SCALE-RM
Data Types | Functions/Subroutines
scale_atmos_saturation Module Reference

module atmosphere / saturation More...

Functions/Subroutines

subroutine, public atmos_saturation_setup
 Setup. More...
 
subroutine atmos_saturation_alpha_0d (temp, alpha)
 calc liquid/ice separation factor (0D) More...
 
subroutine atmos_saturation_dqs_dtem_dens_liq_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, dens, dqsdtem)
 
subroutine atmos_saturation_dqs_dtem_dens_ice_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, dens, dqsdtem)
 
subroutine atmos_saturation_dqs_dtem_dpre_liq_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, pres, qdry, dqsat_dT, dqsat_dP)
 
subroutine atmos_saturation_dqs_dtem_dpre_ice_3d (KA, KS, KE, IA, IS, IE, JA, JS, JE, temp, pres, qdry, dqsat_dT, dqsat_dP)
 
subroutine atmos_saturation_tdew_liq_1d (KA, KS, KE, DENS, TEMP, QV, Tdew, converged)
 
subroutine atmos_saturation_pote_0d (DENS, POTT, TEMP, QV, POTE)
 calculate equivalent potential temperature Bolton, D., 1980: The computation of equivalent potential temperature. Monthly Weather Rev., 108, 1046-1053. PT_E = PT exp( L QV / (CPdry T) f ) f ~ 1.0784 ( 1 + 0.810 QV ) Here T_L is temperature at the lifting condensation level and T_L ~ 55 + 2840 / ( CPdry/Rdry log(T) - log(P_v) - 4.805 ) More...
 
subroutine atmos_saturation_pote_1d (KA, KS, KE, DENS, POTT, TEMP, QV, POTE)
 
subroutine atmos_saturation_moist_conversion_dens_all_0d (DENS, Emoist0, TEMP, QV, QC, QI, CPtot, CVtot, converged)
 Iterative moist conversion (liquid/ice mixture) at constant density (volume) More...
 
subroutine atmos_saturation_moist_conversion_pres_liq_0d (PRES, Entr, Qdry, QV, QC, Rtot, CPtot, TEMP, converged)
 Iterative moist conversion for liquid water at constant pressure. More...
 

Detailed Description

module atmosphere / saturation

Description
Saturation module
Author
Team SCALE
NAMELIST
  • PARAM_ATMOS_SATURATION
    nametypedefault valuecomment
    ATMOS_SATURATION_ULIMIT_TEMP real(RP) 273.15_RP upper limit temperature
    ATMOS_SATURATION_LLIMIT_TEMP real(RP) 233.15_RP lower limit temperature

History Output
No history output

Function/Subroutine Documentation

◆ atmos_saturation_setup()

subroutine, public scale_atmos_saturation::atmos_saturation_setup ( )

Setup.

Definition at line 211 of file scale_atmos_saturation.F90.

References scale_atmos_hydrometeor::atmos_hydrometeor_setup(), scale_const::const_ci, scale_const::const_cl, scale_const::const_cpvap, scale_const::const_cvvap, scale_const::const_lhs0, scale_const::const_lhs00, scale_const::const_lhv0, scale_const::const_lhv00, scale_const::const_thermodyn_type, scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by scale_atmos_adiabat::atmos_adiabat_setup(), mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

