[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 |
---|
[8324] | 19 | USE sbc_ice , ONLY : snwice_mass, snwice_mass_b |
---|
[3625] | 20 | USE dom_oce ! ocean domain |
---|
[8316] | 21 | USE sbc_oce , ONLY : nn_fsbc |
---|
[8411] | 22 | USE icectl |
---|
[8378] | 23 | ! |
---|
[3625] | 24 | USE in_out_manager ! I/O manager |
---|
| 25 | USE iom ! I/O library |
---|
| 26 | USE lib_mpp ! MPP library |
---|
| 27 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
[921] | 28 | |
---|
[835] | 29 | IMPLICIT NONE |
---|
| 30 | PRIVATE |
---|
[921] | 31 | |
---|
[2528] | 32 | PUBLIC lim_rst_opn ! routine called by icestep.F90 |
---|
| 33 | PUBLIC lim_rst_write ! routine called by icestep.F90 |
---|
[8321] | 34 | PUBLIC lim_rst_read ! routine called by ice_init |
---|
[825] | 35 | |
---|
[835] | 36 | LOGICAL, PUBLIC :: lrst_ice !: logical to control the ice restart write |
---|
| 37 | INTEGER, PUBLIC :: numrir, numriw !: logical unit for ice restart (read and write) |
---|
[825] | 38 | |
---|
[835] | 39 | !!---------------------------------------------------------------------- |
---|
[4161] | 40 | !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) |
---|
[1156] | 41 | !! $Id$ |
---|
[2528] | 42 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[835] | 43 | !!---------------------------------------------------------------------- |
---|
| 44 | CONTAINS |
---|
[825] | 45 | |
---|
[835] | 46 | SUBROUTINE lim_rst_opn( kt ) |
---|
| 47 | !!---------------------------------------------------------------------- |
---|
| 48 | !! *** lim_rst_opn *** |
---|
| 49 | !! |
---|
| 50 | !! ** purpose : output of sea-ice variable in a netcdf file |
---|
| 51 | !!---------------------------------------------------------------------- |
---|
| 52 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
| 53 | ! |
---|
[7646] | 54 | CHARACTER(len=20) :: clkt ! ocean time-step define as a character |
---|
| 55 | CHARACTER(len=50) :: clname ! ice output restart file name |
---|
[5341] | 56 | CHARACTER(len=256) :: clpath ! full path to ice output restart file |
---|
[835] | 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 |
---|
[5341] | 66 | IF( nitrst <= nitend .AND. nitrst > 0 ) THEN |
---|
| 67 | ! beware of the format used to write kt (default is i8.8, that should be large enough...) |
---|
| 68 | IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst |
---|
| 69 | ELSE ; WRITE(clkt, '(i8.8)') nitrst |
---|
[835] | 70 | ENDIF |
---|
[5341] | 71 | ! create the file |
---|
| 72 | clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) |
---|
| 73 | clpath = TRIM(cn_icerst_outdir) |
---|
| 74 | IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' |
---|
| 75 | IF(lwp) THEN |
---|
| 76 | WRITE(numout,*) |
---|
| 77 | SELECT CASE ( jprstlib ) |
---|
| 78 | CASE DEFAULT |
---|
| 79 | WRITE(numout,*) ' open ice restart NetCDF file: ',TRIM(clpath)//clname |
---|
| 80 | END SELECT |
---|
| 81 | IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN |
---|
| 82 | WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp |
---|
| 83 | ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp |
---|
| 84 | ENDIF |
---|
| 85 | ENDIF |
---|
| 86 | ! |
---|
| 87 | CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) |
---|
| 88 | lrst_ice = .TRUE. |
---|
[835] | 89 | ENDIF |
---|
| 90 | ENDIF |
---|
| 91 | ! |
---|
[8411] | 92 | IF( ln_limctl ) CALL ice_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' ) ! control print |
---|
[835] | 93 | END SUBROUTINE lim_rst_opn |
---|
[825] | 94 | |
---|
[2528] | 95 | |
---|
[835] | 96 | SUBROUTINE lim_rst_write( kt ) |
---|
| 97 | !!---------------------------------------------------------------------- |
---|
| 98 | !! *** lim_rst_write *** |
---|
| 99 | !! |
---|
| 100 | !! ** purpose : output of sea-ice variable in a netcdf file |
---|
| 101 | !!---------------------------------------------------------------------- |
---|
| 102 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
[2528] | 103 | !! |
---|
| 104 | INTEGER :: ji, jj, jk ,jl ! dummy loop indices |
---|
| 105 | INTEGER :: iter |
---|
[7646] | 106 | CHARACTER(len=25) :: znam |
---|
| 107 | CHARACTER(len=2) :: zchar, zchar1 |
---|
[8373] | 108 | REAL(wp), DIMENSION(jpi,jpj) :: z2d |
---|
[835] | 109 | !!---------------------------------------------------------------------- |
---|
[921] | 110 | |
---|
[888] | 111 | iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 |
---|
[825] | 112 | |
---|
[835] | 113 | IF( iter == nitrst ) THEN |
---|
| 114 | IF(lwp) WRITE(numout,*) |
---|
| 115 | IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file kt =', kt |
---|
| 116 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' |
---|
| 117 | ENDIF |
---|
[825] | 118 | |
---|
[835] | 119 | ! Write in numriw (if iter == nitrst) |
---|
| 120 | ! ------------------ |
---|
| 121 | ! ! calendar control |
---|
[2528] | 122 | CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step |
---|
| 123 | CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ) ) ! date |
---|
[825] | 124 | |
---|
[835] | 125 | ! Prognostic variables |
---|
| 126 | DO jl = 1, jpl |
---|
[7646] | 127 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 128 | znam = 'v_i'//'_htc'//zchar |
---|
[7753] | 129 | z2d(:,:) = v_i(:,:,jl) |
---|
[835] | 130 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 131 | znam = 'v_s'//'_htc'//zchar |
---|
[7753] | 132 | z2d(:,:) = v_s(:,:,jl) |
---|
[835] | 133 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 134 | znam = 'smv_i'//'_htc'//zchar |
---|
[7753] | 135 | z2d(:,:) = smv_i(:,:,jl) |
---|
[835] | 136 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 137 | znam = 'oa_i'//'_htc'//zchar |
---|
[7753] | 138 | z2d(:,:) = oa_i(:,:,jl) |
---|
[835] | 139 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 140 | znam = 'a_i'//'_htc'//zchar |
---|
[7753] | 141 | z2d(:,:) = a_i(:,:,jl) |
---|
[835] | 142 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 143 | znam = 't_su'//'_htc'//zchar |
---|
[7753] | 144 | z2d(:,:) = t_su(:,:,jl) |
---|
[835] | 145 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[8233] | 146 | END DO |
---|
| 147 | |
---|
| 148 | ! MV MP 2016 |
---|
| 149 | IF ( nn_pnd_scheme > 0 ) THEN |
---|
| 150 | DO jl = 1, jpl |
---|
| 151 | WRITE(zchar,'(I2.2)') jl |
---|
| 152 | znam = 'a_ip'//'_htc'//zchar |
---|
| 153 | z2d(:,:) = a_ip(:,:,jl) |
---|
| 154 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 155 | znam = 'v_ip'//'_htc'//zchar |
---|
| 156 | z2d(:,:) = v_ip(:,:,jl) |
---|
| 157 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 158 | END DO |
---|
| 159 | ENDIF |
---|
| 160 | ! END MV MP 2016 |
---|
| 161 | |
---|
| 162 | DO jl = 1, jpl |
---|
| 163 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 164 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
[7753] | 165 | z2d(:,:) = e_s(:,:,1,jl) |
---|
[835] | 166 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 167 | DO jk = 1, nlay_i |
---|
[7646] | 168 | WRITE(zchar1,'(I2.2)') jk |
---|
[835] | 169 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 170 | z2d(:,:) = e_i(:,:,jk,jl) |
---|
[835] | 171 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 172 | END DO |
---|
[825] | 173 | END DO |
---|
| 174 | |
---|
[4205] | 175 | CALL iom_rstput( iter, nitrst, numriw, 'u_ice' , u_ice ) |
---|
| 176 | CALL iom_rstput( iter, nitrst, numriw, 'v_ice' , v_ice ) |
---|
| 177 | CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i ) |
---|
| 178 | CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) |
---|
| 179 | CALL iom_rstput( iter, nitrst, numriw, 'stress12_i' , stress12_i ) |
---|
[5123] | 180 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) |
---|
| 181 | CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 182 | |
---|
[7646] | 183 | ! In case Prather scheme is used for advection, write second order moments |
---|
| 184 | ! ------------------------------------------------------------------------ |
---|
| 185 | IF( nn_limadv == -1 ) THEN |
---|
| 186 | |
---|
| 187 | DO jl = 1, jpl |
---|
| 188 | WRITE(zchar,'(I2.2)') jl |
---|
| 189 | znam = 'sxice'//'_htc'//zchar |
---|
[7753] | 190 | z2d(:,:) = sxice(:,:,jl) |
---|
[835] | 191 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 192 | znam = 'syice'//'_htc'//zchar |
---|
[7753] | 193 | z2d(:,:) = syice(:,:,jl) |
---|
[838] | 194 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 195 | znam = 'sxxice'//'_htc'//zchar |
---|
[7753] | 196 | z2d(:,:) = sxxice(:,:,jl) |
---|
[835] | 197 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 198 | znam = 'syyice'//'_htc'//zchar |
---|
[7753] | 199 | z2d(:,:) = syyice(:,:,jl) |
---|
[835] | 200 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 201 | znam = 'sxyice'//'_htc'//zchar |
---|
[7753] | 202 | z2d(:,:) = sxyice(:,:,jl) |
---|
[835] | 203 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[7646] | 204 | znam = 'sxsn'//'_htc'//zchar |
---|
[7753] | 205 | z2d(:,:) = sxsn(:,:,jl) |
---|
[7646] | 206 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 207 | znam = 'sysn'//'_htc'//zchar |
---|
[7753] | 208 | z2d(:,:) = sysn(:,:,jl) |
---|
[7646] | 209 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 210 | znam = 'sxxsn'//'_htc'//zchar |
---|
[7753] | 211 | z2d(:,:) = sxxsn(:,:,jl) |
---|
[7646] | 212 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 213 | znam = 'syysn'//'_htc'//zchar |
---|
[7753] | 214 | z2d(:,:) = syysn(:,:,jl) |
---|
[7646] | 215 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 216 | znam = 'sxysn'//'_htc'//zchar |
---|
[7753] | 217 | z2d(:,:) = sxysn(:,:,jl) |
---|
[7646] | 218 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 219 | znam = 'sxa'//'_htc'//zchar |
---|
[7753] | 220 | z2d(:,:) = sxa(:,:,jl) |
---|
[7646] | 221 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 222 | znam = 'sya'//'_htc'//zchar |
---|
[7753] | 223 | z2d(:,:) = sya(:,:,jl) |
---|
[7646] | 224 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 225 | znam = 'sxxa'//'_htc'//zchar |
---|
[7753] | 226 | z2d(:,:) = sxxa(:,:,jl) |
---|
[7646] | 227 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 228 | znam = 'syya'//'_htc'//zchar |
---|
[7753] | 229 | z2d(:,:) = syya(:,:,jl) |
---|
[7646] | 230 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 231 | znam = 'sxya'//'_htc'//zchar |
---|
[7753] | 232 | z2d(:,:) = sxya(:,:,jl) |
---|
[7646] | 233 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 234 | znam = 'sxc0'//'_htc'//zchar |
---|
[7753] | 235 | z2d(:,:) = sxc0(:,:,jl) |
---|
[7646] | 236 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 237 | znam = 'syc0'//'_htc'//zchar |
---|
[7753] | 238 | z2d(:,:) = syc0(:,:,jl) |
---|
[7646] | 239 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 240 | znam = 'sxxc0'//'_htc'//zchar |
---|
[7753] | 241 | z2d(:,:) = sxxc0(:,:,jl) |
---|
[7646] | 242 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 243 | znam = 'syyc0'//'_htc'//zchar |
---|
[7753] | 244 | z2d(:,:) = syyc0(:,:,jl) |
---|
[7646] | 245 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 246 | znam = 'sxyc0'//'_htc'//zchar |
---|
[7753] | 247 | z2d(:,:) = sxyc0(:,:,jl) |
---|
[7646] | 248 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 249 | znam = 'sxsal'//'_htc'//zchar |
---|
[7753] | 250 | z2d(:,:) = sxsal(:,:,jl) |
---|
[7646] | 251 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 252 | znam = 'sysal'//'_htc'//zchar |
---|
[7753] | 253 | z2d(:,:) = sysal(:,:,jl) |
---|
[7646] | 254 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 255 | znam = 'sxxsal'//'_htc'//zchar |
---|
[7753] | 256 | z2d(:,:) = sxxsal(:,:,jl) |
---|
[7646] | 257 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 258 | znam = 'syysal'//'_htc'//zchar |
---|
[7753] | 259 | z2d(:,:) = syysal(:,:,jl) |
---|
[7646] | 260 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 261 | znam = 'sxysal'//'_htc'//zchar |
---|
[7753] | 262 | z2d(:,:) = sxysal(:,:,jl) |
---|
[7646] | 263 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 264 | znam = 'sxage'//'_htc'//zchar |
---|
[7753] | 265 | z2d(:,:) = sxage(:,:,jl) |
---|
[7646] | 266 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 267 | znam = 'syage'//'_htc'//zchar |
---|
[7753] | 268 | z2d(:,:) = syage(:,:,jl) |
---|
[7646] | 269 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 270 | znam = 'sxxage'//'_htc'//zchar |
---|
[7753] | 271 | z2d(:,:) = sxxage(:,:,jl) |
---|
[7646] | 272 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 273 | znam = 'syyage'//'_htc'//zchar |
---|
[7753] | 274 | z2d(:,:) = syyage(:,:,jl) |
---|
[7646] | 275 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 276 | znam = 'sxyage'//'_htc'//zchar |
---|
[7753] | 277 | z2d(:,:) = sxyage(:,:,jl) |
---|
[7646] | 278 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
[835] | 279 | END DO |
---|
[825] | 280 | |
---|
[7646] | 281 | CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' , sxopw ) |
---|
| 282 | CALL iom_rstput( iter, nitrst, numriw, 'syopw ' , syopw ) |
---|
| 283 | CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' , sxxopw ) |
---|
| 284 | CALL iom_rstput( iter, nitrst, numriw, 'syyopw' , syyopw ) |
---|
| 285 | CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' , sxyopw ) |
---|
| 286 | |
---|
| 287 | DO jl = 1, jpl |
---|
| 288 | WRITE(zchar,'(I2.2)') jl |
---|
| 289 | DO jk = 1, nlay_i |
---|
| 290 | WRITE(zchar1,'(I2.2)') jk |
---|
| 291 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 292 | z2d(:,:) = sxe(:,:,jk,jl) |
---|
[7646] | 293 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 294 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 295 | z2d(:,:) = sye(:,:,jk,jl) |
---|
[7646] | 296 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 297 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 298 | z2d(:,:) = sxxe(:,:,jk,jl) |
---|
[7646] | 299 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 300 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 301 | z2d(:,:) = syye(:,:,jk,jl) |
---|
[7646] | 302 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 303 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
[7753] | 304 | z2d(:,:) = sxye(:,:,jk,jl) |
---|
[7646] | 305 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 306 | END DO |
---|
| 307 | END DO |
---|
[8233] | 308 | ! MV MP 2016 |
---|
| 309 | IF ( nn_pnd_scheme > 0 ) THEN |
---|
| 310 | DO jl = 1, jpl |
---|
| 311 | WRITE(zchar,'(I2.2)') jl |
---|
| 312 | znam = 'sxap'//'_htc'//zchar |
---|
| 313 | z2d(:,:) = sxap(:,:,jl) |
---|
| 314 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 315 | znam = 'syap'//'_htc'//zchar |
---|
| 316 | z2d(:,:) = syap(:,:,jl) |
---|
| 317 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 318 | znam = 'sxxap'//'_htc'//zchar |
---|
| 319 | z2d(:,:) = sxxap(:,:,jl) |
---|
| 320 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 321 | znam = 'syyap'//'_htc'//zchar |
---|
| 322 | z2d(:,:) = syyap(:,:,jl) |
---|
| 323 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 324 | znam = 'sxyap'//'_htc'//zchar |
---|
| 325 | z2d(:,:) = sxyap(:,:,jl) |
---|
| 326 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 327 | |
---|
| 328 | znam = 'sxvp'//'_htc'//zchar |
---|
| 329 | z2d(:,:) = sxvp(:,:,jl) |
---|
| 330 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 331 | znam = 'syvp'//'_htc'//zchar |
---|
| 332 | z2d(:,:) = syvp(:,:,jl) |
---|
| 333 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 334 | znam = 'sxxvp'//'_htc'//zchar |
---|
| 335 | z2d(:,:) = sxxvp(:,:,jl) |
---|
| 336 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 337 | znam = 'syyvp'//'_htc'//zchar |
---|
| 338 | z2d(:,:) = syyvp(:,:,jl) |
---|
| 339 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 340 | znam = 'sxyvp'//'_htc'//zchar |
---|
| 341 | z2d(:,:) = sxyvp(:,:,jl) |
---|
| 342 | CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) |
---|
| 343 | END DO |
---|
| 344 | ENDIF |
---|
[7646] | 345 | |
---|
| 346 | ENDIF |
---|
| 347 | |
---|
| 348 | ! close restart file |
---|
| 349 | ! ------------------ |
---|
[835] | 350 | IF( iter == nitrst ) THEN |
---|
[7646] | 351 | CALL iom_close( numriw ) |
---|
[835] | 352 | lrst_ice = .FALSE. |
---|
| 353 | ENDIF |
---|
| 354 | ! |
---|
[2715] | 355 | ! |
---|
[921] | 356 | END SUBROUTINE lim_rst_write |
---|
| 357 | |
---|
[2528] | 358 | |
---|
[835] | 359 | SUBROUTINE lim_rst_read |
---|
| 360 | !!---------------------------------------------------------------------- |
---|
| 361 | !! *** lim_rst_read *** |
---|
| 362 | !! |
---|
| 363 | !! ** purpose : read of sea-ice variable restart in a netcdf file |
---|
| 364 | !!---------------------------------------------------------------------- |
---|
[8373] | 365 | INTEGER :: ji, jj, jk, jl |
---|
| 366 | REAL(wp) :: zfice, ziter |
---|
| 367 | REAL(wp), DIMENSION(jpi,jpj) :: z2d |
---|
[7646] | 368 | CHARACTER(len=25) :: znam |
---|
| 369 | CHARACTER(len=2) :: zchar, zchar1 |
---|
[2528] | 370 | INTEGER :: jlibalt = jprstlib |
---|
| 371 | LOGICAL :: llok |
---|
[835] | 372 | !!---------------------------------------------------------------------- |
---|
[921] | 373 | |
---|
[825] | 374 | IF(lwp) THEN |
---|
| 375 | WRITE(numout,*) |
---|
[835] | 376 | WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file' |
---|
[2715] | 377 | WRITE(numout,*) '~~~~~~~~~~~~~' |
---|
[825] | 378 | ENDIF |
---|
| 379 | |
---|
[5341] | 380 | CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib ) |
---|
[835] | 381 | |
---|
[888] | 382 | CALL iom_get( numrir, 'nn_fsbc', zfice ) |
---|
| 383 | CALL iom_get( numrir, 'kt_ice' , ziter ) |
---|
[835] | 384 | IF(lwp) WRITE(numout,*) ' read ice restart file at time step : ', ziter |
---|
| 385 | IF(lwp) WRITE(numout,*) ' in any case we force it to nit000 - 1 : ', nit000 - 1 |
---|
| 386 | |
---|
[825] | 387 | !Control of date |
---|
[921] | 388 | |
---|
[4161] | 389 | IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 ) & |
---|
[835] | 390 | & CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart', & |
---|
| 391 | & ' verify the file or rerun with the value 0 for the', & |
---|
| 392 | & ' control of time parameter nrstdt' ) |
---|
[4161] | 393 | IF( NINT(zfice) /= nn_fsbc .AND. ABS( nrstdt ) == 1 ) & |
---|
[888] | 394 | & CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart', & |
---|
| 395 | & ' verify the file or rerun with the value 0 for the', & |
---|
[835] | 396 | & ' control of time parameter nrstdt' ) |
---|
[825] | 397 | |
---|
[7646] | 398 | ! Prognostic variables |
---|
[835] | 399 | DO jl = 1, jpl |
---|
[7646] | 400 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 401 | znam = 'v_i'//'_htc'//zchar |
---|
| 402 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 403 | v_i(:,:,jl) = z2d(:,:) |
---|
| 404 | znam = 'v_s'//'_htc'//zchar |
---|
| 405 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 406 | v_s(:,:,jl) = z2d(:,:) |
---|
| 407 | znam = 'smv_i'//'_htc'//zchar |
---|
| 408 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 409 | smv_i(:,:,jl) = z2d(:,:) |
---|
| 410 | znam = 'oa_i'//'_htc'//zchar |
---|
| 411 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 412 | oa_i(:,:,jl) = z2d(:,:) |
---|
| 413 | znam = 'a_i'//'_htc'//zchar |
---|
| 414 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 415 | a_i(:,:,jl) = z2d(:,:) |
---|
| 416 | znam = 't_su'//'_htc'//zchar |
---|
| 417 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 418 | t_su(:,:,jl) = z2d(:,:) |
---|
[8233] | 419 | END DO |
---|
| 420 | |
---|
| 421 | ! MV MP 2016 |
---|
| 422 | IF ( nn_pnd_scheme > 0 ) THEN |
---|
| 423 | DO jl = 1, jpl |
---|
| 424 | WRITE(zchar,'(I2.2)') jl |
---|
| 425 | znam = 'a_ip'//'_htc'//zchar |
---|
| 426 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 427 | a_ip(:,:,jl) = z2d(:,:) |
---|
| 428 | znam = 'v_ip'//'_htc'//zchar |
---|
| 429 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 430 | v_ip(:,:,jl) = z2d(:,:) |
---|
| 431 | END DO |
---|
| 432 | ENDIF |
---|
| 433 | ! END MV MP 2016 |
---|
| 434 | |
---|
| 435 | DO jl = 1, jpl |
---|
| 436 | WRITE(zchar,'(I2.2)') jl |
---|
[835] | 437 | znam = 'tempt_sl1'//'_htc'//zchar |
---|
| 438 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 439 | e_s(:,:,1,jl) = z2d(:,:) |
---|
| 440 | DO jk = 1, nlay_i |
---|
[7646] | 441 | WRITE(zchar1,'(I2.2)') jk |
---|
[835] | 442 | znam = 'tempt'//'_il'//zchar1//'_htc'//zchar |
---|
| 443 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 444 | e_i(:,:,jk,jl) = z2d(:,:) |
---|
| 445 | END DO |
---|
| 446 | END DO |
---|
[825] | 447 | |
---|
[835] | 448 | CALL iom_get( numrir, jpdom_autoglo, 'u_ice' , u_ice ) |
---|
| 449 | CALL iom_get( numrir, jpdom_autoglo, 'v_ice' , v_ice ) |
---|
| 450 | CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i ) |
---|
| 451 | CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i ) |
---|
| 452 | CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i ) |
---|
[5123] | 453 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) |
---|
| 454 | CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) |
---|
[825] | 455 | |
---|
[7646] | 456 | ! In case Prather scheme is used for advection, read second order moments |
---|
| 457 | ! ------------------------------------------------------------------------ |
---|
| 458 | IF( nn_limadv == -1 ) THEN |
---|
[825] | 459 | |
---|
[7646] | 460 | DO jl = 1, jpl |
---|
| 461 | WRITE(zchar,'(I2.2)') jl |
---|
| 462 | znam = 'sxice'//'_htc'//zchar |
---|
[835] | 463 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 464 | sxice(:,:,jl) = z2d(:,:) |
---|
| 465 | znam = 'syice'//'_htc'//zchar |
---|
[838] | 466 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 467 | syice(:,:,jl) = z2d(:,:) |
---|
| 468 | znam = 'sxxice'//'_htc'//zchar |
---|
[835] | 469 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 470 | sxxice(:,:,jl) = z2d(:,:) |
---|
| 471 | znam = 'syyice'//'_htc'//zchar |
---|
[835] | 472 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 473 | syyice(:,:,jl) = z2d(:,:) |
---|
| 474 | znam = 'sxyice'//'_htc'//zchar |
---|
[835] | 475 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
[7646] | 476 | sxyice(:,:,jl) = z2d(:,:) |
---|
| 477 | znam = 'sxsn'//'_htc'//zchar |
---|
| 478 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 479 | sxsn(:,:,jl) = z2d(:,:) |
---|
| 480 | znam = 'sysn'//'_htc'//zchar |
---|
| 481 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 482 | sysn(:,:,jl) = z2d(:,:) |
---|
| 483 | znam = 'sxxsn'//'_htc'//zchar |
---|
| 484 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 485 | sxxsn(:,:,jl) = z2d(:,:) |
---|
| 486 | znam = 'syysn'//'_htc'//zchar |
---|
| 487 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 488 | syysn(:,:,jl) = z2d(:,:) |
---|
| 489 | znam = 'sxysn'//'_htc'//zchar |
---|
| 490 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 491 | sxysn(:,:,jl) = z2d(:,:) |
---|
| 492 | znam = 'sxa'//'_htc'//zchar |
---|
| 493 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 494 | sxa(:,:,jl) = z2d(:,:) |
---|
| 495 | znam = 'sya'//'_htc'//zchar |
---|
| 496 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 497 | sya(:,:,jl) = z2d(:,:) |
---|
| 498 | znam = 'sxxa'//'_htc'//zchar |
---|
| 499 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 500 | sxxa(:,:,jl) = z2d(:,:) |
---|
| 501 | znam = 'syya'//'_htc'//zchar |
---|
| 502 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 503 | syya(:,:,jl) = z2d(:,:) |
---|
| 504 | znam = 'sxya'//'_htc'//zchar |
---|
| 505 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 506 | sxya(:,:,jl) = z2d(:,:) |
---|
| 507 | znam = 'sxc0'//'_htc'//zchar |
---|
| 508 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 509 | sxc0(:,:,jl) = z2d(:,:) |
---|
| 510 | znam = 'syc0'//'_htc'//zchar |
---|
| 511 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 512 | syc0(:,:,jl) = z2d(:,:) |
---|
| 513 | znam = 'sxxc0'//'_htc'//zchar |
---|
| 514 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 515 | sxxc0(:,:,jl) = z2d(:,:) |
---|
| 516 | znam = 'syyc0'//'_htc'//zchar |
---|
| 517 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 518 | syyc0(:,:,jl) = z2d(:,:) |
---|
| 519 | znam = 'sxyc0'//'_htc'//zchar |
---|
| 520 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 521 | sxyc0(:,:,jl) = z2d(:,:) |
---|
| 522 | znam = 'sxsal'//'_htc'//zchar |
---|
| 523 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 524 | sxsal(:,:,jl) = z2d(:,:) |
---|
| 525 | znam = 'sysal'//'_htc'//zchar |
---|
| 526 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 527 | sysal(:,:,jl) = z2d(:,:) |
---|
| 528 | znam = 'sxxsal'//'_htc'//zchar |
---|
| 529 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 530 | sxxsal(:,:,jl) = z2d(:,:) |
---|
| 531 | znam = 'syysal'//'_htc'//zchar |
---|
| 532 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 533 | syysal(:,:,jl) = z2d(:,:) |
---|
| 534 | znam = 'sxysal'//'_htc'//zchar |
---|
| 535 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 536 | sxysal(:,:,jl) = z2d(:,:) |
---|
| 537 | znam = 'sxage'//'_htc'//zchar |
---|
| 538 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 539 | sxage(:,:,jl) = z2d(:,:) |
---|
| 540 | znam = 'syage'//'_htc'//zchar |
---|
| 541 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 542 | syage(:,:,jl) = z2d(:,:) |
---|
| 543 | znam = 'sxxage'//'_htc'//zchar |
---|
| 544 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 545 | sxxage(:,:,jl) = z2d(:,:) |
---|
| 546 | znam = 'syyage'//'_htc'//zchar |
---|
| 547 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 548 | syyage(:,:,jl) = z2d(:,:) |
---|
| 549 | znam = 'sxyage'//'_htc'//zchar |
---|
| 550 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 551 | sxyage(:,:,jl)= z2d(:,:) |
---|
[835] | 552 | END DO |
---|
[8233] | 553 | ! MV MP 2016 |
---|
| 554 | IF ( nn_pnd_scheme > 0 ) THEN |
---|
| 555 | DO jl = 1, jpl |
---|
| 556 | WRITE(zchar,'(I2.2)') jl |
---|
| 557 | znam = 'sxap'//'_htc'//zchar |
---|
| 558 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 559 | sxap(:,:,jl) = z2d(:,:) |
---|
| 560 | znam = 'syap'//'_htc'//zchar |
---|
| 561 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 562 | syap(:,:,jl) = z2d(:,:) |
---|
| 563 | znam = 'sxxap'//'_htc'//zchar |
---|
| 564 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 565 | sxxap(:,:,jl) = z2d(:,:) |
---|
| 566 | znam = 'syyap'//'_htc'//zchar |
---|
| 567 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 568 | syyap(:,:,jl) = z2d(:,:) |
---|
| 569 | znam = 'sxyap'//'_htc'//zchar |
---|
| 570 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 571 | sxyap(:,:,jl) = z2d(:,:) |
---|
| 572 | |
---|
| 573 | znam = 'sxvp'//'_htc'//zchar |
---|
| 574 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 575 | sxvp(:,:,jl) = z2d(:,:) |
---|
| 576 | znam = 'syvp'//'_htc'//zchar |
---|
| 577 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 578 | syvp(:,:,jl) = z2d(:,:) |
---|
| 579 | znam = 'sxxvp'//'_htc'//zchar |
---|
| 580 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 581 | sxxvp(:,:,jl) = z2d(:,:) |
---|
| 582 | znam = 'syyvp'//'_htc'//zchar |
---|
| 583 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 584 | syyvp(:,:,jl) = z2d(:,:) |
---|
| 585 | znam = 'sxyvp'//'_htc'//zchar |
---|
| 586 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 587 | sxyvp(:,:,jl) = z2d(:,:) |
---|
| 588 | END DO |
---|
| 589 | ENDIF |
---|
| 590 | ! END MV MP 2016 |
---|
[7646] | 591 | |
---|
| 592 | CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' , sxopw ) |
---|
| 593 | CALL iom_get( numrir, jpdom_autoglo, 'syopw ' , syopw ) |
---|
| 594 | CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' , sxxopw ) |
---|
| 595 | CALL iom_get( numrir, jpdom_autoglo, 'syyopw' , syyopw ) |
---|
| 596 | CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' , sxyopw ) |
---|
| 597 | |
---|
| 598 | DO jl = 1, jpl |
---|
| 599 | WRITE(zchar,'(I2.2)') jl |
---|
| 600 | DO jk = 1, nlay_i |
---|
| 601 | WRITE(zchar1,'(I2.2)') jk |
---|
| 602 | znam = 'sxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 603 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 604 | sxe(:,:,jk,jl) = z2d(:,:) |
---|
| 605 | znam = 'sye'//'_il'//zchar1//'_htc'//zchar |
---|
| 606 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 607 | sye(:,:,jk,jl) = z2d(:,:) |
---|
| 608 | znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar |
---|
| 609 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 610 | sxxe(:,:,jk,jl) = z2d(:,:) |
---|
| 611 | znam = 'syye'//'_il'//zchar1//'_htc'//zchar |
---|
| 612 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 613 | syye(:,:,jk,jl) = z2d(:,:) |
---|
| 614 | znam = 'sxye'//'_il'//zchar1//'_htc'//zchar |
---|
| 615 | CALL iom_get( numrir, jpdom_autoglo, znam , z2d ) |
---|
| 616 | sxye(:,:,jk,jl) = z2d(:,:) |
---|
| 617 | END DO |
---|
| 618 | END DO |
---|
| 619 | ! |
---|
| 620 | END IF |
---|
| 621 | |
---|
[4688] | 622 | ! clem: I do not understand why the following IF is needed |
---|
[5123] | 623 | ! I suspect something inconsistent in the main code with option nn_icesal=1 |
---|
| 624 | IF( nn_icesal == 1 ) THEN |
---|
[4688] | 625 | DO jl = 1, jpl |
---|
[5123] | 626 | sm_i(:,:,jl) = rn_icesal |
---|
[4688] | 627 | DO jk = 1, nlay_i |
---|
[5123] | 628 | s_i(:,:,jk,jl) = rn_icesal |
---|
[4688] | 629 | END DO |
---|
| 630 | END DO |
---|
| 631 | ENDIF |
---|
| 632 | ! |
---|
[8321] | 633 | !CALL iom_close( numrir ) !clem: closed in icestp.F90 |
---|
[2528] | 634 | ! |
---|
[921] | 635 | END SUBROUTINE lim_rst_read |
---|
| 636 | |
---|
[825] | 637 | #else |
---|
| 638 | !!---------------------------------------------------------------------- |
---|
| 639 | !! Default option : Empty module NO LIM sea-ice model |
---|
| 640 | !!---------------------------------------------------------------------- |
---|
| 641 | CONTAINS |
---|
| 642 | SUBROUTINE lim_rst_read ! Empty routine |
---|
| 643 | END SUBROUTINE lim_rst_read |
---|
| 644 | SUBROUTINE lim_rst_write ! Empty routine |
---|
| 645 | END SUBROUTINE lim_rst_write |
---|
| 646 | #endif |
---|
| 647 | |
---|
| 648 | !!====================================================================== |
---|
| 649 | END MODULE limrst |
---|