From 9efa36771f8b4bbe20da991a286806a13248915b Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 30 Jan 2026 13:35:17 -0700 Subject: [PATCH 1/8] avoid nans and infs in plotting stats --- lib/plotting_functions.py | 43 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/lib/plotting_functions.py b/lib/plotting_functions.py index c48ac0c34..8761e8e75 100644 --- a/lib/plotting_functions.py +++ b/lib/plotting_functions.py @@ -785,13 +785,14 @@ def make_polar_plot(wks, case_nickname, base_nickname, pct = pctchange #check if pct has NaN's or Inf values and if so set them to 0 to prevent plotting errors - pct_0 = pct.where(np.isfinite(pct), np.nan) - pct_0 = pct_0.fillna(0.0) + pct = pct.where(np.isfinite(pct), np.nan) + pct = pct.fillna(0.0) + if isinstance(pct, ux.UxDataArray): pct_grid = pct.uxgrid - pct = ux.UxDataArray(pct_0,uxgrid=pct_grid) + pct = ux.UxDataArray(pct,uxgrid=pct_grid) else: - pct = pct_0 + pct = pct if (hemisphere.upper() == "NH") or (hemisphere == "Arctic"): proj = ccrs.NorthPolarStereo() @@ -2407,13 +2408,15 @@ def plot_zonal_mean_and_save(wks, case_nickname, base_nickname, # calculate the percent change pct = (azm - bzm) / np.abs(bzm) * 100.0 + #check if pct has NaN's or Inf values and if so set them to 0 to prevent plotting errors - pct_0 = pct.where(np.isfinite(pct), np.nan) - pct_0 = pct_0.fillna(0.0) + pct = pct.where(np.isfinite(pct), np.nan) + pct = pct.fillna(0.0) + if isinstance(pct, ux.UxDataArray): - pct = ux.UxDataArray(pct_0) + pct = ux.UxDataArray(pct) else: - pct = pct_0 + pct = pct # generate dictionary of contour plot settings: cp_info = prep_contour_plot(azm, bzm, diff, pct, **kwargs) @@ -2481,12 +2484,12 @@ def plot_zonal_mean_and_save(wks, case_nickname, base_nickname, # calculate the percent change pct = (azm - bzm) / np.abs(bzm) * 100.0 #check if pct has NaN's or Inf values and if so set them to 0 to prevent plotting errors - pct_0 = pct.where(np.isfinite(pct), np.nan) - pct_0 = pct_0.fillna(0.0) + pct = pct.where(np.isfinite(pct), np.nan) + pct = pct.fillna(0.0) if isinstance(pct, ux.UxDataArray): - pct = ux.UxDataArray(pct_0) + pct = ux.UxDataArray(pct) else: - pct = pct_0 + pct = pct fig, ax = plt.subplots(nrows=3) ax = [ax[0],ax[1],ax[2]] @@ -2636,12 +2639,12 @@ def plot_meridional_mean_and_save(wks, case_nickname, base_nickname, # calculate the percent change pct = (adata - bdata) / np.abs(bdata) * 100.0 #check if pct has NaN's or Inf values and if so set them to 0 to prevent plotting errors - pct_0 = pct.where(np.isfinite(pct), np.nan) - pct_0 = pct_0.fillna(0.0) + pct = pct.where(np.isfinite(pct), np.nan) + pct = pct.fillna(0.0) if isinstance(pct, ux.UxDataArray): - pct = ux.UxDataArray(pct_0) + pct = ux.UxDataArray(pct) else: - pct = pct_0 + pct = pct # plot-controlling parameters: xdim = 'lon' # the name used for the x-axis dimension @@ -2856,12 +2859,12 @@ def square_contour_difference(fld1, fld2, **kwargs): pct = (fld1 - fld2) / np.abs(fld2) * 100.0 #check if pct has NaN's or Inf values and if so set them to 0 to prevent plotting errors - pct_0 = pct.where(np.isfinite(pct), np.nan) - pct_0 = pct_0.fillna(0.0) + pct = pct.where(np.isfinite(pct), np.nan) + pct = pct.fillna(0.0) if isinstance(pct, ux.UxDataArray): - pct = ux.UxDataArray(pct_0) + pct = ux.UxDataArray(pct) else: - pct = pct_0 + pct = pct ## USE A DIVERGING COLORMAP CENTERED AT ZERO ## Special case is when min > 0 or max < 0 From 5277831796f5df67ef0b8a4c2e64355f8bb82f99 Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 30 Jan 2026 13:36:03 -0700 Subject: [PATCH 2/8] additional CAM deposition variables --- lib/ldf_variable_defaults.yaml | 72 +++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/lib/ldf_variable_defaults.yaml b/lib/ldf_variable_defaults.yaml index e77781539..dbc7d4880 100644 --- a/lib/ldf_variable_defaults.yaml +++ b/lib/ldf_variable_defaults.yaml @@ -142,7 +142,8 @@ QBOT: # atmospheric specific humidity category: "Atmosphere" scale_factor: 1 add_offset: 0 - #new_unit: "W m$^{-2}$" + new_unit: "kg kg{-1}$" + diff_contour_levels_range: [-5e-2, 5e-2, 5e-3] TBOT: category: "Atmosphere" @@ -154,13 +155,63 @@ TREFMNAV: # daily minimum of average 2m temperature colormap: "OrRd" contour_levels_range: [250, 310, 10] - TREFMXAV: # daily maximum of average 2m temperature category: "Atmosphere" colormap: "OrRd" contour_levels_range: [250, 310, 10] +NDEP_TO_SMINN: # atmospheric N deposition to soil mineral N + category: "Atmosphere" + #colormap: "copper_r" + diff_colormap: "BrBG_r" + diff_contour_levels_range: [-5, 5, 5e-1] + scale_factor: 86400 + add_offset: 0 + new_unit: "gN m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "gN m$^{-2}$ d$^{-1}$" + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000365 #days to years, gN/m2 to Tg globally + avg_method: 'sum' + table_unit: "Tg N y$^{-1}$" + +BCDEP: # total BC deposition (dry+wet) from atmosphere + category: "Atmosphere" + #colormap: "copper_r" + diff_colormap: "BrBG_r" + scale_factor: 86400 + add_offset: 0 + new_unit: "kg m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "kg m$^{-2}$ d$^{-1}$" + diff_contour_levels_range: [-2e-3, 2e-3, 5e-4] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + #diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + scale_factor_table: 0.365 #days to years, kg/m2 to Tg globally + avg_method: 'sum' + table_unit: "Tg y$^{-1}$" +DSTDEP: # total dust deposition (dry+wet) from atmosphere + category: "Atmosphere" + colormap: "copper_r" + diff_colormap: "BrBG_r" + scale_factor: 86400 + add_offset: 0 + new_unit: "kg m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "kg m$^{-2}$ d$^{-1}$" + diff_contour_levels_range: [-2e-3, 2e-3, 5e-4] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000365 #days to years, kg/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + #+++++++++++ # Category: Surface fluxes #+++++++++++ @@ -243,6 +294,7 @@ DSTFLXT: # total surface dust emission category: "Surface fluxes" colormap: "copper_r" diff_colormap: "BrBG_r" + diff_contour_range: [-2e-3, 2e-3, 5e-4] scale_factor: 86400 add_offset: 0 new_unit: "kg m$^{-2}$ d$^{-1}$" @@ -271,6 +323,22 @@ MEG_isoprene: avg_method: 'sum' table_unit: "Tg y$^{-1}$" +DSTFLXT: # total surface dust emission + category: "Surface fluxes" + colormap: "copper_r" + diff_colormap: "BrBG_r" + scale_factor: 86400 + add_offset: 0 + new_unit: "kg m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "kg m$^{-2}$ d$^{-1}$" + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000365 #days to years, kg/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + #+++++++++++ # Category: Hydrology From 731c57b044ec16fae369a4079b10d831a2656444 Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 30 Jan 2026 13:36:59 -0700 Subject: [PATCH 3/8] shuffle regional vars plotted --- scripts/plotting/regional_climatology.py | 16 +++++++++++----- scripts/plotting/regional_timeseries.py | 10 +++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/plotting/regional_climatology.py b/scripts/plotting/regional_climatology.py index 5713b4b79..cac0e67c7 100644 --- a/scripts/plotting/regional_climatology.py +++ b/scripts/plotting/regional_climatology.py @@ -76,12 +76,18 @@ def regional_climatology(adfobj): region_list = adfobj.region_list #TODO, make it easier for users decide on these? regional_climo_var_list = ['TSA','PREC','ELAI', - 'FSDS','FLDS','SNOWDP','ASA', - 'FSH','QRUNOFF_TO_COUPLER','ET','FCTR', - 'GPP','TWS','SOILWATER_10CM','FAREA_BURNED', + 'FSDS','FLDS','GPP','ASA', + 'QRUNOFF_TO_COUPLER','ET','FCTR','FCEV', + 'SNOWDP','QBOT','SOILWATER_10CM','FAREA_BURNED', ] - # Extract variables: +# regional_climo_var_list = ['TSA','PREC','ELAI', +# 'FSDS','FLDS','GPP','ASA', +# 'QRUNOFF_TO_COUPLER','ET','DSTDEP','NDEP', +# 'SNOWDP','QBOT','SOILWATER_10CM','BCDEP', +# ] + +# Extract variables: baseline_name = adfobj.get_baseline_info("cam_case_name", required=True) input_climo_baseline = Path(adfobj.get_baseline_info("cam_climo_loc", required=True)) # TODO hard wired for single case name: @@ -451,7 +457,7 @@ def getRegion_xarray(varDS, varName, # Convert lon to [0,360] if necessary longitude = varDS['lon'] varDS = varDS.assign_coords(lon= (longitude + 180) % 360) - print(f"Converted lon to [0,360] for variable {varName}") + #print(f"Converted lon to [0,360] for variable {varName}") # TODO is there a less brittle way to do this? if (area is not None) and (landfrac is not None): diff --git a/scripts/plotting/regional_timeseries.py b/scripts/plotting/regional_timeseries.py index 2fc7520c6..e8b6a0e47 100644 --- a/scripts/plotting/regional_timeseries.py +++ b/scripts/plotting/regional_timeseries.py @@ -76,11 +76,11 @@ def regional_timeseries(adfobj): region_list = adfobj.region_list #TODO, make it easier for users decide on these by adding to yaml file - regional_ts_var_list = ['TSA','PREC','ELAI', - 'FSDS','FLDS','SNOWDP','ASA', - 'FSH','QRUNOFF_TO_COUPLER','ET','FCTR', - 'GPP','TWS','SOILWATER_10CM','FAREA_BURNED', - ] + regional_ts_var_list = ['TSA','PREC','ELAI', + 'FSDS','FLDS','GPP','ASA', + 'QRUNOFF_TO_COUPLER','ET','FCTR','FCEV', + 'SNOWDP','QBOT','SOILWATER_10CM','FAREA_BURNED', + ] # Extract variables: #baseline_name = adfobj.get_baseline_info("cam_case_name", required=True) From 62a8223356c0ac5bf283c9cc2a899816845454d9 Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 30 Jan 2026 13:40:26 -0700 Subject: [PATCH 4/8] new regoins for regional plots --- config_clm_structured_plots.yaml | 41 +++++++++++++++++------------- config_clm_unstructured_plots.yaml | 2 ++ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/config_clm_structured_plots.yaml b/config_clm_structured_plots.yaml index 12508b64d..852bbb948 100644 --- a/config_clm_structured_plots.yaml +++ b/config_clm_structured_plots.yaml @@ -133,23 +133,23 @@ diag_cam_climo: calc_cam_climo: true #Location of CAM climatologies (to be created and then used by this script) - cam_climo_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_climo.cam_case_name}/climo + cam_climo_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_climo.cam_case_name}/lnd/proc/climo #Overwrite CAM climatology files? #If false, or not prsent, then already existing climatology files will be skipped: cam_overwrite_climo: false #Name of CAM case (or CAM run name): - cam_case_name: ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST + cam_case_name: ctsm5.4.004_bgc_f09_Oversaturation_131b_HIST #Case nickname #NOTE: if nickname starts with '0' - nickname must be in quotes! # ie '026a' as opposed to 026a #If missing or left blank, will default to cam_case_name - case_nickname: 'ctsm5.4_124_HIST' + case_nickname: '131b_Oversat' #Location of CAM history (h0) files: - cam_hist_loc: /glade/derecho/scratch/wwieder/archive/${diag_cam_climo.cam_case_name}/lnd/hist/ + cam_hist_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_climo.cam_case_name}/lnd/hist/ # If unstructured_plotting, a mesh file is required! mesh_file: /glade/campaign/cesm/cesmdata/inputdata/share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc @@ -157,7 +157,7 @@ diag_cam_climo: #model year when time series files should start: #Note: Leaving this entry blank will make time series # start at earliest available year. - start_year: 1850 + start_year: 1994 climo_start_year: 2004 #model year when time series files should end: @@ -182,7 +182,7 @@ diag_cam_climo: cam_overwrite_ts: false #Location where time series files are (or will be) stored: - cam_ts_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_climo.cam_case_name}/ts + cam_ts_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_climo.cam_case_name}/lnd/proc/ts #This third set of variables provide info for the CAM baseline climatologies. @@ -204,28 +204,28 @@ diag_cam_baseline_climo: cam_overwrite_climo: false #Name of CAM baseline case: - cam_case_name: ctsm5.4_5.3.068_PPEcal115f09_118_HIST + cam_case_name: ctsm5.4.004_bgc_f09_131_HIST #Baseline case nickname #NOTE: if nickname starts with '0' - nickname must be in quotes! # ie '026a' as opposed to 026a #If missing or left blank, will default to cam_case_name - case_nickname: 'ctsm5.4_118_HIST' + case_nickname: '131_HIST' #Location of CAM baseline history (h0) files: #Example test files - cam_hist_loc: /glade/derecho/scratch/wwieder/archive/${diag_cam_baseline_climo.cam_case_name}/lnd/hist/ + cam_hist_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_baseline_climo.cam_case_name}/lnd/hist/ # If unstructured_plotting, a mesh file is required! mesh_file: /glade/campaign/cesm/cesmdata/inputdata/share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc #Location of baseline CAM climatologies: - cam_climo_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_baseline_climo.cam_case_name}/climo + cam_climo_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_baseline_climo.cam_case_name}/lnd/proc/climo2 #model year when time series files should start: #Note: Leaving this entry blank will make time series # start at earliest available year. - start_year: 1850 + start_year: 1994 climo_start_year: 2004 #model year when time series files should end: @@ -249,7 +249,7 @@ diag_cam_baseline_climo: cam_overwrite_ts: false #Location where time series files are (or will be) stored: - cam_ts_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_baseline_climo.cam_case_name}/ts + cam_ts_loc: /glade/derecho/scratch/${user}/archive/${diag_cam_baseline_climo.cam_case_name}/lnd/proc/ts2 @@ -314,20 +314,21 @@ diag_var_list: - TOTECOSYSC - TOTSOMC_1m - ALTMAX + - TWS + - SOILWATER_10CM - FAREA_BURNED - DSTFLXT - MEG_isoprene - - TWS - GRAINC_TO_FOOD - - C13_GPP_pm - - C13_TOTVEGC_pm - - C14_GPP_pm - - C14_TOTVEGC_pm + #- C13_GPP_pm + #- C13_TOTVEGC_pm + #- C14_GPP_pm + #- C14_TOTVEGC_pm region_list: - Global - N Hemisphere Land - #- S Hemisphere Land + - S Hemisphere Land - Polar - Alaskan Arctic - Canadian Arctic @@ -344,12 +345,16 @@ region_list: - Western US - Central US - Eastern US + - CONUS - Europe + - East Asia + - Eurasia - Mediterranean - Central America - Amazonia - Central Africa - Indonesia + - S America - Brazil - Sahel - Southern Africa diff --git a/config_clm_unstructured_plots.yaml b/config_clm_unstructured_plots.yaml index fdb2a0da1..1de2cebcd 100644 --- a/config_clm_unstructured_plots.yaml +++ b/config_clm_unstructured_plots.yaml @@ -346,6 +346,8 @@ region_list: - Eastern US - CONUS - Europe + - East Asia + - Eurasia - Mediterranean - Central America - Amazonia From b4e12b49569dbed40e28ac13f65c7b7576f31d3c Mon Sep 17 00:00:00 2001 From: wwieder Date: Wed, 4 Feb 2026 17:21:57 -0700 Subject: [PATCH 5/8] better ranges on diffs --- lib/ldf_variable_defaults.yaml | 48 ++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/lib/ldf_variable_defaults.yaml b/lib/ldf_variable_defaults.yaml index dbc7d4880..9d7375ef5 100644 --- a/lib/ldf_variable_defaults.yaml +++ b/lib/ldf_variable_defaults.yaml @@ -82,6 +82,7 @@ TSA: # 2m air temperature colormap: "OrRd" contour_levels_range: [250, 310, 10] diff_colormap: "coolwarm" + diff_contour_range: [-5, 5, 1] pct_diff_colormap: "coolwarm" pct_diff_contour_levels: [-3,-2,-1,-0.5,-0.2,-0.1,0,0.1,0.2,0.5,1,2,3] scale_factor: 1 @@ -105,6 +106,7 @@ PREC: # RAIN + SNOW colorbar: label : "mm d$^{-1}$" diff_colormap: "BrBG" + diff_contour_range: [-5, 5, 1] pct_diff_colormap: "PuOr_r" pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] @@ -113,7 +115,7 @@ FLDS: # atmospheric longwave radiation colormap: "Oranges" contour_levels_range: [100, 500, 25] diff_colormap: "BrBG" - diff_contour_range: [-20, 20, 2] + diff_contour_range: [-15, 15, 2] scale_factor: 1 add_offset: 0 new_unit: "W m$^{-2}$" @@ -128,6 +130,7 @@ FLDS: # atmospheric longwave radiation FSDS: # atmospheric incident solar radiation category: "Atmosphere" + diff_contour_range: [-15, 15, 2] pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] pct_diff_colormap: "PuOr_r" new_unit: "W m$^{-2}$" @@ -137,34 +140,38 @@ FSDS: # atmospheric incident solar radiation WIND: # atmospheric air temperature category: "Atmosphere" + diff_contour_range: [-15, 15, 2] QBOT: # atmospheric specific humidity category: "Atmosphere" scale_factor: 1 add_offset: 0 new_unit: "kg kg{-1}$" - diff_contour_levels_range: [-5e-2, 5e-2, 5e-3] + diff_contour_range: [-0.001,0.001,0.0005] TBOT: category: "Atmosphere" colormap: "OrRd" contour_levels_range: [250, 310, 10] + diff_contour_range: [-5, 5, 1] TREFMNAV: # daily minimum of average 2m temperature category: "Atmosphere" colormap: "OrRd" contour_levels_range: [250, 310, 10] + diff_contour_range: [-5, 5, 1] TREFMXAV: # daily maximum of average 2m temperature category: "Atmosphere" colormap: "OrRd" contour_levels_range: [250, 310, 10] + diff_contour_range: [-5, 5, 1] NDEP_TO_SMINN: # atmospheric N deposition to soil mineral N category: "Atmosphere" #colormap: "copper_r" diff_colormap: "BrBG_r" - diff_contour_levels_range: [-5, 5, 5e-1] + diff_contour_range: [-5, 5, 5e-1] scale_factor: 86400 add_offset: 0 new_unit: "gN m$^{-2}$ d$^{-1}$" @@ -187,10 +194,9 @@ BCDEP: # total BC deposition (dry+wet) from atmosphere mpl: colorbar: label : "kg m$^{-2}$ d$^{-1}$" - diff_contour_levels_range: [-2e-3, 2e-3, 5e-4] + diff_contour_range: [-2e-3, 2e-3, 5e-4] pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] pct_diff_colormap: "PuOr_r" - #diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] scale_factor_table: 0.365 #days to years, kg/m2 to Tg globally avg_method: 'sum' table_unit: "Tg y$^{-1}$" @@ -205,7 +211,7 @@ DSTDEP: # total dust deposition (dry+wet) from atmosphere mpl: colorbar: label : "kg m$^{-2}$ d$^{-1}$" - diff_contour_levels_range: [-2e-3, 2e-3, 5e-4] + diff_contour_range: [-2e-3, 2e-3, 5e-4] pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] pct_diff_colormap: "PuOr_r" scale_factor_table: 0.000365 #days to years, kg/m2 to Pg globally @@ -243,14 +249,16 @@ RNET: # Net Radiation: FSA-FIRA category: "Surface fluxes" derivable_from: ["FSA", "FIRA"] new_unit: "W m$^{-2}$" + diff_contour_range: [-20, 20, 5] + ET: # latent heat: FCTR+FCEV+FGEV category: "Surface fluxes" derivable_from: ["FCTR","FCEV","FGEV"] colormap: "Purples" - contour_levels_range: [0, 220, 10] + contour_levels_range: [0, 150, 10] diff_colormap: "BrBG" - diff_contour_range: [-45, 45, 5] + diff_contour_range: [-25, 25, 5] scale_factor: 1 add_offset: 0 new_unit: "W m$^{-2}$" @@ -353,13 +361,13 @@ H2OSNO: # SNOWICE + SNOWLIQ SNOWDP: # snow height category: "Hydrology" - contour_levels: [-15.,-10.,-5.,-1.,-0.5,-0.1,0.,0.1,0.5,1.,5.,10.,15.] - diff_contour_levels: [-10.,-5.,-1.,-0.5,-0.1,0.,0.1,0.5,1.,5.,10.] + contour_levels: [0.,0.1,0.2,0.5,1,2,5,10,15,20] + diff_contour_levels: [-5.,-2.,-1.,-0.5,-0.2,-0.1,0.,0.1,0.2,0.5,1,2,5] new_unit: "m" TOTRUNOFF: # total liquid runoff category: "Hydrology" - derivable_from: ["QOVER","QDRAI","QRGWL"] #TODO, check accuracy + derivable_from: ["QOVER","QDRAI","QRGWL"] colormap: "Blues" scale_factor: 86400 add_offset: 0 @@ -378,6 +386,10 @@ TWS: # Terrestrial water storage category: "Hydrology" colormap: "Blues" +ZWT: # water table depth + category: "Hydrology" + colormap: "Blues" + QRUNOFF_TO_COUPLER: # runoff to coupler category: "Hydrology" colormap: "Blues" @@ -396,6 +408,18 @@ QRUNOFF_TO_COUPLER: # runoff to coupler #+++++++++++ # Category: Vegetation #+++++++++++ +TV: # vegetation temperature + category: "Vegetation" + colormap: "OrRd" + contour_levels_range: [250, 310, 10] + diff_colormap: "coolwarm" + diff_contour_range: [-5, 5, 1] + pct_diff_colormap: "coolwarm" + pct_diff_contour_levels: [-3,-2,-1,-0.5,-0.2,-0.1,0,0.1,0.2,0.5,1,2,3] + scale_factor: 1 + add_offset: 0 + new_unit: "K" + BTRANMN: # Transpiration beta factor category: "Vegetation" # Or hydrology? @@ -630,6 +654,8 @@ GRAINC_TO_FOOD: #+++++++++++ ALTMAX: # Active Layer Thickness category: "Soils" + contour_levels: [0.,0.1,0.2,0.5,1,2,5,10,20,40] + diff_contour_levels: [-10,-5,-2,-1,-0.5,-0.2,-0.1,0.,0.1,0.2,0.5,1,2,5,10] SOILWATER_10CM: # soil liquid water + ice in top 10cm of soil From 7164d6b383a3dde3ae518cd4c234e23caee9ae8f Mon Sep 17 00:00:00 2001 From: wwieder Date: Wed, 4 Feb 2026 17:22:34 -0700 Subject: [PATCH 6/8] new defaults to check cplhist --- lib/ldf_variable_cplhist.yaml | 384 ++++++++++++++++++++++++++++++++++ 1 file changed, 384 insertions(+) create mode 100644 lib/ldf_variable_cplhist.yaml diff --git a/lib/ldf_variable_cplhist.yaml b/lib/ldf_variable_cplhist.yaml new file mode 100644 index 000000000..9ab6e4d10 --- /dev/null +++ b/lib/ldf_variable_cplhist.yaml @@ -0,0 +1,384 @@ + +#This file lists out variable-specific defaults +#for plotting and observations. These defaults +#are: +# +# PLOTTING: +# +# colormap -> The colormap that will be used for filled contour plots. +# contour_levels -> A list of the specific contour values that will be used for contour plots. +# Cannot be used with "contour_levels_range". +# contour_levels_range -> The contour range that will be used for plots. +# Values are min, max, and stride. Cannot be used with "contour_levels". +# diff_colormap -> The colormap that will be used for filled contour different plots +# diff_contour_levels -> A list of the specific contour values thta will be used for difference plots. +# Cannot be used with "diff_contour_range". +# diff_contour_range -> The contour range that will be used for difference plots. +# Values are min, max, and stride. Cannot be used with "diff_contour_levels". +# scale_factor -> Amount to scale the variable (relative to its "raw" model values). +# add_offset -> Amount of offset to add to the variable (relatie to its "raw" model values). +# new_unit -> Variable units (if not using the "raw" model units). +# mpl -> Dictionary that contains keyword arguments explicitly for matplotlib +# +# mask -> Setting that specifies whether the variable should be masked. +# Currently only accepts "landmask", which means the variable will be masked +# everywhere that isn't land. +# +# +# OBSERVATIONS: +# +# obs_file -> Path to observations file. If only the file name is given, then the file is assumed to +# exist in the path specified by "obs_data_loc" in the config file. +# obs_name -> Name of the observational dataset (mostly used for plotting and generated file naming). +# If this isn't present then the obs_file name is used. +# obs_var_name -> Variable in the observations file to compare against. If this isn't present then the +# variable name is assumed to be the same as the model variable name. +# +# +# +# WEBSITE: +# +# category -> The website category the variable will be placed under. +# +# +# DERIVING: +# +# derivable_from -> If not present in the available output files, the variable can be derived from +# other variables that are present (e.g. PRECT can be derived from PRECC and PRECL), +# which are specified in this list +# NOTE: this is not very flexible at the moment! It can only handle variables that +# are sums of the constituents. Futher flexibility is being explored. +# +# +# Final Note: Please do not modify this file unless you plan to push your changes back to the ADF repo. +# If you would like to modify this file for your personal ADF runs then it is recommended +# to make a copy of this file, make modifications in that copy, and then point the ADF to +# it using the "defaults_file" config variable. +# +#+++++++++++ + +#+++++++++++++ +# Available Land Default Plot Types +#+++++++++++++ + +default_ptypes: ["Tables","LatLon","TimeSeries", + "Arctic","RegionalClimo","RegionalTimeSeries","Special"] + +#+++++++++++++ +# Constants +#+++++++++++++ + +#seconds per day : +spd: 86400 +diff_levs: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] +pct_diff_contour_levels: [-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20] + +#+++++++++++++ +# Category: Atmosphere +#+++++++++++++ + +FSDSND: + category: "Atmosphere" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + new_unit: "W m$^{-2}$" +FSDSVD: + category: "Atmosphere" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + new_unit: "W m$^{-2}$" +FSDSNI: + category: "Atmosphere" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + new_unit: "W m$^{-2}$" +FSDSVI: + category: "Atmosphere" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PuOr_r" + new_unit: "W m$^{-2}$" + +RAIN_FROM_ATM: + category: "Atmosphere" + colormap: "cubehelix_r" + scale_factor: 86400 + add_offset: 0 + new_unit: "mm d$^{-1}$" + mpl: + colorbar: + label : "mm d$^{-1}$" + diff_colormap: "BrBG" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_colormap: "PuOr_r" + +SNOW_FROM_ATM: + category: "Atmosphere" + colormap: "cubehelix_r" + scale_factor: 86400 + add_offset: 0 + new_unit: "mm d$^{-1}$" + mpl: + colorbar: + label : "mm d$^{-1}$" + diff_colormap: "BrBG" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_colormap: "PuOr_r" + +FLDS_NOT_DOWNSCALED: + category: "Atmosphere" + colormap: "Oranges" + contour_levels_range: [100, 500, 25] + diff_colormap: "BrBG" + diff_contour_range: [-0.01, 0.01, 0.002] + scale_factor: 1 + add_offset: 0 + new_unit: "W m$^{-2}$" + mpl: + colorbar: + label : "W m$^{-2}$" + pct_diff_colormap: "PuOr_r" + +ZBOT: + category: "Atmosphere" + diff_contour_range: [-0.01, 0.01, 0.002] + +Tair_from_atm: + category: "Atmosphere" + colormap: "OrRd" + contour_levels_range: [250, 310, 10] + diff_colormap: "coolwarm" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_colormap: "coolwarm" + pct_diff_contour_levels: [-3,-2,-1,-0.5,-0.2,-0.1,0,0.1,0.2,0.5,1,2,3] + scale_factor: 1 + add_offset: 0 + new_unit: "K" + +Thair_from_atm: + category: "Atmosphere" + colormap: "OrRd" + contour_levels_range: [250, 310, 10] + diff_colormap: "coolwarm" + diff_contour_range: [-0.01, 0.01, 0.002] + pct_diff_colormap: "coolwarm" + pct_diff_contour_levels: [-3,-2,-1,-0.5,-0.2,-0.1,0,0.1,0.2,0.5,1,2,3] + scale_factor: 1 + add_offset: 0 + new_unit: "K" + +QBOT_NOT_DOWNSCALED: + category: "Atmosphere" + new_unit: "kg kg{-1}$" + diff_contour_range: [-0.001,0.001,0.0005] + +PBOT_NOT_DOWNSCALED: + category: "Atmosphere" + diff_contour_range: [-0.001,0.001,0.0005] +Rho_from_atm: + category: "Atmosphere" + diff_contour_range: [-0.001,0.001,0.0005] + +PCO2: + category: "Atmosphere" + diff_contour_range: [-0.001,0.001,0.0005] + +UWIND: + category: "Atmosphere" + diff_contour_range: [-0.001,0.001,0.0005] +VWIND: + category: "Atmosphere" + diff_contour_range: [-0.001,0.001,0.0005] + +#--------- +## MISC +#-------- +BCPHIDRY: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +BCPHODRY: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +BCPHIWET: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + new_unit: "kg m$^{-2}$ d$^{-1}$" + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +OCPHIDRY: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +OCPHODRY: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +OCPHIWET: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTWET1: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTDRY1: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTWET2: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTDRY2: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTWET3: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTDRY3: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + +DSTWET4: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +DSTDRY4: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + scale_factor: 86400000 + new_unit: "g m$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "g m$^{-2}$ d$^{-1}$" + pct_diff_colormap: "PuOr_r" + scale_factor_table: 0.000000365 #days to years, g/m2 to Pg globally + avg_method: 'sum' + table_unit: "Pg y$^{-1}$" + +ATM_TOPO: + category: "Misc" + diff_contour_range: [-0.001,0.001,0.0005] + +#End of File From 40c2b5c4d0fa03958d1a6b00ddd7e3003b63f305 Mon Sep 17 00:00:00 2001 From: wwieder Date: Wed, 4 Feb 2026 17:23:56 -0700 Subject: [PATCH 7/8] config files for checking cplhist --- config_clm_unstructured_CPLHIST.yaml | 365 +++++++++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 config_clm_unstructured_CPLHIST.yaml diff --git a/config_clm_unstructured_CPLHIST.yaml b/config_clm_unstructured_CPLHIST.yaml new file mode 100644 index 000000000..eee2eee2c --- /dev/null +++ b/config_clm_unstructured_CPLHIST.yaml @@ -0,0 +1,365 @@ +#============================== +#config_cam_baseline_example.yaml + +#This is the main CAM diagnostics config file +#for doing comparisons of a CAM run against +#another CAM run, or a CAM baseline simulation. + +#Currently, if one is on NCAR's Casper or +#Cheyenne machine, then only the diagnostic output +#paths are needed, at least to perform a quick test +#run (these are indicated with "MUST EDIT" comments). +#Running these diagnostics on a different machine, +#or with a different, non-example simulation, will +#require additional modifications. +# +#Config file Keywords: +#-------------------- +# +#1. Using ${xxx} will substitute that text with the +# variable referenced by xxx. For example: +# +# cam_case_name: cool_run +# cam_climo_loc: /some/where/${cam_case_name} +# +# will set "cam_climo_loc" in the diagnostics package to: +# /some/where/cool_run +# +# Please note that currently this will only work if the +# variable only exists in one location in the file. +# +#2. Using ${.xxx} will do the same as +# keyword 1 above, but specifies which sub-section the +# variable is coming from, which is necessary for variables +# that are repeated in different subsections. For example: +# +# diag_basic_info: +# cam_climo_loc: /some/where/${diag_cam_climo.start_year} +# +# diag_cam_climo: +# start_year: 1850 +# +# will set "cam_climo_loc" in the diagnostics package to: +# /some/where/1850 +# +#Finally, please note that for both 1 and 2 the keywords must be lowercase. +#This is because future developments will hopefully use other keywords +#that are uppercase. Also please avoid using periods (".") in variable +#names, as this will likely cause issues with the current file parsing +#system. +#-------------------- +# +##============================== +# +# This file doesn't (yet) read environment variables, so the user must +# set this themselves. It is also a good idea to search the doc for 'user' +# to see what default paths are being set for output/working files. +# +# Note that the string 'USER-NAME-NOT-SET' is used in the jupyter script +# to check for a failure to customize +# +user: wwieder #'USER-NAME-NOT-SET' + +#This first set of variables specify basic info used by all diagnostic runs: +diag_basic_info: + + #Does the user want plotting of unstructured (native) grid? + #If "false" or missing, then the ADF expects ALL cases to be on lat/lon grids: + unstructured_plotting: true + + #Is this a model vs observations comparison? + #If "false" or missing, then a model-model comparison is assumed: + compare_obs: false + + #Generate HTML website (assumed false if missing): + #Note: The website files themselves will be located in the path + #specified by "cam_diag_plot_loc", under the "/website" subdirectory, + #where "" is the subdirectory created for this particular diagnostics run + #(usually "case_vs_obs_XXX" or "case_vs_baseline_XXX"). + create_html: true + + #Location of observational datasets: + #Note: this only matters if "compare_obs" is true and the path + #isn't specified in the variable defaults file. + obs_data_loc: /glade/campaign/cgd/tss/people/oleson/lnd_diag_data/obs_data + + #Location where re-gridded and interpolated CAM climatology files are stored: + cam_regrid_loc: /glade/derecho/scratch/${user}/ADF_unstruct/regrid + + #Overwrite CAM re-gridded files? + #If false, or missing, then regridding will be skipped for regridded variables + #that already exist in "cam_regrid_loc": + cam_overwrite_regrid: false + + #Location where diagnostic plots are stored: + cam_diag_plot_loc: /glade/derecho/scratch/${user}/ADF_unstruct/plots + + #Location of ADF variable plotting defaults YAML file: + #If left blank or missing, ADF/lib/adf_variable_defaults.yaml will be used + #Uncomment and change path for custom variable defaults file + defaults_file: lib/ldf_variable_cplhist.yaml + + # location of land regions YAML file (only used in regional_climatology plots) + regions_file: lib/regions_lnd.yaml + + #Longitude line on which to center all lat/lon maps. + #If this config option is missing then the central + #longitude will default to 180 degrees E. + central_longitude: 0 + + #Number of processors on which to run the ADF. + #If this config variable isn't present then + #the ADF defaults to one processor. Also, if + #you set it to "*" then it will default + #to all of the processors available on a + #single node/machine: + num_procs: 16 + + #If set to true, then redo all plots even if they already exist. + #If set to false, then if a plot is found it will be skipped: + redo_plot: false + +#This second set of variables provides info for the CAM simulation(s) being diagnosed: +diag_cam_climo: + + # History file list of strings to match + # eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0] + # Only affects timeseries as everything else uses the created timeseries + # Default: + hist_str: clm2.h0a + + #Calculate climatologies? + #If false, the climatology files will not be created: + calc_cam_climo: true + + #Location of CAM climatologies (to be created and then used by this script) + cam_climo_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_climo.cam_case_name}/climo + + #Overwrite CAM climatology files? + #If false, or not prsent, then already existing climatology files will be skipped: + cam_overwrite_climo: false + + #Name of CAM case (or CAM run name): + cam_case_name: CLM6_cesm30alpha08c_ne30pg3_CPLHIST_1850 + + #Case nickname + #NOTE: if nickname starts with '0' - nickname must be in quotes! + # ie '026a' as opposed to 026a + #If missing or left blank, will default to cam_case_name + case_nickname: 'CPL_HIST' + + #Location of CAM history (h0) files: + cam_hist_loc: /glade/derecho/scratch/oleson/archive/${diag_cam_climo.cam_case_name}/lnd/hist/ + + # If unstructured_plotting, a mesh file is required! + mesh_file: /glade/campaign/cesm/cesmdata/inputdata/share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc + + #model year when time series files should start: + #Note: Leaving this entry blank will make time series + # start at earliest available year. + start_year: 1 + climo_start_year: 2 + #model year when time series files should end: + #Note: Leaving this entry blank will make time series + # end at latest available year. + end_year: 3 + + #Do time series files exist? + #If True, then diagnostics assumes that model files are already time series. + #If False, or if simply not present, then diagnostics will attempt to create + #time series files from history (time-slice) files: + cam_ts_done: false + + #Save interim time series files? + #WARNING: This can take up a significant amount of space, + # but will save processing time the next time + cam_ts_save: false + + #Overwrite time series files, if found? + #If set to false, then time series creation will be skipped if files are found: + cam_overwrite_ts: false + + #Location where time series files are (or will be) stored: + cam_ts_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_climo.cam_case_name}/ts + + +#This third set of variables provide info for the CAM baseline climatologies. +#This only matters if "compare_obs" is false: +diag_cam_baseline_climo: + + # History file list of strings to match + # eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0] + # Only affects timeseries as everything else uses the created timeseries + # Default: + hist_str: clm2.h0a + + #Calculate cam baseline climatologies? + #If false, the climatology files will not be created: + calc_cam_climo: true + + #Overwrite CAM climatology files? + #If false, or not present, then already existing climatology files will be skipped: + cam_overwrite_climo: false + + #Name of CAM baseline case: + cam_case_name: CAM7CLM6_cesm30alpha08c_ne30pg3_1850 + + #Baseline case nickname + #NOTE: if nickname starts with '0' - nickname must be in quotes! + # ie '026a' as opposed to 026a + #If missing or left blank, will default to cam_case_name + case_nickname: 'CAM7' + + #Location of CAM baseline history (h0) files: + #Example test files + cam_hist_loc: /glade/derecho/scratch/oleson/archive/${diag_cam_baseline_climo.cam_case_name}/lnd/hist/ + + # If unstructured_plotting, a mesh file is required! + mesh_file: /glade/campaign/cesm/cesmdata/inputdata/share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc + + #Location of baseline CAM climatologies: + cam_climo_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_baseline_climo.cam_case_name}/climo + + #model year when time series files should start: + #Note: Leaving this entry blank will make time series + # start at earliest available year. + start_year: 1 + climo_start_year: 2 + + #model year when time series files should end: + #Note: Leaving this entry blank will make time series + # end at latest available year. + end_year: 3 + climo_end_year: 3 + + #Do time series files need to be generated? + #If True, then diagnostics assumes that model files are already time series. + #If False, or if simply not present, then diagnostics will attempt to create + #time series files from history (time-slice) files: + cam_ts_done: false + + #Save interim time series files for baseline run? + #WARNING: This can take up a significant amount of space: + cam_ts_save: true + + #Overwrite baseline time series files, if found? + #If set to false, then time series creation will be skipped if files are found: + cam_overwrite_ts: false + + #Location where time series files are (or will be) stored: + cam_ts_loc: /glade/derecho/scratch/${user}/ADF_unstruct/${diag_cam_baseline_climo.cam_case_name}/ts + + + +#+++++++++++++++++++++++++++++++++++++++++++++++++++ +#These variables below only matter if you are using +#a non-standard method, or are adding your own +#diagnostic scripts. +#+++++++++++++++++++++++++++++++++++++++++++++++++++ + +#Note: If you want to pass arguments to a particular script, you can +#do it like so (using the "averaging_example" script in this case): +# - {create_climo_files: {kwargs: {clobber: true}}} + +#Name of time-averaging scripts being used to generate climatologies. +#These scripts must be located in "scripts/averaging": +time_averaging_scripts: + - create_climo_files + +#Name of regridding scripts being used. +#These scripts must be located in "scripts/regridding": +regridding_scripts: + # - regrid_and_vert_interp + +#List of analysis scripts being used. +#These scripts must be located in "scripts/analysis": +analysis_scripts: + - lmwg_table + +#List of plotting scripts being used. +#These scripts must be located in "scripts/plotting": +plotting_scripts: + - global_latlon_map + - global_mean_timeseries_lnd + - polar_map + - regional_climatology + - regional_timeseries + +#List of variables that will be processesd: +#Shorter list here, for efficiency of testing +diag_var_list: + - FSDSND + - FSDSVD + - FSDSNI + - FSDSVI + - RAIN_FROM_ATM + - SNOW_FROM_ATM + - FLDS_NOT_DOWNSCALED + - ZBOT + - Tair_from_atm + - Thair_from_atm + - QBOT_NOT_DOWNSCALED + - PBOT_NOT_DOWNSCALED + - Rho_from_atm + - PCO2 + - UWIND + - VWIND + - BCPHIDRY + - BCPHODRY + - BCPHIWET + - OCPHIDRY + - OCPHODRY + - OCPHIWET + - DSTWET1 + - DSTDRY1 + - DSTWET2 + - DSTDRY2 + - DSTWET3 + - DSTDRY3 + - DSTWET4 + - DSTDRY4 + - ATM_TOPO + +region_list: + - Global + - N Hemisphere Land + - S Hemisphere Land + - Polar + - Alaskan Arctic + - Canadian Arctic + - Greenland + - Russian Arctic + # - Antarctica + - Alaska + - Northwest Canada + - Central Canada + - Eastern Canada + - Northern Europe + - Western Siberia + - Eastern Siberia + - Western US + - Central US + - Eastern US + - CONUS + - Europe + - East Asia + - Eurasia + - Mediterranean + - Central America + - Amazonia + - Central Africa + - Indonesia + - S America + - Brazil + - Sahel + - Southern Africa + - India + - Indochina + #- Sahara Desert + #- Arabian Peninsula + - Australia + #- Central Asia ## Was Broken... probably because there were two? + #- Mongolia + #- Tibetan Plateau + +#END OF FILE From 3ddf102991278e3ce20cd0197af231dd1e864b42 Mon Sep 17 00:00:00 2001 From: wwieder Date: Tue, 10 Feb 2026 05:39:53 -0700 Subject: [PATCH 8/8] add area burned fields --- lib/adf_diag.py | 3 +- lib/ldf_variable_defaults.yaml | 38 +++++++++++++++++++----- scripts/plotting/regional_climatology.py | 2 +- scripts/plotting/regional_timeseries.py | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/lib/adf_diag.py b/lib/adf_diag.py index 2f6520b18..11a73740d 100644 --- a/lib/adf_diag.py +++ b/lib/adf_diag.py @@ -1381,7 +1381,8 @@ def derive_variables(self, res=None, hist_str=None, vars_to_derive=None, ts_dir= der_val = ds["FSA"]-ds["FIRA"] elif var == "WUE": der_val = ds["GPP"]/ds["FCTR"].where(ds["FCTR"]>0) - + elif var == "BURNED_AREA": + der_val = ds["FAREA_BURNED"]*ds['area']*ds['landfrac'] # ---------------------------------------------------------------------------------- # Isotope-specific derived variables # ---------------------------------------------------------------------------------- diff --git a/lib/ldf_variable_defaults.yaml b/lib/ldf_variable_defaults.yaml index 9d7375ef5..034cea534 100644 --- a/lib/ldf_variable_defaults.yaml +++ b/lib/ldf_variable_defaults.yaml @@ -171,7 +171,7 @@ NDEP_TO_SMINN: # atmospheric N deposition to soil mineral N category: "Atmosphere" #colormap: "copper_r" diff_colormap: "BrBG_r" - diff_contour_range: [-5, 5, 5e-1] + diff_contour_range: [-5., 5, 0.5] scale_factor: 86400 add_offset: 0 new_unit: "gN m$^{-2}$ d$^{-1}$" @@ -194,7 +194,7 @@ BCDEP: # total BC deposition (dry+wet) from atmosphere mpl: colorbar: label : "kg m$^{-2}$ d$^{-1}$" - diff_contour_range: [-2e-3, 2e-3, 5e-4] + diff_contour_range: [-0.002, 0.002, 0.0005] pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] pct_diff_colormap: "PuOr_r" scale_factor_table: 0.365 #days to years, kg/m2 to Tg globally @@ -211,7 +211,7 @@ DSTDEP: # total dust deposition (dry+wet) from atmosphere mpl: colorbar: label : "kg m$^{-2}$ d$^{-1}$" - diff_contour_range: [-2e-3, 2e-3, 5e-4] + diff_contour_range: [-0.002, 0.002, 0.0005] pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] pct_diff_colormap: "PuOr_r" scale_factor_table: 0.000365 #days to years, kg/m2 to Pg globally @@ -302,7 +302,7 @@ DSTFLXT: # total surface dust emission category: "Surface fluxes" colormap: "copper_r" diff_colormap: "BrBG_r" - diff_contour_range: [-2e-3, 2e-3, 5e-4] + diff_contour_range: [-0.002, 0.002, 0.0005] scale_factor: 86400 add_offset: 0 new_unit: "kg m$^{-2}$ d$^{-1}$" @@ -576,7 +576,9 @@ TOTVEGC: avg_method: 'sum' table_unit: "PgC" +#+++++++++++ # C Isotopes +#+++++++++++ C13_GPP_pm: category: "Carbon" derivable_from: ["C13_GPP","GPP"] @@ -629,10 +631,10 @@ C14_TOTLITC_pm: #TODO, check that calculations are correct #+++++++++++ -# Category: CROP +# Category: Misc #+++++++++++ GRAINC_TO_FOOD: - category: "Crop" + category: "Misc" #contour_levels_range: [0., 3., 0.25] diff_colormap: "PiYG" #diff_contour_range: [-1.5, 1.5, 0.25] @@ -648,6 +650,26 @@ GRAINC_TO_FOOD: avg_method: 'sum' table_unit: "PgC y$^{-1}$" +AREA_BURNED: + category: "Misc" + derivable_from: ["FAREA_BURNED"] + colormap: "hot_r" + #contour_levels_range: [0., 3., 0.25] + diff_colormap: "PiYG" + #diff_contour_range: [-1.5, 1.5, 0.25] + scale_factor: 86400 # per second to per day + add_offset: 0 + new_unit: "km$^{-2}$ d$^{-1}$" + mpl: + colorbar: + label : "km$^{-2}$ d$^{-1}$" + #pct_diff_contour_levels: [-100,-75,-50,-40,-30,-20,-10,-8,-6,-4,-2,0,2,4,6,8,10,20,30,40,50,75,100] + pct_diff_colormap: "PiYG" + scale_factor_table: 0.000365 #days to years, km2 to 1e6 km2 + avg_method: 'sum' + table_unit: "million km$^{-2} y$^{-1}$" + + #+++++++++++ # Category: Soils @@ -658,8 +680,8 @@ ALTMAX: # Active Layer Thickness diff_contour_levels: [-10,-5,-2,-1,-0.5,-0.2,-0.1,0.,0.1,0.2,0.5,1,2,5,10] -SOILWATER_10CM: # soil liquid water + ice in top 10cm of soil - category: "Soils" # or hydrology? +#SOILWATER_10CM: # soil liquid water + ice in top 10cm of soil +# category: "Soils" # or hydrology? TSOI_10CM: # Soil temperature, 0-10 cm category: "Soils" diff --git a/scripts/plotting/regional_climatology.py b/scripts/plotting/regional_climatology.py index cac0e67c7..b031b5abd 100644 --- a/scripts/plotting/regional_climatology.py +++ b/scripts/plotting/regional_climatology.py @@ -78,7 +78,7 @@ def regional_climatology(adfobj): regional_climo_var_list = ['TSA','PREC','ELAI', 'FSDS','FLDS','GPP','ASA', 'QRUNOFF_TO_COUPLER','ET','FCTR','FCEV', - 'SNOWDP','QBOT','SOILWATER_10CM','FAREA_BURNED', + 'SNOWDP','QBOT','SOILWATER_10CM','AREA_BURNED', ] # regional_climo_var_list = ['TSA','PREC','ELAI', diff --git a/scripts/plotting/regional_timeseries.py b/scripts/plotting/regional_timeseries.py index e8b6a0e47..0ad08ee75 100644 --- a/scripts/plotting/regional_timeseries.py +++ b/scripts/plotting/regional_timeseries.py @@ -79,7 +79,7 @@ def regional_timeseries(adfobj): regional_ts_var_list = ['TSA','PREC','ELAI', 'FSDS','FLDS','GPP','ASA', 'QRUNOFF_TO_COUPLER','ET','FCTR','FCEV', - 'SNOWDP','QBOT','SOILWATER_10CM','FAREA_BURNED', + 'SNOWDP','QBOT','SOILWATER_10CM','AREA_BURNED', ] # Extract variables: