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

source: branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 @ 4161

Last change on this file since 4161 was 4161, checked in by cetlod, 10 years ago

dev_LOCEAN_2013 : merge in the 3rd dev branch dev_r4028_CNRS_LIM3, see ticket #1169

  • Property svn:keywords set to Id
File size: 25.1 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 par_ice        ! sea-ice parameters
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
29   IMPLICIT NONE
30   PRIVATE
31
32   PUBLIC   lim_rst_opn    ! routine called by icestep.F90
33   PUBLIC   lim_rst_write  ! routine called by icestep.F90
34   PUBLIC   lim_rst_read   ! routine called by iceini.F90
35
36   LOGICAL, PUBLIC ::   lrst_ice         !: logical to control the ice restart write
37   INTEGER, PUBLIC ::   numrir, numriw   !: logical unit for ice restart (read and write)
38
39   !!----------------------------------------------------------------------
40   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
41   !! $Id$
42   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
43   !!----------------------------------------------------------------------
44CONTAINS
45
46   SUBROUTINE lim_rst_opn( kt )
47      !!----------------------------------------------------------------------
48      !!                    ***  lim_rst_opn  ***
49      !!
50      !! ** purpose  :   output of sea-ice variable in a netcdf file
51      !!----------------------------------------------------------------------
52      INTEGER, INTENT(in) ::   kt       ! number of iteration
53      !
54      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character
55      CHARACTER(LEN=50)   ::   clname   ! ice output restart file name
56      !!----------------------------------------------------------------------
57      !
58      IF( kt == nit000 )   lrst_ice = .FALSE.   ! default definition
59
60      ! in order to get better performances with NetCDF format, we open and define the ice restart file
61      ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice
62      ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1
63      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    &
64         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN
65         ! beware of the format used to write kt (default is i8.8, that should be large enough...)
66         IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
67         ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
68         ENDIF
69         ! create the file
70         clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)
71         IF(lwp) THEN
72            WRITE(numout,*)
73            SELECT CASE ( jprstlib )
74            CASE ( jprstdimg )   ;   WRITE(numout,*) '             open ice restart binary file: '//clname
75            CASE DEFAULT         ;   WRITE(numout,*) '             open ice restart NetCDF file: '//clname
76            END SELECT
77            IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN   
78               WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp
79            ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp
80            ENDIF
81         ENDIF
82         !
83         CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib )
84         lrst_ice = .TRUE.
85      ENDIF
86      !
87   END SUBROUTINE lim_rst_opn
88
89
90   SUBROUTINE lim_rst_write( kt )
91      !!----------------------------------------------------------------------
92      !!                    ***  lim_rst_write  ***
93      !!
94      !! ** purpose  :   output of sea-ice variable in a netcdf file
95      !!----------------------------------------------------------------------
96      INTEGER, INTENT(in) ::   kt     ! number of iteration
97      !!
98      INTEGER ::   ji, jj, jk ,jl   ! dummy loop indices
99      INTEGER ::   iter
100      CHARACTER(len=15) ::   znam
101      CHARACTER(len=1)  ::   zchar, zchar1
102      REAL(wp), POINTER, DIMENSION(:,:) :: z2d
103      !!----------------------------------------------------------------------
104
105      CALL wrk_alloc( jpi, jpj, z2d )
106
107      iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1
108
109      IF( iter == nitrst ) THEN
110         IF(lwp) WRITE(numout,*)
111         IF(lwp) WRITE(numout,*) 'lim_rst_write : write ice restart file  kt =', kt
112         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'         
113      ENDIF
114
115      ! Write in numriw (if iter == nitrst)
116      ! ------------------
117      !                                                                        ! calendar control
118      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step
119      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date
120
121      ! Prognostic variables
122      DO jl = 1, jpl 
123         WRITE(zchar,'(I1)') jl
124         znam = 'v_i'//'_htc'//zchar
125         z2d(:,:) = v_i(:,:,jl)
126         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
127         znam = 'v_s'//'_htc'//zchar
128         z2d(:,:) = v_s(:,:,jl)
129         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
130         znam = 'smv_i'//'_htc'//zchar
131         z2d(:,:) = smv_i(:,:,jl)
132         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
133         znam = 'oa_i'//'_htc'//zchar
134         z2d(:,:) = oa_i(:,:,jl)
135         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
136         znam = 'a_i'//'_htc'//zchar
137         z2d(:,:) = a_i(:,:,jl)
138         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
139         znam = 't_su'//'_htc'//zchar
140         z2d(:,:) = t_su(:,:,jl)
141         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
142      END DO
143
144      DO jl = 1, jpl 
145         WRITE(zchar,'(I1)') jl
146         znam = 'tempt_sl1'//'_htc'//zchar
147         z2d(:,:) = e_s(:,:,1,jl)
148         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
149      END DO
150
151      DO jl = 1, jpl 
152         WRITE(zchar,'(I1)') jl
153         DO jk = 1, nlay_i 
154            WRITE(zchar1,'(I1)') jk
155            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
156            z2d(:,:) = e_i(:,:,jk,jl)
157            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
158         END DO
159      END DO
160
161      CALL iom_rstput( iter, nitrst, numriw, 'u_ice'     , u_ice      )
162      CALL iom_rstput( iter, nitrst, numriw, 'v_ice'     , v_ice      )
163      CALL iom_rstput( iter, nitrst, numriw, 'fsbbq'     , fsbbq      )
164      CALL iom_rstput( iter, nitrst, numriw, 'iatte'     , iatte      ) ! clem modif
165      CALL iom_rstput( iter, nitrst, numriw, 'oatte'     , oatte      ) ! clem modif
166      CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i  )
167      CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i  )
168      CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i )
169
170      DO jl = 1, jpl 
171         WRITE(zchar,'(I1)') jl
172         znam = 'sxice'//'_htc'//zchar
173         z2d(:,:) = sxice(:,:,jl)
174         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
175         znam = 'syice'//'_htc'//zchar
176         z2d(:,:) = syice(:,:,jl)
177         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
178         znam = 'sxxice'//'_htc'//zchar
179         z2d(:,:) = sxxice(:,:,jl)
180         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
181         znam = 'syyice'//'_htc'//zchar
182         z2d(:,:) = syyice(:,:,jl)
183         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
184         znam = 'sxyice'//'_htc'//zchar
185         z2d(:,:) = sxyice(:,:,jl)
186         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
187         znam = 'sxsn'//'_htc'//zchar
188         z2d(:,:) = sxsn(:,:,jl)
189         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
190         znam = 'sysn'//'_htc'//zchar
191         z2d(:,:) = sysn(:,:,jl)
192         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
193         znam = 'sxxsn'//'_htc'//zchar
194         z2d(:,:) = sxxsn(:,:,jl)
195         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
196         znam = 'syysn'//'_htc'//zchar
197         z2d(:,:) = syysn(:,:,jl)
198         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
199         znam = 'sxysn'//'_htc'//zchar
200         z2d(:,:) = sxysn(:,:,jl)
201         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
202         znam = 'sxa'//'_htc'//zchar
203         z2d(:,:) = sxa(:,:,jl)
204         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
205         znam = 'sya'//'_htc'//zchar
206         z2d(:,:) = sya(:,:,jl)
207         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
208         znam = 'sxxa'//'_htc'//zchar
209         z2d(:,:) = sxxa(:,:,jl)
210         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
211         znam = 'syya'//'_htc'//zchar
212         z2d(:,:) = syya(:,:,jl)
213         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
214         znam = 'sxya'//'_htc'//zchar
215         z2d(:,:) = sxya(:,:,jl)
216         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
217         znam = 'sxc0'//'_htc'//zchar
218         z2d(:,:) = sxc0(:,:,jl)
219         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
220         znam = 'syc0'//'_htc'//zchar
221         z2d(:,:) = syc0(:,:,jl)
222         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
223         znam = 'sxxc0'//'_htc'//zchar
224         z2d(:,:) = sxxc0(:,:,jl)
225         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
226         znam = 'syyc0'//'_htc'//zchar
227         z2d(:,:) = syyc0(:,:,jl)
228         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
229         znam = 'sxyc0'//'_htc'//zchar
230         z2d(:,:) = sxyc0(:,:,jl)
231         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
232         znam = 'sxsal'//'_htc'//zchar
233         z2d(:,:) = sxsal(:,:,jl)
234         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
235         znam = 'sysal'//'_htc'//zchar
236         z2d(:,:) = sysal(:,:,jl)
237         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
238         znam = 'sxxsal'//'_htc'//zchar
239         z2d(:,:) = sxxsal(:,:,jl)
240         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
241         znam = 'syysal'//'_htc'//zchar
242         z2d(:,:) = syysal(:,:,jl)
243         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
244         znam = 'sxysal'//'_htc'//zchar
245         z2d(:,:) = sxysal(:,:,jl)
246         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
247         znam = 'sxage'//'_htc'//zchar
248         z2d(:,:) = sxage(:,:,jl)
249         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
250         znam = 'syage'//'_htc'//zchar
251         z2d(:,:) = syage(:,:,jl)
252         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
253         znam = 'sxxage'//'_htc'//zchar
254         z2d(:,:) = sxxage(:,:,jl)
255         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
256         znam = 'syyage'//'_htc'//zchar
257         z2d(:,:) = syyage(:,:,jl)
258         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
259         znam = 'sxyage'//'_htc'//zchar
260         z2d(:,:) = sxyage(:,:,jl)
261         CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
262      END DO
263
264      CALL iom_rstput( iter, nitrst, numriw, 'sxopw ' ,  sxopw  )
265      CALL iom_rstput( iter, nitrst, numriw, 'syopw ' ,  syopw  )
266      CALL iom_rstput( iter, nitrst, numriw, 'sxxopw' ,  sxxopw )
267      CALL iom_rstput( iter, nitrst, numriw, 'syyopw' ,  syyopw )
268      CALL iom_rstput( iter, nitrst, numriw, 'sxyopw' ,  sxyopw )
269
270      DO jl = 1, jpl 
271         WRITE(zchar,'(I1)') jl
272         DO jk = 1, nlay_i 
273            WRITE(zchar1,'(I1)') jk
274            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
275            z2d(:,:) = sxe(:,:,jk,jl)
276            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
277            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
278            z2d(:,:) = sye(:,:,jk,jl)
279            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
280            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
281            z2d(:,:) = sxxe(:,:,jk,jl)
282            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
283            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
284            z2d(:,:) = syye(:,:,jk,jl)
285            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
286            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
287            z2d(:,:) = sxye(:,:,jk,jl)
288            CALL iom_rstput( iter, nitrst, numriw, znam , z2d )
289         END DO
290      END DO
291
292      IF( iter == nitrst ) THEN
293         CALL iom_close( numriw )                         ! close the restart file
294         lrst_ice = .FALSE.
295      ENDIF
296      !
297      CALL wrk_dealloc( jpi, jpj, z2d )
298      !
299   END SUBROUTINE lim_rst_write
300
301
302   SUBROUTINE lim_rst_read
303      !!----------------------------------------------------------------------
304      !!                    ***  lim_rst_read  ***
305      !!
306      !! ** purpose  :   read of sea-ice variable restart in a netcdf file
307      !!----------------------------------------------------------------------
308      INTEGER :: ji, jj, jk, jl, indx
309      REAL(wp) ::   zfice, ziter
310      REAL(wp) ::   zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb   ! local scalars used for the salinity profile
311      REAL(wp), POINTER, DIMENSION(:)  ::   zs_zero 
312      REAL(wp), POINTER, DIMENSION(:,:) ::   z2d
313      CHARACTER(len=15) ::   znam
314      CHARACTER(len=1)  ::   zchar, zchar1
315      INTEGER           ::   jlibalt = jprstlib
316      LOGICAL           ::   llok
317      !!----------------------------------------------------------------------
318
319      CALL wrk_alloc( nlay_i, zs_zero )
320      CALL wrk_alloc( jpi, jpj, z2d )
321
322      IF(lwp) THEN
323         WRITE(numout,*)
324         WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file'
325         WRITE(numout,*) '~~~~~~~~~~~~~'
326      ENDIF
327
328      IF ( jprstlib == jprstdimg ) THEN
329        ! eventually read netcdf file (monobloc)  for restarting on different number of processors
330        ! if {cn_icerst_in}.nc exists, then set jlibalt to jpnf90
331        INQUIRE( FILE = TRIM(cn_icerst_in)//'.nc', EXIST = llok )
332        IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF
333      ENDIF
334
335      CALL iom_open ( cn_icerst_in, numrir, kiolib = jprstlib )
336
337      CALL iom_get( numrir, 'nn_fsbc', zfice )
338      CALL iom_get( numrir, 'kt_ice' , ziter )   
339      IF(lwp) WRITE(numout,*) '   read ice restart file at time step    : ', ziter
340      IF(lwp) WRITE(numout,*) '   in any case we force it to nit000 - 1 : ', nit000 - 1
341
342      !Control of date
343
344      IF( ( nit000 - NINT(ziter) ) /= 1 .AND. ABS( nrstdt ) == 1 )   &
345         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nit000 in ice restart',  &
346         &                   '   verify the file or rerun with the value 0 for the',        &
347         &                   '   control of time parameter  nrstdt' )
348      IF( NINT(zfice) /= nn_fsbc          .AND. ABS( nrstdt ) == 1 )   &
349         &     CALL ctl_stop( 'lim_rst_read ===>>>> : problem with nn_fsbc in ice restart',  &
350         &                   '   verify the file or rerun with the value 0 for the',         &
351         &                   '   control of time parameter  nrstdt' )
352
353      DO jl = 1, jpl 
354         WRITE(zchar,'(I1)') jl
355         znam = 'v_i'//'_htc'//zchar
356         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
357         v_i(:,:,jl) = z2d(:,:)
358         znam = 'v_s'//'_htc'//zchar
359         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
360         v_s(:,:,jl) = z2d(:,:) 
361         znam = 'smv_i'//'_htc'//zchar
362         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
363         smv_i(:,:,jl) = z2d(:,:)
364         znam = 'oa_i'//'_htc'//zchar
365         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
366         oa_i(:,:,jl) = z2d(:,:)
367         znam = 'a_i'//'_htc'//zchar
368         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
369         a_i(:,:,jl) = z2d(:,:)
370         znam = 't_su'//'_htc'//zchar
371         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
372         t_su(:,:,jl) = z2d(:,:)
373         tn_ice (:,:,:) = t_su (:,:,:)
374      END DO
375
376      DO jl = 1, jpl 
377         CALL lbc_lnk( smv_i(:,:,jl) , 'T' ,  1. )
378         CALL lbc_lnk( v_i  (:,:,jl) , 'T' ,  1. )
379         CALL lbc_lnk( a_i  (:,:,jl) , 'T' ,  1. )
380      END DO
381
382      ! we first with bulk ice salinity
383      DO jl = 1, jpl
384         DO jj = 1, jpj
385            DO ji = 1, jpi
386               zindb          = MAX( 0.0 , SIGN( 1.0 , v_i(ji,jj,jl) - 1.0e-4 ) ) 
387               sm_i(ji,jj,jl) = smv_i(ji,jj,jl) / MAX(v_i(ji,jj,jl),1.0e-6) * zindb
388               ht_i(ji,jj,jl) = v_i(ji,jj,jl)   / MAX(a_i(ji,jj,jl),1.0e-6) * zindb
389            END DO
390         END DO
391      END DO
392
393      DO jk = 1, nlay_i
394         s_i(:,:,jk,:) = sm_i(:,:,:)
395      END DO
396
397      IF( num_sal == 2 ) THEN      ! Salinity profile
398         DO jl = 1, jpl
399            DO jk = 1, nlay_i
400               DO jj = 1, jpj
401                  DO ji = 1, jpi
402                     zs_inf        = sm_i(ji,jj,jl)
403                     z_slope_s     = 2._wp * sm_i(ji,jj,jl) / MAX( 0.01_wp , ht_i(ji,jj,jl) )
404                     !- slope of the salinity profile
405                     zs_zero(jk)   = z_slope_s * ( REAL(jk,wp) - 0.5_wp ) * ht_i(ji,jj,jl) / REAL(nlay_i,wp)
406                     zsmax = 4.5_wp
407                     zsmin = 3.5_wp
408                     IF(     sm_i(ji,jj,jl) < zsmin ) THEN
409                        zalpha = 1._wp
410                     ELSEIF( sm_i(ji,jj,jl) < zsmax ) THEN
411                        zalpha = sm_i(ji,jj,jl) / ( zsmin - zsmax ) + zsmax / ( zsmax - zsmin )
412                     ELSE
413                        zalpha = 0._wp
414                     ENDIF
415                     s_i(ji,jj,jk,jl) = zalpha * zs_zero(jk) + ( 1._wp - zalpha ) * zs_inf
416                  END DO
417               END DO
418            END DO
419         END DO
420      ENDIF
421
422      DO jl = 1, jpl 
423         WRITE(zchar,'(I1)') jl
424         znam = 'tempt_sl1'//'_htc'//zchar
425         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
426         e_s(:,:,1,jl) = z2d(:,:)
427      END DO
428
429      DO jl = 1, jpl 
430         WRITE(zchar,'(I1)') jl
431         DO jk = 1, nlay_i 
432            WRITE(zchar1,'(I1)') jk
433            znam = 'tempt'//'_il'//zchar1//'_htc'//zchar
434            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
435            e_i(:,:,jk,jl) = z2d(:,:)
436         END DO
437      END DO
438
439      CALL iom_get( numrir, jpdom_autoglo, 'u_ice'     , u_ice      )
440      CALL iom_get( numrir, jpdom_autoglo, 'v_ice'     , v_ice      )
441      CALL iom_get( numrir, jpdom_autoglo, 'fsbbq'     , fsbbq      )
442      CALL iom_get( numrir, jpdom_autoglo, 'iatte'     , iatte      ) ! clem modif
443      CALL iom_get( numrir, jpdom_autoglo, 'oatte'     , oatte      ) ! clem modif
444      CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i  )
445      CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i  )
446      CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )
447
448      DO jl = 1, jpl 
449         WRITE(zchar,'(I1)') jl
450         znam = 'sxice'//'_htc'//zchar
451         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
452         sxice(:,:,jl) = z2d(:,:)
453         znam = 'syice'//'_htc'//zchar
454         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
455         syice(:,:,jl) = z2d(:,:)
456         znam = 'sxxice'//'_htc'//zchar
457         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
458         sxxice(:,:,jl) = z2d(:,:)
459         znam = 'syyice'//'_htc'//zchar
460         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
461         syyice(:,:,jl) = z2d(:,:)
462         znam = 'sxyice'//'_htc'//zchar
463         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
464         sxyice(:,:,jl) = z2d(:,:)
465         znam = 'sxsn'//'_htc'//zchar
466         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
467         sxsn(:,:,jl) = z2d(:,:)
468         znam = 'sysn'//'_htc'//zchar
469         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
470         sysn(:,:,jl) = z2d(:,:)
471         znam = 'sxxsn'//'_htc'//zchar
472         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
473         sxxsn(:,:,jl) = z2d(:,:)
474         znam = 'syysn'//'_htc'//zchar
475         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
476         syysn(:,:,jl) = z2d(:,:)
477         znam = 'sxysn'//'_htc'//zchar
478         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
479         sxysn(:,:,jl) = z2d(:,:)
480         znam = 'sxa'//'_htc'//zchar
481         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
482         sxa(:,:,jl) = z2d(:,:)
483         znam = 'sya'//'_htc'//zchar
484         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
485         sya(:,:,jl) = z2d(:,:)
486         znam = 'sxxa'//'_htc'//zchar
487         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
488         sxxa(:,:,jl) = z2d(:,:)
489         znam = 'syya'//'_htc'//zchar
490         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
491         syya(:,:,jl) = z2d(:,:)
492         znam = 'sxya'//'_htc'//zchar
493         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
494         sxya(:,:,jl) = z2d(:,:)
495         znam = 'sxc0'//'_htc'//zchar
496         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
497         sxc0(:,:,jl) = z2d(:,:)
498         znam = 'syc0'//'_htc'//zchar
499         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
500         syc0(:,:,jl) = z2d(:,:)
501         znam = 'sxxc0'//'_htc'//zchar
502         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
503         sxxc0(:,:,jl) = z2d(:,:)
504         znam = 'syyc0'//'_htc'//zchar
505         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
506         syyc0(:,:,jl) = z2d(:,:)
507         znam = 'sxyc0'//'_htc'//zchar
508         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
509         sxyc0(:,:,jl) = z2d(:,:)
510         znam = 'sxsal'//'_htc'//zchar
511         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
512         sxsal(:,:,jl) = z2d(:,:)
513         znam = 'sysal'//'_htc'//zchar
514         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
515         sysal(:,:,jl) = z2d(:,:)
516         znam = 'sxxsal'//'_htc'//zchar
517         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
518         sxxsal(:,:,jl) = z2d(:,:)
519         znam = 'syysal'//'_htc'//zchar
520         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
521         syysal(:,:,jl) = z2d(:,:)
522         znam = 'sxysal'//'_htc'//zchar
523         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
524         sxysal(:,:,jl) = z2d(:,:)
525         znam = 'sxage'//'_htc'//zchar
526         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
527         sxage(:,:,jl) = z2d(:,:)
528         znam = 'syage'//'_htc'//zchar
529         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
530         syage(:,:,jl) = z2d(:,:)
531         znam = 'sxxage'//'_htc'//zchar
532         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
533         sxxage(:,:,jl) = z2d(:,:)
534         znam = 'syyage'//'_htc'//zchar
535         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
536         syyage(:,:,jl) = z2d(:,:)
537         znam = 'sxyage'//'_htc'//zchar
538         CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
539         sxyage(:,:,jl)= z2d(:,:)
540      END DO
541
542      CALL iom_get( numrir, jpdom_autoglo, 'sxopw ' ,  sxopw  )
543      CALL iom_get( numrir, jpdom_autoglo, 'syopw ' ,  syopw  )
544      CALL iom_get( numrir, jpdom_autoglo, 'sxxopw' ,  sxxopw )
545      CALL iom_get( numrir, jpdom_autoglo, 'syyopw' ,  syyopw )
546      CALL iom_get( numrir, jpdom_autoglo, 'sxyopw' ,  sxyopw )
547
548      DO jl = 1, jpl 
549         WRITE(zchar,'(I1)') jl
550         DO jk = 1, nlay_i 
551            WRITE(zchar1,'(I1)') jk
552            znam = 'sxe'//'_il'//zchar1//'_htc'//zchar
553            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
554            sxe(:,:,jk,jl) = z2d(:,:)
555            znam = 'sye'//'_il'//zchar1//'_htc'//zchar
556            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
557            sye(:,:,jk,jl) = z2d(:,:)
558            znam = 'sxxe'//'_il'//zchar1//'_htc'//zchar
559            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
560            sxxe(:,:,jk,jl) = z2d(:,:)
561            znam = 'syye'//'_il'//zchar1//'_htc'//zchar
562            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
563            syye(:,:,jk,jl) = z2d(:,:)
564            znam = 'sxye'//'_il'//zchar1//'_htc'//zchar
565            CALL iom_get( numrir, jpdom_autoglo, znam , z2d )
566            sxye(:,:,jk,jl) = z2d(:,:)
567         END DO
568      END DO
569      !
570      !clem CALL iom_close( numrir )
571      !
572      CALL wrk_dealloc( nlay_i, zs_zero )
573      CALL wrk_dealloc( jpi, jpj, z2d )
574      !
575   END SUBROUTINE lim_rst_read
576
577#else
578   !!----------------------------------------------------------------------
579   !!   Default option :       Empty module            NO LIM sea-ice model
580   !!----------------------------------------------------------------------
581CONTAINS
582   SUBROUTINE lim_rst_read             ! Empty routine
583   END SUBROUTINE lim_rst_read
584   SUBROUTINE lim_rst_write            ! Empty routine
585   END SUBROUTINE lim_rst_write
586#endif
587
588   !!======================================================================
589END MODULE limrst
Note: See TracBrowser for help on using the repository browser.