FE-Project
Loading...
Searching...
No Matches
mod_atmos_mesh_gm Module Reference

module Atmosphere / Mesh More...

Data Types

type  atmosmeshgm
 Derived type to manage a computational mesh of global atmospheric model. More...

Functions/Subroutines

subroutine atmosmeshgm_init (this)
 Initialize an object to manage computational mesh.

Detailed Description

module Atmosphere / Mesh

Description
Module for mesh with atmospheric global model
Author
Yuta kawai, Team SCALE
NAMELIST
  • PARAM_ATMOS_MESH
    nametypedefault valuecomment
    SHALLOW_ATM_APPROX_FLAGlogical.true.Flag whether the shallow atmosphere approximation is applied
    DOM_ZMINreal(RP)0.0_RPMinimum vertical coordinate value of the computational domain
    DOM_ZMAXreal(RP)10.0E3_RPMaximum vertical coordinate value of the computational domain
    FZreal(RP), dimension(FZ_NMAX)Values of the vertically computational coordinate at the element boundaries
    ISPERIODICZlogical.false.Flag whether a periodic boundary condition is applied in the vertical direction
    NEGXinteger2Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
    NEGYinteger2Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
    NEZinteger2Number of finite element in the vertical direction in each MPI process
    NLOCALMESHPERPRCinteger6Number of local mesh per MPI process
    NPRCinteger1Total number of MPI process
    POLYORDER_Hinteger2Polynomial order for the horizontal direction
    POLYORDER_Vinteger2Polynomial order for the z-direction
    LUMPEDMASSMATFLAGlogical.false.Flag whether a mass lumping is applied
    ELEMENT_OPERATION_TYPEcharacter(len=H_SHORT)'General'General or TensorProd3D
    SPMV_STORAGE_FORMATcharacter(len=H_SHORT)'ELL'CSR or ELL
    VERTICAL_COORD_NAMEcharacter(len=H_MID)"TERRAIN_FOLLOWING"Type of the vertical coordinate
    TOPO_IN_BASENAMEcharacter(len=H_LONG)''Basename of the input file
    TOPO_IN_VARNAMEcharacter(len=H_MID)'topo'Variable name of topography in the input file
    COMM_USE_MPI_PClogical.false.Flag whether persistent communication is used in MPI
    COMM_USE_MPI_PC_FUJITSU_EXTlogical

History Output
No history output

Function/Subroutine Documentation

◆ atmosmeshgm_init()

subroutine mod_atmos_mesh_gm::atmosmeshgm_init ( class(atmosmeshgm), intent(inout), target this)

Initialize an object to manage computational mesh.

Definition at line 82 of file mod_atmos_mesh_gm.F90.

