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

Last change on this file since 7646 was 7646, checked in by timgraham, 7 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

  • Property svn:keywords set to Id
File size: 24.6 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      END DO
150
151      DO jl = 1, jpl 
152         WRITE(zchar,'(I2.2)') jl
153         znam = 'tempt_sl1'//'_htc'//zchar
154         z2d(:,:) = e_s(:,:,1,jl)
155         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
156      END DO
157
158      DO jl = 1, jpl 
159         WRITE(zchar,'(I2.2)') jl
160         DO jk = 1, nlay_i 
161            WRITE(zchar1,'(I2.2)') jk
162            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
163            z2d(:,:) = e_i(:,:,jk,jl)
164            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
165         END DO
166      END DO
167
168      CALL iom_rstput( iter, nitrst, numriw, 'u_ice'        , u_ice      )
169      CALL iom_rstput( iter, nitrst, numriw, 'v_ice'        , v_ice      )
170      CALL iom_rstput( iter, nitrst, numriw, 'stress1_i'    , stress1_i  )
171      CALL iom_rstput( iter, nitrst, numriw, 'stress2_i'    , stress2_i  )
172      CALL iom_rstput( iter, nitrst, numriw, 'stress12_i'   , stress12_i )
173      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass'  , snwice_mass )
174      CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b )
175
176      ! In case Prather scheme is used for advection, write second order moments
177      ! ------------------------------------------------------------------------
178      IF( nn_limadv == -1 ) THEN
179         
180         DO jl = 1, jpl 
181            WRITE(zchar,'(I2.2)') jl
182            znam = 'sxice'//'_htc'//zchar
183            z2d(:,:) = sxice(:,:,jl)
184            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
185            znam = 'syice'//'_htc'//zchar
186            z2d(:,:) = syice(:,:,jl)
187            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
188            znam = 'sxxice'//'_htc'//zchar
189            z2d(:,:) = sxxice(:,:,jl)
190            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
191            znam = 'syyice'//'_htc'//zchar
192            z2d(:,:) = syyice(:,:,jl)
193            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
194            znam = 'sxyice'//'_htc'//zchar
195            z2d(:,:) = sxyice(:,:,jl)
196            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
197            znam = 'sxsn'//'_htc'//zchar
198            z2d(:,:) = sxsn(:,:,jl)
199            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
200            znam = 'sysn'//'_htc'//zchar
201            z2d(:,:) = sysn(:,:,jl)
202            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
203            znam = 'sxxsn'//'_htc'//zchar
204            z2d(:,:) = sxxsn(:,:,jl)
205            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
206            znam = 'syysn'//'_htc'//zchar
207            z2d(:,:) = syysn(:,:,jl)
208            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
209            znam = 'sxysn'//'_htc'//zchar
210            z2d(:,:) = sxysn(:,:,jl)
211            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
212            znam = 'sxa'//'_htc'//zchar
213            z2d(:,:) = sxa(:,:,jl)
214            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
215            znam = 'sya'//'_htc'//zchar
216            z2d(:,:) = sya(:,:,jl)
217            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
218            znam = 'sxxa'//'_htc'//zchar
219            z2d(:,:) = sxxa(:,:,jl)
220            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
221            znam = 'syya'//'_htc'//zchar
222            z2d(:,:) = syya(:,:,jl)
223            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
224            znam = 'sxya'//'_htc'//zchar
225            z2d(:,:) = sxya(:,:,jl)
226            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
227            znam = 'sxc0'//'_htc'//zchar
228            z2d(:,:) = sxc0(:,:,jl)
229            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
230            znam = 'syc0'//'_htc'//zchar
231            z2d(:,:) = syc0(:,:,jl)
232            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
233            znam = 'sxxc0'//'_htc'//zchar
234            z2d(:,:) = sxxc0(:,:,jl)
235            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
236            znam = 'syyc0'//'_htc'//zchar
237            z2d(:,:) = syyc0(:,:,jl)
238            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
239            znam = 'sxyc0'//'_htc'//zchar
240            z2d(:,:) = sxyc0(:,:,jl)
241            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
242            znam = 'sxsal'//'_htc'//zchar
243            z2d(:,:) = sxsal(:,:,jl)
244            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
245            znam = 'sysal'//'_htc'//zchar
246            z2d(:,:) = sysal(:,:,jl)
247            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
248            znam = 'sxxsal'//'_htc'//zchar
249            z2d(:,:) = sxxsal(:,:,jl)
250            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
251            znam = 'syysal'//'_htc'//zchar
252            z2d(:,:) = syysal(:,:,jl)
253            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
254            znam = 'sxysal'//'_htc'//zchar
255            z2d(:,:) = sxysal(:,:,jl)
256            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
257            znam = 'sxage'//'_htc'//zchar
258            z2d(:,:) = sxage(:,:,jl)
259            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
260            znam = 'syage'//'_htc'//zchar
261            z2d(:,:) = syage(:,:,jl)
262            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
263            znam = 'sxxage'//'_htc'//zchar
264            z2d(:,:) = sxxage(:,:,jl)
265            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
266            znam = 'syyage'//'_htc'//zchar
267            z2d(:,:) = syyage(:,:,jl)
268            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
269            znam = 'sxyage'//'_htc'//zchar
270            z2d(:,:) = sxyage(:,:,jl)
271            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
272         END DO
273
274         CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' ,  sxopw  )
275         CALL iom_rstput( iter, nitrst, numriw, 'syopw ' ,  syopw  )
276         CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' ,  sxxopw )
277         CALL iom_rstput( iter, nitrst, numriw, 'syyopw' ,  syyopw )
278         CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' ,  sxyopw )
279         
280         DO jl = 1, jpl 
281            WRITE(zchar,'(I2.2)') jl
282            DO jk = 1, nlay_i 
283               WRITE(zchar1,'(I2.2)') jk
284               znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
285               z2d(:,:) = sxe(:,:,jk,jl)
286               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
287               znam = 'sye'//'_il'//zchar1//'_htc'//zchar
288               z2d(:,:) = sye(:,:,jk,jl)
289               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
290               znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
291               z2d(:,:) = sxxe(:,:,jk,jl)
292               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
293               znam = 'syye'//'_il'//zchar1//'_htc'//zchar
294               z2d(:,:) = syye(:,:,jk,jl)
295               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
296               znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
297               z2d(:,:) = sxye(:,:,jk,jl)
298               CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
299            END DO
300         END DO
301
302      ENDIF
303     
304      ! close restart file
305      ! ------------------
306      IF( iter == nitrst ) THEN
307         CALL iom_close( numriw )
308         lrst_ice = .FALSE.
309      ENDIF
310      !
311      CALL wrk_dealloc( jpi, jpj, z2d )
312      !
313   END SUBROUTINE lim_rst_write
314
315
316   SUBROUTINE lim_rst_read
317      !!----------------------------------------------------------------------
318      !!                    ***  lim_rst_read  ***
319      !!
320      !! ** purpose  :   read of sea-ice variable restart in a netcdf file
321      !!----------------------------------------------------------------------
322      INTEGER :: ji, jj, jk, jl
323      REAL(wp) ::   zfice, ziter
324      REAL(wp), POINTER, DIMENSION(:,:) ::   z2d
325      CHARACTER(len=25) ::   znam
326      CHARACTER(len=2)  ::   zchar, zchar1
327      INTEGER           ::   jlibalt = jprstlib
328      LOGICAL           ::   llok
329      !!----------------------------------------------------------------------
330
331      CALL wrk_alloc( jpi, jpj, z2d )
332
333      IF(lwp) THEN
334         WRITE(numout,*)
335         WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file'
336         WRITE(numout,*) '~~~~~~~~~~~~~'
337      ENDIF
338
339      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib )
340
341      CALL iom_get( numrir, 'nn_fsbc', zfice )
342      CALL iom_get( numrir, 'kt_ice' , ziter )   
343      IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
344      IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
345
346      !Control of date
347
348      IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
349         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart',  &
350         &                   '   verify the file or rerun with the value 0 for the',        &
351         &                   '   control of time parameter  nrstdt' )
352      IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
353         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
354         &                   '   verify the file or rerun with the value 0 for the',         &
355         &                   '   control of time parameter  nrstdt' )
356
357      ! Prognostic variables
358      DO jl = 1, jpl 
359         WRITE(zchar,'(I2.2)') jl
360         znam = 'v_i'//'_htc'//zchar
361         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
362         v_i(:,:,jl) = z2d(:,:)
363         znam = 'v_s'//'_htc'//zchar
364         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
365         v_s(:,:,jl) = z2d(:,:) 
366         znam = 'smv_i'//'_htc'//zchar
367         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
368         smv_i(:,:,jl) = z2d(:,:)
369         znam = 'oa_i'//'_htc'//zchar
370         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
371         oa_i(:,:,jl) = z2d(:,:)
372         znam = 'a_i'//'_htc'//zchar
373         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
374         a_i(:,:,jl) = z2d(:,:)
375         znam = 't_su'//'_htc'//zchar
376         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
377         t_su(:,:,jl) = z2d(:,:)
378      END DO
379
380      DO jl = 1, jpl 
381         WRITE(zchar,'(I2.2)') jl
382         znam = 'tempt_sl1'//'_htc'//zchar
383         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
384         e_s(:,:,1,jl) = z2d(:,:)
385      END DO
386
387      DO jl = 1, jpl 
388         WRITE(zchar,'(I2.2)') jl
389         DO jk = 1, nlay_i 
390            WRITE(zchar1,'(I2.2)') jk
391            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
392            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
393            e_i(:,:,jk,jl) = z2d(:,:)
394         END DO
395      END DO
396
397      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
398      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
399      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
400      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
401      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
402      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass )
403      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b )
404
405      ! In case Prather scheme is used for advection, read second order moments
406      ! ------------------------------------------------------------------------
407      IF( nn_limadv == -1 ) THEN
408
409         DO jl = 1, jpl 
410            WRITE(zchar,'(I2.2)') jl
411            znam = 'sxice'//'_htc'//zchar
412            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
413            sxice(:,:,jl) = z2d(:,:)
414            znam = 'syice'//'_htc'//zchar
415            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
416            syice(:,:,jl) = z2d(:,:)
417            znam = 'sxxice'//'_htc'//zchar
418            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
419            sxxice(:,:,jl) = z2d(:,:)
420            znam = 'syyice'//'_htc'//zchar
421            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
422            syyice(:,:,jl) = z2d(:,:)
423            znam = 'sxyice'//'_htc'//zchar
424            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
425            sxyice(:,:,jl) = z2d(:,:)
426            znam = 'sxsn'//'_htc'//zchar
427            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
428            sxsn(:,:,jl) = z2d(:,:)
429            znam = 'sysn'//'_htc'//zchar
430            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
431            sysn(:,:,jl) = z2d(:,:)
432            znam = 'sxxsn'//'_htc'//zchar
433            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
434            sxxsn(:,:,jl) = z2d(:,:)
435            znam = 'syysn'//'_htc'//zchar
436            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
437            syysn(:,:,jl) = z2d(:,:)
438            znam = 'sxysn'//'_htc'//zchar
439            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
440            sxysn(:,:,jl) = z2d(:,:)
441            znam = 'sxa'//'_htc'//zchar
442            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
443            sxa(:,:,jl) = z2d(:,:)
444            znam = 'sya'//'_htc'//zchar
445            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
446            sya(:,:,jl) = z2d(:,:)
447            znam = 'sxxa'//'_htc'//zchar
448            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
449            sxxa(:,:,jl) = z2d(:,:)
450            znam = 'syya'//'_htc'//zchar
451            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
452            syya(:,:,jl) = z2d(:,:)
453            znam = 'sxya'//'_htc'//zchar
454            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
455            sxya(:,:,jl) = z2d(:,:)
456            znam = 'sxc0'//'_htc'//zchar
457            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
458            sxc0(:,:,jl) = z2d(:,:)
459            znam = 'syc0'//'_htc'//zchar
460            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
461            syc0(:,:,jl) = z2d(:,:)
462            znam = 'sxxc0'//'_htc'//zchar
463            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
464            sxxc0(:,:,jl) = z2d(:,:)
465            znam = 'syyc0'//'_htc'//zchar
466            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
467            syyc0(:,:,jl) = z2d(:,:)
468            znam = 'sxyc0'//'_htc'//zchar
469            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
470            sxyc0(:,:,jl) = z2d(:,:)
471            znam = 'sxsal'//'_htc'//zchar
472            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
473            sxsal(:,:,jl) = z2d(:,:)
474            znam = 'sysal'//'_htc'//zchar
475            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
476            sysal(:,:,jl) = z2d(:,:)
477            znam = 'sxxsal'//'_htc'//zchar
478            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
479            sxxsal(:,:,jl) = z2d(:,:)
480            znam = 'syysal'//'_htc'//zchar
481            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
482            syysal(:,:,jl) = z2d(:,:)
483            znam = 'sxysal'//'_htc'//zchar
484            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
485            sxysal(:,:,jl) = z2d(:,:)
486            znam = 'sxage'//'_htc'//zchar
487            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
488            sxage(:,:,jl) = z2d(:,:)
489            znam = 'syage'//'_htc'//zchar
490            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
491            syage(:,:,jl) = z2d(:,:)
492            znam = 'sxxage'//'_htc'//zchar
493            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
494            sxxage(:,:,jl) = z2d(:,:)
495            znam = 'syyage'//'_htc'//zchar
496            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
497            syyage(:,:,jl) = z2d(:,:)
498            znam = 'sxyage'//'_htc'//zchar
499            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
500            sxyage(:,:,jl)= z2d(:,:)
501         END DO
502
503         CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
504         CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
505         CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
506         CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
507         CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
508
509         DO jl = 1, jpl 
510            WRITE(zchar,'(I2.2)') jl
511            DO jk = 1, nlay_i 
512               WRITE(zchar1,'(I2.2)') jk
513               znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
514               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
515               sxe(:,:,jk,jl) = z2d(:,:)
516               znam = 'sye'//'_il'//zchar1//'_htc'//zchar
517               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
518               sye(:,:,jk,jl) = z2d(:,:)
519               znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
520               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
521               sxxe(:,:,jk,jl) = z2d(:,:)
522               znam = 'syye'//'_il'//zchar1//'_htc'//zchar
523               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
524               syye(:,:,jk,jl) = z2d(:,:)
525               znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
526               CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
527               sxye(:,:,jk,jl) = z2d(:,:)
528            END DO
529         END DO
530         !
531      END IF
532     
533      ! clem: I do not understand why the following IF is needed
534      !       I suspect something inconsistent in the main code with option nn_icesal=1
535      IF( nn_icesal == 1 ) THEN
536         DO jl = 1, jpl 
537            sm_i(:,:,jl) = rn_icesal
538            DO jk = 1, nlay_i 
539               s_i(:,:,jk,jl) = rn_icesal
540            END DO
541         END DO
542      ENDIF
543      !
544      !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90
545      !
546      CALL wrk_dealloc( jpi, jpj, z2d )
547      !
548   END SUBROUTINE lim_rst_read
549
550#else
551   !!----------------------------------------------------------------------
552   !!   Default option :       Empty module            NO LIM sea-ice model
553   !!----------------------------------------------------------------------
554CONTAINS
555   SUBROUTINE lim_rst_read             ! Empty routine
556   END SUBROUTINE lim_rst_read
557   SUBROUTINE lim_rst_write            ! Empty routine
558   END SUBROUTINE lim_rst_write
559#endif
560
561   !!======================================================================
562END MODULE limrst
Note: See TracBrowser for help on using the repository browser.