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