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_1d (KA, KS, KE, temp, dens, dqsdtem)
 
subroutine atmos_saturation_dqs_dtem_dens_ice_1d (KA, KS, KE, temp, dens, dqsdtem)
 
subroutine atmos_saturation_dqs_dtem_dpre_liq_1d (KA, KS, KE, temp, pres, qdry, dqsat_dT, dqsat_dP)
 
subroutine atmos_saturation_dqs_dtem_dpre_ice_1d (KA, KS, KE, 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_L) 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 244 of file scale_atmos_saturation.F90.

244  use scale_prc, only: &
245  prc_abort
246  use scale_const, only: &
247  cpvap => const_cpvap, &
248  cvvap => const_cvvap, &
249  cl => const_cl, &
250  ci => const_ci, &
251  lhv00 => const_lhv00, &
252  lhs00 => const_lhs00, &
253  lhv0 => const_lhv0, &
254  lhs0 => const_lhs0, &
256  use scale_atmos_hydrometeor, only: &
258  implicit none
259 
260  namelist / param_atmos_saturation / &
261  atmos_saturation_ulimit_temp, &
262  atmos_saturation_llimit_temp
263 
264  integer :: ierr
265  !---------------------------------------------------------------------------
266 
267  log_newline
268  log_info("ATMOS_SATURATION_setup",*) 'Setup'
269 
270  !--- read namelist
271  rewind(io_fid_conf)
272  read(io_fid_conf,nml=param_atmos_saturation,iostat=ierr)
273  if( ierr < 0 ) then !--- missing
274  log_info("ATMOS_SATURATION_setup",*) 'Not found namelist. Default used.'
275  elseif( ierr > 0 ) then !--- fatal error
276  log_error("ATMOS_SATURATION_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_SATURATION. Check!'
277  call prc_abort
278  endif
279  log_nml(param_atmos_saturation)
280 
281  rtem00 = 1.0_rp / tem00
282 
283  if ( const_thermodyn_type == 'EXACT' ) then
284 
285  cpovr_liq = ( cpvap - cl ) / rvap
286  cpovr_ice = ( cpvap - ci ) / rvap
287  cvovr_liq = ( cvvap - cl ) / rvap
288  cvovr_ice = ( cvvap - ci ) / rvap
289 
290  lovr_liq = lhv00 / rvap
291  lovr_ice = lhs00 / rvap
292 
293  elseif( const_thermodyn_type == 'SIMPLE' ) then
294 
295  cpovr_liq = 0.0_rp
296  cpovr_ice = 0.0_rp
297  cvovr_liq = 0.0_rp
298  cvovr_ice = 0.0_rp
299 
300  lovr_liq = lhv0 / rvap
301  lovr_ice = lhs0 / rvap
302 
303  endif
304 
305  dalphadt_const = 1.0_rp / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
306 
307  log_newline
308  log_info("ATMOS_SATURATION_setup",'(1x,A,F7.2,A,F7.2)') 'Temperature range for liquid/ice mixture : ', &
309  atmos_saturation_llimit_temp, ' - ', &
310  atmos_saturation_ulimit_temp
311 
312  !$acc update device(ATMOS_SATURATION_ULIMIT_TEMP, ATMOS_SATURATION_LLIMIT_TEMP)
313  !$acc update device(RTEM00, dalphadT_const)
314  !$acc update device(CPovR_liq, CPovR_ice, CVovR_liq, CVovR_ice, LovR_liq, LovR_ice)
315 
317 
318  call atmos_saturation_psat_liq( tem_min, psat_min_liq ) ! [IN], [OUT]
319  call atmos_saturation_psat_ice( tem_min, psat_min_ice ) ! [IN], [OUT]
320 
321  !$acc update device(psat_min_liq, psat_min_ice)
322 
323  return

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().

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 331 of file scale_atmos_saturation.F90.

331  !$acc routine
332  implicit none
333 
334  real(RP), intent(in) :: temp
335  real(RP), intent(out) :: alpha
336  !---------------------------------------------------------------------------
337 
338  alpha = ( temp - atmos_saturation_llimit_temp ) &
339  / ( atmos_saturation_ulimit_temp - atmos_saturation_llimit_temp )
340 
341  alpha = min( max( alpha, 0.0_rp ), 1.0_rp )
342 
343  return

◆ atmos_saturation_dqs_dtem_dens_liq_1d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dens_liq_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension (ka), intent(in)  temp,
real(rp), dimension (ka), intent(in)  dens,
real(rp), dimension(ka), intent(out)  dqsdtem 
)
Parameters
[in]temptemperature [K]
[in]denstemperature [K]
[out]dqsdtem(d qsw/d T)_{rho}

