Skip to content
Snippets Groups Projects
Commit 474ab748 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

Merge branch 'main' into release

parents 405afab0 1a186793
No related branches found
No related tags found
No related merge requests found
Pipeline #5082 passed
......@@ -169,14 +169,24 @@ if __name__ == "__main__":
end_date if end_date <= model_end_date else model_end_date + timedelta(days=1)
)
if start_date > end_date:
logging.error("Model period not started. Quit.")
sys.exit()
logging.info(
f"Model start date {model_start_date}. Model end date {model_end_date}."
)
logging.info(
f"Start running model {model_id} for start date {start_date} and end date {end_date}"
f"Attempt to run model {model_id} for start date {start_date} and end date {end_date} (today + 2 days)"
)
# Ensure that model is not run after model run period (include 2 extra days at the end to replace forecast with reanalysed)
if model_end_date + timedelta(days=2) < end_date:
logging.error(f"{end_date} is after model period end (+ 2 days) {model_end_date + timedelta(days=2)}. Quit.")
sys.exit()
# Ensure that model is not run before model run period
if today < start_date:
logging.error("Model period not started. Quit.")
sys.exit()
weather_data_file = weather_data_dir + today.strftime(weather_data_filename_pattern)
max_temp_in_period_file = f"{tmp_dir}{year}_max_temp_for_period.nc"
unmasked_result_file = f"{tmp_dir}{year}_unmasked_result.nc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment