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

module Ocean / Mesh More...

Data Types

type  oceanmeshrm
 Derived type to manage a computational mesh of regional ocean model. More...

Functions/Subroutines

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

Detailed Description

module Ocean / Mesh

Description
Module for mesh with ocean regional model
Author
Yuta Kawai, Team SCALE
NAMELIST
  • PARAM_OCEAN_MESH
    nametypedefault valuecomment
    DOM_XMINreal(RP)0.0_RPMinimum x-coordinate value of the computational domain
    DOM_XMAXreal(RP)100.0E3_RPMaximum x-coordinate value of the computational domain
    DOM_YMINreal(RP)0.0_RPMinimum y-coordinate value of the computational domain
    DOM_YMAXreal(RP)100.0E3_RPMaximum y-coordinate value of the computational domain
    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
    ISPERIODICXlogical.true.Flag whether a periodic boundary condition is applied in the x-direction
    ISPERIODICYlogical.true.Flag whether a periodic boundary condition is applied in the y-direction
    ISPERIODICZlogical.false.Flag whether a periodic boundary condition is applied in the vertical direction
    NEXinteger2Number of finite element in the x-direction in each MPI process
    NEYinteger2Number of finite element in the y-direction in each MPI process
    NEZinteger2Number of finite element in the vertical direction in each 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'Storage format of sparse matrix (CSR or ELL)
    NPRCXinteger1Number of MPI process in the x-direction
    NPRCYinteger1Number of MPI process in the y-direction
    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
    VERTICAL_COORD_NAMEcharacter(len=H_MID)"TERRAIN_FOLLOWING"Type of the vertical coordinate
    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

◆ oceanmeshrm_init()

subroutine mod_ocean_mesh_rm::oceanmeshrm_init ( class(oceanmeshrm), intent(inout), target this)

Initialize an object to manage computational mesh.

Definition at line 82 of file mod_ocean_mesh_rm.F90.

