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 81 of file mod_atmos_mesh_gm.F90.

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

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().