SCALE-RM
Functions/Subroutines
scale_atmos_dyn_tinteg_short_rk3 Module Reference

module Atmosphere / Dyn Tinteg More...

Functions/Subroutines

subroutine, public atmos_dyn_tinteg_short_rk3_setup (tinteg_type)
 Setup. More...
 
subroutine, public atmos_dyn_tinteg_short_rk3_finalize
 finalize More...
 
subroutine, public atmos_dyn_tinteg_short_rk3 (DENS, MOMZ, MOMX, MOMY, RHOT, PROG, mflx_hi, tflx_hi, DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, DPRES0, CVtot, CORIOLI, num_diff, wdamp_coef, divdmp_coef, DDIV, FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_ALONG_STREAM, CDZ, FDZ, FDX, FDY, RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, PHI, GSQRT, J13G, J23G, J33G, MAPF, REF_pres, REF_dens, BND_W, BND_E, BND_S, BND_N, TwoD, dt)
 RK3. More...
 

Detailed Description

module Atmosphere / Dyn Tinteg

Description
Temporal integration in Dynamical core for Atmospheric process three stage Runge-Kutta scheme
Author
Team SCALE

This module provides two types of 3rd order and 3 stage Runge=Kutta method: Heun's method and one in Wichere and Skamarock (2002). Note that, Wicker and Skamarock's one ensures 3rd order accuracy only for the case of linear eqautions, and is generally 2nd order accuracy.

Function/Subroutine Documentation

◆ atmos_dyn_tinteg_short_rk3_setup()

subroutine, public scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3_setup ( character(len=*)  tinteg_type)

Setup.

Definition at line 94 of file scale_atmos_dyn_tinteg_short_rk3.F90.

94  use scale_prc, only: &
95  prc_abort
96  use scale_const, only: &
97  undef => const_undef
98  use scale_comm_cartesc, only: &
100  implicit none
101 
102  character(len=*) :: tinteg_type
103 
104  integer :: iv
105  !---------------------------------------------------------------------------
106 
107  select case( tinteg_type )
108  case( 'RK3' )
109  log_info("ATMOS_DYN_Tinteg_short_rk3_setup",*) "RK3: Heun's method is used"
110  ! Heun's method
111  ! k1 = f(\phi_n); r1 = \phi_n + k1 * dt / 3
112  ! k2 = f(r1); r2 = \phi_n + k2 * dt * 2 / 3
113  ! k3 = f(r2); r3 = \phi_n + k3 * dt
114  ! \phi_{n+1} = \phi_n + ( k1 + 3 * k3 ) dt / 4
115  ! = \phi_n + ( (r1-\phi_n) * 3 + (r3-\phi_n) * 3 ) / 4
116  ! = ( r1 * 3 + r3 * 3 - \phi_n * 2 ) / 4
117  flag_ws2002 = .false.
118  fact_dt1 = 1.0_rp / 3.0_rp
119  fact_dt2 = 2.0_rp / 3.0_rp
120  case( 'RK3WS2002' )
121  log_info("ATMOS_DYN_Tinteg_short_rk3_setup",*) "RK3: Wicker and Skamarock (2002) is used"
122  ! Wicker and Skamarock (2002) RK3 scheme
123  ! k1 = f(\phi_n); r1 = \phi_n + k1 * dt / 3
124  ! k2 = f(r1); r2 = \phi_n + k2 * dt / 2
125  ! k3 = f(r2); r3 = \phi_n + k3 * dt
126  ! \phi_{n+1} = r3
127  ! Unlike to Heun's RK3 method, the memory arrays are not needed in this case.
128  flag_ws2002 = .true.
129  fact_dt1 = 1.0_rp / 3.0_rp
130  fact_dt2 = 1.0_rp / 2.0_rp
131  case default
132  log_error("ATMOS_DYN_Tinteg_short_rk3_setup",*) 'TINTEG_TYPE is not RK3. Check!'
133  call prc_abort
134  end select
135 
136  allocate( dens_rk1(ka,ia,ja) )
137  allocate( momz_rk1(ka,ia,ja) )
138  allocate( momx_rk1(ka,ia,ja) )
139  allocate( momy_rk1(ka,ia,ja) )
140  allocate( rhot_rk1(ka,ia,ja) )
141 
142  allocate( dens_rk2(ka,ia,ja) )
143  allocate( momz_rk2(ka,ia,ja) )
144  allocate( momx_rk2(ka,ia,ja) )
145  allocate( momy_rk2(ka,ia,ja) )
146  allocate( rhot_rk2(ka,ia,ja) )
147 
148  allocate( prog_rk1(ka,ia,ja,max(va,1)) )
149  allocate( prog_rk2(ka,ia,ja,max(va,1)) )
150  allocate( i_comm_prog_rk1(max(va,1)) )
151  allocate( i_comm_prog_rk2(max(va,1)) )
152 
153  i_comm_dens_rk1 = 1
154  i_comm_momz_rk1 = 2
155  i_comm_momx_rk1 = 3
156  i_comm_momy_rk1 = 4
157  i_comm_rhot_rk1 = 5
158  call comm_vars8_init( 'DENS_RK1', dens_rk1, i_comm_dens_rk1 )
159  call comm_vars8_init( 'MOMZ_RK1', momz_rk1, i_comm_momz_rk1 )
160  call comm_vars8_init( 'MOMX_RK1', momx_rk1, i_comm_momx_rk1 )
161  call comm_vars8_init( 'MOMY_RK1', momy_rk1, i_comm_momy_rk1 )
162  call comm_vars8_init( 'RHOT_RK1', rhot_rk1, i_comm_rhot_rk1 )
163  do iv = 1, va
164  i_comm_prog_rk1(iv) = 5 + iv
165  call comm_vars8_init( 'PROG_RK1', prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
166  enddo
167 
168 
169  i_comm_dens_rk2 = 1
170  i_comm_momz_rk2 = 2
171  i_comm_momx_rk2 = 3
172  i_comm_momy_rk2 = 4
173  i_comm_rhot_rk2 = 5
174  call comm_vars8_init( 'DENS_RK2', dens_rk2, i_comm_dens_rk2 )
175  call comm_vars8_init( 'MOMZ_RK2', momz_rk2, i_comm_momz_rk2 )
176  call comm_vars8_init( 'MOMX_RK2', momx_rk2, i_comm_momx_rk2 )
177  call comm_vars8_init( 'MOMY_RK2', momy_rk2, i_comm_momy_rk2 )
178  call comm_vars8_init( 'RHOT_RK2', rhot_rk2, i_comm_rhot_rk2 )
179  do iv = 1, va
180  i_comm_prog_rk2(iv) = 5 + iv
181  call comm_vars8_init( 'PROG_RK2', prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
182  enddo
183 
184  dens_rk1(:,:,:) = undef
185  momz_rk1(:,:,:) = undef
186  momx_rk1(:,:,:) = undef
187  momy_rk1(:,:,:) = undef
188  rhot_rk1(:,:,:) = undef
189  if ( va > 0 ) prog_rk1(:,:,:,:) = undef
190 
191  dens_rk2(:,:,:) = undef
192  momz_rk2(:,:,:) = undef
193  momx_rk2(:,:,:) = undef
194  momy_rk2(:,:,:) = undef
195  rhot_rk2(:,:,:) = undef
196  if ( va > 0 ) prog_rk2(:,:,:,:) = undef
197 
198  return

References scale_comm_cartesc::comm_vars8_init(), 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(), and scale_index::va.

Referenced by scale_atmos_dyn_tinteg_short::atmos_dyn_tinteg_short_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_tinteg_short_rk3_finalize()

subroutine, public scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3_finalize

finalize

Definition at line 204 of file scale_atmos_dyn_tinteg_short_rk3.F90.

204 
205  deallocate( dens_rk1 )
206  deallocate( momz_rk1 )
207  deallocate( momx_rk1 )
208  deallocate( momy_rk1 )
209  deallocate( rhot_rk1 )
210 
211  deallocate( dens_rk2 )
212  deallocate( momz_rk2 )
213  deallocate( momx_rk2 )
214  deallocate( momy_rk2 )
215  deallocate( rhot_rk2 )
216 
217  deallocate( prog_rk1 )
218  deallocate( prog_rk2 )
219  deallocate( i_comm_prog_rk1 )
220  deallocate( i_comm_prog_rk2 )
221 
222  return

Referenced by scale_atmos_dyn_tinteg_short::atmos_dyn_tinteg_short_setup().

Here is the caller graph for this function:

◆ atmos_dyn_tinteg_short_rk3()

subroutine, public scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3 ( 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,va), intent(inout)  PROG,
real(rp), dimension(ka,ia,ja,3), intent(inout)  mflx_hi,
real(rp), dimension(ka,ia,ja,3), intent(out)  tflx_hi,
real(rp), dimension(ka,ia,ja), intent(in)  DENS_t,
real(rp), dimension(ka,ia,ja), intent(in)  MOMZ_t,
real(rp), dimension(ka,ia,ja), intent(in)  MOMX_t,
real(rp), dimension(ka,ia,ja), intent(in)  MOMY_t,
real(rp), dimension(ka,ia,ja), intent(in)  RHOT_t,
real(rp), dimension(ka,ia,ja), intent(in)  DPRES0,
real(rp), dimension(ka,ia,ja), intent(in)  CVtot,
real(rp), dimension(ia,ja), intent(in)  CORIOLI,
real(rp), dimension(ka,ia,ja,5,3), intent(in)  num_diff,
real(rp), dimension(ka), intent(in)  wdamp_coef,
real(rp), intent(in)  divdmp_coef,
real(rp), dimension(ka,ia,ja), intent(in)  DDIV,
logical, intent(in)  FLAG_FCT_MOMENTUM,
logical, intent(in)  FLAG_FCT_T,
logical, intent(in)  FLAG_FCT_ALONG_STREAM,
real(rp), dimension (ka), intent(in)  CDZ,
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(ka,ia,ja), intent(in)  REF_pres,
real(rp), dimension(ka,ia,ja), intent(in)  REF_dens,
logical, intent(in)  BND_W,
logical, intent(in)  BND_E,
logical, intent(in)  BND_S,
logical, intent(in)  BND_N,
logical, intent(in)  TwoD,
real(rp), intent(in)  dt 
)

RK3.

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 240 of file scale_atmos_dyn_tinteg_short_rk3.F90.

240  use scale_comm_cartesc, only: &
241  comm_vars8, &
242  comm_wait
243  use scale_atmos_dyn_tstep_short, only: &
244  atmos_dyn_tstep => atmos_dyn_tstep_short
245  use scale_atmos_dyn_common, only: &
247  implicit none
248 
249  real(RP), intent(inout) :: DENS(KA,IA,JA)
250  real(RP), intent(inout) :: MOMZ(KA,IA,JA)
251  real(RP), intent(inout) :: MOMX(KA,IA,JA)
252  real(RP), intent(inout) :: MOMY(KA,IA,JA)
253  real(RP), intent(inout) :: RHOT(KA,IA,JA)
254  real(RP), intent(inout) :: PROG(KA,IA,JA,VA)
255 
256  real(RP), intent(inout) :: mflx_hi(KA,IA,JA,3)
257  real(RP), intent(out ) :: tflx_hi(KA,IA,JA,3)
258 
259  real(RP), intent(in) :: DENS_t(KA,IA,JA)
260  real(RP), intent(in) :: MOMZ_t(KA,IA,JA)
261  real(RP), intent(in) :: MOMX_t(KA,IA,JA)
262  real(RP), intent(in) :: MOMY_t(KA,IA,JA)
263  real(RP), intent(in) :: RHOT_t(KA,IA,JA)
264 
265  real(RP), intent(in) :: DPRES0(KA,IA,JA)
266  real(RP), intent(in) :: CVtot(KA,IA,JA)
267  real(RP), intent(in) :: CORIOLI(IA,JA)
268  real(RP), intent(in) :: num_diff(KA,IA,JA,5,3)
269  real(RP), intent(in) :: wdamp_coef(KA)
270  real(RP), intent(in) :: divdmp_coef
271  real(RP), intent(in) :: DDIV(KA,IA,JA)
272 
273  logical, intent(in) :: FLAG_FCT_MOMENTUM
274  logical, intent(in) :: FLAG_FCT_T
275  logical, intent(in) :: FLAG_FCT_ALONG_STREAM
276 
277  real(RP), intent(in) :: CDZ (KA)
278  real(RP), intent(in) :: FDZ (KA-1)
279  real(RP), intent(in) :: FDX (IA-1)
280  real(RP), intent(in) :: FDY (JA-1)
281  real(RP), intent(in) :: RCDZ(KA)
282  real(RP), intent(in) :: RCDX(IA)
283  real(RP), intent(in) :: RCDY(JA)
284  real(RP), intent(in) :: RFDZ(KA-1)
285  real(RP), intent(in) :: RFDX(IA-1)
286  real(RP), intent(in) :: RFDY(JA-1)
287 
288  real(RP), intent(in) :: PHI (KA,IA,JA)
289  real(RP), intent(in) :: GSQRT(KA,IA,JA,7)
290  real(RP), intent(in) :: J13G (KA,IA,JA,7)
291  real(RP), intent(in) :: J23G (KA,IA,JA,7)
292  real(RP), intent(in) :: J33G
293  real(RP), intent(in) :: MAPF (IA,JA,2,4)
294 
295  real(RP), intent(in) :: REF_pres(KA,IA,JA)
296  real(RP), intent(in) :: REF_dens(KA,IA,JA)
297 
298  logical, intent(in) :: BND_W
299  logical, intent(in) :: BND_E
300  logical, intent(in) :: BND_S
301  logical, intent(in) :: BND_N
302  logical, intent(in) :: TwoD
303 
304  real(RP), intent(in) :: dt
305 
306  real(RP) :: DENS0(KA,IA,JA)
307  real(RP) :: MOMZ0(KA,IA,JA)
308  real(RP) :: MOMX0(KA,IA,JA)
309  real(RP) :: MOMY0(KA,IA,JA)
310  real(RP) :: RHOT0(KA,IA,JA)
311  real(RP) :: PROG0(KA,IA,JA,VA)
312 
313  real(RP) :: mflx_hi_RK(KA,IA,JA,3,2)
314  real(RP) :: tflx_hi_RK(KA,IA,JA,3,2)
315 
316  real(RP) :: dtrk
317 
318  integer :: i, j, k, iv, n
319  !---------------------------------------------------------------------------
320 
321  call prof_rapstart("DYN_RK3_Prep",3)
322 
323 #ifdef DEBUG
324  dens_rk1(:,:,:) = undef
325  momz_rk1(:,:,:) = undef
326  momx_rk1(:,:,:) = undef
327  momy_rk1(:,:,:) = undef
328  rhot_rk1(:,:,:) = undef
329  if ( va > 0 ) prog_rk1(:,:,:,:) = undef
330 
331  dens_rk2(:,:,:) = undef
332  momz_rk2(:,:,:) = undef
333  momx_rk2(:,:,:) = undef
334  momy_rk2(:,:,:) = undef
335  rhot_rk2(:,:,:) = undef
336  if ( va > 0 ) prog_rk2(:,:,:,:) = undef
337 
338  mflx_hi_rk(:,:,:,:,:) = undef
339  tflx_hi_rk(:,:,:,:,:) = undef
340 #endif
341 
342 #ifdef QUICKDEBUG
343  mflx_hi( 1:ks-1,:,:,:) = undef
344  mflx_hi(ke+1:ka ,:,:,:) = undef
345 #endif
346 
347 !OCL XFILL
348  dens0 = dens
349 !OCL XFILL
350  momz0 = momz
351 !OCL XFILL
352  momx0 = momx
353 !OCL XFILL
354  momy0 = momy
355 !OCL XFILL
356  rhot0 = rhot
357 !OCL XFILL
358  if ( va > 0 ) prog0 = prog
359 
360  if ( bnd_w .and. (.not. twod) ) then
361  do j = js, je
362  do k = ks, ke
363  mflx_hi_rk(k,is-1,j,2,:) = mflx_hi(k,is-1,j,2)
364  end do
365  end do
366  end if
367  if ( bnd_e .and. (.not. twod) ) then
368  do j = js, je
369  do k = ks, ke
370  mflx_hi_rk(k,ie,j,2,:) = mflx_hi(k,ie,j,2)
371  end do
372  end do
373  end if
374  if ( bnd_s ) then
375  do i = is, ie
376  do k = ks, ke
377  mflx_hi_rk(k,i,js-1,3,:) = mflx_hi(k,i,js-1,3)
378  end do
379  end do
380  end if
381  if ( bnd_n ) then
382  do i = is, ie
383  do k = ks, ke
384  mflx_hi_rk(k,i,je,3,:) = mflx_hi(k,i,je,3)
385  end do
386  end do
387  end if
388 
389  call prof_rapend ("DYN_RK3_Prep",3)
390 
391  !------------------------------------------------------------------------
392  ! Start RK
393  !------------------------------------------------------------------------
394 
395  !##### RK1 : PROG0,PROG->PROG_RK1 #####
396 
397  call prof_rapstart("DYN_RK3",3)
398 
399  dtrk = dt * fact_dt1
400 
401  call atmos_dyn_tstep( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, & ! [OUT]
402  prog_rk1, & ! [OUT]
403  mflx_hi_rk(:,:,:,:,1), tflx_hi_rk(:,:,:,:,1), & ! [INOUT,OUT]
404  dens0, momz0, momx0, momy0, rhot0, & ! [IN]
405  dens, momz, momx, momy, rhot, & ! [IN]
406  dens_t, momz_t, momx_t, momy_t, rhot_t, & ! [IN]
407  prog0, prog, & ! [IN]
408  dpres0, cvtot, corioli, & ! [IN]
409  num_diff, wdamp_coef, divdmp_coef, ddiv, & ! [IN]
410  flag_fct_momentum, flag_fct_t, & ! [IN]
411  flag_fct_along_stream, & ! [IN]
412  cdz, fdz, fdx, fdy, & ! [IN]
413  rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, & ! [IN]
414  phi, gsqrt, j13g, j23g, j33g, mapf, & ! [IN]
415  ref_pres, ref_dens, & ! [IN]
416  bnd_w, bnd_e, bnd_s, bnd_n, twod, & ! [IN]
417  dtrk, .false. ) ! [IN]
418 
419  call prof_rapend ("DYN_RK3",3)
420  call prof_rapstart("DYN_RK3_BND",3)
421 
422  call atmos_dyn_copy_boundary( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, & ! [INOUT]
423  prog_rk1, & ! [INOUT]
424  dens0, momz0, momx0, momy0, rhot0, & ! [IN]
425  prog0, & ! [IN]
426  bnd_w, bnd_e, bnd_s, bnd_n, twod ) ! [IN]
427 
428  call prof_rapend ("DYN_RK3_BND",3)
429 
430  call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
431  call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
432  call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
433  call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
434  call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
435  do iv = 1, va
436  call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
437  enddo
438 
439  call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
440  call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
441  call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
442  call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
443  call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
444  do iv = 1, va
445  call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
446  enddo
447 
448  !##### RK2 : PROG0,PROG_RK1->PROG_RK2 #####
449 
450  call prof_rapstart("DYN_RK3",3)
451 
452  dtrk = dt * fact_dt2
453 
454  call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, & ! [OUT]
455  prog_rk2, & ! [OUT]
456  mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), & ! [INOUT,OUT]
457  dens0, momz0, momx0, momy0, rhot0, & ! [IN]
458  dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, & ! [IN]
459  dens_t, momz_t, momx_t, momy_t, rhot_t, & ! [IN]
460  prog0, prog_rk1, & ! [IN]
461  dpres0, cvtot, corioli, & ! [IN]
462  num_diff, wdamp_coef, divdmp_coef, ddiv, & ! [IN]
463  flag_fct_momentum, flag_fct_t, & ! [IN]
464  flag_fct_along_stream, & ! [IN]
465  cdz, fdz, fdx, fdy, & ! [IN]
466  rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, & ! [IN]
467  phi, gsqrt, j13g, j23g, j33g, mapf, & ! [IN]
468  ref_pres, ref_dens, & ! [IN]
469  bnd_w, bnd_e, bnd_s, bnd_n, twod, & ! [IN]
470  dtrk, .false. ) ! [IN]
471 
472  call prof_rapend ("DYN_RK3",3)
473  call prof_rapstart("DYN_RK3_BND",3)
474 
475  call atmos_dyn_copy_boundary( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, & ! [INOUT]
476  prog_rk2, & ! [INOUT]
477  dens0, momz0, momx0, momy0, rhot0, & ! [IN]
478  prog0, & ! [IN]
479  bnd_w, bnd_e, bnd_s, bnd_n, twod ) ! [IN]
480 
481  call prof_rapend ("DYN_RK3_BND",3)
482 
483  call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
484  call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
485  call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
486  call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
487  call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
488  do iv = 1, va
489  call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
490  enddo
491 
492  call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
493  call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
494  call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
495  call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
496  call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
497  do iv = 1, va
498  call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
499  enddo
500 
501  !##### RK3 : PROG0,PROG_RK2->PROG #####
502 
503  call prof_rapstart("DYN_RK3",3)
504 
505  dtrk = dt
506 
507  call atmos_dyn_tstep( dens, momz, momx, momy, rhot, & ! [OUT]
508  prog, & ! [OUT]
509  mflx_hi, tflx_hi, & ! [INOUT,OUT]
510  dens0, momz0, momx0, momy0, rhot0, & ! [IN]
511  dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, & ! [IN]
512  dens_t, momz_t, momx_t, momy_t, rhot_t, & ! [IN]
513  prog0, prog_rk2, & ! [IN]
514  dpres0, cvtot, corioli, & ! [IN]
515  num_diff, wdamp_coef, divdmp_coef, ddiv, & ! [IN]
516  flag_fct_momentum, flag_fct_t, & ! [IN]
517  flag_fct_along_stream, & ! [IN]
518  cdz, fdz, fdx, fdy, & ! [IN]
519  rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, & ! [IN]
520  phi, gsqrt, j13g, j23g, j33g, mapf, & ! [IN]
521  ref_pres, ref_dens, & ! [IN]
522  bnd_w, bnd_e, bnd_s, bnd_n, twod, & ! [IN]
523  dtrk, .true. ) ! [IN]
524 
525  if ( .NOT. flag_ws2002 ) then
526  do j = js, je
527  do i = is, ie
528  do k = ks, ke
529  dens(k,i,j) = ( dens_rk1(k,i,j) * 3.0_rp &
530  + dens(k,i,j) * 3.0_rp &
531  - dens0(k,i,j) * 2.0_rp ) / 4.0_rp
532  enddo
533  enddo
534  enddo
535 
536  do j = js, je
537  do i = is, ie
538  do k = ks, ke-1
539  momz(k,i,j) = ( momz_rk1(k,i,j) * 3.0_rp &
540  + momz(k,i,j) * 3.0_rp &
541  - momz0(k,i,j) * 2.0_rp ) / 4.0_rp
542  enddo
543  enddo
544  enddo
545 
546  do j = js, je
547  do i = is, ie
548  do k = ks, ke
549  momx(k,i,j) = ( momx_rk1(k,i,j) * 3.0_rp &
550  + momx(k,i,j) * 3.0_rp &
551  - momx0(k,i,j) * 2.0_rp ) / 4.0_rp
552  enddo
553  enddo
554  enddo
555 
556  do j = js, je
557  do i = is, ie
558  do k = ks, ke
559  momy(k,i,j) = ( momy_rk1(k,i,j) * 3.0_rp &
560  + momy(k,i,j) * 3.0_rp &
561  - momy0(k,i,j) * 2.0_rp ) / 4.0_rp
562  enddo
563  enddo
564  enddo
565 
566  do j = js, je
567  do i = is, ie
568  do k = ks, ke
569  rhot(k,i,j) = ( rhot_rk1(k,i,j) * 3.0_rp &
570  + rhot(k,i,j) * 3.0_rp &
571  - rhot0(k,i,j) * 2.0_rp ) / 4.0_rp
572  enddo
573  enddo
574  enddo
575 
576  do iv = 1, va
577  do j = js, je
578  do i = is, ie
579  do k = ks, ke
580  prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 3.0_rp &
581  + prog(k,i,j,iv) * 3.0_rp &
582  - prog0(k,i,j,iv) * 2.0_rp ) / 4.0_rp
583  enddo
584  enddo
585  enddo
586  enddo
587 
588  do n = 1, 3
589  do j = js, je
590  do i = is, ie
591  do k = ks, ke
592  mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
593  + mflx_hi(k,i,j,n ) * 3.0_rp ) / 4.0_rp
594  enddo
595  enddo
596  enddo
597  enddo
598 
599  do n = 1, 3
600  do j = js, je
601  do i = is, ie
602  do k = ks, ke
603  tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
604  + tflx_hi(k,i,j,n ) * 3.0_rp ) / 4.0_rp
605  enddo
606  enddo
607  enddo
608  enddo
609 
610  endif
611 
612  call prof_rapend ("DYN_RK3",3)
613 
614  return

References scale_atmos_dyn_common::atmos_dyn_copy_boundary(), scale_atmos_dyn_tstep_short::atmos_dyn_tstep_short, 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_tracer::k, 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(), and scale_index::va.

Referenced by scale_atmos_dyn_tinteg_short::atmos_dyn_tinteg_short_setup().

Here is the call graph for this function:
Here is the caller graph for this function:
scale_atmos_grid_cartesc_index::ke
integer, public ke
end point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:52
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_atmos_dyn_common
module Atmosphere / Dynamics common
Definition: scale_atmos_dyn_common.F90:12
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
scale_atmos_dyn_tstep_short::atmos_dyn_tstep_short
procedure(short), pointer, public atmos_dyn_tstep_short
Definition: scale_atmos_dyn_tstep_short.F90:135
scale_index::va
integer, public va
Definition: scale_index.F90:35
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_atmos_dyn_tstep_short
module Atmosphere / Dynamical scheme
Definition: scale_atmos_dyn_tstep_short.F90:12
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_comm_cartesc
module COMMUNICATION
Definition: scale_comm_cartesC.F90:11
scale_atmos_grid_cartesc_index::js
integer, public js
start point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:55
scale_comm_cartesc::comm_vars8_init
subroutine, public comm_vars8_init(varname, var, vid, gid)
Register variables.
Definition: scale_comm_cartesC.F90:811
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:43
scale_atmos_dyn_common::atmos_dyn_copy_boundary
subroutine, public atmos_dyn_copy_boundary(DENS, MOMZ, MOMX, MOMY, RHOT, PROG, DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, BND_W, BND_E, BND_S, BND_N, TwoD)
Definition: scale_atmos_dyn_common.F90:215
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56