Changeset 783
- Timestamp:
- 2008-01-07T15:29:41+01:00 (17 years ago)
- Location:
- trunk/NEMO
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/LIM_SRC/limrst.F90
r719 r783 54 54 !!---------------------------------------------------------------------- 55 55 ! 56 IF( kt == nit000 ) lrst_ice = .FALSE. 57 58 IF( kt == nitrst - 2*nfice + 1 .OR. nitend - nit000 + 1 <= nfice ) THEN59 ! beware if model runs less than nfice + 1 time step60 ! beware of the format used to write kt (default is i8.8, that should be large enough)61 IF( nitrst > 1.0e9 ) THEN62 WRITE(clkt,*) nitrst63 ELSE64 WRITE(clkt,'(i8.8)') nitrst56 IF( kt == nit000 ) lrst_ice = .FALSE. ! default definition 57 58 ! to get better performances with NetCDF format: 59 ! we open and define the ice restart file one ice time step before writing the data (-> at nitrst - 2*nfice + 1) 60 ! except if we write ice restart files every ice time step or if an ice restart file was writen at nitend - 2*nfice + 1 61 IF( kt == nitrst - 2*nfice + 1 .OR. nstock == nfice .OR. ( kt == nitend - nfice + 1 .AND. .NOT. lrst_ice ) ) THEN 62 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 63 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 64 ELSE ; WRITE(clkt, '(i8.8)') nitrst 65 65 ENDIF 66 66 ! create the file 67 IF(lwp) WRITE(numout,*)68 67 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_restart_ice" 69 IF(lwp) WRITE(numout,*) ' open ice restart.output NetCDF file: '//clname 68 IF(lwp) THEN 69 WRITE(numout,*) 70 SELECT CASE ( jprstlib ) 71 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ice restart binary file: '//clname 72 CASE DEFAULT ; WRITE(numout,*) ' open ice restart NetCDF file: '//clname 73 END SELECT 74 IF( kt == nitrst - 2*nfice + 1 ) THEN 75 WRITE(numout,*) ' kt = nitrst - 2*nfice + 1 = ', kt,' date= ', ndastp 76 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 77 ENDIF 78 ENDIF 79 70 80 CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib ) 71 81 lrst_ice = .TRUE. … … 85 95 !!---------------------------------------------------------------------- 86 96 87 iter = kt + nfice - 197 iter = kt + nfice - 1 ! ice restarts are written at kt == nitrst - nfice + 1 88 98 89 99 IF( iter == nitrst ) THEN 90 100 IF(lwp) WRITE(numout,*) 91 IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart .output NetCDFfile kt =', kt101 IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file kt =', kt 92 102 IF(lwp) WRITE(numout,*) '~~~~~~~' 93 103 ENDIF … … 97 107 ! ! calendar control 98 108 CALL iom_rstput( iter, nitrst, numriw, 'nfice' , REAL( nfice, wp) ) ! time-step 99 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice', REAL( iter , wp) ) ! date109 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice', REAL( iter , wp) ) ! date 100 110 101 111 CALL iom_rstput( iter, nitrst, numriw, 'hicif' , hicif (:,:) ) ! prognostic variables -
trunk/NEMO/OPA_SRC/DOM/domain.F90
r719 r783 181 181 ndastp = ndate0 ! Assign initial date to current date 182 182 183 ! ... Control of output frequency 184 IF ( nstock == 0 ) THEN 185 IF(lwp)WRITE(numout,cform_war) 186 IF(lwp)WRITE(numout,*) ' nstock = ', nstock, ' it is forced to ', nitend 187 nstock = nitend 188 nwarn = nwarn + 1 183 ! ... Control of output frequency 184 IF ( nstock == 0 .OR. nstock > nitend - nit000 + 1 ) THEN 185 WRITE(ctmp1,*) ' nstock = ', nstock, ' it is forced to ', nitend - nit000 + 1 186 CALL ctl_warn( ctmp1 ) 187 nstock = nitend - nit000 + 1 189 188 ENDIF 190 189 IF ( nwrite == 0 ) THEN 191 IF(lwp)WRITE(numout,cform_war) 192 IF(lwp)WRITE(numout,*) ' nwrite = ', nwrite, ' it is forced to ', nitend 193 nwrite = nitend 194 nwarn = nwarn + 1 190 WRITE(ctmp1,*) ' nwrite = ', nwrite, ' it is forced to ', nitend 191 CALL ctl_warn( ctmp1 ) 192 nwrite = nitend 195 193 ENDIF 196 194 … … 261 259 IF( lk_ice_lim ) THEN 262 260 IF(lwp) WRITE(numout,*) ' ice model coupling frequency nfice = ', nfice 261 IF( MOD( nitend - nit000 + 1, nfice) /= 0 ) THEN 262 WRITE(ctmp1,*) 'experiment length (', nitend - nit000 + 1, ') is NOT a multiple of nfice (', nfice, ')' 263 CALL ctl_stop( ctmp1, 'Impossible to do proper restart files' ) 264 ENDIF 265 IF( MOD( nstock , nfice) /= 0 ) THEN 266 WRITE(ctmp1,*) 'nstock (' , nstock , ') is NOT a multiple of nfice (', nfice, ')' 267 CALL ctl_stop( ctmp1, 'Impossible to do proper restart files' ) 268 ENDIF 263 269 nfbulk = nfice 264 IF( MOD( rday, nfice*rdt ) /= 0 ) THEN 265 IF(lwp) WRITE(numout,*) ' ' 266 IF(lwp) WRITE(numout,*) 'W A R N I N G : nfice is NOT a multiple of the number of time steps in a day' 267 IF(lwp) WRITE(numout,*) ' ' 268 ENDIF 270 IF( MOD( rday, nfice*rdt ) /= 0 ) CALL ctl_warn( 'nfice is NOT a multiple of the number of time steps in a day' ) 269 271 IF(lwp) WRITE(numout,*) ' bulk computation frequency nfbulk = ', nfbulk, ' = nfice if ice model used' 270 272 IF(lwp) WRITE(numout,*) ' flag closed sea or not nclosea = ', nclosea -
trunk/NEMO/OPA_SRC/TRD/trdmld_rst.F90
r719 r783 46 46 !!-------------------------------------------------------------------------------- 47 47 48 IF( kt == nitrst-1 ) THEN 49 IF( nitrst > 1.0e9 ) THEN 50 WRITE(clkt,*) nitrst 51 ELSE 52 WRITE(clkt,'(i8.8)') nitrst 48 ! to get better performances with NetCDF format: 49 ! we open and define the ocean restart_mld file one time step before writing the data (-> at nitrst - 1) 50 ! except if we write ocean restart_mld files every time step or if an ocean restart_mld file was writen at nitend - 1 51 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nstock ) == 0 ) ) THEN 52 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 53 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 54 ELSE ; WRITE(clkt, '(i8.8)') nitrst 53 55 ENDIF 56 ! create the file 54 57 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_restart_mld" 55 IF(lwp) WRITE(numout,*) ' open ocean restart_mld NetCDF file: '//clname 58 IF(lwp) THEN 59 WRITE(numout,*) 60 SELECT CASE ( jprstlib ) 61 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart_mld binary file: '//clname 62 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart_mld NetCDF file: '//clname 63 END SELECT 64 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 65 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 66 ENDIF 67 ENDIF 68 56 69 CALL iom_open( clname, nummldw, ldwrt = .TRUE., kiolib = jprstlib ) 57 70 ENDIF … … 59 72 IF( kt == nitrst .AND. lwp ) THEN 60 73 WRITE(numout,*) 61 WRITE(numout,*) 'trdmld_rst: output for ML diags. restart, with trd_mld_rst_write routine '74 WRITE(numout,*) 'trdmld_rst: output for ML diags. restart, with trd_mld_rst_write routine kt =', kt 62 75 WRITE(numout,*) '~~~~~~~~~~' 63 76 WRITE(numout,*) … … 81 94 CALL iom_rstput( kt, nitrst, nummldw, 'tml_sumb' , tml_sumb ) 82 95 DO jk = 1, jpltrd 83 IF( jk < 10 ) THEN 84 WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 85 ELSE 86 WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 96 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 97 ELSE ; WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 87 98 ENDIF 88 99 CALL iom_rstput( kt, nitrst, nummldw, charout, tmltrd_csum_ub(:,:,jk) ) … … 94 105 CALL iom_rstput( kt, nitrst, nummldw, 'sml_sumb' , sml_sumb ) 95 106 DO jk = 1, jpltrd 96 IF( jk < 10 ) THEN 97 WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 98 ELSE 99 WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 107 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 108 ELSE ; WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 100 109 ENDIF 101 110 CALL iom_rstput( kt, nitrst, nummldw, charout , smltrd_csum_ub(:,:,jk) ) -
trunk/NEMO/OPA_SRC/restart.F90
r746 r783 65 65 !!---------------------------------------------------------------------- 66 66 ! 67 IF( kt == nit000 ) THEN ! default initialization, to do: should be read in the namelist... 68 nitrst = nitend ! to do: should be read in the namelist in a cleaver way... 69 lrst_oce = .FALSE. 70 ENDIF 71 72 IF ( kt == nitrst-1 .AND. lrst_oce ) THEN 73 CALL ctl_stop( 'rst_opn: we cannot create an ocean restart at every time step', & 74 & 'if the run has more than one time step!!!' ) 75 numrow = 0 76 ELSEIF( kt == nitrst-1 .OR. nitend == nit000 ) THEN ! beware if model runs only one time step 77 ! beware of the format used to write kt (default is i8.8, that should be large enough) 78 IF( nitrst > 1.0e9 ) THEN 79 WRITE(clkt,*) nitrst 80 ELSE 81 WRITE(clkt,'(i8.8)') nitrst 67 IF( kt == nit000 ) THEN ! default definitions 68 lrst_oce = .FALSE. 69 nitrst = nitend 70 ENDIF 71 IF( MOD( kt - 1, nstock ) == 0 ) THEN 72 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 73 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 74 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 75 ENDIF 76 77 ! to get better performances with NetCDF format: 78 ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) 79 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 80 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 81 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 82 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 83 ELSE ; WRITE(clkt, '(i8.8)') nitrst 82 84 ENDIF 83 85 ! create the file … … 86 88 WRITE(numout,*) 87 89 SELECT CASE ( jprstlib ) 88 CASE ( jpnf90 ) 89 WRITE(numout,*) ' open ocean restart.output NetCDF file: '//clname 90 CASE ( jprstdimg ) 91 WRITE(numout,*) ' open ocean restart.output binary file: '//clname 90 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart binary file: '//clname 91 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 92 92 END SELECT 93 IF( kt == nitrst-1 ) THEN 94 WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 95 ELSE 96 WRITE(numout,*) ' kt = ', kt,' date= ', ndastp 93 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 94 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 97 95 ENDIF 98 96 ENDIF … … 116 114 INTEGER, INTENT(in) :: kt ! ocean time-step 117 115 !!---------------------------------------------------------------------- 116 117 IF( kt == nitrst ) THEN 118 IF(lwp) WRITE(numout,*) 119 IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file kt =', kt 120 IF(lwp) WRITE(numout,*) '~~~~~~~' 121 ENDIF 118 122 119 123 ! calendar control
Note: See TracChangeset
for help on using the changeset viewer.