28 #if defined DEBUG || defined QUICKDEBUG
67 (/ 0.0_rp, 3.0_rp/19.0_rp, 9.0_rp/152.0_rp, 94474764.0_rp/318611987.0_rp, -76607525678.0_rp/925997907411.0_rp, -113193410749715476.0_rp/1376008387821185625.0_rp, 510341547912673.0_rp/1709758911034368.0_rp, &
68 0.0_rp, 0.0_rp, 27.0_rp/152.0_rp, -310753854.0_rp/318611987.0_rp, 309768324.0_rp/200562683.0_rp, 68309142.0_rp/42280325.0_rp, -3074637.0_rp/21410624.0_rp, &
69 0.0_rp, 0.0_rp, 0.0_rp, 375818328.0_rp/318611987.0_rp, -57882086555344.0_rp/37088653028409.0_rp, -9901869473098663108168.0_rp/5940196722617929711875.0_rp, 205532548800199165.0_rp/6225256605226855824.0_rp, &
70 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 643400862141470.0_rp/704684407539771.0_rp, 8947230518934447694268.0_rp/9333225588784524496875.0_rp, 32370527990426718666299.0_rp/90521226376106372167680.0_rp, &
71 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, -8377112295767292.0_rp/1089624335851065625.0_rp, 2610287999955961017.0_rp/236243323046620160.0_rp, &
72 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, -2690946369187951875.0_rp/253991013039290368.0_rp, &
73 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp /), &
77 (/ 119490041.0_rp/1597112640.0_rp, 0.0_rp, 55710603179056.0_rp/168638187800205.0_rp, &
78 5739605598843081731.0_rp/28834038834414422400.0_rp, 1477688286853979.0_rp/291957783566400.0_rp, -298030839900625.0_rp/62778200252544.0_rp, &
79 5352656.0_rp/65415735.0_rp /)
85 (/ 0.0_rp, 1.0_rp/3.0_rp, 0.0_rp, 1.0_rp/12.0_rp, -1.0_rp/16.0_rp, 0.0_rp, 9.0_rp/44.0_rp, &
86 0.0_rp, 0.0_rp, 2.0_rp/3.0_rp, 1.0_rp/3.0_rp, 9.0_rp/8.0_rp, 9.0_rp/8.0_rp, -9.0_rp/11.0_rp, &
87 0.0_rp, 0.0_rp, 0.0_rp, -1.0_rp/12.0_rp, -3.0_rp/16.0_rp, -3_rp/8.0_rp, 63.0_rp/44.0_rp, &
88 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, -3.0_rp/8.0_rp, -3.0_rp/4.0_rp, 18.0_rp/11.0_rp, &
89 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 1.0_rp/2.0_rp, 0.0_rp, &
90 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, -16.0_rp/11.0_rp, &
91 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp, 0.0_rp /), &
95 1.0_rp/120.0_rp * (/ 11.0_rp, 0.0_rp, 81.0_rp, 81.0_rp, -32.0_rp, -32.0_rp, 11.0_rp /)
105 integer,
private,
parameter :: rk_nstage = 7
106 integer,
private,
parameter :: rk_nregister = 7
108 type(
rkinfo),
private :: rk_dynvar
109 integer,
private,
parameter :: i_rk_dens = 1
110 integer,
private,
parameter :: i_rk_momz = 2
111 integer,
private,
parameter :: i_rk_momx = 3
112 integer,
private,
parameter :: i_rk_momy = 4
113 integer,
private,
parameter :: i_rk_rhot = 5
115 type(
rkinfo),
private :: rk_prgvar
117 type(
rkinfo),
private :: rk_mflx_hi
118 type(
rkinfo),
private :: rk_tflx_hi
134 character(len=*) :: tinteg_type
137 character(H_SHORT) :: dynvar_name_list(5)
138 character(H_SHORT) :: prgvar_name_list(
va)
139 character(H_SHORT) :: flux_name_list(3)
141 real(
rp) :: rkcoef_a(rk_nstage,rk_nstage)
142 real(
rp) :: rkcoef_b(rk_nstage)
146 select case( trim(tinteg_type) )
147 case (
'RK7s6o',
'RK7s6oLawson1967')
150 case (
'RK7s6oButcher1964')
154 log_error(
"ATMOS_DYN_Tinteg_short_rk7s6o_setup",*)
'The specified TINTEG_TYPE is invalid. Check!', tinteg_type
158 dynvar_name_list(1) =
'DENS'
159 dynvar_name_list(2) =
'MOMZ'
160 dynvar_name_list(3) =
'MOMX'
161 dynvar_name_list(4) =
'MOMY'
162 dynvar_name_list(5) =
'RHOT'
163 call rkcommon_setup( rk_dynvar, rk_nstage, rk_nregister, rkcoef_a, rkcoef_b, dynvar_name_list )
166 flux_name_list(iv) =
'PROG'
168 call rkcommon_setup( rk_prgvar, rk_nstage, rk_nregister, rkcoef_a, rkcoef_b,prgvar_name_list, comm_id_offset=5 )
171 flux_name_list(iv) =
'mflx_hi'
173 call rkcommon_setup( rk_mflx_hi, rk_nstage, rk_nregister, rkcoef_a, rkcoef_b, flux_name_list, is_type_flux=.true. )
177 flux_name_list(iv) =
'tflx_hi'
179 call rkcommon_setup( rk_tflx_hi, rk_nstage, rk_nregister, rkcoef_a, rkcoef_b, flux_name_list, is_type_flux=.true. )
189 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
191 DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
192 DPRES0, CVtot, CORIOLI, &
193 num_diff, wdamp_coef, divdmp_coef, DDIV, &
194 FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
195 FLAG_FCT_ALONG_STREAM, &
196 CDZ, FDZ, FDX, FDY, &
197 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
198 PHI, GSQRT, J13G, J23G, J33G, MAPF, &
199 REF_pres, REF_dens, &
200 BND_W, BND_E, BND_S, BND_N, TwoD, &
211 real(
rp),
intent(inout) :: dens(
ka,
ia,
ja)
212 real(
rp),
intent(inout) :: momz(
ka,
ia,
ja)
213 real(
rp),
intent(inout) :: momx(
ka,
ia,
ja)
214 real(
rp),
intent(inout) :: momy(
ka,
ia,
ja)
215 real(
rp),
intent(inout) :: rhot(
ka,
ia,
ja)
218 real(
rp),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
219 real(
rp),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
221 real(
rp),
intent(in) :: dens_t(
ka,
ia,
ja)
222 real(
rp),
intent(in) :: momz_t(
ka,
ia,
ja)
223 real(
rp),
intent(in) :: momx_t(
ka,
ia,
ja)
224 real(
rp),
intent(in) :: momy_t(
ka,
ia,
ja)
225 real(
rp),
intent(in) :: rhot_t(
ka,
ia,
ja)
227 real(
rp),
intent(in) :: dpres0(
ka,
ia,
ja)
228 real(
rp),
intent(in) :: cvtot(
ka,
ia,
ja)
229 real(
rp),
intent(in) :: corioli(
ia,
ja)
230 real(
rp),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
231 real(
rp),
intent(in) :: wdamp_coef(
ka)
232 real(
rp),
intent(in) :: divdmp_coef
233 real(
rp),
intent(in) :: ddiv(
ka,
ia,
ja)
235 logical,
intent(in) :: flag_fct_momentum
236 logical,
intent(in) :: flag_fct_t
237 logical,
intent(in) :: flag_fct_along_stream
239 real(
rp),
intent(in) :: cdz (
ka)
240 real(
rp),
intent(in) :: fdz (
ka-1)
241 real(
rp),
intent(in) :: fdx (
ia-1)
242 real(
rp),
intent(in) :: fdy (
ja-1)
243 real(
rp),
intent(in) :: rcdz(
ka)
244 real(
rp),
intent(in) :: rcdx(
ia)
245 real(
rp),
intent(in) :: rcdy(
ja)
246 real(
rp),
intent(in) :: rfdz(
ka-1)
247 real(
rp),
intent(in) :: rfdx(
ia-1)
248 real(
rp),
intent(in) :: rfdy(
ja-1)
250 real(
rp),
intent(in) :: phi (
ka,
ia,
ja)
251 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
252 real(
rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
253 real(
rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
254 real(
rp),
intent(in) :: j33g
255 real(
rp),
intent(in) :: mapf (
ia,
ja,2,4)
257 real(
rp),
intent(in) :: ref_pres(
ka,
ia,
ja)
258 real(
rp),
intent(in) :: ref_dens(
ka,
ia,
ja)
260 logical,
intent(in) :: bnd_w
261 logical,
intent(in) :: bnd_e
262 logical,
intent(in) :: bnd_s
263 logical,
intent(in) :: bnd_n
264 logical,
intent(in) :: twod
266 real(
rp),
intent(in) :: dt
268 integer :: i, j,
k, iv, n, s
271 integer,
parameter :: ko_dynvar(5) = (/ 0, 1, 0, 0, 0 /)
272 integer,
parameter :: io_dynvar(5) = (/ 0, 0, 1, 0, 0 /)
273 integer,
parameter :: jo_dynvar(5) = (/ 0, 0, 0, 1, 0 /)
274 integer :: ko_prgvar(
va)
275 integer :: io_prgvar(
va)
276 integer :: jo_prgvar(
va)
282 call rkcommon_rkwork_alloc( rk_dynvar )
283 call rkcommon_rkwork_alloc( rk_prgvar )
286 rk_mflx_hi%buf( 1:
ks-1,:,:,:) = undef
287 rk_mflx_hi%buf(
ke+1:
ka ,:,:,:) = undef
294 rk_dynvar%work0(:,:,:,i_rk_dens) = dens(:,:,:)
296 rk_dynvar%work0(:,:,:,i_rk_momz) = momz(:,:,:)
298 rk_dynvar%work0(:,:,:,i_rk_momx) = momx(:,:,:)
300 rk_dynvar%work0(:,:,:,i_rk_momy) = momy(:,:,:)
302 rk_dynvar%work0(:,:,:,i_rk_rhot) = rhot(:,:,:)
304 rk_dynvar%buf(:,:,:,:) = rk_dynvar%work0(:,:,:,:)
310 rk_prgvar%work0(:,:,:,:) = prog
312 rk_prgvar%buf(:,:,:,:) = rk_prgvar%work0(:,:,:,:)
320 rk_mflx_hi%buf(
k,
is-1,j,2) = mflx_hi(
k,
is-1,j,2)
327 rk_mflx_hi%buf(
k,
ie,j,2) = mflx_hi(
k,
ie,j,2)
334 rk_mflx_hi%buf(
k,i,
js-1,3) = mflx_hi(
k,i,
js-1,3)
341 rk_mflx_hi%buf(
k,i,
je,3) = mflx_hi(
k,i,
je,3)
346 io_prgvar(:) = 0; jo_prgvar(:) = 0; ko_prgvar(:) = 0
354 do stage = 1, rk_nstage
359 rk_dynvar%buf(:,:,:,i_rk_momz), &
360 rk_dynvar%buf(:,:,:,i_rk_momx), &
361 rk_dynvar%buf(:,:,:,i_rk_momy), &
362 rk_dynvar%buf(:,:,:,i_rk_rhot), &
363 rk_prgvar%buf(:,:,:,: ), &
364 rk_dynvar%work0(:,:,:,i_rk_dens), &
365 rk_dynvar%work0(:,:,:,i_rk_momz), &
366 rk_dynvar%work0(:,:,:,i_rk_momx), &
367 rk_dynvar%work0(:,:,:,i_rk_momy), &
368 rk_dynvar%work0(:,:,:,i_rk_rhot), &
369 rk_prgvar%work0(:,:,:,:), &
370 bnd_w, bnd_e, bnd_s, bnd_n, twod )
373 call rkcommon_comm( rk_dynvar )
374 call rkcommon_comm( rk_prgvar )
375 call rkcommon_comm_wait( rk_dynvar )
376 call rkcommon_comm_wait( rk_prgvar )
382 call atmos_dyn_tstep( &
383 rk_dynvar%work(:,:,:,i_rk_dens,stage), &
384 rk_dynvar%work(:,:,:,i_rk_momz,stage), &
385 rk_dynvar%work(:,:,:,i_rk_momx,stage), &
386 rk_dynvar%work(:,:,:,i_rk_momy,stage), &
387 rk_dynvar%work(:,:,:,i_rk_rhot,stage), &
388 rk_prgvar%work(:,:,:,: ,stage), &
389 rk_mflx_hi%buf(:,:,:,:), rk_tflx_hi%buf(:,:,:,:), &
390 rk_dynvar%work0(:,:,:,i_rk_dens), &
391 rk_dynvar%work0(:,:,:,i_rk_momz), &
392 rk_dynvar%work0(:,:,:,i_rk_momx), &
393 rk_dynvar%work0(:,:,:,i_rk_momy), &
394 rk_dynvar%work0(:,:,:,i_rk_rhot), &
395 rk_dynvar%buf(:,:,:,i_rk_dens), &
396 rk_dynvar%buf(:,:,:,i_rk_momz), &
397 rk_dynvar%buf(:,:,:,i_rk_momx), &
398 rk_dynvar%buf(:,:,:,i_rk_momy), &
399 rk_dynvar%buf(:,:,:,i_rk_rhot), &
400 dens_t, momz_t, momx_t, momy_t, rhot_t, &
401 rk_prgvar%work0, rk_prgvar%buf(:,:,:,:), &
402 dpres0, cvtot, corioli, &
403 num_diff, wdamp_coef, divdmp_coef, ddiv, &
404 flag_fct_momentum, flag_fct_t, &
405 flag_fct_along_stream, &
406 cdz, fdz, fdx, fdy, &
407 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
408 phi, gsqrt, j13g, j23g, j33g, mapf, &
409 ref_pres, ref_dens, &
410 bnd_w, bnd_e, bnd_s, bnd_n, twod, &
413 if ( stage < rk_nstage)
then
414 call rkcommon_nextstage( rk_dynvar, stage, io_dynvar, jo_dynvar, ko_dynvar, dt )
415 call rkcommon_nextstage( rk_prgvar, stage, io_prgvar, jo_prgvar, ko_prgvar, dt )
417 call rkcommon_updatevar( rk_dynvar, io_dynvar, jo_dynvar, ko_dynvar, i_rk_dens, i_rk_dens, dt, dens )
418 call rkcommon_updatevar( rk_dynvar, io_dynvar, jo_dynvar, ko_dynvar, i_rk_momz, i_rk_momz, dt, momz )
419 call rkcommon_updatevar( rk_dynvar, io_dynvar, jo_dynvar, ko_dynvar, i_rk_momx, i_rk_momx, dt, momx )
420 call rkcommon_updatevar( rk_dynvar, io_dynvar, jo_dynvar, ko_dynvar, i_rk_momy, i_rk_momy, dt, momy )
421 call rkcommon_updatevar( rk_dynvar, io_dynvar, jo_dynvar, ko_dynvar, i_rk_rhot, i_rk_rhot, dt, rhot )
422 call rkcommon_updatevar( rk_prgvar, io_prgvar, jo_prgvar, ko_prgvar, 1,
va, dt, prog )
424 call rkcommon_updateflux( rk_mflx_hi, stage, 0, 0, 0, 3, mflx_hi )
425 call rkcommon_updateflux( rk_tflx_hi, stage, 0, 0, 0, 3, tflx_hi )
430 call rkcommon_rkwork_dealloc( rk_dynvar )
431 call rkcommon_rkwork_dealloc( rk_prgvar )