From 9f409a02c3bc7f95fabc2c229252ed35eb8ee943 Mon Sep 17 00:00:00 2001 From: Wei-Ting Hung <107704243+angehung5@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:59:33 -0400 Subject: [PATCH] Update global_data_process.py --- python/global_data_process.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python/global_data_process.py b/python/global_data_process.py index 627dcd49..a224b32e 100755 --- a/python/global_data_process.py +++ b/python/global_data_process.py @@ -152,8 +152,8 @@ def read_gfs_climatology(filename, lat, lon, varname): if varname == "pavd": ## map to met grids - yt = readin['lat'][:] - xt = readin['lon'][:] + yt = readin["lat"][:] + xt = readin["lon"][:] data = np.squeeze(readin[varname][:]) DATA = np.empty([data.shape[0], lat.shape[0], lat.shape[1]]) @@ -165,7 +165,7 @@ def read_gfs_climatology(filename, lat, lon, varname): data[ll, :, :].flatten(), yt.flatten(), xt.flatten(), - 'linear', + "linear", np.nan ) @@ -382,8 +382,8 @@ def read_frp_local(filename, lat, lon, fill_value): elif varname == "pavd": ATTNAME = ["long_name", "units", "missing_value"] - ATT = ["Plant area volume density profile", "m2/m3", fill_value] - DATA = read_gfs_climatology(f_can, lat, lon, "pavd") + ATT = ["Plant area volume density profile", "m2/m3", fill_value] + DATA = read_gfs_climatology(f_can, lat, lon, "pavd") elif varname == "mol": # Reference: @@ -444,25 +444,25 @@ def read_frp_local(filename, lat, lon, fill_value): output = Dataset(f_output, "a") output.createDimension("level", DATA.shape[0]) - var_bot = output.createVariable("layer_bottom", "i4", ("level", )) - var_top = output.createVariable("layer_top", "i4", ("level", )) + var_bot = output.createVariable("layer_bottom", "i4", ("level",)) + var_top = output.createVariable("layer_top", "i4", ("level",)) var = output.createVariable( varname, "float", ("time", "level", "grid_yt", "grid_xt"), - fill_value=fill_value + fill_value=fill_value, ) write_varatt(var, ATTNAME, ATT) write_varatt( var_bot, ["long_name", "units"], - ["height of the layer bottom above the ground", "m"] + ["height of the layer bottom above the ground", "m"], ) write_varatt( var_top, ["long_name", "units"], - ["height of the layer top above the ground", "m"] + ["height of the layer top above the ground", "m"], ) var_bot[:] = np.arange(0, 65 + 1, 5)