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

source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 7993

Last change on this file since 7993 was 6486, checked in by davestorkey, 8 years ago

Remove SVN keywords from UKMO/dev_r5518_GO6_package branch.

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