11#include "scaleFElib.h"
52 procedure :: final => atmosmeshgm_final
53 procedure :: create_communicator => atmosmeshgm_create_communicator
54 procedure :: setup_restartfile1 => atmosmeshgm_setup_restartfile1
55 procedure :: setup_restartfile2 => atmosmeshgm_setup_restartfile2
56 procedure :: calc_uvmet => atmosmeshgm_calc_uvmet
57 procedure :: setup_vcoordinate => atmosmeshgm_setup_vcoordinate
82 use scale_const,
only: &
83 rplanet => const_radius
92 real(RP) :: dom_zmin = 0.0_rp
93 real(RP) :: dom_zmax = 10.0e3_rp
94 logical :: isPeriodicZ = .false.
96 integer,
parameter :: FZ_nmax = 1000
97 real(RP) :: FZ(FZ_nmax)
100 logical :: SHALLOW_ATM_APPROX_FLAG = .true.
104 integer :: NLocalMeshPerPrc = 6
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 namelist / param_atmos_mesh / &
121 shallow_atm_approx_flag, &
122 dom_zmin, dom_zmax, &
124 negx, negy, nez, nlocalmeshperprc, nprc, &
125 polyorder_h, polyorder_v, lumpedmassmatflag, &
126 element_operation_type, &
127 spmv_storage_format, &
128 vertical_coord_name, &
129 topo_in_basename, topo_in_varname, &
131 comm_use_mpi_pc_fujitsu_ext
134 logical :: is_spec_FZ
140 log_info(
"ATMOS_MESH_setup",*)
'Setup'
144 comm_use_mpi_pc_fujitsu_ext = .true.
146 comm_use_mpi_pc_fujitsu_ext = .false.
150 read(io_fid_conf,nml=param_atmos_mesh,iostat=ierr)
152 log_info(
"ATMOS_MESH_setup",*)
'Not found namelist. Default used.'
153 elseif( ierr > 0 )
then
154 log_error(
"ATMOS_MESH_setup",*)
'Not appropriate names in namelist PARAM_ATM_MESH. Check!'
157 log_nml(param_atmos_mesh)
163 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
164 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
170 if (fz(k) < 0.0_rp)
then
175 call this%mesh%Init( &
176 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
177 this%element, nlocalmeshperprc, nproc=nprc, &
178 fz=fz(1:nez+1), shallow_approx=shallow_atm_approx_flag )
180 call this%mesh%Init( &
181 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
182 this%element, nlocalmeshperprc, nproc=nprc, &
183 shallow_approx=shallow_atm_approx_flag )
186 call this%mesh%Generate()
190 call this%AtmosMesh_Init( this%mesh )
191 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
195 call this%Read_topography_file( topo_in_basename, topo_in_varname, this%mesh%mesh2D, dom_zmin )
198 call this%Setup_vcoordinate()
201 this%comm_use_mpi_pc = comm_use_mpi_pc
202 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
210 subroutine atmosmeshgm_final(this)
217 do commid=1, this%communicator_num
218 call this%comm_list(commid)%Final()
221 call this%mesh%Final()
222 call this%AtmosMesh_Final()
225 end subroutine atmosmeshgm_final
230 subroutine atmosmeshgm_create_communicator( this, sfield_num, hvfield_num, htensorfield_num, &
231 var_manager, field_list, commid, &
232 field_list_is, field_list_ie )
235 integer,
intent(in) :: sfield_num
236 integer,
intent(in) :: hvfield_num
237 integer,
intent(in) :: htensorfield_num
240 integer,
intent(out) :: commid
241 integer,
intent(in),
optional :: field_list_is
242 integer,
intent(in),
optional :: field_list_ie
246 call this%comm_list(commid)%Init( sfield_num, hvfield_num, htensorfield_num, this%mesh )
247 if ( this%comm_use_mpi_pc )
then
248 call this%comm_list(commid)%Prepare_PC( this%comm_use_mpi_pc_fujitsu_ext )
250 call var_manager%MeshFieldComm_Prepare( this%comm_list(commid), field_list, field_list_is, field_list_ie )
253 end subroutine atmosmeshgm_create_communicator
256 subroutine atmosmeshgm_setup_restartfile1( this, restart_file, var_num )
260 integer,
intent(in) :: var_num
263 call restart_file%Init(
'ATMOS', var_num, meshcubedsphere3d=this%mesh )
265 end subroutine atmosmeshgm_setup_restartfile1
268 subroutine atmosmeshgm_setup_restartfile2( this, restart_file, &
269 in_basename, in_postfix_timelabel, &
270 out_basename, out_postfix_timelabel, &
271 out_dtype, out_title, var_num, dim_name_postfix )
275 character(*),
intent(in) :: in_basename
276 logical,
intent(in) :: in_postfix_timelabel
277 character(*),
intent(in) :: out_basename
278 logical,
intent(in) :: out_postfix_timelabel
279 character(*),
intent(in) :: out_title
280 character(*),
intent(in) :: out_dtype
281 integer,
intent(in) :: var_num
282 character(len=*),
intent(in) :: dim_name_postfix
285 call restart_file%Init(
'ATMOS', in_basename, in_postfix_timelabel, &
286 out_basename, out_postfix_timelabel, out_dtype, out_title, &
287 var_num, dim_name_postfix, &
288 meshcubedsphere3d=this%mesh )
290 end subroutine atmosmeshgm_setup_restartfile2
294 subroutine atmosmeshgm_calc_uvmet( this, U, V, &
312 do n=1, this%mesh%LOCAL_MESH_NUM
313 lcmesh => this%mesh%lcmesh_list(n)
314 elem => lcmesh%refElem3D
316 lcmesh%panelID, lcmesh%pos_en(:,:,1), lcmesh%pos_en(:,:,2), &
317 lcmesh%gam, elem%Np * lcmesh%Ne, &
318 u%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
319 v%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
320 umet%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
321 vmet%local(n)%val(:,lcmesh%NeS:lcmesh%NeE) )
325 end subroutine atmosmeshgm_calc_uvmet
329 subroutine atmosmeshgm_setup_vcoordinate( this )
338 call comm2d%Init( 1, 0, 0, this%mesh%mesh2D )
339 call comm3d%Init( 2, 1, 0, this%mesh )
341 call this%topography%SetVCoordinate( this%ptr_mesh, &
342 this%vcoord_type_id, this%mesh%zmax_gl, comm3d, comm2d )
348 end SUBROUTINE atmosmeshgm_setup_vcoordinate
subroutine atmosmeshgm_init(this)
Initialize an object to manage computational mesh.
integer, parameter, public atm_mesh_max_commnuicator_num
Module common / Coordinate conversion with cubed-sphere projection.
subroutine, public cubedspherecoordcnv_cs2lonlatvec(panelid, alpha, beta, gam, np, vecalpha, vecbeta, veclon, veclat, lat, gpu_async_id)
Convert the components of a vector in local coordinates with an equiangular gnomonic cubed-sphere pro...
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 / Cubed-sphere 3D domain
module FElib / Data / base
module FElib / Data / Communication in 2D cubed-sphere domain
module FElib / Data / Communication in 3D cubed-sphere 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 global 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 cubed-sphere 3D computational domain.
Derived type representing a field with 3D mesh.
Base derived type to manage data communication with 2D cubed-sphere domain.
Base derived type to manage data communication with 3D cubed-sphere domain.
Derived type to manage a sparse matrix.