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

source: NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

Last change on this file was 10765, checked in by jcastill, 5 years ago

First set of changes

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