23 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
26 Real dz = z_phys_nd(i,j,1) - z_phys_nd(i,j,0);
27 Real ls_mask = (surface_state_arr(i-1,j,0)+surface_state_arr(i,j,0))/2.0;
29 Real fac = k==0? 1.0 : 0.0;
30 Real Cd = fac*Cd_sea*(1.0-ls_mask) + Cd_land*ls_mask;
31 Real rho_for_u = (cons_state(i-1,j,k,0)+cons_state(i,j,k,0))/2.0;
32 Real rho_for_v = (cons_state(i,j-1,k,0)+cons_state(i,j,k,0))/2.0;
33 Real uvel = rho_u(i,j,k)/rho_for_u;
34 Real vvel = rho_v(i,j,k)/rho_for_v;
35 Real velmag = std::sqrt(uvel*uvel + vvel*vvel);
36 rho_u_rhs(i, j, k) += -1.0*weight*Cd*velmag*rho_for_u*uvel/dz;
41 ParallelFor(tby, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
44 Real dz = z_phys_nd(i,j,1) - z_phys_nd(i,j,0);
45 Real ls_mask = (surface_state_arr(i,j-1,0)+surface_state_arr(i,j,0))/2.0;
46 Real fac = k==0? 1.0 : 0.0;
47 Real Cd = fac*Cd_sea*(1.0-ls_mask) + Cd_land*ls_mask;
49 Real rho_for_u = (cons_state(i-1,j,k,0)+cons_state(i,j,k,0))/2.0;
50 Real rho_for_v = (cons_state(i,j-1,k,0)+cons_state(i,j,k,0))/2.0;
51 Real uvel = rho_u(i,j,k)/rho_for_u;
52 Real vvel = rho_v(i,j,k)/rho_for_v;
53 Real velmag = std::sqrt(uvel*uvel + vvel*vvel);
54 rho_v_rhs(i, j, k) += -1.0*weight*Cd*velmag*rho_for_v*vvel/dz;