4 REAL(kind(1d0)),
PARAMETER ::
k = 0.4
5 REAL(kind(1d0)),
PARAMETER ::
grav = 9.80665
8 INTEGER,
PARAMETER ::
j12 = 2
9 INTEGER,
PARAMETER ::
k75 = 3
10 INTEGER,
PARAMETER ::
b71 = 4
17 Temp_C, Press_hPa, avRh, dectime, & ! input:
18 lv_J_kg, lvS_J_kg, & ! output:
19 es_hPa, Ea_hPa, VPd_hpa, VPD_Pa, dq, dens_dry, avcp, air_dens)
26 REAL(KIND(1D0)) :: vap_dens
28 REAL(KIND(1D0)),
INTENT(in) :: &
32 REAL(KIND(1D0)),
INTENT(out) :: &
44 REAL(KIND(1D0)),
PARAMETER :: &
52 gas_ct_dry = 8.31451/0.028965, &
53 gas_ct_wv = 8.31451/0.0180153
61 ea_hpa = avrh/100*es_hpa
65 vpd_hpa = es_hpa - ea_hpa
66 vpd_pa = (es_hpa*100) - (ea_hpa*100)
71 vap_dens = (ea_hpa*100/((temp_c + 273.16)*gas_ct_wv))
74 dens_dry = ((press_hpa - ea_hpa)*100)/(gas_ct_dry*(273.16 + temp_c))
77 air_dens = (press_hpa*100)/(gas_ct_dry*(temp_c + 273.16))
83 lv_j_kg =
lat_vap(temp_c, ea_hpa, press_hpa, avcp, dectime)
86 IF (temp_c < 0.000)
THEN
92 IF (press_hpa < 900)
THEN
93 CALL errorhint(46,
'Function LUMPS_cal_AtmMoist', press_hpa, -55.55d0, -55)
112 StabilityMethod, & ! input
113 zzd, & !Active measurement height (meas. height-displac. height)
127 INTEGER,
INTENT(in) :: StabilityMethod
129 REAL(KIND(1D0)),
INTENT(in) :: zzd
130 REAL(KIND(1D0)),
INTENT(in) :: z0m
131 REAL(KIND(1D0)),
INTENT(in) :: zdm
132 REAL(KIND(1D0)),
INTENT(in) :: avU1
133 REAL(KIND(1D0)),
INTENT(in) :: Temp_C
134 REAL(KIND(1D0)),
INTENT(in) :: QH_init
135 REAL(KIND(1D0)),
INTENT(in) :: avdens
136 REAL(KIND(1D0)),
INTENT(in) :: avcp
138 REAL(KIND(1D0)),
INTENT(out) :: L_MOD
139 REAL(KIND(1D0)),
INTENT(out) :: TStar
140 REAL(KIND(1D0)),
INTENT(out) :: UStar
141 REAL(KIND(1D0)),
INTENT(out) :: zL
144 REAL(KIND(1D0)) :: G_T_K, &
152 INTEGER,
PARAMETER :: notUsedI = -55
156 LOGICAL :: debug = .false.
159 h_init = qh_init/(avdens*avcp)
161 IF (debug)
WRITE (*, *) stabilitymethod, z0m, avu1, h_init, ustar, l_mod
162 g_t_k = (
grav/(temp_c + 273.16))*
k
165 'Windspeed Ht too low relative to zdm [Stability calc]- values [z-zdm, zdm]', &
168 ustar = kuz/log(zzd/z0m)
169 IF (abs(h_init) < 0.001)
THEN
175 l_mod = (ustar**2)/(g_t_k*tstar)
177 IF (log(zzd/z0m) < 0.001000)
THEN
179 CALL errorhint(17,
'In stability subroutine, (z-zd) < z0.', zzd, z0m, notusedi)
184 DO WHILE ((abs(lold - l_mod) > 0.01) .AND. (i < 330))
198 ustar = kuz/(log(zzd/z0m) - psim + psimz0)
201 l_mod = (ustar**2)/(g_t_k*tstar)
249 ustar = max(0.001, ustar)
251 IF (z0l < -
neut_limit) ustar = max(0.15, ustar)
255 l_mod = (ustar**2)/(g_t_k*tstar)
274 REAL(kind(1d0)) :: zl, psim
275 INTEGER :: stabilitymethod
277 SELECT CASE (stabilitymethod)
295 REAL(kind(1d0)) :: zl, psih
296 INTEGER :: stabilitymethod
298 SELECT CASE (stabilitymethod)
316 REAL(kind(1d0)) :: zl, phim
317 INTEGER :: stabilitymethod
319 SELECT CASE (stabilitymethod)
337 REAL(kind(1d0)) :: zl, phih
338 INTEGER :: stabilitymethod
340 SELECT CASE (stabilitymethod)
359 REAL(kind(1d0)),
PARAMETER :: a = 6.1
360 REAL(kind(1d0)),
PARAMETER :: b = 2.5
361 REAL(kind(1d0)) :: zl, psim
379 REAL(kind(1d0)) :: zl, phim
395 REAL(kind(1d0)) :: zl, psih
411 REAL(kind(1d0)) :: zl, phih
432 REAL(kind(1d0)),
PARAMETER :: am = 10
433 REAL(kind(1d0)) :: zl, psim
434 REAL(kind(1d0)) :: psim_k
435 REAL(kind(1d0)) :: psim_c
445 psim = dot_product([psim_k, psim_c], [1d0, zl**2])
446 psim = psim/sum([1d0, zl**2])
454 REAL(kind(1d0)),
PARAMETER :: ah = 34
456 REAL(kind(1d0)) :: zl, psih
457 REAL(kind(1d0)) :: psih_k
458 REAL(kind(1d0)) :: psih_c
468 psih = dot_product([psih_k, psih_c], [1d0, zl**2])
469 psih = psih/sum([1d0, zl**2])
483 REAL(kind(1d0)),
PARAMETER :: am = 10
484 REAL(kind(1d0)) :: zl, phim
485 REAL(kind(1d0)) :: phim_k
487 REAL(kind(1d0)) :: phim_c
505 phim = dot_product([phim_k, phim_c], [1d0, zl**2])
506 phim = phim/sum([1d0, zl**2])
513 REAL(kind(1d0)),
PARAMETER :: ah = 34
514 REAL(kind(1d0)) :: zl, phih
515 REAL(kind(1d0)) :: phih_k
517 REAL(kind(1d0)) :: phih_c
531 phih = dot_product([phih_k, phih_c], [1d0, zl**2])
532 phih = phih/sum([1d0, zl**2])
540 REAL(kind(1d0)) :: zl, psic, y, ax
541 REAL(kind(1d0)),
PARAMETER :: pi = acos(-1.)
543 y = (1 - ax*zl)**(1/3.)
544 psic = 3./2*log(y**2 + y + 1/3.) - sqrt(3.)*atan(2*y + 1/sqrt(3.)) + pi/sqrt(3.)
550 REAL(kind(1d0)) :: zl, phic, ax, dpsi_dzl
551 REAL(kind(1d0)),
PARAMETER :: pi = acos(-1.)
554 dpsi_dzl = (9 + 4*(-3 + sqrt(3.))*ax*zl - 9*(1 - ax*zl)**(1/3.))/ &
555 (6.*zl*(2 - 2*ax*zl + (1 - ax*zl)**(2/3.)))
558 phic = 1 - zl*dpsi_dzl
567 REAL(kind(1d0)) :: zl, dpsi, psic, phic, psik, phik
568 REAL(kind(1d0)) :: x_zl, x_psic, x_phic, x_psik, x_phik
571 x_psik = -(2*psik*zl)/(1 + zl**2)**2
572 x_phik = -phik/(zl*(1 + zl**2))
575 x_psic = (2*psic*zl)/(1 + zl**2)**2
576 x_phic = -(phic*zl)/(1 + zl**2)
582 dpsi = x_psic + x_psik + x_phik + x_phic + x_zl
594 REAL(kind(1d0)) :: zl, psi, k1, k2
595 psi = -k1*log(zl + (1 + zl**k2)**(1/k2))
600 REAL(kind(1d0)),
PARAMETER :: a = 6.1
601 REAL(kind(1d0)),
PARAMETER :: b = 2.5
602 REAL(kind(1d0)) :: zl, psim
614 REAL(kind(1d0)),
PARAMETER :: c = 5.3
615 REAL(kind(1d0)),
PARAMETER :: d = 1.1
616 REAL(kind(1d0)) :: zl, psih
628 REAL(kind(1d0)) :: zl, phi, k1, k2, zlk2
631 (zl + zlk2*(1 + zlk2)**((1 - k2)/k2)) &
632 /(zl + (1 + zlk2)**(1/k2)) &
638 REAL(kind(1d0)),
PARAMETER :: a = 6.1
639 REAL(kind(1d0)),
PARAMETER :: b = 2.5
640 REAL(kind(1d0)) :: zl, phim
652 REAL(kind(1d0)),
PARAMETER :: c = 5.3
653 REAL(kind(1d0)),
PARAMETER :: d = 1.1
654 REAL(kind(1d0)) :: zl, phih, zld
671 REAL(kind(1d0)) :: zl, phim
676 phim = 1/(1 - 16*zl)**.25
678 phim = 1 + 6*zl/(1 + zl)
685 REAL(kind(1d0)) :: zl, phih
699 REAL(kind(1d0)) :: zl, psim
713 REAL(kind(1d0)) :: zl, psih
718 psih = (2)*log((1 + (1 - 16*zl)**0.5)/2)
720 psih = (-6)*log(1 + zl)
732 REAL(kind(1d0)) :: zl, phim
737 phim = (1.-19.3*zl)**(-0.25)
747 REAL(kind(1d0)) :: zl, phih
752 phih = 0.95*(1.-11.6*zl)**(-0.5)
761 REAL(kind(1d0)),
PARAMETER :: piover2 = acos(-1.)/2.
762 REAL(kind(1d0)) :: zl, psim, x, x2
767 x = (1 - 19.3*zl)**(0.25)
768 x2 = log((1 + (x**2.))/2.)
769 psim = (2.*log((1 + x)/2.)) + x2 - (2.*atan(x)) + piover2
779 REAL(kind(1d0)) :: zl, psih, x
784 x = 0.95*(1.-11.6*zl)**(0.5)
785 psih = 2*log((1 + x)/2)
790 psih = (-7.8)*(1 + log(zl))
real(kind(1d0)) function phi_heat_k75(zl)
real(kind(1d0)) function phi_cb05(zl, k1, k2)
real(kind(1d0)) function psi_conv(zl, ax)
real(kind(1d0)) function dpsi_dzl_g00(zl, psik, phik, psic, phic)
real(kind(1d0)) function psi_heat_k75(zl)
real(kind(1d0)) function phi_mom_k75(zl)
subroutine cal_atmmoist(temp_c, press_hpa, avrh, dectime, lv_j_kg, lvs_j_kg, es_hpa, ea_hpa, vpd_hpa, vpd_pa, dq, dens_dry, avcp, air_dens)
real(kind(1d0)) function phi_mom_j12(zl)
real(kind(1d0)), parameter k
real(kind(1d0)) function psi_heat_j12(zl)
real(kind(1d0)) function stab_psi_mom(stabilitymethod, zl)
real(kind(1d0)) function psi_mom_b71(zl)
real(kind(1d0)) function psi_mom_k75(zl)
real(kind(1d0)) function phi_mom_g00(zl)
real(kind(1d0)) function phi_mom_b71(zl)
real(kind(1d0)) function psi_mom_cb05(zl)
subroutine cal_stab(stabilitymethod, zzd, z0m, zdm, avu1, temp_c, qh_init, avdens, avcp, l_mod, tstar, ustar, zl)
real(kind(1d0)) function psi_mom_g00(zl)
real(kind(1d0)) function phi_heat_b71(zl)
real(kind(1d0)) function stab_phi_mom(stabilitymethod, zl)
real(kind(1d0)), parameter grav
real(kind(1d0)) function psi_heat_g00(zl)
real(kind(1d0)) function psi_mom_j12(zl)
real(kind(1d0)) function phi_heat_g00(zl)
real(kind(1d0)) function phi_heat_j12(zl)
real(kind(1d0)) function stab_phi_heat(stabilitymethod, zl)
real(kind(1d0)) function psi_cb05(zl, k1, k2)
real(kind(1d0)) function psi_heat_cb05(zl)
real(kind(1d0)) function phi_mom_cb05(zl)
real(kind(1d0)), parameter neut_limit
real(kind(1d0)) function phi_conv(zl, ax)
real(kind(1d0)) function phi_heat_cb05(zl)
real(kind(1d0)) function psi_heat_b71(zl)
real(kind(1d0)) function stab_psi_heat(stabilitymethod, zl)
real(kind(1d0)) function spec_hum_def(vpd_hpa, press_hpa)
real(kind(1d0)) function spec_heat_beer(temp_c, rh, rho_v, rho_d)
real(kind(1d0)) function lat_vap(temp_c, ea_hpa, press_hpa, cp, dectime)
real(kind(1d0)) function sat_vap_press_x(temp_c, press_hpa, from, dectime)
real(kind(1d0)) function lat_vapsublim(temp_c, ea_hpa, press_hpa, cp)
subroutine errorhint(errh, problemfile, value, value2, valuei)