-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Describe the issue
The SeedlingParPatch subroutine uses absolute canopy area (m2) instead of fractional area when calculating par_high_frac and par_low_frac, causing negative values that produce NaNs in seedling light calculations.
fates/main/FatesInterfaceMod.F90
Lines 2411 to 2414 in 3b58472
| ! Start with the assumption that there is a single canopy layer | |
| seedling_par_high = atm_par_dir+atm_par_dif | |
| par_high_frac = 1._r8-cpatch%total_canopy_area | |
| par_low_frac = cpatch%total_canopy_area |
Solution: normalize by patch area
par_high_frac = 1._r8 - (cpatch%total_canopy_area / cpatch%area)
par_low_frac = cpatch%total_canopy_area / cpatch%area
Relevant log output
--WARNING-- skipping CN balance check for first timesteps after startup or data assimilation
--WARNING-- skipping CN balance check for first timesteps after startup or data assimilation
--WARNING-- skipping CN balance check for first timesteps after startup or data assimilation
mass balance error detected
element type (see PRTGenericMod.F90): 1
error fraction relative to biomass stock: 0.0000000000000000
absolut error (flux in - change): NaN
call index: 1
Element index (PARTEH global): 1
net: NaN
dstock: NaN
seed_in: 2.7397260273972605E-002
net_root_uptake: 0.0000000000000000
gpp_acc: 1.8857599694259481
flux_generic_in: 0.0000000000000000
wood_product_harvest: 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
wood_product_landusechange: 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000
error from patch resizing: 0.0000000000000000
burn_flux_to_atm: 0.0000000000000000
seed_out: 0.0000000000000000
flux_generic_out: 0.0000000000000000
frag_out: NaN
aresp_acc: 0.81214024114323924
herbivory_flux_out: 0.0000000000000000
error=net_flux-dstock: NaN
biomass 178.67897611883575
litter 9.9332023308671769
seeds NaN
total stock NaN
previous total 189.34740446594373
lat lon 9.1530000000000005 280.15390000000002
=== DEBUG PAR CALCULATION Day: 1.0208333333333333
Site: 1 Patch: 1
Input atm_par_dir: 288.47089003109909
Input atm_par_dif: 88.529109968900912
seedling_par_high: 377.00000000000000
par_high_frac: -514.12037051582422
seedling_par_low: 224.36420292270481
par_low_frac: 515.12037051582422
new_seedling_layer_par: -78248.808344434467FATES tag
sci.1.87.5_api.41.0.0-12-gf2c22336
Host land model tag
ctsm5.3.077
Machine
derecho
Other supported machine name
No response
Additional context
I have fixes for this and couple of additional bugs (which I'll make separate issues), on my branch debug_trs
Metadata
Metadata
Labels
No labels
Type
Projects
Status
❕Todo