Skip to content

Commit

Permalink
Generic plotting for global time series
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 committed Apr 11, 2024
1 parent b637e0d commit 5cb21cb
Show file tree
Hide file tree
Showing 12 changed files with 750 additions and 166 deletions.
58 changes: 58 additions & 0 deletions tests/integration/generated/test_debug2_chrysalis.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Use this cfg to test a pull request before merging.
# 1. Copy over the contents of template_complete_run.cfg.
# 2. Delete parts that aren't needed. `output` and `www` should include `zppy_test_debug2` rather than `zppy_test_complete_run`.
# 3. Iteratively debug/develop with this cfg.
# 4. Once it's working as expected, copy important changes to template_complete_run.cfg.

[default]
case = v2.LR.historical_0201
constraint = ""
dry_run = "False"
environment_commands = ""
input = "/lcrc/group/e3sm/ac.forsyth2//E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
# To run this test, edit `output` and `www` in this file, along with `actual_images_dir` in test_debug2.py
output = "/lcrc/group/e3sm/ac.forsyth2/zppy_test_debug2_output/unique_id/v2.LR.historical_0201"
partition = "debug"
qos = "regular"
www = "/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_test_debug2_www/unique_id"

[ts]
active = True
e3sm_to_cmip_environment_commands = ""
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate zppy_dev_with_nco_20240405"
walltime = "00:30:00"
years = "1850:1854:2",

[[ atm_monthly_glb ]]
# Note global average won't work for 3D variables.
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
years = "1850:1860:5",

[mpas_analysis]
active = True
anomalyRefYear = 1850
climo_years ="1850-1854", "1855-1860",
enso_years = "1850-1854", "1855-1860",
mesh = "EC30to60E2r2"
parallelTaskCount = 6
partition = "compute"
qos = "regular"
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"

[global_time_series]
active = True
climo_years ="1850-1854", "1855-1860",
experiment_name = "v2.LR.historical_0201"
figstr = "v2_historical_0201"
moc_file=mocTimeSeries_1850-1860.nc
regions="glb"
ts_num_years = 5
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",
57 changes: 57 additions & 0 deletions tests/integration/generated/test_debug3_chrysalis.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Use this cfg to test a pull request before merging.
# 1. Copy over the contents of template_complete_run.cfg.
# 2. Delete parts that aren't needed. `output` and `www` should include `zppy_test_debug3` rather than `zppy_test_complete_run`.
# 3. Iteratively debug/develop with this cfg.
# 4. Once it's working as expected, copy important changes to template_complete_run.cfg.

[default]
case = v2.LR.BGC-LNDATM.CONTRL
constraint = ""
dry_run = "False"
environment_commands = ""
#input = "/lcrc/group/e3sm/ac.forsyth2//E3SMv2/v2.LR.historical_0201"
input = "/lcrc/group/e3sm/ac.sfeng1/E3SM_Simulations/20221127.v2.LR.BGC-LNDATM.CONTRL.ne30pg2_r05_EC30to60E2r2.chrysalis"
input_subdir = archive/atm/hist
mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc"
# To run this test, edit `output` and `www` in this file, along with `actual_images_dir` in test_complete_run.py
output = "/lcrc/group/e3sm/ac.forsyth2/zppy_test_debug3_output/unique_id/20221127.v2.LR.BGC-LNDATM.CONTRL.ne30pg2_r05_EC30to60E2r2.chrysalis"
partition = "debug"
qos = "regular"
#vars = "TREFHT,FSNTOA,FLUT,PRECC,PRECL,QFLX,TS,FSNT,FLNT,TOTSOMC,TOTECOSYSC,NEE,TOTVEGC"
www = "/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_test_debug3_www/unique_id"

[ts]
active = True
e3sm_to_cmip_environment_commands = ""
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate zppy_dev_with_nco_20240405"
walltime = "00:30:00"

[[ atm_monthly_glb ]]
# Note global average won't work for 3D variables.
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
# First 6 are for the original plots.
vars = "TREFHT,FSNTOA,FLUT,PRECC,PRECL,QFLX,TS,FSNT,FLNT"
years = "1880:1890:5",

