FE-Project
Loading...
Searching...
No Matches
mod_ocean_mesh_gm Module Reference

module Ocean / Mesh More...

Data Types

type  oceanmeshgm
 Derived type to manage a computational mesh of global ocean model. More...

Functions/Subroutines

subroutine oceanmeshgm_init (this)
 Initialize an object to manage computational mesh.

Detailed Description

module Ocean / Mesh

Description
Module for mesh with ocean global model
Author
Yuta kawai, Team SCALE
NAMELIST
  • PARAM_OCEAN_MESH
    nametypedefault valuecomment
    SHALLOW_OCN_APPROX_FLAGlogical.true.Flag whether the shallow ocean approximation is applied
    DOM_ZMINreal(RP)0.0_RPMinimum vertical coordinate value of the computational domain
    DOM_ZMAXreal(RP)10.0E3_RPMaximum vertical coordinate value of the computational domain
    FZreal(RP), dimension(FZ_NMAX)Values of the vertically computational coordinate at the element boundaries
    ISPERIODICZlogical.false.Flag whether a periodic boundary condition is applied in the vertical direction
    NEGXinteger2Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
    NEGYinteger2Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
    NEZinteger2Number of finite element in the vertical direction in each MPI process
    NLOCALMESHPERPRCinteger6Number of local mesh per MPI process
    NPRCinteger1Total number of MPI process
    POLYORDER_Hinteger2Polynomial order for the horizontal direction
    POLYORDER_Vinteger2Polynomial order for the z-direction
    LUMPEDMASSMATFLAGlogical.false.Flag whether a mass lumping is applied
    ELEMENT_OPERATION_TYPEcharacter(len=H_SHORT)'General'General or TensorProd3D
    SPMV_STORAGE_FORMATcharacter(len=H_SHORT)'ELL'CSR or ELL
    VERTICAL_COORD_NAMEcharacter(len=H_MID)"TERRAIN_FOLLOWING"Type of the vertical coordinate
    TOPO_IN_BASENAMEcharacter(len=H_LONG)''Basename of the input file
    TOPO_IN_VARNAMEcharacter(len=H_MID)'topo'Variable name of topography in the input file
    COMM_USE_MPI_PClogical.false.Flag whether persistent communication is used in MPI
    COMM_USE_MPI_PC_FUJITSU_EXTlogical

History Output
No history output

Function/Subroutine Documentation

◆ oceanmeshgm_init()

subroutine mod_ocean_mesh_gm::oceanmeshgm_init ( class(oceanmeshgm), intent(inout), target this)

Initialize an object to manage computational mesh.

Definition at line 81 of file mod_ocean_mesh_gm.F90.

82 use scale_const, only: &
83 rplanet => const_radius
85 use scale_meshutil_vcoord, only: &
87
88 implicit none
89 class(OceanMeshGM), target, intent(inout) :: this
90
91 real(RP) :: dom_zmin = 0.0_rp !< Minimum vertical coordinate value of the computational domain
92 real(RP) :: dom_zmax = 10.0e3_rp !< Maximum vertical coordinate value of the computational domain
93 logical :: isPeriodicZ = .false. !< Flag whether a periodic boundary condition is applied in the vertical direction
94
95 integer, parameter :: FZ_nmax = 1000
96 real(RP) :: FZ(FZ_nmax) !< Values of the vertically computational coordinate at the element boundaries
97
98 !* Global
99 logical :: SHALLOW_OCN_APPROX_FLAG = .true. !< Flag whether the shallow ocean approximation is applied
100 integer :: NeGX = 2 !< Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
101 integer :: NeGY = 2 !< Number of finite element in the y-coordinate direction in each panel of the cubed-sphere mesh
102 integer :: NeZ = 2 !< Number of finite element in the vertical direction in each MPI process
103 integer :: NLocalMeshPerPrc = 6 !< Number of local mesh per MPI process
104 integer :: Nprc = 1 !< Total number of MPI process
105 integer :: PolyOrder_h = 2 !< Polynomial order for the horizontal direction
106 integer :: PolyOrder_v = 2 !< Polynomial order for the z-direction
107 logical :: LumpedMassMatFlag = .false. !< Flag whether a mass lumping is applied
108
109 character(len=H_LONG) :: TOPO_IN_BASENAME = '' !< Basename of the input file
110 character(len=H_MID) :: TOPO_IN_VARNAME = 'topo' !< Variable name of topography in the input file
111 character(len=H_MID) :: VERTICAL_COORD_NAME = "TERRAIN_FOLLOWING" !< Type of the vertical coordinate
112
113 logical :: COMM_USE_MPI_PC = .false. !< Flag whether persistent communication is used in MPI
114 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
115
116 character(len=H_SHORT) :: Element_operation_type = 'General' !< General or TensorProd3D
117 character(len=H_SHORT) :: SpMV_storage_format = 'ELL' !< CSR or ELL
118
119 namelist / param_ocean_mesh / &
120 shallow_ocn_approx_flag, &
121 dom_zmin, dom_zmax, &
122 fz, isperiodicz, &
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, &
129 comm_use_mpi_pc, &
130 comm_use_mpi_pc_fujitsu_ext
131
132 integer :: k
133 logical :: is_spec_FZ
134
135 integer :: ierr
136 !-------------------------------------------
137
138 log_newline
139 log_info("OCN_MESH_setup",*) 'Setup'
140
141 fz(:) = -1.0_rp
142#ifdef __FUJITSU
143 comm_use_mpi_pc_fujitsu_ext = .true.
144#else
145 comm_use_mpi_pc_fujitsu_ext = .false.
146#endif
147
148 rewind(io_fid_conf)
149 read(io_fid_conf,nml=param_ocean_mesh,iostat=ierr)
150 if( ierr < 0 ) then !--- missing
151 log_info("OCN_MESH_setup",*) 'Not found namelist. Default used.'
152 elseif( ierr > 0 ) then !--- fatal error
153 log_error("OCN_MESH_setup",*) 'Not appropriate names in namelist PARAM_OCEAN_MESH. Check!'
154 call prc_abort
155 endif
156 log_nml(param_ocean_mesh)
157
158 !----
159
160 !- Setup the element
161
162 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
163 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
164
165 !- Setup the mesh
166
167 is_spec_fz = .true.
168 do k=1, nez+1
169 if (fz(k) < 0.0_rp) then
170 is_spec_fz = .false.
171 end if
172 end do
173 if (is_spec_fz) 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 )
178 else
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 )
183 end if
184
185 call this%mesh%Generate()
186
187 !-
188
189 call this%OceanMesh_Init( this%mesh )
190 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
191
192 !- Set topography & vertical coordinate
193
194 call this%Read_topography_file( topo_in_basename, topo_in_varname, &
195 this%mesh%mesh2D, dom_zmin )
196
197 this%vcoord_type_id = meshutil_get_vcoord_typeid( vertical_coord_name )
198 ! We tentatively disable the setup of vertical coordinate in ocean component.
199 ! For future, we will implement a more flexible setup of vertical coordinate.
200 ! call this%Setup_vcoordinate()
201
202 !-
203 this%comm_use_mpi_pc = comm_use_mpi_pc
204 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
205
206 return
module FElib / Mesh / Base 2D
module FElib / Mesh / utility for general vertical coordinate
integer function, public meshutil_get_vcoord_typeid(vcoord_type)
Get a type ID of vertical coordinate.
Derived type to manage a computational mesh (base type for 2D domain)

References scale_cubedsphere_coord_cnv::cubedspherecoordcnv_cs2lonlatvec(), scale_meshutil_vcoord::meshutil_get_vcoord_typeid(), and mod_ocean_mesh::ocn_mesh_max_commnuicator_num.