SCALE-RM
Functions/Subroutines
scale_atmos_adiabat Module Reference

module ATMOSPHERE / Adiabatic process More...

Functions/Subroutines

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 Reference: Emanuel(1994) More...
 
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 the model Reference: Emanuel(1994) More...
 

Detailed Description

module ATMOSPHERE / Adiabatic process

Description
Moist adiabatic process for calculation of CAPE, CIN
Author
Team SCALE
NAMELIST
  • No namelist group
History Output
namedescriptionunitvariable
BUOY_parcel buoyancy profile in lifting parcel m/s2 BUOY_p
DENS_parcel density profile in lifting parcel kg/m3 DENS_p
ENTR_parcel entropy profile in lifting parcel J/K ENTR_p
QSAT_parcel saturation profile in lifting parcel kg/kg QSAT_p
TEMP_parcel temperature profile in lifting parcel K TEMP_p

Function/Subroutine Documentation

◆ atmos_adiabat_cape()

subroutine, public scale_atmos_adiabat::atmos_adiabat_cape ( integer, intent(in)  Kstr,
real(rp), dimension(ka,ia,ja), intent(in)  DENS,
real(rp), dimension(ka,ia,ja), intent(in)  TEMP,
real(rp), dimension(ka,ia,ja), intent(in)  PRES,
real(rp), dimension(ka,ia,ja,qa), intent(in)  QTRC,
real(rp), dimension ( ka,ia,ja), intent(in)  CZ,
real(rp), dimension (0:ka,ia,ja), intent(in)  FZ,
real(rp), dimension(ia,ja), intent(out)  CAPE,
real(rp), dimension (ia,ja), intent(out)  CIN,
real(rp), dimension (ia,ja), intent(out)  LCL,
real(rp), dimension (ia,ja), intent(out)  LFC,
real(rp), dimension (ia,ja), intent(out)  LNB 
)

Calc CAPE and CIN Type of parcel method: Pseudo-adiabatic ascend from lowermost layer of the model Reference: Emanuel(1994)

Definition at line 61 of file scale_atmos_sub_adiabat.F90.

References atmos_adiabat_liftparcel(), scale_const::const_grav, scale_tracer::i_qv, scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ka, scale_grid_index::ke, and scale_grid_index::ks.

Referenced by mod_atmos_vars::atmos_vars_history().

61  use scale_const, only: &
62  grav => const_grav
63  use scale_atmos_thermodyn, only: &
64  thermodyn_entr => atmos_thermodyn_entr
65  use scale_atmos_saturation, only: &
66  saturation_dens2qsat_liq => atmos_saturation_dens2qsat_liq
67  use scale_history, only: &
68  hist_in
69  implicit none
70 
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)
83 
84  real(RP) :: dens_p (ka,ia,ja)
85  real(RP) :: temp_p (ka,ia,ja)
86  real(RP) :: qtrc_p (ka,ia,ja,qa)
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)
91 
92  integer :: klcl(ia,ja)
93  integer :: klfc(ia,ja)
94  integer :: klnb(ia,ja)
95 
96  integer :: k, i, j
97  !---------------------------------------------------------------------------
98 
99  ! entropy at start point
100  call thermodyn_entr( entr_p(kstr,:,:), & ! [OUT]
101  temp(kstr,:,:), & ! [IN]
102  pres(kstr,:,:), & ! [IN]
103  qtrc(kstr,:,:,:) ) ! [IN]
104 
105  ! lift parcel
106  call atmos_adiabat_liftparcel( kstr, & ! [IN]
107  temp(:,:,:), & ! [IN]
108  pres(:,:,:), & ! [IN]
109  qtrc(:,:,:,:), & ! [IN]
110  entr_p(kstr,:,:), & ! [IN]
111  dens_p(:,:,:), & ! [OUT]
112  temp_p(:,:,:), & ! [OUT]
113  qtrc_p(:,:,:,:) ) ! [OUT]
114 
115  ! entropy profile (lifted parcel)
116  call thermodyn_entr( entr_p(:,:,:), & ! [OUT]
117  temp_p(:,:,:), & ! [IN]
118  pres(:,:,:), & ! [IN]
119  qtrc_p(:,:,:,:) ) ! [IN]
120 
121  ! parcel buoyancy
122  do j = js, je
123  do i = is, ie
124  do k = ks, ke
125  buoy_p(k,i,j) = grav * ( dens(k,i,j) - dens_p(k,i,j) ) / dens_p(k,i,j)
126  enddo
127  buoy_p( 1:ks-1,i,j) = 0.0_rp
128  buoy_p(ke+1:ka ,i,j) = 0.0_rp
129 
130  do k = ks, ke-1
131  buoy_pf(k,i,j) = 0.5_rp * ( buoy_p(k+1,i,j) + buoy_p(k,i,j) )
132  enddo
133  buoy_p(ke,i,j) = buoy_p(ke-1,i,j)
134 
135  buoy_p( 1:ks-1,i,j) = 0.0_rp
136  buoy_p(ke+1:ka ,i,j) = 0.0_rp
137  enddo
138  enddo
139 
140  ! saturation point profile (lifted parcel)
141  call saturation_dens2qsat_liq( qsat_p(:,:,:), & ! [OUT]
142  temp_p(:,:,:), & ! [IN]
143  dens_p(:,:,:) ) ! [IN]
144 
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' )
150 
151  ! detect layer number of LNB, LFC, LCL
152  klcl(:,:) = -1
153  do j = js, je
154  do i = is, ie
155  do k = kstr, ke
156  if ( qtrc_p(kstr,i,j,i_qv) >= qsat_p(k,i,j) ) then
157  klcl(i,j) = k
158  exit
159  endif
160  enddo
161  enddo
162  enddo
163 
164  klfc(:,:) = -1
165  do j = js, je
166  do i = is, ie
167  do k = klcl(i,j), ke
168  if ( buoy_p(k,i,j) >= 0.0_rp ) then
169  klfc(i,j) = k
170  exit
171  endif
172  enddo
173  enddo
174  enddo
175 
176  klnb(:,:) = -1
177  do j = js, je
178  do i = is, ie
179  do k = ke, kstr, -1
180  if ( buoy_p(k,i,j) >= 0.0_rp ) then
181  klnb(i,j) = k
182  exit
183  endif
184  enddo
185  enddo
186  enddo
187 
188  lcl(:,:) = 0.0_rp
189  do j = js, je
190  do i = is, ie
191  if ( klcl(i,j) >= kstr ) then
192  lcl(i,j) = cz(klcl(i,j),i,j)
193  endif
194  enddo
195  enddo
196 
197  lfc(:,:) = 0.0_rp
198  do j = js, je
199  do i = is, ie
200  if ( klfc(i,j) >= kstr ) then
201  lfc(i,j) = cz(klfc(i,j),i,j)
202  endif
203  enddo
204  enddo
205 
206  lnb(:,:) = 0.0_rp
207  do j = js, je
208  do i = is, ie
209  if ( klnb(i,j) >= kstr ) then
210  lnb(i,j) = cz(klnb(i,j),i,j)
211  endif
212  enddo
213  enddo
214 
215  cape(:,:) = 0.0_rp
216  do j = js, je
217  do i = is, ie
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) )
221  enddo
222  endif
223  enddo
224  enddo
225 
226  cin(:,:) = 0.0_rp
227  do j = js, je
228  do i = is, ie
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) )
232  enddo
233  endif
234  enddo
235  enddo
236 
237  return
module ATMOSPHERE / Saturation adjustment
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:48
module CONSTANT
Definition: scale_const.F90:14
module ATMOSPHERE / Thermodynamics
module HISTORY
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_adiabat_liftparcel()

subroutine, public scale_atmos_adiabat::atmos_adiabat_liftparcel ( integer, intent(in)  Kstr,
real(rp), dimension (ka,ia,ja), intent(in)  TEMP,
real(rp), dimension (ka,ia,ja), intent(in)  PRES,
real(rp), dimension (ka,ia,ja,qa), intent(in)  QTRC,
real(rp), dimension(ia,ja), intent(in)  ENTR_p,
real(rp), dimension(ka,ia,ja), intent(out)  DENS_p,
real(rp), dimension(ka,ia,ja), intent(out)  TEMP_p,
real(rp), dimension(ka,ia,ja,qa), intent(out)  QTRC_p 
)

Calc temperature profile with lifting parcel Method: Pseudo-adiabatic ascend from lowermost layer of the model Reference: Emanuel(1994)

Definition at line 253 of file scale_atmos_sub_adiabat.F90.

References scale_const::const_cpdry, scale_const::const_cpvap, scale_const::const_eps, scale_const::const_lhv0, scale_const::const_pre00, scale_const::const_psat0, scale_const::const_rdry, scale_const::const_rvap, scale_const::const_tem00, scale_tracer::i_qc, scale_tracer::i_qv, scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ke, dc_log::log(), scale_tracer::qqe, and scale_tracer::qqs.

Referenced by atmos_adiabat_cape().