Definition at line 1949 of file scale_atmos_saturation.F90.

1949  !$acc routine vector
1950  implicit none
1951  integer, intent(in) :: KA, KS, KE
1952 
1953  real(RP), intent(in) :: temp (KA)
1954  real(RP), intent(in) :: dens (KA)
1955 
1956  real(RP), intent(out) :: dqsdtem(KA)
1957 
1958  integer :: k
1959  !---------------------------------------------------------------------------
1960 
1961  do k = ks, ke
1962  call atmos_saturation_dqs_dtem_dens_liq_0d( temp(k), dens(k), & ! [IN]
1963  dqsdtem(k) ) ! [OUT]
1964  enddo
1965 
1966  return

◆ atmos_saturation_dqs_dtem_dens_ice_1d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dens_ice_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension (ka), intent(in)  temp,
real(rp), dimension (ka), intent(in)  dens,
real(rp), dimension(ka), intent(out)  dqsdtem 
)

Definition at line 2042 of file scale_atmos_saturation.F90.

2042  !$acc routine vector
2043  implicit none
2044  integer, intent(in) :: KA, KS, KE
2045 
2046  real(RP), intent(in) :: temp (KA)
2047  real(RP), intent(in) :: dens (KA)
2048 
2049  real(RP), intent(out) :: dqsdtem(KA)
2050 
2051  integer :: k
2052  !---------------------------------------------------------------------------
2053 
2054  do k = ks, ke
2055  call atmos_saturation_dqs_dtem_dens_ice_0d( temp(k), dens(k), & ! [IN]
2056  dqsdtem(k) ) ! [OUT]
2057  enddo
2058 
2059  return

◆ atmos_saturation_dqs_dtem_dpre_liq_1d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dpre_liq_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension (ka), intent(in)  temp,
real(rp), dimension (ka), intent(in)  pres,
real(rp), dimension (ka), intent(in)  qdry,
real(rp), dimension(ka), intent(out)  dqsat_dT,
real(rp), dimension(ka), intent(out)  dqsat_dP 
)

Definition at line 2189 of file scale_atmos_saturation.F90.

2189  !$acc routine vector
2190  implicit none
2191  integer, intent(in) :: KA, KS, KE
2192 
2193  real(RP), intent(in) :: temp (KA)
2194  real(RP), intent(in) :: pres (KA)
2195  real(RP), intent(in) :: qdry (KA)
2196 
2197  real(RP), intent(out) :: dqsat_dT(KA)
2198  real(RP), intent(out) :: dqsat_dP(KA)
2199 
2200  integer :: k
2201  !---------------------------------------------------------------------------
2202 
2203  do k = ks, ke
2204  call atmos_saturation_dqs_dtem_dpre_liq_0d( temp(k), pres(k), qdry(k), & ! [IN]
2205  dqsat_dt(k), dqsat_dp(k) ) ! [OUT]
2206  enddo
2207 
2208  return

◆ atmos_saturation_dqs_dtem_dpre_ice_1d()

