FE-Project
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines
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 a 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_XMIN real(RP) 0.0_RP Minimum x-coordinate value of the computational domain
    DOM_XMAX real(RP) 100.0E3_RP Maximum x-coordinate value of the computational domain
    DOM_YMIN real(RP) 0.0_RP Minimum y-coordinate value of the computational domain
    DOM_YMAX real(RP) 100.0E3_RP Maximum y-coordinate value of the computational domain
    DOM_ZMIN real(RP) 0.0_RP Minimum vertical coordinate value of the computational domain
    DOM_ZMAX real(RP) 10.0E3_RP Maximum vertical coordinate value of the computational domain
    FZ real(RP), dimension(FZ_NMAX) Values of the vertically computational coordinate at the element boundaries
    ISPERIODICX logical .true. Flag whether a periodic boundary condition is applied in the x-direction
    ISPERIODICY logical .true. Flag whether a periodic boundary condition is applied in the y-direction
    ISPERIODICZ logical .false. Flag whether a periodic boundary condition is applied in the vertical direction
    NEX integer 2 Number of finite element in the x-direction in each MPI process
    NEY integer 2 Number of finite element in the y-direction in each MPI process
    NEZ integer 2 Number of finite element in the vertical direction in each MPI process
    POLYORDER_H integer 2 Polynomial order for the horizontal direction
    POLYORDER_V integer 2 Polynomial order for the z-direction
    LUMPEDMASSMATFLAG logical .false. Flag whether a mass lumping is applied
    ELEMENT_OPERATION_TYPE character(len=H_SHORT) 'General' General or TensorProd3D
    SPMV_STORAGE_FORMAT character(len=H_SHORT) 'ELL' CSR or ELL
    NPRCX integer 1 Number of MPI process in the x-direction
    NPRCY integer 1 Number of MPI process in the y-direction
    TOPO_IN_BASENAME character(len=H_LONG) '' Basename of the input file
    TOPO_IN_VARNAME character(len=H_MID) 'topo' Variable name of topography in the input file
    VERTICAL_COORD_NAME character(len=H_MID) "TERRAIN_FOLLOWING" Type of the vertical coordinate
    COMM_USE_MPI_PC logical .false. Flag whether persistent communication is used in MPI

History Output
No history output

Function/Subroutine Documentation

◆ atmosmeshrm_init()

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

Initialize a 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
93 real(RP) :: dom_xmax = 100.0e3_rp
94 real(RP) :: dom_ymin = 0.0_rp
95 real(RP) :: dom_ymax = 100.0e3_rp
96 real(RP) :: dom_zmin = 0.0_rp
97 real(RP) :: dom_zmax = 10.0e3_rp
98 logical :: isPeriodicX = .true.
99 logical :: isPeriodicY = .true.
100 logical :: isPeriodicZ = .false.
101
102 integer :: NeX = 2
103 integer :: NeY = 2
104 integer :: NeZ = 2
105 integer :: NprcX = 1
106 integer :: NprcY = 1
107 integer :: PolyOrder_h = 2
108 integer :: PolyOrder_v = 2
109 logical :: LumpedMassMatFlag = .false.
110
111 character(len=H_LONG) :: TOPO_IN_BASENAME = ''
112 character(len=H_MID) :: TOPO_IN_VARNAME = 'topo'
113 character(len=H_MID) :: VERTICAL_COORD_NAME = "TERRAIN_FOLLOWING"
114
115 logical :: COMM_USE_MPI_PC = .false.
116
117 character(len=H_SHORT) :: Element_operation_type = 'General'
118 character(len=H_SHORT) :: SpMV_storage_format = 'ELL'
119
120 integer, parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
121
122 integer, parameter :: FZ_nmax = 1000
123 real(RP) :: FZ(FZ_nmax)
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
140 integer :: k
141 logical :: is_spec_FZ
142
143 integer :: ierr
144
145 type(FILE_base_meshfield) :: file_topo
146 !-------------------------------------------
147
148 log_newline
149 log_info("ATMOS_MESH_setup",*) 'Setup'
150
151 fz(:) = -1.0_rp
152
153 rewind(io_fid_conf)
154 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
155 if( ierr < 0 ) then !--- missing
156 log_info("ATMOS_MESH_setup",*) 'Not found namelist. Default used.'
157 elseif( ierr > 0 ) then !--- fatal error
158 log_error("ATMOS_MESH_setup",*) 'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
159 call prc_abort
160 endif
161 log_nml(param_atmos_mesh)
162
163 !----
164
165 ! Setup the element
166
167 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
168 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
169
170 ! Setup the mesh
171
172 is_spec_fz = .true.
173 do k=1, nez+1
174 if (fz(k) < 0.0_rp) then
175 is_spec_fz = .false.
176 end if
177 end do
178 if (is_spec_fz) then
179 call this%mesh%Init( &
180 nprcx*nex, nprcy*ney, nez, &
181 dom_xmin, dom_xmax,dom_ymin, dom_ymax, dom_zmin, dom_zmax, &
182 isperiodicx, isperiodicy, isperiodicz, &
183 this%element, atmos_mesh_nlocalmeshperprc, nprcx, nprcy, &
184 fz=fz(1:nez+1) )
185 else
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 end if
192
193 call this%mesh%Generate()
194
195 !-
196 call this%AtmosMesh_Init( this%mesh )
197 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
198
199 !- Set topography & vertical coordinate
200
201 if ( topo_in_basename /= '' ) then
202 log_info("ATMOS_MESH_setup",*) 'Read topography data'
203
204 call file_topo%Init(1, mesh2d=this%mesh%mesh2D )
205 call file_topo%Open( topo_in_basename, myrank=prc_myrank )
206 call file_topo%Read_Var( mftype2d_xy, topo_in_varname, this%topography%topo )
207 call file_topo%Close()
208 call file_topo%Final()
209 end if
210
211 this%vcoord_type_id = meshutil_get_vcoord_typeid( vertical_coord_name )
212 call this%Setup_vcoordinate()
213
214 !-
215 this%comm_use_mpi_pc = comm_use_mpi_pc
216
217 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().