64 thermodyn_entr => atmos_thermodyn_entr
66 saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
71 integer,
intent(in) :: Kstr
72 real(RP),
intent(in) :: DENS(
ka,
ia,
ja)
73 real(RP),
intent(in) :: TEMP(
ka,
ia,
ja)
74 real(RP),
intent(in) :: PRES(
ka,
ia,
ja)
75 real(RP),
intent(in) :: QTRC(
ka,
ia,
ja,
qa)
76 real(RP),
intent(in) :: CZ (
ka,
ia,
ja)
77 real(RP),
intent(in) :: FZ (0:
ka,
ia,
ja)
78 real(RP),
intent(out) :: CAPE(
ia,
ja)
79 real(RP),
intent(out) :: CIN (
ia,
ja)
80 real(RP),
intent(out) :: LCL (
ia,
ja)
81 real(RP),
intent(out) :: LFC (
ia,
ja)
82 real(RP),
intent(out) :: LNB (
ia,
ja)
84 real(RP) :: DENS_p (
ka,
ia,
ja)
85 real(RP) :: TEMP_p (
ka,
ia,
ja)
87 real(RP) :: ENTR_p (
ka,
ia,
ja)
88 real(RP) :: BUOY_p (
ka,
ia,
ja)
89 real(RP) :: BUOY_pf(
ka,
ia,
ja)
90 real(RP) :: QSAT_p (
ka,
ia,
ja)
92 integer :: kLCL(
ia,
ja)
93 integer :: kLFC(
ia,
ja)
94 integer :: kLNB(
ia,
ja)
100 call thermodyn_entr( entr_p(kstr,:,:), &
116 call thermodyn_entr( entr_p(:,:,:), &
125 buoy_p(k,i,j) = grav * ( dens(k,i,j) - dens_p(k,i,j) ) / dens_p(k,i,j)
127 buoy_p( 1:
ks-1,i,j) = 0.0_rp
128 buoy_p(
ke+1:
ka ,i,j) = 0.0_rp
131 buoy_pf(k,i,j) = 0.5_rp * ( buoy_p(k+1,i,j) + buoy_p(k,i,j) )
133 buoy_p(
ke,i,j) = buoy_p(
ke-1,i,j)
135 buoy_p( 1:
ks-1,i,j) = 0.0_rp
136 buoy_p(
ke+1:
ka ,i,j) = 0.0_rp
141 call saturation_dens2qsat_liq( qsat_p(:,:,:), &
145 call hist_in( dens_p(:,:,:),
'DENS_parcel',
'density profile in lifting parcel',
'kg/m3' )
146 call hist_in( temp_p(:,:,:),
'TEMP_parcel',
'temperature profile in lifting parcel',
'K' )
147 call hist_in( entr_p(:,:,:),
'ENTR_parcel',
'entropy profile in lifting parcel',
'J/K' )
148 call hist_in( buoy_p(:,:,:),
'BUOY_parcel',
'buoyancy profile in lifting parcel',
'm/s2' )
149 call hist_in( qsat_p(:,:,:),
'QSAT_parcel',
'saturation profile in lifting parcel',
'kg/kg' )
156 if ( qtrc_p(kstr,i,j,
i_qv) >= qsat_p(k,i,j) )
then 168 if ( buoy_p(k,i,j) >= 0.0_rp )
then 180 if ( buoy_p(k,i,j) >= 0.0_rp )
then 191 if ( klcl(i,j) >= kstr )
then 192 lcl(i,j) = cz(klcl(i,j),i,j)
200 if ( klfc(i,j) >= kstr )
then 201 lfc(i,j) = cz(klfc(i,j),i,j)
209 if ( klnb(i,j) >= kstr )
then 210 lnb(i,j) = cz(klnb(i,j),i,j)
218 if ( klfc(i,j) >= kstr .AND. klnb(i,j) > kstr )
then 219 do k = klfc(i,j), klnb(i,j)
220 cape(i,j) = cape(i,j) + buoy_pf(k-1,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
229 if ( klfc(i,j) >= kstr )
then 230 do k = kstr+1, klfc(i,j)
231 cin(i,j) = cin(i,j) + buoy_pf(k-1,i,j) * ( fz(k,i,j)-fz(k-1,i,j) )
264 thermodyn_entr => atmos_thermodyn_entr
266 saturation_pres2qsat_liq => atmos_saturation_pres2qsat_liq
269 integer,
intent(in) :: Kstr
270 real(RP),
intent(in) :: TEMP (
ka,
ia,
ja)
271 real(RP),
intent(in) :: PRES (
ka,
ia,
ja)
272 real(RP),
intent(in) :: QTRC (
ka,
ia,
ja,
qa)
273 real(RP),
intent(in) :: ENTR_p(
ia,
ja)
274 real(RP),
intent(out) :: DENS_p(
ka,
ia,
ja)
275 real(RP),
intent(out) :: TEMP_p(
ka,
ia,
ja)
276 real(RP),
intent(out) :: QTRC_p(
ka,
ia,
ja,
qa)
278 real(RP) :: qsat_p(
ka,
ia,
ja)
279 real(RP) :: qtot_p(
ia,
ja)
281 real(RP) :: qdry_p, Rtot, CPtot
282 real(RP) :: pres_dry, pres_vap
283 real(RP) :: TEMP_unsat
284 real(RP) :: qsat_unsat
288 real(RP) :: QTRC_ite(
qa)
290 real(RP) :: TEMP_prev
293 real(RP),
parameter :: criteria = 1.e-8_rp
294 integer,
parameter :: itelim = 100
297 real(RP),
parameter :: TEMMIN = 0.1_rp
299 integer :: k, i, j, iqw
305 temp_p(k,i,j) = temp(k,i,j)
307 qtrc_p(k,i,j,iqw) = qtrc(k,i,j,iqw)
316 qtot_p(i,j) = qtrc(kstr,i,j,
i_qv) + qtrc(kstr,i,j,
i_qc)
323 temp_p(k,i,j) = temp(k,i,j)
326 qdry_p = 1.0_rp - qtot_p(i,j)
327 rtot = rdry * qdry_p + rvap * qtot_p(i,j)
328 cptot = cpdry * qdry_p + cpvap * qtot_p(i,j)
331 pres_dry = max( pres(k,i,j) * qdry_p * rdry / rtot, eps )
332 pres_vap = max( pres(k,i,j) * qtot_p(i,j) * rvap / rtot, eps )
334 temp_unsat = tem00 * exp( ( entr_p(i,j) + qdry_p * rdry *
log( pres_dry / pre00 ) &
335 + qtot_p(i,j) * rvap *
log( pres_vap / psat0 ) &
336 - qtot_p(i,j) * lhv0 / tem00 ) / cptot )
338 call saturation_pres2qsat_liq( qsat_unsat, &
343 if ( qtot_p(i,j) > qsat_unsat )
then 345 temp_ite = tem00 * exp( ( entr_p(i,j) + rdry *
log( pres(k,i,j) / pre00 ) ) / cpdry )
349 call saturation_pres2qsat_liq( qsat_ite, &
354 qtrc_ite(
i_qv) = min( qtot_p(i,j), qsat_ite )
356 call thermodyn_entr( entr_ite, &
361 qdry_p = 1.0_rp - qtrc_ite(
i_qv)
362 cptot = cpdry * qdry_p + cpvap * qtrc_ite(
i_qv)
364 dentr_dt = cptot / temp_ite &
365 - qtrc_ite(
i_qv) * lhv0 / temp_ite**2 &
366 + qtrc_ite(
i_qv) * lhv0**2 / temp_ite**3 / rvap
367 dentr_dt = max( dentr_dt, eps )
370 temp_ite = temp_ite - ( entr_ite - entr_p(i,j) ) / dentr_dt
371 temp_ite = max( temp_ite, temmin )
373 if( abs(temp_ite-temp_prev) < criteria )
exit 377 temp_p(k,i,j) = temp_ite
382 call saturation_pres2qsat_liq( qsat_p(k,i,j), &
387 qtot_p(i,j) = min( qtot_p(i,j), qsat_p(k,i,j) )
389 qtrc_p(k,i,j,
i_qv) = qtot_p(i,j)
390 qtrc_p(k,i,j,
i_qc) = 0.0_rp
392 qdry_p = 1.0_rp - qtot_p(i,j)
393 rtot = rdry * qdry_p + rvap * qtot_p(i,j)
395 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
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 x whole cells (local, with HALO)
integer, public ka
of z whole cells (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
subroutine, public log(type, message)
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
module ATMOSPHERE / Thermodynamics
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
integer, public ja
of y whole cells (local, with HALO)