ESCOMP / ESCOMP/CTSM

Build-namelist doens't function quite right for 1850 without a use case

Open
#3,752 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

### Brief summary of bug

I saw this in #3745 but it took me a bit to figure out that the updated version was correct.

There were differences for ndep fields in the build-namelist tester that I thought at first must've been wrong. But, now I realize they are doing the right behavior. This is because I moved settings in the use-case to the namelist_defaults file which makes sure they are handled correctly.

This is another example of why we should go ahead with #3623 and make use-cases required.

### General bug information

**CTSM version you are using:** ctsm5.4.016 (and going all the way bacd ck)

**Does this bug cause significantly incorrect results in the model's science?** Yes, if you aren't using an 1850 use-case

**Configurations affected:** using sim_year 1850 without a 1850_control use case

### Details of bug

### Important details of your setup / configuration so we can reproduce the bug

In order to do this in a case you'd have to use a longname with a non-standard period so that a use-case wouldn't be chosen for you.

So something like:

./create_test SMS.f10_f10_mg37.1851_DATM%CRUJRA2024_CLM60%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV.derecho_intel -r . --no-build
./xmlchange CLM_NAMELIST_OPTS='start_ymd=18500101'
./xmlchange CLM_BLDNML_OPTS="-bgc bgc -crop --sim_year 1850-2000 --clm_demand flanduse_timeseries"

The resulting CaseDocs/lnd_in file won't have the right range for ndep and it won't have model_align_ndep

If you do something similar, but for "sim_year 1850" it won't have the right 1850 ndep file

These cases will be screwed up as well with DATM settings for 2000

### Important output or errors that show the problem

Here's what I see using compare_namelists the new version is correct:

```
./compare_namelists -b $SCRATCH/ctsm5.4.016/bld/unit_testers/ -pa clm4_5 -pb clm4_5 |& grep -v MATCH | grep -v "No case id data available, will not be able to normalize values as effectively"
ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam4.0+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam4.0+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam5.0+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam5.0+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam6.0+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam6.0+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam7.0+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_cam7.0+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_CRUv7+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_CRUv7+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_GSWP3v1+-bgc+bgc and ./lnd_in.-phys+clm4_5.-res+0.9x1.25+-mask+gx1v7+-sim_year+1850+-envxml_dir+.+-lnd_tuning_mod+clm4_5_GSWP3v1+-bgc+bgc
BASE: stream_fldfilename_ndep = fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc'
COMP: stream_fldfilename_ndep = fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+10x15+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+10x15+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+1.9x2.5+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+1.9x2.5+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+360x720cru+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+360x720cru+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+4x5+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+4x5+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+C96+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+C96+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+mpasa120+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+mpasa120+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+ne16np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+ne16np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+ne30np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+ne30np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+ne3np4+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+ne3np4+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'

ERROR: Namelist diff between files /glade/derecho/scratch/erik/ctsm5.4.016/bld/unit_testers//lnd_in.-phys+clm4_5.-res+ne3np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++ and ./lnd_in.-phys+clm4_5.-res+ne3np4.pg3+-envxml_dir+.++-bgc+bgc+-clm_demand+flanduse_timeseries+-sim_year+1850-2000+-namelist+++a+start_ymd=18500101++
Differences in namelist 'ndepdyn_nml':
BASE: stream_year_last_ndep = 1850
COMP: stream_year_last_ndep = 2015
found extra variable: 'model_year_align_ndep'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.