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

source: branches/2016/dev_r6859_LIM3_meltponds/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 8142

Last change on this file since 8142 was 8061, checked in by vancop, 7 years ago

Quick commit on empirical melt ponds

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