211  use scale_prc, only: &
212  prc_abort
213  use scale_const, only: &
214  cpvap => const_cpvap, &
215  cvvap => const_cvvap, &
216  cl => const_cl, &
217  ci => const_ci, &
218  lhv00 => const_lhv00, &
219  lhs00 => const_lhs00, &
220  lhv0 => const_lhv0, &
221  lhs0 => const_lhs0, &
223  use scale_atmos_hydrometeor, only: &
225  implicit none
226 
227  namelist / param_atmos_saturation / &
228  atmos_saturation_ulimit_temp, &
229  atmos_saturation_llimit_temp
230 
231  integer :: ierr
232  !---------------------------------------------------------------------------
233 
234  log_newline
235  log_info("ATMOS_SATURATION_setup",*) 'Setup'
236 
237  !--- read namelist
238  rewind(io_fid_conf)
239  read(io_fid_conf,nml=param_atmos_saturation,iostat=ierr)
240  if( ierr < 0 ) then !--- missing
241  log_info("ATMOS_SATURATION_setup",*) 'Not found namelist. Default used.'
242  elseif( ierr > 0 ) then !--- fatal error
243  log_error("ATMOS_SATURATION_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_SATURATION. Check!'
244  call prc_abort
245  endif
246  log_nml(param_atmos_saturation)
247 
248  rtem00 = 1.0_rp / tem00
249 
250  if ( const_thermodyn_type == 'EXACT' ) then
251 
252  cpovr_liq = ( cpvap - cl ) / rvap
253  cpovr_ice = ( cpvap - ci ) / rvap
254  cvovr_liq = ( cvvap - cl ) / rvap
255  cvovr_ice = ( cvvap - ci ) / rvap
256 
257  lovr_liq = lhv00 / rvap
258  lovr_ice = lhs00 / rvap
259 
260  elseif( const_thermodyn_type == 'SIMPLE' ) then
261 
262  cpovr_liq = 0.0_rp
263  cpovr_ice = 0.0_rp
264  cvovr_liq = 0.0_rp
265  cvovr_ice = 0.0_rp
266 
267  lovr_liq = lhv0 / rvap
268  lovr_ice = lhs0 / rvap
269 
270  endif
271 
272  dalphadt_const = 1.0_rp / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
273 
274  log_newline
275  log_info("ATMOS_SATURATION_setup",'(1x,A,F7.2,A,F7.2)') 'Temperature range for liquid/ice mixture : ', &
276  atmos_saturation_llimit_temp, ' - ', &
277  atmos_saturation_ulimit_temp
278 
280 
281  call atmos_saturation_psat_liq( tem_min, psat_min_liq ) ! [IN], [OUT]
282  call atmos_saturation_psat_ice( tem_min, psat_min_ice ) ! [IN], [OUT]
283 
284  return
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
Definition: scale_const.F90:67
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:66
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
Definition: scale_const.F90:65
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
Definition: scale_const.F90:77
module atmosphere / hydrometeor
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:75
module PROCESS
Definition: scale_prc.F90:11
real(rp), public const_lhs00
latent heat of sublimation at 0K [J/kg]
Definition: scale_const.F90:78
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
Definition: scale_const.F90:76
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
subroutine, public atmos_hydrometeor_setup
Setup.
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:64
character(len=h_short), public const_thermodyn_type
internal energy type
Definition: scale_const.F90:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_saturation_alpha_0d()

subroutine scale_atmos_saturation::atmos_saturation_alpha_0d ( real(rp), intent(in)  temp,
real(rp), intent(out)  alpha 
)

calc liquid/ice separation factor (0D)

Parameters
[in]temptemperature [K]
[out]alphaliquid/ice separation factor (0-1)

Definition at line 292 of file scale_atmos_saturation.F90.

292  implicit none
293 
294  real(RP), intent(in) :: temp
295  real(RP), intent(out) :: alpha
296  !---------------------------------------------------------------------------
297 
298  alpha = ( temp - atmos_saturation_llimit_temp ) &
299  / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
300 
301  alpha = min( max( alpha, 0.0_rp ), 1.0_rp )
302 
303  return

◆ atmos_saturation_dqs_dtem_dens_liq_3d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dens_liq_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  dqsdtem 
)
Parameters
[in]temptemperature [K]
[in]denstemperature [K]
[out]dqsdtem(d qsw/d T)_{rho}

Definition at line 1352 of file scale_atmos_saturation.F90.

1352  implicit none
1353  integer, intent(in) :: ka, ks, ke
1354  integer, intent(in) :: ia, is, ie
1355  integer, intent(in) :: ja, js, je
1356 
1357  real(RP), intent(in) :: temp (ka,ia,ja)
1358  real(RP), intent(in) :: dens (ka,ia,ja)
1359 
1360  real(RP), intent(out) :: dqsdtem(ka,ia,ja)
1361 
1362  integer :: k, i, j
1363  !---------------------------------------------------------------------------
1364 
1365  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1366  do j = js, je
1367  do i = is, ie
1368  do k = ks, ke
1369  call atmos_saturation_dqs_dtem_dens_liq_0d( temp(k,i,j), dens(k,i,j), & ! [IN]
1370  dqsdtem(k,i,j) ) ! [OUT]
1371  enddo
1372  enddo
1373  enddo
1374 
1375  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO

