CLM bldnml python script insufficiently checks/sets the clm_start_type
- Dominant language
- Fortran
- Stars
- 352
- Forks
- 361
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
### Brief summary of bug
CLM bldnml assumes default for clm_start_type if your RUN_TYPE is 'startup'
### General bug information
**CTSM version you are using:** `ctsm5.2.015`
**Does this bug cause significantly incorrect results in the model's science?** No
**Configurations affected:** When you use a RUN_TYPE startup and try to use a finidat, but your clm_start_type isn't set from the compset (?)
### Details of bug
In running the TRENDY simulations (see [here](https://github.com/NCAR/LMWG_dev/issues/60)), I was unable to create a clone of my AD spinup to continue the spinup via SASU. I kept getting the error:
```
ERROR: Command /glade/work/afoster/TRENDY_2024/CTSM_TRENDY/bld/build-namelist failed rc=255
out=
err=Warning : CLM build-namelist::CLMBuildNamelist::setup_logic_initial_conditions() : setting finidat (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)
is incomptable with using a cold start (by setting CLM_FORCE_COLDSTART=on).
-- Add -ignore_warnings option to CLM_BLDNML_OPTS to ignore this warning
```
even though I had actually set CLM_FORCE_COLDSTART to off. This was solved by setting clm_start_type explicitly in the namelist.
This issue seems to arise from a couple things:
1) in the python bldnml file: the `start_type` is set [here](https://github.com/ESCOMP/CTSM/blob/95fc92abac2f3ffd91fb52162f53ed9c2f553974/cime_config/buildnml#L193), I suppose assuming that your default value has been previously set? Because I was using a TRENDY 1700 case, this wasn't set seemingly.
The error message was very confusing because I *did* set my CLM_FORCE_COLDSTART correctly. Something needs to get updated with this logic to avoid this issue.
2) We should probably set the default for our TRENDY 1700 cases if we want this to be an option/compset
### Important details of your setup / configuration so we can reproduce the bug
[Specify anything relevant: the compset, resolution, machine, compiler, any xml or namelist changes, etc. You don't have to repeat anything that you have already noted above.]
**compset**: I1850Clm50BgcCropCru
**machine**: derecho
**xml changes**
```
./xmlchange DATM_YR_ALIGN=1
./xmlchange DATM_YR_START=1901
./xmlchange DATM_YR_END=1920
./xmlchange CLM_ACCELERATED_SPINUP="sasu"
./xmlchange JOB_WALLCLOCK_TIME="6:00:00"
./xmlchange STOP_OPTION="nyears"
./xmlchange RUN_STARTDATE="0001-01-01"
./xmlchange STOP_N=30
./xmlchange RESUBMIT=9
./xmlchange DOUT_S=TRUE
./xmlchange MOSART_MODE=NULL
./xmlchange CLM_BLDNML_OPTS="-bgc bgc -crop -co2_ppmv 277.75"
./xmlchange CLM_FORCE_COLDSTART=off
```
**user_nl_clm**:
```
do_grossunrep = .false.
! do this for spinup
reseed_dead_plants = .true.
! NDEP - cycle year 1850 for spinup
stream_fldfilename_ndep = '/glade/derecho/scratch/afoster/TRENDY_2024/inputs/ndep/TRENDY2024_Ndep_Monthly_c240725.nc'
model_year_align_ndep = 1850
ndep_taxmode = 'cycle'
! cloning case and using restart file from AD spinup
use_init_interp = .true.
finidat='/glade/derecho/scratch/afoster/TRENDY2024_f09_clm60_ADspinup_20240726-144515/run/TRENDY2024_f09_clm60_ADspinup_20240726-144515.clm2.r.0301-01-01-00000.nc'
use_matrixcn = .true.
use_soil_matrixcn = .true.
``
Contributor guide
Assessment
This issue has not been assessed yet.