Commit ea7a0324 authored by sbiri's avatar sbiri
Browse files

- fixed warning in line 91

- changed tolIn to "all" instead of "flux"
parent 2ab01484
...@@ -73,6 +73,7 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth): ...@@ -73,6 +73,7 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth):
res = AirSeaFluxCode(spd, t, sst, lat=lat, hum=['rh', rh], P=p, res = AirSeaFluxCode(spd, t, sst, lat=lat, hum=['rh', rh], P=p,
hin=hin, Rs=sw, tol=tolIn, gust=gustIn, hin=hin, Rs=sw, tol=tolIn, gust=gustIn,
cskin=cskinIn, meth=meth, L="ecmwf", n=30) cskin=cskinIn, meth=meth, L="ecmwf", n=30)
flg = res["flag"]
elif (inF == 'era5_r360x180.nc'): elif (inF == 'era5_r360x180.nc'):
#%% load era5_r360x180.nc #%% load era5_r360x180.nc
...@@ -87,7 +88,7 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth): ...@@ -87,7 +88,7 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth):
msk = lsm*icon msk = lsm*icon
T = np.array(fid.variables["t2m"])*msk T = np.array(fid.variables["t2m"])*msk
Td = np.array(fid.variables["d2m"])*msk Td = np.array(fid.variables["d2m"])*msk
sst = np.array(fid.variables["sst"])*msk sst = np.array(fid.variables["sst"])
sst = np.where(sst < -100, np.nan, sst)*msk sst = np.where(sst < -100, np.nan, sst)*msk
p = np.array(fid.variables["msl"])*msk/100 # to set hPa p = np.array(fid.variables["msl"])*msk/100 # to set hPa
lw = np.array(fid.variables["strd"])*msk/60/60 lw = np.array(fid.variables["strd"])*msk/60/60
...@@ -115,8 +116,8 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth): ...@@ -115,8 +116,8 @@ def toy_ASFC(inF, outF, gustIn, cskinIn, tolIn, meth):
hin=hin, hin=hin,
Rs=sw.reshape(len(tim), len(lon)*len(lat))[x, :], Rs=sw.reshape(len(tim), len(lon)*len(lat))[x, :],
Rl=lw.reshape(len(tim), len(lon)*len(lat))[x, :], Rl=lw.reshape(len(tim), len(lon)*len(lat))[x, :],
gust=gustIn, cskin=cskinIn, tol=tolIn, qmeth='WMO', gust=gustIn, cskin=cskinIn, tol=tolIn,
meth=meth, n=30, L="ecmwf") qmeth='Buck2', meth=meth, n=30, L="ecmwf")
a = temp.loc[:,"tau":"rh"] a = temp.loc[:,"tau":"rh"]
a = a.to_numpy() a = a.to_numpy()
flg[x, :] = temp["flag"] flg[x, :] = temp["flag"]
...@@ -533,7 +534,7 @@ else: ...@@ -533,7 +534,7 @@ else:
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
tolIn = input("Give tolerance option (to use default press enter): \n") tolIn = input("Give tolerance option (to use default press enter): \n")
if (tolIn == ''): if (tolIn == ''):
tolIn = ['flux', 1e-3, 0.1, 0.1] tolIn = ['all', 0.01, 0.01, 1e-05, 1e-3, 0.1, 0.1]
else: else:
tolIn = eval(tolIn) tolIn = eval(tolIn)
ext = ext+'tol'+tolIn[0] ext = ext+'tol'+tolIn[0]
......
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