New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
limrst.F90 in branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 4220

Last change on this file since 4220 was 4220, checked in by clem, 10 years ago

corrections for restartability

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