Skip to content

Commit 1d9c55e

Browse files
committed
fix examples; update default set for lat_lon_native
1 parent bfd6ca1 commit 1d9c55e

File tree

5 files changed

+56
-28
lines changed

5 files changed

+56
-28
lines changed

e3sm_diags/driver/default_diags/lat_lon_native_model_vs_model.cfg

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sets = ["lat_lon_native"]
33
case_id = "model_vs_model"
44
variables = ["PRECT"]
55
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
6-
regions = ["global", "60S60N", "30S30N-150E90W"]
6+
regions = ["global"]
77
test_colormap = "WhiteBlueGreenYellowRed.rgb"
88
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
99
diff_colormap = "BrBG"
@@ -15,7 +15,7 @@ sets = ["lat_lon_native"]
1515
case_id = "model_vs_model"
1616
variables = ["PRECC"]
1717
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
18-
regions = ["global", "60S60N", "30S30N-150E90W"]
18+
regions = ["global"]
1919
test_colormap = "WhiteBlueGreenYellowRed.rgb"
2020
reference_colormap = "WhiteBlueGreenYellowRed.rgb"
2121
diff_colormap = "BrBG"
@@ -51,6 +51,7 @@ sets = ["lat_lon_native"]
5151
case_id = "model_vs_model"
5252
variables = ["SWCFSRF"]
5353
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
54+
regions = ["global"]
5455
contour_levels = [-170, -150, -135, -120, -105, -90, -75, -60, -45, -30, -15, 0, 15, 30, 45]
5556
diff_levels = [-30, -25, -20, -15, -10, -5, -2, 2, 5, 10, 15, 20, 25, 30]
5657

@@ -60,6 +61,7 @@ sets = ["lat_lon_native"]
6061
case_id = "model_vs_model"
6162
variables = ["LWCFSRF"]
6263
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
64+
regions = ["global"]
6365
contour_levels = [0, 10, 20, 30, 40, 50, 60, 70, 80]
6466
diff_levels = [-30, -25, -20, -15, -10, -5, -2, 2, 5, 10, 15, 20, 25, 30]
6567

@@ -69,6 +71,7 @@ sets = ["lat_lon_native"]
6971
case_id = "model_vs_model"
7072
variables = ["LHFLX"]
7173
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
74+
regions = ["global"]
7275
contour_levels = [0,5, 15, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300]
7376
diff_levels = [-75, -50, -25, -10, -5, -2, 2, 5, 10, 25, 50, 75]
7477

@@ -78,6 +81,7 @@ sets = ["lat_lon_native"]
7881
case_id = "model_vs_model"
7982
variables = ["SHFLX"]
8083
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
84+
regions = ["global"]
8185
contour_levels = [-100, -75, -50, -25, -10, 0, 10, 25, 50, 75, 100, 125, 150]
8286
diff_levels = [-75, -50, -25, -10, -5, -2, 2, 5, 10, 25, 50, 75]
8387

@@ -87,6 +91,7 @@ sets = ["lat_lon_native"]
8791
case_id = "model_vs_model"
8892
variables = ["NET_FLUX_SRF"]
8993
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
94+
regions = ["global"]
9095
contour_levels = [-200, -160, -120, -80, -40, 0, 40, 80, 120, 160, 200]
9196
diff_levels = [-75, -50, -25, -10, -5, -2, 2, 5, 10, 25, 50, 75]
9297

@@ -96,6 +101,7 @@ sets = ["lat_lon_native"]
96101
case_id = "model_vs_model"
97102
variables = ["TMQ"]
98103
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
104+
regions = ["global"]
99105
contour_levels = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60]
100106
diff_levels = [-12, -9, -6, -4, -3, -2, -1, 1, 2, 3, 4, 6, 9, 12]
101107

@@ -105,6 +111,7 @@ sets = ["lat_lon_native"]
105111
case_id = "model_vs_model"
106112
variables = ["QREFHT"]
107113
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
114+
regions = ["global"]
108115
contour_levels = [0.2, 0.5, 1, 2.5, 5, 7.5, 10, 12.5, 15, 17.5]
109116
diff_levels = [-5, -4, -3, -2, -1, -0.25, 0.25, 1, 2, 3, 4, 5]
110117

@@ -113,6 +120,7 @@ sets = ["lat_lon_native"]
113120
case_id = "model_vs_model"
114121
variables = ["U10"]
115122
seasons = ["ANN", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "DJF", "MAM", "JJA", "SON"]
123+
regions = ["global"]
116124
test_colormap = "PiYG_r"
117125
reference_colormap = "PiYG_r"
118126
contour_levels = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

examples/ex8-native-grid-visualization/README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ For your own data, ensure you have:
4040
### Using the Python Script
4141

