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 10765 for NEMO/branches – NEMO

Changeset 10765 for NEMO/branches


Ignore:
Timestamp:
2019-03-15T13:14:30+01:00 (5 years ago)
Author:
jcastill
Message:

First set of changes

Location:
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/CONFIG/SHARED/namelist_ref

    r10758 r10765  
    3434   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
    3535   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
     36   ln_rstdate  = .false.   !  add a datestamp in the restart file name 
    3637      nn_euler    =    1            !  = 0 : start with forward time step if ln_rstart=T 
    3738      nn_rstctl   =    0            !  restart control ==> activated only if ln_rstart=T 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r10758 r10765  
    2222   USE sbc_ice        ! Surface boundary condition: ice fields 
    2323   USE in_out_manager ! I/O manager 
     24   USE ioipsl  , ONLY : ju2ymds    ! for calendar 
    2425   USE iom            ! I/O library 
    2526   USE lib_mpp        ! MPP library 
     
    5152      !! ** purpose  :   output of sea-ice variable in a netcdf file 
    5253      !!---------------------------------------------------------------------- 
     54      INTEGER             ::   iyear, imonth, iday  
     55      REAL (wp)           ::   zsec  
     56      REAL (wp)           ::   zfjulday      !! 
    5357      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    5458      ! 
     
    6771         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
    6872            ! 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 
     73            IF ( ln_rstdate ) THEN  
     74               zfjulday = fjulday + rdt / rday  
     75               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error  
     76               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )             
     77               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday   
     78            ELSE  
     79              IF( nitrst > 999999999 ) THEN     
     80                WRITE(clkt, *       ) nitrst  
     81              ELSE                
     82                WRITE(clkt, '(i8.8)') nitrst  
     83              ENDIF 
    7184            ENDIF 
    7285            ! create the file 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r10758 r10765  
    274274      ENDIF 
    275275 
    276       IF( .NOT. l_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     276      IF( .NOT. l_offline ) CALL rst_opn( kt, ndastp )        ! Open the restart file if needed and control lrst_oce 
    277277      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
    278278      ! 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r10758 r10765  
    281281      !!---------------------------------------------------------------------- 
    282282      USE ioipsl 
    283       NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list,                 & 
     283      NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list, ln_rstdate,     & 
    284284         &             nn_no   , cn_exp   , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl ,     & 
    285285         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
     
    314314         WRITE(numout,*) '      restart output directory        cn_ocerst_outdir= ', cn_ocerst_outdir 
    315315         WRITE(numout,*) '      restart logical                 ln_rstart  = ', ln_rstart 
     316         WRITE(numout,*) '           use date in restart name     ln_rstdate   = ', ln_rstdate 
    316317         WRITE(numout,*) '      start with forward time step    nn_euler   = ', nn_euler 
    317318         WRITE(numout,*) '      control of time step            nn_rstctl  = ', nn_rstctl 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90

    r10758 r10765  
    2020   !!---------------------------------------------------------------------- 
    2121   USE par_oce        ! NEMO parameters 
     22   USE phycst         ! for rday 
    2223   USE dom_oce        ! NEMO domain 
    2324   USE in_out_manager ! NEMO IO routines 
     25   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2426   USE lib_mpp        ! NEMO MPI library, lk_mpp in particular 
    2527   USE netcdf         ! netcdf routines for IO 
     
    161163      CHARACTER(len=256)     :: cl_filename 
    162164      TYPE(iceberg), POINTER :: this 
     165      INTEGER                :: iyear, imonth, iday  
     166      REAL (wp)              :: zsec  
     167      REAL (wp)              :: zfjulday  
     168      CHARACTER(LEN=20)      :: clkt     ! ocean time-step define as a character      TYPE(iceberg), POINTER :: this 
    163169      TYPE(point)  , POINTER :: pt 
    164170      !!---------------------------------------------------------------------- 
     
    167173      cl_path = TRIM(cn_ocerst_outdir) 
    168174      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
     175      IF ( ln_rstdate ) THEN  
     176         zfjulday = fjulday + rdt / rday  
     177         IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error  
     178         CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )             
     179         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     180      ELSE  
     181         IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt  
     182         ELSE                        ;   WRITE(clkt, '(i8.8)') kt  
     183         ENDIF  
     184      ENDIF 
     185 
    169186      IF( lk_mpp ) THEN 
    170          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     187         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 
    171188      ELSE 
    172          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     189         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 
    173190      ENDIF 
    174191      IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r10758 r10765  
    7777   INTEGER       ::   nitend                      !: index of the last time step 
    7878   INTEGER       ::   ndate0                      !: initial calendar date aammjj 
     79   LOGICAL       ::   ln_rstdate = .FALSE.        !: Use calendar date rather than time-step in restart 
    7980   INTEGER       ::   nleapy                      !: Leap year calendar flag (0/1 or 30) 
    8081   INTEGER       ::   ninist                      !: initial state output flag (0/1) 
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r10758 r10765  
    2727   USE in_out_manager  ! I/O manager 
    2828   USE iom             ! I/O module 
     29   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2930   USE diurnal_bulk 
     31   USE sbc_oce         ! for icesheet freshwater input variables 
    3032    
    3133   IMPLICIT NONE 
     
    4648CONTAINS 
    4749 
    48    SUBROUTINE rst_opn( kt ) 
     50   SUBROUTINE rst_opn( kt, ndastp ) 
    4951      !!--------------------------------------------------------------------- 
    5052      !!                   ***  ROUTINE rst_opn  *** 
     
    5759      !!---------------------------------------------------------------------- 
    5860      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
     61      INTEGER, INTENT(in) ::   ndastp ! ocean date 
    5962      !! 
     63 
     64      INTEGER             ::   iyear, imonth, iday  
     65      REAL (wp)           ::   zsec  
     66      REAL (wp)           ::   zfjulday      !! 
    6067      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6168      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
    62       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
     69      CHARACTER(LEN=150)  ::   clpath   ! full path to ocean output restart file 
    6370      !!---------------------------------------------------------------------- 
    6471      ! 
     
    8592         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    8693            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    87             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    88             ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     94            IF ( ln_rstdate ) THEN  
     95               zfjulday = fjulday + rdt / rday  
     96               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error  
     97               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )             
     98               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday   
     99            ELSE  
     100               IF( nitrst > 999999999 ) THEN     
     101                  WRITE(clkt, *       ) nitrst  
     102               ELSE                
     103                  WRITE(clkt, '(i8.8)') nitrst  
     104               ENDIF 
    89105            ENDIF 
    90106            ! create the file 
Note: See TracChangeset for help on using the changeset viewer.