[825] | 1 | MODULE limrst |
---|
[835] | 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE limrst *** |
---|
| 4 | !! Ice restart : write the ice restart file |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History: - ! 2005-04 (M. Vancoppenolle) Original code |
---|
| 7 | !! 3.0 ! 2008-03 (C. Ethe) restart files in using IOM interface |
---|
[2715] | 8 | !! 4.0 ! 2011-02 (G. Madec) dynamical allocation |
---|
[2528] | 9 | !!---------------------------------------------------------------------- |
---|
[825] | 10 | #if defined key_lim3 |
---|
[835] | 11 | !!---------------------------------------------------------------------- |
---|
| 12 | !! 'key_lim3' : LIM sea-ice model |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[3625] | 14 | !! lim_rst_opn : open ice restart file |
---|
| 15 | !! lim_rst_write : write of the restart file |
---|
| 16 | !! lim_rst_read : read the restart file |
---|
[835] | 17 | !!---------------------------------------------------------------------- |
---|
[3625] | 18 | USE ice ! sea-ice variables |
---|
[4205] | 19 | USE oce , ONLY : snwice_mass, snwice_mass_b |
---|
[3625] | 20 | USE dom_oce ! ocean domain |
---|
| 21 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
| 22 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
| 23 | USE in_out_manager ! I/O manager |
---|
| 24 | USE iom ! I/O library |
---|
| 25 | USE lib_mpp ! MPP library |
---|
| 26 | USE wrk_nemo ! work arrays |
---|
| 27 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
[5123] | 28 | USE limctl |
---|
[921] | 29 | |
---|
[835] | 30 | IMPLICIT NONE |
---|
| 31 | PRIVATE |
---|
[921] | 32 | |
---|
[2528] | 33 | PUBLIC lim_rst_opn ! routine called by icestep.F90 |
---|
| 34 | PUBLIC lim_rst_write ! routine called by icestep.F90 |
---|
[5123] | 35 | PUBLIC lim_rst_read ! routine called by sbc_lim_init |
---|
[825] | 36 | |
---|
[835] | 37 | LOGICAL, PUBLIC :: lrst_ice !: logical to control the ice restart write |
---|
| 38 | INTEGER, PUBLIC :: numrir, numriw !: logical unit for ice restart (read and write) |
---|
[825] | 39 | |
---|
[835] | 40 | !!---------------------------------------------------------------------- |
---|
[4161] | 41 | !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) |
---|
[1156] | 42 | !! $Id$ |
---|
[2528] | 43 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[835] | 44 | !!---------------------------------------------------------------------- |
---|
| 45 | CONTAINS |
---|
[825] | 46 | |
---|
[835] | 47 | SUBROUTINE lim_rst_opn( kt ) |
---|
| 48 | !!---------------------------------------------------------------------- |
---|
| 49 | !! *** lim_rst_opn *** |
---|
| 50 | !! |
---|
| 51 | !! ** purpose : output of sea-ice variable in a netcdf file |
---|
| 52 | !!---------------------------------------------------------------------- |
---|
| 53 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
| 54 | ! |
---|
[2528] | 55 | CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character |
---|
[835] | 56 | CHARACTER(LEN=50) :: clname ! ice output restart file name |
---|
[5341] | 57 | CHARACTER(len=256) :: clpath ! full path to ice output restart file |
---|
[835] | 58 | !!---------------------------------------------------------------------- |
---|
| 59 | ! |
---|
| 60 | IF( kt == nit000 ) lrst_ice = .FALSE. ! default definition |
---|
[921] | 61 | |
---|
[2528] | 62 | ! in order to get better performances with NetCDF format, we open and define the ice restart file |
---|
| 63 | ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice |
---|
| 64 | ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 |
---|
| 65 | IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc & |
---|
| 66 | & .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN |
---|
[5341] | 67 | IF( nitrst <= nitend .AND. nitrst > 0 ) THEN |
---|
| 68 | ! beware of the format used to write kt (default is i8.8, that should be large enough...) |
---|
| 69 | IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst |
---|
| 70 | ELSE ; WRITE(clkt, '(i8.8)') nitrst |
---|
[835] | 71 | ENDIF |
---|
[5341] | 72 | ! create the file |
---|
| 73 | clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) |
---|
| 74 | clpath = TRIM(cn_icerst_outdir) |
---|
| 75 | IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' |
---|
| 76 | IF(lwp) THEN |
---|
| 77 | WRITE(numout,*) |
---|
| 78 | SELECT CASE ( jprstlib ) |
---|
| 79 | CASE DEFAULT |
---|
| 80 | WRITE(numout,*) ' open ice restart NetCDF file: ',TRIM(clpath)//clname |
---|
| 81 | END SELECT |
---|
| 82 | IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN |
---|
| 83 | WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp |
---|
| 84 | ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp |
---|
| 85 | ENDIF |
---|
| 86 | ENDIF |
---|
| 87 | ! |
---|
| 88 | CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) |
---|
| 89 | lrst_ice = .TRUE. |
---|
[835] | 90 | ENDIF |
---|
| 91 | ENDIF |
---|
| 92 | ! |
---|
[5128] | 93 | IF( ln_icectl ) CALL lim_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' ) ! control print |
---|
[835] | 94 | END SUBROUTINE lim_rst_opn |
---|
[825] | 95 | |
---|
[2528] | 96 | |
---|
[835] | 97 | SUBROUTINE lim_rst_write( kt ) |
---|
| 98 | !!---------------------------------------------------------------------- |
---|
| 99 | !! *** lim_rst_write *** |
---|
| 100 | !! |
---|
| 101 | !! ** purpose : output of sea-ice variable in a netcdf file |
---|
| 102 | !!---------------------------------------------------------------------- |
---|
| 103 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
[2528] | 104 | !! |
---|
| 105 | INTEGER :: ji, jj, jk ,jl ! dummy loop indices |
---|
| 106 | INTEGER :: iter |
---|
| 107 | CHARACTER(len=15) :: znam |
---|
| 108 | CHARACTER(len=1) :: zchar, zchar1 |
---|
[3294] | 109 | REAL(wp), POINTER, DIMENSION(:,:) :: z2d |
---|
[835] | 110 | !!---------------------------------------------------------------------- |
---|
[921] | 111 | |
---|
[3294] | 112 | CALL wrk_alloc( jpi, jpj, z2d ) |
---|
[2715] | 113 | |
---|
[888] | 114 | iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 |
---|
[825] | 115 | |
---|
[835] | 116 | IF( iter == nitrst ) THEN |
---|
| 117 | IF(lwp) WRITE(numout,*) |
---|
| 118 | IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file kt =', kt |
---|
| 119 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' |
---|
| 120 | ENDIF |
---|
[825] | 121 | |
---|
[835] | 122 | ! Write in numriw (if iter == nitrst) |
---|
| 123 | ! ------------------ |
---|
| 124 | ! ! calendar control |
---|
[2528] | 125 | CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step |
---|
| 126 | CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ) ) ! date |
---|
[825] | 127 | |
---|
[835] | 128 | ! Prognostic variables |
---|
| 129 | DO jl = 1, jpl |
---|
| 130 | WRITE(zchar,'(I1)') jl |
---|
| 131 | znam = 'v_i'//'_htc'//zchar |
---|
| 132 | z2d(:,:) = v_i(:,:,jl) |
---|
| 133 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 134 | znam = 'v_s'//'_htc'//zchar |
---|
| 135 | z2d(:,:) = v_s(:,:,jl) |
---|
| 136 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 137 | znam = 'smv_i'//'_htc'//zchar |
---|
| 138 | z2d(:,:) = smv_i(:,:,jl) |
---|
| 139 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 140 | znam = 'oa_i'//'_htc'//zchar |
---|
| 141 | z2d(:,:) = oa_i(:,:,jl) |
---|
| 142 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 143 | znam = 'a_i'//'_htc'//zchar |
---|
| 144 | z2d(:,:) = a_i(:,:,jl) |
---|
| 145 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 146 | znam = 't_su'//'_htc'//zchar |
---|
| 147 | z2d(:,:) = t_su(:,:,jl) |
---|
| 148 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 149 | END DO |
---|
[5341] | 150 | |
---|
[835] | 151 | DO jl = 1, jpl |
---|
| 152 | WRITE(zchar,'(I1)') jl |
---|
| 153 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
| 154 | z2d(:,:) = e_s(:,:,1,jl) |
---|
| 155 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 156 | END DO |
---|
[825] | 157 | |
---|
[835] | 158 | DO jl = 1, jpl |
---|
| 159 | WRITE(zchar,'(I1)') jl |
---|
| 160 | DO jk = 1, nlay_i |
---|
| 161 | WRITE(zchar1,'(I1)') jk |
---|
| 162 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
| 163 | z2d(:,:) = e_i(:,:,jk,jl) |
---|
| 164 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 165 | END DO |
---|
[825] | 166 | END DO |
---|
| 167 | |
---|
[4205] | 168 | CALL iom_rstput( iter, nitrst, numriw, 'u_ice' , u_ice ) |
---|
| 169 | CALL iom_rstput( iter, nitrst, numriw, 'v_ice' , v_ice ) |
---|
| 170 | CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i ) |
---|
| 171 | CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) |
---|
| 172 | CALL iom_rstput( iter, nitrst, numriw, 'stress12_i' , stress12_i ) |
---|
[5123] | 173 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) |
---|
| 174 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 175 | |
---|
[835] | 176 | DO jl = 1, jpl |
---|
| 177 | WRITE(zchar,'(I1)') jl |
---|
| 178 | znam = 'sxice'//'_htc'//zchar |
---|
| 179 | z2d(:,:) = sxice(:,:,jl) |
---|
| 180 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 181 | znam = 'syice'//'_htc'//zchar |
---|
| 182 | z2d(:,:) = syice(:,:,jl) |
---|
| 183 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 184 | znam = 'sxxice'//'_htc'//zchar |
---|
| 185 | z2d(:,:) = sxxice(:,:,jl) |
---|
| 186 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 187 | znam = 'syyice'//'_htc'//zchar |
---|
| 188 | z2d(:,:) = syyice(:,:,jl) |
---|
| 189 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[838] | 190 | znam = 'sxyice'//'_htc'//zchar |
---|
| 191 | z2d(:,:) = sxyice(:,:,jl) |
---|
| 192 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[835] | 193 | znam = 'sxsn'//'_htc'//zchar |
---|
| 194 | z2d(:,:) = sxsn(:,:,jl) |
---|
| 195 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 196 | znam = 'sysn'//'_htc'//zchar |
---|
| 197 | z2d(:,:) = sysn(:,:,jl) |
---|
| 198 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 199 | znam = 'sxxsn'//'_htc'//zchar |
---|
| 200 | z2d(:,:) = sxxsn(:,:,jl) |
---|
| 201 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 202 | znam = 'syysn'//'_htc'//zchar |
---|
| 203 | z2d(:,:) = syysn(:,:,jl) |
---|
| 204 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 205 | znam = 'sxysn'//'_htc'//zchar |
---|
| 206 | z2d(:,:) = sxysn(:,:,jl) |
---|
| 207 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 208 | znam = 'sxa'//'_htc'//zchar |
---|
| 209 | z2d(:,:) = sxa(:,:,jl) |
---|
| 210 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 211 | znam = 'sya'//'_htc'//zchar |
---|
| 212 | z2d(:,:) = sya(:,:,jl) |
---|
| 213 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 214 | znam = 'sxxa'//'_htc'//zchar |
---|
| 215 | z2d(:,:) = sxxa(:,:,jl) |
---|
| 216 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 217 | znam = 'syya'//'_htc'//zchar |
---|
| 218 | z2d(:,:) = syya(:,:,jl) |
---|
| 219 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 220 | znam = 'sxya'//'_htc'//zchar |
---|
| 221 | z2d(:,:) = sxya(:,:,jl) |
---|
| 222 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 223 | znam = 'sxc0'//'_htc'//zchar |
---|
| 224 | z2d(:,:) = sxc0(:,:,jl) |
---|
| 225 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 226 | znam = 'syc0'//'_htc'//zchar |
---|
| 227 | z2d(:,:) = syc0(:,:,jl) |
---|
| 228 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 229 | znam = 'sxxc0'//'_htc'//zchar |
---|
| 230 | z2d(:,:) = sxxc0(:,:,jl) |
---|
| 231 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 232 | znam = 'syyc0'//'_htc'//zchar |
---|
| 233 | z2d(:,:) = syyc0(:,:,jl) |
---|
| 234 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 235 | znam = 'sxyc0'//'_htc'//zchar |
---|
| 236 | z2d(:,:) = sxyc0(:,:,jl) |
---|
| 237 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 238 | znam = 'sxsal'//'_htc'//zchar |
---|
| 239 | z2d(:,:) = sxsal(:,:,jl) |
---|
| 240 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 241 | znam = 'sysal'//'_htc'//zchar |
---|
| 242 | z2d(:,:) = sysal(:,:,jl) |
---|
| 243 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 244 | znam = 'sxxsal'//'_htc'//zchar |
---|
| 245 | z2d(:,:) = sxxsal(:,:,jl) |
---|
| 246 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 247 | znam = 'syysal'//'_htc'//zchar |
---|
| 248 | z2d(:,:) = syysal(:,:,jl) |
---|
| 249 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 250 | znam = 'sxysal'//'_htc'//zchar |
---|
| 251 | z2d(:,:) = sxysal(:,:,jl) |
---|
| 252 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 253 | znam = 'sxage'//'_htc'//zchar |
---|
| 254 | z2d(:,:) = sxage(:,:,jl) |
---|
| 255 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 256 | znam = 'syage'//'_htc'//zchar |
---|
| 257 | z2d(:,:) = syage(:,:,jl) |
---|
| 258 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 259 | znam = 'sxxage'//'_htc'//zchar |
---|
| 260 | z2d(:,:) = sxxage(:,:,jl) |
---|
| 261 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 262 | znam = 'syyage'//'_htc'//zchar |
---|
| 263 | z2d(:,:) = syyage(:,:,jl) |
---|
| 264 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 265 | znam = 'sxyage'//'_htc'//zchar |
---|
| 266 | z2d(:,:) = sxyage(:,:,jl) |
---|
| 267 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 268 | END DO |
---|
[825] | 269 | |
---|
[835] | 270 | CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' , sxopw ) |
---|
| 271 | CALL iom_rstput( iter, nitrst, numriw, 'syopw ' , syopw ) |
---|
| 272 | CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' , sxxopw ) |
---|
| 273 | CALL iom_rstput( iter, nitrst, numriw, 'syyopw' , syyopw ) |
---|
| 274 | CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' , sxyopw ) |
---|
[825] | 275 | |
---|
[835] | 276 | DO jl = 1, jpl |
---|
| 277 | WRITE(zchar,'(I1)') jl |
---|
| 278 | DO jk = 1, nlay_i |
---|
| 279 | WRITE(zchar1,'(I1)') jk |
---|
| 280 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 281 | z2d(:,:) = sxe(:,:,jk,jl) |
---|
| 282 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[838] | 283 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
| 284 | z2d(:,:) = sye(:,:,jk,jl) |
---|
| 285 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[835] | 286 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 287 | z2d(:,:) = sxxe(:,:,jk,jl) |
---|
| 288 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 289 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
| 290 | z2d(:,:) = syye(:,:,jk,jl) |
---|
| 291 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 292 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
| 293 | z2d(:,:) = sxye(:,:,jk,jl) |
---|
| 294 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 295 | END DO |
---|
| 296 | END DO |
---|
[825] | 297 | |
---|
[835] | 298 | IF( iter == nitrst ) THEN |
---|
| 299 | CALL iom_close( numriw ) ! close the restart file |
---|
| 300 | lrst_ice = .FALSE. |
---|
| 301 | ENDIF |
---|
| 302 | ! |
---|
[3294] | 303 | CALL wrk_dealloc( jpi, jpj, z2d ) |
---|
[2715] | 304 | ! |
---|
[921] | 305 | END SUBROUTINE lim_rst_write |
---|
| 306 | |
---|
[2528] | 307 | |
---|
[835] | 308 | SUBROUTINE lim_rst_read |
---|
| 309 | !!---------------------------------------------------------------------- |
---|
| 310 | !! *** lim_rst_read *** |
---|
| 311 | !! |
---|
| 312 | !! ** purpose : read of sea-ice variable restart in a netcdf file |
---|
| 313 | !!---------------------------------------------------------------------- |
---|
[5128] | 314 | INTEGER :: ji, jj, jk, jl |
---|
[835] | 315 | REAL(wp) :: zfice, ziter |
---|
[3294] | 316 | REAL(wp), POINTER, DIMENSION(:,:) :: z2d |
---|
[2528] | 317 | CHARACTER(len=15) :: znam |
---|
| 318 | CHARACTER(len=1) :: zchar, zchar1 |
---|
| 319 | INTEGER :: jlibalt = jprstlib |
---|
| 320 | LOGICAL :: llok |
---|
[835] | 321 | !!---------------------------------------------------------------------- |
---|
[921] | 322 | |
---|
[3294] | 323 | CALL wrk_alloc( jpi, jpj, z2d ) |
---|
[2715] | 324 | |
---|
[825] | 325 | IF(lwp) THEN |
---|
| 326 | WRITE(numout,*) |
---|
[835] | 327 | WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file' |
---|
[2715] | 328 | WRITE(numout,*) '~~~~~~~~~~~~~' |
---|
[825] | 329 | ENDIF |
---|
| 330 | |
---|
[5341] | 331 | CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib ) |
---|
[835] | 332 | |
---|
[888] | 333 | CALL iom_get( numrir, 'nn_fsbc', zfice ) |
---|
| 334 | CALL iom_get( numrir, 'kt_ice' , ziter ) |
---|
[835] | 335 | IF(lwp) WRITE(numout,*) ' read ice restart file at time step : ', ziter |
---|
| 336 | IF(lwp) WRITE(numout,*) ' in any case we force it to nit000 - 1 : ', nit000 - 1 |
---|
| 337 | |
---|
[825] | 338 | !Control of date |
---|
[921] | 339 | |
---|
[4161] | 340 | IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 ) & |
---|
[835] | 341 | & CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart', & |
---|
| 342 | & ' verify the file or rerun with the value 0 for the', & |
---|
| 343 | & ' control of time parameter nrstdt' ) |
---|
[4161] | 344 | IF( NINT(zfice) /= nn_fsbc .AND. ABS( nrstdt ) == 1 ) & |
---|
[888] | 345 | & CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart', & |
---|
| 346 | & ' verify the file or rerun with the value 0 for the', & |
---|
[835] | 347 | & ' control of time parameter nrstdt' ) |
---|
[825] | 348 | |
---|
[835] | 349 | DO jl = 1, jpl |
---|
| 350 | WRITE(zchar,'(I1)') jl |
---|
| 351 | znam = 'v_i'//'_htc'//zchar |
---|
| 352 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 353 | v_i(:,:,jl) = z2d(:,:) |
---|
| 354 | znam = 'v_s'//'_htc'//zchar |
---|
| 355 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 356 | v_s(:,:,jl) = z2d(:,:) |
---|
| 357 | znam = 'smv_i'//'_htc'//zchar |
---|
| 358 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 359 | smv_i(:,:,jl) = z2d(:,:) |
---|
| 360 | znam = 'oa_i'//'_htc'//zchar |
---|
| 361 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 362 | oa_i(:,:,jl) = z2d(:,:) |
---|
| 363 | znam = 'a_i'//'_htc'//zchar |
---|
| 364 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 365 | a_i(:,:,jl) = z2d(:,:) |
---|
| 366 | znam = 't_su'//'_htc'//zchar |
---|
| 367 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 368 | t_su(:,:,jl) = z2d(:,:) |
---|
| 369 | END DO |
---|
[825] | 370 | |
---|
[919] | 371 | DO jl = 1, jpl |
---|
[835] | 372 | WRITE(zchar,'(I1)') jl |
---|
| 373 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
| 374 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 375 | e_s(:,:,1,jl) = z2d(:,:) |
---|
[825] | 376 | END DO |
---|
[921] | 377 | |
---|
[835] | 378 | DO jl = 1, jpl |
---|
| 379 | WRITE(zchar,'(I1)') jl |
---|
| 380 | DO jk = 1, nlay_i |
---|
| 381 | WRITE(zchar1,'(I1)') jk |
---|
| 382 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
| 383 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 384 | e_i(:,:,jk,jl) = z2d(:,:) |
---|
| 385 | END DO |
---|
| 386 | END DO |
---|
[825] | 387 | |
---|
[835] | 388 | CALL iom_get( numrir, jpdom_autoglo, 'u_ice' , u_ice ) |
---|
| 389 | CALL iom_get( numrir, jpdom_autoglo, 'v_ice' , v_ice ) |
---|
| 390 | CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i ) |
---|
| 391 | CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i ) |
---|
| 392 | CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i ) |
---|
[5123] | 393 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) |
---|
| 394 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 395 | |
---|
[835] | 396 | DO jl = 1, jpl |
---|
| 397 | WRITE(zchar,'(I1)') jl |
---|
| 398 | znam = 'sxice'//'_htc'//zchar |
---|
| 399 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 400 | sxice(:,:,jl) = z2d(:,:) |
---|
| 401 | znam = 'syice'//'_htc'//zchar |
---|
| 402 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 403 | syice(:,:,jl) = z2d(:,:) |
---|
| 404 | znam = 'sxxice'//'_htc'//zchar |
---|
| 405 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 406 | sxxice(:,:,jl) = z2d(:,:) |
---|
| 407 | znam = 'syyice'//'_htc'//zchar |
---|
| 408 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 409 | syyice(:,:,jl) = z2d(:,:) |
---|
[838] | 410 | znam = 'sxyice'//'_htc'//zchar |
---|
| 411 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 412 | sxyice(:,:,jl) = z2d(:,:) |
---|
[835] | 413 | znam = 'sxsn'//'_htc'//zchar |
---|
| 414 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 415 | sxsn(:,:,jl) = z2d(:,:) |
---|
| 416 | znam = 'sysn'//'_htc'//zchar |
---|
| 417 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 418 | sysn(:,:,jl) = z2d(:,:) |
---|
| 419 | znam = 'sxxsn'//'_htc'//zchar |
---|
| 420 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 421 | sxxsn(:,:,jl) = z2d(:,:) |
---|
| 422 | znam = 'syysn'//'_htc'//zchar |
---|
| 423 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 424 | syysn(:,:,jl) = z2d(:,:) |
---|
| 425 | znam = 'sxysn'//'_htc'//zchar |
---|
| 426 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 427 | sxysn(:,:,jl) = z2d(:,:) |
---|
| 428 | znam = 'sxa'//'_htc'//zchar |
---|
| 429 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 430 | sxa(:,:,jl) = z2d(:,:) |
---|
| 431 | znam = 'sya'//'_htc'//zchar |
---|
| 432 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 433 | sya(:,:,jl) = z2d(:,:) |
---|
| 434 | znam = 'sxxa'//'_htc'//zchar |
---|
| 435 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 436 | sxxa(:,:,jl) = z2d(:,:) |
---|
| 437 | znam = 'syya'//'_htc'//zchar |
---|
| 438 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 439 | syya(:,:,jl) = z2d(:,:) |
---|
| 440 | znam = 'sxya'//'_htc'//zchar |
---|
| 441 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 442 | sxya(:,:,jl) = z2d(:,:) |
---|
| 443 | znam = 'sxc0'//'_htc'//zchar |
---|
| 444 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 445 | sxc0(:,:,jl) = z2d(:,:) |
---|
| 446 | znam = 'syc0'//'_htc'//zchar |
---|
| 447 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 448 | syc0(:,:,jl) = z2d(:,:) |
---|
| 449 | znam = 'sxxc0'//'_htc'//zchar |
---|
| 450 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 451 | sxxc0(:,:,jl) = z2d(:,:) |
---|
| 452 | znam = 'syyc0'//'_htc'//zchar |
---|
| 453 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 454 | syyc0(:,:,jl) = z2d(:,:) |
---|
| 455 | znam = 'sxyc0'//'_htc'//zchar |
---|
| 456 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 457 | sxyc0(:,:,jl) = z2d(:,:) |
---|
| 458 | znam = 'sxsal'//'_htc'//zchar |
---|
| 459 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 460 | sxsal(:,:,jl) = z2d(:,:) |
---|
| 461 | znam = 'sysal'//'_htc'//zchar |
---|
| 462 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 463 | sysal(:,:,jl) = z2d(:,:) |
---|
| 464 | znam = 'sxxsal'//'_htc'//zchar |
---|
| 465 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 466 | sxxsal(:,:,jl) = z2d(:,:) |
---|
| 467 | znam = 'syysal'//'_htc'//zchar |
---|
| 468 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 469 | syysal(:,:,jl) = z2d(:,:) |
---|
| 470 | znam = 'sxysal'//'_htc'//zchar |
---|
| 471 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 472 | sxysal(:,:,jl) = z2d(:,:) |
---|
| 473 | znam = 'sxage'//'_htc'//zchar |
---|
| 474 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 475 | sxage(:,:,jl) = z2d(:,:) |
---|
| 476 | znam = 'syage'//'_htc'//zchar |
---|
| 477 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 478 | syage(:,:,jl) = z2d(:,:) |
---|
| 479 | znam = 'sxxage'//'_htc'//zchar |
---|
| 480 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 481 | sxxage(:,:,jl) = z2d(:,:) |
---|
| 482 | znam = 'syyage'//'_htc'//zchar |
---|
| 483 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 484 | syyage(:,:,jl) = z2d(:,:) |
---|
| 485 | znam = 'sxyage'//'_htc'//zchar |
---|
| 486 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 487 | sxyage(:,:,jl)= z2d(:,:) |
---|
| 488 | END DO |
---|
[825] | 489 | |
---|
[835] | 490 | CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' , sxopw ) |
---|
| 491 | CALL iom_get( numrir, jpdom_autoglo, 'syopw ' , syopw ) |
---|
| 492 | CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' , sxxopw ) |
---|
| 493 | CALL iom_get( numrir, jpdom_autoglo, 'syyopw' , syyopw ) |
---|
| 494 | CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' , sxyopw ) |
---|
[825] | 495 | |
---|
[835] | 496 | DO jl = 1, jpl |
---|
| 497 | WRITE(zchar,'(I1)') jl |
---|
| 498 | DO jk = 1, nlay_i |
---|
| 499 | WRITE(zchar1,'(I1)') jk |
---|
| 500 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 501 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 502 | sxe(:,:,jk,jl) = z2d(:,:) |
---|
[838] | 503 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
| 504 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 505 | sye(:,:,jk,jl) = z2d(:,:) |
---|
[835] | 506 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 507 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 508 | sxxe(:,:,jk,jl) = z2d(:,:) |
---|
| 509 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
| 510 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 511 | syye(:,:,jk,jl) = z2d(:,:) |
---|
| 512 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
| 513 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 514 | sxye(:,:,jk,jl) = z2d(:,:) |
---|
| 515 | END DO |
---|
| 516 | END DO |
---|
[2528] | 517 | ! |
---|
[4688] | 518 | ! clem: I do not understand why the following IF is needed |
---|
[5123] | 519 | ! I suspect something inconsistent in the main code with option nn_icesal=1 |
---|
| 520 | IF( nn_icesal == 1 ) THEN |
---|
[4688] | 521 | DO jl = 1, jpl |
---|
[5123] | 522 | sm_i(:,:,jl) = rn_icesal |
---|
[4688] | 523 | DO jk = 1, nlay_i |
---|
[5123] | 524 | s_i(:,:,jk,jl) = rn_icesal |
---|
[4688] | 525 | END DO |
---|
| 526 | END DO |
---|
| 527 | ENDIF |
---|
| 528 | ! |
---|
[4205] | 529 | !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90 |
---|
[2528] | 530 | ! |
---|
[3294] | 531 | CALL wrk_dealloc( jpi, jpj, z2d ) |
---|
[2715] | 532 | ! |
---|
[921] | 533 | END SUBROUTINE lim_rst_read |
---|
| 534 | |
---|
[825] | 535 | #else |
---|
| 536 | !!---------------------------------------------------------------------- |
---|
| 537 | !! Default option : Empty module NO LIM sea-ice model |
---|
| 538 | !!---------------------------------------------------------------------- |
---|
| 539 | CONTAINS |
---|
| 540 | SUBROUTINE lim_rst_read ! Empty routine |
---|
| 541 | END SUBROUTINE lim_rst_read |
---|
| 542 | SUBROUTINE lim_rst_write ! Empty routine |
---|
| 543 | END SUBROUTINE lim_rst_write |
---|
| 544 | #endif |
---|
| 545 | |
---|
| 546 | !!====================================================================== |
---|
| 547 | END MODULE limrst |
---|