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.

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