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

source: branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 8294

Last change on this file since 8294 was 8233, checked in by clem, 7 years ago

merge with dev_r6859_LIM3_meltponds@r8179

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