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