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 3594 for branches/2012/dev_r3452_UKMO9_RESTART/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90 – NEMO

Ignore:
Timestamp:
2012-11-19T13:28:55+01:00 (11 years ago)
Author:
rfurner
Message:

code not tested through SETTEE, builds and runs, but has not been thoroughly tested, so will not be included in 2012 merge, however submitted back to keep record of work done for 2013 developments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3452_UKMO9_RESTART/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r3421 r3594  
    123123      !!---------------------------------------------------------------------- 
    124124      USE ioipsl 
     125 
     126      INTEGER  ::   js               ! dummy loop indice 
     127      CHARACTER(LEN=10)   ::   cltimes  ! restart dump times needed 
     128 
    125129      NAMELIST/namrun/ nn_no   , cn_exp    , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl,   & 
    126130         &             nn_it000, nn_itend  , nn_date0    , nn_leapy     , nn_istate , nn_stock ,   & 
     
    152156         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    153157         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
    154          WRITE(numout,*) '      frequency of restart file       nn_stock   = ', nn_stock 
     158         IF ( nn_stock(1) < 0 ) THEN 
     159            WRITE(numout,*) '      frequency of restart file       nn_stock   = ', ABS(nn_stock(1)) 
     160         ELSE 
     161            WRITE(numout,*) '      list of restart times           nn_stock   = ', nn_stock 
     162         ENDIF 
    155163         WRITE(numout,*) '      frequency of output file        nn_write   = ', nn_write 
    156164         WRITE(numout,*) '      multi file dimgout              ln_dimgnnn = ', ln_dimgnnn 
     
    168176      nleapy = nn_leapy 
    169177      ninist = nn_istate 
    170       nstock = nn_stock 
    171178      nwrite = nn_write 
    172179 
    173180 
    174181      !                             ! control of output frequency 
    175       IF ( nstock == 0 .OR. nstock > nitend ) THEN 
    176          WRITE(ctmp1,*) 'nstock = ', nstock, ' it is forced to ', nitend 
     182      IF ( ALL(nn_stock == 0) ) THEN 
     183         WRITE(ctmp1,*) 'No restart output times specified, restart forced to output at end of run, kt = ', nitend 
    177184         CALL ctl_warn( ctmp1 ) 
    178          nstock = nitend 
    179       ENDIF 
     185         nn_stock(1) = nitend 
     186      ELSE 
     187         IF ( nn_stock(1) > 0 ) THEN 
     188            DO js=1,size(nn_stock)-1 
     189               IF ( nn_stock(js+1) <= nn_stock(js) .AND. nn_stock(js+1) .NE. 0.0 ) THEN 
     190                  WRITE(ctmp1,*) 'Restart times in nn_stock not monotonically increasing, some values ignored' 
     191                  CALL ctl_warn( ctmp1 ) 
     192               ENDIF 
     193            ENDDO 
     194            IF ( ANY(nn_stock > nitend) ) THEN 
     195               WRITE(ctmp1,*) 'some values of nn_stock exceed run length they are forced to end of run, kt = ', nitend 
     196               CALL ctl_warn( ctmp1 ) 
     197               WHERE (nn_stock > nitend ) nn_stock=nitend 
     198            ENDIF 
     199         ELSEIF ( nn_stock(1) < 0 ) THEN 
     200            IF ( ABS(nn_stock(1)) > nitend ) THEN 
     201               WRITE(ctmp1,*) 'Attempting to output restarts at frequency greater than run legth, restart forced to output at end of run, kt = ', nitend 
     202               CALL ctl_warn( ctmp1 ) 
     203               nn_stock(1) = nitend 
     204            ELSE 
     205               DO js=1,SIZE(nn_stock)  
     206                  nn_stock(js) = MIN( (ABS(nn_stock(1)) * js  +  nit000 - 1), nitend) 
     207               ENDDO 
     208               IF ( MAXVAL(nn_stock) < nitend ) THEN 
     209                  WRITE(cltimes,FMT='(i10)') (nitend - nit000 + 1)/nn_stock(1) + 1    
     210                  CALL ctl_stop( 'rst_opn:', &    
     211                  'Too many restart dump times to store in the array', &    
     212                  'Increase jpstocks to ' // cltimes  )  
     213               ENDIF 
     214            ENDIF 
     215         ENDIF 
     216      ENDIF 
     217         
    180218      IF ( nwrite == 0 ) THEN 
    181219         WRITE(ctmp1,*) 'nwrite = ', nwrite, ' it is forced to ', nitend 
Note: See TracChangeset for help on using the changeset viewer.