SUEWS API Site
Documentation of SUEWS source code
Functions/Subroutines | Variables
atmmoiststab_module Module Reference

Functions/Subroutines

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)
 
subroutine cal_stab (stabilitymethod, zzd, z0m, zdm, avu1, temp_c, qh_init, avdens, avcp, l_mod, tstar, ustar, zl)
 
real(kind(1d0)) function stab_psi_mom (stabilitymethod, zl)
 
real(kind(1d0)) function stab_psi_heat (stabilitymethod, zl)
 
real(kind(1d0)) function stab_phi_mom (stabilitymethod, zl)
 
real(kind(1d0)) function stab_phi_heat (stabilitymethod, zl)
 
real(kind(1d0)) function psi_mom_j12 (zl)
 
real(kind(1d0)) function phi_mom_j12 (zl)
 
real(kind(1d0)) function psi_heat_j12 (zl)
 
real(kind(1d0)) function phi_heat_j12 (zl)
 
real(kind(1d0)) function psi_mom_g00 (zl)
 
real(kind(1d0)) function psi_heat_g00 (zl)
 
real(kind(1d0)) function phi_mom_g00 (zl)
 
real(kind(1d0)) function phi_heat_g00 (zl)
 
real(kind(1d0)) function psi_conv (zl, ax)
 
real(kind(1d0)) function phi_conv (zl, ax)
 
real(kind(1d0)) function dpsi_dzl_g00 (zl, psik, phik, psic, phic)
 
real(kind(1d0)) function psi_cb05 (zl, k1, k2)
 
real(kind(1d0)) function psi_mom_cb05 (zl)
 
real(kind(1d0)) function psi_heat_cb05 (zl)
 
real(kind(1d0)) function phi_cb05 (zl, k1, k2)
 
real(kind(1d0)) function phi_mom_cb05 (zl)
 
real(kind(1d0)) function phi_heat_cb05 (zl)
 
real(kind(1d0)) function phi_mom_k75 (zl)
 
real(kind(1d0)) function phi_heat_k75 (zl)
 
real(kind(1d0)) function psi_mom_k75 (zl)
 
real(kind(1d0)) function psi_heat_k75 (zl)
 
real(kind(1d0)) function phi_mom_b71 (zl)
 
real(kind(1d0)) function phi_heat_b71 (zl)
 
real(kind(1d0)) function psi_mom_b71 (zl)
 
real(kind(1d0)) function psi_heat_b71 (zl)
 

Variables

real(kind(1d0)), parameter neut_limit = 1.E-2
 
real(kind(1d0)), parameter k = 0.4
 
real(kind(1d0)), parameter grav = 9.80665
 
integer, parameter j12 = 2
 
integer, parameter k75 = 3
 
integer, parameter b71 = 4
 

Function/Subroutine Documentation

◆ cal_atmmoist()

subroutine atmmoiststab_module::cal_atmmoist ( real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(out) lv_j_kg,
real(kind(1d0)), intent(out) lvs_j_kg,
real(kind(1d0)), intent(out) es_hpa,
real(kind(1d0)), intent(out) ea_hpa,
real(kind(1d0)), intent(out) vpd_hpa,
real(kind(1d0)), intent(out) vpd_pa,
real(kind(1d0)), intent(out) dq,
real(kind(1d0)), intent(out) dens_dry,
real(kind(1d0)), intent(out) avcp,
real(kind(1d0)), intent(out) air_dens )

Definition at line 16 of file suews_phys_atmmoiststab.f95.

20
21 USE meteo, ONLY: &
24
25 IMPLICIT NONE
26 REAL(KIND(1D0)) :: vap_dens
27
28 REAL(KIND(1D0)), INTENT(in) :: &
29 temp_c, &
30 press_hpa, &
31 avrh, dectime
32 REAL(KIND(1D0)), INTENT(out) :: &
33 lv_j_kg, & !Latent heat of vaporization in [J kg-1]
34 lvs_j_kg, & !Latent heat of sublimation in J/kg
35 es_hpa, & !Saturation vapour pressure over water in hPa
36 ea_hpa, & !Vapour pressure of water in hPa
37 vpd_hpa, & !vapour pressure deficit in hPa
38 vpd_pa, & !vapour pressure deficit in Pa
39 dq, & !Specific humidity deficit in g/kg
40 dens_dry, & !Vap density or absolute humidity [kg m-3]
41 avcp, & !specific heat capacity in J kg-1 K-1
42 air_dens !Air density in kg/m3
43
44 REAL(KIND(1D0)), PARAMETER :: &
45 ! comp = 0.9995, &
46 ! epsil = 0.62197,& !ratio molecular weight of water vapor/dry air (kg/mol/kg/mol)
47 ! epsil_gkg = 621.97, & !ratio molecular weight of water vapor/dry air in g/kg
48 ! dry_gas = 8.31451,& !Dry gas constant (J/k/mol)
49 ! gas_ct_wat = 461.05,& !Gas constant for water (J/kg/K)
50 ! molar = 0.028965,& !Dry air molar fraction in kg/mol
51 ! molar_wat_vap = 0.0180153,& !Molar fraction of water vapor in kg/mol
52 gas_ct_dry = 8.31451/0.028965, & !j/kg/k=dry_gas/molar
53 gas_ct_wv = 8.31451/0.0180153 !j/kg/k=dry_gas/molar_wat_vap
54 ! waterDens = 999.8395 !Density of water in 0 cel deg
55 INTEGER :: from = 1
56
57 !Saturation vapour pressure over water in hPa
58 es_hpa = sat_vap_press_x(temp_c, press_hpa, from, dectime) ! dectime is more or less unnecessary here
59
60 !Vapour pressure of water in hPa
61 ea_hpa = avrh/100*es_hpa
62
63 ! if(debug.and.dectime>55.13.and.dectime<55.2)write(35,*)'%',Temp_C
64
65 vpd_hpa = es_hpa - ea_hpa !vapour pressure deficit in hPa
66 vpd_pa = (es_hpa*100) - (ea_hpa*100) !vapour pressure deficit in Pa
67
68 dq = spec_hum_def(vpd_hpa, press_hpa) !Specific humidity deficit in g/kg
69
70 !Vap density or absolute humidity (kg/m3)
71 vap_dens = (ea_hpa*100/((temp_c + 273.16)*gas_ct_wv))
72
73 !density Dry Air Beer(1990) kg/m3
74 dens_dry = ((press_hpa - ea_hpa)*100)/(gas_ct_dry*(273.16 + temp_c))
75
76 !Air density in kg/m3
77 air_dens = (press_hpa*100)/(gas_ct_dry*(temp_c + 273.16))
78
79 !Calculate specific heat capacity in J kg-1 K-1
80 avcp = spec_heat_beer(temp_c, avrh, vap_dens, dens_dry)
81
82 !Latent heat of vaporization in [J kg-1]
83 lv_j_kg = lat_vap(temp_c, ea_hpa, press_hpa, avcp, dectime)
84
85 !Latent heat of sublimation in J/kg
86 IF (temp_c < 0.000) THEN
87 lvs_j_kg = lat_vapsublim(temp_c, ea_hpa, press_hpa, avcp)
88 ELSE
89 lvs_j_kg = 2834000
90 END IF
91 !if(debug)write(*,*)lv_J_kg,Temp_C,'lv2'
92 IF (press_hpa < 900) THEN
93 CALL errorhint(46, 'Function LUMPS_cal_AtmMoist', press_hpa, -55.55d0, -55)
94 END IF
95 RETURN
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)

