-
Notifications
You must be signed in to change notification settings - Fork 34
Extend snapshot support for other core sets and doc updates #1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
32161ad
Extend snapshot support for other core sets
chengzhuzhang c72549d
add new util module
chengzhuzhang 47ff468
fix tests
chengzhuzhang ca5c585
fix mean_2d_viewer
chengzhuzhang 5a81319
add testing scripts
chengzhuzhang d0bf718
clean up; clarify on input format for time_slices
chengzhuzhang 294648b
update testing scripts
chengzhuzhang 5acb1eb
update README.md for 3.1.0 new feature
chengzhuzhang bfd6ca1
Update documentation for v3.1.0 features and parameters
chengzhuzhang 1d9c55e
fix examples; update default set for lat_lon_native
chengzhuzhang f0e5426
Refactor implementation of I/O for retrieving time-sliced datasets
tomvothecoder 38f05f9
Add unit tests
tomvothecoder 9b598a1
Fix method reference in lat_lon_native_driver.py
tomvothecoder cd31762
Update e3sm_diags/driver/lat_lon_driver.py
tomvothecoder dc37922
Apply Copilot review suggestions
tomvothecoder 2312b65
minor doc change
chengzhuzhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
50 changes: 50 additions & 0 deletions
50
auxiliary_tools/debug/1013-snapshot-analysis-core-sets/T.cfg
This file contains hidden or 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,50 @@ | ||
| [#] | ||
| sets = ["lat_lon"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"] | ||
| plevs = [850.0] | ||
| contour_levels = [240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295] | ||
| diff_levels = [-5, -4, -3, -2, -1, -0.5, -0.25, 0.25, 0.5, 1, 2, 3, 4, 5] | ||
| regrid_method = "bilinear" | ||
|
|
||
| [#] | ||
| sets = ["polar"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["DJF", "MAM", "JJA", "SON"] | ||
| regions = ["polar_S", "polar_N"] | ||
| plevs = [850.0] | ||
| contour_levels = [230, 240, 250, 260, 270, 280, 290, 300, 310] | ||
| diff_levels = [-15, -10, -7.5, -5, -2.5, -1, 1, 2.5, 5, 7.5, 10, 15] | ||
|
|
||
| [#] | ||
| sets = ["zonal_mean_2d"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"] | ||
| contour_levels = [180,185,190,200,210,220,230,240,250,260,270,280,290,295,300] | ||
| diff_levels = [-3.0, -2.5, -2, -1.5, -1, -0.5, -0.25, 0.25, 0.5, 1, 1.5, 2, 2.5, 3.0] | ||
|
|
||
| [#] | ||
| sets = ["zonal_mean_2d_stratosphere"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"] | ||
| contour_levels = [180,185,190,200,210,220,230,240,250,260,270,280,290,295,300] | ||
| diff_levels = [-8, -6,-4,-2, -1, -0.5, 0.5, 1, 2, 4,6, 8] | ||
|
|
||
| [#] | ||
| sets = ["zonal_mean_xy"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"] | ||
| plevs = [850.0] | ||
|
|
||
| [#] | ||
| sets = ["meridional_mean_2d"] | ||
| case_id = "model_vs_model" | ||
| variables = ["T"] | ||
| seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"] | ||
| contour_levels = [180,185,190,200,210,220,230,240,250,260,270,280,290,295,300] | ||
| diff_levels = [-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7] |
93 changes: 93 additions & 0 deletions
93
auxiliary_tools/debug/1013-snapshot-analysis-core-sets/run_snapshot_core.py
This file contains hidden or 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,93 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| This script runs e3sm_diags with the core sets to visualize snap-shot data. | ||
| """ | ||
|
|
||
| import os | ||
| import sys | ||
|
|
||
| from e3sm_diags.parameter.core_parameter import CoreParameter | ||
| from e3sm_diags.run import runner | ||
|
|
||
| # Auto-detect username | ||
| username = os.environ.get('USER', 'unknown_user') | ||
|
|
||
| # Create parameter objects for 3 different runs | ||
| params = [] | ||
|
|
||
| ## (1) First test configuration | ||
| #param1 = LatLonNativeParameter() | ||
| #param1.results_dir = f"/lcrc/group/e3sm/public_html/diagnostic_output/{username}/tests/lat_lon_native_test_1" | ||
| #param1.test_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid" | ||
| #param1.test_name = "v3.LR.amip_0101" | ||
| #param1.short_test_name = "v3.LR.amip_0101" | ||
| #param1.reference_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid" | ||
| #param1.ref_name = "v3.HR.test4" | ||
| #param1.short_ref_name = "v3.HR.test4" | ||
| #param1.seasons = ["DJF"] | ||
| #param1.test_grid_file = "/lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc" | ||
| #param1.ref_grid_file = "/lcrc/group/e3sm/diagnostics/grids/ne120pg2.nc" | ||
| #param1.case_id = "model_vs_model" | ||
| #param1.run_type = "model_vs_model" | ||
| #params.append(param1) | ||
| # | ||
| ## (2) Second test configuration | ||
| #param2 = LatLonNativeParameter() | ||
| #param2.results_dir = f"/lcrc/group/e3sm/public_html/diagnostic_output/{username}/tests/lat_lon_native_test_2" | ||
| #param2.test_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid" | ||
| #param2.test_file = "v3.LR.amip_0101_DJF_climo.nc" | ||
| #param2.short_test_name = "v3.LR.amip_0101" | ||
| #param2.reference_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid" | ||
| #param2.ref_file = "v3.HR.test4_DJF_climo.nc" | ||
| #param2.short_ref_name = "v3.HR.test4" | ||
| #param2.seasons = ["DJF"] | ||
| #param2.test_grid_file = "/lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc" | ||
| #param2.ref_grid_file = "/lcrc/group/e3sm/diagnostics/grids/ne120pg2.nc" | ||
| #param2.case_id = "model_vs_model" | ||
| #param2.run_type = "model_vs_model" | ||
| #params.append(param2) | ||
|
|
||
| # (3) Third test configuration | ||
| param3 = CoreParameter() | ||
| param3.results_dir = f"/lcrc/group/e3sm/public_html/diagnostic_output/{username}/tests/1013-snapshot-analysis-core-sets" | ||
| param3.test_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/time-series/rgr" | ||
| param3.test_file = "T_005101_006012.nc" | ||
| param3.reference_data_path = "/lcrc/group/e3sm/public_html/e3sm_diags_test_data/postprocessed_e3sm_v2_data_for_e3sm_diags/20210528.v2rc3e.piControl.ne30pg2_EC30to60E2r2.chrysalis/time-series/rgr" | ||
| param3.ref_file = "T_005101_006012.nc" | ||
| param3.short_test_name = "v2 test" | ||
| param3.short_ref_name = "v2 test" | ||
| param3.time_slices = ["0","1"] | ||
| param3.case_id = "model_vs_model" | ||
| param3.run_type = "model_vs_model" | ||
| params.append(param3) | ||
|
|
||
| # Run the single diagnostic, comment out for complete diagnostics. | ||
| cfg_path = "auxiliary_tools/debug/1013-snapshot-analysis-core-sets/T.cfg" | ||
| sys.argv.extend(["--diags", cfg_path]) | ||
|
|
||
| runner.sets_to_run = ["lat_lon", | ||
| "zonal_mean_xy", | ||
| "zonal_mean_2d", | ||
| "zonal_mean_2d_stratosphere", | ||
| "polar", | ||
| "meridional_mean_2d",] | ||
|
|
||
| # Run each test sequentially | ||
| for i, param in enumerate(params, 1): | ||
| print(f"\n{'='*60}") | ||
| print(f"Running Test {i}: {param.results_dir}") | ||
| print(f"{'='*60}") | ||
|
|
||
| # Create results directory | ||
| if not os.path.exists(param.results_dir): | ||
| os.makedirs(param.results_dir) | ||
|
|
||
| # Run the diagnostic | ||
| runner.run_diags([param]) | ||
| print(f"Test {i} completed!") | ||
|
|
||
| print(f"\n{'='*60}") | ||
| print("All tests completed!") | ||
| print(f"{'='*60}") | ||
|
|
||
|
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including me!