◆ atmos_saturation_dqs_dtem_dens_ice_3d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dens_ice_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  dens,
real(rp), dimension(ka,ia,ja), intent(out)  dqsdtem 
)

Definition at line 1417 of file scale_atmos_saturation.F90.

1417  implicit none
1418  integer, intent(in) :: ka, ks, ke
1419  integer, intent(in) :: ia, is, ie
1420  integer, intent(in) :: ja, js, je
1421 
1422  real(RP), intent(in) :: temp (ka,ia,ja)
1423  real(RP), intent(in) :: dens (ka,ia,ja)
1424 
1425  real(RP), intent(out) :: dqsdtem(ka,ia,ja)
1426 
1427  integer :: k, i, j
1428  !---------------------------------------------------------------------------
1429 
1430  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1431  do j = js, je
1432  do i = is, ie
1433  do k = ks, ke
1434  call atmos_saturation_dqs_dtem_dens_ice_0d( temp(k,i,j), dens(k,i,j), & ! [IN]
1435  dqsdtem(k,i,j) ) ! [OUT]
1436  enddo
1437  enddo
1438  enddo
1439 
1440  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO

◆ atmos_saturation_dqs_dtem_dpre_liq_3d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dpre_liq_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  pres,
real(rp), dimension (ka,ia,ja), intent(in)  qdry,
real(rp), dimension(ka,ia,ja), intent(out)  dqsat_dT,
real(rp), dimension(ka,ia,ja), intent(out)  dqsat_dP 
)

Definition at line 1534 of file scale_atmos_saturation.F90.

1534  implicit none
1535  integer, intent(in) :: ka, ks, ke
1536  integer, intent(in) :: ia, is, ie
1537  integer, intent(in) :: ja, js, je
1538 
1539  real(RP), intent(in) :: temp (ka,ia,ja)
1540  real(RP), intent(in) :: pres (ka,ia,ja)
1541  real(RP), intent(in) :: qdry (ka,ia,ja)
1542 
1543  real(RP), intent(out) :: dqsat_dt(ka,ia,ja)
1544  real(RP), intent(out) :: dqsat_dp(ka,ia,ja)
1545 
1546  integer :: k, i, j
1547  !---------------------------------------------------------------------------
1548 
1549  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1550  do j = js, je
1551  do i = is, ie
1552  do k = ks, ke
1553  call atmos_saturation_dqs_dtem_dpre_liq_0d( temp(k,i,j), pres(k,i,j), qdry(k,i,j), & ! [IN]
1554  dqsat_dt(k,i,j), dqsat_dp(k,i,j) ) ! [OUT]
1555  enddo
1556  enddo
1557  enddo
1558 
1559  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO

◆ atmos_saturation_dqs_dtem_dpre_ice_3d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dpre_ice_3d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ka,ia,ja), intent(in)  temp,
real(rp), dimension (ka,ia,ja), intent(in)  pres,
real(rp), dimension (ka,ia,ja), intent(in)  qdry,
real(rp), dimension(ka,ia,ja), intent(out)  dqsat_dT,
real(rp), dimension(ka,ia,ja), intent(out)  dqsat_dP 
)

Definition at line 1610 of file scale_atmos_saturation.F90.

References scale_const::const_undef, and scale_precision::rp.

1610  implicit none
1611  integer, intent(in) :: ka, ks, ke
1612  integer, intent(in) :: ia, is, ie
1613  integer, intent(in) :: ja, js, je
1614 
1615  real(RP), intent(in) :: temp (ka,ia,ja)
1616  real(RP), intent(in) :: pres (ka,ia,ja)
1617  real(RP), intent(in) :: qdry (ka,ia,ja)
1618 
1619  real(RP), intent(out) :: dqsat_dt(ka,ia,ja)
1620  real(RP), intent(out) :: dqsat_dp(ka,ia,ja)
1621 
1622  integer :: k, i, j
1623  !---------------------------------------------------------------------------
1624 
1625  !$omp parallel do OMP_SCHEDULE_ collapse(2)
1626  do j = js, je
1627  do i = is, ie
1628  do k = ks, ke
1629  call atmos_saturation_dqs_dtem_dpre_ice( temp(k,i,j), pres(k,i,j), qdry(k,i,j), & ! [IN]
1630  dqsat_dt(k,i,j), dqsat_dp(k,i,j) ) ! [OUT]
1631  enddo
1632  enddo
1633  enddo
1634 
1635  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO

◆ atmos_saturation_tdew_liq_1d()

subroutine scale_atmos_saturation::atmos_saturation_tdew_liq_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  DENS,
real(rp), dimension(ka), intent(in)  TEMP,
real(rp), dimension (ka), intent(in)  QV,
real(rp), dimension(ka), intent(out)  Tdew,
logical, intent(out)  converged 
)

Definition at line 1760 of file scale_atmos_saturation.F90.

References scale_prc::prc_abort().

1760  integer, intent(in) :: ka, ks, ke
1761 
1762  real(RP), intent(in) :: dens(ka)
1763  real(RP), intent(in) :: temp(ka)
1764  real(RP), intent(in) :: qv (ka)
1765 
1766  real(RP), intent(out) :: tdew(ka)
1767  logical, intent(out) :: converged
1768 
1769  integer :: k
1770  !---------------------------------------------------------------------------
1771 
1772  do k = ks, ke
1773  call atmos_saturation_tdew_liq_0d( dens(k), temp(k), qv(k), & ! [IN]
1774  tdew(k), converged ) ! [OUT]
1775  if ( .not. converged ) exit
1776  end do
1777 
integer, public ke
end point of inner domain: z, local
integer, public ks
start point of inner domain: z, local
integer, public ka
of whole cells: z, local, with HALO
Here is the call graph for this function:

◆ atmos_saturation_pote_0d()

subroutine scale_atmos_saturation::atmos_saturation_pote_0d ( real(rp), intent(in)  DENS,
real(rp), intent(in)  POTT,
real(rp), intent(in)  TEMP,
real(rp), intent(in)  QV,
real(rp), intent(out)  POTE 
)

calculate equivalent potential temperature Bolton, D., 1980: The computation of equivalent potential temperature. Monthly Weather Rev., 108, 1046-1053. PT_E = PT exp( L QV / (CPdry T) f ) f ~ 1.0784 ( 1 + 0.810 QV ) Here T_L is temperature at the lifting condensation level and T_L ~ 55 + 2840 / ( CPdry/Rdry log(T) - log(P_v) - 4.805 )

Definition at line 1832 of file scale_atmos_saturation.F90.

References scale_const::const_cpdry, and scale_const::const_rdry.

Referenced by atmos_saturation_pote_1d().

1832  use scale_const, only: &
1833  rdry => const_rdry, &
1834  cpdry => const_cpdry
1835  use scale_atmos_hydrometeor, only: &
1836  atmos_hydrometeor_lhv
1837  real(RP), intent(in) :: dens
1838  real(RP), intent(in) :: pott
1839  real(RP), intent(in) :: temp
1840  real(RP), intent(in) :: qv
1841 
1842  real(RP), intent(out) :: pote
1843 
1844  real(RP) :: tl
1845  real(RP) :: pv
1846  real(RP) :: lhv
1847 
1848  pv = dens * qv * rvap * temp
1849  tl = 55.0_rp + 2840.0_rp / ( cpdry / rdry * log(temp) - log(pv) - 4.805_rp )
1850  call atmos_hydrometeor_lhv( temp, lhv ) ! [IN], [OUT]
1851 
1852  pote = pott * exp( lhv * qv / ( cpdry * temp ) &
1853  * 1.0784_rp * ( 1.0_rp + 0.810_rp * qv ) )
1854 
1855  return
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:56
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
module atmosphere / hydrometeor
module CONSTANT
Definition: scale_const.F90:11
Here is the caller graph for this function:

◆ atmos_saturation_pote_1d()

subroutine scale_atmos_saturation::atmos_saturation_pote_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension(ka), intent(in)  DENS,
real(rp), dimension(ka), intent(in)  POTT,
real(rp), dimension(ka), intent(in)  TEMP,
real(rp), dimension (ka), intent(in)  QV,
real(rp), dimension(ka), intent(out)  POTE 
)

