source: CONFIG/UNIFORM/v6/IPSLCM6/SOURCES/NEMO/limrst.F90 @ 2113

Last change on this file since 2113 was 2113, checked in by omamce, 11 years ago

O.M.

  • Add coupled interface for LIM3
  • Closea : spread Black Sea outflow on several points
  • stpctl : prevent Salinity to be below 0.1 PSS
File size: 24.8 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 3.4 , UCL - NEMO Consortium (2011)
41   !! $Id: limrst.F90 3625 2012-11-21 13:19:18Z acc $
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, '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         tn_ice (:,:,:) = t_su (:,:,:)
372      END DO
373
374      DO jl = 1, jpl 
375         CALL lbc_lnk( smv_i(:,:,jl) , 'T' ,  1. )
376         CALL lbc_lnk( v_i  (:,:,jl) , 'T' ,  1. )
377         CALL lbc_lnk( a_i  (:,:,jl) , 'T' ,  1. )
378      END DO
379
380      ! we first with bulk ice salinity
381      DO jl = 1, jpl
382         DO jj = 1, jpj
383            DO ji = 1, jpi
384               zindb          = MAX( 0.0 , SIGN( 1.0 , v_i(ji,jj,jl) - 1.0e-4 ) ) 
385               sm_i(ji,jj,jl) = smv_i(ji,jj,jl) / MAX(v_i(ji,jj,jl),1.0e-6) * zindb
386               ht_i(ji,jj,jl) = v_i(ji,jj,jl)   / MAX(a_i(ji,jj,jl),1.0e-6) * zindb
387            END DO
388         END DO
389      END DO
390
391      DO jk = 1, nlay_i
392         s_i(:,:,jk,:) = sm_i(:,:,:)
393      END DO
394
395      IF( num_sal == 2 ) THEN      ! Salinity profile
396         DO jl = 1, jpl
397            DO jk = 1, nlay_i
398               DO jj = 1, jpj
399                  DO ji = 1, jpi
400                     zs_inf        = sm_i(ji,jj,jl)
401                     z_slope_s     = 2._wp * sm_i(ji,jj,jl) / MAX( 0.01_wp , ht_i(ji,jj,jl) )
402                     !- slope of the salinity profile
403                     zs_zero(jk)   = z_slope_s * ( REAL(jk,wp) - 0.5_wp ) * ht_i(ji,jj,jl) / REAL(nlay_i,wp)
404                     zsmax = 4.5_wp
405                     zsmin = 3.5_wp
406                     IF(     sm_i(ji,jj,jl) < zsmin ) THEN
407                        zalpha = 1._wp
408                     ELSEIF( sm_i(ji,jj,jl) < zsmax ) THEN
409                        zalpha = sm_i(ji,jj,jl) / ( zsmin - zsmax ) + zsmax / ( zsmax - zsmin )
410                     ELSE
411                        zalpha = 0._wp
412                     ENDIF
413                     s_i(ji,jj,jk,jl) = zalpha * zs_zero(jk) + ( 1._wp - zalpha ) * zs_inf
414                  END DO
415               END DO
416            END DO
417         END DO
418      ENDIF
419
420      DO jl = 1, jpl 
421         WRITE(zchar,'(I1)') jl
422         znam = 'tempt_sl1'//'_htc'//zchar
423         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
424         e_s(:,:,1,jl) = z2d(:,:)
425      END DO
426
427      DO jl = 1, jpl 
428         WRITE(zchar,'(I1)') jl
429         DO jk = 1, nlay_i 
430            WRITE(zchar1,'(I1)') jk
431            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
432            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
433            e_i(:,:,jk,jl) = z2d(:,:)
434         END DO
435      END DO
436
437      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
438      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
439      CALL iom_get( numrir, jpdom_autoglo, 'fsbbq'     , fsbbq      )
440      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
441      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
442      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
443
444      DO jl = 1, jpl 
445         WRITE(zchar,'(I1)') jl
446         znam = 'sxice'//'_htc'//zchar
447         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
448         sxice(:,:,jl) = z2d(:,:)
449         znam = 'syice'//'_htc'//zchar
450         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
451         syice(:,:,jl) = z2d(:,:)
452         znam = 'sxxice'//'_htc'//zchar
453         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
454         sxxice(:,:,jl) = z2d(:,:)
455         znam = 'syyice'//'_htc'//zchar
456         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
457         syyice(:,:,jl) = z2d(:,:)
458         znam = 'sxyice'//'_htc'//zchar
459         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
460         sxyice(:,:,jl) = z2d(:,:)
461         znam = 'sxsn'//'_htc'//zchar
462         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
463         sxsn(:,:,jl) = z2d(:,:)
464         znam = 'sysn'//'_htc'//zchar
465         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
466         sysn(:,:,jl) = z2d(:,:)
467         znam = 'sxxsn'//'_htc'//zchar
468         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
469         sxxsn(:,:,jl) = z2d(:,:)
470         znam = 'syysn'//'_htc'//zchar
471         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
472         syysn(:,:,jl) = z2d(:,:)
473         znam = 'sxysn'//'_htc'//zchar
474         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
475         sxysn(:,:,jl) = z2d(:,:)
476         znam = 'sxa'//'_htc'//zchar
477         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
478         sxa(:,:,jl) = z2d(:,:)
479         znam = 'sya'//'_htc'//zchar
480         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
481         sya(:,:,jl) = z2d(:,:)
482         znam = 'sxxa'//'_htc'//zchar
483         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
484         sxxa(:,:,jl) = z2d(:,:)
485         znam = 'syya'//'_htc'//zchar
486         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
487         syya(:,:,jl) = z2d(:,:)
488         znam = 'sxya'//'_htc'//zchar
489         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
490         sxya(:,:,jl) = z2d(:,:)
491         znam = 'sxc0'//'_htc'//zchar
492         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
493         sxc0(:,:,jl) = z2d(:,:)
494         znam = 'syc0'//'_htc'//zchar
495         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
496         syc0(:,:,jl) = z2d(:,:)
497         znam = 'sxxc0'//'_htc'//zchar
498         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
499         sxxc0(:,:,jl) = z2d(:,:)
500         znam = 'syyc0'//'_htc'//zchar
501         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
502         syyc0(:,:,jl) = z2d(:,:)
503         znam = 'sxyc0'//'_htc'//zchar
504         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
505         sxyc0(:,:,jl) = z2d(:,:)
506         znam = 'sxsal'//'_htc'//zchar
507         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
508         sxsal(:,:,jl) = z2d(:,:)
509         znam = 'sysal'//'_htc'//zchar
510         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
511         sysal(:,:,jl) = z2d(:,:)
512         znam = 'sxxsal'//'_htc'//zchar
513         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
514         sxxsal(:,:,jl) = z2d(:,:)
515         znam = 'syysal'//'_htc'//zchar
516         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
517         syysal(:,:,jl) = z2d(:,:)
518         znam = 'sxysal'//'_htc'//zchar
519         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
520         sxysal(:,:,jl) = z2d(:,:)
521         znam = 'sxage'//'_htc'//zchar
522         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
523         sxage(:,:,jl) = z2d(:,:)
524         znam = 'syage'//'_htc'//zchar
525         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
526         syage(:,:,jl) = z2d(:,:)
527         znam = 'sxxage'//'_htc'//zchar
528         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
529         sxxage(:,:,jl) = z2d(:,:)
530         znam = 'syyage'//'_htc'//zchar
531         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
532         syyage(:,:,jl) = z2d(:,:)
533         znam = 'sxyage'//'_htc'//zchar
534         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
535         sxyage(:,:,jl)= z2d(:,:)
536      END DO
537
538      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
539      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
540      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
541      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
542      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
543
544      DO jl = 1, jpl 
545         WRITE(zchar,'(I1)') jl
546         DO jk = 1, nlay_i 
547            WRITE(zchar1,'(I1)') jk
548            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
549            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
550            sxe(:,:,jk,jl) = z2d(:,:)
551            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
552            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
553            sye(:,:,jk,jl) = z2d(:,:)
554            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
555            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
556            sxxe(:,:,jk,jl) = z2d(:,:)
557            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
558            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
559            syye(:,:,jk,jl) = z2d(:,:)
560            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
561            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
562            sxye(:,:,jk,jl) = z2d(:,:)
563         END DO
564      END DO
565      !
566      CALL iom_close( numrir )
567      !
568      CALL wrk_dealloc( nlay_i, zs_zero )
569      CALL wrk_dealloc( jpi, jpj, z2d )
570      !
571   END SUBROUTINE lim_rst_read
572
573#else
574   !!----------------------------------------------------------------------
575   !!   Default option :       Empty module            NO LIM sea-ice model
576   !!----------------------------------------------------------------------
577CONTAINS
578   SUBROUTINE lim_rst_read             ! Empty routine
579   END SUBROUTINE lim_rst_read
580   SUBROUTINE lim_rst_write            ! Empty routine
581   END SUBROUTINE lim_rst_write
582#endif
583
584   !!======================================================================
585END MODULE limrst
Note: See TracBrowser for help on using the repository browser.