31 public :: atmos_hydrometeor_lhv
32 public :: atmos_hydrometeor_lhs
33 public :: atmos_hydrometeor_lhf
34 public :: atmos_hydrometeor_entr
37 interface atmos_hydrometeor_lhv
42 end interface atmos_hydrometeor_lhv
44 interface atmos_hydrometeor_lhs
49 end interface atmos_hydrometeor_lhs
51 interface atmos_hydrometeor_lhf
56 end interface atmos_hydrometeor_lhf
58 interface atmos_hydrometeor_entr
62 end interface atmos_hydrometeor_entr
68 integer,
public ::
i_qv = -1
70 integer,
public,
parameter ::
n_hyd = 6
72 integer,
public,
parameter ::
i_hc = 1
73 integer,
public,
parameter ::
i_hr = 2
74 integer,
public,
parameter ::
i_hi = 3
75 integer,
public,
parameter ::
i_hs = 4
76 integer,
public,
parameter ::
i_hg = 5
77 integer,
public,
parameter ::
i_hh = 6
79 integer,
public ::
i_qc = -1
80 integer,
public ::
i_qr = -1
81 integer,
public ::
i_qi = -1
82 integer,
public ::
i_qs = -1
83 integer,
public ::
i_qg = -1
84 integer,
public ::
i_qh = -1
86 integer,
public ::
i_nc = -1
87 integer,
public ::
i_nr = -1
88 integer,
public ::
i_ni = -1
89 integer,
public ::
i_ns = -1
90 integer,
public ::
i_ng = -1
91 integer,
public ::
i_nh = -1
94 integer,
public ::
qhs = -1
95 integer,
public ::
qhe = -2
97 integer,
public ::
qls = -1
98 integer,
public ::
qle = -2
100 integer,
public ::
qis = -1
101 integer,
public ::
qie = -2
115 real(RP),
private :: cv_vapor
116 real(RP),
private :: cp_vapor
117 real(RP),
private :: cv_water
118 real(RP),
private :: cp_water
119 real(RP),
private :: cv_ice
120 real(RP),
private :: cp_ice
122 real(RP),
private :: thermodyn_emask = 1.0_rp
147 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[HYDEROMETER] / Categ[ATMOS SHARE] / Origin[SCALElib]' 149 if ( thermodyn_type ==
'EXACT' )
then 161 thermodyn_emask = 1.0_rp
163 elseif( thermodyn_type ==
'SIMPLE' )
then 175 thermodyn_emask = 0.0_rp
178 write(*,*)
'xxx Not appropriate ATMOS_THERMODYN_ENERGY_TYPE. Check!', trim(thermodyn_type)
204 integer,
intent(out) :: q0
205 integer,
intent(in) :: nv
206 integer,
intent(in) :: nl
207 integer,
intent(in) :: ni
208 character(len=*),
intent(in) :: name(nv+nl+ni)
209 character(len=*),
intent(in) :: desc(nv+nl+ni)
210 character(len=*),
intent(in) :: unit(nv+nl+ni)
212 logical,
intent(in),
optional :: advc(nv+nl+ni)
214 real(RP) :: cv (nv+nl+ni)
215 real(RP) :: cp (nv+nl+ni)
216 real(RP) :: r (nv+nl+ni)
217 logical :: mass (nv+nl+ni)
218 logical :: advc_(nv+nl+ni)
225 write(*,*)
'xxx tracer for hydrometeor is already registerd' 230 write(*,*)
'xxx number of vapor must be 1 at this moment' 259 if (
present(advc) )
then 306 real(RP),
intent(out) :: lhv
307 real(RP),
intent(in) :: temp
310 lhv = lhv0 + ( cp_vapor - cp_water ) * ( temp - tem00 ) * thermodyn_emask
324 real(RP),
intent(out) :: lhv (KA)
325 real(RP),
intent(in) :: temp(KA)
331 lhv(k) = lhv0 + ( cp_vapor - cp_water ) * ( temp(k) - tem00 ) * thermodyn_emask
346 real(RP),
intent(out) :: lhv (IA,JA)
347 real(RP),
intent(in) :: temp(IA,JA)
354 lhv(i,j) = lhv0 + ( cp_vapor - cp_water ) * ( temp(i,j) - tem00 ) * thermodyn_emask
370 real(RP),
intent(out) :: lhv (KA,IA,JA)
371 real(RP),
intent(in) :: temp(KA,IA,JA)
379 lhv(k,i,j) = lhv0 + ( cp_vapor - cp_water ) * ( temp(k,i,j) - tem00 ) * thermodyn_emask
396 real(RP),
intent(out) :: lhs
397 real(RP),
intent(in) :: temp
400 lhs = lhs0 + ( cp_vapor - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
414 real(RP),
intent(out) :: lhs (KA)
415 real(RP),
intent(in) :: temp(KA)
421 lhs(k) = lhs0 + ( cp_vapor - cp_ice ) * ( temp(k) - tem00 ) * thermodyn_emask
436 real(RP),
intent(out) :: lhs (IA,JA)
437 real(RP),
intent(in) :: temp(IA,JA)
444 lhs(i,j) = lhs0 + ( cp_vapor - cp_ice ) * ( temp(i,j) - tem00 ) * thermodyn_emask
460 real(RP),
intent(out) :: lhs (KA,IA,JA)
461 real(RP),
intent(in) :: temp(KA,IA,JA)
469 lhs(k,i,j) = lhs0 + ( cp_vapor - cp_ice ) * ( temp(k,i,j) - tem00 ) * thermodyn_emask
486 real(RP),
intent(out) :: lhf
487 real(RP),
intent(in) :: temp
490 lhf = lhf0 + ( cp_water - cp_ice ) * ( temp - tem00 ) * thermodyn_emask
504 real(RP),
intent(out) :: lhf (KA)
505 real(RP),
intent(in) :: temp(KA)
511 lhf(k) = lhf0 + ( cp_water - cp_ice ) * ( temp(k) - tem00 ) * thermodyn_emask
526 real(RP),
intent(out) :: lhf (IA,JA)
527 real(RP),
intent(in) :: temp(IA,JA)
534 lhf(i,j) = lhf0 + ( cp_water - cp_ice ) * ( temp(i,j) - tem00 ) * thermodyn_emask
550 real(RP),
intent(out) :: lhf (KA,IA,JA)
551 real(RP),
intent(in) :: temp(KA,IA,JA)
559 lhf(k,i,j) = lhf0 + ( cp_water - cp_ice ) * ( temp(k,i,j) - tem00 ) * thermodyn_emask
589 real(RP),
intent(out) :: entr
590 real(RP),
intent(in) :: temp
591 real(RP),
intent(in) :: pres
592 real(RP),
intent(in) :: q(QA)
593 real(RP),
intent(in) :: Rq(QA)
595 real(RP) :: qdry, Rtot
596 real(RP) :: logT_T0, pres_dry, pres_vap
601 logt_t0 = log( temp / tem00 )
607 rtot = rtot + q(iqw) * rq(iqw)
609 rtot = rtot + rdry * qdry
612 pres_dry = max( pres * qdry * rdry / rtot, eps )
613 entr = qdry * cpdry * logt_t0 &
614 - qdry * rdry * log( pres_dry / pre00 )
617 pres_vap = max( pres * q(
i_qv) * rvap / rtot, eps )
618 entr = entr + q(
i_qv) * cp_vapor * logt_t0 &
619 - q(
i_qv) * rvap * log( pres_vap / psat0 ) &
620 + q(
i_qv) * lhv0 / tem00
626 entr = entr + q(iqw) * cp_water * logt_t0
633 entr = entr + q(iqw) * cp_ice * logt_t0 &
634 - q(iqw) * lhf0 / tem00
663 real(RP),
intent(out) :: entr(IA,JA)
664 real(RP),
intent(in) :: temp(IA,JA)
665 real(RP),
intent(in) :: pres(IA,JA)
666 real(RP),
intent(in) :: q (IA,JA,QA)
667 real(RP),
intent(in) :: Rq (QA)
669 real(RP) :: qdry, Rtot
670 real(RP) :: logT_T0, pres_dry, pres_vap
679 logt_t0 = log( temp(i,j) / tem00 )
684 qdry = qdry - q(i,j,iqw)
685 rtot = rtot + q(i,j,iqw) * rq(iqw)
687 rtot = rtot + rdry * qdry
690 pres_dry = max( pres(i,j) * qdry * rdry / rtot, eps )
691 entr(i,j) = qdry * cpdry * logt_t0 &
692 - qdry * rdry * log( pres_dry / pre00 )
695 pres_vap = max( pres(i,j) * q(i,j,
i_qv) * rvap / rtot, eps )
696 entr(i,j) = entr(i,j) + q(i,j,
i_qv) * cp_vapor * logt_t0 &
697 - q(i,j,
i_qv) * rvap * log( pres_vap / psat0 ) &
698 + q(i,j,
i_qv) * lhv0 / tem00
704 entr(i,j) = entr(i,j) + q(i,j,iqw) * cp_water * logt_t0
711 entr(i,j) = entr(i,j) + q(i,j,iqw) * cp_ice * logt_t0 &
712 - q(i,j,iqw) * lhf0 / tem00
744 real(RP),
intent(out) :: entr(KA,IA,JA)
745 real(RP),
intent(in) :: temp(KA,IA,JA)
746 real(RP),
intent(in) :: pres(KA,IA,JA)
747 real(RP),
intent(in) :: q (KA,IA,JA,QA)
748 real(RP),
intent(in) :: Rq (QA)
750 real(RP) :: qdry, Rtot
751 real(RP) :: logT_T0, pres_dry, pres_vap
753 integer :: k, i, j, iqw
761 logt_t0 = log( temp(k,i,j) / tem00 )
766 qdry = qdry - q(k,i,j,iqw)
767 rtot = rtot + q(k,i,j,iqw) * rq(iqw)
769 rtot = rtot + rdry * qdry
772 pres_dry = max( pres(k,i,j) * qdry * rdry / rtot, eps )
773 entr(k,i,j) = qdry * cpdry * logt_t0 &
774 - qdry * rdry * log( pres_dry / pre00 )
777 pres_vap = max( pres(k,i,j) * q(k,i,j,
i_qv) * rvap / rtot, eps )
778 entr(k,i,j) = entr(k,i,j) + q(k,i,j,
i_qv) * cp_vapor * logt_t0 &
779 - q(k,i,j,
i_qv) * rvap * log( pres_vap / psat0 ) &
780 + q(k,i,j,
i_qv) * lhv0 / tem00
786 entr(k,i,j) = entr(k,i,j) + q(k,i,j,iqw) * cp_water * logt_t0
793 entr(k,i,j) = entr(k,i,j) + q(k,i,j,iqw) * cp_ice * logt_t0 &
794 - q(k,i,j,iqw) * lhf0 / tem00
812 real(RP),
intent(inout) :: qtrc(:,:,:,:)
814 real(RP),
parameter :: dc = 20.e-6_rp
815 real(RP),
parameter :: dr = 200.e-6_rp
816 real(RP),
parameter :: di = 80.e-6_rp
817 real(RP),
parameter :: ds = 80.e-6_rp
818 real(RP),
parameter :: dg = 200.e-6_rp
819 real(RP),
parameter :: rhow = 1000.0_rp
820 real(RP),
parameter :: rhof = 100.0_rp
821 real(RP),
parameter :: rhog = 400.0_rp
822 real(RP),
parameter :: b = 3.0_rp
829 if (
i_nc > 0 ) qtrc(:,:,:,
i_nc) = qtrc(:,:,:,
i_qc) / ( (piov6*rhow) * dc**b )
830 if (
i_nr > 0 ) qtrc(:,:,:,
i_nr) = qtrc(:,:,:,
i_qr) / ( (piov6*rhow) * dr**b )
831 if (
i_ni > 0 ) qtrc(:,:,:,
i_ni) = qtrc(:,:,:,
i_qi) / ( (piov6*rhof) * di**b )
832 if (
i_ns > 0 ) qtrc(:,:,:,
i_ns) = qtrc(:,:,:,
i_qs) / ( (piov6*rhof) * ds**b )
833 if (
i_ng > 0 ) qtrc(:,:,:,
i_ng) = qtrc(:,:,:,
i_qg) / ( (piov6*rhog) * dg**b )
subroutine atmos_hydrometeor_lhv_3d(lhv, temp)
subroutine atmos_hydrometeor_lhv_2d(lhv, temp)
subroutine atmos_hydrometeor_lhs_1d(lhs, temp)
real(rp), parameter, public const_psat0
saturate pressure of water vapor at 0C [Pa]
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
subroutine atmos_hydrometeor_lhs_2d(lhs, temp)
subroutine, public prc_mpistop
Abort MPI.
real(rp), parameter, public const_ci
specific heat (ice) [J/kg/K]
logical, public io_l
output log or not? (this process)
integer, parameter, public i_hs
snow
subroutine atmos_hydrometeor_entr_3d(entr, temp, pres, q, Rq)
calc temp, pres, q -> entropy (3D)
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
integer, parameter, public i_hr
liquid water rain
subroutine atmos_hydrometeor_lhv_0d(lhv, temp)
subroutine atmos_hydrometeor_lhf_2d(lhf, temp)
integer, parameter, public i_hi
ice water cloud
integer, public ke
end point of inner domain: z, local
real(rp), parameter, public const_tem00
temperature reference (0C) [K]
subroutine atmos_hydrometeor_entr_0d(entr, temp, pres, q, Rq)
calc temp, pres, q -> entropy (0D)
real(rp), public const_cvvap
specific heat (water vapor, constant volume) [J/kg/K]
integer, parameter, public i_hh
hail
subroutine, public atmos_hydrometeor_diagnose_number_concentration(QTRC)
subroutine atmos_hydrometeor_entr_2d(entr, temp, pres, q, Rq)
calc temp, pres, q -> entropy (2D)
real(rp), public const_lhf0
latent heat of fusion at 0C [J/kg]
subroutine atmos_hydrometeor_lhf_0d(lhf, temp)
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]
subroutine atmos_hydrometeor_lhs_0d(lhs, temp)
real(rp), parameter, public const_lhv0
latent heat of vaporizaion at 0C [J/kg]
real(rp), public const_pre00
pressure reference [Pa]
real(rp), public const_lhf00
latent heat of fusion at 0K [J/kg]
subroutine atmos_hydrometeor_lhv_1d(lhv, temp)
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]
real(rp), public lhf
latent heat of fusion for use [J/kg]
subroutine atmos_hydrometeor_lhs_3d(lhs, temp)
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
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
integer, public ks
start point of inner domain: z, local
real(rp), public const_eps
small number
subroutine, public atmos_hydrometeor_setup
Setup.
subroutine, public atmos_hydrometeor_regist(Q0, NV, NL, NI, NAME, DESC, UNIT, ADVC)
Regist tracer.
real(rp), public const_pi
pi
subroutine atmos_hydrometeor_lhf_3d(lhf, temp)
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ADVC, MASS)
Regist tracer.
integer, public io_fid_log
Log file ID.
integer, parameter, public n_hyd
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
integer, parameter, public i_hg
graupel
subroutine atmos_hydrometeor_lhf_1d(lhf, temp)