Skip to content

Commit

Permalink
Merge pull request #11 from geoglows/adapt_to_ecmwf2
Browse files Browse the repository at this point in the history
Adapt to ecmwf2
  • Loading branch information
msouff authored Nov 18, 2023
2 parents 96027ea + 3e2f734 commit fed4141
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ecflow_entities:
- PYSCRIPT
- WORKSPACE
- VPU
- OUTPUT_DIR
suite: geoglows_forecast
- name: rapid_forecast_task
variables:
Expand Down Expand Up @@ -99,6 +100,9 @@ rapid_exec: /path/to/rapid_exec
rapid_exec_dir: /path/to/rapid_exec_dir
rapid_subprocess_dir: /path/to/rapid_subprocess_dir

# forecast records variables
forecast_records_dir: /path/to/forecast_records_dir

# nco variables
nces_exec: /path/to/nces_exec

Expand Down
6 changes: 5 additions & 1 deletion geoglows_ecflow/geoglows_forecast_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def create_day_one_family(
family_name: str,
task_name: str,
vpu_list: list[str],
output_dir: str,
trigger: str,
is_local: bool = False,
) -> Family:
Expand All @@ -203,7 +204,7 @@ def create_day_one_family(
family_name (str): Name of the family group.
task_name (str): Name of the task.
vpu_list (list[str]): List of VPU codes.
nces_exec (str): Path to the nces executable.
output_dir (str): Path to forecast records output directory.
trigger (str): Trigger that will start this family.
is_local (bool, optional): True if the job is run locally.
Expand All @@ -222,6 +223,7 @@ def create_day_one_family(
# Create init flows tasks
task = Task(f"{task_name}_{vpu}")
task.add_variable("VPU", str(vpu))
task.add_variable("OUTPUT_DIR", output_dir)
if is_local:
if i > 0:
prev_vpu = vpu_list[i - 1]
Expand Down Expand Up @@ -311,6 +313,7 @@ def create(config_path: str) -> None:
rapid_exec = config["rapid_exec"]
rapid_exec_dir = config["rapid_exec_dir"]
rapid_subprocess_dir = config["rapid_subprocess_dir"]
forecast_records_dir = config["forecast_records_dir"]
nces_exec = config["nces_exec"]
aws_config = config["aws_config"]

Expand Down Expand Up @@ -410,6 +413,7 @@ def create(config_path: str) -> None:
day_one_family_name,
day_one_task_name,
vpu_list,
forecast_records_dir,
init_flows_family_name,
is_local=local_run,
)
Expand Down
7 changes: 6 additions & 1 deletion geoglows_ecflow/resources/day_one_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,19 @@ def update_forecast_records(
nargs=1,
help="VPU number",
)
parser.add_argument(
"output_dir",
nargs=1,
help="path to the forecast records output directory",
)

args = parser.parse_args()
workspace = args.workspace[0]
vpu = args.vpu[0]
rapid_input = os.path.join(workspace, "input")
rapid_output = os.path.join(workspace, "output")
returnperiods = os.path.join(workspace, "return_periods_dir")
forecast_records = os.path.join(workspace, "forecast_records")
forecast_records = args.output_dir[0]
rapid_output = os.path.join(workspace, "output")

# start logging
Expand Down

0 comments on commit fed4141

Please sign in to comment.