11#include "scaleFElib.h"
52 procedure :: final => atmosmeshrm_final
53 procedure :: create_communicator => atmosmeshrm_create_communicator
54 procedure :: setup_restartfile1 => atmosmeshrm_setup_restartfile1
55 procedure :: setup_restartfile2 => atmosmeshrm_setup_restartfile2
56 procedure :: calc_uvmet => atmosmeshrm_calc_uvmet
57 procedure :: setup_vcoordinate => atmosmeshrm_setup_vcoordinate
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.
107 integer :: PolyOrder_h = 2
108 integer :: PolyOrder_v = 2
109 logical :: LumpedMassMatFlag = .false.
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"
115 logical :: COMM_USE_MPI_PC = .false.
116 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
118 character(len=H_SHORT) :: Element_operation_type =
'General'
119 character(len=H_SHORT) :: SpMV_storage_format =
'ELL'
121 integer,
parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
123 integer,
parameter :: FZ_nmax = 1000
124 real(RP) :: FZ(FZ_nmax)
126 namelist / param_atmos_mesh / &
127 dom_xmin, dom_xmax, &
128 dom_ymin, dom_ymax, &
129 dom_zmin, dom_zmax, &
131 isperiodicx, isperiodicy, isperiodicz, &
133 polyorder_h, polyorder_v, lumpedmassmatflag, &
134 element_operation_type, &
135 spmv_storage_format, &
137 topo_in_basename, topo_in_varname, &
138 vertical_coord_name, &
140 comm_use_mpi_pc_fujitsu_ext
143 logical :: is_spec_FZ
151 log_info(
"ATMOS_MESH_setup",*)
'Setup'
155 comm_use_mpi_pc_fujitsu_ext = .true.
157 comm_use_mpi_pc_fujitsu_ext = .false.
161 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
163 log_info(
"ATMOS_MESH_setup",*)
'Not found namelist. Default used.'
164 elseif( ierr > 0 )
then
165 log_error(
"ATMOS_MESH_setup",*)
'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
168 log_nml(param_atmos_mesh)
174 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
175 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
181 if (fz(k) < 0.0_rp)
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, &
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 )
200 call this%mesh%Generate()
203 call this%AtmosMesh_Init( this%mesh )
204 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
208 if ( topo_in_basename /=
'' )
then
209 log_info(
"ATMOS_MESH_setup",*)
'Read topography data'
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()
219 call this%Setup_vcoordinate()
222 this%comm_use_mpi_pc = comm_use_mpi_pc
223 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
230 subroutine atmosmeshrm_final(this)
237 do commid=1, this%communicator_num
238 call this%comm_list(commid)%Final()
241 call this%mesh%Final()
242 call this%AtmosMesh_Final()
245 end subroutine atmosmeshrm_final
249 subroutine atmosmeshrm_create_communicator( this, sfield_num, hvfield_num, htensorfield_num, &
250 var_manager, field_list, commid )
253 integer,
intent(in) :: sfield_num
254 integer,
intent(in) :: hvfield_num
255 integer,
intent(in) :: htensorfield_num
258 integer,
intent(out) :: commid
262 call this%comm_list(commid)%Init( sfield_num, hvfield_num, htensorfield_num, this%mesh )
263 if ( this%comm_use_mpi_pc )
then
264 call this%comm_list(commid)%Prepare_PC( this%comm_use_mpi_pc_fujitsu_ext )
266 call var_manager%MeshFieldComm_Prepare( this%comm_list(commid), field_list )
269 end subroutine atmosmeshrm_create_communicator
271 subroutine atmosmeshrm_setup_restartfile1( this, restart_file, var_num )
275 integer,
intent(in) :: var_num
278 call restart_file%Init(
'ATMOS', var_num, mesh3d=this%mesh )
280 end subroutine atmosmeshrm_setup_restartfile1
282 subroutine atmosmeshrm_setup_restartfile2( this, restart_file, &
283 in_basename, in_postfix_timelabel, &
284 out_basename, out_postfix_timelabel, &
285 out_dtype, out_title, var_num )
289 character(*),
intent(in) :: in_basename
290 logical,
intent(in) :: in_postfix_timelabel
291 character(*),
intent(in) :: out_basename
292 logical,
intent(in) :: out_postfix_timelabel
293 character(*),
intent(in) :: out_title
294 character(*),
intent(in) :: out_dtype
295 integer,
intent(in) :: var_num
298 call restart_file%Init(
'ATMOS', in_basename, in_postfix_timelabel, &
299 out_basename, out_postfix_timelabel, out_dtype, out_title, var_num, &
303 end subroutine atmosmeshrm_setup_restartfile2
305 subroutine atmosmeshrm_calc_uvmet( this, U, V, &
319 do n=1, this%mesh%LOCAL_MESH_NUM
320 lcmesh => this%mesh%lcmesh_list(n)
322 do ke=lcmesh%NeS, lcmesh%NeE
323 umet%local(n)%val(:,ke) = u%local(n)%val(:,ke)
324 vmet%local(n)%val(:,ke) = v%local(n)%val(:,ke)
329 end subroutine atmosmeshrm_calc_uvmet
332 subroutine atmosmeshrm_setup_vcoordinate( this )
341 call comm2d%Init( 1, 0, 0, this%mesh%mesh2D )
342 call comm3d%Init( 2, 1, 0, this%mesh )
344 call this%topography%SetVCoordinate( this%ptr_mesh, &
345 this%vcoord_type_id, this%mesh%zmax_gl, comm3d, comm2d )
351 end SUBROUTINE atmosmeshrm_setup_vcoordinate
subroutine atmosmeshrm_init(this)
Initialize an object to manage computational mesh.
integer, parameter, public atm_mesh_max_commnuicator_num
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / File / Base
module FElib / File / Restart
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 2D
integer, public meshbase2d_dimtypeid_xy
module FElib / Mesh / Base 3D
module FElib / Mesh / Cubic 3D domain
module FElib / Data / base
module FElib / Data / Communication 3D cubic domain
module FElib / Data / Communication 2D rectangle domain
module FElib / Mesh / utility for general vertical coordinate
integer function, public meshutil_get_vcoord_typeid(vcoord_type)
FElib / model framework / mesh manager.
FElib / model framework / variable manager.
Module common / sparsemat.
Derived type to manage a computational mesh (base class)
Derived type to manage a computational mesh of regional atmospheric model.
Derived type representing a 3D reference element.
Derived type representing a hexahedral element.
Derived type to manage a local 3D computational domain.
Derived type representing a field with 3D mesh.
Base derived type to manage data communication with 3D cubic domain.
Base derived type to manage data communication with 2D rectangle domain.
Derived type to manage a sparse matrix.