New URL for NEMO forge!

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#1141 (Out of bounds in closea.F90/clo_rnf) – NEMO

Opened 11 years ago

Closed 10 years ago

#1141 closed Bug (fixed)

Out of bounds in closea.F90/clo_rnf

Reported by: nemo_user Owned by: smasson
Priority: highest Milestone:
Component: OCE Version: trunk
Severity: Keywords:


In closea.F90 / clo_rnf

p_rnfmsk experiences out of bounds index. mi0 and mj0 should not be used directly, but only to define a range of index.

Here is my proposal of clo_rnf :

  SUBROUTINE clo_rnf( p_rnfmsk )
      !!                  ***  ROUTINE sbc_rnf  ***
      !! ** Purpose :   allow the treatment of closed sea outflow grid-points
      !!                to be the same as river mouth grid-points
      !! ** Method  :   set to 1 the runoff mask (mskrnf, see sbcrnf module)
      !!                at the closed sea outflow grid-point.
      !! ** Action  :   update (p_)mskrnf (set 1 at closed sea outflow)
      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array)
      INTEGER  ::   jc, jn, ji, jj      ! dummy loop indices
      DO jc = 1, jpncs
         IF( ncstt(jc) >= 1 ) THEN            ! runoff mask set to 1 at closed sea outflows
             DO jn = 1, 4
                DO jj =    mj0( ncsjr(jc,jn) ), mj1( ncsjr(jc,jn) )
                   DO ji = mi0( ncsir(jc,jn) ), mi1( ncsir(jc,jn) )
                      p_rnfmsk(ji,jj) = MAX( p_rnfmsk(ji,jj), 1.0_wp )
                   END DO
                END DO
            END DO 
      END DO 

Commit History (2)


v3_4_STABLE: bugfix in closea, see #1141


trunk: bugfix in closea, see #1141

Change History (3)

comment:1 Changed 11 years ago by clevy

  • Owner changed from NEMO team to smasson

comment:2 Changed 11 years ago by smasson

I don't understand where is the problem. This kind of syntax using mi/j0/1 is used in many places in the code. Could you give us more details? Which values of mi/j0/1 do you have when you have the problem?

comment:3 Changed 10 years ago by smasson

  • Resolution set to fixed
  • Status changed from new to closed

Ok I see your point thanks to #1155.
done in the trunk in r4087 and in v3_4_STABLE in r4088

Note: See TracTickets for help on using tickets.