References errorhint(), meteo::lat_vap(), meteo::lat_vapsublim(), meteo::sat_vap_press_x(), meteo::spec_heat_beer(), and meteo::spec_hum_def().

Referenced by suews_driver::suews_cal_biogenco2(), suews_driver::suews_cal_biogenco2_dts(), suews_driver::suews_cal_main(), and suews_driver::suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_stab()

subroutine atmmoiststab_module::cal_stab ( integer, intent(in) stabilitymethod,
real(kind(1d0)), intent(in) zzd,
real(kind(1d0)), intent(in) z0m,
real(kind(1d0)), intent(in) zdm,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) qh_init,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(out) l_mod,
real(kind(1d0)), intent(out) tstar,
real(kind(1d0)), intent(out) ustar,
real(kind(1d0)), intent(out) zl )

Definition at line 111 of file suews_phys_atmmoiststab.f95.

125
126 IMPLICIT NONE
127 INTEGER, INTENT(in) :: StabilityMethod
128
129 REAL(KIND(1D0)), INTENT(in) :: zzd !Active measurement height (meas. height-displac. height)
130 REAL(KIND(1D0)), INTENT(in) :: z0m !Aerodynamic roughness length
131 REAL(KIND(1D0)), INTENT(in) :: zdm !Displacement height
132 REAL(KIND(1D0)), INTENT(in) :: avU1 !Average wind speed
133 REAL(KIND(1D0)), INTENT(in) :: Temp_C !Air temperature
134 REAL(KIND(1D0)), INTENT(in) :: QH_init !sensible heat flux [W m-2]
135 REAL(KIND(1D0)), INTENT(in) :: avdens ! air density [kg m-3]
136 REAL(KIND(1D0)), INTENT(in) :: avcp ! volumetric heat capacity [J m-3 K-1]
137
138 REAL(KIND(1D0)), INTENT(out) :: L_MOD !Obukhov length
139 REAL(KIND(1D0)), INTENT(out) :: TStar !T*
140 REAL(KIND(1D0)), INTENT(out) :: UStar !Friction velocity
141 REAL(KIND(1D0)), INTENT(out) :: zL ! Stability scale
142 ! REAL(KIND(1d0)),INTENT(out)::psim !Stability function of momentum
143
144 REAL(KIND(1D0)) :: G_T_K, &
145 kuz, &
146 lold, &
147 psim, &
148 z0l, &
149 psimz0, &
150 h_init, &
151 h
152 INTEGER, PARAMETER :: notUsedI = -55
153
154 INTEGER :: i
155
156 LOGICAL :: debug = .false.
157
158 !Kinematic sensible heat flux [K m s-1] used to calculate friction velocity
159 h_init = qh_init/(avdens*avcp)
160
161 IF (debug) WRITE (*, *) stabilitymethod, z0m, avu1, h_init, ustar, l_mod
162 g_t_k = (grav/(temp_c + 273.16))*k !gravity constant/(Temperature*Von Karman Constant)
163 kuz = k*avu1 !Von Karman constant*mean wind speed
164 IF (zzd < 0) CALL errorhint(32, &
165 'Windspeed Ht too low relative to zdm [Stability calc]- values [z-zdm, zdm]', &
166 zzd, zdm, notusedi)
167
168 ustar = kuz/log(zzd/z0m) !Initial setting of u* and calc. of L_MOD (neutral situation)
169 IF (abs(h_init) < 0.001) THEN ! prevent zero TStar
170 h = 0.001
171 ELSE
172 h = h_init
173 END IF
174 tstar = (-h/ustar)
175 l_mod = (ustar**2)/(g_t_k*tstar)
176
177 IF (log(zzd/z0m) < 0.001000) THEN
178 ! PRINT*, 1/(z0m-z0m)
179 CALL errorhint(17, 'In stability subroutine, (z-zd) < z0.', zzd, z0m, notusedi)
180 END IF
181 i = 1
182 lold = -999.
183 z0l = z0m/l_mod !z0m roughness length
184 DO WHILE ((abs(lold - l_mod) > 0.01) .AND. (i < 330)) !NT: add error threshold !Iteration starts
185 lold = l_mod
186 zl = zzd/l_mod
187 z0l = z0m/l_mod !z0m roughness length
188
189 ! IF (zL>2)THEN
190 ! CALL ErrorHint(73,'LUMPS_atmos_functions_stab.f95: stability scale (z/L), UStar',zL,UStar,notUsedI)
191 ! RETURN !MO-theory not necessarily valid above zL>2. Still causes problematic UStar values and correct limit might be 0.3.
192 ! !Needs more investigations.
193 ! END IF
194
195 psim = stab_psi_mom(stabilitymethod, zl)
196 psimz0 = stab_psi_mom(stabilitymethod, z0l)
197
198 ustar = kuz/(log(zzd/z0m) - psim + psimz0) !Friction velocity in non-neutral situation
199
200 tstar = (-h/ustar)
201 l_mod = (ustar**2)/(g_t_k*tstar)
202
203 ! IF(UStar<0.001000)THEN !If u* too small
204 ! UStar=KUZ/(LOG(Zzd/z0m))
205 ! PRINT*, 'UStar info',UStar,KUZ,(LOG(Zzd/z0m)),Zzd,z0m
206 ! CALL ErrorHint(30,'SUBROUTINE STAB_lumps:[ u*< 0.001] zl,dectime',zl,dectime,notUsedI)
207 ! CALL ErrorHint(30,'SUBROUTINE STAB_lumps:[ u*< 0.001] z0l,UStar',z0l,UStar,notUsedI)
208 ! CALL ErrorHint(30,'SUBROUTINE STAB_lumps:[ u*< 0.001] psim,psimz0',psim,psimz0,notUsedI)
209 ! CALL ErrorHint(30,'SUBROUTINE STAB_lumps:[ u*< 0.001] AVU1,log(zzd/z0m)',AVU1,LOG(zzd/z0m),notUsedI)
210 !
211 ! ! RETURN
212 ! ENDIF
213
214 i = i + 1
215 END DO
216
217 ! limit zL to be within [-5,5]
218 ! IF (zL < -5 .OR. zL > 5) THEN
219 ! zL = MIN(5., MAX(-5., zL))
220 ! limit other output variables as well as z/L
221 ! L_MOD = zzd/zL
222 ! limit L_mod to 3.e4 for consistency with output
223 ! IF (ABS(L_MOD) > 3E4) L_MOD = L_MOD/ABS(L_MOD)*3E4
224 ! z0L = z0m/L_MOD
225 ! psim = stab_psi_mom(StabilityMethod, zL)
226 ! psimz0 = stab_psi_mom(StabilityMethod, z0L)
227
228 ! TS 01 Aug 2018:
229 ! TS: limit UStar and TStar to reasonable values
230 ! to prevent potential issues in other stability-related calcualtions
231 ! 02 Aug 2018: set a low limit at 0.15 m/s (Schumann 1988, BLM, DOI: 10.1007/BF00123019)
232 ! UStar = KUZ/(LOG(Zzd/z0m) - psim + psimz0)
233 ! UStar = MAX(0.15, UStar)
234 ! TStar = (-H/UStar)
235
236 ! IF (UStar < 0.0001) THEN !If u* still too small after iteration, then force quit simulation and write out error info
237 ! ! UStar=KUZ/(LOG(Zzd/z0m))
238 ! PRINT *, 'UStar', UStar, KUZ, (LOG(Zzd/z0m)), Zzd, z0m
239 ! CALL ErrorHint(30, 'SUBROUTINE cal_Stab:[ u*< 0.0001] zl,L_MOD', zl, L_MOD, notUsedI)
240 ! CALL ErrorHint(30, 'SUBROUTINE cal_Stab:[ u*< 0.0001] z0l,UStar', z0l, UStar, notUsedI)
241 ! CALL ErrorHint(30, 'SUBROUTINE cal_Stab:[ u*< 0.0001] psim,psimz0', psim, psimz0, notUsedI)
242 ! CALL ErrorHint(30, 'SUBROUTINE cal_Stab:[ u*< 0.0001] AVU1,log(zzd/z0m)', AVU1, LOG(zzd/z0m), notUsedI)
243
244 ! ! RETURN
245 ! ENDIF
246
247 ! TS 11 Feb 2021: limit UStar and TStar to reasonable ranges
248 ! under all conditions, min(UStar)==0.001 m s-1 (Jimenez et al 2012, MWR, https://doi.org/10.1175/mwr-d-11-00056.1
249 ustar = max(0.001, ustar)
250 ! under convective/unstable condition, min(UStar)==0.15 m s-1: (Schumann 1988, BLM, https://doi.org/10.1007/BF00123019)
251 IF (z0l < -neut_limit) ustar = max(0.15, ustar)
252
253 ! update associated variables
254 tstar = (-h/ustar)
255 l_mod = (ustar**2)/(g_t_k*tstar)
256 zl = zzd/l_mod
257
258 ! if ( L_MOD<-990 ) then
259 ! print*, 'L_MOD too low',L_MOD
260 ! print*, 1/(L_MOD-L_MOD)
261 !
262 ! end if
263

References errorhint(), grav, k, neut_limit, and stab_psi_mom().

Referenced by suews_driver::suews_cal_resistance(), and suews_driver::suews_cal_resistance_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dpsi_dzl_g00()

real(kind(1d0)) function atmmoiststab_module::dpsi_dzl_g00 ( real(kind(1d0)) zl,
real(kind(1d0)) psik,
real(kind(1d0)) phik,
real(kind(1d0)) psic,
real(kind(1d0)) phic )

Definition at line 562 of file suews_phys_atmmoiststab.f95.

563 ! Grachev et al. (2000), eqn 15
564 ! note: Psi is a zL-weighted sum of Kansas and convective components
565 ! derived from d(Psi)/d(zL)=d((psiK+zL**2*psiC)/(1+zL**2))/d(zL)
566
567 REAL(KIND(1D0)) :: zl, dPsi, psiC, phiC, psiK, phiK
568 REAL(KIND(1D0)) :: x_zl, x_psiC, x_phiC, x_psiK, x_phiK
569
570 ! Kansas part
571 x_psik = -(2*psik*zl)/(1 + zl**2)**2
572 x_phik = -phik/(zl*(1 + zl**2))
573
574 ! convective contribution
575 x_psic = (2*psic*zl)/(1 + zl**2)**2
576 x_phic = -(phic*zl)/(1 + zl**2)
577
578 ! zL related
579 x_zl = 1/zl
580
581 ! totoal
582 dpsi = x_psic + x_psik + x_phik + x_phic + x_zl
583

◆ phi_cb05()

real(kind(1d0)) function atmmoiststab_module::phi_cb05 ( real(kind(1d0)) zl,
real(kind(1d0)) k1,
real(kind(1d0)) k2 )

Definition at line 626 of file suews_phys_atmmoiststab.f95.

627 ! Cheng and Brutsaert (2005), eqn 22/24
628 REAL(KIND(1D0)) :: zl, phi, k1, k2, zlk2
629 zlk2 = zl**k2
630 phi = 1 + k1*( &
631 (zl + zlk2*(1 + zlk2)**((1 - k2)/k2)) &
632 /(zl + (1 + zlk2)**(1/k2)) &
633 )

Referenced by phi_heat_cb05(), and phi_mom_cb05().

Here is the caller graph for this function:

◆ phi_conv()

real(kind(1d0)) function atmmoiststab_module::phi_conv ( real(kind(1d0)) zl,
real(kind(1d0)) ax )

Definition at line 548 of file suews_phys_atmmoiststab.f95.

549 ! Grachev et al. (2000), eqn 15
550 REAL(KIND(1D0)) :: zl, phiC, ax, dPsi_dzL
551 REAL(KIND(1D0)), PARAMETER :: pi = acos(-1.)
552
553 ! d(psi_conv)/d(zL)
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.)))
556
557 ! phi=1-zL*d(Psi)/d(zL)
558 phic = 1 - zl*dpsi_dzl
559

