Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Question about SpinupStability_SP_v9.ncl

LiwenWu

LiwenWu
Member
Dear Scientists,
I have successfully run a regional SP spin-up case using my own atmospheric forcing data, land use , LAI and soil data with version CTSM-ctsm5.2.005. Then I ran SpinupStability_SP_v9.ncl to see if the spin-up has reached the equilibrium. But I met an error:

Copyright (C) 1995-2015 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.3.0
The use of this software is governed by a License Agreement.
See NCAR Command Language (NCL) for more details.
(0) =========================================
(0) Start Time: Mon Jul 15 21:49:20 CST 2024
(0) =========================================
warning:FileReadVar: mcdate contains a 0 length dimension
warning:FileReadVar: time contains a 0 length dimension
fatal:["NclFile.c":2099]:Subscript out of range, error in subscript #0
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 72 in file SpinupStability_SP_v9.ncl

then I checked the SpinupStability_SP_v9.ncl. The code at or near line 72 are as below: (note that I set annual_hist= "True")

if (annual_hist .eq. "True") then
lstyrdim = dimsizes(lstfile->mcdate)
mcdate_lst = lstfile->mcdate(lstyrdim-1) #line 72
else
mcdate_lst = lstfile->mcdate
end if

I wonder if the error is related to variable mcdate and time? I set hist_mfilt = 12 and hist_nhtfrq = 0 for h0 files.I checked the h0*.nc file. I only found that the variable mcdate started at every February. The variables contain the data as below:

data:
mcdate = 210201, 210301, 210401, 210501, 210601, 210701, 210801, 210901,
211001, 211101, 211201, 220101 ;

time = 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ;

May I ask if the reason for the error is that mcdate data starts from February every year?Or do you have any suggestions? I attached my SpinupStability_SP_v9.ncl below.
Looking forward to your reply. Thank you!
 

Attachments

  • SpinupStability_SP_v9.ncl.txt
    26.5 KB · Views: 0

LiwenWu

LiwenWu
Member
Further more, since the tool is designed for h0 file saved with hist_mfilt = 1. I wonder how can hist_mfilt = 1 contain yearly data for h0 file?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The script is designed for use with either monthly history files, with each month in a separate file (hist_mfilt = 1 and hist_nhtfrq = 0), or annual mean history files (hist_mfilt = 20 for example and hist_nhtfrq = -8760). If you use it with monthly history files, then it will compute the annual means.
 

LiwenWu

LiwenWu
Member
Dear Oleson,
Thanks for your timely reply. I modified hist_mfilt = 1 and hist_nhtfrq = 0 for h0 file in user_nl_clm. And CTSM generated serval h0 monthly files for 21 years(eg. shanxispinup6.clm2.h0.0001-01.nc, shanxispinup6.clm2.h0.0001-02.nc, ..., shanxispinup6.clm2.h0.0021-12.nc). Then I modified SpinupStability_SP_v9.ncl file for my case.

caseid = "shanxispinup6"
username = "user"
annual_hist = "True"
cplot = "Global"
subper = 21
h2osoi_layer = 8 ; Desired soil layer (layer 8 is about 1m)
tsoi_layer = 10 ; Desired soil layer (layer 10 is about 3m)

do_plot = "True"
;=======================================================================;

data_dir = "/home/user/cesm/scratch/shanxispinup6/run/"

When I ran ncl SpinupStability_SP_v9.ncl it shows:

ls: Cannot access '/home/user/cesm/scratch/shanxispinup6/run/shanxispinup6.clm2.h0.*-*-*-*.nc' : No such file or directory
fatal:["FileSupport.c":4159]:(missing) has no file extension, can't determine type of file to open
fatal:file (lstfile) isn't defined
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 71 in file SpinupStability_SP_v9.ncl

I think the error is due to the h0 files name is only accurate to the month(shanxispinup6.clm2.h0.0001-01.nc) instead of shanxispinup6.clm2.h0.*-*-*-*.nc.
Then I modified annual_hist = "False" and ran ncl SpinupStability_SP_v9.ncl. Another error occured:

(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203708
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203708
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203708
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203708
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203386
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=203386
fatal:New: a zero or negative value has been passed in in the dimension size parameter
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 183 in file SpinupStability_SP_v9.ncl

I have no idea about this error. Do you have any suggestions? I also wonder how to set annual_hist for my case?
Looking forward to your reply. Thanks.
 

LiwenWu

LiwenWu
Member
Dear Oleson,
I rerun the case with annual mean history files (hist_mfilt = 21 and hist_nhtfrq = -8760) generated. When I ran ncl SpinupStability_SP_v9.ncl, an error occured:

fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading landarea_noequil
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 436 in file SpinupStability_SP_v9.ncl

Note that I set annual_hist = "True" and data_dir = "/home/user/cesm/archive/shanxispinup7/lnd/hist/" this time. I wonder why the tool interupted for reading both annual and monthly mean history files. It seems to be very few related posts on the forum and I have no idea about the error. Could you please give me some advice? Or is there any other way to evaluate whether spinup has reached equilibrium?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
For monthly history files (hist_mfilt = 1 and hist_nhtfrq = 0) run the script with annual_hist = "False". I'm not sure what the cause of the error you are getting is. Maybe you don't have all months for every year? Do all years have 12 months?
The second error generally can mean that you haven't run enough years. You need at least three loops over the forcing data, e.g., if you are looping over 20 years of forcing data, then you need at least a 60 year model run.
 
Top