Index: trunk/NEMO/LIM_SRC/limdia.F90
===================================================================
--- trunk/NEMO/LIM_SRC/limdia.F90	(revision 12)
+++ trunk/NEMO/LIM_SRC/limdia.F90	(revision 77)
@@ -12,12 +12,13 @@
    !!----------------------------------------------------------------------
    !! * Modules used
-   USE phycst
-   USE in_out_manager
+   USE phycst          ! 
+   USE par_ice         ! ice parameters
    USE ice_oce         ! ice variables
-   USE daymod
-   USE dom_ice
-   USE ice
-   USE iceini
-   USE limistate
+   USE daymod          !
+   USE dom_ice         !
+   USE ice             !
+   USE iceini          !
+   USE limistate       !
+   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
@@ -28,34 +29,36 @@
 
    !! * Shared module variables
-   INTEGER, PUBLIC  ::  &
+   INTEGER, PUBLIC  ::  &  !:
       ntmoy   = 1 ,     &  !: instantaneous values of ice evolution or averaging ntmoy
       ninfo   = 1          !: frequency of ouputs on file ice_evolu in case of averaging
 
    !! * Module variables
-   INTEGER          ::  &
-      nfrinf  = 4          ! number of variables written in one line 
- 
-   INTEGER          ::  &
+   INTEGER, PARAMETER ::   &  ! Parameters for outputs to files "evolu"
+      jpinfmx = 100         ,    &  ! maximum number of key variables
+      jpchinf = 5           ,    &  ! ???
+      jpchsep = jpchinf + 2         ! ???
+
+   INTEGER ::   &
+      nfrinf  = 4 ,     &  ! number of variables written in one line 
       nferme ,          &  ! last time step at which the var. are written on file
       nvinfo ,          &  ! number of total variables 
       nbvt   ,          &  ! number of time variables
       naveg                ! number of step for accumulation before averaging
- 
-   REAL(wp), DIMENSION(ninfmx) ::  &
-      vinfom               ! temporary working space
-
-   CHARACTER(len=8) ::  &
+
+   CHARACTER(len=8) ::   &
       fmtinf  = '1PE13.5 ' ! format of the output values  
-
-   CHARACTER(len=30) :: &
+   CHARACTER(len=30) ::   &
       fmtw  ,           &  ! formats
       fmtr  ,           &  ! ???
       fmtitr               ! ???
-
-   CHARACTER(len=nchsep), DIMENSION(ninfmx) ::   &
+   CHARACTER(len=jpchsep), DIMENSION(jpinfmx) ::   &
       titvar               ! title of key variables
-
-   REAL(wp) :: &
-      epsi06 = 1.e-06
+ 
+   REAL(wp) ::   &
+      epsi06 = 1.e-06      ! ???
+   REAL(wp), DIMENSION(jpinfmx) ::  &
+      vinfom               ! temporary working space
+   REAL(wp), DIMENSION(jpi,jpj) ::   &
+      aire                 ! masked grid cell area
 
    !! * Substitutions
@@ -81,5 +84,5 @@
        INTEGER  ::   jv,ji, jj   ! dummy loop indices
        INTEGER  ::   nv          ! indice of variable 
-       REAL(wp), DIMENSION(ninfmx) ::  & 
+       REAL(wp), DIMENSION(jpinfmx) ::  & 
           vinfor           ! temporary working space 
        REAL(wp) ::    &
@@ -98,10 +101,10 @@
 
        nv = 1 
-       vinfor(nv) = REAL(numit)
+       vinfor(nv) = REAL( numit )
        nv = nv + 1
        vinfor(nv) = nyear
  
        DO jv = nbvt + 1, nvinfo
-          vinfor(jv) = 0.0
+          vinfor(jv) = 0.e0
        END DO
 
@@ -109,5 +112,5 @@
        zextent85 = 0.e0
        ! variables in northern Hemis
-       DO jj = jeq, jpjm1
+       DO jj = njeq, jpjm1
           DO ji = fs_2, fs_jpim1   ! vector opt.
              IF( tms(ji,jj) == 1 ) THEN
@@ -135,5 +138,5 @@
       ! variables in southern Hemis
        nv = nv + 1
-       DO jj = 2, jeqm1
+       DO jj = 2, njeqm1
           DO ji = fs_2, fs_jpim1   ! vector opt.
              IF( tms(ji,jj) == 1 ) THEN
@@ -169,5 +172,5 @@
           naveg = 0
           DO jv = 1, nvinfo
-             vinfom(jv)=0.0
+             vinfom(jv) = 0.e0
           END DO
        ENDIF
@@ -199,7 +202,6 @@
        REAL(wp) ::   zxx0, zxx1    ! temporary scalars
 
-       CHARACTER(len=nchinf) ::   titinf
+       CHARACTER(len=jpchinf) ::   titinf
        !!-------------------------------------------------------------------
-
 
        ! Read Namelist namicedia
@@ -216,4 +218,7 @@
        ENDIF
 
+       ! masked grid cell area
+       aire(:,:) = area(:,:) * tms(:,:)
+
        ! Titles of ice key variables :
        nv = 1
@@ -265,10 +270,10 @@
 
        ! definition of formats 
-       WRITE( fmtw  , '(A,I3,A2,I1,A)' )  '(', nfrinf, '(A', nchsep, ','//fmtinf//'))'
-       WRITE( fmtr  , '(A,I3,A,I1,A)'  )  '(', nfrinf, '(', nchsep, 'X,'//fmtinf//'))'
-       WRITE( fmtitr, '(A,I3,A,I1,A)'  )  '(', nvinfo, 'A', nchinf, ')'
+       WRITE( fmtw  , '(A,I3,A2,I1,A)' )  '(', nfrinf, '(A', jpchsep, ','//fmtinf//'))'
+       WRITE( fmtr  , '(A,I3,A,I1,A)'  )  '(', nfrinf, '(', jpchsep, 'X,'//fmtinf//'))'
+       WRITE( fmtitr, '(A,I3,A,I1,A)'  )  '(', nvinfo, 'A', jpchinf, ')'
 
        ! opening  "ice_evolu" file
-       irecl = ( nchinf + 1 ) * nvinfo 
+       irecl = ( jpchinf + 1 ) * nvinfo 
        OPEN( numevo_ice, file='ice.evolu', status='unknown', RECL = irecl)
        OPEN( numevo_ice, file='ice.evolu', status='unknown')
@@ -276,7 +281,7 @@
        !- ecriture de 2 lignes d''entete :
        WRITE(numevo_ice,1000) fmtr, fmtw, fmtitr, nvinfo, ntot, 0, nfrinf
-       zxx0 = 0.001 * REAL(ninfo)
-       zxx1 = 0.001 * REAL(ndeb)
-       WRITE(numevo_ice,1111) REAL(nchinf), 0., zxx1, zxx0, 0., 0., 0
+       zxx0 = 0.001 * REAL( ninfo )
+       zxx1 = 0.001 * REAL( ndeb  )
+       WRITE(numevo_ice,1111) REAL(jpchinf), 0., zxx1, zxx0, 0., 0., 0
 
        !- ecriture de 2 lignes de titre :
@@ -289,5 +294,5 @@
        !--preparation de "titvar" pour l''ecriture parmi les valeurs numeriques :
        DO  jv = 2 , nvinfo
-          titinf     = titvar(jv)(:nchinf)
+          titinf     = titvar(jv)(:jpchinf)
           titvar(jv) = '  '//titinf
        END DO
