Commit 5ebf3de2 authored by sbiri's avatar sbiri
Browse files

fix problematic flag "u"

parent 108595d0
......@@ -362,8 +362,8 @@ def AirSeaFluxCode(spd, T, SST, lat=None, hum=None, P=None, hin=18, hout=10,
u10n[ind] = wind[ind]-usr[ind]/kappa*(np.log(h_in[0, ind]/10) -
psim[ind])
flag = np.where((u10n < 0) & (flag == "n"), "u",
np.where((u10n < 0) & (flag != "n"), flag+[","]+["u"],
flag))
np.where((u10n < 0) & (flag != "u"),
flag+[","]+["u"], flag))
u10n = np.where(u10n < 0, np.nan, u10n)
itera[ind] = np.ones(1)*it
sensible = -rho*cp*usr*tsr
......
......@@ -94,8 +94,8 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth):
fid.close()
spd = np.sqrt(np.power(u, 2)+np.power(v, 2))
del u, v, fid
lsm = np.where(lsm >= 0, np.nan, 1) # reverse 0 on land 1 over ocean
icon = np.where(icon <= 0, np.nan, 1)
lsm = np.where(lsm > 0, np.nan, 1) # reverse 0 on land 1 over ocean
icon = np.where(icon < 0, np.nan, 1)
msk = lsm*icon
hin = np.array([10, 2, 2])
latIn = np.tile(lat, (len(lon), 1)).T.reshape(len(lon)*len(lat))
......@@ -127,7 +127,7 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth):
for i in range(39)])
res = np.moveaxis(res, 0, -1)
flg = np.where(np.isnan(msk.reshape(len(tim), len(lon)*len(lat))),
'm', flg)
'm', flg)
if (outF[-3:] == '.nc'):
if (inF == 'era5_r360x180.nc'):
#%% save NetCDF4
......
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