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/OFF_SRC/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/OFF_SRC/domain.F90

    r3433 r3594  
    8888      !!---------------------------------------------------------------------- 
    8989      USE ioipsl 
     90 
     91      INTEGER :: js    ! dummy loop variable 
     92      CHARACTER(LEN=10)   ::   cltimes  ! restart dump times needed 
     93 
    9094      NAMELIST/namrun/ nn_no   , cn_exp    , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl,   & 
    9195         &             nn_it000, nn_itend  , nn_date0    , nn_leapy     , nn_istate , nn_stock ,   & 
     
    117121         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    118122         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
    119          WRITE(numout,*) '      frequency of restart file       nn_stock   = ', nn_stock 
     123         IF ( nn_stock(1) < 0 ) THEN 
     124            WRITE(numout,*) '      frequency of restart file       nn_stock   = ', ABS(nn_stock(1)) 
     125         ELSE 
     126            WRITE(numout,*) '      list of restart times           nn_stock   = ', nn_stock 
     127         ENDIF 
    120128         WRITE(numout,*) '      frequency of output file        nn_write   = ', nn_write 
    121129         WRITE(numout,*) '      multi file dimgout              ln_dimgnnn = ', ln_dimgnnn 
     
    132140      nleapy = nn_leapy 
    133141      ninist = nn_istate 
    134       nstock = nn_stock 
    135142      nwrite = nn_write 
    136143 
    137  
    138144      !                             ! control of output frequency 
    139       IF ( nstock == 0 .OR. nstock > nitend ) THEN 
    140          WRITE(ctmp1,*) 'nstock = ', nstock, ' it is forced to ', nitend 
     145      IF ( ALL(nn_stock == 0) ) THEN 
     146         WRITE(ctmp1,*) 'No restart output times specified, restart forced to output at end of run, kt = ', nitend 
    141147         CALL ctl_warn( ctmp1 ) 
    142          nstock = nitend 
    143       ENDIF 
     148         nn_stock(1) = nitend 
     149      ELSE 
     150         IF ( nn_stock(1) > 0 ) THEN 
     151            DO js=1,size(nn_stock)-1 
     152               IF ( nn_stock(js+1) <= nn_stock(js) .AND. nn_stock(js+1) .NE. 0.0 ) THEN 
     153                  WRITE(ctmp1,*) 'Restart times in nn_stock not monotonically increasing, some values ignored' 
     154                  CALL ctl_warn( ctmp1 ) 
     155               ENDIF 
     156            ENDDO 
     157            IF ( ANY(nn_stock > nitend) ) THEN 
     158               WRITE(ctmp1,*) 'some values of nn_stock exceed run length they are forced to end of run, kt = ', nitend 
     159               CALL ctl_warn( ctmp1 ) 
     160               WHERE (nn_stock > nitend ) nn_stock=nitend 
     161            ENDIF 
     162         ELSEIF ( nn_stock(1) < 0 ) THEN 
     163            IF ( ABS(nn_stock(1)) > nitend ) THEN 
     164               WRITE(ctmp1,*) 'Attempting to output restarts at frequency greater than run legth, restart forced to output at end of run, kt = ', nitend 
     165               CALL ctl_warn( ctmp1 ) 
     166               nn_stock(1) = nitend 
     167            ELSE 
     168               DO js=1,SIZE(nn_stock)  
     169                  nn_stock(js) = MIN( (ABS(nn_stock(1)) * js  +  nit000 - 1), nitend) 
     170               ENDDO 
     171               IF ( MAXVAL(nn_stock) < nitend ) THEN 
     172                  WRITE(cltimes,FMT='(i10)') (nitend - nit000 + 1)/nn_stock(1) + 1    
     173                  CALL ctl_stop( 'rst_opn:', &    
     174                  'Too many restart dump times to store in the array', &    
     175                  'Increase jpstocks to ' // cltimes  )  
     176               ENDIF 
     177            ENDIF 
     178         ENDIF 
     179      ENDIF 
     180         
    144181      IF ( nwrite == 0 ) THEN 
    145182         WRITE(ctmp1,*) 'nwrite = ', nwrite, ' it is forced to ', nitend 
Note: See TracChangeset for help on using the changeset viewer.