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

Questions about BGC spinup

Houhhu

Nash
Member
Dear all,

Hi! I am trying to run a I2000Bgc compset spinup following the section 1.5.5 Spinup of CLM5.0-BGC of Clm5.0 User's guide.I want to spinup using the forcing data from 1979 to 1983.and try to simulate the model year from 1984 to 2014. Here are some setting:

./create_newcase -case AD_spinup -res f19_g17 -compset 2000_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_SROF_SGLC_SWAV ....

./xmlchange CLM_ACCELERATED_SPINUP="on"
./xmlchange RESUBMIT=3,STOP_N=50,STOP_OPTION=nyears,STOP_DATE=02010101
./xmlchange DATM_CLMNCEP_YR_ALIGN" value="1979
./xmlchange DATM_CLMNCEP_YR_START" value="1979
./xmlchange DATM_CLMNCEP_YR_END" value="1983

However,when I run ./case.submit,some errors occurred. I attached the cesm.log file
I search the error, it seems the problem of ESMF, but i cannot solve it . Could you help me figure out the problem?
ERROR timeaddmonths(): MM out of range
ERROR timeaddmonths(): MM out of range
ERROR: seq_timemgr_ESMFCodeCheck
ERROR timeaddmonths(): MM out of range
seq_timemgr_ESMFCodeCheck error= -1
(seq_timemgr_ETimeInit) : error return from ESMF_TimeSet: setting optDate
ERROR: seq_timemgr_ESMFCodeCheck
 

Attachments

  • cesm.log.txt
    16.4 KB · Views: 2
  • cpl.log.txt
    14.2 KB · Views: 1

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I'm not familiar with that error. What version of the model are you running (output of git describe)?
But what happens if you do not set STOP_DATE, i.e., leave it as the default -999.
Also, can you post the results of these:
./xmlquery RUN_STARTDATE
./xmlquery STOP_DATE
./xmlquery DATM_CLMNCEP_YR_ALIGN
./xmlquery DATM_CLMNCEP_YR_START
./xmlquery DATM_CLMNCEP_YR_END
 

Houhhu

Nash
Member
I'm not familiar with that error. What version of the model are you running (output of git describe)?
But what happens if you do not set STOP_DATE, i.e., leave it as the default -999.
Also, can you post the results of these:
./xmlquery RUN_STARTDATE
./xmlquery STOP_DATE
./xmlquery DATM_CLMNCEP_YR_ALIGN
./xmlquery DATM_CLMNCEP_YR_START
./xmlquery DATM_CLMNCEP_YR_END
Thanks for you reply,olesen. The version of model is 5.0
I have changed the STOP_DATE to '-999', and it seems work. No errors ouccured after I submited the case.
I also want to ask if it is reasonable for me to use forcing data from 1979-1983 to spin-up and then use the restart file to start simulating from 1984-2014. If this is not proper, could you give me some advice? Here are the results:

./xmlquery RUN_STARTDATE = 0001-01-01
./xmlquery STOP_DATE = -999
./xmlquery DATM_CLMNCEP_YR_ALIGN = 1979
./xmlquery DATM_CLMNCEP_YR_START = 1979
./xmlquery DATM_CLMNCEP_YR_END = 1983

Best
 

Houhhu

Nash
Member
@olesen, could you give
Thanks for you reply,olesen. The version of model is 5.0
I have changed the STOP_DATE to '-999', and it seems work. No errors ouccured after I submited the case.
I also want to ask if it is reasonable for me to use forcing data from 1979-1983 to spin-up and then use the restart file to start simulating from 1984-2014. If this is not proper, could you give me some advice? Here are the results:

./xmlquery RUN_STARTDATE = 0001-01-01
./xmlquery STOP_DATE = -999
./xmlquery DATM_CLMNCEP_YR_ALIGN = 1979
./xmlquery DATM_CLMNCEP_YR_START = 1979
./xmlquery DATM_CLMNCEP_YR_END = 1983

Best
@olesen,Could you give me some suggestions?
 

slevis