Referenced by phi_heat_g00(), and phi_mom_g00().

Here is the caller graph for this function:

◆ phi_heat_b71()

real(kind(1d0)) function atmmoiststab_module::phi_heat_b71 ( real(kind(1d0)) zl)

Definition at line 744 of file suews_phys_atmmoiststab.f95.

745 ! Businger et al. (1971)
746 ! modified by Hogstrom (1988): see Table VII
747 REAL(KIND(1D0)) :: zl, phih
748
749 IF (abs(zl) < neut_limit) THEN
750 phih = 1
751 ELSEIF (zl < -neut_limit) THEN
752 phih = 0.95*(1.-11.6*zl)**(-0.5)
753 ELSEIF (zl > neut_limit) THEN
754 phih = 0.95 + 7.8*zl
755 END IF
756

References neut_limit.

Referenced by phi_heat_g00(), and stab_phi_heat().

Here is the caller graph for this function:

◆ phi_heat_cb05()

real(kind(1d0)) function atmmoiststab_module::phi_heat_cb05 ( real(kind(1d0)) zl)

Definition at line 650 of file suews_phys_atmmoiststab.f95.

651 ! Cheng and Brutsaert (2005), eqn 24
652 REAL(KIND(1D0)), PARAMETER :: c = 5.3
653 REAL(KIND(1D0)), PARAMETER :: d = 1.1
654 REAL(KIND(1D0)) :: zl, phih, zld
655
656 IF (abs(zl) < neut_limit) THEN
657 phih = 1
658 ELSEIF (zl > neut_limit) THEN
659 zld = zl**d
660 phih = phi_cb05(zl, c, d)
661 END IF
662

