In def_diag.F
Code: Select all
# ifdef BIO_FENNEL
DO ivar=1,NDbio2d
ifield=iDbio2(ivar)
IF (TRIM(var_name(i)).eq.TRIM(Vname(1,ifield))) THEN
got_var(ifield)=.TRUE.
DIA(ng)%Vid(ifield)=var_id(i)
END IF
END DO
DO ivar=1,NDbio3d
ifield=iDbio3(ivar)
IF (TRIM(var_name(i)).eq.TRIM(Vname(1,ifield))) THEN
got_var(ifield)=.TRUE.
DIA(ng)%Vid(ifield)=var_id(i)
END IF
END DO
# endif
Code: Select all
# ifdef BIO_FENNEL
DO ivar=1,NDbio2d
ifield=iDbio2(ivar)
IF (.not.got_var(ifield).and.Dout(ifield,ng)) THEN
IF (Master) WRITE (stdout,60) TRIM(Vname(1,ifield)), &
& TRIM(ncname)
exit_flag=3
RETURN
END IF
END DO
DO ivar=1,NDbio3d
ifield=iDbio3(ivar)
IF (.not.got_var(ifield).and.Dout(ifield,ng)) THEN
IF (Master) WRITE (stdout,60) TRIM(Vname(1,ifield)), &
& TRIM(ncname)
exit_flag=3
RETURN
END IF
END DO
# endif
Because if one user does turn on #BIO_FENNEL, but not turn on the #DIAGNOSTICS_BIO flag, then in fennel_mod.F, finally become mod_biology.f90, will not allocate a variable called iDbio2 and iDbio3.
Code: Select all
#if defined DIAGNOSTICS && defined DIAGNOSTICS_BIO
!
! Biological 2D diagnostic variable IDs.
!
integer, allocatable :: iDbio2(:) ! 2D biological terms
integer :: iCOfx ! air-sea CO2 flux
integer :: iDNIT ! denitrification flux
integer :: ipCO2 ! partial pressure of CO2
integer :: iO2fx ! air-sea O2 flux
!
! Biological 3D diagnostic variable IDs.
!
integer, allocatable :: iDbio3(:) ! 3D biological terms
integer :: iPPro = 1 ! primary productivity
integer :: iNO3u = 2 ! NO3 uptake
#endif
However, iDbio2 and iDbio3 will be required by def_diag.F if you dod not have a DIAGNOSTICS_BIO limitation. Right?
Thanks.