11#include "scaleFElib.h"
52 procedure :: final => oceanmeshgm_final
53 procedure :: create_communicator => oceanmeshgm_create_communicator
54 procedure :: setup_restartfile1 => oceanmeshgm_setup_restartfile1
55 procedure :: setup_restartfile2 => oceanmeshgm_setup_restartfile2
56 procedure :: calc_uvmet => oceanmeshgm_calc_uvmet
57 procedure :: setup_vcoordinate => oceanmeshgm_setup_vcoordinate
82 use scale_const,
only: &
83 rplanet => const_radius
91 real(RP) :: dom_zmin = 0.0_rp
92 real(RP) :: dom_zmax = 10.0e3_rp
93 logical :: isPeriodicZ = .false.
95 integer,
parameter :: FZ_nmax = 1000
96 real(RP) :: FZ(FZ_nmax)
99 logical :: SHALLOW_OCN_APPROX_FLAG = .true.
103 integer :: NLocalMeshPerPrc = 6
105 integer :: PolyOrder_h = 2
106 integer :: PolyOrder_v = 2
107 logical :: LumpedMassMatFlag = .false.
109 character(len=H_LONG) :: TOPO_IN_BASENAME =
''
110 character(len=H_MID) :: TOPO_IN_VARNAME =
'topo'
111 character(len=H_MID) :: VERTICAL_COORD_NAME =
"TERRAIN_FOLLOWING"
113 logical :: COMM_USE_MPI_PC = .false.
114 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
116 character(len=H_SHORT) :: Element_operation_type =
'General'
117 character(len=H_SHORT) :: SpMV_storage_format =
'ELL'
119 namelist / param_ocean_mesh / &
120 shallow_ocn_approx_flag, &
121 dom_zmin, dom_zmax, &
123 negx, negy, nez, nlocalmeshperprc, nprc, &
124 polyorder_h, polyorder_v, lumpedmassmatflag, &
125 element_operation_type, &
126 spmv_storage_format, &
127 vertical_coord_name, &
128 topo_in_basename, topo_in_varname, &
130 comm_use_mpi_pc_fujitsu_ext
133 logical :: is_spec_FZ
139 log_info(
"OCN_MESH_setup",*)
'Setup'
143 comm_use_mpi_pc_fujitsu_ext = .true.
145 comm_use_mpi_pc_fujitsu_ext = .false.
149 read(io_fid_conf,nml=param_ocean_mesh,iostat=ierr)
151 log_info(
"OCN_MESH_setup",*)
'Not found namelist. Default used.'
152 elseif( ierr > 0 )
then
153 log_error(
"OCN_MESH_setup",*)
'Not appropriate names in namelist PARAM_OCEAN_MESH. Check!'
156 log_nml(param_ocean_mesh)
162 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
163 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
169 if (fz(k) < 0.0_rp)
then
174 call this%mesh%Init( &
175 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
176 this%element, nlocalmeshperprc, nproc=nprc, &
177 fz=fz(1:nez+1), shallow_approx=shallow_ocn_approx_flag )
179 call this%mesh%Init( &
180 negx, negy, nez, rplanet, dom_zmin, dom_zmax, &
181 this%element, nlocalmeshperprc, nproc=nprc, &
182 shallow_approx=shallow_ocn_approx_flag )
185 call this%mesh%Generate()
189 call this%OceanMesh_Init( this%mesh )
190 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
194 call this%Read_topography_file( topo_in_basename, topo_in_varname, &
195 this%mesh%mesh2D, dom_zmin )
203 this%comm_use_mpi_pc = comm_use_mpi_pc
204 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
212 subroutine oceanmeshgm_final(this)
219 do commid=1, this%communicator_num
220 call this%comm_list(commid)%Final()
223 call this%mesh%Final()
224 call this%OceanMesh_Final()
227 end subroutine oceanmeshgm_final
232 subroutine oceanmeshgm_create_communicator( this, sfield_num, hvfield_num, htensorfield_num, &
233 var_manager, field_list, commid, &
234 field_list_is, field_list_ie )
237 integer,
intent(in) :: sfield_num
238 integer,
intent(in) :: hvfield_num
239 integer,
intent(in) :: htensorfield_num
242 integer,
intent(out) :: commid
243 integer,
intent(in),
optional :: field_list_is
244 integer,
intent(in),
optional :: field_list_ie
248 call this%comm_list(commid)%Init( sfield_num, hvfield_num, htensorfield_num, this%mesh )
249 if ( this%comm_use_mpi_pc )
then
250 call this%comm_list(commid)%Prepare_PC( this%comm_use_mpi_pc_fujitsu_ext )
252 call var_manager%MeshFieldComm_Prepare( this%comm_list(commid), field_list, field_list_is, field_list_ie )
255 end subroutine oceanmeshgm_create_communicator
258 subroutine oceanmeshgm_setup_restartfile1( this, restart_file, var_num, dim_name_postfix )
262 integer,
intent(in) :: var_num
263 character(*),
intent(in) :: dim_name_postfix
266 call restart_file%Init(
'OCEAN', var_num, dim_name_postfix, meshcubedsphere3d=this%mesh )
268 end subroutine oceanmeshgm_setup_restartfile1
271 subroutine oceanmeshgm_setup_restartfile2( this, restart_file, &
272 in_basename, in_postfix_timelabel, &
273 out_basename, out_postfix_timelabel, &
274 out_dtype, out_title, var_num, dim_name_postfix )
278 character(*),
intent(in) :: in_basename
279 logical,
intent(in) :: in_postfix_timelabel
280 character(*),
intent(in) :: out_basename
281 logical,
intent(in) :: out_postfix_timelabel
282 character(*),
intent(in) :: out_title
283 character(*),
intent(in) :: out_dtype
284 integer,
intent(in) :: var_num
285 character(*),
intent(in) :: dim_name_postfix
288 call restart_file%Init(
'OCEAN', in_basename, in_postfix_timelabel, &
289 out_basename, out_postfix_timelabel, out_dtype, out_title, &
290 var_num, dim_name_postfix, &
291 meshcubedsphere3d=this%mesh )
293 end subroutine oceanmeshgm_setup_restartfile2
297 subroutine oceanmeshgm_calc_uvmet( this, U, V, &
315 do n=1, this%mesh%LOCAL_MESH_NUM
316 lcmesh => this%mesh%lcmesh_list(n)
317 elem => lcmesh%refElem3D
319 lcmesh%panelID, lcmesh%pos_en(:,:,1), lcmesh%pos_en(:,:,2), &
320 lcmesh%gam, elem%Np * lcmesh%Ne, &
321 u%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
322 v%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
323 umet%local(n)%val(:,lcmesh%NeS:lcmesh%NeE), &
324 vmet%local(n)%val(:,lcmesh%NeS:lcmesh%NeE) )
328 end subroutine oceanmeshgm_calc_uvmet
332 subroutine oceanmeshgm_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 oceanmeshgm_setup_vcoordinate
subroutine oceanmeshgm_init(this)
Initialize an object to manage computational mesh.
integer, parameter, public ocn_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
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 ocean 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 2D 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.