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 8953 – NEMO

Changeset 8953


Ignore:
Timestamp:
2017-12-08T12:05:11+01:00 (6 years ago)
Author:
frrh
Message:

First working version relative to NEMOv4.0+LIM3

Location:
branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/LIM_SRC_3/icerst.F90

    r8564 r8953  
    1919   USE dom_oce        ! ocean domain 
    2020   USE sbc_oce , ONLY : nn_fsbc 
     21   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2122   USE icectl 
    2223   ! 
     
    4647      !! ** purpose  :   open restart file 
    4748      !!---------------------------------------------------------------------- 
     49      INTEGER             ::   iyear, imonth, iday 
     50      REAL (wp)           ::   zsec 
     51      REAL (wp)           ::   zfjulday      !! 
    4852      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    4953      ! 
     
    6266         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
    6367            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    64             IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    65             ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     68 
     69            IF ( ln_rstdate ) THEN 
     70               zfjulday = fjulday + rdt / rday 
     71               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     72               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     73               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     74            ELSE 
     75          IF( nitrst > 999999999 ) THEN    
     76                  WRITE(clkt, *       ) nitrst 
     77               ELSE               
     78                  WRITE(clkt, '(i8.8)') nitrst 
     79               ENDIF      
    6680            ENDIF 
     81 
     82 
     83!            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     84!            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     85!            ENDIF 
    6786            ! create the file 
    6887            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r7646 r8953  
    273273      ENDIF 
    274274 
    275       IF( .NOT. l_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     275      IF( .NOT. l_offline ) CALL rst_opn( kt, ndastp )        ! Open the restart file if needed and control lrst_oce 
    276276      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
    277277      ! 
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r7822 r8953  
    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 
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90

    r6623 r8953  
    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 deine 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) 
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r8518 r8953  
    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) 
  • branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r6140 r8953  
    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 
    59       !! 
     61      INTEGER, INTENT(in) ::   ndastp ! ocean date 
     62      INTEGER             ::   iyear, imonth, iday 
     63      REAL (wp)           ::   zsec 
     64      REAL (wp)           ::   zfjulday      !! 
     65 
    6066      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6167      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
    62       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
     68      CHARACTER(len=150)  ::   clpath   ! full path to ocean output restart file 
    6369      !!---------------------------------------------------------------------- 
    6470      ! 
     
    8591         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    8692            ! 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 
     93            IF ( ln_rstdate ) THEN 
     94               zfjulday = fjulday + rdt / rday 
     95               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     96               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     97               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     98            ELSE 
     99          IF( nitrst > 999999999 ) THEN    
     100                  WRITE(clkt, *       ) nitrst 
     101               ELSE               
     102                  WRITE(clkt, '(i8.8)') nitrst 
     103               ENDIF      
    89104            ENDIF 
    90105            ! create the file 
Note: See TracChangeset for help on using the changeset viewer.