New URL for NEMO forge!   http://forge.nemo-ocean.eu

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.
Changeset 13009 for NEMO/trunk/src/OCE/LBC – NEMO

Ignore:
Timestamp:
2020-06-03T08:35:19+02:00 (4 years ago)
Author:
smasson
Message:

trunk: bugfix, introduced in [12933], when jpnij = 1, see 2477

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/LBC/lib_mpp.F90

    r12933 r13009  
    11261126            CALL ctl_opn( inum,'ocean.output', 'APPEND', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    11271127            WRITE(inum,*) 
    1128             idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )        ! how many digits to we need to write? min=4, max=9 
    1129             WRITE(clfmt, "('(a,i', i1, '.', i1, ')')") idg, idg     ! '(a,ix.x)' 
     1128            idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )        ! how many digits to we need to write? min=4, max=9 
     1129            WRITE(clfmt, "('(a,i', i1, '.', i1, ')')") idg, idg            ! '(a,ix.x)' 
    11301130            WRITE(inum,clfmt) ' ===>>> : see E R R O R in ocean.output_', narea - 1 
    11311131         ENDIF 
     
    12321232      IF( PRESENT( karea ) ) THEN 
    12331233         IF( karea > 1 ) THEN 
    1234             idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )        ! how many digits to we need to write? min=4, max=9 
    1235             WRITE(clfmt, "('(a,a,i', i1, '.', i1, ')')") idg, idg   ! '(a,a,ix.x)' 
     1234            ! Warning: jpnij is maybe not already defined when calling ctl_opn -> use mppsize instead of jpnij 
     1235            idg = MAX( INT(LOG10(REAL(MAX(1,mppsize-1),wp))) + 1, 4 )      ! how many digits to we need to write? min=4, max=9 
     1236            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ')')") idg, idg          ! '(a,a,ix.x)' 
    12361237            WRITE(clfile, clfmt) TRIM(clfile), '_', karea-1 
    12371238         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.