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 3890 for branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2013-04-23T15:44:05+02:00 (11 years ago)
Author:
acc
Message:

Branch 2013/dev_r3858_NOC_ZTC, #863. Changes to make new vvl code restartable. Vertical scale factors are read in dom_vvl_init which is called from domain before istate. Introduced rst_read_open in restart.F90 so that the restart file can be optionally opened in advance of the call to rst_read

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r3867 r3890  
    2929   PRIVATE 
    3030 
    31    PUBLIC   rst_opn    ! routine called by step module 
    32    PUBLIC   rst_write  ! routine called by step module 
    33    PUBLIC   rst_read   ! routine called by opa  module 
     31   PUBLIC   rst_opn         ! routine called by step module 
     32   PUBLIC   rst_write       ! routine called by step module 
     33   PUBLIC   rst_read        ! routine called by istate module 
     34   PUBLIC   rst_read_open   ! routine called in rst_read and (possibly) in dom_vvl_init 
    3435 
    3536   !! * Substitutions 
     
    138139   END SUBROUTINE rst_write 
    139140 
     141   SUBROUTINE rst_read_open 
     142      !!----------------------------------------------------------------------  
     143      !!                   ***  ROUTINE rst_read_open  *** 
     144      !!  
     145      !! ** Purpose :   Open read files for restart (format fixed by jprstlib ) 
     146      !!  
     147      !! ** Method  :   Use a non-zero, positive value of numror to assess whether or not 
     148      !!                the file has already been opened 
     149      !!---------------------------------------------------------------------- 
     150      INTEGER  ::   jlibalt = jprstlib 
     151      LOGICAL  ::   llok 
     152      !!---------------------------------------------------------------------- 
     153 
     154      IF( numror .LE. 0 ) THEN 
     155         IF(lwp) THEN                                             ! Contol prints 
     156            WRITE(numout,*) 
     157            SELECT CASE ( jprstlib ) 
     158            CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
     159            CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file' 
     160            END SELECT 
     161            IF ( snc4set%luse )      WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 
     162            WRITE(numout,*) '~~~~~~~~' 
     163         ENDIF 
     164 
     165         IF ( jprstlib == jprstdimg ) THEN 
     166           ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
     167           ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90 
     168           INQUIRE( FILE = TRIM(cn_ocerst_in)//'.nc', EXIST = llok ) 
     169           IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF 
     170         ENDIF 
     171         CALL iom_open( cn_ocerst_in, numror, kiolib = jlibalt ) 
     172      ENDIF 
     173   END SUBROUTINE rst_read_open 
    140174 
    141175   SUBROUTINE rst_read 
     
    148182      !!---------------------------------------------------------------------- 
    149183      REAL(wp) ::   zrdt, zrdttra1 
    150       INTEGER  ::   jk, jlibalt = jprstlib 
     184      INTEGER  ::   jk 
    151185      LOGICAL  ::   llok 
    152186      !!---------------------------------------------------------------------- 
    153187 
    154       IF(lwp) THEN                                             ! Contol prints 
    155          WRITE(numout,*) 
    156          SELECT CASE ( jprstlib ) 
    157          CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
    158          CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file' 
    159          END SELECT 
    160          IF ( snc4set%luse )      WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 
    161          WRITE(numout,*) '~~~~~~~~' 
    162       ENDIF 
    163  
    164       IF ( jprstlib == jprstdimg ) THEN 
    165         ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
    166         ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90 
    167         INQUIRE( FILE = TRIM(cn_ocerst_in)//'.nc', EXIST = llok ) 
    168         IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF 
    169       ENDIF 
    170       CALL iom_open( cn_ocerst_in, numror, kiolib = jlibalt ) 
     188      CALL rst_read_open           ! open restart for reading (if not already opened) 
    171189 
    172190      ! Check dynamics and tracer time-step consistency and force Euler restart if changed 
Note: See TracChangeset for help on using the changeset viewer.