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 4780 for branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 – NEMO

Ignore:
Timestamp:
2014-09-19T18:45:49+02:00 (10 years ago)
Author:
edblockley
Message:

Second commit in UKMO11 development branch.

This change allows the user to replace the nn_stock frequency-based restart dump writing functionality with a list-based version (nn_stocklist).
This is conterolled using the logical ln_rst_list which defaults to false.
At present the list is hard-wired to have maximum 10 entries but this could be modified if required.

Ed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r4775 r4780  
    6565      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    & 
    6666         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 
    67          ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    68          IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    69          ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     67         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
     68            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     69            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     70            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     71            ENDIF 
     72            ! create the file 
     73            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
     74            clpath = TRIM(cn_icerst_outdir)  
     75            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
     76            IF(lwp) THEN 
     77               WRITE(numout,*) 
     78               SELECT CASE ( jprstlib ) 
     79               CASE ( jprstdimg ) 
     80                  WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
     81               CASE DEFAULT 
     82                  WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
     83               END SELECT 
     84               IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
     85                  WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
     86               ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
     87               ENDIF 
     88            ENDIF 
     89            ! 
     90            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
     91            lrst_ice = .TRUE. 
    7092         ENDIF 
    71          ! create the file 
    72          clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
    73          clpath = TRIM(cn_icerst_outdir)  
    74          IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
    75          IF(lwp) THEN 
    76             WRITE(numout,*) 
    77             SELECT CASE ( jprstlib ) 
    78             CASE ( jprstdimg ) 
    79                WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
    80             CASE DEFAULT 
    81                WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
    82             END SELECT 
    83             IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
    84                WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
    85             ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
    86             ENDIF 
    87          ENDIF 
    88          ! 
    89          CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
    90          lrst_ice = .TRUE. 
    9193      ENDIF 
    9294      ! 
Note: See TracChangeset for help on using the changeset viewer.