ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
305 stars 308 forks source link

uninitialized errors with fates: get_croot_carbon_patch and dustmod #2321

Open rgknox opened 8 months ago

rgknox commented 8 months ago

These routines, get_croot_carbon_patch and get_froot_carbon_patch are found in CNVegetationFacade and called in clm_driver right before CanopyFluxes. These routines are apparently there to calculate the patch level fine-root and coarse root carbon. They are called while fates is active, over fates columns and performing nonsense calculations on probably uninitialized variables:

https://github.com/ESCOMP/CTSM/blob/ctsm5.1.dev163/src/biogeochem/CNVegetationFacade.F90#L1603-L1623

This did generate a fail when I changed the FatesColdSatPhen_prescribed test to use gnu and debug (which catches uninitialized variables): SMS_D_Ld3.f09_g17.I2000Clm51FatesSpCruRsGs.derecho_gnu.clm-FatesColdSatPhen_prescribed

Solution: Simple solution is to not call the routines and block it out from clm_driver, a slightly more elegant and future proofed way would be to filter at the column level inside the routine in case fates is run along side a crop model or something.

rgknox commented 8 months ago

The following error is also generated in dev163 when I use gnu and debug flags on that test in derecho:

dec1741.hsn.de.hpc.ucar.edu 769:  Error dstmbl: pft=           69  lnd_frc_mbl(p)=    2216381976734.5981     
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: local  patch    index = 69
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: global patch    index = 149382
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: global column   index = 24438
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: global landunit index = 15097
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: global gridcell index = 7810
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: gridcell longitude    =  135.0000000
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: gridcell latitude     =  -14.6073298
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: pft      type         = 0
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: column   type         = 1
dec1741.hsn.de.hpc.ucar.edu 769: iam = 641: landunit type         = 1
dec1741.hsn.de.hpc.ucar.edu 769:  ENDRUN:
dec1741.hsn.de.hpc.ucar.edu 769:  ERROR: ERROR in /glade/u/home/rgknox/ctsm/src/biogeochem/DUSTMod.F90 at line 336
dec1741.hsn.de.hpc.ucar.edu 769: #0  0x108c820 in __shr_abort_mod_MOD_shr_abort_backtrace
dec1741.hsn.de.hpc.ucar.edu 769:    at /glade/u/home/rgknox/ctsm/share/src/shr_abort_mod.F90:104
dec1741.hsn.de.hpc.ucar.edu 769: #1  0x108c8e3 in __shr_abort_mod_MOD_shr_abort_abort
dec1741.hsn.de.hpc.ucar.edu 769:    at /glade/u/home/rgknox/ctsm/share/src/shr_abort_mod.F90:61
dec1741.hsn.de.hpc.ucar.edu 769: #2  0x5b3960 in __abortutils_MOD_endrun_write_point_context
dec1741.hsn.de.hpc.ucar.edu 769:    at /glade/u/home/rgknox/ctsm/src/main/abortutils.F90:98
dec1741.hsn.de.hpc.ucar.edu 769: #3  0x89f8e9 in __dustmod_MOD_dustemission
dec1741.hsn.de.hpc.ucar.edu 769:    at /glade/u/home/rgknox/ctsm/src/biogeochem/DUSTMod.F90:336
ekluzek commented 7 months ago

@adrifoster and @glemieux will work on this.