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.
#2212 (12 months runoff hard coded...) – NEMO

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2212 closed Defect (fixed)

12 months runoff hard coded...

Reported by: smasson Owned by: systeam
Priority: low Milestone:
Component: SBC Version: trunk
Severity: minor Keywords:
Cc: rblod

Description (last modified by nicolasmartin)


Reported by Rachid: in sbc_rnf_init, the use of 12 record runoff files is hard coded...
Indeed we have a nice hard coded declaration...

      REAL(wp), DIMENSION(12)                 :: zrec             ! times records

No need to say that there is no call to any warning/stop or any comment to warn people about this hard coded definition...

This zrec is required but, in fact, not needed in iom_gettime:

         CALL iom_gettime( inum, zrec, kntime=nbrec)

nbrec is next used to allocate a 3D array zrnfcl(jpi,jpj,nbrec) without any test on the error status exit... I let you imagine what happen when nbrec = 365...

Cherry on the cake: this 3D array is not needed as the iom_get is done in a temporal loop:

         DO jm = 1, nbrec
            CALL iom_get( inum, jpdom_data, TRIM( sn_rnf%clvar ), zrnfcl(:,:,jm), jm )
         END DO

Last point, iom_gettime mix-up unlimited dimension size with a time axis variable... this routine requires an input array (that is in fact never used) which size is not know when calling iom_gettime...


Clean up all this mess...


Dont't let this king of crappy code to be commited...

Commit History (2)


trunk: avoid the allocation of potentialy large array in sbcrnf, see #2212


trunk: replace iom_gettime by iom_getszuld, see #2212

Change History (5)

comment:1 Changed 5 years ago by smasson

In 10522:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:2 Changed 5 years ago by smasson

[10522] : first step: get rid of iom_gettime to avoid the use of an array which size is unknown...

comment:3 Changed 5 years ago by smasson

In 10523:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:4 Changed 5 years ago by smasson

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

comment:5 Changed 5 years ago by nicolasmartin

  • Description modified (diff)
Note: See TracTickets for help on using tickets.