-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDAT Migration Phase 2: Refactor tc_analysis set (#829)
* start tc_analysis_refactor * update driver * update plotting * Clean up plotter - Remove unused variables - Make `plot_info` a constant called `PLOT_INFO`, which is now a dict of dicts - Reorder functions for top-down readability * Remove unused notebook --------- Co-authored-by: tomvothecoder <[email protected]>
- Loading branch information
1 parent
eed8a29
commit e0e3bab
Showing
4 changed files
with
466 additions
and
28 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
auxiliary_tools/cdat_regression_testing/668-tc_analysis/668-tc_analysis_run_script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
""" | ||
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 `chmod -R o=rx <SET_DIR>` to allow public access to viewer outputs on the NERSC webserver | ||
- Example: `chmod -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 = "tc_analysis" | ||
# 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: "671-lat-lon" | ||
SET_DIR = "688-tc_analysis" | ||
|
||
# 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: str | None = None | ||
|
||
# TODO: <OPTIONAL> Update MULTIPROCESSING based on whether to run in parallel or | ||
# serial. For debugging purposes, set to False to run serially. | ||
MULTIPROCESSING = True | ||
|
||
run_set(SET_NAME, SET_DIR, CFG_PATH, MULTIPROCESSING) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
from e3sm_diags.parameter.core_parameter import CoreParameter | ||
from e3sm_diags.parameter.tc_analysis_parameter import TCAnalysisParameter | ||
from e3sm_diags.run import runner | ||
|
||
param = CoreParameter() | ||
|
||
#param.test_data_path = '/Users/zhang40/Documents/ACME_simulations/E3SM_v1_H1_6hourly_TC/test' | ||
param.test_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/1_2/1_2' | ||
param.test_name = '20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis' | ||
param.test_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/extendedOutput.v3.LR.historical_0101/tc-analysis' | ||
param.test_name = 'extendedOutput.v3.LR.historical_0101' | ||
param.short_test_name = 'v3.LR.historical_threshold_1.0' | ||
param.reference_data_path = '/global/cfs/cdirs/e3sm/e3sm_diags/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/0_3/0_3' | ||
param.ref_name = '20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis' | ||
param.short_ref_name = 'threshold_0.3' | ||
param.run_type = 'model_vs_model' | ||
prefix = '/global/cfs/cdirs/e3sm/www/zhang40/tests' | ||
#param.multiprocessing = True | ||
#param.num_workers = 4 | ||
param.results_dir = os.path.join(prefix, 'tc_analysis_model_model') | ||
#param.test_timeseries_input = True | ||
#param.ref_timeseries_input = True | ||
param.test_start_yr = '2000' | ||
param.test_end_yr = '2014' | ||
param.ref_start_yr = '0051' | ||
param.ref_end_yr = '0060' | ||
|
||
runner.sets_to_run = ['tc_analysis'] | ||
runner.run_diags([param]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.