Go to the documentation of this file.
67 wdamp_tau, wdamp_height, &
74 real(
rp),
intent(out) :: wdamp_coef(
ka)
75 real(
rp),
intent(in) :: wdamp_tau
76 real(
rp),
intent(in) :: wdamp_height
77 real(
rp),
intent(in) :: fz(0:
ka)
86 if ( wdamp_height < 0.0_rp )
then
88 wdamp_coef(:) = 0.0_rp
90 elseif( fz(
ke)-wdamp_height < eps )
then
92 wdamp_coef(:) = 0.0_rp
95 alpha = 1.0_rp / wdamp_tau
99 sw = 0.5_rp + sign( 0.5_rp, fz(
k)-wdamp_height )
101 wdamp_coef(
k) = alpha * sw &
102 * 0.5_rp * ( 1.0_rp - cos( pi * (fz(
k)-wdamp_height) / (fz(
ke)-wdamp_height)) )
106 wdamp_coef( 1:
ks-1) = wdamp_coef(
ks)
109 wdamp_coef(
ke+1:
ka ) = wdamp_coef(
ke)
114 log_info(
"ATMOS_DYN_wdamp_setup",*)
'Setup Rayleigh damping coefficient'
115 log_info_cont(
'(1x,A)')
'|=== Rayleigh Damping Coef ===|'
116 log_info_cont(
'(1x,A)')
'| k zh[m] coef[/s] |'
118 log_info_cont(
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',
k, fz(
k), wdamp_coef(
k),
' |'
121 log_info_cont(
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',
k, fz(
k), wdamp_coef(
k),
' | KE = TOA'
123 log_info_cont(
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',
k, fz(
k), wdamp_coef(
k),
' |'
126 log_info_cont(
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',
k, fz(
k), wdamp_coef(
k),
' | KS-1 = surface'
128 log_info_cont(
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',
k, fz(
k), wdamp_coef(
k),
' |'
131 log_info_cont(
'(1x,A,I5,F10.2,12x,A)')
'| ',
k, fz(
k),
' |'
132 log_info_cont(
'(1x,A)')
'|=============================|'
143 fill_constval, lateral_halo, top_bottom_halo )
146 real(
rp),
intent(inout) :: var(
ka,
ia,
ja)
147 real(
rp),
intent(in) :: fill_constval
148 logical,
intent(in) :: lateral_halo
149 logical,
intent(in) :: top_bottom_halo
156 if (lateral_halo)
then
162 var(
k,i,j) = fill_constval
167 var(
k,i,j) = fill_constval
177 var(
k,i,j) = fill_constval
187 var(
k,i,j) = fill_constval
194 if (top_bottom_halo)
then
199 var( 1:
ks-1,i,j) = fill_constval
200 var(
ke+1:
ka ,i,j) = fill_constval
212 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
213 DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, &
214 BND_W, BND_E, BND_S, BND_N, TwoD )
216 real(
rp),
intent(inout) :: dens (
ka,
ia,
ja)
217 real(
rp),
intent(inout) :: momz (
ka,
ia,
ja)
218 real(
rp),
intent(inout) :: momx (
ka,
ia,
ja)
219 real(
rp),
intent(inout) :: momy (
ka,
ia,
ja)
220 real(
rp),
intent(inout) :: rhot (
ka,
ia,
ja)
222 real(
rp),
intent(in) :: dens0(
ka,
ia,
ja)
223 real(
rp),
intent(in) :: momz0(
ka,
ia,
ja)
224 real(
rp),
intent(in) :: momx0(
ka,
ia,
ja)
225 real(
rp),
intent(in) :: momy0(
ka,
ia,
ja)
226 real(
rp),
intent(in) :: rhot0(
ka,
ia,
ja)
228 logical,
intent(in) :: bnd_w
229 logical,
intent(in) :: bnd_e
230 logical,
intent(in) :: bnd_s
231 logical,
intent(in) :: bnd_n
232 logical,
intent(in) :: twod
234 integer ::
k, i, j, iv
239 if ( bnd_w .and. (.not. twod) )
then
248 dens(
k,i,j) = dens0(
k,i,j)
249 momz(
k,i,j) = momz0(
k,i,j)
250 momx(
k,i,j) = momx0(
k,i,j)
251 momy(
k,i,j) = momy0(
k,i,j)
252 rhot(
k,i,j) = rhot0(
k,i,j)
255 prog(
k,i,j,iv) = prog0(
k,i,j,iv)
262 if ( bnd_e .and. (.not. twod) )
then
271 dens(
k,i,j) = dens0(
k,i,j)
272 momz(
k,i,j) = momz0(
k,i,j)
273 momx(
k,i,j) = momx0(
k,i,j)
274 momy(
k,i,j) = momy0(
k,i,j)
275 rhot(
k,i,j) = rhot0(
k,i,j)
278 prog(
k,i,j,iv) = prog0(
k,i,j,iv)
289 momx(
k,
ie,j) = momx0(
k,
ie,j)
303 dens(
k,i,j) = dens0(
k,i,j)
304 momz(
k,i,j) = momz0(
k,i,j)
305 momx(
k,i,j) = momx0(
k,i,j)
306 momy(
k,i,j) = momy0(
k,i,j)
307 rhot(
k,i,j) = rhot0(
k,i,j)
310 prog(
k,i,j,iv) = prog0(
k,i,j,iv)
326 dens(
k,i,j) = dens0(
k,i,j)
327 momz(
k,i,j) = momz0(
k,i,j)
328 momx(
k,i,j) = momx0(
k,i,j)
329 momy(
k,i,j) = momy0(
k,i,j)
330 rhot(
k,i,j) = rhot0(
k,i,j)
333 prog(
k,i,j,iv) = prog0(
k,i,j,iv)
344 momy(
k,i,
je) = momy0(
k,i,
je)
358 BND_W, BND_E, BND_S, BND_N, TwoD )
360 real(
rp),
intent(inout) :: qtrc (
ka,
ia,
ja)
361 real(
rp),
intent(in) :: qtrc0(
ka,
ia,
ja)
362 logical,
intent(in) :: bnd_w
363 logical,
intent(in) :: bnd_e
364 logical,
intent(in) :: bnd_s
365 logical,
intent(in) :: bnd_n
366 logical,
intent(in) :: twod
372 if ( bnd_w .and. (.not. twod) )
then
380 qtrc(
k,i,j) = qtrc0(
k,i,j)
386 if ( bnd_e .and. (.not. twod) )
then
394 qtrc(
k,i,j) = qtrc0(
k,i,j)
408 qtrc(
k,i,j) = qtrc0(
k,i,j)
422 qtrc(
k,i,j) = qtrc0(
k,i,j)
439 GSQRT, J13G, J23G, J33G, MAPF, &
441 RCDZ, RCDX, RCDY, RFDZ, FDZ )
443 real(
rp),
intent(out) :: ddiv(
ka,
ia,
ja)
444 real(
rp),
intent(in) :: momz(
ka,
ia,
ja)
445 real(
rp),
intent(in) :: momx(
ka,
ia,
ja)
446 real(
rp),
intent(in) :: momy(
ka,
ia,
ja)
447 real(
rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
448 real(
rp),
intent(in) :: j13g(
ka,
ia,
ja,7)
449 real(
rp),
intent(in) :: j23g(
ka,
ia,
ja,7)
450 real(
rp),
intent(in) :: j33g
451 real(
rp),
intent(in) :: mapf(
ia,
ja,2,7)
452 logical,
intent(in) :: twod
453 real(
rp),
intent(in) :: rcdz(
ka)
454 real(
rp),
intent(in) :: rcdx(
ia)
455 real(
rp),
intent(in) :: rcdy(
ja)
456 real(
rp),
intent(in) :: rfdz(
ka-1)
457 real(
rp),
intent(in) :: fdz(
ka-1)
472 ddiv(
k,
is,j) = j33g * ( momz(
k,
is,j) - momz(
k-1,
is,j) ) * rcdz(
k) &
473 + ( ( momy(
k+1,
is,j) + momy(
k+1,
is,j-1) ) * j23g(
k+1,
is,j,
i_xyw) &
474 - ( momy(
k-1,
is,j) + momy(
k-1,
is,j-1) ) * j23g(
k-1,
is,j,
i_xyw) ) / ( fdz(
k)+fdz(
k-1) ) &
482 k = iundef; i = iundef; j = iundef
487 ddiv(
ks,
is,j) = j33g * ( momz(
ks,
is,j) ) * rcdz(
ks) &
493 ddiv(
ke,
is,j) = j33g * ( - momz(
ke-1,
is,j ) ) * rcdz(
ke) &
502 k = iundef; i = iundef; j = iundef
510 ddiv(
k,i,j) = j33g * ( momz(
k,i,j) - momz(
k-1,i ,j ) ) * rcdz(
k) &
511 + ( ( momx(
k+1,i,j) + momx(
k+1,i-1,j ) ) * j13g(
k+1,i,j,
i_xyw) &
512 - ( momx(
k-1,i,j) + momx(
k-1,i-1,j ) ) * j13g(
k-1,i,j,
i_xyw) &
513 + ( momy(
k+1,i,j) + momy(
k+1,i ,j-1) ) * j23g(
k+1,i,j,
i_xyw) &
514 - ( momy(
k-1,i,j) + momy(
k-1,i ,j-1) ) * j23g(
k-1,i,j,
i_xyw) ) / ( fdz(
k)+fdz(
k-1) ) &
515 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
516 * ( ( momx(
k,i ,j ) * gsqrt(
k,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
517 - momx(
k,i-1,j ) * gsqrt(
k,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
518 + ( momy(
k,i ,j ) * gsqrt(
k,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
519 - momy(
k,i, j-1) * gsqrt(
k,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
525 k = iundef; i = iundef; j = iundef
531 ddiv(
ks,i,j) = j33g * ( momz(
ks,i,j) ) * rcdz(
ks) &
532 + ( ( momx(
ks+1,i,j) + momx(
ks+1,i-1,j ) ) * j13g(
ks+1,i,j,
i_xyw) &
533 - ( momx(
ks-1,i,j) + momx(
ks ,i-1,j ) ) * j13g(
ks ,i,j,
i_xyw) &
534 + ( momy(
ks+1,i,j) + momy(
ks+1,i ,j-1) ) * j23g(
ks+1,i,j,
i_xyw) &
535 - ( momy(
ks ,i,j) + momy(
ks ,i ,j-1) ) * j23g(
ks ,i,j,
i_xyw) ) * rfdz(
ks) &
536 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
537 * ( ( momx(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
538 - momx(
ks,i-1,j ) * gsqrt(
ks,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
539 + ( momy(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
540 - momy(
ks,i, j-1) * gsqrt(
ks,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
541 ddiv(
ke,i,j) = j33g * ( - momz(
ke-1,i ,j ) ) * rcdz(
ke) &
542 + ( ( momx(
ke ,i,j) + momx(
ke ,i-1,j ) ) * j13g(
ke ,i,j,
i_xyw) &
543 - ( momx(
ke-1,i,j) + momx(
ke-1,i-1,j ) ) * j13g(
ke-1,i,j,
i_xyw) &
544 + ( momy(
ke ,i,j) + momy(
ke ,i ,j-1) ) * j23g(
ke ,i,j,
i_xyw) &
545 - ( momy(
ke-1,i,j) + momy(
ke-1,i ,j-1) ) * j23g(
ke-1,i,j,
i_xyw) ) * rfdz(
ke) &
546 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
547 * ( ( momx(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
548 - momx(
ke,i-1,j ) * gsqrt(
ke,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
549 + ( momy(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
550 - momy(
ke,i, j-1) * gsqrt(
ke,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
555 k = iundef; i = iundef; j = iundef
581 DPRES, RT2P, REF_rhot, & ! (out)
582 rhot, qtrc, ref_pres, aq_r, aq_cv, aq_cp, aq_mass )
590 real(
rp),
intent(out) :: dpres(
ka,
ia,
ja)
591 real(
rp),
intent(out) :: rt2p(
ka,
ia,
ja)
592 real(
rp),
intent(out) :: ref_rhot(
ka,
ia,
ja)
593 real(
rp),
intent(in) :: rhot(
ka,
ia,
ja)
595 real(
rp),
intent(in) :: ref_pres(
ka,
ia,
ja)
596 real(
rp),
intent(in) :: aq_r(
qa)
597 real(
rp),
intent(in) :: aq_cv(
qa)
598 real(
rp),
intent(in) :: aq_cp(
qa)
599 real(
rp),
intent(in) :: aq_mass(
qa)
603 real(
rp) :: qdry (
ka)
604 real(
rp) :: rtot (
ka)
605 real(
rp) :: cvtot(
ka)
606 real(
rp) :: cptot(
ka)
616 cpovcv = cpdry / cvdry
641 rtot(
k) = rtot(
k) + aq_r(iq) * qtrc(
k,i,j,iq)
642 cvtot(
k) = cvtot(
k) + aq_cv(iq) * qtrc(
k,i,j,iq)
643 cptot(
k) = cptot(
k) + aq_cp(iq) * qtrc(
k,i,j,iq)
644 qdry(
k) = qdry(
k) - qtrc(
k,i,j,iq) * aq_mass(iq)
648 rtot(
k) = rtot(
k) + rdry * qdry(
k)
649 cvtot(
k) = cvtot(
k) + cvdry * qdry(
k)
650 cptot(
k) = cptot(
k) + cpdry * qdry(
k)
653 pres = p0 * ( rtot(
k) * rhot(
k,i,j) / p0 )**( cptot(
k) / cvtot(
k) )
654 rt2p(
k,i,j) = cptot(
k) / cvtot(
k) * pres / rhot(
k,i,j)
655 dpres(
k,i,j) = pres - ref_pres(
k,i,j)
656 ref_rhot(
k,i,j) = rhot(
k,i,j)
658 dpres(
ks-1,i,j) = dpres(
ks+1,i,j) + ( ref_pres(
ks+1,i,j) - ref_pres(
ks-1,i,j) )
659 dpres(
ke+1,i,j) = dpres(
ke-1,i,j) + ( ref_pres(
ke-1,i,j) - ref_pres(
ke+1,i,j) )
integer, public ke
end point of inner domain: z, local
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
real(rp), public const_eps
small number
subroutine, public prof_rapstart(rapname_base, level, disable_barrier)
Start raptime.
integer, parameter, public rp
integer, public ie
end point of inner domain: x, local
module atmosphere / grid / cartesC index
subroutine, public check(current_line, v)
Undefined value checker.
subroutine, public atmos_dyn_wdamp_setup(wdamp_coef, wdamp_tau, wdamp_height, FZ)
Setup.
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
subroutine, public atmos_dyn_fill_halo(var, fill_constval, lateral_halo, top_bottom_halo)
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
subroutine, public atmos_dyn_copy_boundary_tracer(QTRC, QTRC0, BND_W, BND_E, BND_S, BND_N, TwoD)
integer, public is
start point of inner domain: x, local
real(rp), parameter, public const_pi
pi
integer, public ks
start point of inner domain: z, local
subroutine, public atmos_dyn_divergence(DDIV, MOMZ, MOMX, MOMY, GSQRT, J13G, J23G, J33G, MAPF, TwoD, RCDZ, RCDX, RCDY, RFDZ, FDZ)
integer, public js
start point of inner domain: y, local
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
subroutine, public prof_rapend(rapname_base, level, disable_barrier)
Save raptime.
subroutine, public atmos_dyn_prep_pres_linearization(DPRES, RT2P, REF_rhot, RHOT, QTRC, REF_pres, AQ_R, AQ_CV, AQ_CP, AQ_MASS)
real(rp), public const_undef
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)
real(rp), public const_pre00
pressure reference [Pa]
integer, public je
end point of inner domain: y, local