Skip to content

Commit

Permalink
added era5 variable to plain_table_task.ecf
Browse files Browse the repository at this point in the history
  • Loading branch information
msouff committed Jun 1, 2020
1 parent 5571999 commit 20c6eec
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ecflow/run_rapid.def
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ suite run_rapid
edit ECF_HOME '/home/michael/host_share/rapid_run/ecflow'
task prep_task
edit PYSCRIPT '/home/michael/host_share/rapid_run/ecflow/iprep_ecf.py'
edit IO_LOCATION '/home/michael/host_share/rapid-io_init'
edit IO_LOCATION '/home/michael/host_share/japan-io'
edit RUNOFF_LOCATION '/home/michael/host_share/ecmwf'
family ensemble_family
trigger prep_task == complete
Expand Down Expand Up @@ -172,7 +172,7 @@ suite run_rapid
task plain_table_task
trigger ensemble_family == complete
edit PYSCRIPT '/home/michael/host_share/rapid_run/ecflow/spt_extract_plain_table.py'
edit OUT_LOCATION '/home/michael/host_share/rapid-io_init/output'
edit OUT_LOCATION '/home/michael/host_share/japan-io/output'
edit LOG_FILE '/home/michael/host_share/rapid_run/ecflow/run_rapid/ecf_out/plain_table.log'
edit NCES_EXEC '/home/michael/miniconda3/envs/ecflow/bin/nces'
endsuite
Expand Down
4 changes: 2 additions & 2 deletions ecflow/run_rapid.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def create_ensemble_family():

prep_task = suite.add_task('prep_task')
prep_task.add_variable("PYSCRIPT", os.path.join(home, 'iprep_ecf.py'))
prep_task.add_variable("IO_LOCATION", "/home/michael/host_share/rapid-io_init")
prep_task.add_variable("IO_LOCATION", "/home/michael/host_share/japan-io")
prep_task.add_variable("RUNOFF_LOCATION", "/home/michael/host_share/ecmwf")

suite += create_ensemble_family()

plain_table_task = suite.add_task('plain_table_task')
plain_table_task.add_trigger("ensemble_family == complete")
plain_table_task.add_variable("PYSCRIPT", os.path.join(home, 'spt_extract_plain_table.py'))
plain_table_task.add_variable("OUT_LOCATION", "/home/michael/host_share/rapid-io_init/output")
plain_table_task.add_variable("OUT_LOCATION", "/home/michael/host_share/japan-io/output")
plain_table_task.add_variable("LOG_FILE", os.path.join(home, 'run_rapid/ecf_out/plain_table.log'))
plain_table_task.add_variable("NCES_EXEC", "/home/michael/miniconda3/envs/ecflow/bin/nces")

Expand Down
2 changes: 1 addition & 1 deletion ecflow/run_rapid/plain_table_task.ecf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
%include <head.h>
/usr/bin/python3.6 %PYSCRIPT% %OUT_LOCATION% %LOG_FILE% %NCES_EXEC%
/usr/bin/python3.6 %PYSCRIPT% %OUT_LOCATION% %LOG_FILE% %NCES_EXEC% era5
%include <tail.h>
4 changes: 3 additions & 1 deletion ecflow/spt_extract_plain_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#################################################################

import os
from glob import glob
import sys
import multiprocessing as mp
import subprocess as sp
Expand Down Expand Up @@ -43,7 +44,8 @@ def extract_summary_table(workspace):
file_name = 'summary_table_{0}_{1}.csv'.format(full_name, date_string)

# creating pandas dataframe with return periods
rp_path = os.path.join(os.path.split(workspace)[0], 'return_periods_erai_t511_24hr_20100101to20141231.nc')
era_type = str(sys.argv[4])
rp_path = glob(os.path.join(os.path.split(workspace)[0], f'return_periods_{era_type}*.nc'))[0]
rp_ncfile = nc.Dataset(rp_path, 'r')

# extract values
Expand Down
4 changes: 2 additions & 2 deletions ecflow_era/run_rapid_era.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ suite run_rapid_era
task era_task
edit PYSCRIPT '/home/michael/host_share/rapid_run/ecflow_era/run_lsm.py'
edit RAPID_EXEC '/home/michael/rapid/run/rapid'
edit IO_LOCATION '/home/michael/host_share/rapid-io_init'
edit ERA_LOCATION '/home/michael/host_share/era_data'
edit IO_LOCATION '/home/michael/host_share/japan-io'
edit ERA_LOCATION '/home/michael/host_share/era5_data/era5_runoff_2001to2015'
endsuite
# enddef
4 changes: 2 additions & 2 deletions ecflow_era/run_rapid_era.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
prep_task = suite.add_task('era_task')
prep_task.add_variable("PYSCRIPT", os.path.join(home, 'run_lsm.py'))
prep_task.add_variable("RAPID_EXEC", '/home/michael/rapid/run/rapid')
prep_task.add_variable("IO_LOCATION", "/home/michael/host_share/rapid-io_init")
prep_task.add_variable("ERA_LOCATION", "/home/michael/host_share/era_data")
prep_task.add_variable("IO_LOCATION", "/home/michael/host_share/japan-io")
prep_task.add_variable("ERA_LOCATION", "/home/michael/host_share/era5_data/era5_runoff_2001to2015")

print(defs)

Expand Down
7 changes: 3 additions & 4 deletions run_seasonal_qinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
@author: michael
"""
from RAPIDpy.rapid import RAPID

qout = '/home/michael/host_share/rapid-io/output' \
'/south_america-col_negro_b' \
'/Qout_erai_t511_24hr_19800101to19961231.nc'
connt = '/home/michael/host_share/rapid-io/input' \
'/south_america-col_negro_b/rapid_connect.csv'



from RAPIDpy.rapid import RAPID

rapid_manager = RAPID(
Qout_file=qout,
rapid_connect_file=connt
Expand Down

0 comments on commit 20c6eec

Please sign in to comment.