subroutine scale_atmos_saturation::atmos_saturation_dqs_dtem_dpre_ice_1d ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
real(rp), dimension (ka), intent(in)  temp,
real(rp), dimension (ka), intent(in)  pres,
real(rp), dimension (ka), intent(in)  qdry,
real(rp), dimension(ka), intent(out)  dqsat_dT,
real(rp), dimension(ka), intent(out)  dqsat_dP 
)

Definition at line 2295 of file scale_atmos_saturation.F90.

2295  !$acc routine vector
2296  implicit none
2297  integer, intent(in) :: KA, KS, KE
2298 
2299  real(RP), intent(in) :: temp (KA)
2300  real(RP), intent(in) :: pres (KA)
2301  real(RP), intent(in) :: qdry (KA)
2302 
2303  real(RP), intent(out) :: dqsat_dT(KA)
2304  real(RP), intent(out) :: dqsat_dP(KA)
2305 
2306  integer :: k
2307  !---------------------------------------------------------------------------
2308 
2309  do k = ks, ke
2310  call atmos_saturation_dqs_dtem_dpre_ice( temp(k), pres(k), qdry(k), & ! [IN]
2311  dqsat_dt(k), dqsat_dp(k) ) ! [OUT]
2312  enddo
2313 
2314  return

References scale_const::const_undef.

◆ 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 2481 of file scale_atmos_saturation.F90.

2481  !$acc routine vector
2482  integer, intent(in) :: KA, KS, KE
2483 
2484  real(RP), intent(in) :: DENS(KA)
2485  real(RP), intent(in) :: TEMP(KA)
2486  real(RP), intent(in) :: QV (KA)
2487 
2488  real(RP), intent(out) :: Tdew(KA)
2489  logical, intent(out) :: converged
2490 
2491  integer :: k
2492  !---------------------------------------------------------------------------
2493 
2494  do k = ks, ke
2495  call atmos_saturation_tdew_liq_0d( dens(k), temp(k), qv(k), & ! [IN]
2496  tdew(k), converged ) ! [OUT]
2497  if ( .not. converged ) exit
2498  end do
2499 

References scale_prc::prc_abort().

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_L) 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 2561 of file scale_atmos_saturation.F90.

2561  !$acc routine
2562  use scale_const, only: &
2563  rdry => const_rdry, &
2564  cpdry => const_cpdry
2565  use scale_atmos_hydrometeor, only: &
2566  atmos_hydrometeor_lhv
2567  real(RP), intent(in) :: DENS
2568  real(RP), intent(in) :: POTT
2569  real(RP), intent(in) :: TEMP
2570  real(RP), intent(in) :: QV
2571 
2572  real(RP), intent(out) :: POTE
2573 
2574  real(RP) :: TL
2575  real(RP) :: Pv
2576  real(RP) :: LHV
2577 
2578  pv = dens * qv * rvap * temp
2579  tl = 55.0_rp + 2840.0_rp / ( cpdry / rdry * log(temp) - log(pv) - 4.805_rp )
2580  call atmos_hydrometeor_lhv( temp, lhv ) ! [IN], [OUT]
2581 
2582  pote = pott * exp( lhv * qv / ( cpdry * tl ) &
2583  * 1.0784_rp * ( 1.0_rp + 0.810_rp * qv ) )
2584 
2585  return

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

Referenced by atmos_saturation_pote_1d().

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 2593 of file scale_atmos_saturation.F90.

2593  !$acc routine vector
2594  integer, intent(in) :: KA, KS, KE
2595 
2596  real(RP), intent(in) :: DENS(KA)
2597  real(RP), intent(in) :: POTT(KA)
2598  real(RP), intent(in) :: TEMP(KA)
2599  real(RP), intent(in) :: QV (KA)
2600 
2601  real(RP), intent(out) :: POTE(KA)
2602 
2603  integer :: k
2604 
2605  do k = ks, ke
2606  call atmos_saturation_pote_0d( dens(k), pott(k), temp(k), qv(k), & ! [IN]
2607  pote(k) ) ! [OUT]
2608  end do
2609 
2610  return

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, and scale_atmos_hydrometeor::lhv.

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 2770 of file scale_atmos_saturation.F90.

