From 8da9cbce3db66a63d971a7579c6dbbd987fdc4a0 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Tue, 26 Nov 2024 14:29:06 -0600 Subject: [PATCH 1/2] Add Viewer support --- ...time_series_comprehensive_v3_setup_only_chrysalis.cfg | 9 +++++++++ ...se_global_time_series_comprehensive_v3_setup_only.cfg | 9 +++++++++ zppy/defaults/default.ini | 7 +++++++ zppy/templates/global_time_series.bash | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg b/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg index ad7b5de1..baa48724 100644 --- a/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg +++ b/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg @@ -19,6 +19,15 @@ years = "1985:1989:2", active = True walltime = "00:30:00" + [[ land_monthly ]] + extra_vars = "area,landfrac" + frequency = "monthly" + input_files = "elm.h0" + input_subdir = "archive/lnd/hist" + mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc" + years = "1985:1995:5", + vars = "FSH,RH2M,LAISHA,LAISUN,QINTR,QOVER,QRUNOFF,QSOIL,QVEGE,QVEGT,SOILWATER_10CM,TSA,H2OSNO,TOTLITC,CWDC,SOIL1C,SOIL2C,SOIL3C,SOIL4C,WOOD_HARVESTC,TOTVEGC,NBP,GPP,AR,HR" + [[ atm_monthly_glb ]] # Note global average won't work for 3D variables. frequency = "monthly" diff --git a/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg b/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg index 3c743694..94c7e15e 100644 --- a/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg +++ b/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg @@ -19,6 +19,15 @@ years = "1985:1989:2", active = True walltime = "00:30:00" + [[ land_monthly ]] + extra_vars = "area,landfrac" + frequency = "monthly" + input_files = "elm.h0" + input_subdir = "archive/lnd/hist" + mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc" + years = "1985:1995:5", + vars = "FSH,RH2M,LAISHA,LAISUN,QINTR,QOVER,QRUNOFF,QSOIL,QVEGE,QVEGT,SOILWATER_10CM,TSA,H2OSNO,TOTLITC,CWDC,SOIL1C,SOIL2C,SOIL3C,SOIL4C,WOOD_HARVESTC,TOTVEGC,NBP,GPP,AR,HR" + [[ atm_monthly_glb ]] # Note global average won't work for 3D variables. frequency = "monthly" diff --git a/zppy/defaults/default.ini b/zppy/defaults/default.ini index d4c42a33..74082efc 100644 --- a/zppy/defaults/default.ini +++ b/zppy/defaults/default.ini @@ -305,7 +305,13 @@ figstr = string(default="") # The specific subdirectory with the ocean data # NOTE: always overrides value in [default] input_subdir = string(default="archive/ocn/hist") +# Set to True to construct a Viewer page +make_viewer = string(default="False") moc_file = string(default="") +# Number of columns per page +ncols = integer(default=2) +# Number of rows per page +nrows = integer(default=4) # The names of the plots you want displayed # Variable requirements: # net_toa_flux_restom requires RESTOM @@ -319,6 +325,7 @@ plots_original = string(default="net_toa_flux_restom,global_surface_air_temperat # These should be a subset of the `vars` generated by the `ts` `glb` subtasks. plots_atm = string(default="") plots_ice = string(default="") +# Set `plots_lnd = "all"` to run every variable in the land csv file. plots_lnd = string(default="") plots_ocn = string(default="") # regions to plot: glb, n, s (global, northern hemisphere, southern hemisphere) diff --git a/zppy/templates/global_time_series.bash b/zppy/templates/global_time_series.bash index fed2209e..8b1a2e0e 100644 --- a/zppy/templates/global_time_series.bash +++ b/zppy/templates/global_time_series.bash @@ -7,13 +7,14 @@ ################################################################################ results_dir={{ prefix }}_results -zi-global-time-series --use_ocn {{ use_ocn }} --input {{ input }} --input_subdir {{ input_subdir }} --moc_file {{ moc_file }} --case_dir {{ output }} --experiment_name {{ experiment_name }} --figstr {{ figstr }} --color {{ color }} --ts_num_years {{ ts_num_years }} --plots_original {{ plots_original }} --plots_atm {{ plots_atm }} --plots_ice {{ plots_ice }} --plots_lnd {{ plots_lnd }} --plots_ocn {{ plots_ocn }} --nrows 4 --ncols 2 --results_dir ${results_dir} --regions {{ regions }} --start_yr {{ year1 }} --end_yr {{ year2 }} +zi-global-time-series --use_ocn {{ use_ocn }} --input {{ input }} --input_subdir {{ input_subdir }} --moc_file {{ moc_file }} --case_dir {{ output }} --experiment_name {{ experiment_name }} --figstr {{ figstr }} --color {{ color }} --ts_num_years {{ ts_num_years }} --plots_original {{ plots_original }} --plots_atm {{ plots_atm }} --plots_ice {{ plots_ice }} --plots_lnd {{ plots_lnd }} --plots_ocn {{ plots_ocn }} --nrows {{ nrows }} --ncols {{ ncols }} --results_dir ${results_dir} --regions {{ regions }} --make_viewer {{ make_viewer }} --start_yr {{ year1 }} --end_yr {{ year2 }} echo 'Copy images to directory' results_dir_absolute_path={{ scriptDir }}/${results_dir} mkdir -p ${results_dir_absolute_path} cp ${results_dir}/*.pdf ${results_dir_absolute_path} cp ${results_dir}/*.png ${results_dir_absolute_path} +cp -r ${results_dir}/viewer ${results_dir_absolute_path} ################################################################################ case={{ case }} From d2e5bd9b5491a6ab3c332c41a5bac425162bfef3 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Fri, 20 Dec 2024 14:40:20 -0600 Subject: [PATCH 2/2] Use updated nco for zi input --- ...time_series_comprehensive_v3_setup_only_chrysalis.cfg | 9 --------- ...se_global_time_series_comprehensive_v3_setup_only.cfg | 9 --------- zppy/templates/ts.bash | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg b/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg index baa48724..ad7b5de1 100644 --- a/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg +++ b/tests/integration/generated/test_min_case_global_time_series_comprehensive_v3_setup_only_chrysalis.cfg @@ -19,15 +19,6 @@ years = "1985:1989:2", active = True walltime = "00:30:00" - [[ land_monthly ]] - extra_vars = "area,landfrac" - frequency = "monthly" - input_files = "elm.h0" - input_subdir = "archive/lnd/hist" - mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc" - years = "1985:1995:5", - vars = "FSH,RH2M,LAISHA,LAISUN,QINTR,QOVER,QRUNOFF,QSOIL,QVEGE,QVEGT,SOILWATER_10CM,TSA,H2OSNO,TOTLITC,CWDC,SOIL1C,SOIL2C,SOIL3C,SOIL4C,WOOD_HARVESTC,TOTVEGC,NBP,GPP,AR,HR" - [[ atm_monthly_glb ]] # Note global average won't work for 3D variables. frequency = "monthly" diff --git a/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg b/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg index 94c7e15e..3c743694 100644 --- a/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg +++ b/tests/integration/template_min_case_global_time_series_comprehensive_v3_setup_only.cfg @@ -19,15 +19,6 @@ years = "1985:1989:2", active = True walltime = "00:30:00" - [[ land_monthly ]] - extra_vars = "area,landfrac" - frequency = "monthly" - input_files = "elm.h0" - input_subdir = "archive/lnd/hist" - mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc" - years = "1985:1995:5", - vars = "FSH,RH2M,LAISHA,LAISUN,QINTR,QOVER,QRUNOFF,QSOIL,QVEGE,QVEGT,SOILWATER_10CM,TSA,H2OSNO,TOTLITC,CWDC,SOIL1C,SOIL2C,SOIL3C,SOIL4C,WOOD_HARVESTC,TOTVEGC,NBP,GPP,AR,HR" - [[ atm_monthly_glb ]] # Note global average won't work for 3D variables. frequency = "monthly" diff --git a/zppy/templates/ts.bash b/zppy/templates/ts.bash index de24489a..d5a1b71c 100644 --- a/zppy/templates/ts.bash +++ b/zppy/templates/ts.bash @@ -62,7 +62,7 @@ if grep -q "*" input.txt; then fi # Generate time series files # If the user-defined parameter "vars" is "", then ${vars}, defined above, will be too. -cat input.txt | ncclimo \ +cat input.txt | /home/ac.zender/bin_chrysalis/ncclimo --npo \ -c {{ case }} \ {%- if vars != '' %} -v ${vars} \