24 #if defined DEBUG || defined QUICKDEBUG 53 real(RP),
private,
allocatable :: dens_rk1(:,:,:)
54 real(RP),
private,
allocatable :: momz_rk1(:,:,:)
55 real(RP),
private,
allocatable :: momx_rk1(:,:,:)
56 real(RP),
private,
allocatable :: momy_rk1(:,:,:)
57 real(RP),
private,
allocatable :: rhot_rk1(:,:,:)
58 real(RP),
private,
allocatable :: prog_rk1(:,:,:,:)
59 real(RP),
private,
allocatable :: dens_rk2(:,:,:)
60 real(RP),
private,
allocatable :: momz_rk2(:,:,:)
61 real(RP),
private,
allocatable :: momx_rk2(:,:,:)
62 real(RP),
private,
allocatable :: momy_rk2(:,:,:)
63 real(RP),
private,
allocatable :: rhot_rk2(:,:,:)
64 real(RP),
private,
allocatable :: prog_rk2(:,:,:,:)
67 integer :: i_comm_dens_rk1 = 1
68 integer :: i_comm_momz_rk1 = 2
69 integer :: i_comm_momx_rk1 = 3
70 integer :: i_comm_momy_rk1 = 4
71 integer :: i_comm_rhot_rk1 = 5
72 integer,
allocatable :: i_comm_prog_rk1(:)
74 integer :: i_comm_dens_rk2 = 1
75 integer :: i_comm_momz_rk2 = 2
76 integer :: i_comm_momx_rk2 = 3
77 integer :: i_comm_momy_rk2 = 4
78 integer :: i_comm_rhot_rk2 = 5
79 integer,
allocatable :: i_comm_prog_rk2(:)
81 logical :: flag_ws2002
99 character(len=*) :: tinteg_type
104 select case( tinteg_type )
106 log_info(
"ATMOS_DYN_Tinteg_short_rk3_setup",*)
"RK3: Heun's method is used" 114 flag_ws2002 = .false.
115 fact_dt1 = 1.0_rp / 3.0_rp
116 fact_dt2 = 2.0_rp / 3.0_rp
118 log_info(
"ATMOS_DYN_Tinteg_short_rk3_setup",*)
"RK3: Wichere and Skamarock (2002) is used" 125 fact_dt1 = 1.0_rp / 3.0_rp
126 fact_dt2 = 1.0_rp / 2.0_rp
128 log_error(
"ATMOS_DYN_Tinteg_short_rk3_setup",*)
'TINTEG_TYPE is not RK3. Check!' 132 allocate( dens_rk1(
ka,
ia,
ja) )
133 allocate( momz_rk1(
ka,
ia,
ja) )
134 allocate( momx_rk1(
ka,
ia,
ja) )
135 allocate( momy_rk1(
ka,
ia,
ja) )
136 allocate( rhot_rk1(
ka,
ia,
ja) )
138 allocate( dens_rk2(
ka,
ia,
ja) )
139 allocate( momz_rk2(
ka,
ia,
ja) )
140 allocate( momx_rk2(
ka,
ia,
ja) )
141 allocate( momy_rk2(
ka,
ia,
ja) )
142 allocate( rhot_rk2(
ka,
ia,
ja) )
144 allocate( prog_rk1(
ka,
ia,
ja,max(
va,1)) )
145 allocate( prog_rk2(
ka,
ia,
ja,max(
va,1)) )
146 allocate( i_comm_prog_rk1(max(
va,1)) )
147 allocate( i_comm_prog_rk2(max(
va,1)) )
155 i_comm_prog_rk1(iv) = 5 + iv
156 call comm_vars8_init(
'PROG_RK1', prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
165 i_comm_prog_rk2(iv) = 5 + iv
166 call comm_vars8_init(
'PROG_RK2', prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
169 dens_rk1(:,:,:) = undef
170 momz_rk1(:,:,:) = undef
171 momx_rk1(:,:,:) = undef
172 momy_rk1(:,:,:) = undef
173 rhot_rk1(:,:,:) = undef
174 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
176 dens_rk2(:,:,:) = undef
177 momz_rk2(:,:,:) = undef
178 momx_rk2(:,:,:) = undef
179 momy_rk2(:,:,:) = undef
180 rhot_rk2(:,:,:) = undef
181 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
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, &
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)
216 real(RP),
intent(inout) :: PROG(
ka,
ia,
ja,
va)
218 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
219 real(RP),
intent(inout) :: 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
265 real(RP),
intent(in) :: dt
267 real(RP) :: DENS0(
ka,
ia,
ja)
268 real(RP) :: MOMZ0(
ka,
ia,
ja)
269 real(RP) :: MOMX0(
ka,
ia,
ja)
270 real(RP) :: MOMY0(
ka,
ia,
ja)
271 real(RP) :: RHOT0(
ka,
ia,
ja)
274 real(RP) :: mflx_hi_RK(
ka,
ia,
ja,3,2)
275 real(RP) :: tflx_hi_RK(
ka,
ia,
ja,3,2)
279 integer :: i, j, k, iv, n
285 dens_rk1(:,:,:) = undef
286 momz_rk1(:,:,:) = undef
287 momx_rk1(:,:,:) = undef
288 momy_rk1(:,:,:) = undef
289 rhot_rk1(:,:,:) = undef
290 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
292 dens_rk2(:,:,:) = undef
293 momz_rk2(:,:,:) = undef
294 momx_rk2(:,:,:) = undef
295 momy_rk2(:,:,:) = undef
296 rhot_rk2(:,:,:) = undef
297 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
299 mflx_hi_rk(:,:,:,:,:) = undef
300 tflx_hi_rk(:,:,:,:,:) = undef
304 mflx_hi( 1:
ks-1,:,:,:) = undef
305 mflx_hi(
ke+1:
ka ,:,:,:) = undef
319 if (
va > 0 ) prog0 = prog
324 mflx_hi_rk(k,
is-1,j,2,:) = mflx_hi(k,
is-1,j,2)
331 mflx_hi_rk(k,
ie,j,2,:) = mflx_hi(k,
ie,j,2)
338 mflx_hi_rk(k,i,
js-1,3,:) = mflx_hi(k,i,
js-1,3)
345 mflx_hi_rk(k,i,
je,3,:) = mflx_hi(k,i,
je,3)
362 call atmos_dyn_tstep( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
364 mflx_hi_rk(:,:,:,:,1), tflx_hi_rk(:,:,:,:,1), &
365 dens0, momz0, momx0, momy0, rhot0, &
366 dens, momz, momx, momy, rhot, &
367 dens_t, momz_t, momx_t, momy_t, rhot_t, &
369 dpres0, cvtot, corioli, &
370 num_diff, wdamp_coef, divdmp_coef, ddiv, &
371 flag_fct_momentum, flag_fct_t, &
372 flag_fct_along_stream, &
373 cdz, fdz, fdx, fdy, &
374 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
375 phi, gsqrt, j13g, j23g, j33g, mapf, &
376 ref_pres, ref_dens, &
377 bnd_w, bnd_e, bnd_s, bnd_n, &
385 dens0, momz0, momx0, momy0, rhot0, &
387 bnd_w, bnd_e, bnd_s, bnd_n )
391 call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
392 call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
393 call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
394 call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
395 call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
397 call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
400 call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
401 call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
402 call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
403 call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
404 call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
406 call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
415 call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
417 mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), &
418 dens0, momz0, momx0, momy0, rhot0, &
419 dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
420 dens_t, momz_t, momx_t, momy_t, rhot_t, &
422 dpres0, cvtot, corioli, &
423 num_diff, wdamp_coef, divdmp_coef, ddiv, &
424 flag_fct_momentum, flag_fct_t, &
425 flag_fct_along_stream, &
426 cdz, fdz, fdx, fdy, &
427 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
428 phi, gsqrt, j13g, j23g, j33g, mapf, &
429 ref_pres, ref_dens, &
430 bnd_w, bnd_e, bnd_s, bnd_n, &
438 dens0, momz0, momx0, momy0, rhot0, &
440 bnd_w, bnd_e, bnd_s, bnd_n )
444 call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
445 call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
446 call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
447 call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
448 call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
450 call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
453 call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
454 call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
455 call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
456 call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
457 call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
459 call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
468 call atmos_dyn_tstep( dens, momz, momx, momy, rhot, &
471 dens0, momz0, momx0, momy0, rhot0, &
472 dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
473 dens_t, momz_t, momx_t, momy_t, rhot_t, &
475 dpres0, cvtot, corioli, &
476 num_diff, wdamp_coef, divdmp_coef, ddiv, &
477 flag_fct_momentum, flag_fct_t, &
478 flag_fct_along_stream, &
479 cdz, fdz, fdx, fdy, &
480 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
481 phi, gsqrt, j13g, j23g, j33g, mapf, &
482 ref_pres, ref_dens, &
483 bnd_w, bnd_e, bnd_s, bnd_n, &
486 if ( .NOT. flag_ws2002 )
then 490 dens(k,i,j) = ( dens_rk1(k,i,j) * 3.0_rp &
491 + dens(k,i,j) * 3.0_rp &
492 - dens0(k,i,j) * 2.0_rp ) / 4.0_rp
500 momz(k,i,j) = ( momz_rk1(k,i,j) * 3.0_rp &
501 + momz(k,i,j) * 3.0_rp &
502 - momz0(k,i,j) * 2.0_rp ) / 4.0_rp
510 momx(k,i,j) = ( momx_rk1(k,i,j) * 3.0_rp &
511 + momx(k,i,j) * 3.0_rp &
512 - momx0(k,i,j) * 2.0_rp ) / 4.0_rp
520 momy(k,i,j) = ( momy_rk1(k,i,j) * 3.0_rp &
521 + momy(k,i,j) * 3.0_rp &
522 - momy0(k,i,j) * 2.0_rp ) / 4.0_rp
530 rhot(k,i,j) = ( rhot_rk1(k,i,j) * 3.0_rp &
531 + rhot(k,i,j) * 3.0_rp &
532 - rhot0(k,i,j) * 2.0_rp ) / 4.0_rp
541 prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 3.0_rp &
542 + prog(k,i,j,iv) * 3.0_rp &
543 - prog0(k,i,j,iv) * 2.0_rp ) / 4.0_rp
553 mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
554 + mflx_hi(k,i,j,n ) * 3.0_rp ) / 4.0_rp
564 tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
565 + tflx_hi(k,i,j,n ) * 3.0_rp ) / 4.0_rp
module Atmosphere / Dynamical scheme
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
subroutine, public check(current_line, v)
Undefined value checker.
real(rp), public const_undef
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
procedure(short), pointer, public atmos_dyn_tstep_short
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
subroutine, public comm_vars8_init(varname, var, vid)
Register variables.
subroutine, public prc_abort
Abort Process.
integer, public js
start point of inner domain: y, local
module Atmosphere / Dyn Tinteg
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, dt)
RK3.
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
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)
subroutine, public atmos_dyn_tinteg_short_rk3_setup(tinteg_type)
Setup.
integer, public ka
of whole cells: z, local, with HALO
subroutine, public prof_rapend(rapname_base, level)
Save raptime.