References neut_limit, and phi_cb05().

Referenced by phi_heat_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_heat_g00()

real(kind(1d0)) function atmmoiststab_module::phi_heat_g00 ( real(kind(1d0)) zl)

Definition at line 512 of file suews_phys_atmmoiststab.f95.

513 REAL(KIND(1D0)), PARAMETER :: ah = 34
514 REAL(KIND(1D0)) :: zl, phih
515 REAL(KIND(1D0)) :: phih_K ! Kansas part
516 ! REAL(KIND(1D0)):: psih_K ! Kansas part
517 REAL(KIND(1D0)) :: phih_C ! convective part
518 ! REAL(KIND(1D0)):: psih_C ! convective part
519
520 IF (abs(zl) < neut_limit) THEN
521 phih = 1
522 ELSEIF (zl < -neut_limit) THEN
523 ! kansas
524 ! psih_K = psi_heat_B71(ZL)
525 phih_k = phi_heat_b71(zl)
526
527 ! convective
528 ! psih_C = psi_conv(ZL, ah)
529 phih_c = phi_conv(zl, ah)
530
531 phih = dot_product([phih_k, phih_c], [1d0, zl**2])
532 phih = phih/sum([1d0, zl**2])
533
534 END IF
535

References neut_limit, phi_conv(), and phi_heat_b71().