83 use scale_meshutil_vcoord, only: &
85
86 implicit none
87 class(OceanMeshRM), target, intent(inout) :: this
88
89 real(RP) :: dom_xmin = 0.0_rp !< Minimum x-coordinate value of the computational domain
90 real(RP) :: dom_xmax = 100.0e3_rp !< Maximum x-coordinate value of the computational domain
91 real(RP) :: dom_ymin = 0.0_rp !< Minimum y-coordinate value of the computational domain
92 real(RP) :: dom_ymax = 100.0e3_rp !< Maximum y-coordinate value of the computational domain
93 real(RP) :: dom_zmin = 0.0_rp !< Minimum vertical coordinate value of the computational domain
94 real(RP) :: dom_zmax = 10.0e3_rp !< Maximum vertical coordinate value of the computational domain
95 logical :: isPeriodicX = .true. !< Flag whether a periodic boundary condition is applied in the x-direction
96 logical :: isPeriodicY = .true. !< Flag whether a periodic boundary condition is applied in the y-direction
97 logical :: isPeriodicZ = .false. !< Flag whether a periodic boundary condition is applied in the vertical direction
98
99 integer :: NeX = 2 !< Number of finite element in the x-direction in each MPI process
100 integer :: NeY = 2 !< Number of finite element in the y-direction in each MPI process
101 integer :: NeZ = 2 !< Number of finite element in the vertical direction in each MPI process
102 integer :: NprcX = 1 !< Number of MPI process in the x-direction
103 integer :: NprcY = 1 !< Number of MPI process in the y-direction
104 integer :: PolyOrder_h = 2 !< Polynomial order for the horizontal direction
105 integer :: PolyOrder_v = 2 !< Polynomial order for the z-direction
106 logical :: LumpedMassMatFlag = .false. !< Flag whether a mass lumping is applied
107
108 character(len=H_LONG) :: TOPO_IN_BASENAME = '' !< Basename of the input file
109 character(len=H_MID) :: TOPO_IN_VARNAME = 'topo' !< Variable name of topography in the input file
110 character(len=H_MID) :: VERTICAL_COORD_NAME = "TERRAIN_FOLLOWING" !< Type of the vertical coordinate
111
112 logical :: COMM_USE_MPI_PC = .false. !< Flag whether persistent communication is used in MPI
113 logical :: COMM_USE_MPI_PC_FUJITSU_EXT
114
115 character(len=H_SHORT) :: Element_operation_type = 'General' !< General or TensorProd3D
116 character(len=H_SHORT) :: SpMV_storage_format = 'ELL' !< Storage format of sparse matrix (CSR or ELL)
117
118 integer, parameter :: ATMOS_MESH_NLocalMeshPerPrc = 1
119
120 integer, parameter :: FZ_nmax = 1000
121 real(RP) :: FZ(FZ_nmax) !< Values of the vertically computational coordinate at the element boundaries
122
123 namelist / param_ocean_mesh / &
124 dom_xmin, dom_xmax, &
125 dom_ymin, dom_ymax, &
126 dom_zmin, dom_zmax, &
127 fz, &
128 isperiodicx, isperiodicy, isperiodicz, &
129 nex, ney, nez, &
130 polyorder_h, polyorder_v, lumpedmassmatflag, &
131 element_operation_type, &
132 spmv_storage_format, &
133 nprcx, nprcy, &
134 topo_in_basename, topo_in_varname, &
135 vertical_coord_name, &
136 comm_use_mpi_pc, &
137 comm_use_mpi_pc_fujitsu_ext
138
139 integer :: k
140 logical :: is_spec_FZ
141
142 integer :: ierr
143 !-------------------------------------------
144
145 log_newline
146 log_info("OCEAN_MESH_setup",*) 'Setup'
147
148 fz(:) = -1.0_rp
149#ifdef __FUJITSU
150 comm_use_mpi_pc_fujitsu_ext = .true.
151#else
152 comm_use_mpi_pc_fujitsu_ext = .false.
153#endif
154
155 rewind(io_fid_conf)
156 read(io_fid_conf,nml=param_ocean_mesh,iostat=ierr)
157 if( ierr < 0 ) then !--- missing
158 log_info("OCEAN_MESH_setup",*) 'Not found namelist. Default used.'
159 elseif( ierr > 0 ) then !--- fatal error
160 log_error("OCEAN_MESH_setup",*) 'Not appropriate names in namelist PARAM_OCEAN_MESH. Check!'
161 call prc_abort
162 endif
163 log_nml(param_ocean_mesh)
164
165 !----
166
167 ! Setup the element
168
169 call this%element%Init( polyorder_h, polyorder_v, lumpedmassmatflag )
170 call this%element_v1D%Init( polyorder_v, lumpedmassmatflag )
171
172 ! Setup the mesh
173
174 is_spec_fz = .true.
175 do k=1, nez+1
176 if (fz(k) < 0.0_rp) then
177 is_spec_fz = .false.
178 end if
179 end do
180 if (is_spec_fz) 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, &
186 fz=fz(1:nez+1) )
187 else
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 )
193 end if
194
195 call this%mesh%Generate()
196
197 !-
198 call this%OceanMesh_Init( this%mesh )
199 call this%PrepairElementOperation( element_operation_type, spmv_storage_format )
200
201 !- Set topography & vertical coordinate
202
203 call this%Read_topography_file( topo_in_basename, topo_in_varname, &
204 this%mesh%mesh2D, dom_zmin )
205
206 this%vcoord_type_id = meshutil_get_vcoord_typeid( vertical_coord_name )
207 ! We tentatively disable the setup of vertical coordinate in ocean component.
208 ! For future, we will implement a more flexible setup of vertical coordinate.
209 ! call this%Setup_vcoordinate()
210
211 !-
212 this%comm_use_mpi_pc = comm_use_mpi_pc
213 this%comm_use_mpi_pc_fujitsu_ext = comm_use_mpi_pc_fujitsu_ext
214
215 return
module FElib / Mesh / utility for general vertical coordinate
integer function, public meshutil_get_vcoord_typeid(vcoord_type)
Get a type ID of vertical coordinate.

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