81 h_dt, U_dt, V_dt, & ! (out)
82 h_, u_, v_, hs_, u1_, u2_, coriolis, &
83 dx, dy, sx, sy, lift, lmesh, elem )
89 type(
sparsemat),
intent(in) :: dx, dy, sx, sy, lift
90 real(rp),
intent(out) :: h_dt(elem%np,lmesh%nea)
91 real(rp),
intent(out) :: u_dt(elem%np,lmesh%nea)
92 real(rp),
intent(out) :: v_dt(elem%np,lmesh%nea)
93 real(rp),
intent(in) :: h_(elem%np,lmesh%nea)
94 real(rp),
intent(in) :: u_(elem%np,lmesh%nea)
95 real(rp),
intent(in) :: v_(elem%np,lmesh%nea)
96 real(rp),
intent(in) :: hs_(elem%np,lmesh%nea)
97 real(rp),
intent(in) :: u1_(elem%np,lmesh%nea)
98 real(rp),
intent(in) :: u2_(elem%np,lmesh%nea)
99 real(rp),
intent(in) :: coriolis(elem%np,lmesh%nea)
101 real(rp) :: fx(elem%np), fy(elem%np), liftdelflx(elem%np)
102 real(rp) :: del_flux(elem%nfptot,lmesh%ne,prog_vars_num)
103 real(rp) :: del_flux_aux(elem%nfptot,lmesh%ne,1)
104 real(rp) :: u1_dt(elem%np), u2_dt(elem%np)
105 real(rp) :: vor(elem%np), e(elem%np)
109 call prof_rapstart(
'cal_dyn_tend_bndflux', 3)
110 call cal_del_flux_dyn( del_flux, del_flux_aux, &
111 h_, u_, v_, hs_, u1_, u2_, &
112 lmesh%Gsqrt, lmesh%GIJ(:,:,1,1), lmesh%GIJ(:,:,2,2), &
113 lmesh%normal_fn(:,:,1), lmesh%normal_fn(:,:,2), &
114 lmesh%vmapM, lmesh%vmapP, &
116 call prof_rapend(
'cal_dyn_tend_bndflux', 3)
119 call prof_rapstart(
'cal_dyn_tend_interior', 3)
124 do ke = lmesh%NeS, lmesh%NeE
128 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux_aux(:,ke,1), liftdelflx)
131 lmesh%Escale(:,ke,1,1) * fx(:) &
132 - lmesh%Escale(:,ke,2,2) * fy(:) &
133 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
135 e(:) = grav * ( hs_(:,ke) + h_(:,ke) ) &
136 + 0.5_rp * ( u1_(:,ke) * u_(:,ke) + u2_(:,ke) * v_(:,ke) )
141 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,vars_h_id), liftdelflx)
144 lmesh%Escale(:,ke,1,1) * fx(:) &
145 + lmesh%Escale(:,ke,2,2) * fy(:) &
146 + liftdelflx(:) ) / lmesh%Gsqrt(:,ke)
150 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,vars_u1_id), liftdelflx)
153 lmesh%Escale(:,ke,1,1) * fx(:) &
155 - lmesh%Gsqrt(:,ke) * ( coriolis(:,ke) + vor(:) ) * v_(:,ke) )
159 call sparsemat_matmul(lift, lmesh%Fscale(:,ke) * del_flux(:,ke,vars_u2_id), liftdelflx)
162 lmesh%Escale(:,ke,2,2) * fy(:) &
164 + lmesh%Gsqrt(:,ke) * ( coriolis(:,ke) + vor(:) ) * u_(:,ke) )
167 u_dt(:,ke) = lmesh%GIJ(:,ke,1,1) * u1_dt(:) + lmesh%GIJ(:,ke,1,2) * u2_dt(:)
168 v_dt(:,ke) = lmesh%GIJ(:,ke,2,1) * u1_dt(:) + lmesh%GIJ(:,ke,2,2) * u2_dt(:)
171 call prof_rapend(
'cal_dyn_tend_interior', 3)