Moderator
Sounds fine, though you will make the final assessment when you look at the model results. It is not uncommon in modeling work that one has to run and rerun several times before they achieve what they intended.
 

Houhhu

Nash
Member
Sounds fine, though you will make the final assessment when you look at the model results. It is not uncommon in modeling work that one has to run and rerun several times before they achieve what they intended.
Thanks for you reply. it has been helpful to me.
 

Houhhu

Nash
Member
Dear Slevis, I am trying to run a AD_spinup for a study region(the res is 0.25° and mask array in domain file is (160, 280) ).here is the setup process:

./xmlchange CLM_ACCELERATED_SPINUP=on
./xmlchange CLM_FORCE_COLDSTART=on
./xmlchange STOP_N=200
./xmlchange STOP_OPTION=nyears
./xmlchange DATM_CLMNCEP_YR_START=1979
./xmlchange DATM_CLMNCEP_YR_ALIGN=1979
./xmlchange DATM_CLMNCEP_YR_END=1982
./xmlchange NTASKS=64
./case.setup
I also change the ATM_DOMAIN_FILE and LND_DOMAIN_FILE to my domain file, adding my surfdata path in user_nl_clm.
After ./case.setup, I use my own forcing data following the USER'S GUIDE 1.5.7 Running with atmospheric forcing from a previous simulation.
There is no problem running ./case.build and ./case.submit.

However, I want to know why the model takes a relatively long time to spinup. The speed of model spinup is similar to the speed of same case when setting "CLM_ACCELERATED_SPINUP=off ", CLM_FORCE_COLDSTART=off. Is it normal for the model spinup?
I create another case while setting the "CLM_FORCE_COLDSTART=off" and "CLM_ACCELERATED_SPINUP=on", but the model spinup speed is not much different from before.

Could you give me some advice about accelerating the spinup speed? Increasing the number of NTASK maybe is a choice,but I have a limit on computation.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I'm not sure I understand your question, but the purpose of the AD spinup is to get the model carbon pools to spinup faster than they would in a normal spinup. The doesn't actually increase the model speed in real time.
 

Houhhu

Nash
Member
Thank you for you reply. I apologize if I bother you. Based on your response, my understanding is that setting CLM_ACCELERATED_SPINUP=on, the model will only output annual averages for the variables 'TOTECOSYSC', 'TOTECOSYSN', 'TOTSOMC', 'TOTSOMN', 'TOTVEGC', 'TOTVEGN', 'TLAI', 'GPP', 'CPOOL', 'NPP', and 'TWS', thereby achieving a faster spinup speed of carbon pools. Therefore, the actual running time of the model remains the same for the same case while CLM_ACCELERATED_SPINUP=off . Is my understanding correct?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Good point. If you only output annual averages for just those variables in AD mode, you should see a small speed up compared to the same run where the default monthly history files are output. The speedup is due to the reduced output, not necessarily due to the AD mode itself.
 

Houhhu

Nash
Member
Sorry for bother you, Oleson. In section Spinup of CLM5.0-BGC-Crop of the CLM5.0 User’s Guide, I see spinup can also start from a default initial file. I begin my regional spinup from a initial file(set finidat in user_nl_clm) and running for 10 years. I modify the ncl script but I am not sure if it worked. It sees in equilibrium. Is the problem of model running time, should I spinup longer? In the User's Guide, it takes about 10 years spinup from a initial file to reach equilibrium for TLAI, GPP, and TWS.
In $path_to_your_archive_directory/$caseid/lnd/hist ,there is only one file spin_upAD_modify.clm2.h0.0001-01-01-00000.nc. and I set hist_mfilt = 20
hist_nhtfrq = -8760.

