[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 | ! |
---|
[7646] | 55 | CHARACTER(len=20) :: clkt ! ocean time-step define as a character |
---|
| 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 | ! |
---|
[7646] | 93 | IF( ln_limctl ) 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 |
---|
[7646] | 107 | CHARACTER(len=25) :: znam |
---|
| 108 | CHARACTER(len=2) :: 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 |
---|
[7646] | 130 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 131 | znam = 'v_i'//'_htc'//zchar |
---|
[7753] | 132 | z2d(:,:) = v_i(:,:,jl) |
---|
[835] | 133 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 134 | znam = 'v_s'//'_htc'//zchar |
---|
[7753] | 135 | z2d(:,:) = v_s(:,:,jl) |
---|
[835] | 136 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 137 | znam = 'smv_i'//'_htc'//zchar |
---|
[7753] | 138 | z2d(:,:) = smv_i(:,:,jl) |
---|
[835] | 139 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 140 | znam = 'oa_i'//'_htc'//zchar |
---|
[7753] | 141 | z2d(:,:) = oa_i(:,:,jl) |
---|
[835] | 142 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 143 | znam = 'a_i'//'_htc'//zchar |
---|
[7753] | 144 | z2d(:,:) = a_i(:,:,jl) |
---|
[835] | 145 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 146 | znam = 't_su'//'_htc'//zchar |
---|
[7753] | 147 | z2d(:,:) = t_su(:,:,jl) |
---|
[835] | 148 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 149 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
[7753] | 150 | z2d(:,:) = e_s(:,:,1,jl) |
---|
[835] | 151 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 152 | DO jk = 1, nlay_i |
---|
[7646] | 153 | WRITE(zchar1,'(I2.2)') jk |
---|
[835] | 154 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 155 | z2d(:,:) = e_i(:,:,jk,jl) |
---|
[835] | 156 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 157 | END DO |
---|
[825] | 158 | END DO |
---|
| 159 | |
---|
[4205] | 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, 'stress1_i' , stress1_i ) |
---|
| 163 | CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) |
---|
| 164 | CALL iom_rstput( iter, nitrst, numriw, 'stress12_i' , stress12_i ) |
---|
[5123] | 165 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) |
---|
| 166 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 167 | |
---|
[7646] | 168 | ! In case Prather scheme is used for advection, write second order moments |
---|
| 169 | ! ------------------------------------------------------------------------ |
---|
| 170 | IF( nn_limadv == -1 ) THEN |
---|
| 171 | |
---|
| 172 | DO jl = 1, jpl |
---|
| 173 | WRITE(zchar,'(I2.2)') jl |
---|
| 174 | znam = 'sxice'//'_htc'//zchar |
---|
[7753] | 175 | z2d(:,:) = sxice(:,:,jl) |
---|
[835] | 176 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 177 | znam = 'syice'//'_htc'//zchar |
---|
[7753] | 178 | z2d(:,:) = syice(:,:,jl) |
---|
[838] | 179 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 180 | znam = 'sxxice'//'_htc'//zchar |
---|
[7753] | 181 | z2d(:,:) = sxxice(:,:,jl) |
---|
[835] | 182 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 183 | znam = 'syyice'//'_htc'//zchar |
---|
[7753] | 184 | z2d(:,:) = syyice(:,:,jl) |
---|
[835] | 185 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 186 | znam = 'sxyice'//'_htc'//zchar |
---|
[7753] | 187 | z2d(:,:) = sxyice(:,:,jl) |
---|
[835] | 188 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 189 | znam = 'sxsn'//'_htc'//zchar |
---|
[7753] | 190 | z2d(:,:) = sxsn(:,:,jl) |
---|
[7646] | 191 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 192 | znam = 'sysn'//'_htc'//zchar |
---|
[7753] | 193 | z2d(:,:) = sysn(:,:,jl) |
---|
[7646] | 194 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 195 | znam = 'sxxsn'//'_htc'//zchar |
---|
[7753] | 196 | z2d(:,:) = sxxsn(:,:,jl) |
---|
[7646] | 197 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 198 | znam = 'syysn'//'_htc'//zchar |
---|
[7753] | 199 | z2d(:,:) = syysn(:,:,jl) |
---|
[7646] | 200 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 201 | znam = 'sxysn'//'_htc'//zchar |
---|
[7753] | 202 | z2d(:,:) = sxysn(:,:,jl) |
---|
[7646] | 203 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 204 | znam = 'sxa'//'_htc'//zchar |
---|
[7753] | 205 | z2d(:,:) = sxa(:,:,jl) |
---|
[7646] | 206 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 207 | znam = 'sya'//'_htc'//zchar |
---|
[7753] | 208 | z2d(:,:) = sya(:,:,jl) |
---|
[7646] | 209 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 210 | znam = 'sxxa'//'_htc'//zchar |
---|
[7753] | 211 | z2d(:,:) = sxxa(:,:,jl) |
---|
[7646] | 212 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 213 | znam = 'syya'//'_htc'//zchar |
---|
[7753] | 214 | z2d(:,:) = syya(:,:,jl) |
---|
[7646] | 215 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 216 | znam = 'sxya'//'_htc'//zchar |
---|
[7753] | 217 | z2d(:,:) = sxya(:,:,jl) |
---|
[7646] | 218 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 219 | znam = 'sxc0'//'_htc'//zchar |
---|
[7753] | 220 | z2d(:,:) = sxc0(:,:,jl) |
---|
[7646] | 221 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 222 | znam = 'syc0'//'_htc'//zchar |
---|
[7753] | 223 | z2d(:,:) = syc0(:,:,jl) |
---|
[7646] | 224 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 225 | znam = 'sxxc0'//'_htc'//zchar |
---|
[7753] | 226 | z2d(:,:) = sxxc0(:,:,jl) |
---|
[7646] | 227 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 228 | znam = 'syyc0'//'_htc'//zchar |
---|
[7753] | 229 | z2d(:,:) = syyc0(:,:,jl) |
---|
[7646] | 230 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 231 | znam = 'sxyc0'//'_htc'//zchar |
---|
[7753] | 232 | z2d(:,:) = sxyc0(:,:,jl) |
---|
[7646] | 233 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 234 | znam = 'sxsal'//'_htc'//zchar |
---|
[7753] | 235 | z2d(:,:) = sxsal(:,:,jl) |
---|
[7646] | 236 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 237 | znam = 'sysal'//'_htc'//zchar |
---|
[7753] | 238 | z2d(:,:) = sysal(:,:,jl) |
---|
[7646] | 239 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 240 | znam = 'sxxsal'//'_htc'//zchar |
---|
[7753] | 241 | z2d(:,:) = sxxsal(:,:,jl) |
---|
[7646] | 242 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 243 | znam = 'syysal'//'_htc'//zchar |
---|
[7753] | 244 | z2d(:,:) = syysal(:,:,jl) |
---|
[7646] | 245 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 246 | znam = 'sxysal'//'_htc'//zchar |
---|
[7753] | 247 | z2d(:,:) = sxysal(:,:,jl) |
---|
[7646] | 248 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 249 | znam = 'sxage'//'_htc'//zchar |
---|
[7753] | 250 | z2d(:,:) = sxage(:,:,jl) |
---|
[7646] | 251 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 252 | znam = 'syage'//'_htc'//zchar |
---|
[7753] | 253 | z2d(:,:) = syage(:,:,jl) |
---|
[7646] | 254 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 255 | znam = 'sxxage'//'_htc'//zchar |
---|
[7753] | 256 | z2d(:,:) = sxxage(:,:,jl) |
---|
[7646] | 257 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 258 | znam = 'syyage'//'_htc'//zchar |
---|
[7753] | 259 | z2d(:,:) = syyage(:,:,jl) |
---|
[7646] | 260 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 261 | znam = 'sxyage'//'_htc'//zchar |
---|
[7753] | 262 | z2d(:,:) = sxyage(:,:,jl) |
---|
[7646] | 263 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[835] | 264 | END DO |
---|
[825] | 265 | |
---|
[7646] | 266 | CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' , sxopw ) |
---|
| 267 | CALL iom_rstput( iter, nitrst, numriw, 'syopw ' , syopw ) |
---|
| 268 | CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' , sxxopw ) |
---|
| 269 | CALL iom_rstput( iter, nitrst, numriw, 'syyopw' , syyopw ) |
---|
| 270 | CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' , sxyopw ) |
---|
| 271 | |
---|
| 272 | DO jl = 1, jpl |
---|
| 273 | WRITE(zchar,'(I2.2)') jl |
---|
| 274 | DO jk = 1, nlay_i |
---|
| 275 | WRITE(zchar1,'(I2.2)') jk |
---|
| 276 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 277 | z2d(:,:) = sxe(:,:,jk,jl) |
---|
[7646] | 278 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 279 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 280 | z2d(:,:) = sye(:,:,jk,jl) |
---|
[7646] | 281 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 282 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 283 | z2d(:,:) = sxxe(:,:,jk,jl) |
---|
[7646] | 284 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 285 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 286 | z2d(:,:) = syye(:,:,jk,jl) |
---|
[7646] | 287 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 288 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 289 | z2d(:,:) = sxye(:,:,jk,jl) |
---|
[7646] | 290 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 291 | END DO |
---|
| 292 | END DO |
---|
| 293 | |
---|
| 294 | ENDIF |
---|
| 295 | |
---|
| 296 | ! close restart file |
---|
| 297 | ! ------------------ |
---|
[835] | 298 | IF( iter == nitrst ) THEN |
---|
[7646] | 299 | CALL iom_close( numriw ) |
---|
[835] | 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 |
---|
[7646] | 317 | CHARACTER(len=25) :: znam |
---|
| 318 | CHARACTER(len=2) :: zchar, zchar1 |
---|
[2528] | 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 | |
---|
[7646] | 349 | ! Prognostic variables |
---|
[835] | 350 | DO jl = 1, jpl |
---|
[7646] | 351 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 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 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
| 371 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 372 | e_s(:,:,1,jl) = z2d(:,:) |
---|
| 373 | DO jk = 1, nlay_i |
---|
[7646] | 374 | WRITE(zchar1,'(I2.2)') jk |
---|
[835] | 375 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
| 376 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 377 | e_i(:,:,jk,jl) = z2d(:,:) |
---|
| 378 | END DO |
---|
| 379 | END DO |
---|
[825] | 380 | |
---|
[835] | 381 | CALL iom_get( numrir, jpdom_autoglo, 'u_ice' , u_ice ) |
---|
| 382 | CALL iom_get( numrir, jpdom_autoglo, 'v_ice' , v_ice ) |
---|
| 383 | CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i ) |
---|
| 384 | CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i ) |
---|
| 385 | CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i ) |
---|
[5123] | 386 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) |
---|
| 387 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 388 | |
---|
[7646] | 389 | ! In case Prather scheme is used for advection, read second order moments |
---|
| 390 | ! ------------------------------------------------------------------------ |
---|
| 391 | IF( nn_limadv == -1 ) THEN |
---|
[825] | 392 | |
---|
[7646] | 393 | DO jl = 1, jpl |
---|
| 394 | WRITE(zchar,'(I2.2)') jl |
---|
| 395 | znam = 'sxice'//'_htc'//zchar |
---|
[835] | 396 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 397 | sxice(:,:,jl) = z2d(:,:) |
---|
| 398 | znam = 'syice'//'_htc'//zchar |
---|
[838] | 399 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 400 | syice(:,:,jl) = z2d(:,:) |
---|
| 401 | znam = 'sxxice'//'_htc'//zchar |
---|
[835] | 402 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 403 | sxxice(:,:,jl) = z2d(:,:) |
---|
| 404 | znam = 'syyice'//'_htc'//zchar |
---|
[835] | 405 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 406 | syyice(:,:,jl) = z2d(:,:) |
---|
| 407 | znam = 'sxyice'//'_htc'//zchar |
---|
[835] | 408 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 409 | sxyice(:,:,jl) = z2d(:,:) |
---|
| 410 | znam = 'sxsn'//'_htc'//zchar |
---|
| 411 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 412 | sxsn(:,:,jl) = z2d(:,:) |
---|
| 413 | znam = 'sysn'//'_htc'//zchar |
---|
| 414 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 415 | sysn(:,:,jl) = z2d(:,:) |
---|
| 416 | znam = 'sxxsn'//'_htc'//zchar |
---|
| 417 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 418 | sxxsn(:,:,jl) = z2d(:,:) |
---|
| 419 | znam = 'syysn'//'_htc'//zchar |
---|
| 420 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 421 | syysn(:,:,jl) = z2d(:,:) |
---|
| 422 | znam = 'sxysn'//'_htc'//zchar |
---|
| 423 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 424 | sxysn(:,:,jl) = z2d(:,:) |
---|
| 425 | znam = 'sxa'//'_htc'//zchar |
---|
| 426 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 427 | sxa(:,:,jl) = z2d(:,:) |
---|
| 428 | znam = 'sya'//'_htc'//zchar |
---|
| 429 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 430 | sya(:,:,jl) = z2d(:,:) |
---|
| 431 | znam = 'sxxa'//'_htc'//zchar |
---|
| 432 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 433 | sxxa(:,:,jl) = z2d(:,:) |
---|
| 434 | znam = 'syya'//'_htc'//zchar |
---|
| 435 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 436 | syya(:,:,jl) = z2d(:,:) |
---|
| 437 | znam = 'sxya'//'_htc'//zchar |
---|
| 438 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 439 | sxya(:,:,jl) = z2d(:,:) |
---|
| 440 | znam = 'sxc0'//'_htc'//zchar |
---|
| 441 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 442 | sxc0(:,:,jl) = z2d(:,:) |
---|
| 443 | znam = 'syc0'//'_htc'//zchar |
---|
| 444 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 445 | syc0(:,:,jl) = z2d(:,:) |
---|
| 446 | znam = 'sxxc0'//'_htc'//zchar |
---|
| 447 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 448 | sxxc0(:,:,jl) = z2d(:,:) |
---|
| 449 | znam = 'syyc0'//'_htc'//zchar |
---|
| 450 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 451 | syyc0(:,:,jl) = z2d(:,:) |
---|
| 452 | znam = 'sxyc0'//'_htc'//zchar |
---|
| 453 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 454 | sxyc0(:,:,jl) = z2d(:,:) |
---|
| 455 | znam = 'sxsal'//'_htc'//zchar |
---|
| 456 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 457 | sxsal(:,:,jl) = z2d(:,:) |
---|
| 458 | znam = 'sysal'//'_htc'//zchar |
---|
| 459 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 460 | sysal(:,:,jl) = z2d(:,:) |
---|
| 461 | znam = 'sxxsal'//'_htc'//zchar |
---|
| 462 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 463 | sxxsal(:,:,jl) = z2d(:,:) |
---|
| 464 | znam = 'syysal'//'_htc'//zchar |
---|
| 465 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 466 | syysal(:,:,jl) = z2d(:,:) |
---|
| 467 | znam = 'sxysal'//'_htc'//zchar |
---|
| 468 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 469 | sxysal(:,:,jl) = z2d(:,:) |
---|
| 470 | znam = 'sxage'//'_htc'//zchar |
---|
| 471 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 472 | sxage(:,:,jl) = z2d(:,:) |
---|
| 473 | znam = 'syage'//'_htc'//zchar |
---|
| 474 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 475 | syage(:,:,jl) = z2d(:,:) |
---|
| 476 | znam = 'sxxage'//'_htc'//zchar |
---|
| 477 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 478 | sxxage(:,:,jl) = z2d(:,:) |
---|
| 479 | znam = 'syyage'//'_htc'//zchar |
---|
| 480 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 481 | syyage(:,:,jl) = z2d(:,:) |
---|
| 482 | znam = 'sxyage'//'_htc'//zchar |
---|
| 483 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 484 | sxyage(:,:,jl)= z2d(:,:) |
---|
[835] | 485 | END DO |
---|
[7646] | 486 | |
---|
| 487 | CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' , sxopw ) |
---|
| 488 | CALL iom_get( numrir, jpdom_autoglo, 'syopw ' , syopw ) |
---|
| 489 | CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' , sxxopw ) |
---|
| 490 | CALL iom_get( numrir, jpdom_autoglo, 'syyopw' , syyopw ) |
---|
| 491 | CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' , sxyopw ) |
---|
| 492 | |
---|
| 493 | DO jl = 1, jpl |
---|
| 494 | WRITE(zchar,'(I2.2)') jl |
---|
| 495 | DO jk = 1, nlay_i |
---|
| 496 | WRITE(zchar1,'(I2.2)') jk |
---|
| 497 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 498 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 499 | sxe(:,:,jk,jl) = z2d(:,:) |
---|
| 500 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
| 501 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 502 | sye(:,:,jk,jl) = z2d(:,:) |
---|
| 503 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 504 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 505 | sxxe(:,:,jk,jl) = z2d(:,:) |
---|
| 506 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
| 507 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 508 | syye(:,:,jk,jl) = z2d(:,:) |
---|
| 509 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
| 510 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 511 | sxye(:,:,jk,jl) = z2d(:,:) |
---|
| 512 | END DO |
---|
| 513 | END DO |
---|
| 514 | ! |
---|
| 515 | END IF |
---|
| 516 | |
---|
[4688] | 517 | ! clem: I do not understand why the following IF is needed |
---|
[5123] | 518 | ! I suspect something inconsistent in the main code with option nn_icesal=1 |
---|
| 519 | IF( nn_icesal == 1 ) THEN |
---|
[4688] | 520 | DO jl = 1, jpl |
---|
[5123] | 521 | sm_i(:,:,jl) = rn_icesal |
---|
[4688] | 522 | DO jk = 1, nlay_i |
---|
[5123] | 523 | s_i(:,:,jk,jl) = rn_icesal |
---|
[4688] | 524 | END DO |
---|
| 525 | END DO |
---|
| 526 | ENDIF |
---|
| 527 | ! |
---|
[4205] | 528 | !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90 |
---|
[2528] | 529 | ! |
---|
[3294] | 530 | CALL wrk_dealloc( jpi, jpj, z2d ) |
---|
[2715] | 531 | ! |
---|
[921] | 532 | END SUBROUTINE lim_rst_read |
---|
| 533 | |
---|
[825] | 534 | #else |
---|
| 535 | !!---------------------------------------------------------------------- |
---|
| 536 | !! Default option : Empty module NO LIM sea-ice model |
---|
| 537 | !!---------------------------------------------------------------------- |
---|
| 538 | CONTAINS |
---|
| 539 | SUBROUTINE lim_rst_read ! Empty routine |
---|
| 540 | END SUBROUTINE lim_rst_read |
---|
| 541 | SUBROUTINE lim_rst_write ! Empty routine |
---|
| 542 | END SUBROUTINE lim_rst_write |
---|
| 543 | #endif |
---|
| 544 | |
---|
| 545 | !!====================================================================== |
---|
| 546 | END MODULE limrst |
---|