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

Last change on this file since 6140 was 6140, checked in by timgraham, 8 years ago

Merge of branches/2015/dev_merge_2015 back into trunk. Merge excludes NEMOGCM/TOOLS/OBSTOOLS/ for now due to issues with the change of file type. Will sort these manually with further commits.

Branch merged as follows:
In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
Small conflicts due to bug fixes applied to trunk since the dev_merge_2015 was copied. Bug fixes were applied to the branch as well so these were easy to resolve.
Branch committed at this stage

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2015/dev_merge_2015
to merge the branch into the trunk and then commit - no conflicts at this stage.

  • Property svn:keywords set to Id
File size: 23.4 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_icectl )   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=15) ::   znam
108      CHARACTER(len=1)  ::   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,'(I1)') 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,'(I1)') 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,'(I1)') jl
160         DO jk = 1, nlay_i 
161            WRITE(zchar1,'(I1)') 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      DO jl = 1, jpl 
177         WRITE(zchar,'(I1)') jl
178         znam = 'sxice'//'_htc'//zchar
179         z2d(:,:) = sxice(:,:,jl)
180         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
181         znam = 'syice'//'_htc'//zchar
182         z2d(:,:) = syice(:,:,jl)
183         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
184         znam = 'sxxice'//'_htc'//zchar
185         z2d(:,:) = sxxice(:,:,jl)
186         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
187         znam = 'syyice'//'_htc'//zchar
188         z2d(:,:) = syyice(:,:,jl)
189         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
190         znam = 'sxyice'//'_htc'//zchar
191         z2d(:,:) = sxyice(:,:,jl)
192         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
193         znam = 'sxsn'//'_htc'//zchar
194         z2d(:,:) = sxsn(:,:,jl)
195         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
196         znam = 'sysn'//'_htc'//zchar
197         z2d(:,:) = sysn(:,:,jl)
198         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
199         znam = 'sxxsn'//'_htc'//zchar
200         z2d(:,:) = sxxsn(:,:,jl)
201         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
202         znam = 'syysn'//'_htc'//zchar
203         z2d(:,:) = syysn(:,:,jl)
204         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
205         znam = 'sxysn'//'_htc'//zchar
206         z2d(:,:) = sxysn(:,:,jl)
207         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
208         znam = 'sxa'//'_htc'//zchar
209         z2d(:,:) = sxa(:,:,jl)
210         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
211         znam = 'sya'//'_htc'//zchar
212         z2d(:,:) = sya(:,:,jl)
213         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
214         znam = 'sxxa'//'_htc'//zchar
215         z2d(:,:) = sxxa(:,:,jl)
216         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
217         znam = 'syya'//'_htc'//zchar
218         z2d(:,:) = syya(:,:,jl)
219         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
220         znam = 'sxya'//'_htc'//zchar
221         z2d(:,:) = sxya(:,:,jl)
222         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
223         znam = 'sxc0'//'_htc'//zchar
224         z2d(:,:) = sxc0(:,:,jl)
225         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
226         znam = 'syc0'//'_htc'//zchar
227         z2d(:,:) = syc0(:,:,jl)
228         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
229         znam = 'sxxc0'//'_htc'//zchar
230         z2d(:,:) = sxxc0(:,:,jl)
231         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
232         znam = 'syyc0'//'_htc'//zchar
233         z2d(:,:) = syyc0(:,:,jl)
234         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
235         znam = 'sxyc0'//'_htc'//zchar
236         z2d(:,:) = sxyc0(:,:,jl)
237         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
238         znam = 'sxsal'//'_htc'//zchar
239         z2d(:,:) = sxsal(:,:,jl)
240         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
241         znam = 'sysal'//'_htc'//zchar
242         z2d(:,:) = sysal(:,:,jl)
243         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
244         znam = 'sxxsal'//'_htc'//zchar
245         z2d(:,:) = sxxsal(:,:,jl)
246         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
247         znam = 'syysal'//'_htc'//zchar
248         z2d(:,:) = syysal(:,:,jl)
249         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
250         znam = 'sxysal'//'_htc'//zchar
251         z2d(:,:) = sxysal(:,:,jl)
252         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
253         znam = 'sxage'//'_htc'//zchar
254         z2d(:,:) = sxage(:,:,jl)
255         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
256         znam = 'syage'//'_htc'//zchar
257         z2d(:,:) = syage(:,:,jl)
258         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
259         znam = 'sxxage'//'_htc'//zchar
260         z2d(:,:) = sxxage(:,:,jl)
261         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
262         znam = 'syyage'//'_htc'//zchar
263         z2d(:,:) = syyage(:,:,jl)
264         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
265         znam = 'sxyage'//'_htc'//zchar
266         z2d(:,:) = sxyage(:,:,jl)
267         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
268      END DO
269
270      CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' ,  sxopw  )
271      CALL iom_rstput( iter, nitrst, numriw, 'syopw ' ,  syopw  )
272      CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' ,  sxxopw )
273      CALL iom_rstput( iter, nitrst, numriw, 'syyopw' ,  syyopw )
274      CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' ,  sxyopw )
275
276      DO jl = 1, jpl 
277         WRITE(zchar,'(I1)') jl
278         DO jk = 1, nlay_i 
279            WRITE(zchar1,'(I1)') jk
280            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
281            z2d(:,:) = sxe(:,:,jk,jl)
282            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
283            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
284            z2d(:,:) = sye(:,:,jk,jl)
285            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
286            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
287            z2d(:,:) = sxxe(:,:,jk,jl)
288            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
289            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
290            z2d(:,:) = syye(:,:,jk,jl)
291            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
292            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
293            z2d(:,:) = sxye(:,:,jk,jl)
294            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
295         END DO
296      END DO
297
298      IF( iter == nitrst ) THEN
299         CALL iom_close( numriw )                         ! close the restart file
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=15) ::   znam
318      CHARACTER(len=1)  ::   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      DO jl = 1, jpl 
350         WRITE(zchar,'(I1)') jl
351         znam = 'v_i'//'_htc'//zchar
352         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
353         v_i(:,:,jl) = z2d(:,:)
354         znam = 'v_s'//'_htc'//zchar
355         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
356         v_s(:,:,jl) = z2d(:,:) 
357         znam = 'smv_i'//'_htc'//zchar
358         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
359         smv_i(:,:,jl) = z2d(:,:)
360         znam = 'oa_i'//'_htc'//zchar
361         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
362         oa_i(:,:,jl) = z2d(:,:)
363         znam = 'a_i'//'_htc'//zchar
364         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
365         a_i(:,:,jl) = z2d(:,:)
366         znam = 't_su'//'_htc'//zchar
367         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
368         t_su(:,:,jl) = z2d(:,:)
369      END DO
370
371      DO jl = 1, jpl 
372         WRITE(zchar,'(I1)') jl
373         znam = 'tempt_sl1'//'_htc'//zchar
374         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
375         e_s(:,:,1,jl) = z2d(:,:)
376      END DO
377
378      DO jl = 1, jpl 
379         WRITE(zchar,'(I1)') jl
380         DO jk = 1, nlay_i 
381            WRITE(zchar1,'(I1)') jk
382            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
383            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
384            e_i(:,:,jk,jl) = z2d(:,:)
385         END DO
386      END DO
387
388      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
389      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
390      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
391      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
392      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
393      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass )
394      CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b )
395
396      DO jl = 1, jpl 
397         WRITE(zchar,'(I1)') jl
398         znam = 'sxice'//'_htc'//zchar
399         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
400         sxice(:,:,jl) = z2d(:,:)
401         znam = 'syice'//'_htc'//zchar
402         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
403         syice(:,:,jl) = z2d(:,:)
404         znam = 'sxxice'//'_htc'//zchar
405         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
406         sxxice(:,:,jl) = z2d(:,:)
407         znam = 'syyice'//'_htc'//zchar
408         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
409         syyice(:,:,jl) = z2d(:,:)
410         znam = 'sxyice'//'_htc'//zchar
411         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
412         sxyice(:,:,jl) = z2d(:,:)
413         znam = 'sxsn'//'_htc'//zchar
414         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
415         sxsn(:,:,jl) = z2d(:,:)
416         znam = 'sysn'//'_htc'//zchar
417         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
418         sysn(:,:,jl) = z2d(:,:)
419         znam = 'sxxsn'//'_htc'//zchar
420         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
421         sxxsn(:,:,jl) = z2d(:,:)
422         znam = 'syysn'//'_htc'//zchar
423         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
424         syysn(:,:,jl) = z2d(:,:)
425         znam = 'sxysn'//'_htc'//zchar
426         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
427         sxysn(:,:,jl) = z2d(:,:)
428         znam = 'sxa'//'_htc'//zchar
429         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
430         sxa(:,:,jl) = z2d(:,:)
431         znam = 'sya'//'_htc'//zchar
432         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
433         sya(:,:,jl) = z2d(:,:)
434         znam = 'sxxa'//'_htc'//zchar
435         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
436         sxxa(:,:,jl) = z2d(:,:)
437         znam = 'syya'//'_htc'//zchar
438         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
439         syya(:,:,jl) = z2d(:,:)
440         znam = 'sxya'//'_htc'//zchar
441         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
442         sxya(:,:,jl) = z2d(:,:)
443         znam = 'sxc0'//'_htc'//zchar
444         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
445         sxc0(:,:,jl) = z2d(:,:)
446         znam = 'syc0'//'_htc'//zchar
447         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
448         syc0(:,:,jl) = z2d(:,:)
449         znam = 'sxxc0'//'_htc'//zchar
450         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
451         sxxc0(:,:,jl) = z2d(:,:)
452         znam = 'syyc0'//'_htc'//zchar
453         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
454         syyc0(:,:,jl) = z2d(:,:)
455         znam = 'sxyc0'//'_htc'//zchar
456         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
457         sxyc0(:,:,jl) = z2d(:,:)
458         znam = 'sxsal'//'_htc'//zchar
459         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
460         sxsal(:,:,jl) = z2d(:,:)
461         znam = 'sysal'//'_htc'//zchar
462         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
463         sysal(:,:,jl) = z2d(:,:)
464         znam = 'sxxsal'//'_htc'//zchar
465         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
466         sxxsal(:,:,jl) = z2d(:,:)
467         znam = 'syysal'//'_htc'//zchar
468         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
469         syysal(:,:,jl) = z2d(:,:)
470         znam = 'sxysal'//'_htc'//zchar
471         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
472         sxysal(:,:,jl) = z2d(:,:)
473         znam = 'sxage'//'_htc'//zchar
474         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
475         sxage(:,:,jl) = z2d(:,:)
476         znam = 'syage'//'_htc'//zchar
477         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
478         syage(:,:,jl) = z2d(:,:)
479         znam = 'sxxage'//'_htc'//zchar
480         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
481         sxxage(:,:,jl) = z2d(:,:)
482         znam = 'syyage'//'_htc'//zchar
483         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
484         syyage(:,:,jl) = z2d(:,:)
485         znam = 'sxyage'//'_htc'//zchar
486         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
487         sxyage(:,:,jl)= z2d(:,:)
488      END DO
489
490      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
491      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
492      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
493      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
494      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
495
496      DO jl = 1, jpl 
497         WRITE(zchar,'(I1)') jl
498         DO jk = 1, nlay_i 
499            WRITE(zchar1,'(I1)') jk
500            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
501            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
502            sxe(:,:,jk,jl) = z2d(:,:)
503            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
504            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
505            sye(:,:,jk,jl) = z2d(:,:)
506            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
507            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
508            sxxe(:,:,jk,jl) = z2d(:,:)
509            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
510            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
511            syye(:,:,jk,jl) = z2d(:,:)
512            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
513            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
514            sxye(:,:,jk,jl) = z2d(:,:)
515         END DO
516      END DO
517      !
518      ! clem: I do not understand why the following IF is needed
519      !       I suspect something inconsistent in the main code with option nn_icesal=1
520      IF( nn_icesal == 1 ) THEN
521         DO jl = 1, jpl 
522            sm_i(:,:,jl) = rn_icesal
523            DO jk = 1, nlay_i 
524               s_i(:,:,jk,jl) = rn_icesal
525            END DO
526         END DO
527      ENDIF
528      !
529      !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90
530      !
531      CALL wrk_dealloc( jpi, jpj, z2d )
532      !
533   END SUBROUTINE lim_rst_read
534
535#else
536   !!----------------------------------------------------------------------
537   !!   Default option :       Empty module            NO LIM sea-ice model
538   !!----------------------------------------------------------------------
539CONTAINS
540   SUBROUTINE lim_rst_read             ! Empty routine
541   END SUBROUTINE lim_rst_read
542   SUBROUTINE lim_rst_write            ! Empty routine
543   END SUBROUTINE lim_rst_write
544#endif
545
546   !!======================================================================
547END MODULE limrst
Note: See TracBrowser for help on using the repository browser.