SCALE-RM
Functions/Subroutines
scale_atmos_dyn_tstep_large_fvm_heve Module Reference

module Atmosphere / Dynamics More...

Functions/Subroutines

subroutine, public atmos_dyn_tstep_large_fvm_heve_setup (DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, mflx_hi)
 Setup. More...
 
subroutine, public atmos_dyn_tstep_large_fvm_heve (DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, DENS_av, MOMZ_av, MOMX_av, MOMY_av, RHOT_av, QTRC_av, mflx_hi, tflx_hi, num_diff, num_diff_q, QTRC0, DENS_tp, MOMZ_tp, MOMX_tp, MOMY_tp, RHOT_tp, RHOQ_tp, CORIOLI, CDZ, CDX, CDY, FDZ, FDX, FDY, RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, PHI, GSQRT, J13G, J23G, J33G, MAPF, AQ_R, AQ_CV, AQ_CP, AQ_MASS, REF_dens, REF_pott, REF_qv, REF_pres, BND_W, BND_E, BND_S, BND_N, ND_COEF, ND_COEF_Q, ND_ORDER, ND_SFC_FACT, ND_USE_RS, BND_QA, BND_SMOOTHER_FACT, DAMP_DENS, DAMP_VELZ, DAMP_VELX, DAMP_VELY, DAMP_POTT, DAMP_QTRC, DAMP_alpha_DENS, DAMP_alpha_VELZ, DAMP_alpha_VELX, DAMP_alpha_VELY, DAMP_alpha_POTT, DAMP_alpha_QTRC, wdamp_coef, divdmp_coef, FLAG_TRACER_SPLIT_TEND, FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_TRACER, FLAG_FCT_ALONG_STREAM, USE_AVERAGE, I_QV, DTLS, DTSS, Llast)
 Dynamical Process. More...
 
subroutine check_mass (DENS, DAMP_DENS, mflx_hi, tflx_hi, GSQRT, MAPF, RCDX, RCDY, dt, step, BND_W, BND_E, BND_S, BND_N)
 

Detailed Description

module Atmosphere / Dynamics

Description
HEVE FVM scheme for large time step in Atmospheric dynamical process
Author
Team SCALE
NAMELIST
  • No namelist group
History Output
namedescriptionunitvariable
ALLMOM_lb_hz horizontally total momentum flux from lateral boundary (w/ CHECK_MASS) kg/m2/s allmflx_lb_horizontal
DENS_t_damp tendency of dencity due to damping (w/ HIST_TEND) kg/m3/s damp_t
DENS_t_phys tendency of dencity due to physics (w/ HIST_TEND) kg/m3/s DENS_tp
MFLXX momentum flux of x-direction (w/ CHECK_MASS) kg/m2/s mflx_hi
MFLXY momentum flux of y-direction (w/ CHECK_MASS) kg/m2/s mflx_hi
MFLXZ momentum flux of z-direction (w/ CHECK_MASS) kg/m2/s mflx_hi
MOMX_t_damp tendency of momentum x due to damping (w/ HIST_TEND) kg/m2/s2 damp_t
MOMX_t_phys tendency of momentum x due to physics (w/ HIST_TEND) kg/m2/s2 MOMX_tp
MOMY_t_damp tendency of momentum y due to damping (w/ HIST_TEND) kg/m2/s2 damp_t
MOMY_t_phys tendency of momentum y due to physics (w/ HIST_TEND) kg/m2/s2 MOMY_tp
MOMZ_t_damp tendency of momentum z due to damping (w/ HIST_TEND) kg/m2/s2 damp_t
MOMZ_t_phys tendency of momentum z due to physics (w/ HIST_TEND) kg/m2/s2 MOMZ_tp
RHOT_t_damp tendency of rho*theta temperature due to damping (w/ HIST_TEND) K kg/m3/s damp_t
RHOT_t_phys tendency of rho*theta temperature due to physics (w/ HIST_TEND) K kg/m3/s RHOT_tp
TFLXX potential temperature flux of x-direction (w/ CHECK_MASS) K*kg/m2/s tflx_hi
TFLXY potential temperature flux of y-direction (w/ CHECK_MASS) K*kg/m2/s tflx_hi
TFLXZ potential temperature flux of z-direction (w/ CHECK_MASS) K*kg/m2/s tflx_hi
{TRACER_NAME}_t_damp tendency of {TRACER_NAME} due to damping (w/ HIST_TEND);
{TRACER_NAME} depends on the physics schemes, e.g., QV, QC, QR.
kg/kg/s damp_t
{TRACER_NAME}_t_phys tendency of {TRACER_NAME} due to physics (w/ HIST_TEND);
{TRACER_NAME} depends on the physics schemes, e.g., QV, QC, QR.
kg/kg/s RHOQ_tp

Function/Subroutine Documentation

◆ atmos_dyn_tstep_large_fvm_heve_setup()

subroutine, public scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve_setup ( real(rp), dimension(ka,ia,ja), intent(inout)  DENS,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMZ,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMX,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMY,
real(rp), dimension(ka,ia,ja), intent(inout)  RHOT,
real(rp), dimension(ka,ia,ja,qa), intent(inout)  QTRC,
real(rp), dimension(ka,ia,ja,va), intent(inout)  PROG,
real(rp), dimension(ka,ia,ja,3), intent(inout)  mflx_hi 
)

Setup.

Definition at line 95 of file scale_atmos_dyn_tstep_large_fvm_heve.F90.

References scale_comm_cartesc::comm_vars8_init(), scale_const::const_ohm, scale_const::const_undef, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_prc::prc_abort(), scale_prc_cartesc::prc_has_e, scale_prc_cartesc::prc_has_n, scale_prc_cartesc::prc_has_s, scale_prc_cartesc::prc_has_w, scale_tracer::qa, scale_index::va, scale_atmos_grid_cartesc_index::xdir, scale_atmos_grid_cartesc_index::ydir, and scale_atmos_grid_cartesc_index::zdir.

Referenced by scale_atmos_dyn_tstep_large::atmos_dyn_tstep_large_setup().

95  use scale_prc, only: &
96  prc_abort
97  use scale_prc_cartesc, only: &
98  prc_has_e, &
99  prc_has_w, &
100  prc_has_n, &
101  prc_has_s
102  use scale_const, only: &
103  ohm => const_ohm, &
104  undef => const_undef
105  use scale_comm_cartesc, only: &
107  implicit none
108 
109  ! MPI_RECV_INIT requires intent(inout)
110  real(RP), intent(inout) :: dens(ka,ia,ja)
111  real(RP), intent(inout) :: momz(ka,ia,ja)
112  real(RP), intent(inout) :: momx(ka,ia,ja)
113  real(RP), intent(inout) :: momy(ka,ia,ja)
114  real(RP), intent(inout) :: rhot(ka,ia,ja)
115  real(RP), intent(inout) :: qtrc(ka,ia,ja,qa)
116  real(RP), intent(inout) :: prog(ka,ia,ja,va)
117  real(RP), intent(inout) :: mflx_hi(ka,ia,ja,3)
118 
119  integer :: iv, iq
120  !---------------------------------------------------------------------------
121 
122  allocate( dens_t(ka,ia,ja) )
123  allocate( momz_t(ka,ia,ja) )
124  allocate( momx_t(ka,ia,ja) )
125  allocate( momy_t(ka,ia,ja) )
126  allocate( rhot_t(ka,ia,ja) )
127  allocate( rhoq_t(ka,ia,ja,qa) )
128 
129  allocate( i_comm_prog(max(va,1)) )
130  allocate( i_comm_qtrc(qa) )
131  allocate( i_comm_rhoq_t(qa) )
132 
133  call comm_vars8_init( 'DENS', dens, i_comm_dens )
134  call comm_vars8_init( 'MOMZ', momz, i_comm_momz )
135  call comm_vars8_init( 'MOMX', momx, i_comm_momx )
136  call comm_vars8_init( 'MOMY', momy, i_comm_momy )
137  call comm_vars8_init( 'RHOT', rhot, i_comm_rhot )
138  do iv = 1, va
139  i_comm_prog(iv) = 5 + iv
140  call comm_vars8_init( 'PROG', prog(:,:,:,iv), i_comm_prog(iv) )
141  end do
142 
143  call comm_vars8_init( 'DENS_t', dens_t, i_comm_dens_t )
144  call comm_vars8_init( 'MOMZ_t', momz_t, i_comm_momz_t )
145  call comm_vars8_init( 'MOMX_t', momx_t, i_comm_momx_t )
146  call comm_vars8_init( 'MOMY_t', momy_t, i_comm_momy_t )
147  call comm_vars8_init( 'RHOT_t', rhot_t, i_comm_rhot_t )
148 
149  do iq = 1, qa
150  i_comm_rhoq_t(iq) = 5 + va + iq
151  i_comm_qtrc(iq) = 5 + va + iq
152 
153  call comm_vars8_init( 'RHOQ_t', rhoq_t(:,:,:,iq), i_comm_rhoq_t(iq) )
154  call comm_vars8_init( 'QTRC', qtrc(:,:,:,iq), i_comm_qtrc(iq) )
155  end do
156 
157  call comm_vars8_init( 'mflx_Z', mflx_hi(:,:,:,zdir), i_comm_mflx_z )
158  call comm_vars8_init( 'mflx_X', mflx_hi(:,:,:,xdir), i_comm_mflx_x )
159  call comm_vars8_init( 'mflx_Y', mflx_hi(:,:,:,ydir), i_comm_mflx_y )
160 
161  allocate( zero(ka,ia,ja) )
162  zero(:,:,:) = 0.0_rp
163 
164  mflx_hi(:,:,:,:) = undef
165 
166  return
integer, public va
Definition: scale_index.F90:35
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
module process / cartesC
logical, public prc_has_s
logical, public prc_has_n
logical, public prc_has_e
real(rp), public const_undef
Definition: scale_const.F90:41
module COMMUNICATION
real(rp), public const_ohm
angular velocity of the planet [1/s]
Definition: scale_const.F90:45
module PROCESS
Definition: scale_prc.F90:11
subroutine, public comm_vars8_init(varname, var, vid)
Register variables.
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
integer, public ka
of whole cells: z, local, with HALO
logical, public prc_has_w
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_tstep_large_fvm_heve()

