11#include "scaleFElib.h"
21 use scale_const,
only: &
22 undef8 => const_undef8
77 logical :: calc_numdiff_flag
82 procedure,
public :: calc_tendency => atmosdyn_calc_tendency
83 procedure,
public :: update => atmosdyn_update
84 procedure,
public :: finalize => atmosdyn_finalize
95 private :: setup_coriolis_parameter
117 class(
atmosdyn),
intent(inout) :: this
118 class(modelmeshbase),
target,
intent(in) :: model_mesh
121 character(len=H_MID) :: EQS_TYPE =
"NONHYDRO3D_HEVE"
122 character(len=H_SHORT) :: TINTEG_TYPE =
'ERK_SSP_3s3o'
123 character(len=H_SHORT) :: TINTEG_TYPE_TRACER =
'ERK_SSP_3s3o'
124 real(DP) :: TIME_DT = undef8
125 character(len=H_SHORT) :: TIME_DT_UNIT =
'SEC'
127 logical :: MODALFILTER_FLAG = .false.
128 logical :: NUMDIFF_FLAG = .false.
129 logical :: SPONGELAYER_FLAG = .false.
130 logical :: ONLY_TRACERADV_FLAG = .false.
131 logical :: TRACERADV_DISABLE_LIMITER = .false.
132 logical :: TRACERADV_MODALFILTER_FLAG = .false.
133 logical :: HIDE_MPI_COMM_FLAG = .false.
135 namelist / param_atmos_dyn / &
138 tinteg_type_tracer, &
144 only_traceradv_flag, &
145 traceradv_disable_limiter, &
146 traceradv_modalfilter_flag, &
150 class(
meshbase),
pointer :: ptr_mesh
161 if (.not. this%IsActivated())
return
162 log_info(
'AtmosDyn_setup',*)
166 read(io_fid_conf,nml=param_atmos_dyn,iostat=ierr)
168 log_info(
"ATMOS_DYN_setup",*)
'Not found namelist. Default used.'
169 elseif( ierr > 0 )
then
170 log_error(
"ATMOS_DYN_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_DYN. Check!'
173 log_nml(param_atmos_dyn)
177 call model_mesh%GetModelMesh( ptr_mesh )
178 select type(model_mesh)
180 atm_mesh => model_mesh
182 mesh3d => atm_mesh%ptr_mesh
186 call tm_parent_comp%Regist_process(
'ATMOS_DYN', time_dt, time_dt_unit, &
189 dtsec = tm_parent_comp%process_list(this%tm_process_id)%dtsec
192 call this%dyn_vars%Init( model_mesh )
194 call setup_coriolis_parameter( this%dyn_vars, atm_mesh )
197 call this%dyncore_driver%Init( eqs_type, &
198 tinteg_type, dtsec, &
199 spongelayer_flag, modalfilter_flag, &
200 hide_mpi_comm_flag, &
204 call this%trcadv_driver%Init(
"TRCADV3D_HEVE", &
205 tinteg_type_tracer, dtsec, &
206 traceradv_modalfilter_flag, traceradv_disable_limiter, &
207 atm_mesh, this%dyncore_driver%boundary_cond, only_traceradv_flag )
210 this%CALC_NUMDIFF_FLAG = numdiff_flag
211 if (this%CALC_NUMDIFF_FLAG)
call this%numdiff%Init( atm_mesh, dtsec )
229 subroutine atmosdyn_calc_tendency( this, model_mesh, prgvars_list, trcvars_list, auxvars_list, forcing_list, is_update )
232 class(
atmosdyn),
intent(inout) :: this
233 class(modelmeshbase),
intent(in) :: model_mesh
238 logical,
intent(in) :: is_update
240 if (.not. this%IsActivated())
return
244 end subroutine atmosdyn_calc_tendency
257 subroutine atmosdyn_update( this, model_mesh, prgvars_list, trcvars_list, auxvars_list, forcing_list, is_update )
258 use scale_tracer,
only: &
260 use scale_const,
only: &
261 grav => const_grav, &
262 rdry => const_rdry, &
263 cpdry => const_cpdry, &
264 cvdry => const_cvdry, &
265 pres00 => const_pre00
281 class(
atmosdyn),
intent(inout) :: this
282 class(modelmeshbase),
intent(in) :: model_mesh
287 logical,
intent(in) :: is_update
293 call prof_rapstart(
'ATM_DYN_update', 1)
295 call model_mesh%GetModelMesh( mesh )
301 if ( .not. this%trcadv_driver%ONLY_TRACERADV_FLAG )
then
303 call prof_rapstart(
'ATM_DYN_core', 2)
305 call this%dyncore_driver%Update( &
306 prgvars_list, auxvars_list, forcing_list, &
307 this%trcadv_driver%TRCVARS3D(trcddens_id), &
308 this%trcadv_driver%TRCVARS3D(trcddens0_id), &
309 this%trcadv_driver%AUXTRC_FLUX_VARS3D(massflx_x_tavg), &
310 this%trcadv_driver%AUXTRC_FLUX_VARS3D(massflx_y_tavg), &
311 this%trcadv_driver%AUXTRC_FLUX_VARS3D(massflx_z_tavg), &
312 this%trcadv_driver%alphaDensM, this%trcadv_driver%alphaDensP, &
314 model_mesh%element3D_operation, &
315 model_mesh%DOptrMat(1), model_mesh%DOptrMat(2), model_mesh%DOptrMat(3), &
316 model_mesh%SOptrMat(1), model_mesh%SOptrMat(2), model_mesh%SOptrMat(3), &
317 model_mesh%LiftOptrMat, mesh3d )
319 call prof_rapend(
'ATM_DYN_core', 2)
326 call prof_rapstart(
'ATM_DYN_qtracer', 2)
328 call this%trcadv_driver%Update( &
329 trcvars_list, prgvars_list, auxvars_list, forcing_list, &
330 model_mesh%element3D_operation, &
331 model_mesh%DOptrMat(1), model_mesh%DOptrMat(2), model_mesh%DOptrMat(3), &
332 model_mesh%SOptrMat(1), model_mesh%SOptrMat(2), model_mesh%SOptrMat(3), &
333 model_mesh%LiftOptrMat, mesh3d, &
334 this%dyncore_driver )
336 call prof_rapend(
'ATM_DYN_qtracer', 2)
341 if ( this%CALC_NUMDIFF_FLAG )
then
342 call prof_rapstart(
'ATM_DYN_numfilter', 2)
343 call this%numdiff%Apply( prgvars_list, &
344 auxvars_list, this%dyncore_driver%boundary_cond, &
345 model_mesh%DOptrMat(1), model_mesh%DOptrMat(2), model_mesh%DOptrMat(3), &
346 model_mesh%LiftOptrMat, mesh3d )
347 call prof_rapend(
'ATM_DYN_numfilter', 2)
351 call prof_rapend(
'ATM_DYN_update', 1)
354 end subroutine atmosdyn_update
359 subroutine atmosdyn_finalize( this )
361 class(
atmosdyn),
intent(inout) :: this
365 if (.not. this%IsActivated())
return
366 log_info(
'AtmosDyn_finalize',*)
368 call this%dyncore_driver%Final()
369 call this%trcadv_driver%Final()
371 if (this%CALC_NUMDIFF_FLAG)
call this%numdiff%Final()
373 call this%dyn_vars%Final()
376 end subroutine atmosdyn_finalize
381 subroutine setup_coriolis_parameter( this, atm_mesh )
387 class(atmosdynvars),
target,
intent(inout) :: this
388 class(atmosmesh),
target,
intent(in) :: atm_mesh
395 character(len=H_SHORT) :: CORIOLIS_type
396 real(RP) :: CORIOLIS_f0 = 0.0_rp
397 real(RP) :: CORIOLIS_beta = 0.0_rp
398 real(RP) :: CORIOLIS_y0
400 namelist /param_atmos_dyn_coriolis/ &
402 coriolis_f0, coriolis_beta, coriolis_y0
409 mesh3d => atm_mesh%ptr_mesh
411 coriolis_type =
'NONE'
415 coriolis_y0 = 0.5_rp*(mesh3d%ymax_gl + mesh3d%ymin_gl)
419 read(io_fid_conf,nml=param_atmos_dyn_coriolis,iostat=ierr)
421 log_info(
"ATMOS_DYN_setup_coriolis",*)
'Not found namelist. Default used.'
422 else if( ierr > 0 )
then
423 log_error(
"ATMOS_DYN_setup_coriolis",*)
'Not appropriate names in namelist PARAM_ATMOS_DYN_CORIOLIS. Check!'
426 log_nml(param_atmos_dyn_coriolis)
428 do n = 1, mesh3d%LOCAL_MESH_NUM
429 call atmosdynauxvars_getlocalmeshfields( n, mesh3d, this%AUXVARS2D_manager, &
431 lcmesh2d => lcmesh3d%lcmesh2D
434 coriolis%val(:,lcmesh2d%NeS:lcmesh2d%NeE), &
435 coriolis_type, lcmesh2d%refElem2D%Np * lcmesh2d%Ne, &
436 lcmesh2d%pos_en(:,:,2), coriolis_f0, coriolis_beta, coriolis_y0, &
437 lcmesh3d%lat2D(:,:) )
441 end subroutine setup_coriolis_parameter
605end module mod_atmos_dyn
module ATMOSPHERE dynamics
integer, parameter, public atmos_dyn_auxvars2d_coriolis_id
subroutine, public atmosdynauxvars_getlocalmeshfields(domid, mesh, auxvars_list, coriolis, lcmesh3d)
module ATMOSPHERE dynamics
subroutine atmosdyn_setup(this, model_mesh, tm_parent_comp)
Setup a component of atmospheric dynamics.
module ATMOSPHERE / Variables
subroutine, public atmosvars_getlocalmeshprgvar(domid, mesh, prgvars_list, auxvars_list, varid, var, dens_hyd, pres_hyd, lcmesh3d)
subroutine, public atmosvars_getlocalmeshprgvars(domid, mesh, prgvars_list, auxvars_list, ddens, momx, momy, momz, therm, dens_hyd, pres_hyd, rtot, cvtot, cptot, lcmesh3d)
subroutine, public atmosvars_getlocalmeshqtrcphytend(domid, mesh, phytends_list, qtrcid, rhoq_tp)
subroutine, public atmosvars_getlocalmeshqtrcvar(domid, mesh, trcvars_list, varid, var, lcmesh3d)
module FElib / Fluid dyn solver / Atmosphere / driver (3D nonhydrostatic model)
module FElib / Fluid dyn solver / Atmosphere / DGM driver (tracer advection)
integer, parameter, public massflx_x_id
integer, parameter, public trcvars3d_dens0_id
integer, parameter, public trcvars3d_dens_id
integer, parameter, public massflx_z_id
integer, parameter, public massflx_y_id
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Common
integer, parameter, public prgvar_ddens_id
integer, parameter, public prgvar_num
module Atmosphere / Dynamics common
module common / Coriolis parameter
subroutine, public get_coriolis_parameter(coriolis, colioris_type, np, y, f0, beta, y0, lat)
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 atmospheric dynamics.
Derived type to provide a driver of dynamical core with the atmospheric nonhydrostatic equations.