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 – NEMO

Changeset 13009 for NEMO/trunk


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

Location:
NEMO/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/ICB/icbrst.F90

    r12933 r13009  
    215215         cl_filename = TRIM(cexper)//"_"//TRIM(ADJUSTL(cl_kt))//"_"//TRIM(cn_icbrst_out) 
    216216         IF( lk_mpp ) THEN 
    217             idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
    218             WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)' 
     217            idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
     218            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)' 
    219219            WRITE(cl_filename,clfmt) TRIM(cl_filename), '_', narea-1, '.nc' 
    220220         ELSE 
  • NEMO/trunk/src/OCE/ICB/icbtrj.F90

    r12933 r13009  
    8484      cl_filename = 'trajectory_icebergs_'//TRIM(ADJUSTL(cldate_ini))//'-'//TRIM(ADJUSTL(cldate_end)) 
    8585      IF ( lk_mpp ) THEN 
    86          idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
    87          WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)' 
     86         idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
     87         WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)' 
    8888         WRITE(cl_filename,clfmt) TRIM(cl_filename), '_', narea-1, '.nc' 
    8989      ELSE 
  • NEMO/trunk/src/OCE/IOM/iom_nf90.F90

    r12933 r13009  
    111111         IF( ldwrt ) THEN              !* the file should be open in write mode so we create it... 
    112112            IF( jpnij > 1 ) THEN 
    113                idg = MAX( INT(LOG10(REAL(jpnij-1,wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
    114                WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg   ! '(a,a,ix.x,a)' 
     113               idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
     114               WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)' 
    115115               WRITE(cltmp,clfmt) cdname(1:iln-1), '_', narea-1, '.nc' 
    116116               cdname = TRIM(cltmp) 
  • 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 
  • NEMO/trunk/src/OCE/stpctl.F90

    r12933 r13009  
    260260      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
    261261      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
    262       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     262      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
    263263      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
    264264                                   WRITE(clmax, cl4) kmax-1 
  • NEMO/trunk/src/SAS/stpctl.F90

    r12933 r13009  
    220220      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
    221221      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
    222       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     222      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
    223223      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
    224224                                   WRITE(clmax, cl4) kmax-1 
  • NEMO/trunk/tests/CANAL/MY_SRC/stpctl.F90

    r12933 r13009  
    260260      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
    261261      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
    262       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     262      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
    263263      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
    264264                                   WRITE(clmax, cl4) kmax-1 
  • NEMO/trunk/tests/STATION_ASF/MY_SRC/stpctl.F90

    r12933 r13009  
    219219      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
    220220      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
    221       WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij-1,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     221      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
    222222      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
    223223                                   WRITE(clmax, cl4) kmax-1 
Note: See TracChangeset for help on using the changeset viewer.