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_r3406_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2013/dev_r3406_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 5592

Last change on this file since 5592 was 3938, checked in by flavoni, 11 years ago

dev_r3406_CNRS_LIM3: update LIM3, see ticket #1116

  • Property svn:keywords set to Id
File size: 25.1 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 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   !!----------------------------------------------------------------------
44CONTAINS
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, 'iatte'     , iatte      ) ! clem modif
165      CALL iom_rstput( iter, nitrst, numriw, 'oatte'     , oatte      ) ! clem modif
166      CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i  )
167      CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i  )
168      CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i )
169
170      DO jl = 1, jpl 
171         WRITE(zchar,'(I1)') jl
172         znam = 'sxice'//'_htc'//zchar
173         z2d(:,:) = sxice(:,:,jl)
174         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
175         znam = 'syice'//'_htc'//zchar
176         z2d(:,:) = syice(:,:,jl)
177         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
178         znam = 'sxxice'//'_htc'//zchar
179         z2d(:,:) = sxxice(:,:,jl)
180         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
181         znam = 'syyice'//'_htc'//zchar
182         z2d(:,:) = syyice(:,:,jl)
183         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
184         znam = 'sxyice'//'_htc'//zchar
185         z2d(:,:) = sxyice(:,:,jl)
186         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
187         znam = 'sxsn'//'_htc'//zchar
188         z2d(:,:) = sxsn(:,:,jl)
189         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
190         znam = 'sysn'//'_htc'//zchar
191         z2d(:,:) = sysn(:,:,jl)
192         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
193         znam = 'sxxsn'//'_htc'//zchar
194         z2d(:,:) = sxxsn(:,:,jl)
195         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
196         znam = 'syysn'//'_htc'//zchar
197         z2d(:,:) = syysn(:,:,jl)
198         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
199         znam = 'sxysn'//'_htc'//zchar
200         z2d(:,:) = sxysn(:,:,jl)
201         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
202         znam = 'sxa'//'_htc'//zchar
203         z2d(:,:) = sxa(:,:,jl)
204         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
205         znam = 'sya'//'_htc'//zchar
206         z2d(:,:) = sya(:,:,jl)
207         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
208         znam = 'sxxa'//'_htc'//zchar
209         z2d(:,:) = sxxa(:,:,jl)
210         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
211         znam = 'syya'//'_htc'//zchar
212         z2d(:,:) = syya(:,:,jl)
213         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
214         znam = 'sxya'//'_htc'//zchar
215         z2d(:,:) = sxya(:,:,jl)
216         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
217         znam = 'sxc0'//'_htc'//zchar
218         z2d(:,:) = sxc0(:,:,jl)
219         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
220         znam = 'syc0'//'_htc'//zchar
221         z2d(:,:) = syc0(:,:,jl)
222         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
223         znam = 'sxxc0'//'_htc'//zchar
224         z2d(:,:) = sxxc0(:,:,jl)
225         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
226         znam = 'syyc0'//'_htc'//zchar
227         z2d(:,:) = syyc0(:,:,jl)
228         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
229         znam = 'sxyc0'//'_htc'//zchar
230         z2d(:,:) = sxyc0(:,:,jl)
231         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
232         znam = 'sxsal'//'_htc'//zchar
233         z2d(:,:) = sxsal(:,:,jl)
234         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
235         znam = 'sysal'//'_htc'//zchar
236         z2d(:,:) = sysal(:,:,jl)
237         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
238         znam = 'sxxsal'//'_htc'//zchar
239         z2d(:,:) = sxxsal(:,:,jl)
240         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
241         znam = 'syysal'//'_htc'//zchar
242         z2d(:,:) = syysal(:,:,jl)
243         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
244         znam = 'sxysal'//'_htc'//zchar
245         z2d(:,:) = sxysal(:,:,jl)
246         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
247         znam = 'sxage'//'_htc'//zchar
248         z2d(:,:) = sxage(:,:,jl)
249         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
250         znam = 'syage'//'_htc'//zchar
251         z2d(:,:) = syage(:,:,jl)
252         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
253         znam = 'sxxage'//'_htc'//zchar
254         z2d(:,:) = sxxage(:,:,jl)
255         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
256         znam = 'syyage'//'_htc'//zchar
257         z2d(:,:) = syyage(:,:,jl)
258         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
259         znam = 'sxyage'//'_htc'//zchar
260         z2d(:,:) = sxyage(:,:,jl)
261         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
262      END DO
263
264      CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' ,  sxopw  )
265      CALL iom_rstput( iter, nitrst, numriw, 'syopw ' ,  syopw  )
266      CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' ,  sxxopw )
267      CALL iom_rstput( iter, nitrst, numriw, 'syyopw' ,  syyopw )
268      CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' ,  sxyopw )
269
270      DO jl = 1, jpl 
271         WRITE(zchar,'(I1)') jl
272         DO jk = 1, nlay_i 
273            WRITE(zchar1,'(I1)') jk
274            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
275            z2d(:,:) = sxe(:,:,jk,jl)
276            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
277            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
278            z2d(:,:) = sye(:,:,jk,jl)
279            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
280            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
281            z2d(:,:) = sxxe(:,:,jk,jl)
282            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
283            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
284            z2d(:,:) = syye(:,:,jk,jl)
285            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
286            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
287            z2d(:,:) = sxye(:,:,jk,jl)
288            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
289         END DO
290      END DO
291
292      IF( iter == nitrst ) THEN
293         CALL iom_close( numriw )                         ! close the restart file
294         lrst_ice = .FALSE.
295      ENDIF
296      !
297      CALL wrk_dealloc( jpi, jpj, z2d )
298      !
299   END SUBROUTINE lim_rst_write
300
301
302   SUBROUTINE lim_rst_read
303      !!----------------------------------------------------------------------
304      !!                    ***  lim_rst_read  ***
305      !!
306      !! ** purpose  :   read of sea-ice variable restart in a netcdf file
307      !!----------------------------------------------------------------------
308      INTEGER :: ji, jj, jk, jl, indx
309      REAL(wp) ::   zfice, ziter
310      REAL(wp) ::   zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb   ! local scalars used for the salinity profile
311      REAL(wp), POINTER, DIMENSION(:)  ::   zs_zero 
312      REAL(wp), POINTER, DIMENSION(:,:) ::   z2d
313      CHARACTER(len=15) ::   znam
314      CHARACTER(len=1)  ::   zchar, zchar1
315      INTEGER           ::   jlibalt = jprstlib
316      LOGICAL           ::   llok
317      !!----------------------------------------------------------------------
318
319      CALL wrk_alloc( nlay_i, zs_zero )
320      CALL wrk_alloc( jpi, jpj, z2d )
321
322      IF(lwp) THEN
323         WRITE(numout,*)
324         WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file'
325         WRITE(numout,*) '~~~~~~~~~~~~~'
326      ENDIF
327
328      IF ( jprstlib == jprstdimg ) THEN
329        ! eventually read netcdf file (monobloc)  for restarting on different number of processors
330        ! if {cn_icerst_in}.nc exists, then set jlibalt to jpnf90
331        INQUIRE( FILE = TRIM(cn_icerst_in)//'.nc', EXIST = llok )
332        IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF
333      ENDIF
334
335      CALL iom_open ( cn_icerst_in, numrir, kiolib = jprstlib )
336
337      CALL iom_get( numrir, 'nn_fsbc', zfice )
338      CALL iom_get( numrir, 'kt_ice' , ziter )   
339      IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
340      IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
341
342      !Control of date
343
344      IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
345         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart',  &
346         &                   '   verify the file or rerun with the value 0 for the',        &
347         &                   '   control of time parameter  nrstdt' )
348      IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
349         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
350         &                   '   verify the file or rerun with the value 0 for the',         &
351         &                   '   control of time parameter  nrstdt' )
352
353      DO jl = 1, jpl 
354         WRITE(zchar,'(I1)') jl
355         znam = 'v_i'//'_htc'//zchar
356         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
357         v_i(:,:,jl) = z2d(:,:)
358         znam = 'v_s'//'_htc'//zchar
359         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
360         v_s(:,:,jl) = z2d(:,:) 
361         znam = 'smv_i'//'_htc'//zchar
362         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
363         smv_i(:,:,jl) = z2d(:,:)
364         znam = 'oa_i'//'_htc'//zchar
365         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
366         oa_i(:,:,jl) = z2d(:,:)
367         znam = 'a_i'//'_htc'//zchar
368         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
369         a_i(:,:,jl) = z2d(:,:)
370         znam = 't_su'//'_htc'//zchar
371         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
372         t_su(:,:,jl) = z2d(:,:)
373      END DO
374
375      DO jl = 1, jpl 
376         CALL lbc_lnk( smv_i(:,:,jl) , 'T' ,  1. )
377         CALL lbc_lnk( v_i  (:,:,jl) , 'T' ,  1. )
378         CALL lbc_lnk( a_i  (:,:,jl) , 'T' ,  1. )
379      END DO
380
381      ! we first with bulk ice salinity
382      DO jl = 1, jpl
383         DO jj = 1, jpj
384            DO ji = 1, jpi
385               zindb          = MAX( 0.0 , SIGN( 1.0 , v_i(ji,jj,jl) - 1.0e-4 ) ) 
386               sm_i(ji,jj,jl) = smv_i(ji,jj,jl) / MAX(v_i(ji,jj,jl),1.0e-6) * zindb
387               ht_i(ji,jj,jl) = v_i(ji,jj,jl)   / MAX(a_i(ji,jj,jl),1.0e-6) * zindb
388            END DO
389         END DO
390      END DO
391
392      DO jk = 1, nlay_i
393         s_i(:,:,jk,:) = sm_i(:,:,:)
394      END DO
395
396      IF( num_sal == 2 ) THEN      ! Salinity profile
397         DO jl = 1, jpl
398            DO jk = 1, nlay_i
399               DO jj = 1, jpj
400                  DO ji = 1, jpi
401                     zs_inf        = sm_i(ji,jj,jl)
402                     z_slope_s     = 2._wp * sm_i(ji,jj,jl) / MAX( 0.01_wp , ht_i(ji,jj,jl) )
403                     !- slope of the salinity profile
404                     zs_zero(jk)   = z_slope_s * ( REAL(jk,wp) - 0.5_wp ) * ht_i(ji,jj,jl) / REAL(nlay_i,wp)
405                     zsmax = 4.5_wp
406                     zsmin = 3.5_wp
407                     IF( sm_i(ji,jj,jl) .LT. zsmin ) THEN
408                        zalpha = 1._wp
409                     ELSEIF( sm_i(ji,jj,jl) .LT.zsmax ) THEN
410                        zalpha = sm_i(ji,jj,jl) / ( zsmin - zsmax ) + zsmax / ( zsmax - zsmin )
411                     ELSE
412                        zalpha = 0._wp
413                     ENDIF
414                     s_i(ji,jj,jk,jl) = zalpha * zs_zero(jk) + ( 1._wp - zalpha ) * zs_inf
415                  END DO
416               END DO
417            END DO
418         END DO
419      ENDIF
420
421      DO jl = 1, jpl 
422         WRITE(zchar,'(I1)') jl
423         znam = 'tempt_sl1'//'_htc'//zchar
424         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
425         e_s(:,:,1,jl) = z2d(:,:)
426      END DO
427
428      DO jl = 1, jpl 
429         WRITE(zchar,'(I1)') jl
430         DO jk = 1, nlay_i 
431            WRITE(zchar1,'(I1)') jk
432            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
433            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
434            e_i(:,:,jk,jl) = z2d(:,:)
435         END DO
436      END DO
437
438      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
439      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
440      CALL iom_get( numrir, jpdom_autoglo, 'fsbbq'     , fsbbq      )
441      CALL iom_get( numrir, jpdom_autoglo, 'iatte'     , iatte      ) ! clem modif
442      CALL iom_get( numrir, jpdom_autoglo, 'oatte'     , oatte      ) ! clem modif
443      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
444      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
445      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
446
447      DO jl = 1, jpl 
448         WRITE(zchar,'(I1)') jl
449         znam = 'sxice'//'_htc'//zchar
450         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
451         sxice(:,:,jl) = z2d(:,:)
452         znam = 'syice'//'_htc'//zchar
453         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
454         syice(:,:,jl) = z2d(:,:)
455         znam = 'sxxice'//'_htc'//zchar
456         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
457         sxxice(:,:,jl) = z2d(:,:)
458         znam = 'syyice'//'_htc'//zchar
459         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
460         syyice(:,:,jl) = z2d(:,:)
461         znam = 'sxyice'//'_htc'//zchar
462         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
463         sxyice(:,:,jl) = z2d(:,:)
464         znam = 'sxsn'//'_htc'//zchar
465         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
466         sxsn(:,:,jl) = z2d(:,:)
467         znam = 'sysn'//'_htc'//zchar
468         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
469         sysn(:,:,jl) = z2d(:,:)
470         znam = 'sxxsn'//'_htc'//zchar
471         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
472         sxxsn(:,:,jl) = z2d(:,:)
473         znam = 'syysn'//'_htc'//zchar
474         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
475         syysn(:,:,jl) = z2d(:,:)
476         znam = 'sxysn'//'_htc'//zchar
477         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
478         sxysn(:,:,jl) = z2d(:,:)
479         znam = 'sxa'//'_htc'//zchar
480         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
481         sxa(:,:,jl) = z2d(:,:)
482         znam = 'sya'//'_htc'//zchar
483         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
484         sya(:,:,jl) = z2d(:,:)
485         znam = 'sxxa'//'_htc'//zchar
486         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
487         sxxa(:,:,jl) = z2d(:,:)
488         znam = 'syya'//'_htc'//zchar
489         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
490         syya(:,:,jl) = z2d(:,:)
491         znam = 'sxya'//'_htc'//zchar
492         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
493         sxya(:,:,jl) = z2d(:,:)
494         znam = 'sxc0'//'_htc'//zchar
495         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
496         sxc0(:,:,jl) = z2d(:,:)
497         znam = 'syc0'//'_htc'//zchar
498         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
499         syc0(:,:,jl) = z2d(:,:)
500         znam = 'sxxc0'//'_htc'//zchar
501         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
502         sxxc0(:,:,jl) = z2d(:,:)
503         znam = 'syyc0'//'_htc'//zchar
504         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
505         syyc0(:,:,jl) = z2d(:,:)
506         znam = 'sxyc0'//'_htc'//zchar
507         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
508         sxyc0(:,:,jl) = z2d(:,:)
509         znam = 'sxsal'//'_htc'//zchar
510         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
511         sxsal(:,:,jl) = z2d(:,:)
512         znam = 'sysal'//'_htc'//zchar
513         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
514         sysal(:,:,jl) = z2d(:,:)
515         znam = 'sxxsal'//'_htc'//zchar
516         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
517         sxxsal(:,:,jl) = z2d(:,:)
518         znam = 'syysal'//'_htc'//zchar
519         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
520         syysal(:,:,jl) = z2d(:,:)
521         znam = 'sxysal'//'_htc'//zchar
522         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
523         sxysal(:,:,jl) = z2d(:,:)
524         znam = 'sxage'//'_htc'//zchar
525         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
526         sxage(:,:,jl) = z2d(:,:)
527         znam = 'syage'//'_htc'//zchar
528         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
529         syage(:,:,jl) = z2d(:,:)
530         znam = 'sxxage'//'_htc'//zchar
531         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
532         sxxage(:,:,jl) = z2d(:,:)
533         znam = 'syyage'//'_htc'//zchar
534         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
535         syyage(:,:,jl) = z2d(:,:)
536         znam = 'sxyage'//'_htc'//zchar
537         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
538         sxyage(:,:,jl)= z2d(:,:)
539      END DO
540
541      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
542      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
543      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
544      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
545      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
546
547      DO jl = 1, jpl 
548         WRITE(zchar,'(I1)') jl
549         DO jk = 1, nlay_i 
550            WRITE(zchar1,'(I1)') jk
551            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
552            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
553            sxe(:,:,jk,jl) = z2d(:,:)
554            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
555            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
556            sye(:,:,jk,jl) = z2d(:,:)
557            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
558            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
559            sxxe(:,:,jk,jl) = z2d(:,:)
560            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
561            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
562            syye(:,:,jk,jl) = z2d(:,:)
563            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
564            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
565            sxye(:,:,jk,jl) = z2d(:,:)
566         END DO
567      END DO
568      !
569      !clem CALL iom_close( numrir )
570      !
571      CALL wrk_dealloc( nlay_i, zs_zero )
572      CALL wrk_dealloc( jpi, jpj, z2d )
573      !
574   END SUBROUTINE lim_rst_read
575
576#else
577   !!----------------------------------------------------------------------
578   !!   Default option :       Empty module            NO LIM sea-ice model
579   !!----------------------------------------------------------------------
580CONTAINS
581   SUBROUTINE lim_rst_read             ! Empty routine
582   END SUBROUTINE lim_rst_read
583   SUBROUTINE lim_rst_write            ! Empty routine
584   END SUBROUTINE lim_rst_write
585#endif
586
587   !!======================================================================
588END MODULE limrst
Note: See TracBrowser for help on using the repository browser.