11#include "scaleFElib.h"
55 character(len=H_SHORT) :: mesh_type
67 procedure,
public :: setup_vars => atmos_setup_vars
68 procedure,
public :: calc_tendency => atmos_calc_tendency
69 procedure,
public :: update => atmos_update
70 procedure,
public :: set_surface => atmos_set_surface
71 procedure,
public :: finalize => atmos_finalize
92 use scale_const,
only: &
93 undef8 => const_undef8
95 use scale_atmos_hydrometeor,
only: &
96 atmos_hydrometeor_dry, &
97 atmos_hydrometeor_regist
98 use scale_atmos_thermodyn,
only: &
100 use scale_atmos_saturation,
only: &
101 atmos_saturation_setup
112 logical :: ACTIVATE_FLAG = .true.
114 real(DP) :: TIME_DT = undef8
115 character(len=H_SHORT) :: TIME_DT_UNIT =
'SEC'
116 real(DP) :: TIME_DT_RESTART = undef8
117 character(len=H_SHORT) :: TIME_DT_RESTART_UNIT =
'SEC'
119 logical :: ATMOS_DYN_DO = .true.
120 logical :: ATMOS_PHY_SF_DO = .false.
121 logical :: ATMOS_PHY_TB_DO = .false.
122 logical :: ATMOS_PHY_MP_DO = .false.
123 character(len=H_SHORT) :: ATMOS_MESH_TYPE =
'REGIONAL'
125 logical :: ATMOS_USE_QV = .false.
128 namelist / param_atmos / &
133 time_dt_restart_unit, &
143 call prof_rapstart(
'ATM_setup', 1)
144 log_info(
'AtmosComponent_setup',*)
'Atmosphere model components '
148 read(io_fid_conf,nml=param_atmos,iostat=ierr)
150 log_info(
"ATMOS_setup",*)
'Not found namelist. Default used.'
151 elseif( ierr > 0 )
then
152 log_error(
"ATM_setup",*)
'Not appropriate names in namelist PARAM_ATMOS. Check!'
158 call this%ModelComponent_Init(
'ATMOS', activate_flag )
159 if ( .not. activate_flag )
return
163 call this%time_manager%Init( this%GetComponentName(), &
164 time_dt, time_dt_unit, &
165 time_dt_restart, time_dt_restart_unit )
171 this%mesh_type = atmos_mesh_type
172 select case( this%mesh_type )
174 call this%mesh_rm%Init()
176 this%mesh => this%mesh_rm
178 call this%mesh_gm%Init()
180 this%mesh => this%mesh_gm
182 log_error(
"ATM_setup",*)
'Unsupported type of mesh is specified. Check!', this%mesh_type
188 call atmos_thermodyn_setup
189 call atmos_saturation_setup
194 call this%phy_sfc_proc%ModelComponentProc_Init(
'AtmosPhysSfc', atmos_phy_sf_do )
195 call this%phy_sfc_proc%setup( this%mesh, this%time_manager )
198 call this%phy_mp_proc%ModelComponentProc_Init(
'AtmosPhysMp', atmos_phy_mp_do )
199 call this%phy_mp_proc%setup( this%mesh, this%time_manager )
202 if ( atmos_hydrometeor_dry .and. atmos_use_qv )
then
203 log_info(
"ATMOS_setup",*)
"Regist QV"
204 call atmos_hydrometeor_regist( 0, 0, &
206 (/
'Ratio of Water Vapor mass to total mass (Specific humidity)'/), &
208 this%phy_mp_proc%vars%QS )
210 this%phy_mp_proc%vars%QA = 1
211 this%phy_mp_proc%vars%QE = this%phy_mp_proc%vars%QS
215 call this%dyn_proc%ModelComponentProc_Init(
'AtmosDyn', atmos_dyn_do )
216 call this%dyn_proc%setup( this%mesh, this%time_manager )
219 call this%phy_tb_proc%ModelComponentProc_Init(
'AtmosPhysTb', atmos_phy_tb_do )
220 call this%phy_tb_proc%setup( this%mesh, this%time_manager )
221 call this%phy_tb_proc%SetDynBC( this%dyn_proc%dyncore_driver%boundary_cond )
224 log_info(
'AtmosComponent_setup',*)
'Finish setup of each atmospheric components.'
226 call prof_rapend(
'ATM_setup', 1)
233 subroutine atmos_setup_vars( this )
239 call prof_rapstart(
'ATM_setup_vars', 1)
241 call this%vars%Init( this%mesh )
242 call this%vars%Regist_physvar_manager( &
243 this%phy_mp_proc%vars%auxvars2D_manager )
245 call prof_rapend(
'ATM_setup_vars', 1)
248 end subroutine atmos_setup_vars
252 subroutine atmos_calc_tendency( this, force )
253 use scale_tracer,
only: qa
267 logical,
intent(in) :: force
275 integer :: tm_process_id
283 call prof_rapstart(
'ATM_tendency', 1)
286 call this%mesh%GetModelMesh( mesh )
294 call prof_rapstart(
'ATM_exchange_prgv', 2)
295 call this%vars%PROGVARS_manager%MeshFieldComm_Exchange()
296 if ( qa > 0 )
call this%vars%QTRCVARS_manager%MeshFieldComm_Exchange()
297 call prof_rapend(
'ATM_exchange_prgv', 2)
301 do n=1, mesh%LOCAL_MESH_NUM
303 tp_list(dens_tp)%ptr, tp_list(momx_tp)%ptr, tp_list(momy_tp)%ptr, &
304 tp_list(momz_tp)%ptr, tp_list(rhot_tp)%ptr, tp_list(rhoh_p )%ptr, tp_qtrc, &
310 do ke=lcmesh%NeS, lcmesh%NeE
311 tp_list(v)%ptr%val(:,ke) = 0.0_rp
316 do ke=lcmesh%NeS, lcmesh%NeE
317 tp_qtrc(iq)%ptr%val(:,ke) = 0.0_rp
326 if ( this%phy_mp_proc%IsActivated() )
then
327 call prof_rapstart(
'ATM_Microphysics', 1)
328 tm_process_id = this%phy_mp_proc%tm_process_id
329 is_update = this%time_manager%Do_process(tm_process_id) .or. force
330 call this%phy_mp_proc%calc_tendency( &
331 this%mesh, this%vars%PROGVARS_manager, this%vars%QTRCVARS_manager, &
332 this%vars%AUXVARS_manager, this%vars%PHYTENDS_manager, is_update )
333 call prof_rapend(
'ATM_Microphysics', 1)
341 if ( this%phy_tb_proc%IsActivated() )
then
342 call prof_rapstart(
'ATM_Turbulence', 1)
343 tm_process_id = this%phy_tb_proc%tm_process_id
344 is_update = this%time_manager%Do_process(tm_process_id) .or. force
345 call this%phy_tb_proc%calc_tendency( &
346 this%mesh, this%vars%PROGVARS_manager, this%vars%QTRCVARS_manager, &
347 this%vars%AUXVARS_manager, this%vars%PHYTENDS_manager, is_update )
348 call prof_rapend(
'ATM_Turbulence', 1)
358 if ( this%phy_sfc_proc%IsActivated() )
then
359 call prof_rapstart(
'ATM_SurfaceFlux', 1)
360 tm_process_id = this%phy_sfc_proc%tm_process_id
361 is_update = this%time_manager%Do_process(tm_process_id) .or. force
362 call this%phy_sfc_proc%calc_tendency( &
363 this%mesh, this%vars%PROGVARS_manager, this%vars%QTRCVARS_manager, &
364 this%vars%AUXVARS_manager, this%vars%PHYTENDS_manager, is_update )
365 call prof_rapend(
'ATM_SurfaceFlux', 1)
372 call prof_rapend(
'ATM_tendency', 1)
374 end subroutine atmos_calc_tendency
378 subroutine atmos_update( this )
382 integer :: tm_process_id
386 call prof_rapstart(
'ATM_update', 1)
390 if ( this%dyn_proc%IsActivated() )
then
391 call prof_rapstart(
'ATM_Dynamics', 1)
392 tm_process_id = this%dyn_proc%tm_process_id
393 is_update = this%time_manager%Do_process( tm_process_id )
395 log_progress(*)
'atmosphere / dynamics'
396 do inner_itr=1, this%time_manager%Get_process_inner_itr_num( tm_process_id )
397 call this%dyn_proc%update( &
398 this%mesh, this%vars%PROGVARS_manager, this%vars%QTRCVARS_manager, &
399 this%vars%AUXVARS_manager, this%vars%PHYTENDS_manager, is_update )
401 call prof_rapend(
'ATM_Dynamics', 1)
406 call this%vars%Calc_diagnostics()
407 call this%vars%AUXVARS_manager%MeshFieldComm_Exchange()
417 call this%vars%Check()
419 call prof_rapend(
'ATM_update', 1)
421 end subroutine atmos_update
424 subroutine atmos_set_surface( this )
443 call prof_rapstart(
'ATM_sfc_exch', 1)
445 call this%mesh%GetModelMesh( mesh )
448 call mesh%GetMesh2D( mesh2d )
453 do n=1, mesh2d%LOCAL_MESH_NUM
455 mesh2d, this%vars%AUXVARS2D_manager, &
456 prec, prec_engi, lcmesh )
459 do ke=lcmesh%NeS, lcmesh%NeE
460 prec %val(:,ke) = 0.0_rp
461 prec_engi%val(:,ke) = 0.0_rp
464 if ( this%phy_mp_proc%IsActivated() )
then
466 mesh2d, this%phy_mp_proc%vars%auxvars2D_manager, &
467 sflx_rain_mp, sflx_snow_mp, sflx_engi_mp )
470 do ke=lcmesh%NeS, lcmesh%NeE
471 prec %val(:,ke) = prec %val(:,ke) + sflx_rain_mp%val(:,ke) + sflx_snow_mp%val(:,ke)
472 prec_engi%val(:,ke) = prec_engi%val(:,ke) + sflx_engi_mp%val(:,ke)
477 call prof_rapend(
'ATM_sfc_exch', 1)
480 end subroutine atmos_set_surface
484 subroutine atmos_finalize( this )
489 log_info(
'AtmosComponent_finalize',*)
491 if ( .not. this%IsActivated() )
return
493 call this%dyn_proc%finalize()
494 call this%phy_sfc_proc%finalize()
495 call this%phy_tb_proc%finalize()
496 call this%phy_mp_proc%finalize()
498 call this%vars%Final()
500 select case( this%mesh_type )
502 call this%mesh_rm%Final()
504 call this%mesh_gm%Final()
508 call this%time_manager%Final()
511 end subroutine atmos_finalize
module Atmosphere component
subroutine atmos_setup(this)
Setup an object to mange atmospheric component.
module Atmosphere / Dynamics
module Atmosphere / Physics / Cloud Microphysics
subroutine, public atmosphympvars_getlocalmeshfields_sfcflx(domid, mesh, sfcflx_list, sflx_rain, sflx_snow, sflx_engi)
module Atmosphere / Physics / cloud microphysics
module Atmosphere / Physics / surface process
module Atmosphere / Physics / sub-grid scale turbulence process
module Atmosphere / Physics / Variables
subroutine, public atmosvars_getlocalmeshsfcvar(domid, mesh, auxvars2d_list, prec, prec_engi, lcmesh2d)
subroutine, public atmosvars_getlocalmeshphytends(domid, mesh, phytends_list, dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, rhoh_p, rhoq_tp, lcmesh3d)
module FElib / Fluid dyn solver / Atmosphere / Nonhydrostatic model / Common
integer, parameter, public phytend_momz_id
integer, parameter, public phytend_rhot_id
integer, parameter, public phytend_momx_id
integer, parameter, public phytend_num
integer, parameter, public phytend_momy_id
integer, parameter, public phytend_rhoh_id
integer, parameter, public phytend_dens_id
module FElib / File / History
subroutine, public file_history_meshfield_setup(mesh1d_, mesh2d_, mesh3d_, meshcubedsphere2d_, meshcubedsphere3d_)
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Data / base
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
FElib / model framework / model component.
FElib / model framework / mesh manager.
subroutine, public time_manager_regist_component(tmanager_comp)
Derived type to manage atmospheric component.
Derived type to manage a component of atmospheric dynamics.
Derived type to manage a computational mesh (base class)
Derived type to manage a computational mesh of global atmospheric model.
Derived type to manage a computational mesh of regional atmospheric model.
Derived type to manage a component of cloud microphysics.
Derived type to manage a component of surface process.
Derived type to manage a component of sub-grid scale turbulent process.
Derived type to manage variables with atmospheric component.
Derived type to manage a local 3D computational domain.
Derived type representing a field with local mesh (base type)