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

source: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 9391

Last change on this file since 9391 was 9391, checked in by davestorkey, 6 years ago

UKMO/dev_r8864_restart_date branch: bug fixes

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