2770  !$acc routine
2771  use scale_atmos_hydrometeor, only: &
2772  cp_vapor, &
2773  cp_water, &
2774  cp_ice, &
2775  cv_vapor, &
2776  cv_water, &
2777  cv_ice, &
2778  lhv, &
2779  lhf
2780  implicit none
2781  real(RP), intent(in) :: DENS
2782  real(RP), intent(in) :: Emoist0
2783 
2784  real(RP), intent(inout) :: TEMP
2785  real(RP), intent(inout) :: QV
2786  real(RP), intent(inout) :: QC
2787  real(RP), intent(inout) :: QI
2788  real(RP), intent(inout) :: CPtot
2789  real(RP), intent(inout) :: CVtot
2790 
2791  logical, intent(out) :: converged
2792 
2793  ! working
2794  real(RP) :: QSUM
2795  real(RP) :: TEMP0
2796  real(RP) :: QV0, QC0, QI0
2797  real(RP) :: CPtot0, CVtot0
2798  real(RP) :: alpha
2799  real(RP) :: qsat
2800  real(RP) :: Emoist ! moist internal energy
2801 
2802  ! d(X)/dT
2803  real(RP) :: dalpha_dT
2804  real(RP) :: dqsat_dT
2805  real(RP) :: dqc_dT, dqi_dT
2806  real(RP) :: dCVtot_dT
2807  real(RP) :: dEmoist_dT
2808  real(RP) :: dtemp
2809 
2810  integer, parameter :: itelim = 100
2811  real(RP), parameter :: dtemp_criteria = 0.1_rp**(2+rp/2)
2812  integer :: ite
2813  !---------------------------------------------------------------------------
2814 
2815  temp0 = temp
2816  cptot0 = cptot
2817  cvtot0 = cvtot
2818  qv0 = qv
2819  qc0 = qc
2820  qi0 = qi
2821  qsum = qv + qc + qi
2822 
2823  ! Check if saturation condition would not be met after evaporating all cloud water and ice virtually.
2824  qv = qsum
2825  qc = 0.0_rp
2826  qi = 0.0_rp
2827  cptot = cptot0 + qc0 * ( cp_vapor - cp_water ) + qi0 * ( cp_vapor - cp_ice )
2828  cvtot = cvtot0 + qc0 * ( cv_vapor - cv_water ) + qi0 * ( cv_vapor - cv_ice )
2829  temp = ( emoist0 - lhv * qv ) / cvtot
2830 
2831  call atmos_saturation_dens2qsat_all( temp, dens, & ! [IN]
2832  qsat ) ! [OUT]
2833 
2834  if ( qsum <= qsat ) then
2835  converged = .true.
2836  return
2837  end if
2838 
2839  ! Iteration
2840  qv = qv0
2841  qc = qc0
2842  qi = qi0
2843  temp = temp0
2844  cptot = cptot0
2845  cvtot = cvtot0
2846 
2847  converged = .false.
2848  !$acc loop seq
2849  do ite = 1, itelim
2850 
2851  ! dX/dT
2852  call atmos_saturation_dqs_dtem_dens_all_0d( temp, dens, & ! [IN]
2853  dqsat_dt, & ! [OUT]
2854  qsat=qsat, alpha=alpha ) ! [OUT]
2855  call atmos_saturation_dalphadt( temp, dalpha_dt ) ! [IN], [OUT]
2856 
2857  dqc_dt = ( qsum - qv ) * dalpha_dt - dqsat_dt * ( alpha )
2858  dqi_dt = -( qsum - qv ) * dalpha_dt - dqsat_dt * ( 1.0_rp-alpha )
2859 
2860  dcvtot_dt = dqsat_dt * cv_vapor &
2861  + dqc_dt * cv_water &
2862  + dqi_dt * cv_ice
2863 
2864  demoist_dt = temp * dcvtot_dt + cvtot + dqsat_dt * lhv - dqi_dt * lhf
2865 
2866  ! Saturation
2867  qv = qsat
2868  qc = ( qsum - qsat ) * ( alpha )
2869  qi = ( qsum - qsat ) * ( 1.0_rp - alpha )
2870 
2871  cvtot = cvtot0 &
2872  + cv_vapor * ( qv - qv0 ) &
2873  + cv_water * ( qc - qc0 ) &
2874  + cv_ice * ( qi - qi0 )
2875 
2876 
2877 ! Emoist = temp * CVtot + qv * LHV - qi * LHF
2878  emoist = temp * cvtot + qsat * lhv - qi * lhf
2879 
2880  ! update temp by the newtonian method
2881  dtemp = ( emoist - emoist0 ) / demoist_dt
2882  temp = temp - dtemp
2883 
2884  if ( abs(dtemp) < dtemp_criteria ) then
2885  converged = .true.
2886  exit
2887  endif
2888 
2889  if( temp*0.0_rp /= 0.0_rp ) exit
2890  enddo
2891 
2892  cptot = cptot &
2893  + cp_vapor * ( qv - qv0 ) &
2894  + cp_water * ( qc - qc0 ) &
2895  + cp_ice * ( qi - qi0 )
2896 
2897  return

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, and scale_atmos_hydrometeor::lhv.

