11#include "scaleFElib.h"
52 procedure :: final => oceanmeshrm_final
53 procedure :: create_communicator => oceanmeshrm_create_communicator
54 procedure :: setup_restartfile1 => oceanmeshrm_setup_restartfile1
55 procedure :: setup_restartfile2 => oceanmeshrm_setup_restartfile2
56 procedure :: calc_uvmet => oceanmeshrm_calc_uvmet
57 procedure :: setup_vcoordinate => oceanmeshrm_setup_vcoordinate
89 real(RP) :: dom_xmin = 0.0_rp
90 real(RP) :: dom_xmax = 100.0e3_rp
91 real(RP) :: dom_ymin = 0.0_rp
92 real(RP) :: dom_ymax = 100.0e3_rp
93 real(RP) :: dom_zmin = 0.0_rp
94 real(RP) :: dom_zmax = 10.0e3_rp
95 logical :: isPeriodicX = .true.
96 logical :: isPeriodicY = .true.
97 logical :: isPeriodicZ = .false.
104 integer :: PolyOrder_h = 2
105 integer :: PolyOrder_v = 2
106 logical :: LumpedMassMatFlag = .false.
108 character(len=H_LONG) :: TOPO_IN_BASENAME =
''
109 character(len=H_MID) :: TOPO_IN_VARNAME =
'topo'
110 character(len=H_MID) :: VERTICAL_COORD_NAME =
"TERRAIN_FOLLOWING"
112 logical :: COMM_USE_MPI_PC = .false.
113 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
115 character(len=H_SHORT) :: Element_operation_type =
'General'
116 character(len=H_SHORT) :: SpMV_storage_format =
'ELL'
118 integer,
parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
120 integer,
parameter :: FZ_nmax = 1000
121 real(RP) :: FZ(FZ_nmax)
123 namelist / param_ocean_mesh / &
124 dom_xmin, dom_xmax, &
125 dom_ymin, dom_ymax, &
126 dom_zmin, dom_zmax, &
128 isperiodicx, isperiodicy, isperiodicz, &
130 polyorder_h, polyorder_v, lumpedmassmatflag, &
131 element_operation_type, &
132 spmv_storage_format, &
134 topo_in_basename, topo_in_varname, &
135 vertical_coord_name, &
137 comm_use_mpi_pc_fujitsu_ext
140 logical :: is_spec_FZ
146 log_info(
"OCEAN_MESH_setup",*)
'Setup'
150 comm_use_mpi_pc_fujitsu_ext = .true.
152 comm_use_mpi_pc_fujitsu_ext = .false.
156 read(io_fid_conf,nml=param_ocean_mesh,iostat=ierr)
158 log_info(
"OCEAN_MESH_setup",*)
'Not found namelist. Default used.'
159 elseif( ierr > 0 )
then
160 log_error(
"OCEAN_MESH_setup",*)
'Not appropriate names in namelist PARAM_OCEAN_MESH. Check!'
163 log_nml(param_ocean_mesh)
169 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
170 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
176 if (fz(k) < 0.0_rp)
then
181 call this%mesh%Init( &
182 nprcx*nex, nprcy*ney, nez, &
183 dom_xmin, dom_xmax,dom_ymin, dom_ymax, dom_zmin, dom_zmax, &
184 isperiodicx, isperiodicy, isperiodicz, &
185 this%element, atmos_mesh_nlocalmeshperprc, nprcx, nprcy, &
188 call this%mesh%Init( &
189 nprcx*nex, nprcy*ney, nez, &
190 dom_xmin, dom_xmax,dom_ymin, dom_ymax, dom_zmin, dom_zmax, &
191 isperiodicx, isperiodicy, isperiodicz, &
192 this%element, atmos_mesh_nlocalmeshperprc, nprcx, nprcy )
195 call this%mesh%Generate()
198 call this%OceanMesh_Init( this%mesh )
199 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
203 call this%Read_topography_file( topo_in_basename, topo_in_varname, &
204 this%mesh%mesh2D, dom_zmin )
212 this%comm_use_mpi_pc = comm_use_mpi_pc
213 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
220 subroutine oceanmeshrm_final(this)
227 do commid=1, this%communicator_num
228 call this%comm_list(commid)%Final()
231 call this%mesh%Final()
232 call this%OceanMesh_Final()
235 end subroutine oceanmeshrm_final
239 subroutine oceanmeshrm_create_communicator( this, sfield_num, hvfield_num, htensorfield_num, &
240 var_manager, field_list, commid, &
241 field_list_is, field_list_ie )
244 integer,
intent(in) :: sfield_num
245 integer,
intent(in) :: hvfield_num
246 integer,
intent(in) :: htensorfield_num
249 integer,
intent(out) :: commid
250 integer,
intent(in),
optional :: field_list_is
251 integer,
intent(in),
optional :: field_list_ie
255 call this%comm_list(commid)%Init( sfield_num, hvfield_num, htensorfield_num, this%mesh )
256 if ( this%comm_use_mpi_pc )
then
257 call this%comm_list(commid)%Prepare_PC( this%comm_use_mpi_pc_fujitsu_ext )
259 call var_manager%MeshFieldComm_Prepare( this%comm_list(commid), field_list, field_list_is, field_list_ie )
262 end subroutine oceanmeshrm_create_communicator
264 subroutine oceanmeshrm_setup_restartfile1( this, restart_file, var_num, dim_name_postfix )
268 integer,
intent(in) :: var_num
269 character(*),
intent(in) :: dim_name_postfix
272 call restart_file%Init(
'OCEAN', var_num, dim_name_postfix, mesh3d=this%mesh )
274 end subroutine oceanmeshrm_setup_restartfile1
276 subroutine oceanmeshrm_setup_restartfile2( this, restart_file, &
277 in_basename, in_postfix_timelabel, &
278 out_basename, out_postfix_timelabel, &
279 out_dtype, out_title, var_num, dim_name_postfix )
283 character(*),
intent(in) :: in_basename
284 logical,
intent(in) :: in_postfix_timelabel
285 character(*),
intent(in) :: out_basename
286 logical,
intent(in) :: out_postfix_timelabel
287 character(*),
intent(in) :: out_title
288 character(*),
intent(in) :: out_dtype
289 integer,
intent(in) :: var_num
290 character(*),
intent(in) :: dim_name_postfix
293 call restart_file%Init(
'OCEAN', in_basename, in_postfix_timelabel, &
294 out_basename, out_postfix_timelabel, out_dtype, out_title, &
295 var_num, dim_name_postfix, &
299 end subroutine oceanmeshrm_setup_restartfile2
301 subroutine oceanmeshrm_calc_uvmet( this, U, V, &
315 do n=1, this%mesh%LOCAL_MESH_NUM
316 lcmesh => this%mesh%lcmesh_list(n)
318 do ke=lcmesh%NeS, lcmesh%NeE
319 umet%local(n)%val(:,ke) = u%local(n)%val(:,ke)
320 vmet%local(n)%val(:,ke) = v%local(n)%val(:,ke)
325 end subroutine oceanmeshrm_calc_uvmet
328 subroutine oceanmeshrm_setup_vcoordinate( this )
337 call comm2d%Init( 1, 0, 0, this%mesh%mesh2D )
338 call comm3d%Init( 2, 1, 0, this%mesh )
340 call this%topography%SetVCoordinate( this%mesh, &
341 this%vcoord_type_id, this%mesh%zmax_gl, comm3d, comm2d )
347 end subroutine oceanmeshrm_setup_vcoordinate
subroutine oceanmeshrm_init(this)
Initialize an object to manage computational mesh.
integer, parameter, public ocn_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 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 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 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.