80 topo, zTop, vcoord_id, lcmesh, elem, lcmesh2D, elem2D, &
88 real(rp),
intent(out) :: g13(elem%np,lcmesh%nea)
89 real(rp),
intent(out) :: g23(elem%np,lcmesh%nea)
90 real(rp),
intent(out) :: zlev(elem%np,lcmesh%nea)
91 real(rp),
intent(inout) :: gsqrtv(elem%np,lcmesh%nea)
92 real(rp),
intent(in) :: topo(elem2d%np,lcmesh2d%nea)
93 integer,
intent(in) :: vcoord_id
94 real(rp),
intent(in) :: ztop
100 real(rp) :: del_flux(elem2d%nfptot,lcmesh2d%ne,2)
101 real(rp) :: fx2d(elem2d%np), fy2d(elem2d%np), liftdelflux2d(elem2d%np)
102 real(rp) :: gradzs(elem2d%np,lcmesh2d%ne,2)
103 real(rp) :: coef3d(elem%np)
114 call cal_del_flux( del_flux, &
115 topo, lcmesh2d%normal_fn(:,:,1), lcmesh2d%normal_fn(:,:,2), &
116 lcmesh2d%VMapM, lcmesh2d%VMapP, lcmesh2d, elem2d )
122 do ke2d=1, lcmesh2d%Ne
124 call sparsemat_matmul( lift2d, lcmesh2d%Fscale(:,ke2d) * del_flux(:,ke2d,1), liftdelflux2d)
125 gradzs(:,ke2d,1) = lcmesh2d%Escale(:,ke2d,1,1) * fx2d(:) + liftdelflux2d(:)
128 call sparsemat_matmul( lift2d, lcmesh2d%Fscale(:,ke2d) * del_flux(:,ke2d,2), liftdelflux2d)
129 gradzs(:,ke2d,2) = lcmesh2d%Escale(:,ke2d,2,2) * fy2d(:) + liftdelflux2d(:)
135 ke2d = lcmesh%EMap3Dto2D(ke)
136 coef3d(:) = 1.0_rp - lcmesh%pos_en(:,ke,3) / ztop
137 zlev(:,ke) = lcmesh%pos_en(:,ke,3) &
138 + coef3d(:) * topo(elem%IndexH2Dto3D,ke2d)
140 gsqrtv(:,ke) = 1.0_rp - topo(elem%IndexH2Dto3D,ke2d) / ztop
141 coef3d(:) = - coef3d(:) / gsqrtv(:,ke)
142 g13(:,ke) = coef3d(:) * gradzs(elem%IndexH2Dto3D(:),ke2d,1)
143 g23(:,ke) = coef3d(:) * gradzs(elem%IndexH2Dto3D(:),ke2d,2)
148 log_error(
"Mesh_VCoord_GetMetric",*)
"vcoord_id is inappropriate. Check!", vcoord_id
subroutine, public meshutil_vcoord_getmetric(g13, g23, zlev, gsqrtv, topo, ztop, vcoord_id, lcmesh, elem, lcmesh2d, elem2d, dx2d, dy2d, lift2d)