Definition at line 1863 of file scale_atmos_saturation.F90.

References atmos_saturation_pote_0d(), scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, scale_atmos_hydrometeor::lhv, scale_prc::prc_abort(), and scale_precision::rp.

1863  integer, intent(in) :: ka, ks, ke
1864 
1865  real(RP), intent(in) :: dens(ka)
1866  real(RP), intent(in) :: pott(ka)
1867  real(RP), intent(in) :: temp(ka)
1868  real(RP), intent(in) :: qv (ka)
1869 
1870  real(RP), intent(out) :: pote(ka)
1871 
1872  integer :: k
1873 
1874  do k = ks, ke
1875  call atmos_saturation_pote_0d( dens(k), pott(k), temp(k), qv(k), & ! [IN]
1876  pote(k) ) ! [OUT]
1877  end do
1878 
1879  return
integer, public ke
end point of inner domain: z, local
integer, public ks
start point of inner domain: z, local
integer, public ka
of whole cells: z, local, with HALO
Here is the call graph for this function:

◆ atmos_saturation_moist_conversion_dens_all_0d()

subroutine scale_atmos_saturation::atmos_saturation_moist_conversion_dens_all_0d ( real(rp), intent(in)  DENS,
real(rp), intent(in)  Emoist0,
real(rp), intent(inout)  TEMP,
real(rp), intent(inout)  QV,
real(rp), intent(inout)  QC,
real(rp), intent(inout)  QI,
real(rp), intent(inout)  CPtot,
real(rp), intent(inout)  CVtot,
logical, intent(out)  converged 
)

Iterative moist conversion (liquid/ice mixture) at constant density (volume)

Definition at line 2024 of file scale_atmos_saturation.F90.

References scale_atmos_hydrometeor::cp_ice, scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::cv_ice, scale_atmos_hydrometeor::cv_vapor, scale_atmos_hydrometeor::cv_water, scale_atmos_hydrometeor::lhf, scale_atmos_hydrometeor::lhv, scale_prc::prc_abort(), and scale_precision::rp.

