11#include "scaleFElib.h"
21 use scale_const,
only: &
22 undef8 => const_undef8
23 use scale_tracer,
only: qa
70 logical :: gfilter_flag
73 logical :: modalfilter_flag
77 procedure,
public :: calc_tendency => atmosphytb_calc_tendency
78 procedure,
public :: update => atmosphytb_update
79 procedure,
public :: finalize => atmosphytb_finalize
80 procedure,
public :: setdynbc => atmosphytb_setdynbc
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) :: TB_TYPE =
'SMAGORINSKY'
119 character(len=H_SHORT) :: PostGLFilter_Type =
'None'
120 character(len=H_SHORT) :: PostGLFilter_ConvFilterShape =
'GAUSSIAN'
121 integer :: PostGLFilter_Nnodeh1D_reconst = -1
122 real(RP) :: PostGLFilter_GaussinWidthFac = 1.5_rp
123 real(RP) :: PostModalFilter_ALPHA_h = 0.0_rp
124 real(RP) :: PostModalFilter_EtaC_h = 0.0_rp
125 integer :: PostModalFilter_ORDER_h = 16
126 real(RP) :: PostModalFilter_ALPHA_v = 0.0_rp
127 integer :: PostModalFilter_ORDER_v = 16
129 namelist /param_atmos_phy_tb/ &
134 postglfilter_nnodeh1d_reconst, &
135 postglfilter_gaussinwidthfac, &
136 postmodalfilter_alpha_h, &
137 postmodalfilter_etac_h, &
138 postmodalfilter_order_h, &
139 postmodalfilter_alpha_v, &
140 postmodalfilter_order_v
144 class(
meshbase),
pointer :: ptr_mesh
152 if (.not. this%IsActivated())
return
155 log_info(
"ATMOS_PHY_TB_setup",*)
'Setup'
159 read(io_fid_conf,nml=param_atmos_phy_tb,iostat=ierr)
161 log_info(
"ATMOS_PHY_TB_setup",*)
'Not found namelist. Default used.'
162 elseif( ierr > 0 )
then
163 log_error(
"ATMOS_PHY_TB_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_TB. Check!'
166 log_nml(param_atmos_phy_tb)
170 call model_mesh%GetModelMesh( ptr_mesh )
171 select type(model_mesh)
173 atm_mesh => model_mesh
178 call tm_parent_comp%Regist_process(
'ATMOS_PHY_TB', time_dt, time_dt_unit, &
181 dtsec = tm_parent_comp%process_list(this%tm_process_id)%dtsec
184 call this%vars%Init( model_mesh )
187 call this%tb_driver%Init( tb_type, dtsec, atm_mesh )
190 this%dyn_bnd => null()
194 select case( trim(postglfilter_type) )
195 case (
'ConvolFilter',
'Reconstruction',
'Reconstruction2')
196 this%gFilter_flag = .true.
197 case (
'None',
'ModalFilter')
198 this%gFilter_flag = .false.
200 log_info(
"ATMOS_PHY_TB_setup",*)
'Not appropriate names of PostGLFilter_Type in namelist PARAM_ATMOS_PHY_TB. Check!'
205 if ( this%gFilter_flag )
then
206 if ( postglfilter_nnodeh1d_reconst < 0 )
then
207 elem3d=> atm_mesh%ptr_mesh%lcmesh_list(1)%refElem3D
208 postglfilter_nnodeh1d_reconst = elem3d%Nnode_h1D
210 call this%gFilter_phy_tb%Init( postglfilter_type, &
211 postglfilter_convfiltershape, postglfilter_gaussinwidthfac, &
212 postglfilter_nnodeh1d_reconst, &
213 2, 0, 0, atm_mesh%ptr_mesh )
215 if ( postmodalfilter_alpha_h > 0.0_rp .or. postmodalfilter_alpha_v > 0.0_rp )
then
216 this%modalFilter_flag = .true.
217 elem3d=> atm_mesh%ptr_mesh%lcmesh_list(1)%refElem3D
218 call elem3d_hex%Init( elem3d%PolyOrder_h, elem3d%PolyOrder_v, .false. )
219 call this%modalfilter_3D%Init( elem3d_hex, postmodalfilter_etac_h, postmodalfilter_alpha_h, postmodalfilter_order_h, 0.0_rp, postmodalfilter_alpha_v, postmodalfilter_order_v )
220 call elem3d_hex%Final()
222 this%modalFilter_flag = .false.
238 subroutine atmosphytb_calc_tendency( &
239 this, model_mesh, prgvars_list, trcvars_list, &
240 auxvars_list, forcing_list, is_update )
242 use scale_tracer,
only: &
250 atmosvars_getlocalmeshprgvars, &
251 atmosvars_getlocalmeshprgvar, &
252 atmosvars_getlocalmeshqtrcvar, &
253 atmosvars_getlocalmeshphyauxvars, &
254 atmosvars_getlocalmeshphytends
261 class(modelmeshbase),
intent(in) :: model_mesh
266 logical,
intent(in) :: is_update
275 class(
localmeshfieldbase),
pointer :: DENS_tp, MOMX_tp, MOMY_tp, MOMZ_tp, RHOT_tp, RHOH_P
282 if (.not. this%IsActivated())
return
286 log_progress(*)
'atmosphere / physics / turbulence'
288 call model_mesh%GetModelMesh( mesh )
295 call this%tb_driver%Tendency( this%vars%tends_manager, &
296 prgvars_list, trcvars_list, auxvars_list, &
297 this%vars%auxvars_manager, this%vars%diagvars_manager, &
299 model_mesh%DOptrMat(1), model_mesh%DOptrMat(2), model_mesh%DOptrMat(3), &
300 model_mesh%SOptrMat(1), model_mesh%SOptrMat(2), model_mesh%SOptrMat(3), &
301 model_mesh%LiftOptrMat, mesh3d, &
302 this%gFilter_flag, this%gFilter_phy_tb, this%vars%diagvars(nu_vid:kh_vid), &
303 this%modalFilter_flag, this%modalfilter_3D )
306 call prof_rapstart(
'ATM_PHY_TB_add_tend', 2)
307 do n=1, mesh%LOCAL_MESH_NUM
308 call atmosvars_getlocalmeshphytends( n, &
309 mesh, forcing_list, &
310 dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, &
314 mesh, this%vars%tends_manager, &
315 tb_momx_t, tb_momy_t, tb_momz_t, tb_rhot_t, tb_rhoq_t_list, &
320 do ke=lcmesh%NeS, lcmesh%NeE
321 momx_tp%val(:,ke) = momx_tp%val(:,ke) + tb_momx_t%val(:,ke)
322 momy_tp%val(:,ke) = momy_tp%val(:,ke) + tb_momy_t%val(:,ke)
323 momz_tp%val(:,ke) = momz_tp%val(:,ke) + tb_momz_t%val(:,ke)
324 rhot_tp%val(:,ke) = rhot_tp%val(:,ke) + tb_rhot_t%val(:,ke)
328 if ( .not. tracer_advc(iq) ) cycle
330 do ke = lcmesh%NeS, lcmesh%NeE
331 rhoq_tp(iq)%ptr%val(:,ke) = rhoq_tp(iq)%ptr%val(:,ke) &
332 + tb_rhoq_t_list(iq)%ptr%val(:,ke)
338 call prof_rapend(
'ATM_PHY_TB_add_tend', 2)
341 end subroutine atmosphytb_calc_tendency
352 subroutine atmosphytb_update( this, model_mesh, prgvars_list, trcvars_list, auxvars_list, forcing_list, is_update )
356 class(modelmeshbase),
intent(in) :: model_mesh
361 logical,
intent(in) :: is_update
365 end subroutine atmosphytb_update
370 subroutine atmosphytb_finalize( this )
375 if (.not. this%IsActivated())
return
377 call this%tb_driver%Final()
378 call this%vars%Final()
381 end subroutine atmosphytb_finalize
388 subroutine atmosphytb_setdynbc( this, dyn_bnd )
391 type(
atmdynbnd),
intent(in),
target :: dyn_bnd
394 this%dyn_bnd => dyn_bnd
397 end subroutine atmosphytb_setdynbc
module Atmosphere / Physics / sub-grid scale turbulence
subroutine, public atmosphytbvars_getlocalmeshfields_tend(domid, mesh, tb_tends_list, tb_momx_t, tb_momy_t, tb_momz_t, tb_rhot_t, tb_rhoq_t, lcmesh3d)
module Atmosphere / Physics / sub-grid scale turbulence process
subroutine atmosphytb_setup(this, model_mesh, tm_parent_comp)
Setup a component of SGS turbulence process.
module Atmosphere / Variables
module FElib / Fluid dyn solver / Atmosphere / Boundary
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Common
integer, parameter, public prgvar_ddens_id
module FElib / Fluid dyn solver / Atmosphere / Physics turbulence / Common
integer, parameter, public atmos_phy_tb_diag_kh_id
integer, parameter, public atmos_phy_tb_diag_nu_id
module FElib / Physics turbulence / Atmosphere / driver
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Element/ ModalFilter
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
module FElib / Data / Filter operation
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 sub-grid scale turbulent process.
Derived type to manage variables with atmospheric SGS turbulent component.
A derived type useful for apply boundary conditions.
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 hexahedral element.
Derived type representing a modal filter.
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 (base type)
Derived type to represent filter operation for 3D mesh field.