11#include "scaleFElib.h"
21 use scale_const,
only: &
22 undef8 => const_undef8
65 integer :: atm_var_container_typeid
72 logical :: use_delta_form
74 procedure :: setup => atmosphybl_setup
75 procedure :: calc_tendency => atmosphybl_calc_tendency
76 procedure :: update => atmosphybl_update
77 procedure :: finalize => atmosphybl_finalize
78 procedure,
public :: setdynbc => atmosphybl_setdynbc
101 subroutine atmosphybl_setup( this, model_mesh, tm_parent_comp )
102 use scale_tracer,
only: qa
111 class(modelmeshbase),
target,
intent(in) :: model_mesh
114 real(dp) :: time_dt = undef8
115 character(len=H_SHORT) :: time_dt_unit =
'SEC'
117 character(len=H_MID) :: bl_type =
'NONE'
118 integer :: atm_var_container_typeid
119 real(rp) :: c_ip = 1.0_rp
120 logical :: use_delta_form = .false.
122 namelist /param_atmos_phy_bl/ &
126 atm_var_container_typeid, &
131 class(
meshbase),
pointer :: ptr_mesh
137 integer :: qs_bl, qe_bl, qa_bl
140 if (.not. this%IsActivated())
return
143 log_info(
"ATMOS_PHY_BL_setup",*)
'Setup'
149 read(io_fid_conf,nml=param_atmos_phy_bl,iostat=ierr)
151 log_info(
"ATMOS_PHY_BL_setup",*)
'Not found namelist. Default used.'
152 elseif( ierr > 0 )
then
153 log_error(
"ATMOS_PHY_BL_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_BL. Check!'
156 log_nml(param_atmos_phy_bl)
158 this%atm_var_container_typeid = atm_var_container_typeid
160 this%use_delta_form = use_delta_form
164 call model_mesh%GetModelMesh( ptr_mesh )
165 select type(model_mesh)
167 atm_mesh => model_mesh
172 call tm_parent_comp%Regist_process(
'ATMOS_PHY_BL', time_dt, time_dt_unit, &
175 this%dtsec = tm_parent_comp%process_list(this%tm_process_id)%dtsec
179 select case( bl_type )
180 case(
'MYNN_LEVEL2' )
187 log_error(
"ATMOS_PHY_BL_setup",*)
'Not appropriate PBL turbulence parameterization type. Check!'
191 qe_bl = qs_bl + qa_bl - 1
194 call this%vars%Init( model_mesh, qs_bl, qe_bl, qa_bl )
197 call this%v_elem1D%Init( atm_mesh%ptr_mesh%refElem3D%PolyOrder_v, .false. )
200 end subroutine atmosphybl_setup
212 subroutine atmosphybl_calc_tendency( &
213 this, model_mesh, prgvars_list, trcvars_list, &
214 auxvars_list, forcing_list, is_update )
215 use scale_tracer,
only: &
238 class(modelmeshbase),
intent(in) :: model_mesh
243 logical,
intent(in) :: is_update
258 class(
localmeshfieldbase),
pointer :: dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, rhoh_p
265 logical,
allocatable :: is_bound(:,:)
267 type(dyn_bndinfo),
allocatable :: bnd_info(:)
270 if (.not. this%IsActivated())
return
272 log_progress(*)
'atmosphere / physics / planetary boundary layer'
274 call model_mesh%GetModelMesh( mesh )
281 if ( is_update )
then
282 call prof_rapstart(
'ATM_BL_tendency', 2)
284 allocate( bnd_info(mesh3d%LOCAL_MESH_NUM) )
286 do n=1, mesh3d%LOCAL_MESH_NUM
288 mesh, prgvars_list, auxvars_list, &
289 ddens, momx, momy, momz, drhot, &
290 dens_hyd, pres_hyd, rtot, cvtot, cptot, &
294 mesh, auxvars_list, &
298 mesh, trcvars_list, &
302 mesh, this%vars%tends_manager, &
303 bl_rhou_t, bl_rhov_t, bl_rhot_t, bl_rhoq_t_list )
306 allocate( bnd_info(n)%is_bound(lcmesh%refElem3D%NfpTot,lcmesh%Ne) )
307 call this%dyn_bnd%Inquire_bound_flag( bnd_info(n)%is_bound, &
308 n, lcmesh%VMapM, lcmesh%VMapP, lcmesh%VMapB, &
309 lcmesh, lcmesh%refElem3D )
311 select case( this%BL_TYPEID )
314 this%vars%diagvars(nu_id)%local(n)%val, &
315 this%vars%diagvars(kh_id)%local(n)%val, &
316 this%vars%diagvars(tke_id)%local(n)%val, &
317 ddens%val, momx%val, momy%val, momz%val, drhot%val, &
318 dens_hyd%val, pres_hyd%val, rtot%val, pres%val, pt%val, &
319 model_mesh%DOptrMat(3), model_mesh%LiftOptrMat, &
320 lcmesh, lcmesh%refElem3D, bnd_info(n)%is_bound )
324 bl_rhou_t%val, bl_rhov_t%val, bl_rhot_t%val, &
326 ddens%val, momx%val, momy%val, drhot%val, &
328 pt%val, dens_hyd%val, pres_hyd%val, &
329 this%vars%diagvars(nu_id)%local(n)%val, &
330 this%vars%diagvars(kh_id)%local(n)%val, &
331 model_mesh%element3D_operation, &
332 this%C_IP, this%dtsec, &
333 lcmesh, lcmesh%refElem3D, this%v_elem1D, &
334 bnd_info(n)%is_bound, this%use_delta_form )
338 do n=1, mesh3d%LOCAL_MESH_NUM
339 deallocate( bnd_info(n)%is_bound )
341 call prof_rapend(
'ATM_BL_tendency', 2)
344 call prof_rapstart(
'ATM_PHY_BL_add_tend', 2)
345 do n=1, mesh%LOCAL_MESH_NUM
347 mesh, forcing_list, &
348 dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, &
352 mesh, this%vars%tends_manager, &
353 bl_rhou_t, bl_rhov_t, bl_rhot_t, bl_rhoq_t_list, &
358 do ke=lcmesh%NeS, lcmesh%NeE
359 momx_tp%val(:,ke) = momx_tp%val(:,ke) + bl_rhou_t%val(:,ke)
360 momy_tp%val(:,ke) = momy_tp%val(:,ke) + bl_rhov_t%val(:,ke)
361 rhot_tp%val(:,ke) = rhot_tp%val(:,ke) + bl_rhot_t%val(:,ke)
365 if ( .not. tracer_advc(iq) ) cycle
367 do ke=lcmesh%NeS, lcmesh%NeE
368 rhoq_tp(iq)%ptr%val(:,ke) = rhoq_tp(iq)%ptr%val(:,ke) &
369 + bl_rhoq_t_list(iq)%ptr%val(:,ke)
375 call prof_rapend(
'ATM_PHY_BL_add_tend', 2)
378 end subroutine atmosphybl_calc_tendency
389 subroutine atmosphybl_update( this, model_mesh, &
390 prgvars_list, trcvars_list, &
391 auxvars_list, forcing_list, is_update )
395 class(modelmeshbase),
intent(in) :: model_mesh
400 logical,
intent(in) :: is_update
403 end subroutine atmosphybl_update
408 subroutine atmosphybl_finalize( this )
415 if (.not. this%IsActivated())
return
417 select case ( this%BL_TYPEID )
422 call this%vars%Final()
423 call this%v_elem1D%Final()
425 end subroutine atmosphybl_finalize
432 subroutine atmosphybl_setdynbc( this, dyn_bnd )
435 type(
atmdynbnd),
intent(in),
target :: dyn_bnd
438 this%dyn_bnd => dyn_bnd
441 end subroutine atmosphybl_setdynbc
module Atmosphere / Physics / Planetary Boundary Layer Turbulence
integer, parameter, public atmos_phy_bl_rhot_t_id
integer, parameter, public atmos_phy_bl_rhov_t_id
integer, parameter, public atmos_phy_bl_rhou_t_id
integer, parameter, public atmos_phy_bl_diag_kh_id
subroutine, public atmosphyblvars_getlocalmeshfields_tend(domid, mesh, bl_tends_list, bl_rhou_t, bl_rhov_t, bl_rhot_t, bl_rhoq_t, lcmesh3d)
integer, parameter, public atmos_phy_bl_diag_tke_id
integer, parameter, public atmos_phy_bl_diag_nu_id
module Atmosphere / Physics / Planetary Boundary Layer
integer, parameter bl_typeid_mynn_level2
Type ID of MYNN Level 2 PBL scheme.
module Atmosphere / Variables
subroutine, public atmosvars_getlocalmeshphytends(domid, mesh, phytends_list, dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, rhoh_p, rhoq_tp, lcmesh3d)
integer, parameter, public atm_vars_container_primary_id
subroutine, public atmosvars_getlocalmeshphyauxvars(domid, mesh, phyauxvars_list, pres, pt, 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_getlocalmeshqtrcvarlist(domid, mesh, trcvars_list, varid_s, var_list, lcmesh3d)
module Atmosphere / Variables
module FElib / Fluid dyn solver / Atmosphere / Boundary
module FElib / Atmosphere / Physics / boundary layer turbulence
subroutine, public atm_phy_bl_dgm_common_calc_tendency(rhou_tp, rhov_tp, drhot_tp, rhoq_tp_list, ddens_, momx_, momy_, drhot_, qtrc_list, pt_, dens_hyd, pres_hyd, nu, kh, element3d_operation, c_ip, dtsec, lmesh, elem, elem1d, is_bound, use_delta_form)
Calculate tendency with PBL turbulence models.
module FElib / Atmosphere / Physics / boundary layer turbulence
subroutine, public atm_phy_bl_dgm_mynn_lv2_init(mesh)
Initialize a module of MYNN Level 2 PBL turbulence parameterization.
subroutine, public atm_phy_bl_dgm_mynn_lv2_cal_vviscdiffcoef(nu, kh, tke, ddens_, momx_, momy_, momz_, drhot_, dens_hyd, pres_hyd, rtot, pres, pt, dz, lift, lmesh, elem, is_bound)
subroutine, public atm_phy_bl_dgm_mynn_lv2_final()
Finalize a module of MYNN Level 2 PBL turbulence parameterization.
module FElib / Element / Base
module FElib / Element / line
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 / Data / base
FElib / model framework / physics process.
FElib / model framework / mesh manager.
FElib / model framework / variable manager.
Derived type to manage a computational mesh (base class)
Derived type to manage a component of planetary boundary layer (PBL) turbulence parameterization in a...
Derived type to manage variables with planetary boundary layer (PBL) turbulence parameterization comp...
Derived type to manage a set of variables (prognostic variables, tracer variables,...
A derived type useful for apply boundary conditions.
Derived type representing a 1D reference element.
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 line 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 representing a field with 3D mesh.
Derived type representing a field (base type)