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

module Atmosphere / Mesh More...

Data Types

type  atmosmeshrm
 Derived type to manage a computational mesh of regional atmospheric model. More...

Functions/Subroutines

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

Detailed Description

module Atmosphere / Mesh

Description
Module for mesh with atmospheric regional model
Author
Yuta kawai, Team SCALE
NAMELIST
  • PARAM_ATMOS_MESH
    nametypedefault valuecomment
    DOM_XMINreal(RP)0.0_RPMinimum x-coordinate value of the computational domain
    DOM_XMAXreal(RP)100.0E3_RPMaximum x-coordinate value of the computational domain
    DOM_YMINreal(RP)0.0_RPMinimum y-coordinate value of the computational domain
    DOM_YMAXreal(RP)100.0E3_RPMaximum y-coordinate value of the computational domain
    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
    ISPERIODICXlogical.true.Flag whether a periodic boundary condition is applied in the x-direction
    ISPERIODICYlogical.true.Flag whether a periodic boundary condition is applied in the y-direction
    ISPERIODICZlogical.false.Flag whether a periodic boundary condition is applied in the vertical direction
    NEXinteger2Number of finite element in the x-direction in each MPI process
    NEYinteger2Number of finite element in the y-direction in each MPI process
    NEZinteger2Number of finite element in the vertical direction in each 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'Storage format of sparse matrix (CSR or ELL)
    NPRCXinteger1Number of MPI process in the x-direction
    NPRCYinteger1Number of MPI process in the y-direction
    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
    VERTICAL_COORD_NAMEcharacter(len=H_MID)"TERRAIN_FOLLOWING"Type of the vertical coordinate
    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

◆ atmosmeshrm_init()

subroutine mod_atmos_mesh_rm::atmosmeshrm_init ( class(atmosmeshrm), intent(inout), target this)

Initialize an object to manage computational mesh.

Definition at line 82 of file mod_atmos_mesh_rm.F90.

84 use scale_mesh_base2d, only: &
85 mftype2d_xy => meshbase2d_dimtypeid_xy
86 use scale_meshutil_vcoord, only: &
88
89 implicit none
90 class(AtmosMeshRM), target, intent(inout) :: this
91
92 real(RP) :: dom_xmin = 0.0_rp !< Minimum x-coordinate value of the computational domain
93 real(RP) :: dom_xmax = 100.0e3_rp !< Maximum x-coordinate value of the computational domain
94 real(RP) :: dom_ymin = 0.0_rp !< Minimum y-coordinate value of the computational domain
95 real(RP) :: dom_ymax = 100.0e3_rp !< Maximum y-coordinate value of the computational domain
96 real(RP) :: dom_zmin = 0.0_rp !< Minimum vertical coordinate value of the computational domain
97 real(RP) :: dom_zmax = 10.0e3_rp !< Maximum vertical coordinate value of the computational domain
98 logical :: isPeriodicX = .true. !< Flag whether a periodic boundary condition is applied in the x-direction
99 logical :: isPeriodicY = .true. !< Flag whether a periodic boundary condition is applied in the y-direction
100 logical :: isPeriodicZ = .false. !< Flag whether a periodic boundary condition is applied in the vertical direction
101
102 integer :: NeX = 2 !< Number of finite element in the x-direction in each MPI process
103 integer :: NeY = 2 !< Number of finite element in the y-direction in each MPI process
104 integer :: NeZ = 2 !< Number of finite element in the vertical direction in each MPI process
105 integer :: NprcX = 1 !< Number of MPI process in the x-direction
106 integer :: NprcY = 1 !< Number of MPI process in the y-direction
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' !< Storage format of sparse matrix (CSR or ELL)
120
121 integer, parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
122
123 integer, parameter :: FZ_nmax = 1000
124 real(RP) :: FZ(FZ_nmax) !< Values of the vertically computational coordinate at the element boundaries
125
126 namelist / param_atmos_mesh / &
127 dom_xmin, dom_xmax, &
128 dom_ymin, dom_ymax, &
129 dom_zmin, dom_zmax, &
130 fz, &
131 isperiodicx, isperiodicy, isperiodicz, &
132 nex, ney, nez, &
133 polyorder_h, polyorder_v, lumpedmassmatflag, &
134 element_operation_type, &
135 spmv_storage_format, &
136 nprcx, nprcy, &
137 topo_in_basename, topo_in_varname, &
138 vertical_coord_name, &
139 comm_use_mpi_pc, &
140 comm_use_mpi_pc_fujitsu_ext
141
142 integer :: k
143 logical :: is_spec_FZ
144
145 integer :: ierr
146
147 type(FILE_base_meshfield) :: file_topo
148 !-------------------------------------------
149
150 log_newline
151 log_info("ATMOS_MESH_setup",*) 'Setup'
152
153 fz(:) = -1.0_rp
154#ifdef __FUJITSU
155 comm_use_mpi_pc_fujitsu_ext = .true.
156#else
157 comm_use_mpi_pc_fujitsu_ext = .false.
158#endif
159
160 rewind(io_fid_conf)
161 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
162 if( ierr < 0 ) then !--- missing
163 log_info("ATMOS_MESH_setup",*) 'Not found namelist. Default used.'
164 elseif( ierr > 0 ) then !--- fatal error
165 log_error("ATMOS_MESH_setup",*) 'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
166 call prc_abort
167 endif
168 log_nml(param_atmos_mesh)
169
170 !----
171
172 ! Setup the element
173
174 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
175 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
176
177 ! Setup the mesh
178
179 is_spec_fz = .true.
180 do k=1, nez+1
181 if (fz(k) < 0.0_rp) then
182 is_spec_fz = .false.
183 end if
184 end do
185 if (is_spec_fz) then
186 call this%mesh%Init( &
187 nprcx*nex, nprcy*ney, nez, &
188 dom_xmin, dom_xmax,dom_ymin, dom_ymax, dom_zmin, dom_zmax, &
189 isperiodicx, isperiodicy, isperiodicz, &
190 this%element, atmos_mesh_nlocalmeshperprc, nprcx, nprcy, &
191 fz=fz(1:nez+1) )
192 else
193 call this%mesh%Init( &
194 nprcx*nex, nprcy*ney, nez, &
195 dom_xmin, dom_xmax,dom_ymin, dom_ymax, dom_zmin, dom_zmax, &
196 isperiodicx, isperiodicy, isperiodicz, &
197 this%element, atmos_mesh_nlocalmeshperprc, nprcx, nprcy )
198 end if
199
200 call this%mesh%Generate()
201
202 !-
203 call this%AtmosMesh_Init( this%mesh )
204 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
205
206 !- Set topography & vertical coordinate
207
208 if ( topo_in_basename /= '' ) then
209 log_info("ATMOS_MESH_setup",*) 'Read topography data'
210
211 call file_topo%Init(1, mesh2d=this%mesh%mesh2D )
212 call file_topo%Open( topo_in_basename, myrank=prc_myrank )
213 call file_topo%Read_Var( mftype2d_xy, topo_in_varname, this%topography%topo )
214 call file_topo%Close()
215 call file_topo%Final()
216 end if
217
218 this%vcoord_type_id = meshutil_get_vcoord_typeid( vertical_coord_name )
219 call this%Setup_vcoordinate()
220
221 !-
222 this%comm_use_mpi_pc = comm_use_mpi_pc
223 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
224
225 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_mesh_base2d::meshbase2d_dimtypeid_xy, and scale_meshutil_vcoord::meshutil_get_vcoord_typeid().