2024  use scale_prc, only: &
2025  prc_abort
2026  use scale_atmos_hydrometeor, only: &
2027  cp_vapor, &
2028  cp_water, &
2029  cp_ice, &
2030  cv_vapor, &
2031  cv_water, &
2032  cv_ice, &
2033  lhv, &
2034  lhf
2035  implicit none
2036 
2037  real(RP), intent(in) :: dens
2038  real(RP), intent(in) :: emoist0
2039 
2040  real(RP), intent(inout) :: temp
2041  real(RP), intent(inout) :: qv
2042  real(RP), intent(inout) :: qc
2043  real(RP), intent(inout) :: qi
2044  real(RP), intent(inout) :: cptot
2045  real(RP), intent(inout) :: cvtot
2046 
2047  logical, intent(out) :: converged
2048 
2049  ! working
2050  real(RP) :: qsum
2051  real(RP) :: temp0
2052  real(RP) :: qv0, qc0, qi0
2053  real(RP) :: cvtot0
2054  real(RP) :: alpha
2055  real(RP) :: qsat
2056  real(RP) :: emoist ! moist internal energy
2057 
2058  ! d(X)/dT
2059  real(RP) :: dalpha_dt
2060  real(RP) :: dqsat_dt
2061  real(RP) :: dqc_dt, dqi_dt
2062  real(RP) :: dcvtot_dt
2063  real(RP) :: demoist_dt
2064  real(RP) :: dtemp
2065 
2066  integer, parameter :: itelim = 100
2067  real(RP), parameter :: dtemp_criteria = 0.1_rp**(2+rp/2)
2068  integer :: ite
2069  !---------------------------------------------------------------------------
2070 
2071  temp0 = temp
2072  cvtot0 = cvtot
2073  qv0 = qv
2074  qc0 = qc
2075  qi0 = qi
2076  qsum = qv + qc + qi
2077 
2078  call atmos_saturation_dens2qsat_all( temp, dens, & ! [IN]
2079  qsat ) ! [OUT]
2080 
2081  if ( qsum <= qsat ) then
2082  qv = qsum
2083  cptot = cptot + qc * ( cp_vapor - cp_water ) + qi * ( cp_vapor - cp_ice )
2084  cvtot = cvtot + qc * ( cv_vapor - cv_water ) + qi * ( cv_vapor - cv_ice )
2085  qc = 0.0_rp
2086  qi = 0.0_rp
2087  temp = ( emoist0 - lhv * qv ) / cvtot
2088  converged = .true.
2089  return
2090  end if
2091 
2092  converged = .false.
2093  do ite = 1, itelim
2094 
2095  ! dX/dT
2096  call atmos_saturation_dqs_dtem_dens_all_0d( temp, dens, & ! [IN]
2097  dqsat_dt, & ! [OUT]
2098  qsat=qsat, alpha=alpha ) ! [OUT]
2099  call atmos_saturation_dalphadt( temp, dalpha_dt ) ! [IN], [OUT]
2100 
2101  dqc_dt = ( qsum - qv ) * dalpha_dt - dqsat_dt * ( alpha )
2102  dqi_dt = -( qsum - qv ) * dalpha_dt - dqsat_dt * ( 1.0_rp-alpha )
2103 
2104  dcvtot_dt = dqsat_dt * cv_vapor &
2105  + dqc_dt * cv_water &
2106  + dqi_dt * cv_ice
2107 
2108  demoist_dt = temp * dcvtot_dt + cvtot + dqsat_dt * lhv - dqi_dt * lhf
2109 
2110  ! Saturation
2111  qv = qsat
2112  qc = ( qsum - qsat ) * ( alpha )
2113  qi = ( qsum - qsat ) * ( 1.0_rp - alpha )
2114 
2115  cvtot = cvtot0 &
2116  + cv_vapor * ( qv - qv0 ) &
2117  + cv_water * ( qc - qc0 ) &
2118  + cv_ice * ( qi - qi0 )
2119 
2120  emoist = temp * cvtot + qv * lhv - qi * lhf
2121 
2122  ! update temp by the newtonian method
2123  dtemp = ( emoist - emoist0 ) / demoist_dt
2124  temp = temp - dtemp
2125 
2126  if ( abs(dtemp) < dtemp_criteria ) then
2127  converged = .true.
2128  exit
2129  endif
2130 
2131  if( temp*0.0_rp /= 0.0_rp ) exit
2132  enddo
2133 
2134  cptot = cptot &
2135  + cp_vapor * ( qv - qv0 ) &
2136  + cp_water * ( qc - qc0 ) &
2137  + cp_ice * ( qi - qi0 )
2138 
2139  return
real(rp), public cv_ice
CV for ice [J/kg/K].
real(rp), public cp_ice
CP for ice [J/kg/K].
real(rp), public cv_vapor
CV for vapor [J/kg/K].
module atmosphere / hydrometeor
module PROCESS
Definition: scale_prc.F90:11
real(rp), public lhf
latent heat of fusion for use [J/kg]
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
real(rp), public lhv
latent heat of vaporization for use [J/kg]
real(rp), public cp_vapor
CP for vapor [J/kg/K].
integer, parameter, public rp
real(rp), public cp_water
CP for water [J/kg/K].
real(rp), public cv_water
CV for water [J/kg/K].
Here is the call graph for this function:

◆ atmos_saturation_moist_conversion_pres_liq_0d()

subroutine scale_atmos_saturation::atmos_saturation_moist_conversion_pres_liq_0d ( real(rp), intent(in)  PRES,
real(rp), intent(in)  Entr,
real(rp), intent(in)  Qdry,
real(rp), intent(inout)  QV,
real(rp), intent(inout)  QC,
real(rp), intent(inout)  Rtot,
real(rp), intent(inout)  CPtot,
real(rp), intent(out)  TEMP,
logical, intent(out)  converged 
)

Iterative moist conversion for liquid water at constant pressure.

Definition at line 2151 of file scale_atmos_saturation.F90.

References scale_const::const_eps, scale_const::const_lhv0, scale_atmos_hydrometeor::cp_vapor, and scale_atmos_hydrometeor::cp_water.

