10#include "scaleFElib.h"
44 procedure :: final => meshtopography_final
45 procedure :: setvcoordinate => meshtopography_set_vcoordinate
69 character(len=*),
intent(in) :: varname
75 call this%topo%Init( varname,
"m", mesh )
77 do n=1, mesh%LOCAL_MESH_NUM
79 this%topo%local(n)%val(:,:) = 0.0_rp
89 subroutine meshtopography_final( this )
95 call this%topo%Final()
97 end subroutine meshtopography_final
101 subroutine meshtopography_set_vcoordinate( this, mesh3D, &
102 vcoord_id, zTop, comm3D, comm2D )
107 class(
meshbase3d),
intent(inout),
target :: mesh3D
108 integer,
intent(in) :: vcoord_id
109 real(RP),
intent(in) :: zTop
124 type(
meshfield3d),
target :: zlev, GsqrtV, G13, G23
127 logical :: flag_covariantvec
130 lcmesh => mesh3d%lcmesh_list(1)
131 lcmesh2d => lcmesh%lcmesh2D
132 call dx2d %Init( lcmesh2d%refElem2D%Dx1 )
133 call dy2d %Init( lcmesh2d%refElem2D%Dx2 )
134 call lift2d%Init( lcmesh2d%refElem2D%Lift )
138 comm2d_varlist(1)%field2d => this%topo
139 call comm2d%Put(comm2d_varlist, 1)
140 call comm2d%Exchange()
141 call comm2d%Get(comm2d_varlist, 1)
145 call zlev%Init(
"zlev",
"", mesh3d )
146 call gsqrtv%Init(
"GsqrtV",
"", mesh3d )
147 call g13%Init(
"G13",
"", mesh3d )
148 call g23%Init(
"G23",
"", mesh3d )
150 call tmp_g13%Init(
"tmp_G13",
"", mesh3d )
151 call tmp_g23%Init(
"tmp_G23",
"", mesh3d )
153 do n=1, mesh3d%LOCAL_MESH_NUM
154 lcmesh => mesh3d%lcmesh_list(n)
155 lcmesh2d => lcmesh%lcmesh2D
157 call calc_vcoordinate_metrics_lc( &
158 g13%local(n)%val, g23%local(n)%val, tmp_g13%local(n)%val, tmp_g23%local(n)%val, &
159 zlev%local(n)%val, gsqrtv%local(n)%val, &
160 this%topo%local(n)%val, ztop, vcoord_id, &
161 lcmesh, lcmesh%refElem3D, lcmesh2d, lcmesh2d%refElem2D, &
162 lcmesh%GIJ(:,:,1,1), lcmesh%GIJ(:,:,1,2), lcmesh%GIJ(:,:,2,1), lcmesh%GIJ(:,:,2,2), &
168 comm3d_varlist(1)%field3d => zlev
169 comm3d_varlist(2)%field3d => gsqrtv
170 comm3d_varlist(3)%field3d => tmp_g13
171 comm3d_varlist(4)%field3d => tmp_g23
173 flag_covariantvec = .false.
176 call comm3d%SetCovariantVec( 1, g13, g23 )
177 flag_covariantvec = .true.
180 call comm3d%Put(comm3d_varlist, 1)
181 call comm3d%Exchange()
182 call comm3d%Get(comm3d_varlist, 1)
186 do n=1, mesh3d%LOCAL_MESH_NUM
187 lcmesh => mesh3d%lcmesh_list(n)
188 elem3d => lcmesh%refElem3D
190 if ( flag_covariantvec )
then
191 call mesh3d%Set_geometric_with_vcoord( n, &
192 gsqrtv%local(n)%val, zlev%local(n)%val, g13%local(n)%val, g23%local(n)%val )
194 call mesh3d%Set_geometric_with_vcoord( n, &
195 gsqrtv%local(n)%val, zlev%local(n)%val, tmp_g13%local(n)%val, tmp_g23%local(n)%val )
212 end subroutine meshtopography_set_vcoordinate
217 subroutine calc_vcoordinate_metrics_lc( G13, G23, tmp_G13, tmp_G23, zlev, GsqrtV, &
218 topo, zTop, vcoord_id, lcmesh, elem3D, lcmesh2D, elem2D, &
219 G11, G12, G21, G22, Dx2D, Dy2D, Lift2D )
227 real(RP),
intent(out) :: G13(elem3D%Np,lcmesh%NeA)
228 real(RP),
intent(out) :: G23(elem3D%Np,lcmesh%NeA)
229 real(RP),
intent(out) :: tmp_G13(elem3D%Np,lcmesh%NeA)
230 real(RP),
intent(out) :: tmp_G23(elem3D%Np,lcmesh%NeA)
231 real(RP),
intent(out) :: zlev(elem3D%Np,lcmesh%NeA)
232 real(RP),
intent(out) :: GsqrtV(elem3D%Np,lcmesh%NeA)
233 real(RP),
intent(in) :: topo(elem2D%Np,lcmesh2D%NeA)
234 real(RP),
intent(in) :: zTop
235 integer,
intent(in) :: vcoord_id
236 real(RP),
intent(in) :: G11(elem2D%Np,lcmesh2D%Ne)
237 real(RP),
intent(in) :: G12(elem2D%Np,lcmesh2D%Ne)
238 real(RP),
intent(in) :: G21(elem2D%Np,lcmesh2D%Ne)
239 real(RP),
intent(in) :: G22(elem2D%Np,lcmesh2D%Ne)
240 type(
sparsemat),
intent(in) :: Dx2D, Dy2D, Lift2D
242 integer :: IndexH2Dto3D(elem3D%Np)
243 integer :: ke, ke2D, p
247 g13, g23, zlev, gsqrtv, &
248 topo, ztop, vcoord_id, &
249 lcmesh, lcmesh%refElem3D, lcmesh2d, lcmesh2d%refElem2D, &
252 indexh2dto3d(:) = elem3d%IndexH2Dto3D(:)
256 do ke=lcmesh%NeS, lcmesh%NeE
258 ke2d = lcmesh%EMap3Dto2D(ke)
259 tmp_g13(p,ke) = g11(indexh2dto3d(p),ke2d) * g13(p,ke) + g12(indexh2dto3d(p),ke2d) * g23(p,ke)
260 tmp_g23(p,ke) = g21(indexh2dto3d(p),ke2d) * g13(p,ke) + g22(indexh2dto3d(p),ke2d) * g23(p,ke)
264 end subroutine calc_vcoordinate_metrics_lc
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)
Get metric terms of vertical coordinate transformation.
Module common / sparsemat.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Derived type to manage topography datat and setup vertical coordinate metric.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Base derived type to manage data communication.
Container to save a pointer of MeshField(1D, 2D, 3D) object.
Base derived type to manage data communication with 3D cubed-sphere domain.
Derived type to manage a sparse matrix.