Skip to content

Commit

Permalink
Temporarily turn off jinja template variable existence test for RRFS …
Browse files Browse the repository at this point in the history
…dev.
  • Loading branch information
danielabdi-noaa committed Mar 10, 2023
1 parent ed89733 commit 7881c7f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
14 changes: 13 additions & 1 deletion parm/FV3LAM_wflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ MODULES_RUN_TASK_FP script.
{%- if do_rrfs_dev %}

<!-- beginning of meta block for prod spinup -->
{%- if do_smoke_dust or do_nonvar_cldanal or do_refl2tten or do_enkf_radar_ref or do_envar_radar_ref %}
<metatask name="data_preprocessing">

{%- if do_spinup %}
Expand Down Expand Up @@ -926,7 +927,12 @@ MODULES_RUN_TASK_FP script.
************************************************************************
-->
{%- endif %}
<!--
************************************************************************
************************************************************************
-->
</metatask>
{%- endif %}
<!-- end of meta block for prod spinup -->

{%- endif %}
Expand Down Expand Up @@ -2337,6 +2343,7 @@ MODULES_RUN_TASK_FP script.
************************************************************************
************************************************************************
-->
{%- if tn_prep_cyc_prod %}
<task name="&TN_PREP_CYC_PROD;{{ uscore_ensmem_name }}" cycledefs="prodcyc,prodcyc_long" maxtries="{{ maxtries_run_prepstart }}">

&RSRV_DEFAULT;
Expand Down Expand Up @@ -2452,6 +2459,7 @@ MODULES_RUN_TASK_FP script.
</dependency>

</task>
{%- endif %}
<!--
************************************************************************
************************************************************************
Expand Down Expand Up @@ -3387,7 +3395,7 @@ MODULES_RUN_TASK_FP script.
************************************************************************
************************************************************************
-->
{%- if do_rrfs_dev %}
{%- if do_rrfs_dev and wtime_run_fcst_long %}
<task name="&TN_RUN_FCST;_prod_long{{ uscore_ensmem_name }}" cycledefs="prodcyc_long" maxtries="{{ maxtries_run_fcst }}">

&RSRV_FCST;
Expand Down Expand Up @@ -3480,6 +3488,7 @@ MODULES_RUN_TASK_FP script.
{%- if not do_ensfcst %}
{%- if not is_rtma %}
{%- if do_rrfs_dev %}
{%- if tn_save_restart %}
<metatask name="&TN_SAVE_RESTART;_prod">

<var name="fhr"> {{ restart_interval }} </var>
Expand Down Expand Up @@ -3574,6 +3583,7 @@ MODULES_RUN_TASK_FP script.
{%- endif %}
{%- endif %}
{%- endif %}
{%- endif %}
<!--
************************************************************************
************************************************************************
Expand Down Expand Up @@ -4183,6 +4193,7 @@ the <task> tag to be identical to the ones above for other output times.
{%- if do_rrfs_dev %}
{%- if machine in ["JET", "HERA"] %}
{%- if not do_ensemble %}
{%- if ppn_run_graphics %} <!-- maybe removed later -->
<!--
************************************************************************
************************************************************************
Expand Down Expand Up @@ -4275,6 +4286,7 @@ the <task> tag to be identical to the ones above for other output times.
{%- endif %}
{%- endif %}
{%- endif %}
{%- endif %}
<!--
************************************************************************
************************************************************************
Expand Down
6 changes: 3 additions & 3 deletions ush/config.rrfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ rrfs:
DO_SOIL_ADJUST: false # turn on later
DO_RADDA: false
DO_BUFRSND: false
DO_RRFS_DEV: false
DO_POST_SPINUP: false # true
DO_POST_PROD: false # true
DO_RRFS_DEV: true
DO_POST_SPINUP: false # turn on later
DO_POST_PROD: false # turn on later
cycledefs:
INITIAL_CYCLEDEF: '{{ [workflow.DATE_FIRST_CYCL[0:8], "0300 ", workflow.DATE_LAST_CYCL[0:8], "2300 12:00:00"]|join }}'
BOUNDARY_CYCLEDEF: '{{ [workflow.DATE_FIRST_CYCL[0:8], "0000 ", workflow.DATE_LAST_CYCL[0:8], "2300 06:00:00"]|join }}'
Expand Down
8 changes: 7 additions & 1 deletion ush/fill_jinja_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ def parse_args(argv):
action="store_true",
help="Suppress all output",
)
parser.add_argument(
"-i",
"--ignore_undefined",
action="store_true",
help="Ignore undefined jinja template variables",
)
parser.add_argument(
"-u",
"--user_config",
Expand Down Expand Up @@ -279,7 +285,7 @@ def fill_jinja_template(argv):
tvars = {}
for var in template_vars:

if cfg.get(var, "NULL") == "NULL":
if (not cla.ignore_undefined) and (cfg.get(var, "NULL") == "NULL"):
raise KeyError(f"{var} does not exist in user-supplied settings!")

if not cla.quiet:
Expand Down
5 changes: 4 additions & 1 deletion ush/generate_FV3LAM_wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,11 @@ def generate_FV3LAM_wflow(ushdir, logfile: str = "log.generate_FV3LAM_wflow", de
# from the jinja template file.
#
try:
# Until all of RRFS is merged lets temporarily ignore undefined template variables
# This is needed to have all the workflow in at the beginning, then add testable tasks one
# one by one. Once everything is merged this should be removed.
fill_jinja_template(
["-q", "-u", settings_str, "-t", template_xml_fp, "-o", wflow_xml_fp]
["-i", "-q", "-u", settings_str, "-t", template_xml_fp, "-o", wflow_xml_fp]
)
except:
logging.info(
Expand Down

0 comments on commit 7881c7f

Please sign in to comment.