253  use scale_const, only: &
254  eps => const_eps, &
255  rdry => const_rdry, &
256  cpdry => const_cpdry, &
257  rvap => const_rvap, &
258  cpvap => const_cpvap, &
259  lhv0 => const_lhv0, &
260  psat0 => const_psat0, &
261  pre00 => const_pre00, &
262  tem00 => const_tem00
263  use scale_atmos_thermodyn, only: &
264  thermodyn_entr => atmos_thermodyn_entr
265  use scale_atmos_saturation, only: &
266  saturation_pres2qsat_liq => atmos_saturation_pres2qsat_liq
267  implicit none
268 
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)
277 
278  real(RP) :: qsat_p(ka,ia,ja)
279  real(RP) :: qtot_p(ia,ja)
280 
281  real(RP) :: qdry_p, rtot, cptot
282  real(RP) :: pres_dry, pres_vap
283  real(RP) :: temp_unsat
284  real(RP) :: qsat_unsat
285 
286  real(RP) :: temp_ite
287  real(RP) :: qsat_ite
288  real(RP) :: qtrc_ite(qa)
289  real(RP) :: entr_ite
290  real(RP) :: temp_prev
291  real(RP) :: dentr_dt
292 
293  real(RP), parameter :: criteria = 1.e-8_rp
294  integer, parameter :: itelim = 100
295  integer :: ite
296 
297  real(RP), parameter :: temmin = 0.1_rp
298 
299  integer :: k, i, j, iqw
300  !---------------------------------------------------------------------------
301 
302  do j = js, je
303  do i = is, ie
304  do k = 1, kstr
305  temp_p(k,i,j) = temp(k,i,j)
306  do iqw = qqs, qqe
307  qtrc_p(k,i,j,iqw) = qtrc(k,i,j,iqw)
308  enddo
309  enddo
310  enddo
311  enddo
312 
313  ! vapor + cloud water at the start point
314  do j = js, je
315  do i = is, ie
316  qtot_p(i,j) = qtrc(kstr,i,j,i_qv) + qtrc(kstr,i,j,i_qc)
317  enddo
318  enddo
319 
320  do j = js, je
321  do i = is, ie
322  do k = kstr, ke
323  temp_p(k,i,j) = temp(k,i,j) ! first guess
324 
325  ! T1: unsaturated temperature, S = U1(PRES, TEMP_unsat, qtot_p)
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)
329 
330  ! dry air + vapor
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 )
333 
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 )
337 
338  call saturation_pres2qsat_liq( qsat_unsat, & ! [OUT]
339  temp_unsat, & ! [IN]
340  pres(k,i,j) ) ! [IN]
341 
342  ! T2: saturated temperature, S = U2(PRES, TEMP_ite, QTRC_ite)
343  if ( qtot_p(i,j) > qsat_unsat ) then
344 
345  temp_ite = tem00 * exp( ( entr_p(i,j) + rdry * log( pres(k,i,j) / pre00 ) ) / cpdry )
346 
347  do ite = 1, itelim
348 
349  call saturation_pres2qsat_liq( qsat_ite, & ! [OUT]
350  temp_ite, & ! [IN]
351  pres(k,i,j) ) ! [IN]
352 
353  qtrc_ite(:) = 0.0_rp ! Pseudo-adiabatic: no cloud water
354  qtrc_ite(i_qv) = min( qtot_p(i,j), qsat_ite )
355 
356  call thermodyn_entr( entr_ite, & ! [OUT]
357  temp_ite, & ! [IN]
358  pres(k,i,j), & ! [IN]
359  qtrc_ite(:) ) ! [IN]
360 
361  qdry_p = 1.0_rp - qtrc_ite(i_qv)
362  cptot = cpdry * qdry_p + cpvap * qtrc_ite(i_qv)
363 
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 )
368 
369  temp_prev = temp_ite
370  temp_ite = temp_ite - ( entr_ite - entr_p(i,j) ) / dentr_dt
371  temp_ite = max( temp_ite, temmin )
372 
373  if( abs(temp_ite-temp_prev) < criteria ) exit
374 
375  enddo
376 
377  temp_p(k,i,j) = temp_ite
378 
379  endif
380 
381  ! parcel satulation point
382  call saturation_pres2qsat_liq( qsat_p(k,i,j), & ! [OUT]
383  temp_p(k,i,j), & ! [IN]
384  pres(k,i,j) ) ! [IN]
385 
386  ! update parcel vapor : remove condensed water
387  qtot_p(i,j) = min( qtot_p(i,j), qsat_p(k,i,j) )
388 
389  qtrc_p(k,i,j,i_qv) = qtot_p(i,j)
390  qtrc_p(k,i,j,i_qc) = 0.0_rp
391 
392  qdry_p = 1.0_rp - qtot_p(i,j)
393  rtot = rdry * qdry_p + rvap * qtot_p(i,j)
394 
395  dens_p(k,i,j) = pres(k,i,j) / ( rtot * temp_p(k,i,j) )
396  enddo
397  enddo
398  enddo
399 
400  return
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
Definition: scale_const.F90:86
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:58
module ATMOSPHERE / Saturation adjustment
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
Definition: scale_const.F90:95
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:57
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:80
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:93
subroutine, public log(type, message)
Definition: dc_log.f90:133
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:65
module CONSTANT
Definition: scale_const.F90:14
real(rp), public const_eps
small number
Definition: scale_const.F90:36
module ATMOSPHERE / Thermodynamics
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:66
Here is the call graph for this function:
Here is the caller graph for this function: