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