Skip to content

Commit

Permalink
Refactor annual_cycle_zonal_mean
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhuzhang authored and tomvothecoder committed Jul 15, 2024
1 parent 8b90a38 commit befef87
Show file tree
Hide file tree
Showing 9 changed files with 1,233 additions and 184 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "OMI-MLS"
variables = ["SCO"]
ref_name = "OMI-MLS"
reference_name = "OMI-MLS"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "diverging_bwr.rgb"
contour_levels = [180,200,220,240,260,280,300,320,340,360,380]
diff_levels = [ -40, -30, -20, -15, -10, -5,-2,2, 5, 10, 15, 20, 30,40]

[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "OMI-MLS"
variables = ["TCO"]
ref_name = "OMI-MLS"
reference_name = "OMI-MLS"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "diverging_bwr.rgb"
contour_levels = [12,16,20,24,28,32,36,40,44]
diff_levels = [-20,-15,-10,-5,-2,2,5,10,15,20]

[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "SST_CL_HadISST"
variables = ["SST"]
ref_name = "HadISST_CL"
reference_name = "HadISST (Climatology)"
contour_levels = [-1, 0, 1, 3, 6, 9, 12, 15, 18, 20, 22, 24, 26, 28, 29]
diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.2, 0.2, 0.5, 1, 2, 3, 4, 5]


[#]
sets = ["annual_cycle_zonal_mean"]
case_id = "GPCP_v3.2"
variables = ["PRECT"]
ref_name = "GPCP_v3.2"
reference_name = "GPCP_v3.2"
test_colormap = "WhiteBlueGreenYellowRed.rgb"
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
diff_colormap = "BrBG"
contour_levels = [0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16]
diff_levels = [-5, -4, -3, -2, -1, -0.5, 0.5, 1, 2, 3, 4, 5]

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""
The template run script used for generating results on your development branch.
Steps:
1. Activate your conda dev env for your branch
2. `make install` to install the latest version of your branch code into the env
3. Copy this script into `auxiliary_tools/cdat_regression_testing/<ISSUE>-<SET_NAME>`
4. Update `SET_DIR` string variable
5. Update `SET_NAME` string variable.
- Options include: "lat_lon", "zonal_mean_xy", "zonal_mean_2d",
"zonal_mean_2d_stratosphere", "polar", "cosp_histogram",
"meridional_mean_2d", "annual_cycle_zonal_mean", "enso_diags", "qbo",
"area_mean_time_series", "diurnal_cycle", "streamflow", "arm_diags",
"tc_analysis", "aerosol_aeronet", "aerosol_budget", "mp_partition",
6. Run this script as a Python module
- `auxiliary_tools` is not included in `setup.py`, so `-m` is required
to run the script as a Python module
- Command: python -m auxiliary_tools.cdat_regression_testing.<ISSUE>-<SET_NAME>.<SCRIPT-NAME>
- Example: python -m auxiliary_tools.cdat_regression_testing.660_cosp_histogram.run_script
7. Run `chown -R o=rx <SET_DIR>` to allow public access to viewer outputs on the NERSC webserver
- Example: `chown -R o=rx /global/cfs/cdirs/e3sm/www/cdat-migration-fy24/654-zonal_mean_xy`
- https://portal.nersc.gov/project/e3sm/cdat-migration-fy24/
8. Make a copy of the CDAT regression testing notebook in the same directory
as this script and follow the instructions there to start testing.
9. <OPTIONAL> Update `CFG_PATH` to a custom cfg file to debug specific variables.
- It is useful to create a custom cfg based on the default diags to debug
specific variables that are running into problems.
- For example, copy `zonal_mean_xy_model_vs_model.cfg` into the same directory
as the copy of this script, then modify it to specific variables. Afterwards
update `CFG_PATH` to the path of that .cfg file.
- Tip: Use VS Code to step through the code with the Python debugger.
"""
from auxiliary_tools.cdat_regression_testing.base_run_script import run_set

# TODO: Update SETS_TO_RUN to the single set you are refactoring.
# Example: "lat_lon"
SET_NAME = "annual_cycle_zonal_mean"
# TODO: Update SET_DIR to <ISSUE-SET_NAME>. This string gets appended
# to the base results_dir, "/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/".
# Example: "669-annual_cycle_zonal_mean"
SET_DIR = "/global/cfs/cdirs/e3sm/www/cdat-migration-fy24/669-annual_cycle_zonal_mean"

# TODO: <OPTIONAL> UPDATE CFG_PATH if using a custom cfg file for debugging.
# Example: "auxiliary_tools/cdat_regression_testing/654_zonal_mean_xy.cfg"
# CFG_PATH = "/global/homes/c/chengzhu/e3sm_diags/auxiliary_tools/cdat_regression_testing/669-annual_cycle_zonal_mean/669-annual_cycle_zonal_mean.cfg"

CFG_PATH = "/global/homes/c/chengzhu/e3sm_diags/auxiliary_tools/cdat_regression_testing/669-annual_cycle_zonal_mean/annual_cycle_zonal_mean_model_vs_obs.cfg"
# TODO: <OPTIONAL> Update MULTIPROCESSING based on whether to run in parallel or
# serial. For debugging purposes, set to False to run serially.
MULTIPROCESSING = True
#MULTIPROCESSING = False

run_set(SET_NAME, SET_DIR, CFG_PATH, MULTIPROCESSING)
Loading

0 comments on commit befef87

Please sign in to comment.