Skip to content

Commit

Permalink
Update global_data_process.py
Browse files Browse the repository at this point in the history
  • Loading branch information
angehung5 authored Apr 3, 2024
1 parent 7ac5991 commit adb5070
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/global_data_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
import os
import sys
from datetime import datetime, timedelta, timezone

import numpy as np
from netCDF4 import Dataset
from pysolar.solar import get_altitude
from scipy.interpolate import griddata


"""User Arguments"""
# Time: yyyymmddhhfff
timelist = sys.argv[1]
timelist = np.array(timelist.split(",")).astype(str)


"""User Options"""
path = "/groups/ESS/whung/canopy_wind/gfsv16_test_data" # work directory
ref_lev = 10 # reference height (m, a.g.l.)
Expand Down Expand Up @@ -194,7 +193,6 @@ def read_frp_local(filename, lat, lon, fill_value):
HH = inputtime[8:10] # hour in UTC
FH = inputtime[10:] # forecast hour, for met file only


# input/output files
f_met = (
path + "/gfs.t" + HH + "z." + YY + MM + DD + ".sfcf" + FH + ".nc"
Expand Down Expand Up @@ -271,7 +269,7 @@ def read_frp_local(filename, lat, lon, fill_value):
print("-----------!!!WARNING!!!-------------")
print("---!!!Climatological FRP is used!!!--")

os.system("cp " + f_met + " " + f_output) # copy gfs met file for appending
os.system("cp " + f_met + " " + f_output) # copy gfs met file for appending

"""Reading dimensions"""
print("------------------------------------")
Expand All @@ -296,7 +294,6 @@ def read_frp_local(filename, lat, lon, fill_value):
print("lat", lat.shape)
print("lon", lon.shape)


"""Adding canvar"""
print("------------------------------------")
print("---- Generating canopy variables...")
Expand Down Expand Up @@ -347,7 +344,7 @@ def read_frp_local(filename, lat, lon, fill_value):
DATA = (-1 * den * Cp * t2m * (fricv**3)) / (K * g * shtfl)
DATA[DATA > 500] = 500
DATA[DATA < -500] = -500

del [readin, t2m, fricv, shtfl]

elif varname == "csz":
Expand Down

0 comments on commit adb5070

Please sign in to comment.