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 5462 for branches/UKMO/restart_datestamp/NEMOGCM/NEMO/LIM_SRC_2/limrst_2.F90 – NEMO

Ignore:
Timestamp:
2015-06-22T16:40:58+02:00 (9 years ago)
Author:
davestorkey
Message:

Update UKMO/restart_datestamp branch to revision 5442 of trunk. Also clear the SVN keywords again - necessary after the update step.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/restart_datestamp/NEMOGCM/NEMO/LIM_SRC_2/limrst_2.F90

    r5420 r5462  
    5050      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    5151      CHARACTER(LEN=50)   ::   clname   ! ice output restart file name 
     52      CHARACTER(len=150)  ::   clpath   ! full path to ice output restart file 
    5253      !!---------------------------------------------------------------------- 
    5354      ! 
     
    5859      ! except if we write ice restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 
    5960      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 
    60          ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    61          IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    62          ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     61         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
     62            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     63            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     64            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     65            ENDIF 
     66            ! create the file 
     67            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
     68            clpath = TRIM(cn_icerst_outdir)  
     69            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/'  
     70            IF(lwp) THEN 
     71               WRITE(numout,*) 
     72               SELECT CASE ( jprstlib ) 
     73               CASE ( jprstdimg ) 
     74                  WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
     75               CASE DEFAULT 
     76                  WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
     77               END SELECT 
     78               IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
     79                  WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
     80               ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
     81               ENDIF 
     82            ENDIF 
     83 
     84            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
     85            lrst_ice = .TRUE. 
    6386         ENDIF 
    64          ! create the file 
    65          clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
    66          IF(lwp) THEN 
    67             WRITE(numout,*) 
    68             SELECT CASE ( jprstlib ) 
    69             CASE ( jprstdimg )   ;   WRITE(numout,*) '             open ice restart binary file: '//clname 
    70             CASE DEFAULT         ;   WRITE(numout,*) '             open ice restart NetCDF file: '//clname 
    71             END SELECT 
    72             IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
    73                WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
    74             ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
    75             ENDIF 
    76          ENDIF 
    77  
    78          CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
    79          lrst_ice = .TRUE. 
    8087      ENDIF 
    8188      ! 
     
    188195        ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
    189196        ! if {cn_icerst_in}.nc exists, then set jlibalt to jpnf90 
    190         INQUIRE( FILE = TRIM(cn_icerst_in)//'.nc', EXIST = llok ) 
     197        INQUIRE( FILE = TRIM(cn_icerst_indir)//'/'//TRIM(cn_icerst_in)//'.nc', EXIST = llok ) 
    191198        IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF 
    192199      ENDIF 
    193200 
    194       CALL iom_open ( cn_icerst_in, numrir, kiolib = jlibalt ) 
     201      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//TRIM(cn_icerst_in), numrir, kiolib = jlibalt ) 
    195202 
    196203      CALL iom_get( numrir, 'kt_ice' , ziter ) 
Note: See TracChangeset for help on using the changeset viewer.