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
91 real(RP) :: dom_xmin = 0.0_rp
92 real(RP) :: dom_xmax = 100.0e3_rp
93 real(RP) :: dom_ymin = 0.0_rp
94 real(RP) :: dom_ymax = 100.0e3_rp
95 real(RP) :: dom_zmin = 0.0_rp
96 real(RP) :: dom_zmax = 10.0e3_rp
97 logical :: isPeriodicX = .true.
98 logical :: isPeriodicY = .true.
99 logical :: isPeriodicZ = .false.
106 integer :: PolyOrder_h = 2
107 integer :: PolyOrder_v = 2
108 logical :: LumpedMassMatFlag = .false.
110 character(len=H_LONG) :: TOPO_IN_BASENAME =
''
111 character(len=H_MID) :: TOPO_IN_VARNAME =
'topo'
112 character(len=H_MID) :: VERTICAL_COORD_NAME =
"TERRAIN_FOLLOWING"
114 logical :: COMM_USE_MPI_PC = .false.
115 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
117 character(len=H_SHORT) :: Element_operation_type =
'General'
118 character(len=H_SHORT) :: SpMV_storage_format =
'ELL'
120 integer,
parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
122 integer,
parameter :: FZ_nmax = 1000
123 real(RP) :: FZ(FZ_nmax)
125 namelist / param_atmos_mesh / &
126 dom_xmin, dom_xmax, &
127 dom_ymin, dom_ymax, &
128 dom_zmin, dom_zmax, &
130 isperiodicx, isperiodicy, isperiodicz, &
132 polyorder_h, polyorder_v, lumpedmassmatflag, &
133 element_operation_type, &
134 spmv_storage_format, &
136 topo_in_basename, topo_in_varname, &
137 vertical_coord_name, &
139 comm_use_mpi_pc_fujitsu_ext
142 logical :: is_spec_FZ
148 log_info(
"ATMOS_MESH_setup",*)
'Setup'
152 comm_use_mpi_pc_fujitsu_ext = .true.
154 comm_use_mpi_pc_fujitsu_ext = .false.
158 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
160 log_info(
"ATMOS_MESH_setup",*)
'Not found namelist. Default used.'
161 elseif( ierr > 0 )
then
162 log_error(
"ATMOS_MESH_setup",*)
'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
165 log_nml(param_atmos_mesh)
171 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
172 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
178 if (fz(k) < 0.0_rp)
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, &
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 )
197 call this%mesh%Generate()
200 call this%AtmosMesh_Init( this%mesh )
201 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
205 call this%Read_topography_file( topo_in_basename, topo_in_varname, this%mesh%mesh2D, dom_zmin )
208 call this%Setup_vcoordinate()
211 this%comm_use_mpi_pc = comm_use_mpi_pc
212 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
219 subroutine atmosmeshrm_final(this)
226 do commid=1, this%communicator_num
227 call this%comm_list(commid)%Final()
230 call this%mesh%Final()
231 call this%AtmosMesh_Final()
234 end subroutine atmosmeshrm_final
238 subroutine atmosmeshrm_create_communicator( this, sfield_num, hvfield_num, htensorfield_num, &
239 var_manager, field_list, commid, &
240 field_list_is, field_list_ie )
243 integer,
intent(in) :: sfield_num
244 integer,
intent(in) :: hvfield_num
245 integer,
intent(in) :: htensorfield_num
248 integer,
intent(out) :: commid
249 integer,
intent(in),
optional :: field_list_is
250 integer,
intent(in),
optional :: field_list_ie
254 call this%comm_list(commid)%Init( sfield_num, hvfield_num, htensorfield_num, this%mesh )
255 if ( this%comm_use_mpi_pc )
then
256 call this%comm_list(commid)%Prepare_PC( this%comm_use_mpi_pc_fujitsu_ext )
258 call var_manager%MeshFieldComm_Prepare( this%comm_list(commid), field_list, field_list_is, field_list_ie )
261 end subroutine atmosmeshrm_create_communicator
263 subroutine atmosmeshrm_setup_restartfile1( this, restart_file, var_num )
267 integer,
intent(in) :: var_num
270 call restart_file%Init(
'ATMOS', var_num, mesh3d=this%mesh )
272 end subroutine atmosmeshrm_setup_restartfile1
274 subroutine atmosmeshrm_setup_restartfile2( this, restart_file, &
275 in_basename, in_postfix_timelabel, &
276 out_basename, out_postfix_timelabel, &
277 out_dtype, out_title, var_num, dim_name_postfix )
281 character(*),
intent(in) :: in_basename
282 logical,
intent(in) :: in_postfix_timelabel
283 character(*),
intent(in) :: out_basename
284 logical,
intent(in) :: out_postfix_timelabel
285 character(*),
intent(in) :: out_title
286 character(*),
intent(in) :: out_dtype
287 integer,
intent(in) :: var_num
288 character(len=*),
intent(in) :: dim_name_postfix
291 call restart_file%Init(
'ATMOS', in_basename, in_postfix_timelabel, &
292 out_basename, out_postfix_timelabel, out_dtype, out_title, &
293 var_num, dim_name_postfix, &
297 end subroutine atmosmeshrm_setup_restartfile2
299 subroutine atmosmeshrm_calc_uvmet( this, U, V, &
313 do n=1, this%mesh%LOCAL_MESH_NUM
314 lcmesh => this%mesh%lcmesh_list(n)
316 do ke=lcmesh%NeS, lcmesh%NeE
317 umet%local(n)%val(:,ke) = u%local(n)%val(:,ke)
318 vmet%local(n)%val(:,ke) = v%local(n)%val(:,ke)
323 end subroutine atmosmeshrm_calc_uvmet
326 subroutine atmosmeshrm_setup_vcoordinate( this )
335 call comm2d%Init( 1, 0, 0, this%mesh%mesh2D )
336 call comm3d%Init( 2, 1, 0, this%mesh )
338 call this%topography%SetVCoordinate( this%ptr_mesh, &
339 this%vcoord_type_id, this%mesh%zmax_gl, comm3d, comm2d )
345 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 / 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)
Get a type ID of vertical coordinate.
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 restart file with each component.
Derived type to manage a local 3D computational domain.
Derived type to manage a computational mesh (base type for 3D domain)
Derived type to manage a cubic 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.