1+ """
2+ This script is designed to debug a specific issue in the E3SM Diagnostics tool
3+ (e3sm_diags) related to the tropical_subseasonal set. The bug occurs when
4+ processing year values less than 1000, resulting in the error:
5+ "ValueError: no ISO-8601 or cftime-string-like match for string: 1-01-01".
6+ This issue was reported in PR #971.
7+
8+ The script replicates the behavior of the following command-line invocation
9+ of e3sm_diags:
10+
11+ e3sm_diags tropical_subseasonal --no_viewer --reference_data_path '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/time-series' --test_data_path '/lcrc/group/e3sm2/ac.xzheng/E3SMv3_dev/20250404.wcycl1850.ne120pg2_r025_RRSwISC6to18E3r5.test4.chrysalis//post/atm/180x360_traave/ts/daily/1yr' --results_dir '/lcrc/group/e3sm/public_html/diagnostic_output/ac.zhang40/tests/tropical_subseasonal_time_fix' --case_id 'wavenumber-frequency' --ref_timeseries_input --test_timeseries_input --run_type 'model_vs_obs' --sets 'tropical_subseasonal' --variables 'PRECT' --seasons 'ANN' 'DJF' 'MAM' 'JJA' 'SON' --regions '15S15N' --regrid_tool 'xesmf' --regrid_method 'conservative_normed' --multiprocessing --num_workers '32' --backend 'cartopy' --output_format 'png' --output_format_subplot 'pdf' --canvas_size_w '1212' --canvas_size_h '1628' --figsize '8.5' '11.0' --dpi '150' --arrows --test_name 'v3.HR_test4' --short_test_name 'v3.HR_test4' --test_colormap 'cet_rainbow.rgb' --ref_name 'IMERG_Daily' --reference_name 'IMERG Daily' --reference_colormap 'cet_rainbow.rgb' --diff_title 'percent difference' --diff_colormap 'diverging_bwr.rgb' --granulate 'variables' 'plevs' 'regions' --selectors 'sets' 'seasons' --test_start_yr 2 --test_end_yr 18 --ref_start_yr 2001 --ref_end_yr 2010
12+
13+ The script uses the e3sm_diags Python API to configure and run the diagnostics
14+ with the same parameters as the command-line invocation. It is intended to
15+ help identify and resolve the issue with year values less than 1000.
16+ """
17+
18+ from e3sm_diags .parameter .core_parameter import CoreParameter
19+ from e3sm_diags .run import runner
20+ from e3sm_diags .parameter .tropical_subseasonal_parameter import TropicalSubseasonalParameter
21+
22+ # Set up parameters
23+ param = CoreParameter ()
24+ param .no_viewer = True
25+ param .reference_data_path = '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/time-series'
26+ param .test_data_path = '/lcrc/group/e3sm2/ac.xzheng/E3SMv3_dev/20250404.wcycl1850.ne120pg2_r025_RRSwISC6to18E3r5.test4.chrysalis//post/atm/180x360_traave/ts/daily/1yr'
27+ param .results_dir = '/lcrc/group/e3sm/public_html/diagnostic_output/ac.tvo/tests/tropical_subseasonal_time_fix'
28+ param .case_id = 'wavenumber-frequency'
29+ param .ref_timeseries_input = True
30+ param .test_timeseries_input = True
31+ param .run_type = 'model_vs_obs'
32+ param .sets = ['tropical_subseasonal' ]
33+ param .variables = ['PRECT' ]
34+ param .seasons = ['ANN' , 'DJF' , 'MAM' , 'JJA' , 'SON' ]
35+ param .regions = ['15S15N' ]
36+ param .regrid_tool = 'xesmf'
37+ param .regrid_method = 'conservative_normed'
38+ param .multiprocessing = True
39+ param .num_workers = 32
40+ param .output_format_subplot = ['pdf' ]
41+ param .canvas_size_w = 1212
42+ param .canvas_size_h = 1628
43+ param .figsize = [8.5 , 11.0 ]
44+ param .dpi = 150
45+ param .arrows = True
46+ param .short_test_name = 'v3.HR_test4'
47+ param .test_colormap = 'cet_rainbow.rgb'
48+ param .ref_name = 'IMERG_Daily'
49+ param .reference_name = 'IMERG Daily'
50+ param .reference_colormap = 'cet_rainbow.rgb'
51+ param .diff_title = 'percent difference'
52+ param .diff_colormap = 'diverging_bwr.rgb'
53+ param .granulate = ['variables' , 'plevs' , 'regions' ]
54+ param .selectors = ['sets' , 'seasons' ]
55+
56+
57+ trop_param = TropicalSubseasonalParameter ()
58+ trop_param .test_start_yr = 2
59+ trop_param .test_name = 'v3.HR_test4'
60+
61+ trop_param .test_end_yr = 18
62+ trop_param .ref_start_yr = 2001
63+ trop_param .ref_end_yr = 2010
64+
65+ # Run the diagnostics
66+ runner .sets_to_run = ['tropical_subseasonal' ]
67+ runner .run_diags ([param , trop_param ])
0 commit comments