83 use scale_const, only: &
84 rplanet => const_radius
85 use scale_mesh_base2d, only: &
86 mftype2d_xy => meshbase2d_dimtypeid_xy
87 use scale_meshutil_vcoord, only: &
89
90 implicit none
91 class(AtmosMeshGM), target, intent(inout) :: this
92
93 real(RP) :: dom_zmin = 0.0_rp !< Minimum vertical coordinate value of the computational domain
94 real(RP) :: dom_zmax = 10.0e3_rp !< Maximum vertical coordinate value of the computational domain
95 logical :: isPeriodicZ = .false. !< Flag whether a periodic boundary condition is applied in the vertical direction
96
97 integer, parameter :: FZ_nmax = 1000
98 real(RP) :: FZ(FZ_nmax) !< Values of the vertically computational coordinate at the element boundaries
99
100 !* Global
101 logical :: SHALLOW_ATM_APPROX_FLAG = .true. !< Flag whether the shallow atmosphere approximation is applied
102 integer :: NeGX = 2 !< Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
103 integer :: NeGY = 2 !< Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
104 integer :: NeZ = 2 !< Number of finite element in the vertical direction in each MPI process
105 integer :: NLocalMeshPerPrc = 6 !< Number of local mesh per MPI process
106 integer :: Nprc = 1 !< Total number of MPI process
107 integer :: PolyOrder_h = 2 !< Polynomial order for the horizontal direction
108 integer :: PolyOrder_v = 2 !< Polynomial order for the z-direction
109 logical :: LumpedMassMatFlag = .false. !< Flag whether a mass lumping is applied
110
111 character(len=H_LONG) :: TOPO_IN_BASENAME = '' !< Basename of the input file
112 character(len=H_MID) :: TOPO_IN_VARNAME = 'topo' !< Variable name of topography in the input file
113 character(len=H_MID) :: VERTICAL_COORD_NAME = "TERRAIN_FOLLOWING" !< Type of the vertical coordinate
114
115 logical :: COMM_USE_MPI_PC = .false. !< Flag whether persistent communication is used in MPI
116 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
117
118 character(len=H_SHORT) :: Element_operation_type = 'General' !< General or TensorProd3D
119 character(len=H_SHORT) :: SpMV_storage_format = 'ELL' !< CSR or ELL
120
121 namelist / param_atmos_mesh / &
122 shallow_atm_approx_flag, &
123 dom_zmin, dom_zmax, &
124 fz, isperiodicz, &
125 negx, negy, nez, nlocalmeshperprc, nprc, &
126 polyorder_h, polyorder_v, lumpedmassmatflag, &
127 element_operation_type, &
128 spmv_storage_format, &
129 vertical_coord_name, &
130 topo_in_basename, topo_in_varname, &
131 comm_use_mpi_pc, &
132 comm_use_mpi_pc_fujitsu_ext
133
134 integer :: k
135 logical :: is_spec_FZ
136
137 integer :: ierr
138
139 type(FILE_base_meshfield) :: file_topo
140 !-------------------------------------------
141
142 log_newline
143 log_info("ATMOS_MESH_setup",*) 'Setup'
144
145 fz(:) = -1.0_rp
146#ifdef __FUJITSU
147 comm_use_mpi_pc_fujitsu_ext = .true.
148#else
149 comm_use_mpi_pc_fujitsu_ext = .false.
150#endif
151
152 rewind(io_fid_conf)
153 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
154 if( ierr < 0 ) then !--- missing
155 log_info("ATMOS_MESH_setup",*) 'Not found namelist. Default used.'
156 elseif( ierr > 0 ) then !--- fatal error
157 log_error("ATMOS_MESH_setup",*) 'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
158 call prc_abort
159 endif
160 log_nml(param_atmos_mesh)
161
162 !----
163
164 !- Setup the element
165
166 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
167 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
168
169 !- Setup the mesh
170
171 is_spec_fz = .true.
172 do k=1, nez+1
173 if (fz(k) < 0.0_rp) then
174 is_spec_fz = .false.
175 end if
176 end do
177 if (is_spec_fz) then
178 call this%mesh%Init( &
179 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
180 this%element, nlocalmeshperprc, nproc=nprc, &
181 fz=fz(1:nez+1), shallow_approx=shallow_atm_approx_flag )
182 else
183 call this%mesh%Init( &
184 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
185 this%element, nlocalmeshperprc, nproc=nprc, &
186 shallow_approx=shallow_atm_approx_flag )
187 end if
188
189 call this%mesh%Generate()
190
191 !-
192
193 call this%AtmosMesh_Init( this%mesh )
194 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
195
196 !- Set topography & vertical coordinate
197
198 if ( topo_in_basename /= '' ) then
199 log_info("ATMOS_MESH_setup",*) 'Read topography data'
200
201 call file_topo%Init(1, meshcubedsphere2d=this%mesh%mesh2D )
202 call file_topo%Open( topo_in_basename, myrank=prc_myrank )
203 call file_topo%Read_Var( mftype2d_xy, topo_in_varname, this%topography%topo )
204 call file_topo%Close()
205 call file_topo%Final()
206 end if
207
208 this%vcoord_type_id = meshutil_get_vcoord_typeid( vertical_coord_name )
209 call this%Setup_vcoordinate()
210
211 !-
212 this%comm_use_mpi_pc = comm_use_mpi_pc
213 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
214
215 return
module FElib / Mesh / Base 2D
integer, public meshbase2d_dimtypeid_xy
module FElib / Mesh / utility for general vertical coordinate
integer function, public meshutil_get_vcoord_typeid(vcoord_type)

References mod_atmos_mesh::atm_mesh_max_commnuicator_num, scale_cubedsphere_coord_cnv::cubedspherecoordcnv_cs2lonlatvec(), scale_mesh_base2d::meshbase2d_dimtypeid_xy, and scale_meshutil_vcoord::meshutil_get_vcoord_typeid().