Bug in reading tl_LBC for biological variables

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
hjsong

Bug in reading tl_LBC for biological variables

#1 Unread post by hjsong »

I would like to report a possible bug in reading tangent linear (and representer) boundary conditions for biological variables.

Since I am working on the NEMURO model, I will follow the script name for this model. But other biological models are also applied.

In the standard input file (ocean.in), you can define different boundary conditions for the nonlinear model and the adjoint model for physical variables.
Then the boundary condition for tangent linear and representer model is assigned in the "read_phypar.F" (line 2671-2691).

Code: Select all

#if defined TANGENT || defined TL_IOMS
!
!  Set lateral boundary condition switches for the tangent linear
!  models (TLM and RPM) to the same values as the adjoint model.
!
        DO ivar=1,nLBCvar
          DO i=1,4
            tl_LBC(i,ivar,ng)%acquire  =ad_LBC(i,ivar,ng)%acquire
            tl_LBC(i,ivar,ng)%Chapman  =ad_LBC(i,ivar,ng)%Chapman
            tl_LBC(i,ivar,ng)%clamped  =ad_LBC(i,ivar,ng)%clamped
            tl_LBC(i,ivar,ng)%closed   =ad_LBC(i,ivar,ng)%closed
            tl_LBC(i,ivar,ng)%Flather  =ad_LBC(i,ivar,ng)%Flather
            tl_LBC(i,ivar,ng)%gradient =ad_LBC(i,ivar,ng)%gradient
            tl_LBC(i,ivar,ng)%nested   =ad_LBC(i,ivar,ng)%nested
            tl_LBC(i,ivar,ng)%nudging  =ad_LBC(i,ivar,ng)%nudging
            tl_LBC(i,ivar,ng)%periodic =ad_LBC(i,ivar,ng)%periodic
            tl_LBC(i,ivar,ng)%radiation=ad_LBC(i,ivar,ng)%radiation
            tl_LBC(i,ivar,ng)%reduced  =ad_LBC(i,ivar,ng)%reduced
          END DO
        END DO
#endif
At this point, "ad_LBC" for biological variables is not yet read because it is read in the function "read_BioPar", which comes after "read_PhyPar" in the "inp_par.F".
The issue is that there is no statement for assigning "tl_LBC" in the function "read_BioPar", or the script "nemuro_inp.h".
So "tl_LBC" may not the same as "ad_LBC" that you give in the "nemuro.in".

My quick fix was just to add the same assigning statement in the "nemuro_inp.h".
I believe there should be better fix for this bug.
I hope I explained this clearly.

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

Re: Bug in reading tl_LBC for biological variables

#2 Unread post by arango »

Yes, good catch. We need to delay the initialization of the tl_LBC logical switches until the biological and sediment models input parameters are processed. I corrected this problem. See the following :arrow: ticket for more details.

Thank you for bringing this to my attention. Please update.

hjsong

Re: Bug in reading tl_LBC for biological variables

#3 Unread post by hjsong »

Thank you for fixing the bug!
It was fast!!

Post Reply