Skip to content

Commit 2918954

Browse files
authored
Merge pull request #3338 from olyson/b4b-dev_contrib_scripts
Update SpinupStability and run_clm_historical scripts
2 parents da587af + e8ec878 commit 2918954

File tree

5 files changed

+108
-100
lines changed

5 files changed

+108
-100
lines changed

tools/contrib/README

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ available before adding it. These scripts may not be as well tested or supported
66
tools. They are also ONLY assumed to work on the NCAR supercomputer. So paths will be hardwired to
77
assume NCAR directory structures.
88

9-
The python scripts require the following settings before running on cheyenne:
9+
The python scripts require the following settings before running on Derecho:
1010

1111
module load conda
1212
../../py_env_create
@@ -16,28 +16,28 @@ Brief description of scripts:
1616

1717
create_scrip_file.ncl
1818
Create a SCRIP grid file needed for running with WRF
19-
run_clm_historical
20-
does all the setup and submission required to do a 1850-2010 CLM
21-
historical simulation in three separate submissions
22-
v1 - Andrew Slater+Dave Lawrence, 8/2015
19+
run_clm_historical.v11.csh
20+
does all the setup and submission required to do a 1850-2023 CLM
21+
historical simulation in five separate submissions
22+
v11 - Oleson, 07/2025
2323

2424
modify_singlept_site
2525
Modify some data on a surface dataset created by site_and_regional/subset_data
2626

27-
SpinupStability_SP_v9.ncl
27+
SpinupStability_SP_v10.ncl
2828
This script assesses the equilibrium state of a Satellite Phenology (SP)
2929
spinup run, works on either monthly or annual mean history files - Keith
30-
Oleson 12/2021
30+
Oleson 07/2025
3131

32-
SpinupStability_BGC_v10.ncl
32+
SpinupStability_BGC_v11.ncl
3333
This script assesses the equilibrium state of a Biogeochemistry (BGC)
3434
spinup run, works on either monthly or annual mean history files - Keith
35-
Oleson 12/2021
35+
Oleson 07/2025
3636

37-
SpinupStability_BGC_v11_SE.ncl
37+
SpinupStability_BGC_v12_SE.ncl
3838
This script assesses the equilibrium state of a ne30pg3 (spectral element)
3939
Biogeochemistry (BGC) spinup run, works on either monthly or annual mean
40-
history files - Keith Oleson 03/2025
40+
history files - Oleson 07/2025
4141

4242
run_clmtowers
4343
This script will run any number of flux tower sites.
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
; NCL script
2-
; SpinupStability_BGC_v10.ncl
2+
; SpinupStability_BGC_v11.ncl
33
; Script to examine stability of BGC spinup simulation.
44
; This version operates on either monthly mean or multi-annual mean multi-variable history files
55
; NOTE: THIS SCRIPT IS ONLY INTENDED FOR USE WITH 2-D LAT/LON GRIDS
6-
; Keith Oleson, Mar 2020
7-
8-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
9-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
10-
load "~oleson/lnd_diag/run/contributed.ncl"
11-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
6+
; Keith Oleson, July 2025
127

138
begin
149

@@ -30,17 +25,18 @@ begin
3025
; annual_hist flag to False if your case has monthly mean history files.
3126
; AND set the region (supported options: Global, Arctic, SPT).
3227
; AND set the subper (subsampling period in years, number of years that atm forcing repeats).
33-
; The script assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist
28+
; The script assumes that your history files are in /glade/derecho/scratch/$username/archive/$caseid/lnd/hist
3429
; You need a run consisting of at least three cycles of atmospheric data
3530
;=======================================================================;
3631

3732
; GLOBAL EXAMPLE
38-
caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD"
39-
username = "oleson"
33+
caseid = "ctsm53026_BNF_AD"
34+
username = "slevis"
4035
annual_hist = True
4136
region = "Global" ; Global, Arctic, or SPT (single point)
4237
subper = 20 ; Subsampling period in years
4338
paleo = False ; Use paleo map
39+
hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later)
4440

4541
; SPT (single point) EXAMPLE
4642
; caseid = "clm50_release-clm5.0.15_SPT_GSWP3V1_1850spin"
@@ -49,12 +45,13 @@ begin
4945
; region = "SPT" ; Global, Arctic, or SPT (single point)
5046
; subper = 20 ; Subsampling period in years
5147
; paleo = False ; Use paleo map
48+
; hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later)
5249

5350
do_plot = True
5451
; do_plot = False
5552
;=======================================================================;
5653

57-
data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/"
54+
data_dir = "/glade/derecho/scratch/"+username+"/archive/"+caseid+"/lnd/hist/"
5855
if ( systemfunc("test -d "+data_dir+"; echo $?" ) .ne. 0 )then
5956
print( "Input directory does not exist or not found: "+data_dir );
6057
print( "Make sure username and caseid and base directory is set correctly" )
@@ -85,9 +82,9 @@ begin
8582
end if
8683

8784
if (annual_hist) then
88-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc")
85+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc")
8986
else
90-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc")
87+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc")
9188
end if
9289
flsdims = dimsizes(fls)
9390

tools/contrib/SpinupStability_BGC_v11_SE.ncl renamed to tools/contrib/SpinupStability_BGC_v12_SE.ncl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; NCL script
2-
; SpinupStability_BGC_v11_SE.ncl
2+
; SpinupStability_BGC_v12_SE.ncl
33
; Script to examine stability of spinup simulation.
44
; This version operates on either monthly mean or multi-annual mean multi-variable history files
55
; and supports ne30 grids only
6-
; Keith Oleson, March 2025
6+
; Keith Oleson, July 2025
77
;
88
; ARH mods, April 2020 - modified to work for unstructured grids via remapping to FV 1 deg. grid.
99
; KO mods, March 2025 - regrid history file using ncremap to get area and landfrac instead of
@@ -41,6 +41,7 @@ begin
4141
region = "Global" ; Global
4242
subper = 20 ; Subsampling period in years
4343
paleo = False ; Use paleo map ; UNTESTED IN THIS VERSION
44+
hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later)
4445

4546
;--- ARH mods ---
4647
map_method = "conserve" ;bilinear,conserve or patch
@@ -81,9 +82,9 @@ begin
8182
totecosysc_thresh = 1.0 ; disequilibrium threshold for individual gridcells (gC/m2/yr)
8283

8384
if (annual_hist) then
84-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc")
85+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc")
8586
else
86-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc")
87+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc")
8788
end if
8889
flsdims = dimsizes(fls)
8990

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
; NCL script
2-
; SpinupStability_SP_v9.ncl
2+
; SpinupStability_SP_v10.ncl
33
; Script to examine stability of SP spinup simulation.
44
; This version operates on either monthly mean or multi-annual mean multi-variable history files
5-
; Keith Oleson, Sep 2018
6-
7-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
8-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
9-
load "~oleson/lnd_diag/run/contributed.ncl"
10-
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
5+
; Keith Oleson, July 2025
116

127
begin
138

@@ -27,21 +22,24 @@ begin
2722
; To run this script, just enter in your case name and username below.
2823
; AND set the annual_hist flag to "True" if your case has annual mean history files or set
2924
; annual_hist flag to "False" if your case has monthly mean history files.
30-
; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist
25+
; The script assumes that your history files are in /glade/derecho/scratch/$username/archive/$caseid/lnd/hist
3126
;=======================================================================;
3227

33-
caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850pAD"
28+
caseid = "clm50sp_cesm23a02cPPEn08ctsm51d030_1deg_GSWP3V1_1850spin"
3429
username = "oleson"
3530
annual_hist = "False"
3631
cplot = "Global"
3732
subper = 20
3833
h2osoi_layer = 8 ; Desired soil layer (layer 8 is about 1m)
3934
tsoi_layer = 10 ; Desired soil layer (layer 10 is about 3m)
35+
hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later)
4036

4137
do_plot = "True"
4238
;=======================================================================;
4339

44-
data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/"
40+
data_dir = "/glade/derecho/scratch/"+username+"/archive/"+caseid+"/lnd/hist/"
41+
; FOR TESTING
42+
; data_dir = "/glade/campaign/cgd/tss/common/Land_Only_Simulations/CTSM51_DEV/CLM50_CTSM51_LAND_ONLY_RELEASE/"+caseid+"/lnd/hist/"
4543

4644
; Thresholds
4745
glob_thresh_fsh = 0.02 ; global threshold for FSH equilibrium (delta W m-2 / yr)
@@ -54,9 +52,9 @@ begin
5452
tws_thresh = 0.001 ; disequilibrium threshold for individual gridcells (m)
5553

5654
if (annual_hist .eq. "True") then
57-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*-*-*"+".nc")
55+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*-*-*"+".nc")
5856
else
59-
fls = systemfunc("ls " + data_dir + caseid+".clm2.h0a.*-*"+".nc")
57+
fls = systemfunc("ls " + data_dir + caseid+".clm2."+hist_ext+".*-*"+".nc")
6058
end if
6159
flsdims = dimsizes(fls)
6260

0 commit comments

Comments
 (0)