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 @ 5123

Last change on this file since 5123 was 5123, checked in by clem, 9 years ago

major LIM3 cleaning + monocat capabilities + NEMO namelist-consistency; sette to follow

  • Property svn:keywords set to Id
File size: 23.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 oce     , ONLY :  snwice_mass, snwice_mass_b
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   USE limctl
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 sbc_lim_init
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      IF( ln_nicep )   CALL lim_prt( kt, jiindx, jjindx, 1, ' - Beginning the time step - ' )   ! control print
89   END SUBROUTINE lim_rst_opn
90
91
92   SUBROUTINE lim_rst_write( kt )
93      !!----------------------------------------------------------------------
94      !!                    ***  lim_rst_write  ***
95      !!
96      !! ** purpose  :   output of sea-ice variable in a netcdf file
97      !!----------------------------------------------------------------------
98      INTEGER, INTENT(in) ::   kt     ! number of iteration
99      !!
100      INTEGER ::   ji, jj, jk ,jl   ! dummy loop indices
101      INTEGER ::   iter
102      CHARACTER(len=15) ::   znam
103      CHARACTER(len=1)  ::   zchar, zchar1
104      REAL(wp), POINTER, DIMENSION(:,:) :: z2d
105      !!----------------------------------------------------------------------
106
107      CALL wrk_alloc( jpi, jpj, z2d )
108
109      iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1
110
111      IF( iter == nitrst ) THEN
112         IF(lwp) WRITE(numout,*)
113         IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file  kt =', kt
114         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
115      ENDIF
116
117      ! Write in numriw (if iter == nitrst)
118      ! ------------------
119      !                                                                        ! calendar control
120      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step
121      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
122
123      ! Prognostic variables
124      DO jl = 1, jpl 
125         WRITE(zchar,'(I1)') jl
126         znam = 'v_i'//'_htc'//zchar
127         z2d(:,:) = v_i(:,:,jl)
128         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
129         znam = 'v_s'//'_htc'//zchar
130         z2d(:,:) = v_s(:,:,jl)
131         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
132         znam = 'smv_i'//'_htc'//zchar
133         z2d(:,:) = smv_i(:,:,jl)
134         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
135         znam = 'oa_i'//'_htc'//zchar
136         z2d(:,:) = oa_i(:,:,jl)
137         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
138         znam = 'a_i'//'_htc'//zchar
139         z2d(:,:) = a_i(:,:,jl)
140         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
141         znam = 't_su'//'_htc'//zchar
142         z2d(:,:) = t_su(:,:,jl)
143         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
144      END DO
145     
146      DO jl = 1, jpl 
147         WRITE(zchar,'(I1)') jl
148         znam = 'tempt_sl1'//'_htc'//zchar
149         z2d(:,:) = e_s(:,:,1,jl)
150         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
151      END DO
152
153      DO jl = 1, jpl 
154         WRITE(zchar,'(I1)') jl
155         DO jk = 1, nlay_i 
156            WRITE(zchar1,'(I1)') jk
157            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
158            z2d(:,:) = e_i(:,:,jk,jl)
159            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
160         END DO
161      END DO
162
163      CALL iom_rstput( iter, nitrst, numriw, 'u_ice'        , u_ice      )
164      CALL iom_rstput( iter, nitrst, numriw, 'v_ice'        , v_ice      )
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 )
169      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b )
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   ! 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, 'stress1_i' , stress1_i  )
396      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
397      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
398      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass )
399      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b )
400
401      DO jl = 1, jpl 
402         WRITE(zchar,'(I1)') jl
403         znam = 'sxice'//'_htc'//zchar
404         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
405         sxice(:,:,jl) = z2d(:,:)
406         znam = 'syice'//'_htc'//zchar
407         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
408         syice(:,:,jl) = z2d(:,:)
409         znam = 'sxxice'//'_htc'//zchar
410         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
411         sxxice(:,:,jl) = z2d(:,:)
412         znam = 'syyice'//'_htc'//zchar
413         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
414         syyice(:,:,jl) = z2d(:,:)
415         znam = 'sxyice'//'_htc'//zchar
416         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
417         sxyice(:,:,jl) = z2d(:,:)
418         znam = 'sxsn'//'_htc'//zchar
419         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
420         sxsn(:,:,jl) = z2d(:,:)
421         znam = 'sysn'//'_htc'//zchar
422         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
423         sysn(:,:,jl) = z2d(:,:)
424         znam = 'sxxsn'//'_htc'//zchar
425         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
426         sxxsn(:,:,jl) = z2d(:,:)
427         znam = 'syysn'//'_htc'//zchar
428         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
429         syysn(:,:,jl) = z2d(:,:)
430         znam = 'sxysn'//'_htc'//zchar
431         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
432         sxysn(:,:,jl) = z2d(:,:)
433         znam = 'sxa'//'_htc'//zchar
434         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
435         sxa(:,:,jl) = z2d(:,:)
436         znam = 'sya'//'_htc'//zchar
437         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
438         sya(:,:,jl) = z2d(:,:)
439         znam = 'sxxa'//'_htc'//zchar
440         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
441         sxxa(:,:,jl) = z2d(:,:)
442         znam = 'syya'//'_htc'//zchar
443         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
444         syya(:,:,jl) = z2d(:,:)
445         znam = 'sxya'//'_htc'//zchar
446         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
447         sxya(:,:,jl) = z2d(:,:)
448         znam = 'sxc0'//'_htc'//zchar
449         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
450         sxc0(:,:,jl) = z2d(:,:)
451         znam = 'syc0'//'_htc'//zchar
452         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
453         syc0(:,:,jl) = z2d(:,:)
454         znam = 'sxxc0'//'_htc'//zchar
455         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
456         sxxc0(:,:,jl) = z2d(:,:)
457         znam = 'syyc0'//'_htc'//zchar
458         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
459         syyc0(:,:,jl) = z2d(:,:)
460         znam = 'sxyc0'//'_htc'//zchar
461         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
462         sxyc0(:,:,jl) = z2d(:,:)
463         znam = 'sxsal'//'_htc'//zchar
464         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
465         sxsal(:,:,jl) = z2d(:,:)
466         znam = 'sysal'//'_htc'//zchar
467         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
468         sysal(:,:,jl) = z2d(:,:)
469         znam = 'sxxsal'//'_htc'//zchar
470         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
471         sxxsal(:,:,jl) = z2d(:,:)
472         znam = 'syysal'//'_htc'//zchar
473         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
474         syysal(:,:,jl) = z2d(:,:)
475         znam = 'sxysal'//'_htc'//zchar
476         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
477         sxysal(:,:,jl) = z2d(:,:)
478         znam = 'sxage'//'_htc'//zchar
479         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
480         sxage(:,:,jl) = z2d(:,:)
481         znam = 'syage'//'_htc'//zchar
482         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
483         syage(:,:,jl) = z2d(:,:)
484         znam = 'sxxage'//'_htc'//zchar
485         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
486         sxxage(:,:,jl) = z2d(:,:)
487         znam = 'syyage'//'_htc'//zchar
488         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
489         syyage(:,:,jl) = z2d(:,:)
490         znam = 'sxyage'//'_htc'//zchar
491         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
492         sxyage(:,:,jl)= z2d(:,:)
493      END DO
494
495      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
496      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
497      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
498      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
499      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
500
501      DO jl = 1, jpl 
502         WRITE(zchar,'(I1)') jl
503         DO jk = 1, nlay_i 
504            WRITE(zchar1,'(I1)') jk
505            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
506            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
507            sxe(:,:,jk,jl) = z2d(:,:)
508            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
509            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
510            sye(:,:,jk,jl) = z2d(:,:)
511            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
512            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
513            sxxe(:,:,jk,jl) = z2d(:,:)
514            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
515            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
516            syye(:,:,jk,jl) = z2d(:,:)
517            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
518            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
519            sxye(:,:,jk,jl) = z2d(:,:)
520         END DO
521      END DO
522      !
523      ! clem: I do not understand why the following IF is needed
524      !       I suspect something inconsistent in the main code with option nn_icesal=1
525      IF( nn_icesal == 1 ) THEN
526         DO jl = 1, jpl 
527            sm_i(:,:,jl) = rn_icesal
528            DO jk = 1, nlay_i 
529               s_i(:,:,jk,jl) = rn_icesal
530            END DO
531         END DO
532      ENDIF
533      !
534      !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90
535      !
536      CALL wrk_dealloc( nlay_i, zs_zero )
537      CALL wrk_dealloc( jpi, jpj, z2d )
538      !
539   END SUBROUTINE lim_rst_read
540
541#else
542   !!----------------------------------------------------------------------
543   !!   Default option :       Empty module            NO LIM sea-ice model
544   !!----------------------------------------------------------------------
545CONTAINS
546   SUBROUTINE lim_rst_read             ! Empty routine
547   END SUBROUTINE lim_rst_read
548   SUBROUTINE lim_rst_write            ! Empty routine
549   END SUBROUTINE lim_rst_write
550#endif
551
552   !!======================================================================
553END MODULE limrst
Note: See TracBrowser for help on using the repository browser.