10#include "scaleFElib.h"
41 procedure :: final => meshtopography_final
42 procedure :: setvcoordinate => meshtopography_set_vcoordinate
66 character(len=*),
intent(in) :: varname
72 call this%topo%Init( varname,
"m", mesh )
74 do n=1, mesh%LOCAL_MESH_NUM
76 this%topo%local(n)%val(:,:) = 0.0_rp
84 subroutine meshtopography_final( this )
90 call this%topo%Final()
93 end subroutine meshtopography_final
96 subroutine meshtopography_set_vcoordinate( this, mesh3D, &
97 vcoord_id, zTop, comm3D, comm2D )
105 class(
meshbase3d),
intent(inout),
target :: mesh3D
106 integer,
intent(in) :: vcoord_id
107 real(RP),
intent(in) :: zTop
122 type(
meshfield3d),
target :: zlev, GsqrtV, G13, G23
125 logical :: flag_covariantvec
128 lcmesh => mesh3d%lcmesh_list(1)
129 lcmesh2d => lcmesh%lcmesh2D
130 call dx2d %Init( lcmesh2d%refElem2D%Dx1 )
131 call dy2d %Init( lcmesh2d%refElem2D%Dx2 )
132 call lift2d%Init( lcmesh2d%refElem2D%Lift )
136 comm2d_varlist(1)%field2d => this%topo
137 call comm2d%Put(comm2d_varlist, 1)
138 call comm2d%Exchange()
139 call comm2d%Get(comm2d_varlist, 1)
143 call zlev%Init(
"zlev",
"", mesh3d )
144 call gsqrtv%Init(
"GsqrtV",
"", mesh3d )
145 call g13%Init(
"G13",
"", mesh3d )
146 call g23%Init(
"G23",
"", mesh3d )
148 call tmp_g13%Init(
"tmp_G13",
"", mesh3d )
149 call tmp_g23%Init(
"tmp_G23",
"", mesh3d )
151 do n=1, mesh3d%LOCAL_MESH_NUM
152 lcmesh => mesh3d%lcmesh_list(n)
153 lcmesh2d => lcmesh%lcmesh2D
154 elem3d => lcmesh%refElem3D
157 g13%local(n)%val, g23%local(n)%val, zlev%local(n)%val, &
158 gsqrtv%local(n)%val, &
159 this%topo%local(n)%val(:,:), ztop, vcoord_id, &
160 lcmesh, lcmesh%refElem3D, lcmesh2d, lcmesh2d%refElem2D, &
164 do ke=lcmesh%NeS, lcmesh%NeE
165 ke2d = lcmesh%EMap3Dto2D(ke)
166 tmp_g13%local(n)%val(:,ke) = &
167 lcmesh%GIJ(elem3d%IndexH2Dto3D(:),ke2d,1,1) * g13%local(n)%val(:,ke) &
168 + lcmesh%GIJ(elem3d%IndexH2Dto3D(:),ke2d,1,2) * g23%local(n)%val(:,ke)
169 tmp_g23%local(n)%val(:,ke) = &
170 lcmesh%GIJ(elem3d%IndexH2Dto3D(:),ke2d,2,1) * g13%local(n)%val(:,ke) &
171 + lcmesh%GIJ(elem3d%IndexH2Dto3D(:),ke2d,2,2) * g23%local(n)%val(:,ke)
177 comm3d_varlist(1)%field3d => zlev
178 comm3d_varlist(2)%field3d => gsqrtv
179 comm3d_varlist(3)%field3d => tmp_g13
180 comm3d_varlist(4)%field3d => tmp_g23
182 flag_covariantvec = .false.
185 call comm3d%SetCovariantVec( 1, g13, g23 )
186 flag_covariantvec = .true.
189 call comm3d%Put(comm3d_varlist, 1)
190 call comm3d%Exchange()
191 call comm3d%Get(comm3d_varlist, 1)
195 do n=1, mesh3d%LOCAL_MESH_NUM
196 lcmesh => mesh3d%lcmesh_list(n)
197 elem3d => lcmesh%refElem3D
199 if ( flag_covariantvec )
then
200 call mesh3d%Set_geometric_with_vcoord( n, &
201 gsqrtv%local(n)%val, zlev%local(n)%val, g13%local(n)%val, g23%local(n)%val )
203 call mesh3d%Set_geometric_with_vcoord( n, &
204 gsqrtv%local(n)%val, zlev%local(n)%val, tmp_g13%local(n)%val, tmp_g23%local(n)%val )
221 end subroutine meshtopography_set_vcoordinate
223end module scale_mesh_topography
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Topography
subroutine meshtopography_init(this, varname, mesh)
module FElib / Data / base
module FElib / Data / Communication base
module FElib / Data / Communication in 3D cubed-sphere domain
module FElib / Mesh / utility for general vertical coordinate
subroutine, public meshutil_vcoord_getmetric(g13, g23, zlev, gsqrtv, topo, ztop, vcoord_id, lcmesh, elem, lcmesh2d, elem2d, dx2d, dy2d, lift2d)
module common / sparsemat
Base derived type to manage data communication.