There is a possible bug in routines fennel_mod.h.
! Set number of diagnostics terms.
!
NDbio3d=2
NDbio2d=0
# ifdef DENITRIFICATION
NDbio2d=NDbio2d+1
# endif
# ifdef CARBON
NDbio2d=NDbio2d+2
# endif
# ifdef OXYGEN
NDbio2d=NDbio2d+1
# endif
IF DIAGNOSTICS_BIO is defined and DENITRIFICATION, CARBON and OXYGEN are not defined. Then NDbio2d = 0. Array iDbio2 will be allocated as iDbio2(0).