Referenced by phi_heat_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_heat_j12()

real(kind(1d0)) function atmmoiststab_module::phi_heat_j12 ( real(kind(1d0)) zl)

Definition at line 410 of file suews_phys_atmmoiststab.f95.

411 REAL(KIND(1D0)) :: zl, phih
412
413 IF (abs(zl) < neut_limit) THEN
414 phih = 1
415 ELSEIF (zl < -neut_limit) THEN
416 phih = phi_heat_g00(zl)
417 ELSEIF (zl > neut_limit) THEN
418 phih = phi_heat_cb05(zl)
419 END IF
420

References neut_limit, phi_heat_cb05(), and phi_heat_g00().

Referenced by stab_phi_heat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_heat_k75()

real(kind(1d0)) function atmmoiststab_module::phi_heat_k75 ( real(kind(1d0)) zl)

Definition at line 683 of file suews_phys_atmmoiststab.f95.

684 ! Kondo (1975) adopted by Campbell & Norman eqn 7.22 and 7.23 p 97
685 REAL(KIND(1D0)) :: zl, phih
686
687 IF (abs(zl) < neut_limit) THEN
688 phih = 1
689 ELSEIF (zl < -neut_limit) THEN
690 phih = phi_mom_k75(zl)**2
691 ELSEIF (zl > neut_limit) THEN
692 phih = phi_mom_k75(zl)
693 END IF
694

References neut_limit, and phi_mom_k75().

Referenced by stab_phi_heat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_mom_b71()

real(kind(1d0)) function atmmoiststab_module::phi_mom_b71 ( real(kind(1d0)) zl)

Definition at line 729 of file suews_phys_atmmoiststab.f95.

730 ! Businger et al. (1971)
731 ! modified by Hogstrom (1988): see Table VI
732 REAL(KIND(1D0)) :: zl, phim
733
734 IF (abs(zl) < neut_limit) THEN
735 phim = 1
736 ELSEIF (zl < -neut_limit) THEN
737 phim = (1.-19.3*zl)**(-0.25)
738 ELSEIF (zl > neut_limit) THEN
739 phim = 1 + 6*zl
740 END IF
741

References neut_limit.

Referenced by phi_mom_g00(), and stab_phi_mom().

Here is the caller graph for this function:

◆ phi_mom_cb05()

real(kind(1d0)) function atmmoiststab_module::phi_mom_cb05 ( real(kind(1d0)) zl)

Definition at line 636 of file suews_phys_atmmoiststab.f95.

637 ! Cheng and Brutsaert (2005), eqn 22
638 REAL(KIND(1D0)), PARAMETER :: a = 6.1
639 REAL(KIND(1D0)), PARAMETER :: b = 2.5
640 REAL(KIND(1D0)) :: zl, phim
641
642 IF (abs(zl) < neut_limit) THEN
643 phim = 1
644 ELSEIF (zl > neut_limit) THEN
645 phim = phi_cb05(zl, a, b)
646 END IF
647

References neut_limit, and phi_cb05().

Referenced by phi_mom_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_mom_g00()

real(kind(1d0)) function atmmoiststab_module::phi_mom_g00 ( real(kind(1d0)) zl)

Definition at line 482 of file suews_phys_atmmoiststab.f95.

483 REAL(KIND(1D0)), PARAMETER :: am = 10
484 REAL(KIND(1D0)) :: zl, phim
485 REAL(KIND(1D0)) :: phim_K ! Kansas part
486 ! REAL(KIND(1D0)):: psim_K ! Kansas part
487 REAL(KIND(1D0)) :: phim_C ! convective part
488 ! REAL(KIND(1D0)):: psim_C ! convective part
489
490 IF (abs(zl) < neut_limit) THEN
491 phim = 1
492 ELSEIF (zl < -neut_limit) THEN
493 ! kansas
494 ! psim_K = psi_mom_B71(ZL)
495 phim_k = phi_mom_b71(zl)
496
497 ! convective
498 ! psim_C = psi_conv(ZL, am)
499 phim_c = phi_conv(zl, am)
500
501 ! by definition correct but not used due to bizzare numeric behaviour
502 ! phim = 1 - zL*dPsi_dzL_G00(zL, psim_K, phim_K, psim_C, phim_C)
503
504 ! weighted sum:
505 phim = dot_product([phim_k, phim_c], [1d0, zl**2])
506 phim = phim/sum([1d0, zl**2])
507
508 END IF
509

References neut_limit, phi_conv(), and phi_mom_b71().

Referenced by phi_mom_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_mom_j12()

real(kind(1d0)) function atmmoiststab_module::phi_mom_j12 ( real(kind(1d0)) zl)

Definition at line 376 of file suews_phys_atmmoiststab.f95.

377 ! not directly provided by J12
378 ! equations below are derived from related original formulations
379 REAL(KIND(1D0)) :: zl, phim
380
381 IF (abs(zl) < neut_limit) THEN
382 phim = 1
383 ELSEIF (zl < -neut_limit) THEN
384 ! derivative of eqn 17 in Jimenez et al. (2012)
385 phim = phi_mom_g00(zl)
386 ELSEIF (zl > neut_limit) THEN
387 ! derivative of eqn 18 in Jimenez et al. (2012)
388 phim = phi_mom_cb05(zl)
389 END IF
390

