15 #include "inc_openmp.h" 47 private :: moist_conversion_liq
48 private :: moist_conversion_all
66 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
67 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
68 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,
qa)
72 integer :: k, i, j, iq
85 diffq = diffq + qtrc(k,i,j,iq)
87 qtrc(k,i,j,iq) = max( qtrc(k,i,j,iq), 0.0_rp )
92 diffq = diffq - qtrc(k,i,j,iq)
96 qtrc(k,i,j,
i_qv) = qtrc(k,i,j,
i_qv) + diffq
101 diffq = qtrc(k,i,j,
i_qv)
102 qtrc(k,i,j,
i_qv) = max( qtrc(k,i,j,
i_qv), 0.0_rp )
103 diffq = diffq - qtrc(k,i,j,
i_qv)
107 dens(k,i,j) = dens(k,i,j) * ( 1.0_rp - diffq )
108 rhot(k,i,j) = rhot(k,i,j) * ( 1.0_rp - diffq )
135 thermodyn_qd => atmos_thermodyn_qd, &
136 thermodyn_cv => atmos_thermodyn_cv, &
137 thermodyn_temp_pres_e => atmos_thermodyn_temp_pres_e
139 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
140 saturation_dens2qsat_all => atmos_saturation_dens2qsat_all
143 real(RP),
intent(inout) :: RHOE_t(
ka,
ia,
ja)
144 real(RP),
intent(inout) :: QTRC_t(
ka,
ia,
ja,
qa)
145 real(RP),
intent(inout) :: RHOE0 (
ka,
ia,
ja)
146 real(RP),
intent(inout) :: QTRC0 (
ka,
ia,
ja,
qa)
147 real(RP),
intent(in) :: DENS0 (
ka,
ia,
ja)
148 logical,
intent(in) :: flag_liquid
151 real(RP) :: TEMP0 (
ka,
ia,
ja)
152 real(RP) :: PRES0 (
ka,
ia,
ja)
153 real(RP) :: QDRY0 (
ka,
ia,
ja)
154 real(RP) :: CVtot (
ka,
ia,
ja)
156 real(RP) :: Emoist(
ka,
ia,
ja)
157 real(RP) :: QSUM1 (
ka,
ia,
ja)
158 real(RP) :: TEMP1 (
ka,
ia,
ja)
160 real(RP) :: RHOE1 (
ka,
ia,
ja)
164 integer :: k, i, j, iq
178 qtrc1(k,i,j,iq) = qtrc0(k,i,j,iq)
184 call thermodyn_temp_pres_e( temp0(:,:,:), &
191 call thermodyn_qd( qdry0(:,:,:), &
194 call thermodyn_cv( cvtot(:,:,:), &
198 if (
i_qi <= 0 .OR. flag_liquid )
then 205 emoist(k,i,j) = temp0(k,i,j) * cvtot(k,i,j) &
206 + qtrc1(k,i,j,
i_qv) * lhv
208 qsum1(k,i,j) = qtrc1(k,i,j,
i_qv) &
211 qtrc1(k,i,j,
i_qv) = qsum1(k,i,j)
212 qtrc1(k,i,j,
i_qc) = 0.0_rp
217 call thermodyn_cv( cvtot(:,:,:), &
226 temp1(k,i,j) = ( emoist(k,i,j) - qtrc1(k,i,j,
i_qv) * lhv ) / cvtot(k,i,j)
231 call moist_conversion_liq( temp1(:,:,:), &
245 emoist(k,i,j) = temp0(k,i,j) * cvtot(k,i,j) &
246 + qtrc1(k,i,j,
i_qv) * lhv &
247 - qtrc1(k,i,j,
i_qi) * lhf
249 qsum1(k,i,j) = qtrc1(k,i,j,
i_qv) &
250 + qtrc1(k,i,j,
i_qc) &
253 qtrc1(k,i,j,
i_qv) = qsum1(k,i,j)
254 qtrc1(k,i,j,
i_qc) = 0.0_rp
255 qtrc1(k,i,j,
i_qi) = 0.0_rp
260 call thermodyn_cv( cvtot(:,:,:), &
269 temp1(k,i,j) = ( emoist(k,i,j) - qtrc1(k,i,j,
i_qv) * lhv ) / cvtot(k,i,j)
274 call moist_conversion_all( temp1(:,:,:), &
283 call thermodyn_cv( cvtot(:,:,:), &
293 qtrc_t(k,i,j,iq) = qtrc_t(k,i,j,iq) + ( qtrc1(k,i,j,iq) - qtrc0(k,i,j,iq) ) * rdt
295 qtrc0(k,i,j,iq) = qtrc1(k,i,j,iq)
305 rhoe1(k,i,j) = dens0(k,i,j) * temp1(k,i,j) * cvtot(k,i,j)
307 rhoe_t(k,i,j) = rhoe_t(k,i,j) + ( rhoe1(k,i,j) - rhoe0(k,i,j) ) * rdt
309 rhoe0(k,i,j) = rhoe1(k,i,j)
328 subroutine moist_conversion_liq( &
340 thermodyn_cv => atmos_thermodyn_cv, &
343 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
348 real(RP),
intent(inout) :: TEMP1 (
ka,
ia,
ja)
349 real(RP),
intent(inout) :: QTRC1 (
ka,
ia,
ja,
qa)
350 real(RP),
intent(in) :: DENS0 (
ka,
ia,
ja)
351 real(RP),
intent(in) :: QSUM1 (
ka,
ia,
ja)
352 real(RP),
intent(in) :: QDRY0 (
ka,
ia,
ja)
353 real(RP),
intent(in) :: Emoist(
ka,
ia,
ja)
355 real(RP) :: QSAT(
ka,
ia,
ja)
361 real(RP) :: qsatl_new
362 real(RP) :: Emoist_new
365 real(RP) :: dqsatl_dT
367 real(RP) :: dCVtot_dT
368 real(RP) :: dEmoist_dT
372 integer :: index_sat(
ka*
ia*
ja,3)
374 integer,
parameter :: itelim = 100
375 real(RP) :: dtemp_criteria
377 integer :: k, i, j, ijk, iq, ite
382 dtemp_criteria = 0.1_rp**(2+
rp/2)
384 call saturation_dens2qsat_liq( qsat(:,:,:), &
393 if ( qsum1(k,i,j) > qsat(k,i,j) )
then 395 ijk_sat = ijk_sat + 1
396 index_sat(ijk_sat,1) = k
397 index_sat(ijk_sat,2) = i
398 index_sat(ijk_sat,3) = j
413 q(iq) = qtrc1(k,i,j,iq)
419 call saturation_dens2qsat_liq( qsatl_new, &
425 q(
i_qc) = qsum1(k,i,j) - qsatl_new
427 call thermodyn_cv( cvtot, &
431 emoist_new = temp * cvtot + qsatl_new * lhv
438 dcvtot_dt = dqsatl_dt * cvw(
i_qv) &
441 demoist_dt = qsatl_new * dcvtot_dt + cvtot + dqsatl_dt * lhv
443 dtemp = ( emoist_new - emoist(k,i,j) ) / demoist_dt
446 if ( abs(dtemp) < dtemp_criteria )
then 451 if( temp*0.0_rp /= 0.0_rp)
exit 454 if ( .NOT. converged )
then 455 write(*,*)
'xxx [moist_conversion] not converged! dtemp=', dtemp,k,i,j,ite
461 qtrc1(k,i,j,iq) = q(iq)
471 end subroutine moist_conversion_liq
476 subroutine moist_conversion_all( &
489 thermodyn_cv => atmos_thermodyn_cv, &
492 saturation_dens2qsat_all => atmos_saturation_dens2qsat_all, &
493 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq, &
494 saturation_dens2qsat_ice => atmos_saturation_dens2qsat_ice, &
495 saturation_alpha => atmos_saturation_alpha, &
496 saturation_dalphadt => atmos_saturation_dalphadt, &
503 real(RP),
intent(inout) :: TEMP1 (
ka,
ia,
ja)
504 real(RP),
intent(inout) :: QTRC1 (
ka,
ia,
ja,
qa)
505 real(RP),
intent(in) :: DENS0 (
ka,
ia,
ja)
506 real(RP),
intent(in) :: QSUM1 (
ka,
ia,
ja)
507 real(RP),
intent(in) :: QDRY0 (
ka,
ia,
ja)
508 real(RP),
intent(in) :: Emoist(
ka,
ia,
ja)
510 real(RP) :: QSAT(
ka,
ia,
ja)
517 real(RP) :: qsat_new, qsatl_new, qsati_new
518 real(RP) :: Emoist_new
521 real(RP) :: dalpha_dT
522 real(RP) :: dqsat_dT, dqsatl_dT, dqsati_dT
523 real(RP) :: dqc_dT, dqi_dT
524 real(RP) :: dCVtot_dT
525 real(RP) :: dEmoist_dT
529 integer :: index_sat(
ka*
ia*
ja,3)
531 integer,
parameter :: itelim = 100
532 real(RP) :: dtemp_criteria
534 integer :: k, i, j, ijk, iq, ite
538 dtemp_criteria = 0.1_rp**(2+
rp/2)
540 call saturation_dens2qsat_all( qsat(:,:,:), &
549 if ( qsum1(k,i,j) > qsat(k,i,j) )
then 551 ijk_sat = ijk_sat + 1
552 index_sat(ijk_sat,1) = k
553 index_sat(ijk_sat,2) = i
554 index_sat(ijk_sat,3) = j
569 q(iq) = qtrc1(k,i,j,iq)
576 call saturation_alpha( alpha, temp )
578 call saturation_dens2qsat_all( qsat_new, temp, dens0(k,i,j) )
579 call saturation_dens2qsat_liq( qsatl_new, temp, dens0(k,i,j) )
580 call saturation_dens2qsat_ice( qsati_new, temp, dens0(k,i,j) )
584 q(
i_qc) = ( qsum1(k,i,j)-qsat_new ) * ( alpha )
585 q(
i_qi) = ( qsum1(k,i,j)-qsat_new ) * ( 1.0_rp-alpha )
587 call thermodyn_cv( cvtot, &
591 emoist_new = temp * cvtot + qsat_new * lhv - q(
i_qi) * lhf
594 call saturation_dalphadt( dalpha_dt, temp )
599 dqsat_dt = qsatl_new * dalpha_dt + dqsatl_dt * ( alpha ) &
600 - qsati_new * dalpha_dt + dqsati_dt * ( 1.0_rp-alpha )
602 dqc_dt = ( qsum1(k,i,j)-qsat_new ) * dalpha_dt - dqsat_dt * ( alpha )
603 dqi_dt = -( qsum1(k,i,j)-qsat_new ) * dalpha_dt - dqsat_dt * ( 1.0_rp-alpha )
605 dcvtot_dt = dqsat_dt * cvw(
i_qv) &
606 + dqc_dt * cvw(
i_qc) &
609 demoist_dt = temp * dcvtot_dt + cvtot + dqsat_dt * lhv - dqi_dt * lhf
611 dtemp = ( emoist_new - emoist(k,i,j) ) / demoist_dt
614 if ( abs(dtemp) < dtemp_criteria )
then 619 if( temp*0.0_rp /= 0.0_rp)
exit 622 if ( .NOT. converged )
then 623 write(*,*) temp1(k,i,j), dens0(k,i,j),q,qtrc1(k,i,j,
qqs:
qqe)
624 write(*,*)
'xxx [moist_conversion] not converged! dtemp=', dtemp, k,i,j,ite
630 qtrc1(k,i,j,iq) = q(iq)
640 end subroutine moist_conversion_all
671 real(RP),
intent(out) :: flux_rain(
ka,
ia,
ja)
672 real(RP),
intent(out) :: flux_snow(
ka,
ia,
ja)
673 real(RP),
intent(inout) :: DENS (
ka,
ia,
ja)
674 real(RP),
intent(inout) :: MOMZ (
ka,
ia,
ja)
675 real(RP),
intent(inout) :: MOMX (
ka,
ia,
ja)
676 real(RP),
intent(inout) :: MOMY (
ka,
ia,
ja)
677 real(RP),
intent(inout) :: RHOE (
ka,
ia,
ja)
678 real(RP),
intent(inout) :: QTRC (
ka,
ia,
ja,
qa)
679 real(RP),
intent(inout) :: vterm (
ka,
ia,
ja,
qa)
680 real(RP),
intent(in) :: temp (
ka,
ia,
ja)
681 real(DP),
intent(in) :: dt
685 real(RP) :: eflx(
ka,
ia,
ja)
687 real(RP) :: rcdz (
ka,
ia,
ja)
688 real(RP) :: rcdz_u(
ka,
ia,
ja)
689 real(RP) :: rcdz_v(
ka,
ia,
ja)
690 real(RP) :: rfdz (
ka,
ia,
ja)
692 integer :: k, i, j, iq
699 call comm_vars8( vterm(:,:,:,iq), iq )
703 call comm_vars8( qtrc(:,:,:,iq),
qqe+iq )
707 flux_rain(:,:,:) = 0.0_rp
709 flux_snow(:,:,:) = 0.0_rp
720 rcdz_u(k,i,j) = 2.0_rp / ( (
real_fz(k,i+1,j) -
real_fz(k-1,i+1,j) ) &
722 rcdz_v(k,i,j) = 2.0_rp / ( (
real_fz(k,i,j+1) -
real_fz(k-1,i,j+1) ) &
732 call comm_wait( vterm(:,:,:,iq), iq )
734 call comm_wait( qtrc(:,:,:,iq),
qqe+iq )
740 qflx(k,i,j,iq) = vterm(k+1,i,j,iq) * dens(k+1,i,j) * qtrc(k+1,i,j,iq) * j33g
742 qflx(
ke,i,j,iq) = 0.0_rp
745 eflx(
ks-1,i,j) = qflx(
ks-1,i,j,iq) * temp(
ks,i,j) * cvw(iq)
747 eflx(k,i,j) = qflx(k,i,j,iq) * temp(k+1,i,j) * cvw(iq)
748 rhoe(k,i,j) = rhoe(k,i,j) - dt * ( eflx(k,i,j) - eflx(k-1,i,j) ) * rcdz(k,i,j)
750 eflx(
ke,i,j) = 0.0_rp
751 rhoe(
ke,i,j) = rhoe(
ke,i,j) - dt * ( - eflx(
ke-1,i,j) ) * rcdz(
ke,i,j)
754 eflx(
ks-1,i,j) = qflx(
ks-1,i,j,iq) * grav / rfdz(
ks-1,i,j)
756 eflx(k,i,j) = qflx(k,i,j,iq) * grav / rfdz(k,i,j)
757 rhoe(k,i,j) = rhoe(k,i,j) - dt * ( eflx(k,i,j) - eflx(k-1,i,j) ) * rcdz(k,i,j)
759 rhoe(
ke,i,j) = rhoe(
ke,i,j) - dt * ( - eflx(
ke-1,i,j) ) * rcdz(
ke,i,j)
763 eflx(k,i,j) = 0.25_rp * ( vterm(k+1,i,j,iq) + vterm(k,i,j,iq) ) &
764 * ( qtrc(k+1,i,j,iq) + qtrc(k,i,j,iq) ) &
768 momz(k,i,j) = momz(k,i,j) - dt * ( eflx(k+1,i,j) - eflx(k,i,j) ) * rfdz(k,i,j)
772 eflx(
ks-1,i,j) = 0.25_rp * ( vterm(
ks,i,j,iq) + vterm(
ks,i+1,j,iq) ) &
773 * ( qtrc(
ks,i,j,iq) + qtrc(
ks,i+1,j,iq) ) &
776 eflx(k,i,j) = 0.25_rp * ( vterm(k+1,i,j,iq) + vterm(k+1,i+1,j,iq) ) &
777 * ( qtrc(k+1,i,j,iq) + qtrc(k+1,i+1,j,iq) ) &
779 momx(k,i,j) = momx(k,i,j) - dt * ( eflx(k,i,j) - eflx(k-1,i,j) ) * rcdz_u(k,i,j)
781 momx(
ke,i,j) = momx(
ke,i,j) - dt * ( - eflx(
ke-1,i,j) ) * rcdz_u(
ke,i,j)
784 eflx(
ks-1,i,j) = 0.25_rp * ( vterm(
ks,i,j,iq) + vterm(
ks,i,j+1,iq) ) &
785 * ( qtrc(
ks,i,j,iq) + qtrc(
ks,i,j+1,iq) ) &
788 eflx(k,i,j) = 0.25_rp * ( vterm(k+1,i,j,iq) + vterm(k+1,i,j+1,iq) ) &
789 * ( qtrc(k+1,i,j,iq) + qtrc(k+1,i,j+1,iq) ) &
791 momy(k,i,j) = momy(k,i,j) - dt * ( eflx(k,i,j) - eflx(k-1,i,j) ) * rcdz_v(k,i,j)
793 momy(
ke,i,j) = momy(
ke,i,j) - dt * ( - eflx(
ke-1,i,j) ) * rcdz_v(
ke,i,j)
803 rhoq(
ks-1,i,j,iq) = dens(
ks,i,j) * qtrc(
ks,i,j,iq)
805 rhoq(k,i,j,iq) = dens(k,i,j) * qtrc(k,i,j,iq)
817 qflx(k,i,j,iq) = vterm(k+1,i,j,iq) * rhoq(k+1,i,j,iq)
819 qflx(
ke,i,j,iq) = 0.0_rp
829 dens(k,i,j) = dens(k,i,j) - dt * ( qflx(k,i,j,iq) - qflx(k-1,i,j,iq) ) * rcdz(k,i,j)
840 qtrc(k,i,j,iq) = ( rhoq(k,i,j,iq) - dt * ( qflx(k,i,j,iq) - qflx(k-1,i,j,iq) ) * rcdz(k,i,j) ) / dens(k,i,j)
850 qtrc(k,i,j,
i_qv) = rhoq(k,i,j,
i_qv) / dens(k,i,j)
861 flux_rain(k,i,j) = flux_rain(k,i,j) - qflx(k,i,j,iq)
872 flux_snow(k,i,j) = flux_snow(k,i,j) - qflx(k,i,j,iq)
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
subroutine, public atmos_phy_mp_precipitation(flux_rain, flux_snow, DENS, MOMZ, MOMX, MOMY, RHOE, QTRC, vterm, temp, dt)
precipitation transport
real(rp), public cvovr_liq
real(dp), public time_dtsec_atmos_phy_mp
time interval of physics(microphysics) [sec]
real(rp), public cvovr_ice
integer, public ke
end point of inner domain: z, local
real(rp), public gtrans_j33g
(3,3) element of Jacobian matrix * {G}^1/2
real(rp), dimension(:,:,:), allocatable, public real_fz
geopotential height [m] (cell face )
real(rp), dimension(:,:,:), allocatable, public real_cz
geopotential height [m] (cell center)
character(len=h_short), public tracer_type
real(rp), public const_undef
module ATMOSPHERE / Physics Cloud Microphysics - Common
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
real(rp), public lovr_ice
real(rp), public const_lhv
latent heat of vaporizaion for use
real(rp), dimension(:), allocatable, public aq_cv
CV for each hydrometeors [J/kg/K].
integer, public ks
start point of inner domain: z, local
subroutine, public atmos_phy_mp_negative_fixer(DENS, RHOT, QTRC)
Negative fixer.
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
real(rp), public const_lhf
latent heat of fusion for use
integer, public ie
end point of inner domain: x, local
real(rp), public lovr_liq
module ATMOSPHERE / Thermodynamics
subroutine, public atmos_phy_mp_saturation_adjustment(RHOE_t, QTRC_t, RHOE0, QTRC0, DENS0, flag_liquid)
Saturation adjustment.
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
integer, parameter, public rp
integer, public ja
of y whole cells (local, with HALO)