Small bugs in CPP BIO_FENNEL with DIAG and DIAGNOSTICS_BIO

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
Honolulu_Wang
Posts: 13
Joined: Mon Sep 08, 2014 4:17 pm
Location: Hohai University

Small bugs in CPP BIO_FENNEL with DIAG and DIAGNOSTICS_BIO

#1 Post by Honolulu_Wang » Thu Sep 13, 2018 6:14 pm

Here are small ROMS bugs for DIAGNOSTICS_BIO terms in ROMS.
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
and also

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
I think all this flag should be # if defined BIO_FENNEL && defined DIAGNOSTICS_BIO.

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.

User avatar
arango
Site Admin
Posts: 1081
Joined: Wed Feb 26, 2003 4:41 pm
Location: IMCS, Rutgers University
Contact:

Re: Small bugs in CPP BIO_FENNEL with DIAG and DIAGNOSTICS_

#2 Post by arango » Thu Sep 13, 2018 9:12 pm

Nope. That's not what I have in the repository for def_diags.F:

Code: Select all

# ifdef DIAGNOSTICS_BIO
#  if defined BIO_FENNEL || defined HYPOXIA_SRM
          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
#  endif
#  if defined BIO_FENNEL
          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
# endif

...

# ifdef DIAGNOSTICS_BIO
#  if defined BIO_FENNEL || defined HYPOXIA_SRM
        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
#  endif
#  if defined BIO_FENNEL
        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
# endif
also fennel_mod.h is correct as it is. You either modified those files or need to update!

sun_92
Posts: 19
Joined: Sat Apr 07, 2018 12:59 am
Location: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Re: Small bugs in CPP BIO_FENNEL with DIAG and DIAGNOSTICS_

#3 Post by sun_92 » Thu Sep 20, 2018 4:34 am

Hello all.

I was using Roms AGRIF for doing biogeochemical modelling, now switching to rutgers for the same. Can anyone please help me with the preliminary steps?

I created the biundary initial and forcing files using croco tools. However the bio modules in CROCO and Rutgers are not the same. Any help in this regard would be deeply appreciated.

Post Reply