Commit 4b9ce53a authored by sbiri's avatar sbiri
Browse files

Update AirSeaFluxCode.py, flux_subs.py files

parent 85cd62f3
...@@ -98,12 +98,12 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10, ...@@ -98,12 +98,12 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
10. neutral moisture exhange coefficient (cqn) 10. neutral moisture exhange coefficient (cqn)
11. star virtual temperature (tsrv) 11. star virtual temperature (tsrv)
12. star temperature (tsr) 12. star temperature (tsr)
13. star humidity (qsr) 13. star specific humidity (qsr)
14. star velocity (usr) 14. star wind speed (usr)
15. momentum stability function (psim) 15. momentum stability function (psim)
16. heat stability function (psit) 16. heat stability function (psit)
17. moisture stability function (psiq) 17. moisture stability function (psiq)
18. 10m neutral velocity (u10n) 18. 10m neutral wind speed (u10n)
19. 10m neutral temperature (t10n) 19. 10m neutral temperature (t10n)
20. 10m neutral virtual temperature (tv10n) 20. 10m neutral virtual temperature (tv10n)
21. 10m neutral specific humidity (q10n) 21. 10m neutral specific humidity (q10n)
...@@ -126,6 +126,9 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10, ...@@ -126,6 +126,9 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
"u": u10n<0, "q":q10n<0 "u": u10n<0, "q":q10n<0
"m": missing, "l": z/L<0.01, "m": missing, "l": z/L<0.01,
"i": convergence fail at n) "i": convergence fail at n)
38. gust wind speed (ug)
39. Bulk Richardson number (Rib)
40. relative humidity (rh)
2021 / Author S. Biri 2021 / Author S. Biri
""" """
...@@ -403,6 +406,7 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10, ...@@ -403,6 +406,7 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
zo = ref_ht/np.exp(kappa/np.sqrt(cd10n)) zo = ref_ht/np.exp(kappa/np.sqrt(cd10n))
# adjust neutral cdn at any output height # adjust neutral cdn at any output height
cdn = np.power(kappa/np.log(hout/zo), 2) cdn = np.power(kappa/np.log(hout/zo), 2)
# cd = np.power(kappa/(np.log(hout/zo)-psim), 2)
cd = cd_calc(cdn, h_out[0], h_out[0], psim) cd = cd_calc(cdn, h_out[0], h_out[0], psim)
# solve for zot, zoq from ct10n, cq10n # solve for zot, zoq from ct10n, cq10n
zot = ref_ht/(np.exp(kappa**2/(ct10n*np.log(ref_ht/zo)))) zot = ref_ht/(np.exp(kappa**2/(ct10n*np.log(ref_ht/zo))))
...@@ -410,6 +414,8 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10, ...@@ -410,6 +414,8 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
# adjust neutral ctn, cqn at any output height # adjust neutral ctn, cqn at any output height
ctn =np.power(kappa, 2)/(np.log(h_out[0]/zo)*np.log(h_out[1]/zot)) ctn =np.power(kappa, 2)/(np.log(h_out[0]/zo)*np.log(h_out[1]/zot))
cqn =np.power(kappa, 2)/(np.log(h_out[0]/zo)*np.log(h_out[2]/zoq)) cqn =np.power(kappa, 2)/(np.log(h_out[0]/zo)*np.log(h_out[2]/zoq))
# ct = np.power(kappa, 2)/((np.log(h_out[0]/zo)-psim)*(np.log(h_out[1]/zot)-psit))
# cq = np.power(kappa, 2)/((np.log(h_out[0]/zo)-psim)*(np.log(h_out[2]/zoq)-psiq))
ct, cq = ctcq_calc(cdn, cd, ctn, cqn, h_out[1], h_out[2], h_out[1], ct, cq = ctcq_calc(cdn, cd, ctn, cqn, h_out[1], h_out[2], h_out[1],
psit, psiq) psit, psiq)
uref = (spd-usr/kappa*(np.log(h_in[0]/h_out[0])-psim + uref = (spd-usr/kappa*(np.log(h_in[0]/h_out[0])-psim +
...@@ -519,4 +525,4 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10, ...@@ -519,4 +525,4 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
"ug", "Rib", "rh"]) "ug", "Rib", "rh"])
resAll["flag"] = flag resAll["flag"] = flag
return resAll return resAll
...@@ -123,7 +123,7 @@ def cd_calc(cdn, hin, hout, psim): ...@@ -123,7 +123,7 @@ def cd_calc(cdn, hin, hout, psim):
cdn : float cdn : float
neutral drag coefficient neutral drag coefficient
hin : float hin : float
original sensor height [m] wind speed height [m]
hout : float hout : float
reference height [m] reference height [m]
psim : float psim : float
...@@ -236,11 +236,11 @@ def ctcq_calc(cdn, cd, ctn, cqn, ht, hq, hout, psit, psiq): ...@@ -236,11 +236,11 @@ def ctcq_calc(cdn, cd, ctn, cqn, ht, hq, hout, psit, psiq):
cqn : float cqn : float
neutral moisture exchange coefficient neutral moisture exchange coefficient
ht : float ht : float
original temperature sensor height [m] original temperature height [m]
hq : float hq : float
original moisture sensor height [m] original moisture height [m]
hout : float hout : float
output height [m] reference height [m]
psit : float psit : float
heat stability function heat stability function
psiq : float psiq : float
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment