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

source: branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 8733

Last change on this file since 8733 was 8733, checked in by dancopsey, 6 years ago

Remove svn keywords.

File size: 24.3 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      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file
58      !!----------------------------------------------------------------------
59      !
60      IF( kt == nit000 )   lrst_ice = .FALSE.   ! default definition
61
62      ! in order to get better performances with NetCDF format, we open and define the ice restart file
63      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice
64      ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1
65      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    &
66         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN
67         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN
68            ! beware of the format used to write kt (default is i8.8, that should be large enough...)
69            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
70            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
71            ENDIF
72            ! create the file
73            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)
74            clpath = TRIM(cn_icerst_outdir) 
75            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/'
76            IF(lwp) THEN
77               WRITE(numout,*)
78               SELECT CASE ( jprstlib )
79               CASE DEFAULT
80                  WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname
81               END SELECT
82               IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN   
83                  WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp
84               ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp
85               ENDIF
86            ENDIF
87            !
88            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib )
89            lrst_ice = .TRUE.
90         ENDIF
91      ENDIF
92      !
93      IF( ln_limctl )   CALL lim_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' )   ! control print
94   END SUBROUTINE lim_rst_opn
95
96
97   SUBROUTINE lim_rst_write( kt )
98      !!----------------------------------------------------------------------
99      !!                    ***  lim_rst_write  ***
100      !!
101      !! ** purpose  :   output of sea-ice variable in a netcdf file
102      !!----------------------------------------------------------------------
103      INTEGER, INTENT(in) ::   kt     ! number of iteration
104      !!
105      INTEGER ::   ji, jj, jk ,jl   ! dummy loop indices
106      INTEGER ::   iter
107      CHARACTER(len=25) ::   znam
108      CHARACTER(len=2)  ::   zchar, zchar1
109      REAL(wp), POINTER, DIMENSION(:,:) :: z2d
110      !!----------------------------------------------------------------------
111
112      CALL wrk_alloc( jpi, jpj, z2d )
113
114      iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1
115
116      IF( iter == nitrst ) THEN
117         IF(lwp) WRITE(numout,*)
118         IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file  kt =', kt
119         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
120      ENDIF
121
122      ! Write in numriw (if iter == nitrst)
123      ! ------------------
124      !                                                                        ! calendar control
125      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step
126      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
127
128      ! Prognostic variables
129      DO jl = 1, jpl 
130         WRITE(zchar,'(I2.2)') jl
131         znam = 'v_i'//'_htc'//zchar
132         z2d(:,:) = v_i(:,:,jl)
133         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
134         znam = 'v_s'//'_htc'//zchar
135         z2d(:,:) = v_s(:,:,jl)
136         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
137         znam = 'smv_i'//'_htc'//zchar
138         z2d(:,:) = smv_i(:,:,jl)
139         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
140         znam = 'oa_i'//'_htc'//zchar
141         z2d(:,:) = oa_i(:,:,jl)
142         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
143         znam = 'a_i'//'_htc'//zchar
144         z2d(:,:) = a_i(:,:,jl)
145         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
146         znam = 't_su'//'_htc'//zchar
147         z2d(:,:) = t_su(:,:,jl)
148         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
149         znam = 'tempt_sl1'//'_htc'//zchar
150         z2d(:,:) = e_s(:,:,1,jl)
151         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
152         DO jk = 1, nlay_i 
153            WRITE(zchar1,'(I2.2)') 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, 'stress1_i'    , stress1_i  )
163      CALL iom_rstput( iter, nitrst, numriw, 'stress2_i'    , stress2_i  )
164      CALL iom_rstput( iter, nitrst, numriw, 'stress12_i'   , stress12_i )
165      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass'  , snwice_mass )
166      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b )
167
168      ! In case Prather scheme is used for advection, write second order moments
169      ! ------------------------------------------------------------------------
170      IF( nn_limadv == -1 ) THEN
171         
172         DO jl = 1, jpl 
173            WRITE(zchar,'(I2.2)') jl
174            znam = 'sxice'//'_htc'//zchar
175            z2d(:,:) = sxice(:,:,jl)
176            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
177            znam = 'syice'//'_htc'//zchar
178            z2d(:,:) = syice(:,:,jl)
179            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
180            znam = 'sxxice'//'_htc'//zchar
181            z2d(:,:) = sxxice(:,:,jl)
182            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
183            znam = 'syyice'//'_htc'//zchar
184            z2d(:,:) = syyice(:,:,jl)
185            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
186            znam = 'sxyice'//'_htc'//zchar
187            z2d(:,:) = sxyice(:,:,jl)
188            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
189            znam = 'sxsn'//'_htc'//zchar
190            z2d(:,:) = sxsn(:,:,jl)
191            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
192            znam = 'sysn'//'_htc'//zchar
193            z2d(:,:) = sysn(:,:,jl)
194            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
195            znam = 'sxxsn'//'_htc'//zchar
196            z2d(:,:) = sxxsn(:,:,jl)
197            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
198            znam = 'syysn'//'_htc'//zchar
199            z2d(:,:) = syysn(:,:,jl)
200            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
201            znam = 'sxysn'//'_htc'//zchar
202            z2d(:,:) = sxysn(:,:,jl)
203            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
204            znam = 'sxa'//'_htc'//zchar
205            z2d(:,:) = sxa(:,:,jl)
206            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
207            znam = 'sya'//'_htc'//zchar
208            z2d(:,:) = sya(:,:,jl)
209            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
210            znam = 'sxxa'//'_htc'//zchar
211            z2d(:,:) = sxxa(:,:,jl)
212            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
213            znam = 'syya'//'_htc'//zchar
214            z2d(:,:) = syya(:,:,jl)
215            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
216            znam = 'sxya'//'_htc'//zchar
217            z2d(:,:) = sxya(:,:,jl)
218            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
219            znam = 'sxc0'//'_htc'//zchar
220            z2d(:,:) = sxc0(:,:,jl)
221            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
222            znam = 'syc0'//'_htc'//zchar
223            z2d(:,:) = syc0(:,:,jl)
224            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
225            znam = 'sxxc0'//'_htc'//zchar
226            z2d(:,:) = sxxc0(:,:,jl)
227            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
228            znam = 'syyc0'//'_htc'//zchar
229            z2d(:,:) = syyc0(:,:,jl)
230            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
231            znam = 'sxyc0'//'_htc'//zchar
232            z2d(:,:) = sxyc0(:,:,jl)
233            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
234            znam = 'sxsal'//'_htc'//zchar
235            z2d(:,:) = sxsal(:,:,jl)
236            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
237            znam = 'sysal'//'_htc'//zchar
238            z2d(:,:) = sysal(:,:,jl)
239            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
240            znam = 'sxxsal'//'_htc'//zchar
241            z2d(:,:) = sxxsal(:,:,jl)
242            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
243            znam = 'syysal'//'_htc'//zchar
244            z2d(:,:) = syysal(:,:,jl)
245            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
246            znam = 'sxysal'//'_htc'//zchar
247            z2d(:,:) = sxysal(:,:,jl)
248            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
249            znam = 'sxage'//'_htc'//zchar
250            z2d(:,:) = sxage(:,:,jl)
251            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
252            znam = 'syage'//'_htc'//zchar
253            z2d(:,:) = syage(:,:,jl)
254            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
255            znam = 'sxxage'//'_htc'//zchar
256            z2d(:,:) = sxxage(:,:,jl)
257            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
258            znam = 'syyage'//'_htc'//zchar
259            z2d(:,:) = syyage(:,:,jl)
260            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
261            znam = 'sxyage'//'_htc'//zchar
262            z2d(:,:) = sxyage(:,:,jl)
263            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
264         END DO
265
266         CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' ,  sxopw  )
267         CALL iom_rstput( iter, nitrst, numriw, 'syopw ' ,  syopw  )
268         CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' ,  sxxopw )
269         CALL iom_rstput( iter, nitrst, numriw, 'syyopw' ,  syyopw )
270         CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' ,  sxyopw )
271         
272         DO jl = 1, jpl 
273            WRITE(zchar,'(I2.2)') jl
274            DO jk = 1, nlay_i 
275               WRITE(zchar1,'(I2.2)') jk
276               znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
277               z2d(:,:) = sxe(:,:,jk,jl)
278               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
279               znam = 'sye'//'_il'//zchar1//'_htc'//zchar
280               z2d(:,:) = sye(:,:,jk,jl)
281               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
282               znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
283               z2d(:,:) = sxxe(:,:,jk,jl)
284               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
285               znam = 'syye'//'_il'//zchar1//'_htc'//zchar
286               z2d(:,:) = syye(:,:,jk,jl)
287               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
288               znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
289               z2d(:,:) = sxye(:,:,jk,jl)
290               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
291            END DO
292         END DO
293
294      ENDIF
295     
296      ! close restart file
297      ! ------------------
298      IF( iter == nitrst ) THEN
299         CALL iom_close( numriw )
300         lrst_ice = .FALSE.
301      ENDIF
302      !
303      CALL wrk_dealloc( jpi, jpj, z2d )
304      !
305   END SUBROUTINE lim_rst_write
306
307
308   SUBROUTINE lim_rst_read
309      !!----------------------------------------------------------------------
310      !!                    ***  lim_rst_read  ***
311      !!
312      !! ** purpose  :   read of sea-ice variable restart in a netcdf file
313      !!----------------------------------------------------------------------
314      INTEGER :: ji, jj, jk, jl
315      REAL(wp) ::   zfice, ziter
316      REAL(wp), POINTER, DIMENSION(:,:) ::   z2d
317      CHARACTER(len=25) ::   znam
318      CHARACTER(len=2)  ::   zchar, zchar1
319      INTEGER           ::   jlibalt = jprstlib
320      LOGICAL           ::   llok
321      !!----------------------------------------------------------------------
322
323      CALL wrk_alloc( jpi, jpj, z2d )
324
325      IF(lwp) THEN
326         WRITE(numout,*)
327         WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file'
328         WRITE(numout,*) '~~~~~~~~~~~~~'
329      ENDIF
330
331      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib )
332
333      CALL iom_get( numrir, 'nn_fsbc', zfice )
334      CALL iom_get( numrir, 'kt_ice' , ziter )   
335      IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
336      IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
337
338      !Control of date
339
340      IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
341         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart',  &
342         &                   '   verify the file or rerun with the value 0 for the',        &
343         &                   '   control of time parameter  nrstdt' )
344      IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
345         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
346         &                   '   verify the file or rerun with the value 0 for the',         &
347         &                   '   control of time parameter  nrstdt' )
348
349      ! Prognostic variables
350      DO jl = 1, jpl 
351         WRITE(zchar,'(I2.2)') 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         znam = 'tempt_sl1'//'_htc'//zchar
371         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
372         e_s(:,:,1,jl) = z2d(:,:)
373         DO jk = 1, nlay_i 
374            WRITE(zchar1,'(I2.2)') jk
375            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
376            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
377            e_i(:,:,jk,jl) = z2d(:,:)
378         END DO
379      END DO
380
381      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
382      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
383      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
384      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
385      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
386      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass )
387      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b )
388
389      ! In case Prather scheme is used for advection, read second order moments
390      ! ------------------------------------------------------------------------
391      IF( nn_limadv == -1 ) THEN
392
393         DO jl = 1, jpl 
394            WRITE(zchar,'(I2.2)') jl
395            znam = 'sxice'//'_htc'//zchar
396            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
397            sxice(:,:,jl) = z2d(:,:)
398            znam = 'syice'//'_htc'//zchar
399            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
400            syice(:,:,jl) = z2d(:,:)
401            znam = 'sxxice'//'_htc'//zchar
402            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
403            sxxice(:,:,jl) = z2d(:,:)
404            znam = 'syyice'//'_htc'//zchar
405            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
406            syyice(:,:,jl) = z2d(:,:)
407            znam = 'sxyice'//'_htc'//zchar
408            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
409            sxyice(:,:,jl) = z2d(:,:)
410            znam = 'sxsn'//'_htc'//zchar
411            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
412            sxsn(:,:,jl) = z2d(:,:)
413            znam = 'sysn'//'_htc'//zchar
414            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
415            sysn(:,:,jl) = z2d(:,:)
416            znam = 'sxxsn'//'_htc'//zchar
417            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
418            sxxsn(:,:,jl) = z2d(:,:)
419            znam = 'syysn'//'_htc'//zchar
420            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
421            syysn(:,:,jl) = z2d(:,:)
422            znam = 'sxysn'//'_htc'//zchar
423            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
424            sxysn(:,:,jl) = z2d(:,:)
425            znam = 'sxa'//'_htc'//zchar
426            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
427            sxa(:,:,jl) = z2d(:,:)
428            znam = 'sya'//'_htc'//zchar
429            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
430            sya(:,:,jl) = z2d(:,:)
431            znam = 'sxxa'//'_htc'//zchar
432            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
433            sxxa(:,:,jl) = z2d(:,:)
434            znam = 'syya'//'_htc'//zchar
435            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
436            syya(:,:,jl) = z2d(:,:)
437            znam = 'sxya'//'_htc'//zchar
438            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
439            sxya(:,:,jl) = z2d(:,:)
440            znam = 'sxc0'//'_htc'//zchar
441            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
442            sxc0(:,:,jl) = z2d(:,:)
443            znam = 'syc0'//'_htc'//zchar
444            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
445            syc0(:,:,jl) = z2d(:,:)
446            znam = 'sxxc0'//'_htc'//zchar
447            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
448            sxxc0(:,:,jl) = z2d(:,:)
449            znam = 'syyc0'//'_htc'//zchar
450            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
451            syyc0(:,:,jl) = z2d(:,:)
452            znam = 'sxyc0'//'_htc'//zchar
453            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
454            sxyc0(:,:,jl) = z2d(:,:)
455            znam = 'sxsal'//'_htc'//zchar
456            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
457            sxsal(:,:,jl) = z2d(:,:)
458            znam = 'sysal'//'_htc'//zchar
459            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
460            sysal(:,:,jl) = z2d(:,:)
461            znam = 'sxxsal'//'_htc'//zchar
462            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
463            sxxsal(:,:,jl) = z2d(:,:)
464            znam = 'syysal'//'_htc'//zchar
465            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
466            syysal(:,:,jl) = z2d(:,:)
467            znam = 'sxysal'//'_htc'//zchar
468            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
469            sxysal(:,:,jl) = z2d(:,:)
470            znam = 'sxage'//'_htc'//zchar
471            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
472            sxage(:,:,jl) = z2d(:,:)
473            znam = 'syage'//'_htc'//zchar
474            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
475            syage(:,:,jl) = z2d(:,:)
476            znam = 'sxxage'//'_htc'//zchar
477            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
478            sxxage(:,:,jl) = z2d(:,:)
479            znam = 'syyage'//'_htc'//zchar
480            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
481            syyage(:,:,jl) = z2d(:,:)
482            znam = 'sxyage'//'_htc'//zchar
483            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
484            sxyage(:,:,jl)= z2d(:,:)
485         END DO
486
487         CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
488         CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
489         CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
490         CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
491         CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
492
493         DO jl = 1, jpl 
494            WRITE(zchar,'(I2.2)') jl
495            DO jk = 1, nlay_i 
496               WRITE(zchar1,'(I2.2)') jk
497               znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
498               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
499               sxe(:,:,jk,jl) = z2d(:,:)
500               znam = 'sye'//'_il'//zchar1//'_htc'//zchar
501               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
502               sye(:,:,jk,jl) = z2d(:,:)
503               znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
504               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
505               sxxe(:,:,jk,jl) = z2d(:,:)
506               znam = 'syye'//'_il'//zchar1//'_htc'//zchar
507               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
508               syye(:,:,jk,jl) = z2d(:,:)
509               znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
510               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
511               sxye(:,:,jk,jl) = z2d(:,:)
512            END DO
513         END DO
514         !
515      END IF
516     
517      ! clem: I do not understand why the following IF is needed
518      !       I suspect something inconsistent in the main code with option nn_icesal=1
519      IF( nn_icesal == 1 ) THEN
520         DO jl = 1, jpl 
521            sm_i(:,:,jl) = rn_icesal
522            DO jk = 1, nlay_i 
523               s_i(:,:,jk,jl) = rn_icesal
524            END DO
525         END DO
526      ENDIF
527      !
528      !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90
529      !
530      CALL wrk_dealloc( jpi, jpj, z2d )
531      !
532   END SUBROUTINE lim_rst_read
533
534#else
535   !!----------------------------------------------------------------------
536   !!   Default option :       Empty module            NO LIM sea-ice model
537   !!----------------------------------------------------------------------
538CONTAINS
539   SUBROUTINE lim_rst_read             ! Empty routine
540   END SUBROUTINE lim_rst_read
541   SUBROUTINE lim_rst_write            ! Empty routine
542   END SUBROUTINE lim_rst_write
543#endif
544
545   !!======================================================================
546END MODULE limrst
Note: See TracBrowser for help on using the repository browser.