subroutine, public scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve ( real(rp), dimension(ka,ia,ja), intent(inout)  DENS,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMZ,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMX,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMY,
real(rp), dimension(ka,ia,ja), intent(inout)  RHOT,
real(rp), dimension(ka,ia,ja,qa), intent(inout)  QTRC,
real(rp), dimension(ka,ia,ja,va), intent(inout)  PROG,
real(rp), dimension(ka,ia,ja), intent(inout)  DENS_av,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMZ_av,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMX_av,
real(rp), dimension(ka,ia,ja), intent(inout)  MOMY_av,
real(rp), dimension(ka,ia,ja), intent(inout)  RHOT_av,
real(rp), dimension(ka,ia,ja,qa), intent(inout)  QTRC_av,
real(rp), dimension(ka,ia,ja,3), intent(out)  mflx_hi,
real(rp), dimension(ka,ia,ja,3), intent(out)  tflx_hi,
real(rp), dimension(ka,ia,ja,5,3), intent(out)  num_diff,
real(rp), dimension(ka,ia,ja,3), intent(out)  num_diff_q,
real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC0,
real(rp), dimension(ka,ia,ja), intent(in)  DENS_tp,
real(rp), dimension(ka,ia,ja), intent(in)  MOMZ_tp,
real(rp), dimension(ka,ia,ja), intent(in)  MOMX_tp,
real(rp), dimension(ka,ia,ja), intent(in)  MOMY_tp,
real(rp), dimension(ka,ia,ja), intent(in)  RHOT_tp,
real(rp), dimension(ka,ia,ja,qa), intent(in)  RHOQ_tp,
real(rp), dimension(ia,ja), intent(in)  CORIOLI,
real(rp), dimension (ka), intent(in)  CDZ,
real(rp), dimension (ia), intent(in)  CDX,
real(rp), dimension (ja), intent(in)  CDY,
real(rp), dimension (ka-1), intent(in)  FDZ,
real(rp), dimension (ia-1), intent(in)  FDX,
real(rp), dimension (ja-1), intent(in)  FDY,
real(rp), dimension(ka), intent(in)  RCDZ,
real(rp), dimension(ia), intent(in)  RCDX,
real(rp), dimension(ja), intent(in)  RCDY,
real(rp), dimension(ka-1), intent(in)  RFDZ,
real(rp), dimension(ia-1), intent(in)  RFDX,
real(rp), dimension(ja-1), intent(in)  RFDY,
real(rp), dimension (ka,ia,ja), intent(in)  PHI,
real(rp), dimension(ka,ia,ja,7), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja,7), intent(in)  J13G,
real(rp), dimension (ka,ia,ja,7), intent(in)  J23G,
real(rp), intent(in)  J33G,
real(rp), dimension (ia,ja,2,4), intent(in)  MAPF,
real(rp), dimension (qa), intent(in)  AQ_R,
real(rp), dimension (qa), intent(in)  AQ_CV,
real(rp), dimension (qa), intent(in)  AQ_CP,
real(rp), dimension(qa), intent(in)  AQ_MASS,
real(rp), dimension(ka,ia,ja), intent(in)  REF_dens,
real(rp), dimension(ka,ia,ja), intent(in)  REF_pott,
real(rp), dimension (ka,ia,ja), intent(in)  REF_qv,
real(rp), dimension(ka,ia,ja), intent(in)  REF_pres,
logical, intent(in)  BND_W,
logical, intent(in)  BND_E,
logical, intent(in)  BND_S,
logical, intent(in)  BND_N,
real(rp), intent(in)  ND_COEF,
real(rp), intent(in)  ND_COEF_Q,
integer, intent(in)  ND_ORDER,
real(rp), intent(in)  ND_SFC_FACT,
logical, intent(in)  ND_USE_RS,
integer, intent(in)  BND_QA,
real(rp), intent(in)  BND_SMOOTHER_FACT,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_DENS,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_VELZ,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_VELX,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_VELY,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_POTT,
real(rp), dimension(ka,ia,ja,bnd_qa), intent(in)  DAMP_QTRC,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_alpha_DENS,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_alpha_VELZ,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_alpha_VELX,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_alpha_VELY,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_alpha_POTT,
real(rp), dimension(ka,ia,ja,bnd_qa), intent(in)  DAMP_alpha_QTRC,
real(rp), dimension(ka), intent(in)  wdamp_coef,
real(rp), intent(in)  divdmp_coef,
logical, intent(in)  FLAG_TRACER_SPLIT_TEND,
logical, intent(in)  FLAG_FCT_MOMENTUM,
logical, intent(in)  FLAG_FCT_T,
logical, intent(in)  FLAG_FCT_TRACER,
logical, intent(in)  FLAG_FCT_ALONG_STREAM,
logical, intent(in)  USE_AVERAGE,
integer, intent(in)  I_QV,
real(dp), intent(in)  DTLS,
real(dp), intent(in)  DTSS,
logical, intent(in)  Llast 
)

Dynamical Process.

Parameters
[in]phigeopotential
[in]gsqrtvertical metrics {G}^1/2
[in]j13g(1,3) element of Jacobian matrix
[in]j23g(2,3) element of Jacobian matrix
[in]j33g(3,3) element of Jacobian matrix
[in]mapfmap factor
[in]ref_presreference pressure

Definition at line 200 of file scale_atmos_dyn_tstep_large_fvm_heve.F90.

References scale_atmos_dyn_common::atmos_dyn_divergence(), scale_atmos_dyn_common::atmos_dyn_fct(), scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_fluxx_xyz, scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxx_xyz_ud1(), scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_fluxy_xyz, scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxy_xyz_ud1(), scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_fluxz_xyz, scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxz_xyz_ud1(), scale_atmos_dyn_common::atmos_dyn_numfilter_coef(), scale_atmos_dyn_common::atmos_dyn_numfilter_coef_q(), scale_atmos_dyn_tinteg_short::atmos_dyn_tinteg_short, scale_atmos_dyn_tinteg_tracer::atmos_dyn_tinteg_tracer, check_mass(), scale_const::const_cpdry, scale_const::const_cvdry, scale_const::const_eps, scale_const::const_pre00, scale_const::const_rdry, scale_atmos_grid_cartesc_index::i_uy, scale_atmos_grid_cartesc_index::i_uyz, scale_atmos_grid_cartesc_index::i_xv, scale_atmos_grid_cartesc_index::i_xvz, scale_atmos_grid_cartesc_index::i_xy, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::ieb, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::isb, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::jeb, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::jsb, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::ks, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), scale_tracer::qa, scale_tracer::tracer_advc, scale_tracer::tracer_mass, scale_tracer::tracer_name, scale_index::va, scale_atmos_grid_cartesc_index::xdir, scale_atmos_grid_cartesc_index::ydir, and scale_atmos_grid_cartesc_index::zdir.

Referenced by scale_atmos_dyn_tstep_large::atmos_dyn_tstep_large_setup().