◆ 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 2909 of file scale_atmos_saturation.F90.

2909  !$acc routine
2910  use scale_const, only: &
2911  eps => const_eps, &
2912  lhv0 => const_lhv0
2913  use scale_atmos_hydrometeor, only: &
2914  atmos_hydrometeor_entr, &
2915  atmos_hydrometeor_entr2temp, &
2916  cp_vapor, &
2917  cp_water
2918 
2919  real(RP), intent(in) :: PRES
2920  real(RP), intent(in) :: ENTR
2921  real(RP), intent(in) :: Qdry
2922 
2923  real(RP), intent(inout) :: QV
2924  real(RP), intent(inout) :: QC
2925  real(RP), intent(inout) :: CPtot
2926  real(RP), intent(inout) :: Rtot
2927 
2928  real(RP), intent(out) :: TEMP
2929  logical, intent(out) :: converged
2930 
2931  real(RP), parameter :: TEMMIN = 0.1_rp
2932  real(RP), parameter :: criteria = 1.e-8_rp
2933  integer, parameter :: itelim = 100
2934  integer :: ite
2935 
2936  real(RP) :: Qsum
2937  real(RP) :: qsat, psat
2938 
2939  real(RP) :: TEMP_ite
2940  real(RP) :: QV_ite
2941  real(RP) :: ENTR_ite
2942  real(RP) :: Rtot_ite
2943  real(RP) :: CPtot_ite
2944 
2945  real(RP) :: dqsat_dT, dqsat_dP
2946 
2947  real(RP) :: TEMP_prev
2948  real(RP) :: dENTR_dT
2949  !---------------------------------------------------------------------------
2950 
2951  qsum = qv + qc
2952 
2953  ! all liquid evaporates
2954  rtot = rtot + qc * rvap
2955  cptot = cptot + qc * ( cp_vapor - cp_water )
2956  qv = qsum
2957  qc = 0.0_rp
2958 
2959  call atmos_hydrometeor_entr2temp( entr, pres, qsum, 0.0_rp, qdry, & ! [IN]
2960  rtot, cptot, & ! [IN]
2961  temp ) ! [OUT]
2962 
2963  call atmos_saturation_pres2qsat_liq( temp, pres, qdry, & ! [IN]
2964  qsat ) ! [OUT]
2965  if ( qsum <= qsat ) then
2966  ! unsaturated
2967 
2968  converged = .true.
2969 
2970  return
2971 
2972  else
2973  ! saturated
2974 
2975  temp_ite = temp
2976 
2977  !$acc loop seq
2978  do ite = 1, itelim
2979 
2980  call atmos_saturation_dqs_dtem_dpre_liq_0d( temp_ite, pres, qdry, & ! [IN]
2981  dqsat_dt, dqsat_dp, & ! [OUT]
2982  qsat=qsat, psat=psat ) ! [OUT]
2983 
2984  qv_ite = min( qsum, qsat )
2985 
2986  rtot_ite = rtot - ( qsum - qv_ite ) * rvap
2987  cptot_ite = cptot - ( qsum - qv_ite ) * ( cp_vapor - cp_water )
2988 
2989  dentr_dt = cptot_ite / temp_ite &
2990  + ( ( cp_vapor - cp_water ) * log( temp_ite / tem00 ) &
2991  - rvap * log( psat/ psat0 ) &
2992  + lhv0 / tem00 &
2993  ) * dqsat_dt
2994 
2995  call atmos_hydrometeor_entr( temp_ite, pres, & ! [IN]
2996  qv_ite, 0.0_rp, qdry, & ! [IN] ! QI = 0
2997  rtot_ite, cptot_ite, & ! [IN]
2998  entr_ite ) ! [OUT]
2999 
3000  temp_prev = temp_ite
3001  temp_ite = temp_ite - ( entr_ite - entr ) / max( dentr_dt, eps )
3002  temp_ite = max( temp_ite, temmin )
3003 
3004  if( abs(temp_ite-temp_prev) < criteria ) then
3005  converged = .true.
3006  exit
3007  end if
3008 
3009  enddo
3010 
3011  end if
3012 
3013  qv = qv_ite
3014  qc = qsum - qv
3015  cptot = cptot_ite
3016  rtot = rtot_ite
3017  temp = temp_ite
3018 
3019  return

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

