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 real(
rp) :: ei0 (1+nl+ni)
258 logical :: mass (1+nl+ni)
259 logical :: advc_(1+nl+ni)
266 log_error(
"ATMOS_HYDROMETEOR_regist",*)
'tracer for hydrometeor is already registerd'
301 if (
present(advc) )
then
352 real(RP),
intent(in) :: temp
353 real(RP),
intent(out) :: lhv
368 integer,
intent(in) :: KA, KS, KE
370 real(RP),
intent(in) :: temp(KA)
372 real(RP),
intent(out) :: lhv (KA)
385 subroutine atmos_hydrometeor_lhv_2d( &
386 IA, IS, IE, JA, JS, JE, &
390 integer,
intent(in) :: IA, IS, IE
391 integer,
intent(in) :: JA, JS, JE
393 real(RP),
intent(in) :: temp(IA,JA)
394 real(RP),
intent(out) :: lhv (IA,JA)
407 end subroutine atmos_hydrometeor_lhv_2d
410 subroutine atmos_hydrometeor_lhv_3d( &
417 integer,
intent(in) :: KA, KS, KE
418 integer,
intent(in) :: IA, IS, IE
419 integer,
intent(in) :: JA, JS, JE
421 real(RP),
intent(in) :: temp(KA,IA,JA)
422 real(RP),
intent(out) :: lhv (KA,IA,JA)
436 end subroutine atmos_hydrometeor_lhv_3d
439 subroutine atmos_hydrometeor_lhs_0d( &
446 real(RP),
intent(in) :: temp
447 real(RP),
intent(out) :: lhs
450 lhs = lhs0 + (
cp_vapor -
cp_ice ) * ( temp - tem00 ) * thermodyn_emask
453 end subroutine atmos_hydrometeor_lhs_0d
462 integer,
intent(in) :: KA, KS, KE
464 real(RP),
intent(in) :: temp(KA)
466 real(RP),
intent(out) :: lhs (KA)
472 call atmos_hydrometeor_lhs( temp(k), lhs(k) )
479 subroutine atmos_hydrometeor_lhs_2d( &
480 IA, IS, IE, JA, JS, JE, &
484 integer,
intent(in) :: IA, IS, IE
485 integer,
intent(in) :: JA, JS, JE
487 real(RP),
intent(in) :: temp(IA,JA)
488 real(RP),
intent(out) :: lhs (IA,JA)
496 call atmos_hydrometeor_lhs( temp(i,j), lhs(i,j) )
501 end subroutine atmos_hydrometeor_lhs_2d
504 subroutine atmos_hydrometeor_lhs_3d( &
505 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
510 integer,
intent(in) :: KA, KS, KE
511 integer,
intent(in) :: IA, IS, IE
512 integer,
intent(in) :: JA, JS, JE
514 real(RP),
intent(in) :: temp(KA,IA,JA)
515 real(RP),
intent(out) :: lhs (KA,IA,JA)
524 call atmos_hydrometeor_lhs( temp(k,i,j), lhs(k,i,j) )
530 end subroutine atmos_hydrometeor_lhs_3d
533 subroutine atmos_hydrometeor_lhf_0d( &
540 real(RP),
intent(in) :: temp
541 real(RP),
intent(out) :: lhf
544 lhf = lhf0 + (
cp_water -
cp_ice ) * ( temp - tem00 ) * thermodyn_emask
547 end subroutine atmos_hydrometeor_lhf_0d
556 integer,
intent(in) :: KA, KS, KE
558 real(RP),
intent(in) :: temp(KA)
559 real(RP),
intent(out) :: lhf (KA)
565 call atmos_hydrometeor_lhf( temp(k), lhf(k) )
572 subroutine atmos_hydrometeor_lhf_2d( &
573 IA, IS, IE, JA, JS, JE, &
577 integer,
intent(in) :: IA, IS, IE
578 integer,
intent(in) :: JA, JS, JE
580 real(RP),
intent(in) :: temp(IA,JA)
581 real(RP),
intent(out) :: lhf (IA,JA)
589 call atmos_hydrometeor_lhf( temp(i,j), lhf(i,j) )
594 end subroutine atmos_hydrometeor_lhf_2d
597 subroutine atmos_hydrometeor_lhf_3d( &
604 integer,
intent(in) :: KA, KS, KE
605 integer,
intent(in) :: IA, IS, IE
606 integer,
intent(in) :: JA, JS, JE
608 real(RP),
intent(in) :: temp(KA,IA,JA)
609 real(RP),
intent(out) :: lhf (KA,IA,JA)
618 call atmos_hydrometeor_lhf( temp(k,i,j), lhf(k,i,j) )
624 end subroutine atmos_hydrometeor_lhf_3d
628 subroutine atmos_hydrometeor_entr_0d( &
643 real(RP),
intent(in) :: TEMP
644 real(RP),
intent(in) :: PRES
645 real(RP),
intent(in) :: QV
646 real(RP),
intent(in) :: QI
647 real(RP),
intent(in) :: Qdry
648 real(RP),
intent(in) :: Rtot
649 real(RP),
intent(in) :: CPtot
651 real(RP),
intent(out) :: entr
653 real(RP) :: pres_dry, pres_vap
656 pres_dry = pres * qdry * rdry / rtot
657 pres_vap = pres * qv * rvap / rtot
659 entr = cptot * log( temp / tem00 ) &
660 - qdry * rdry * log( pres_dry / pre00 ) &
661 - qv * rvap * log( pres_vap / psat0 ) &
662 + ( qv * lhv0 - qi * lhf0 ) / tem00
665 end subroutine atmos_hydrometeor_entr_0d
670 IA, IS, IE, JA, JS, JE, &
676 integer,
intent(in) :: IA, IS, IE
677 integer,
intent(in) :: JA, JS, JE
679 real(RP),
intent(in) :: TEMP (IA,JA)
680 real(RP),
intent(in) :: PRES (IA,JA)
681 real(RP),
intent(in) :: QV (IA,JA)
682 real(RP),
intent(in) :: QI (IA,JA)
683 real(RP),
intent(in) :: Qdry (IA,JA)
684 real(RP),
intent(in) :: Rtot (IA,JA)
685 real(RP),
intent(in) :: CPtot(IA,JA)
687 real(RP),
intent(out) :: entr(IA,JA)
695 call atmos_hydrometeor_entr_0d( &
696 temp(i,j), pres(i,j), &
697 qv(i,j), qi(i,j), qdry(i,j), &
698 rtot(i,j), cptot(i,j), &
707 subroutine atmos_hydrometeor_entr_3d( &
708 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
714 integer,
intent(in) :: KA, KS, KE
715 integer,
intent(in) :: IA, IS, IE
716 integer,
intent(in) :: JA, JS, JE
718 real(RP),
intent(in) :: TEMP (KA,IA,JA)
719 real(RP),
intent(in) :: PRES (KA,IA,JA)
720 real(RP),
intent(in) :: QV (KA,IA,JA)
721 real(RP),
intent(in) :: QI (KA,IA,JA)
722 real(RP),
intent(in) :: Qdry (KA,IA,JA)
723 real(RP),
intent(in) :: Rtot (KA,IA,JA)
724 real(RP),
intent(in) :: CPtot(KA,IA,JA)
726 real(RP),
intent(out) :: entr(KA,IA,JA)
735 call atmos_hydrometeor_entr_0d( &
736 temp(k,i,j), pres(k,i,j), &
737 qv(k,i,j), qi(k,i,j), qdry(k,i,j), &
738 rtot(k,i,j), cptot(k,i,j), &
745 end subroutine atmos_hydrometeor_entr_3d
749 subroutine atmos_hydrometeor_entr2temp_0d( &
764 real(RP),
intent(in) :: entr
765 real(RP),
intent(in) :: pres
766 real(RP),
intent(in) :: qv
767 real(RP),
intent(in) :: qi
768 real(RP),
intent(in) :: qdry
769 real(RP),
intent(in) :: Rtot
770 real(RP),
intent(in) :: CPtot
772 real(RP),
intent(out) :: temp
774 real(RP) :: pres_dry, pres_vap
777 pres_dry = pres * qdry * rdry / rtot
778 pres_vap = pres * qv * rvap / rtot
782 + qdry * rdry * log( pres_dry / pre00 ) &
783 + qv * rvap * log( pres_vap / psat0 ) &
784 - ( qv * lhv0 - qi * lhf0 ) / tem00 ) / cptot )
786 end subroutine atmos_hydrometeor_entr2temp_0d