References neut_limit, phi_mom_cb05(), and phi_mom_g00().

Referenced by stab_phi_mom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi_mom_k75()

real(kind(1d0)) function atmmoiststab_module::phi_mom_k75 ( real(kind(1d0)) zl)

Definition at line 669 of file suews_phys_atmmoiststab.f95.

670 ! Kondo (1975) adopted by Campbell & Norman eqn 7.22 and 7.23 p 97
671 REAL(KIND(1D0)) :: zl, phim
672
673 IF (abs(zl) < neut_limit) THEN
674 phim = 1
675 ELSEIF (zl < -neut_limit) THEN
676 phim = 1/(1 - 16*zl)**.25
677 ELSEIF (zl > neut_limit) THEN
678 phim = 1 + 6*zl/(1 + zl)
679 END IF
680

References neut_limit.

Referenced by phi_heat_k75(), and stab_phi_mom().

Here is the caller graph for this function:

◆ psi_cb05()

real(kind(1d0)) function atmmoiststab_module::psi_cb05 ( real(kind(1d0)) zl,
real(kind(1d0)) k1,
real(kind(1d0)) k2 )

Definition at line 592 of file suews_phys_atmmoiststab.f95.

593 ! Cheng and Brutsaert (2005), eqn 21/23
594 REAL(KIND(1D0)) :: zl, psi, k1, k2
595 psi = -k1*log(zl + (1 + zl**k2)**(1/k2))

Referenced by psi_heat_cb05(), and psi_mom_cb05().

Here is the caller graph for this function:

◆ psi_conv()

real(kind(1d0)) function atmmoiststab_module::psi_conv ( real(kind(1d0)) zl,
real(kind(1d0)) ax )

Definition at line 538 of file suews_phys_atmmoiststab.f95.

539 ! Grachev et al. (2000), eqn 12
540 REAL(KIND(1D0)) :: zl, psiC, y, ax
541 REAL(KIND(1D0)), PARAMETER :: pi = acos(-1.)
542
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.)
545

Referenced by psi_heat_g00(), and psi_mom_g00().

Here is the caller graph for this function:

◆ psi_heat_b71()

real(kind(1d0)) function atmmoiststab_module::psi_heat_b71 ( real(kind(1d0)) zl)

Definition at line 777 of file suews_phys_atmmoiststab.f95.

778 ! integral form of phi_heat_B71
779 REAL(KIND(1D0)) :: zl, psih, x
780
781 IF (abs(zl) < neut_limit) THEN
782 psih = 0
783 ELSEIF (zl < -neut_limit) THEN
784 x = 0.95*(1.-11.6*zl)**(0.5)
785 psih = 2*log((1 + x)/2)
786 ELSEIF (zl > neut_limit) THEN
787 IF (zl < 1) THEN
788 psih = (-7.8)*zl
789 ELSE
790 psih = (-7.8)*(1 + log(zl))
791 END IF
792 END IF
793

References neut_limit.

Referenced by psi_heat_g00(), and stab_psi_heat().

Here is the caller graph for this function:

◆ psi_heat_cb05()

real(kind(1d0)) function atmmoiststab_module::psi_heat_cb05 ( real(kind(1d0)) zl)

Definition at line 612 of file suews_phys_atmmoiststab.f95.

613 ! Cheng and Brutsaert (2005), eqn 23
614 REAL(KIND(1D0)), PARAMETER :: c = 5.3
615 REAL(KIND(1D0)), PARAMETER :: d = 1.1
616 REAL(KIND(1D0)) :: zl, psih
617
618 IF (abs(zl) < neut_limit) THEN
619 psih = 0
620 ELSEIF (zl > neut_limit) THEN
621 psih = psi_cb05(zl, c, d)
622 END IF
623

References neut_limit, and psi_cb05().

Referenced by psi_heat_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_heat_g00()

real(kind(1d0)) function atmmoiststab_module::psi_heat_g00 ( real(kind(1d0)) zl)

Definition at line 451 of file suews_phys_atmmoiststab.f95.

452 ! Grachev et al. (2000), eqn 18
453 ! determination of `ah` see sect. 4.1 of G00
454 REAL(KIND(1D0)), PARAMETER :: ah = 34
455
456 REAL(KIND(1D0)) :: zl, psih
457 REAL(KIND(1D0)) :: psih_k
458 REAL(KIND(1D0)) :: psih_c
459
460 IF (abs(zl) < neut_limit) THEN
461 psih = 0
462 ELSEIF (zl < -neut_limit) THEN
463 ! Kansas part:
464 psih_k = psi_heat_b71(zl)
465 ! convective contribution:
466 psih_c = psi_conv(zl, ah)
467 ! zL weighted sum:
468 psih = dot_product([psih_k, psih_c], [1d0, zl**2])
469 psih = psih/sum([1d0, zl**2])
470
471 END IF
472

References neut_limit, psi_conv(), and psi_heat_b71().

Referenced by psi_heat_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_heat_j12()

real(kind(1d0)) function atmmoiststab_module::psi_heat_j12 ( real(kind(1d0)) zl)

Definition at line 393 of file suews_phys_atmmoiststab.f95.