[[ lnd_monthly_glb ]]
frequency = "monthly"
input_files = "elm.h0"
input_subdir = "archive/lnd/hist"
mapping_file = "glb"
vars = "TOTSOMC,TOTECOSYSC,NBP,TOTVEGC"
years = "1880:1890:5",

[global_time_series]
active = True
atmosphere_only = "True"
experiment_name = "v2.LR.BGC-LNDATM.CONTRL"
figstr = "v2.LR.BGC-LNDATM.CONTRL"
plots_original = "net_toa_flux_restom,global_surface_air_temperature,toa_radiation,net_atm_energy_imbalance,change_ohc,max_moc,change_sea_level,net_atm_water_imbalance"
plots_atm = "RESSURF,TS,FSNT,FLNT"
plots_lnd = "TOTSOMC,TOTECOSYSC,NBP,TOTVEGC"
ts_num_years = 5
walltime = "00:30:00"
years = "1880-1890",
41 changes: 41 additions & 0 deletions tests/integration/post.v3.LR.piControl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[default]
input = /lcrc/group/e3sm2/ac.golaz/E3SMv3/v3.LR.piControl
output = /lcrc/group/e3sm/ac.forsyth2/zppy_test_v3_output/v3/v3.LR.piControl
case = v3.LR.piControl
www = /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_test_v3_www/v3
partition = compute
environment_commands = "source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh"
campaign = "water_cycle"

[ts]
active = True
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate zppy_dev_with_nco_20240405"
years = "0001:0050:10",
walltime = "00:50:00"

[[ atm_monthly_glb ]]
input_subdir = "archive/atm/hist"
input_files = "eam.h0"
frequency = "monthly"
mapping_file = "glb"

[[ lnd_monthly_glb ]]
input_subdir = "archive/lnd/hist"
input_files = "elm.h0"
frequency = "monthly"
mapping_file = "glb"
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"


[global_time_series]
active = True
experiment_name = "v3.LR.piControl"
figstr = "v3.LR.piControl"
atmosphere_only = True
#plots_original = "net_toa_flux_restom,global_surface_air_temperature,toa_radiation,net_atm_energy_imbalance,change_ohc,max_moc,change_sea_level,net_atm_water_imbalance"
plots_lnd = "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"
ts_num_years = 10
walltime = "00:30:00"
years = "1-50",
climo_years ="1-50",
ts_years ="1-50",
58 changes: 58 additions & 0 deletions tests/integration/template_debug2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Use this cfg to test a pull request before merging.
# 1. Copy over the contents of template_complete_run.cfg.
# 2. Delete parts that aren't needed. `output` and `www` should include `zppy_test_debug2` rather than `zppy_test_complete_run`.
# 3. Iteratively debug/develop with this cfg.
# 4. Once it's working as expected, copy important changes to template_complete_run.cfg.

[default]
case = v2.LR.historical_0201
constraint = "#expand constraint#"
dry_run = "#expand dry_run#"
environment_commands = "#expand environment_commands#"
input = "#expand user_input#/E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
# To run this test, edit `output` and `www` in this file, along with `actual_images_dir` in test_debug2.py
output = "#expand user_output#zppy_test_debug2_output/#expand unique_id#/v2.LR.historical_0201"
partition = "#expand partition_short#"
qos = "#expand qos_short#"
www = "#expand user_www#zppy_test_debug2_www/#expand unique_id#"

[ts]
active = True
e3sm_to_cmip_environment_commands = "#expand e3sm_to_cmip_environment_commands#"
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate zppy_dev_with_nco_20240405"
walltime = "00:30:00"
years = "1850:1854:2",

[[ atm_monthly_glb ]]
# Note global average won't work for 3D variables.
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
years = "1850:1860:5",

[mpas_analysis]
active = True
anomalyRefYear = 1850
climo_years ="1850-1854", "1855-1860",
enso_years = "1850-1854", "1855-1860",
mesh = "EC30to60E2r2"
parallelTaskCount = 6
partition = "#expand partition_long#"
qos = "#expand qos_long#"
ts_years = "1850-1854", "1850-1860",
walltime = "#expand mpas_analysis_walltime#"

