Changeset 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
- Property svn:eol-style deleted
r1613 r2528 4 4 !! Ocean restart : write the ocean restart file 5 5 !!====================================================================== 6 !! History : ! 99-11 (M. Imbard) Original code 7 !! 8.5 ! 02-08 (G. Madec) F90: Free form 8 !! 9.0 ! 05-11 (V. Garnier) Surface pressure gradient organization 9 !! 9.0 ! 06-07 (S. Masson) use IOM for restart 6 !! History : OPA ! 1999-11 (M. Imbard) Original code 7 !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form 8 !! 2.0 ! 2006-07 (S. Masson) use IOM for restart 9 !! 3.3 ! 2010-04 (M. Leclair, G. Madec) modified LF-RA 10 !! - - ! 2010-10 (C. Ethe, G. Madec) TRC-TRA merge (T-S in 4D) 10 11 !!---------------------------------------------------------------------- 11 12 … … 15 16 !! rst_read : read the ocean restart file 16 17 !!---------------------------------------------------------------------- 18 USE oce ! ocean dynamics and tracers 17 19 USE dom_oce ! ocean space and time domain 18 USE oce ! ocean dynamics and tracers19 20 USE phycst ! physical constants 20 21 USE in_out_manager ! I/O manager 21 22 USE iom ! I/O module 22 USE c1d ! re-initialization of u-v mask for the 1D configuration23 USE zpshde ! partial step: hor. derivative (zps_hde routine)24 23 USE eosbn2 ! equation of state (eos bn2 routine) 25 USE zdfddm ! double diffusion mixing26 USE zdfmxl ! mixed layer depth27 24 USE trdmld_oce ! ocean active mixed layer tracers trends variables 25 USE domvvl ! variable volume 26 USE traswp ! swap from 4D T-S to 3D T & S and vice versa 28 27 29 28 IMPLICIT NONE … … 34 33 PUBLIC rst_read ! routine called by opa module 35 34 36 LOGICAL, PUBLIC :: lrst_oce = .FALSE. 37 INTEGER, PUBLIC :: numror, numrow 35 LOGICAL, PUBLIC :: lrst_oce = .FALSE. !: logical to control the oce restart write 36 INTEGER, PUBLIC :: numror, numrow !: logical unit for cean restart (read and write) 38 37 39 38 !! * Substitutions 39 # include "domzgr_substitute.h90" 40 40 # include "vectopt_loop_substitute.h90" 41 41 !!---------------------------------------------------------------------- 42 !! OPA 9.0 , LOCEAN-IPSL (2006)42 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 43 43 !! $Id$ 44 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 45 !!---------------------------------------------------------------------- 46 44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 45 !!---------------------------------------------------------------------- 47 46 CONTAINS 48 47 … … 88 87 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 89 88 END SELECT 89 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 90 90 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 91 91 ELSE ; WRITE(numout,*) ' kt = ' , kt 92 92 ENDIF 93 93 ENDIF 94 94 ! 95 95 CALL iom_open( clname, numrow, ldwrt = .TRUE., kiolib = jprstlib ) 96 96 lrst_oce = .TRUE. … … 107 107 !! 108 108 !! ** Method : Write in numrow when kt == nitrst in NetCDF 109 !! file, save fields which are necessary for restart109 !! file, save fields which are necessary for restart 110 110 !!---------------------------------------------------------------------- 111 111 INTEGER, INTENT(in) :: kt ! ocean time-step 112 112 !!---------------------------------------------------------------------- 113 113 114 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics time step115 CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) ) ! surface tracer time step116 117 CALL iom_rstput( kt, nitrst, numrow, 'ub' , ub) ! before fields118 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vb)119 CALL iom_rstput( kt, nitrst, numrow, 'tb' , tb)120 CALL iom_rstput( kt, nitrst, numrow, 'sb' , sb)121 CALL iom_rstput( kt, nitrst, numrow, 'rotb' , rotb)122 CALL iom_rstput( kt, nitrst, numrow, 'hdivb' , hdivb)123 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb)124 !125 CALL iom_rstput( kt, nitrst, numrow, 'un' , un ) ! now fields126 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vn )127 CALL iom_rstput( kt, nitrst, numrow, 'tn' , tn)128 CALL iom_rstput( kt, nitrst, numrow, 'sn' , sn)129 CALL iom_rstput( kt, nitrst, numrow, 'rotn' , rotn)130 CALL iom_rstput( kt, nitrst, numrow, 'hdivn' , hdivn)131 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , sshn)132 133 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop)114 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics time step 115 CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) ) ! surface tracer time step 116 117 CALL iom_rstput( kt, nitrst, numrow, 'ub' , ub ) ! before fields 118 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vb ) 119 CALL iom_rstput( kt, nitrst, numrow, 'tb' , tb ) 120 CALL iom_rstput( kt, nitrst, numrow, 'sb' , sb ) 121 CALL iom_rstput( kt, nitrst, numrow, 'rotb' , rotb ) 122 CALL iom_rstput( kt, nitrst, numrow, 'hdivb' , hdivb ) 123 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb ) 124 IF( lk_vvl ) CALL iom_rstput( kt, nitrst, numrow, 'fse3t_b', fse3t_b(:,:,:) ) 125 ! 126 CALL iom_rstput( kt, nitrst, numrow, 'un' , un ) ! now fields 127 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vn ) 128 CALL iom_rstput( kt, nitrst, numrow, 'tn' , tn ) 129 CALL iom_rstput( kt, nitrst, numrow, 'sn' , sn ) 130 CALL iom_rstput( kt, nitrst, numrow, 'rotn' , rotn ) 131 CALL iom_rstput( kt, nitrst, numrow, 'hdivn' , hdivn ) 132 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , sshn ) 133 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 134 134 #if defined key_zdfkpp 135 CALL iom_rstput( kt, nitrst, numrow, 'rhd' , rhd)135 CALL iom_rstput( kt, nitrst, numrow, 'rhd' , rhd ) 136 136 #endif 137 138 137 IF( kt == nitrst ) THEN 139 138 CALL iom_close( numrow ) ! close the restart file (only at last time step) … … 153 152 !!---------------------------------------------------------------------- 154 153 REAL(wp) :: zrdt, zrdttra1 155 INTEGER :: j libalt = jprstlib154 INTEGER :: jk, jlibalt = jprstlib 156 155 LOGICAL :: llok 157 156 !!---------------------------------------------------------------------- … … 163 162 CASE ( jprstdimg ) ; WRITE(numout,*) 'rst_read : read oce binary restart file' 164 163 END SELECT 164 IF ( snc4set%luse ) WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 165 165 WRITE(numout,*) '~~~~~~~~' 166 166 ENDIF … … 184 184 ENDIF 185 185 ! 186 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub )! before fields187 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb)188 CALL iom_get( numror, jpdom_autoglo, 'tb' , tb)189 CALL iom_get( numror, jpdom_autoglo, 'sb' , sb)190 CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb)191 CALL iom_get( numror, jpdom_autoglo, 'hdivb', hdivb)192 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb)193 !194 CALL iom_get( numror, jpdom_autoglo, 'un' , un ) ! now fields195 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn )196 CALL iom_get( numror, jpdom_autoglo, 'tn' , tn)197 CALL iom_get( numror, jpdom_autoglo, 'sn' , sn)198 CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn)199 CALL iom_get( numror, jpdom_autoglo, 'hdivn', hdivn)200 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn)201 202 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop )! now potential density186 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub ) ! before fields 187 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb ) 188 CALL iom_get( numror, jpdom_autoglo, 'tb' , tb ) 189 CALL iom_get( numror, jpdom_autoglo, 'sb' , sb ) 190 CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb ) 191 CALL iom_get( numror, jpdom_autoglo, 'hdivb' , hdivb ) 192 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb ) 193 IF( lk_vvl ) CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) ) 194 ! 195 CALL iom_get( numror, jpdom_autoglo, 'un' , un ) ! now fields 196 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn ) 197 CALL iom_get( numror, jpdom_autoglo, 'tn' , tn ) 198 CALL iom_get( numror, jpdom_autoglo, 'sn' , sn ) 199 CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn ) 200 CALL iom_get( numror, jpdom_autoglo, 'hdivn' , hdivn ) 201 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn ) 202 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop ) ! now potential density 203 203 #if defined key_zdfkpp 204 204 IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 205 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd )! now in situ density anomaly205 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd ) ! now in situ density anomaly 206 206 ELSE 207 CALL eos( tn, sn, rhd ) ! compute rhd 207 CALL tra_swap 208 CALL eos( tsn, rhd ) ! compute rhd 208 209 ENDIF 209 210 #endif 210 211 ! 211 212 IF( neuler == 0 ) THEN ! Euler restart (neuler=0) 212 213 tb (:,:,:) = tn (:,:,:) ! all before fields set to now values … … 217 218 hdivb(:,:,:) = hdivn(:,:,:) 218 219 sshb (:,:) = sshn (:,:) 220 IF( lk_vvl ) THEN 221 DO jk = 1, jpk 222 fse3t_b(:,:,jk) = fse3t_n(:,:,jk) 223 END DO 224 ENDIF 219 225 ENDIF 220 226 !
Note: See TracChangeset
for help on using the changeset viewer.