Skip to content

Commit 9e87625

Browse files
committed
Update SpinupStability_BGC_v12_SE.ncl to work for FATES and ne16pg3
1 parent 157a07e commit 9e87625

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

tools/contrib/SpinupStability_BGC_v12_SE.ncl

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
; 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
5-
; and supports ne30 grids only
5+
; it supports "ne" grids only, and it supports FATES simulations
66
; Keith Oleson, July 2025
7+
; Sam Levis, Feb 2026
78
;
89
; ARH mods, April 2020 - modified to work for unstructured grids via remapping to FV 1 deg. grid.
910
; KO mods, March 2025 - regrid history file using ncremap to get area and landfrac instead of
@@ -35,24 +36,27 @@ begin
3536
;=======================================================================;
3637

3738
; GLOBAL EXAMPLE
38-
caseid = "ctsm53n02ctsm52027_ne30pg3t232_AD"
39-
username = "oleson"
40-
annual_hist = True
39+
caseid = "ctsm60_fates_nocomp_adspinup"
40+
username = "afoster"
41+
annual_hist = False
4142
region = "Global" ; Global
4243
subper = 20 ; Subsampling period in years
4344
paleo = False ; Use paleo map ; UNTESTED IN THIS VERSION
45+
fates = True ; FATES simulation?
4446
hist_ext = "h0a" ; Valid options: h0a, h0
4547

4648
;--- ARH mods ---
4749
map_method = "conserve" ;bilinear,conserve or patch
48-
dout_s = False ;short term storage (archive) directory structure
50+
dout_s = True ;short term storage (archive) directory structure
4951

5052
;srcGrid = "ne120pg3"
5153
;srcGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/cam/coords/ne120pg3_scrip_c170628.nc"
52-
srcGrid = "ne30pg3"
53-
srcGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/cam/coords/ne30pg3_scrip_170604.nc"
54+
;srcGrid = "ne30pg3"
55+
;srcGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/cam/coords/ne30pg3_scrip_170604.nc"
5456
;srcGrid = "ne30pg2"
5557
;srcGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/cam/coords/ne30pg2_scrip_c170608.nc"
58+
srcGrid = "ne16pg3"
59+
srcGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/atm/cam/coords/ne16pg3_scrip_170725.nc"
5660

5761
dstGrid = "f09"
5862
dstGridName="/glade/campaign/cesm/cesmdata/cseg/inputdata/share/scripgrids/0.9x1.25_SCRIP_desc.181018.nc"
@@ -144,9 +148,15 @@ begin
144148
if (isfilevardim(data[0],"landfrac","lndgrid")) then
145149
totecosysc = data[:]->TOTECOSYSC(year,:)
146150
totsomc = data[:]->TOTSOMC(year,:)
147-
totvegc = data[:]->TOTVEGC(year,:)
148-
tlai = data[:]->TLAI(year,:)
149-
gpp = data[:]->GPP(year,:)
151+
if (fates) then
152+
totvegc = data[:]->FATES_VEGC(year,:) * 1000 ; kg -> g
153+
tlai = data[:]->FATES_LAI(year,:)
154+
gpp = data[:]->FATES_GPP(year,:) * 1000 ; kg -> g
155+
else
156+
totvegc = data[:]->TOTVEGC(year,:)
157+
tlai = data[:]->TLAI(year,:)
158+
gpp = data[:]->GPP(year,:)
159+
end if
150160
tws = data[:]->TWS(year,:)
151161
if (isfilevar(data[0],"H2OSNO")) then
152162
h2osno = data[:]->H2OSNO(year,:)
@@ -157,9 +167,15 @@ begin
157167
else
158168
totecosysc = data[:]->TOTECOSYSC(year,:,:)
159169
totsomc = data[:]->TOTSOMC(year,:,:)
160-
totvegc = data[:]->TOTVEGC(year,:,:)
161-
tlai = data[:]->TLAI(year,:,:)
162-
gpp = data[:]->GPP(year,:,:)
170+
if (fates) then
171+
totvegc = data[:]->FATES_VEGC(year,:,:) * 1000 ; kg -> g
172+
tlai = data[:]->FATES_LAI(year,:,:)
173+
gpp = data[:]->FATES_GPP(year,:,:) * 1000 ; kg -> g
174+
else
175+
totvegc = data[:]->TOTVEGC(year,:,:)
176+
tlai = data[:]->TLAI(year,:,:)
177+
gpp = data[:]->GPP(year,:,:)
178+
end if
163179
tws = data[:]->TWS(year,:,:)
164180
if (isfilevar(data[0],"H2OSNO")) then
165181
h2osno = data[:]->H2OSNO(year,:,:)
@@ -171,9 +187,15 @@ begin
171187
else
172188
totecosysc = month_to_annual(data[:]->TOTECOSYSC,1)
173189
totsomc = month_to_annual(data[:]->TOTSOMC,1)
174-
totvegc = month_to_annual(data[:]->TOTVEGC,1)
175-
tlai = month_to_annual(data[:]->TLAI,1)
176-
gpp = month_to_annual(data[:]->GPP,1)
190+
if (fates) then
191+
totvegc = month_to_annual(data[:]->FATES_VEGC,1) * 1000 ; kg -> g
192+
tlai = month_to_annual(data[:]->FATES_LAI,1)
193+
gpp = month_to_annual(data[:]->FATES_GPP,1) * 1000 ; kg -> g
194+
else
195+
totvegc = month_to_annual(data[:]->TOTVEGC,1)
196+
tlai = month_to_annual(data[:]->TLAI,1)
197+
gpp = month_to_annual(data[:]->GPP,1)
198+
end if
177199
if (isfilevar(data[0],"TWS")) then
178200
tws = month_to_annual(data[:]->TWS,1)
179201
else

0 commit comments

Comments
 (0)