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 13061 for NEMO/releases/r4.0/r4.0-HEAD/src/OCE – NEMO

Ignore:
Timestamp:
2020-06-08T15:20:11+02:00 (4 years ago)
Author:
smasson
Message:

r4.0-HEAD: fix max number of digits for the cpu number in filename, see #2424

Location:
NEMO/releases/r4.0/r4.0-HEAD/src/OCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/ICB/icbrst.F90

    r11536 r13061  
    189189      ! 
    190190      INTEGER ::   jn   ! dummy loop index 
     191      INTEGER ::   idg  ! number of digits 
    191192      INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim 
    192193      CHARACTER(len=256)     :: cl_path 
    193194      CHARACTER(len=256)     :: cl_filename 
     195      CHARACTER(len=8  )     :: cl_kt 
     196      CHARACTER(LEN=12 )     :: clfmt            ! writing format 
    194197      TYPE(iceberg), POINTER :: this 
    195198      TYPE(point)  , POINTER :: pt 
     
    206209         cl_path = TRIM(cn_ocerst_outdir) 
    207210         IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
     211         WRITE(cl_kt, '(i8.8)') kt 
     212         cl_filename = TRIM(cexper)//"_icebergs_"//cl_kt//"_restart" 
    208213         IF( lk_mpp ) THEN 
    209             WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     214            idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
     215            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)' 
     216            WRITE(cl_filename,  clfmt) TRIM(cl_filename), '_', narea-1, '.nc' 
    210217         ELSE 
    211             WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     218            WRITE(cl_filename,'(a,a)') TRIM(cl_filename),               '.nc' 
    212219         ENDIF 
    213220         IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',  & 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/ICB/icbtrj.F90

    r10068 r13061  
    6262      ! 
    6363      INTEGER                ::   iret, iyear, imonth, iday 
     64      INTEGER                ::   idg  ! number of digits 
    6465      REAL(wp)               ::   zfjulday, zsec 
    6566      CHARACTER(len=80)      ::   cl_filename 
    66       CHARACTER(LEN=20)      ::   cldate_ini, cldate_end 
     67      CHARACTER(LEN=8 )      ::   cldate_ini, cldate_end 
     68      CHARACTER(LEN=12)      ::   clfmt            ! writing format 
    6769      TYPE(iceberg), POINTER ::   this 
    6870      TYPE(point)  , POINTER ::   pt 
     
    8082 
    8183      ! define trajectory output name 
    82       IF ( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A,"_",I4.4,".nc")')   & 
    83          &                        TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)), narea-1 
    84       ELSE                 ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A         ,".nc")')   & 
    85          &                        TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)) 
     84      cl_filename = 'trajectory_icebergs_'//cldate_ini//'-'//cldate_end 
     85      IF ( lk_mpp ) THEN 
     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)' 
     88         WRITE(cl_filename,  clfmt) TRIM(cl_filename), '_', narea-1, '.nc' 
     89      ELSE 
     90         WRITE(cl_filename,'(a,a)') TRIM(cl_filename),               '.nc' 
    8691      ENDIF 
    8792      IF( lwp .AND. nn_verbose_level >= 0 )   WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename) 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/IOM/iom_def.F90

    r10425 r13061  
    3333   INTEGER, PARAMETER, PUBLIC ::   jpmax_vars   = 1200 !: maximum number of variables in one file 
    3434   INTEGER, PARAMETER, PUBLIC ::   jpmax_dims   =  4   !: maximum number of dimensions for one variable 
    35    INTEGER, PARAMETER, PUBLIC ::   jpmax_digits =  5   !: maximum number of digits for the cpu number in the file name 
     35   INTEGER, PARAMETER, PUBLIC ::   jpmax_digits =  9   !: maximum number of digits for the cpu number in the file name 
    3636 
    3737 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/IOM/iom_nf90.F90

    r11536 r13061  
    6060      CHARACTER(LEN=256) ::   clinfo           ! info character 
    6161      CHARACTER(LEN=256) ::   cltmp            ! temporary character 
     62      CHARACTER(LEN=12 ) ::   clfmt            ! writing format 
     63      INTEGER            ::   idg              ! number of digits 
    6264      INTEGER            ::   iln              ! lengths of character 
    6365      INTEGER            ::   istop            ! temporary storage of nstop 
     
    6971      INTEGER            ::   ihdf5            ! local variable for retrieval of value for NF90_HDF5 
    7072      LOGICAL            ::   llclobber        ! local definition of ln_clobber 
    71       INTEGER            ::   ilevels           ! vertical levels 
     73      INTEGER            ::   ilevels          ! vertical levels 
    7274      !--------------------------------------------------------------------- 
    7375      ! 
     
    104106         IF( ldwrt ) THEN              !* the file should be open in write mode so we create it... 
    105107            IF( jpnij > 1 ) THEN 
    106                WRITE(cltmp,'(a,a,i4.4,a)') cdname(1:iln-1), '_', narea-1, '.nc' 
     108               idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
     109               WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg          ! '(a,a,ix.x,a)' 
     110               WRITE(cltmp,clfmt) cdname(1:iln-1), '_', narea-1, '.nc' 
    107111               cdname = TRIM(cltmp) 
    108112            ENDIF 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/LBC/lib_mpp.F90

    r13013 r13061  
    11901190      ! 
    11911191      CHARACTER(len=80) ::   clfile 
     1192      CHARACTER(LEN=10) ::   clfmt            ! writing format 
    11921193      INTEGER           ::   iost 
     1194      INTEGER           ::   idg              ! number of digits 
    11931195      !!---------------------------------------------------------------------- 
    11941196      ! 
     
    11971199      clfile = TRIM(cdfile) 
    11981200      IF( PRESENT( karea ) ) THEN 
    1199          IF( karea > 1 )   WRITE(clfile, "(a,'_',i4.4)") TRIM(clfile), karea-1 
     1201         IF( karea > 1 ) THEN 
     1202            ! Warning: jpnij is maybe not already defined when calling ctl_opn -> use mppsize instead of jpnij 
     1203            idg = MAX( INT(LOG10(REAL(MAX(1,mppsize-1),wp))) + 1, 4 )      ! how many digits to we need to write? min=4, max=9 
     1204            WRITE(clfmt, "('(a,a,i', i1, '.', i1, ')')") idg, idg          ! '(a,a,ix.x)' 
     1205            WRITE(clfile, clfmt) TRIM(clfile), '_', karea-1 
     1206         ENDIF 
    12001207      ENDIF 
    12011208#if defined key_agrif 
Note: See TracChangeset for help on using the changeset viewer.