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