[Dart-dev] DART/branches Revision: 12889
dart at ucar.edu
dart at ucar.edu
Tue Oct 2 17:16:54 MDT 2018
thoar at ucar.edu
2018-10-02 17:16:54 -0600 (Tue, 02 Oct 2018)
63
Adding the renamed and new files from the git reorganization.
Added: DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/__init__.py
===================================================================
--- DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/__init__.py (rev 0)
+++ DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/__init__.py 2018-10-02 23:16:54 UTC (rev 12889)
@@ -0,0 +1,9 @@
+from .core import dartclasses
+from .core import setup_dart
+from .core.setup_experiment import *
+from .core import setup_experiment_tools
+from .core import setup_initial_ens
+from .core import setup_obs_prep
+from .core import setup_wrf_hydro
+from .core import setup_wrf_hydro_ens
+from .core import setup_wrf_hydro_ens_job
Property changes on: DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/__init__.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Rev Author HeadURL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/__init__.py
===================================================================
--- DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/__init__.py 2018-10-02 22:59:36 UTC (rev 12888)
+++ DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/__init__.py 2018-10-02 23:16:54 UTC (rev 12889)
Property changes on: DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/__init__.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Rev Author HeadURL Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/create_parameter_restart_file.py
===================================================================
--- DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/create_parameter_restart_file.py 2018-10-02 22:59:36 UTC (rev 12888)
+++ DART/branches/rma_wrfHydro/models/wrf_hydro/hydro_dart_py/hydrodartpy/core/create_parameter_restart_file.py 2018-10-02 23:16:54 UTC (rev 12889)
@@ -1,9 +1,10 @@
import argparse
+import datetime
import pathlib
import xarray as xa
# python3 create_parameter_restart_file.py \
-# /Users/jamesmcc/Downloads/test_param_restart_file.nc \
+# /Users/jamesmcc/Downloads/ \
# --hydro_rst /Users/jamesmcc/Downloads/croton_NY/NWM/RESTART/HYDRO_RST.2011-08-26_00_00_DOMAIN1 \
# --restart /Users/jamesmcc/Downloads/croton_NY/NWM/RESTART/RESTART.2011082600_DOMAIN1 \
# --existing_variables qlink1 qlink1 SNEQV \
@@ -81,7 +82,7 @@
# TODO(JLM): make either of the restart files optional, right now both are required even if not used.
def create_parameter_restart_file(
- out_file: str=None,
+ out_path: str=None,
out_mode: str='r',
hydro_rst_file: str=None,
restart_file: str=None,
@@ -90,18 +91,36 @@
values: list=None
):
+ hydro_rst_time = None
+ restart_time = None
+
if hydro_rst_file is not None:
hydro_rst = xa.open_dataset(hydro_rst_file)
+ hydro_rst_time = datetime.datetime.strptime(hydro_rst.Restart_Time, '%Y-%m-%d_%H:%M:%S')
if restart_file is not None:
restart = xa.open_dataset(restart_file)
+ restart_time_raw = restart.data_vars.get('Times').data[0].decode('utf-8')
+ restart_time = datetime.datetime.strptime(restart_time_raw, '%Y-%m-%d_%H:%M:%S')
- # create new file?
+ if hydro_rst_time is not None and restart_time is not None:
+ if hydro_rst_time != restart_time:
More information about the Dart-dev
mailing list