4242
```bash
43-
# Edit ex8.py to set your output directory
44-
# Update the `prefix` variable to point to your web directory
45-
46-
# Run with default settings
43+
# Run with default settings (automatically uses your username for output directory)
4744
python ex8.py
4845

4946
# Run with multiprocessing for better performance
@@ -57,18 +54,28 @@ python ex8.py -d diags.cfg --multiprocessing --num_workers=32
5754

5855
```bash
5956
e3sm_diags lat_lon_native \
60-
--test_data_path /lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid \
61-
--test_file v3.LR.amip_0101.eam.h0.1989-12.nc \
62-
--test_grid_file /lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc \
63-
--reference_data_path /lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid \
64-
--ref_file v3.LR.amip_0101.eam.h0.1989-12.nc \
65-
--ref_grid_file /lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc \
66-
--results_dir /results/ex8_native_grid \
67-
--case_id model_vs_model \
57+
--no_viewer \
58+
--reference_data_path '/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid' \
59+
--test_data_path '/lcrc/group/e3sm/public_html/e3sm_diags_test_data/native_grid' \
60+
--results_dir '/lcrc/group/e3sm/public_html/diagnostic_output/$USER/e3sm_diags_examples/ex8_native_grid' \
61+
--case_id 'model_vs_model' \
62+
--run_type 'model_vs_model' \
63+
--sets 'lat_lon_native' \
64+
--variables 'TGCLDLWP' \
6865
--time_slices 0 \
69-
--run_type model_vs_model
66+
--main_title 'TGCLDLWP 0 global' \
67+
--contour_levels '10' '25' '50' '75' '100' '125' '150' '175' '200' '225' '250' \
68+
--short_test_name 'v3.LR.amip_0101' \
69+
--ref_file 'v3.LR.amip_0101.eam.h0.1989-12.nc' \
70+
--diff_colormap 'RdBu' \
71+
--diff_levels '-35' '-30' '-25' '-20' '-15' '-10' '-5' '5' '10' '15' '20' '25' '30' '35' \
72+
--test_grid_file '/lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc' \
73+
--ref_grid_file '/lcrc/group/e3sm/diagnostics/grids/ne30pg2.nc' \
74+
--test_file 'v3.LR.amip_0101.eam.h0.1989-12.nc'
7075
```
7176

77+
**Note:** Use `--no_viewer` for command-line usage to avoid directory creation issues. For HTML viewer output, use the Python script approach instead.
78+
7279
## Configuration File
7380

7481
The `diags.cfg` file allows you to customize:
@@ -86,7 +93,7 @@ The diagnostic will generate:
8693
- Difference plot (Test - Reference)
8794
- HTML viewer for browsing results
8895

89-
Results will be saved in: `<your_directory>/ex8_native_grid/viewer/`
96+
Results will be saved in: `/lcrc/group/e3sm/public_html/diagnostic_output/$USER/e3sm_diags_examples/ex8_native_grid/viewer/`
9097

9198
## Notes
9299

examples/ex8-native-grid-visualization/ex8.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
from e3sm_diags.parameter.lat_lon_native_parameter import LatLonNativeParameter
2020
from e3sm_diags.run import runner
2121

22+
# Auto-detect username
23+
username = os.environ.get('USER', 'unknown_user')
24+
2225
# Create parameter object
2326
param = LatLonNativeParameter()
2427

@@ -50,8 +53,7 @@
5053
param.antialiased = False
5154

5255
# Name of the folder where the results are stored.
53-
# Change `prefix` to use your directory.
54-
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
56+
prefix = f"/lcrc/group/e3sm/public_html/diagnostic_output/{username}/e3sm_diags_examples"
5557
param.results_dir = os.path.join(prefix, "ex8_native_grid")
5658

5759
# Below are more optional arguments.

examples/ex9-snapshot-analysis/README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,26 @@ python ex9.py -d diags.cfg --multiprocessing --num_workers=32
6969

7070
```bash
7171
e3sm_diags zonal_mean_2d \
72-
--test_data_path /path/to/test/data \
73-
--test_file T_005101_006012.nc \
74-
--reference_data_path /path/to/ref/data \
75-
--ref_file T_005101_006012.nc \
76-
--results_dir /results/ex9_snapshots \
77-
--case_id snapshot_comparison \
78-
--time_slices 0 1 2 \
79-
--run_type model_vs_model \
72+
--no_viewer \
73+
--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' \
74+
--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' \
75+
--results_dir '/lcrc/group/e3sm/public_html/diagnostic_output/$USER/e3sm_diags_examples/ex9_snapshot_analysis' \
76+
--case_id 'model_vs_model' \
77+
--run_type 'model_vs_model' \
78+
--sets 'zonal_mean_2d' \
79+
--variables 'T' \
80+
--time_slices 0 \
8081
--multiprocessing \
81-
--num_workers 32
82+
--main_title 'T 0 global' \
83+
--contour_levels '180' '185' '190' '200' '210' '220' '230' '240' '250' '260' '270' '280' '290' '295' '300' \
84+
--short_test_name 'v2 test' \
85+
--ref_file 'T_005101_006012.nc' \
86+
--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' \
87+
--test_file 'T_005101_006012.nc'
8288
```
8389

90+
**Note:** Use `--no_viewer` for command-line usage to avoid directory creation issues. For HTML viewer output, use the Python script approach instead.
91+
8492
**Important**: Do not use both `--time_slices` and `--seasons` in the same command!
8593

8694
## Configuration File

examples/ex9-snapshot-analysis/ex9.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
from e3sm_diags.parameter.core_parameter import CoreParameter
2929
from e3sm_diags.run import runner
3030

31+
# Auto-detect username
32+
username = os.environ.get('USER', 'unknown_user')
33+
3134
# Create parameter object
3235
param = CoreParameter()
3336

@@ -59,7 +62,7 @@
5962

6063
# Name of the folder where the results are stored.
6164
# Change `prefix` to use your directory.
62-
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
65+
prefix = f"/lcrc/group/e3sm/public_html/diagnostic_output/{username}/e3sm_diags_examples"
6366
param.results_dir = os.path.join(prefix, "ex9_snapshot_analysis")
6467

6568
# Below are more optional arguments.

0 commit comments

Comments
 (0)