From b94fa262f6aae349b0a838fc186242ce793e902a Mon Sep 17 00:00:00 2001 From: awlostowski-noaa Date: Wed, 20 Apr 2022 12:01:52 -0600 Subject: [PATCH] quick bug fixes related to lastobs writing and initial time --- src/troute-nwm/src/nwm_routing/output.py | 4 +++- src/troute-nwm/src/nwm_routing/preprocess.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/troute-nwm/src/nwm_routing/output.py b/src/troute-nwm/src/nwm_routing/output.py index 4aed7ff9e..cbb6b27c4 100644 --- a/src/troute-nwm/src/nwm_routing/output.py +++ b/src/troute-nwm/src/nwm_routing/output.py @@ -340,12 +340,14 @@ def nwm_output_generator( # Write out LastObs as netcdf. # This is only needed if 1) streamflow nudging is ON and 2) a lastobs output # folder is provided by the user. + lastobs_output_folder = None + nudging_true = None streamflow_da = data_assimilation_parameters.get('streamflow_da', None) - nudging_true = streamflow_da.get('streamflow_nudging', None) if streamflow_da: lastobs_output_folder = streamflow_da.get( "lastobs_output_folder", None ) + nudging_true = streamflow_da.get('streamflow_nudging', None) if nudging_true and lastobs_output_folder: diff --git a/src/troute-nwm/src/nwm_routing/preprocess.py b/src/troute-nwm/src/nwm_routing/preprocess.py index 3f4358642..5b16c9ceb 100644 --- a/src/troute-nwm/src/nwm_routing/preprocess.py +++ b/src/troute-nwm/src/nwm_routing/preprocess.py @@ -607,6 +607,7 @@ def nwm_initial_warmstate_preprocess( q0, t0 = nhd_io.read_lite_restart( restart_parameters['lite_channel_restart_file'] ) + t0_str = None # build initial states from user-provided restart parameters else: