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

source: trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

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