11#include "scaleFElib.h"
21 use scale_const,
only: &
22 undef8 => const_undef8
73 procedure,
public :: setup => oceandyn_setup
74 procedure,
public :: calc_tendency => oceandyn_calc_tendency
75 procedure,
public :: update => oceandyn_update
76 procedure,
public :: finalize => oceandyn_finalize
87 private :: setup_coriolis_parameter
96 integer :: ocean_dyn_eqs_slab = 1
106 subroutine oceandyn_setup( this, model_mesh, tm_parent_comp )
112 class(
oceandyn),
intent(inout) :: this
113 class(modelmeshbase),
target,
intent(in) :: model_mesh
116 character(len=H_MID) :: eqs_type =
"SLAB"
117 character(len=H_SHORT) :: tinteg_type =
'ERK_SSP_3s3o'
118 character(len=H_SHORT) :: tinteg_type_tracer =
'ERK_SSP_3s3o'
119 real(dp) :: time_dt = undef8
120 character(len=H_SHORT) :: time_dt_unit =
'SEC'
124 namelist / param_ocean_dyn / &
127 tinteg_type_tracer, &
133 class(
meshbase),
pointer :: ptr_mesh
142 if (.not. this%IsActivated())
return
143 log_info(
'OceanDyn_setup',*)
149 read(io_fid_conf,nml=param_ocean_dyn,iostat=ierr)
151 log_info(
"OceanDyn_setup",*)
'Not found namelist. Default used.'
152 elseif( ierr > 0 )
then
153 log_error(
"OceanDyn_setup",*)
'Not appropriate names in namelist PARAM_OCEAN_DYN. Check!'
156 log_nml(param_ocean_dyn)
159 select case (trim(eqs_type))
160 case (
'FIXED_INIT_TEMP')
163 this%eqs_type = ocean_dyn_eqs_slab
165 log_info(
'OceanDyn_setup',*)
'Not appropriate EQS_TYPE. Check!'
171 call model_mesh%GetModelMesh( ptr_mesh )
172 select type(model_mesh)
174 ocean_mesh => model_mesh
176 this%mesh3D => ocean_mesh%ptr_mesh
180 call tm_parent_comp%Regist_process(
'OCEAN_DYN', time_dt, time_dt_unit, &
183 this%dtsec = tm_parent_comp%process_list(this%tm_process_id)%dtsec
186 call this%dyn_vars%Init( model_mesh )
188 call setup_coriolis_parameter( this%dyn_vars, ocean_mesh )
197 end subroutine oceandyn_setup
212 subroutine oceandyn_calc_tendency( this, model_mesh, prgvars_list, trcvars_list, auxvars_list, forcing_list, is_update )
215 class(
oceandyn),
intent(inout) :: this
216 class(modelmeshbase),
intent(in) :: model_mesh
221 logical,
intent(in) :: is_update
225 if (.not. this%IsActivated())
return
228 end subroutine oceandyn_calc_tendency
241 subroutine oceandyn_update( this, model_mesh, prgvars_list, trcvars_list, auxvars_list, forcing_list, is_update )
249 class(
oceandyn),
intent(inout) :: this
250 class(modelmeshbase),
intent(in) :: model_mesh
255 logical,
intent(in) :: is_update
268 log_info(
'OceanDyn_update',*)
'No update for fixed initial temperature'
272 call prof_rapstart(
'OCEAN_DYN_update', 1)
274 call model_mesh%GetModelMesh( mesh )
281 call prof_rapstart(
'OCEAN_DYN_core', 2)
284 do idom=1, mesh3d%LOCAL_MESH_NUM
285 lmesh => mesh3d%lcmesh_list(idom)
286 lmesh2d => lmesh%lcmesh2D
287 call ocn_dyn_update_lc( therm%local(idom)%val, &
288 rhoh%local(idom)%val, &
289 this%dtsec, lmesh, lmesh%refElem3D, lmesh2d, lmesh2d%refElem2D )
293 call prof_rapend(
'OCEAN_DYN_core', 2)
296 call prof_rapend(
'OCEAN_DYN_update', 1)
299 end subroutine oceandyn_update
304 subroutine oceandyn_finalize( this )
306 class(
oceandyn),
intent(inout) :: this
310 if (.not. this%IsActivated())
return
311 log_info(
'OceanDyn_finalize',*)
314 call this%dyn_vars%Final()
317 end subroutine oceandyn_finalize
323 subroutine setup_coriolis_parameter( this, ocn_mesh )
330 class(oceanmesh),
target,
intent(in) :: ocn_mesh
337 character(len=H_SHORT) :: coriolis_type
338 real(rp) :: coriolis_f0 = 0.0_rp
339 real(rp) :: coriolis_beta = 0.0_rp
340 real(rp) :: coriolis_y0
342 namelist /param_ocean_dyn_coriolis/ &
344 coriolis_f0, coriolis_beta, coriolis_y0
351 mesh3d => ocn_mesh%ptr_mesh
353 coriolis_type =
'NONE'
357 coriolis_y0 = 0.5_rp*(mesh3d%ymax_gl + mesh3d%ymin_gl)
361 read(io_fid_conf,nml=param_ocean_dyn_coriolis,iostat=ierr)
363 log_info(
"OCEAN_DYN_setup_coriolis",*)
'Not found namelist. Default used.'
364 else if( ierr > 0 )
then
365 log_error(
"OCEAN_DYN_setup_coriolis",*)
'Not appropriate names in namelist PARAM_OCEAN_DYN_CORIOLIS. Check!'
368 log_nml(param_ocean_dyn_coriolis)
370 do n = 1, mesh3d%LOCAL_MESH_NUM
373 lcmesh2d => lcmesh3d%lcmesh2D
376 coriolis%val(:,lcmesh2d%NeS:lcmesh2d%NeE), &
377 coriolis_type, lcmesh2d%refElem2D%Np * lcmesh2d%Ne, &
378 lcmesh2d%pos_en(:,:,2), coriolis_f0, coriolis_beta, coriolis_y0, &
385 end subroutine setup_coriolis_parameter
389 subroutine ocn_dyn_update_lc( THERM, &
390 RHOH, dt, lmesh, elem, lmesh2D, elem2D )
391 use scale_const,
only: &
393 use scale_atmos_hydrometeor,
only: &
400 real(rp),
intent(inout) :: therm(elem%np,lmesh%nea)
401 real(rp),
intent(in) :: rhoh(elem%np,lmesh%nea)
402 real(rp),
intent(in) :: dt
408 coef = dt / ( cv_water * dwatr )
410 do ke=lmesh%NeS, lmesh%NeE
411 therm(:,ke) = therm(:,ke) + rhoh(:,ke) * coef
414 end subroutine ocn_dyn_update_lc
subroutine, public oceandynauxvars_getlocalmeshfields(domid, mesh, auxvars_list, coriolis, lcmesh3d)
integer ocean_dyn_eqs_fixed_init_temp
subroutine, public oceanvars_getlocalmeshprgvars(domid, mesh, prgvars_list, auxvars2d_list, u, v, w, therm, salt, sfc_temp, sfc_alb_ir_dir, sfc_alb_ir_dif, sfc_alb_nir_dir, sfc_alb_nir_dif, sfc_alb_vis_dir, sfc_alb_vis_dif, lcmesh3d)
integer, parameter, public prgvar_therm_id
integer, parameter, public phytend_rhoh_id
Module common / Coriolis parameter.
subroutine, public get_coriolis_parameter(coriolis, colioris_type, np, y, f0, beta, y0, lat)
Get Coriolis parameter.
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Local, Base
module FElib / Data / base
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
module FElib / Mesh / Cubic 3D domain
module FElib / Data / base
FElib / model framework / physics process.
FElib / model framework / mesh manager.
FElib / model framework / variable manager.
Module common / sparsemat.
Module common / Runge-Kutta scheme.
Derived type to manage a component of oceanic dynamics.
Derived type to manage variables with oceanic dynamics component.
Derived type to manage a computational mesh (base class)
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Base type to manage a computational mesh.
Derived type to manage a cubic 3D computational domain.
Derived type representing a field with 2D mesh.
Derived type representing a field with 3D mesh.
Derived type representing a field (base type)
Derived type to manage a sparse matrix.
Derived type to provide RK scheme.