Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Oct 8, 2024
1 parent 2ebb0b1 commit d6289af
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ush/HWP_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def check_restart_files(hourly_hwpdir, fcst_dates):
hourly_hwpdir: the directory where the RESTART data is copied (nwges/HOURLY_HWP)
fcst_dates: Forecast dates
Returns:
list of hwp_avail_hours, hwp_non_avail_hours
lists of hours with and without available RESTART files
"""
hwp_avail_hours = []
hwp_non_avail_hours = []
Expand All @@ -40,6 +40,11 @@ def check_restart_files(hourly_hwpdir, fcst_dates):
def copy_missing_restart(nwges_dir, hwp_non_avail_hours, hourly_hwpdir):
"""Check the restart files.
The script loops through hwp_non_avail_hours (missing files in
nwges/HOURLY_HWP) and determines if an alternative RESTART file in
nwges/fcst_fv3lam/RESTART is available instead. If so, it is
appended to restart_avail_hours.
Args:
nwges_dir: holds the boundary, INPUT, and RESTART files (e.g,
described here:
Expand All @@ -51,7 +56,9 @@ def copy_missing_restart(nwges_dir, hwp_non_avail_hours, hourly_hwpdir):
hwp_non_avail_hours: a list of hours without available RESTART files
hourly_hwpdir: the directory where the RESTART data is copied (nwges/HOURLY_HWP)
Returns:
list of (restart_avail_hours, restart_nonavail_hours_test)
list of::
- restart_avail_hours
- restart_nonavail_hours_test which is a subset of hwp_non_avail_hours.
"""
restart_avail_hours = []
Expand Down Expand Up @@ -118,7 +125,11 @@ def process_hwp(fcst_dates, hourly_hwpdir, cols, rows, intp_dir, rave_to_intp):
intp_dir: the working directory for smoke processing (${CYCLE_DIR}/process_smoke)
rave_to_intp: a string based on the grid name:: rave_to_intp = predef_grid+"intp"
Returns:
list of (hwp_ave_arr, xarr_hwp, totprcp_ave_arr, xarr_totprcp)
list of::
- average (through time) of HWP_AVE in the available RESTART files
- hwp_ave_arr converted to an xarray DataArray
- the total precipitation vector (totprcp) reshaped to the 2D grid
- totprcp_ave_arr converted to an xarray DataArray
"""
hwp_ave = []
totprcp = np.zeros((cols*rows))
Expand Down

0 comments on commit d6289af

Please sign in to comment.