394 ! Jimenez et al. (2012), eqn 17 and 19
395 REAL(KIND(1D0)) :: zl, psih
396
397 IF (abs(zl) < neut_limit) THEN
398 psih = 0
399 ELSEIF (zl < -neut_limit) THEN
400 ! Jimenez et al. (2012), eqn 17
401 psih = psi_heat_g00(zl)
402 ELSEIF (zl > neut_limit) THEN
403 ! Jimenez et al. (2012), eqn 19:
404 ! Cheng and Brutsaert (2005)
405 psih = psi_heat_cb05(zl)
406 END IF
407

References neut_limit, psi_heat_cb05(), and psi_heat_g00().

Referenced by stab_psi_heat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_heat_k75()

real(kind(1d0)) function atmmoiststab_module::psi_heat_k75 ( real(kind(1d0)) zl)

Definition at line 711 of file suews_phys_atmmoiststab.f95.

712 ! Kondo (1975) adopted by Campbell & Norman eqn 7.26 and 7.27 p 97
713 REAL(KIND(1D0)) :: zl, psih
714
715 IF (abs(zl) < neut_limit) THEN
716 psih = 0
717 ELSEIF (zl < -neut_limit) THEN
718 psih = (2)*log((1 + (1 - 16*zl)**0.5)/2)
719 ELSEIF (zl > neut_limit) THEN
720 psih = (-6)*log(1 + zl)
721 END IF
722

References neut_limit.

Referenced by psi_mom_k75(), and stab_psi_heat().

Here is the caller graph for this function:

◆ psi_mom_b71()

real(kind(1d0)) function atmmoiststab_module::psi_mom_b71 ( real(kind(1d0)) zl)

Definition at line 759 of file suews_phys_atmmoiststab.f95.

760 ! integral form of phi_mom_B71
761 REAL(KIND(1D0)), PARAMETER :: PIOVER2 = acos(-1.)/2.
762 REAL(KIND(1D0)) :: zl, psim, x, x2
763
764 IF (abs(zl) < neut_limit) THEN
765 psim = 0
766 ELSEIF (zl < -neut_limit) THEN
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
770
771 ELSEIF (zl > neut_limit) THEN
772 psim = (-6)*zl
773 END IF
774

References neut_limit.

Referenced by psi_mom_g00(), and stab_psi_mom().

Here is the caller graph for this function:

◆ psi_mom_cb05()

real(kind(1d0)) function atmmoiststab_module::psi_mom_cb05 ( real(kind(1d0)) zl)

Definition at line 598 of file suews_phys_atmmoiststab.f95.

599 ! Cheng and Brutsaert (2005), eqn 21
600 REAL(KIND(1D0)), PARAMETER :: a = 6.1
601 REAL(KIND(1D0)), PARAMETER :: b = 2.5
602 REAL(KIND(1D0)) :: zl, psim
603
604 IF (abs(zl) < neut_limit) THEN
605 psim = 0
606 ELSEIF (zl > neut_limit) THEN
607 psim = psi_cb05(zl, a, b)
608 END IF
609

References neut_limit, and psi_cb05().

Referenced by psi_mom_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_mom_g00()

real(kind(1d0)) function atmmoiststab_module::psi_mom_g00 ( real(kind(1d0)) zl)

Definition at line 429 of file suews_phys_atmmoiststab.f95.

430 ! Grachev et al. (2000), eqn 18
431 ! determination of `am` see sect. 4.1 of G00
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
436
437 IF (abs(zl) < neut_limit) THEN
438 psim = 0
439 ELSEIF (zl < -neut_limit) THEN
440 ! Kansas part:
441 psim_k = psi_mom_b71(zl)
442 ! convective contribution:
443 psim_c = psi_conv(zl, am)
444 ! zL weighted sum:
445 psim = dot_product([psim_k, psim_c], [1d0, zl**2])
446 psim = psim/sum([1d0, zl**2])
447 END IF
448

References neut_limit, psi_conv(), and psi_mom_b71().

Referenced by psi_mom_j12().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_mom_j12()

real(kind(1d0)) function atmmoiststab_module::psi_mom_j12 ( real(kind(1d0)) zl)

Definition at line 357 of file suews_phys_atmmoiststab.f95.

358 ! Jimenez et al. (2012), eqn 17 and 18
359 REAL(KIND(1D0)), PARAMETER :: a = 6.1
360 REAL(KIND(1D0)), PARAMETER :: b = 2.5
361 REAL(KIND(1D0)) :: zl, psim
362
363 IF (abs(zl) < neut_limit) THEN
364 psim = 0
365 ELSEIF (zl < -neut_limit) THEN
366 ! Jimenez et al. (2012), eqn 17
367 psim = psi_mom_g00(zl)
368 ELSEIF (zl > neut_limit) THEN
369 ! Jimenez et al. (2012), eqn 18:
370 ! Cheng and Brutsaert (2005)
371 psim = psi_mom_cb05(zl)
372 END IF
373

References neut_limit, psi_mom_cb05(), and psi_mom_g00().

Referenced by stab_psi_mom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ psi_mom_k75()

real(kind(1d0)) function atmmoiststab_module::psi_mom_k75 ( real(kind(1d0)) zl)

Definition at line 697 of file suews_phys_atmmoiststab.f95.

698 ! Kondo (1975) adopted by Campbell & Norman eqn 7.26 and 7.27 p 97
699 REAL(KIND(1D0)) :: zl, psim
700
701 IF (abs(zl) < neut_limit) THEN
702 psim = 0
703 ELSEIF (zl < -neut_limit) THEN
704 psim = 0.6*psi_heat_k75(zl)
705 ELSEIF (zl > neut_limit) THEN
706 psim = psi_heat_k75(zl)
707 END IF
708

References neut_limit, and psi_heat_k75().