2151  use scale_const, only: &
2152  eps => const_eps, &
2153  lhv0 => const_lhv0
2154  use scale_atmos_hydrometeor, only: &
2155  atmos_hydrometeor_entr, &
2156  atmos_hydrometeor_entr2temp, &
2157  cp_vapor, &
2158  cp_water
2159 
2160  real(RP), intent(in) :: pres
2161  real(RP), intent(in) :: entr
2162  real(RP), intent(in) :: qdry
2163 
2164  real(RP), intent(inout) :: qv
2165  real(RP), intent(inout) :: qc
2166  real(RP), intent(inout) :: cptot
2167  real(RP), intent(inout) :: rtot
2168 
2169  real(RP), intent(out) :: temp
2170  logical, intent(out) :: converged
2171 
2172  real(RP), parameter :: temmin = 0.1_rp
2173  real(RP), parameter :: criteria = 1.e-8_rp
2174  integer, parameter :: itelim = 100
2175  integer :: ite
2176 
2177  real(RP) :: qsum
2178  real(RP) :: qsat, psat
2179 
2180  real(RP) :: temp_ite
2181  real(RP) :: qv_ite
2182  real(RP) :: entr_ite
2183  real(RP) :: rtot_ite
2184  real(RP) :: cptot_ite
2185 
2186  real(RP) :: dqsat_dt, dqsat_dp
2187 
2188  real(RP) :: temp_prev
2189  real(RP) :: dentr_dt
2190  !---------------------------------------------------------------------------
2191 
2192  qsum = qv + qc
2193 
2194  ! all liquid evaporates
2195  rtot = rtot + qc * rvap
2196  cptot = cptot + qc * ( cp_vapor - cp_water )
2197  qv = qsum
2198  qc = 0.0_rp
2199 
2200  call atmos_hydrometeor_entr2temp( entr, pres, qsum, 0.0_rp, qdry, & ! [IN]
2201  rtot, cptot, & ! [IN]
2202  temp ) ! [OUT]
2203 
2204  call atmos_saturation_pres2qsat_liq( temp, pres, qdry, & ! [IN]
2205  qsat ) ! [OUT]
2206  if ( qsum <= qsat ) then
2207  ! unsaturated
2208 
2209  converged = .true.
2210 
2211  return
2212 
2213  else
2214  ! saturated
2215 
2216  temp_ite = temp
2217 
2218  do ite = 1, itelim
2219 
2220  call atmos_saturation_dqs_dtem_dpre_liq_0d( temp_ite, pres, qdry, & ! [IN]
2221  dqsat_dt, dqsat_dp, & ! [OUT]
2222  qsat=qsat, psat=psat ) ! [OUT]
2223 
2224  qv_ite = min( qsum, qsat )
2225 
2226  rtot_ite = rtot - ( qsum - qv_ite ) * rvap
2227  cptot_ite = cptot - ( qsum - qv_ite ) * ( cp_vapor - cp_water )
2228 
2229  dentr_dt = cptot_ite / temp_ite &
2230  + ( ( cp_vapor - cp_water ) * log( temp_ite / tem00 ) &
2231  - rvap * log( psat/ psat0 ) &
2232  + lhv0 / tem00 &
2233  ) * dqsat_dt
2234 
2235  call atmos_hydrometeor_entr( temp_ite, pres, & ! [IN]
2236  qv_ite, 0.0_rp, qdry, & ! [IN] ! QI = 0
2237  rtot_ite, cptot_ite, & ! [IN]
2238  entr_ite ) ! [OUT]
2239 
2240  temp_prev = temp_ite
2241  temp_ite = temp_ite - ( entr_ite - entr ) / max( dentr_dt, eps )
2242  temp_ite = max( temp_ite, temmin )
2243 
2244  if( abs(temp_ite-temp_prev) < criteria ) then
2245  converged = .true.
2246  exit
2247  end if
2248 
2249  enddo
2250 
2251  end if
2252 
2253  qv = qv_ite
2254  qc = qsum - qv
2255  cptot = cptot_ite
2256  rtot = rtot_ite
2257  temp = temp_ite
2258 
2259  return
module atmosphere / hydrometeor
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:75
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
real(rp), public cp_vapor
CP for vapor [J/kg/K].
real(rp), public cp_water
CP for water [J/kg/K].