scale_const::const_lhv0
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
Definition: scale_const.F90:82
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_atmos_hydrometeor::cp_water
real(rp), public cp_water
CP for water [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:152
scale_const::const_lhs00
real(rp), public const_lhs00
latent heat of sublimation at 0K [J/kg]
Definition: scale_const.F90:85
scale_const::const_lhv00
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
Definition: scale_const.F90:83
scale_const::const_eps
real(rp), public const_eps
small number
Definition: scale_const.F90:35
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
scale_const::const_thermodyn_type
character(len=h_short), public const_thermodyn_type
internal energy type
Definition: scale_const.F90:111
scale_const::const_cpvap
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
Definition: scale_const.F90:69
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_atmos_hydrometeor::cv_vapor
real(rp), public cv_vapor
CV for vapor [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:149
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_const::const_cpdry
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:60
scale_const::const_ci
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
Definition: scale_const.F90:72
scale_const::const_cl
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:71
scale_const::const_cvvap
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
Definition: scale_const.F90:70
scale_atmos_hydrometeor::lhf
real(rp), public lhf
latent heat of fusion for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:146
scale_const::const_rdry
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:59
scale_const::const_lhs0
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
Definition: scale_const.F90:84
scale_atmos_hydrometeor::atmos_hydrometeor_setup
subroutine, public atmos_hydrometeor_setup
Setup.
Definition: scale_atmos_hydrometeor.F90:176
scale_atmos_hydrometeor::cp_vapor
real(rp), public cp_vapor
CP for vapor [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:150
scale_atmos_hydrometeor::cv_water
real(rp), public cv_water
CV for water [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:151
scale_atmos_hydrometeor::cv_ice
real(rp), public cv_ice
CV for ice [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:153
scale_atmos_hydrometeor::cp_ice
real(rp), public cp_ice
CP for ice [J/kg/K].
Definition: scale_atmos_hydrometeor.F90:154