Referenced by stab_psi_mom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stab_phi_heat()

real(kind(1d0)) function atmmoiststab_module::stab_phi_heat ( integer stabilitymethod,
real(kind(1d0)) zl )

Definition at line 334 of file suews_phys_atmmoiststab.f95.

335 IMPLICIT NONE
336
337 REAL(KIND(1D0)) :: zl, phih
338 INTEGER :: StabilityMethod
339
340 SELECT CASE (stabilitymethod)
341 CASE (j12)
342 phih = phi_heat_j12(zl)
343
344 CASE (k75)
345 phih = phi_heat_k75(zl)
346
347 CASE (b71)
348 phih = phi_heat_b71(zl)
349
350 END SELECT
351

References b71, j12, k75, phi_heat_b71(), phi_heat_j12(), and phi_heat_k75().

Referenced by rsl_module::cal_beta_lc(), rsl_module::cal_ch(), and rsl_module::cal_psih_hat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stab_phi_mom()

real(kind(1d0)) function atmmoiststab_module::stab_phi_mom ( integer stabilitymethod,
real(kind(1d0)) zl )

Definition at line 313 of file suews_phys_atmmoiststab.f95.

314 IMPLICIT NONE
315
316 REAL(KIND(1D0)) :: zl, phim
317 INTEGER :: StabilityMethod
318
319 SELECT CASE (stabilitymethod)
320 CASE (j12)
321 phim = phi_mom_j12(zl)
322
323 CASE (k75)
324 phim = phi_mom_k75(zl)
325
326 CASE (b71)
327 phim = phi_mom_b71(zl)
328
329 END SELECT
330

References b71, j12, k75, phi_mom_b71(), phi_mom_j12(), and phi_mom_k75().

Referenced by rsl_module::cal_cm(), and rsl_module::cal_psim_hat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stab_psi_heat()

real(kind(1d0)) function atmmoiststab_module::stab_psi_heat ( integer stabilitymethod,
real(kind(1d0)) zl )

Definition at line 292 of file suews_phys_atmmoiststab.f95.

293 IMPLICIT NONE
294
295 REAL(KIND(1D0)) :: zl, psih
296 INTEGER :: StabilityMethod
297
298 SELECT CASE (stabilitymethod)
299 CASE (j12)
300 psih = psi_heat_j12(zl)
301
302 CASE (k75)
303 psih = psi_heat_k75(zl)
304
305 CASE (b71)
306 psih = psi_heat_b71(zl)
307
308 END SELECT
309

References b71, j12, k75, psi_heat_b71(), psi_heat_j12(), and psi_heat_k75().

Referenced by resist_module::aerodynamicresistance(), rsl_module::rslprofile(), and rsl_module::rslprofile_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stab_psi_mom()

real(kind(1d0)) function atmmoiststab_module::stab_psi_mom ( integer stabilitymethod,
real(kind(1d0)) zl )

Definition at line 271 of file suews_phys_atmmoiststab.f95.

272 IMPLICIT NONE
273
274 REAL(KIND(1D0)) :: zl, psim
275 INTEGER :: StabilityMethod
276
277 SELECT CASE (stabilitymethod)
278 CASE (j12)
279 psim = psi_mom_j12(zl)
280
281 CASE (k75)
282 psim = psi_mom_k75(zl)
283
284 CASE (b71)
285 psim = psi_mom_b71(zl)
286
287 END SELECT
288

References b71, j12, k75, psi_mom_b71(), psi_mom_j12(), and psi_mom_k75().

Referenced by resist_module::aerodynamicresistance(), cal_stab(), rsl_module::cal_z0_rsl(), rsl_module::rslprofile(), and rsl_module::rslprofile_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ b71

integer, parameter atmmoiststab_module::b71 = 4

Definition at line 10 of file suews_phys_atmmoiststab.f95.

10 INTEGER, PARAMETER :: B71 = 4 ! Businger et al (1971) modifed Hogstrom (1988)

Referenced by stab_phi_heat(), stab_phi_mom(), stab_psi_heat(), and stab_psi_mom().

◆ grav

real(kind(1d0)), parameter atmmoiststab_module::grav = 9.80665

Definition at line 5 of file suews_phys_atmmoiststab.f95.

5 REAL(KIND(1D0)), PARAMETER :: grav = 9.80665 !g - gravity - physics today august 1987

Referenced by cal_stab().

◆ j12

integer, parameter atmmoiststab_module::j12 = 2

Definition at line 8 of file suews_phys_atmmoiststab.f95.

8 INTEGER, PARAMETER :: J12 = 2 ! Cheng and Brutsaert (2005)

Referenced by stab_phi_heat(), stab_phi_mom(), stab_psi_heat(), and stab_psi_mom().

◆ k

real(kind(1d0)), parameter atmmoiststab_module::k = 0.4

Definition at line 4 of file suews_phys_atmmoiststab.f95.

4 REAL(KIND(1D0)), PARAMETER :: k = 0.4 !Von Karman's contant

Referenced by cal_stab(), and bluews_module::cbl_initial().

◆ k75

integer, parameter atmmoiststab_module::k75 = 3

Definition at line 9 of file suews_phys_atmmoiststab.f95.

9 INTEGER, PARAMETER :: k75 = 3 ! Kondo (1975) adopted by Campbell & Norman eqn 7.26 p 97

Referenced by stab_phi_heat(), stab_phi_mom(), stab_psi_heat(), and stab_psi_mom().

◆ neut_limit

real(kind(1d0)), parameter atmmoiststab_module::neut_limit = 1.E-2