ESCOMP / ESCOMP/CTSM

hist_fexcl and hist_fincl do not get appropriately checked together

Open
#2,867 9 comments 0 reactions 0 assignees View on GitHub
b4b priority: low usability
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
6d 6h
Merged PRs (30d)
8

Description

### Brief summary of bug

If a variable is in both `hist_fexcl` and `hist_fincl` the code seems to assume `hist_fincl`. This can result in a crash if having the variable doesn't work for your code.

### General bug information

**CTSM version you are using:** `ctsm5.3.009`

**Does this bug cause significantly incorrect results in the model's science?** No

**Configurations affected:** any

### Details of bug

In trying to test `ERS_Ld60.f45_f45_mg37.I2000Clm50FatesCruRsGs.derecho_intel.clm-FatesColdST3` I got a fail because ST3 mode does not output `FATES_ERROR_EL`. This variable *is* in the `hist_fexcl1` but it is also in the `hist_fincl1`. The run submits but then fails when it reads the variable list:

```
dec0617.hsn.de.hpc.ucar.edu 612: not found in the list of fates_hist%hvars.
dec0610.hsn.de.hpc.ucar.edu 188: ERROR: ERROR in clmfates_interfaceMod.F90 at line 670
dec0613.hsn.de.hpc.ucar.edu 273: not found in the list of fates_hist%hvars.
dec0614.hsn.de.hpc.ucar.edu 427: ERROR: ERROR in clmfates_interfaceMod.F90 at line 670
dec0617.hsn.de.hpc.ucar.edu 612: Most likely, this is because this history variable
dec0610.hsn.de.hpc.ucar.edu 189: the history field: FATES_ERROR_EL
dec0613.hsn.de.hpc.ucar.edu 273: Most likely, this is because this history variable
dec0617.hsn.de.hpc.ucar.edu 612: was specified in the user namelist, but the user
dec0610.hsn.de.hpc.ucar.edu 189: was requested in the namelist, but was
dec0613.hsn.de.hpc.ucar.edu 273: was specified in the user namelist, but the user
```

### Important details of your setup / configuration so we can reproduce the bug
```
hist_fexcl1 = 'FATES_ERROR_EL'
hist_fields_list_file = .false.
hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_AREA_TREES', 'FATES_COLD_STATUS',
'FATES_GDD', 'FATES_NCHILLDAYS', 'FATES_NCOLDDAYS', 'FATES_DAYSINCE_COLDLEAFOFF', 'FATES_DAYSINCE_COLDLEAFON',
'FATES_CANOPY_SPREAD', 'FATES_NESTEROV_INDEX', 'FATES_IGNITIONS', 'FATES_FDI', 'FATES_ROS',
'FATES_EFFECT_WSPEED', 'FATES_FUELCONSUMED', 'FATES_FIRE_INTENSITY', 'FATES_FIRE_INTENSITY_BURNFRAC', 'FATES_BURNFRAC',
'FATES_FUEL_MEF', 'FATES_FUEL_BULKD', 'FATES_FUEL_EFF_MOIST', 'FATES_FUEL_SAV', 'FATES_FUEL_AMOUNT',
'FATES_LITTER_IN', 'FATES_LITTER_OUT', 'FATES_SEED_BANK', 'FATES_SEEDS_IN', 'FATES_STOREC',
'FATES_VEGC', 'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC',
'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND', 'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC',
'FATES_PRIMARY_PATCHFUSION_ERR', 'FATES_HARVEST_WOODPROD_C_FLUX', 'FATES_DISTURBANCE_RATE_FIRE', 'FATES_DISTURBANCE_RATE_LOGGING', 'FATES_DISTURBANCE_RATE_TREEFALL',
'FATES_STOMATAL_COND', 'FATES_LBLAYER_COND', 'FATES_NPP', 'FATES_GPP', 'FATES_AUTORESP',
'FATES_GROWTH_RESP', 'FATES_MAINT_RESP', 'FATES_GPP_CANOPY', 'FATES_AUTORESP_CANOPY', 'FATES_GPP_USTORY',
'FATES_AUTORESP_USTORY', 'FATES_DEMOTION_CARBONFLUX', 'FATES_PROMOTION_CARBONFLUX', 'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_USTORY',
'FATES_NEP', 'FATES_HET_RESP', 'FATES_FIRE_CLOSS', 'FATES_FIRE_FLUX_EL', 'FATES_CBALANCE_ERROR',
'FATES_ERROR_EL', 'FATES_LEAF_ALLOC', 'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC',
'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC'
```

Definition of Done: (from https://github.com/ESCOMP/CTSM/issues/2867#issuecomment-2468708734)
- [ ] Decide if fincl or fexcl should have precedence -- or if we should just validate if it should die in buildnml (Erik strongly asks for the latter)
- [ ] Implement the solution

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.