---------------------------------
Copyright (C) 1995-2019 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.6.2
The use of this software is governed by a License Agreement.
See NCAR Command Language (NCL) for more details.
(0) =========================================
(0) Start Time: Tue Dec 5 00:29:51 CST 2023
(0) =========================================
(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0) You may want to set the gsnAddCyclic resource to False to avoid a
(0) warning message from the spline function.
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0) You may want to set the gsnAddCyclic resource to False to avoid a
(0) warning message from the spline function.
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
(0) =======================================================================
(0) =======================================================================
(0) EQUILIBRIUM SUMMARY
(0) =======================================================================
(0) FATAL: TOTECOSYSC is NOT in equilibrium
(0) FATAL: TOTSOMC is NOT in equilibrium
(0) FATAL: TOTVEGC is NOT in equilibrium
(0) FATAL: TLAI is NOT in equilibrium
(0) FATAL: GPP is NOT in equilibrium
(0) WARNING: TWS is NOT in equilibrium or is missing
(0) WARNING: H2OSNO is NOT in equilibrium or is missing
(0) FATAL: Not enough of the land surface is in equilibrium ( 4.68% > 3.00%)
(0) FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again
(0) =======================================================================
(0) =========================================
(0) Finish Time: Tue Dec 5 00:29:52 CST 2023
(0) =========================================
(0) Successfully ran the script
 

slevis

Moderator
I'm not confident that I understand, so my answer may be wrong:
- If you start from bare soil, then you run in AD spinup for several hundred years.
- If you start from an existing finidat, then it depends how different the initial conditions are from the final state. In some cases you may not need to spin up at all and in others you may need to spin up for hundreds of years.
 

Houhhu

Nash
Member
Hi, Oleson, I try to use the SpinupStability.ncl and get the result:
=======================================================================
(0) EQUILIBRIUM SUMMARY
(0) =======================================================================
(0) FATAL: TOTECOSYSC is NOT in equilibrium
(0) FATAL: TOTSOMC is NOT in equilibrium
(0) FATAL: TOTVEGC is NOT in equilibrium
(0) TLAI is in equilibrium. Eq. Yr. = 13
(0) GPP is in equilibrium. Eq. Yr. = 13
(0) WARNING: TWS is NOT in equilibrium or is missing
(0) WARNING: H2OSNO is NOT in equilibrium or is missing
(0) FATAL: Not enough of the land surface is in equilibrium ( 22.67% > 3.00%)
(0) FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again
(0) =======================================================================
(0) =========================================
(0) Finish Time: Fri Dec 8 00:22:05 CST 2023
(0) =========================================
I have two quesetions, (1) how can I plot the figure like the Spin up User's Guide shows ?
(2) I set hist_mfilt = 20 and hist_nhtfrq = -8760,which means 20 year vaules in a h0 file. If I spinup for 50 years, In my $archive file/lnd/hist there will be ***.h0.0001-01-01-00000.nc, ****.h0.0021-01-01-00000.nc, ****.h0.0041--01-01-00000.nc. Will the SpinupStabiliyt script read all of the file in this contents(50 years value)?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
(1) The ncl script should produce a plot in postscript form. Look for a *.ps file
(2) Yes

Remember to set subper to the number of years your atmospheric forcing is looping over.
 

Houhhu

Nash
Member
Thanks for you respone, Oleson! I have found the *.ps file and get the figures. The figure is attched below. I set the subper=4, because the forcing data to spinup is from 1979 to 1982.
But I still have some questions about the result.
(1)Will these warning affects the ncl scripts?
======================================================
(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0) You may want to set the gsnAddCyclic resource to False to avoid a
(0) warning message from the spline function.
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
warning:["CoordArrays.c":591]:No Valid values in Array, unable to compute Min or Max
(0) =======================================================================
(0) =======================================================================
(0) EQUILIBRIUM SUMMARY
(0) =======================================================================
(0) FATAL: TOTECOSYSC is NOT in equilibrium
(0) FATAL: TOTSOMC is NOT in equilibrium
(0) FATAL: TOTVEGC is NOT in equilibrium
(0) TLAI is in equilibrium. Eq. Yr. = 13
(0) GPP is in equilibrium. Eq. Yr. = 13
(0) WARNING: TWS is NOT in equilibrium or is missing
(0) WARNING: H2OSNO is NOT in equilibrium or is missing
(0) FATAL: Not enough of the land surface is in equilibrium ( 21.67% > 3.00%)
(0) FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again
================================================================================
1702481977025.png
(2) Unlike the AD spinup plot in the documention of spinup of CLM5.0-BGC, the TOTECOSYSC, TOTSOMC, TOTCEGC, TLAI, GPP vaules don't start from zero. Is the problem of setting a initial file and the CLM_FORCE_COLDSTART=off? Although the LAI and GPP is in equilibrium, should I spinup a longer time?
(3) My domain file is a region, not global. But the colored area in the last two maps from the tool do not match the area of my simulation. most colored area is in the sea.
I aslo attach the datm_in and lnd_in file.
 