200  use scale_const, only: &
201  eps => const_eps, &
202  p0 => const_pre00, &
203  rdry => const_rdry, &
204  cvdry => const_cvdry, &
205  cpdry => const_cpdry
206  use scale_comm_cartesc, only: &
207  comm_vars8, &
208  comm_wait
209  use scale_atmos_dyn_common, only: &
214  use scale_atmos_dyn_fvm_flux_ud1, only: &
218  use scale_atmos_dyn_fvm_flux, only: &
222  use scale_file_history, only: &
223 #ifdef hist_tend
224  file_history_in, &
225 #endif
226  file_history_set_disable
227  use scale_atmos_dyn_tinteg_short, only: &
229  use scale_atmos_dyn_tinteg_tracer, only: &
231  implicit none
232 
233  real(RP), intent(inout) :: dens(ka,ia,ja)
234  real(RP), intent(inout) :: momz(ka,ia,ja)
235  real(RP), intent(inout) :: momx(ka,ia,ja)
236  real(RP), intent(inout) :: momy(ka,ia,ja)
237  real(RP), intent(inout) :: rhot(ka,ia,ja)
238  real(RP), intent(inout) :: qtrc(ka,ia,ja,qa)
239  real(RP), intent(inout) :: prog(ka,ia,ja,va)
240 
241  real(RP), intent(inout) :: dens_av(ka,ia,ja)
242  real(RP), intent(inout) :: momz_av(ka,ia,ja)
243  real(RP), intent(inout) :: momx_av(ka,ia,ja)
244  real(RP), intent(inout) :: momy_av(ka,ia,ja)
245  real(RP), intent(inout) :: rhot_av(ka,ia,ja)
246  real(RP), intent(inout) :: qtrc_av(ka,ia,ja,qa)
247 
248  real(RP), intent(out) :: mflx_hi(ka,ia,ja,3)
249  real(RP), intent(out) :: tflx_hi(ka,ia,ja,3)
250 
251  real(RP), intent(out) :: num_diff(ka,ia,ja,5,3)
252  real(RP), intent(out) :: num_diff_q(ka,ia,ja,3)
253 
254  real(RP), intent(in) :: qtrc0(ka,ia,ja,qa)
255 
256  real(RP), intent(in) :: dens_tp(ka,ia,ja)
257  real(RP), intent(in) :: momz_tp(ka,ia,ja)
258  real(RP), intent(in) :: momx_tp(ka,ia,ja)
259  real(RP), intent(in) :: momy_tp(ka,ia,ja)
260  real(RP), intent(in) :: rhot_tp(ka,ia,ja)
261  real(RP), intent(in) :: rhoq_tp(ka,ia,ja,qa)
262 
263  real(RP), intent(in) :: corioli(ia,ja)
264 
265  real(RP), intent(in) :: cdz (ka)
266  real(RP), intent(in) :: cdx (ia)
267  real(RP), intent(in) :: cdy (ja)
268  real(RP), intent(in) :: fdz (ka-1)
269  real(RP), intent(in) :: fdx (ia-1)
270  real(RP), intent(in) :: fdy (ja-1)
271  real(RP), intent(in) :: rcdz(ka)
272  real(RP), intent(in) :: rcdx(ia)
273  real(RP), intent(in) :: rcdy(ja)
274  real(RP), intent(in) :: rfdz(ka-1)
275  real(RP), intent(in) :: rfdx(ia-1)
276  real(RP), intent(in) :: rfdy(ja-1)
277 
278  real(RP), intent(in) :: phi (ka,ia,ja)
279  real(RP), intent(in) :: gsqrt(ka,ia,ja,7)
280  real(RP), intent(in) :: j13g (ka,ia,ja,7)
281  real(RP), intent(in) :: j23g (ka,ia,ja,7)
282  real(RP), intent(in) :: j33g
283  real(RP), intent(in) :: mapf (ia,ja,2,4)
284 
285  real(RP), intent(in) :: aq_r (qa)
286  real(RP), intent(in) :: aq_cv (qa)
287  real(RP), intent(in) :: aq_cp (qa)
288  real(RP), intent(in) :: aq_mass(qa)
289 
290  real(RP), intent(in) :: ref_dens(ka,ia,ja)
291  real(RP), intent(in) :: ref_pott(ka,ia,ja)
292  real(RP), intent(in) :: ref_qv (ka,ia,ja)
293  real(RP), intent(in) :: ref_pres(ka,ia,ja)
294 
295  logical, intent(in) :: bnd_w
296  logical, intent(in) :: bnd_e
297  logical, intent(in) :: bnd_s
298  logical, intent(in) :: bnd_n
299 
300  real(RP), intent(in) :: nd_coef
301  real(RP), intent(in) :: nd_coef_q
302  integer, intent(in) :: nd_order
303  real(RP), intent(in) :: nd_sfc_fact
304  logical, intent(in) :: nd_use_rs
305 
306  integer, intent(in) :: bnd_qa
307  real(RP), intent(in) :: bnd_smoother_fact
308 
309  real(RP), intent(in) :: damp_dens(ka,ia,ja)
310  real(RP), intent(in) :: damp_velz(ka,ia,ja)
311  real(RP), intent(in) :: damp_velx(ka,ia,ja)
312  real(RP), intent(in) :: damp_vely(ka,ia,ja)
313  real(RP), intent(in) :: damp_pott(ka,ia,ja)
314  real(RP), intent(in) :: damp_qtrc(ka,ia,ja,bnd_qa)
315 
316  real(RP), intent(in) :: damp_alpha_dens(ka,ia,ja)
317  real(RP), intent(in) :: damp_alpha_velz(ka,ia,ja)
318  real(RP), intent(in) :: damp_alpha_velx(ka,ia,ja)
319  real(RP), intent(in) :: damp_alpha_vely(ka,ia,ja)
320  real(RP), intent(in) :: damp_alpha_pott(ka,ia,ja)
321  real(RP), intent(in) :: damp_alpha_qtrc(ka,ia,ja,bnd_qa)
322 
323  real(RP), intent(in) :: wdamp_coef(ka)
324  real(RP), intent(in) :: divdmp_coef
325 
326  logical, intent(in) :: flag_tracer_split_tend
327  logical, intent(in) :: flag_fct_momentum
328  logical, intent(in) :: flag_fct_t
329  logical, intent(in) :: flag_fct_tracer
330  logical, intent(in) :: flag_fct_along_stream
331 
332  logical, intent(in) :: use_average
333 
334  integer, intent(in) :: i_qv
335 
336  real(DP), intent(in) :: dtls
337  real(DP), intent(in) :: dtss
338  logical , intent(in) :: llast
339 
340  ! for time integartion
341  real(RP) :: dens00 (ka,ia,ja) ! saved density before small step loop
342 
343  ! diagnostic variables
344  real(RP) :: ddiv (ka,ia,ja) ! 3 dimensional divergence
345  real(RP) :: dpres0 (ka,ia,ja) ! pressure deviation
346  real(RP) :: rt2p (ka,ia,ja) ! factor of RHOT to PRES
347  real(RP) :: ref_rhot(ka,ia,ja) ! reference of RHOT
348 
349  real(RP) :: qdry ! dry air
350  real(RP) :: rtot ! total R
351  real(RP) :: cvtot ! total CV
352  real(RP) :: cptot ! total CP
353  real(RP) :: pres ! pressure
354 #ifdef DRY
355  real(RP) :: cpovcv
356 #endif
357 
358  real(RP) :: dens_tq(ka,ia,ja)
359  real(RP) :: diff(ka,ia,ja)
360  real(RP) :: damp
361 #ifdef HIST_TEND
362  real(RP) :: damp_t(ka,ia,ja)
363 #endif
364 
365  ! For tracer advection
366  real(RP) :: mflx_av (ka,ia,ja,3) ! rho * vel(x,y,z) @ (u,v,w)-face average
367 
368  real(RP) :: dtl
369  real(RP) :: dts
370  integer :: nstep
371 
372  integer :: i, j, k, iq, step
373  integer :: iv
374  integer :: n
375  !---------------------------------------------------------------------------
376 
377  call prof_rapstart("DYN_Large_Preparation", 2)
378 
379  dts = real(DTSS, kind=RP) ! short time step
380  dtl = real(DTLS, kind=RP) ! large time step
381  nstep = ceiling( ( dtl - eps ) / dts )
382  dts = dtl / nstep ! dts is divisor of dtl and smaller or equal to dtss
383 
384 #ifdef DEBUG
385  log_info("ATMOS_DYN_Tstep_large_fvm_heve",*) 'Dynamics large time step'
386  log_info_cont('(1x,A,F0.2,A,F0.2,A,I0)') &
387  '-> DT_large, DT_small, DT_large/DT_small : ', dtl, ', ', dts, ', ', nstep
388 
389  dens00(:,:,:) = undef
390 
391  num_diff(:,:,:,:,:) = undef
392 
393  mflx_hi(:,:,:,:) = undef
394  tflx_hi(:,:,:,:) = undef
395 #endif
396 
397 !OCL XFILL
398  dens00(:,:,:) = dens(:,:,:)
399 
400  if ( use_average ) then
401 !OCL XFILL
402  dens_av(:,:,:) = 0.0_rp
403 !OCL XFILL
404  momz_av(:,:,:) = 0.0_rp
405 !OCL XFILL
406  momx_av(:,:,:) = 0.0_rp
407 !OCL XFILL
408  momy_av(:,:,:) = 0.0_rp
409 !OCL XFILL
410  rhot_av(:,:,:) = 0.0_rp
411  endif
412 
413 #ifndef DRY
414 !OCL XFILL
415  mflx_av(:,:,:,:) = 0.0_rp
416 
417 #endif
418 
419 #ifdef DRY
420  cpovcv = cpdry / cvdry
421 #endif
422  !------------------------------------------------------------------------
423  ! prepare thermodynamical data
424  ! specific heat
425  ! pressure data ( linearization )
426  !
427  ! pres = P0 * ( R * rhot / P0 )**(CP/CV)
428  ! d pres / d rhot ~ CP*R/CV * ( R * rhot / P0 )**(R/CV)
429  ! = CP*R/CV * ( pres / P0 )**(R/CP)
430  ! = CP*R/CV * temp / pott
431  ! = CP/CV * pres / rhot
432  ! pres ~ P0 * ( R * rhot0 / P0 ) ** (CP/CV) + CV*R/CP * ( pres / P0 )**(R/CP) * rhot'
433  !------------------------------------------------------------------------
434 !OCL XFILL
435  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
436  !$omp shared(JA,IA,KS,KE) &
437  !$omp shared(P0,Rdry,RHOT,AQ_R,AQ_CV,AQ_CP,QTRC,AQ_MASS,REF_rhot,REF_pres,CPdry,CVdry,QA,RT2P,DPRES0) &
438 #ifdef DRY
439  !$omp shared(CPovCV) &
440 #endif
441  !$omp private(i,j,k,iq) &
442  !$omp private(PRES,Rtot,CVtot,CPtot,QDRY)
443  do j = 1, ja
444  do i = 1, ia
445  do k = ks, ke
446 #ifdef DRY
447  pres = p0 * ( rdry * rhot(k,i,j) / p0 )**cpovcv
448  rt2p(k,i,j) = cpovcv * pres / rhot(k,i,j)
449 #else
450  rtot = 0.0_rp
451  cvtot = 0.0_rp
452  cptot = 0.0_rp
453  qdry = 1.0_rp
454  do iq = 1, qa
455  rtot = rtot + aq_r(iq) * qtrc(k,i,j,iq)
456  cvtot = cvtot + aq_cv(iq) * qtrc(k,i,j,iq)
457  cptot = cptot + aq_cp(iq) * qtrc(k,i,j,iq)
458  qdry = qdry - qtrc(k,i,j,iq) * aq_mass(iq)
459  enddo
460  rtot = rtot + rdry * qdry
461  cvtot = cvtot + cvdry * qdry
462  cptot = cptot + cpdry * qdry
463  pres = p0 * ( rtot * rhot(k,i,j) / p0 )**( cptot / cvtot )
464  rt2p(k,i,j) = cptot / cvtot * pres / rhot(k,i,j)
465 #endif
466  dpres0(k,i,j) = pres - ref_pres(k,i,j)
467  ref_rhot(k,i,j) = rhot(k,i,j)
468  end do
469  dpres0(ks-1,i,j) = dpres0(ks+1,i,j) + ( ref_pres(ks+1,i,j) - ref_pres(ks-1,i,j) )
470  dpres0(ke+1,i,j) = dpres0(ke-1,i,j) + ( ref_pres(ke-1,i,j) - ref_pres(ke+1,i,j) )
471  end do
472  end do
473 
474  call prof_rapend ("DYN_Large_Preparation", 2)
475 
476  !###########################################################################
477  ! Update DENS,MONZ,MOMX,MOMY,MOMZ,RHOT
478  !###########################################################################
479 
480  call prof_rapstart("DYN_Large_Tendency", 2)
481 
482 #ifdef HIST_TEND
483 !OCL XFILL
484  damp_t(:,:,:) = 0.0_rp
485 #endif
486 
487 !OCL XFILL
488  dens_tq(:,:,:) = 0.0_rp
489 
490  do iq = 1, qa
491 
492  if ( iq >= i_qv .and. iq < i_qv+bnd_qa ) then
493 
494  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
495 !OCL XFILL
496  do j = js-1, je+1
497  do i = is-1, ie+1
498  do k = ks, ke
499  diff(k,i,j) = qtrc(k,i,j,iq) - damp_qtrc(k,i,j,iq-i_qv+1)
500  enddo
501  enddo
502  enddo
503  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
504  !$omp private(i,j,k,damp) &
505 #ifdef HIST_TEND
506  !$omp shared(damp_t) &
507 #endif
508  !$omp shared(JS,JE,IS,IE,KS,KE,iq) &
509  !$omp shared(RHOQ_t,RHOQ_tp,DENS_tq,DAMP_alpha_QTRC,diff,BND_SMOOTHER_FACT,DENS00,TRACER_MASS,I_QV)
510 !OCL XFILL
511  do j = js, je
512  do i = is, ie
513  do k = ks, ke
514  damp = - damp_alpha_qtrc(k,i,j,iq-i_qv+1) &
515  * ( diff(k,i,j) & ! rayleigh damping
516  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
517  * 0.125_rp * bnd_smoother_fact ) ! horizontal smoother
518 #ifdef HIST_TEND
519  damp_t(k,i,j) = damp
520 #endif
521  damp = damp * dens00(k,i,j)
522  rhoq_t(k,i,j,iq) = rhoq_tp(k,i,j,iq) + damp
523  dens_tq(k,i,j) = dens_tq(k,i,j) + damp * tracer_mass(iq) ! only for mass tracer
524  enddo
525  enddo
526  enddo
527 #ifdef HIST_TEND
528  call file_history_in(rhoq_tp(:,:,:,iq), trim(tracer_name(iq))//'_t_phys', &
529  'tendency of '//trim(tracer_name(iq))//' due to physics (w/ HIST_TEND)', 'kg/kg/s' )
530  call file_history_in(damp_t, trim(tracer_name(iq))//'_t_damp', &
531  'tendency of '//trim(tracer_name(iq))//' due to damping (w/ HIST_TEND)', 'kg/kg/s' )
532 #endif
533 !OCL XFILL
534  do j = js, je
535  do i = is, ie
536  rhoq_t( 1:ks-1,i,j,iq) = 0.0_rp
537  rhoq_t(ke+1:ka ,i,j,iq) = 0.0_rp
538  enddo
539  enddo
540 
541  call comm_vars8( rhoq_t(:,:,:,iq), i_comm_rhoq_t(iq) )
542  call comm_wait ( rhoq_t(:,:,:,iq), i_comm_rhoq_t(iq), .false. )
543 
544  else
545 
546  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(3)
547 !OCL XFILL
548  do j = 1, ja
549  do i = 1, ia
550  do k = 1, ka
551  rhoq_t(k,i,j,iq) = rhoq_tp(k,i,j,iq)
552  enddo
553  enddo
554  enddo
555 
556  end if
557 
558  end do
559 
560  call prof_rapend ("DYN_Large_Tendency", 2)
561 
562  call prof_rapstart("DYN_Large_Boundary", 2)
563 
564  if ( bnd_w ) then
565  !$omp parallel do private(j,k) OMP_SCHEDULE_ collapse(2)
566  do j = js, je
567  do k = ks, ke
568  mflx_hi(k,is-1,j,xdir) = gsqrt(k,is-1,j,i_uyz) * momx(k,is-1,j) / mapf(is-1,j,2,i_uy)
569  enddo
570  enddo
571  end if
572  if ( bnd_e ) then
573  !$omp parallel do private(j,k) OMP_SCHEDULE_ collapse(2)
574  do j = js, je
575  do k = ks, ke
576  mflx_hi(k,ie,j,xdir) = gsqrt(k,ie,j,i_uyz) * momx(k,ie,j) / mapf(ie,j,2,i_uy)
577  enddo
578  enddo
579  end if
580  if ( bnd_s ) then
581  !$omp parallel do private(i,k) OMP_SCHEDULE_ collapse(2)
582  do i = is, ie
583  do k = ks, ke
584  mflx_hi(k,i,js-1,ydir) = gsqrt(k,i,js-1,i_xvz) * momy(k,i,js-1) / mapf(i,js-1,1,i_xv)
585  enddo
586  enddo
587  end if
588  if ( bnd_n ) then
589  !$omp parallel do private(i,k) OMP_SCHEDULE_ collapse(2)
590  do i = is, ie
591  do k = ks, ke
592  mflx_hi(k,i,je,ydir) = gsqrt(k,i,je,i_xvz) * momy(k,i,je) / mapf(i,je,1,i_xv)
593  enddo
594  enddo
595  end if
596 
597  call prof_rapend ("DYN_Large_Boundary", 2)
598 
599 
600  do step = 1, nstep
601 
602  call file_history_set_disable( .not. (llast .AND. step == nstep ) )
603 
604  !-----< prepare tendency >-----
605 
606  call prof_rapstart("DYN_Large_Tendency", 2)
607 
608  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
609 !OCL XFILL
610  do j = js-1, je+1
611  do i = is-1, ie+1
612  do k = ks, ke
613  diff(k,i,j) = dens(k,i,j) - damp_dens(k,i,j)
614  enddo
615  enddo
616  enddo
617  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
618  !$omp private(i,j,k,damp) &
619 #ifdef HIST_TEND
620  !$omp shared(damp_t) &
621 #endif
622  !$omp shared(JS,JE,IS,IE,KS,KE) &
623  !$omp shared(DAMP_alpha_DENS,diff,DENS_tq,DENS_t,DENS_tp,BND_SMOOTHER_FACT)
624 !OCL XFILL
625  do j = js, je
626  do i = is, ie
627  do k = ks, ke
628  damp = - damp_alpha_dens(k,i,j) &
629  * ( diff(k,i,j) & ! rayleigh damping
630  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
631  * 0.125_rp * bnd_smoother_fact ) & ! horizontal smoother
632  + dens_tq(k,i,j) ! dencity change due to rayleigh damping for tracers
633  dens_t(k,i,j) = dens_tp(k,i,j) & ! tendency from physical step
634  + damp
635 #ifdef HIST_TEND
636  damp_t(k,i,j) = damp
637 #endif
638  enddo
639  enddo
640  enddo
641 !OCL XFILL
642  do j = js, je
643  do i = is, ie
644  dens_t( 1:ks-1,i,j) = 0.0_rp
645  dens_t(ke+1:ka ,i,j) = 0.0_rp
646  enddo
647  enddo
648  call comm_vars8( dens_t(:,:,:), i_comm_dens_t )
649 #ifdef HIST_TEND
650  call file_history_in(dens_tp, 'DENS_t_phys', 'tendency of dencity due to physics (w/ HIST_TEND)', 'kg/m3/s' )
651  call file_history_in(damp_t, 'DENS_t_damp', 'tendency of dencity due to damping (w/ HIST_TEND)', 'kg/m3/s' )
652 #endif
653 
654  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
655 !OCL XFILL
656  do j = js-1, je+1
657  do i = is-1, ie+1
658  do k = ks, ke-1
659  diff(k,i,j) = momz(k,i,j) - damp_velz(k,i,j) * ( dens(k,i,j)+dens(k+1,i,j) ) * 0.5_rp
660  enddo
661  enddo
662  enddo
663  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
664  !$omp private(i,j,k,damp) &
665 #ifdef HIST_TEND
666  !$omp shared(damp_t) &
667 #endif
668  !$omp shared(JS,JE,IS,IE,KS,KE) &
669  !$omp shared(DAMP_alpha_VELZ,diff,BND_SMOOTHER_FACT,MOMZ_t,MOMZ_tp)
670 !OCL XFILL
671  do j = js, je
672  do i = is, ie
673  do k = ks, ke-1
674  damp = - damp_alpha_velz(k,i,j) &
675  * ( diff(k,i,j) & ! rayleigh damping
676  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
677  * 0.125_rp * bnd_smoother_fact ) ! horizontal smoother
678 
679  momz_t(k,i,j) = momz_tp(k,i,j) & ! tendency from physical step
680  + damp
681 #ifdef HIST_TEND
682  damp_t(k,i,j) = damp
683 #endif
684  enddo
685  enddo
686  enddo
687 !OCL XFILL
688  do j = js, je
689  do i = is, ie
690  momz_t( 1:ks-1,i,j) = 0.0_rp
691  momz_t(ke:ka ,i,j) = 0.0_rp
692  enddo
693  enddo
694  call comm_vars8( momz_t(:,:,:), i_comm_momz_t )
695 #ifdef HIST_TEND
696  call file_history_in(momz_tp, 'MOMZ_t_phys', 'tendency of momentum z due to physics (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZHXY' )
697  call file_history_in(damp_t, 'MOMZ_t_damp', 'tendency of momentum z due to damping (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZHXY' )
698 #endif
699 
700  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
701 !OCL XFILL
702  do j = js-1, je+1
703  do i = is-1, ie+1
704  do k = ks, ke
705  diff(k,i,j) = momx(k,i,j) - damp_velx(k,i,j) * ( dens(k,i,j)+dens(k,i+1,j) ) * 0.5_rp
706  enddo
707  enddo
708  enddo
709 !OCL XFILL
710  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
711  !$omp private(i,j,k,damp) &
712 #ifdef HIST_TEND
713  !$omp shared(damp_t) &
714 #endif
715  !$omp shared(JS,JE,IS,IE,KS,KE) &
716  !$omp shared(DAMP_alpha_VELX,diff,BND_SMOOTHER_FACT,MOMX_tp,MOMX_t)
717  do j = js, je
718  do i = is, ie
719  do k = ks, ke
720  damp = - damp_alpha_velx(k,i,j) &
721  * ( diff(k,i,j) & ! rayleigh damping
722  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
723  * 0.125_rp * bnd_smoother_fact ) ! horizontal smoother
724  momx_t(k,i,j) = momx_tp(k,i,j) & ! tendency from physical step
725  + damp
726 #ifdef HIST_TEND
727  damp_t(k,i,j) = damp
728 #endif
729  enddo
730  enddo
731  enddo
732 !OCL XFILL
733  do j = js, je
734  do i = is, ie
735  momx_t( 1:ks-1,i,j) = 0.0_rp
736  momx_t(ke+1:ka ,i,j) = 0.0_rp
737  enddo
738  enddo
739  call comm_vars8( momx_t(:,:,:), i_comm_momx_t )
740 #ifdef HIST_TEND
741  call file_history_in(momx_tp, 'MOMX_t_phys', 'tendency of momentum x due to physics (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZXHY' )
742  call file_history_in(damp_t, 'MOMX_t_damp', 'tendency of momentum x due to damping (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZXHY' )
743 #endif
744 
745  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
746 !OCL XFILL
747  do j = js-1, je+1
748  do i = is-1, ie+1
749  do k = ks, ke
750  diff(k,i,j) = momy(k,i,j) - damp_vely(k,i,j) * ( dens(k,i,j)+dens(k,i,j+1) ) * 0.5_rp
751  enddo
752  enddo
753  enddo
754 !OCL XFILL
755  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
756  !$omp private(i,j,k,damp) &
757 #ifdef HIST_TEND
758  !$omp shared(damp_t) &
759 #endif
760  !$omp shared(JS,JE,IS,IE,KS,KE) &
761  !$omp shared(DAMP_alpha_VELY,diff,BND_SMOOTHER_FACT,MOMY_tp,MOMY_t)
762  do j = js, je
763  do i = is, ie
764  do k = ks, ke
765  damp = - damp_alpha_vely(k,i,j) &
766  * ( diff(k,i,j) & ! rayleigh damping
767  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
768  * 0.125_rp * bnd_smoother_fact ) ! horizontal smoother
769  momy_t(k,i,j) = momy_tp(k,i,j) & ! tendency from physical step
770  + damp
771 #ifdef HIST_TEND
772  damp_t(k,i,j) = damp
773 #endif
774  enddo
775  enddo
776  enddo
777 !OCL XFILL
778  do j = js, je
779  do i = is, ie
780  momy_t( 1:ks-1,i,j) = 0.0_rp
781  momy_t(ke+1:ka ,i,j) = 0.0_rp
782  enddo
783  enddo
784  call comm_vars8( momy_t(:,:,:), i_comm_momy_t )
785 #ifdef HIST_TEND
786  call file_history_in(momy_tp, 'MOMY_t_phys', 'tendency of momentum y due to physics (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZXYH' )
787  call file_history_in(damp_t, 'MOMY_t_damp', 'tendency of momentum y due to damping (w/ HIST_TEND)', 'kg/m2/s2', dim_type='ZXYH' )
788 #endif
789 
790  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
791 !OCL XFILL
792  do j = js-1, je+2
793  do i = is-1, ie+2
794  do k = ks, ke
795  diff(k,i,j) = rhot(k,i,j) - damp_pott(k,i,j) * dens(k,i,j)
796  enddo
797  enddo
798  enddo
799 !OCL XFILL
800  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
801  !$omp private(i,j,k,damp) &
802 #ifdef HIST_TEND
803  !$omp shared(damp_t) &
804 #endif
805  !$omp shared(JS,JE,IS,IE,KS,KE) &
806  !$omp shared(DAMP_alpha_POTT,diff,BND_SMOOTHER_FACT,RHOT_t,RHOT_tp)
807  do j = js, je
808  do i = is, ie
809  do k = ks, ke
810  damp = - damp_alpha_pott(k,i,j) &
811  * ( diff(k,i,j) & ! rayleigh damping
812  - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
813  * 0.125_rp * bnd_smoother_fact ) ! horizontal smoother
814  rhot_t(k,i,j) = rhot_tp(k,i,j) & ! tendency from physical step
815  + damp
816 #ifdef HIST_TEND
817  damp_t(k,i,j) = damp
818 #endif
819  enddo
820  enddo
821  enddo
822 !OCL XFILL
823  do j = js, je
824  do i = is, ie
825  rhot_t( 1:ks-1,i,j) = 0.0_rp
826  rhot_t(ke+1:ka ,i,j) = 0.0_rp
827  enddo
828  enddo
829  call comm_vars8( rhot_t(:,:,:), i_comm_rhot_t )
830 #ifdef HIST_TEND
831  call file_history_in(rhot_tp, 'RHOT_t_phys', 'tendency of rho*theta temperature due to physics (w/ HIST_TEND)', 'K kg/m3/s' )
832  call file_history_in(damp_t, 'RHOT_t_damp', 'tendency of rho*theta temperature due to damping (w/ HIST_TEND)', 'K kg/m3/s' )
833 #endif
834 
835  call comm_wait ( dens_t(:,:,:), i_comm_dens_t, .false. )
836  call comm_wait ( momz_t(:,:,:), i_comm_momz_t, .false. )
837  call comm_wait ( momx_t(:,:,:), i_comm_momx_t, .false. )
838  call comm_wait ( momy_t(:,:,:), i_comm_momy_t, .false. )
839  call comm_wait ( rhot_t(:,:,:), i_comm_rhot_t, .false. )
840 
841  call prof_rapend ("DYN_Large_Tendency", 2)
842 
843  call prof_rapstart("DYN_Large_Numfilter", 2)
844 
845  !-----< prepare numerical diffusion coefficient >-----
846 
847  if ( nd_coef == 0.0_rp ) then
848 !OCL XFILL
849  num_diff(:,:,:,:,:) = 0.0_rp
850  else
851  call atmos_dyn_numfilter_coef( num_diff(:,:,:,:,:), & ! [OUT]
852  dens, momz, momx, momy, rhot, & ! [IN]
853  cdz, cdx, cdy, fdz, fdx, fdy, dts, & ! [IN]
854  ref_dens, ref_pott, & ! [IN]
855  nd_coef, nd_order, nd_sfc_fact, nd_use_rs ) ! [IN]
856  endif
857 
858  call prof_rapend ("DYN_Large_Numfilter", 2)
859 
860  if ( divdmp_coef > 0.0_rp ) then
861 
862  call atmos_dyn_divergence( ddiv, & ! (out)
863  momz, momx, momy, & ! (in)
864  gsqrt, j13g, j23g, j33g, mapf, & ! (in)
865  rcdz, rcdx, rcdy, rfdz, fdz ) ! (in)
866 
867  else
868 
869 !XFILL
870  ddiv = 0.0_rp
871 
872  end if
873 
874  !------------------------------------------------------------------------
875  ! Start short time integration
876  !------------------------------------------------------------------------
877 
878  call prof_rapstart("DYN_Short_Tinteg", 2)
879 
880  call atmos_dyn_tinteg_short( dens, momz, momx, momy, rhot, prog, & ! (inout)
881  mflx_hi, tflx_hi, & ! (inout)
882  dens_t, momz_t, momx_t, momy_t, rhot_t, & ! (in)
883  dpres0, rt2p, corioli, & ! (in)
884  num_diff, wdamp_coef, divdmp_coef, ddiv, & ! (in)
885  flag_fct_momentum, flag_fct_t, & ! (in)
886  flag_fct_along_stream, & ! (in)
887  cdz, fdz, fdx, fdy, & ! (in)
888  rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, & ! (in)
889  phi, gsqrt, j13g, j23g, j33g, mapf, & ! (in)
890  ref_dens, ref_rhot, & ! (in)
891  bnd_w, bnd_e, bnd_s, bnd_n, & ! (in)
892  dts ) ! (in)
893 
894  call prof_rapend ("DYN_Short_Tinteg", 2)
895 
896 #ifdef CHECK_MASS
897  call check_mass( &
898  dens, damp_dens, &
899  mflx_hi, tflx_hi, &
900  gsqrt, mapf, &
901  rcdx, rcdy, &
902  dts, step, &
903  bnd_w, bnd_e, bnd_s, bnd_n )
904 #endif
905 
906  !$omp parallel do default(none) private(i,j,iv) OMP_SCHEDULE_ collapse(2) &
907  !$omp shared(JSB,JEB,ISB,IEB,KS,KA,DENS,MOMZ,MOMX,MOMY,RHOT,VA,PROG,KE)
908  do j = jsb, jeb
909  do i = isb, ieb
910  dens( 1:ks-1,i,j) = dens(ks,i,j)
911  momz( 1:ks-1,i,j) = 0.0_rp
912  momx( 1:ks-1,i,j) = momx(ks,i,j)
913  momy( 1:ks-1,i,j) = momy(ks,i,j)
914  rhot( 1:ks-1,i,j) = rhot(ks,i,j)
915  do iv = 1, va
916  prog( 1:ks-1,i,j,iv) = prog(ks,i,j,iv)
917  end do
918  dens(ke+1:ka, i,j) = dens(ke,i,j)
919  momz(ke+1:ka, i,j) = 0.0_rp
920  momx(ke+1:ka, i,j) = momx(ke,i,j)
921  momy(ke+1:ka, i,j) = momy(ke,i,j)
922  rhot(ke+1:ka, i,j) = rhot(ke,i,j)
923  do iv = 1, va
924  prog(ke+1:ka, i,j,iv) = prog(ke,i,j,iv)
925  end do
926  enddo
927  enddo
928 
929  call comm_vars8( dens(:,:,:), i_comm_dens )
930  call comm_vars8( momz(:,:,:), i_comm_momz )
931  call comm_vars8( momx(:,:,:), i_comm_momx )
932  call comm_vars8( momy(:,:,:), i_comm_momy )
933  call comm_vars8( rhot(:,:,:), i_comm_rhot )
934  do iv = 1, va
935  call comm_vars8( prog(:,:,:,iv), i_comm_prog(iv) )
936  end do
937  call comm_wait ( dens(:,:,:), i_comm_dens, .false. )
938  call comm_wait ( momz(:,:,:), i_comm_momz, .false. )
939  call comm_wait ( momx(:,:,:), i_comm_momx, .false. )
940  call comm_wait ( momy(:,:,:), i_comm_momy, .false. )
941  call comm_wait ( rhot(:,:,:), i_comm_rhot, .false. )
942  do iv = 1, va
943  call comm_wait ( prog(:,:,:,iv), i_comm_prog(iv), .false. )
944  end do
945 
946  if ( use_average ) then
947  do j = jsb, jeb
948  do i = isb, ieb
949  do k = ks, ke
950  dens_av(k,i,j) = dens_av(k,i,j) + dens(k,i,j)
951  momz_av(k,i,j) = momz_av(k,i,j) + momz(k,i,j)
952  momx_av(k,i,j) = momx_av(k,i,j) + momx(k,i,j)
953  momy_av(k,i,j) = momy_av(k,i,j) + momy(k,i,j)
954  rhot_av(k,i,j) = rhot_av(k,i,j) + rhot(k,i,j)
955  end do
956  end do
957  end do
958  endif
959 
960 #ifndef DRY
961  do j = jsb, jeb
962  do i = isb, ieb
963  do k = ks, ke
964  mflx_av(k,i,j,:) = mflx_av(k,i,j,:) + mflx_hi(k,i,j,:)
965  end do
966  end do
967  end do
968 #endif
969 
970  enddo ! dynamical steps
971 
972  if ( use_average ) then
973  do j = jsb, jeb
974  do i = isb, ieb
975  do k = ks, ke
976  dens_av(k,i,j) = dens_av(k,i,j) / nstep
977  end do
978  end do
979  end do
980  do j = jsb, jeb
981  do i = isb, ieb
982  do k = ks, ke
983  momz_av(k,i,j) = momz_av(k,i,j) / nstep
984  end do
985  end do
986  end do
987  do j = jsb, jeb
988  do i = isb, ieb
989  do k = ks, ke
990  momx_av(k,i,j) = momx_av(k,i,j) / nstep
991  end do
992  end do
993  end do
994  do j = jsb, jeb
995  do i = isb, ieb
996  do k = ks, ke
997  momy_av(k,i,j) = momy_av(k,i,j) / nstep
998  end do
999  end do
1000  end do
1001  do j = jsb, jeb
1002  do i = isb, ieb
1003  do k = ks, ke
1004  rhot_av(k,i,j) = rhot_av(k,i,j) / nstep
1005  end do
1006  end do
1007  end do
1008  endif
1009 
1010 #ifndef DRY
1011  !###########################################################################
1012  ! Update Tracers
1013  !###########################################################################
1014 
1015 !OCL XFILL
1016  do n = 1, 3
1017  do j = jsb, jeb
1018  do i = isb, ieb
1019  do k = ks, ke
1020  mflx_hi(k,i,j,n) = mflx_av(k,i,j,n) / nstep
1021  end do
1022  end do
1023  end do
1024  end do
1025 
1026  call comm_vars8( mflx_hi(:,:,:,zdir), i_comm_mflx_z )
1027  call comm_vars8( mflx_hi(:,:,:,xdir), i_comm_mflx_x )
1028  call comm_vars8( mflx_hi(:,:,:,ydir), i_comm_mflx_y )
1029  call comm_wait ( mflx_hi(:,:,:,zdir), i_comm_mflx_z, .false. )
1030  call comm_wait ( mflx_hi(:,:,:,xdir), i_comm_mflx_x, .false. )
1031  call comm_wait ( mflx_hi(:,:,:,ydir), i_comm_mflx_y, .false. )
1032 
1033  if ( use_average ) then
1034 !OCL XFILL
1035  qtrc_av(:,:,:,:) = 0.0_rp
1036  endif
1037 
1038  !------------------------------------------------------------------------
1039  ! Update each tracer
1040  !------------------------------------------------------------------------
1041 
1042 #ifdef SDM
1043  do iq = 1, i_qv
1044 #else
1045  do iq = 1, qa
1046 #endif
1047 
1048  if ( tracer_advc(iq) ) then
1049 
1050  call prof_rapstart("DYN_Large_Numfilter", 2)
1051 
1052  if ( nd_coef_q == 0.0_rp ) then
1053 !OCL XFILL
1054  num_diff_q(:,:,:,:) = 0.0_rp
1055  else
1056  call atmos_dyn_numfilter_coef_q( num_diff_q(:,:,:,:), & ! [OUT]
1057  dens00, qtrc(:,:,:,iq), iq==i_qv, & ! [IN]
1058  cdz, cdx, cdy, dtl, & ! [IN]
1059  ref_qv, iq, & ! [IN]
1060  nd_coef_q, nd_order, nd_sfc_fact, nd_use_rs ) ! [IN]
1061  endif
1062 
1063  call prof_rapend ("DYN_Large_Numfilter", 2)
1064 
1065  call prof_rapstart("DYN_Tracer_Tinteg", 2)
1066 
1067  if ( flag_tracer_split_tend ) then
1068  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1069  !$omp shared(KA,IA,JA,iq,QTRC,RHOQ_t,DENS,dtl)
1070  do j = 1, ja
1071  do i = 1, ia
1072  do k = 1, ka
1073  qtrc(k,i,j,iq) = qtrc(k,i,j,iq) &
1074  + rhoq_t(k,i,j,iq) * dtl / dens(k,i,j)
1075  end do
1076  end do
1077  end do
1078  rhoq_tn => zero
1079  else
1080  rhoq_tn => rhoq_t(:,:,:,iq)
1081  end if
1082 
1083  call atmos_dyn_tinteg_tracer( &
1084  qtrc(:,:,:,iq), & ! (inout)
1085  qtrc0(:,:,:,iq), rhoq_tn, &! (in)
1086  dens00, dens, & ! (in)
1087  mflx_hi, num_diff_q, & ! (in)
1088  gsqrt, mapf(:,:,:,i_xy), & ! (in)
1089  cdz, rcdz, rcdx, rcdy, & ! (in)
1090  bnd_w, bnd_e, bnd_s, bnd_n, & ! (in)
1091  dtl, & ! (in)
1092  llast .AND. flag_fct_tracer, & ! (in)
1093  flag_fct_along_stream ) ! (in)
1094 
1095  call prof_rapend ("DYN_Tracer_Tinteg", 2)
1096 
1097  else
1098 
1099  do j = js, je
1100  do i = is, ie
1101  do k = ks, ke
1102  qtrc(k,i,j,iq) = ( qtrc0(k,i,j,iq) * dens00(k,i,j) &
1103  + rhoq_t(k,i,j,iq) * dtl ) / dens(k,i,j)
1104  end do
1105  end do
1106  end do
1107 
1108  end if
1109 
1110  if ( use_average ) then
1111  do j = jsb, jeb
1112  do i = isb, ieb
1113  do k = ks, ke
1114  qtrc_av(k,i,j,iq) = qtrc(k,i,j,iq)
1115  end do
1116  end do
1117  end do
1118  endif
1119 
1120  call comm_vars8( qtrc(:,:,:,iq), i_comm_qtrc(iq) )
1121 
1122  enddo ! scalar quantities loop
1123 
1124  do iq = 1, qa
1125  call comm_wait ( qtrc(:,:,:,iq), i_comm_qtrc(iq), .false. )
1126  enddo
1127 #endif
1128 
1129  return
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
Definition: scale_const.F90:57
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:56
subroutine, public atmos_dyn_fvm_fluxy_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation Y-flux at XYZ
integer, public va
Definition: scale_index.F90:35
subroutine, public atmos_dyn_fvm_fluxz_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation z-flux at XYZ
module Atmosphere / Dynamics Temporal integration
subroutine, public atmos_dyn_numfilter_coef(num_diff, DENS, MOMZ, MOMX, MOMY, RHOT, CDZ, CDX, CDY, FDZ, FDX, FDY, DT, REF_dens, REF_pott, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
integer, public ia
of whole cells: x, local, with HALO
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxx_xyz
integer, public ja
of whole cells: y, local, with HALO
module Atmosphere / Dynamics Temporal integration
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
module COMMUNICATION
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:88
integer, public je
end point of inner domain: y, local
subroutine, public atmos_dyn_numfilter_coef_q(num_diff_q, DENS, QTRC, is_qv, CDZ, CDX, CDY, dt, REF_qv, iq, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
procedure(tinteg), pointer, public atmos_dyn_tinteg_tracer
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
module CONSTANT
Definition: scale_const.F90:11
integer, public js
start point of inner domain: y, local
real(rp), public const_eps
small number
Definition: scale_const.F90:33
module scale_atmos_dyn_fvm_flux
integer, public ka
of whole cells: z, local, with HALO
subroutine, public atmos_dyn_fct(qflx_anti, phi_in, DENS0, DENS, qflx_hi, qflx_lo, mflx_hi, rdz, rdx, rdy, GSQRT, MAPF, dt, flag_vect)
Flux Correction Transport Limiter.
subroutine, public atmos_dyn_divergence(DDIV, MOMZ, MOMX, MOMY, GSQRT, J13G, J23G, J33G, MAPF, RCDZ, RCDX, RCDY, RFDZ, FDZ)
procedure(short), pointer, public atmos_dyn_tinteg_short
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxz_xyz
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxy_xyz
module file_history
subroutine, public atmos_dyn_fvm_fluxx_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation X-flux at XYZ
module scale_atmos_dyn_fvm_flux_ud1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_mass()

subroutine scale_atmos_dyn_tstep_large_fvm_heve::check_mass ( real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension(ka,ia,ja), intent(in)  DAMP_DENS,
real(rp), dimension (ka,ia,ja,3), intent(in)  mflx_hi,
real(rp), dimension (ka,ia,ja,3), intent(in)  tflx_hi,
real(rp), dimension (ka,ia,ja,7), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2,7), intent(in)  MAPF,
real(rp), dimension(ia), intent(in)  RCDX,
real(rp), dimension(ja), intent(in)  RCDY,
real(rp), intent(in)  dt,
integer, intent(in)  step,
logical, intent(in)  BND_W,
logical, intent(in)  BND_E,
logical, intent(in)  BND_S,
logical, intent(in)  BND_N 
)

Definition at line 1141 of file scale_atmos_dyn_tstep_large_fvm_heve.F90.

References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_vol, scale_comm_cartesc::comm_datatype, scale_comm_cartesc::comm_world, scale_atmos_grid_cartesc_index::i_xy, scale_atmos_grid_cartesc_index::i_xyz, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::kmax, scale_atmos_grid_cartesc_index::ks, scale_atmos_grid_cartesc_index::xdir, scale_atmos_grid_cartesc_index::ydir, and scale_atmos_grid_cartesc_index::zdir.

Referenced by atmos_dyn_tstep_large_fvm_heve().

1141  use mpi
1142  use scale_atmos_grid_cartesc_real, only: &
1144  use scale_comm_cartesc, only: &
1145  comm_datatype, &
1146  comm_world
1147  use scale_file_history, only: &
1148  file_history_in
1149  implicit none
1150  real(RP), intent(in) :: dens (ka,ia,ja)
1151  real(RP), intent(in) :: damp_dens(ka,ia,ja)
1152  real(RP), intent(in) :: mflx_hi (ka,ia,ja,3)
1153  real(RP), intent(in) :: tflx_hi (ka,ia,ja,3)
1154  real(RP), intent(in) :: gsqrt (ka,ia,ja,7)
1155  real(RP), intent(in) :: mapf ( ia,ja,2,7)
1156  real(RP), intent(in) :: rcdx(ia)
1157  real(RP), intent(in) :: rcdy(ja)
1158  real(RP), intent(in) :: dt
1159  integer, intent(in) :: step
1160  logical, intent(in) :: bnd_w
1161  logical, intent(in) :: bnd_e
1162  logical, intent(in) :: bnd_s
1163  logical, intent(in) :: bnd_n
1164 
1165  ! lateral boundary flux
1166  real(RP) :: mflx_lb_horizontal(ka)
1167  real(RP) :: allmflx_lb_horizontal(ka)
1168  real(RP) :: mflx_lb_total
1169  real(RP) :: mass_total
1170  real(RP) :: mass_total2
1171  real(RP) :: allmflx_lb_total
1172  real(RP) :: allmass_total
1173  real(RP) :: allmass_total2
1174 
1175  integer :: k, i, j
1176  integer :: ierr
1177 
1178 
1179  call file_history_in(mflx_hi(:,:,:,zdir), 'MFLXZ', 'momentum flux of z-direction (w/ CHECK_MASS)', 'kg/m2/s', dim_type='ZHXY' )
1180  call file_history_in(mflx_hi(:,:,:,xdir), 'MFLXX', 'momentum flux of x-direction (w/ CHECK_MASS)', 'kg/m2/s', dim_type='ZXHY' )
1181  call file_history_in(mflx_hi(:,:,:,ydir), 'MFLXY', 'momentum flux of y-direction (w/ CHECK_MASS)', 'kg/m2/s', dim_type='ZXYH' )
1182 
1183  call file_history_in(tflx_hi(:,:,:,zdir), 'TFLXZ', 'potential temperature flux of z-direction (w/ CHECK_MASS)', 'K*kg/m2/s', dim_type='ZHXY' )
1184  call file_history_in(tflx_hi(:,:,:,xdir), 'TFLXX', 'potential temperature flux of x-direction (w/ CHECK_MASS)', 'K*kg/m2/s', dim_type='ZXHY' )
1185  call file_history_in(tflx_hi(:,:,:,ydir), 'TFLXY', 'potential temperature flux of y-direction (w/ CHECK_MASS)', 'K*kg/m2/s', dim_type='ZXYH' )
1186 
1187  mflx_lb_total = 0.0_rp
1188  mflx_lb_horizontal(:) = 0.0_rp
1189  allmflx_lb_horizontal(:) = 0.0_rp
1190 
1191  if ( bnd_w ) then ! for western boundary
1192  i = is
1193  do j = js, je
1194  do k = ks, ke
1195  mflx_lb_total = mflx_lb_total + mflx_hi(k,i-1,j,xdir) * rcdx(i) * vol(k,i,j) &
1196  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1197  mflx_lb_horizontal(k) = mflx_lb_horizontal(k) + mflx_hi(k,i-1,j,xdir) * rcdx(i) * vol(k,i,j) &
1198  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1199 
1200  end do
1201  end do
1202  end if
1203  if ( bnd_e ) then ! for eastern boundary
1204  i = ie
1205  do j = js, je
1206  do k = ks, ke
1207  mflx_lb_total = mflx_lb_total - mflx_hi(k,i,j,xdir) * rcdx(i) * vol(k,i,j) &
1208  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1209  mflx_lb_horizontal(k) = mflx_lb_horizontal(k) - mflx_hi(k,i,j,xdir) * rcdx(i) * vol(k,i,j) &
1210  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1211  end do
1212  end do
1213  end if
1214  if ( bnd_s ) then ! for sourthern boundary
1215  j = js
1216  do i = is, ie
1217  do k = ks, ke
1218  mflx_lb_total = mflx_lb_total + mflx_hi(k,i,j-1,ydir) * rcdy(j) * vol(k,i,j) &
1219  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1220  mflx_lb_horizontal(k) = mflx_lb_horizontal(k) + mflx_hi(k,i,j-1,ydir) * rcdy(j) * vol(k,i,j) &
1221  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1222  end do
1223  end do
1224  end if
1225  if ( bnd_n ) then ! for northern boundary
1226  j = je
1227  do i = is, ie
1228  do k = ks, ke
1229  mflx_lb_total = mflx_lb_total - mflx_hi(k,i,j,ydir) * rcdy(j) * vol(k,i,j) &
1230  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1231  mflx_lb_horizontal(k) = mflx_lb_horizontal(k) - mflx_hi(k,i,j,ydir) * rcdy(j) * vol(k,i,j) &
1232  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) / gsqrt(k,i,j,i_xyz) * dt
1233  end do
1234  end do
1235  end if
1236 
1237  mass_total = 0.0_rp
1238  mass_total2 = 0.0_rp
1239 
1240  ! check total mass in the inner region
1241  do j = js, je
1242  do i = is, ie
1243  do k = ks, ke
1244  mass_total = mass_total + dens(k,i,j) * vol(k,i,j)
1245  mass_total2 = mass_total2 + damp_dens(k,i,j) * vol(k,i,j)
1246  end do
1247  end do
1248  end do
1249 
1250  call mpi_allreduce( mflx_lb_total, &
1251  allmflx_lb_total, &
1252  1, &
1253  comm_datatype, &
1254  mpi_sum, &
1255  comm_world, &
1256  ierr )
1257 
1258  log_info("check_mass",'(A,1x,I1,1x,ES24.17)') 'total mflx_lb:', step, allmflx_lb_total
1259 
1260  call mpi_allreduce( mass_total, &
1261  allmass_total, &
1262  1, &
1263  comm_datatype, &
1264  mpi_sum, &
1265  comm_world, &
1266  ierr )
1267 
1268  log_info("check_mass",'(A,1x,I1,1x,ES24.17)') 'total mass :', step, allmass_total
1269 
1270  call mpi_allreduce( mass_total2, &
1271  allmass_total2, &
1272  1, &
1273  comm_datatype, &
1274  mpi_sum, &
1275  comm_world, &
1276  ierr )
1277 
1278  log_info("check_mass",'(A,1x,I1,1x,ES24.17)') 'total mass2 :', step, allmass_total2
1279 
1280  call mpi_allreduce( mflx_lb_horizontal(ks:ke), &
1281  allmflx_lb_horizontal(ks:ke), &
1282  kmax, &
1283  comm_datatype, &
1284  mpi_sum, &
1285  comm_world, &
1286  ierr )
1287 
1288  call file_history_in(allmflx_lb_horizontal(:), 'ALLMOM_lb_hz', &
1289  'horizontally total momentum flux from lateral boundary (w/ CHECK_MASS)', 'kg/m2/s' )
1290 
1291  return
integer, public comm_world
communication world ID
integer, public ia
of whole cells: x, local, with HALO
integer, public comm_datatype
datatype of variable
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
integer, public ja
of whole cells: y, local, with HALO
module COMMUNICATION
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public kmax
of computational cells: z, local
integer, public js
start point of inner domain: y, local
module Atmosphere GRID CartesC Real(real space)
integer, public ka
of whole cells: z, local, with HALO
module file_history
Here is the caller graph for this function: