66 hydrometeor_entr => atmos_hydrometeor_entr, &
70 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
75 integer,
intent(in) :: kstr
76 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
77 real(RP),
intent(in) :: temp(
ka,
ia,
ja)
78 real(RP),
intent(in) :: pres(
ka,
ia,
ja)
79 real(RP),
intent(in) :: qtrc(
ka,
ia,
ja,
qa)
80 real(RP),
intent(in) :: cz (
ka,
ia,
ja)
81 real(RP),
intent(in) :: fz (0:
ka,
ia,
ja)
82 real(RP),
intent(out) :: cape(
ia,
ja)
83 real(RP),
intent(out) :: cin (
ia,
ja)
84 real(RP),
intent(out) :: lcl (
ia,
ja)
85 real(RP),
intent(out) :: lfc (
ia,
ja)
86 real(RP),
intent(out) :: lnb (
ia,
ja)
88 real(RP) :: dens_p (
ka,
ia,
ja)
89 real(RP) :: temp_p (
ka,
ia,
ja)
91 real(RP) :: entr_p (
ka,
ia,
ja)
92 real(RP) :: buoy_p (
ka,
ia,
ja)
93 real(RP) :: buoy_pf(
ka,
ia,
ja)
94 real(RP) :: qsat_p (
ka,
ia,
ja)
96 integer :: klcl(
ia,
ja)
97 integer :: klfc(
ia,
ja)
98 integer :: klnb(
ia,
ja)
104 write(*,*)
'xxx Qv & Qc do not exist. CAPE calculation is invalid. STOP' 109 call hydrometeor_entr( entr_p(kstr,:,:), &
126 call hydrometeor_entr( entr_p(:,:,:), &
136 buoy_p(k,i,j) = grav * ( dens(k,i,j) - dens_p(k,i,j) ) / dens_p(k,i,j)
138 buoy_p( 1:
ks-1,i,j) = 0.0_rp
139 buoy_p(
ke+1:
ka ,i,j) = 0.0_rp
142 buoy_pf(k,i,j) = 0.5_rp * ( buoy_p(k+1,i,j) + buoy_p(k,i,j) )
144 buoy_p(
ke,i,j) = buoy_p(
ke-1,i,j)
146 buoy_p( 1:
ks-1,i,j) = 0.0_rp
147 buoy_p(
ke+1:
ka ,i,j) = 0.0_rp
152 call saturation_dens2qsat_liq( qsat_p(:,:,:), &
156 call hist_in( dens_p(:,:,:),
'DENS_parcel',
'density profile in lifting parcel',
'kg/m3' )
157 call hist_in( temp_p(:,:,:),
'TEMP_parcel',
'temperature profile in lifting parcel',
'K' )
158 call hist_in( entr_p(:,:,:),
'ENTR_parcel',
'entropy profile in lifting parcel',
'J/K' )
159 call hist_in( buoy_p(:,:,:),
'BUOY_parcel',
'buoyancy profile in lifting parcel',
'm/s2' )
160 call hist_in( qsat_p(:,:,:),
'QSAT_parcel',
'saturation profile in lifting parcel',
'kg/kg' )
167 if ( qtrc_p(kstr,i,j,
i_qv) >= qsat_p(k,i,j) )
then 179 if ( buoy_p(k,i,j) >= 0.0_rp )
then 191 if ( buoy_p(k,i,j) >= 0.0_rp )
then 202 if ( klcl(i,j) >= kstr )
then 203 lcl(i,j) = cz(klcl(i,j),i,j)
211 if ( klfc(i,j) >= kstr )
then 212 lfc(i,j) = cz(klfc(i,j),i,j)
220 if ( klnb(i,j) >= kstr )
then 221 lnb(i,j) = cz(klnb(i,j),i,j)
229 if ( klfc(i,j) >= kstr .AND. klnb(i,j) > kstr )
then 230 do k = klfc(i,j), klnb(i,j)
231 cape(i,j) = cape(i,j) + buoy_pf(k-1,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
240 if ( klfc(i,j) >= kstr )
then 241 do k = kstr+1, klfc(i,j)
242 cin(i,j) = cin(i,j) + buoy_pf(k-1,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
275 hydrometeor_entr => atmos_hydrometeor_entr, &
279 saturation_pres2qsat_liq => atmos_saturation_pres2qsat_liq
282 integer,
intent(in) :: kstr
283 real(RP),
intent(in) :: temp (
ka,
ia,
ja)
284 real(RP),
intent(in) :: pres (
ka,
ia,
ja)
285 real(RP),
intent(in) :: qtrc (
ka,
ia,
ja,
qa)
286 real(RP),
intent(in) :: entr_p(
ia,
ja)
287 real(RP),
intent(out) :: dens_p(
ka,
ia,
ja)
288 real(RP),
intent(out) :: temp_p(
ka,
ia,
ja)
289 real(RP),
intent(out) :: qtrc_p(
ka,
ia,
ja,
qa)
291 real(RP) :: qsat_p(
ka,
ia,
ja)
292 real(RP) :: qtot_p(
ia,
ja)
294 real(RP) :: qdry_p, rtot, cptot
295 real(RP) :: pres_dry, pres_vap
296 real(RP) :: temp_unsat
297 real(RP) :: qsat_unsat
301 real(RP) :: qtrc_ite(
qa)
303 real(RP) :: temp_prev
306 real(RP),
parameter :: criteria = 1.e-8_rp
307 integer,
parameter :: itelim = 100
310 real(RP),
parameter :: temmin = 0.1_rp
312 integer :: k, i, j, iqw
318 temp_p(k,i,j) = temp(k,i,j)
320 qtrc_p(k,i,j,iqw) = qtrc(k,i,j,iqw)
329 qtot_p(i,j) = qtrc(kstr,i,j,
i_qv) + qtrc(kstr,i,j,
i_qc)
336 temp_p(k,i,j) = temp(k,i,j)
339 qdry_p = 1.0_rp - qtot_p(i,j)
340 rtot = rdry * qdry_p + rvap * qtot_p(i,j)
341 cptot = cpdry * qdry_p + cpvap * qtot_p(i,j)
344 pres_dry = max( pres(k,i,j) * qdry_p * rdry / rtot, eps )
345 pres_vap = max( pres(k,i,j) * qtot_p(i,j) * rvap / rtot, eps )
347 temp_unsat = tem00 * exp( ( entr_p(i,j) + qdry_p * rdry * log( pres_dry / pre00 ) &
348 + qtot_p(i,j) * rvap * log( pres_vap / psat0 ) &
349 - qtot_p(i,j) * lhv0 / tem00 ) / cptot )
351 call saturation_pres2qsat_liq( qsat_unsat, &
356 if ( qtot_p(i,j) > qsat_unsat )
then 358 temp_ite = tem00 * exp( ( entr_p(i,j) + rdry * log( pres(k,i,j) / pre00 ) ) / cpdry )
362 call saturation_pres2qsat_liq( qsat_ite, &
367 qtrc_ite(
i_qv) = min( qtot_p(i,j), qsat_ite )
369 call hydrometeor_entr( entr_ite, &
375 qdry_p = 1.0_rp - qtrc_ite(
i_qv)
376 cptot = cpdry * qdry_p + cpvap * qtrc_ite(
i_qv)
378 dentr_dt = cptot / temp_ite &
379 - qtrc_ite(
i_qv) * lhv0 / temp_ite**2 &
380 + qtrc_ite(
i_qv) * lhv0**2 / temp_ite**3 / rvap
381 dentr_dt = max( dentr_dt, eps )
384 temp_ite = temp_ite - ( entr_ite - entr_p(i,j) ) / dentr_dt
385 temp_ite = max( temp_ite, temmin )
387 if( abs(temp_ite-temp_prev) < criteria )
exit 391 temp_p(k,i,j) = temp_ite
396 call saturation_pres2qsat_liq( qsat_p(k,i,j), &
401 qtot_p(i,j) = min( qtot_p(i,j), qsat_p(k,i,j) )
403 qtrc_p(k,i,j,
i_qv) = qtot_p(i,j)
404 qtrc_p(k,i,j,
i_qc) = 0.0_rp
406 qdry_p = 1.0_rp - qtot_p(i,j)
407 rtot = rdry * qdry_p + rvap * qtot_p(i,j)
409 dens_p(k,i,j) = pres(k,i,j) / ( rtot * temp_p(k,i,j) )
module ATMOSPHERE / Adiabatic process
integer, public is
start point of inner domain: x, local
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
integer, public je
end point of inner domain: y, local
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
real(rp), dimension(qa_max), public tracer_r
integer, public ke
end point of inner domain: z, local
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
subroutine, public atmos_adiabat_liftparcel(Kstr, TEMP, PRES, QTRC, ENTR_p, DENS_p, TEMP_p, QTRC_p)
Calc temperature profile with lifting parcel Method: Pseudo-adiabatic ascend from lowermost layer of ...
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
subroutine, public atmos_adiabat_cape(Kstr, DENS, TEMP, PRES, QTRC, CZ, FZ, CAPE, CIN, LCL, LFC, LNB)
Calc CAPE and CIN Type of parcel method: Pseudo-adiabatic ascend from lowermost layer of the model Re...
integer, public ia
of whole cells: x, local, with HALO
integer, public ka
of whole cells: z, local, with HALO
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
real(rp), public const_pre00
pressure reference [Pa]
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
integer, public ks
start point of inner domain: z, local
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
integer, public ja
of whole cells: y, local, with HALO