[global_time_series]
active = True
climo_years ="1850-1854", "1855-1860",
experiment_name = "v2.LR.historical_0201"
figstr = "v2_historical_0201"
moc_file=mocTimeSeries_1850-1860.nc
regions="glb"
ts_num_years = 5
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",
57 changes: 57 additions & 0 deletions tests/integration/template_debug3.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Use this cfg to test a pull request before merging.
# 1. Copy over the contents of template_complete_run.cfg.
# 2. Delete parts that aren't needed. `output` and `www` should include `zppy_test_debug3` rather than `zppy_test_complete_run`.
# 3. Iteratively debug/develop with this cfg.
# 4. Once it's working as expected, copy important changes to template_complete_run.cfg.

[default]
case = v2.LR.BGC-LNDATM.CONTRL
constraint = "#expand constraint#"
dry_run = "#expand dry_run#"
environment_commands = "#expand environment_commands#"
#input = "#expand user_input#/E3SMv2/v2.LR.historical_0201"
input = "/lcrc/group/e3sm/ac.sfeng1/E3SM_Simulations/20221127.v2.LR.BGC-LNDATM.CONTRL.ne30pg2_r05_EC30to60E2r2.chrysalis"
input_subdir = archive/atm/hist
mapping_file = "map_r05_to_cmip6_180x360_aave.20231110.nc"
# To run this test, edit `output` and `www` in this file, along with `actual_images_dir` in test_complete_run.py
output = "#expand user_output#zppy_test_debug3_output/#expand unique_id#/20221127.v2.LR.BGC-LNDATM.CONTRL.ne30pg2_r05_EC30to60E2r2.chrysalis"
partition = "#expand partition_short#"
qos = "#expand qos_short#"
#vars = "TREFHT,FSNTOA,FLUT,PRECC,PRECL,QFLX,TS,FSNT,FLNT,TOTSOMC,TOTECOSYSC,NEE,TOTVEGC"
www = "#expand user_www#zppy_test_debug3_www/#expand unique_id#"

[ts]
active = True
e3sm_to_cmip_environment_commands = "#expand e3sm_to_cmip_environment_commands#"
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate zppy_dev_with_nco_20240405"
walltime = "00:30:00"

[[ atm_monthly_glb ]]
# Note global average won't work for 3D variables.
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
# First 6 are for the original plots.
vars = "TREFHT,FSNTOA,FLUT,PRECC,PRECL,QFLX,TS,FSNT,FLNT"
years = "1880:1890:5",

[[ lnd_monthly_glb ]]
frequency = "monthly"
input_files = "elm.h0"
input_subdir = "archive/lnd/hist"
mapping_file = "glb"
vars = "TOTSOMC,TOTECOSYSC,NBP,TOTVEGC"
years = "1880:1890:5",

[global_time_series]
active = True
atmosphere_only = "True"
experiment_name = "v2.LR.BGC-LNDATM.CONTRL"
figstr = "v2.LR.BGC-LNDATM.CONTRL"
plots_original = "net_toa_flux_restom,global_surface_air_temperature,toa_radiation,net_atm_energy_imbalance,change_ohc,max_moc,change_sea_level,net_atm_water_imbalance"
plots_atm = "RESSURF,TS,FSNT,FLNT"
plots_lnd = "TOTSOMC,TOTECOSYSC,NBP,TOTVEGC"
ts_num_years = 5
walltime = "00:30:00"
years = "1880-1890",
2 changes: 1 addition & 1 deletion tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def generate_cfgs(unified_testing=False, dry_run=False):
else:
expansions["dry_run"] = "False"

cfg_names = ["bundles", "complete_run", "debug"]
cfg_names = ["bundles", "complete_run", "debug", "debug2", "debug3"]
for cfg_name in cfg_names:
cfg_template = f"{git_top_level}/tests/integration/template_{cfg_name}.cfg"
cfg_generated = (
Expand Down
Loading

0 comments on commit 5cb21cb

Please sign in to comment.