Attachments

  • datm_in.txt
    1.4 KB · Views: 1
  • lnd_in.txt
    8.6 KB · Views: 1

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The script is designed to work with global simulations, not regional. So you will have to change the script to plot your region correctly. Also, the thresholds are set for global simulations and thus are probably too strict for a regional simulation. The fact that it doesn't start at zero is probably related to using an initial file and not doing a cold start. It's probably ok to run that way. An AD simulation with an initial file should be setting "reseed_dead_plants" to .true. in your lnd_in namelist, which will give dead areas some carbon so that the vegetation has a chance to grow again. I would check this setting in your lnd_in file.
 

Houhhu

Nash
Member
Hi, Oleson! I try to modify the ncl scripts, however I am not familiar with the ncl language.
Here are settings I have changed:
if (region .eq. "Global") then
resc@mpLimitMode = "LatLon"
resc@mpMinLatF = 15.
resc@mpMaxLatF = 55.
resc@mpMinLonF = 70.
resc@mpMaxLonF = 140.
resc@gsnAddCyclic = True
resc@mpProjection = "CylindricalEquidistant"
end if
1702571660781.png
(1)It seems the colored area in two maps match the area of my simulation now.But I am not sure if it is correct for the regional simulation.The region I set in SpinupStability.ncl is "Global",which options is "Global", "SPT", "Arctic".I think the other two options should not be reasonable for the regional simulaiton. Could you please tell me how to modfity the script for a region if I am wrong. (my domain file is 0.25 degree, lat ranges 15 to 55, lon ranges from 70 to 140 )
(2)As you mentioned, thresholds should be reset for a regional simulation,but I have no idea how to set it.I have searched the forums, another version of SpinupStabaility has a scaling factor like:
==========================================================
glob_thresh_totecosysc = 0.02*scale_factor ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr)
; glob_thresh_totecosysc = 0.60*scale_factor ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr)
glob_thresh_totsomc = 0.02*scale_factor ; global threshold for TOTSOMC equilibrium (delta PgC / yr)
glob_thresh_totvegc = 0.02*scale_factor ; global threshold for TOTVEGC equilibrium (delta PgC / yr)
glob_thresh_cwdc = 0.02*scale_factor ; global threshold for CWDC equilibrium (delta PgC / yr)
glob_thresh_tlai = 0.02*scale_factor ; global threshold for TLAI equilibrium (delta m2/m2 / yr)
glob_thresh_gpp = 0.02*scale_factor ; global threshold for GPP equilibrium (delta PgC / yr)
glob_thresh_npp = 0.02*scale_factor ; global threshold for NPP equilibrium (delta PgC / yr)
glob_thresh_tws = 0.001*scale_factor ; global threshold for TWS equilibrium (delta m / yr)
glob_thresh_h2osno = 1.0*scale_factor ; global threshold for H2OSNO equilibrium (delta mm / yr)
===========================================================
should I calculate a scale_factor and multiply the vaule as the threshold? If I am wrong, how can I set these thresholds for regional simulation?

sorry for a series of questions. Thanks in advance!
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I forgot I had "Arctic" in there which was originally for a regional simulation over the Arctic only, so I think the script will work properly for your region. As far as setting thresholds, the scale_factor you refer to was for a sparse grid simulation where the scale_factor was simply computed as the number of grid cells in the sparse grid simulation divided by the number of land gridcells in a full grid global simulation. Seems like you could do something similar for your region, or perhaps scale it by the area of your region divided by the global area, or some such. It's up to you.
 
Top