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

source: branches/UKMO/dev_r5107_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 5493

Last change on this file since 5493 was 5493, checked in by dancopsey, 9 years ago

Removed SVN keywords.

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 par_ice        ! sea-ice parameters
21   USE dom_oce        ! ocean domain
22   USE sbc_oce        ! Surface boundary condition: ocean fields
23   USE sbc_ice        ! Surface boundary condition: ice fields
24   USE in_out_manager ! I/O manager
25   USE iom            ! I/O library
26   USE lib_mpp        ! MPP library
27   USE wrk_nemo       ! work arrays
28   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC   lim_rst_opn    ! routine called by icestep.F90
34   PUBLIC   lim_rst_write  ! routine called by icestep.F90
35   PUBLIC   lim_rst_read   ! routine called by iceini.F90
36
37   LOGICAL, PUBLIC ::   lrst_ice         !: logical to control the ice restart write
38   INTEGER, PUBLIC ::   numrir, numriw   !: logical unit for ice restart (read and write)
39
40   !!----------------------------------------------------------------------
41   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
42   !! $Id$
43   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
44   !!----------------------------------------------------------------------
45CONTAINS
46
47   SUBROUTINE lim_rst_opn( kt )
48      !!----------------------------------------------------------------------
49      !!                    ***  lim_rst_opn  ***
50      !!
51      !! ** purpose  :   output of sea-ice variable in a netcdf file
52      !!----------------------------------------------------------------------
53      INTEGER, INTENT(in) ::   kt       ! number of iteration
54      !
55      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character
56      CHARACTER(LEN=50)   ::   clname   ! ice output restart file name
57      !!----------------------------------------------------------------------
58      !
59      IF( kt == nit000 )   lrst_ice = .FALSE.   ! default definition
60
61      ! in order to get better performances with NetCDF format, we open and define the ice restart file
62      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice
63      ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1
64      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    &
65         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN
66         ! beware of the format used to write kt (default is i8.8, that should be large enough...)
67         IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
68         ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
69         ENDIF
70         ! create the file
71         clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)
72         IF(lwp) THEN
73            WRITE(numout,*)
74            SELECT CASE ( jprstlib )
75            CASE ( jprstdimg )   ;   WRITE(numout,*) '             open ice restart binary file: '//clname
76            CASE DEFAULT         ;   WRITE(numout,*) '             open ice restart NetCDF file: '//clname
77            END SELECT
78            IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN   
79               WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp
80            ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp
81            ENDIF
82         ENDIF
83         !
84         CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib )
85         lrst_ice = .TRUE.
86      ENDIF
87      !
88   END SUBROUTINE lim_rst_opn
89
90
91   SUBROUTINE lim_rst_write( kt )
92      !!----------------------------------------------------------------------
93      !!                    ***  lim_rst_write  ***
94      !!
95      !! ** purpose  :   output of sea-ice variable in a netcdf file
96      !!----------------------------------------------------------------------
97      INTEGER, INTENT(in) ::   kt     ! number of iteration
98      !!
99      INTEGER ::   ji, jj, jk ,jl   ! dummy loop indices
100      INTEGER ::   iter
101      CHARACTER(len=15) ::   znam
102      CHARACTER(len=1)  ::   zchar, zchar1
103      REAL(wp), POINTER, DIMENSION(:,:) :: z2d
104      !!----------------------------------------------------------------------
105
106      CALL wrk_alloc( jpi, jpj, z2d )
107
108      iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1
109
110      IF( iter == nitrst ) THEN
111         IF(lwp) WRITE(numout,*)
112         IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file  kt =', kt
113         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
114      ENDIF
115
116      ! Write in numriw (if iter == nitrst)
117      ! ------------------
118      !                                                                        ! calendar control
119      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step
120      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
121
122      ! Prognostic variables
123      DO jl = 1, jpl 
124         WRITE(zchar,'(I1)') jl
125         znam = 'v_i'//'_htc'//zchar
126         z2d(:,:) = v_i(:,:,jl)
127         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
128         znam = 'v_s'//'_htc'//zchar
129         z2d(:,:) = v_s(:,:,jl)
130         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
131         znam = 'smv_i'//'_htc'//zchar
132         z2d(:,:) = smv_i(:,:,jl)
133         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
134         znam = 'oa_i'//'_htc'//zchar
135         z2d(:,:) = oa_i(:,:,jl)
136         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
137         znam = 'a_i'//'_htc'//zchar
138         z2d(:,:) = a_i(:,:,jl)
139         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
140         znam = 't_su'//'_htc'//zchar
141         z2d(:,:) = t_su(:,:,jl)
142         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
143      END DO
144     
145      DO jl = 1, jpl 
146         WRITE(zchar,'(I1)') jl
147         znam = 'tempt_sl1'//'_htc'//zchar
148         z2d(:,:) = e_s(:,:,1,jl)
149         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
150      END DO
151
152      DO jl = 1, jpl 
153         WRITE(zchar,'(I1)') jl
154         DO jk = 1, nlay_i 
155            WRITE(zchar1,'(I1)') jk
156            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
157            z2d(:,:) = e_i(:,:,jk,jl)
158            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
159         END DO
160      END DO
161
162      CALL iom_rstput( iter, nitrst, numriw, 'u_ice'        , u_ice      )
163      CALL iom_rstput( iter, nitrst, numriw, 'v_ice'        , v_ice      )
164      CALL iom_rstput( iter, nitrst, numriw, '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      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass'  , snwice_mass )   !clem modif
168      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) !clem modif
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   ! 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         WRITE(zchar,'(I1)') jl
377         znam = 'tempt_sl1'//'_htc'//zchar
378         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
379         e_s(:,:,1,jl) = z2d(:,:)
380      END DO
381
382      DO jl = 1, jpl 
383         WRITE(zchar,'(I1)') jl
384         DO jk = 1, nlay_i 
385            WRITE(zchar1,'(I1)') jk
386            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
387            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
388            e_i(:,:,jk,jl) = z2d(:,:)
389         END DO
390      END DO
391
392      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
393      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
394      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
395      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
396      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
397      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass )   !clem modif
398      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) !clem modif
399
400      DO jl = 1, jpl 
401         WRITE(zchar,'(I1)') jl
402         znam = 'sxice'//'_htc'//zchar
403         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
404         sxice(:,:,jl) = z2d(:,:)
405         znam = 'syice'//'_htc'//zchar
406         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
407         syice(:,:,jl) = z2d(:,:)
408         znam = 'sxxice'//'_htc'//zchar
409         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
410         sxxice(:,:,jl) = z2d(:,:)
411         znam = 'syyice'//'_htc'//zchar
412         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
413         syyice(:,:,jl) = z2d(:,:)
414         znam = 'sxyice'//'_htc'//zchar
415         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
416         sxyice(:,:,jl) = z2d(:,:)
417         znam = 'sxsn'//'_htc'//zchar
418         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
419         sxsn(:,:,jl) = z2d(:,:)
420         znam = 'sysn'//'_htc'//zchar
421         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
422         sysn(:,:,jl) = z2d(:,:)
423         znam = 'sxxsn'//'_htc'//zchar
424         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
425         sxxsn(:,:,jl) = z2d(:,:)
426         znam = 'syysn'//'_htc'//zchar
427         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
428         syysn(:,:,jl) = z2d(:,:)
429         znam = 'sxysn'//'_htc'//zchar
430         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
431         sxysn(:,:,jl) = z2d(:,:)
432         znam = 'sxa'//'_htc'//zchar
433         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
434         sxa(:,:,jl) = z2d(:,:)
435         znam = 'sya'//'_htc'//zchar
436         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
437         sya(:,:,jl) = z2d(:,:)
438         znam = 'sxxa'//'_htc'//zchar
439         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
440         sxxa(:,:,jl) = z2d(:,:)
441         znam = 'syya'//'_htc'//zchar
442         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
443         syya(:,:,jl) = z2d(:,:)
444         znam = 'sxya'//'_htc'//zchar
445         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
446         sxya(:,:,jl) = z2d(:,:)
447         znam = 'sxc0'//'_htc'//zchar
448         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
449         sxc0(:,:,jl) = z2d(:,:)
450         znam = 'syc0'//'_htc'//zchar
451         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
452         syc0(:,:,jl) = z2d(:,:)
453         znam = 'sxxc0'//'_htc'//zchar
454         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
455         sxxc0(:,:,jl) = z2d(:,:)
456         znam = 'syyc0'//'_htc'//zchar
457         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
458         syyc0(:,:,jl) = z2d(:,:)
459         znam = 'sxyc0'//'_htc'//zchar
460         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
461         sxyc0(:,:,jl) = z2d(:,:)
462         znam = 'sxsal'//'_htc'//zchar
463         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
464         sxsal(:,:,jl) = z2d(:,:)
465         znam = 'sysal'//'_htc'//zchar
466         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
467         sysal(:,:,jl) = z2d(:,:)
468         znam = 'sxxsal'//'_htc'//zchar
469         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
470         sxxsal(:,:,jl) = z2d(:,:)
471         znam = 'syysal'//'_htc'//zchar
472         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
473         syysal(:,:,jl) = z2d(:,:)
474         znam = 'sxysal'//'_htc'//zchar
475         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
476         sxysal(:,:,jl) = z2d(:,:)
477         znam = 'sxage'//'_htc'//zchar
478         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
479         sxage(:,:,jl) = z2d(:,:)
480         znam = 'syage'//'_htc'//zchar
481         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
482         syage(:,:,jl) = z2d(:,:)
483         znam = 'sxxage'//'_htc'//zchar
484         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
485         sxxage(:,:,jl) = z2d(:,:)
486         znam = 'syyage'//'_htc'//zchar
487         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
488         syyage(:,:,jl) = z2d(:,:)
489         znam = 'sxyage'//'_htc'//zchar
490         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
491         sxyage(:,:,jl)= z2d(:,:)
492      END DO
493
494      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
495      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
496      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
497      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
498      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
499
500      DO jl = 1, jpl 
501         WRITE(zchar,'(I1)') jl
502         DO jk = 1, nlay_i 
503            WRITE(zchar1,'(I1)') jk
504            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
505            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
506            sxe(:,:,jk,jl) = z2d(:,:)
507            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
508            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
509            sye(:,:,jk,jl) = z2d(:,:)
510            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
511            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
512            sxxe(:,:,jk,jl) = z2d(:,:)
513            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
514            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
515            syye(:,:,jk,jl) = z2d(:,:)
516            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
517            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
518            sxye(:,:,jk,jl) = z2d(:,:)
519         END DO
520      END DO
521      !
522      ! clem: I do not understand why the following IF is needed
523      !       I suspect something inconsistent in the main code with option num_sal=1
524      IF( num_sal == 1 ) THEN
525         DO jl = 1, jpl 
526            sm_i(:,:,jl) = bulk_sal
527            DO jk = 1, nlay_i 
528               s_i(:,:,jk,jl) = bulk_sal
529            END DO
530         END DO
531      ENDIF
532      !
533      !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90
534      !
535      CALL wrk_dealloc( nlay_i, zs_zero )
536      CALL wrk_dealloc( jpi, jpj, z2d )
537      !
538   END SUBROUTINE lim_rst_read
539
540#else
541   !!----------------------------------------------------------------------
542   !!   Default option :       Empty module            NO LIM sea-ice model
543   !!----------------------------------------------------------------------
544CONTAINS
545   SUBROUTINE lim_rst_read             ! Empty routine
546   END SUBROUTINE lim_rst_read
547   SUBROUTINE lim_rst_write            ! Empty routine
548   END SUBROUTINE lim_rst_write
549#endif
550
551   !!======================================================================
552END MODULE limrst
Note: See TracBrowser for help on using the repository browser.