29 public :: atmos_hydrometeor_lhv
30 public :: atmos_hydrometeor_lhs
31 public :: atmos_hydrometeor_lhf
32 public :: atmos_hydrometeor_entr
33 public :: atmos_hydrometeor_entr2temp
39 interface atmos_hydrometeor_lhv
42 module procedure atmos_hydrometeor_lhv_2d
43 module procedure atmos_hydrometeor_lhv_3d
44 end interface atmos_hydrometeor_lhv
46 interface atmos_hydrometeor_lhs
47 module procedure atmos_hydrometeor_lhs_0d
49 module procedure atmos_hydrometeor_lhs_2d
50 module procedure atmos_hydrometeor_lhs_3d
51 end interface atmos_hydrometeor_lhs
53 interface atmos_hydrometeor_lhf
54 module procedure atmos_hydrometeor_lhf_0d
56 module procedure atmos_hydrometeor_lhf_2d
57 module procedure atmos_hydrometeor_lhf_3d
58 end interface atmos_hydrometeor_lhf
60 interface atmos_hydrometeor_entr
61 module procedure atmos_hydrometeor_entr_0d
63 module procedure atmos_hydrometeor_entr_3d
64 end interface atmos_hydrometeor_entr
66 interface atmos_hydrometeor_entr2temp
67 module procedure atmos_hydrometeor_entr2temp_0d
68 end interface atmos_hydrometeor_entr2temp
77 integer,
public ::
i_qv = -1
79 integer,
public,
parameter ::
n_hyd = 6
81 integer,
public,
parameter ::
i_hc = 1
82 integer,
public,
parameter ::
i_hr = 2
83 integer,
public,
parameter ::
i_hi = 3
84 integer,
public,
parameter ::
i_hs = 4
85 integer,
public,
parameter ::
i_hg = 5
86 integer,
public,
parameter ::
i_hh = 6
89 (/
"QC",
"QR",
"QI",
"QS",
"QG",
"QH" /)
91 (/
"cloud ",
"rain ",
"ice water",
"snow ",
"graupel ",
"hail " /)
93 (/
"NC",
"NR",
"NI",
"NS",
"NG",
"NH" /)
114 integer,
public ::
qha = 0
115 integer,
public ::
qhs = -1
116 integer,
public ::
qhe = -2
118 integer,
public ::
qla = 0
119 integer,
public ::
qls = -1
120 integer,
public ::
qle = -2
122 integer,
public ::
qia = 0
123 integer,
public ::
qis = -1
124 integer,
public ::
qie = -2
145 real(RP),
private :: thermodyn_emask = 1.0_rp
147 logical,
private :: initialized = .false.
174 if ( initialized )
return 180 log_info(
"ATMOS_HYDROMETEOR_setup",*)
'Setup' 182 if ( thermodyn_type ==
'EXACT' )
then 194 thermodyn_emask = 1.0_rp
196 elseif( thermodyn_type ==
'SIMPLE' )
then 208 thermodyn_emask = 0.0_rp
211 log_error(
"ATMOS_HYDROMETEOR_setup",*)
'Not appropriate ATMOS_THERMODYN_ENERGY_TYPE. Check!', trim(thermodyn_type)
244 integer,
intent(in) :: NL
245 integer,
intent(in) :: NI
246 character(len=*),
intent(in) :: NAME(1+nl+ni)
247 character(len=*),
intent(in) :: DESC(1+nl+ni)
248 character(len=*),
intent(in) :: UNIT(1+nl+ni)
250 integer,
intent(out) :: Q0
252 logical,
intent(in),
optional :: ADVC(1+nl+ni)
254 real(RP) :: CV (1+nl+ni)
255 real(RP) :: CP (1+nl+ni)
256 real(RP) :: R (1+nl+ni)
257 logical :: MASS (1+nl+ni)
258 logical :: ADVC_(1+nl+ni)
265 log_error(
"ATMOS_HYDROMETEOR_regist",*)
'tracer for hydrometeor is already registerd' 297 if (
present(advc) )
then 348 real(RP),
intent(in) :: temp
349 real(RP),
intent(out) :: lhv
364 integer,
intent(in) :: KA, KS, KE
366 real(RP),
intent(in) :: temp(ka)
368 real(RP),
intent(out) :: lhv (ka)
381 subroutine atmos_hydrometeor_lhv_2d( &
382 IA, IS, IE, JA, JS, JE, &
386 integer,
intent(in) :: IA, IS, IE
387 integer,
intent(in) :: JA, JS, JE
389 real(RP),
intent(in) :: temp(ia,ja)
390 real(RP),
intent(out) :: lhv (ia,ja)
403 end subroutine atmos_hydrometeor_lhv_2d
406 subroutine atmos_hydrometeor_lhv_3d( &
413 integer,
intent(in) :: KA, KS, KE
414 integer,
intent(in) :: IA, IS, IE
415 integer,
intent(in) :: JA, JS, JE
417 real(RP),
intent(in) :: temp(ka,ia,ja)
418 real(RP),
intent(out) :: lhv (ka,ia,ja)
432 end subroutine atmos_hydrometeor_lhv_3d
435 subroutine atmos_hydrometeor_lhs_0d( &
442 real(RP),
intent(in) :: temp
443 real(RP),
intent(out) :: lhs
446 lhs = lhs0 + (
cp_vapor -
cp_ice ) * ( temp - tem00 ) * thermodyn_emask
449 end subroutine atmos_hydrometeor_lhs_0d
458 integer,
intent(in) :: KA, KS, KE
460 real(RP),
intent(in) :: temp(ka)
462 real(RP),
intent(out) :: lhs (ka)
468 call atmos_hydrometeor_lhs( temp(k), lhs(k) )
475 subroutine atmos_hydrometeor_lhs_2d( &
476 IA, IS, IE, JA, JS, JE, &
480 integer,
intent(in) :: IA, IS, IE
481 integer,
intent(in) :: JA, JS, JE
483 real(RP),
intent(in) :: temp(ia,ja)
484 real(RP),
intent(out) :: lhs (ia,ja)
492 call atmos_hydrometeor_lhs( temp(i,j), lhs(i,j) )
497 end subroutine atmos_hydrometeor_lhs_2d
500 subroutine atmos_hydrometeor_lhs_3d( &
501 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
506 integer,
intent(in) :: KA, KS, KE
507 integer,
intent(in) :: IA, IS, IE
508 integer,
intent(in) :: JA, JS, JE
510 real(RP),
intent(in) :: temp(ka,ia,ja)
511 real(RP),
intent(out) :: lhs (ka,ia,ja)
520 call atmos_hydrometeor_lhs( temp(k,i,j), lhs(k,i,j) )
526 end subroutine atmos_hydrometeor_lhs_3d
529 subroutine atmos_hydrometeor_lhf_0d( &
536 real(RP),
intent(in) :: temp
537 real(RP),
intent(out) :: lhf
540 lhf = lhf0 + (
cp_water -
cp_ice ) * ( temp - tem00 ) * thermodyn_emask
543 end subroutine atmos_hydrometeor_lhf_0d
552 integer,
intent(in) :: KA, KS, KE
554 real(RP),
intent(in) :: temp(ka)
555 real(RP),
intent(out) :: lhf (ka)
561 call atmos_hydrometeor_lhf( temp(k), lhf(k) )
568 subroutine atmos_hydrometeor_lhf_2d( &
569 IA, IS, IE, JA, JS, JE, &
573 integer,
intent(in) :: IA, IS, IE
574 integer,
intent(in) :: JA, JS, JE
576 real(RP),
intent(in) :: temp(ia,ja)
577 real(RP),
intent(out) :: lhf (ia,ja)
585 call atmos_hydrometeor_lhf( temp(i,j), lhf(i,j) )
590 end subroutine atmos_hydrometeor_lhf_2d
593 subroutine atmos_hydrometeor_lhf_3d( &
600 integer,
intent(in) :: KA, KS, KE
601 integer,
intent(in) :: IA, IS, IE
602 integer,
intent(in) :: JA, JS, JE
604 real(RP),
intent(in) :: temp(ka,ia,ja)
605 real(RP),
intent(out) :: lhf (ka,ia,ja)
614 call atmos_hydrometeor_lhf( temp(k,i,j), lhf(k,i,j) )
620 end subroutine atmos_hydrometeor_lhf_3d
624 subroutine atmos_hydrometeor_entr_0d( &
639 real(RP),
intent(in) :: TEMP
640 real(RP),
intent(in) :: PRES
641 real(RP),
intent(in) :: QV
642 real(RP),
intent(in) :: QI
643 real(RP),
intent(in) :: Qdry
644 real(RP),
intent(in) :: Rtot
645 real(RP),
intent(in) :: CPtot
647 real(RP),
intent(out) :: entr
649 real(RP) :: pres_dry, pres_vap
652 pres_dry = pres * qdry * rdry / rtot
653 pres_vap = pres * qv * rvap / rtot
655 entr = cptot * log( temp / tem00 ) &
656 - qdry * rdry * log( pres_dry / pre00 ) &
657 - qv * rvap * log( pres_vap / psat0 ) &
658 + ( qv * lhv0 - qi * lhf0 ) / tem00
661 end subroutine atmos_hydrometeor_entr_0d
666 IA, IS, IE, JA, JS, JE, &
672 integer,
intent(in) :: IA, IS, IE
673 integer,
intent(in) :: JA, JS, JE
675 real(RP),
intent(in) :: TEMP (ia,ja)
676 real(RP),
intent(in) :: PRES (ia,ja)
677 real(RP),
intent(in) :: QV (ia,ja)
678 real(RP),
intent(in) :: QI (ia,ja)
679 real(RP),
intent(in) :: Qdry (ia,ja)
680 real(RP),
intent(in) :: Rtot (ia,ja)
681 real(RP),
intent(in) :: CPtot(ia,ja)
683 real(RP),
intent(out) :: entr(ia,ja)
691 call atmos_hydrometeor_entr_0d( &
692 temp(i,j), pres(i,j), &
693 qv(i,j), qi(i,j), qdry(i,j), &
694 rtot(i,j), cptot(i,j), &
703 subroutine atmos_hydrometeor_entr_3d( &
704 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
710 integer,
intent(in) :: KA, KS, KE
711 integer,
intent(in) :: IA, IS, IE
712 integer,
intent(in) :: JA, JS, JE
714 real(RP),
intent(in) :: TEMP (ka,ia,ja)
715 real(RP),
intent(in) :: PRES (ka,ia,ja)
716 real(RP),
intent(in) :: QV (ka,ia,ja)
717 real(RP),
intent(in) :: QI (ka,ia,ja)
718 real(RP),
intent(in) :: Qdry (ka,ia,ja)
719 real(RP),
intent(in) :: Rtot (ka,ia,ja)
720 real(RP),
intent(in) :: CPtot(ka,ia,ja)
722 real(RP),
intent(out) :: entr(ka,ia,ja)
731 call atmos_hydrometeor_entr_0d( &
732 temp(k,i,j), pres(k,i,j), &
733 qv(k,i,j), qi(k,i,j), qdry(k,i,j), &
734 rtot(k,i,j), cptot(k,i,j), &
741 end subroutine atmos_hydrometeor_entr_3d
745 subroutine atmos_hydrometeor_entr2temp_0d( &
760 real(RP),
intent(in) :: entr
761 real(RP),
intent(in) :: pres
762 real(RP),
intent(in) :: qv
763 real(RP),
intent(in) :: qi
764 real(RP),
intent(in) :: qdry
765 real(RP),
intent(in) :: Rtot
766 real(RP),
intent(in) :: CPtot
768 real(RP),
intent(out) :: temp
770 real(RP) :: pres_dry, pres_vap
773 pres_dry = pres * qdry * rdry / rtot
774 pres_vap = pres * qv * rvap / rtot
778 + qdry * rdry * log( pres_dry / pre00 ) &
779 + qv * rvap * log( pres_vap / psat0 ) &
780 - ( qv * lhv0 - qi * lhf0 ) / tem00 ) / cptot )
782 end subroutine atmos_hydrometeor_entr2temp_0d
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
subroutine atmos_hydrometeor_lhv_1d(KA, KS, KE, temp, lhv)
subroutine atmos_hydrometeor_lhf_1d(KA, KS, KE, temp, lhf)
real(rp), public cv_ice
CV for ice [J/kg/K].
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
real(rp), parameter, public const_dwatr
density of water [kg/m3]
real(rp), public cp_ice
CP for ice [J/kg/K].
integer, parameter, public i_hs
snow
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
integer, parameter, public i_hr
liquid water rain
integer, parameter, public i_hi
ice water cloud
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
subroutine atmos_hydrometeor_entr_2d(IA, IS, IE, JA, JS, JE, TEMP, PRES, QV, QI, Qdry, Rtot, CPtot, entr)
calc temp, pres, q -> entropy (2D)
integer, parameter, public i_hh
hail
real(rp), public const_lhf0
latent heat of fusion at 0C [J/kg]
real(rp), parameter, public const_dice
density of ice [kg/m3]
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), parameter, public const_lhs0
latent heat of sublimation at 0C [J/kg]
real(rp), public cv_vapor
CV for vapor [J/kg/K].
logical, public atmos_hydrometeor_dry
subroutine atmos_hydrometeor_lhs_1d(KA, KS, KE, temp, lhs)
module atmosphere / hydrometeor
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
real(rp), public const_pre00
pressure reference [Pa]
subroutine, public const_setup
Setup.
real(rp), public const_lhf00
latent heat of fusion at 0K [J/kg]
real(rp), public const_lhs00
latent heat of sublimation at 0K [J/kg]
real(rp), public const_lhv00
latent heat of vaporizaion at 0K [J/kg]
logical, public atmos_hydrometeor_ice_phase
real(rp), public lhf
latent heat of fusion for use [J/kg]
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
subroutine, public prc_abort
Abort Process.
real(rp), public lhv
latent heat of vaporization for use [J/kg]
real(rp), public lhs
latent heat of sublimation for use [J/kg]
integer, parameter, public i_hc
liquid water cloud
subroutine atmos_hydrometeor_lhv_0d(temp, lhv)
subroutine, public atmos_hydrometeor_regist(NL, NI, NAME, DESC, UNIT, Q0, ADVC)
ATMOS_HYDROMETEOR_regist Regist tracer.
subroutine, public atmos_hydrometeor_setup
Setup.
real(rp), dimension(n_hyd), public hyd_dens
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ADVC, MASS)
Regist tracer.
character(len=h_short), dimension(n_hyd), parameter, public num_name
integer, parameter, public n_hyd
character(len=h_mid), dimension(n_hyd), parameter, public hyd_desc
real(rp), parameter, public const_cpvap
specific heat (water vapor, constant pressure) [J/kg/K]
character(len=h_short), public const_thermodyn_type
internal energy type
real(rp), public cp_vapor
CP for vapor [J/kg/K].
real(rp), public cp_water
CP for water [J/kg/K].
integer, parameter, public i_hg
graupel
real(rp), public cv_water
CV for water [J/kg/K].