Index: /trunk/NEMOGCM/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /trunk/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2714)
+++ /trunk/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 2715)
@@ -672,5 +672,4 @@
 !!======================================================================
 !!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi)
-!!   nammpp_dyndist    Massively Parallel domain decomposition          ("key_agrif" && "key_mpp_dyndist")
 !!   namctl            Control prints & Benchmark
 !!   namsol            elliptic solver / island / free surface 
@@ -696,11 +695,7 @@
                            !  buffer blocking send or immediate non-blocking sends, resp.
    nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation
-/
-!-----------------------------------------------------------------------
-&nammpp_dyndist !   Massively Parallel Distribution for AGRIF zoom      ("key_agrif" && "key_mpp_dyndist")
-!-----------------------------------------------------------------------
-   jpni        =    1      !  jpni   number of processors following i
-   jpnj        =    1      !  jpnj   number of processors following j
-   jpnij       =    1      !  jpnij  number of local domains
+   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1)     
+   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1)     
+   jpnij       =   0       !  jpnij  number of local domains (set automatically if < 1)              
 /
 !-----------------------------------------------------------------------
Index: /trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2714)
+++ /trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 2715)
@@ -669,8 +669,7 @@
 
 !!======================================================================
-!!                  ***  Miscelaneous namelists  ***
+!!                  ***  Miscellaneous namelists  ***
 !!======================================================================
 !!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi)
-!!   nammpp_dyndist    Massively Parallel domain decomposition          ("key_agrif" && "key_mpp_dyndist")
 !!   namctl            Control prints & Benchmark
 !!   namsol            elliptic solver / island / free surface 
@@ -696,11 +695,7 @@
                            !  buffer blocking send or immediate non-blocking sends, resp.
    nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation
-/
-!-----------------------------------------------------------------------
-&nammpp_dyndist !   Massively Parallel Distribution for AGRIF zoom      ("key_agrif" && "key_mpp_dyndist")
-!-----------------------------------------------------------------------
-   jpni        =    1      !  jpni   number of processors following i
-   jpnj        =    1      !  jpnj   number of processors following j
-   jpnij       =    1      !  jpnij  number of local domains
+   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =   0       !  jpnij  number of local domains (set automatically if < 1)
 /
 !-----------------------------------------------------------------------
Index: /trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- /trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 2714)
+++ /trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 2715)
@@ -132,5 +132,5 @@
 &namsbc        !   Surface Boundary Condition (surface module)
 !-----------------------------------------------------------------------
-   nn_fsbc     = 5         !  frequency of surface boundary condition computation 
+   nn_fsbc     =  1        !  frequency of surface boundary condition computation 
                            !     (also = the frequency of sea-ice model call)
    ln_ana      = .false.   !  analytical formulation                    (T => fill namsbc_ana ) 
@@ -686,5 +686,4 @@
 !!======================================================================
 !!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi)
-!!   nammpp_dyndist    Massively Parallel domain decomposition          ("key_agrif" && "key_mpp_dyndist")
 !!   namctl            Control prints & Benchmark
 !!   namsol            elliptic solver / island / free surface 
@@ -710,11 +709,7 @@
                            !  buffer blocking send or immediate non-blocking sends, resp.
    nn_buffer   =   0       !  size in bytes of exported buffer ('B' case), 0 no exportation
-/
-!-----------------------------------------------------------------------
-&nammpp_dyndist !   Massively Parallel Distribution for AGRIF zoom      ("key_agrif" && "key_mpp_dyndist")
-!-----------------------------------------------------------------------
-   jpni        =    1      !  jpni   number of processors following i
-   jpnj        =    1      !  jpnj   number of processors following j
-   jpnij       =    1      !  jpnij  number of local domains
+   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =   0       !  jpnij  number of local domains (set automatically if < 1)
 /
 !-----------------------------------------------------------------------
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modarrays.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modarrays.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modarrays.F	(revision 2715)
@@ -126,25 +126,7 @@
 C     Local variables
 C
-      SELECT CASE (nbdim)
-      CASE (1)
-           lower = lbound(Variable % array1,indice)
-           upper = ubound(Variable % array1,indice)
-      CASE (2)
-           lower = lbound(Variable % array2,indice)
-           upper = ubound(Variable % array2,indice)
-      CASE (3)
-           lower = lbound(Variable % array3,indice)
-           upper = ubound(Variable % array3,indice)
-      CASE (4)
-           lower = lbound(Variable % array4,indice)
-           upper = ubound(Variable % array4,indice)
-      CASE (5)
-           lower = lbound(Variable % array5,indice)
-           upper = ubound(Variable % array5,indice)
-      CASE (6)
-           lower = lbound(Variable % array6,indice)
-           upper = ubound(Variable % array6,indice)
-      END SELECT
-C
+
+      lower = Variable % lb(indice)
+      upper = Variable % ub(indice)
       return
 C
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbc.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbc.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbc.F	(revision 2715)
@@ -86,5 +86,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array1 => tab  
+      childtemp % var % parray1 => tab  
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -167,5 +167,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array2 => tab  
+      childtemp % var % parray2 => tab  
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -247,5 +247,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array3 => tab
+      childtemp % var % parray3 => tab
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -328,5 +328,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array4 => tab  
+      childtemp % var % parray4 => tab  
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -409,5 +409,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array5 => tab  
+      childtemp % var % parray5 => tab  
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -491,5 +491,5 @@
 C      
 C     Values of the grid variable
-      childtemp % var % array6 => tab  
+      childtemp % var % parray6 => tab  
 C
 C     Temporary results for the time interpolation before and after the space 
@@ -814,5 +814,5 @@
       
       CALL MPI_ALLREDUCE(iminmaxg,lubglob,2*nbdim,MPI_INTEGER,MPI_MIN,
-     &                     MPI_COMM_AGRIF,code)  
+     &                     MPI_COMM_WORLD,code)  
      
       lubglob(1:nbdim,2) = - lubglob(1:nbdim,2)      
@@ -1067,5 +1067,5 @@
          do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array1(ir)
+     &           child%var%parray1(ir)
             kindex = kindex + 1
          enddo       
@@ -1077,5 +1077,5 @@
            do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array2(ir,jr)
+     &           child%var%parray2(ir,jr)
             kindex = kindex + 1
            enddo
@@ -1088,5 +1088,5 @@
              do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array3(ir,jr,kr)
+     &           child%var%parray3(ir,jr,kr)
             kindex = kindex + 1
              enddo
@@ -1101,5 +1101,5 @@
                do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array4(ir,jr,kr,lr)
+     &           child%var%parray4(ir,jr,kr,lr)
             kindex = kindex + 1
                enddo
@@ -1116,5 +1116,5 @@
                  do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array5(ir,jr,kr,lr,mr)
+     &           child%var%parray5(ir,jr,kr,lr,mr)
             kindex = kindex + 1
                  enddo
@@ -1133,5 +1133,5 @@
                    do ir=bounds(1,1),bounds(1,2)
             child%var%oldvalues2d(2,kindex) =
-     &           child%var%array6(ir,jr,kr,lr,mr,nr)
+     &           child%var%parray6(ir,jr,kr,lr,mr,nr)
             kindex = kindex + 1
                    enddo
@@ -1184,5 +1184,5 @@
 !CDIR ALTCODE
          do ir=bounds(1,1),bounds(1,2)
-                child%var%array1(ir) =
+                child%var%parray1(ir) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex)    
@@ -1195,5 +1195,5 @@
 !CDIR ALTCODE
            do ir=bounds(1,1),bounds(1,2)
-                child%var%array2(ir,jr) =
+                child%var%parray2(ir,jr) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex) 
@@ -1207,5 +1207,5 @@
 !CDIR ALTCODE
              do ir=bounds(1,1),bounds(1,2)
-                child%var%array3(ir,jr,kr) =
+                child%var%parray3(ir,jr,kr) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex) 
@@ -1221,5 +1221,5 @@
 !CDIR ALTCODE
                do ir=bounds(1,1),bounds(1,2)
-                child%var%array4(ir,jr,kr,lr) =
+                child%var%parray4(ir,jr,kr,lr) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex) 
@@ -1237,5 +1237,5 @@
 !CDIR ALTCODE
                  do ir=bounds(1,1),bounds(1,2)
-                child%var%array5(ir,jr,kr,lr,mr) =
+                child%var%parray5(ir,jr,kr,lr,mr) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex) 
@@ -1255,5 +1255,5 @@
 !CDIR ALTCODE
                    do ir=bounds(1,1),bounds(1,2)
-                child%var%array6(ir,jr,kr,lr,mr,nr) =
+                child%var%parray6(ir,jr,kr,lr,mr,nr) =
      &           c2t*child % var % oldvalues2d(1,kindex)   
      &         + c1t*child % var % oldvalues2d(2,kindex) 
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbcfunction.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbcfunction.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modbcfunction.F	(revision 2715)
@@ -35,4 +35,5 @@
       Use Agrif_Update
       Use Agrif_fluxmod
+      Use Agrif_Save
 C             
       IMPLICIT NONE
@@ -65,5 +66,6 @@
      &                     Agrif_Init_variable1d,
      &                     Agrif_Init_variable2d,
-     &                     Agrif_Init_variable3d
+     &                     Agrif_Init_variable3d,
+     &                     Agrif_Init_variable4d
       end interface       
 C
@@ -76,4 +78,11 @@
      &                     Agrif_update_var5d
       end interface       
+      
+      interface Agrif_Save_Forrestore
+         module procedure Agrif_Save_Forrestore0d,    
+     &                    Agrif_Save_Forrestore2d,    
+     &                    Agrif_Save_Forrestore3d,    
+     &                    Agrif_Save_Forrestore4d
+      end interface
 C
       Contains 
@@ -255,5 +264,5 @@
       LOGICAL, OPTIONAL :: Interpolationshouldbemade
 C
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       TYPE(Agrif_PVariable),Pointer ::tabvars
       
@@ -265,8 +274,15 @@
 C     
 
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
       endif  
       
@@ -307,24 +323,44 @@
       INTEGER, OPTIONAL      :: interp,interp1,interp2,interp3
 C
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer ::tabvars
+      
+    
+C
 C
 C     Begin 
 C
-      Agrif_Mygrid % tabvars(tabvarsindic)% var % Typeinterp = 
+C     
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Mygrid % tabvars(indic)
+      endif      
+C
+C     Begin 
+C
+      tabvars % var % Typeinterp = 
      &    Agrif_Constant
       IF (present(interp)) THEN
-      Agrif_Mygrid % tabvars(tabvarsindic)% var % Typeinterp = 
+      tabvars % var % Typeinterp = 
      &           interp
       ENDIF
       IF (present(interp1)) THEN
-      Agrif_Mygrid % tabvars(tabvarsindic)% var % Typeinterp(1) = 
+      tabvars % var % Typeinterp(1) = 
      &           interp1
       ENDIF
       IF (present(interp2)) THEN
-      Agrif_Mygrid % tabvars(tabvarsindic)% var % Typeinterp(2) = 
+      tabvars % var % Typeinterp(2) = 
      &           interp2
       ENDIF
       IF (present(interp3)) THEN
-      Agrif_Mygrid % tabvars(tabvarsindic)% var % Typeinterp(3) = 
+      tabvars % var % Typeinterp(3) = 
      &           interp3
       ENDIF
@@ -353,5 +389,5 @@
       INTEGER, OPTIONAL      :: interp11,interp12,interp21,interp22
 C
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       TYPE(Agrif_PVariable),Pointer ::tabvars
       
@@ -363,8 +399,15 @@
 C     
 
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Mygrid % tabvars(tabvarsindic)
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Mygrid % tabvars(indic)
       endif 
 C
@@ -460,34 +503,50 @@
      &       update2, update3,update4,update5
 C
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer :: roottabvars      
 C
 C
 C     Begin 
-C
-      Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate = 
+
+      indic = tabvarsindic
+
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)      
+      else
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
+C
+      roottabvars% var % typeupdate = 
      &                   Agrif_Update_Copy
       
       IF (present(update)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate = 
+        roottabvars% var % typeupdate = 
      &           update
       ENDIF
       IF (present(update1)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate(1) = 
+        roottabvars% var % typeupdate(1) = 
      &           update1
       ENDIF  
       IF (present(update2)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate(2) = 
+        roottabvars% var % typeupdate(2) = 
      &           update2
       ENDIF  
       IF (present(update3)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate(3) = 
+        roottabvars% var % typeupdate(3) = 
      &           update3
       ENDIF 
       IF (present(update4)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate(4) = 
+        roottabvars% var % typeupdate(4) = 
      &           update4
       ENDIF       
       IF (present(update5)) THEN
-        Agrif_Mygrid % tabvars(tabvarsindic)% var % typeupdate(5) = 
+        roottabvars% var % typeupdate(5) = 
      &           update5
       ENDIF                  
@@ -513,10 +572,16 @@
 C     Arguments      
 C
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
 C
 C     Begin 
 C
-C
-      Agrif_Mygrid%tabvars(tabvarsindic)%var % restaure = .TRUE.
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif  
+C
+      Agrif_Mygrid%tabvars(indic)%var % restaure = .TRUE.
 C
       End Subroutine Agrif_Set_restore
@@ -530,5 +595,5 @@
 
       INTEGER :: tabvarsindic0 ! indice of the variable in tabvars
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
@@ -536,10 +601,17 @@
       if (Agrif_Root()) Return
 C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
       if (present(procname)) then
-      CALL Agrif_Interp_variable(tabvarsindic0,tabvarsindic,procname)
-      CALL Agrif_Bc_variable(tabvarsindic0,tabvarsindic,1.,procname)
-      else
-      CALL Agrif_Interp_variable(tabvarsindic0,tabvarsindic)
-      CALL Agrif_Bc_variable(tabvarsindic0,tabvarsindic,1.)
+      CALL Agrif_Interp_variable(tabvarsindic0,indic,procname)
+      CALL Agrif_Bc_variable(tabvarsindic0,indic,1.,procname)
+      else
+      CALL Agrif_Interp_variable(tabvarsindic0,indic)
+      CALL Agrif_Bc_variable(tabvarsindic0,indic,1.)
       endif
 
@@ -553,5 +625,5 @@
 
       REAL, DIMENSION(:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
@@ -559,11 +631,18 @@
 C
       if (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif      
 C
       if (present(procname)) then
-      CALL Agrif_Interp_variable(q,tabvarsindic,procname)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.,procname)
-      else
-      CALL Agrif_Interp_variable(q,tabvarsindic)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.)
+      CALL Agrif_Interp_variable(q,indic,procname)
+      CALL Agrif_Bc_variable(q,indic,1.,procname)
+      else
+      CALL Agrif_Interp_variable(q,indic)
+      CALL Agrif_Bc_variable(q,indic,1.)
       endif
 
@@ -579,14 +658,22 @@
       External :: procname
       Optional ::  procname
+      integer :: indic
 
 C
       if (Agrif_Root()) Return
 C
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
       if (present(procname)) then
-      CALL Agrif_Interp_variable(q,tabvarsindic,procname)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.,procname)
-      else
-      CALL Agrif_Interp_variable(q,tabvarsindic)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.)
+      CALL Agrif_Interp_variable(q,indic,procname)
+      CALL Agrif_Bc_variable(q,indic,1.,procname)
+      else
+      CALL Agrif_Interp_variable(q,indic)
+      CALL Agrif_Bc_variable(q,indic,1.)
       endif
 
@@ -601,16 +688,23 @@
 
       REAL,  DIMENSION(:,:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
 C
       if (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif      
 C
       if (present(procname)) then
-      CALL Agrif_Interp_variable(q,tabvarsindic,procname)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.,procname)
-      else
-      CALL Agrif_Interp_variable(q,tabvarsindic)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.)
+      CALL Agrif_Interp_variable(q,indic,procname)
+      CALL Agrif_Bc_variable(q,indic,1.,procname)
+      else
+      CALL Agrif_Interp_variable(q,indic)
+      CALL Agrif_Bc_variable(q,indic,1.)
       endif
 
@@ -625,16 +719,23 @@
 
       REAL,  DIMENSION(:,:,:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
 C
       if (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif       
 C
       if (present(procname)) then
-      CALL Agrif_Interp_variable(q,tabvarsindic,procname)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.,procname)
-      else
-      CALL Agrif_Interp_variable(q,tabvarsindic)
-      CALL Agrif_Bc_variable(q,tabvarsindic,1.)
+      CALL Agrif_Interp_variable(q,indic,procname)
+      CALL Agrif_Bc_variable(q,indic,1.,procname)
+      else
+      CALL Agrif_Interp_variable(q,indic)
+      CALL Agrif_Bc_variable(q,indic,1.)
       endif
 
@@ -798,5 +899,5 @@
       External :: procname
       Optional ::  procname
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
 C        
       REAL, OPTIONAL :: calledweight
@@ -808,4 +909,11 @@
 C      
       If (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif         
       
       if ( PRESENT(calledweight) ) then
@@ -817,12 +925,12 @@
       endif
       
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
       parenttabvars => tabvars%parent_var
-      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
-      parenttabvars => Agrif_Curgrid % parent % tabvars(tabvarsindic)
-      roottabvars => Agrif_Mygrid % tabvars(tabvarsindic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
       endif
             
@@ -856,5 +964,5 @@
       External :: procname
       Optional ::  procname
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
 C        
       REAL, OPTIONAL :: calledweight
@@ -866,4 +974,11 @@
 C      
       If (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif       
       
       if ( PRESENT(calledweight) ) then
@@ -875,12 +990,12 @@
       endif
       
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
       parenttabvars => tabvars%parent_var
-      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
-      parenttabvars => Agrif_Curgrid % parent % tabvars(tabvarsindic)
-      roottabvars => Agrif_Mygrid % tabvars(tabvarsindic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
       endif
             
@@ -914,5 +1029,5 @@
       External :: procname
       Optional ::  procname
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
 C        
       REAL, OPTIONAL :: calledweight
@@ -924,4 +1039,11 @@
 C      
       If (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif       
       
       if ( PRESENT(calledweight) ) then
@@ -933,12 +1055,12 @@
       endif
       
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
       parenttabvars => tabvars%parent_var
-      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
-      parenttabvars => Agrif_Curgrid % parent % tabvars(tabvarsindic)
-      roottabvars => Agrif_Mygrid % tabvars(tabvarsindic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
       endif
             
@@ -972,5 +1094,5 @@
       External :: procname
       Optional ::  procname
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
 C        
       REAL, OPTIONAL :: calledweight
@@ -983,4 +1105,12 @@
       If (Agrif_Root()) Return
       
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif      
+      
       if ( PRESENT(calledweight) ) then
         weight=calledweight      
@@ -991,12 +1121,12 @@
       endif
       
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
       parenttabvars => tabvars%parent_var
-      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
-      parenttabvars => Agrif_Curgrid % parent % tabvars(tabvarsindic)
-      roottabvars => Agrif_Mygrid % tabvars(tabvarsindic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
       endif
             
@@ -1030,5 +1160,5 @@
       External :: procname
       Optional ::  procname
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
 C        
       REAL, OPTIONAL :: calledweight
@@ -1040,4 +1170,11 @@
 C      
       If (Agrif_Root()) Return
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif      
       
       if ( PRESENT(calledweight) ) then
@@ -1049,12 +1186,12 @@
       endif
       
-      if (tabvarsindic <=0) then
-      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-tabvarsindic)
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
       parenttabvars => tabvars%parent_var
-      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-tabvarsindic)
-      else
-      tabvars=>Agrif_Curgrid % tabvars(tabvarsindic)
-      parenttabvars => Agrif_Curgrid % parent % tabvars(tabvarsindic)
-      roottabvars => Agrif_Mygrid % tabvars(tabvarsindic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
       endif
             
@@ -1086,5 +1223,5 @@
 
       INTEGER :: tabvarsindic0 ! indice of the variable in tabvars
-      INTEGER :: tabvarsindic  ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic  ! indice of the variable in tabvars
       INTEGER :: dimensio  ! indice of the variable in tabvars
       External :: procname
@@ -1093,23 +1230,30 @@
       if (Agrif_Root()) Return
 C     
-      dimensio = Agrif_Mygrid % tabvars(tabvarsindic) % var % nbdim 
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif       
+C     
+      dimensio = Agrif_Mygrid % tabvars(indic) % var % nbdim 
 C
       if ( dimensio .EQ. 1 ) then
        if (present(procname)) then
        Call Agrif_Interp_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array1 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
        else
        Call Agrif_Interp_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array1 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
        endif
        endif
@@ -1118,18 +1262,18 @@
       if (present(procname)) then
        Call Agrif_Interp_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array2 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
       else
        Call Agrif_Interp_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array2 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
       endif
       endif
@@ -1138,18 +1282,18 @@
       if (present(procname)) then
        Call Agrif_Interp_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array3 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
       else
        Call Agrif_Interp_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array3 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
       endif
       endif
@@ -1158,18 +1302,18 @@
       if (present(procname)) then
        Call Agrif_Interp_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array4 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
       else
        Call Agrif_Interp_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array4 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
       endif
       endif
@@ -1178,18 +1322,18 @@
       if (present(procname)) then
        Call Agrif_Interp_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array5 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
       else
        Call Agrif_Interp_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array5 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
        endif
        endif
@@ -1198,18 +1342,18 @@
       if (present(procname)) then
        Call Agrif_Interp_6D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array6 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim,procname)
       else
        Call Agrif_Interp_6D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),
+     & Agrif_Mygrid % tabvars(indic) % var %  TypeInterp,
+     & Agrif_Curgrid % parent % tabvars(indic),
+     & Agrif_Curgrid % tabvars(indic),
      & Agrif_Curgrid % tabvars(tabvarsindic0) % var % array6 ,     
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & Agrif_Mygrid % tabvars(indic) % var % restaure,
+     & Agrif_Mygrid % tabvars(indic) %var % nbdim)
       endif
       endif
@@ -1225,24 +1369,44 @@
 
       REAL, DIMENSION(:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars      
 C
       if (Agrif_Root()) Return
 C      
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
       if (present(procname)) then
       Call Agrif_Interp_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim,procname)
       else
       Call Agrif_Interp_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim)
+     
       endif
       Return
@@ -1256,26 +1420,51 @@
 
       REAL,  DIMENSION(:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
-
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars      
 C
        if (Agrif_Root()) Return
-C
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      if (tabvars%var%restaure) then
+        if (agrif_curgrid%ngridstep == 0) then
+          call AGRIF_CopyFromold_AllOneVar
+     &            (Agrif_Curgrid,Agrif_OldMygrid,indic)
+        endif
+      endif
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+
+            
        if (present(procname)) then
        Call Agrif_Interp_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim,procname)
        else
        Call Agrif_Interp_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
-       endif
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim)
+     
+      endif 
       Return
       End Subroutine Agrif_Interp_var2d
@@ -1288,26 +1477,51 @@
 
       REAL,  DIMENSION(:,:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
-
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars      
 C
       if (Agrif_Root()) Return
-C
+C      
+
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      if (tabvars%var%restaure) then
+        if (agrif_curgrid%ngridstep == 0) then
+          call AGRIF_CopyFromold_AllOneVar
+     &            (Agrif_Curgrid,Agrif_OldMygrid,indic)
+        endif
+      endif      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+
       if (present(procname)) then
       Call Agrif_Interp_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim,procname)
       else
       Call Agrif_Interp_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
-      endif
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim)
+     
+      endif   
       Return
       End Subroutine Agrif_Interp_var3d
@@ -1320,26 +1534,51 @@
 
       REAL,  DIMENSION(:,:,:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
-
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars  
 C
       if (Agrif_Root()) Return
-C
+C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      if (tabvars%var%restaure) then
+        if (agrif_curgrid%ngridstep == 0) then
+          call AGRIF_CopyFromold_AllOneVar
+     &            (Agrif_Curgrid,Agrif_OldMygrid,indic)
+        endif
+      endif      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+            
       if (present(procname)) then
       Call Agrif_Interp_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim,procname)
       else
       Call Agrif_Interp_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
-      endif
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim)
+     
+      endif      
+
       Return
       End Subroutine Agrif_Interp_var4d     
@@ -1352,25 +1591,44 @@
 
       REAL,  DIMENSION(:,:,:,:,:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic, indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname
-
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars      
 C
       if (Agrif_Root()) Return
-C
+C      
+
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
       if (present(procname)) then
       Call Agrif_Interp_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim,procname)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim,procname)
       else
       Call Agrif_Interp_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var %  TypeInterp,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % restaure,
-     & Agrif_Mygrid % tabvars(tabvarsindic) %var % nbdim)
+     & roottabvars % var %  TypeInterp,
+     & parenttabvars,
+     & tabvars,q,
+     & roottabvars % var % restaure,
+     & roottabvars %var % nbdim)
+     
       endif
       Return
@@ -1538,5 +1796,5 @@
 
       REAL,  DIMENSION(:) :: q
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
       External :: procname
       Optional ::  procname      
@@ -1544,30 +1802,49 @@
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate1
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate2        
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars   
 C      
       if (Agrif_Root()) Return
 C     
+
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
       IF (present(locupdate)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:1) 
+      tabvars%var % updateinf(1:1) 
      &      = locupdate(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:1) 
+      tabvars%var % updatesup(1:1) 
      &      = locupdate(2)
       ELSE
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:1) 
+      tabvars%var % updateinf(1:1) 
      &      = -99
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:1) 
+      tabvars%var % updatesup(1:1) 
      &      = -99
       ENDIF
       
       IF (present(locupdate1)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1) 
+      tabvars%var % updateinf(1) 
      &      = locupdate1(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1) 
+      tabvars%var % updatesup(1) 
      &      = locupdate1(2)
       ENDIF  
       
       IF (present(locupdate2)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(2) 
+      tabvars%var % updateinf(2) 
      &      = locupdate2(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(2) 
+      tabvars%var % updatesup(2) 
      &      = locupdate2(2)
       ENDIF       
@@ -1575,17 +1852,17 @@
       IF (present(procname)) THEN
       Call Agrif_Update_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup,
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup,
      & procname)
-      ELSE
+      ELSE 
       Call Agrif_Update_1D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup)      
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup)       
       ENDIF
 
@@ -1607,32 +1884,50 @@
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate1
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate2        
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars       
 C      
       IF (Agrif_Root()) RETURN
       
 C 
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
       IF (present(locupdate)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:2) 
+      tabvars%var % updateinf(1:2) 
      &      = locupdate(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:2) 
+      tabvars%var % updatesup(1:2) 
      &      = locupdate(2)
       ELSE
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:2) 
+      tabvars%var % updateinf(1:2) 
      &      = -99
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:2) 
+      tabvars%var % updatesup(1:2) 
      &      = -99
       ENDIF
       
       IF (present(locupdate1)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1) 
+      tabvars%var % updateinf(1) 
      &      = locupdate1(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1) 
+      tabvars%var % updatesup(1) 
      &      = locupdate1(2)
       ENDIF  
       
       IF (present(locupdate2)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(2) 
+      tabvars%var % updateinf(2) 
      &      = locupdate2(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(2) 
+      tabvars%var % updatesup(2) 
      &      = locupdate2(2)
       ENDIF
@@ -1640,17 +1935,17 @@
       IF (present(procname)) THEN
       Call Agrif_Update_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup,
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup,
      & procname)
-      ELSE
+      ELSE 
       Call Agrif_Update_2D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup)      
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup)       
       ENDIF
 
@@ -1672,32 +1967,49 @@
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate1
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate2        
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars       
 C      
       IF (Agrif_Root()) RETURN 
 C      
-
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+      
       IF (present(locupdate)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:3) 
+      tabvars%var % updateinf(1:3) 
      &      = locupdate(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:3) 
+      tabvars%var % updatesup(1:3) 
      &      = locupdate(2)
       ELSE
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:3) 
+      tabvars%var % updateinf(1:3) 
      &      = -99
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:3) 
+      tabvars%var % updatesup(1:3) 
      &      = -99
       ENDIF      
       
       IF (present(locupdate1)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1) 
+      tabvars%var % updateinf(1) 
      &      = locupdate1(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1) 
+      tabvars%var % updatesup(1) 
      &      = locupdate1(2)
       ENDIF  
       
       IF (present(locupdate2)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(2) 
+      tabvars%var % updateinf(2) 
      &      = locupdate2(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(2) 
+      tabvars%var % updatesup(2) 
      &      = locupdate2(2)
       ENDIF
@@ -1705,17 +2017,17 @@
       IF (present(procname)) THEN
       Call Agrif_Update_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup,
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup,
      & procname)
-      ELSE
+      ELSE 
       Call Agrif_Update_3D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup)      
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup)       
       ENDIF
 
@@ -1737,31 +2049,48 @@
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate1
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate2        
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars       
 C      
       IF (Agrif_Root()) RETURN
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)     
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif      
 C      
       IF (present(locupdate)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:4) 
+      tabvars%var % updateinf(1:4) 
      &      = locupdate(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:4) 
+      tabvars%var % updatesup(1:4) 
      &      = locupdate(2)
       ELSE
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:4) 
+      tabvars%var % updateinf(1:4) 
      &      = -99
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:4) 
+      tabvars%var % updatesup(1:4) 
      &      = -99
       ENDIF
       
       IF (present(locupdate1)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1) 
+      tabvars%var % updateinf(1) 
      &      = locupdate1(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1) 
+      tabvars%var % updatesup(1) 
      &      = locupdate1(2)
       ENDIF  
       
       IF (present(locupdate2)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(2) 
+      tabvars%var % updateinf(2) 
      &      = locupdate2(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(2) 
+      tabvars%var % updatesup(2) 
      &      = locupdate2(2)
       ENDIF
@@ -1769,17 +2098,17 @@
       IF (present(procname)) THEN
       Call Agrif_Update_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup,
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup,
      & procname)
-      ELSE
+      ELSE 
       Call Agrif_Update_4D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup)      
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup)       
       ENDIF
 
@@ -1801,31 +2130,49 @@
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate1
       INTEGER, DIMENSION(2), OPTIONAL :: locupdate2        
-      INTEGER :: tabvarsindic ! indice of the variable in tabvars
+      INTEGER :: tabvarsindic,indic ! indice of the variable in tabvars
+      TYPE(Agrif_PVariable),Pointer ::tabvars,parenttabvars,roottabvars       
 C
       IF (Agrif_Root()) RETURN
 C      
+      indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif 
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      parenttabvars => tabvars%parent_var
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)      
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      parenttabvars => Agrif_Curgrid % parent % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+       
       IF (present(locupdate)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:5) 
+      tabvars%var % updateinf(1:5) 
      &      = locupdate(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:5) 
+      tabvars%var % updatesup(1:5) 
      &      = locupdate(2)
       ELSE
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1:5) 
+      tabvars%var % updateinf(1:5) 
      &      = -99
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1:5) 
+      tabvars%var % updatesup(1:5) 
      &      = -99
       ENDIF
       
       IF (present(locupdate1)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(1) 
+      tabvars%var % updateinf(1) 
      &      = locupdate1(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(1) 
+      tabvars%var % updatesup(1) 
      &      = locupdate1(2)
       ENDIF  
       
       IF (present(locupdate2)) THEN
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updateinf(2) 
+      tabvars%var % updateinf(2) 
      &      = locupdate2(1)
-      Agrif_Curgrid%tabvars(tabvarsindic)%var % updatesup(2) 
+      tabvars%var % updatesup(2) 
      &      = locupdate2(2)
       ENDIF
@@ -1833,17 +2180,17 @@
       IF (present(procname)) THEN
       Call Agrif_Update_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup,
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup,
      & procname)
-      ELSE
+      ELSE 
       Call Agrif_Update_5D(
-     & Agrif_Mygrid % tabvars(tabvarsindic) % var % typeupdate,
-     & Agrif_Curgrid % parent % tabvars(tabvarsindic),
-     & Agrif_Curgrid % tabvars(tabvarsindic),q,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updateinf,
-     & Agrif_Curgrid % tabvars(tabvarsindic) % var % updatesup)      
+     & roottabvars % var % typeupdate,
+     & parenttabvars,
+     & tabvars,q,
+     & tabvars % var % updateinf,
+     & tabvars % var % updatesup)       
       ENDIF
 
@@ -1952,97 +2299,6 @@
       End Subroutine Agrif_Flux_Correction
 
-      Subroutine Agrif_Declare_Variable(posvar,firstpoint,
-     &    raf,lb,ub,varid)
-      character*(80) :: variablename
-      Type(Agrif_List_Variables), Pointer :: newvariable,newvariablep
-      INTEGER, DIMENSION(:) :: posvar
-      INTEGER, DIMENSION(:) :: lb,ub
-      INTEGER, DIMENSION(:) :: firstpoint
-      CHARACTER(*) ,DIMENSION(:) :: raf        
-      TYPE(Agrif_Pvariable), Pointer :: parent_var,root_var
-      INTEGER :: dimensio
-      INTEGER :: varid
-            
-      if (agrif_root()) return
-
-      dimensio = SIZE(posvar)
-C
-C    
-      Allocate(newvariable)
-      Allocate(newvariable%pvar)
-      Allocate(newvariable%pvar%var)
-      Allocate(newvariable%pvar%var%posvar(dimensio))
-      Allocate(newvariable%pvar%var%interptab(dimensio))
-      newvariable%pvar%var%variablename = variablename
-      newvariable%pvar%var%interptab = raf
-      newvariable%pvar%var%nbdim = dimensio
-      newvariable%pvar%var%posvar = posvar
-      newvariable%pvar%var%point(1:dimensio) = firstpoint
-      newvariable%pvar%var%lb(1:dimensio) = lb(1:dimensio)
-      newvariable%pvar%var%ub(1:dimensio) = ub(1:dimensio)
-      
-      newvariable % nextvariable => Agrif_Curgrid%variables
-      
-      Agrif_Curgrid%variables => newvariable
-      Agrif_Curgrid%Nbvariables = Agrif_Curgrid%Nbvariables + 1
-      
-      varid = -Agrif_Curgrid%Nbvariables
-      
-       if (agrif_curgrid%parent%nbvariables < agrif_curgrid%nbvariables)
-     &       then
-      Allocate(newvariablep)
-      Allocate(newvariablep%pvar)
-      Allocate(newvariablep%pvar%var)      
-      Allocate(newvariablep%pvar%var%posvar(dimensio))
-      Allocate(newvariablep%pvar%var%interptab(dimensio))
-      newvariablep%pvar%var%variablename = variablename
-      newvariablep%pvar%var%interptab = raf
-      newvariablep%pvar%var%nbdim = dimensio
-      newvariablep%pvar%var%posvar = posvar
-      newvariablep%pvar%var%point(1:dimensio) = firstpoint
-      
-      newvariablep % nextvariable => Agrif_Curgrid%parent%variables
-      
-      Agrif_Curgrid%parent%variables => newvariablep       
-      
-      Agrif_Curgrid%parent%Nbvariables = 
-     &    Agrif_Curgrid%parent%Nbvariables + 1
-      parent_var=>newvariablep%pvar
-      else
-      parent_var=>Agrif_Search_Variable
-     &              (Agrif_Curgrid%parent,Agrif_Curgrid%nbvariables)
-       endif
-       
-       newvariable%pvar%parent_var=>parent_var
-      
-      root_var=>Agrif_Search_Variable
-     &              (Agrif_Mygrid,Agrif_Curgrid%nbvariables)
-     
-      newvariable%pvar%var%root_var=>root_var%var
-      
-           
-      End Subroutine Agrif_Declare_Variable
-
-      FUNCTION Agrif_Search_Variable(grid,varid)
-      integer :: varid
-      Type(Agrif_Pvariable), Pointer :: Agrif_Search_variable
-      Type(Agrif_grid), Pointer :: grid
-      
-      Type(Agrif_List_Variables), pointer :: parcours
-      Logical :: foundvariable
-      integer nb
-      
-      foundvariable = .FALSE.
-      parcours => grid%variables
-      
-      do nb=1,varid-1
-         parcours => parcours%nextvariable
-      End Do
-      
-      Agrif_Search_variable => parcours%pvar
-      
-      
-      End Function Agrif_Search_variable
-                              
+
+      
       Subroutine Agrif_Declare_Profile_flux(profilename,posvar,
      &    firstpoint,raf)
@@ -2071,5 +2327,122 @@
       
       End Subroutine Agrif_Declare_Profile_flux
+
+      Subroutine Agrif_Save_ForRestore0D(tabvarsindic0,tabvarsindic)
+      integer :: tabvarsindic0, tabvarsindic
+      integer :: dimensio
               
+      dimensio =  Agrif_Mygrid % tabvars(tabvarsindic0) % var % nbdim
+      
+      select case(dimensio)
+      case(2)
+          call Agrif_Save_ForRestore2D(
+     &      Agrif_Curgrid % tabvars(tabvarsindic0) % var % array2,
+     &      tabvarsindic)
+      case(3)
+          call Agrif_Save_ForRestore3D(
+     &      Agrif_Curgrid % tabvars(tabvarsindic0) % var % array3,
+     &      tabvarsindic)
+      case(4)
+          call Agrif_Save_ForRestore4D(
+     &      Agrif_Curgrid % tabvars(tabvarsindic0) % var % array4,
+     &      tabvarsindic)     
+      end select
+
+      Return
+      End Subroutine Agrif_Save_ForRestore0D 
+      
+    
+      
+      Subroutine Agrif_Save_ForRestore2D(q,tabvarsindic)
+      real,dimension(:,:) :: q
+      integer :: tabvarsindic, indic
+      TYPE(Agrif_PVariable),Pointer ::tabvars, roottabvars    
+ 
+       indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif      
+      if (.not.allocated(tabvars%var%array2)) then      
+      allocate(tabvars%var%array2(tabvars%var%lb(1):tabvars%var%ub(1),
+     &                            tabvars%var%lb(2):tabvars%var%ub(2)))
+      endif
+      tabvars%var%array2 = q
+      roottabvars%var%restaure = .true.
+      
+      Return
+      End Subroutine Agrif_Save_ForRestore2D  
+      
+      Subroutine Agrif_Save_ForRestore3D(q,tabvarsindic)
+      real,dimension(:,:,:) :: q
+      integer :: tabvarsindic, indic
+      TYPE(Agrif_PVariable),Pointer ::tabvars, roottabvars    
+ 
+       indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif      
+
+      if (.not.allocated(tabvars%var%array3)) then
+      allocate(tabvars%var%array3(tabvars%var%lb(1):tabvars%var%ub(1),
+     &                            tabvars%var%lb(2):tabvars%var%ub(2),
+     &                            tabvars%var%lb(3):tabvars%var%ub(3)))
+      endif
+      tabvars%var%array3 = q
+      roottabvars%var%restaure = .true.
+      
+      Return
+      End Subroutine Agrif_Save_ForRestore3D
+      
+      Subroutine Agrif_Save_ForRestore4D(q,tabvarsindic)
+      real,dimension(:,:,:,:) :: q
+      integer :: tabvarsindic, indic
+      TYPE(Agrif_PVariable),Pointer ::tabvars, roottabvars    
+ 
+       indic = tabvarsindic
+      if (tabvarsindic >=0) then
+        if (agrif_curgrid%tabvars(tabvarsindic)%var%nbdim == 0) then
+          indic = agrif_curgrid%tabvars(tabvarsindic)%var%iarray0
+        endif
+      endif
+      
+      if (indic <=0) then
+      tabvars => Agrif_Search_Variable(Agrif_Curgrid,-indic)
+      roottabvars => Agrif_Search_Variable(Agrif_Mygrid,-indic)
+      else
+      tabvars=>Agrif_Curgrid % tabvars(indic)
+      roottabvars => Agrif_Mygrid % tabvars(indic)
+      endif
+
+      if (.not.allocated(tabvars%var%array4)) then         
+      allocate(tabvars%var%array4(tabvars%var%lb(1):tabvars%var%ub(1),
+     &                            tabvars%var%lb(2):tabvars%var%ub(2),
+     &                            tabvars%var%lb(3):tabvars%var%ub(3),
+     &                            tabvars%var%lb(4):tabvars%var%ub(4)))
+      endif
+      tabvars%var%array4 = q
+      roottabvars%var%restaure = .true.
+      
+      Return
+      End Subroutine Agrif_Save_ForRestore4D                   
 C
       End module Agrif_bcfunction
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcluster.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcluster.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcluster.F	(revision 2715)
@@ -1166,4 +1166,11 @@
 C
         newgrid % parent => g      
+
+C       Level of the current grid
+        newgrid % level = newgrid % parent % level + 1
+        if (newgrid % level > Agrif_MaxLevelLoc) then
+          Agrif_MaxLevelLoc = newgrid%level
+        endif
+
 C      
 C       Grid pointed by newgrid is a fixed grid      
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcurgridfunctions.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcurgridfunctions.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modcurgridfunctions.F	(revision 2715)
@@ -684,8 +684,8 @@
       
 C
-C
-      AGRIF_saveCURGRID => AGRIF_CURGRID
-C
-      Call AGRIF_INSTANCE(AGRIF_CURGRID%parent)            
+      
+      Agrif_Curgrid%Parent%save_grid => Agrif_Curgrid
+C
+      Call Agrif_Instance(Agrif_Curgrid%parent)            
 C
 C
@@ -709,5 +709,5 @@
 C
 C
-      Call AGRIF_INSTANCE(AGRIF_saveCURGRID)            
+      Call Agrif_Instance(Agrif_Curgrid%save_grid)
 C
 C
@@ -737,5 +737,5 @@
       INTEGER :: iii,out,iiimax
       Logical :: BEXIST
-      INTEGER,DIMENSION(1:10) :: ForbiddenUnit
+      INTEGER,DIMENSION(1:1000) :: ForbiddenUnit
 C
 C
@@ -967,4 +967,24 @@
       MaxSearch = mymaxsearch
       end subroutine Agrif_Set_MaskMaxSearch
+      
+C *****************************************************************
+CCC  subroutine Agrif_Level
+C *****************************************************************
+      Function Agrif_Level()
+      Integer :: Agrif_Level
+     
+      Agrif_Level = Agrif_Curgrid % level
+     
+      End Function Agrif_Level
+      
+C *****************************************************************
+CCC  subroutine Agrif_MaxLevel
+C *****************************************************************
+      Function Agrif_MaxLevel()
+      Integer :: Agrif_MaxLevel
+     
+      Agrif_MaxLevel = Agrif_MaxLevelLoc
+     
+      End Function Agrif_MaxLevel      
 
       End Module Agrif_CurgridFunctions 
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinit.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinit.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinit.F	(revision 2715)
@@ -135,5 +135,5 @@
          Agrif_Gr % tabvars(i) % var % nbdim = 0
 C
-         if (associated(Agrif_Gr%tabvars(i)%var%array1)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array1)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 1
              Agrif_Gr % tabvars(i) % var % lb(1:1) = 
@@ -142,5 +142,5 @@
      &         ubound(Agrif_Gr%tabvars(i)%var%array1)     
          endif
-         if (associated(Agrif_Gr%tabvars(i)%var%array2)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array2)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 2
              Agrif_Gr % tabvars(i) % var % lb(1:2) = 
@@ -149,5 +149,5 @@
      &         ubound(Agrif_Gr%tabvars(i)%var%array2)
          endif
-         if (associated(Agrif_Gr%tabvars(i)%var%array3)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array3)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 3
              Agrif_Gr % tabvars(i) % var % lb(1:3) = 
@@ -156,5 +156,5 @@
      &         ubound(Agrif_Gr%tabvars(i)%var%array3)
          endif
-         if (associated(Agrif_Gr%tabvars(i)%var%array4)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array4)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 4
              Agrif_Gr % tabvars(i) % var % lb(1:4) = 
@@ -163,5 +163,5 @@
      &         ubound(Agrif_Gr%tabvars(i)%var%array4)
          endif
-         if (associated(Agrif_Gr%tabvars(i)%var%array5)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array5)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 5
              Agrif_Gr % tabvars(i) % var % lb(1:5) = 
@@ -170,5 +170,5 @@
      &         ubound(Agrif_Gr%tabvars(i)%var%array5)
          endif
-         if (associated(Agrif_Gr%tabvars(i)%var%array6)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%array6)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 6
              Agrif_Gr % tabvars(i) % var % lb(1:6) = 
@@ -178,65 +178,65 @@
          endif
 C
-         if (associated(Agrif_Gr%tabvars(i)%var%darray1)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 1
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%darray2)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 2
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%darray3)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 3
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%darray4)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 4
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%darray5)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 5
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%darray6)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 6
-         endif
-C
-         if (associated(Agrif_Gr%tabvars(i)%var%larray1)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 1
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%larray2)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 2
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%larray3)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 3
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%larray4)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 4
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%larray5)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 5
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%larray6)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 6
-         endif
-C
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray1)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 1
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray2)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 2
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray3)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 3
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray4)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 4
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray5)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 5
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%iarray6)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 6
-         endif
-C
-         if (associated(Agrif_Gr%tabvars(i)%var%carray1)) then
-             Agrif_Gr % tabvars(i) % var % nbdim = 1
-         endif
-         if (associated(Agrif_Gr%tabvars(i)%var%carray2)) then
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray1)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 1
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray2)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 2
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray3)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 3
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray4)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 4
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray5)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 5
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%darray6)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 6
+         endif
+C
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray1)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 1
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray2)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 2
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray3)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 3
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray4)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 4
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray5)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 5
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%larray6)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 6
+         endif
+C
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray1)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 1
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray2)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 2
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray3)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 3
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray4)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 4
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray5)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 5
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%iarray6)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 6
+         endif
+C
+         if (allocated(Agrif_Gr%tabvars(i)%var%carray1)) then
+             Agrif_Gr % tabvars(i) % var % nbdim = 1
+         endif
+         if (allocated(Agrif_Gr%tabvars(i)%var%carray2)) then
              Agrif_Gr % tabvars(i) % var % nbdim = 2
          endif
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterp.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterp.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterp.F	(revision 2715)
@@ -89,5 +89,5 @@
 C
 C     Tab is the result of the interpolation
-      childtemp % var % array1 => tab 
+      childtemp % var % parray1 => tab 
       
       childtemp % var % lb = child % var % lb
@@ -97,5 +97,5 @@
       if (torestore) then
 C 
-          childtemp % var % array1 = child % var % array1
+          childtemp % var % parray1 = child % var % array1
 C          
           childtemp % var % restore1D => child % var % restore1D
@@ -171,5 +171,5 @@
 C
 C     Tab is the result of the interpolation
-      childtemp % var % array2 => tab  
+      childtemp % var % parray2 => tab  
       
       childtemp % var % lb = child % var % lb
@@ -179,5 +179,5 @@
       if (torestore) then      
 C 
-          childtemp % var % array2 = child % var % array2          
+          childtemp % var % parray2 = child % var % array2          
 C 
           childtemp % var % restore2D => child % var % restore2D        
@@ -255,5 +255,5 @@
 C     
 C     Tab is the result of the interpolation 
-      childtemp % var % array3 => tab 
+      childtemp % var % parray3 => tab 
       
       childtemp % var % lb = child % var % lb
@@ -262,5 +262,5 @@
       if (torestore) then
 C     
-          childtemp % var % array3 = child % var % array3
+          childtemp % var % parray3 = child % var % array3
 C
           childtemp % var % restore3D => child % var % restore3D
@@ -341,5 +341,5 @@
 C      
 C     Tab is the result of the interpolation
-      childtemp % var % array4 => tab 
+      childtemp % var % parray4 => tab 
       
       childtemp % var % lb = child % var % lb
@@ -349,5 +349,5 @@
       if (torestore) then
 C 
-          childtemp % var % array4 = child % var % array4
+          childtemp % var % parray4 = child % var % array4
 C
           childtemp % var % restore4D => child % var % restore4D
@@ -428,5 +428,5 @@
 C      
 C     Tab is the result of the interpolation
-      childtemp % var % array5 => tab  
+      childtemp % var % parray5 => tab  
       
       childtemp % var % lb = child % var % lb
@@ -436,5 +436,5 @@
       if (torestore) then
 C 
-          childtemp % var % array5 = child % var % array5
+          childtemp % var % parray5 = child % var % array5
 C
           childtemp % var % restore5D => child % var % restore5D
@@ -516,5 +516,5 @@
 C      
 C     Tab is the result of the interpolation
-      childtemp % var % array6 => tab  
+      childtemp % var % parray6 => tab  
       
       childtemp % var % lb = child % var % lb
@@ -524,5 +524,5 @@
       if (torestore) then
 C 
-          childtemp % var % array6 = child % var % array6
+          childtemp % var % parray6 = child % var % array6
 C
           childtemp % var % restore6D => child % var % restore6D
@@ -835,6 +835,4 @@
 
       Call Agrif_nbdim_Full_VarEQreal(tempP%var,0.,nbdim)
-
-
 
       IF (present(procname)) THEN
@@ -894,5 +892,5 @@
 C
       Call MPI_ALLGATHER(tab3,4*nbdim,MPI_INTEGER,tab4,4*nbdim,
-     &                   MPI_INTEGER,MPI_COMM_AGRIF,code)
+     &                   MPI_INTEGER,MPI_COMM_WORLD,code)
 
       IF (.not.associated(tempPextend%var)) Allocate(tempPextend%var)
@@ -908,5 +906,5 @@
       memberin1(1) = memberin
       CALL MPI_ALLGATHER(memberin1,1,MPI_LOGICAL,memberinall,
-     &                  1,MPI_LOGICAL,MPI_COMM_AGRIF,code)
+     &                  1,MPI_LOGICAL,MPI_COMM_WORLD,code)
 
        Call Get_External_Data_first(tab4t(:,:,1),
@@ -1161,5 +1159,5 @@
            do i = pttruetab(1),cetruetab(1)         
             if (restore%var%restore1D(i) == 0)
-     &            child % var % array1(i) = 
+     &            child % var % parray1(i) = 
      &            tempC % var % array1(i)    
           enddo
@@ -1168,5 +1166,5 @@
              do i = pttruetab(1),cetruetab(1) 
               if (restore%var%restore2D(i,j) == 0)     
-     &              child % var % array2(i,j) = 
+     &              child % var % parray2(i,j) = 
      &              tempC % var % array2(i,j)    
               enddo
@@ -1177,5 +1175,5 @@
              do i = pttruetab(1),cetruetab(1) 
               if (restore%var%restore3D(i,j,k) == 0)
-     &                  child % var % array3(i,j,k) =
+     &                  child % var % parray3(i,j,k) =
      &                  tempC % var % array3(i,j,k)    
                   enddo
@@ -1188,5 +1186,5 @@
              do i = pttruetab(1),cetruetab(1)
                 if (restore%var%restore4D(i,j,k,l) == 0)
-     &                 child % var % array4(i,j,k,l) = 
+     &                 child % var % parray4(i,j,k,l) = 
      &                 tempC % var % array4(i,j,k,l)    
              enddo
@@ -1201,5 +1199,5 @@
              do i = pttruetab(1),cetruetab(1)
                 if (restore%var%restore5D(i,j,k,l,m) == 0)
-     &                  child % var % array5(i,j,k,l,m) = 
+     &                  child % var % parray5(i,j,k,l,m) = 
      &                  tempC % var % array5(i,j,k,l,m)    
              enddo
@@ -1216,5 +1214,5 @@
              do i = pttruetab(1),cetruetab(1)
                 if (restore%var%restore6D(i,j,k,l,m,n) == 0)
-     &                      child % var % array6(i,j,k,l,m,n) = 
+     &                      child % var % parray6(i,j,k,l,m,n) = 
      &                      tempC % var % array6(i,j,k,l,m,n)    
              enddo
@@ -1234,13 +1232,13 @@
           SELECT CASE (nbdim)
           CASE (1)
-            child%var%array1(childarray(1,1,2):childarray(1,2,2)) =
+            child%var%parray1(childarray(1,1,2):childarray(1,2,2)) =
      &       tempC%var%array1(childarray(1,1,1):childarray(1,2,1))
           CASE (2)
-            child%var%array2(childarray(1,1,2):childarray(1,2,2),
+            child%var%parray2(childarray(1,1,2):childarray(1,2,2),
      &                       childarray(2,1,2):childarray(2,2,2)) =
      &      tempC%var%array2(childarray(1,1,1):childarray(1,2,1),
      &                       childarray(2,1,1):childarray(2,2,1))
           CASE (3)
-            child%var%array3(childarray(1,1,2):childarray(1,2,2),
+            child%var%parray3(childarray(1,1,2):childarray(1,2,2),
      &                       childarray(2,1,2):childarray(2,2,2),
      &                       childarray(3,1,2):childarray(3,2,2)) =
@@ -1249,5 +1247,5 @@
      &                       childarray(3,1,1):childarray(3,2,1))
           CASE (4)
-            child%var%array4(childarray(1,1,2):childarray(1,2,2),
+            child%var%parray4(childarray(1,1,2):childarray(1,2,2),
      &                       childarray(2,1,2):childarray(2,2,2),
      &                       childarray(3,1,2):childarray(3,2,2),
@@ -1258,5 +1256,5 @@
      &                       childarray(4,1,1):childarray(4,2,1))
           CASE (5)
-            child%var%array5(childarray(1,1,2):childarray(1,2,2),
+            child%var%parray5(childarray(1,1,2):childarray(1,2,2),
      &                       childarray(2,1,2):childarray(2,2,2),
      &                       childarray(3,1,2):childarray(3,2,2),
@@ -1269,5 +1267,5 @@
      &                       childarray(5,1,1):childarray(5,2,1))
           CASE (6)
-            child%var%array6(childarray(1,1,2):childarray(1,2,2),
+            child%var%parray6(childarray(1,1,2):childarray(1,2,2),
      &                       childarray(2,1,2):childarray(2,2,2),
      &                       childarray(3,1,2):childarray(3,2,2),
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterpbasic.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterpbasic.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modinterpbasic.F	(revision 2715)
@@ -113,8 +113,8 @@
            locind_parent_left = locind_parent_left + 1.
            globind_parent_right = globind_parent_right + 1.
+           ypos2 = ypos*invds+(i-1)*invds2           
         endif
         
         diff=(globind_parent_right - ypos2)
-        
         y(i) = (diff*x(locind_parent_left)
      &        + (1.-diff)*x(locind_parent_left+1))
@@ -170,5 +170,5 @@
       Real, Dimension(:,:), Allocatable :: coeffparent_tmp
       REAL    :: ypos,globind_parent_left,globind_parent_right
-      REAL    :: invds, invds2
+      REAL    :: invds, invds2, invds3
       REAL :: ypos2,diff
 C
@@ -189,4 +189,5 @@
       invds = 1./ds_parent
       invds2 = ds_child/ds_parent
+      invds3 = 0.5/real(coeffraf)
 
       ypos2 = ypos*invds
@@ -216,8 +217,11 @@
            locind_parent_left = locind_parent_left + 1
            globind_parent_right = globind_parent_right + 1.
+           ypos2 = ypos*invds+(i-1)*invds2
         endif
-        
+
         diff=(globind_parent_right - ypos2)
+        diff = invds3*nint(2*coeffraf*diff)
         indparent(i,dir) = locind_parent_left
+
         coeffparent(i,dir) = diff
         
@@ -238,7 +242,8 @@
 C      
        indparent(nc,dir) = locind_parent_left
-       
-         coeffparent(nc,dir) = (globind_parent_left + ds_parent - ypos)
+       diff = (globind_parent_left + ds_parent - ypos)
      &       * invds
+        diff = invds3*nint(2*coeffraf*diff)
+         coeffparent(nc,dir) = diff
       endif                                           
 
@@ -280,5 +285,5 @@
       INTEGER :: i,coeffraf,locind_parent_left
       REAL    :: ypos,globind_parent_left,globind_parent_right
-      REAL    :: invds, invds2
+      REAL    :: invds, invds2, invds3
       REAL :: ypos2,diff
 C
@@ -305,4 +310,5 @@
       invds = 1./ds_parent
       invds2 = ds_child/ds_parent
+      invds3 = 0.5/real(coeffraf)      
       
       ypos2 = ypos*invds
@@ -323,8 +329,13 @@
            locind_parent_left = locind_parent_left + 1
            globind_parent_right = globind_parent_right + 1.
+           ypos2 = ypos*invds+(i-1)*invds2           
         endif
         
         diff=(globind_parent_right - ypos2)
+        
+        diff = invds3*nint(2*coeffraf*diff)
+                
         indparent(i,1) = locind_parent_left
+
         coeffparent(i,1) = diff
         ypos2 = ypos2 + invds2
@@ -345,6 +356,8 @@
        indparent(nc,1) = locind_parent_left
        
-         coeffparent(nc,1) = (globind_parent_left + ds_parent - ypos)
+       diff = (globind_parent_left + ds_parent - ypos)
      &       * invds
+        diff = invds3*nint(2*coeffraf*diff)
+         coeffparent(nc,1) = diff
       endif                                          
 C           
@@ -462,5 +475,7 @@
      &                        + (locind_parent_left - 1)*ds_parent 
      
-        deltax = invdsparent*(ypos-globind_parent_left)
+C        deltax = invdsparent*(ypos-globind_parent_left)
+        deltax = nint(coeffraf*deltax)/real(coeffraf)
+        
         ypos = ypos + ds_child
          if (abs(deltax).LE.0.0001) then
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modlinktomodel.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modlinktomodel.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modlinktomodel.F	(revision 2715)
@@ -32,5 +32,4 @@
         external Agrif_probdim_modtype_def
         external Agrif_clustering_def
-        external Agrif_comm_def
 C     Interface                       
       Interface
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modmpp.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modmpp.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modmpp.F	(revision 2715)
@@ -67,5 +67,5 @@
 
          CALL MPI_ALLGATHER(memberout1,1,MPI_LOGICAL,memberoutall,
-     &                  1,MPI_LOGICAL,MPI_COMM_AGRIF,code)
+     &                  1,MPI_LOGICAL,MPI_COMM_WORLD,code)
         ENDIF
          pttruetab2(:,Agrif_Procrank) = pttruetab(:,Agrif_Procrank)
@@ -207,5 +207,5 @@
 
          CALL MPI_ALLGATHER(memberout1,1,MPI_LOGICAL,memberoutall,
-     &                  1,MPI_LOGICAL,MPI_COMM_AGRIF,code)
+     &                  1,MPI_LOGICAL,MPI_COMM_WORLD,code)
         ENDIF
          pttruetab2(:,Agrif_Procrank) = pttruetab(:,Agrif_Procrank)
@@ -356,5 +356,5 @@
 C
             Call MPI_SEND(sendtoproc(k),1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,code)
+     &                    MPI_COMM_WORLD,code)
 C
             if (sendtoproc(k)) then
@@ -365,5 +365,5 @@
                 Call MPI_SEND(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
 C
                 datasize = 1
@@ -381,5 +381,5 @@
      &                        imin(1,k):imax(1,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(2)
                    Call MPI_SEND(tempC%var%array2(
@@ -387,5 +387,5 @@
      &                        imin(2,k):imax(2,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(3)
                 
@@ -399,5 +399,5 @@
      &                        imin(4,k):imax(4,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(5)
                    Call MPI_SEND(tempC%var%array5(
@@ -408,5 +408,5 @@
      &                        imin(5,k):imax(5,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(6)
                    Call MPI_SEND(tempC%var%array6(
@@ -418,5 +418,5 @@
      &                        imin(6,k):imax(6,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 END SELECT
 C
@@ -432,5 +432,5 @@
 C
             Call MPI_RECV(res,1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,statut,code)
+     &                    MPI_COMM_WORLD,statut,code)
 C
             recvfromproc(k) = res
@@ -441,5 +441,5 @@
                 Call MPI_RECV(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,statut,code)
+     &                        MPI_COMM_WORLD,statut,code)
 
                 imin_recv(:,k) = iminmax_temp(:,1,k)
@@ -462,26 +462,26 @@
               Call MPI_RECV(temprecv%var%array1,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(2)
               Call MPI_RECV(temprecv%var%array2,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(3)
               Call MPI_RECV(temprecv%var%array3,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
 
             CASE(4)
               Call MPI_RECV(temprecv%var%array4,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(5)
               Call MPI_RECV(temprecv%var%array5,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(6)
               Call MPI_RECV(temprecv%var%array6,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
        END SELECT
                         
@@ -503,5 +503,5 @@
             
             Call MPI_SEND(sendtoproc(k),1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,code)
+     &                    MPI_COMM_WORLD,code)
 C
             if (sendtoproc(k)) then
@@ -512,5 +512,5 @@
                 Call MPI_SEND(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
 C
                 SELECT CASE(nbdim)
@@ -521,5 +521,5 @@
      &                        imin(1,k):imax(1,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(2)
                 datasize=SIZE(tempC%var%array2(
@@ -530,5 +530,5 @@
      &                        imin(2,k):imax(2,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(3)
                 datasize=SIZE(tempC%var%array3(
@@ -541,5 +541,5 @@
      &                        imin(3,k):imax(3,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(4)
                 datasize=SIZE(tempC%var%array4(
@@ -554,5 +554,5 @@
      &                        imin(4,k):imax(4,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(5)
                 datasize=SIZE(tempC%var%array5(
@@ -569,5 +569,5 @@
      &                        imin(5,k):imax(5,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(6)
                 datasize=SIZE(tempC%var%array6(
@@ -586,5 +586,5 @@
      &                        imin(6,k):imax(6,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 END SELECT
 C
@@ -600,5 +600,5 @@
 C
             Call MPI_RECV(res,1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,statut,code)
+     &                    MPI_COMM_WORLD,statut,code)
 C
             recvfromproc(k) = res
@@ -609,5 +609,5 @@
                 Call MPI_RECV(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,statut,code)
+     &                        MPI_COMM_WORLD,statut,code)
 
 C                imin_recv(:,k) = iminmax_temp(:,1,k)
@@ -629,15 +629,15 @@
               Call MPI_RECV(temprecv%var%array1,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(2)
               datasize=SIZE(temprecv%var%array2)
               Call MPI_RECV(temprecv%var%array2,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(3)
               datasize=SIZE(temprecv%var%array3)
               Call MPI_RECV(temprecv%var%array3,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
 
             CASE(4)
@@ -645,15 +645,15 @@
               Call MPI_RECV(temprecv%var%array4,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(5)
               datasize=SIZE(temprecv%var%array5)
               Call MPI_RECV(temprecv%var%array5,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(6)
               datasize=SIZE(temprecv%var%array6)
               Call MPI_RECV(temprecv%var%array6,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
           END SELECT
             
@@ -693,5 +693,5 @@
 C
             Call MPI_SEND(sendtoproc(k),1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,code)
+     &                    MPI_COMM_WORLD,code)
 C
             if (sendtoproc(k)) then
@@ -702,5 +702,5 @@
                 Call MPI_SEND(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
 C
             endif
@@ -715,5 +715,5 @@
 C
             Call MPI_RECV(res,1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,statut,code)
+     &                    MPI_COMM_WORLD,statut,code)
 C
             recvfromproc(k) = res
@@ -724,5 +724,5 @@
                 Call MPI_RECV(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,statut,code)
+     &                        MPI_COMM_WORLD,statut,code)
 
                 imin_recv(:,k) = iminmax_temp(:,1,k)
@@ -739,5 +739,5 @@
             
             Call MPI_SEND(sendtoproc(k),1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,code)
+     &                    MPI_COMM_WORLD,code)
 C
             if (sendtoproc(k)) then
@@ -748,5 +748,5 @@
                 Call MPI_SEND(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
 C
             endif
@@ -761,5 +761,5 @@
 C
             Call MPI_RECV(res,1,MPI_LOGICAL,k,etiquette,
-     &                    MPI_COMM_AGRIF,statut,code)
+     &                    MPI_COMM_WORLD,statut,code)
 C
             recvfromproc(k) = res
@@ -770,5 +770,5 @@
                 Call MPI_RECV(iminmax_temp(:,:,k),
      &                        2*nbdim,MPI_INTEGER,k,etiquette,
-     &                        MPI_COMM_AGRIF,statut,code)
+     &                        MPI_COMM_WORLD,statut,code)
 
                 imin_recv(:,k) = iminmax_temp(:,1,k)
@@ -842,5 +842,5 @@
      &                        imin(1,k):imax(1,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(2)               
                    Call MPI_SEND(tempC%var%array2(
@@ -848,5 +848,5 @@
      &                        imin(2,k):imax(2,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(3)
      
@@ -860,5 +860,5 @@
      &                        imin(4,k):imax(4,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(5)
                    Call MPI_SEND(tempC%var%array5(
@@ -869,5 +869,5 @@
      &                        imin(5,k):imax(5,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(6)
                    Call MPI_SEND(tempC%var%array6(
@@ -879,5 +879,5 @@
      &                        imin(6,k):imax(6,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 END SELECT
 C
@@ -910,26 +910,26 @@
               Call MPI_RECV(temprecv%var%array1,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(2)           
               Call MPI_RECV(temprecv%var%array2,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(3)       
               Call MPI_RECV(temprecv%var%array3,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
 
             CASE(4)
               Call MPI_RECV(temprecv%var%array4,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(5)
               Call MPI_RECV(temprecv%var%array5,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(6)
               Call MPI_RECV(temprecv%var%array6,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
        END SELECT
                         
@@ -958,5 +958,5 @@
      &                        imin(1,k):imax(1,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(2)                
                 datasize=SIZE(tempC%var%array2(
@@ -967,5 +967,5 @@
      &                        imin(2,k):imax(2,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(3)
                 datasize=SIZE(tempC%var%array3(
@@ -978,5 +978,5 @@
      &                        imin(3,k):imax(3,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(4)
                 datasize=SIZE(tempC%var%array4(
@@ -991,5 +991,5 @@
      &                        imin(4,k):imax(4,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(5)
                 datasize=SIZE(tempC%var%array5(
@@ -1006,5 +1006,5 @@
      &                        imin(5,k):imax(5,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 CASE(6)
                 datasize=SIZE(tempC%var%array6(
@@ -1023,5 +1023,5 @@
      &                        imin(6,k):imax(6,k)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
                 END SELECT
 C
@@ -1047,15 +1047,15 @@
               Call MPI_RECV(temprecv%var%array1,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(2)           
               datasize=SIZE(temprecv%var%array2)
               Call MPI_RECV(temprecv%var%array2,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(3)           
               datasize=SIZE(temprecv%var%array3)
               Call MPI_RECV(temprecv%var%array3,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
 
             CASE(4)
@@ -1063,15 +1063,15 @@
               Call MPI_RECV(temprecv%var%array4,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(5)
               datasize=SIZE(temprecv%var%array5)
               Call MPI_RECV(temprecv%var%array5,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
             CASE(6)
               datasize=SIZE(temprecv%var%array6)
               Call MPI_RECV(temprecv%var%array6,
      &               datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &               MPI_COMM_AGRIF,statut,code)
+     &               MPI_COMM_WORLD,statut,code)
           END SELECT
             
@@ -1108,5 +1108,5 @@
      &                        imin(3):imax(3)),
      &                        datasize,MPI_DOUBLE_PRECISION,k,etiquette,
-     &                        MPI_COMM_AGRIF,code)
+     &                        MPI_COMM_WORLD,code)
      
          End Subroutine Agrif_Send_3Darray
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modsauv.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modsauv.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modsauv.F	(revision 2715)
@@ -35,4 +35,5 @@
       Use Agrif_Link
       Use Agrif_Arrays
+      Use Agrif_Variables
 C
       IMPLICIT NONE
@@ -42,4 +43,107 @@
 C
 C
+      Subroutine Agrif_Deallocate_Arrays(Var)
+      type(Agrif_Variable), pointer :: Var
+      
+            if (ALLOCATED(var%array1)) then
+               Deallocate(var%array1)
+            endif
+            if (ALLOCATED(var%array2)) then
+               Deallocate(var%array2)
+            endif
+            if (ALLOCATED(var%array3)) then
+               Deallocate(var%array3)
+            endif
+            if (ALLOCATED(var%array4)) then
+               Deallocate(var%array4)
+            endif
+            if (ALLOCATED(var%array5)) then
+               Deallocate(var%array5)
+            endif
+            if (ALLOCATED(var%array6)) then
+               Deallocate(var%array6)
+            endif
+C
+            if (ALLOCATED(var%darray1)) then
+               Deallocate(var%darray1)
+            endif
+            if (ALLOCATED(var%darray2)) then
+               Deallocate(var%darray2)
+            endif
+            if (ALLOCATED(var%darray3)) then
+               Deallocate(var%darray3)
+            endif
+            if (ALLOCATED(var%darray4)) then
+               Deallocate(var%darray4)
+            endif
+            if (ALLOCATED(var%darray5)) then
+               Deallocate(var%darray5)
+            endif
+            if (ALLOCATED(var%darray6)) then
+               Deallocate(var%darray6)
+            endif
+C
+            if (ALLOCATED(var%larray1)) then
+               Deallocate(var%larray1)
+            endif
+            if (ALLOCATED(var%larray2)) then
+               Deallocate(var%larray2)
+            endif
+            if (ALLOCATED(var%larray3)) then
+               Deallocate(var%larray3)
+            endif
+            if (ALLOCATED(var%larray4)) then
+               Deallocate(var%larray4)
+            endif
+            if (ALLOCATED(var%larray5)) then
+               Deallocate(var%larray5)
+            endif
+            if (ALLOCATED(var%larray6)) then
+               Deallocate(var%larray6)
+            endif
+C
+            if (ALLOCATED(var%iarray1)) then
+               Deallocate(var%iarray1)
+            endif
+            if (ALLOCATED(var%iarray2)) then
+               Deallocate(var%iarray2)
+            endif
+            if (ALLOCATED(var%iarray3)) then
+               Deallocate(var%iarray3)
+            endif
+            if (ALLOCATED(var%iarray4)) then
+               Deallocate(var%iarray4)
+            endif
+            if (ALLOCATED(var%iarray5)) then
+               Deallocate(var%iarray5)
+            endif
+            if (ALLOCATED(var%iarray6)) then
+               Deallocate(var%iarray6)
+            endif
+C
+            if (ALLOCATED(var%carray1)) then
+               Deallocate(var%carray1)
+            endif
+            if (ALLOCATED(var%carray2)) then
+               Deallocate(var%carray2)
+            endif
+C
+            if (associated(var%oldvalues2D)) then
+               Deallocate(var%oldvalues2D)
+            endif
+            if (associated(var%interpIndex)) then
+               Deallocate(var%interpIndex)
+            endif
+            
+            if (associated(var%posvar)) then
+               Deallocate(var%posvar)
+            endif     
+            
+            if (associated(var%interptab)) then
+               Deallocate(var%interptab)
+            endif
+            
+      Return
+      End Subroutine Agrif_Deallocate_Arrays    
 C
 C     **************************************************************************
@@ -62,4 +166,5 @@
       TYPE(Agrif_Grid),pointer   :: Agrif_Gr ! Pointer on the current grid
       INTEGER i 
+      Type(Agrif_List_Variables), pointer :: parcours      
 C
 C   
@@ -67,101 +172,5 @@
          if ( .NOT. Agrif_Mygrid % tabvars(i) % var % restaure) then
 C 
-            if (associated(Agrif_Gr%tabvars(i)%var%array1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array6)
-            endif
-C
-            if (associated(Agrif_Gr%tabvars(i)%var%darray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray6)
-            endif
-C
-            if (associated(Agrif_Gr%tabvars(i)%var%larray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray6)
-            endif
-C
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray6)
-            endif
-C
-            if (associated(Agrif_Gr%tabvars(i)%var%carray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%carray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%carray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%carray2)
-            endif
-C
-            if (associated(Agrif_Gr%tabvars(i)%var%oldvalues2D)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%oldvalues2D)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%interpIndex)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%interpIndex)
-            endif
-            
-            if (associated(Agrif_Gr%tabvars(i)%var%posvar)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%posvar)
-            endif     
-            
-            if (associated(Agrif_Gr%tabvars(i)%var%interptab)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%interptab)
-            endif  
+            call Agrif_Deallocate_Arrays(Agrif_Gr%tabvars(i)%var)
             
        endif
@@ -177,4 +186,22 @@
 C 
         endif
+      enddo
+      
+      parcours => Agrif_Gr%variables
+    
+      do i=1,Agrif_Gr%NbVariables
+       if (.NOT. parcours%pvar%var%root_var%restaure) then
+        call Agrif_Deallocate_Arrays(parcours%pvar%var)
+       endif
+        if (associated(parcours%pvar%var%list_interp)) then
+           Call Agrif_Free_list_interp
+     &                          (parcours%pvar%var%list_interp)
+         endif                             
+C
+       if ( .NOT. parcours%pvar%var%root_var % restaure) then
+            Deallocate(parcours%pvar%var)
+C 
+        endif
+        parcours => parcours%nextvariable
       enddo
 C
@@ -231,111 +258,31 @@
       TYPE(Agrif_Grid),pointer   :: Agrif_Gr  ! Pointer on the current grid
       INTEGER i
+      Type(Agrif_List_Variables), pointer :: parcours, rootparcours
 C
 C      
       do i = 1 , AGRIF_NbVariables
          if ( Agrif_Mygrid % tabvars(i) % var % restaure) then
-C 
-            if (associated(Agrif_Gr%tabvars(i)%var%array1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%array6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%array6)
-            endif
-!
-            if (associated(Agrif_Gr%tabvars(i)%var%darray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%darray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%darray6)
-            endif
-!
-            if (associated(Agrif_Gr%tabvars(i)%var%larray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%larray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%larray6)
-            endif
-!
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray2)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray3)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray3)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray4)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray4)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray5)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray5)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%iarray6)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%iarray6)
-            endif
-!
-            if (associated(Agrif_Gr%tabvars(i)%var%carray1)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%carray1)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%carray2)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%carray2)
-            endif
-!
-            if (associated(Agrif_Gr%tabvars(i)%var%oldvalues2D)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%oldvalues2D)
-            endif
-            if (associated(Agrif_Gr%tabvars(i)%var%interpIndex)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%interpIndex)
-            endif
             
-            if (associated(Agrif_Gr%tabvars(i)%var%posvar)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%posvar)
-            endif     
-            
-            if (associated(Agrif_Gr%tabvars(i)%var%interptab)) then
-               Deallocate(Agrif_Gr%tabvars(i)%var%interptab)
-            endif                  
-!
+         call Agrif_Deallocate_Arrays(Agrif_Gr%tabvars(i)%var)
+         !
             Deallocate(Agrif_Gr%tabvars(i)%var)
 ! 
          endif
       enddo
+      
+      parcours => Agrif_Gr%variables
+      rootparcours=>Agrif_Mygrid%variables
+    
+      do i=1,Agrif_Gr%NbVariables
+       if (rootparcours%pvar%var%restaure) then
+        call Agrif_Deallocate_Arrays(parcours%pvar%var)
+      
+            Deallocate(parcours%pvar%var)
+C 
+        endif
+        parcours => parcours%nextvariable
+        rootparcours => rootparcours%nextvariable        
+      enddo
+            
 C
 C      
@@ -464,4 +411,130 @@
 C      
       End Subroutine Agrif_CopyFromold
+      
+CC    **************************************************************************
+CCC   Subroutine AGRIF_CopyFromold_AllOneVar
+C     **************************************************************************
+C
+      Recursive Subroutine AGRIF_CopyFromold_AllOneVar(g,oldchildgrids,
+     &   indic)
+C
+CCC   Description:
+CCC   Routine called in the Agrif_Init_Hierarchy procedure 
+C       (Agrif_Clustering module). 
+C
+CC    Method:        
+C
+C     Declarations:
+C
+      
+C      
+C     Pointer argument    
+      TYPE(AGRIF_grid),pointer   :: g ! Pointer on the current grid
+      TYPE(AGRIF_pgrid),pointer   :: oldchildgrids
+      integer :: indic
+C
+C     Local pointer
+      TYPE(AGRIF_pgrid),pointer  :: parcours ! Pointer for the recursive 
+                                             ! procedure 
+      REAL g_eps,eps,oldgrid_eps
+      INTEGER :: out
+      INTEGER :: iii
+C
+      out = 0
+C                                                                           
+      parcours => oldchildgrids  
+C
+      do while (associated(parcours))
+C 
+        if ((.NOT. g % fixed) .AND. (parcours % gr %oldgrid)) then
+C        
+            g_eps = huge(1.)
+            oldgrid_eps = huge(1.)
+            do iii = 1 , Agrif_Probdim
+               g_eps = min(g_eps,g % Agrif_d(iii))
+               oldgrid_eps = min(oldgrid_eps,
+     &                       parcours % gr % Agrif_d(iii))
+            enddo
+C
+            eps = min(g_eps,oldgrid_eps)/100.                  
+C
+            do iii = 1 , Agrif_Probdim
+
+               if (g % Agrif_d(iii) .LT. 
+     &             (parcours % gr % Agrif_d(iii) - eps)) then
+C            
+                   parcours => parcours % next
+C            
+                   out = 1
+C   
+                   Exit
+C             
+               endif
+C      
+            enddo
+        if ( out .EQ. 1 ) Cycle
+C
+            Call AGRIF_CopyFromOldOneVar(g,parcours%gr,indic)
+C
+        endif
+C                     
+        Call Agrif_CopyFromold_AllOneVar
+     &             (g, parcours % gr % child_grids,indic)
+C        
+        parcours => parcours % next
+C        
+      enddo
+C
+C     
+      Return      
+C
+C
+      End Subroutine AGRIF_CopyFromold_AllOneVar
+C
+C
+C      
+C     **************************************************************************
+CCC   Subroutine Agrif_CopyFromoldOneVar
+C     **************************************************************************
+C      
+      Subroutine Agrif_CopyFromoldOneVar(Agrif_New_Gr,Agrif_Old_Gr,
+     &    indic)
+C
+CCC   Description:
+CCC   Call to the Agrif_Copy procedure.
+C
+CC    Method:
+CC            
+C
+C     Declarations:
+C
+      
+C      
+C     Pointer argument    
+      TYPE(Agrif_Grid),Pointer   :: Agrif_New_Gr  ! Pointer on the current grid
+      TYPE(Agrif_Grid),Pointer :: Agrif_Old_Gr    ! Pointer on an old grid
+      INTEGER :: indic
+      INTEGER :: i
+      TYPE(Agrif_PVariable),Pointer ::tabvars,oldtabvars      
+C
+C      
+      tabvars => Agrif_Search_Variable(Agrif_New_Gr,-indic)
+      oldtabvars => Agrif_Search_Variable(Agrif_Old_Gr,-indic)
+
+      Call Agrif_Nbdim_Allocation(tabvars%var,
+     &  tabvars%var%lb,tabvars%var%ub,
+     &  tabvars%var%nbdim)
+     
+      Call Agrif_Copy(Agrif_New_Gr,Agrif_Old_Gr,
+     &           tabvars,oldtabvars)
+
+
+C      
+C            
+      Return
+C
+C      
+      End Subroutine Agrif_CopyFromoldOneVar      
+      
 C
 C
@@ -753,4 +826,5 @@
          enddo
       CASE (2)
+
         i0 = ind_gmin(1)
         do i = ind_newmin(1),ind_newmax(1)
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modtypes.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modtypes.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modtypes.F	(revision 2715)
@@ -37,6 +37,4 @@
       INTEGER, PARAMETER :: Agrif_NbMaxGrids = 10
                   
-C     MPI Communicator
-      INTEGER :: mpi_comm_agrif
 C
 C     **************************************************************************
@@ -126,4 +124,6 @@
            ! List of the grid variables   
            TYPE(Agrif_PVariable), DIMENSION(:) ,Pointer :: tabvars     
+           ! pointer on the save grid 
+           TYPE(Agrif_grid)                    ,Pointer :: save_grid                
 C
            ! Global x,y and z position
@@ -169,4 +169,6 @@
            INTEGER                                 :: NbVariables = 0
            Type(Agrif_Flux), Pointer               :: fluxes => NULL()
+           INTEGER                                 :: level
+           ! level of the grid in the hierarchy
       End TYPE Agrif_grid
 C
@@ -198,42 +200,50 @@
 C        Arrays containing the values of the grid variables (REAL)
          REAL                                    :: array0 
-         REAL   , DIMENSION(:)          ,Pointer :: array1    => NULL()
-         REAL   , DIMENSION(:,:)        ,Pointer :: array2    => NULL()
-         REAL   , DIMENSION(:,:,:)      ,Pointer :: array3    => NULL()
-         REAL   , DIMENSION(:,:,:,:)    ,Pointer :: array4    => NULL()
-         REAL   , DIMENSION(:,:,:,:,:)  ,Pointer :: array5    => NULL()
-         REAL   , DIMENSION(:,:,:,:,:,:),Pointer :: array6    => NULL()
+         REAL   , DIMENSION(:)          ,ALLOCATABLE :: array1    
+         REAL   , DIMENSION(:,:)        ,ALLOCATABLE :: array2    
+         REAL   , DIMENSION(:,:,:)      ,ALLOCATABLE :: array3    
+         REAL   , DIMENSION(:,:,:,:)    ,ALLOCATABLE :: array4    
+         REAL   , DIMENSION(:,:,:,:,:)  ,ALLOCATABLE :: array5    
+         REAL   , DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: array6  
+         
+         REAL   , DIMENSION(:)          ,POINTER :: parray1    
+         REAL   , DIMENSION(:,:)        ,POINTER :: parray2    
+         REAL   , DIMENSION(:,:,:)      ,POINTER :: parray3    
+         REAL   , DIMENSION(:,:,:,:)    ,POINTER :: parray4    
+         REAL   , DIMENSION(:,:,:,:,:)  ,POINTER :: parray5    
+         REAL   , DIMENSION(:,:,:,:,:,:),POINTER :: parray6
+         
 C        Arrays containing the values of the grid variables (REAL*8)
          REAL*8                                 :: darray0
-         REAL*8, DIMENSION(:)          ,Pointer :: darray1   => NULL()
-         REAL*8, DIMENSION(:,:)        ,Pointer :: darray2   => NULL()
-         REAL*8, DIMENSION(:,:,:)      ,Pointer :: darray3   => NULL()
-         REAL*8, DIMENSION(:,:,:,:)    ,Pointer :: darray4   => NULL()
-         REAL*8, DIMENSION(:,:,:,:,:)  ,Pointer :: darray5   => NULL()
-         REAL*8, DIMENSION(:,:,:,:,:,:),Pointer :: darray6   => NULL()
+         REAL*8, DIMENSION(:)          ,ALLOCATABLE :: darray1   
+         REAL*8, DIMENSION(:,:)        ,ALLOCATABLE :: darray2   
+         REAL*8, DIMENSION(:,:,:)      ,ALLOCATABLE :: darray3   
+         REAL*8, DIMENSION(:,:,:,:)    ,ALLOCATABLE :: darray4   
+         REAL*8, DIMENSION(:,:,:,:,:)  ,ALLOCATABLE :: darray5   
+         REAL*8, DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: darray6   
 C        Arrays containing the values of the grid variables (REAL*4)
          REAL*4                                 :: sarray0
-         REAL*4, DIMENSION(:)          ,Pointer :: sarray1   => NULL()
-         REAL*4, DIMENSION(:,:)        ,Pointer :: sarray2   => NULL()
-         REAL*4, DIMENSION(:,:,:)      ,Pointer :: sarray3   => NULL()
-         REAL*4, DIMENSION(:,:,:,:)    ,Pointer :: sarray4   => NULL()
-         REAL*4, DIMENSION(:,:,:,:,:)  ,Pointer :: sarray5   => NULL()
-         REAL*4, DIMENSION(:,:,:,:,:,:),Pointer :: sarray6   => NULL()
+         REAL*4, DIMENSION(:)          ,ALLOCATABLE :: sarray1   
+         REAL*4, DIMENSION(:,:)        ,ALLOCATABLE :: sarray2   
+         REAL*4, DIMENSION(:,:,:)      ,ALLOCATABLE :: sarray3   
+         REAL*4, DIMENSION(:,:,:,:)    ,ALLOCATABLE :: sarray4   
+         REAL*4, DIMENSION(:,:,:,:,:)  ,ALLOCATABLE :: sarray5   
+         REAL*4, DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: sarray6   
 C        Arrays containing the values of the grid variables (LOGICAL)
          LOGICAL                                 :: larray0
-         LOGICAL, DIMENSION(:)          ,Pointer :: larray1   => NULL()
-         LOGICAL, DIMENSION(:,:)        ,Pointer :: larray2   => NULL()
-         LOGICAL, DIMENSION(:,:,:)      ,Pointer :: larray3   => NULL()
-         LOGICAL, DIMENSION(:,:,:,:)    ,Pointer :: larray4   => NULL()
-         LOGICAL, DIMENSION(:,:,:,:,:)  ,Pointer :: larray5   => NULL()
-         LOGICAL, DIMENSION(:,:,:,:,:,:),Pointer :: larray6   => NULL()
+         LOGICAL, DIMENSION(:)          ,ALLOCATABLE :: larray1   
+         LOGICAL, DIMENSION(:,:)        ,ALLOCATABLE :: larray2   
+         LOGICAL, DIMENSION(:,:,:)      ,ALLOCATABLE :: larray3   
+         LOGICAL, DIMENSION(:,:,:,:)    ,ALLOCATABLE :: larray4   
+         LOGICAL, DIMENSION(:,:,:,:,:)  ,ALLOCATABLE :: larray5   
+         LOGICAL, DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: larray6   
 C         Arrays containing the values of the grid variables (INTEGER)   
          INTEGER                                 :: iarray0
-         INTEGER, DIMENSION(:)          ,Pointer :: iarray1   => NULL()
-         INTEGER, DIMENSION(:,:)        ,Pointer :: iarray2   => NULL()
-         INTEGER, DIMENSION(:,:,:)      ,Pointer :: iarray3   => NULL()
-         INTEGER, DIMENSION(:,:,:,:)    ,Pointer :: iarray4   => NULL()
-         INTEGER, DIMENSION(:,:,:,:,:)  ,Pointer :: iarray5   => NULL()
-         INTEGER, DIMENSION(:,:,:,:,:,:),Pointer :: iarray6   => NULL()
+         INTEGER, DIMENSION(:)          ,ALLOCATABLE :: iarray1   
+         INTEGER, DIMENSION(:,:)        ,ALLOCATABLE :: iarray2   
+         INTEGER, DIMENSION(:,:,:)      ,ALLOCATABLE :: iarray3   
+         INTEGER, DIMENSION(:,:,:,:)    ,ALLOCATABLE :: iarray4   
+         INTEGER, DIMENSION(:,:,:,:,:)  ,ALLOCATABLE :: iarray5   
+         INTEGER, DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: iarray6   
 C
          INTEGER, DIMENSION(:)          ,Pointer :: restore1D => NULL()
@@ -245,6 +255,6 @@
 C   
          CHARACTER(2050)                          :: carray0
-         CHARACTER(200), DIMENSION(:)    ,Pointer :: carray1   => NULL()
-         CHARACTER(200), DIMENSION(:,:)  ,Pointer :: carray2   => NULL()
+         CHARACTER(200), DIMENSION(:)    ,ALLOCATABLE :: carray1
+         CHARACTER(200), DIMENSION(:,:)  ,ALLOCATABLE :: carray2
 C
          ! Array used for the time interpolation
@@ -375,5 +385,5 @@
       REAL                  :: Agrif_SpecialValueFineGrid
 C   clustering PARAMETERs
-      INTEGER               :: Agrif_Regridding
+      INTEGER               :: Agrif_Regridding = 10
       INTEGER               :: Agrif_Minwidth
       REAL                  :: Agrif_Efficiency = 0.7
@@ -406,10 +416,11 @@
       ! Agrif_USE_FIXED_GRIDS = 1 if AMR mode + fixed grid 
       !    else only AMR mode
-      INTEGER               :: Agrif_USE_FIXED_GRIDS         
+      INTEGER               :: Agrif_USE_FIXED_GRIDS
+      INTEGER               :: Agrif_Maxlevelloc
 C
 #ifdef key_mpp_mpi
       INTEGER :: Agrif_Nbprocs  ! Number of processors
       INTEGER :: Agrif_ProcRank ! Rank of the current processor 
-      INTEGER :: Agrif_Group    ! Group associated to MPI_COMM_AGRIF
+      INTEGER :: Agrif_Group    ! Group associated to MPI_COMM_WORLD
       INTEGER :: Agrif_MPIPREC
 #endif
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdate.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdate.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdate.F	(revision 2715)
@@ -72,6 +72,7 @@
       External :: procname
       Optional ::  procname      
-      REAL, DIMENSION(lbound(child%var%array1,1):
-     &                ubound(child%var%array1,1)), Target :: tab  ! Results
+      REAL, DIMENSION(
+     &         child%var%lb(1):child%var%ub(1)
+     &         ), Target :: tab    ! Result
 C
 C
@@ -86,5 +87,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array1 => tab
+C      childtemp % var % array1 => tab
       
       childtemp % var % lb = child % var % lb
@@ -139,7 +140,7 @@
                                                           
       REAL, DIMENSION(
-     &      lbound(child%var%array2,1):ubound(child%var%array2,1),
-     &      lbound(child%var%array2,2):ubound(child%var%array2,2)),
-     &      Target :: tab  ! Results
+     &         child%var%lb(1):child%var%ub(1),
+     &         child%var%lb(2):child%var%ub(2)
+     &    ), Target :: tab    ! Result
 C
 C
@@ -154,5 +155,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array2 => tab 
+C      childtemp % var % array2 => tab 
       
       childtemp % var % lb = child % var % lb
@@ -203,8 +204,8 @@
                                                        
       REAL, DIMENSION(
-     &      lbound(child%var%array3,1):ubound(child%var%array3,1),
-     &      lbound(child%var%array3,2):ubound(child%var%array3,2),
-     &      lbound(child%var%array3,3):ubound(child%var%array3,3)),
-     &      Target :: tab  ! Results    
+     &         child%var%lb(1):child%var%ub(1),
+     &         child%var%lb(2):child%var%ub(2),
+     &         child%var%lb(3):child%var%ub(3)
+     &      ), Target :: tab  ! Results  
 C
 C
@@ -219,5 +220,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array3 => tab     
+C      childtemp % var % array3 => tab     
       
       childtemp % var % lb = child % var % lb
@@ -268,9 +269,9 @@
       Optional ::  procname        
       REAL, DIMENSION(
-     &      lbound(child%var%array4,1):ubound(child%var%array4,1),
-     &      lbound(child%var%array4,2):ubound(child%var%array4,2),
-     &      lbound(child%var%array4,3):ubound(child%var%array4,3),
-     &      lbound(child%var%array4,4):ubound(child%var%array4,4)),
-     &      Target :: tab  ! Results
+     &         child%var%lb(1):child%var%ub(1),
+     &         child%var%lb(2):child%var%ub(2),
+     &         child%var%lb(3):child%var%ub(3),
+     &         child%var%lb(4):child%var%ub(4)
+     &      ), Target :: tab  ! Results
 C
 C
@@ -285,5 +286,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array4 => tab     
+C      childtemp % var % array4 => tab     
       
       childtemp % var % lb = child % var % lb
@@ -336,10 +337,10 @@
               
       REAL, DIMENSION(
-     &      lbound(child%var%array5,1):ubound(child%var%array5,1),
-     &      lbound(child%var%array5,2):ubound(child%var%array5,2),
-     &      lbound(child%var%array5,3):ubound(child%var%array5,3),
-     &      lbound(child%var%array5,4):ubound(child%var%array5,4),
-     &      lbound(child%var%array5,5):ubound(child%var%array5,5)),
-     &      Target :: tab  ! Results
+     &         child%var%lb(1):child%var%ub(1),
+     &         child%var%lb(2):child%var%ub(2),
+     &         child%var%lb(3):child%var%ub(3),
+     &         child%var%lb(4):child%var%ub(4),
+     &         child%var%lb(5):child%var%ub(5)
+     &      ),  Target :: tab  ! Results
 C
 C
@@ -354,5 +355,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array5 => tab      
+C      childtemp % var % array5 => tab      
       
       childtemp % var % lb = child % var % lb
@@ -401,11 +402,11 @@
                                               ! are done on the fine grid       
       REAL, DIMENSION(
-     &      lbound(child%var%array6,1):ubound(child%var%array6,1),
-     &      lbound(child%var%array6,2):ubound(child%var%array6,2),
-     &      lbound(child%var%array6,3):ubound(child%var%array6,3),
-     &      lbound(child%var%array6,4):ubound(child%var%array6,4),
-     &      lbound(child%var%array6,5):ubound(child%var%array6,5),
-     &      lbound(child%var%array6,6):ubound(child%var%array6,6)),
-     &      Target :: tab  ! Results
+     &         child%var%lb(1):child%var%ub(1),
+     &         child%var%lb(2):child%var%ub(2),
+     &         child%var%lb(3):child%var%ub(3),
+     &         child%var%lb(4):child%var%ub(4),
+     &         child%var%lb(5):child%var%ub(5),
+     &         child%var%lb(6):child%var%ub(6)
+     &      ),  Target :: tab  ! Results
 C
 C
@@ -420,5 +421,5 @@
 C      
 C     Values on the current grid used for the update
-      childtemp % var % array6 => tab      
+C      childtemp % var % array6 => tab      
       
       childtemp % var % lb = child % var % lb
@@ -522,20 +523,6 @@
           case('N') ! No space DIMENSION      
 C
-            select case (nbdim) 
-C      
-              case(1)
-                nbtab_Child(n) = SIZE(child % var % array1,n) - 1
-              case(2)
-                nbtab_Child(n) = SIZE(child % var % array2,n) - 1
-              case(3)
-                nbtab_Child(n) = SIZE(child % var % array3,n) - 1
-              case(4)
-                nbtab_Child(n) = SIZE(child % var % array4,n) - 1
-              case(5)
-                nbtab_Child(n) = SIZE(child % var % array5,n) - 1  
-              case(6)
-                nbtab_Child(n) = SIZE(child % var % array6,n) - 1 
-C
-            end select
+            
+            nbtab_Child(n) = child % var % ub(n) - child % var % lb(n)
 C
 C           No interpolation but only a copy of the values of the grid variable      
@@ -560,5 +547,5 @@
       endif
       enddo
-     
+
        IF (present(procname)) THEN
 
@@ -716,8 +703,8 @@
           indtab(i,1,1) = indtab(i,1,1) - coeffraf
           indtab(i,1,2) = indtab(i,1,2) - 1
-          IF ((TypeUpdate(i) .EQ. Agrif_Update_Full_Weighting)
-     &                            .AND.(mod(coeffraf,2) == 1)) THEN
-            indtab(i,1,1) = indtab(i,1,1) - 1
-            indtab(i,1,2) = indtab(i,1,2) + 1
+C at this point, indices are OK for an average          
+          IF ((TypeUpdate(i) .EQ. Agrif_Update_Full_Weighting)) THEN
+            indtab(i,1,1) = indtab(i,1,1) - coeffraf/2
+            indtab(i,1,2) = indtab(i,1,2) + coeffraf/2
           ENDIF
         ENDIF
@@ -757,5 +744,5 @@
       
       CALL MPI_ALLREDUCE(iminmaxg,lubglob,2*nbdim,MPI_INTEGER,MPI_MIN,
-     &                     MPI_COMM_AGRIF,code)
+     &                     MPI_COMM_WORLD,code)
 
       lubglob(1:nbdim,2) = - lubglob(1:nbdim,2)      
@@ -763,5 +750,4 @@
 #endif 
 C
-
       indtruetab(1:nbdim,1,1) = max(indtab(1:nbdim,1,1),
      &     lubglob(1:nbdim,1))
@@ -771,5 +757,4 @@
 C
 C
-
            IF (present(procname)) THEN
               Call Agrif_UpdatenD              
@@ -790,5 +775,5 @@
      &              posvartab_child,loctab_Child,
      &              nbdim)           
-           ENDIF
+           ENDIF        
 C
 C      
@@ -899,8 +884,8 @@
           indtab(i,2,2) = indtab(i,2,2) + coeffraf - 1
           IF (TypeUpdate(i) .EQ. Agrif_Update_Full_Weighting) THEN
-            indtab(i,1,1) = indtab(i,1,1) - 1
-            indtab(i,1,2) = indtab(i,1,2) + 1
-            indtab(i,2,1) = indtab(i,2,1) - 1
-            indtab(i,2,2) = indtab(i,2,2) + 1
+            indtab(i,1,1) = indtab(i,1,1) - coeffraf/2
+            indtab(i,1,2) = indtab(i,1,2) + coeffraf/2
+            indtab(i,2,1) = indtab(i,2,1) - coeffraf/2
+            indtab(i,2,2) = indtab(i,2,2) + coeffraf/2
           ENDIF          
         ENDIF
@@ -925,5 +910,5 @@
       
       CALL MPI_ALLREDUCE(iminmaxg,lubglob,2*nbdim,MPI_INTEGER,MPI_MIN,
-     &                     MPI_COMM_AGRIF,code)  
+     &                     MPI_COMM_WORLD,code)  
      
       lubglob(1:nbdim,2) = - lubglob(1:nbdim,2)      
@@ -1209,6 +1194,4 @@
 
       Call Agrif_nbdim_Full_VarEQreal(tempC%var,0.,nbdim)
-
-
 
       IF (present(procname)) THEN
@@ -1287,5 +1270,5 @@
 C
       Call MPI_ALLGATHER(tab3,4*nbdim,MPI_INTEGER,tab4,4*nbdim,
-     &                   MPI_INTEGER,MPI_COMM_AGRIF,code)
+     &                   MPI_INTEGER,MPI_COMM_WORLD,code)
 
       IF (.not.associated(tempCextend%var)) Allocate(tempCextend%var)
@@ -1300,5 +1283,5 @@
       memberin1(1) = memberin
       CALL MPI_ALLGATHER(memberin1,1,MPI_LOGICAL,memberinall,
-     &                  1,MPI_LOGICAL,MPI_COMM_AGRIF,code)
+     &                  1,MPI_LOGICAL,MPI_COMM_WORLD,code)
  
        Call Get_External_Data_first(tab4t(:,:,1),
@@ -1419,5 +1402,5 @@
 C
       Call MPI_ALLGATHER(tab3,4*nbdim,MPI_INTEGER,tab4,4*nbdim,
-     &                   MPI_INTEGER,MPI_COMM_AGRIF,code)
+     &                   MPI_INTEGER,MPI_COMM_WORLD,code)
 
       IF (.not.associated(tempPextend%var)) Allocate(tempPextend%var)
@@ -1432,5 +1415,5 @@
       memberin1(1) = member
       CALL MPI_ALLGATHER(memberin1,1,MPI_LOGICAL,memberinall2,
-     &                  1,MPI_LOGICAL,MPI_COMM_AGRIF,code)
+     &                  1,MPI_LOGICAL,MPI_COMM_WORLD,code)
  
       Call Get_External_Data_first(tab5t(:,:,1),
@@ -1742,4 +1725,5 @@
       REAL :: positionmin,positionmax
       INTEGER :: imin,imax
+      INTEGER :: coeffraf
 #endif
 C
@@ -1770,7 +1754,14 @@
           ENDIF
         ELSE
+          IF (TypeUpdate(i).NE.Agrif_Update_Full_Weighting) THEN
         positionmin = positionmin - ds_Parent(i)/2.
-        IF (TypeUpdate(i) .EQ. Agrif_Update_Full_Weighting) THEN
-          positionmin = positionmin - ds_Child(i)
+          ELSE
+          coeffraf = nint(ds_Parent(i)/ds_Child(i))
+          if (mod(coeffraf,2) == 1) then
+            positionmin = positionmin - (ds_Parent(i)-ds_Child(i))
+          else
+            positionmin = positionmin - (ds_Parent(i)-ds_Child(i))
+     &                                -ds_Child(i)/2.
+          endif
         ENDIF
         ENDIF
@@ -1780,5 +1771,5 @@
 
        positionmin = s_Child(i) + (imin -
-     &                                pttab_Child(i)) * ds_Child(i)
+     &                             pttab_Child(i)) * ds_Child(i)
 
         pttruetabwhole(i) = imin
@@ -1794,7 +1785,15 @@
           ENDIF
         ELSE
+          IF (TypeUpdate(i).NE.Agrif_Update_Full_Weighting) THEN        
         positionmax = positionmax  + ds_Parent(i)/2.
-        IF (TypeUpdate(i) .EQ. Agrif_Update_Full_Weighting) THEN
-          positionmax = positionmax + ds_Child(i)
+          ELSE
+          coeffraf = nint(ds_Parent(i)/ds_Child(i))
+          if (mod(coeffraf,2) == 1) then
+            positionmax = positionmax + (ds_Parent(i)-ds_Child(i))
+          else
+            positionmax = positionmax + (ds_Parent(i)-ds_Child(i)) 
+     &                                + ds_Child(i)/2.
+          endif
+
         ENDIF        
         ENDIF
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdatebasic.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdatebasic.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modupdatebasic.F	(revision 2715)
@@ -571,5 +571,5 @@
       INTEGER :: i1,i2
       REAL :: invsumweight
-      REAL :: weights(-(coeffraf-1):coeffraf-1)
+      REAL :: weights(-(coeffraf):coeffraf)
       
 C
@@ -595,8 +595,16 @@
 C
              
-       it1 = -(coeffraf-1)
-       i1 = -(coeffraf-1)+locind_child_left+diffmod
-       i2 = 2*coeffraf - 2
-       
+      if (diffmod == 1) THEN
+        invsumweight=1./(2.*coeffraf**2)
+        do i=-coeffraf,-1
+          weights(i) = invsumweight*(2*(coeffraf+i)+1)
+        enddo
+        do i=0,coeffraf-1
+          weights(i)=weights(-(i+1))
+        enddo
+        it1 = -coeffraf
+        i1 = -(coeffraf-1)+locind_child_left
+        i2 = 2*coeffraf - 1
+      else
       invsumweight=1./coeffraf**2
       do i=-(coeffraf-1),0
@@ -606,4 +614,8 @@
         weights(i) = invsumweight*(coeffraf - i)
       enddo
+        it1 = -(coeffraf-1)
+        i1 = -(coeffraf-1)+locind_child_left
+        i2 = 2*coeffraf - 2
+      endif
 
       sumweight = 0                    
@@ -638,4 +650,5 @@
       enddo    
 C
+
       Return 
 C            
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modutil.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modutil.F	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modutil.F	(revision 2715)
@@ -63,29 +63,12 @@
 C
 #ifdef key_mpp_mpi
-      Logical      :: mpi_was_called
-      Integer      :: code, ierr
+      Integer      :: code
       INCLUDE 'mpif.h'
 C
 C
-      Call Agrif_comm_def(mpi_comm_agrif)
-
-      CALL mpi_initialized ( mpi_was_called, code )
-      IF( code /= MPI_SUCCESS ) THEN
-         WRITE(*, *) ': Error in routine mpi_initialized'
-         CALL mpi_abort( mpi_comm_world, code, ierr )
-      ENDIF
-
-      IF( .NOT. mpi_was_called ) THEN 
-         CALL mpi_comm_dup( mpi_comm_world, mpi_comm_agrif, code)
-         IF( code /= MPI_SUCCESS ) THEN
-            WRITE(*, *) ' Agrif_Step: Error in routine mpi_comm_dup'
-            CALL mpi_abort( mpi_comm_world, code, ierr )
-         ENDIF
-      ENDIF
-
       If (Agrif_Mygrid % ngridstep == 0) Then
-          Call MPI_COMM_SIZE(MPI_COMM_AGRIF,Agrif_Nbprocs,code)
-          Call MPI_COMM_RANK(MPI_COMM_AGRIF,Agrif_ProcRank,code)
-          Call MPI_COMM_GROUP(MPI_COMM_AGRIF,Agrif_Group,code)
+          Call MPI_COMM_SIZE(MPI_COMM_WORLD,Agrif_Nbprocs,code)
+          Call MPI_COMM_RANK(MPI_COMM_WORLD,Agrif_ProcRank,code)
+          Call MPI_COMM_GROUP(MPI_COMM_WORLD,Agrif_Group,code)
       endif
 #endif
@@ -234,4 +217,6 @@
 C
       if ( Agrif_USE_ONLY_FIXED_GRIDS .EQ. 0 ) then
+C
+      Call Agrif_Save_All(Agrif_oldmygrid)      
 C      
       Call Agrif_Free_before_All(Agrif_oldmygrid)
@@ -322,4 +307,5 @@
 C     Detection (Agrif_detect is a user s routine)
 C      
+     
       do iii = 1 , Agrif_Probdim
          size(iii) = g%nb(iii) + 1
@@ -440,4 +426,42 @@
 C
       End Subroutine Agrif_Free_before_All
+C     **************************************************************************
+CCC   Subroutine Agrif_Save_All
+C     **************************************************************************
+C
+      Recursive Subroutine Agrif_Save_All(g)
+C
+CCC   Description:
+C
+CC    Method:        
+C
+C     Declarations:
+C
+C     Pointer argument    
+      Type(Agrif_pgrid),pointer   :: g        ! Pointer on the current grid
+C
+C     Local pointer
+      Type(Agrif_pgrid),pointer  :: parcours ! Pointer for the recursive 
+                                             ! procedure      
+C
+C
+      parcours => g        
+C      
+      Do while (associated(parcours))     
+        If (.not. parcours%gr%fixed) Then
+            Call Agrif_Instance(parcours%gr)
+            Call Agrif_Before_Regridding()
+            parcours % gr % oldgrid = .TRUE.        
+        endif
+C
+        Call Agrif_Save_All (parcours % gr % child_grids)
+C  
+        parcours => parcours % next             
+      enddo
+C     
+      Return      
+C
+C
+      End Subroutine Agrif_Save_All      
 C
 C
@@ -710,4 +734,9 @@
 C     The root coarse grid is a fixed grid
       Agrif_Mygrid % fixed = .TRUE.
+C     Level of the root grid
+      Agrif_Mygrid % level = 0
+C     Maximum level in the hierarchy
+      Agrif_MaxLevelLoc = 0
+      
 C      
 C     Number of the grid pointed by Agrif_Mygrid (root coarse grid)
@@ -725,9 +754,11 @@
 C      
       Call Agrif_Instance (Agrif_Mygrid)        
+C
+      Call Agrif_Set_numberofcells(Agrif_Mygrid)          
 C             
 C     Allocation of the array containing the values of the grid variables
       Call Agrif_Allocation (Agrif_Mygrid)
 C        
-      Call Agrif_initialisations(Agrif_Mygrid)
+      Call Agrif_initialisations(Agrif_Mygrid)    
 C      
       nullify(Agrif_Mygrid % child_grids)
@@ -759,46 +790,46 @@
 C
       do nb = 1, Agrif_NbVariables
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array1) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array1) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array1)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array2) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array2) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array2)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array3) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array3) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array3)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array4) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array4) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array4)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array5) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array5) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array5)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % array6) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % array6) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % array6)
 C
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray1) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray1) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray1)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray2) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray2) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray2)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray3) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray3) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray3)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray4) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray4) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray4)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray5) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray5) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray5)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % iarray6) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % iarray6) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % iarray6)
 C
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray1) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray1) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray1)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray2) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray2) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray2)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray3) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray3) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray3)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray4) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray4) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray4)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray5) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray5) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray5)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % larray6) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % larray6) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % larray6)
 C
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % carray1) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % carray1) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % carray1)
-          if ( associated(Agrif_Mygrid % tabvars(nb) % var % carray2) ) 
+          if ( allocated(Agrif_Mygrid % tabvars(nb) % var % carray2) ) 
      &       Deallocate(Agrif_Mygrid % tabvars(nb) % var % carray2)
       enddo
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modvariables.F
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modvariables.F	(revision 2715)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/AGRIF_FILES/modvariables.F	(revision 2715)
@@ -0,0 +1,152 @@
+      Module Agrif_Variables 
+      Use Agrif_CurgridFunctions
+      
+      Contains
+      Subroutine Agrif_Declare_Variable(posvar,firstpoint,
+     &    raf,lb,ub,varid,torestore)
+      character*(80) :: variablename
+      Type(Agrif_List_Variables), Pointer :: newvariable,newvariablep
+      INTEGER, DIMENSION(:) :: posvar
+      INTEGER, DIMENSION(:) :: lb,ub
+      INTEGER, DIMENSION(:) :: firstpoint
+      CHARACTER(*) ,DIMENSION(:) :: raf        
+      TYPE(Agrif_Pvariable), Pointer :: parent_var,root_var
+      INTEGER :: dimensio
+      INTEGER :: varid
+      LOGICAL, OPTIONAL :: torestore
+      LOGICAL :: restaure
+            
+!      if (agrif_root()) return
+
+      variablename = 'xxx'
+      
+      restaure = .FALSE.
+      if (agrif_mygrid%ngridstep /= 0) then
+        if (present(torestore)) restaure = torestore
+      endif
+      
+      dimensio = SIZE(posvar)
+C
+C    
+      Allocate(newvariable)
+      Allocate(newvariable%pvar)
+      Allocate(newvariable%pvar%var)
+      Allocate(newvariable%pvar%var%posvar(dimensio))
+      Allocate(newvariable%pvar%var%interptab(dimensio))
+      newvariable%pvar%var%variablename = variablename
+      newvariable%pvar%var%interptab = raf
+      newvariable%pvar%var%nbdim = dimensio
+      newvariable%pvar%var%posvar = posvar
+      newvariable%pvar%var%point(1:dimensio) = firstpoint
+      newvariable%pvar%var%restaure = restaure
+
+      newvariable%pvar%var%lb(1:dimensio) = lb(1:dimensio)
+      newvariable%pvar%var%ub(1:dimensio) = ub(1:dimensio)
+      
+      if (restaure) then
+      select case(dimensio)
+      case(1)
+                  Allocate( newvariable%pvar%var%Restore1D(  
+     &      lb(1):ub(1)))         
+            newvariable%pvar%var%Restore1D = 0      
+      case(2)
+                  Allocate( newvariable%pvar%var%Restore2D(  
+     &      lb(1):ub(1),lb(2):ub(2)))         
+            newvariable%pvar%var%Restore2D = 0
+      case(3)
+                  Allocate( newvariable%pvar%var%Restore3D(  
+     &      lb(1):ub(1),lb(2):ub(2),lb(3):ub(3)))         
+            newvariable%pvar%var%Restore3D = 0
+      case(4)
+                  Allocate( newvariable%pvar%var%Restore4D(  
+     &      lb(1):ub(1),lb(2):ub(2),lb(3):ub(3),lb(4):ub(4)))         
+            newvariable%pvar%var%Restore4D = 0
+      case(5)
+                  Allocate( newvariable%pvar%var%Restore5D(  
+     &      lb(1):ub(1),lb(2):ub(2),lb(3):ub(3),lb(4):ub(4),
+     &      lb(5):ub(5)))         
+            newvariable%pvar%var%Restore5D = 0            
+      end select
+      endif
+      
+      newvariable % nextvariable => Agrif_Curgrid%variables
+      
+      Agrif_Curgrid%variables => newvariable
+      Agrif_Curgrid%Nbvariables = Agrif_Curgrid%Nbvariables + 1
+
+      varid = -Agrif_Curgrid%Nbvariables
+
+!       if (agrif_curgrid%parent%nbvariables < agrif_curgrid%nbvariables)
+!     &       then
+!      Allocate(newvariablep)
+!      Allocate(newvariablep%pvar)
+!      Allocate(newvariablep%pvar%var)      
+!      Allocate(newvariablep%pvar%var%posvar(dimensio))
+!      Allocate(newvariablep%pvar%var%interptab(dimensio))
+!      newvariablep%pvar%var%variablename = variablename
+!      newvariablep%pvar%var%interptab = raf
+!      newvariablep%pvar%var%nbdim = dimensio
+!      newvariablep%pvar%var%posvar = posvar
+!      newvariablep%pvar%var%point(1:dimensio) = firstpoint
+!      newvariablep%pvar%var%restaure = restaure      
+! 
+!      newvariablep%pvar%var%lb(1:dimensio) = lb(1:dimensio)
+!      newvariablep%pvar%var%ub(1:dimensio) = ub(1:dimensio)
+!           
+!      newvariablep % nextvariable => Agrif_Curgrid%parent%variables
+!      
+!      Agrif_Curgrid%parent%variables => newvariablep       
+!      
+!      Agrif_Curgrid%parent%Nbvariables = 
+!     &    Agrif_Curgrid%parent%Nbvariables + 1
+!      parent_var=>newvariablep%pvar
+!      else
+!      parent_var=>Agrif_Search_Variable
+!     &              (Agrif_Curgrid%parent,Agrif_Curgrid%nbvariables)
+!       endif
+       
+       if (.not.agrif_root()) then
+      parent_var=>Agrif_Search_Variable
+     &              (Agrif_Curgrid%parent,Agrif_Curgrid%nbvariables)       
+       
+       newvariable%pvar%parent_var=>parent_var
+       do i=1,dimensio
+         if (parent_var%var%interptab(i)=='N') then
+           parent_var%var%lb(i)=lb(i)
+           parent_var%var%ub(i)=ub(i)
+         endif
+       enddo
+       endif       
+      
+      root_var=>Agrif_Search_Variable
+     &              (Agrif_Mygrid,Agrif_Curgrid%nbvariables)
+     
+      newvariable%pvar%var%root_var=>root_var%var
+      
+           
+      End Subroutine Agrif_Declare_Variable
+
+      FUNCTION Agrif_Search_Variable(grid,varid)
+      integer :: varid
+      Type(Agrif_Pvariable), Pointer :: Agrif_Search_variable
+      Type(Agrif_grid), Pointer :: grid
+      
+      Type(Agrif_List_Variables), pointer :: parcours
+      Logical :: foundvariable
+      integer nb
+      integer :: varidinv
+      
+      foundvariable = .FALSE.
+      parcours => grid%variables
+      varidinv = 1 + grid%nbvariables - varid
+
+      do nb=1,varidinv-1
+         parcours => parcours%nextvariable    
+      End Do
+      
+      Agrif_Search_variable => parcours%pvar
+      
+      
+      End Function Agrif_Search_variable
+      
+      End Module Agrif_Variables      
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/DiversListe.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/DiversListe.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/DiversListe.c	(revision 2715)
@@ -348,5 +348,5 @@
 /*                                                                            */
 /******************************************************************************/
-void Add_NameOfCommon_1(char *nom)
+void Add_NameOfCommon_1(char *nom,char *cursubroutinename)
 {
    listnom *newnom;
@@ -362,4 +362,5 @@
          newnom=(listnom *) malloc (sizeof (listnom));
          strcpy(newnom->o_nom,nom);
+         strcpy(newnom->o_subroutinename,cursubroutinename);
          Save_Length(nom,23);
          newnom->suiv = List_NameOfCommon;
@@ -524,4 +525,5 @@
      /* Creation of the string for the dimension of this variable             */
      dimsempty = 1;
+
      if ( d )
      {
@@ -542,6 +544,7 @@
         if ( dimsempty == 1 ) newvar->var->v_dimsempty=1;
      }
-     strcpy(newvar->var->v_readedlistdimension,listdimension);
-     Save_Length(listdimension,15);
+
+/*     strcpy(newvar->var->v_readedlistdimension,listdimension);
+     Save_Length(listdimension,15);*/
      /*                                                                       */
      newvar->suiv = NULL;
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex	(revision 2715)
@@ -1,9 +1,10 @@
 # Compilation:
-CC		= cc -O -g
+CC		= cc -O -g -Wall
 LEX		= flex
 
 # option de flex et pas de lex
 LEXFLAGS=-i
-YACC = byacc -t -v
+YACC = byacc -t -v -g
+YACC = bison -t -v -g
 
 
@@ -38,8 +39,10 @@
 convert.tab.c : convert.y decl.h
 	$(YACC) convert.y
-	mv -f y.tab.c convert.tab.c
+#	mv -f y.tab.c convert.tab.c
 fortran.tab.c : fortran.y decl.h
 	$(YACC) -p fortran fortran.y
-	mv -f y.tab.c fortran.tab.c
+#	mv -f y.tab.c fortran.tab.c
+#	mv -f y.output fortran.output
+#	mv -f y.dot fortran.dot
 convert.yy.c : convert.lex
 	$(LEX) $(LEXFLAGS) -oconvert.yy.c convert.lex
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex.byacc
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex.byacc	(revision 2715)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Makefile.lex.byacc	(revision 2715)
@@ -0,0 +1,76 @@
+# Compilation:
+CC		= cc -O -g -Wall
+LEX		= flex
+
+# option de flex et pas de lex
+LEXFLAGS=-i
+YACC = byacc -t -v -g
+YACC = bison -t -v -g
+
+
+OBJS = main.o WriteInFile.o toamr.o fortran.o  \
+       dependfile.o SubLoopCreation.o WorkWithlistvarindoloop.o \
+       WorkWithvarofsubroutineliste.o WorkWithParameterlist.o \
+       Writedeclarations.o WorkWithglobliste.o UtilFortran.o \
+       UtilNotGridDep.o WorkWithlistdatavariable.o \
+       DiversListe.o UtilAgrif.o WorkWithAllocatelist.o \
+       UtilCharacter.o UtilListe.o UtilFile.o \
+       WorkWithlistofmodulebysubroutine.o WorkWithlistmoduleinfile.o \
+       WorkWithlistofcoupled.o
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+all : conv
+
+conv :  $(OBJS)
+	$(CC) $(OBJS)  $(LEXLIB) -o ../$@
+
+main.o : main.c
+main.c : convert.tab.c  convert.yy.c
+	rm -f main.c
+	cat convert.tab.c  convert.yy.c > main.c
+	rm -f convert.yy.c convert.tab.c
+fortran.o : fortran.c
+fortran.c : fortran.tab.c fortran.yy.c
+	rm -f fortran.c
+	cat fortran.tab.c  fortran.yy.c > fortran.c
+#rm -f fortran.yy.c fortran.tab.c
+convert.tab.c : convert.y decl.h
+	$(YACC) convert.y
+	mv -f y.tab.c convert.tab.c
+fortran.tab.c : fortran.y decl.h
+	$(YACC) -p fortran fortran.y
+	mv -f y.tab.c fortran.tab.c
+	mv -f y.output fortran.output
+	mv -f y.dot fortran.dot
+convert.yy.c : convert.lex
+	$(LEX) $(LEXFLAGS) -oconvert.yy.c convert.lex
+fortran.yy.c : fortran.lex
+	$(LEX) $(LEXFLAGS) -Pfortran -ofortran.yy.c fortran.lex
+	
+toamr.o : toamr.c decl.h
+WriteInFile.o : WriteInFile.c decl.h
+dependfile.o : dependfile.c decl.h
+SubLoopCreation.o : SubLoopCreation.c decl.h
+WorkWithglobliste.o : WorkWithglobliste.c decl.h
+WorkWithlistvarindoloop.o : WorkWithlistvarindoloop.c decl.h
+WorkWithvarofsubroutineliste.o : WorkWithvarofsubroutineliste.c decl.h
+Writedeclarations.o : Writedeclarations.c decl.h
+UtilFortran.o : UtilFortran.c decl.h
+WorkWithParameterlist.o : WorkWithParameterlist.c decl.h
+UtilNotGridDep.o : UtilNotGridDep.c decl.h
+WorkWithlistdatavariable.o : WorkWithlistdatavariable.c decl.h
+DiversListe.o : DiversListe.c decl.h
+UtilAgrif.o : UtilAgrif.c decl.h
+WorkWithAllocatelist.o : WorkWithAllocatelist.c decl.h
+UtilCharacter.o : UtilCharacter.c decl.h
+UtilListe.o : UtilListe.c decl.h
+UtilFile.o : UtilFile.c decl.h
+WorkWithlistofmodulebysubroutine.o : WorkWithlistofmodulebysubroutine.c decl.h
+WorkWithlistmoduleinfile.o : WorkWithlistmoduleinfile.c decl.h
+WorkWithlistofcoupled.o : WorkWithlistofcoupled.c decl.h
+clean : 
+	/bin/rm -f *.o y.tab.c main.c lex.yy.c fortran.c \
+	fortran.tab.c fortran.yy.c convert.tab.c convert.yy.c \
+	y.output
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c	(revision 2715)
@@ -61,5 +61,5 @@
       /* we should add the use agrif_uti l if it is necessary                 */
       WriteHeadofSubroutineLoop();
-      WriteUsemoduleDeclaration();
+      WriteUsemoduleDeclaration(subroutinename);
       if ( ImplicitNoneInSubroutine() == 1 ) fprintf(fortranout,
                                                        "      IMPLICIT NONE\n");
@@ -69,4 +69,5 @@
       /*    from pointer) in the new subroutine                               */
       if ( mark == 1 ) fprintf(fortranout,"!!! 000000000000000 \n");
+
       if ( SubInList_ContainsSubroutine() == 0 ) WriteLocalParamDeclaration();
       if ( mark == 1 ) fprintf(fortranout,"!!! 111111111111111 \n");
@@ -95,5 +96,5 @@
    {
       AddUseAgrifUtil_0(fortranout);
-      WriteUsemoduleDeclaration();
+      WriteUsemoduleDeclaration(subroutinename);
       WriteIncludeDeclaration();
       if ( ImplicitNoneInSubroutine() == 1 ) fprintf(fortranout,
@@ -103,4 +104,5 @@
       if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbbbbbbbbbb \n");
       if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(1);
+      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbccccccccc \n");      
       WriteArgumentDeclaration_beforecall();
 /*      writesub_loopdeclaration_scalar(List_SubroutineArgument_Var,fortranout);
@@ -127,8 +129,7 @@
 /*                                                                            */
 /******************************************************************************/
-void WriteVariablelist_subloop(FILE *outputfile)
+void WriteVariablelist_subloop(FILE *outputfile,char *ligne)
 {
    listvar *parcours;
-   char ligne[LONG_C];
    int compteur;
 
@@ -146,27 +147,11 @@
       if ( !strcasecmp(parcours->var->v_subroutinename,subroutinename) )
       {
-         if ( didvariableadded == 0 )
-         {
-            strcpy(ligne,"");
-         }
-         else
-         {
-            if ( compteur == 0 ) strcpy(ligne,"");
+         if ( didvariableadded == 1 )
+         {
             strcat(ligne,",");
          }
          strcat(ligne,parcours->var->v_nomvar);
          didvariableadded = 1;
-         compteur = compteur + 1;
-         if ( compteur == 3 )
-         {
-            if ( retour77 == 0 )
-            {
-               strcat(ligne," &");
-               fprintf(outputfile,"\n      %s",ligne);
             }
-            else fprintf(outputfile,"\n     & %s",ligne);
-            compteur = 0;
-         }
-      }
       parcours = parcours -> suiv;
    }
@@ -176,33 +161,12 @@
       if ( !strcasecmp(parcours->var->v_subroutinename,subroutinename) )
       {
-         if ( didvariableadded == 0 )
-         {
-            strcpy(ligne,"");
-         }
-         else
-         {
-            if ( compteur == 0 ) strcpy(ligne,"");
+         if ( didvariableadded == 1 )
+         {
             strcat(ligne,",");
          }
          strcat(ligne,parcours->var->v_nomvar);
          didvariableadded = 1;
-         compteur = compteur + 1;
-         if ( compteur == 3 )
-         {
-            if ( retour77 == 0 )
-            {
-               strcat(ligne," &");
-               fprintf(outputfile,"\n      %s",ligne);
             }
-            else fprintf(outputfile,"\n     & %s",ligne);
-            compteur = 0;
-         }
-      }
       parcours = parcours -> suiv;
-   }
-   if ( compteur != 3 && compteur != 0 )
-   {
-      if ( retour77 == 0 ) fprintf(outputfile,"\n      %s &",ligne);
-      else fprintf(outputfile,"\n     & %s ",ligne);
    }
    if ( todebug == 1 ) printf("Out of WriteVariablelist_subloop\n");
@@ -224,14 +188,11 @@
 /*                                                                            */
 /******************************************************************************/
-void WriteVariablelist_subloop_Call(FILE *outputfile)
+void WriteVariablelist_subloop_Call(FILE *outputfile,char *ligne)
 {
    listvar *parcours;
-   char ligne[LONG_40M];
    char ligne2[10];
    int i;
    int compteur ;
 
-   strcpy(ligne,"");
-   
    if ( todebug == 1 ) printf("Enter in WriteVariablelist_subloop_Call\n");
    parcours = List_UsedInSubroutine_Var;
@@ -243,20 +204,9 @@
       /*    in the output file                                                */
       if ( !strcasecmp(parcours->var->v_subroutinename,subroutinename)  &&
-          (parcours->var->v_allocatable == 0  || !strcasecmp(parcours->var->v_typevar,"type"))      &&
-           parcours->var->v_pointerdeclare == 0
+           (parcours->var->v_pointerdeclare == 0 || !strcasecmp(parcours->var->v_typevar,"type"))
          )
       {
-         if ( didvariableadded == 0 )
-         {
-            if ( retour77 == 1 ) strcpy(ligne,"\n     & ");
-            else strcpy(ligne,"\n      ");
-         }
-         else
-         {
-            if ( compteur == 0 )
-            {
-               if ( retour77 == 1 ) strcpy(ligne,"\n     & ");
-               else strcpy(ligne,"\n      ");
-            }
+         if ( didvariableadded == 1 )
+         {
             strcat(ligne," , ");
          }
@@ -266,6 +216,6 @@
          /* the name of the variable                                          */
          if (  SubloopScalar != 0 &&
-               (IsVarAllocatable_0(parcours->var->v_nomvar) == 0 &&
-               parcours->var->v_pointerdeclare == 0 ) &&
+               (
+               (parcours->var->v_pointerdeclare == 0 || !strcasecmp(parcours->var->v_typevar,"type"))) &&
                parcours->var->v_nbdim != 0 )
          {
@@ -306,6 +256,6 @@
    }
    
-   Save_Length(ligne,41);
-   tofich(outputfile,ligne,0);
+//   Save_Length(ligne,41);
+//   tofich(outputfile,ligne,0);
    /* Now we should replace the last ", &" by " &"                            */
 /*   if ( didvariableadded != 0 && retour77 == 0 ) fseek(outputfile,-1,SEEK_CUR);
@@ -330,15 +280,10 @@
 /*                                                                            */
 /******************************************************************************/
-void WriteVariablelist_subloop_Def(FILE *outputfile)
+void WriteVariablelist_subloop_Def(FILE *outputfile, char *ligne)
 {
    listvar *parcours;
 /*   char ligne[LONG_40M];*/
-   char *ligne;
    int compteur;
 
-/*   strcpy(ligne," ");*/
-
-   ligne=(char *)malloc(LONG_40M*sizeof(char));
-   
    if ( todebug == 1 ) printf("Enter in WriteVariablelist_subloop_Def\n");
    parcours = List_UsedInSubroutine_Var;
@@ -350,36 +295,14 @@
       /*    in the output file                                                */
       if ( !strcasecmp(parcours->var->v_subroutinename,subroutinename)  &&
-          (parcours->var->v_allocatable == 0  || !strcasecmp(parcours->var->v_typevar,"type"))      &&
-           parcours->var->v_pointerdeclare == 0
+           (parcours->var->v_pointerdeclare == 0 || !strcasecmp(parcours->var->v_typevar,"type"))
          )
       {
-         if ( didvariableadded == 0 )
-         {
-            if ( retour77 == 1 ) strcpy(ligne,"\n     &");
-            else strcpy(ligne,"\n      ");
-         }
-         else
-         {
-            if ( compteur == 0 )
-            {
-               if ( retour77 == 1 ) strcpy(ligne,"\n     & ");
-               else strcpy(ligne,"\n      ");
+         if ( didvariableadded == 1 )
+         {
+            strcat(ligne,",");
+         }
+         strcat(ligne,parcours->var->v_nomvar);
+         didvariableadded = 1;
             }
-            strcat(ligne,",");
-         }
-         strcat(ligne,parcours->var->v_nomvar);
-         compteur = compteur + 1;
-         didvariableadded = 1;
-/*         if ( compteur == 3 )
-         {
-            if ( retour77 == 0 )
-            {
-               strcat(ligne," &");
-               fprintf(outputfile,"\n      %s",ligne);
-            }
-            else fprintf(outputfile,"\n     & %s",ligne);
-            compteur = 0;
-         }*/
-      }
       parcours = parcours -> suiv;
    }
@@ -390,5 +313,5 @@
    }*/
    Save_Length(ligne,41);
-   tofich(outputfile,ligne,0);
+ //  tofich(outputfile,ligne,0);
 
    /* Now we should replace the last ", &" by " &"                            */
@@ -396,7 +319,5 @@
    if ( didvariableadded == 0 ) fseek(outputfile,-1,SEEK_CUR);*/
    if ( todebug == 1 ) printf("Out of WriteVariablelist_subloop_Def\n");
-   strcpy(ligne,"");
    
-   free(ligne);
 }
 
@@ -419,5 +340,5 @@
 void WriteHeadofSubroutineLoop()
 {
-   char ligne[LONG_C];
+   char ligne[LONG_40M];
    FILE * subloop;
 
@@ -428,14 +349,18 @@
    subloop = associate(ligne);
    /*                                                                         */
-   if ( retour77 == 0 ) sprintf(ligne,"      subroutine Sub_Loop_%s( &"
-                                                               ,subroutinename);
-   else sprintf(ligne,"      subroutine Sub_Loop_%s( ",subroutinename);
-   fprintf(subloop,ligne);
+   if (isrecursive) 
+   {
+   sprintf(ligne,"      recursive subroutine Sub_Loop_%s(",subroutinename);
+   }
+   else
+   {
+   sprintf(ligne,"      subroutine Sub_Loop_%s(",subroutinename);
+   }
    /*                                                                         */
-   WriteVariablelist_subloop(subloop);
-   WriteVariablelist_subloop_Def(subloop);
+   WriteVariablelist_subloop(subloop,ligne);
+   WriteVariablelist_subloop_Def(subloop,ligne);
    /*                                                                         */
-   sprintf(ligne,")");
-   fprintf(subloop,ligne);
+     strcat(ligne,")");
+   tofich(subloop,ligne,1);
    /* if USE agrif_Uti l should be add                                        */
    AddUseAgrifUtil_0(subloop);
@@ -461,8 +386,9 @@
 void closeandcallsubloopandincludeit_0(int suborfun)
 {
-   char ligne[LONG_C];
+   char ligne[LONG_40M];
 
    if ( firstpass == 0 )
    {
+
    if ( todebug == 1 ) printf("Enter in closeandcallsubloopandincludeit_0\n");
    if ( IsTabvarsUseInArgument_0() == 1 )
@@ -484,16 +410,15 @@
                      fprintf(oldfortranout,"      Call Agrif_Init_Grids () \n");
       /* Now we add the call af the new subroutine                            */
-      if ( retour77 == 0 ) sprintf(ligne,"\n      Call Sub_Loop_%s( &"
-                                                               ,subroutinename);
-      else sprintf(ligne,"\n      Call Sub_Loop_%s( ",subroutinename);
-      fprintf(fortranout,ligne);
+      sprintf(ligne,"\n      Call Sub_Loop_%s( ",subroutinename);
       /* Write the list of the local variables used in this new subroutine    */
-      WriteVariablelist_subloop(fortranout);
+      WriteVariablelist_subloop(fortranout,ligne);
       /* Write the list of the global tables used in this new subroutine      */
       /*    in doloop                                                         */
-      WriteVariablelist_subloop_Call(fortranout);
+      WriteVariablelist_subloop_Call(fortranout,ligne);
       /* Close the parenthesis of the new subroutine called                   */
-      sprintf(ligne,")");
-      fprintf(fortranout,ligne);
+       strcat(ligne,")");
+      
+      tofich(fortranout,ligne,1);
+
       /* We should close the original subroutine                              */
       if ( suborfun == 3 ) sprintf(ligne,"\n      end program %s"
@@ -520,5 +445,5 @@
 void closeandcallsubloop_contains_0()
 {
-   char ligne[LONG_C];
+   char ligne[LONG_40M];
 
    if ( firstpass == 0 )
@@ -548,8 +473,8 @@
       fprintf(fortranout,ligne);
       /* Write the list of the local variables used in this new subroutine    */
-      WriteVariablelist_subloop(fortranout);
+      WriteVariablelist_subloop(fortranout,ligne);
       /* Write the list of the global tables used in this new subroutine      */
       /*    in doloop                                                         */
-      WriteVariablelist_subloop_Call(fortranout);
+      WriteVariablelist_subloop_Call(fortranout,ligne);
       /* Close the parenthesis of the new subroutine called                   */
       sprintf(ligne,")");
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilAgrif.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilAgrif.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilAgrif.c	(revision 2715)
@@ -67,4 +67,5 @@
    else if ( !strcasecmp(tokname,"Agrif_Set_UpdateType") ) agrifintheword = 1;
    else if ( !strcasecmp(tokname,"Agrif_Set_restore")    ) agrifintheword = 1;
+   else if ( !strcasecmp(tokname,"Agrif_Save_Forrestore")) agrifintheword = 1;
    else if ( !strcasecmp(tokname,"agrif_init_grids")     ) agrifintheword = 1;
    else if ( !strcasecmp(tokname,"agrif_step")           ) agrifintheword = 1;
@@ -107,4 +108,6 @@
    listvar *newvar;
    int out;
+   
+   printf("ICI ident = %s\n",ident);
    
    if ( firstpass == 0 )
@@ -117,5 +120,5 @@
          else newvar=newvar->suiv;
       }
-
+       printf("out1 = %d\n",out);
       if ( out == 0 )
       {
@@ -127,4 +130,6 @@
          }
       }
+      if (out == 1 && !strcasecmp(newvar->var->v_typevar,"type")) return;
+
       if ( out == 0 )
       {
@@ -147,6 +152,7 @@
       }
 
-      if ( out == 1 )
-      {
+      if ( out == 1 && strcasecmp(newvar->var->v_typevar,"type"))
+      {
+      printf("ICIC3\n");
          /* remove the variable                                               */
          RemoveWordCUR_0(fortranout,(long)(-lengthname),
@@ -183,6 +189,7 @@
                else newvar=newvar->suiv;
             }
-            if ( out == 1 )
+            if ( out == 1 && strcasecmp(newvar->var->v_typevar,"type"))
             {
+            printf("ICICIC4 %s\n",newvar->var->v_typevar);
                /* remove the variable                                         */
                RemoveWordCUR_0(fortranout,(long)(-lengthname),
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilCharacter.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilCharacter.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilCharacter.c	(revision 2715)
@@ -284,8 +284,8 @@
       )
    {
-      printf("--- in UtilCharacter we do not found the \n");
+   /*   printf("--- in UtilCharacter we do not found the \n");
       printf("---  variable %s, the module where this \n",nom);
       printf("---  variable has been defined has not been\n");
-      printf("---  found.\n");
+      printf("---  found.\n");*/
    }
 }
@@ -320,4 +320,5 @@
          )
       {
+
          if (strcasecmp(toprinttmp,"") && ( toprinttmp[0] >= 'A' ) )
          {
@@ -330,4 +331,5 @@
          sprintf(chartmp,"%c",nom[i]);
          strcat(toprinttmp,chartmp);
+
       }
       /*                                                                      */
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFortran.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFortran.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFortran.c	(revision 2715)
@@ -97,4 +97,5 @@
         /* Now we should give the definition of the variable in the           */
         /* table List_UsedInSubroutine_Var                                    */
+        printf("QDKFLSDFKSLDF\n");
         strcpy(curvar->var->v_typevar,newvar->var->v_typevar);
         strcpy(curvar->var->v_dimchar,newvar->var->v_dimchar);
@@ -102,4 +103,5 @@
         curvar->var->v_dimensiongiven = newvar->var->v_dimensiongiven;
         curvar->var->v_allocatable = newvar->var->v_allocatable;
+        curvar->var->v_target = newvar->var->v_target;
         curvar->var->v_pointerdeclare = newvar->var->v_pointerdeclare;
         curvar->var->v_indicetabvars = newvar->var->v_indicetabvars;
@@ -133,4 +135,5 @@
         )
      {
+        strcpy(curvar->var->v_commoninfile,newvar->var->v_commoninfile);
         CopyRecord(curvar->var,newvar->var);
         present = 1;
@@ -535,4 +538,8 @@
                 sprintf(ligne,"TYPE(Agrif_%s), DIMENSION(:), ALLOCATABLE :: Agrif_%s_var",curmodulename,curmodulename); 
                 tofich(module_declar,ligne,1);
+                sprintf(ligne,"PUBLIC :: Agrif_%s",curmodulename); 
+                tofich(module_declar,ligne,1);
+                sprintf(ligne,"PUBLIC :: Agrif_%s_var",curmodulename); 
+                tofich(module_declar,ligne,1);
         }
    }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilListe.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilListe.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilListe.c	(revision 2715)
@@ -72,4 +72,5 @@
    var->v_optionaldeclare     = 0 ;
    var->v_allocatable         = 0 ;
+   var->v_target              = 0 ;
    var->v_dimsempty           = 0 ;
    var->v_dimension = (listdim *)NULL;
@@ -152,7 +153,13 @@
    }
    /* Si cette variable est declaree en save                                  */
-   if (SaveDeclare == 1 ) curvar->v_save = 1;
+   if (SaveDeclare == 1 ) {
+   curvar->v_save = 1;
+   }
+
    /* Si cette variable est v_allocatable                                     */
    if (Allocatabledeclare == 1 ) curvar->v_allocatable=1;
+   
+   /* Si cette variable est v_targer                                     */
+   if (Targetdeclare == 1 ) curvar->v_target=1;
    /* if INTENT spec has been given                                           */
    if ( strcasecmp(IntentSpec,"") )
@@ -202,4 +209,5 @@
       tmpvar->v_save=parcours->var->v_save;
       tmpvar->v_VariableIsParameter=parcours->var->v_VariableIsParameter;
+      printf("QLKDF\n");
       tmpvar->v_indicetabvars=parcours->var->v_indicetabvars;
       strcpy(tmpvar->v_modulename,parcours->var->v_modulename);
@@ -220,4 +228,5 @@
       tmpvar->v_optionaldeclare=parcours->var->v_optionaldeclare;
       tmpvar->v_allocatable=parcours->var->v_allocatable;
+      tmpvar->v_target=parcours->var->v_target;
       strcpy(tmpvar->v_IntentSpec,parcours->var->v_IntentSpec);
       tmpvar->v_dimsempty=parcours->var->v_dimsempty;
@@ -511,5 +520,5 @@
 }
 
-listname *Insertname(listname *lin,char *nom)
+listname *Insertname(listname *lin,char *nom, int sens)
 {
    listname *newvar ;
@@ -526,4 +535,6 @@
    else
    {
+      if (sens == 0)
+      {
       tmpvar = lin ;
       while (tmpvar->suiv)
@@ -533,5 +544,40 @@
       tmpvar -> suiv = newvar;
    }
+      else
+      {
+      newvar->suiv = lin;
+      lin = newvar;
+      }
+   }
    return lin;
+}
+
+listname *concat_listname(listname *l1, listname *l2)
+{
+   listname *tmpvar;
+
+   tmpvar = l1;
+   while (tmpvar->suiv)
+   {
+    tmpvar = tmpvar->suiv;
+   }
+   
+   tmpvar->suiv = l2;
+   
+   return l1;
+}
+
+void *createstringfromlistname(char *ligne, listname *lin)
+{
+listname *tmpvar;
+
+strcpy(ligne,"");
+tmpvar = lin;
+while(tmpvar)
+{
+  strcat(ligne,tmpvar->n_name);
+  if (tmpvar->suiv) strcat(ligne,",");
+  tmpvar=tmpvar->suiv;
+}
 }
 
@@ -618,2 +664,22 @@
 
 }
+
+void Init_List_Data_Var()
+{
+listvar *parcours;
+
+parcours = List_Data_Var_Cur;
+
+if (List_Data_Var_Cur)
+{
+while (parcours)
+{
+ List_Data_Var_Cur = List_Data_Var_Cur->suiv;
+ free(parcours);
+ parcours = List_Data_Var_Cur;
+}
+}
+
+List_Data_Var_Cur = NULL;
+
+}
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithParameterlist.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithParameterlist.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithParameterlist.c	(revision 2715)
@@ -49,6 +49,7 @@
    if ( firstpass == 1 )
    {
-      if ( VariableIsParameter == 1 ) List_GlobalParameter_Var =
-                         AddListvarToListvar(listin,List_GlobalParameter_Var,1);
+      if ( VariableIsParameter == 1 ) {
+      List_GlobalParameter_Var =  AddListvarToListvar(listin,List_GlobalParameter_Var,1);
+   }
    }
 }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistdatavariable.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistdatavariable.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistdatavariable.c	(revision 2715)
@@ -48,10 +48,11 @@
 /*                                                                            */
 /******************************************************************************/
-void Add_Data_Var_1 (char *name,char *values)
+void Add_Data_Var_1 (listvar **curlist,char *name,char *values)
 {
   listvar *newvar;
+  char ligne[LONG_C];
 
-  if ( firstpass == 1 )
-  {
+//  if ( firstpass == 1 )
+//  {
      newvar=(listvar *)malloc(sizeof(listvar));
      newvar->var=(variable *)malloc(sizeof(variable));
@@ -68,17 +69,75 @@
      strcpy(newvar->var->v_commoninfile,mainfile);
      Save_Length(mainfile,10);
-     strcpy(newvar->var->v_initialvalue,values);
-     Save_Length(values,14);
+     if (strchr(values,',') && strncasecmp(values,"'",1))
+            {
+            sprintf(ligne,"(/%s/)",values);
+            }
+     else
+       strcpy(ligne,values);
+       
+     strcpy(newvar->var->v_initialvalue,ligne);
+     Save_Length(ligne,14);
      newvar->suiv = NULL;
-
-     if ( !List_Data_Var )
+     if ( ! (*curlist) )
      {
-        List_Data_Var  = newvar ;
+        *curlist  = newvar ;
      }
      else
      {
-        newvar->suiv = List_Data_Var;
-        List_Data_Var = newvar;
+        newvar->suiv = *curlist;
+        *curlist = newvar;
      }
+//  }
+}
+
+void Add_Data_Var_Names_01 (listvar **curlist,listname *l1,listname *l2)
+{
+  listvar *newvar;
+  listvar *tmpvar;
+  listname *tmpvar1;
+  listname *tmpvar2;  
+  char ligne[LONG_C];
+  
+  tmpvar1 = l1;
+  tmpvar2 = l2;
+  
+  while (tmpvar1)
+     {
+     newvar=(listvar *)malloc(sizeof(listvar));
+     newvar->var=(variable *)malloc(sizeof(variable));
+     /*                                                                       */
+     Init_Variable(newvar->var);
+     /*                                                                       */
+     if ( inmoduledeclare == 1 ) newvar->var->v_module=1;
+     strcpy(newvar->var->v_nomvar,tmpvar1->n_name);
+     Save_Length(tmpvar1->n_name,4);
+     strcpy(newvar->var->v_subroutinename,subroutinename);
+     Save_Length(subroutinename,11);
+     strcpy(newvar->var->v_modulename,curmodulename);
+     Save_Length(curmodulename,6);
+     strcpy(newvar->var->v_commoninfile,mainfile);
+     Save_Length(mainfile,10);
+       
+     strcpy(newvar->var->v_initialvalue,tmpvar2->n_name);
+     Save_Length(tmpvar2->n_name,14);
+     newvar->suiv = NULL;
+     
+     if ( ! (*curlist) )
+     {
+        *curlist  = newvar ;
+     }
+     else
+     {
+        tmpvar = *curlist;
+        while (tmpvar->suiv)
+          tmpvar=tmpvar->suiv;
+        tmpvar->suiv = newvar;
+     }
+     
+  tmpvar1 = tmpvar1->suiv;
+  tmpvar2 = tmpvar2->suiv;  
   }
+  return;
+
+
 }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistofmodulebysubroutine.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistofmodulebysubroutine.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistofmodulebysubroutine.c	(revision 2715)
@@ -61,5 +61,5 @@
            List_ModuleUsed_Var = Readthedependfile
                                (tmplistmodule->u_usemodule,List_ModuleUsed_Var);
-
+         printf("PPPPPPPPPPPPPP\n");
            List_GlobParamModuleUsed_Var = ReaddependParameterList
                       (tmplistmodule->u_usemodule,List_GlobParamModuleUsed_Var);
@@ -281,7 +281,8 @@
 /*                                                                            */
 /******************************************************************************/
-void WriteUsemoduleDeclaration()
+void WriteUsemoduleDeclaration(char *cursubroutinename)
 {
   listusemodule *newmodule;
+  
 
   newmodule = List_NameOfModuleUsed;
@@ -290,9 +291,12 @@
   while ( newmodule )
   {
-     if ( !strcasecmp(newmodule->u_cursubroutine,subroutinename) )
+     if ( !strcasecmp(newmodule->u_cursubroutine,cursubroutinename) )
+     {
+     if (strcmp(newmodule->u_charusemodule,""))
      {
              fprintf(fortranout,"      USE %s \n"
                                                    ,newmodule->u_charusemodule);
      }
+     }
         newmodule = newmodule ->suiv;
   }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistvarindoloop.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistvarindoloop.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistvarindoloop.c	(revision 2715)
@@ -66,7 +66,10 @@
       newvar->suiv = NULL;
       strcpy(newvar->var->v_nomvar,ident);
+
       Save_Length(ident,4);
       strcpy(newvar->var->v_modulename,curmodulename);
       Save_Length(curmodulename,6);
+     printf("ICI %d\n",newvar->var->v_module);
+
       strcpy(newvar->var->v_commoninfile,mainfile);
       Save_Length(mainfile,10);
@@ -75,4 +78,5 @@
       newvar->var->v_pointedvar=pointedvar;
       List_UsedInSubroutine_Var = newvar ;
+       printf("jaoute %s\n",newvar->var->v_nomvar);
   }
   else
@@ -96,4 +100,5 @@
          /*                                                                   */
          strcpy(newvar->var->v_nomvar,ident);
+
          Save_Length(ident,4);
          strcpy(newvar->var->v_commoninfile,mainfile);
@@ -101,9 +106,11 @@
          strcpy(newvar->var->v_modulename,curmodulename);
          Save_Length(curmodulename,6);
+       printf("ICI %d\n",newvar->var->v_module);
          strcpy(newvar->var->v_subroutinename,subroutinename);
          Save_Length(subroutinename,11);
          newvar->var->v_pointedvar=pointedvar;
          newvar->suiv = List_UsedInSubroutine_Var;
-         List_UsedInSubroutine_Var = newvar;
+         printf("jaoute %s\n",newvar->var->v_nomvar);
+         List_UsedInSubroutine_Var = newvar;        
       }
   }
@@ -134,4 +141,5 @@
       newvar->suiv = NULL;
       strcpy(newvar->var->v_nomvar,name);
+
       Save_Length(name,4);
       strcpy(newvar->var->v_modulename,curmodulename);
@@ -181,4 +189,5 @@
          /*                                                                   */
          strcpy(newvar->var->v_nomvar,name);
+
          Save_Length(name,4);
          strcpy(newvar->var->v_modulename,curmodulename);
@@ -189,4 +198,5 @@
          Save_Length(subroutinename,11);
          newvar->var->v_pointedvar=pointedvar;
+
          /* we should find this new variable to know the tabvars indice       */
          if ( variableisglobal(newvar, List_Global_Var) == 1 )
@@ -303,4 +313,10 @@
                                   strcpy(var1->v_commonname,var2->v_commonname);
    else strcpy(var2->v_commonname,var1->v_commonname);
+   
+   printf("modulenameII = %s %s %d %s\n",var1->v_modulename,var2->v_modulename,var1->v_module,var1->v_nomvar);
+
+   if ( !strcasecmp(var1->v_modulename,"") || (var1->v_module ==0))
+                                  strcpy(var1->v_modulename,var2->v_modulename);
+   else strcpy(var2->v_modulename,var1->v_modulename);
 
    if ( !strcasecmp(var1->v_vallengspec,"") )
@@ -350,11 +366,15 @@
    if ( var1->v_save == 0 ) var1->v_save = var2->v_save ;
    else var2->v_save = var1->v_save ;
-
+   
    if ( var1->v_VariableIsParameter == 0 )
                      var1->v_VariableIsParameter = var2->v_VariableIsParameter ;
+                    
    else var2->v_VariableIsParameter = var1->v_VariableIsParameter ;
-
    if ( var1->v_indicetabvars == 0 )
+   {
+   
                                  var1->v_indicetabvars = var2->v_indicetabvars ;
+       printf("HERHEHR %s mm %s mm %d\n",var1->v_nomvar,var2->v_modulename,var2->v_indicetabvars);
+                                 }
    else var2->v_indicetabvars = var1->v_indicetabvars ;
 
@@ -387,4 +407,7 @@
    if ( var1->v_allocatable == 0 ) var1->v_allocatable = var2->v_allocatable ;
    else var2->v_allocatable = var1->v_allocatable ;
+   
+   if ( var1->v_target == 0 ) var1->v_target = var2->v_target ;
+   else var2->v_target = var1->v_target ;
 
    if ( var1->v_dimsempty == 0 ) var1->v_dimsempty = var2->v_dimsempty ;
@@ -424,5 +447,5 @@
       }
       /* if variable has been found                                           */
-      
+
       if ( out == 1 ) CopyRecord(parcours->var,parcours1->var);
       
@@ -489,6 +512,7 @@
          strcpy(newvar->var->v_subroutinename,parcours->var->v_subroutinename);
          strcpy(newvar->var->v_nomvar,parcours->var->v_nomvar);
+
          sprintf(ligne,"save_%s",parcours->var->v_subroutinename);
-         Add_NameOfCommon_1(ligne);
+         Add_NameOfCommon_1(ligne,parcours->var->v_subroutinename);
          strcpy(newvar->var->v_commonname,ligne);
          Save_Length(ligne,7);
@@ -504,7 +528,10 @@
          /*                                                                   */
          newvar->suiv = NULL;
+
          CopyRecord(parcours->var,newvar->var);
-         strcpy(newvar->var->v_subroutinename,"");
+         strcpy(newvar->var->v_subroutinename,parcours->var->v_subroutinename);
+
          strcpy(newvar->var->v_nomvar,parcours->var->v_nomvar);
+
          strcpy(newvar->var->v_modulename,parcours->var->v_modulename);
          List_Global_Var = AddListvarToListvar(newvar,List_Global_Var,1);
@@ -532,9 +559,12 @@
       while ( parcours1 && out == 0 )
       {
+
          if ( !strcasecmp(parcours->var->v_nomvar,
                           parcours1->var->v_nomvar)         &&
               !strcasecmp(parcours->var->v_subroutinename,
                           parcours1->var->v_subroutinename)
-            ) out = 1;
+            ) {
+            out = 1;     
+            }
          else parcours1 = parcours1->suiv;
       }
@@ -543,4 +573,5 @@
       {
          strcpy(parcours->var->v_commoninfile,parcours1->var->v_commoninfile);
+             
          CopyRecord(parcours->var,parcours1->var);
       }
@@ -559,24 +590,46 @@
    listvar *parcours1;
    int out;
+   int out2;
    
    parcours = list_to_modify;
+
    while( parcours )
    {
+     printf("LE NOM EST %s\n",parcours->var->v_nomvar);
       /* looking in List_Global_Var                                           */
       
       out = 0;
-      if (list_to_modify != List_SubroutineDeclaration_Var) {
+      
+//       if (list_to_modify != List_SubroutineDeclaration_Var && list_to_modify != List_UsedInSubroutine_Var) {
+//       parcours1 = List_Global_Var;
+//       while ( parcours1 && out == 0 )
+//       {
+//          if ( !strcasecmp(parcours->var->v_nomvar,
+//                           parcours1->var->v_nomvar)         &&
+//               !strcasecmp(parcours->var->v_modulename,
+//                           parcours1->var->v_modulename)
+//             ) out = 1;
+//          else parcours1 = parcours1->suiv;
+//       }
+//       }
+      
+  //    if (list_to_modify == List_UsedInSubroutine_Var) {
       parcours1 = List_Global_Var;
       while ( parcours1 && out == 0 )
       {
+      printf("lenombis est %s\n",parcours1->var->v_nomvar);
          if ( !strcasecmp(parcours->var->v_nomvar,
                           parcours1->var->v_nomvar)         &&
+                 !strcasecmp(parcours->var->v_subroutinename,
+                             parcours1->var->v_subroutinename) &&
               !strcasecmp(parcours->var->v_modulename,
                           parcours1->var->v_modulename)
-            ) out = 1;
+            ) {
+            out = 1;
+            }
          else parcours1 = parcours1->suiv;
       }
-      }
-          
+//      }      
+
       /* if variable has been found                                           */
       if ( out == 1 ) {
@@ -588,5 +641,5 @@
          parcours1 = List_SubroutineDeclaration_Var ;
          out = 0;
-         while ( parcours1 && out == 0 )
+         while ( parcours1)
          {
             if ( !strcasecmp(parcours->var->v_nomvar,
@@ -596,5 +649,9 @@
                  !strcasecmp(parcours->var->v_modulename,
                              parcours1->var->v_modulename)
-               ) out = 1;
+               ) {
+
+               out = 1;
+               break;
+               }
             else parcours1 = parcours1->suiv;
          }
@@ -603,4 +660,5 @@
          if ( out == 1 ) {
          CopyRecord(parcours->var,parcours1->var);
+        
          }
          else
@@ -620,6 +678,8 @@
             }
             /* if variable has been found                                     */
-            if ( out == 1 ) CopyRecord(parcours->var,parcours1->var);       
-         }
+            if ( out == 1 ) {
+            CopyRecord(parcours->var,parcours1->var);       
+         }
+      }
       }
       parcours = parcours->suiv;
@@ -636,10 +696,13 @@
    int out;
 
+   
    parcours = List_UsedInSubroutine_Var;
    while( parcours )
    {
       out = 0 ;
+      printf("OIEROZEIR %s %s\n",parcours->var->v_nomvar,parcours->var->v_modulename);
       if ( parcours->var->v_indicetabvars == 0 )
       {
+       printf("OIEROZEIR %s\n",parcours->var->v_nomvar);
          parcours2 = List_NameOfModuleUsed;
          while( parcours2 )
@@ -864,4 +927,5 @@
            remove = LookingForVariableInList(List_SubroutineDeclaration_Var,
                                                                  parcours->var);
+
       if ( remove == 0 )
            remove = LookingForVariableInList(List_Parameter_Var,
@@ -873,7 +937,10 @@
            remove = LookingForVariableInListGlob(List_GlobalParameter_Var,
                                                                  parcours->var);
+      
       if ( remove == 0 )
            remove = LookingForVariableInListParamGlob(
                                     List_GlobParamModuleUsed_Var,parcours->var);
+
+  
       if ( remove == 0 )
       {
@@ -885,7 +952,9 @@
          else remove = 1;
       }
+
       /************************************************************************/
       /*                         Remove                                       */
       /************************************************************************/
+
       if ( remove == 1 )
       {
@@ -907,4 +976,5 @@
       }
    }
+   
 
 }
@@ -1136,12 +1206,14 @@
 /*   newvar = List_Common_Var;*/
 /*   newvar = List_UsedInSubroutine_Var;*/
+/*   newvar = List_Data_Var;*/
    while ( newvar )
    {
-      printf("++++ %s %d %s %s %s\n",
+      printf("++++ %s - %d - %s - %s - %s - %s\n",
       newvar->var->v_nomvar,
       newvar->var->v_VariableIsParameter,
       newvar->var->v_subroutinename,
       newvar->var->v_modulename,
-      newvar->var->v_typevar
+      newvar->var->v_typevar,
+      newvar->var->v_initialvalue      
             );
       newvar = newvar->suiv;
@@ -1642,5 +1714,4 @@
    listnom *parcours_nom;
    char ligne[LONG_C];
-
    if ( firstpass == 0 )
    {
@@ -1650,6 +1721,9 @@
          if ( parcours_nom->o_val == 1 )
          {
+            strcpy(ligne,"");
+            tofich(fortranout,ligne,1);
             sprintf (ligne, "module %s",parcours_nom->o_nom);
             tofich(fortranout,ligne,1);
+            WriteUsemoduleDeclaration(parcours_nom->o_subroutinename);
             strcpy(ligne,"implicit none");
             tofich(fortranout,ligne,1);
@@ -1844,4 +1918,5 @@
    }
    if ( mark == 1 ) printf("Indicemaxtabvars = %d \n",indicemaxtabvars);
+   
 }
 
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WriteInFile.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WriteInFile.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WriteInFile.c	(revision 2715)
@@ -230,4 +230,5 @@
       fseek(filout,position,SEEK_SET);
       tofich_line(filout,sizetoremove,position);
+
    }
 }
@@ -245,4 +246,5 @@
       fseek(filout,position,SEEK_CUR);
       tofich_blanc(filout,sizetoremove);
+
    }
 }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Writedeclarations.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Writedeclarations.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/Writedeclarations.c	(revision 2715)
@@ -97,7 +97,9 @@
   }
   if ( v->v_ExternalDeclare     == 1 ) strcat(ligne, ", EXTERNAL");
-  if ( v->v_allocatable         == 1 &&
-       v->v_save                == 0 )
+  if ( v->v_allocatable         == 1)
        {strcat(ligne,", ALLOCATABLE");
+       }
+  if ( v->v_target         == 1)
+       {strcat(ligne,", TARGET");
        }
   if ( v->v_optionaldeclare     == 1 ) strcat(ligne,", OPTIONAL");
@@ -212,5 +214,5 @@
   {
      v = newvar->var;
-     
+     if (mark == 1) fprintf(fileout,"222222233333333\n");
      WriteBeginDeclaration(v,ligne,visibility);
 
@@ -225,4 +227,5 @@
      
      tofich (filecommon, ligne,1);
+     if (mark == 1) fprintf(fileout,"44444433333333\n");     
   }
   Save_Length(ligne,45);
@@ -272,5 +275,4 @@
       if ( !strcasecmp(parcours->var->v_subroutinename,subroutinename) &&
            parcours->var->v_save == 0                                  &&
-          (parcours->var->v_allocatable == 0  || !strcasecmp(parcours->var->v_typevar,"type"))      &&
            parcours->var->v_pointerdeclare == 0                        &&
            parcours->var->v_VariableIsParameter == 0                   &&
@@ -406,4 +408,5 @@
 
   parcoursprec = (listnom * )NULL;
+
   /* we should list the needed parameter                                      */
   if ( !strcasecmp(name_common,commonname) )
@@ -415,8 +418,10 @@
   {
      newvar = deb_common;
+
      out = 0 ;
      while ( newvar && out == 0 )
      {
-        if ( !strcasecmp(parcours->o_nom,newvar->var->v_nomvar) )
+     
+        if ( !strcasecmp(parcours->o_nom,newvar->var->v_nomvar) && !strcasecmp(var->v_subroutinename,newvar->var->v_subroutinename))
         {
            out=1;
@@ -438,5 +443,5 @@
      while ( newvar && out == 0 )
      {
-        if ( !strcasecmp(parcours->o_nom,newvar->var->v_nomvar) )
+        if ( !strcasecmp(parcours->o_nom,newvar->var->v_nomvar) && !strcasecmp(var->v_subroutinename,newvar->var->v_subroutinename))        
         {
            out=1;
@@ -460,5 +465,5 @@
      {
         if ( !strcasecmp(parcours->o_nom,newvar->var->v_nomvar) &&
-             parcours->o_val == 0 )
+            !strcasecmp(var->v_subroutinename,newvar->var->v_subroutinename) && parcours->o_val == 0 )
         {
            writeit=1;
@@ -472,9 +477,9 @@
         changeval = 0;
         v = newvar->var;
-        if ( v->v_allocatable == 1 && strcasecmp(v->v_typevar,"type") )
-        {
-           changeval = 1;
-           v->v_allocatable = 0;
-        }
+//        if ( v->v_allocatable == 1 && strcasecmp(v->v_typevar,"type") )
+//        {
+//           changeval = 1;
+//           v->v_allocatable = 0;
+//        }
         WriteBeginDeclaration(v,ligne,1);
         if ( v->v_nbdim == 0 ) WriteScalarDeclaration(v,ligne);
@@ -523,9 +528,9 @@
   tofich (fileout, "",1);
   newvar = deb_common;
+
   while (newvar)
   {
      if ( newvar->var->v_nbdim == 0 &&
           !strcasecmp(newvar->var->v_subroutinename,subroutinename)  &&
-          (newvar->var->v_allocatable == 0  || !strcasecmp(newvar->var->v_typevar,"type"))      &&
            newvar->var->v_pointerdeclare == 0
          )
@@ -565,8 +570,8 @@
   while (newvar)
   {
+  printf("newvar = %s %d %s\n",newvar->var->v_nomvar,newvar->var->v_pointerdeclare,newvar->var->v_typevar);
      if ( newvar->var->v_nbdim != 0                                 &&
           !strcasecmp(newvar->var->v_subroutinename,subroutinename) &&
-          (newvar->var->v_allocatable == 0  || !strcasecmp(newvar->var->v_typevar,"type"))      &&
-          newvar->var->v_pointerdeclare == 0
+          (newvar->var->v_pointerdeclare == 0 || !strcasecmp(newvar->var->v_typevar,"type"))
         )
      {
@@ -577,6 +582,6 @@
           if (strcasecmp(v->v_typevar,"type"))
            {
-           changeval = 1;
-           v->v_allocatable = 0;
+      //     changeval = 1;
+      //     v->v_allocatable = 0;
            }
           else
@@ -626,6 +631,10 @@
 out = LookingForVariableInList(List_SubroutineArgument_Var,parcours->var);
 if (out == 0) out = VariableIsInListCommon(parcours,List_Common_Var);
+
+
+
 if (out == 0) out = LookingForVariableInList(List_Parameter_Var,parcours->var);
 if (out == 0) out = LookingForVariableInList(List_FunctionType_Var,parcours->var);
+if (out == 0) out = LookingForVariableInListGlobal(List_Global_Var,parcours->var);
 
 /*
@@ -658,2 +667,36 @@
 }
 }
+
+void ReWriteDataStatement_0(FILE * filout)
+{
+listvar *parcours;
+int out;
+char ligne[LONG_C];
+char initialvalue[LONG_C];
+
+if (insubroutinedeclare == 1)
+{
+parcours = List_Data_Var_Cur ;
+while (parcours)
+{
+out = VariableIsInListCommon(parcours,List_Common_Var);
+if (out == 0) out = LookingForVariableInListGlobal(List_Global_Var,parcours->var);
+
+if (out == 0)
+{
+if (strncasecmp(parcours->var->v_initialvalue,"(/",2))
+{
+strcpy(initialvalue,parcours->var->v_initialvalue);
+}
+else
+{
+strncpy(initialvalue,&parcours->var->v_initialvalue[2],strlen(parcours->var->v_initialvalue)-4);
+strcpy(&initialvalue[strlen(parcours->var->v_initialvalue)-4],"\0");
+}
+sprintf(ligne,"data %s/%s/",parcours->var->v_nomvar,initialvalue);
+tofich(filout,ligne,1);
+}
+parcours = parcours->suiv;
+}
+}
+}
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h	(revision 2715)
@@ -38,5 +38,5 @@
 #define LONG_4C 4000
 #define LONG_4M 4000
-#define LONG_40M 40000
+#define LONG_40M 4000000
 
 /******************************************************************************/
@@ -89,4 +89,5 @@
    int  v_optionaldeclare;
    int  v_allocatable;
+   int  v_target;
    int  v_dimsempty;
    listdim *v_dimension;
@@ -142,4 +143,5 @@
    char o_nom[LONG_C];
    char o_module[LONG_C];
+   char o_subroutinename[LONG_C];
    int  o_val;
    listcouple *couple;
@@ -181,4 +183,5 @@
  listvar *List_Global_Var;
  listvar *List_Data_Var;
+ listvar *List_Data_Var_Cur;
  listvar *List_Save_Var;
  listvar *List_SubroutineArgument_Var;
@@ -233,4 +236,5 @@
 /******************************************************************************/
  int inagrifcallargument;
+ int afterpercent;
  int sameagrifargument;
  int InAgrifParentDef;
@@ -246,4 +250,5 @@
  int InitialValueGiven;    /* An initial value has been given */
  int Allocatabledeclare;
+ int Targetdeclare;
  int SaveDeclare;
  int functiondeclarationisdone;
@@ -267,4 +272,6 @@
  char vallengspec[LONG_C];
  char subroutinename[LONG_C];
+ int isrecursive;
+ char previoussubroutinename[LONG_C];
 
 /******************************************************************************/
@@ -303,7 +310,9 @@
  int checkexistcommon;
  int insubroutinedeclare;
+ int ininterfacedeclare;
  int inmoduledeclare;
  int dimsempty;
  int created_dimensionlist;
+ int incontainssubroutine;
 
  char meetagrifinitgrids[LONG_C];
@@ -479,5 +488,5 @@
 extern void Addmoduletothelisttmp(char *name);
 extern void Add_NameOfModule_1(char *nom);
-extern void Add_NameOfCommon_1(char *nom);
+extern void Add_NameOfCommon_1(char *nom,char *cursubroutinename);
 extern void Add_CouplePointed_Var_1(char *namemodule,listcouple *couple);
 extern void Add_Include_1(char *name);
@@ -490,7 +499,7 @@
 /******************************************************************************/
 extern void writeheadnewsub_0();
-extern void WriteVariablelist_subloop(FILE *outputfile);
-extern void WriteVariablelist_subloop_Call(FILE *outputfile);
-extern void WriteVariablelist_subloop_Def(FILE *outputfile);
+extern void WriteVariablelist_subloop(FILE *outputfile,char *ligne);
+extern void WriteVariablelist_subloop_Call(FILE *outputfile,char *ligne);
+extern void WriteVariablelist_subloop_Def(FILE *outputfile,char *ligne);
 extern void WriteHeadofSubroutineLoop();
 extern void closeandcallsubloopandincludeit_0(int suborfun);
@@ -600,8 +609,11 @@
 extern void printliste(listvar * lin);
 extern int IsinListe(listvar *lin,char *nom);
-extern listname *Insertname(listname *lin,char *nom);
+extern listname *Insertname(listname *lin,char *nom,int sens);
+extern listname *concat_listname(listname *l1, listname *l2);
+extern void *createstringfromlistname(char *ligne, listname *lin);
 extern void printname(listname * lin);
 extern void removeglobfromlist(listname **lin);
 extern void writelistpublic(listname *lin);
+extern void Init_List_Data_Var();
 /******************************************************************************/
 /*********** UtilNotGridDep.c *************************************************/
@@ -624,5 +636,6 @@
 /*********** WorkWithlistdatavariable.c ***************************************/
 /******************************************************************************/
-extern void Add_Data_Var_1 (char *name,char *values);
+extern void Add_Data_Var_1 (listvar **curlist,char *name,char *values);
+extern void Add_Data_Var_Names_01 (listvar **curlist,listname *l1, listname *l2);
 /******************************************************************************/
 /*********** WorkWithlistmoduleinfile.c ***************************************/
@@ -637,5 +650,5 @@
 extern void Add_NameOfModuleUsed_1(char *name);
 extern void Addmoduletothelist(char *name);
-extern void WriteUsemoduleDeclaration();
+extern void WriteUsemoduleDeclaration(char *cursubroutinename);
 /******************************************************************************/
 /*********** WorkWithlistvarindoloop.c ****************************************/
@@ -711,4 +724,5 @@
 extern void writesub_loopdeclaration_tab (listvar * deb_common, FILE *fileout);
 extern void ReWriteDeclarationAndAddTosubroutine_01(listvar *listdecl);
+extern void ReWriteDataStatement_0(FILE * filout);
 /******************************************************************************/
 /*********** WriteInFile.c ****************************************************/
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/dependfile.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/dependfile.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/dependfile.c	(revision 2715)
@@ -431,4 +431,13 @@
               fprintf(dependfileoutput,"T\n");
            }
+           /********** MODULENAME *********************************************/
+           if ( strcasecmp(parcours->var->v_modulename,"") )
+           {
+              fprintf(dependfileoutput,"%s\n",parcours->var->v_modulename);
+           }
+           else
+           {
+              fprintf(dependfileoutput,"T\n");
+           }
            /********** NBDIM **************************************************/
 /*           fprintf(dependfileoutput,"%d\n",parcours->var->v_nbdim);*/
@@ -437,4 +446,6 @@
            /********** ALLOCATABLE ********************************************/
            fprintf(dependfileoutput,"%d\n",parcours->var->v_allocatable);
+           /********** TARGET ********************************************/
+           fprintf(dependfileoutput,"%d\n",parcours->var->v_target);
            /********** POINTERDECLARE *****************************************/
            fprintf(dependfileoutput,"%d\n",parcours->var->v_pointerdeclare);
@@ -466,4 +477,7 @@
               fprintf(dependfileoutput,"T\n");
            }
+           /********** PRIVATE *****************************************/
+           fprintf(dependfileoutput,"%d\n",parcours->var->v_PrivateDeclare);
+              
            /********** INDICETABVARS ******************************************/
            fprintf(dependfileoutput,"%d\n",parcours->var->v_indicetabvars);
@@ -562,4 +576,15 @@
             strcpy(parcours->var->v_commonname,"");
          }
+           /********** MODULENAME *********************************************/
+         fscanf(dependfileoutput,"%s\n",parcours->var->v_modulename);
+         
+         printf("MODULENAME = %s %s\n",parcours->var->v_nomvar,parcours->var->v_modulename);
+         
+         if ( !strcasecmp(parcours->var->v_modulename,"T") )
+         {
+            strcpy(parcours->var->v_modulename,"");
+         }
+         
+
            /********** NBDIM **************************************************/
 /*         fscanf(dependfileoutput,"%d\n",&parcours->var->v_nbdim);*/
@@ -573,4 +598,7 @@
                                parcours->var->v_commonname);
          }
+           /********** TARGET ********************************************/
+         fscanf(dependfileoutput,"%d\n",&parcours->var->v_target);
+         
            /********** POINTERDECLARE *****************************************/
          fscanf(dependfileoutput,"%d\n",&parcours->var->v_pointerdeclare);
@@ -597,4 +625,7 @@
             strcpy(parcours->var->v_nameinttypename,"");
          }
+           /********** PRIVATE *****************************************/
+         fscanf(dependfileoutput,"%d\n",&parcours->var->v_PrivateDeclare);
+         
            /********** INDICETABVARS ******************************************/
          fscanf(dependfileoutput,"%d\n",&parcours->var->v_indicetabvars);
@@ -624,4 +655,6 @@
          fscanf(dependfileoutput,"%s\n",nothing);
          parcours->suiv = NULL;
+         if (parcours->var->v_PrivateDeclare == 0)
+         {
          if ( !listout )
          {
@@ -643,4 +676,5 @@
                parcoursprec = parcours0->suiv;
             }
+         }
          }
          parcours = NULL;
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.c	(revision 2715)
@@ -1,37 +1,429 @@
-#ifndef lint
-static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
-#endif
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING (yyerrflag!=0)
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "2.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* Substitute the variable and function names.  */
 #define yyparse fortranparse
 #define yylex fortranlex
 #define yyerror fortranerror
-#define yychar fortranchar
-#define yyval fortranval
 #define yylval fortranlval
+#define yychar  fortranchar
 #define yydebug fortrandebug
 #define yynerrs fortrannerrs
-#define yyerrflag fortranerrflag
-#define yyss fortranss
-#define yyssp fortranssp
-#define yyvs fortranvs
-#define yyvsp fortranvsp
-#define yylhs fortranlhs
-#define yylen fortranlen
-#define yydefred fortrandefred
-#define yydgoto fortrandgoto
-#define yysindex fortransindex
-#define yyrindex fortranrindex
-#define yygindex fortrangindex
-#define yytable fortrantable
-#define yycheck fortrancheck
-#define yyname fortranname
-#define yyrule fortranrule
-#define YYPREFIX "fortran"
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     TOK_BINARY_OP = 258,
+     TOK_NEQV = 259,
+     TOK_EQV = 260,
+     TOK_XOR = 261,
+     TOK_OR = 262,
+     TOK_AND = 263,
+     TOK_NOT = 264,
+     TOK_NE = 265,
+     TOK_EQ = 266,
+     TOK_GE = 267,
+     TOK_LE = 268,
+     TOK_GT = 269,
+     TOK_LT = 270,
+     TOK_UNARY_OP = 271,
+     TOK_DSLASH = 272,
+     TOK_SLASH = 273,
+     TOK_DASTER = 274,
+     TOK_SEP = 275,
+     TOK_SEMICOLON = 276,
+     TOK_NEXTLINE = 277,
+     TOK_PARAMETER = 278,
+     TOK_RESULT = 279,
+     TOK_ONLY = 280,
+     TOK_INCLUDE = 281,
+     TOK_SUBROUTINE = 282,
+     TOK_PROGRAM = 283,
+     TOK_FUNCTION = 284,
+     TOK_OMP = 285,
+     TOK_DOLLAR = 286,
+     TOK_FORMAT = 287,
+     TOK_MAX = 288,
+     TOK_TANH = 289,
+     TOK_WHERE = 290,
+     TOK_ELSEWHERE = 291,
+     TOK_ENDWHERE = 292,
+     TOK_MAXVAL = 293,
+     TOK_TRIM = 294,
+     TOK_SUM = 295,
+     TOK_SQRT = 296,
+     TOK_CASE = 297,
+     TOK_SELECTCASE = 298,
+     TOK_FILE = 299,
+     TOK_END = 300,
+     TOK_ERR = 301,
+     TOK_DONOTTREAT = 302,
+     TOK_ENDDONOTTREAT = 303,
+     TOK_EXIST = 304,
+     TOK_MIN = 305,
+     TOK_FLOAT = 306,
+     TOK_EXP = 307,
+     TOK_COS = 308,
+     TOK_COSH = 309,
+     TOK_ACOS = 310,
+     TOK_NINT = 311,
+     TOK_CYCLE = 312,
+     TOK_SIN = 313,
+     TOK_SINH = 314,
+     TOK_ASIN = 315,
+     TOK_EQUIVALENCE = 316,
+     TOK_BACKSPACE = 317,
+     TOK_LOG = 318,
+     TOK_TAN = 319,
+     TOK_ATAN = 320,
+     TOK_RECURSIVE = 321,
+     TOK_ABS = 322,
+     TOK_MOD = 323,
+     TOK_SIGN = 324,
+     TOK_MINLOC = 325,
+     TOK_MAXLOC = 326,
+     TOK_EXIT = 327,
+     TOK_MINVAL = 328,
+     TOK_PUBLIC = 329,
+     TOK_PRIVATE = 330,
+     TOK_ALLOCATABLE = 331,
+     TOK_RETURN = 332,
+     TOK_THEN = 333,
+     TOK_ELSEIF = 334,
+     TOK_ELSE = 335,
+     TOK_ENDIF = 336,
+     TOK_PRINT = 337,
+     TOK_PLAINGOTO = 338,
+     TOK_CONSTRUCTID = 339,
+     TOK_LOGICALIF = 340,
+     TOK_PLAINDO = 341,
+     TOK_CONTAINS = 342,
+     TOK_ENDDO = 343,
+     TOK_MODULE = 344,
+     TOK_ENDMODULE = 345,
+     TOK_DOWHILE = 346,
+     TOK_ALLOCATE = 347,
+     TOK_OPEN = 348,
+     TOK_CLOSE = 349,
+     TOK_INQUIRE = 350,
+     TOK_WRITE = 351,
+     TOK_READ = 352,
+     TOK_REWIND = 353,
+     TOK_DEALLOCATE = 354,
+     TOK_NULLIFY = 355,
+     TOK_FIN = 356,
+     TOK_DEBUT = 357,
+     TOK_DIMENSION = 358,
+     TOK_ENDSELECT = 359,
+     TOK_EXTERNAL = 360,
+     TOK_INTENT = 361,
+     TOK_INTRINSIC = 362,
+     TOK_NAMELIST = 363,
+     TOK_CASEDEFAULT = 364,
+     TOK_OPTIONAL = 365,
+     TOK_POINTER = 366,
+     TOK_CONTINUE = 367,
+     TOK_SAVE = 368,
+     TOK_TARGET = 369,
+     TOK_QUOTE = 370,
+     TOK_IMPLICIT = 371,
+     TOK_NONE = 372,
+     TOK_CALL = 373,
+     TOK_STAT = 374,
+     TOK_POINT_TO = 375,
+     TOK_COMMON = 376,
+     TOK_GLOBAL = 377,
+     TOK_INTERFACE = 378,
+     TOK_ENDINTERFACE = 379,
+     TOK_LEFTAB = 380,
+     TOK_RIGHTAB = 381,
+     TOK_PAUSE = 382,
+     TOK_PROCEDURE = 383,
+     TOK_STOP = 384,
+     TOK_NAMEEQ = 385,
+     TOK_REAL8 = 386,
+     TOK_OUT = 387,
+     TOK_INOUT = 388,
+     TOK_IN = 389,
+     TOK_USE = 390,
+     TOK_TRUE = 391,
+     TOK_FALSE = 392,
+     TOK_LABEL = 393,
+     TOK_TYPE = 394,
+     TOK_TYPEPAR = 395,
+     TOK_ENDTYPE = 396,
+     TOK_REAL = 397,
+     TOK_INTEGER = 398,
+     TOK_LOGICAL = 399,
+     TOK_DOUBLEPRECISION = 400,
+     TOK_DOUBLEREAL = 401,
+     TOK_ENDSUBROUTINE = 402,
+     TOK_ENDFUNCTION = 403,
+     TOK_ENDPROGRAM = 404,
+     TOK_ENDUNIT = 405,
+     TOK_CHARACTER = 406,
+     TOK_CHAR_CONSTANT = 407,
+     TOK_CHAR_CUT = 408,
+     TOK_DATA = 409,
+     TOK_CHAR_INT = 410,
+     TOK_CHAR_MESSAGE = 411,
+     TOK_CSTREAL = 412,
+     TOK_CSTREALDP = 413,
+     TOK_CSTREALQP = 414,
+     TOK_SFREAL = 415,
+     TOK_COMPLEX = 416,
+     TOK_DOUBLECOMPLEX = 417,
+     TOK_NAME = 418,
+     TOK_NAME_CHAR = 419,
+     TOK_PROBTYPE = 420,
+     TOK_INTERPTYPE = 421,
+     TOK_VARTYPE = 422,
+     TOK_BC = 423,
+     TOK_OP = 424,
+     TOK_CSTINT = 425,
+     TOK_COMMENT = 426,
+     TOK_FILENAME = 427
+   };
+#endif
+/* Tokens.  */
+#define TOK_BINARY_OP 258
+#define TOK_NEQV 259
+#define TOK_EQV 260
+#define TOK_XOR 261
+#define TOK_OR 262
+#define TOK_AND 263
+#define TOK_NOT 264
+#define TOK_NE 265
+#define TOK_EQ 266
+#define TOK_GE 267
+#define TOK_LE 268
+#define TOK_GT 269
+#define TOK_LT 270
+#define TOK_UNARY_OP 271
+#define TOK_DSLASH 272
+#define TOK_SLASH 273
+#define TOK_DASTER 274
+#define TOK_SEP 275
+#define TOK_SEMICOLON 276
+#define TOK_NEXTLINE 277
+#define TOK_PARAMETER 278
+#define TOK_RESULT 279
+#define TOK_ONLY 280
+#define TOK_INCLUDE 281
+#define TOK_SUBROUTINE 282
+#define TOK_PROGRAM 283
+#define TOK_FUNCTION 284
+#define TOK_OMP 285
+#define TOK_DOLLAR 286
+#define TOK_FORMAT 287
+#define TOK_MAX 288
+#define TOK_TANH 289
+#define TOK_WHERE 290
+#define TOK_ELSEWHERE 291
+#define TOK_ENDWHERE 292
+#define TOK_MAXVAL 293
+#define TOK_TRIM 294
+#define TOK_SUM 295
+#define TOK_SQRT 296
+#define TOK_CASE 297
+#define TOK_SELECTCASE 298
+#define TOK_FILE 299
+#define TOK_END 300
+#define TOK_ERR 301
+#define TOK_DONOTTREAT 302
+#define TOK_ENDDONOTTREAT 303
+#define TOK_EXIST 304
+#define TOK_MIN 305
+#define TOK_FLOAT 306
+#define TOK_EXP 307
+#define TOK_COS 308
+#define TOK_COSH 309
+#define TOK_ACOS 310
+#define TOK_NINT 311
+#define TOK_CYCLE 312
+#define TOK_SIN 313
+#define TOK_SINH 314
+#define TOK_ASIN 315
+#define TOK_EQUIVALENCE 316
+#define TOK_BACKSPACE 317
+#define TOK_LOG 318
+#define TOK_TAN 319
+#define TOK_ATAN 320
+#define TOK_RECURSIVE 321
+#define TOK_ABS 322
+#define TOK_MOD 323
+#define TOK_SIGN 324
+#define TOK_MINLOC 325
+#define TOK_MAXLOC 326
+#define TOK_EXIT 327
+#define TOK_MINVAL 328
+#define TOK_PUBLIC 329
+#define TOK_PRIVATE 330
+#define TOK_ALLOCATABLE 331
+#define TOK_RETURN 332
+#define TOK_THEN 333
+#define TOK_ELSEIF 334
+#define TOK_ELSE 335
+#define TOK_ENDIF 336
+#define TOK_PRINT 337
+#define TOK_PLAINGOTO 338
+#define TOK_CONSTRUCTID 339
+#define TOK_LOGICALIF 340
+#define TOK_PLAINDO 341
+#define TOK_CONTAINS 342
+#define TOK_ENDDO 343
+#define TOK_MODULE 344
+#define TOK_ENDMODULE 345
+#define TOK_DOWHILE 346
+#define TOK_ALLOCATE 347
+#define TOK_OPEN 348
+#define TOK_CLOSE 349
+#define TOK_INQUIRE 350
+#define TOK_WRITE 351
+#define TOK_READ 352
+#define TOK_REWIND 353
+#define TOK_DEALLOCATE 354
+#define TOK_NULLIFY 355
+#define TOK_FIN 356
+#define TOK_DEBUT 357
+#define TOK_DIMENSION 358
+#define TOK_ENDSELECT 359
+#define TOK_EXTERNAL 360
+#define TOK_INTENT 361
+#define TOK_INTRINSIC 362
+#define TOK_NAMELIST 363
+#define TOK_CASEDEFAULT 364
+#define TOK_OPTIONAL 365
+#define TOK_POINTER 366
+#define TOK_CONTINUE 367
+#define TOK_SAVE 368
+#define TOK_TARGET 369
+#define TOK_QUOTE 370
+#define TOK_IMPLICIT 371
+#define TOK_NONE 372
+#define TOK_CALL 373
+#define TOK_STAT 374
+#define TOK_POINT_TO 375
+#define TOK_COMMON 376
+#define TOK_GLOBAL 377
+#define TOK_INTERFACE 378
+#define TOK_ENDINTERFACE 379
+#define TOK_LEFTAB 380
+#define TOK_RIGHTAB 381
+#define TOK_PAUSE 382
+#define TOK_PROCEDURE 383
+#define TOK_STOP 384
+#define TOK_NAMEEQ 385
+#define TOK_REAL8 386
+#define TOK_OUT 387
+#define TOK_INOUT 388
+#define TOK_IN 389
+#define TOK_USE 390
+#define TOK_TRUE 391
+#define TOK_FALSE 392
+#define TOK_LABEL 393
+#define TOK_TYPE 394
+#define TOK_TYPEPAR 395
+#define TOK_ENDTYPE 396
+#define TOK_REAL 397
+#define TOK_INTEGER 398
+#define TOK_LOGICAL 399
+#define TOK_DOUBLEPRECISION 400
+#define TOK_DOUBLEREAL 401
+#define TOK_ENDSUBROUTINE 402
+#define TOK_ENDFUNCTION 403
+#define TOK_ENDPROGRAM 404
+#define TOK_ENDUNIT 405
+#define TOK_CHARACTER 406
+#define TOK_CHAR_CONSTANT 407
+#define TOK_CHAR_CUT 408
+#define TOK_DATA 409
+#define TOK_CHAR_INT 410
+#define TOK_CHAR_MESSAGE 411
+#define TOK_CSTREAL 412
+#define TOK_CSTREALDP 413
+#define TOK_CSTREALQP 414
+#define TOK_SFREAL 415
+#define TOK_COMPLEX 416
+#define TOK_DOUBLECOMPLEX 417
+#define TOK_NAME 418
+#define TOK_NAME_CHAR 419
+#define TOK_PROBTYPE 420
+#define TOK_INTERPTYPE 421
+#define TOK_VARTYPE 422
+#define TOK_BC 423
+#define TOK_OP 424
+#define TOK_CSTINT 425
+#define TOK_COMMENT 426
+#define TOK_FILENAME 427
+
+
+
+
+/* Copy the first part of user declarations.  */
 #line 36 "fortran.y"
+
+#define YYMAXDEPTH 1000
 #include <stdlib.h>
 #include <stdio.h>
@@ -53,6 +445,28 @@
 int removeline=0;
 listvar *test;
-#line 57 "fortran.y"
-typedef union {
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 59 "fortran.y"
+{
        char      nac[LONG_C];
        char      na[LONGNOM];
@@ -64,286 +478,819 @@
        typedim   dim1;
        variable *v;
-       } YYSTYPE;
-#line 68 "y.tab.c"
-#define TOK_BINARY_OP 257
-#define TOK_EQV 258
-#define TOK_NEQV 259
-#define TOK_OR 260
-#define TOK_XOR 261
-#define TOK_AND 262
-#define TOK_NOT 263
-#define TOK_LT 264
-#define TOK_GT 265
-#define TOK_LE 266
-#define TOK_GE 267
-#define TOK_EQ 268
-#define TOK_NE 269
-#define TOK_UNARY_OP 270
-#define TOK_DSLASH 271
-#define TOK_SLASH 272
-#define TOK_DASTER 273
-#define TOK_SEP 274
-#define TOK_SEMICOLON 275
-#define TOK_NEXTLINE 276
-#define TOK_PARAMETER 277
-#define TOK_RESULT 278
-#define TOK_ONLY 279
-#define TOK_INCLUDE 280
-#define TOK_SUBROUTINE 281
-#define TOK_PROGRAM 282
-#define TOK_FUNCTION 283
-#define TOK_OMP 284
-#define TOK_DOLLAR 285
-#define TOK_FORMAT 286
-#define TOK_MAX 287
-#define TOK_TANH 288
-#define TOK_WHERE 289
-#define TOK_ELSEWHERE 290
-#define TOK_ENDWHERE 291
-#define TOK_MAXVAL 292
-#define TOK_TRIM 293
-#define TOK_SUM 294
-#define TOK_SQRT 295
-#define TOK_CASE 296
-#define TOK_SELECTCASE 297
-#define TOK_FILE 298
-#define TOK_END 299
-#define TOK_ERR 300
-#define TOK_DONOTTREAT 301
-#define TOK_ENDDONOTTREAT 302
-#define TOK_EXIST 303
-#define TOK_MIN 304
-#define TOK_FLOAT 305
-#define TOK_EXP 306
-#define TOK_COS 307
-#define TOK_COSH 308
-#define TOK_ACOS 309
-#define TOK_NINT 310
-#define TOK_CYCLE 311
-#define TOK_SIN 312
-#define TOK_SINH 313
-#define TOK_ASIN 314
-#define TOK_EQUIVALENCE 315
-#define TOK_BACKSPACE 316
-#define TOK_LOG 317
-#define TOK_TAN 318
-#define TOK_ATAN 319
-#define TOK_RECURSIVE 320
-#define TOK_ABS 321
-#define TOK_MOD 322
-#define TOK_SIGN 323
-#define TOK_MINLOC 324
-#define TOK_MAXLOC 325
-#define TOK_EXIT 326
-#define TOK_MINVAL 327
-#define TOK_PUBLIC 328
-#define TOK_PRIVATE 329
-#define TOK_ALLOCATABLE 330
-#define TOK_RETURN 331
-#define TOK_THEN 332
-#define TOK_ELSEIF 333
-#define TOK_ELSE 334
-#define TOK_ENDIF 335
-#define TOK_PRINT 336
-#define TOK_PLAINGOTO 337
-#define TOK_CONSTRUCTID 338
-#define TOK_LOGICALIF 339
-#define TOK_PLAINDO 340
-#define TOK_CONTAINS 341
-#define TOK_ENDDO 342
-#define TOK_MODULE 343
-#define TOK_ENDMODULE 344
-#define TOK_DOWHILE 345
-#define TOK_ALLOCATE 346
-#define TOK_OPEN 347
-#define TOK_CLOSE 348
-#define TOK_INQUIRE 349
-#define TOK_WRITE 350
-#define TOK_READ 351
-#define TOK_REWIND 352
-#define TOK_DEALLOCATE 353
-#define TOK_NULLIFY 354
-#define TOK_FIN 355
-#define TOK_DEBUT 356
-#define TOK_DIMENSION 357
-#define TOK_ENDSELECT 358
-#define TOK_EXTERNAL 359
-#define TOK_INTENT 360
-#define TOK_INTRINSIC 361
-#define TOK_NAMELIST 362
-#define TOK_CASEDEFAULT 363
-#define TOK_OPTIONAL 364
-#define TOK_POINTER 365
-#define TOK_CONTINUE 366
-#define TOK_SAVE 367
-#define TOK_TARGET 368
-#define TOK_QUOTE 369
-#define TOK_IMPLICIT 370
-#define TOK_NONE 371
-#define TOK_CALL 372
-#define TOK_STAT 373
-#define TOK_POINT_TO 374
-#define TOK_COMMON 375
-#define TOK_GLOBAL 376
-#define TOK_INTERFACE 377
-#define TOK_ENDINTERFACE 378
-#define TOK_LEFTAB 379
-#define TOK_RIGHTAB 380
-#define TOK_PAUSE 381
-#define TOK_PROCEDURE 382
-#define TOK_STOP 383
-#define TOK_NAMEEQ 384
-#define TOK_REAL8 385
-#define TOK_OUT 386
-#define TOK_INOUT 387
-#define TOK_IN 388
-#define TOK_USE 389
-#define TOK_TRUE 390
-#define TOK_FALSE 391
-#define TOK_LABEL 392
-#define TOK_TYPE 393
-#define TOK_TYPEPAR 394
-#define TOK_ENDTYPE 395
-#define TOK_REAL 396
-#define TOK_INTEGER 397
-#define TOK_LOGICAL 398
-#define TOK_DOUBLEPRECISION 399
-#define TOK_DOUBLEREAL 400
-#define TOK_ENDSUBROUTINE 401
-#define TOK_ENDFUNCTION 402
-#define TOK_ENDPROGRAM 403
-#define TOK_ENDUNIT 404
-#define TOK_CHARACTER 405
-#define TOK_CHAR_CONSTANT 406
-#define TOK_CHAR_CUT 407
-#define TOK_DATA 408
-#define TOK_CHAR_INT 409
-#define TOK_CHAR_MESSAGE 410
-#define TOK_CSTREAL 411
-#define TOK_CSTREALDP 412
-#define TOK_CSTREALQP 413
-#define TOK_SFREAL 414
-#define TOK_COMPLEX 415
-#define TOK_DOUBLECOMPLEX 416
-#define TOK_NAME 417
-#define TOK_NAME_CHAR 418
-#define TOK_PROBTYPE 419
-#define TOK_INTERPTYPE 420
-#define TOK_VARTYPE 421
-#define TOK_BC 422
-#define TOK_OP 423
-#define TOK_CSTINT 424
-#define TOK_COMMENT 425
-#define TOK_FILENAME 426
-#define YYERRCODE 256
-short fortranlhs[] = {                                        -1,
-    0,    0,   68,   68,   68,   68,   68,   71,   71,   76,
-   76,   76,   76,   76,   82,   78,   72,   72,   72,   72,
-   69,   70,   70,   73,   73,   83,   75,   84,   84,   77,
-   77,   77,   77,   77,   77,   16,   74,   80,   33,    6,
-    6,    6,   85,   85,   85,    5,    5,   38,   38,   79,
-   79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-   79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-   86,   86,  103,  103,  103,  103,  103,  103,  103,  103,
-  103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-  103,  103,  103,  103,  103,  103,   98,   98,   88,   88,
-   99,   99,  105,  106,  106,  104,  104,   87,   87,    2,
-    2,  108,   89,  100,  101,  101,  101,   58,   58,   91,
-   91,   91,   91,  111,  112,  112,  110,  110,  110,   47,
-   47,   47,   47,   47,   32,   32,   97,  113,  113,  113,
-  113,  114,   96,   96,  115,    3,    3,   93,   93,   67,
-   67,   66,   66,   90,   90,   90,  117,  117,  118,  118,
-  119,   15,   15,  109,  109,    4,    4,   14,   95,  120,
-  120,   92,   92,  121,    1,    1,  107,   19,   19,   19,
-   19,  127,  126,  126,  126,  126,  128,  128,  128,  125,
-   25,   24,   24,   24,   24,   24,   24,  116,  116,   65,
-   65,  124,  124,  124,  130,  130,   34,   34,   34,   34,
-   37,   37,  129,  129,  122,  122,  122,  131,  131,  132,
-  132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-   30,   30,   30,  102,  102,   11,   11,   12,   12,   13,
-   13,   13,   13,   13,   63,   63,   62,   62,   62,   62,
-   61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-   61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-   61,   61,   61,   61,   61,   61,   40,   40,   39,   39,
-   39,   39,   39,   39,   31,   31,   64,   64,   64,   64,
-   64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
-   64,   64,   64,   64,   64,   64,   64,   59,   59,   59,
-   59,   60,   60,   41,   41,   41,  133,   49,   49,   49,
-   49,   36,   48,   42,   50,   50,   52,   52,   51,   51,
-   53,   53,   53,   53,   53,   53,   53,   28,   27,   27,
-   27,   27,   27,   27,   27,   27,   26,   26,   26,   26,
-   55,   55,   54,   57,   57,   56,   56,  123,  123,  134,
-   35,   94,   94,   94,   94,  135,   17,    9,    9,   10,
-    7,    7,    8,    8,   81,   81,   81,   81,   81,   81,
-   81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
-   81,   81,   81,   81,   81,   81,   81,   20,   23,   22,
-   21,  143,  143,  143,  141,  141,  141,  146,  146,  146,
-  145,  145,   18,   18,  148,  148,  144,  147,  149,  149,
-  136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
-  136,  136,  157,  150,  150,  156,  156,  151,  151,  154,
-  159,  159,  160,  160,  158,  162,  161,  161,  163,  163,
-  155,  155,  153,  153,  153,  153,  153,  153,  171,  171,
-  172,  172,  172,  173,  173,  174,  174,  168,  168,  178,
-  178,  177,  177,  166,  166,  170,  170,  170,  170,  170,
-  179,  179,  181,  181,  181,  181,  181,  181,  181,  181,
-  165,  165,  176,  176,  167,  167,  167,  169,  180,  180,
-  182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
-  182,  182,  182,  183,  183,  175,  175,  185,  185,  184,
-  184,  184,  184,  184,  186,  186,  186,   43,   43,   43,
-   44,   44,   44,   44,   44,   44,   44,   44,   45,   45,
-   45,   45,   45,   46,   46,  187,  187,  164,  152,  152,
-  137,  137,  137,  188,  188,  188,  189,  190,  190,  139,
-  139,  138,  138,  140,  140,  191,  191,  192,  192,  142,
-   29,
+       }
+/* Line 193 of yacc.c.  */
+#line 483 "fortran.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 496 "fortran.tab.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   5878
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  190
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  184
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  552
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  978
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   427
+
+#define YYTRANSLATE(YYX)						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+     187,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,   183,     2,     2,     2,   189,     2,     2,
+     179,   180,    23,    21,     3,    22,     2,   188,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     4,     2,
+     185,     5,   186,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,   181,     2,   182,     2,   184,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     6,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+      18,    19,    20,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
+      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
+      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
+      71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
+      81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
+      91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
+     101,   102,   103,   104,   105,   106,   107,   108,   109,   110,
+     111,   112,   113,   114,   115,   116,   117,   118,   119,   120,
+     121,   122,   123,   124,   125,   126,   127,   128,   129,   130,
+     131,   132,   133,   134,   135,   136,   137,   138,   139,   140,
+     141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
+     151,   152,   153,   154,   155,   156,   157,   158,   159,   160,
+     161,   162,   163,   164,   165,   166,   167,   168,   169,   170,
+     171,   172,   173,   174,   175,   176,   177,   178
 };
-short fortranlen[] = {                                         2,
-    0,    2,    2,    2,    1,    3,    3,    1,    3,    2,
-    2,    3,    3,    2,    2,    2,    1,    1,    1,    1,
-    0,    0,    2,    0,    1,    0,    0,    0,    1,    0,
-    4,    2,    5,    3,    2,    1,    0,    1,    1,    0,
-    2,    3,    0,    2,    3,    1,    3,    1,    1,    2,
-    4,    2,    2,    4,    2,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    4,    3,    3,    2,    3,
-    0,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     7,    10,    13,    15,    19,    23,
+      25,    29,    32,    35,    39,    43,    46,    49,    52,    54,
+      56,    58,    60,    61,    62,    65,    66,    68,    69,    70,
+      72,    73,    78,    81,    87,    91,    94,    96,    97,    99,
+     101,   102,   105,   109,   110,   113,   117,   119,   123,   125,
+     127,   130,   135,   138,   141,   146,   149,   151,   153,   155,
+     157,   159,   161,   163,   165,   167,   169,   174,   178,   182,
+     185,   189,   190,   192,   194,   196,   198,   200,   202,   204,
+     206,   208,   210,   212,   214,   216,   218,   220,   222,   224,
+     226,   228,   230,   232,   234,   236,   238,   240,   242,   246,
+     250,   256,   258,   262,   266,   269,   274,   276,   280,   281,
+     284,   287,   291,   293,   295,   297,   302,   309,   314,   316,
+     320,   323,   327,   333,   337,   339,   340,   343,   345,   350,
+     354,   357,   361,   365,   369,   373,   374,   376,   379,   382,
+     386,   392,   396,   397,   400,   403,   405,   411,   417,   420,
+     424,   427,   431,   433,   437,   440,   444,   450,   452,   455,
+     457,   461,   464,   466,   470,   471,   473,   475,   479,   483,
+     486,   488,   492,   495,   498,   499,   506,   514,   515,   518,
+     521,   525,   529,   531,   532,   535,   540,   544,   548,   553,
+     556,   558,   560,   562,   564,   566,   568,   570,   572,   573,
+     576,   578,   582,   583,   586,   590,   592,   596,   599,   603,
+     605,   607,   609,   611,   612,   616,   617,   620,   625,   627,
+     631,   633,   635,   637,   640,   642,   647,   649,   651,   653,
+     655,   657,   659,   661,   663,   665,   667,   668,   672,   674,
+     678,   680,   682,   685,   688,   692,   694,   696,   698,   702,
+     704,   706,   710,   714,   719,   724,   728,   733,   738,   742,
+     747,   752,   757,   762,   767,   772,   777,   782,   787,   792,
+     797,   802,   807,   811,   816,   821,   826,   831,   833,   837,
+     839,   841,   843,   846,   849,   852,   854,   856,   859,   862,
+     865,   868,   871,   874,   877,   880,   883,   886,   889,   893,
+     896,   900,   903,   906,   909,   912,   915,   918,   921,   922,
+     924,   927,   930,   933,   935,   937,   939,   941,   942,   944,
+     947,   952,   958,   963,   967,   971,   973,   976,   978,   982,
+     984,   986,   990,   996,  1001,  1005,  1008,  1011,  1013,  1015,
+    1017,  1019,  1021,  1023,  1025,  1027,  1030,  1033,  1035,  1038,
+    1040,  1042,  1043,  1045,  1051,  1052,  1054,  1056,  1058,  1059,
+    1063,  1064,  1070,  1073,  1078,  1085,  1092,  1094,  1096,  1098,
+    1102,  1106,  1108,  1112,  1116,  1118,  1120,  1126,  1132,  1137,
+    1139,  1142,  1145,  1148,  1151,  1153,  1156,  1162,  1164,  1166,
+    1169,  1175,  1177,  1180,  1184,  1189,  1191,  1193,  1195,  1197,
+    1199,  1201,  1203,  1205,  1209,  1213,  1217,  1220,  1223,  1224,
+    1230,  1238,  1239,  1242,  1244,  1246,  1247,  1249,  1251,  1253,
+    1255,  1258,  1260,  1262,  1264,  1270,  1276,  1279,  1282,  1285,
+    1288,  1290,  1291,  1296,  1303,  1305,  1309,  1312,  1315,  1318,
+    1319,  1323,  1324,  1326,  1329,  1331,  1333,  1337,  1339,  1342,
+    1344,  1346,  1349,  1352,  1355,  1359,  1362,  1364,  1365,  1367,
+    1370,  1373,  1374,  1377,  1381,  1385,  1389,  1393,  1395,  1399,
+    1401,  1403,  1407,  1409,  1411,  1413,  1416,  1421,  1426,  1429,
+    1432,  1434,  1436,  1438,  1440,  1442,  1444,  1446,  1448,  1450,
+    1454,  1456,  1458,  1462,  1466,  1470,  1474,  1477,  1481,  1484,
+    1487,  1490,  1493,  1497,  1499,  1501,  1503,  1507,  1508,  1510,
+    1513,  1518,  1521,  1524,  1530,  1531,  1533,  1536,  1538,  1540,
+    1542,  1546,  1550,  1554,  1558,  1562,  1566,  1568,  1570,  1572,
+    1576,  1582,  1588,  1594,  1600,  1608,  1610,  1619,  1622,  1624,
+    1626,  1630,  1632,  1634,  1636,  1641,  1643,  1647,  1648,  1653,
+    1655,  1659,  1663
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int16 yyrhs[] =
+{
+     191,     0,    -1,    -1,   191,   192,    -1,   187,   198,    -1,
+     199,   193,    -1,   177,    -1,   197,   200,   205,    -1,     1,
+     205,   201,    -1,   194,    -1,   193,    27,   194,    -1,   203,
+     196,    -1,   212,   196,    -1,   206,   207,   196,    -1,   315,
+     200,   205,    -1,   195,   196,    -1,   298,     4,    -1,   198,
+     200,    -1,    53,    -1,    54,    -1,    36,    -1,    37,    -1,
+      -1,    -1,   144,   201,    -1,    -1,   177,    -1,    -1,    -1,
+      72,    -1,    -1,   202,    33,   204,   208,    -1,    34,   204,
+      -1,    35,   204,   208,    30,   209,    -1,    35,   204,   208,
+      -1,    95,   169,    -1,   169,    -1,    -1,    32,    -1,   158,
+      -1,    -1,   179,   180,    -1,   179,   210,   180,    -1,    -1,
+     179,   180,    -1,   179,   210,   180,    -1,   211,    -1,   210,
+       3,   211,    -1,   169,    -1,    23,    -1,   257,   222,    -1,
+     145,   213,   221,   324,    -1,   147,   324,    -1,   117,   216,
+      -1,   224,   179,   249,   180,    -1,   224,   249,    -1,   243,
+      -1,   228,    -1,   253,    -1,   239,    -1,   241,    -1,   240,
+      -1,   308,    -1,   251,    -1,   237,    -1,   234,    -1,    68,
+     179,   280,   180,    -1,   111,   221,   242,    -1,   113,   221,
+     215,    -1,    67,   217,    -1,   225,   226,   187,    -1,    -1,
+     275,    -1,    46,    -1,    40,    -1,    44,    -1,    56,    -1,
+      79,    -1,    45,    -1,    47,    -1,    62,    -1,    57,    -1,
+      58,    -1,    59,    -1,    60,    -1,    61,    -1,    64,    -1,
+      65,    -1,    66,    -1,    69,    -1,    70,    -1,    71,    -1,
+      74,    -1,    75,    -1,    76,    -1,    77,    -1,   169,    -1,
+     214,    -1,   215,     3,   214,    -1,   179,   220,   180,    -1,
+     216,     3,   179,   220,   180,    -1,   218,    -1,   217,     3,
+     218,    -1,   179,   219,   180,    -1,   298,   276,    -1,   219,
+       3,   298,   276,    -1,   280,    -1,   220,     3,   280,    -1,
+      -1,     4,     4,    -1,   255,   256,    -1,   223,   204,   208,
+      -1,    35,    -1,    29,    -1,   160,    -1,   169,    24,   227,
+      24,    -1,   226,   248,   169,    24,   227,    24,    -1,   231,
+      24,   227,    24,    -1,   232,    -1,   232,     3,   227,    -1,
+     229,   230,    -1,   229,   247,   230,    -1,   228,   248,   247,
+     248,   230,    -1,   228,     3,   230,    -1,   119,    -1,    -1,
+     169,   276,    -1,   169,    -1,   169,   179,   280,   180,    -1,
+     231,     3,   231,    -1,   233,   299,    -1,   232,    21,   232,
+      -1,   232,    22,   232,    -1,   232,    23,   232,    -1,   232,
+     188,   232,    -1,    -1,   284,    -1,   235,   236,    -1,   114,
+     298,    -1,   114,   247,   298,    -1,   235,   248,   247,   248,
+     298,    -1,   235,     3,   298,    -1,    -1,   129,   324,    -1,
+     130,   324,    -1,   109,    -1,   238,   248,   169,   276,   264,
+      -1,   239,     3,   169,   276,   264,    -1,    81,   187,    -1,
+      81,   221,   242,    -1,    80,   187,    -1,    80,   221,   242,
+      -1,   169,    -1,   242,     3,   169,    -1,   244,   245,    -1,
+     244,   247,   245,    -1,   243,   248,   247,   248,   245,    -1,
+     127,    -1,   128,   127,    -1,   246,    -1,   245,     3,   246,
+      -1,   169,   276,    -1,    20,    -1,    24,   169,    24,    -1,
+      -1,     3,    -1,   250,    -1,   249,     3,   250,    -1,   169,
+       5,   280,    -1,   134,   252,    -1,   169,    -1,   252,     3,
+     169,    -1,   122,   123,    -1,   122,   137,    -1,    -1,   271,
+     254,   169,   276,   264,   305,    -1,   255,     3,   254,   169,
+     276,   264,   305,    -1,    -1,   262,   266,    -1,   261,   259,
+      -1,   263,    23,   176,    -1,   258,   268,   180,    -1,   146,
+      -1,    -1,    23,   176,    -1,    23,   179,   260,   180,    -1,
+     179,   260,   180,    -1,   169,   269,   270,    -1,   169,     5,
+     269,   270,    -1,   269,   270,    -1,   157,    -1,   263,    -1,
+     149,    -1,   148,    -1,   167,    -1,   151,    -1,   168,    -1,
+     150,    -1,    -1,    23,   265,    -1,   280,    -1,   179,    23,
+     180,    -1,    -1,    23,   267,    -1,   179,   268,   180,    -1,
+     280,    -1,   179,    23,   180,    -1,   169,   269,    -1,   169,
+       5,   269,    -1,   169,    -1,   176,    -1,   280,    -1,    23,
+      -1,    -1,     3,   169,   269,    -1,    -1,     4,     4,    -1,
+       3,   272,     4,     4,    -1,   273,    -1,   272,     3,   273,
+      -1,    29,    -1,   275,    -1,    82,    -1,   109,   276,    -1,
+     111,    -1,   112,   179,   274,   180,    -1,   113,    -1,   116,
+      -1,   117,    -1,   119,    -1,   120,    -1,   140,    -1,   138,
+      -1,   139,    -1,    80,    -1,    81,    -1,    -1,   179,   277,
+     180,    -1,   278,    -1,   277,     3,   278,    -1,   279,    -1,
+       4,    -1,   280,     4,    -1,     4,   280,    -1,   280,     4,
+     279,    -1,    23,    -1,   280,    -1,   283,    -1,   179,   280,
+     180,    -1,   307,    -1,   281,    -1,    46,   282,   180,    -1,
+      39,   282,   180,    -1,    40,   179,   282,   180,    -1,    44,
+     179,   282,   180,    -1,    56,   282,   180,    -1,    79,   179,
+     282,   180,    -1,    45,   179,   280,   180,    -1,    47,   280,
+     180,    -1,   148,   179,   282,   180,    -1,    62,   179,   280,
+     180,    -1,    57,   179,   280,   180,    -1,    58,   179,   280,
+     180,    -1,    59,   179,   280,   180,    -1,    60,   179,   280,
+     180,    -1,    61,   179,   280,   180,    -1,    64,   179,   280,
+     180,    -1,    65,   179,   280,   180,    -1,    66,   179,   280,
+     180,    -1,    69,   179,   280,   180,    -1,    70,   179,   280,
+     180,    -1,    71,   179,   280,   180,    -1,    73,   280,   180,
+      -1,    74,   179,   282,   180,    -1,    75,   179,   282,   180,
+      -1,    76,   179,   282,   180,    -1,    77,   179,   282,   180,
+      -1,   280,    -1,   282,     3,   280,    -1,   288,    -1,   299,
+      -1,   293,    -1,   280,   285,    -1,   284,   280,    -1,    12,
+     280,    -1,    21,    -1,    22,    -1,    21,   280,    -1,    22,
+     280,    -1,    23,   280,    -1,    25,   280,    -1,    14,   280,
+      -1,     8,   280,    -1,    17,   280,    -1,   186,   280,    -1,
+      18,   280,    -1,   185,   280,    -1,    15,   280,    -1,   186,
+       5,   280,    -1,    16,   280,    -1,   185,     5,   280,    -1,
+      13,   280,    -1,     7,   280,    -1,     9,   280,    -1,    10,
+     280,    -1,    11,   280,    -1,    24,   286,    -1,     5,   287,
+      -1,    -1,   280,    -1,     5,   280,    -1,    24,   280,    -1,
+       5,   280,    -1,   280,    -1,   298,    -1,   292,    -1,   290,
+      -1,    -1,   291,    -1,   291,   302,    -1,   292,   179,   294,
+     180,    -1,   292,   179,   294,   180,   302,    -1,   298,   179,
+     294,   180,    -1,   288,   189,   288,    -1,   131,   360,   132,
+      -1,   289,    -1,   289,   295,    -1,   296,    -1,   295,     3,
+     296,    -1,   280,    -1,   297,    -1,   280,     4,   280,    -1,
+     280,     4,   280,     4,   280,    -1,     4,   280,     4,   280,
+      -1,     4,     4,   280,    -1,     4,   280,    -1,   280,     4,
+      -1,     4,    -1,   169,    -1,   142,    -1,   143,    -1,   176,
+      -1,   163,    -1,   164,    -1,   165,    -1,   299,   169,    -1,
+     300,   301,    -1,   158,    -1,   300,   158,    -1,   162,    -1,
+     159,    -1,    -1,   302,    -1,   179,   303,     4,   303,   180,
+      -1,    -1,   280,    -1,   187,    -1,   280,    -1,    -1,   306,
+       5,   280,    -1,    -1,   179,   283,     3,   283,   180,    -1,
+     309,   310,    -1,   309,   310,     3,   311,    -1,   309,   310,
+       3,    31,     4,   187,    -1,   309,   310,     3,    31,     4,
+     313,    -1,   141,    -1,   169,    -1,   312,    -1,   311,     3,
+     312,    -1,   169,   126,   169,    -1,   314,    -1,   313,     3,
+     314,    -1,   169,   126,   169,    -1,   169,    -1,   328,    -1,
+      98,   179,   366,   370,   180,    -1,   105,   179,   369,   370,
+     180,    -1,   106,   179,   371,   180,    -1,   317,    -1,   318,
+     324,    -1,   316,   324,    -1,   319,   324,    -1,    96,   324,
+      -1,   321,    -1,   372,   328,    -1,    41,   179,   280,   180,
+     304,    -1,    42,    -1,    43,    -1,   372,    84,    -1,    85,
+     179,   280,   180,    84,    -1,    86,    -1,    87,   324,    -1,
+      48,   320,   180,    -1,    49,   179,   280,   180,    -1,   115,
+      -1,   110,    -1,    93,    -1,   153,    -1,   156,    -1,   155,
+      -1,   154,    -1,   280,    -1,   320,     3,   280,    -1,   320,
+       4,   280,    -1,   326,   323,   322,    -1,   327,   280,    -1,
+      94,   325,    -1,    -1,   373,     5,   280,     3,   280,    -1,
+     373,     5,   280,     3,   280,     3,   280,    -1,    -1,   176,
+     248,    -1,   187,    -1,   169,    -1,    -1,   169,    -1,    92,
+      -1,    97,    -1,   118,    -1,   330,   332,    -1,   365,    -1,
+     341,    -1,   333,    -1,    98,   179,   366,   370,   180,    -1,
+     105,   179,   369,   370,   180,    -1,    78,   303,    -1,    83,
+     304,    -1,    63,   304,    -1,   340,   304,    -1,   331,    -1,
+      -1,   298,   329,   276,   276,    -1,   330,   189,   298,   329,
+     276,   276,    -1,   176,    -1,   331,     3,   176,    -1,     5,
+     280,    -1,   126,   280,    -1,   336,   334,    -1,    -1,   179,
+     335,   180,    -1,    -1,   338,    -1,   337,   169,    -1,   124,
+      -1,   339,    -1,   338,     3,   339,    -1,   280,    -1,    23,
+     364,    -1,   133,    -1,   135,    -1,   349,   345,    -1,   351,
+     343,    -1,   352,   345,    -1,   352,   345,   360,    -1,   104,
+     346,    -1,    38,    -1,    -1,   356,    -1,   345,   342,    -1,
+     350,   344,    -1,    -1,     3,   356,    -1,   179,   347,   180,
+      -1,   179,   353,   180,    -1,   179,   298,   180,    -1,   179,
+     176,   180,    -1,   176,    -1,   179,   283,   180,    -1,   169,
+      -1,   348,    -1,   347,     3,   348,    -1,   353,    -1,    23,
+      -1,    25,    -1,   298,   280,    -1,   298,   280,   189,   330,
+      -1,   298,   179,   297,   180,    -1,   298,    23,    -1,   298,
+      25,    -1,    99,    -1,   100,    -1,   354,    -1,    23,    -1,
+     103,    -1,   101,    -1,    88,    -1,   102,    -1,   354,    -1,
+     179,   353,   180,    -1,   288,    -1,   299,    -1,   353,   355,
+     353,    -1,   353,    23,   353,    -1,   353,    24,   353,    -1,
+     353,    25,   353,    -1,   355,   353,    -1,   353,    20,   353,
+      -1,    50,   280,    -1,    55,   280,    -1,    52,   280,    -1,
+      51,   280,    -1,   169,     5,   280,    -1,    21,    -1,    22,
+      -1,   358,    -1,   356,     3,   358,    -1,    -1,   288,    -1,
+     357,   359,    -1,   179,   356,   180,   359,    -1,   281,   359,
+      -1,   299,   359,    -1,   179,   356,     3,   363,   180,    -1,
+      -1,   285,    -1,   359,   285,    -1,   283,    -1,   362,    -1,
+     361,    -1,   283,     3,   280,    -1,   283,     3,   362,    -1,
+     362,     3,   280,    -1,   362,     3,   362,    -1,   361,     3,
+     280,    -1,   361,     3,   362,    -1,   283,    -1,   281,    -1,
+     307,    -1,   179,   280,   180,    -1,   179,   283,     3,   363,
+     180,    -1,   179,   362,     3,   363,   180,    -1,   179,   361,
+       3,   363,   180,    -1,   169,     5,   280,     3,   280,    -1,
+     169,     5,   280,     3,   280,     3,   280,    -1,   176,    -1,
+      89,   179,   280,     3,   280,   180,     3,   280,    -1,    89,
+     364,    -1,   367,    -1,   330,    -1,   366,     3,   367,    -1,
+     298,    -1,   292,    -1,   368,    -1,   298,   179,   295,   180,
+      -1,   367,    -1,   369,     3,   367,    -1,    -1,     3,   125,
+       5,   298,    -1,   298,    -1,   371,     3,   298,    -1,    91,
+     280,   180,    -1,   298,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   336,   336,   337,   339,   340,   341,   342,   343,   346,
+     347,   349,   350,   351,   360,   361,   363,   365,   367,   374,
+     379,   380,   382,   384,   385,   387,   388,   394,   397,   398,
+     401,   402,   430,   448,   481,   515,   532,   539,   541,   545,
+     550,   553,   556,   561,   562,   563,   571,   582,   594,   595,
+     597,   605,   613,   619,   620,   635,   648,   649,   655,   656,
+     693,   706,   707,   708,   709,   710,   711,   712,   713,   714,
+     715,   734,   735,   741,   742,   743,   744,   745,   746,   747,
+     748,   749,   750,   751,   752,   753,   754,   755,   756,   757,
+     758,   759,   760,   761,   762,   763,   764,   766,   767,   769,
+     770,   772,   773,   775,   777,   778,   780,   781,   783,   784,
+     786,   869,   906,   912,   917,   922,   936,   950,   965,   972,
+     981,   982,   983,   984,   986,   991,   992,   997,  1001,  1006,
+    1011,  1013,  1015,  1017,  1019,  1023,  1024,  1027,  1029,  1030,
+    1031,  1032,  1034,  1036,  1041,  1046,  1052,  1068,  1085,  1086,
+    1088,  1092,  1097,  1101,  1106,  1112,  1123,  1135,  1140,  1146,
+    1151,  1155,  1165,  1174,  1184,  1185,  1187,  1191,  1196,  1219,
+    1221,  1222,  1224,  1234,  1236,  1238,  1270,  1305,  1307,  1309,
+    1313,  1318,  1323,  1331,  1332,  1334,  1335,  1337,  1338,  1339,
+    1341,  1346,  1348,  1353,  1357,  1360,  1366,  1368,  1374,  1375,
+    1377,  1378,  1380,  1381,  1382,  1384,  1385,  1387,  1388,  1397,
+    1401,  1406,  1408,  1411,  1412,  1414,  1415,  1416,  1418,  1419,
+    1421,  1425,  1426,  1428,  1433,  1435,  1437,  1438,  1439,  1440,
+    1446,  1449,  1450,  1451,  1453,  1455,  1458,  1463,  1467,  1469,
+    1473,  1478,  1482,  1487,  1492,  1500,  1501,  1503,  1504,  1506,
+    1508,  1512,  1514,  1516,  1518,  1520,  1522,  1524,  1526,  1528,
+    1530,  1532,  1534,  1536,  1538,  1540,  1542,  1544,  1546,  1548,
+    1550,  1552,  1554,  1556,  1558,  1560,  1562,  1565,  1566,  1570,
+    1571,  1573,  1575,  1577,  1579,  1582,  1583,  1585,  1587,  1589,
+    1591,  1593,  1595,  1597,  1599,  1601,  1603,  1605,  1607,  1609,
+    1611,  1613,  1615,  1617,  1619,  1621,  1623,  1625,  1628,  1629,
+    1631,  1633,  1636,  1638,  1642,  1647,  1652,  1658,  1670,  1675,
+    1677,  1680,  1684,  1694,  1700,  1703,  1704,  1707,  1708,  1711,
+    1712,  1714,  1716,  1719,  1721,  1722,  1723,  1724,  1726,  1784,
+    1786,  1787,  1788,  1789,  1790,  1791,  1793,  1795,  1797,  1798,
+    1800,  1803,  1804,  1806,  1809,  1810,  1812,  1813,  1815,  1816,
+    1825,  1827,  1830,  1850,  1884,  1904,  1955,  1963,  1966,  1970,
+    1980,  1991,  1995,  2005,  2017,  2026,  2027,  2033,  2039,  2040,
+    2090,  2108,  2128,  2147,  2180,  2181,  2182,  2183,  2184,  2185,
+    2186,  2187,  2188,  2189,  2190,  2191,  2192,  2193,  2230,  2240,
+    2249,  2258,  2267,  2268,  2269,  2271,  2272,  2273,  2275,  2276,
+    2277,  2278,  2279,  2281,  2282,  2284,  2285,  2287,  2289,  2296,
+    2297,  2298,  2299,  2300,  2301,  2307,  2313,  2314,  2315,  2316,
+    2317,  2319,  2320,  2330,  2332,  2333,  2335,  2336,  2338,  2366,
+    2367,  2369,  2370,  2372,  2402,  2404,  2405,  2408,  2422,  2425,
+    2426,  2429,  2430,  2431,  2432,  2433,  2434,  2446,  2447,  2449,
+    2450,  2455,  2456,  2458,  2459,  2461,  2462,  2463,  2464,  2465,
+    2467,  2468,  2470,  2471,  2472,  2473,  2474,  2475,  2476,  2477,
+    2479,  2480,  2482,  2483,  2486,  2487,  2488,  2491,  2494,  2495,
+    2497,  2498,  2499,  2500,  2501,  2502,  2503,  2504,  2505,  2506,
+    2507,  2508,  2509,  2511,  2512,  2514,  2515,  2517,  2518,  2520,
+    2521,  2522,  2523,  2524,  2526,  2527,  2528,  2530,  2531,  2532,
+    2534,  2536,  2538,  2540,  2542,  2544,  2546,  2547,  2549,  2551,
+    2553,  2555,  2557,  2561,  2564,  2571,  2573,  2574,  2576,  2577,
+    2578,  2580,  2582,  2583,  2585,  2592,  2593,  2595,  2596,  2598,
+    2599,  2607,  2609
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "','", "':'", "'='", "TOK_BINARY_OP",
+  "TOK_NEQV", "TOK_EQV", "TOK_XOR", "TOK_OR", "TOK_AND", "TOK_NOT",
+  "TOK_NE", "TOK_EQ", "TOK_GE", "TOK_LE", "TOK_GT", "TOK_LT",
+  "TOK_UNARY_OP", "TOK_DSLASH", "'+'", "'-'", "'*'", "TOK_SLASH",
+  "TOK_DASTER", "TOK_SEP", "TOK_SEMICOLON", "TOK_NEXTLINE",
+  "TOK_PARAMETER", "TOK_RESULT", "TOK_ONLY", "TOK_INCLUDE",
+  "TOK_SUBROUTINE", "TOK_PROGRAM", "TOK_FUNCTION", "TOK_OMP", "TOK_DOLLAR",
+  "TOK_FORMAT", "TOK_MAX", "TOK_TANH", "TOK_WHERE", "TOK_ELSEWHERE",
+  "TOK_ENDWHERE", "TOK_MAXVAL", "TOK_TRIM", "TOK_SUM", "TOK_SQRT",
+  "TOK_CASE", "TOK_SELECTCASE", "TOK_FILE", "TOK_END", "TOK_ERR",
+  "TOK_DONOTTREAT", "TOK_ENDDONOTTREAT", "TOK_EXIST", "TOK_MIN",
+  "TOK_FLOAT", "TOK_EXP", "TOK_COS", "TOK_COSH", "TOK_ACOS", "TOK_NINT",
+  "TOK_CYCLE", "TOK_SIN", "TOK_SINH", "TOK_ASIN", "TOK_EQUIVALENCE",
+  "TOK_BACKSPACE", "TOK_LOG", "TOK_TAN", "TOK_ATAN", "TOK_RECURSIVE",
+  "TOK_ABS", "TOK_MOD", "TOK_SIGN", "TOK_MINLOC", "TOK_MAXLOC", "TOK_EXIT",
+  "TOK_MINVAL", "TOK_PUBLIC", "TOK_PRIVATE", "TOK_ALLOCATABLE",
+  "TOK_RETURN", "TOK_THEN", "TOK_ELSEIF", "TOK_ELSE", "TOK_ENDIF",
+  "TOK_PRINT", "TOK_PLAINGOTO", "TOK_CONSTRUCTID", "TOK_LOGICALIF",
+  "TOK_PLAINDO", "TOK_CONTAINS", "TOK_ENDDO", "TOK_MODULE",
+  "TOK_ENDMODULE", "TOK_DOWHILE", "TOK_ALLOCATE", "TOK_OPEN", "TOK_CLOSE",
+  "TOK_INQUIRE", "TOK_WRITE", "TOK_READ", "TOK_REWIND", "TOK_DEALLOCATE",
+  "TOK_NULLIFY", "TOK_FIN", "TOK_DEBUT", "TOK_DIMENSION", "TOK_ENDSELECT",
+  "TOK_EXTERNAL", "TOK_INTENT", "TOK_INTRINSIC", "TOK_NAMELIST",
+  "TOK_CASEDEFAULT", "TOK_OPTIONAL", "TOK_POINTER", "TOK_CONTINUE",
+  "TOK_SAVE", "TOK_TARGET", "TOK_QUOTE", "TOK_IMPLICIT", "TOK_NONE",
+  "TOK_CALL", "TOK_STAT", "TOK_POINT_TO", "TOK_COMMON", "TOK_GLOBAL",
+  "TOK_INTERFACE", "TOK_ENDINTERFACE", "TOK_LEFTAB", "TOK_RIGHTAB",
+  "TOK_PAUSE", "TOK_PROCEDURE", "TOK_STOP", "TOK_NAMEEQ", "TOK_REAL8",
+  "TOK_OUT", "TOK_INOUT", "TOK_IN", "TOK_USE", "TOK_TRUE", "TOK_FALSE",
+  "TOK_LABEL", "TOK_TYPE", "TOK_TYPEPAR", "TOK_ENDTYPE", "TOK_REAL",
+  "TOK_INTEGER", "TOK_LOGICAL", "TOK_DOUBLEPRECISION", "TOK_DOUBLEREAL",
+  "TOK_ENDSUBROUTINE", "TOK_ENDFUNCTION", "TOK_ENDPROGRAM", "TOK_ENDUNIT",
+  "TOK_CHARACTER", "TOK_CHAR_CONSTANT", "TOK_CHAR_CUT", "TOK_DATA",
+  "TOK_CHAR_INT", "TOK_CHAR_MESSAGE", "TOK_CSTREAL", "TOK_CSTREALDP",
+  "TOK_CSTREALQP", "TOK_SFREAL", "TOK_COMPLEX", "TOK_DOUBLECOMPLEX",
+  "TOK_NAME", "TOK_NAME_CHAR", "TOK_PROBTYPE", "TOK_INTERPTYPE",
+  "TOK_VARTYPE", "TOK_BC", "TOK_OP", "TOK_CSTINT", "TOK_COMMENT",
+  "TOK_FILENAME", "'('", "')'", "'['", "']'", "'!'", "'_'", "'<'", "'>'",
+  "'\\n'", "'/'", "'%'", "$accept", "input", "line", "suite_line_list",
+  "suite_line", "instr", "fin_line", "keyword", "position", "thislabel",
+  "cmnt", "nulcurbuf", "opt_recursive", "entry", "name_routine",
+  "writedeclar", "before_include", "filename", "arglist", "arglist1",
+  "args", "arg", "spec", "opt_spec", "name_intrinsic",
+  "use_intrinsic_list", "list_couple", "list_expr_equi", "expr_equi",
+  "list_expr_equi1", "list_expr", "opt_sep", "after_type",
+  "before_function", "before_parameter", "before_data", "data",
+  "datavallist", "save", "before_save", "varsave", "datanamelist",
+  "expr_data", "opt_signe", "namelist", "namelist_action",
+  "after_namelist", "interface", "before_dimension", "dimension",
+  "private", "public", "use_name_list", "common", "before_common",
+  "var_common_list", "var_common", "comblock", "opt_comma", "paramlist",
+  "paramitem", "module_proc_stmt", "proc_name_list", "implicit",
+  "opt_retour", "dcl", "nodimsgiven", "type", "before_typepar",
+  "c_selector", "c_attribute", "before_character", "typespec", "typename",
+  "lengspec", "proper_lengspec", "selector", "proper_selector",
+  "attribute", "clause", "opt_clause", "options", "attr_spec_list",
+  "attr_spec", "intent_spec", "access_spec", "dims", "dimlist", "dim",
+  "ubound", "expr", "predefinedfunction", "minmaxlist", "uexpr", "signe",
+  "operation", "after_slash", "after_equal", "lhs", "beforefunctionuse",
+  "array_ele_substring_func_ref", "begin_array", "structure_component",
+  "vec", "funarglist", "funargs", "funarg", "triplet", "ident",
+  "simple_const", "string_constant", "opt_substring", "substring",
+  "optexpr", "opt_expr", "initial_value", "before_initial",
+  "complex_const", "use_stat", "word_use", "module_name", "rename_list",
+  "rename_name", "only_list", "only_name", "exec", "word_endsubroutine",
+  "word_endunit", "word_endprogram", "word_endfunction", "caselist",
+  "boucledo", "do_arg", "opt_int", "opt_name", "optname", "worddo",
+  "wordwhile", "iffable", "before_dims", "ident_dims", "int_list",
+  "after_ident_dims", "call", "opt_call", "opt_callarglist", "keywordcall",
+  "before_call", "callarglist", "callarg", "stop", "io", "option_inlist",
+  "option_read", "opt_inlist", "ioctl", "after_rewind", "ctllist",
+  "ioclause", "iofctl", "infmt", "read", "write", "fexpr", "unpar_fexpr",
+  "addop", "inlist", "opt_lhs", "inelt", "opt_operation", "outlist",
+  "out2", "other", "dospec", "label", "goto", "allocation_list",
+  "allocate_object", "array_element", "allocate_object_list",
+  "opt_stat_spec", "pointer_name_list", "logif", "do_var", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,    44,    58,    61,   258,   259,   260,   261,
+     262,   263,   264,   265,   266,   267,   268,   269,   270,   271,
+     272,    43,    45,    42,   273,   274,   275,   276,   277,   278,
+     279,   280,   281,   282,   283,   284,   285,   286,   287,   288,
+     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
+     299,   300,   301,   302,   303,   304,   305,   306,   307,   308,
+     309,   310,   311,   312,   313,   314,   315,   316,   317,   318,
+     319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
+     329,   330,   331,   332,   333,   334,   335,   336,   337,   338,
+     339,   340,   341,   342,   343,   344,   345,   346,   347,   348,
+     349,   350,   351,   352,   353,   354,   355,   356,   357,   358,
+     359,   360,   361,   362,   363,   364,   365,   366,   367,   368,
+     369,   370,   371,   372,   373,   374,   375,   376,   377,   378,
+     379,   380,   381,   382,   383,   384,   385,   386,   387,   388,
+     389,   390,   391,   392,   393,   394,   395,   396,   397,   398,
+     399,   400,   401,   402,   403,   404,   405,   406,   407,   408,
+     409,   410,   411,   412,   413,   414,   415,   416,   417,   418,
+     419,   420,   421,   422,   423,   424,   425,   426,   427,    40,
+      41,    91,    93,    33,    95,    60,    62,    10,    47,    37
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint16 yyr1[] =
+{
+       0,   190,   191,   191,   192,   192,   192,   192,   192,   193,
+     193,   194,   194,   194,   194,   194,   195,   196,   197,   197,
+     197,   197,   198,   199,   199,   200,   200,   201,   202,   202,
+     203,   203,   203,   203,   203,   203,   204,   205,   206,   207,
+     208,   208,   208,   209,   209,   209,   210,   210,   211,   211,
+     212,   212,   212,   212,   212,   212,   212,   212,   212,   212,
+     212,   212,   212,   212,   212,   212,   212,   212,   212,   212,
+     212,   213,   213,   214,   214,   214,   214,   214,   214,   214,
+     214,   214,   214,   214,   214,   214,   214,   214,   214,   214,
+     214,   214,   214,   214,   214,   214,   214,   215,   215,   216,
+     216,   217,   217,   218,   219,   219,   220,   220,   221,   221,
+     222,   222,   223,   224,   225,   226,   226,   226,   227,   227,
+     228,   228,   228,   228,   229,   230,   230,   231,   231,   231,
+     232,   232,   232,   232,   232,   233,   233,   234,   235,   235,
+     235,   235,   236,   237,   237,   238,   239,   239,   240,   240,
+     241,   241,   242,   242,   243,   243,   243,   244,   244,   245,
+     245,   246,   247,   247,   248,   248,   249,   249,   250,   251,
+     252,   252,   253,   253,   254,   255,   255,   256,   257,   257,
+     257,   257,   258,   259,   259,   259,   259,   260,   260,   260,
+     261,   262,   263,   263,   263,   263,   263,   263,   264,   264,
+     265,   265,   266,   266,   266,   267,   267,   268,   268,   268,
+     268,   269,   269,   270,   270,   271,   271,   271,   272,   272,
+     273,   273,   273,   273,   273,   273,   273,   273,   273,   273,
+     273,   274,   274,   274,   275,   275,   276,   276,   277,   277,
+     278,   278,   278,   278,   278,   279,   279,   280,   280,   280,
+     280,   281,   281,   281,   281,   281,   281,   281,   281,   281,
+     281,   281,   281,   281,   281,   281,   281,   281,   281,   281,
+     281,   281,   281,   281,   281,   281,   281,   282,   282,   283,
+     283,   283,   283,   283,   283,   284,   284,   285,   285,   285,
+     285,   285,   285,   285,   285,   285,   285,   285,   285,   285,
+     285,   285,   285,   285,   285,   285,   285,   285,   286,   286,
+     286,   286,   287,   287,   288,   288,   288,   289,   290,   290,
+     290,   290,   291,   292,   293,   294,   294,   295,   295,   296,
+     296,   297,   297,   297,   297,   297,   297,   297,   298,   299,
+     299,   299,   299,   299,   299,   299,   299,   300,   300,   300,
+     300,   301,   301,   302,   303,   303,   304,   304,   305,   305,
+     306,   307,   308,   308,   308,   308,   309,   310,   311,   311,
+     312,   313,   313,   314,   314,   315,   315,   315,   315,   315,
+     315,   315,   315,   315,   315,   315,   315,   315,   315,   315,
+     315,   315,   315,   315,   315,   315,   315,   315,   316,   317,
+     318,   319,   320,   320,   320,   321,   321,   321,   322,   322,
+     322,   323,   323,   324,   324,   325,   325,   326,   327,   328,
+     328,   328,   328,   328,   328,   328,   328,   328,   328,   328,
+     328,   329,   330,   330,   331,   331,   332,   332,   333,   334,
+     334,   335,   335,   336,   337,   338,   338,   339,   339,   340,
+     340,   341,   341,   341,   341,   341,   341,   342,   342,   343,
+     343,   344,   344,   345,   345,   346,   346,   346,   346,   346,
+     347,   347,   348,   348,   348,   348,   348,   348,   348,   348,
+     349,   349,   350,   350,   351,   351,   351,   352,   353,   353,
+     354,   354,   354,   354,   354,   354,   354,   354,   354,   354,
+     354,   354,   354,   355,   355,   356,   356,   357,   357,   358,
+     358,   358,   358,   358,   359,   359,   359,   360,   360,   360,
+     361,   361,   361,   361,   361,   361,   361,   361,   362,   362,
+     362,   362,   362,   363,   363,   364,   365,   365,   366,   366,
+     366,   367,   367,   367,   368,   369,   369,   370,   370,   371,
+     371,   372,   373
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     2,     2,     2,     1,     3,     3,     1,
+       3,     2,     2,     3,     3,     2,     2,     2,     1,     1,
+       1,     1,     0,     0,     2,     0,     1,     0,     0,     1,
+       0,     4,     2,     5,     3,     2,     1,     0,     1,     1,
+       0,     2,     3,     0,     2,     3,     1,     3,     1,     1,
+       2,     4,     2,     2,     4,     2,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     4,     3,     3,     2,
+       3,     0,     1,     1,     1,     1,     1,     1,     1,     1,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    3,    3,    5,
-    1,    3,    3,    2,    4,    1,    3,    0,    2,    2,
-    3,    1,    1,    1,    4,    6,    4,    1,    3,    2,
-    3,    5,    3,    1,    0,    2,    1,    4,    3,    2,
-    3,    3,    3,    3,    0,    1,    2,    2,    3,    5,
-    3,    0,    2,    2,    1,    5,    5,    2,    3,    2,
-    3,    1,    3,    2,    3,    5,    1,    2,    1,    3,
-    2,    1,    3,    0,    1,    1,    3,    3,    2,    1,
-    3,    2,    2,    0,    6,    7,    0,    2,    2,    3,
-    3,    1,    0,    2,    4,    3,    3,    4,    2,    1,
-    1,    1,    1,    1,    1,    1,    1,    0,    2,    1,
-    3,    0,    2,    3,    1,    3,    2,    3,    1,    1,
-    1,    1,    0,    3,    0,    2,    4,    1,    3,    1,
-    1,    1,    2,    1,    4,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    0,    3,    1,    3,    1,
-    1,    2,    2,    3,    1,    1,    1,    3,    1,    1,
-    3,    3,    4,    4,    3,    4,    4,    3,    4,    4,
+       1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
+       5,     1,     3,     3,     2,     4,     1,     3,     0,     2,
+       2,     3,     1,     1,     1,     4,     6,     4,     1,     3,
+       2,     3,     5,     3,     1,     0,     2,     1,     4,     3,
+       2,     3,     3,     3,     3,     0,     1,     2,     2,     3,
+       5,     3,     0,     2,     2,     1,     5,     5,     2,     3,
+       2,     3,     1,     3,     2,     3,     5,     1,     2,     1,
+       3,     2,     1,     3,     0,     1,     1,     3,     3,     2,
+       1,     3,     2,     2,     0,     6,     7,     0,     2,     2,
+       3,     3,     1,     0,     2,     4,     3,     3,     4,     2,
+       1,     1,     1,     1,     1,     1,     1,     1,     0,     2,
+       1,     3,     0,     2,     3,     1,     3,     2,     3,     1,
+       1,     1,     1,     0,     3,     0,     2,     4,     1,     3,
+       1,     1,     1,     2,     1,     4,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     0,     3,     1,     3,
+       1,     1,     2,     2,     3,     1,     1,     1,     3,     1,
+       1,     3,     3,     4,     4,     3,     4,     4,     3,     4,
     4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
-    4,    3,    4,    4,    4,    4,    1,    3,    1,    1,
-    1,    2,    2,    2,    1,    1,    2,    2,    2,    2,
-    2,    2,    2,    2,    2,    2,    2,    3,    2,    3,
-    2,    2,    2,    2,    2,    2,    2,    0,    1,    2,
-    2,    2,    1,    1,    1,    1,    0,    1,    2,    4,
-    5,    4,    3,    3,    1,    2,    1,    3,    1,    1,
-    3,    5,    4,    3,    2,    2,    1,    1,    1,    1,
-    1,    1,    1,    1,    2,    2,    1,    2,    1,    1,
-    0,    1,    5,    0,    1,    1,    1,    0,    3,    0,
-    5,    2,    4,    6,    6,    1,    1,    1,    3,    3,
-    1,    3,    3,    1,    1,    5,    5,    4,    1,    2,
-    2,    2,    2,    1,    2,    5,    1,    1,    2,    5,
-    1,    2,    3,    4,    1,    1,    1,    1,    1,    1,
-    1,    1,    3,    3,    3,    2,    2,    0,    5,    7,
-    0,    2,    1,    1,    0,    1,    1,    1,    0,    1,
-    1,    2,    1,    1,    1,    5,    5,    2,    2,    2,
-    2,    1,    0,    4,    6,    1,    3,    2,    2,    2,
-    0,    3,    0,    1,    2,    1,    1,    3,    1,    2,
-    1,    1,    2,    2,    2,    3,    2,    1,    0,    2,
-    1,    1,    1,    0,    2,    0,    1,    2,    2,    0,
-    1,    0,    2,    3,    3,    3,    3,    1,    3,    1,
+       4,     4,     3,     4,     4,     4,     4,     1,     3,     1,
+       1,     1,     2,     2,     2,     1,     1,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     3,     2,
+       3,     2,     2,     2,     2,     2,     2,     2,     0,     1,
+       2,     2,     2,     1,     1,     1,     1,     0,     1,     2,
+       4,     5,     4,     3,     3,     1,     2,     1,     3,     1,
+       1,     3,     5,     4,     3,     2,     2,     1,     1,     1,
+       1,     1,     1,     1,     1,     2,     2,     1,     2,     1,
+       1,     0,     1,     5,     0,     1,     1,     1,     0,     3,
+       0,     5,     2,     4,     6,     6,     1,     1,     1,     3,
+       3,     1,     3,     3,     1,     1,     5,     5,     4,     1,
+       2,     2,     2,     2,     1,     2,     5,     1,     1,     2,
+       5,     1,     2,     3,     4,     1,     1,     1,     1,     1,
+       1,     1,     1,     3,     3,     3,     2,     2,     0,     5,
+       7,     0,     2,     1,     1,     0,     1,     1,     1,     1,
+       2,     1,     1,     1,     5,     5,     2,     2,     2,     2,
+       1,     0,     4,     6,     1,     3,     2,     2,     2,     0,
+       3,     0,     1,     2,     1,     1,     3,     1,     2,     1,
+       1,     2,     2,     2,     3,     2,     1,     0,     1,     2,
+       2,     0,     2,     3,     3,     3,     3,     1,     3,     1,
     1,    3,    1,    1,    1,    2,    4,    4,    2,    2,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
@@ -352,1506 +1299,650 @@
     4,    2,    2,    5,    0,    1,    2,    1,    1,    1,
     3,    3,    3,    3,    3,    3,    1,    1,    1,    3,
-    5,    5,    5,    5,    7,    1,    3,    1,    8,    2,
-    1,    1,    3,    1,    1,    1,    4,    1,    3,    1,
-    3,    0,    4,    1,    3,    0,    1,    0,    2,    3,
-    1,
+       5,     5,     5,     5,     7,     1,     8,     2,     1,     1,
+       3,     1,     1,     1,     4,     1,     3,     0,     4,     1,
+       3,     3,     1
 };
-short fortrandefred[] = {                                      1,
-    0,   37,   19,   20,   17,   18,   27,    5,   21,    2,
-    0,    0,   27,   23,    3,  113,   38,    0,    0,  458,
-    0,  387,  388,    0,    0,    0,    0,    0,   29,    0,
-    0,    0,    0,    0,  391,    0,  497,    0,    0,  417,
-  397,    0,    0,    0,  418,    0,  491,  492,  496,  498,
-  495,    0,    0,    0,  145,  396,    0,    0,    0,  395,
-    0,  421,  124,    0,  446,  157,    0,    0,    0,  451,
-    0,  452,  366,    0,  182,    0,  193,  192,  197,  195,
-  398,  401,  400,  399,  190,  114,  194,  196,  338,  436,
-    0,    0,    0,    0,    0,  379,    0,    0,    0,   60,
-    0,    8,   21,   21,    0,    0,   21,    0,    0,    0,
-    0,   58,   61,   62,   63,   64,   65,    0,    0,    0,
-    0,    0,    0,    0,    0,  375,  384,    0,    0,    0,
-    0,  423,  424,  425,    0,    0,    0,    0,    0,    0,
-    0,   25,   37,    7,   36,   32,    0,    0,    0,  285,
-  286,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  339,  340,    0,
-  347,  350,  349,  342,  343,  344,  341,    0,    0,    0,
-    0,    0,  249,    0,  247,    0,  281,    0,  316,  250,
-    0,    0,    0,  356,  430,    0,    0,    0,  101,    0,
-  428,    0,    0,  150,    0,  148,    0,  429,    0,  414,
-  413,  392,  548,    0,  550,    0,  416,  407,   35,  383,
-    0,  480,  478,    0,  457,    0,    0,    0,    0,  162,
-    0,    0,  138,    0,    0,  172,  173,  158,  143,  144,
-  170,    0,  234,  235,    0,   72,   52,    0,    0,    0,
-  112,    0,   50,    0,  174,  381,  382,  380,    0,    0,
-    0,  178,   15,    0,    0,    0,   10,   11,   39,   21,
-   37,   14,    0,    0,    0,    0,  166,  165,    0,    0,
-    0,    0,    0,    0,    0,    0,  120,    0,    0,  137,
-    0,    0,    0,    0,  159,    0,    0,  179,    0,  210,
-    0,  367,    0,  389,    0,    0,  433,  385,    0,    0,
-    0,    0,    0,    0,  422,  431,    0,    0,  440,  445,
-    0,  453,  514,  515,  494,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  454,    0,    0,    0,    0,    0,
-    6,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint16 yydefact[] =
+{
+       2,     0,     1,    37,    20,    21,    18,    19,    27,     6,
+      22,     3,    25,    30,    27,    24,     4,    26,    37,   113,
+      38,     0,     0,   456,     0,   387,   388,     0,     0,     0,
+       0,     0,    29,   354,   108,   108,     0,     0,   391,     0,
+     486,     0,     0,   417,   397,   415,     0,     0,   418,     0,
+     480,   481,   485,   487,   484,     0,     0,     0,   145,   396,
+     108,   108,     0,   395,     0,   419,   124,     0,   444,   157,
+       0,     0,     0,   449,     0,   450,   366,    71,   182,     0,
+     193,   192,   197,   195,   398,   401,   400,   399,   190,   114,
+     194,   196,   338,   434,     5,     9,    22,     0,    22,     0,
+      22,     0,     0,    57,   125,    65,   142,    64,   164,    59,
+      61,    60,    56,     0,    63,    58,   215,     0,   183,   202,
+     191,   431,    62,     0,    25,     0,   379,     0,     0,   384,
+     411,     0,   375,     0,   430,   423,   439,     0,     0,   422,
+       0,     0,     0,   421,     0,     8,     7,    36,    32,    40,
+       0,     0,   285,   286,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  249,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  348,    0,  352,  346,  345,  317,    0,  319,
-    0,  317,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  282,    0,    0,  393,    0,    0,    0,    0,    0,
-  109,  152,    0,    0,    0,    0,  570,    0,    0,    0,
-    0,    0,  551,  556,    0,    0,    0,    0,    0,  560,
-  564,    0,    0,   74,   75,   78,   73,   79,   76,   81,
-   82,   83,   84,   85,   80,   86,   87,   88,   89,   90,
-   91,   92,   93,   94,   95,   77,   96,    0,   97,    0,
-  139,    0,    0,    0,    0,    0,    0,  220,  222,    0,
-  224,    0,  226,  227,  228,  229,  230,  221,    0,  218,
-  216,  174,  110,    0,    0,  180,    0,    0,  203,    0,
-    0,    0,    9,   16,   12,   13,    0,    0,    0,    0,
-    0,  123,    0,    0,    0,   70,    0,    0,    0,  126,
-  121,  141,    0,    0,  161,    0,    0,  184,    0,  212,
-    0,    0,    0,    0,    0,  207,  181,    0,    0,    0,
-  412,  571,    0,  405,    0,    0,  433,  437,    0,    0,
-    0,    0,  447,  484,  485,    0,    0,    0,    0,  481,
-  499,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  468,    0,  516,    0,    0,  469,    0,    0,    0,
-    0,    0,    0,  456,   49,   48,   41,    0,   46,    0,
-    0,    0,  252,    0,    0,    0,  251,  258,  255,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  272,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  324,    0,    0,    0,    0,  248,    0,    0,
-    0,    0,    0,    0,  307,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  306,    0,    0,    0,    0,    0,    0,    0,
-    0,  394,  104,    0,  103,  102,   66,    0,    0,    0,
-    0,    0,    0,  477,  476,  479,    0,    0,    0,  378,
-    0,  163,    0,   99,    0,  171,   51,    0,  223,    0,
-    0,    0,    0,  111,    0,    0,  204,    0,  245,    0,
-  238,    0,  240,  434,   31,    0,   54,  167,    0,    0,
-  136,    0,    0,    0,    0,    0,    0,  129,    0,    0,
-    0,  160,    0,    0,    0,    0,  189,  186,  208,    0,
-    0,    0,  368,    0,    0,    0,    0,  450,  442,    0,
-  489,  490,    0,    0,    0,    0,  474,  475,    0,    0,
-    0,  526,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   42,    0,   33,  386,    0,  253,  254,
-  257,  261,  262,  263,  264,  265,  260,  266,  267,  268,
-  269,  270,  271,  273,  274,  275,  276,  256,    0,    0,
-    0,  248,  532,    0,  536,    0,  534,    0,  259,    0,
-    0,  322,    0,  327,    0,  330,    0,    0,    0,    0,
-    0,    0,    0,    0,  153,  390,    0,    0,    0,  553,
-  376,  561,  377,  565,   98,    0,    0,    0,  147,  232,
-  233,  231,    0,  219,  217,    0,    0,  206,    0,    0,
-  237,    0,    0,  122,    0,    0,    0,    0,    0,    0,
-  115,  128,    0,  117,  140,  146,  185,    0,  187,    0,
-    0,    0,    0,    0,    0,    0,    0,  448,    0,    0,
-    0,  500,    0,  482,    0,    0,  527,  517,   47,   44,
-    0,    0,    0,    0,    0,  361,    0,    0,    0,    0,
-    0,  321,  105,    0,  557,    0,  100,    0,    0,  199,
-  225,    0,    0,  239,    0,  244,  119,    0,    0,    0,
-    0,    0,  188,  214,    0,  364,    0,  371,  370,  369,
-  426,  427,    0,  435,  488,    0,    0,    0,   45,    0,
-  541,  543,  542,  353,    0,    0,  328,    0,    0,  563,
-    0,    0,  175,    0,  116,    0,    0,    0,  524,    0,
-    0,    0,    0,  201,  176,    0,  373,  372,    0,    0,
-    0,    0,    0,    0,    0,    0,
-};
-short fortrandgoto[] = {                                       1,
-  262,  263,   91,  286,  598,  353,  927,  928,  742,  743,
-  512,  710,  711,  287,  242,  146,  313,  222,   92,   93,
-   94,   95,   96,   97,   98,  189,  190,  191,  553,  843,
-  192,  722,  280,  311,  193,  194,  542,  599,  195,  356,
-  196,  197,  385,  386,  387,  893,  723,  198,  199,  640,
-  814,  815,  816,  395,  396,  205,  211,  724,  663,  645,
-  200,  357,  713,  422,  910,  433,  100,   10,  276,   11,
-  101,   12,  143,   13,   14,  102,  103,  277,  104,  105,
-  106,  107,    0,  108,  776,  255,  215,  245,  109,  110,
-  111,  112,  113,  114,  115,  116,  117,  478,  208,  118,
-  293,  498,  479,  483,  209,  428,  503,  264,  289,  294,
-  119,  297,  120,  300,  121,  839,  122,  304,  305,  252,
-  505,  265,  953,  272,  123,  308,  124,  544,  737,  509,
-  499,  500,  641,  954,  125,  126,  441,  683,  449,  452,
-  127,  128,  202,  129,  320,  554,  130,  228,    0,  131,
-  325,  132,  133,  134,  135,  136,  274,  137,  329,  561,
-  562,  138,  563,  225,  139,  332,  140,  345,  141,  235,
-    0,    0,    0,  582,  583,  346,  587,    0,  568,  347,
-  570,  571,  349,  584,  585,  763,    0,  443,  444,    0,
-    0,    0,
-};
-short fortransindex[] = {                                      0,
-  121,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-27287, -307,    0,    0,    0,    0,    0, -289, -289,    0,
-  111,    0,    0,25188,  118, 1476,  147,  153,    0,25188,
-   91,  107, 1476,  163,    0,   27,    0,  -13,25188,    0,
-    0, -250, -178,   27,    0,  208,    0,    0,    0,    0,
-    0,  -14,  215,  229,    0,    0,  201,  201, -151,    0,
-  244,    0,    0, -237,    0,    0,  -89,   27,   27,    0,
- -100,    0,    0, -101,    0,   27,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  284,   35,   27,   27,   27,    0,  290,  134,  280,    0,
-   79,    0,    0,    0,   -5, -307,    0,  138,   -9,  387,
-  388,    0,    0,    0,    0,    0,    0,   42, -117,  404,
-  387, -110,  225, -312,   43,    0,    0, 3999,   54,25188,
-   41,    0,    0,    0, 1476,  420,  425,   59,  437,25721,
-  437,    0,    0,    0,    0,    0,  444,25188,25188,    0,
-    0,25188,  446,  448,  450,25188,25188,25188,  455,  456,
-  466,  478,  480,  486,  487,  497,  503,  504,  509,  513,
-25188,  515,  524,  528,  532,  533,25241,    0,    0,  539,
-    0,    0,    0,    0,    0,    0,    0,25188,   18,  149,
-  542,25188,    0,  548,    0,  553,    0,  563,    0,    0,
- 8597,  115,25188,    0,    0, 8597,  190,  570,    0,25188,
-    0, 8597,  558,    0,  222,    0,  222,    0,25188,    0,
-    0,    0,    0,25188,    0,25903,    0,    0,    0,    0,
-  190,    0,    0,25380,    0,  190,  190,  222, 3040,    0,
-  224,  190,    0,25188,  609,    0,    0,    0,    0,    0,
-    0,  610,    0,    0,  201,    0,    0,  255, 1930,  603,
-    0,  651,    0, -289,    0,    0,    0,    0,  283,25428,
- -312,    0,    0,  665,27287, -307,    0,    0,    0,    0,
-    0,    0, -289,  648,  296,  675,    0,    0,   19,  308,
-   19,  -12,   86,  -11,  665,  308,    0,  190,   19,    0,
-  313,  665,  318,  692,    0,  -10, 3093,    0,24098,    0,
-  703,    0,  711,    0,  717,  732,    0,    0,  387,  190,
- 8597,25188,25188,  190,    0,    0,  360, 4498,    0,    0,
-25685,    0,    0,    0,    0,25188,25188,25188,25188,  740,
-25685,  149,  553, 1423,    0,  764,  209,    0, 9398,25241,
-    0,    8,  535,25936, 3157,  236, 8597,25188,25188,25188,
-  281,26019,  461,25188,25188,25188,25188,25188,25188,25188,
-25188,25188,25188,25188,25188,26043,25188,25188,25188,25188,
-25188,25241,    0,  781,  451,  786,  789,    0, 8597,25188,
-  790,26094,    0,25188,    0,    0,    0,    0,   48,    0,
-  190,    0,24299,25188,25188,25188,25188,25188,25188,25188,
-25188,25188,25188,25188,25188,25188,25188, 2012,25188,24438,
-24486,    0,25188,25188,    0,26169,  665,  475,  147,26191,
-    0,    0,  791,  791,26213,27040,    0,  796,  553,  563,
-  793,  801,    0,    0,  798,  256,  799,  796,  797,    0,
-    0,  568,  791,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  800,    0,  571,
-    0, 8597,  577,  802,  428,   27,  665,    0,    0,  665,
-    0,  807,    0,    0,    0,    0,    0,    0,  119,    0,
-    0,    0,    0,  444,  436,    0,24627, 8597,    0,  819,
- 2554,  665,    0,    0,    0,    0,  444,25188,  599,  296,
-  387,    0,  387,  233,25188,    0,  447,  449,  233,    0,
-    0,    0,  387,  665,    0,  692,  318,    0, 3093,    0,
-24251,  817, 8597,  824,24675,    0,    0, -225,  190,  190,
-    0,    0,  806,    0, 8597, 8597,    0,    0,  445, 8597,
-  827,  826,    0,    0,    0, 9456, 9398,  605,  100,    0,
-    0, 8597, 8597, 8597, 8597,25188,  333, 1423,  538,  553,
- 8597,    0,  828,    0, 8597, 1423,    0, 9398, 9398, 9398,
- 9398, 9398,  598,    0,    0,    0,    0,  614,    0,  833,
- 1476,25188,    0,  618,  619,26276,    0,    0,    0,26327,
-26349,26446,26468,26509,26582,26604,26626,26701,26742,26764,
-26859,    0,  626,  634,  636,  638,  642,  831,  834,  835,
-26881,25241,    0,25241,25241,  644,25188,    0,  822,  840,
-24813,  553,  841,25188,    0, 8597, 2081, 2081, 2226, 2226,
- 3157,   84,   84,   84,   84,   84,   84,   90,   90,   48,
-25188,25188,    0, 8597,   48,25188,   84,25188,   84, 8597,
- 8597,    0,    0,  190,    0,    0,    0,  468,  551,25188,
-24813, -278,  845,    0,    0,    0, -278,  846,  190,    0,
- 3040,    0,25188,    0,25188,    0,    0,  852,    0, -170,
- 1930,  843,  485,    0,  665,  864,    0,25188,    0,  646,
-    0, 6917,    0,    0,    0, 8597,    0,    0,  318,  308,
-    0,  321,  550,  635,26934,  643,  870,    0,  645,  190,
-  852,    0,  878,24675,  817,  506,    0,    0,    0,  862,
-  547,  880,    0,  793,  797,25188,  665,    0,    0, 4498,
-    0,    0,24813,  631,  544,25685,    0,    0, 8597,    0,
-  656,    0, 8597, 8597, 1423, 8597,  828,  250,  598,  598,
-  598,   38,   -1,    0,   10,    0,    0, 8597,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,25563,25563,
-25563,    0,    0, 8597,    0, 8597,    0, 8597,    0,  885,
-25188,    0,24866,    0,  883,    0, 7337,  548,   84,   84,
-   48,   84,   84,  665,    0,    0,26997,  658,  867,    0,
-    0,    0,    0,    0,    0, 8597,  660,25616,    0,    0,
-    0,    0,  891,    0,    0,  665,  852,    0, 8597, 2554,
-    0,25005,  692,    0,  149,  233,  233,  233,  233,  233,
-    0,    0,  233,    0,    0,    0,    0,  817,    0,24675,
-   28,  516,  517,  894,  895,27113,  665,    0,  896,24169,
-  190,    0,  209,    0, 2501, 8597,    0,    0,    0,    0,
-  662,  879,  898,  900,  902,    0,  903,25188, 7757,24813,
-25188,    0,    0,  904,    0,  190,    0,25053, 8597,    0,
-    0,  852,    0,    0, 8597,    0,    0,  184,  184,  906,
-  491,  677,    0,    0,  573,    0,  917,    0,    0,    0,
-    0,    0,25188,    0,    0,  801,  909, 8597,    0,25188,
-    0,    0,    0,    0, 8597,25188,    0, 8177,25188,    0,
-  927,    0,    0,  911,    0,  557,  559,27166,    0,27187,
- 8597,25188, 8597,    0,    0,25188,    0,    0,25188,25188,
- 8597, 8597, 8597,27272,25188, 8597,
-};
-short fortranrindex[] = {                                      0,
- 5433,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  223,23906,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,23602,
-  560,  560,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,22995,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  560, 3577,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   25,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-18370,  579,    0,    0,    0,    0,    4,  -15,   52,    0,
-23145,    0,    0,    0,    0,23906,    0,    0,    0, 5953,
-13515,    0,    0,    0,    0,    0,    0,    0,18586,13666,
-  580,    0,   11,    0,    0,    0,    0,    0,23298,    0,
-    0,    0,    0,    0,    0,18739,18890,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,16959,    0,    0,    0,
+     339,   340,     0,   347,   350,   349,   342,   343,   344,   341,
+       0,   402,   250,   247,     0,   279,   316,   318,   315,   281,
+     314,   280,   351,   249,     0,     0,   356,   357,   428,     0,
+      69,   101,     0,   355,   426,     0,   150,     0,   148,     0,
+     427,     0,   414,   413,   392,   535,     0,   537,     0,   416,
+     407,    35,   383,     0,   469,   467,     0,   455,     0,     0,
+       0,     0,   162,     0,     0,   138,     0,    53,   172,   173,
+     158,   143,   144,   170,   169,   234,   235,   108,    72,    52,
+      30,    15,    25,     0,    11,    39,    22,    12,     0,     0,
+      55,   166,   127,   164,     0,   125,     0,   236,   120,   125,
+     165,   137,     0,   165,     0,     0,     0,   236,   154,   159,
+       0,     0,     0,   112,    50,     0,   177,   174,   209,   210,
+       0,     0,     0,   179,     0,     0,   178,     0,    16,   236,
+     367,   362,    37,   381,   380,   382,   164,   408,   406,     0,
+       0,     0,   420,     0,   441,   438,   443,   429,     0,   451,
+     503,   504,   483,     0,     0,     0,     0,   338,     0,   490,
+     491,   452,   457,   461,     0,   482,     0,   453,   389,     0,
+       0,   431,   385,     0,    34,     0,   284,   277,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,   527,   517,   249,     0,   519,
+     518,     0,     0,   247,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   308,
+       0,     0,     0,   282,   283,     0,   354,   319,   317,   317,
+     345,   348,   346,   352,     0,     0,   393,     0,     0,   236,
+       0,     0,   109,   152,   151,   149,     0,     0,   551,     0,
+     542,   431,   539,   547,   538,   543,   341,   247,   314,   541,
+     545,   547,   549,     0,    67,    74,    75,    78,    73,    79,
+      76,    81,    82,    83,    84,    85,    80,    86,    87,    88,
+      89,    90,    91,    92,    93,    94,    95,    77,    96,    97,
+      68,     0,   139,     0,   106,     0,     0,     0,    10,    17,
+      40,    13,     0,     0,     0,   135,     0,    70,     0,     0,
+     135,   123,   164,     0,   126,   121,   141,   164,   236,   236,
+     164,   161,     0,   155,   220,   222,   236,   224,     0,   226,
+     227,   228,   229,   230,     0,   218,   221,   216,    40,   174,
+     110,     0,     0,   212,   207,   211,   181,   184,     0,   338,
+       0,   213,     0,   203,   205,     0,   180,   236,     0,    14,
+     412,   552,   405,     0,   436,   437,   431,   435,     0,   447,
+       0,   442,   445,   473,   474,     0,   314,     0,   470,   472,
+     488,   498,   501,   500,   499,     0,   472,   507,   514,   508,
+     514,   459,   458,   514,   505,   507,   460,     0,     0,     0,
+       0,     0,   496,   454,     0,     0,    49,    48,    41,     0,
+      46,    43,     0,     0,   252,     0,     0,     0,   251,   258,
+     255,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,   272,     0,     0,     0,     0,     0,     0,
+     247,     0,     0,     0,   324,     0,     0,     0,   248,     0,
+       0,   313,   307,   302,   292,   303,   304,   305,   301,   291,
+     297,   299,   293,   295,   287,   288,   289,     0,     0,   309,
+     306,   290,     0,   296,     0,   294,   323,     0,   325,     0,
+       0,   403,   404,   394,     0,   103,   104,   102,    66,     0,
+       0,     0,   317,     0,     0,   466,   468,   465,     0,     0,
+       0,   378,     0,   163,     0,    99,     0,   171,    51,    31,
+     168,    54,   167,     0,   118,     0,   136,     0,     0,   127,
+     129,     0,   125,   241,   245,     0,   238,   240,   246,     0,
+     198,   198,     0,   160,   223,     0,     0,     0,   111,     0,
+     236,   208,     0,     0,   213,   186,     0,   189,     0,   204,
+     432,     0,     0,   363,   368,     0,   236,   448,   440,     0,
+       0,   478,   479,   317,   475,     0,   463,   464,   502,   464,
+       0,   515,   511,   512,   507,   509,   462,   497,   493,   494,
+     495,   492,   547,   547,     0,    42,     0,    33,   386,   278,
+     253,   254,   257,   261,   262,   263,   264,   265,   260,   266,
+     267,   268,   269,   270,   271,   273,   274,   275,   276,   256,
+     248,     0,     0,     0,   520,   521,   524,   525,   522,   523,
+     259,   247,   312,   310,   311,   300,   298,   354,   337,   329,
+     326,   327,   330,   320,   322,   236,   153,   390,     0,     0,
+       0,   540,   376,   546,   377,   550,    98,   107,     0,   115,
+     135,   135,   135,   135,   135,   130,   128,   135,   117,   122,
+     243,     0,   237,   242,   140,     0,   146,   147,   156,   232,
+     233,   231,     0,   219,   217,   236,   198,   185,   213,   187,
+       0,   206,     0,     0,     0,     0,   236,   446,   489,     0,
+       0,     0,   471,   472,   507,   514,   516,   506,     0,     0,
+      47,    44,     0,   338,     0,     0,     0,   361,     0,     0,
+     335,   336,     0,   321,   105,     0,   544,     0,   100,   119,
+     131,   132,   133,   134,     0,   239,   244,   246,     0,   199,
+     200,   225,   198,   358,   188,   214,   374,   364,   365,   371,
+     370,   369,     0,   433,   477,   476,     0,   510,   424,   425,
+      45,     0,   530,   532,   531,   353,   334,     0,   331,   328,
+       0,   548,   116,     0,   358,   175,     0,     0,     0,   409,
+     513,     0,   333,     0,   536,   201,   176,     0,   373,   372,
+       0,     0,   332,   359,   410,   533,     0,   534
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,    11,    94,    95,    96,   261,    12,   262,    13,
+      18,    15,    97,    98,   148,    14,    99,   266,   354,   777,
+     599,   600,   100,   257,   479,   480,   247,   210,   211,   428,
+     483,   217,   294,   295,   101,   102,   273,   703,   103,   104,
+     278,   274,   704,   705,   105,   106,   281,   107,   108,   109,
+     110,   111,   434,   112,   113,   288,   289,   244,   276,   270,
+     271,   114,   254,   115,   531,   296,   530,   116,   117,   303,
+     540,   118,   119,   120,   856,   919,   306,   543,   300,   541,
+     737,   297,   524,   525,   862,   526,   504,   715,   716,   717,
+     357,   192,   358,   193,   194,   413,   660,   642,   195,   668,
+     196,   197,   198,   199,   670,   820,   821,   822,   200,   201,
+     202,   422,   417,   214,   208,   955,   956,   203,   122,   123,
+     311,   743,   744,   928,   929,   124,   125,   126,   127,   128,
+     204,   129,   552,   317,   224,   230,   130,   131,   132,   309,
+     133,   134,   322,   135,   325,   560,   136,   137,   561,   562,
+     138,   139,   581,   341,   586,   329,   237,   567,   568,   140,
+     343,   141,   142,   344,   570,   346,   582,   583,   584,   762,
+     388,   389,   390,   894,   227,   143,   443,   444,   445,   451,
+     684,   453,   144,   553
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -702
+static const yytype_int16 yypact[] =
+{
+    -702,   921,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,   -59,  5446,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,   -24,   -24,  -702,    -3,  -702,  -702,  4703,     3,  2638,
+      49,    56,  -702,  4703,    37,    38,  2638,   146,  -702,   -93,
+    -702,  -110,  4703,  -702,  -702,    43,    48,   -93,  -702,   148,
+    -702,  -702,  -702,  -702,  -702,   185,   156,   158,  -702,  -702,
+     164,   164,    79,  -702,   171,  -702,  -702,   -51,  -702,  -702,
+      -7,   -93,   -93,  -702,    75,  -702,  -702,    53,  -702,   -93,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,   179,  -702,  -702,   224,  -702,   130,
+    -702,   -81,   186,   136,   149,  -702,   138,  -702,   360,   363,
+    -702,  -702,   172,   150,  -702,  -702,   145,   -19,    16,    29,
+     370,   395,  -702,   231,   -59,   -93,  -702,   -93,   -93,  -702,
+     230,  4703,  -702,    27,   405,  -702,   233,   241,  2638,  -702,
+     236,  2722,   236,  -702,  5702,  -702,  -702,  -702,  -702,   253,
+    4703,  4703,  -702,  -702,  4703,   256,   257,   266,  4703,  4703,
+    4703,   267,   271,   277,   289,   292,   298,   304,   312,   313,
+     314,   315,   317,  4703,   318,   328,   329,   330,   331,  4831,
+    -702,  -702,   334,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    4703,  2443,  -702,  -702,  4703,   244,  -702,   335,   343,  -702,
+     344,   359,   228,  -702,    58,  4703,  -702,  2443,  -702,   362,
+     529,  -702,  4703,  2443,  -702,   536,  -702,   372,  -702,   372,
+    -702,  4703,  -702,  -702,  -702,  -702,  4703,  -702,  1425,  -702,
+    -702,  -702,  -702,   362,  -702,  -702,  4959,  -702,   362,   362,
+     372,  3079,  -702,   373,   362,  -702,  4703,   541,  -702,  -702,
+    -702,  -702,  -702,  -702,   544,  -702,  -702,   164,  -702,  -702,
+    5446,  -702,   -59,   -24,  -702,  -702,  -702,  -702,   548,   390,
+     563,  -702,    60,    28,   333,   408,   159,   399,  -702,   408,
+     362,  -702,   159,  -702,   410,   412,   159,   399,   571,  -702,
+     413,   445,   581,  -702,  -702,   -24,   583,  -702,  3039,  -702,
+     404,   147,  3935,  -702,  5087,   -19,  -702,   411,  -702,   399,
+    -702,   586,  -702,  -702,  -702,  -702,   360,   362,  2443,  4703,
+    4703,   362,  -702,   414,  4063,  -702,  -702,  -702,  2588,  -702,
+    -702,  -702,  -702,  4703,  4703,  4703,  4703,   587,  2588,   244,
+     359,  -702,  1096,   588,   403,   580,  2852,  4831,  -702,   416,
+     417,  -702,  -702,    17,   567,  1446,  2556,  2443,    23,  4703,
+    4703,  4703,    42,  1469,    52,  4703,  4703,  4703,  4703,  4703,
+    4703,  4703,  4703,  4703,  4703,  4703,  4703,  1491,  4703,  4703,
+    4703,  4703,  4703,  4831,  2443,  1512,   722,  -702,   461,   595,
+     604,  4703,  1548,   607,  3423,  4703,  4703,  4703,  4703,  4703,
+    4703,  4703,  4703,  4703,  4703,  4703,  4703,  4703,  4703,  3167,
+    4703,  3551,  3679,  -702,    19,   362,  4703,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  4703,  4703,  -702,  1570,    65,   399,
+      49,  1694,  -702,  -702,   608,   608,  1752,   791,  -702,   244,
+     -54,    22,   425,   612,  -702,  -702,   436,   437,     8,    22,
+    -702,   616,  -702,    70,   608,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+     617,   597,  -702,    74,  2443,   443,   454,   -93,  -702,  -702,
+     253,  -702,  4703,    76,   390,   260,  4703,  -702,   455,   457,
+     260,  -702,   360,  2489,  -702,  -702,  -702,   360,   399,   399,
+     360,  -702,   413,   571,  -702,  -702,   399,  -702,   449,  -702,
+    -702,  -702,  -702,  -702,   356,  -702,  -702,  -702,   253,  -702,
+    -702,   460,  4191,  -702,  -702,  2443,  -702,  -702,  3935,  3295,
+     452,   630,  4319,  -702,  2443,   462,  -702,   399,    33,  -702,
+    -702,  -702,  -702,   629,  2443,  2443,  -702,  -702,   467,  2443,
+     464,   642,  -702,  -702,  -702,  2852,  3807,    78,  -702,   106,
+    -702,  2443,  2443,  2443,  2443,  4703,   308,  5572,  2443,   244,
+    1773,  -702,   643,  2443,  -702,  5572,  -702,  2852,  2852,  2852,
+    2852,  2852,   623,  -702,   362,   362,  -702,  -702,  -702,    86,
+    -702,   471,  2638,  4703,  -702,    87,    89,  1794,  -702,  -702,
+    -702,  1815,  1836,  1876,  1897,  1939,  2018,  2079,  2121,  2142,
+    2163,  2200,  2221,  -702,    90,    92,    93,    94,    98,  2261,
+     648,   649,   650,  4831,  -702,  4831,  4831,   103,  -702,  4703,
+    4703,  2443,  -702,  2460,  2460,  2481,  2481,  2556,  2577,  2577,
+    2577,  2577,  2577,  2577,   119,   119,    19,  4703,  4703,  2443,
+    -702,    19,  4703,  2577,  4703,  2577,   244,   652,  2783,   477,
+     478,  2443,  2443,  -702,   362,  -702,  -702,  -702,  -702,   490,
+     576,  4703,  2783,    -8,   481,  -702,  -702,  -702,    -8,   482,
+     362,  -702,  3079,  -702,  4703,  -702,  4703,  -702,  -702,  -702,
+    2443,  -702,  -702,   639,    35,   387,  -702,  2345,   640,   486,
+    -702,   646,   408,  4703,  -702,   104,  -702,  -702,  1325,   362,
+     651,   651,   413,  -702,  -702,   264,   445,   662,  -702,   502,
+     399,  -702,   492,  4191,   630,  -702,   504,  -702,   495,  -702,
+    -702,   672,   552,   677,  -702,  4703,   399,  -702,  -702,  4063,
+     513,  -702,  -702,  2783,   674,  2588,  -702,  -702,  2443,   680,
+     105,  -702,  2443,  2443,  5572,  2443,   643,   547,   623,   623,
+     623,   396,   612,   616,    20,  -702,   141,  -702,  -702,  2443,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  5215,  5215,  5215,  2443,  -702,  2443,  -702,  2443,  -702,
+    -702,   514,  2577,  2577,    19,  2577,  2577,  4703,  2911,  1360,
+     698,  -702,  -702,   335,  -702,   399,  -702,  -702,  2403,   109,
+     697,  -702,  -702,  -702,  -702,  -702,  -702,  2443,   111,  -702,
+     260,   260,   260,   260,   260,   359,  -702,   260,  -702,  -702,
+    2443,  2489,  -702,  4447,  -702,  5343,  -702,  -702,   571,  -702,
+    -702,  -702,   523,  -702,  -702,   399,   651,  -702,   630,  -702,
+    4191,  -702,   -47,   535,   538,  1171,   399,  -702,  -702,   744,
+     525,   362,  -702,   403,  5613,  2443,  -702,  -702,   530,   531,
+    -702,  -702,   116,   704,   532,   533,   534,  -702,   537,  4703,
+    1382,  4703,  2783,  -702,  -702,   712,  -702,   362,  -702,  -702,
+      10,    10,   528,   115,   695,  -702,  -702,  2443,  4575,  -702,
+    2443,  -702,   651,   715,  -702,  -702,   598,  -702,   718,  -702,
+    -702,  -702,  4703,  -702,  -702,   425,   543,  2443,  -702,  -702,
+    -702,  4703,  -702,  -702,  -702,  -702,  2443,  4703,  1404,  -702,
+    4703,  -702,  -702,   554,   715,  -702,   723,   572,   573,  1194,
+    -702,  1280,  2443,  4703,  2443,  -702,  -702,  4703,  -702,  -702,
+    4703,  4703,  2443,  2443,  2443,  1303,  4703,  2443
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -702,  -702,  -702,  -702,   503,  -702,     2,  -702,   740,  -702,
+     -49,   756,  -702,  -702,    -1,     5,  -702,  -702,  -407,  -702,
+      -5,     4,  -702,  -702,    85,  -702,  -702,  -702,   349,  -702,
+      84,   -11,  -702,  -702,  -702,  -702,  -702,  -482,  -702,  -702,
+    -265,   282,  -402,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,   173,  -702,  -702,  -278,   270,   -39,   -21,   515,
+     291,  -702,  -702,  -702,   258,  -702,  -702,  -702,  -702,  -702,
+     245,  -702,  -702,  -702,  -701,  -702,  -702,  -702,   483,  -290,
+    -687,  -702,  -702,    63,  -702,   709,  -282,  -702,   -58,   -61,
+     -27,  -176,   -80,  -154,  -323,  -532,  -702,  -702,  -128,  -702,
+    -702,  -702,  -204,  -702,   377,   121,   -92,    64,   178,   -87,
+    -702,  -702,  -198,  -399,   -29,  -143,  -702,  -163,  -702,  -702,
+    -702,  -702,   -56,  -702,  -139,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,   -12,  -702,  -702,  -702,   676,   265,
+    -232,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,    73,
+    -702,  -702,  -702,  -702,  -702,   254,  -702,  -702,    68,  -702,
+    -702,  -702,  -702,  -275,   684,  -316,  -426,  -702,  -694,  -561,
+     480,   446,  -372,  -648,   272,  -702,   237,  -201,  -702,   238,
+    -421,  -702,  -702,  -702
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -508
+static const yytype_int16 yytable[] =
+{
+     191,   442,   207,   385,   423,   511,   213,   220,   534,   207,
+     501,   632,   513,   339,   505,   228,   387,   667,   711,   763,
+     857,   149,   765,   146,   219,   386,   603,   547,   591,   440,
+     689,   283,   319,   843,   440,   232,   393,   450,   840,   301,
+     596,   215,   215,   596,   410,   603,   761,   869,   761,   240,
+     241,   761,   304,   569,   340,   603,   841,   842,   843,   251,
+     252,   424,   425,   576,   741,   279,   225,   259,   674,   226,
+     887,   592,   248,   690,   290,   312,   222,   694,   362,   494,
+     364,   755,   447,   699,   495,   282,   249,   284,   268,   774,
+     603,   286,   603,   603,   223,   603,   603,   603,   269,   242,
+     264,   603,   267,   243,   318,   439,   603,   851,   884,   327,
+     439,   207,   902,   313,   694,   314,   315,   830,    17,   774,
+     250,   728,   926,   355,   356,   418,   587,   330,   331,   588,
+     589,   590,   363,   255,   256,  -315,   841,   842,   843,   275,
+     927,   280,   408,   409,   410,   147,   377,   676,   291,   292,
+     298,   760,   384,   320,   895,   896,  -164,   299,  -164,   766,
+    -164,    92,  -164,   392,   596,   923,   578,   414,   215,   242,
+     242,   385,   706,   243,   243,   283,   150,   706,   427,   242,
+     293,   924,   205,   243,   387,   431,   597,   419,   687,   597,
+     887,   121,  -164,   386,   436,   302,  -164,   598,   844,   437,
+     339,   682,   742,   604,   411,   412,   260,   385,   305,   384,
+     339,  -314,   229,   489,   579,   497,   321,   231,   339,   484,
+     387,   954,   608,   844,   216,   218,   720,   721,   209,   630,
+     886,   886,   610,   886,   724,   212,   936,   502,   426,   496,
+     245,   340,   731,   507,   253,   675,   487,   510,    92,   734,
+     691,   340,   498,   591,   695,   580,   701,   263,   756,   340,
+     591,   805,   490,   807,   809,   740,   775,   780,   491,   781,
+     795,   535,   796,   797,   798,   535,   591,   544,   799,   605,
+     606,   152,   153,   810,   852,   885,   757,   666,   265,   906,
+     750,   908,   554,   555,   528,   550,   940,   559,   624,   625,
+     626,   627,   628,   844,   411,   412,   571,   572,   573,   574,
+     597,   637,   767,   768,   769,   770,   771,   549,   277,   287,
+     384,   891,   351,   537,   937,   221,   538,   233,   587,   330,
+     331,   588,   589,   590,   607,   238,   499,   239,   611,   612,
+     613,   614,   615,   616,   617,   618,   619,   620,   621,   622,
+     246,   888,   889,   761,   234,   272,   629,   500,   909,   726,
+     727,   235,   442,   283,   236,   914,   285,   641,   643,   644,
+     645,   646,   647,   648,   649,   650,   651,   652,   653,   654,
+     655,   656,   659,   661,   663,   665,   421,   429,   393,   213,
+     440,   440,   435,   307,   450,   342,   347,   671,   672,   308,
+     310,   578,   859,   860,   861,   886,   316,   416,   323,   578,
+     326,   441,   324,   454,   448,   328,   449,   452,   898,   588,
+     589,   590,   482,   587,   330,   331,   588,   589,   590,   805,
+     807,   809,   353,   415,   591,   359,   360,   339,   121,   910,
+     911,   912,   913,   868,   858,   361,   365,   849,   866,   579,
+     366,   591,   591,   591,   591,   591,   367,   579,   506,   339,
+     339,   339,   339,   339,   876,   700,   439,   439,   368,   707,
+     387,   369,   387,   387,   514,   698,   718,   370,   340,   440,
+     883,   712,   831,   371,   440,   811,   719,   833,   759,   722,
+     580,   372,   373,   374,   375,   551,   376,   378,   580,   556,
+     340,   340,   340,   340,   340,   535,   566,   379,   380,   381,
+     382,   535,   535,   391,   416,   392,   566,   706,   706,   706,
+     706,   706,   418,   419,   706,   255,   256,   515,   420,   180,
+     181,    92,   430,   587,   330,   331,   588,   589,   590,   754,
+     432,   433,   481,   904,   485,   183,   184,   486,   758,   185,
+     186,   187,   188,   492,   516,   439,   517,   518,   519,   268,
+     439,   520,   521,   189,   522,   523,   494,   591,   330,   331,
+     588,   589,   590,   778,   512,   207,   779,   277,   503,   508,
+     925,   509,   287,   922,   536,   527,   529,   546,   578,   548,
+     557,   585,   575,   634,   933,   594,   595,   601,   635,   393,
+    -488,  -488,  -488,  -488,  -488,  -488,   804,   636,   806,   808,
+     639,   679,   384,   812,   321,   683,   685,   686,   845,   688,
+     692,   693,   696,   697,   708,   903,   709,   339,   725,   730,
+     813,   814,   735,   736,   745,   815,   579,   816,   387,   387,
+     387,   819,   739,   225,   748,   749,   764,   811,   590,   935,
+     776,   801,   802,   803,   828,   819,   817,   823,   824,   826,
+     827,   832,   834,   839,   847,   496,   864,   837,   340,   484,
+     848,   865,   867,   870,   855,   871,   872,   580,   873,   394,
+     874,   395,   396,   397,   398,   399,   850,   400,   401,   402,
+     403,   404,   405,   878,   897,   406,   407,   408,   409,   410,
+    -489,   902,   907,   921,   930,   934,   535,   742,   578,   941,
+     938,   939,   942,   943,   944,   950,   844,   945,   875,   952,
+    -360,   958,   559,   960,   957,   633,   879,  -247,   967,  -247,
+    -247,  -247,  -247,  -247,   965,  -247,  -247,  -247,  -247,  -247,
+    -247,   968,   926,  -247,  -247,  -247,  -247,  -247,   901,   394,
+      16,   395,   396,   397,   398,   399,   579,   400,   401,   402,
+     403,   404,   405,   488,   393,   406,   407,   408,   409,   410,
+     145,   892,   441,   449,   804,   806,   808,   836,   890,   677,
+     838,   710,   723,   732,   493,   702,   258,   729,   545,   863,
+     213,   900,   916,   915,   681,   669,   394,   580,   395,   396,
+     397,   398,   399,   829,   400,   401,   402,   403,   404,   405,
+     949,   966,   406,   407,   408,   409,   410,   880,   931,   969,
+     352,   746,   877,   882,   718,   345,   917,   593,   920,   631,
+     747,   772,     0,   773,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,   535,     0,     0,     0,     0,     0,     0,
+       0,     0,   825,     0,     0,     0,     0,     0,     0,   411,
+     412,   449,     0,   881,     0,     0,   449,     0,   835,     0,
+       0,     0,   946,     0,   948,   819,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0, 1107, 2724,
- 1277,    0,    0, 1646,    0, 2894,    0, 1816,    0,    0,
-  125,    0,    0,    0,    0,19043,    0,19194,    0,    0,
-    0,13884,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   392,     0,     0,     0,     0,     0,   854,     0,     0,
+       0,     0,     0,     0,     0,   959,     0,  -247,  -247,     0,
+       0,     0,     0,     0,   961,     0,     0,     0,     0,     0,
+     962,     2,     3,   964,   638,     0,     0,     0,     0,   411,
+     412,     0,     0,   566,     0,     0,   972,     0,     0,     0,
+     973,     0,     0,   974,   975,     0,     0,     0,   -23,   977,
+     -23,     0,     0,   -23,   -23,   -23,   -23,     4,     5,   -23,
+       0,     0,   -23,   -23,   -23,     0,     0,     0,     0,   -23,
+     -23,     0,     0,     0,     6,     7,   411,   412,     0,     0,
+       0,     0,     0,     0,   -23,     0,     0,     0,   -23,   -23,
+       0,     0,     0,   -23,     0,     0,     0,     0,     0,   -23,
+       0,   -23,   -23,     0,   -23,     0,   -23,   -23,   -23,   -23,
+     -23,     0,   -23,   -23,   -23,   -23,   -23,   -23,   -23,   -23,
+     -23,   -23,   -23,   -23,   -23,   -23,   -23,   -23,     0,     0,
+     -23,   -23,   -23,     0,   -23,   -23,   -23,     0,   -23,   -23,
+     -23,     0,     0,   -23,     0,   -23,     0,     0,   -23,   -23,
+     -23,   -23,     0,     0,   -23,   -23,   -23,     0,     0,   351,
+       0,     0,   -23,     0,     0,     8,   -23,   -23,   -23,   -23,
+     -23,   -23,   -23,     0,   -23,   -23,   -23,   -23,   -23,     0,
+       0,   -23,     0,     0,     0,   951,     0,     0,   -23,   -23,
+     -23,     0,     0,     0,     0,     0,     0,   -23,     9,  -507,
+       0,  -507,     0,  -507,  -507,  -507,  -507,  -507,    10,  -507,
+    -507,  -507,  -507,  -507,  -507,     0,     0,  -507,  -507,  -507,
+    -507,  -507,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   154,   155,     0,     0,     0,
+     156,   157,   158,   159,     0,     0,     0,     0,     0,     0,
+       0,     0,   160,   161,   162,   163,   164,   165,   166,     0,
+     167,   168,   169,     0,     0,   170,   171,   172,     0,   173,
+     174,   175,   176,   177,   932,   178,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,   970,     0,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   180,   181,
+       0,     0,     0,     0,   182,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   183,   184,     0,     0,   185,   186,
+     187,   188,     0,     0,     0,    92,     0,     0,     0,     0,
+       0,     0,   189,     0,     0,   577,     0,     0,     0,     0,
+       0,  -507,  -507,   971,     0,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,   976,     0,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   853,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,     0,     0,     0,     0,     0,   411,   412,     0,     0,
+       0,     0,     0,     0,   901,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,   411,
+     412,   406,   407,   408,   409,   410,   947,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   963,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,   411,   412,   406,   407,   408,
+     409,   410,     0,     0,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,   411,   412,
+     406,   407,   408,   409,   410,     0,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+     411,   412,   406,   407,   408,   409,   410,  -250,     0,  -250,
+    -250,  -250,  -250,  -250,     0,  -250,  -250,  -250,  -250,  -250,
+    -250,     0,     0,  -250,  -250,  -250,  -250,  -250,     0,     0,
+       0,     0,     0,     0,     0,   411,   412,     0,     0,     0,
+       0,     0,     0,   394,     0,   395,   396,   397,   398,   399,
+       0,   400,   401,   402,   403,   404,   405,   411,   412,   406,
+     407,   408,   409,   410,     0,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,   411,
+     412,   406,   407,   408,   409,   410,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   438,     0,     0,     0,     0,
+     411,   412,     0,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,  602,    0,    0,    0,
+       0,   411,   412,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   609,
+       0,     0,     0,     0,   411,   412,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   623,     0,     0,     0,     0,   411,   412,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,19347,    0,    0,    0,    0,    0,
-    0,19498,    0,    0,   29,    0,    0,    0,    0,    0,
-    0,19651,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   24,  223,23906,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,19802,    0,    0,    0,14035,
-    0,  954,  580,    0,  908,14035,    0,   30,    0,    0,
-    0,  908,    0,14191,    0,    0,    0,    0,  960,    0,
-    0,    0,19955,    0,    0,    0,    0,    0,20106,23449,
-20259,    0,    0,    0,    0,    0,    0,  987,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0, 9631,
-    0,10472,10208, 5640,    0,20410,    0,10627,    0,23753,
-    0,    0,20563,    0, 6171,    0,  673,    0,    0,    0,
+       0,     0,  -250,     0,     0,     0,     0,  -250,  -250,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+       0,     0,     0,     0,     0,     0,     0,     0,   638,     0,
+       0,     0,     0,   411,   412,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     673,     0,     0,     0,     0,   411,   412,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   678,     0,     0,     0,     0,   411,
+     412,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,   394,     0,   395,   396,   397,   398,   399,     0,
+     400,   401,   402,   403,   404,   405,     0,     0,   406,   407,
+     408,   409,   410,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   680,     0,     0,     0,     0,   411,   412,     0,
+       0,     0,   420,     0,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,   411,   412,
+     406,   407,   408,   409,   410,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   782,     0,     0,     0,     0,   411,
+     412,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   783,     0,     0,     0,     0,
+     411,   412,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   784,     0,     0,     0,
+       0,   411,   412,   394,     0,   395,   396,   397,   398,   399,
+       0,   400,   401,   402,   403,   404,   405,     0,     0,   406,
+     407,   408,   409,   410,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   785,     0,     0,     0,
+       0,   411,   412,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,   786,     0,     0,
+       0,     0,   411,   412,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,     0,     0,
+     406,   407,   408,   409,   410,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   787,
+       0,     0,     0,     0,   411,   412,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   788,     0,
+       0,     0,     0,   411,   412,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   789,
+       0,     0,     0,     0,   411,   412,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, 4668,    0,17110,17263, 3263,    0,    0,
-25786,    0,    0,  972,    0,    0,    0,    0, 3433,    0,
+       0,   790,     0,     0,     0,     0,   411,   412,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0, 5271,    0,    0,
-    0,    0,    0,    0,    0,    0,  674,    0,    0,    0,
-    0,    0,20714,20867,    0,    0,    0,  165,    0,  510,
-  995,  679,    0,    0, 6497,  869, 9017,  526,  995,    0,
-    0,    0,21018,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   791,     0,     0,     0,     0,   411,   412,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,21171,    0,    0,
-    0,  680,    0,    0,    0,    0,14404,    0,    0,  127,
+       0,     0,     0,   792,     0,     0,     0,     0,   411,   412,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     793,     0,     0,     0,     0,   411,   412,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,21322,    0,    0,    0,   40,    0,    0,
-    0,   24,    0,    0,    0,    0,21322,    0,    0,    0,
-  580,    0,14555,  356,    0,    0,    0,    0,  356,    0,
-    0,    0,  580,14404,    0,14711,    0,    0,    0,    0,
- 5618, 1012,  708,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,21475,21626,    0,    0,    0,  709,
-    0, 1013,    0,    0,    0,   63,    0,    0, 1014,    0,
-    0,12251,12465,12620,12834,    0, 1014,25857,17479, 4299,
-14924,    0,21779,    0,14924, 5802,    0,    0,    0,    0,
-    0,    0,10891,    0,    0,    0,    0,    0,    0,21930,
+       0,   794,     0,     0,     0,     0,   411,   412,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   800,     0,     0,     0,     0,   411,   412,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,     0,     0,     0,     0,
+       0,     0,   399,   713,   400,   401,   402,   403,   404,   405,
+       0,   151,   406,   407,   408,   409,   410,     0,     0,     0,
+     152,   153,   714,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   846,     0,     0,   154,   155,
+     411,   412,     0,   156,   157,   158,   159,     0,     0,     0,
+       0,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,     0,   905,     0,     0,     0,     0,   411,   412,
+    -508,  -508,  -508,  -508,  -508,  -508,     0,     0,   406,   407,
+     408,   409,   410,     0,     0,     0,     0,     0,     0,   330,
+     331,   563,     0,   564,     0,     0,     0,     0,     0,     0,
+     179,     0,     0,     0,     0,     0,     0,     0,   411,   412,
+       0,   180,   181,     0,     0,     0,     0,   182,   333,   334,
+     335,     0,     0,   336,     0,   411,   412,   183,   184,     0,
+     151,   185,   186,   187,   188,     0,     0,     0,    92,   152,
+     153,     0,     0,     0,     0,   189,   411,   412,   190,     0,
+       0,     0,     0,     0,     0,     0,     0,   154,   155,     0,
+       0,     0,   156,   157,   158,   159,     0,     0,     0,     0,
+       0,     0,     0,     0,   160,   161,   162,   163,   164,   165,
+     166,     0,   167,   168,   169,     0,     0,   170,   171,   172,
+       0,   173,   174,   175,   176,   177,     0,   178,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,27019,    0,    0,
+     180,   181,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,   411,   412,   330,   331,   332,   183,   184,     0,     0,
+     185,   186,   187,   188,     0,     0,     0,   337,     0,     0,
+       0,     0,   411,   412,   189,     0,     0,   565,     0,   179,
+       0,     0,   333,   334,   335,     0,     0,   336,     0,     0,
+     180,   181,     0,     0,     0,     0,   182,   818,     0,     0,
+       0,     0,     0,     0,     0,   151,   183,   184,     0,     0,
+     185,   186,   187,   188,   152,   153,     0,    92,     0,     0,
+       0,     0,     0,     0,   189,     0,     0,   190,     0,     0,
+       0,     0,   154,   155,     0,   206,     0,   156,   157,   158,
+     159,     0,     0,     0,     0,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,   180,   181,     0,     0,     0,     0,
+       0,     0,     0,   330,   331,     0,     0,     0,     0,     0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+       0,   337,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   338,   333,   334,   335,     0,     0,   336,     0,     0,
+       0,     0,     0,     0,   179,   899,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,   180,   181,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
- 1021, 2185,    0,    0,    0,11727, 9782,10051, 9111, 9262,
- 6322, 6591, 6742, 7011, 7162, 7431, 7582, 4838, 5101, 3696,
-    0,    0,    0,11882, 3866,    0, 7851,    0, 8002,  164,
-  212,    0,    0,    0,    0,    0,    0,    0,    0,    0,
- 1025,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,17632,    0,    0,
-    0,    0,    0,    0,12989,    0,    0,  710,    0,    0,
-    0,  720,    0,    0,    0,15080,    0,    0,    0,14035,
-    0,    0,  795,    0,    0,    0,   16,    0,    0,    0,
-17632,    0,    0,    0, 1012,    0,    0,    0,    0,    0,
-    0,22083,    0,  995,  995,    0,   24,    0,    0,    0,
-    0,    0,    0,  729,    0,    0,    0,    0,13203,  698,
-    0,    0,15293,15449, 5802,15662,22234,13358,11046,11309,
-11464,12096,    0,    0,    0,    0,    0,  730,    0,    0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+       0,   337,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   565,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   179,     0,   532,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,   533,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,   455,
+       0,     0,     0,   456,   457,   458,   459,     0,     0,     0,
+       0,     0,     0,     0,     0,   460,   461,   462,   463,   464,
+     465,   466,     0,   467,   468,   469,     0,     0,   470,   471,
+     472,     0,     0,   473,   474,   475,   476,     0,   477,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,15818,    0,15974,    0,16130,    0,27293,
- 1028,    0,  737,    0, 1030,    0,  738, 2355, 8271, 8422,
- 4129, 8691, 8842,  674,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  742,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,12989,16286,    0,  744,    0,
-    0,  749,16437,    0,  467,  356,  356,  356,  356,  356,
-    0,    0,  356,    0,    0,    0,    0, 1012,    0,    0,
-    0,    0,    0,    0,    0,    0,   24,    0,    0,    0,
-    0,    0,  750,    0,25857,14924,    0,    0,    0,    0,
-    0,  590,    0,    0,    0,    0,    0,    0,  751,    0,
-  768,    0,    0,    0,    0,    0,    0,    0,17848,    0,
-    0,16286,16655,    0,  720,    0,    0,   93,  146,   31,
-   44,    0,    0,    0,18001,    0,22387,    0,    0,    0,
-    0,    0,    0,    0,    0,  777,    0,16806,    0,    0,
-    0,    0,    0,    0,  778,    0,    0,  779,    0,    0,
-    0,16655,    0,    0,    0,    0,    0,22538,    0,    0,
-  783,    0,22691,    0,    0,    0,    0,    0,    0,    0,
-  788,18217,22842, 1031,    0, 1036,
-};
-short fortrangindex[] = {                                      0,
-    0,    0,    0,  813,  303, -401,    0,  126,    0,  211,
- -255,    0,  232,  565,  285,   -2,    0,  -23,    0,    0,
-    0,    0,    0,    0,    0,    0, -120,    7,    0,    0,
- -328,    0,    0,  815, -135,    0, -305,  339, -152,  181,
- -137,    0,  766,  736, -326, -686, -234, -220,    0,  718,
-  221,  438,  371, -189,    0,  -26, -371, -495,    0,    0,
- -169,  -24,  273, -397,    0,  -98,    0,    0, 1117,    0,
-    0,    0,  -39,  -56, 1119,  865,    0,   53,    0,    0,
-    0,    0,    0,    0,    0,    0,   65,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, 1065,  452,  458,  716,    0,    0,    0,  -30,  627,
-    0, -277,    0,    0,    0, -667,    0, -281,  620,    0,
-  654,    0,  194,    0,    0,    0,    0,  608, -649,    0,
-    0,  457,    0,    0,    0, 1032,  612, -392,  613,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0, -230,
-    0,    0,    0,    0,    0,    0,  602,    0,    0,    0,
-    0,    0,  412,  607,    0,  219,    0,    0,    0,    0,
-    0,    0,    0,    0, -408,    0,    0,    0,    0, -317,
-  414, 1033, -335, -688,    0, -522,    0, -226,    0,    0,
-    0,    0,
-};
-#define YYTABLESIZE 27711
-short fortrantable[] = {                                     201,
-  442,  206,  343,  546,  400,  212,  218,  388,  206,  450,
-  440,  592,  522,  569,  226,  440,  147,   99,  531,  342,
-  230,  536,  639,  577,  384,  234,  224,  525,  202,  539,
-  285,  593,  528,  729,   71,  391,  221,  926,  108,  530,
-  595,  383,  202,  191,  249,  250,  535,  191,  597,  595,
-  890,  595,  257,  740,  183,  630,  688,  394,  764,  127,
-  236,  191,  766,  866,  236,  243,  281,  236,  183,  266,
-  267,  268,  133,  133,  133,  133,  888,  324,  259,  589,
-  291,  447,   71,  205,  236,  869,  351,  134,  433,  299,
-  301,  433,  260,  439,  829,  526,  217,  205,  439,  338,
-  214,  322,  704,  338,  309,  321,  338,  420,  326,  421,
-  206,  310,  433,  894,  895,  715,  216,  142,  434,  240,
-  241,  238,  239,  354,  355,  417,  415,  145,  416,  288,
-    9,  417,  362,  246,  317,  131,  131,  131,   89,  453,
-  758,  589,  333,  420,  334,  421,  376,  247,  213,  420,
-  148,  421,  389,  240,  241,  425,  278,  203,  423,  282,
-  240,  241,  701,  392,  213,  402,  227,  399,  402,  761,
-  236,  673,  424,  271,  581,  270,  702,  767,  426,  913,
-  388,  762,  402,  762,  236,  430,  207,  762,  132,  132,
-  132,  741,  210,  343,  435,  721,  888,  384,  937,  436,
-  721,  314,  219,  343,  403,  433,  580,  403,  433,  389,
-  342,  343,  388,  427,  383,  840,  841,  842,  923,  482,
-  342,  403,   30,  579,  516,  859,  253,  254,  342,  628,
-  860,  698,   30,  592,  699,  735,  514,  438,  229,  739,
-  446,  592,  448,  451,  952,  508,  383,  231,  481,  755,
-  589,  333,  404,  334,  236,  404,  714,  592,  213,  524,
-  529,  504,  527,  642,  307,   89,  306,  202,  237,  404,
-  768,  769,  770,  771,  772,  150,  603,  151,  731,  602,
-  517,   99,  543,  244,  543,  248,  191,  127,  551,  240,
-  241,  589,  333,  183,  334,  398,  685,  555,  556,  295,
-  165,  165,  133,  560,  532,  803,  302,  805,  807,  590,
-  591,  572,  573,  574,  575,  134,  251,  261,  442,  486,
-  419,  607,  205,  450,  602,  389,  552,  258,  440,  440,
-  557,  269,  515,  338,  338,  606,  361,  273,  363,  610,
-  611,  612,  613,  614,  615,  616,  617,  618,  619,  620,
-  621,  874,  875,  275,  391,  418,  419,  631,  344,  350,
-  917,  418,  419,  938,  131,  887,  887,  922,  887,  212,
-  588,  590,  591,  760,  589,  333,    2,  334,  646,  647,
-  648,  649,  650,  651,  652,  653,  654,  655,  656,  657,
-  658,  659,  660,  664,  665,  667,  669,  236,  670,  671,
-  279,  202,  232,  296,    3,    4,  303,  284,  581,  233,
-  223,  439,  439,  538,  323,  596,  581,  132,  283,  592,
-  191,    5,    6,  393,  596,  433,  596,  183,  868,  343,
-  288,  290,  592,  592,  592,  592,  592,  853,  883,  897,
-  580,   71,  854,  220,  925,  108,  342,  298,  580,  847,
-  343,  343,  343,  343,  343,  830,  205,  579,  292,  312,
-  832,  440,  697,  327,  328,  579,  440,  342,  342,  342,
-  342,  342,  803,  805,  807,  330,  331,  319,   30,  588,
-  590,  591,  392,  352,  810,  358,  712,  359,  762,  360,
-  719,  877,  720,  716,  364,  365,  383,   30,  383,  383,
-  725,  609,  730,   28,  602,  366,   30,   30,  130,  130,
-  130,  130,    7,  130,  543,  675,  543,  367,  674,  368,
-  543,  590,  591,   30,   30,  369,  370,  721,  721,  721,
-  721,  721,  859,  857,  721,  858,  371,  860,  604,  605,
-  887,  754,  372,  373,  439,    8,  315,  592,  374,  439,
-  555,  759,  375,  555,  377,  438,  448,  623,  624,  625,
-  626,  627,  314,  378,  924,  397,  554,  379,  903,  554,
-  636,  380,  381,  521,  777,  523,  206,  778,  390,  417,
-  415,  398,  416,  533,  882,  589,  333,  394,  334,  401,
-  912,  859,  857,  856,  858,  581,  860,  420,  403,  421,
-  391,  855,  402,  588,  590,  591,   89,  804,  690,  806,
-  808,  689,  389,  429,   30,  431,  817,  694,  343,  819,
-  693,  934,  918,  919,  920,  921,  338,  580,  902,  338,
-  338,  338,  338,  338,  338,  342,  820,  821,  432,  717,
-  480,  822,  520,  823,  579,  757,  810,   30,  756,  338,
-  936,  338,  484,  485,  774,  827,  817,  773,  779,  780,
-  501,  602,  602,  383,  383,  383,  794,  881,  836,  602,
-  482,  487,  417,  415,  795,  416,  796,  602,  797,  602,
-  824,  602,  798,  849,  809,  602,  851,  602,  448,  850,
-  420,  403,  421,  448,  502,  834,  886,  475,  905,  885,
-  907,  900,  939,  693,  511,  773,  506,  475,  518,  543,
-  178,  179,  284,  277,  236,  581,  277,  236,  520,  552,
-  106,  876,  552,  106,  295,  560,  181,  182,  880,  534,
-  183,  184,  185,  186,  302,  537,  865,  475,  130,  475,
-  475,  475,  475,  547,  187,  135,  135,  580,  211,  449,
-  241,  211,  449,  241,  548,  391,  549,  475,  475,  475,
-  246,  135,  135,  246,  579,  135,  135,  135,  135,  486,
-  278,  550,  486,  278,  804,  806,  808,  337,  329,  135,
-  337,  329,  107,  558,  243,  107,  212,  243,  899,  242,
-  483,  335,  242,  483,  335,  404,  405,  406,  407,  408,
-  576,  409,  410,  411,  412,  413,  414,  586,  336,  418,
-  419,  336,  600,  909,  588,  590,  591,  487,  334,  331,
-  487,  334,  331,  333,  632,  712,  333,  915,  332,  634,
-  633,  332,  635,  637,  678,  681,  682,  324,  684,  686,
-  687,  695,  692,  691,  696,  543,  700,  338,  338,  338,
-  338,  338,  705,  338,  338,  338,  338,  338,  338,  707,
-  736,  338,  338,  726,  738,  727,  746,  749,  223,  750,
-  591,  765,  775,  945,  799,  817,  948,  800,  801,  811,
-  812,  818,  826,  392,  825,  831,  833,  317,  404,  405,
-  406,  407,  408,  838,  409,  410,  411,  412,  413,  414,
-  845,  846,  418,  419,  848,  314,  861,  236,  958,  525,
-  314,  314,  950,  314,  863,  960,  864,  236,  867,  871,
-  872,  961,  870,  873,  963,  896,  900,  906,  314,  314,
-  314,  911,  929,  741,  931,  932,  935,  971,  941,  940,
-  942,  972,  943,  944,  973,  974,  956,  949,  955,  959,
-  976,  236,  860,  475,  397,  475,  475,  475,  475,  475,
-  957,  475,  475,  475,  475,  475,  475,  964,  500,  475,
-  475,  966,  475,  967,  475,  925,  108,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  215,  164,  127,  475,  475,
-  209,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  443,  475,  354,
-  475,  475,  475,  475,  475,  562,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  213,  444,  475,  475,  475,  483,  475,  475,
-  475,  325,  475,  475,  475,  317,  118,  475,  354,  475,
-  326,  544,  475,  475,  475,  475,  545,  891,  475,  475,
-  475,  914,  968,  930,  718,  510,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  519,  475,  475,
-  475,  475,  475,  475,  475,  475,  351,  475,  475,  475,
-  475,  889,  475,  475,  475,  594,  351,  629,  828,  643,
-  947,  475,  475,  879,  916,   15,  314,  314,  314,  314,
-  314,  144,  314,  314,  314,  314,  314,  314,  256,  513,
-  314,  314,  835,  351,  676,  965,  733,  351,  351,  351,
-  351,  351,  837,  351,  728,  703,  732,  844,  747,  318,
-  744,  878,  745,  236,  351,  748,  351,  351,  351,  884,
-    0,    0,  348,    0,    0,    0,    0,    0,  236,  236,
-    0,    0,  236,    0,  236,    0,    0,  236,  236,  236,
-  236,  236,  236,  236,    0,    0,  236,  236,  236,    0,
-    0,    0,    0,  236,  236,    0,    0,    0,  236,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,  236,    0,
-    0,    0,  236,  236,    0,    0,    0,  236,    0,    0,
-    0,    0,    0,  236,    0,  236,  236,    0,  236,    0,
-  236,  236,  236,  236,  236,    0,  236,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,    0,    0,  236,  236,  236,    0,  236,  236,
-  236,    0,  236,  236,  236,    0,  314,  236,    0,  236,
-    0,    0,  236,  236,  236,  236,  314,    0,  236,  236,
-  236,    0,    0,    0,    0,    0,  236,    0,    0,  236,
-  236,  236,  236,  236,  236,  236,  236,    0,  236,  236,
-  236,  236,  236,  314,    0,  236,    0,  314,  314,  314,
-  314,  314,  236,  236,  236,    0,    0,    0,    0,    0,
-    0,  236,  236,    0,  314,    0,  314,  314,  314,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  351,    0,  351,  351,  351,  351,  351,    0,
-  351,  351,  351,  351,  351,  351,    0,  351,  351,  351,
-    0,  351,    0,  351,    0,    0,  351,  351,  351,  351,
-  351,  351,  351,    0,    0,  351,  351,  351,    0,    0,
-    0,    0,  351,  351,    0,    0,    0,  351,  351,    0,
-    0,    0,    0,    0,    0,    0,    0,  351,    0,    0,
-    0,  351,  351,    0,    0,    0,  351,    0,    0,    0,
-    0,    0,  351,    0,  351,  351,    0,  351,    0,  351,
-  351,  351,  351,  351,    0,  351,  351,  351,  351,  351,
-  351,  351,  351,  351,  351,  351,  351,  351,  351,  351,
-  351,    0,  578,  351,  351,  351,    0,  351,  351,  351,
-    0,  351,  351,  351,    0,    0,  351,    0,  351,    0,
-    0,  351,  351,  351,  351,  204,  351,  351,  351,  351,
-    0,    0,    0,    0,    0,  351,    0,    0,  351,  351,
-  351,  351,  351,  351,  351,  351,    0,  351,  351,  351,
-  351,  351,    0,    0,  351,  188,    0,    0,  150,    0,
-  151,  351,  351,  351,    0,    0,    0,    0,    0,    0,
-  351,  351,  314,    0,  314,  314,  314,  314,  314,    0,
-  314,  314,  314,  314,  314,  314,    0,  314,  314,  314,
-    0,  314,    0,  314,    0,    0,  314,  314,  314,  314,
-  314,  314,  314,    0,    0,  314,  314,  314,    0,    0,
-    0,    0,  314,  314,    0,    0,    0,  314,  314,    0,
-    0,    0,    0,    0,    0,    0,    0,  314,    0,    0,
-    0,  314,  314,    0,    0,    0,  314,    0,    0,    0,
-    0,    0,  314,    0,  314,  314,    0,  314,    0,  314,
-  314,  314,  314,  314,    0,  314,  314,  314,  314,  314,
-  314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
-  314,    0,    0,  314,  314,  314,    0,  314,  314,  314,
-    0,  314,  314,  314,    0,  318,  314,    0,  314,    0,
-    0,  314,  314,  314,  314,  318,  314,  314,  314,  314,
-    0,    0,    0,    0,    0,  314,    0,    0,  314,  314,
-  314,  314,  314,  314,  314,  314,    0,  314,  314,  314,
-  314,  314,  318,    0,  314,    0,  318,  318,  318,  318,
-  318,  314,  314,  314,    0,    0,    0,    0,    0,    0,
-  314,  314,    0,  318,    0,  318,  318,  318,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,    0,  176,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,  315,    0,    0,  180,    0,
-    0,    0,    0,    0,    0,  315,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,    0,    0,   89,
-    0,    0,    0,    0,    0,    0,  187,    0,    0,    0,
-    0,    0,  315,    0,  177,    0,  315,  315,  315,  315,
-  315,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,  315,    0,  315,  315,  315,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,  318,    0,  318,  318,  318,  318,  318,    0,  318,
-  318,  318,  318,  318,  318,    0,  318,  318,  318,    0,
-  318,    0,  318,    0,    0,  318,  318,  318,  318,  318,
-  318,  318,    0,    0,  318,  318,  318,    0,    0,    0,
-    0,  318,  318,    0,    0,    0,  318,  318,    0,    0,
-    0,    0,    0,    0,    0,    0,  318,    0,    0,    0,
-  318,  318,    0,    0,    0,  318,    0,    0,    0,    0,
-    0,  318,    0,  318,  318,    0,  318,    0,  318,  318,
-  318,  318,  318,    0,  318,  318,  318,  318,  318,  318,
-  318,  318,  318,  318,  318,  318,  318,  318,  318,  318,
-    0,    0,  318,  318,  318,    0,  318,  318,  318,    0,
-  318,  318,  318,    0,    0,  318,    0,  318,    0,    0,
-  318,  318,  318,  318,    0,  318,  318,  318,  318,    0,
-    0,    0,    0,    0,  318,    0,    0,  318,  318,  318,
-  318,  318,  318,  318,  318,    0,  318,  318,  318,  318,
-  318,  188,    0,  318,  150,    0,  151,    0,    0,    0,
-  318,  318,  318,    0,    0,    0,    0,    0,    0,  318,
-  318,  315,  661,  315,  315,  315,  315,  315,    0,  315,
-  315,  315,  315,  315,  315,    0,  315,  315,  315,    0,
-  315,    0,  315,    0,    0,  315,  315,  315,  315,  315,
-  315,  315,    0,    0,  315,  315,  315,    0,    0,    0,
-    0,  315,  315,    0,    0,    0,  315,  315,    0,    0,
-    0,    0,  417,  415,    0,  416,  315,    0,    0,    0,
-  315,  315,    0,    0,    0,  315,    0,    0,    0,    0,
-  420,  315,  421,  315,  315,    0,  315,    0,  315,  315,
-  315,  315,  315,    0,  315,  315,  315,  315,  315,  315,
-  315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-    0,    0,  315,  315,  315,    0,  315,  315,  315,    0,
-  315,  315,  315,    0,  323,  315,    0,  315,    0,    0,
-  315,  315,  315,  315,  323,  315,  315,  315,  315,    0,
-    0,    0,    0,    0,  315,    0,  488,  315,  315,  315,
-  315,  315,  315,  315,  315,    0,  315,  315,  315,  315,
-  315,    0,    0,  315,  323,  323,  323,  323,  323,  323,
-  315,  315,  315,    0,    0,    0,    0,    0,    0,  315,
-  315,    0,  323,    0,  323,  323,  323,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  253,  254,  489,
-    0,    0,    0,    0,    0,    0,    0,  417,  415,    0,
-  416,    0,    0,    0,  149,    0,    0,    0,    0,    0,
-    0,    0,    0,  662,    0,  420,  490,  421,  491,  492,
-  493,    0,    0,  494,  495,    0,  496,  497,  152,  153,
-    0,    0,    0,  154,  155,  156,  157,    0,    0,    0,
-    0,    0,    0,    0,    0,  158,  159,  160,  161,  162,
-  163,  164,    0,  165,  166,  167,    0,    0,  168,  169,
-  170,    0,  171,  172,  173,  174,  175,    0,  176,    0,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  320,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  320,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  177,  320,    0,    0,    0,  320,  320,  320,  320,  320,
-    0,  178,  179,    0,    0,    0,    0,  180,    0,    0,
-    0,    0,  320,    0,  320,  320,  320,  181,  182,    0,
-    0,  183,  184,  185,  186,    0,    0,    0,   89,    0,
-    0,    0,    0,    0,    0,  187,    0,    0,    0,    0,
-  323,    0,  323,  323,  323,  323,  323,    0,  323,  323,
-  323,  323,  323,  323,    0,  323,  323,  323,    0,  323,
-    0,  323,    0,    0,  323,  323,  323,  323,  323,  323,
-  323,    0,    0,  323,  323,  323,    0,    0,    0,    0,
-  323,  323,    0,    0,    0,  323,  323,  408,    0,  409,
-  410,  411,  412,  413,  414,  323,    0,  418,  419,  323,
-  323,    0,    0,    0,  323,    0,    0,    0,    0,    0,
-  323,    0,  323,  323,    0,  323,    0,  323,  323,  323,
-  323,  323,    0,  323,  323,  323,  323,  323,  323,  323,
-  323,  323,  323,  323,  323,  323,  323,  323,  323,    0,
-  578,  323,  323,  323,    0,  323,  323,  323,    0,  323,
-  323,  323,    0,    0,  323,    0,  323,    0,    0,  323,
-  323,  323,  323,    0,  323,  323,  323,  323,    0,    0,
-    0,    0,    0,  323,    0,    0,  323,  323,  323,  323,
-  323,  323,  323,  323,    0,  323,  323,  323,  323,  323,
-    0,    0,  323,  188,    0,  709,  150,    0,  151,  323,
-  323,  323,    0,    0,    0,    0,    0,    0,  323,  323,
-  320,  708,  320,  320,  320,  320,  320,    0,  320,  320,
-  320,  320,  320,  320,    0,  320,  320,  320,    0,  320,
-    0,  320,    0,    0,  320,  320,  320,  320,  320,  320,
-  320,    0,    0,  320,  320,  320,    0,    0,    0,    0,
-  320,  320,    0,    0,    0,  320,  320,    0,    0,    0,
-    0,    0,    0,    0,    0,  320,    0,    0,    0,  320,
-  320,    0,    0,    0,  320,    0,    0,    0,    0,    0,
-  320,    0,  320,  320,    0,  320,    0,  320,  320,  320,
-  320,  320,    0,  320,  320,  320,  320,  320,  320,  320,
-  320,  320,  320,  320,  320,  320,  320,  320,  320,    0,
-    0,  320,  320,  320,    0,  320,  320,  320,    0,  320,
-  320,  320,    0,  280,  320,    0,  320,    0,    0,  320,
-  320,  320,  320,  280,  320,  320,  320,  320,    0,    0,
-    0,    0,    0,  320,    0,    0,  320,  320,  320,  320,
-  320,  320,  320,  320,    0,  320,  320,  320,  320,  320,
-  280,    0,  320,    0,  280,  280,  280,  280,  280,  320,
-  320,  320,    0,    0,    0,    0,    0,    0,  320,  320,
-    0,  280,    0,  280,  280,  280,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,    0,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,    0,  165,  166,  167,    0,  149,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,    0,  176,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  152,  153,    0,    0,    0,  154,  155,  156,  157,    0,
-    0,    0,    0,    0,    0,    0,    0,  158,  159,  160,
-  161,  162,  163,  164,    0,  165,  166,  167,    0,    0,
-  168,  169,  170,    0,  171,  172,  173,  174,  175,    0,
-  176,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,  279,    0,    0,  180,    0,    0,    0,
-    0,    0,    0,  279,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,    0,    0,  892,    0,    0,
-    0,    0,    0,    0,  187,    0,    0,    0,    0,    0,
-    0,    0,  177,    0,  279,  279,  279,  279,  279,    0,
-    0,    0,    0,  178,  179,    0,    0,    0,    0,  180,
-    0,  279,    0,  279,  279,  279,    0,    0,    0,  181,
-  182,    0,    0,  183,  184,  185,  186,    0,    0,    0,
-   89,    0,    0,    0,    0,    0,    0,  187,    0,  280,
-    0,  280,  280,  280,  280,  280,    0,  280,  280,  280,
-  280,  280,  280,    0,  280,  280,  280,    0,  280,    0,
-  280,    0,    0,  280,  280,  280,  280,  280,  280,  280,
-    0,    0,  280,  280,  280,    0,    0,    0,    0,  280,
-  280,    0,    0,    0,  280,  280,    0,    0,    0,    0,
-    0,    0,    0,    0,  280,    0,    0,    0,  280,  280,
-    0,    0,    0,  280,    0,    0,    0,    0,    0,  280,
-    0,  280,  280,    0,  280,    0,  280,  280,  280,  280,
-  280,    0,  280,  280,  280,  280,  280,  280,  280,  280,
-  280,  280,  280,  280,  280,  280,  280,  280,    0,    0,
-  280,  280,  280,    0,  280,  280,  280,    0,  280,  280,
-  280,    0,    0,  280,    0,  280,    0,    0,  280,  280,
-  280,  280,    0,  280,  280,  280,  280,    0,    0,    0,
-    0,    0,  280,    0,    0,  280,  280,  280,  280,  280,
-  280,  280,  280,    0,  280,  280,  280,  280,  280,    0,
-    0,  280,  188,    0,  540,  150,    0,  151,  280,  280,
-    0,    0,    0,    0,    0,    0,    0,  280,  280,  279,
-    0,  279,  279,  279,  279,  279,    0,  279,  279,  279,
-  279,  279,  279,    0,  279,  279,  279,    0,  279,    0,
-  279,    0,    0,  279,  279,  279,  279,  279,  279,  279,
-    0,    0,  279,  279,  279,    0,    0,    0,    0,  279,
-  279,    0,    0,    0,  279,  279,    0,    0,  417,  415,
-    0,  416,    0,    0,  279,    0,    0,    0,  279,  279,
-    0,    0,    0,  279,    0,    0,  420,    0,  421,  279,
-    0,  279,  279,    0,  279,    0,  279,  279,  279,  279,
-  279,    0,  279,  279,  279,  279,  279,  279,  279,  279,
-  279,  279,  279,  279,  279,  279,  279,  279,    0,    0,
-  279,  279,  279,    0,  279,  279,  279,    0,  279,  279,
-  279,    0,  538,  279,    0,  279,    0,    0,  279,  279,
-  279,  279,  538,  279,  279,  279,  279,    0,    0,    0,
-    0,    0,  279,    0,    0,  279,  279,  279,  279,  279,
-  279,  279,  279,    0,  279,  279,  279,  279,  279,    0,
-    0,  279,    0,  250,  250,  250,  538,  250,  279,  279,
-  279,    0,    0,    0,    0,    0,    0,  279,  279,    0,
-    0,    0,  250,  250,  250,    0,    0,  454,    0,    0,
-    0,  455,  456,  457,  458,    0,    0,    0,    0,    0,
-    0,    0,    0,  459,  460,  461,  462,  463,  464,  465,
-    0,  466,  467,  468,    0,  149,  469,  470,  471,    0,
-    0,  472,  473,  474,  475,    0,  476,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,    0,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,  283,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  283,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  477,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  283,
-    0,  177,    0,  283,  283,  283,  283,  283,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-  283,    0,    0,  283,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,    0,    0,  541,
-    0,    0,    0,    0,    0,    0,  187,    0,  538,    0,
-  250,  250,  250,  250,  250,    0,  250,  250,  250,  250,
-  250,  250,    0,    0,  250,  250,    0,  538,    0,  538,
-    0,    0,  538,  538,  538,  538,  538,  538,  538,    0,
-    0,  538,  538,  538,    0,    0,    0,    0,  538,  538,
-    0,    0,    0,  538,  538,    0,    0,    0,    0,    0,
-    0,    0,    0,  538,    0,    0,    0,  538,  538,    0,
-    0,    0,  538,    0,    0,    0,    0,    0,  538,    0,
-  538,  538,    0,  538,    0,  538,  538,  538,  538,  538,
-    0,  538,  538,  538,  538,  538,  538,  538,  538,  538,
-  538,  538,  538,  538,  538,  538,  538,    0,    0,  538,
-  538,  538,    0,  538,  538,  538,    0,  538,  538,  538,
-    0,    0,  538,    0,  538,    0,    0,  538,  538,  538,
-  538,    0,  538,  538,  538,  538,    0,    0,    0,    0,
-    0,  538,    0,    0,  538,  538,  538,  538,  538,  538,
-  538,  538,    0,  538,  538,  538,  538,  538,    0,    0,
-  538,    0,    0,    0,    0,    0,    0,  538,  538,  538,
-    0,    0,    0,    0,    0,    0,  538,  538,  283,    0,
-  283,  283,  283,  283,  283,  289,  283,  283,  283,  283,
-  283,  283,    0,  283,  283,  289,    0,  283,    0,  283,
-    0,    0,  283,  283,  283,  283,  283,  283,  283,    0,
-    0,  283,  283,  283,    0,    0,    0,    0,  283,  283,
-    0,    0,  289,  283,  283,    0,  289,  289,  289,  289,
-  289,    0,    0,  283,    0,    0,    0,  283,  283,    0,
-    0,    0,  283,  289,    0,    0,  289,    0,  283,    0,
-  283,  283,    0,  283,    0,  283,  283,  283,  283,  283,
-    0,  283,  283,  283,  283,  283,  283,  283,  283,  283,
-  283,  283,  283,  283,  283,  283,  283,    0,    0,  283,
-  283,  283,    0,  283,  283,  283,    0,  283,  283,  283,
-    0,    0,  283,    0,  283,    0,    0,  283,  283,  283,
-  283,    0,  283,  283,  283,  283,    0,    0,    0,    0,
-    0,  283,    0,    0,  283,  283,  283,  283,  283,  283,
-  283,  283,    0,  283,  283,  283,  283,  283,    0,    0,
-  283,    0,    0,    0,    0,    0,    0,  283,  283,  283,
-    0,    0,    0,    0,    0,    0,  283,  283,    0,    0,
-    0,    0,    0,    0,  108,  290,    0,    0,  108,  108,
-  108,  108,    0,    0,    0,  290,    0,    0,    0,    0,
-  108,  108,  108,  108,  108,  108,  108,    0,  108,  108,
-  108,    0,    0,  108,  108,  108,    0,    0,  108,  108,
-  108,  108,  290,  108,    0,    0,  290,  290,  290,  290,
-  290,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  290,    0,    0,  290,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  289,    0,  289,  289,  289,  289,  289,    0,  289,
-  289,  289,  289,  289,  289,    0,  289,  289,    0,    0,
-  289,    0,  289,    0,    0,  289,  289,  289,  289,  289,
-  289,  289,    0,    0,  289,  289,  289,    0,    0,    0,
-    0,  289,  289,  108,    0,    0,  289,  289,    0,    0,
-    0,    0,    0,    0,    0,    0,  289,    0,    0,    0,
-  289,  289,    0,    0,    0,  289,    0,    0,    0,    0,
-    0,  289,    0,  289,  289,    0,  289,    0,  289,  289,
-  289,  289,  289,    0,  289,  289,  289,  289,  289,  289,
-  289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
-    0,    0,  289,  289,  289,    0,  289,  289,  289,    0,
-  289,  289,  289,    0,    0,  289,    0,  289,    0,    0,
-  289,  289,  289,  289,    0,  289,  289,  289,  289,    0,
-    0,    0,    0,    0,  289,    0,    0,  289,  289,  289,
-  289,  289,  289,  289,  289,    0,  289,  289,  289,  289,
-  289,    0,    0,  289,    0,    0,    0,    0,    0,    0,
-  289,  289,  289,    0,    0,    0,    0,    0,    0,  289,
-  289,  290,    0,  290,  290,  290,  290,  290,  311,  290,
-  290,  290,  290,  290,  290,    0,  290,  290,  311,    0,
-  290,    0,  290,    0,    0,  290,  290,  290,  290,  290,
-  290,  290,    0,    0,  290,  290,  290,    0,    0,    0,
-    0,  290,  290,    0,    0,  311,  290,  290,    0,  311,
-  311,  311,  311,  311,    0,    0,  290,    0,    0,    0,
-  290,  290,    0,    0,    0,  290,  311,    0,    0,  311,
-    0,  290,    0,  290,  290,    0,  290,    0,  290,  290,
-  290,  290,  290,    0,  290,  290,  290,  290,  290,  290,
-  290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
-    0,    0,  290,  290,  290,    0,  290,  290,  290,    0,
-  290,  290,  290,    0,    0,  290,    0,  290,    0,    0,
-  290,  290,  290,  290,    0,  290,  290,  290,  290,    0,
-    0,    0,    0,    0,  290,    0,    0,  290,  290,  290,
-  290,  290,  290,  290,  290,    0,  290,  290,  290,  290,
-  290,    0,    0,  290,    0,    0,    0,    0,    0,    0,
-  290,  290,  290,    0,   20,    0,    0,    0,    0,  290,
-  290,    0,    0,    0,    0,    0,    0,    0,  519,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  519,   26,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,   30,    0,    0,    0,    0,   33,
-  314,    0,    0,    0,   37,   38,    0,    0,    0,  519,
-  519,  519,  519,  519,  315,   47,   48,   49,   50,   51,
-   52,  316,    0,    0,    0,    0,    0,    0,  519,  519,
-  519,    0,    0,    0,   62,    0,    0,    0,    0,    0,
-   65,    0,    0,    0,    0,    0,    0,    0,    0,   70,
-    0,   72,    0,    0,  311,    0,  311,  311,  311,  311,
-  311,    0,  311,  311,  311,  311,  311,  311,    0,  311,
-  311,    0,    0,  311,    0,  311,    0,    0,  311,  311,
-  311,  311,  311,  311,  311,   89,    0,  311,  311,  311,
-    0,    0,   90,    0,  311,  311,    0,    0,    0,  311,
-  311,    0,    0,    0,    0,    0,    0,    0,    0,  311,
-    0,    0,    0,  311,  311,    0,    0,    0,  311,    0,
-    0,    0,    0,    0,  311,    0,  311,  311,    0,  311,
-    0,  311,  311,  311,  311,  311,    0,  311,  311,  311,
-  311,  311,  311,  311,  311,  311,  311,  311,  311,  311,
-  311,  311,  311,    0,    0,  311,  311,  311,    0,  311,
-  311,  311,    0,  311,  311,  311,    0,    0,  311,    0,
-  311,    0,    0,  311,  311,  311,  311,    0,  311,  311,
-  311,  311,    0,    0,    0,    0,    0,  311,    0,    0,
-  311,  311,  311,  311,  311,  311,  311,  311,    0,  311,
-  311,  311,  311,  311,    0,    0,  311,  188,    0,  559,
-  150,    0,  151,  311,  311,  311,    0,    0,    0,    0,
-    0,    0,  311,  311,  519,    0,  519,  519,  519,  519,
-  519,    0,  519,  519,  519,  519,  519,  519,    0,    0,
-  519,  519,    0,  519,    0,  519,    0,    0,  519,  519,
-  519,  519,  519,  519,  519,    0,    0,  519,  519,  519,
-    0,    0,    0,    0,  519,  519,    0,    0,    0,  519,
-  519,    0,    0,    0,    0,    0,    0,    0,    0,  519,
-    0,    0,    0,  519,  519,    0,    0,    0,  519,    0,
-    0,    0,    0,    0,  519,    0,  519,  519,    0,  519,
-    0,  519,  519,  519,  519,  519,    0,  519,  519,  519,
-  519,  519,  519,  519,  519,  519,  519,  519,  519,  519,
-  519,  519,  519,    0,    0,  519,  519,  519,    0,  519,
-  519,  519,    0,  519,  519,  519,    0,  528,  519,    0,
-  519,    0,    0,  519,  519,  519,  519,  528,    0,  519,
-  519,  519,    0,    0,    0,    0,    0,  519,    0,    0,
-  519,  519,  519,  519,  519,  519,  519,  519,    0,  519,
-  519,  519,  519,  519,    0,    0,  519,    0,    0,  247,
-  247,    0,  247,  519,  519,  519,    0,    0,    0,    0,
-    0,    0,  519,  519,    0,    0,    0,  247,  247,  247,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  149,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  287,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  287,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  287,    0,  177,    0,  287,    0,
-  287,  287,  287,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,  287,    0,    0,  287,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,    0,   89,    0,    0,    0,    0,    0,
-    0,  187,    0,  528,    0,  247,  247,  247,  247,  247,
-    0,  247,  247,  247,  247,  247,  247,    0,    0,  247,
-  247,    0,  528,    0,  528,    0,    0,  528,  528,  528,
-  528,  528,  528,  528,    0,    0,  528,  528,  528,    0,
-    0,    0,    0,  528,  528,    0,    0,    0,  528,  528,
-    0,    0,    0,    0,    0,    0,    0,    0,  528,    0,
-    0,    0,  528,  528,    0,    0,    0,  528,    0,    0,
-    0,    0,    0,  528,    0,  528,  528,    0,  528,    0,
-  528,  528,  528,  528,  528,    0,  528,  528,  528,  528,
-  528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-  528,  528,    0,    0,  528,  528,  528,    0,  528,  528,
-  528,    0,  528,  528,  528,    0,    0,  528,    0,  528,
-    0,    0,  528,  528,  528,  528,    0,  528,  528,  528,
-  528,    0,    0,    0,    0,    0,  528,    0,    0,  528,
-  528,  528,  528,  528,  528,  528,  528,    0,  528,  528,
-  528,  528,  528,    0,    0,  528,    0,    0,    0,    0,
-    0,    0,  528,  528,  528,    0,    0,    0,    0,    0,
-    0,  528,  528,  287,    0,  287,  287,  287,  287,  287,
-  288,  287,  287,  287,  287,  287,  287,    0,  287,    0,
-  288,    0,  287,    0,  287,    0,    0,  287,  287,  287,
-  287,  287,  287,  287,    0,    0,  287,  287,  287,    0,
-    0,    0,    0,  287,  287,    0,    0,  288,  287,  287,
-    0,  288,    0,  288,  288,  288,    0,    0,  287,    0,
-    0,    0,  287,  287,    0,    0,    0,  287,  288,    0,
-    0,  288,    0,  287,    0,  287,  287,    0,  287,    0,
-  287,  287,  287,  287,  287,    0,  287,  287,  287,  287,
-  287,  287,  287,  287,  287,  287,  287,  287,  287,  287,
-  287,  287,    0,    0,  287,  287,  287,    0,  287,  287,
-  287,    0,  287,  287,  287,    0,    0,  287,    0,  287,
-    0,    0,  287,  287,  287,  287,    0,  287,  287,  287,
-  287,    0,    0,    0,    0,    0,  287,    0,    0,  287,
-  287,  287,  287,  287,  287,  287,  287,    0,  287,  287,
-  287,  287,  287,    0,    0,  287,    0,    0,    0,    0,
-    0,    0,  287,  287,  287,    0,    0,    0,    0,    0,
-    0,  287,  287,    0,    0,    0,    0,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  308,    0,    0,
-    0,  308,  308,    0,  308,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  308,    0,
-  308,    0,  308,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  288,    0,  288,  288,
-  288,  288,  288,    0,  288,  288,  288,  288,  288,  288,
-    0,  288,    0,    0,    0,  288,    0,  288,    0,    0,
-  288,  288,  288,  288,  288,  288,  288,    0,    0,  288,
-  288,  288,    0,    0,    0,    0,  288,  288,    0,    0,
-    0,  288,  288,    0,    0,    0,    0,    0,    0,    0,
-    0,  288,    0,    0,    0,  288,  288,    0,    0,    0,
-  288,    0,    0,    0,    0,    0,  288,    0,  288,  288,
-    0,  288,   22,  288,  288,  288,  288,  288,    0,  288,
-  288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
-  288,  288,  288,  288,  288,    0,    0,  288,  288,  288,
-    0,  288,  288,  288,    0,  288,  288,  288,    0,    0,
-  288,    0,  288,    0,    0,  288,  288,  288,  288,    0,
-  288,  288,  288,  288,    0,    0,    0,    0,    0,  288,
-    0,    0,  288,  288,  288,  288,  288,  288,  288,  288,
-    0,  288,  288,  288,  288,  288,    0,    0,  288,    0,
-    0,    0,    0,    0,    0,  288,  288,  288,    0,    0,
-    0,    0,    0,    0,  288,  288,  308,    0,  308,  308,
-  308,  308,  308,    0,  308,  308,  308,  308,  308,  308,
-    0,  308,    0,  308,    0,  308,    0,  308,    0,    0,
-  308,  308,  308,  308,  308,  308,  308,    0,    0,  308,
-  308,  308,    0,    0,    0,    0,  308,  308,    0,    0,
-    0,  308,  308,    0,    0,    0,    0,    0,    0,    0,
-    0,  308,    0,    0,    0,  308,  308,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,  308,    0,  308,  308,
-    0,  308,    0,  308,  308,  308,  308,  308,    0,  308,
-  308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-  308,  308,  308,  308,  308,    0,    0,  308,  308,  308,
-    0,  308,  308,  308,    0,  308,  308,  308,    0,  466,
-  308,    0,  308,    0,    0,  308,  308,  308,  308,  466,
-  308,  308,  308,  308,  338,    0,    0,    0,  338,  308,
-    0,  338,  308,  308,  308,  308,    0,  308,  308,  308,
-    0,  308,  308,  308,  308,  308,    0,  338,  308,  338,
-    0,  518,  518,  518,  518,  308,  308,    0,    0,    0,
-    0,    0,    0,    0,    0,  308,    0,    0,    0,  518,
-  518,  518,    0,    0,    0,    0,    0,   22,    0,   22,
-    0,    0,   22,   22,   22,   22,    0,    0,   22,    0,
-    0,   22,   22,   22,    0,    0,    0,    0,   22,   22,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   22,    0,    0,    0,   22,   22,    0,
-    0,    0,   22,    0,    0,    0,    0,    0,   22,    0,
-   22,   22,    0,   22,    0,   22,   22,   22,   22,   22,
-    0,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-   22,   22,   22,   22,   22,   22,   22,    0,    0,   22,
-   22,   22,    0,   22,   22,   22,    0,   22,   22,   22,
-    0,  518,   22,    0,   22,    0,    0,   22,   22,   22,
-   22,  518,    0,   22,   22,   22,    0,    0,    0,    0,
-    0,   22,    0,    0,    0,   22,   22,   22,   22,   22,
-   22,   22,    0,   22,   22,   22,   22,   22,    0,    0,
-   22,    0,    0,  518,  518,  518,  518,   22,   22,   22,
-    0,    0,    0,    0,    0,    0,   22,    0,    0,    0,
-    0,  518,  518,  518,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  338,  338,  338,  338,  338,
-    0,  338,  338,  338,  338,  338,  338,    0,    0,  338,
-  338,    0,    0,    0,    0,  466,    0,  518,  518,  518,
-  518,  518,    0,  518,  518,  518,  518,  518,  518,    0,
-    0,  518,  518,    0,  466,    0,  466,    0,    0,  466,
-  466,  466,  466,  466,  466,  466,    0,    0,  466,  466,
-  466,    0,    0,    0,    0,  466,  466,    0,    0,    0,
-  466,  466,    0,    0,    0,    0,    0,    0,    0,    0,
-  466,    0,   56,    0,  466,  466,    0,    0,    0,  466,
-    0,    0,   56,    0,    0,  466,    0,  466,  466,    0,
-  466,    0,  466,  466,  466,  466,  466,    0,  466,  466,
-  466,  466,  466,  466,  466,  466,  466,  466,  466,  466,
-  466,  466,  466,  466,    0,    0,  466,  466,  466,    0,
-  466,  466,  466,    0,  466,  466,  466,    0,    0,  466,
-    0,  466,    0,    0,  466,  466,  466,  466,    0,    0,
-  466,  466,  466,    0,    0,    0,    0,    0,  466,    0,
-    0,  466,  466,  466,  466,    0,  466,  466,  466,    0,
-  466,  466,  466,  466,  466,    0,    0,  466,    0,    0,
-    0,    0,    0,    0,  466,  466,    0,  518,    0,  518,
-  518,  518,  518,  518,  466,  518,  518,  518,  518,  518,
-  518,    0,    0,  518,  518,    0,  518,    0,  518,    0,
-    0,  518,  518,  518,  518,  518,  518,  518,    0,    0,
-  518,  518,  518,    0,    0,    0,    0,  518,  518,    0,
-    0,    0,  518,  518,    0,    0,    0,    0,    0,    0,
-    0,    0,  518,    0,    0,    0,  518,  518,    0,    0,
-    0,  518,    0,    0,    0,    0,    0,  518,    0,  518,
-  518,    0,  518,    0,  518,  518,  518,  518,  518,    0,
-  518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
-  518,  518,  518,  518,  518,  518,    0,    0,  518,  518,
-  518,    0,  518,  518,  518,    0,  518,  518,  518,    0,
-  284,  518,    0,  518,    0,    0,  518,  518,  518,  518,
-  284,    0,  518,  518,  518,    0,    0,    0,    0,    0,
-  518,    0,    0,  518,  518,  518,  518,    0,  518,  518,
-  518,    0,  518,  518,  518,  518,  518,  284,   56,  518,
-    0,  284,    0,    0,  284,    0,  518,  518,    0,    0,
-    0,    0,    0,  164,  164,    0,  518,   56,  284,   56,
-    0,  284,   56,   56,   56,   56,   56,   56,   56,    0,
-    0,   56,   56,   56,    0,    0,    0,    0,   56,   56,
-    0,    0,    0,   56,   56,    0,    0,    0,    0,    0,
-    0,    0,    0,   56,    0,    0,    0,   56,   56,    0,
-    0,    0,   56,    0,    0,    0,    0,    0,   56,    0,
-   56,   56,    0,   56,    0,   56,   56,   56,   56,   56,
-    0,   56,   56,   56,   56,   56,   56,   56,   56,   56,
-   56,   56,   56,   56,   56,   56,   56,    0,    0,   56,
-   56,   56,    0,   56,   56,   56,    0,   56,   56,   56,
-    0,  305,   56,    0,   56,    0,    0,   56,   56,   56,
-   56,  305,    0,   56,   56,   56,    0,    0,    0,    0,
-    0,   56,    0,    0,   56,   56,   56,   56,   56,   56,
-   56,   56,    0,   56,   56,   56,   56,   56,  305,    0,
-   56,    0,  305,    0,    0,  305,    0,   56,   56,   56,
-    0,    0,    0,    0,    0,    0,   56,   56,    0,  305,
-    0,    0,  305,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  284,    0,  284,  284,
-  284,  284,  284,    0,    0,    0,    0,    0,    0,    0,
-    0,  284,    0,    0,    0,  284,    0,  284,    0,    0,
-  284,  284,  284,  284,  284,  284,  284,    0,    0,  284,
-  284,  284,    0,    0,    0,    0,  284,  284,    0,    0,
-    0,  284,  284,    0,    0,    0,    0,    0,    0,    0,
-    0,  284,    0,    0,    0,  284,  284,    0,    0,    0,
-  284,    0,    0,    0,    0,    0,  284,    0,  284,  284,
-    0,  284,    0,  284,  284,  284,  284,  284,    0,  284,
-  284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
-  284,  284,  284,  284,  284,    0,    0,  284,  284,  284,
-    0,  284,  284,  284,    0,  284,  284,  284,  341,  341,
-  284,  341,  284,    0,    0,  284,  284,  284,  284,    0,
-  284,  284,  284,  284,    0,    0,  341,  341,  341,  284,
-    0,    0,  284,  284,  284,  284,  284,  284,  284,  284,
-    0,  284,  284,  284,  284,  284,    0,  305,  284,  305,
-  305,  305,  305,  305,    0,  284,  284,  284,    0,    0,
-  295,    0,  305,    0,  284,  284,  305,    0,  305,    0,
-  295,  305,  305,  305,  305,  305,  305,  305,    0,    0,
-  305,  305,  305,    0,    0,    0,    0,  305,  305,    0,
-    0,    0,  305,  305,    0,    0,    0,  295,    0,    0,
-    0,  295,  305,    0,  295,    0,  305,  305,    0,    0,
-    0,  305,    0,    0,    0,    0,    0,  305,  295,  305,
-  305,  295,  305,    0,  305,  305,  305,  305,  305,    0,
-  305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
-  305,  305,  305,  305,  305,  305,    0,    0,  305,  305,
-  305,    0,  305,  305,  305,    0,  305,  305,  305,    0,
-    0,  305,    0,  305,    0,    0,  305,  305,  305,  305,
-    0,  305,  305,  305,  305,    0,    0,    0,    0,    0,
-  305,    0,    0,  305,  305,  305,  305,  305,  305,  305,
-  305,    0,  305,  305,  305,  305,  305,    0,    0,  305,
-    0,    0,    0,    0,    0,    0,  305,  305,  305,    0,
-    0,  293,    0,    0,    0,  305,  305,    0,    0,    0,
-    0,  293,    0,    0,  341,  341,  341,  341,  341,    0,
-  341,  341,  341,  341,  341,  341,    0,    0,  341,  341,
-    0,    0,    0,    0,    0,    0,    0,    0,  293,    0,
-    0,    0,  293,    0,    0,  293,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  293,
-    0,    0,  293,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  295,    0,  295,  295,
-  295,  295,  295,    0,    0,    0,    0,    0,    0,    0,
-    0,  295,    0,    0,    0,  295,    0,  295,    0,    0,
-  295,  295,  295,  295,  295,  295,  295,    0,    0,  295,
-  295,  295,    0,    0,    0,    0,  295,  295,    0,    0,
-    0,  295,  295,    0,    0,    0,    0,    0,    0,    0,
-    0,  295,    0,    0,    0,  295,  295,    0,    0,    0,
-  295,    0,    0,  341,    0,    0,  295,    0,  295,  295,
-    0,  295,    0,  295,  295,  295,  295,  295,    0,  295,
-  295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
-  295,  295,  295,  295,  295,    0,    0,  295,  295,  295,
-    0,  295,  295,  295,    0,  295,  295,  295,  417,  415,
-  295,  416,  295,    0,    0,  295,  295,  295,  295,    0,
-  295,  295,  295,  295,  852,    0,  420,  403,  421,  295,
-    0,    0,  295,  295,  295,  295,  295,  295,  295,  295,
-    0,  295,  295,  295,  295,  295,    0,  293,  295,  293,
-  293,  293,  293,  293,    0,  295,  295,  295,    0,    0,
-  299,    0,  293,    0,  295,  295,  293,    0,  293,    0,
-  299,  293,  293,  293,  293,  293,  293,  293,    0,    0,
-  293,  293,  293,    0,    0,    0,    0,  293,  293,    0,
-    0,    0,  293,  293,    0,    0,    0,  299,    0,    0,
-    0,  299,  293,    0,  299,    0,  293,  293,    0,    0,
-    0,  293,    0,    0,    0,    0,    0,  293,  299,  293,
-  293,  299,  293,    0,  293,  293,  293,  293,  293,    0,
-  293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-  293,  293,  293,  293,  293,  293,    0,    0,  293,  293,
-  293,    0,  293,  293,  293,    0,  293,  293,  293,    0,
-    0,  293,    0,  293,    0,    0,  293,  293,  293,  293,
-    0,  293,  293,  293,  293,    0,    0,    0,    0,    0,
-  293,    0,    0,  293,  293,  293,  293,  293,  293,  293,
-  293,    0,  293,  293,  293,  293,  293,    0,    0,  293,
-    0,    0,    0,    0,    0,    0,  293,  293,  293,    0,
-    0,  297,    0,    0,    0,  293,  293,    0,    0,    0,
-    0,  297,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  297,    0,
-    0,    0,  297,    0,    0,  297,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  297,
-    0,    0,  297,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  299,    0,  299,  299,
-  299,  299,  299,    0,    0,    0,    0,    0,    0,    0,
-    0,  299,    0,    0,    0,  299,    0,  299,    0,    0,
-  299,  299,  299,  299,  299,  299,  299,    0,    0,  299,
-  299,  299,    0,    0,    0,    0,  299,  299,    0,    0,
-    0,  299,  299,    0,    0,    0,    0,    0,    0,    0,
-    0,  299,    0,    0,    0,  299,  299,    0,    0,    0,
-  299,    0,    0,    0,    0,    0,  299,    0,  299,  299,
-    0,  299,    0,  299,  299,  299,  299,  299,    0,  299,
-  299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
-  299,  299,  299,  299,  299,    0,    0,  299,  299,  299,
-    0,  299,  299,  299,    0,  299,  299,  299,  417,  415,
-  299,  416,  299,    0,    0,  299,  299,  299,  299,    0,
-  299,  299,  299,  299,  901,    0,  420,  403,  421,  299,
-    0,    0,  299,  299,  299,  299,  299,  299,  299,  299,
-    0,  299,  299,  299,  299,  299,    0,  297,  299,  297,
-  297,  297,  297,  297,    0,  299,  299,  299,    0,    0,
-  291,    0,  297,    0,  299,  299,  297,    0,  297,    0,
-  291,  297,  297,  297,  297,  297,  297,  297,    0,    0,
-  297,  297,  297,    0,    0,    0,    0,  297,  297,    0,
-    0,    0,  297,  297,    0,    0,    0,  291,    0,    0,
-    0,  291,  297,    0,  291,    0,  297,  297,    0,    0,
-    0,  297,    0,    0,    0,    0,    0,  297,  291,  297,
-  297,  291,  297,    0,  297,  297,  297,  297,  297,    0,
-  297,  297,  297,  297,  297,  297,  297,  297,  297,  297,
-  297,  297,  297,  297,  297,  297,    0,    0,  297,  297,
-  297,    0,  297,  297,  297,    0,  297,  297,  297,    0,
-    0,  297,    0,  297,    0,    0,  297,  297,  297,  297,
-    0,  297,  297,  297,  297,    0,    0,    0,    0,    0,
-  297,    0,    0,  297,  297,  297,  297,  297,  297,  297,
-  297,    0,  297,  297,  297,  297,  297,    0,    0,  297,
-    0,    0,    0,    0,    0,    0,  297,  297,  297,    0,
-    0,  301,    0,    0,    0,  297,  297,    0,    0,    0,
-    0,  301,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  301,    0,
-    0,    0,  301,    0,    0,  301,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  301,
-    0,    0,  301,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  291,    0,  291,  291,
-  291,  291,  291,    0,    0,    0,    0,    0,    0,    0,
-    0,  291,    0,    0,    0,  291,    0,  291,    0,    0,
-  291,  291,  291,  291,  291,  291,  291,    0,    0,  291,
-  291,  291,    0,    0,    0,    0,  291,  291,    0,    0,
-    0,  291,  291,    0,    0,    0,    0,    0,    0,    0,
-    0,  291,    0,    0,    0,  291,  291,    0,    0,    0,
-  291,    0,    0,    0,    0,    0,  291,    0,  291,  291,
-    0,  291,    0,  291,  291,  291,  291,  291,    0,  291,
-  291,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-  291,  291,  291,  291,  291,    0,    0,  291,  291,  291,
-    0,  291,  291,  291,    0,  291,  291,  291,  417,  415,
-  291,  416,  291,    0,    0,  291,  291,  291,  291,    0,
-  291,  291,  291,  291,  946,    0,  420,  403,  421,  291,
-    0,    0,  291,  291,  291,  291,  291,  291,  291,  291,
-    0,  291,  291,  291,  291,  291,    0,  301,  291,  301,
-  301,  301,  301,  301,    0,  291,  291,  291,    0,    0,
-  296,    0,  301,    0,  291,  291,  301,    0,  301,    0,
-  296,  301,  301,  301,  301,  301,  301,  301,    0,    0,
-  301,  301,  301,    0,    0,    0,    0,  301,  301,    0,
-    0,    0,  301,  301,    0,    0,    0,  296,    0,    0,
-    0,  296,  301,    0,  296,    0,  301,  301,    0,    0,
-    0,  301,    0,    0,    0,    0,    0,  301,  296,  301,
-  301,  296,  301,    0,  301,  301,  301,  301,  301,    0,
-  301,  301,  301,  301,  301,  301,  301,  301,  301,  301,
-  301,  301,  301,  301,  301,  301,    0,    0,  301,  301,
-  301,    0,  301,  301,  301,    0,  301,  301,  301,    0,
-    0,  301,    0,  301,    0,    0,  301,  301,  301,  301,
-    0,  301,  301,  301,  301,    0,    0,    0,    0,    0,
-  301,    0,    0,  301,  301,  301,  301,  301,  301,  301,
-  301,    0,  301,  301,  301,  301,  301,    0,    0,  301,
-    0,    0,    0,    0,    0,    0,  301,  301,  301,    0,
-    0,  294,    0,    0,    0,  301,  301,    0,    0,    0,
-    0,  294,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  294,    0,
-    0,    0,  294,    0,    0,  294,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  294,
-    0,    0,  294,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  296,    0,  296,  296,
-  296,  296,  296,    0,    0,    0,    0,    0,    0,    0,
-    0,  296,    0,    0,    0,  296,    0,  296,    0,    0,
-  296,  296,  296,  296,  296,  296,  296,    0,    0,  296,
-  296,  296,    0,    0,    0,    0,  296,  296,    0,    0,
-    0,  296,  296,    0,    0,    0,    0,    0,    0,    0,
-    0,  296,    0,    0,    0,  296,  296,    0,    0,    0,
-  296,    0,    0,    0,    0,    0,  296,    0,  296,  296,
-    0,  296,    0,  296,  296,  296,  296,  296,    0,  296,
-  296,  296,  296,  296,  296,  296,  296,  296,  296,  296,
-  296,  296,  296,  296,  296,    0,    0,  296,  296,  296,
-    0,  296,  296,  296,    0,  296,  296,  296,  417,  415,
-  296,  416,  296,    0,    0,  296,  296,  296,  296,    0,
-  296,  296,  296,  296,  962,    0,  420,  403,  421,  296,
-    0,    0,  296,  296,  296,  296,  296,  296,  296,  296,
-    0,  296,  296,  296,  296,  296,    0,  294,  296,  294,
-  294,  294,  294,  294,    0,  296,  296,  296,    0,    0,
-  312,    0,  294,    0,  296,  296,  294,    0,  294,    0,
-  312,  294,  294,  294,  294,  294,  294,  294,    0,    0,
-  294,  294,  294,    0,    0,    0,    0,  294,  294,    0,
-    0,    0,  294,  294,    0,    0,    0,  312,    0,    0,
-    0,  312,  294,    0,  312,    0,  294,  294,    0,    0,
-    0,  294,    0,    0,    0,    0,    0,  294,  312,  294,
-  294,  312,  294,    0,  294,  294,  294,  294,  294,    0,
-  294,  294,  294,  294,  294,  294,  294,  294,  294,  294,
-  294,  294,  294,  294,  294,  294,    0,    0,  294,  294,
-  294,    0,  294,  294,  294,    0,  294,  294,  294,    0,
-    0,  294,    0,  294,    0,    0,  294,  294,  294,  294,
-    0,  294,  294,  294,  294,    0,    0,    0,    0,    0,
-  294,    0,    0,  294,  294,  294,  294,  294,  294,  294,
-  294,    0,  294,  294,  294,  294,  294,    0,    0,  294,
-    0,    0,    0,    0,    0,    0,  294,  294,  294,    0,
-    0,  310,    0,    0,    0,  294,  294,    0,    0,    0,
-    0,  310,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  310,    0,
-    0,    0,  310,    0,    0,  310,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  310,
-    0,    0,  310,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  312,    0,  312,  312,
-  312,  312,  312,    0,    0,    0,    0,    0,    0,    0,
-    0,  312,    0,    0,    0,  312,    0,  312,    0,    0,
-  312,  312,  312,  312,  312,  312,  312,    0,    0,  312,
-  312,  312,    0,    0,    0,    0,  312,  312,    0,    0,
-    0,  312,  312,    0,    0,    0,    0,    0,    0,    0,
-    0,  312,    0,    0,    0,  312,  312,    0,    0,    0,
-  312,    0,    0,    0,    0,    0,  312,    0,  312,  312,
-    0,  312,    0,  312,  312,  312,  312,  312,    0,  312,
-  312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
-  312,  312,  312,  312,  312,    0,    0,  312,  312,  312,
-    0,  312,  312,  312,    0,  312,  312,  312,  417,  415,
-  312,  416,  312,    0,    0,  312,  312,  312,  312,    0,
-  312,  312,  312,  312,    0,    0,  420,  403,  421,  312,
-    0,    0,  312,  312,  312,  312,  312,  312,  312,  312,
-    0,  312,  312,  312,  312,  312,    0,  310,  312,  310,
-  310,  310,  310,  310,    0,  312,  312,  312,    0,    0,
-  300,    0,  310,    0,  312,  312,  310,    0,  310,    0,
-  300,  310,  310,  310,  310,  310,  310,  310,    0,    0,
-  310,  310,  310,    0,    0,    0,    0,  310,  310,    0,
-    0,    0,  310,  310,    0,    0,    0,  300,    0,    0,
-    0,  300,  310,    0,  300,    0,  310,  310,    0,    0,
-    0,  310,    0,    0,    0,    0,    0,  310,  300,  310,
-  310,  300,  310,    0,  310,  310,  310,  310,  310,    0,
-  310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
-  310,  310,  310,  310,  310,  310,    0,    0,  310,  310,
-  310,    0,  310,  310,  310,    0,  310,  310,  310,    0,
-    0,  310,    0,  310,    0,    0,  310,  310,  310,  310,
-    0,  310,  310,  310,  310,    0,    0,    0,    0,    0,
-  310,    0,    0,  310,  310,  310,  310,  310,  310,  310,
-  310,    0,  310,  310,  310,  310,  310,    0,    0,  310,
-    0,    0,    0,    0,    0,    0,  310,  310,  310,    0,
-    0,  298,    0,    0,    0,  310,  310,    0,    0,    0,
-    0,  298,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  298,    0,
-    0,    0,  298,    0,    0,  298,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  298,
-    0,    0,  298,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  300,    0,  300,  300,
-  300,  300,  300,    0,    0,    0,    0,    0,    0,    0,
-    0,  300,    0,    0,    0,  300,    0,  300,    0,    0,
-  300,  300,  300,  300,  300,  300,  300,    0,    0,  300,
-  300,  300,    0,    0,    0,    0,  300,  300,    0,    0,
-    0,  300,  300,    0,    0,    0,    0,    0,    0,    0,
-    0,  300,    0,    0,    0,  300,  300,    0,    0,    0,
-  300,    0,    0,    0,    0,    0,  300,    0,  300,  300,
-    0,  300,    0,  300,  300,  300,  300,  300,    0,  300,
-  300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
-  300,  300,  300,  300,  300,    0,    0,  300,  300,  300,
-    0,  300,  300,  300,    0,  300,  300,  300,  247,  247,
-  300,  247,  300,    0,    0,  300,  300,  300,  300,    0,
-  300,  300,  300,  300,    0,    0,  247,  247,  247,  300,
-    0,    0,  300,  300,  300,  300,  300,  300,  300,  300,
-    0,  300,  300,  300,  300,  300,    0,  298,  300,  298,
-  298,  298,  298,  298,    0,  300,  300,  300,    0,    0,
-  304,    0,  298,    0,  300,  300,  298,    0,  298,    0,
-  304,  298,  298,  298,  298,  298,  298,  298,    0,    0,
-  298,  298,  298,    0,    0,    0,    0,  298,  298,    0,
-    0,    0,  298,  298,    0,    0,    0,  304,    0,    0,
-    0,  304,  298,    0,  304,    0,  298,  298,    0,    0,
-    0,  298,    0,    0,    0,    0,    0,  298,  304,  298,
-  298,  304,  298,    0,  298,  298,  298,  298,  298,    0,
-  298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-  298,  298,  298,  298,  298,  298,    0,    0,  298,  298,
-  298,    0,  298,  298,  298,    0,  298,  298,  298,    0,
-    0,  298,    0,  298,    0,    0,  298,  298,  298,  298,
-    0,  298,  298,  298,  298,    0,    0,    0,    0,    0,
-  298,    0,    0,  298,  298,  298,  298,  298,  298,  298,
-  298,    0,  298,  298,  298,  298,  298,    0,    0,  298,
-    0,    0,    0,    0,    0,    0,  298,  298,  298,    0,
-    0,  303,    0,    0,    0,  298,  298,    0,    0,    0,
-    0,  303,    0,    0,  247,  247,  247,  247,  247,    0,
-  247,  247,  247,  247,  247,  247,    0,    0,  247,  247,
-    0,    0,    0,    0,    0,    0,    0,    0,  303,    0,
-    0,    0,  303,    0,    0,  303,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  303,
-    0,    0,  303,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  304,    0,  304,  304,
-  304,  304,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  304,    0,    0,    0,  304,    0,  304,    0,    0,
-  304,  304,  304,  304,  304,  304,  304,    0,    0,  304,
-  304,  304,    0,    0,    0,    0,  304,  304,    0,    0,
-    0,  304,  304,    0,    0,    0,    0,    0,    0,    0,
-    0,  304,    0,    0,    0,  304,  304,    0,    0,    0,
-  304,    0,    0,    0,    0,    0,  304,  567,  304,  304,
-  333,  304,  334,  304,  304,  304,  304,  304,    0,  304,
-  304,  304,  304,  304,  304,  304,  304,  304,  304,  304,
-  304,  304,  304,  304,  304,    0,    0,  304,  304,  304,
-    0,  304,  304,  304,    0,  304,  304,  304,    0,    0,
-  304,    0,  304,    0,    0,  304,  304,  304,  304,    0,
-  304,  304,  304,  304,    0,  753,    0,  751,  150,  304,
-  151,    0,  304,  304,  304,  304,  304,  304,  304,  304,
-    0,  304,  304,  304,  304,  304,  576,  303,  304,  303,
-  303,  303,  303,    0,    0,  304,  304,  304,    0,    0,
-    0,    0,  303,    0,  304,  304,  303,    0,  303,    0,
-    0,  303,  303,  303,  303,  303,  303,  303,    0,    0,
-  303,  303,  303,    0,    0,    0,    0,  303,  303,    0,
-    0,    0,  303,  303,    0,    0,    0,    0,    0,    0,
-    0,    0,  303,    0,    0,    0,  303,  303,    0,    0,
-    0,  303,    0,    0,    0,    0,    0,  303,    0,  303,
-  303,    0,  303,    0,  303,  303,  303,  303,  303,    0,
-  303,  303,  303,  303,  303,  303,  303,  303,  303,  303,
-  303,  303,  303,  303,  303,  303,    0,    0,  303,  303,
-  303,    0,  303,  303,  303,    0,  303,  303,  303,    0,
-  338,  303,    0,  303,    0,    0,  303,  303,  303,  303,
-  338,  303,  303,  303,  303,    0,    0,    0,    0,    0,
-  303,    0,    0,  303,  303,  303,  303,  303,  303,  303,
-  303,    0,  303,  303,  303,  303,  303,  338,    0,  303,
-  338,  338,  338,  338,  338,  338,  303,  303,  303,    0,
-    0,    0,    0,    0,    0,  303,  303,    0,    0,    0,
-    0,    0,    0,    0,    0,  336,  337,  338,    0,    0,
-  339,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  149,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  752,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  292,  176,    0,    0,    0,    0,  178,  179,    0,
-    0,  292,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,    0,  340,    0,    0,    0,  292,    0,
-    0,  187,  292,    0,    0,  292,    0,    0,    0,    0,
-    0,    0,    0,    0,  177,    0,    0,    0,    0,  292,
-    0,    0,  292,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,    0,    0,    0,    0,    0,  338,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  338,  338,  338,    0,  338,    0,  338,    0,    0,
-  338,  338,  338,  338,  338,  338,  338,    0,    0,  338,
-  338,  338,    0,    0,    0,    0,  338,  338,    0,    0,
-    0,  338,  338,    0,    0,    0,    0,    0,    0,    0,
-    0,  338,    0,    0,    0,  338,  338,    0,    0,    0,
-  338,    0,    0,    0,    0,    0,  338,    0,  338,  338,
-    0,  338,    0,  338,  338,  338,  338,  338,    0,  338,
-  338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-  338,  338,  338,  338,  338,    0,    0,  338,  338,  338,
-    0,  338,  338,  338,    0,  338,  338,  338,    0,    0,
-  338,    0,  338,    0,    0,  338,  338,  338,  338,    0,
-    0,  338,  338,  338,    0,    0,    0,    0,    0,  338,
-    0,    0,  338,  338,  338,  338,  338,  338,  338,  338,
-    0,  338,  338,  338,  338,  338,    0,  292,  338,  292,
-  292,    0,    0,    0,    0,  338,  338,  338,    0,    0,
-  302,    0,  292,    0,  338,  338,  292,    0,  292,    0,
-  302,  292,  292,  292,  292,  292,  292,  292,    0,    0,
-  292,  292,  292,    0,    0,    0,    0,  292,  292,    0,
-    0,    0,  292,  292,    0,    0,    0,  302,    0,    0,
-    0,  302,  292,    0,  302,    0,  292,  292,    0,    0,
-    0,  292,    0,    0,    0,    0,    0,  292,  302,  292,
-  292,  302,  292,    0,  292,  292,  292,  292,  292,    0,
-  292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-  292,  292,  292,  292,  292,  292,    0,    0,  292,  292,
-  292,    0,  292,  292,  292,    0,  292,  292,  292,    0,
-    0,  292,    0,  292,    0,    0,  292,  292,  292,  292,
-    0,  292,  292,  292,  292,    0,    0,    0,    0,    0,
-  292,    0,    0,  292,  292,  292,  292,  292,  292,  292,
-  292,    0,  292,  292,  292,  292,  292,    0,    0,  292,
-    0,    0,    0,    0,    0,    0,  292,  292,  292,    0,
-    0,    0,    0,    0,    0,  292,  292,  501,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  501,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  501,  501,
-  501,  501,  501,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,   657,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+       0,   658,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,   478,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  302,    0,  302,  302,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  302,    0,    0,    0,  302,    0,  302,    0,    0,
-  302,  302,  302,  302,  302,  302,  302,    0,    0,  302,
-  302,  302,    0,    0,    0,    0,  302,  302,    0,    0,
-    0,  302,  302,    0,    0,    0,    0,    0,    0,    0,
-    0,  302,    0,    0,    0,  302,  302,    0,    0,    0,
-  302,    0,    0,    0,    0,    0,  302,    0,  302,  302,
-    0,  302,    0,  302,  302,  302,  302,  302,    0,  302,
-  302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
-  302,  302,  302,  302,  302,    0,    0,  302,  302,  302,
-    0,  302,  302,  302,    0,  302,  302,  302,    0,    0,
-  302,    0,  302,    0,    0,  302,  302,  302,  302,    0,
-  302,  302,  302,  302,    0,    0,    0,    0,    0,  302,
-    0,    0,  302,  302,  302,  302,  302,  302,  302,  302,
-    0,  302,  302,  302,  302,  302,    0,    0,  302,    0,
-    0,    0,    0,  501,    0,  302,  302,  302,    0,    0,
-    0,  502,    0,    0,  302,  302,    0,    0,  501,  501,
-  501,  502,  501,    0,  501,    0,    0,  501,  501,  501,
-  501,  501,  501,  501,    0,    0,  501,  501,  501,    0,
-    0,    0,    0,  501,  501,    0,    0,    0,  501,  501,
-    0,    0,  502,  502,  502,  502,  502,    0,  501,    0,
-    0,    0,  501,  501,    0,    0,    0,  501,    0,    0,
-    0,    0,    0,  501,    0,  501,  501,    0,  501,    0,
-  501,  501,  501,  501,  501,    0,  501,  501,  501,  501,
-  501,  501,  501,  501,  501,  501,  501,  501,  501,  501,
-  501,  501,    0,    0,  501,  501,  501,    0,  501,  501,
-  501,    0,  501,  501,  501,    0,    0,  501,    0,  501,
-    0,    0,  501,  501,  501,  501,    0,    0,  501,  501,
-  501,    0,    0,    0,    0,    0,  501,    0,    0,  501,
-  501,  501,  501,  501,  501,  501,  501,    0,  501,  501,
-  501,  501,  501,    0,    0,  501,    0,    0,    0,    0,
-    0,    0,  501,  501,  501,    0,  493,    0,    0,    0,
-    0,  501,  501,    0,    0,    0,  493,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  499,  499,
-  493,  499,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+     733,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   533,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   190,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  502,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  502,  502,  502,    0,  502,    0,  502,    0,
-    0,  502,  502,  502,  502,  502,  502,  502,    0,    0,
-  502,  502,  502,    0,    0,    0,    0,  502,  502,    0,
-    0,    0,  502,  502,    0,    0,    0,    0,    0,    0,
-    0,    0,  502,    0,    0,    0,  502,  502,    0,    0,
-    0,  502,    0,    0,    0,    0,    0,  502,    0,  502,
-  502,    0,  502,    0,  502,  502,  502,  502,  502,    0,
-  502,  502,  502,  502,  502,  502,  502,  502,  502,  502,
-  502,  502,  502,  502,  502,  502,    0,    0,  502,  502,
-  502,    0,  502,  502,  502,    0,  502,  502,  502,    0,
-    0,  502,    0,  502,    0,    0,  502,  502,  502,  502,
-    0,    0,  502,  502,  502,    0,    0,    0,    0,    0,
-  502,    0,    0,  502,  502,  502,  502,  502,  502,  502,
-  502,    0,  502,  502,  502,  502,  502,    0,    0,  502,
-    0,    0,  493,    0,    0,    0,  502,  502,    0,    0,
-  507,    0,    0,    0,    0,  502,  502,  499,  499,  499,
-  507,  493,    0,  493,    0,    0,  493,  493,  493,  493,
-  493,  493,  493,    0,    0,  493,  493,  493,    0,    0,
-    0,    0,  493,  493,    0,    0,    0,  493,  493,    0,
-    0,  507,  507,  507,  507,  507,    0,  493,    0,    0,
-    0,  493,  493,    0,    0,    0,  493,    0,    0,    0,
-    0,    0,  493,    0,  493,  493,    0,  493,    0,  493,
-  493,  493,  493,  493,    0,  493,  493,  493,  493,  493,
-  493,  493,  493,  493,  493,  493,  493,  493,  493,  493,
-  493,    0,    0,  493,  493,  493,    0,  493,  493,  493,
-    0,  493,  493,  493,    0,    0,  493,    0,  493,    0,
-    0,  493,  493,  493,  493,    0,    0,  493,  493,  493,
-    0,    0,    0,    0,    0,  493,    0,    0,  493,  493,
-  493,  493,  493,  493,  493,  493,    0,  493,  493,  493,
-  493,  493,    0,    0,  493,    0,    0,    0,    0,    0,
-    0,  493,  493,  493,    0,  504,    0,    0,    0,    0,
-  493,  493,    0,    0,    0,  504,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  504,  504,  504,  504,
-  504,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,   640,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,    92,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  507,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  507,  507,    0,    0,  507,    0,  507,    0,    0,
-  507,  507,  507,  507,  507,  507,  507,    0,    0,  507,
-  507,  507,    0,    0,    0,    0,  507,  507,    0,    0,
-    0,  507,  507,    0,    0,    0,    0,    0,    0,    0,
-    0,  507,    0,    0,    0,  507,  507,    0,    0,    0,
-  507,    0,    0,    0,    0,    0,  507,    0,  507,  507,
-    0,  507,    0,  507,  507,  507,  507,  507,    0,  507,
-  507,  507,  507,  507,  507,  507,  507,  507,  507,  507,
-  507,  507,  507,  507,  507,    0,    0,  507,  507,  507,
-    0,  507,  507,  507,    0,  507,  507,  507,    0,    0,
-  507,    0,  507,    0,    0,  507,  507,  507,  507,    0,
-    0,  507,  507,  507,    0,    0,    0,    0,    0,  507,
-    0,    0,  507,  507,  507,  507,  507,  507,  507,  507,
-    0,  507,  507,  507,  507,  507,    0,    0,  507,    0,
-    0,  504,    0,    0,    0,  507,  507,  507,  505,    0,
-    0,    0,    0,    0,  507,  507,  504,  504,  505,    0,
-  504,    0,  504,    0,    0,  504,  504,  504,  504,  504,
-  504,  504,    0,    0,  504,  504,  504,    0,    0,    0,
-    0,  504,  504,    0,    0,    0,  504,  504,    0,  505,
-  505,  505,  505,  505,    0,    0,  504,    0,    0,    0,
-  504,  504,    0,    0,    0,  504,    0,    0,    0,    0,
-    0,  504,    0,  504,  504,    0,  504,    0,  504,  504,
-  504,  504,  504,    0,  504,  504,  504,  504,  504,  504,
-  504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
-    0,    0,  504,  504,  504,    0,  504,  504,  504,    0,
-  504,  504,  504,    0,    0,  504,    0,  504,    0,    0,
-  504,  504,  504,  504,    0,    0,  504,  504,  504,    0,
-    0,    0,    0,    0,  504,    0,    0,  504,  504,  504,
-  504,  504,  504,  504,  504,    0,  504,  504,  504,  504,
-  504,    0,    0,  504,    0,    0,    0,    0,    0,    0,
-  504,  504,  504,  506,    0,    0,    0,    0,    0,  504,
-  504,    0,    0,  506,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,   662,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  506,  506,  506,  506,  506,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   179,     0,   664,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,     0,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1859,1594 +1950,63 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  505,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  505,
-  505,    0,    0,  505,    0,  505,    0,    0,  505,  505,
-  505,  505,  505,  505,  505,    0,    0,  505,  505,  505,
-    0,    0,    0,    0,  505,  505,    0,    0,    0,  505,
-  505,    0,    0,    0,    0,    0,    0,    0,    0,  505,
-    0,    0,    0,  505,  505,    0,    0,    0,  505,    0,
-    0,    0,    0,    0,  505,    0,  505,  505,    0,  505,
-    0,  505,  505,  505,  505,  505,    0,  505,  505,  505,
-  505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
-  505,  505,  505,    0,    0,  505,  505,  505,    0,  505,
-  505,  505,    0,  505,  505,  505,    0,    0,  505,    0,
-  505,    0,    0,  505,  505,  505,  505,    0,    0,  505,
-  505,  505,    0,    0,    0,    0,    0,  505,    0,    0,
-  505,  505,  505,  505,  505,  505,  505,  505,    0,  505,
-  505,  505,  505,  505,    0,    0,  505,    0,    0,  506,
-    0,    0,    0,  505,  505,  505,  313,    0,    0,    0,
-    0,    0,  505,  505,  506,  506,  313,    0,  506,    0,
-  506,    0,    0,  506,  506,  506,  506,  506,  506,  506,
-    0,    0,  506,  506,  506,    0,    0,    0,    0,  506,
-  506,    0,    0,  313,  506,  506,    0,  313,    0,    0,
-  313,    0,    0,    0,  506,    0,    0,    0,  506,  506,
-    0,    0,    0,  506,  313,    0,    0,    0,    0,  506,
-    0,  506,  506,    0,  506,    0,  506,  506,  506,  506,
-  506,    0,  506,  506,  506,  506,  506,  506,  506,  506,
-  506,  506,  506,  506,  506,  506,  506,  506,    0,    0,
-  506,  506,  506,    0,  506,  506,  506,    0,  506,  506,
-  506,    0,    0,  506,    0,  506,    0,    0,  506,  506,
-  506,  506,    0,    0,  506,  506,  506,    0,    0,    0,
-    0,    0,  506,    0,    0,  506,  506,  506,  506,  506,
-  506,  506,  506,    0,  506,  506,  506,  506,  506,    0,
-    0,  506,    0,    0,    0,    0,    0,    0,  506,  506,
-  506,  309,    0,    0,    0,    0,    0,  506,  506,    0,
-    0,  309,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  309,    0,
-    0,    0,  309,    0,    0,  309,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  309,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+     751,     0,   752,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  313,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  313,    0,    0,
-    0,  313,    0,  313,    0,    0,  313,  313,  313,  313,
-  313,  313,  313,    0,    0,  313,  313,  313,    0,    0,
-    0,    0,  313,  313,    0,    0,    0,  313,  313,    0,
-    0,    0,    0,    0,    0,    0,    0,  313,    0,    0,
-    0,  313,  313,    0,    0,    0,  313,    0,    0,    0,
-    0,    0,  313,    0,  313,  313,    0,  313,    0,  313,
-  313,  313,  313,  313,    0,  313,  313,  313,  313,  313,
-  313,  313,  313,  313,  313,  313,  313,  313,  313,  313,
-  313,    0,    0,  313,  313,  313,    0,  313,  313,  313,
-    0,  313,  313,  313,    0,  503,  313,    0,  313,    0,
-    0,  313,  313,  313,  313,  503,  313,  313,  313,  313,
-    0,    0,    0,    0,    0,  313,    0,    0,  313,  313,
-  313,  313,  313,  313,  313,  313,    0,  313,  313,  313,
-  313,  313,    0,    0,  313,    0,  503,  309,  503,  503,
-  503,  313,  313,  313,    0,    0,    0,    0,    0,    0,
-  313,  313,  309,    0,    0,    0,  309,    0,  309,    0,
-    0,  309,  309,  309,  309,  309,  309,  309,    0,    0,
-  309,  309,  309,    0,    0,    0,    0,  309,  309,    0,
-    0,    0,  309,  309,    0,    0,    0,    0,    0,    0,
-    0,    0,  309,    0,    0,    0,  309,  309,    0,    0,
-    0,  309,    0,    0,    0,    0,    0,  309,    0,  309,
-  309,    0,  309,    0,  309,  309,  309,  309,  309,    0,
-  309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
-  309,  309,  309,  309,  309,  309,    0,    0,  309,  309,
-  309,    0,  309,  309,  309,    0,  309,  309,  309,    0,
-  509,  309,    0,  309,    0,    0,  309,  309,  309,  309,
-  509,  309,  309,  309,  309,    0,    0,    0,    0,    0,
-  309,    0,    0,  309,  309,  309,  309,  309,  309,  309,
-  309,    0,  309,  309,  309,  309,  309,    0,    0,  309,
-    0,  509,    0,    0,  509,    0,  309,  309,  309,    0,
-    0,    0,    0,    0,    0,  309,  309,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   533,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   753,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  503,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  503,    0,    0,    0,
-  503,    0,  503,    0,    0,  503,  503,  503,  503,  503,
-  503,  503,    0,    0,  503,  503,  503,    0,    0,    0,
-    0,  503,  503,    0,    0,    0,  503,  503,    0,    0,
-    0,    0,    0,    0,    0,    0,  503,    0,    0,    0,
-  503,  503,    0,    0,    0,  503,    0,    0,    0,    0,
-    0,  503,    0,  503,  503,    0,  503,    0,  503,  503,
-  503,  503,  503,    0,  503,  503,  503,  503,  503,  503,
-  503,  503,  503,  503,  503,  503,  503,  503,  503,  503,
-    0,    0,  503,  503,  503,    0,  503,  503,  503,    0,
-  503,  503,  503,    0,  512,  503,    0,  503,    0,    0,
-  503,  503,  503,  503,  512,    0,  503,  503,  503,    0,
-    0,    0,    0,    0,  503,    0,    0,  503,  503,  503,
-  503,  503,  503,  503,  503,    0,  503,  503,  503,  503,
-  503,    0,    0,  503,    0,  512,  509,    0,  512,    0,
-  503,  503,  503,    0,    0,    0,    0,    0,    0,  503,
-  503,  509,    0,    0,    0,  509,    0,  509,    0,    0,
-  509,  509,  509,  509,  509,  509,  509,    0,    0,  509,
-  509,  509,    0,    0,    0,    0,  509,  509,    0,    0,
-    0,  509,  509,    0,    0,    0,    0,    0,    0,    0,
-    0,  509,    0,    0,    0,  509,  509,    0,    0,    0,
-  509,    0,    0,    0,    0,    0,  509,    0,  509,  509,
-    0,  509,    0,  509,  509,  509,  509,  509,    0,  509,
-  509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
-  509,  509,  509,  509,  509,    0,    0,  509,  509,  509,
-    0,  509,  509,  509,    0,  509,  509,  509,    0,  511,
-  509,    0,  509,    0,    0,  509,  509,  509,  509,  511,
-    0,  509,  509,  509,    0,    0,    0,    0,    0,  509,
-    0,    0,  509,  509,  509,  509,  509,  509,  509,  509,
-    0,  509,  509,  509,  509,  509,    0,    0,  509,    0,
-  511,    0,    0,  511,    0,  509,  509,  509,    0,    0,
-    0,    0,    0,    0,  509,  509,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,   558,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,   539,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  512,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  512,    0,    0,    0,  512,
-    0,  512,    0,    0,  512,  512,  512,  512,  512,  512,
-  512,    0,    0,  512,  512,  512,    0,    0,    0,    0,
-  512,  512,    0,    0,    0,  512,  512,    0,    0,    0,
-    0,    0,    0,    0,    0,  512,    0,    0,    0,  512,
-  512,    0,    0,    0,  512,    0,    0,    0,    0,    0,
-  512,    0,  512,  512,    0,  512,    0,  512,  512,  512,
-  512,  512,    0,  512,  512,  512,  512,  512,  512,  512,
-  512,  512,  512,  512,  512,  512,  512,  512,  512,    0,
-    0,  512,  512,  512,    0,  512,  512,  512,    0,  512,
-  512,  512,    0,  510,  512,    0,  512,    0,    0,  512,
-  512,  512,  512,  510,    0,  512,  512,  512,    0,    0,
-    0,    0,    0,  512,    0,    0,  512,  512,  512,  512,
-  512,  512,  512,  512,    0,  512,  512,  512,  512,  512,
-    0,    0,  512,    0,  510,  511,    0,  510,    0,  512,
-  512,  512,    0,    0,    0,    0,    0,    0,  512,  512,
-  511,    0,    0,    0,  511,    0,  511,    0,    0,  511,
-  511,  511,  511,  511,  511,  511,    0,    0,  511,  511,
-  511,    0,    0,    0,    0,  511,  511,    0,    0,    0,
-  511,  511,    0,    0,    0,    0,    0,    0,    0,    0,
-  511,    0,    0,    0,  511,  511,    0,    0,    0,  511,
-    0,    0,    0,    0,    0,  511,    0,  511,  511,    0,
-  511,    0,  511,  511,  511,  511,  511,    0,  511,  511,
-  511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
-  511,  511,  511,  511,    0,    0,  511,  511,  511,    0,
-  511,  511,  511,    0,  511,  511,  511,    0,  236,  511,
-    0,  511,    0,    0,  511,  511,  511,  511,  236,    0,
-  511,  511,  511,    0,    0,    0,    0,    0,  511,    0,
-    0,  511,  511,  511,  511,  511,  511,  511,  511,    0,
-  511,  511,  511,  511,  511,    0,    0,  511,    0,    0,
-  236,    0,  236,    0,  511,  511,  511,    0,    0,    0,
-    0,    0,    0,  511,  511,    0,    0,    0,    0,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  510,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  510,    0,    0,    0,  510,    0,
-  510,    0,    0,  510,  510,  510,  510,  510,  510,  510,
-    0,    0,  510,  510,  510,    0,    0,    0,    0,  510,
-  510,    0,    0,    0,  510,  510,    0,    0,    0,    0,
-    0,    0,    0,    0,  510,    0,    0,    0,  510,  510,
-    0,    0,    0,  510,    0,    0,    0,    0,    0,  510,
-    0,  510,  510,    0,  510,    0,  510,  510,  510,  510,
-  510,    0,  510,  510,  510,  510,  510,  510,  510,  510,
-  510,  510,  510,  510,  510,  510,  510,  510,    0,    0,
-  510,  510,  510,    0,  510,  510,  510,    0,  510,  510,
-  510,    0,  513,  510,    0,  510,    0,    0,  510,  510,
-  510,  510,  513,    0,  510,  510,  510,    0,    0,    0,
-    0,    0,  510,    0,    0,  510,  510,  510,  510,  510,
-  510,  510,  510,    0,  510,  510,  510,  510,  510,    0,
-    0,  510,    0,  513,  236,    0,  513,    0,  510,  510,
-  510,    0,    0,    0,    0,    0,    0,  510,  510,    0,
-    0,    0,    0,  236,    0,  236,    0,    0,  236,  236,
-  236,  236,  236,  236,  236,    0,    0,  236,  236,  236,
-    0,    0,    0,    0,  236,  236,    0,    0,    0,  236,
-  236,    0,    0,    0,    0,    0,    0,    0,    0,  236,
-    0,    0,    0,  236,  236,    0,    0,    0,  236,    0,
-    0,    0,    0,    0,  236,    0,  236,  236,    0,  236,
-    0,  236,  236,  236,  236,  236,    0,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,  236,    0,    0,  236,  236,  236,    0,  236,
-  236,  236,    0,  236,  236,  236,    0,  508,  236,    0,
-  236,    0,    0,  236,  236,  236,  236,  508,    0,  236,
-  236,  236,    0,    0,    0,    0,    0,  236,    0,    0,
-  236,  236,  236,  236,  236,  236,  236,  236,    0,  236,
-  236,  236,  236,  236,    0,    0,  236,    0,  508,    0,
-    0,  508,    0,  236,  236,  236,    0,    0,    0,    0,
-    0,    0,  236,  236,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  513,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  513,    0,    0,    0,  513,    0,  513,
-    0,    0,  513,  513,  513,  513,  513,  513,  513,    0,
-    0,  513,  513,  513,    0,    0,    0,    0,  513,  513,
-    0,    0,    0,  513,  513,    0,    0,    0,    0,    0,
-    0,    0,    0,  513,   57,    0,    0,  513,  513,    0,
-    0,    0,  513,    0,   57,    0,    0,    0,  513,    0,
-  513,  513,    0,  513,    0,  513,  513,  513,  513,  513,
-    0,  513,  513,  513,  513,  513,  513,  513,  513,  513,
-  513,  513,  513,  513,  513,  513,  513,    0,    0,  513,
-  513,  513,    0,  513,  513,  513,    0,  513,  513,  513,
-    0,    0,  513,    0,  513,    0,    0,  513,  513,  513,
-  513,    0,    0,  513,  513,  513,    0,    0,    0,    0,
-    0,  513,    0,    0,  513,  513,  513,  513,  513,  513,
-  513,  513,    0,  513,  513,  513,  513,  513,    0,    0,
-  513,    0,    0,  508,    0,    0,    0,  513,  513,  513,
-    0,    0,    0,    0,    0,    0,  513,  513,  508,    0,
-    0,    0,  508,    0,  508,    0,    0,  508,  508,  508,
-  508,  508,  508,  508,    0,    0,  508,  508,  508,    0,
-    0,    0,    0,  508,  508,    0,    0,    0,  508,  508,
-    0,    0,    0,    0,    0,  142,    0,    0,  508,    0,
-    0,    0,  508,  508,    0,  142,    0,  508,    0,    0,
-    0,    0,    0,  508,    0,  508,  508,    0,  508,    0,
-  508,  508,  508,  508,  508,    0,  508,  508,  508,  508,
-  508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
-  508,  508,    0,    0,  508,  508,  508,    0,  508,  508,
-  508,    0,  508,  508,  508,    0,    0,  508,    0,  508,
-    0,    0,  508,  508,  508,  508,    0,    0,  508,  508,
-  508,    0,    0,    0,    0,    0,  508,    0,    0,  508,
-  508,  508,  508,  508,  508,  508,  508,    0,  508,  508,
-  508,  508,  508,    0,    0,  508,    0,    0,    0,    0,
-   57,    0,  508,  508,  508,    0,    0,    0,    0,    0,
-    0,  508,  508,    0,    0,  164,  164,    0,    0,   57,
-    0,   57,    0,    0,   57,   57,   57,   57,   57,   57,
-   57,    0,    0,   57,   57,   57,    0,    0,    0,    0,
-   57,   57,    0,    0,    0,   57,   57,    0,    0,    0,
-    0,    0,    0,    0,    0,   57,    0,    0,    0,   57,
-   57,    0,    0,    0,   57,    0,    0,    0,    0,    0,
-   57,    0,   57,   57,    0,   57,    0,   57,   57,   57,
-   57,   57,    0,   57,   57,   57,   57,   57,   57,   57,
-   57,   57,   57,   57,   57,   57,   57,   57,   57,    0,
-    0,   57,   57,   57,    0,   57,   57,   57,    0,   57,
-   57,   57,    0,  355,   57,    0,   57,    0,    0,   57,
-   57,   57,   57,  355,    0,   57,   57,   57,    0,    0,
-    0,    0,    0,   57,    0,    0,   57,   57,   57,   57,
-   57,   57,   57,   57,    0,   57,   57,   57,   57,   57,
-    0,  142,   57,    0,  355,    0,    0,    0,    0,   57,
-   57,   57,    0,    0,    0,    0,  164,  164,   57,   57,
-  142,  355,  142,    0,    0,  142,  142,  142,  142,  142,
-  142,  142,    0,    0,  142,  142,  142,    0,    0,    0,
-    0,  142,  142,    0,    0,    0,  142,  142,    0,    0,
-    0,    0,    0,    0,    0,    0,  142,    0,    0,    0,
-  142,  142,    0,    0,    0,  142,    0,    0,    0,    0,
-    0,  142,    0,  142,  142,    0,  142,    0,  142,  142,
-  142,  142,  142,    0,  142,  142,  142,  142,  142,  142,
-  142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
-    0,    0,  142,  142,  142,    0,  142,  142,  142,    0,
-  142,  142,  142,    0,  125,  142,    0,  142,    0,    0,
-  142,  142,  142,  142,  125,    0,  142,  142,  142,    0,
-    0,    0,    0,    0,  142,    0,    0,  142,  142,  142,
-  142,  142,  142,  142,  142,    0,  142,  142,  142,  142,
-  142,    0,    0,  142,    0,    0,    0,    0,  125,    0,
-  142,  142,  142,    0,    0,    0,    0,    0,    0,  142,
-  142,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  355,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  355,    0,
-  355,    0,    0,  355,  355,  355,  355,  355,  355,  355,
-    0,    0,  355,  355,  355,    0,    0,    0,    0,  355,
-  355,    0,    0,    0,  355,  355,    0,    0,    0,    0,
-  154,    0,    0,    0,  355,    0,    0,    0,  355,  355,
-  154,    0,    0,  355,    0,    0,    0,    0,    0,  355,
-    0,  355,  355,    0,  355,    0,  355,  355,  355,  355,
-  355,    0,  355,  355,  355,  355,  355,  355,  355,  355,
-  355,  355,  355,  355,  355,  355,  355,  355,    0,    0,
-  355,  355,  355,    0,  355,  355,  355,    0,  355,  355,
-  355,    0,    0,  355,    0,  355,    0,    0,  355,  355,
-  355,  355,    0,    0,  355,  355,  355,    0,    0,    0,
-    0,    0,  355,    0,    0,  355,  355,  355,  355,  355,
-  355,  355,  355,    0,  355,  355,  355,  355,  355,    0,
-  125,  355,    0,    0,    0,    0,    0,    0,  355,  355,
-  355,    0,    0,    0,    0,  125,  125,  355,  355,  125,
-    0,  125,    0,    0,  125,  125,  125,  125,  125,  125,
-  125,    0,    0,  125,  125,  125,    0,    0,    0,    0,
-  125,  125,    0,    0,    0,  125,  125,    0,    0,    0,
-    0,    0,    0,    0,    0,  125,    0,    0,    0,  125,
-  125,    0,    0,    0,  125,    0,    0,    0,    0,    0,
-  125,    0,  125,  125,    0,  125,    0,  125,  125,  125,
-  125,  125,    0,  125,  125,  125,  125,  125,  125,  125,
-  125,  125,  125,  125,  125,  125,  125,  125,  125,    0,
-    0,  125,  125,  125,    0,  125,  125,  125,    0,  125,
-  125,  125,    0,  236,  125,    0,  125,    0,    0,  125,
-  125,  125,  125,  236,    0,  125,  125,  125,    0,    0,
-    0,    0,    0,  125,    0,    0,  125,  125,  125,  125,
-  125,  125,  125,  125,    0,  125,  125,  125,  125,  125,
-    0,    0,  125,    0,    0,  236,  154,  236,    0,  125,
-  125,    0,    0,    0,    0,    0,    0,    0,  125,  125,
-    0,  154,  154,    0,    0,  154,    0,  154,    0,    0,
-  154,  154,  154,  154,  154,  154,  154,    0,    0,  154,
-  154,  154,    0,    0,    0,    0,  154,  154,    0,    0,
-    0,  154,  154,    0,    0,    0,    0,    0,    0,    0,
-    0,  154,    0,    0,    0,  154,  154,    0,    0,    0,
-  154,    0,    0,    0,    0,    0,  154,    0,  154,  154,
-    0,  154,    0,  154,  154,  154,  154,  154,    0,  154,
-  154,  154,  154,  154,  154,  154,  154,  154,  154,  154,
-  154,  154,  154,  154,  154,    0,    0,  154,  154,  154,
-    0,  154,  154,  154,  164,  154,  154,  154,    0,    0,
-  154,    0,  154,    0,  164,  154,  154,  154,  154,    0,
-    0,  154,  154,  154,    0,    0,    0,    0,    0,  154,
-    0,    0,  154,  154,  154,  154,  154,  154,  154,  154,
-    0,  154,  154,  154,  154,  154,    0,    0,  154,    0,
-    0,    0,    0,    0,    0,  154,  154,  154,    0,    0,
-    0,    0,    0,    0,  154,  154,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  236,    0,
-  236,    0,    0,  236,  236,  236,  236,  236,  236,  236,
-    0,    0,  236,  236,  236,    0,    0,    0,    0,  236,
-  236,    0,    0,    0,  236,  236,    0,    0,    0,    0,
-  155,    0,    0,    0,  236,    0,    0,    0,  236,  236,
-  155,    0,    0,  236,    0,    0,    0,    0,    0,  236,
-    0,  236,  236,    0,  236,    0,  236,  236,  236,  236,
-  236,    0,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,    0,    0,
-  236,  236,  236,    0,  236,  236,  236,    0,  236,  236,
-  236,    0,    0,  236,    0,  236,    0,    0,  236,  236,
-  236,  236,    0,    0,  236,  236,  236,    0,    0,    0,
-    0,    0,  236,    0,    0,  236,  236,  236,  236,  236,
-  236,  236,  236,    0,  236,  236,  236,  236,  236,    0,
-  164,  236,    0,    0,    0,    0,    0,    0,  236,  236,
-  236,    0,    0,    0,    0,  164,  164,  236,  236,  164,
-    0,  164,    0,    0,  164,  164,  164,  164,  164,  164,
-  164,    0,    0,  164,  164,  164,    0,    0,    0,    0,
-  164,  164,    0,    0,    0,  164,  164,    0,    0,    0,
-    0,    0,    0,    0,    0,  164,    0,    0,    0,  164,
-  164,    0,    0,    0,  164,    0,    0,    0,    0,    0,
-  164,    0,  164,  164,    0,  164,    0,  164,  164,  164,
-  164,  164,    0,  164,  164,  164,  164,  164,  164,  164,
-  164,  164,  164,  164,  164,  164,  164,  164,  164,    0,
-    0,  164,  164,  164,    0,  164,  164,  164,    0,  164,
-  164,  164,    0,  525,  164,    0,  164,    0,    0,  164,
-  164,  164,  164,  525,    0,  164,  164,  164,    0,    0,
-    0,    0,    0,  164,    0,    0,  164,  164,  164,  164,
-  164,  164,  164,  164,    0,  164,  164,  164,  164,  164,
-    0,    0,  164,    0,  525,    0,  155,  525,    0,  164,
-  164,  164,    0,    0,    0,    0,    0,    0,  164,  164,
-    0,  155,  155,    0,    0,  155,    0,  155,    0,    0,
-  155,  155,  155,  155,  155,  155,  155,    0,    0,  155,
-  155,  155,    0,    0,    0,    0,  155,  155,    0,    0,
-    0,  155,  155,    0,    0,    0,    0,    0,    0,    0,
-    0,  155,    0,    0,    0,  155,  155,    0,    0,    0,
-  155,    0,    0,    0,    0,    0,  155,    0,  155,  155,
-    0,  155,    0,  155,  155,  155,  155,  155,    0,  155,
-  155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
-  155,  155,  155,  155,  155,    0,    0,  155,  155,  155,
-    0,  155,  155,  155,    0,  155,  155,  155,    0,  168,
-  155,    0,  155,    0,    0,  155,  155,  155,  155,  168,
-    0,  155,  155,  155,    0,    0,    0,    0,    0,  155,
-    0,    0,  155,  155,  155,  155,  155,  155,  155,  155,
-    0,  155,  155,  155,  155,  155,    0,    0,  155,    0,
-  168,    0,    0,  168,    0,  155,  155,  155,    0,    0,
-    0,    0,    0,    0,  155,  155,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  525,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  525,    0,
-  525,    0,    0,  525,  525,  525,  525,  525,  525,  525,
-    0,    0,  525,  525,  525,    0,    0,    0,    0,  525,
-  525,    0,    0,    0,  525,  525,    0,    0,    0,    0,
-    0,    0,    0,    0,  525,    0,    0,    0,  525,  525,
-    0,    0,    0,  525,    0,    0,    0,    0,    0,  525,
-    0,  525,  525,    0,  525,    0,  525,  525,  525,  525,
-  525,    0,  525,  525,  525,  525,  525,  525,  525,  525,
-  525,  525,  525,  525,  525,  525,  525,  525,    0,    0,
-  525,  525,  525,    0,  525,  525,  525,    0,  525,  525,
-  525,    0,  523,  525,    0,  525,    0,    0,  525,  525,
-  525,  525,  523,    0,  525,  525,  525,    0,    0,    0,
-    0,    0,  525,    0,    0,  525,  525,  525,  525,  525,
-  525,  525,  525,    0,  525,  525,  525,  525,  525,    0,
-    0,  525,    0,  523,    0,  168,  523,    0,  525,  525,
-  525,    0,    0,    0,    0,    0,    0,  525,  525,    0,
-    0,    0,    0,    0,  168,    0,  168,    0,    0,  168,
-  168,  168,  168,  168,  168,  168,    0,    0,  168,  168,
-  168,    0,    0,    0,    0,  168,  168,    0,    0,    0,
-  168,  168,    0,    0,    0,    0,    0,    0,    0,    0,
-  168,    0,    0,    0,  168,  168,    0,    0,    0,  168,
-    0,    0,    0,    0,    0,  168,    0,  168,  168,    0,
-  168,    0,  168,  168,  168,  168,  168,    0,  168,  168,
-  168,  168,  168,  168,  168,  168,  168,  168,  168,  168,
-  168,  168,  168,  168,    0,    0,  168,  168,  168,    0,
-  168,  168,  168,    0,  168,  168,  168,    0,  522,  168,
-    0,  168,    0,    0,  168,  168,  168,  168,  522,    0,
-  168,  168,  168,    0,    0,    0,    0,    0,  168,    0,
-    0,  168,  168,  168,  168,  168,  168,  168,  168,    0,
-  168,  168,  168,  168,  168,    0,    0,  168,    0,  522,
-    0,    0,  522,    0,  168,  168,  168,    0,    0,    0,
-    0,    0,    0,  168,  168,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  523,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  523,    0,  523,
-    0,    0,  523,  523,  523,  523,  523,  523,  523,    0,
-    0,  523,  523,  523,    0,    0,    0,    0,  523,  523,
-    0,    0,    0,  523,  523,    0,    0,    0,    0,    0,
-    0,    0,    0,  523,    0,    0,    0,  523,  523,    0,
-    0,    0,  523,    0,    0,    0,    0,    0,  523,    0,
-  523,  523,    0,  523,    0,  523,  523,  523,  523,  523,
-    0,  523,  523,  523,  523,  523,  523,  523,  523,  523,
-  523,  523,  523,  523,  523,  523,  523,    0,    0,  523,
-  523,  523,    0,  523,  523,  523,    0,  523,  523,  523,
-    0,  520,  523,    0,  523,    0,    0,  523,  523,  523,
-  523,  520,    0,  523,  523,  523,    0,    0,    0,    0,
-    0,  523,    0,    0,  523,  523,  523,  523,  523,  523,
-  523,  523,    0,  523,  523,  523,  523,  523,    0,    0,
-  523,    0,  520,    0,  522,  520,    0,  523,  523,  523,
-    0,    0,    0,    0,    0,    0,  523,  523,    0,    0,
-    0,    0,    0,  522,    0,  522,    0,    0,  522,  522,
-  522,  522,  522,  522,  522,    0,    0,  522,  522,  522,
-    0,    0,    0,    0,  522,  522,    0,    0,    0,  522,
-  522,    0,    0,    0,    0,    0,    0,    0,    0,  522,
-    0,    0,    0,  522,  522,    0,    0,    0,  522,    0,
-    0,    0,    0,    0,  522,    0,  522,  522,    0,  522,
-    0,  522,  522,  522,  522,  522,    0,  522,  522,  522,
-  522,  522,  522,  522,  522,  522,  522,  522,  522,  522,
-  522,  522,  522,    0,    0,  522,  522,  522,    0,  522,
-  522,  522,    0,  522,  522,  522,    0,  531,  522,    0,
-  522,    0,    0,  522,  522,  522,  522,  531,    0,  522,
-  522,  522,    0,    0,    0,    0,    0,  522,    0,    0,
-  522,  522,  522,  522,  522,  522,  522,  522,    0,  522,
-  522,  522,  522,  522,    0,    0,  522,    0,    0,    0,
-    0,  531,    0,  522,  522,  522,    0,    0,    0,    0,
-    0,    0,  522,  522,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  520,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  520,    0,  520,    0,
-    0,  520,  520,  520,  520,  520,  520,  520,    0,    0,
-  520,  520,  520,    0,    0,    0,    0,  520,  520,    0,
-    0,    0,  520,  520,    0,    0,    0,    0,    0,    0,
-    0,    0,  520,  535,    0,    0,  520,  520,    0,    0,
-    0,  520,    0,  535,    0,    0,    0,  520,    0,  520,
-  520,    0,  520,    0,  520,  520,  520,  520,  520,    0,
-  520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
-  520,  520,  520,  520,  520,  520,    0,  535,  520,  520,
-  520,    0,  520,  520,  520,    0,  520,  520,  520,    0,
-    0,  520,    0,  520,    0,    0,  520,  520,  520,  520,
-    0,    0,  520,  520,  520,    0,    0,    0,    0,    0,
-  520,    0,    0,  520,  520,  520,  520,  520,  520,  520,
-  520,    0,  520,  520,  520,  520,  520,    0,    0,  520,
-    0,    0,    0,  531,    0,    0,  520,  520,  520,    0,
-    0,    0,    0,    0,    0,  520,  520,    0,    0,    0,
-    0,    0,  531,    0,  531,    0,    0,  531,  531,  531,
-  531,  531,  531,  531,    0,    0,  531,  531,  531,    0,
-    0,    0,    0,  531,  531,    0,    0,    0,  531,  531,
-    0,    0,    0,    0,    0,    0,    0,    0,  531,  533,
-    0,    0,  531,  531,    0,    0,    0,  531,    0,  533,
-    0,    0,    0,  531,    0,  531,  531,    0,  531,    0,
-  531,  531,  531,  531,  531,    0,  531,  531,  531,  531,
-  531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-  531,  531,    0,  533,  531,  531,  531,    0,  531,  531,
-  531,    0,  531,  531,  531,    0,    0,  531,    0,  531,
-    0,    0,  531,  531,  531,  531,    0,  531,  531,  531,
-  531,    0,    0,    0,    0,    0,  531,    0,    0,  531,
-  531,  531,  531,  531,  531,  531,  531,    0,  531,  531,
-  531,  531,  531,    0,    0,  531,    0,    0,    0,  535,
-    0,    0,  531,  531,  531,    0,    0,    0,    0,    0,
-    0,  531,  531,    0,    0,    0,    0,    0,  535,    0,
-  535,    0,    0,  535,  535,  535,  535,  535,  535,  535,
-    0,    0,  535,  535,  535,    0,    0,    0,    0,  535,
-  535,    0,    0,    0,  535,  535,    0,    0,    0,    0,
-    0,    0,    0,    0,  535,  198,    0,    0,  535,  535,
-    0,    0,    0,  535,    0,  198,    0,    0,    0,  535,
-    0,  535,  535,    0,  535,    0,  535,  535,  535,  535,
-  535,    0,  535,  535,  535,  535,  535,  535,  535,  535,
-  535,  535,  535,  535,  535,  535,  535,  535,    0,  198,
-  535,  535,  535,    0,  535,  535,  535,    0,  535,  535,
-  535,    0,    0,  535,    0,  535,  198,    0,  535,  535,
-  535,  535,    0,  535,  535,  535,  535,    0,    0,    0,
-    0,    0,  535,    0,    0,  535,  535,  535,  535,  535,
-  535,  535,  535,    0,  535,  535,  535,  535,  535,    0,
-    0,  535,    0,    0,    0,  533,    0,    0,  535,  535,
-  535,    0,    0,    0,    0,    0,    0,  535,  535,    0,
-    0,    0,    0,    0,  533,    0,  533,    0,    0,  533,
-  533,  533,  533,  533,  533,  533,    0,    0,  533,  533,
-  533,    0,    0,    0,    0,  533,  533,    0,    0,    0,
-  533,  533,    0,    0,    0,    0,  156,    0,    0,    0,
-  533,    0,    0,    0,  533,  533,  156,    0,    0,  533,
-    0,    0,    0,    0,    0,  533,    0,  533,  533,    0,
-  533,    0,  533,  533,  533,  533,  533,    0,  533,  533,
-  533,  533,  533,  533,  533,  533,  533,  533,  533,  533,
-  533,  533,  533,  533,    0,    0,  533,  533,  533,    0,
-  533,  533,  533,    0,  533,  533,  533,    0,    0,  533,
-    0,  533,    0,    0,  533,  533,  533,  533,    0,  533,
-  533,  533,  533,    0,    0,    0,    0,    0,  533,    0,
-    0,  533,  533,  533,  533,  533,  533,  533,  533,    0,
-  533,  533,  533,  533,  533,    0,    0,  533,    0,    0,
-    0,  198,    0,    0,  533,  533,  533,    0,    0,    0,
-    0,    0,    0,  533,  533,    0,    0,    0,    0,    0,
-  198,    0,  198,    0,    0,  198,  198,  198,  198,  198,
-  198,  198,    0,    0,  198,  198,  198,    0,    0,    0,
-    0,  198,  198,    0,    0,    0,  198,  198,    0,    0,
-    0,    0,    0,    0,    0,    0,  198,    0,    0,    0,
-  198,  198,    0,    0,    0,  198,    0,    0,    0,    0,
-    0,  198,    0,  198,  198,    0,  198,    0,  198,  198,
-  198,  198,  198,    0,  198,  198,  198,  198,  198,  198,
-  198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
-    0,    0,  198,  198,  198,    0,  198,  198,  198,    0,
-  198,  198,  198,    0,  358,  198,    0,  198,    0,    0,
-  198,  198,  198,  198,  358,    0,  198,  198,  198,    0,
-    0,    0,    0,    0,  198,    0,    0,  198,  198,  198,
-  198,  198,  198,  198,  198,    0,  198,  198,  198,  198,
-  198,    0,  156,  198,    0,    0,    0,    0,  358,    0,
-  198,  198,  198,    0,    0,    0,    0,  156,  156,  198,
-  198,  156,    0,  156,    0,  360,  156,  156,  156,  156,
-  156,  156,  156,    0,    0,  156,  156,  156,    0,    0,
-    0,    0,  156,  156,    0,    0,    0,  156,  156,    0,
-    0,    0,    0,    0,    0,    0,    0,  156,    0,    0,
-    0,  156,  156,    0,    0,    0,  156,    0,    0,    0,
-    0,    0,  156,    0,  156,  156,    0,  156,    0,  156,
-  156,  156,  156,  156,    0,  156,  156,  156,  156,  156,
-  156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
-  156,    0,    0,  156,  156,  156,    0,  156,  156,  156,
-    0,  156,  156,  156,    0,  521,  156,    0,  156,    0,
-    0,  156,  156,  156,  156,  521,    0,  156,  156,  156,
-    0,    0,    0,    0,    0,  156,    0,    0,  156,  156,
-  156,  156,  156,  156,  156,  156,    0,  156,  156,  156,
-  156,  156,    0,    0,  156,    0,  521,    0,    0,  521,
-    0,  156,  156,  156,    0,    0,    0,    0,    0,    0,
-  156,  156,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,   533,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  358,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  358,
-    0,  358,    0,    0,  358,  358,  358,  358,  358,  358,
-  358,    0,    0,  358,  358,  358,    0,    0,    0,    0,
-  358,  358,    0,    0,    0,  358,  358,    0,   40,    0,
-    0,    0,    0,    0,    0,  358,    0,    0,   40,  358,
-  358,    0,    0,    0,  358,    0,    0,    0,    0,    0,
-  358,    0,  358,  358,    0,  358,    0,  358,  358,  358,
-  358,  358,    0,  358,  358,  358,  358,  358,  358,  358,
-  358,  358,  358,  358,  358,  358,  358,  358,  358,    0,
-    0,  358,  358,  358,    0,  358,  358,  358,    0,  358,
-  358,  358,    0,    0,  358,    0,  358,    0,    0,  358,
-  358,  358,  358,    0,    0,  358,  358,  358,    0,    0,
-    0,    0,    0,  358,    0,    0,  358,  358,  358,  358,
-  358,  358,  358,  358,    0,  358,  358,  358,  358,  358,
-    0,  521,  358,    0,    0,    0,    0,    0,    0,  358,
-  358,  358,    0,    0,    0,    0,    0,    0,  358,  358,
-  521,    0,  521,    0,    0,  521,  521,  521,  521,  521,
-  521,  521,    0,    0,  521,  521,  521,    0,    0,    0,
-    0,  521,  521,    0,    0,    0,  521,  521,    0,  530,
-    0,    0,    0,    0,    0,    0,  521,    0,    0,  530,
-  521,  521,    0,    0,    0,  521,    0,    0,    0,    0,
-    0,  521,    0,  521,  521,    0,  521,    0,  521,  521,
-  521,  521,  521,    0,  521,  521,  521,  521,  521,  521,
-  521,  521,  521,  521,  521,  521,  521,  521,  521,  521,
-    0,    0,  521,  521,  521,    0,  521,  521,  521,    0,
-  521,  521,  521,    0,    0,  521,    0,  521,    0,    0,
-  521,  521,  521,  521,    0,    0,  521,  521,  521,    0,
-    0,    0,    0,    0,  521,    0,    0,  521,  521,  521,
-  521,  521,  521,  521,  521,    0,  521,  521,  521,  521,
-  521,    0,    0,  521,   40,    0,    0,    0,    0,    0,
-  521,  521,  521,    0,    0,    0,    0,    0,    0,  521,
-  521,    0,    0,   40,    0,   40,   40,    0,   40,   40,
-   40,   40,   40,   40,   40,    0,    0,   40,   40,   40,
-    0,    0,    0,    0,   40,   40,    0,    0,    0,   40,
-   40,    0,  529,    0,    0,    0,    0,    0,    0,   40,
-    0,    0,  529,   40,   40,    0,    0,    0,   40,    0,
-    0,    0,    0,    0,   40,    0,   40,   40,    0,   40,
-    0,   40,   40,   40,   40,   40,    0,   40,   40,   40,
-   40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-   40,   40,   40,    0,    0,   40,   40,   40,    0,   40,
-   40,   40,    0,   40,   40,   40,    0,    0,   40,    0,
-   40,    0,    0,   40,   40,   40,   40,    0,    0,   40,
-   40,   40,    0,    0,    0,    0,    0,   40,    0,    0,
-   40,   40,   40,   40,   40,   40,   40,   40,    0,   40,
-   40,   40,   40,   40,    0,  530,   40,    0,    0,    0,
-    0,    0,    0,   40,   40,   40,    0,    0,    0,    0,
-    0,    0,   40,   40,  530,    0,  530,    0,    0,  530,
-  530,  530,  530,  530,  530,  530,    0,    0,  530,  530,
-  530,    0,    0,    0,    0,  530,  530,    0,    0,    0,
-  530,  530,    0,    0,    0,    0,    0,    0,    0,    0,
-  530,    0,    0,    0,  530,  530,    0,    0,    0,  530,
-    0,    0,    0,    0,    0,  530,    0,  530,  530,    0,
-  530,    0,  530,  530,  530,  530,  530,    0,  530,  530,
-  530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
-  530,  530,  530,  530,    0,    0,  530,  530,  530,    0,
-  530,  530,  530,    0,  530,  530,  530,    0,  525,  530,
-    0,  530,    0,    0,  530,  530,  530,  530,  525,  530,
-  530,  530,  530,    0,    0,    0,    0,    0,  530,    0,
-    0,  530,  530,  530,  530,  530,  530,  530,  530,    0,
-  530,  530,  530,  530,  530,    0,    0,  530,  529,  525,
-    0,    0,  525,    0,  530,  530,  530,    0,    0,    0,
-    0,    0,    0,  530,  530,    0,    0,  529,    0,  529,
-    0,    0,  529,  529,  529,  529,  529,  529,  529,    0,
-    0,  529,  529,  529,    0,    0,    0,    0,  529,  529,
-    0,    0,    0,  529,  529,    0,    0,    0,    0,    0,
-    0,    0,    0,  529,    0,    0,    0,  529,  529,    0,
-    0,    0,  529,    0,    0,    0,    0,    0,  529,    0,
-  529,  529,    0,  529,    0,  529,  529,  529,  529,  529,
-    0,  529,  529,  529,  529,  529,  529,  529,  529,  529,
-  529,  529,  529,  529,  529,  529,  529,    0,    0,  529,
-  529,  529,    0,  529,  529,  529,    0,  529,  529,  529,
-    0,  198,  529,    0,  529,    0,    0,  529,  529,  529,
-  529,  198,  529,  529,  529,  529,    0,    0,    0,    0,
-    0,  529,    0,    0,  529,  529,  529,  529,  529,  529,
-  529,  529,    0,  529,  529,  529,  529,  529,    0,    0,
-  529,    0,    0,    0,    0,  198,    0,  529,  529,  529,
-    0,    0,    0,    0,    0,    0,  529,  529,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  525,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  525,    0,  525,    0,    0,  525,  525,
-  525,  525,  525,  525,  525,    0,    0,  525,  525,  525,
-    0,    0,    0,    0,  525,  525,    0,    0,    0,  525,
-  525,    0,    0,    0,    0,    0,    0,    0,    0,  525,
-    0,    0,    0,  525,  525,    0,    0,    0,  525,    0,
-    0,    0,    0,    0,  525,    0,  525,  525,    0,  525,
-    0,  525,  525,  525,  525,  525,    0,  525,  525,  525,
-  525,  525,  525,  525,  525,  525,  525,  525,  525,  525,
-  525,  525,  525,    0,    0,  525,  525,  525,    0,  525,
-  525,  525,    0,  525,  525,  525,    0,  200,  525,    0,
-  525,    0,    0,  525,  525,  525,  525,  200,    0,  525,
-  525,  525,    0,    0,    0,    0,    0,  525,    0,    0,
-  525,  525,  525,  525,  525,  525,  525,  525,    0,  525,
-  525,  525,  525,  525,    0,    0,  525,  198,    0,    0,
-    0,  200,    0,  525,  525,    0,    0,    0,    0,    0,
-    0,    0,  525,  525,    0,    0,  198,    0,  198,    0,
-    0,  198,  198,  198,  198,  198,  198,  198,    0,    0,
-  198,  198,  198,    0,    0,    0,    0,  198,  198,    0,
-    0,    0,  198,  198,    0,    0,    0,    0,    0,    0,
-    0,    0,  198,    0,    0,    0,  198,  198,    0,    0,
-    0,  198,    0,    0,    0,    0,    0,  198,    0,  198,
-  198,    0,  198,    0,  198,  198,  198,  198,  198,    0,
-  198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
-  198,  198,  198,  198,  198,  198,    0,    0,  198,  198,
-  198,    0,  198,  198,  198,    0,  198,  198,  198,    0,
-  374,  198,    0,  198,    0,    0,  198,  198,  198,  198,
-  374,    0,  198,  198,  198,    0,    0,    0,    0,    0,
-  198,    0,    0,  198,  198,  198,  198,  198,  198,  198,
-  198,    0,  198,  198,  198,  198,  198,    0,    0,  198,
-    0,    0,    0,    0,  374,    0,  198,  198,  198,    0,
-    0,    0,    0,    0,    0,  198,  198,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  200,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  200,    0,  200,    0,    0,  200,  200,  200,
-  200,  200,  200,  200,    0,    0,  200,  200,  200,    0,
-    0,    0,    0,  200,  200,    0,    0,    0,  200,  200,
-    0,    0,    0,    0,    0,    0,    0,    0,  200,    0,
-    0,    0,  200,  200,    0,    0,    0,  200,    0,    0,
-    0,    0,    0,  200,    0,  200,  200,    0,  200,    0,
-  200,  200,  200,  200,  200,    0,  200,  200,  200,  200,
-  200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-  200,  200,    0,    0,  200,  200,  200,    0,  200,  200,
-  200,    0,  200,  200,  200,    0,  359,  200,    0,  200,
-    0,    0,  200,  200,  200,  200,  359,    0,  200,  200,
-  200,    0,    0,    0,    0,    0,  200,    0,    0,  200,
-  200,  200,  200,  200,  200,  200,  200,    0,  200,  200,
-  200,  200,  200,    0,    0,  200,  374,    0,    0,    0,
-  359,    0,  200,  200,  200,    0,    0,    0,    0,    0,
-    0,  200,  200,    0,    0,  374,    0,  374,    0,    0,
-  374,  374,  374,  374,  374,  374,  374,    0,    0,  374,
-  374,  374,    0,    0,    0,    0,  374,  374,    0,    0,
-    0,  374,  374,    0,    0,    0,    0,    0,    0,    0,
-    0,  374,    0,    0,    0,  374,  374,    0,    0,    0,
-  374,    0,    0,    0,    0,    0,  374,    0,  374,  374,
-    0,  374,    0,  374,  374,  374,  374,  374,    0,  374,
-  374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
-  374,  374,  374,  374,  374,    0,    0,  374,  374,  374,
-    0,  374,  374,  374,    0,  374,  374,  374,    0,   59,
-  374,    0,  374,    0,    0,  374,  374,  374,  374,   59,
-    0,  374,  374,  374,    0,    0,    0,    0,    0,  374,
-    0,    0,  374,  374,  374,  374,  374,  374,  374,  374,
-    0,  374,  374,  374,  374,  374,    0,    0,  374,    0,
-    0,    0,    0,    0,    0,  374,  374,  374,    0,    0,
-    0,    0,    0,    0,  374,  374,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  359,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  359,    0,  359,    0,    0,  359,  359,  359,  359,
-  359,  359,  359,    0,    0,  359,  359,  359,    0,    0,
-    0,    0,  359,  359,    0,    0,    0,  359,  359,    0,
-    0,    0,    0,    0,    0,    0,    0,  359,    0,    0,
-    0,  359,  359,    0,    0,    0,  359,    0,    0,    0,
-    0,    0,  359,    0,  359,  359,    0,  359,    0,  359,
-  359,  359,  359,  359,    0,  359,  359,  359,  359,  359,
-  359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
-  359,    0,    0,  359,  359,  359,    0,  359,  359,  359,
-    0,  359,  359,  359,    0,  125,  359,    0,  359,    0,
-    0,  359,  359,  359,  359,  125,    0,  359,  359,  359,
-    0,    0,    0,    0,    0,  359,    0,    0,  359,  359,
-  359,  359,  359,  359,  359,  359,    0,  359,  359,  359,
-  359,  359,    0,    0,  359,   59,    0,    0,    0,  125,
-    0,  359,  359,  359,    0,    0,    0,    0,    0,    0,
-  359,  359,    0,    0,   59,    0,   59,    0,    0,   59,
-   59,   59,   59,   59,   59,   59,    0,    0,   59,   59,
-   59,    0,    0,    0,    0,   59,   59,    0,    0,    0,
-   59,   59,    0,    0,    0,    0,    0,    0,    0,    0,
-   59,    0,    0,    0,   59,   59,    0,    0,    0,   59,
-    0,    0,    0,    0,    0,   59,    0,   59,   59,    0,
-   59,    0,   59,   59,   59,   59,   59,    0,   59,   59,
-   59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
-   59,   59,   59,   59,    0,    0,   59,   59,   59,    0,
-   59,   59,   59,    0,   59,   59,   59,    0,  432,   59,
-    0,   59,    0,    0,   59,   59,   59,   59,  432,    0,
-   59,   59,   59,    0,    0,    0,    0,    0,   59,    0,
-    0,   59,   59,   59,   59,   59,   59,   59,   59,    0,
-   59,   59,   59,   59,   59,    0,    0,   59,    0,    0,
-    0,    0,    0,    0,   59,   59,   59,    0,    0,    0,
-    0,    0,    0,   59,   59,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  125,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  125,    0,  125,    0,    0,  125,  125,  125,  125,  125,
-  125,  125,    0,    0,  125,  125,  125,    0,    0,    0,
-    0,  125,  125,    0,    0,    0,  125,  125,    0,  441,
-    0,    0,    0,    0,    0,    0,  125,    0,    0,  441,
-  125,  125,    0,    0,    0,  125,    0,    0,    0,    0,
-    0,  125,    0,  125,  125,    0,  125,    0,  125,  125,
-  125,  125,  125,    0,  125,  125,  125,  125,  125,  125,
-  125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
-    0,    0,  125,  125,  125,    0,  125,  125,  125,    0,
-  125,  125,  125,    0,    0,  125,    0,  125,    0,    0,
-  125,  125,  125,  125,    0,    0,  125,  125,  125,    0,
-    0,    0,    0,    0,  125,    0,    0,  125,  125,  125,
-  125,  125,  125,  125,  125,    0,  125,  125,  125,  125,
-  125,    0,    0,  125,  432,    0,    0,    0,    0,    0,
-  125,  125,    0,    0,    0,    0,    0,    0,    0,  125,
-  125,    0,    0,  432,    0,  432,    0,    0,  432,  432,
-  432,  432,  432,  432,  432,    0,    0,  432,  432,  432,
-    0,    0,    0,    0,  432,  432,    0,    0,    0,  432,
-  432,    0,  357,    0,    0,    0,    0,    0,    0,  432,
-    0,    0,  357,  432,  432,    0,    0,    0,  432,    0,
-    0,    0,    0,    0,  432,    0,  432,  432,    0,  432,
-    0,  432,  432,  432,  432,  432,    0,  432,  432,  432,
-  432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-  432,  432,  432,    0,    0,  432,  432,  432,    0,  432,
-  432,  432,    0,  432,  432,  432,    0,    0,  432,    0,
-  432,    0,    0,  432,  432,  432,  432,    0,    0,  432,
-  432,  432,    0,    0,    0,    0,    0,  432,    0,    0,
-  432,  432,  432,  432,  432,  432,  432,  432,    0,  432,
-  432,  432,  432,  432,    0,  441,  432,    0,    0,    0,
-    0,    0,    0,  432,  432,  432,    0,    0,    0,    0,
-    0,    0,  432,  432,  441,    0,  441,    0,    0,  441,
-  441,  441,  441,  441,  441,  441,    0,    0,  441,  441,
-  441,    0,    0,    0,    0,  441,  441,    0,    0,    0,
-  441,  441,    0,   69,    0,    0,    0,    0,    0,    0,
-  441,    0,    0,   69,  441,  441,    0,    0,    0,  441,
-    0,    0,    0,    0,    0,  441,    0,  441,  441,    0,
-  441,    0,  441,  441,  441,  441,  441,    0,  441,  441,
-  441,  441,  441,  441,  441,  441,  441,  441,  441,  441,
-  441,  441,  441,  441,    0,    0,  441,  441,  441,    0,
-  441,  441,  441,    0,  441,  441,  441,    0,    0,  441,
-    0,  441,    0,    0,  441,  441,  441,  441,    0,    0,
-  441,  441,  441,    0,    0,    0,    0,    0,  441,    0,
-    0,  441,  441,  441,  441,  441,  441,  441,  441,    0,
-  441,  441,  441,  441,  441,    0,    0,  441,  357,    0,
-    0,    0,    0,    0,  441,  441,  441,    0,    0,    0,
-    0,    0,    0,  441,  441,    0,    0,  357,    0,  357,
-    0,    0,  357,  357,  357,  357,  357,  357,  357,    0,
-    0,  357,  357,  357,    0,    0,    0,    0,  357,  357,
-    0,    0,    0,  357,  357,    0,   53,    0,    0,    0,
-    0,    0,    0,  357,    0,    0,   53,  357,  357,    0,
-    0,    0,  357,    0,    0,    0,    0,    0,  357,    0,
-  357,  357,    0,  357,    0,  357,  357,  357,  357,  357,
-    0,  357,  357,  357,  357,  357,  357,  357,  357,  357,
-  357,  357,  357,  357,  357,  357,  357,    0,    0,  357,
-  357,  357,    0,  357,  357,  357,    0,  357,  357,  357,
-    0,    0,  357,    0,  357,    0,    0,  357,  357,  357,
-  357,    0,    0,  357,  357,  357,    0,    0,    0,    0,
-    0,  357,    0,    0,  357,  357,  357,  357,  357,  357,
-  357,  357,    0,  357,  357,  357,  357,  357,    0,   69,
-  357,    0,    0,    0,    0,    0,    0,  357,  357,  357,
-    0,    0,    0,    0,    0,    0,  357,  357,   69,    0,
-   69,    0,    0,   69,   69,   69,   69,   69,   69,   69,
-    0,    0,   69,   69,   69,    0,    0,    0,    0,   69,
-   69,    0,    0,    0,   69,   69,    0,  169,    0,    0,
-    0,    0,    0,    0,   69,    0,    0,  169,   69,   69,
-    0,    0,    0,   69,    0,    0,    0,    0,    0,   69,
-    0,   69,   69,    0,   69,    0,   69,   69,   69,   69,
-   69,    0,   69,   69,   69,   69,   69,   69,   69,   69,
-   69,   69,   69,   69,   69,   69,   69,   69,    0,    0,
-   69,   69,   69,    0,   69,   69,   69,    0,   69,   69,
-   69,    0,    0,   69,    0,   69,    0,    0,   69,   69,
-   69,   69,    0,    0,   69,   69,   69,    0,    0,    0,
-    0,    0,   69,    0,    0,   69,   69,   69,   69,   69,
-   69,   69,   69,    0,   69,   69,   69,   69,   69,    0,
-    0,   69,   53,    0,    0,    0,    0,    0,   69,   69,
-   69,    0,    0,    0,    0,    0,    0,   69,   69,    0,
-    0,   53,    0,   53,    0,    0,   53,   53,   53,   53,
-   53,   53,   53,    0,    0,   53,   53,   53,    0,    0,
-    0,    0,   53,   53,    0,    0,    0,   53,   53,    0,
-  177,    0,    0,    0,    0,    0,    0,   53,    0,    0,
-  177,   53,   53,    0,    0,    0,   53,    0,    0,    0,
-    0,    0,   53,    0,   53,   53,    0,   53,    0,   53,
-   53,   53,   53,   53,    0,   53,   53,   53,   53,   53,
-   53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
-   53,    0,    0,   53,   53,   53,    0,   53,   53,   53,
-    0,   53,   53,   53,    0,    0,   53,    0,   53,    0,
-    0,   53,   53,   53,   53,    0,    0,   53,   53,   53,
-    0,    0,    0,    0,    0,   53,    0,    0,   53,   53,
-   53,   53,   53,   53,   53,   53,    0,   53,   53,   53,
-   53,   53,    0,  169,   53,    0,    0,    0,    0,    0,
-    0,   53,   53,   53,    0,    0,    0,    0,    0,    0,
-   53,   53,  169,    0,  169,    0,    0,  169,  169,  169,
-  169,  169,  169,  169,    0,    0,  169,  169,  169,    0,
-    0,    0,    0,  169,  169,    0,    0,    0,  169,  169,
-    0,   55,    0,    0,    0,    0,    0,    0,  169,    0,
-    0,   55,  169,  169,    0,    0,    0,  169,    0,    0,
-    0,    0,    0,  169,    0,  169,  169,    0,  169,    0,
-  169,  169,  169,  169,  169,    0,  169,  169,  169,  169,
-  169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
-  169,  169,    0,    0,  169,  169,  169,    0,  169,  169,
-  169,    0,  169,  169,  169,    0,    0,  169,    0,  169,
-    0,    0,  169,  169,  169,  169,    0,    0,  169,  169,
-  169,    0,    0,    0,    0,    0,  169,    0,    0,  169,
-  169,  169,  169,  169,  169,  169,  169,    0,  169,  169,
-  169,  169,  169,    0,    0,  169,  177,    0,    0,    0,
-    0,    0,  169,  169,  169,    0,    0,    0,    0,    0,
-    0,  169,  169,    0,    0,  177,    0,  177,    0,    0,
-  177,  177,  177,  177,  177,  177,  177,    0,    0,  177,
-  177,  177,    0,    0,    0,    0,  177,  177,    0,    0,
-    0,  177,  177,    0,  362,    0,    0,    0,    0,    0,
-    0,  177,    0,    0,  362,  177,  177,    0,    0,    0,
-  177,    0,    0,    0,    0,    0,  177,    0,  177,  177,
-    0,  177,    0,  177,  177,  177,  177,  177,    0,  177,
-  177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
-  177,  177,  177,  177,  177,    0,    0,  177,  177,  177,
-    0,  177,  177,  177,    0,  177,  177,  177,    0,    0,
-  177,    0,  177,    0,    0,  177,  177,  177,  177,    0,
-    0,  177,  177,  177,    0,    0,    0,    0,    0,  177,
-    0,    0,  177,  177,  177,  177,  177,  177,  177,  177,
-    0,  177,  177,  177,  177,  177,    0,   55,  177,    0,
-    0,    0,    0,    0,    0,  177,  177,  177,    0,    0,
-    0,    0,    0,    0,  177,  177,   55,    0,   55,    0,
-    0,   55,   55,   55,   55,   55,   55,   55,    0,    0,
-   55,   55,   55,    0,    0,    0,    0,   55,   55,    0,
-    0,    0,   55,   55,    0,  164,    0,    0,    0,    0,
-    0,    0,   55,    0,    0,  164,   55,   55,    0,    0,
-    0,   55,    0,    0,    0,    0,    0,   55,    0,   55,
-   55,    0,   55,    0,   55,   55,   55,   55,   55,    0,
-   55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-   55,   55,   55,   55,   55,   55,    0,    0,   55,   55,
-   55,    0,   55,   55,   55,    0,   55,   55,   55,    0,
-    0,   55,    0,   55,    0,    0,   55,   55,   55,   55,
-    0,    0,   55,   55,   55,    0,    0,    0,    0,    0,
-   55,    0,    0,   55,   55,   55,   55,   55,   55,   55,
-   55,    0,   55,   55,   55,   55,   55,    0,    0,   55,
-  362,    0,    0,    0,    0,    0,   55,   55,   55,    0,
-    0,    0,    0,    0,    0,   55,   55,    0,    0,  362,
-    0,  362,    0,    0,  362,  362,  362,  362,  362,  362,
-  362,    0,    0,  362,  362,  362,    0,    0,    0,    0,
-  362,  362,    0,    0,    0,  362,  362,    0,  406,    0,
-    0,    0,    0,    0,    0,  362,    0,    0,  406,  362,
-  362,    0,    0,    0,  362,    0,    0,    0,    0,    0,
-  362,    0,  362,  362,    0,  362,    0,  362,  362,  362,
-  362,  362,    0,  362,  362,  362,  362,  362,  362,  362,
-  362,  362,  362,  362,  362,  362,  362,  362,  362,    0,
-    0,  362,  362,  362,    0,  362,  362,  362,    0,  362,
-  362,  362,    0,    0,  362,    0,  362,    0,    0,  362,
-  362,  362,  362,    0,    0,  362,  362,  362,    0,    0,
-    0,    0,    0,  362,    0,    0,  362,  362,  362,  362,
-  362,  362,  362,  362,    0,  362,  362,  362,  362,  362,
-    0,  164,  362,    0,    0,    0,    0,    0,    0,  362,
-  362,  362,    0,    0,    0,    0,    0,    0,  362,  362,
-  164,    0,  164,    0,    0,  164,  164,  164,  164,  164,
-  164,  164,    0,    0,  164,  164,  164,    0,    0,    0,
-    0,  164,  164,    0,    0,    0,  164,  164,    0,  472,
-    0,    0,    0,    0,    0,    0,  164,    0,    0,  472,
-  164,  164,    0,    0,    0,  164,    0,    0,    0,    0,
-    0,  164,    0,  164,  164,    0,  164,    0,  164,  164,
-  164,  164,  164,    0,  164,  164,  164,  164,  164,  164,
-  164,  164,  164,  164,  164,  164,  164,  164,  164,  164,
-    0,    0,  164,  164,  164,    0,  164,  164,  164,    0,
-  164,  164,  164,    0,    0,  164,    0,  164,    0,    0,
-  164,  164,  164,  164,    0,    0,  164,  164,  164,    0,
-    0,    0,    0,    0,  164,    0,    0,  164,  164,  164,
-  164,  164,  164,  164,  164,    0,  164,  164,  164,  164,
-  164,    0,    0,  164,  406,    0,    0,    0,    0,    0,
-  164,  164,  164,    0,    0,    0,    0,    0,    0,  164,
-  164,    0,    0,  406,    0,  406,    0,    0,  406,  406,
-  406,  406,  406,  406,  406,    0,    0,  406,  406,  406,
-    0,    0,    0,    0,  406,  406,    0,    0,    0,  406,
-  406,    0,   34,    0,    0,    0,    0,    0,    0,  406,
-    0,    0,   34,  406,  406,    0,    0,    0,  406,    0,
-    0,    0,    0,    0,  406,    0,  406,  406,    0,  406,
-    0,  406,  406,  406,  406,  406,    0,  406,  406,  406,
-  406,  406,  406,  406,  406,  406,  406,  406,  406,  406,
-  406,  406,  406,    0,    0,  406,  406,  406,    0,  406,
-  406,  406,    0,  406,  406,  406,    0,    0,  406,    0,
-  406,    0,    0,  406,  406,  406,  406,    0,    0,  406,
-  406,  406,    0,    0,    0,    0,    0,  406,    0,    0,
-  406,  406,  406,  406,  406,  406,  406,  406,    0,  406,
-  406,  406,  406,  406,    0,  472,  406,    0,    0,    0,
-    0,    0,    0,  406,  406,  406,    0,    0,    0,    0,
-    0,    0,  406,  406,  472,    0,  472,    0,    0,  472,
-  472,  472,  472,  472,  472,  472,    0,    0,  472,  472,
-  472,    0,    0,    0,    0,  472,  472,    0,    0,    0,
-  472,  472,    0,  151,    0,    0,    0,    0,    0,    0,
-  472,    0,    0,  151,  472,  472,    0,    0,    0,  472,
-    0,    0,    0,    0,    0,  472,    0,  472,  472,    0,
-  472,    0,  472,  472,  472,  472,  472,    0,  472,  472,
-  472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
-  472,  472,  472,  472,    0,    0,  472,  472,  472,    0,
-  472,  472,  472,    0,  472,  472,  472,    0,    0,  472,
-    0,  472,    0,    0,  472,  472,  472,  472,    0,    0,
-  472,  472,  472,    0,    0,    0,    0,    0,  472,    0,
-    0,  472,  472,  472,  472,  472,  472,  472,  472,    0,
-  472,  472,  472,  472,  472,    0,    0,  472,   34,    0,
-    0,    0,    0,    0,  472,  472,  472,    0,    0,    0,
-    0,    0,    0,  472,  472,    0,    0,   34,    0,   34,
-    0,    0,   34,   34,   34,   34,   34,   34,   34,    0,
-    0,   34,   34,   34,    0,    0,    0,    0,   34,   34,
-    0,    0,    0,   34,   34,    0,  149,    0,    0,    0,
-    0,    0,    0,   34,    0,    0,  149,   34,   34,    0,
-    0,    0,   34,    0,    0,    0,    0,    0,   34,    0,
-   34,   34,    0,   34,    0,   34,   34,   34,   34,   34,
-    0,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-   34,   34,   34,   34,   34,   34,   34,    0,    0,   34,
-   34,   34,    0,   34,   34,   34,    0,   34,   34,   34,
-    0,    0,   34,    0,   34,    0,    0,   34,   34,   34,
-   34,    0,    0,   34,   34,   34,    0,    0,    0,    0,
-    0,   34,    0,    0,   34,   34,   34,   34,   34,   34,
-   34,   34,    0,   34,   34,   34,   34,   34,    0,  151,
-   34,    0,    0,    0,    0,    0,    0,   34,   34,   34,
-    0,    0,    0,    0,    0,    0,   34,   34,  151,    0,
-  151,    0,    0,  151,  151,  151,  151,  151,  151,  151,
-    0,    0,  151,  151,  151,    0,    0,    0,    0,  151,
-  151,    0,    0,    0,  151,  151,    0,   67,    0,    0,
-    0,    0,    0,    0,  151,    0,    0,   67,  151,  151,
-    0,    0,    0,  151,    0,    0,    0,    0,    0,  151,
-    0,  151,  151,    0,  151,    0,  151,  151,  151,  151,
-  151,    0,  151,  151,  151,  151,  151,  151,  151,  151,
-  151,  151,  151,  151,  151,  151,  151,  151,    0,    0,
-  151,  151,  151,    0,  151,  151,  151,    0,  151,  151,
-  151,    0,    0,  151,    0,  151,    0,    0,  151,  151,
-  151,  151,    0,    0,  151,  151,  151,    0,    0,    0,
-    0,    0,  151,    0,    0,  151,  151,  151,  151,  151,
-  151,  151,  151,    0,  151,  151,  151,  151,  151,    0,
-    0,  151,  149,    0,    0,    0,    0,    0,  151,  151,
-  151,    0,    0,    0,    0,    0,    0,  151,  151,    0,
-    0,  149,    0,  149,    0,    0,  149,  149,  149,  149,
-  149,  149,  149,    0,    0,  149,  149,  149,    0,    0,
-    0,    0,  149,  149,    0,    0,    0,  149,  149,    0,
-   68,    0,    0,    0,    0,    0,    0,  149,    0,    0,
-   68,  149,  149,    0,    0,    0,  149,    0,    0,    0,
-    0,    0,  149,    0,  149,  149,    0,  149,    0,  149,
-  149,  149,  149,  149,    0,  149,  149,  149,  149,  149,
-  149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
-  149,    0,    0,  149,  149,  149,    0,  149,  149,  149,
-    0,  149,  149,  149,    0,    0,  149,    0,  149,    0,
-    0,  149,  149,  149,  149,    0,    0,  149,  149,  149,
-    0,    0,    0,    0,    0,  149,    0,    0,  149,  149,
-  149,  149,  149,  149,  149,  149,    0,  149,  149,  149,
-  149,  149,    0,   67,  149,    0,    0,    0,    0,    0,
-    0,  149,  149,  149,    0,    0,    0,    0,    0,    0,
-  149,  149,   67,    0,   67,    0,    0,   67,   67,   67,
-   67,   67,   67,   67,    0,    0,   67,   67,   67,    0,
-    0,    0,    0,   67,   67,    0,    0,    0,   67,   67,
-    0,   40,    0,    0,    0,    0,    0,    0,   67,    0,
-    0,   40,   67,   67,    0,    0,    0,   67,    0,    0,
-    0,    0,    0,   67,    0,   67,   67,    0,   67,    0,
-   67,   67,   67,   67,   67,    0,   67,   67,   67,   67,
-   67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-   67,   67,    0,    0,   67,   67,   67,    0,   67,   67,
-   67,    0,   67,   67,   67,    0,    0,   67,    0,   67,
-    0,    0,   67,   67,   67,   67,    0,    0,   67,   67,
-   67,    0,    0,    0,    0,    0,   67,    0,    0,   67,
-   67,   67,   67,   67,   67,   67,   67,    0,   67,   67,
-   67,   67,   67,    0,    0,   67,   68,    0,    0,    0,
-    0,    0,   67,   67,   67,    0,    0,    0,    0,    0,
-    0,   67,   67,    0,    0,   68,    0,   68,    0,    0,
-   68,   68,   68,   68,   68,   68,   68,    0,    0,   68,
-   68,   68,    0,    0,    0,    0,   68,   68,    0,    0,
-    0,   68,   68,    0,  438,    0,    0,    0,    0,    0,
-    0,   68,    0,    0,  438,   68,   68,    0,    0,    0,
-   68,    0,    0,    0,    0,    0,   68,    0,   68,   68,
-    0,   68,    0,   68,   68,   68,   68,   68,    0,   68,
-   68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
-   68,   68,   68,   68,   68,    0,    0,   68,   68,   68,
-    0,   68,   68,   68,    0,   68,   68,   68,    0,    0,
-   68,    0,   68,    0,    0,   68,   68,   68,   68,    0,
-    0,   68,   68,   68,    0,    0,    0,    0,    0,   68,
-    0,    0,   68,   68,   68,   68,   68,   68,   68,   68,
-    0,   68,   68,   68,   68,   68,    0,   40,   68,    0,
-    0,    0,    0,    0,    0,   68,   68,   68,    0,    0,
-    0,    0,    0,    0,   68,   68,   40,    0,   40,    0,
-    0,   40,   40,   40,   40,   40,   40,   40,    0,    0,
-   40,   40,   40,    0,    0,    0,    0,   40,   40,    0,
-    0,    0,   40,   40,    0,  439,    0,    0,    0,    0,
-    0,    0,   40,    0,    0,  439,   40,   40,    0,    0,
-    0,   40,    0,    0,    0,    0,    0,   40,    0,   40,
-   40,    0,   40,    0,   40,   40,   40,   40,   40,    0,
-   40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-   40,   40,   40,   40,   40,   40,    0,    0,   40,   40,
-   40,    0,   40,   40,   40,    0,   40,   40,   40,    0,
-    0,   40,    0,   40,    0,    0,   40,   40,   40,   40,
-    0,    0,   40,   40,   40,    0,    0,    0,    0,    0,
-   40,    0,    0,   40,   40,   40,   40,   40,   40,   40,
-   40,    0,   40,   40,   40,   40,   40,    0,    0,   40,
-  438,    0,    0,    0,    0,    0,   40,   40,   40,    0,
-    0,    0,    0,    0,    0,   40,   40,    0,    0,  438,
-    0,  438,    0,    0,  438,  438,  438,  438,  438,  438,
-  438,    0,    0,  438,  438,  438,    0,    0,    0,    0,
-  438,  438,    0,    0,    0,  438,  438,    0,  467,    0,
-    0,    0,    0,    0,    0,  438,    0,    0,  467,  438,
-  438,    0,    0,    0,  438,    0,    0,    0,    0,    0,
-  438,    0,  438,  438,    0,  438,    0,  438,  438,  438,
-  438,  438,    0,  438,  438,  438,  438,  438,  438,  438,
-  438,  438,  438,  438,  438,  438,  438,  438,  438,    0,
-    0,  438,  438,  438,    0,  438,  438,  438,    0,  438,
-  438,  438,    0,    0,  438,    0,  438,    0,    0,  438,
-  438,  438,  438,    0,    0,  438,  438,  438,    0,    0,
-    0,    0,    0,  438,    0,    0,  438,  438,  438,  438,
-  438,  438,  438,  438,    0,  438,  438,  438,  438,  438,
-    0,  439,  438,    0,    0,    0,    0,    0,    0,  438,
-  438,  438,    0,    0,    0,    0,    0,    0,  438,  438,
-  439,    0,  439,    0,    0,  439,  439,  439,  439,  439,
-  439,  439,    0,    0,  439,  439,  439,    0,    0,    0,
-    0,  439,  439,    0,    0,    0,  439,  439,    0,   43,
-    0,    0,    0,    0,    0,    0,  439,    0,    0,   43,
-  439,  439,    0,    0,    0,  439,    0,    0,    0,    0,
-    0,  439,    0,  439,  439,    0,  439,    0,  439,  439,
-  439,  439,  439,    0,  439,  439,  439,  439,  439,  439,
-  439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
-    0,    0,  439,  439,  439,    0,  439,  439,  439,    0,
-  439,  439,  439,    0,    0,  439,    0,  439,    0,    0,
-  439,  439,  439,  439,    0,    0,  439,  439,  439,    0,
-    0,    0,    0,    0,  439,    0,    0,  439,  439,  439,
-  439,  439,  439,  439,  439,    0,  439,  439,  439,  439,
-  439,    0,    0,  439,  467,    0,    0,    0,    0,    0,
-  439,  439,  439,    0,    0,    0,    0,    0,    0,  439,
-  439,    0,    0,  467,    0,  467,    0,    0,  467,  467,
-  467,  467,  467,  467,  467,    0,    0,  467,  467,  467,
-    0,    0,    0,    0,  467,  467,    0,    0,    0,  467,
-  467,    0,  363,    0,    0,    0,    0,    0,    0,  467,
-    0,    0,  363,  467,  467,    0,    0,    0,  467,    0,
-    0,    0,    0,    0,  467,    0,  467,  467,    0,  467,
-    0,  467,  467,  467,  467,  467,    0,  467,  467,  467,
-  467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
-  467,  467,  467,    0,    0,  467,  467,  467,    0,  467,
-  467,  467,    0,  467,  467,  467,    0,    0,  467,    0,
-  467,    0,    0,  467,  467,  467,  467,    0,    0,  467,
-  467,  467,    0,    0,    0,    0,    0,  467,    0,    0,
-  467,  467,  467,  467,  467,  467,  467,  467,    0,  467,
-  467,  467,  467,  467,    0,   43,  467,    0,    0,    0,
-    0,    0,    0,  467,  467,  467,    0,    0,    0,    0,
-    0,    0,  467,  467,   43,    0,   43,    0,    0,   43,
-   43,   43,   43,   43,   43,   43,    0,    0,   43,   43,
-   43,    0,    0,    0,    0,   43,   43,    0,    0,    0,
-   43,   43,    0,  473,    0,    0,    0,    0,    0,    0,
-   43,    0,    0,  473,   43,   43,    0,    0,    0,   43,
-    0,    0,    0,    0,    0,   43,    0,   43,   43,    0,
-   43,    0,   43,   43,   43,   43,   43,    0,   43,   43,
-   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
-   43,   43,   43,   43,    0,    0,   43,   43,   43,    0,
-   43,   43,   43,    0,   43,   43,   43,    0,    0,   43,
-    0,   43,    0,    0,   43,   43,   43,   43,    0,    0,
-   43,   43,   43,    0,    0,    0,    0,    0,   43,    0,
-    0,   43,   43,   43,   43,   43,   43,   43,   43,    0,
-   43,   43,   43,   43,   43,    0,    0,   43,  363,    0,
-    0,    0,    0,    0,   43,   43,   43,    0,    0,    0,
-    0,    0,    0,   43,   43,    0,    0,  363,    0,  363,
-    0,    0,  363,  363,  363,  363,  363,  363,  363,    0,
-    0,  363,  363,  363,    0,    0,    0,    0,  363,  363,
-    0,    0,    0,  363,  363,    0,  365,    0,    0,    0,
-    0,    0,    0,  363,    0,    0,  365,  363,  363,    0,
-    0,    0,  363,    0,    0,    0,    0,    0,  363,    0,
-  363,  363,    0,  363,    0,  363,  363,  363,  363,  363,
-    0,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-  363,  363,  363,  363,  363,  363,  363,    0,    0,  363,
-  363,  363,    0,  363,  363,  363,    0,  363,  363,  363,
-    0,    0,  363,    0,  363,    0,    0,  363,  363,  363,
-  363,    0,    0,  363,  363,  363,    0,    0,    0,    0,
-    0,  363,    0,    0,  363,  363,  363,  363,  363,  363,
-  363,  363,    0,  363,  363,  363,  363,  363,    0,  473,
-  363,    0,    0,    0,    0,    0,    0,  363,  363,  363,
-    0,    0,    0,    0,    0,    0,  363,  363,  473,    0,
-  473,    0,    0,  473,  473,  473,  473,  473,  473,  473,
-    0,    0,  473,  473,  473,    0,    0,    0,    0,  473,
-  473,    0,    0,    0,  473,  473,    0,  409,    0,    0,
-    0,    0,    0,    0,  473,    0,    0,  409,  473,  473,
-    0,    0,    0,  473,    0,    0,    0,    0,    0,  473,
-    0,  473,  473,    0,  473,    0,  473,  473,  473,  473,
-  473,    0,  473,  473,  473,  473,  473,  473,  473,  473,
-  473,  473,  473,  473,  473,  473,  473,  473,    0,    0,
-  473,  473,  473,    0,  473,  473,  473,    0,  473,  473,
-  473,    0,    0,  473,    0,  473,    0,    0,  473,  473,
-  473,  473,    0,    0,  473,  473,  473,    0,    0,    0,
-    0,    0,  473,    0,    0,  473,  473,  473,  473,  473,
-  473,  473,  473,    0,  473,  473,  473,  473,  473,    0,
-    0,  473,  365,    0,    0,    0,    0,    0,  473,  473,
-  473,    0,    0,    0,    0,    0,    0,  473,  473,    0,
-    0,  365,    0,  365,    0,    0,  365,  365,  365,  365,
-  365,  365,  365,    0,    0,  365,  365,  365,    0,    0,
-    0,    0,  365,  365,    0,    0,    0,  365,  365,    0,
-  549,    0,    0,    0,    0,    0,    0,  365,    0,    0,
-  549,  365,  365,    0,    0,    0,  365,    0,    0,    0,
-    0,    0,  365,    0,  365,  365,    0,  365,    0,  365,
-  365,  365,  365,  365,    0,  365,  365,  365,  365,  365,
-  365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-  365,    0,    0,  365,  365,  365,    0,  365,  365,  365,
-    0,  365,  365,  365,    0,    0,  365,    0,  365,    0,
-    0,  365,  365,  365,  365,    0,    0,  365,  365,  365,
-    0,    0,    0,    0,    0,  365,    0,    0,  365,  365,
-  365,  365,  365,  365,  365,  365,    0,  365,  365,  365,
-  365,  365,    0,  409,  365,    0,    0,    0,    0,    0,
-    0,  365,  365,  365,    0,    0,    0,    0,    0,    0,
-  365,  365,  409,    0,  409,    0,    0,  409,  409,  409,
-  409,  409,  409,  409,    0,    0,  409,  409,  409,    0,
-    0,    0,    0,  409,  409,    0,    0,    0,  409,  409,
-    0,  410,    0,    0,    0,    0,    0,    0,  409,    0,
-    0,  410,  409,  409,    0,    0,    0,  409,    0,    0,
-    0,    0,    0,  409,    0,  409,  409,    0,  409,    0,
-  409,  409,  409,  409,  409,    0,  409,  409,  409,  409,
-  409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
-  409,  409,    0,    0,  409,  409,  409,    0,  409,  409,
-  409,    0,  409,  409,  409,    0,    0,  409,    0,  409,
-    0,    0,  409,  409,  409,  409,    0,    0,  409,  409,
-  409,    0,    0,    0,    0,    0,  409,    0,    0,  409,
-  409,  409,  409,  409,  409,  409,  409,    0,  409,  409,
-  409,  409,  409,    0,    0,  409,  549,    0,    0,    0,
-    0,    0,  409,  409,  409,    0,    0,    0,    0,    0,
-    0,  409,  409,    0,    0,  549,    0,  549,    0,    0,
-  549,  549,  549,  549,  549,  549,  549,    0,    0,  549,
-  549,  549,    0,    0,    0,    0,  549,  549,    0,    0,
-    0,  549,  549,    0,  415,    0,    0,    0,    0,    0,
-    0,  549,    0,    0,  415,  549,  549,    0,    0,    0,
-  549,    0,    0,    0,    0,    0,  549,    0,  549,  549,
-    0,  549,    0,  549,  549,  549,  549,  549,    0,  549,
-  549,  549,  549,  549,  549,  549,  549,  549,  549,  549,
-  549,  549,  549,  549,  549,    0,    0,  549,  549,  549,
-    0,  549,  549,  549,    0,  549,  549,  549,    0,    0,
-  549,    0,  549,    0,    0,  549,  549,  549,  549,    0,
-    0,  549,  549,  549,    0,    0,    0,    0,    0,  549,
-    0,    0,  549,  549,  549,  549,  549,  549,  549,  549,
-    0,  549,  549,  549,  549,  549,    0,  410,  549,    0,
-    0,    0,    0,    0,    0,  549,  549,  549,    0,    0,
-    0,    0,    0,    0,  549,  549,  410,    0,  410,    0,
-    0,  410,  410,  410,  410,  410,  410,  410,    0,    0,
-  410,  410,  410,    0,    0,    0,    0,  410,  410,    0,
-    0,    0,  410,  410,    4,    0,    0,    0,    0,    0,
-    0,    0,  410,    0,    4,    0,  410,  410,    0,    0,
-    0,  410,    0,    0,    0,    0,    0,  410,    0,  410,
-  410,    0,  410,    0,  410,  410,  410,  410,  410,    0,
-  410,  410,  410,  410,  410,  410,  410,  410,  410,  410,
-  410,  410,  410,  410,  410,  410,    0,    0,  410,  410,
-  410,    0,  410,  410,  410,    0,  410,  410,  410,    0,
-    0,  410,    0,  410,    0,    0,  410,  410,  410,  410,
-    0,    0,  410,  410,  410,    0,    0,    0,    0,    0,
-  410,    0,    0,  410,  410,  410,  410,  410,  410,  410,
-  410,    0,  410,  410,  410,  410,  410,    0,    0,  410,
-  415,    0,    0,    0,    0,    0,  410,  410,  410,    0,
-    0,    0,    0,    0,    0,  410,  410,    0,    0,  415,
-    0,  415,    0,    0,  415,  415,  415,  415,  415,  415,
-  415,    0,    0,  415,  415,  415,    0,    0,    0,    0,
-  415,  415,    0,    0,    0,  415,  415,  411,    0,    0,
-    0,    0,    0,    0,    0,  415,    0,  411,    0,  415,
-  415,    0,    0,    0,  415,    0,    0,    0,    0,    0,
-  415,    0,  415,  415,    0,  415,    0,  415,  415,  415,
-  415,  415,    0,  415,  415,  415,  415,  415,  415,  415,
-  415,  415,  415,  415,  415,  415,  415,  415,  415,    0,
-    0,  415,  415,  415,    0,  415,  415,  415,    0,  415,
-  415,  415,    0,    0,  415,    0,  415,    0,    0,  415,
-  415,  415,  415,    0,    0,  415,  415,  415,    0,    0,
-    0,    0,    0,  415,    0,    0,  415,  415,  415,  415,
-  415,  415,  415,  415,    0,  415,  415,  415,  415,  415,
-    4,    0,  415,    0,    0,    0,    0,    0,    0,  415,
-  415,    0,    0,    0,    0,    0,    0,    0,  415,  415,
-    0,    4,    0,    0,    4,    4,    4,    4,    4,    4,
-    4,    0,    0,    4,    4,    4,    0,    0,    0,    0,
-    4,    4,    0,    0,    0,    4,    4,    0,  408,    0,
-    0,    0,    0,    0,    0,    4,    0,    0,  408,    4,
-    4,    0,    0,    0,    4,    0,    0,    0,    0,    0,
-    4,    0,    4,    4,    0,    4,    0,    4,    4,    4,
-    4,    4,    0,    4,    4,    4,    4,    4,    4,    4,
-    4,    4,    4,    4,    4,    4,    4,    4,    4,    0,
-    0,    4,    4,    4,    0,    4,    4,    4,    0,    4,
-    4,    4,    0,    0,    4,    0,    4,    0,    0,    4,
-    4,    4,    4,    0,    0,    4,    4,    4,    0,    0,
-    0,    0,    0,    4,    0,    0,    4,    4,    4,    4,
-    4,    4,    4,    4,    0,    4,    4,    4,    4,    4,
-    0,    0,    4,  411,    0,    0,    0,    0,    0,    4,
-    4,    4,    0,    0,    0,    0,    0,    0,    4,    4,
-    0,    0,  411,    0,  411,    0,    0,  411,  411,  411,
-  411,  411,  411,  411,    0,    0,  411,  411,  411,    0,
-    0,    0,    0,  411,  411,    0,    0,    0,  411,  411,
-    0,  354,    0,    0,    0,    0,    0,    0,  411,    0,
-    0,  354,  411,  411,    0,    0,    0,  411,    0,    0,
-    0,    0,    0,  411,    0,  411,  411,    0,  411,    0,
-  411,  411,  411,  411,  411,    0,  411,  411,  411,  411,
-  411,  411,  411,  411,  411,  411,  411,  411,  411,  411,
-  411,  411,    0,    0,  411,  411,  411,    0,  411,  411,
-  411,    0,  411,  411,  411,    0,    0,  411,    0,  411,
-    0,    0,  411,  411,  411,  411,    0,    0,  411,  411,
-  411,    0,    0,    0,    0,    0,  411,    0,    0,  411,
-  411,  411,  411,  411,  411,  411,  411,    0,  411,  411,
-  411,  411,  411,    0,  408,  411,    0,    0,    0,    0,
-    0,    0,  411,  411,  411,    0,    0,    0,    0,    0,
-    0,    0,  411,  408,    0,  408,    0,    0,  408,  408,
-  408,  408,  408,  408,  408,    0,    0,  408,  408,  408,
-    0,    0,    0,    0,  408,  408,    0,    0,    0,  408,
-  408,    0,  455,    0,    0,    0,    0,    0,    0,  408,
-    0,    0,  455,  408,  408,    0,    0,    0,  408,    0,
-    0,    0,    0,    0,  408,    0,  408,  408,    0,  408,
-    0,  408,  408,  408,  408,  408,    0,  408,  408,  408,
-  408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
-  408,  408,  408,    0,    0,  408,  408,  408,    0,  408,
-  408,  408,    0,  408,  408,  408,    0,    0,  408,    0,
-  408,    0,    0,  408,  408,  408,  408,    0,    0,  408,
-  408,  408,    0,    0,    0,    0,    0,  408,    0,    0,
-  408,  408,  408,  408,  408,  408,  408,  408,    0,  408,
-  408,  408,  408,  408,    0,    0,  408,  354,    0,    0,
-    0,    0,    0,  408,  408,    0,    0,    0,    0,    0,
-    0,    0,  408,  408,    0,    0,  354,    0,  354,    0,
-    0,  354,  354,  354,  354,  354,  354,  354,    0,    0,
-  354,  354,  354,    0,    0,    0,    0,  354,  354,    0,
-    0,    0,  354,  354,    0,   24,    0,    0,    0,    0,
-    0,    0,  354,    0,    0,   24,  354,  354,    0,    0,
-    0,  354,    0,    0,    0,    0,    0,  354,    0,  354,
-  354,    0,  354,    0,  354,  354,  354,  354,  354,    0,
-  354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
-  354,  354,  354,  354,  354,  354,    0,    0,  354,  354,
-  354,    0,  354,  354,  354,    0,  354,  354,  354,    0,
-    0,  354,    0,  354,    0,    0,  354,  354,  354,  354,
-    0,    0,  354,  354,  354,    0,    0,    0,    0,    0,
-  354,    0,    0,  354,  354,  354,  354,    0,  354,  354,
-  354,    0,  354,  354,  354,  354,  354,    0,  455,  354,
-    0,    0,    0,    0,    0,    0,  354,  354,    0,    0,
-    0,    0,    0,    0,    0,    0,  354,  455,    0,  455,
-    0,    0,  455,  455,  455,  455,  455,  455,  455,    0,
-    0,  455,  455,  455,    0,    0,    0,    0,  455,  455,
-    0,    0,    0,  455,  455,    0,    0,    0,    0,    0,
-    0,    0,    0,  455,    0,    0,    0,  455,  455,    0,
-    0,    0,  455,    0,    0,    0,    0,    0,  455,    0,
-  455,  455,    0,  455,    0,  455,  455,  455,  455,  455,
-    0,  455,  455,  455,  455,  455,  455,  455,  455,  455,
-  455,  455,  455,  455,  455,  455,  455,    0,    0,  455,
-  455,  455,    0,  455,  455,  455,    0,  455,  455,  455,
-    0,    0,  455,    0,  455,    0,    0,  455,  455,  455,
-  455,    0,    0,  455,  455,  455,    0,  188,    0,  540,
-  150,  455,  151,    0,  455,  455,  455,  455,    0,  455,
-  455,  455,    0,  455,  455,  455,  455,  455,  545,    0,
-  455,   24,    0,    0,    0,    0,    0,  455,  455,    0,
-    0,    0,    0,    0,    0,    0,    0,  455,    0,    0,
-   24,    0,   24,    0,    0,   24,   24,   24,   24,   24,
-   24,   24,    0,    0,   24,   24,   24,    0,    0,    0,
-    0,   24,   24,    0,    0,    0,   24,   24,    0,  638,
-  417,  415,    0,  416,    0,    0,   24,    0,    0,    0,
-   24,   24,    0,    0,    0,   24,  901,    0,  420,  403,
-  421,   24,    0,   24,   24,    0,   24,    0,   24,   24,
-   24,   24,   24,    0,   24,   24,   24,   24,   24,   24,
-   24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
-    0,    0,   24,   24,   24,    0,   24,   24,   24,    0,
-   24,   24,   24,    0,    0,   24,    0,   24,    0,    0,
-   24,   24,   24,   24,    0,    0,   24,   24,   24,    0,
-  188,    0,  540,  150,   24,  151,    0,   24,   24,   24,
-   24,   24,   24,   24,   24,    0,   24,   24,   24,   24,
-   24,  734,    0,   24,    0,    0,    0,    0,    0,    0,
-   24,   24,   24,    0,    0,    0,    0,    0,    0,   24,
-    0,    0,    0,    0,    0,    0,    0,    0,  188,    0,
-    0,  150,    0,  151,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  644,
-  149,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  177,  188,    0,    0,
-  150,    0,  151,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,  666,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,  149,   89,    0,    0,    0,    0,    0,
-    0,  187,    0,    0,    0,  188,    0,    0,  150,    0,
-  151,    0,    0,    0,    0,    0,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,  668,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,  149,  165,  166,  167,    0,    0,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,    0,  176,    0,    0,
-    0,    0,    0,    0,    0,  152,  153,    0,    0,    0,
-  154,  155,  156,  157,    0,    0,    0,    0,    0,    0,
-    0,    0,  158,  159,  160,  161,  162,  163,  164,    0,
-  165,  166,  167,    0,    0,  168,  169,  170,    0,  171,
-  172,  173,  174,  175,    0,  176,    0,    0,    0,  177,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,    0,    0,    0,  180,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,    0,  188,   89,  706,  150,
-    0,  151,    0,    0,  187,    0,    0,  177,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  178,  179,
-    0,    0,    0,    0,  180,    0,    0,    0,    0,    0,
-  149,    0,    0,    0,  181,  182,    0,    0,  183,  184,
-  185,  186,    0,    0,  188,   89,  540,  150,    0,  151,
-    0,    0,  187,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,  149,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,    0,  176,    0,    0,    0,  177,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,  188,    0,   89,  150,    0,  151,    0,    0,
-    0,  187,    0,    0,  177,    0,    0,    0,    0,    0,
-  813,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,    0,  149,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,  188,    0,    0,  150,  187,
-  151,    0,    0,  152,  153,    0,    0,    0,  154,  155,
-  156,  157,    0,  898,    0,    0,    0,    0,    0,    0,
-  158,  159,  160,  161,  162,  163,  164,  149,  165,  166,
-  167,    0,    0,  168,  169,  170,    0,  171,  172,  173,
-  174,  175,    0,  176,    0,    0,    0,    0,    0,    0,
-    0,  152,  153,    0,    0,    0,  154,  155,  156,  157,
-    0,    0,    0,    0,    0,    0,    0,    0,  158,  159,
-  160,  161,  162,  163,  164,    0,  165,  166,  167,    0,
-    0,  168,  169,  170,    0,  171,  172,  173,  174,  175,
-    0,  176,    0,    0,    0,  177,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  178,  179,    0,    0,
-    0,    0,  180,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  181,  182,    0,    0,  183,  184,  185,  186,
-    0,    0,    0,   89,  188,    0,  709,  150,    0,  151,
-  187,    0,    0,  177,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,    0,    0,
-  180,    0,    0,    0,    0,  149,    0,    0,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,    0,
-    0,   89,  188,    0,  951,  150,    0,  151,  187,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  177,  176,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,  188,    0,   89,
-  150,    0,  151,    0,    0,    0,  187,    0,    0,    0,
-    0,    0,    0,    0,  177,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,  149,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-  382,    0,   89,  150,    0,  151,    0,    0,    0,  187,
-    0,  152,  153,    0,    0,    0,  154,  155,  156,  157,
-    0,    0,    0,    0,    0,    0,    0,    0,  158,  159,
-  160,  161,  162,  163,  164,  149,  165,  166,  167,    0,
-    0,  168,  169,  170,    0,  171,  172,  173,  174,  175,
-    0,  176,    0,    0,    0,    0,    0,    0,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,    0,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,  177,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,    0,    0,
-  180,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,  188,
-    0,   89,  150,    0,  151,    0,    0,    0,  187,    0,
-    0,  177,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-  149,    0,    0,    0,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,  507,    0,   89,
-  150,    0,  151,    0,  152,  153,  187,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,  149,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,    0,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,    0,  165,  166,  167,    0,    0,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,  177,  176,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,  382,    0,   89,  150,    0,  151,    0,    0,
-    0,  187,    0,    0,    0,    0,    0,    0,    0,  177,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,    0,    0,    0,  180,    0,    0,    0,
-    0,    0,  149,    0,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,  908,    0,   89,  150,    0,
-  151,    0,    0,    0,  187,    0,  152,  153,    0,    0,
-    0,  154,  155,  156,  157,    0,    0,    0,    0,    0,
-    0,    0,    0,  158,  159,  160,  161,  162,  163,  164,
-  149,  165,  166,  167,    0,    0,  168,  169,  170,    0,
-  171,  172,  173,  174,  175,    0,  176,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,  567,    0,  564,  333,    0,  334,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,  177,    0,
-  341,    0,  335,  333,    0,  334,    0,    0,    0,  178,
-  179,    0,    0,    0,    0,  180,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  181,  182,    0,    0,  183,
-  184,  185,  186,    0,    0,    0,   89,    0,    0,    0,
-    0,    0,    0,  445,    0,    0,  177,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,  149,  247,  247,  247,    0,
-  247,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,  247,   89,  247,  247,  247,    0,  152,
-  153,  187,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,  518,  518,  518,
-  518,  518,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,  518,  518,  518,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  177,  176,  437,  417,  415,    0,  416,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,  565,  180,    0,
-    0,    0,  420,  403,  421,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,  601,  417,  415,  892,
-  416,    0,  336,  337,  338,    0,  187,  339,    0,    0,
-    0,    0,    0,    0,  177,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,  336,  337,
-  338,  181,  182,  339,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,    0,    0,  247,  247,  247,  247,  247,    0,  247,
-  247,  247,  247,  247,  247,    0,    0,  247,  247,  608,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,  420,  403,
-  421,    0,    0,  622,  417,  415,    0,  416,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,    0,
-    0,  566,  420,  403,  421,    0,    0,    0,  187,    0,
-  178,  179,    0,    0,  518,  518,  518,  518,  518,    0,
-  518,  518,  518,  518,  518,  518,  181,  182,  518,  518,
-  183,  184,  185,  186,  638,  417,  415,  340,  416,    0,
-    0,    0,    0,    0,  187,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  672,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,  677,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,  679,  417,  415,    0,  416,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  420,  403,  421,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,  781,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  782,  417,  415,
-    0,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,  783,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,  784,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,  785,  417,
-  415,    0,  416,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  420,  403,  421,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  786,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,  787,  417,  415,    0,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  788,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,  789,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,    0,
-    0,    0,    0,    0,    0,  404,  405,  406,  407,  408,
-    0,  409,  410,  411,  412,  413,  414,    0,    0,  418,
-  419,  790,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,  791,  417,  415,    0,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  792,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  793,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,  802,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  862,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  904,  417,  415,
-    0,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,  247,
-  247,  247,    0,  247,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  247,  247,
-  247,  417,  415,  680,  416,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  420,
-  403,  421,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  417,  415,  933,  416,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  420,  403,  421,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  417,  415,  969,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,  417,  415,
-  970,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,  247,  247,  247,  247,
-  247,    0,  247,  247,  247,  247,  247,  247,    0,    0,
-  247,  247,    0,    0,    0,    0,    0,  404,  405,  406,
-  407,  408,    0,  409,  410,  411,  412,  413,  414,    0,
-    0,  418,  419,  417,  415,  975,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  247,  247,  247,  247,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  247,  247,  247,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
+       0,     0,   179,     0,     0,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,   738,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -3454,1178 +2014,527 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+     714,     0,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-  247,  247,  247,  247,  247,    0,  247,  247,  247,  247,
-  247,  247,    0,   16,  247,  247,   17,    0,   18,   19,
-    0,    0,   20,    0,    0,   21,   22,   23,    0,    0,
-    0,    0,   24,   25,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,   26,    0,    0,
-    0,   27,   28,    0,    0,    0,   29,    0,    0,    0,
-    0,    0,   30,    0,   31,   32,    0,   33,    0,   34,
-   35,   36,   37,   38,    0,   39,   40,   41,   42,   43,
-   44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
-   54,    0,    0,   55,   56,   57,    0,   58,   59,   60,
-    0,   61,   62,   63,    0,    0,   64,    0,   65,    0,
-    0,   66,   67,   68,   69,    0,    0,   70,   71,   72,
-    0,    0,    0,    0,    0,   73,    0,    0,    0,   74,
-   75,   76,   77,   78,   79,   80,    0,   81,   82,   83,
-   84,   85,    0,    0,   86,    0,    0,    0,    0,    0,
-    0,   87,   88,   89,    0,    0,    0,    0,    0,    0,
-   90,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   953,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   190,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,    92,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   179,     0,     0,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,     0,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     383,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+       0,     0,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   446,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,     0,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   542,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,   893,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   383,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,    19,     0,     0,    20,   -28,
+      21,    22,     0,     0,    23,   180,   181,    24,    25,    26,
+       0,   182,     0,     0,    27,    28,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,    29,
+       0,     0,    92,    30,    31,     0,     0,     0,    32,   189,
+       0,     0,   918,     0,    33,     0,    34,    35,     0,    36,
+       0,    37,    38,    39,    40,    41,     0,    42,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    56,    57,     0,     0,    58,    59,    60,     0,    61,
+      62,    63,     0,    64,    65,    66,     0,     0,    67,     0,
+      68,     0,     0,    69,    70,    71,    72,     0,     0,    73,
+      74,    75,     0,     0,     0,     0,     0,    76,     0,     0,
+       0,    77,    78,    79,    80,    81,    82,    83,     0,    84,
+      85,    86,    87,    88,     0,     0,    89,     0,     0,     0,
+       0,   154,   155,    90,    91,    92,   156,   157,   158,   159,
+       0,     0,    93,     0,     0,     0,     0,     0,   160,   161,
+     162,   163,   164,   165,   166,     0,   167,   168,   169,     0,
+       0,   170,   171,   172,     0,   173,   174,   175,   176,   177,
+       0,   178,   154,   155,     0,     0,     0,   156,   157,   158,
+     159,     0,     0,     0,     0,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   180,   181,     0,     0,     0,     0,
+     182,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+      23,    92,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   577,     0,     0,     0,   180,   181,     0,     0,     0,
+       0,   182,     0,     0,     0,    29,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+      33,     0,   893,     0,     0,    36,   348,     0,     0,   189,
+      40,    41,   577,     0,     0,     0,     0,     0,     0,     0,
+     349,    50,    51,    52,    53,    54,    55,   350,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      65,     0,     0,     0,     0,     0,    68,     0,     0,     0,
+       0,     0,     0,     0,     0,    73,     0,    75,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,    92,     0,     0,     0,     0,     0,     0,    93
 };
-short fortrancheck[] = {                                      24,
-  231,   26,  140,  309,  194,   30,   33,  177,   33,  236,
-  231,  347,  290,  331,   39,  236,   19,   11,  296,  140,
-   44,  303,  394,  341,  177,   40,   40,   40,   44,   40,
-   40,  349,   44,  529,   10,  188,   10,   10,   10,  295,
-   42,  177,   58,   40,   68,   69,  302,   44,   41,   42,
-   41,   42,   76,  279,   44,  382,  449,   40,  581,   44,
-   37,   58,  585,  731,   41,   59,  106,   44,   58,   93,
-   94,   95,   42,   43,   44,   45,  765,   37,   44,   42,
-  111,  234,   58,   44,   61,  735,  143,   44,   37,  120,
-  121,   40,   58,  231,  373,   10,   32,   58,  236,   37,
-   10,   61,  504,   41,  417,  130,   44,   60,  135,   62,
-  135,  424,   61,  800,  801,  517,   10,  425,  217,  271,
-  272,   57,   58,  148,  149,   42,   43,  417,   45,   44,
-   10,   42,  157,  371,  128,   43,   44,   45,  417,  238,
-   41,   42,   43,   60,   45,   62,  171,  385,   58,   60,
-   40,   62,  177,  271,  272,   41,  104,   40,   44,  107,
-  271,  272,   44,  188,   58,   41,  417,  192,   44,  578,
-   44,  427,   58,   40,  344,   42,   58,  586,  203,  847,
-  350,  579,   58,  581,   58,  210,   40,  585,   43,   44,
-   45,  417,   40,  331,  219,  524,  885,  350,  885,  224,
-  529,   37,   40,  341,   41,   41,  344,   44,   44,  234,
-  331,  349,  382,  207,  350,  386,  387,  388,  868,  244,
-  341,   58,    0,  344,  281,   42,  328,  329,  349,  382,
-   47,  487,   10,  569,  490,  541,  276,  231,  417,  545,
-  234,  577,  236,  237,  912,  270,  382,   40,  242,  567,
-   42,   43,   41,   45,   40,   44,  512,  593,   58,  272,
-  272,  264,  293,  401,   40,  417,   42,  283,   40,   58,
-  588,  589,  590,  591,  592,   43,   41,   45,  534,   44,
-  283,  275,  307,   40,  309,  375,  283,  272,  319,  271,
-  272,   42,   43,  283,   45,   40,   41,  322,  323,  417,
-  271,  272,  272,  328,  298,  632,  417,  634,  635,  272,
-  273,  336,  337,  338,  339,  272,  417,  283,  549,  255,
-  273,   41,  283,  550,   44,  350,  320,   44,  549,  550,
-  324,   42,  280,  271,  272,  360,  156,   58,  158,  364,
-  365,  366,  367,  368,  369,  370,  371,  372,  373,  374,
-  375,  744,  745,  275,  507,  272,  273,  382,  140,  141,
-  856,  272,  273,  886,  272,  763,  764,  863,  766,  394,
-  271,  272,  273,   41,   42,   43,  256,   45,  403,  404,
-  405,  406,  407,  408,  409,  410,  411,  412,  413,  414,
-  415,  416,  417,  418,  419,  420,  421,  374,  423,  424,
-  406,  417,  417,  119,  284,  285,  122,  417,  578,  424,
-  424,  549,  550,  424,  374,  417,  586,  272,  281,  755,
-  417,  301,  302,  406,  417,  374,  417,  417,  734,  567,
-   44,   44,  768,  769,  770,  771,  772,  719,  756,  811,
-  578,  417,  720,  417,  417,  417,  567,   44,  586,  705,
-  588,  589,  590,  591,  592,  682,  417,  578,  417,  417,
-  687,  682,  486,   44,   40,  586,  687,  588,  589,  590,
-  591,  592,  799,  800,  801,  417,   40,  424,  256,  271,
-  272,  273,  507,   40,  637,   40,  511,   40,  886,   40,
-  521,  747,  523,  518,   40,   40,  632,  275,  634,  635,
-  525,   41,  533,  281,   44,   40,  284,  285,   42,   43,
-   44,   45,  392,   47,  539,   41,  541,   40,   44,   40,
-  545,  272,  273,  301,  302,   40,   40,  856,  857,  858,
-  859,  860,   42,   43,  863,   45,   40,   47,  358,  359,
-  938,  566,   40,   40,  682,  425,   37,  883,   40,  687,
-   41,  576,   40,   44,   40,  549,  550,  377,  378,  379,
-  380,  381,   37,   40,  870,  417,   41,   40,  824,   44,
-  390,   40,   40,  289,  601,  291,  601,  602,   40,   42,
-   43,   40,   45,  299,   41,   42,   43,   40,   45,   37,
-  846,   42,   43,   44,   45,  765,   47,   60,   61,   62,
-  753,  722,   40,  271,  272,  273,  417,  632,   41,  634,
-  635,   44,  637,   44,  392,   58,  641,   41,  756,  644,
-   44,  877,  857,  858,  859,  860,   37,  765,  818,   40,
-   41,   42,   43,   44,   45,  756,  661,  662,  417,   41,
-  417,  666,   44,  668,  765,   41,  799,  425,   44,   60,
-  881,   62,   44,   44,   41,  680,  681,   44,   41,   41,
-   58,   44,   44,  799,  800,  801,   41,   37,  693,   44,
-  695,  417,   42,   43,   41,   45,   41,   44,   41,   44,
-  674,   44,   41,  708,   41,   44,   41,   44,  682,   44,
-   60,   61,   62,  687,   44,  689,   41,    0,   41,   44,
-   41,   44,   41,   44,   40,   44,  424,   10,   61,  734,
-  390,  391,  417,   41,   41,  885,   44,   44,   44,   41,
-   41,  746,   44,   44,  417,  750,  406,  407,  753,  417,
-  410,  411,  412,  413,  417,   44,  730,   40,  272,   42,
-   43,   44,   45,   41,  424,  390,  391,  885,   41,   41,
-   41,   44,   44,   44,   44,  908,   40,   60,   61,   62,
-   41,  406,  407,   44,  885,  410,  411,  412,  413,   41,
-   41,   40,   44,   44,  799,  800,  801,   41,   41,  424,
-   44,   44,   41,  424,   41,   44,  811,   44,  813,   41,
-   41,   41,   44,   44,   44,  258,  259,  260,  261,  262,
-   61,  264,  265,  266,  267,  268,  269,   44,   41,  272,
-  273,   44,  278,  838,  271,  272,  273,   41,   41,   41,
-   44,   44,   44,   41,   44,  850,   44,  852,   41,   44,
-  380,   44,   44,   44,   44,   40,   44,   37,   41,   41,
-   44,   40,  272,   44,  417,  870,   40,  258,  259,  260,
-  261,  262,  417,  264,  265,  266,  267,  268,  269,   41,
-   44,  272,  273,  417,   41,  417,   61,   41,  424,   44,
-  273,   44,   40,  898,   44,  900,  901,   44,   44,   58,
-   41,   41,  332,  908,  417,   41,   41,  881,  258,  259,
-  260,  261,  262,   42,  264,  265,  266,  267,  268,  269,
-   58,  417,  272,  273,   41,   37,  272,    0,  933,   40,
-   42,   43,  906,   45,  272,  940,  272,   10,   41,   58,
-  374,  946,  417,   44,  949,   41,   44,   61,   60,   61,
-   62,   41,  417,  417,   41,   41,   41,  962,   41,   61,
-   41,  966,   41,   41,  969,  970,  374,   44,  272,   41,
-  975,   44,   47,  256,  417,  258,  259,  260,  261,  262,
-   44,  264,  265,  266,  267,  268,  269,   41,  271,  272,
-  273,   61,  275,  417,  277,  417,  417,  280,  281,  282,
-  283,  284,  285,  286,  287,  288,  289,  290,  291,  292,
-  293,  294,  295,  296,  297,  417,  417,   44,  301,  302,
-   41,  304,  305,  306,  307,  308,  309,  310,  311,  312,
-  313,  314,  315,  316,  317,  318,  319,  320,  321,  322,
-  323,  324,  325,  326,  327,  328,  329,   41,  331,   58,
-  333,  334,  335,  336,  337,   41,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   41,   41,  357,  358,  359,   44,  361,  362,
-  363,   41,  365,  366,  367,   41,  272,  370,   41,  372,
-   41,   41,  375,  376,  377,  378,   41,  775,  381,  382,
-  383,  850,  957,  873,  520,  271,  389,  390,  391,  392,
-  393,  394,  395,  396,  397,  398,  399,  285,  401,  402,
-  403,  404,  405,  406,  407,  408,    0,  410,  411,  412,
-  413,  773,  415,  416,  417,  350,   10,  382,  681,  402,
-  900,  424,  425,  753,  852,    9,  258,  259,  260,  261,
-  262,   13,  264,  265,  266,  267,  268,  269,   74,  275,
-  272,  273,  691,   37,  429,  952,  539,   41,   42,   43,
-   44,   45,  695,   47,  528,  502,  537,  701,  557,  128,
-  549,  750,  550,  256,   58,  559,   60,   61,   62,  756,
-   -1,   -1,  140,   -1,   -1,   -1,   -1,   -1,  271,  272,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   37,   -1,  408,   -1,   41,   42,   43,
-   44,   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   58,   -1,   60,   61,   62,   -1,
+
+static const yytype_int16 yycheck[] =
+{
+      27,   233,    29,   179,   202,   287,    33,    36,   298,    36,
+     275,   383,   290,   141,   279,    42,   179,   416,   500,   580,
+     721,    22,   583,    18,    35,   179,     3,   309,   344,   233,
+     451,     3,     5,    23,   238,    47,   190,   238,     3,    23,
+      23,     4,     4,    23,    25,     3,   578,   734,   580,    60,
+      61,   583,    23,   328,   141,     3,    21,    22,    23,    71,
+      72,     3,     4,   338,    31,   104,   176,    79,     3,   179,
+     764,   346,   123,     3,   113,   124,   169,     3,   158,     3,
+     160,     3,   236,   490,    24,   106,   137,   108,   169,     3,
+       3,   112,     3,     3,   187,     3,     3,     3,   179,    20,
+      98,     3,   100,    24,   131,   233,     3,     3,     3,   138,
+     238,   138,     3,   125,     3,   127,   128,   125,   177,     3,
+     127,   528,   169,   150,   151,   179,    20,    21,    22,    23,
+      24,    25,   159,    80,    81,   189,    21,    22,    23,     3,
+     187,     3,    23,    24,    25,   169,   173,   429,     3,     4,
+     169,   577,   179,   126,   802,   803,    20,   176,    20,   585,
+      24,   169,    24,   190,    23,   866,   342,   194,     4,    20,
+      20,   347,   495,    24,    24,     3,   179,   500,   205,    20,
+      35,   868,   179,    24,   347,   212,   169,   179,   180,   169,
+     884,    13,    20,   347,   221,   179,    24,   180,   188,   226,
+     328,   179,   169,   180,   185,   186,    27,   383,   179,   236,
+     338,   189,   169,   262,   342,   187,   189,   169,   346,   246,
+     383,   922,   180,   188,   187,   187,   508,   509,   179,   383,
+     762,   763,   180,   765,   516,   179,   884,   276,   180,   179,
+      62,   328,   532,   282,   169,   180,   257,   286,   169,   539,
+     180,   338,   273,   569,   180,   342,   180,    33,   180,   346,
+     576,   633,   263,   635,   636,   547,   180,   180,   266,   180,
+     180,   298,   180,   180,   180,   302,   592,   304,   180,   359,
+     360,    21,    22,   180,   180,   180,   180,   415,   158,   180,
+     565,   180,   319,   320,   295,   316,   180,   324,   378,   379,
+     380,   381,   382,   188,   185,   186,   333,   334,   335,   336,
+     169,   391,   587,   588,   589,   590,   591,   312,   169,   169,
+     347,   180,   144,   176,   885,   179,   179,   179,    20,    21,
+      22,    23,    24,    25,   361,   179,     3,   179,   365,   366,
+     367,   368,   369,   370,   371,   372,   373,   374,   375,   376,
+     179,   772,   773,   885,   169,   169,   383,    24,   840,     3,
+       4,   176,   594,     3,   179,   847,     3,   394,   395,   396,
+     397,   398,   399,   400,   401,   402,   403,   404,   405,   406,
+     407,   408,   409,   410,   411,   412,   158,   209,   542,   416,
+     594,   595,   219,    23,   595,   141,   142,   424,   425,     4,
+     169,   577,   138,   139,   140,   937,   176,   179,     3,   585,
+     169,   233,   179,   240,   236,   179,   238,   239,   817,    23,
+      24,    25,   244,    20,    21,    22,    23,    24,    25,   801,
+     802,   803,   179,   189,   750,   179,   179,   565,   260,   841,
+     842,   843,   844,   733,   722,   179,   179,   712,   730,   577,
+     179,   767,   768,   769,   770,   771,   179,   585,   280,   587,
+     588,   589,   590,   591,   746,   492,   594,   595,   179,   496,
+     633,   179,   635,   636,    29,   487,   503,   179,   565,   683,
+     755,   502,   683,   179,   688,   639,   507,   688,   180,   510,
+     577,   179,   179,   179,   179,   317,   179,   179,   585,   321,
+     587,   588,   589,   590,   591,   532,   328,   179,   179,   179,
+     179,   538,   539,   179,   179,   542,   338,   840,   841,   842,
+     843,   844,   179,   179,   847,    80,    81,    82,   169,   142,
+     143,   169,     3,    20,    21,    22,    23,    24,    25,   566,
+       4,   169,   169,   825,     3,   158,   159,     3,   575,   162,
+     163,   164,   165,     5,   109,   683,   111,   112,   113,   169,
+     688,   116,   117,   176,   119,   120,     3,   883,    21,    22,
+      23,    24,    25,   602,     3,   602,   603,   169,   179,   169,
+     870,   169,   169,   865,   180,     4,     3,   176,   764,     3,
+     176,     3,     5,   132,   876,   179,   179,    30,     3,   753,
+      20,    21,    22,    23,    24,    25,   633,     3,   635,   636,
+       3,     3,   639,   640,   189,     3,   180,   180,   705,     3,
+       3,    24,   179,   169,   169,   823,   169,   755,   179,   169,
+     657,   658,   180,     3,     5,   662,   764,   664,   801,   802,
+     803,   668,   180,   176,   180,     3,     3,   801,    25,   881,
+     179,     3,     3,     3,   681,   682,     4,   180,   180,   169,
+      84,   180,   180,    24,    24,   179,     4,   694,   755,   696,
+      24,   169,   180,   169,    23,   180,     4,   764,   126,     5,
+       3,     7,     8,     9,    10,    11,   713,    13,    14,    15,
+      16,    17,    18,   180,   180,    21,    22,    23,    24,    25,
+      20,     3,     5,   180,   169,   180,   733,   169,   884,     5,
+     180,   180,   180,   180,   180,     3,   188,   180,   745,    24,
+       5,     3,   749,   180,   126,     3,   753,     5,     5,     7,
+       8,     9,    10,    11,   180,    13,    14,    15,    16,    17,
+      18,   169,   169,    21,    22,    23,    24,    25,     4,     5,
+      10,     7,     8,     9,    10,    11,   884,    13,    14,    15,
+      16,    17,    18,   260,   918,    21,    22,    23,    24,    25,
+      14,   776,   594,   595,   801,   802,   803,   692,   774,   430,
+     696,   499,   512,   538,   269,   494,    77,   529,   305,   726,
+     817,   818,   853,   851,     3,   418,     5,   884,     7,     8,
+       9,    10,    11,   682,    13,    14,    15,    16,    17,    18,
+     902,   954,    21,    22,    23,    24,    25,   753,   874,   958,
+     144,   556,   749,   755,   851,   141,   853,   347,   855,   383,
+     558,   594,    -1,   595,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   870,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   674,    -1,    -1,    -1,    -1,    -1,    -1,   185,
+     186,   683,    -1,   189,    -1,    -1,   688,    -1,   690,    -1,
+      -1,    -1,   899,    -1,   901,   902,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   918,    -1,    -1,    -1,    -1,    -1,   719,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   932,    -1,   185,   186,    -1,
+      -1,    -1,    -1,    -1,   941,    -1,    -1,    -1,    -1,    -1,
+     947,     0,     1,   950,   180,    -1,    -1,    -1,    -1,   185,
+     186,    -1,    -1,   755,    -1,    -1,   963,    -1,    -1,    -1,
+     967,    -1,    -1,   970,   971,    -1,    -1,    -1,    27,   976,
+      29,    -1,    -1,    32,    33,    34,    35,    36,    37,    38,
+      -1,    -1,    41,    42,    43,    -1,    -1,    -1,    -1,    48,
+      49,    -1,    -1,    -1,    53,    54,   185,   186,    -1,    -1,
+      -1,    -1,    -1,    -1,    63,    -1,    -1,    -1,    67,    68,
+      -1,    -1,    -1,    72,    -1,    -1,    -1,    -1,    -1,    78,
+      -1,    80,    81,    -1,    83,    -1,    85,    86,    87,    88,
+      89,    -1,    91,    92,    93,    94,    95,    96,    97,    98,
+      99,   100,   101,   102,   103,   104,   105,   106,    -1,    -1,
+     109,   110,   111,    -1,   113,   114,   115,    -1,   117,   118,
+     119,    -1,    -1,   122,    -1,   124,    -1,    -1,   127,   128,
+     129,   130,    -1,    -1,   133,   134,   135,    -1,    -1,   881,
+      -1,    -1,   141,    -1,    -1,   144,   145,   146,   147,   148,
+     149,   150,   151,    -1,   153,   154,   155,   156,   157,    -1,
+      -1,   160,    -1,    -1,    -1,   907,    -1,    -1,   167,   168,
+     169,    -1,    -1,    -1,    -1,    -1,    -1,   176,   177,     3,
+      -1,     5,    -1,     7,     8,     9,    10,    11,   187,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    39,    40,    -1,    -1,    -1,
+      44,    45,    46,    47,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    56,    57,    58,    59,    60,    61,    62,    -1,
+      64,    65,    66,    -1,    -1,    69,    70,    71,    -1,    73,
+      74,    75,    76,    77,     3,    79,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,     3,    -1,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,  271,  272,  273,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   40,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   40,   -1,   -1,   43,   -1,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  256,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,  271,  272,  273,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   37,   -1,  408,   -1,   41,   42,   43,   44,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   58,   -1,   60,   61,   62,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   142,   143,
+      -1,    -1,    -1,    -1,   148,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,
+     164,   165,    -1,    -1,    -1,   169,    -1,    -1,    -1,    -1,
+      -1,    -1,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,
+      -1,   185,   186,     3,    -1,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,     3,    -1,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     4,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,    -1,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
+      -1,    -1,    -1,    -1,     4,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,   185,
+     186,    21,    22,    23,    24,    25,     4,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     4,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,   185,   186,    21,    22,    23,
+      24,    25,    -1,    -1,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,   185,   186,
+      21,    22,    23,    24,    25,    -1,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+     185,   186,    21,    22,    23,    24,    25,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,
+      -1,    -1,    -1,     5,    -1,     7,     8,     9,    10,    11,
+      -1,    13,    14,    15,    16,    17,    18,   185,   186,    21,
+      22,    23,    24,    25,    -1,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,   185,
+     186,    21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,
+     185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,    0,   -1,   -1,  396,   -1,
-   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   -1,   37,   -1,  379,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   58,   -1,   60,   61,   62,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,  273,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   40,   -1,  408,   43,   -1,   45,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  256,   61,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,  273,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   42,   43,   -1,   45,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   60,  326,   62,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,  277,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   40,   41,   42,   43,   44,   45,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   58,   -1,   60,   61,   62,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  328,  329,  330,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   42,   43,   -1,
-   45,   -1,   -1,   -1,  263,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  272,   -1,   60,  357,   62,  359,  360,
-  361,   -1,   -1,  364,  365,   -1,  367,  368,  287,  288,
-   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,
-  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,  318,
-  319,   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,
+      -1,    -1,    -1,   185,   186,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  379,   37,   -1,   -1,   -1,   41,   42,   43,   44,   45,
-   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,
-   -1,   -1,   58,   -1,   60,   61,   62,  406,  407,   -1,
-   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,
-  256,   -1,  258,  259,  260,  261,  262,   -1,  264,  265,
-  266,  267,  268,  269,   -1,  271,  272,  273,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,  262,   -1,  264,
-  265,  266,  267,  268,  269,  311,   -1,  272,  273,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   40,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   40,   -1,   42,   43,   -1,   45,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  256,   58,  258,  259,  260,  261,  262,   -1,  264,  265,
-  266,  267,  268,  269,   -1,  271,  272,  273,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,  380,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   37,   -1,  408,   -1,   41,   42,   43,   44,   45,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,   58,   -1,   60,   61,   62,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,   -1,  312,  313,  314,   -1,  263,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,
+     180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,
+     186,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,     5,    -1,     7,     8,     9,    10,    11,    -1,
+      13,    14,    15,    16,    17,    18,    -1,    -1,    21,    22,
+      23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,
+      -1,    -1,   169,    -1,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,   185,   186,
+      21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,
+     186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,
+     185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,     5,    -1,     7,     8,     9,    10,    11,
+      -1,    13,    14,    15,    16,    17,    18,    -1,    -1,    21,
+      22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,
+      -1,    -1,   185,   186,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,    -1,    -1,
+      21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,
+      -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,
-  307,  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,
-  317,  318,  319,   -1,  321,  322,  323,  324,  325,   -1,
-  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,    0,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,   -1,   10,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   -1,   -1,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  379,   -1,   41,   42,   43,   44,   45,   -1,
-   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,
-   -1,   58,   -1,   60,   61,   62,   -1,   -1,   -1,  406,
-  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,  256,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,  271,  272,  273,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   40,   -1,   42,   43,   -1,   45,  415,  416,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  256,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,  271,  272,  273,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   42,   43,
-   -1,   45,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   60,   -1,   62,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,   42,   43,   44,   45,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,  288,   -1,   -1,
-   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,  310,
-   -1,  312,  313,  314,   -1,  263,  317,  318,  319,   -1,
-   -1,  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,
-   -1,  379,   -1,   41,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-   58,   -1,   -1,   61,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,  256,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  256,   -1,
-  258,  259,  260,  261,  262,    0,  264,  265,  266,  267,
-  268,  269,   -1,  271,  272,   10,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   37,  301,  302,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   58,   -1,   -1,   61,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,   -1,  288,    0,   -1,   -1,  292,  293,
-  294,  295,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,
-  304,  305,  306,  307,  308,  309,  310,   -1,  312,  313,
-  314,   -1,   -1,  317,  318,  319,   -1,   -1,  322,  323,
-  324,  325,   37,  327,   -1,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   58,   -1,   -1,   61,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,  417,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  256,   -1,  258,  259,  260,  261,  262,    0,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,   10,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   37,  301,  302,   -1,   41,
-   42,   43,   44,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   58,   -1,   -1,   61,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,  286,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,  311,
+      -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+     180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,   -1,   -1,   -1,  331,
-  332,   -1,   -1,   -1,  336,  337,   -1,   -1,   -1,   41,
-   42,   43,   44,   45,  346,  347,  348,  349,  350,  351,
-  352,  353,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,  366,   -1,   -1,   -1,   -1,   -1,
-  372,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  381,
-   -1,  383,   -1,   -1,  256,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,  271,
-  272,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,  417,   -1,  289,  290,  291,
-   -1,   -1,  424,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   40,   -1,   42,
-   43,   -1,   45,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  256,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,   42,
-   43,   -1,   45,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   60,   61,   62,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,
+      -1,    -1,    11,     4,    13,    14,    15,    16,    17,    18,
+      -1,    12,    21,    22,    23,    24,    25,    -1,    -1,    -1,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    39,    40,
+     185,   186,    -1,    44,    45,    46,    47,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,
+      13,    14,    15,    16,    17,    18,    -1,    -1,    21,    22,
+      23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    21,
+      22,    23,    -1,    25,    -1,    -1,    -1,    -1,    -1,    -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   185,   186,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    50,    51,
+      52,    -1,    -1,    55,    -1,   185,   186,   158,   159,    -1,
+      12,   162,   163,   164,   165,    -1,    -1,    -1,   169,    21,
+      22,    -1,    -1,    -1,    -1,   176,   185,   186,   179,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,    40,    -1,
+      -1,    -1,    44,    45,    46,    47,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,    61,
+      62,    -1,    64,    65,    66,    -1,    -1,    69,    70,    71,
+      -1,    73,    74,    75,    76,    77,    -1,    79,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     142,   143,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   185,   186,    21,    22,    23,   158,   159,    -1,    -1,
+     162,   163,   164,   165,    -1,    -1,    -1,   169,    -1,    -1,
+      -1,    -1,   185,   186,   176,    -1,    -1,   179,    -1,   131,
+      -1,    -1,    50,    51,    52,    -1,    -1,    55,    -1,    -1,
+     142,   143,    -1,    -1,    -1,    -1,   148,     4,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,   158,   159,    -1,    -1,
+     162,   163,   164,   165,    21,    22,    -1,   169,    -1,    -1,
+      -1,    -1,    -1,    -1,   176,    -1,    -1,   179,    -1,    -1,
+      -1,    -1,    39,    40,    -1,   187,    -1,    44,    45,    46,
+      47,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,   142,   143,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    21,    22,    -1,    -1,    -1,    -1,    -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    50,    51,    52,    -1,    -1,    55,    -1,    -1,
+      -1,    -1,    -1,    -1,   131,     4,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   131,    -1,     5,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    40,
+      -1,    -1,    -1,    44,    45,    46,    47,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    -1,    74,    75,    76,    77,    -1,    79,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   37,   -1,  379,   -1,   41,   -1,
-   43,   44,   45,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   58,   -1,   -1,   61,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,   -1,  256,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,  256,   -1,  258,  259,  260,  261,  262,
-    0,  264,  265,  266,  267,  268,  269,   -1,  271,   -1,
-   10,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   37,  301,  302,
-   -1,   41,   -1,   43,   44,   45,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   58,   -1,
-   -1,   61,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,   42,   -1,   44,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,   -1,
-   60,   -1,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,    0,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  256,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,  271,   -1,  273,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-  380,  381,  382,  383,   37,   -1,   -1,   -1,   41,  389,
-   -1,   44,  392,  393,  394,  395,   -1,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   60,  408,   62,
-   -1,   42,   43,   44,   45,  415,  416,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  425,   -1,   -1,   -1,   60,
-   61,   62,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,   -1,   -1,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,   -1,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   42,   43,   44,   45,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,  260,
-  261,  262,   -1,  264,  265,  266,  267,  268,  269,   -1,
-   -1,  272,  273,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,    0,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   10,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,   -1,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,   -1,   -1,   -1,  415,  416,   -1,  256,   -1,  258,
-  259,  260,  261,  262,  425,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,   -1,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   37,  256,  408,
-   -1,   41,   -1,   -1,   44,   -1,  415,  416,   -1,   -1,
-   -1,   -1,   -1,  271,  272,   -1,  425,  275,   58,  277,
-   -1,   61,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   37,   -1,
-  408,   -1,   41,   -1,   -1,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,  417,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   40,  328,  329,
-   43,  331,   45,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   40,   -1,   42,   43,  389,
-   45,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   61,  256,  408,  258,
-  259,  260,  261,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   37,   -1,  408,
-   40,   41,   42,   43,   44,   45,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  298,  299,  300,   -1,   -1,
-  303,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  263,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  273,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,    0,  327,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,   37,   -1,
-   -1,  424,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,  272,  273,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,
-   43,   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,     5,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      -1,    24,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,   169,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,  256,   -1,  415,  416,  417,   -1,   -1,
-   -1,    0,   -1,   -1,  424,  425,   -1,   -1,  271,  272,
-  273,   10,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   41,   42,   43,   44,   45,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,    0,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   10,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   42,   43,
-   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+       5,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  271,  272,  273,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,  256,   -1,   -1,   -1,  415,  416,   -1,   -1,
-    0,   -1,   -1,   -1,   -1,  424,  425,  271,  272,  273,
-   10,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   41,   42,   43,   44,   45,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,    0,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,     5,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,  256,   -1,   -1,   -1,  415,  416,  417,    0,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  271,  272,   10,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   41,
-   42,   43,   44,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,    0,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,     5,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   41,   42,   43,   44,   45,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   131,    -1,     5,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
@@ -4633,1594 +2542,63 @@
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  271,
-  272,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,  256,
-   -1,   -1,   -1,  415,  416,  417,    0,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  271,  272,   10,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   37,  301,  302,   -1,   41,   -1,   -1,
-   44,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   58,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,    0,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      23,    -1,    25,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   41,  256,   43,   44,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   41,  256,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    23,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   41,  256,   -1,   44,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   42,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   61,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,  256,   -1,   44,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   41,   -1,
-   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,    0,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   10,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,  256,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  271,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,    0,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   10,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-  256,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  271,  272,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   41,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,
-  275,   58,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   10,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   -1,   42,  256,   44,   -1,  415,
-  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,    0,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   10,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   10,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   41,   -1,  256,   44,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,   -1,  256,   44,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   41,
-   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   41,   -1,  256,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,
-   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,    0,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   10,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   44,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,  256,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,    0,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   10,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   44,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,  256,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,    0,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   10,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   44,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   61,   -1,  375,  376,
-  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   -1,   -1,  256,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,    0,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   10,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,  380,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,  256,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,  271,  272,  424,
-  425,  275,   -1,  277,   -1,   61,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   41,   -1,   -1,   44,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    23,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,  278,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,  380,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   41,
-   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,
-   -1,   44,   -1,  415,  416,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   44,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   44,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   10,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   10,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-  256,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  425,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,
-   -1,   -1,   -1,  415,  416,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,   -1,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,  256,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  425,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   40,   -1,   42,
-   43,  389,   45,   -1,  392,  393,  394,  395,   -1,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   61,   -1,
-  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  425,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   41,
-   42,   43,   -1,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   58,   -1,   60,   61,
-   62,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   40,   -1,   42,   43,  389,   45,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   61,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   40,   -1,
-   -1,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   61,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  379,   40,   -1,   -1,
-   43,   -1,   45,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   61,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,  263,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,   -1,   -1,   -1,   40,   -1,   -1,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   61,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,  263,  312,  313,  314,   -1,   -1,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,
-  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  304,  305,  306,  307,  308,  309,  310,   -1,
-  312,  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,
-  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,  379,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   -1,   40,  417,   42,   43,
-   -1,   45,   -1,   -1,  424,   -1,   -1,  379,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,
-   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,
-  263,   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,
-  412,  413,   -1,   -1,   40,  417,   42,   43,   -1,   45,
-   -1,   -1,  424,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,  263,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,   -1,  327,   -1,   -1,   -1,  379,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   40,   -1,  417,   43,   -1,   45,   -1,   -1,
-   -1,  424,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,
-   58,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  263,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   40,   -1,   -1,   43,  424,
-   45,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,
-  294,  295,   -1,   58,   -1,   -1,   -1,   -1,   -1,   -1,
-  304,  305,  306,  307,  308,  309,  310,  263,  312,  313,
-  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,
-  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,
-  306,  307,  308,  309,  310,   -1,  312,  313,  314,   -1,
-   -1,  317,  318,  319,   -1,  321,  322,  323,  324,  325,
-   -1,  327,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,
-   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,
-   -1,   -1,   -1,  417,   40,   -1,   42,   43,   -1,   45,
-  424,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,
-  396,   -1,   -1,   -1,   -1,  263,   -1,   -1,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,
-   -1,  417,   40,   -1,   42,   43,   -1,   45,  424,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,  379,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   40,   -1,  417,
-   43,   -1,   45,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,  263,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   40,   -1,  417,   43,   -1,   45,   -1,   -1,   -1,  424,
-   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,
-  306,  307,  308,  309,  310,  263,  312,  313,  314,   -1,
-   -1,  317,  318,  319,   -1,  321,  322,  323,  324,  325,
-   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,
-  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   40,
-   -1,  417,   43,   -1,   45,   -1,   -1,   -1,  424,   -1,
-   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   40,   -1,  417,
-   43,   -1,   45,   -1,  287,  288,  424,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,  263,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,   -1,  312,  313,  314,   -1,   -1,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,  379,  327,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   40,   -1,  417,   43,   -1,   45,   -1,   -1,
-   -1,  424,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  379,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,  263,   -1,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   40,   -1,  417,   43,   -1,
-   45,   -1,   -1,   -1,  424,   -1,  287,  288,   -1,   -1,
-   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,  310,
-  263,  312,  313,  314,   -1,   -1,  317,  318,  319,   -1,
-  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   40,   -1,   42,   43,   -1,   45,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,  379,   -1,
-   40,   -1,   42,   43,   -1,   45,   -1,   -1,   -1,  390,
-  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  406,  407,   -1,   -1,  410,
-  411,  412,  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,   -1,   -1,  379,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,  263,   41,   42,   43,   -1,
-   45,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   58,  417,   60,   61,   62,   -1,  287,
-  288,  424,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,   43,
-   44,   45,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,  379,  327,   41,   42,   43,   -1,   45,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,  273,  396,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   41,   42,   43,  417,
-   45,   -1,  298,  299,  300,   -1,  424,  303,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,  298,  299,
-  300,  406,  407,  303,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   60,   61,
-   62,   -1,   -1,   41,   42,   43,   -1,   45,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,
-   -1,  417,   60,   61,   62,   -1,   -1,   -1,  424,   -1,
-  390,  391,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,  406,  407,  272,  273,
-  410,  411,  412,  413,   41,   42,   43,  417,   45,   -1,
-   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   41,   42,   43,   -1,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   41,   42,   43,
-   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,   42,
-   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   -1,
-   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   41,   42,   43,
-   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   42,   43,   44,   45,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,
-   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   42,   43,
-   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,
-  261,  262,   -1,  264,  265,  266,  267,  268,  269,   -1,
-   -1,  272,  273,   42,   43,   44,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
+      -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
@@ -6228,926 +2606,1075 @@
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      23,    -1,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,  277,  272,  273,  280,   -1,  282,  283,
-   -1,   -1,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,   -1,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    29,    -1,    -1,    32,    33,
+      34,    35,    -1,    -1,    38,   142,   143,    41,    42,    43,
+      -1,   148,    -1,    -1,    48,    49,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    63,
+      -1,    -1,   169,    67,    68,    -1,    -1,    -1,    72,   176,
+      -1,    -1,   179,    -1,    78,    -1,    80,    81,    -1,    83,
+      -1,    85,    86,    87,    88,    89,    -1,    91,    92,    93,
+      94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
+     104,   105,   106,    -1,    -1,   109,   110,   111,    -1,   113,
+     114,   115,    -1,   117,   118,   119,    -1,    -1,   122,    -1,
+     124,    -1,    -1,   127,   128,   129,   130,    -1,    -1,   133,
+     134,   135,    -1,    -1,    -1,    -1,    -1,   141,    -1,    -1,
+      -1,   145,   146,   147,   148,   149,   150,   151,    -1,   153,
+     154,   155,   156,   157,    -1,    -1,   160,    -1,    -1,    -1,
+      -1,    39,    40,   167,   168,   169,    44,    45,    46,    47,
+      -1,    -1,   176,    -1,    -1,    -1,    -1,    -1,    56,    57,
+      58,    59,    60,    61,    62,    -1,    64,    65,    66,    -1,
+      -1,    69,    70,    71,    -1,    73,    74,    75,    76,    77,
+      -1,    79,    39,    40,    -1,    -1,    -1,    44,    45,    46,
+      47,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,    -1,
+     148,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      38,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    -1,    -1,    -1,    63,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      78,    -1,   169,    -1,    -1,    83,    84,    -1,    -1,   176,
+      88,    89,   179,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      98,    99,   100,   101,   102,   103,   104,   105,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     118,    -1,    -1,    -1,    -1,    -1,   124,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   133,    -1,   135,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176
 };
-#define YYFINAL 1
-#ifndef YYDEBUG
-#define YYDEBUG 1
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint16 yystos[] =
+{
+       0,   191,     0,     1,    36,    37,    53,    54,   144,   177,
+     187,   192,   197,   199,   205,   201,   198,   177,   200,    29,
+      32,    34,    35,    38,    41,    42,    43,    48,    49,    63,
+      67,    68,    72,    78,    80,    81,    83,    85,    86,    87,
+      88,    89,    91,    92,    93,    94,    95,    96,    97,    98,
+      99,   100,   101,   102,   103,   104,   105,   106,   109,   110,
+     111,   113,   114,   115,   117,   118,   119,   122,   124,   127,
+     128,   129,   130,   133,   134,   135,   141,   145,   146,   147,
+     148,   149,   150,   151,   153,   154,   155,   156,   157,   160,
+     167,   168,   169,   176,   193,   194,   195,   202,   203,   206,
+     212,   224,   225,   228,   229,   234,   235,   237,   238,   239,
+     240,   241,   243,   244,   251,   253,   257,   258,   261,   262,
+     263,   298,   308,   309,   315,   316,   317,   318,   319,   321,
+     326,   327,   328,   330,   331,   333,   336,   337,   340,   341,
+     349,   351,   352,   365,   372,   201,   205,   169,   204,   204,
+     179,    12,    21,    22,    39,    40,    44,    45,    46,    47,
+      56,    57,    58,    59,    60,    61,    62,    64,    65,    66,
+      69,    70,    71,    73,    74,    75,    76,    77,    79,   131,
+     142,   143,   148,   158,   159,   162,   163,   164,   165,   176,
+     179,   280,   281,   283,   284,   288,   290,   291,   292,   293,
+     298,   299,   300,   307,   320,   179,   187,   280,   304,   179,
+     217,   218,   179,   280,   303,     4,   187,   221,   187,   221,
+     304,   179,   169,   187,   324,   176,   179,   364,   280,   169,
+     325,   169,   324,   179,   169,   176,   179,   346,   179,   179,
+     221,   221,    20,    24,   247,   298,   179,   216,   123,   137,
+     127,   324,   324,   169,   252,    80,    81,   213,   275,   324,
+      27,   196,   198,    33,   196,   158,   207,   196,   169,   179,
+     249,   250,   169,   226,   231,     3,   248,   169,   230,   247,
+       3,   236,   248,     3,   248,     3,   248,   169,   245,   246,
+     247,     3,     4,    35,   222,   223,   255,   271,   169,   176,
+     268,    23,   179,   259,    23,   179,   266,    23,     4,   329,
+     169,   310,   200,   324,   324,   324,   176,   323,   280,     5,
+     126,   189,   332,     3,   179,   334,   169,   304,   179,   345,
+      21,    22,    23,    50,    51,    52,    55,   169,   179,   288,
+     299,   343,   345,   350,   353,   354,   355,   345,    84,    98,
+     105,   298,   328,   179,   208,   280,   280,   280,   282,   179,
+     179,   179,   282,   280,   282,   179,   179,   179,   179,   179,
+     179,   179,   179,   179,   179,   179,   179,   280,   179,   179,
+     179,   179,   179,   179,   280,   281,   283,   307,   360,   361,
+     362,   179,   280,   283,     5,     7,     8,     9,    10,    11,
+      13,    14,    15,    16,    17,    18,    21,    22,    23,    24,
+      25,   185,   186,   285,   280,   189,   179,   302,   179,   179,
+     169,   158,   301,   302,     3,     4,   180,   280,   219,   298,
+       3,   280,     4,   169,   242,   242,   280,   280,   180,   288,
+     292,   298,   330,   366,   367,   368,   176,   283,   298,   298,
+     367,   369,   298,   371,   242,    40,    44,    45,    46,    47,
+      56,    57,    58,    59,    60,    61,    62,    64,    65,    66,
+      69,    70,    71,    74,    75,    76,    77,    79,   169,   214,
+     215,   169,   298,   220,   280,     3,     3,   221,   194,   200,
+     204,   196,     5,   249,     3,    24,   179,   187,   248,     3,
+      24,   230,   247,   179,   276,   230,   298,   247,   169,   169,
+     247,   276,     3,   245,    29,    82,   109,   111,   112,   113,
+     116,   117,   119,   120,   272,   273,   275,     4,   204,     3,
+     256,   254,     5,    23,   269,   280,   180,   176,   179,   169,
+     260,   269,   179,   267,   280,   268,   176,   276,     3,   205,
+     248,   298,   322,   373,   280,   280,   298,   176,    23,   280,
+     335,   338,   339,    23,    25,   179,   298,   347,   348,   353,
+     354,   280,   280,   280,   280,     5,   353,   179,   281,   288,
+     299,   342,   356,   357,   358,     3,   344,    20,    23,    24,
+      25,   355,   353,   360,   179,   179,    23,   169,   180,   210,
+     211,    30,   180,     3,   180,   282,   282,   280,   180,   180,
+     180,   280,   280,   280,   280,   280,   280,   280,   280,   280,
+     280,   280,   280,   180,   282,   282,   282,   282,   282,   280,
+     283,   361,   362,     3,   132,     3,     3,   282,   180,     3,
+       5,   280,   287,   280,   280,   280,   280,   280,   280,   280,
+     280,   280,   280,   280,   280,   280,   280,     5,    24,   280,
+     286,   280,     5,   280,     5,   280,   288,   303,   289,   294,
+     294,   280,   280,   180,     3,   180,   276,   218,   180,     3,
+     180,     3,   179,     3,   370,   180,   180,   180,     3,   370,
+       3,   180,     3,    24,     3,   180,   179,   169,   324,   208,
+     280,   180,   250,   227,   232,   233,   284,   280,   169,   169,
+     231,   227,   248,     4,    23,   277,   278,   279,   280,   248,
+     276,   276,   248,   246,   276,   179,     3,     4,   208,   254,
+     169,   269,   260,     5,   269,   180,     3,   270,    23,   180,
+     276,    31,   169,   311,   312,     5,   329,   364,   180,     3,
+     353,    23,    25,   179,   280,     3,   180,   180,   280,   180,
+     356,   285,   359,   359,     3,   359,   356,   353,   353,   353,
+     353,   353,   366,   369,     3,   180,   179,   209,   304,   280,
+     180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
+     180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
+     180,     3,     3,     3,   280,   362,   280,   362,   280,   362,
+     180,   283,   280,   280,   280,   280,   280,     4,     4,   280,
+     295,   296,   297,   180,   180,   298,   169,    84,   280,   295,
+     125,   367,   180,   367,   180,   298,   214,   280,   220,    24,
+       3,    21,    22,    23,   188,   299,   180,    24,    24,   230,
+     280,     3,   180,     4,   298,    23,   264,   264,   245,   138,
+     139,   140,   274,   273,     4,   169,   276,   180,   269,   270,
+     169,   180,     4,   126,     3,   280,   276,   339,   180,   280,
+     297,   189,   348,   353,     3,   180,   285,   358,   370,   370,
+     211,   180,   210,   169,   363,   363,   363,   180,   303,     4,
+     280,     4,     3,   302,   276,   180,   180,     5,   180,   227,
+     232,   232,   232,   232,   227,   278,   279,   280,   179,   265,
+     280,   180,   276,   264,   270,   269,   169,   187,   313,   314,
+     169,   312,     3,   276,   180,   330,   363,   359,   180,   180,
+     180,     5,   180,   180,   180,   180,   280,     4,   280,   296,
+       3,   298,    24,    23,   264,   305,   306,   126,     3,   280,
+     180,   280,   280,     4,   280,   180,   305,     5,   169,   314,
+       3,     3,   280,   280,   280,   280,     3,   280
+};
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (YY_("syntax error: cannot back up")); \
+      YYERROR;							\
+    }								\
+while (YYID (0))
+
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
 #endif
-#define YYMAXTOKEN 426
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
 #if YYDEBUG
-char *fortranname[] = {
-"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,"'!'",0,0,0,"'%'",0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,
-0,0,0,0,0,"':'",0,"'<'","'='","'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,"'['",0,"']'",0,"'_'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TOK_BINARY_OP","TOK_EQV","TOK_NEQV",
-"TOK_OR","TOK_XOR","TOK_AND","TOK_NOT","TOK_LT","TOK_GT","TOK_LE","TOK_GE",
-"TOK_EQ","TOK_NE","TOK_UNARY_OP","TOK_DSLASH","TOK_SLASH","TOK_DASTER",
-"TOK_SEP","TOK_SEMICOLON","TOK_NEXTLINE","TOK_PARAMETER","TOK_RESULT",
-"TOK_ONLY","TOK_INCLUDE","TOK_SUBROUTINE","TOK_PROGRAM","TOK_FUNCTION",
-"TOK_OMP","TOK_DOLLAR","TOK_FORMAT","TOK_MAX","TOK_TANH","TOK_WHERE",
-"TOK_ELSEWHERE","TOK_ENDWHERE","TOK_MAXVAL","TOK_TRIM","TOK_SUM","TOK_SQRT",
-"TOK_CASE","TOK_SELECTCASE","TOK_FILE","TOK_END","TOK_ERR","TOK_DONOTTREAT",
-"TOK_ENDDONOTTREAT","TOK_EXIST","TOK_MIN","TOK_FLOAT","TOK_EXP","TOK_COS",
-"TOK_COSH","TOK_ACOS","TOK_NINT","TOK_CYCLE","TOK_SIN","TOK_SINH","TOK_ASIN",
-"TOK_EQUIVALENCE","TOK_BACKSPACE","TOK_LOG","TOK_TAN","TOK_ATAN",
-"TOK_RECURSIVE","TOK_ABS","TOK_MOD","TOK_SIGN","TOK_MINLOC","TOK_MAXLOC",
-"TOK_EXIT","TOK_MINVAL","TOK_PUBLIC","TOK_PRIVATE","TOK_ALLOCATABLE",
-"TOK_RETURN","TOK_THEN","TOK_ELSEIF","TOK_ELSE","TOK_ENDIF","TOK_PRINT",
-"TOK_PLAINGOTO","TOK_CONSTRUCTID","TOK_LOGICALIF","TOK_PLAINDO","TOK_CONTAINS",
-"TOK_ENDDO","TOK_MODULE","TOK_ENDMODULE","TOK_DOWHILE","TOK_ALLOCATE",
-"TOK_OPEN","TOK_CLOSE","TOK_INQUIRE","TOK_WRITE","TOK_READ","TOK_REWIND",
-"TOK_DEALLOCATE","TOK_NULLIFY","TOK_FIN","TOK_DEBUT","TOK_DIMENSION",
-"TOK_ENDSELECT","TOK_EXTERNAL","TOK_INTENT","TOK_INTRINSIC","TOK_NAMELIST",
-"TOK_CASEDEFAULT","TOK_OPTIONAL","TOK_POINTER","TOK_CONTINUE","TOK_SAVE",
-"TOK_TARGET","TOK_QUOTE","TOK_IMPLICIT","TOK_NONE","TOK_CALL","TOK_STAT",
-"TOK_POINT_TO","TOK_COMMON","TOK_GLOBAL","TOK_INTERFACE","TOK_ENDINTERFACE",
-"TOK_LEFTAB","TOK_RIGHTAB","TOK_PAUSE","TOK_PROCEDURE","TOK_STOP","TOK_NAMEEQ",
-"TOK_REAL8","TOK_OUT","TOK_INOUT","TOK_IN","TOK_USE","TOK_TRUE","TOK_FALSE",
-"TOK_LABEL","TOK_TYPE","TOK_TYPEPAR","TOK_ENDTYPE","TOK_REAL","TOK_INTEGER",
-"TOK_LOGICAL","TOK_DOUBLEPRECISION","TOK_DOUBLEREAL","TOK_ENDSUBROUTINE",
-"TOK_ENDFUNCTION","TOK_ENDPROGRAM","TOK_ENDUNIT","TOK_CHARACTER",
-"TOK_CHAR_CONSTANT","TOK_CHAR_CUT","TOK_DATA","TOK_CHAR_INT","TOK_CHAR_MESSAGE",
-"TOK_CSTREAL","TOK_CSTREALDP","TOK_CSTREALQP","TOK_SFREAL","TOK_COMPLEX",
-"TOK_DOUBLECOMPLEX","TOK_NAME","TOK_NAME_CHAR","TOK_PROBTYPE","TOK_INTERPTYPE",
-"TOK_VARTYPE","TOK_BC","TOK_OP","TOK_CSTINT","TOK_COMMENT","TOK_FILENAME",
-};
-char *fortranrule[] = {
-"$accept : input",
-"input :",
-"input : input line",
-"line : '\\n' position",
-"line : thislabel suite_line_list",
-"line : TOK_COMMENT",
-"line : keyword cmnt writedeclar",
-"line : error writedeclar nulcurbuf",
-"suite_line_list : suite_line",
-"suite_line_list : suite_line_list TOK_SEMICOLON suite_line",
-"suite_line : entry fin_line",
-"suite_line : spec fin_line",
-"suite_line : before_include filename fin_line",
-"suite_line : exec cmnt writedeclar",
-"suite_line : instr fin_line",
-"instr : ident ':'",
-"fin_line : position cmnt",
-"keyword : TOK_DONOTTREAT",
-"keyword : TOK_ENDDONOTTREAT",
-"keyword : TOK_OMP",
-"keyword : TOK_DOLLAR",
-"position :",
-"thislabel :",
-"thislabel : TOK_LABEL nulcurbuf",
-"cmnt :",
-"cmnt : TOK_COMMENT",
-"incomment :",
-"nulcurbuf :",
-"opt_recursive :",
-"opt_recursive : TOK_RECURSIVE",
-"entry :",
-"entry : opt_recursive TOK_SUBROUTINE name_routine arglist",
-"entry : TOK_PROGRAM name_routine",
-"entry : TOK_FUNCTION name_routine arglist TOK_RESULT arglist1",
-"entry : TOK_FUNCTION name_routine arglist",
-"entry : TOK_MODULE TOK_NAME",
-"name_routine : TOK_NAME",
-"writedeclar :",
-"before_include : TOK_INCLUDE",
-"filename : TOK_CHAR_CONSTANT",
-"arglist :",
-"arglist : '(' ')'",
-"arglist : '(' args ')'",
-"arglist1 :",
-"arglist1 : '(' ')'",
-"arglist1 : '(' args ')'",
-"args : arg",
-"args : args ',' arg",
-"arg : TOK_NAME",
-"arg : '*'",
-"spec : type after_type",
-"spec : TOK_TYPE opt_spec opt_sep opt_name",
-"spec : TOK_ENDTYPE opt_name",
-"spec : TOK_POINTER list_couple",
-"spec : before_parameter '(' paramlist ')'",
-"spec : before_parameter paramlist",
-"spec : common",
-"spec : save",
-"spec : implicit",
-"spec : dimension",
-"spec : public",
-"spec : private",
-"spec : use_stat",
-"spec : module_proc_stmt",
-"spec : interface",
-"spec : namelist",
-"spec : TOK_BACKSPACE '(' expr ')'",
-"spec : TOK_EXTERNAL opt_sep use_name_list",
-"spec : TOK_INTRINSIC opt_sep use_intrinsic_list",
-"spec : TOK_EQUIVALENCE list_expr_equi",
-"spec : before_data data '\\n'",
-"opt_spec :",
-"opt_spec : access_spec",
-"name_intrinsic : TOK_SUM",
-"name_intrinsic : TOK_TANH",
-"name_intrinsic : TOK_MAXVAL",
-"name_intrinsic : TOK_MIN",
-"name_intrinsic : TOK_MINVAL",
-"name_intrinsic : TOK_TRIM",
-"name_intrinsic : TOK_SQRT",
-"name_intrinsic : TOK_NINT",
-"name_intrinsic : TOK_FLOAT",
-"name_intrinsic : TOK_EXP",
-"name_intrinsic : TOK_COS",
-"name_intrinsic : TOK_COSH",
-"name_intrinsic : TOK_ACOS",
-"name_intrinsic : TOK_SIN",
-"name_intrinsic : TOK_SINH",
-"name_intrinsic : TOK_ASIN",
-"name_intrinsic : TOK_LOG",
-"name_intrinsic : TOK_TAN",
-"name_intrinsic : TOK_ATAN",
-"name_intrinsic : TOK_MOD",
-"name_intrinsic : TOK_SIGN",
-"name_intrinsic : TOK_MINLOC",
-"name_intrinsic : TOK_MAXLOC",
-"name_intrinsic : TOK_NAME",
-"use_intrinsic_list : name_intrinsic",
-"use_intrinsic_list : use_intrinsic_list ',' name_intrinsic",
-"list_couple : '(' list_expr ')'",
-"list_couple : list_couple ',' '(' list_expr ')'",
-"list_expr_equi : expr_equi",
-"list_expr_equi : list_expr_equi ',' expr_equi",
-"expr_equi : '(' list_expr_equi1 ')'",
-"list_expr_equi1 : ident dims",
-"list_expr_equi1 : list_expr_equi1 ',' ident dims",
-"list_expr : expr",
-"list_expr : list_expr ',' expr",
-"opt_sep :",
-"opt_sep : ':' ':'",
-"after_type : dcl nodimsgiven",
-"after_type : before_function name_routine arglist",
-"before_function : TOK_FUNCTION",
-"before_parameter : TOK_PARAMETER",
-"before_data : TOK_DATA",
-"data : TOK_NAME TOK_SLASH datavallist TOK_SLASH",
-"data : data opt_comma TOK_NAME TOK_SLASH datavallist TOK_SLASH",
-"data : datanamelist TOK_SLASH datavallist TOK_SLASH",
-"datavallist : expr_data",
-"datavallist : expr_data ',' datavallist",
-"save : before_save varsave",
-"save : before_save comblock varsave",
-"save : save opt_comma comblock opt_comma varsave",
-"save : save ',' varsave",
-"before_save : TOK_SAVE",
-"varsave :",
-"varsave : TOK_NAME dims",
-"datanamelist : TOK_NAME",
-"datanamelist : TOK_NAME '(' expr ')'",
-"datanamelist : datanamelist ',' datanamelist",
-"expr_data : opt_signe simple_const",
-"expr_data : expr_data '+' expr_data",
-"expr_data : expr_data '-' expr_data",
-"expr_data : expr_data '*' expr_data",
-"expr_data : expr_data '/' expr_data",
-"opt_signe :",
-"opt_signe : signe",
-"namelist : namelist_action after_namelist",
-"namelist_action : TOK_NAMELIST ident",
-"namelist_action : TOK_NAMELIST comblock ident",
-"namelist_action : namelist_action opt_comma comblock opt_comma ident",
-"namelist_action : namelist_action ',' ident",
-"after_namelist :",
-"interface : TOK_INTERFACE opt_name",
-"interface : TOK_ENDINTERFACE opt_name",
-"before_dimension : TOK_DIMENSION",
-"dimension : before_dimension opt_comma TOK_NAME dims lengspec",
-"dimension : dimension ',' TOK_NAME dims lengspec",
-"private : TOK_PRIVATE '\\n'",
-"private : TOK_PRIVATE opt_sep use_name_list",
-"public : TOK_PUBLIC '\\n'",
-"public : TOK_PUBLIC opt_sep use_name_list",
-"use_name_list : TOK_NAME",
-"use_name_list : use_name_list ',' TOK_NAME",
-"common : before_common var_common_list",
-"common : before_common comblock var_common_list",
-"common : common opt_comma comblock opt_comma var_common_list",
-"before_common : TOK_COMMON",
-"before_common : TOK_GLOBAL TOK_COMMON",
-"var_common_list : var_common",
-"var_common_list : var_common_list ',' var_common",
-"var_common : TOK_NAME dims",
-"comblock : TOK_DSLASH",
-"comblock : TOK_SLASH TOK_NAME TOK_SLASH",
-"opt_comma :",
-"opt_comma : ','",
-"paramlist : paramitem",
-"paramlist : paramlist ',' paramitem",
-"paramitem : TOK_NAME '=' expr",
-"module_proc_stmt : TOK_PROCEDURE proc_name_list",
-"proc_name_list : TOK_NAME",
-"proc_name_list : proc_name_list ',' TOK_NAME",
-"implicit : TOK_IMPLICIT TOK_NONE",
-"implicit : TOK_IMPLICIT TOK_REAL8",
-"opt_retour :",
-"dcl : options opt_retour TOK_NAME dims lengspec initial_value",
-"dcl : dcl ',' opt_retour TOK_NAME dims lengspec initial_value",
-"nodimsgiven :",
-"type : typespec selector",
-"type : before_character c_selector",
-"type : typename '*' TOK_CSTINT",
-"type : before_typepar attribute ')'",
-"before_typepar : TOK_TYPEPAR",
-"c_selector :",
-"c_selector : '*' TOK_CSTINT",
-"c_selector : '*' '(' c_attribute ')'",
-"c_selector : '(' c_attribute ')'",
-"c_attribute : TOK_NAME clause opt_clause",
-"c_attribute : TOK_NAME '=' clause opt_clause",
-"c_attribute : clause opt_clause",
-"before_character : TOK_CHARACTER",
-"typespec : typename",
-"typename : TOK_INTEGER",
-"typename : TOK_REAL",
-"typename : TOK_COMPLEX",
-"typename : TOK_DOUBLEPRECISION",
-"typename : TOK_DOUBLECOMPLEX",
-"typename : TOK_LOGICAL",
-"lengspec :",
-"lengspec : '*' proper_lengspec",
-"proper_lengspec : expr",
-"proper_lengspec : '(' '*' ')'",
-"selector :",
-"selector : '*' proper_selector",
-"selector : '(' attribute ')'",
-"proper_selector : expr",
-"proper_selector : '(' '*' ')'",
-"attribute : TOK_NAME clause",
-"attribute : TOK_NAME '=' clause",
-"attribute : TOK_NAME",
-"attribute : TOK_CSTINT",
-"clause : expr",
-"clause : '*'",
-"opt_clause :",
-"opt_clause : ',' TOK_NAME clause",
-"options :",
-"options : ':' ':'",
-"options : ',' attr_spec_list ':' ':'",
-"attr_spec_list : attr_spec",
-"attr_spec_list : attr_spec_list ',' attr_spec",
-"attr_spec : TOK_PARAMETER",
-"attr_spec : access_spec",
-"attr_spec : TOK_ALLOCATABLE",
-"attr_spec : TOK_DIMENSION dims",
-"attr_spec : TOK_EXTERNAL",
-"attr_spec : TOK_INTENT '(' intent_spec ')'",
-"attr_spec : TOK_INTRINSIC",
-"attr_spec : TOK_OPTIONAL",
-"attr_spec : TOK_POINTER",
-"attr_spec : TOK_SAVE",
-"attr_spec : TOK_TARGET",
-"intent_spec : TOK_IN",
-"intent_spec : TOK_OUT",
-"intent_spec : TOK_INOUT",
-"access_spec : TOK_PUBLIC",
-"access_spec : TOK_PRIVATE",
-"dims :",
-"dims : '(' dimlist ')'",
-"dimlist : dim",
-"dimlist : dimlist ',' dim",
-"dim : ubound",
-"dim : ':'",
-"dim : expr ':'",
-"dim : ':' expr",
-"dim : expr ':' ubound",
-"ubound : '*'",
-"ubound : expr",
-"expr : uexpr",
-"expr : '(' expr ')'",
-"expr : complex_const",
-"expr : predefinedfunction",
-"predefinedfunction : TOK_SUM minmaxlist ')'",
-"predefinedfunction : TOK_MAX minmaxlist ')'",
-"predefinedfunction : TOK_TANH '(' minmaxlist ')'",
-"predefinedfunction : TOK_MAXVAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_MIN minmaxlist ')'",
-"predefinedfunction : TOK_MINVAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_TRIM '(' expr ')'",
-"predefinedfunction : TOK_SQRT expr ')'",
-"predefinedfunction : TOK_REAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_NINT '(' expr ')'",
-"predefinedfunction : TOK_FLOAT '(' expr ')'",
-"predefinedfunction : TOK_EXP '(' expr ')'",
-"predefinedfunction : TOK_COS '(' expr ')'",
-"predefinedfunction : TOK_COSH '(' expr ')'",
-"predefinedfunction : TOK_ACOS '(' expr ')'",
-"predefinedfunction : TOK_SIN '(' expr ')'",
-"predefinedfunction : TOK_SINH '(' expr ')'",
-"predefinedfunction : TOK_ASIN '(' expr ')'",
-"predefinedfunction : TOK_LOG '(' expr ')'",
-"predefinedfunction : TOK_TAN '(' expr ')'",
-"predefinedfunction : TOK_ATAN '(' expr ')'",
-"predefinedfunction : TOK_ABS expr ')'",
-"predefinedfunction : TOK_MOD '(' minmaxlist ')'",
-"predefinedfunction : TOK_SIGN '(' minmaxlist ')'",
-"predefinedfunction : TOK_MINLOC '(' minmaxlist ')'",
-"predefinedfunction : TOK_MAXLOC '(' minmaxlist ')'",
-"minmaxlist : expr",
-"minmaxlist : minmaxlist ',' expr",
-"uexpr : lhs",
-"uexpr : simple_const",
-"uexpr : vec",
-"uexpr : expr operation",
-"uexpr : signe expr",
-"uexpr : TOK_NOT expr",
-"signe : '+'",
-"signe : '-'",
-"operation : '+' expr",
-"operation : '-' expr",
-"operation : '*' expr",
-"operation : TOK_DASTER expr",
-"operation : TOK_EQ expr",
-"operation : TOK_EQV expr",
-"operation : TOK_GT expr",
-"operation : '>' expr",
-"operation : TOK_LT expr",
-"operation : '<' expr",
-"operation : TOK_GE expr",
-"operation : '>' '=' expr",
-"operation : TOK_LE expr",
-"operation : '<' '=' expr",
-"operation : TOK_NE expr",
-"operation : TOK_NEQV expr",
-"operation : TOK_XOR expr",
-"operation : TOK_OR expr",
-"operation : TOK_AND expr",
-"operation : TOK_SLASH after_slash",
-"operation : '=' after_equal",
-"after_slash :",
-"after_slash : expr",
-"after_slash : '=' expr",
-"after_slash : TOK_SLASH expr",
-"after_equal : '=' expr",
-"after_equal : expr",
-"lhs : ident",
-"lhs : structure_component",
-"lhs : array_ele_substring_func_ref",
-"beforefunctionuse :",
-"array_ele_substring_func_ref : begin_array",
-"array_ele_substring_func_ref : begin_array substring",
-"array_ele_substring_func_ref : structure_component '(' funarglist ')'",
-"array_ele_substring_func_ref : structure_component '(' funarglist ')' substring",
-"begin_array : ident '(' funarglist ')'",
-"structure_component : lhs '%' lhs",
-"vec : TOK_LEFTAB outlist TOK_RIGHTAB",
-"funarglist : beforefunctionuse",
-"funarglist : beforefunctionuse funargs",
-"funargs : funarg",
-"funargs : funargs ',' funarg",
-"funarg : expr",
-"funarg : triplet",
-"triplet : expr ':' expr",
-"triplet : expr ':' expr ':' expr",
-"triplet : ':' expr ':' expr",
-"triplet : ':' ':' expr",
-"triplet : ':' expr",
-"triplet : expr ':'",
-"triplet : ':'",
-"ident : TOK_NAME",
-"simple_const : TOK_TRUE",
-"simple_const : TOK_FALSE",
-"simple_const : TOK_CSTINT",
-"simple_const : TOK_CSTREAL",
-"simple_const : TOK_CSTREALDP",
-"simple_const : TOK_CSTREALQP",
-"simple_const : simple_const TOK_NAME",
-"simple_const : string_constant opt_substring",
-"string_constant : TOK_CHAR_CONSTANT",
-"string_constant : string_constant TOK_CHAR_CONSTANT",
-"string_constant : TOK_CHAR_MESSAGE",
-"string_constant : TOK_CHAR_CUT",
-"opt_substring :",
-"opt_substring : substring",
-"substring : '(' optexpr ':' optexpr ')'",
-"optexpr :",
-"optexpr : expr",
-"opt_expr : '\\n'",
-"opt_expr : expr",
-"initial_value :",
-"initial_value : before_initial '=' expr",
-"before_initial :",
-"complex_const : '(' uexpr ',' uexpr ')'",
-"use_stat : word_use module_name",
-"use_stat : word_use module_name ',' rename_list",
-"use_stat : word_use module_name ',' TOK_ONLY ':' '\\n'",
-"use_stat : word_use module_name ',' TOK_ONLY ':' only_list",
-"word_use : TOK_USE",
-"module_name : TOK_NAME",
-"rename_list : rename_name",
-"rename_list : rename_list ',' rename_name",
-"rename_name : TOK_NAME TOK_POINT_TO TOK_NAME",
-"only_list : only_name",
-"only_list : only_list ',' only_name",
-"only_name : TOK_NAME TOK_POINT_TO TOK_NAME",
-"only_name : TOK_NAME",
-"exec : iffable",
-"exec : TOK_ALLOCATE '(' allocation_list opt_stat_spec ')'",
-"exec : TOK_DEALLOCATE '(' allocate_object_list opt_stat_spec ')'",
-"exec : TOK_NULLIFY '(' pointer_name_list ')'",
-"exec : word_endunit",
-"exec : word_endprogram opt_name",
-"exec : word_endsubroutine opt_name",
-"exec : word_endfunction opt_name",
-"exec : TOK_ENDMODULE opt_name",
-"exec : boucledo",
-"exec : logif iffable",
-"exec : TOK_WHERE '(' expr ')' opt_expr",
-"exec : TOK_ELSEWHERE",
-"exec : TOK_ENDWHERE",
-"exec : logif TOK_THEN",
-"exec : TOK_ELSEIF '(' expr ')' TOK_THEN",
-"exec : TOK_ELSE",
-"exec : TOK_ENDIF opt_name",
-"exec : TOK_CASE caselist ')'",
-"exec : TOK_SELECTCASE '(' expr ')'",
-"exec : TOK_CASEDEFAULT",
-"exec : TOK_ENDSELECT",
-"exec : TOK_CONTAINS",
-"word_endsubroutine : TOK_ENDSUBROUTINE",
-"word_endunit : TOK_ENDUNIT",
-"word_endprogram : TOK_ENDPROGRAM",
-"word_endfunction : TOK_ENDFUNCTION",
-"caselist : expr",
-"caselist : caselist ',' expr",
-"caselist : caselist ':' expr",
-"boucledo : worddo opt_int do_arg",
-"boucledo : wordwhile expr",
-"boucledo : TOK_ENDDO optname",
-"do_arg :",
-"do_arg : do_var '=' expr ',' expr",
-"do_arg : do_var '=' expr ',' expr ',' expr",
-"opt_int :",
-"opt_int : TOK_CSTINT opt_comma",
-"opt_name : '\\n'",
-"opt_name : TOK_NAME",
-"optname :",
-"optname : TOK_NAME",
-"worddo : TOK_PLAINDO",
-"wordwhile : TOK_DOWHILE",
-"dotarget :",
-"dotarget : TOK_CSTINT",
-"iffable : TOK_CONTINUE",
-"iffable : ident_dims after_ident_dims",
-"iffable : goto",
-"iffable : io",
-"iffable : call",
-"iffable : TOK_ALLOCATE '(' allocation_list opt_stat_spec ')'",
-"iffable : TOK_DEALLOCATE '(' allocate_object_list opt_stat_spec ')'",
-"iffable : TOK_EXIT optexpr",
-"iffable : TOK_RETURN opt_expr",
-"iffable : TOK_CYCLE opt_expr",
-"iffable : stop opt_expr",
-"iffable : int_list",
-"before_dims :",
-"ident_dims : ident before_dims dims dims",
-"ident_dims : ident_dims '%' ident before_dims dims dims",
-"int_list : TOK_CSTINT",
-"int_list : int_list ',' TOK_CSTINT",
-"after_ident_dims : '=' expr",
-"after_ident_dims : TOK_POINT_TO expr",
-"call : keywordcall opt_call",
-"opt_call :",
-"opt_call : '(' opt_callarglist ')'",
-"opt_callarglist :",
-"opt_callarglist : callarglist",
-"keywordcall : before_call TOK_NAME",
-"before_call : TOK_CALL",
-"callarglist : callarg",
-"callarglist : callarglist ',' callarg",
-"callarg : expr",
-"callarg : '*' label",
-"stop : TOK_PAUSE",
-"stop : TOK_STOP",
-"io : iofctl ioctl",
-"io : read option_read",
-"io : write ioctl",
-"io : write ioctl outlist",
-"io : TOK_REWIND after_rewind",
-"io : TOK_FORMAT",
-"opt_CHAR_INT :",
-"opt_CHAR_INT : TOK_CSTINT TOK_NAME",
-"idfile : '*'",
-"idfile : TOK_CSTINT",
-"idfile : ident",
-"option_print :",
-"option_print : ',' outlist",
-"option_inlist :",
-"option_inlist : inlist",
-"option_read : ioctl option_inlist",
-"option_read : infmt opt_inlist",
-"opt_outlist :",
-"opt_outlist : outlist",
-"opt_inlist :",
-"opt_inlist : ',' inlist",
-"ioctl : '(' ctllist ')'",
-"ioctl : '(' fexpr ')'",
-"after_rewind : '(' ident ')'",
-"after_rewind : '(' TOK_CSTINT ')'",
-"after_rewind : TOK_CSTINT",
-"after_rewind : '(' uexpr ')'",
-"after_rewind : TOK_NAME",
-"ctllist : ioclause",
-"ctllist : ctllist ',' ioclause",
-"ioclause : fexpr",
-"ioclause : '*'",
-"ioclause : TOK_DASTER",
-"ioclause : TOK_NAME expr",
-"ioclause : TOK_NAME expr '%' ident_dims",
-"ioclause : TOK_NAME '(' triplet ')'",
-"ioclause : TOK_NAME '*'",
-"ioclause : TOK_NAME TOK_DASTER",
-"iofctl : TOK_OPEN",
-"iofctl : TOK_CLOSE",
-"infmt : unpar_fexpr",
-"infmt : '*'",
-"read : TOK_READ",
-"read : TOK_INQUIRE",
-"read : TOK_PRINT",
-"write : TOK_WRITE",
-"fexpr : unpar_fexpr",
-"fexpr : '(' fexpr ')'",
-"unpar_fexpr : lhs",
-"unpar_fexpr : simple_const",
-"unpar_fexpr : fexpr addop fexpr",
-"unpar_fexpr : fexpr '*' fexpr",
-"unpar_fexpr : fexpr TOK_SLASH fexpr",
-"unpar_fexpr : fexpr TOK_DASTER fexpr",
-"unpar_fexpr : addop fexpr",
-"unpar_fexpr : fexpr TOK_DSLASH fexpr",
-"unpar_fexpr : TOK_FILE expr",
-"unpar_fexpr : TOK_EXIST expr",
-"unpar_fexpr : TOK_ERR expr",
-"unpar_fexpr : TOK_END expr",
-"unpar_fexpr : TOK_NAME '=' expr",
-"addop : '+'",
-"addop : '-'",
-"inlist : inelt",
-"inlist : inlist ',' inelt",
-"opt_lhs :",
-"opt_lhs : lhs",
-"inelt : opt_lhs opt_operation",
-"inelt : '(' inlist ')' opt_operation",
-"inelt : predefinedfunction opt_operation",
-"inelt : simple_const opt_operation",
-"inelt : '(' inlist ',' dospec ')'",
-"opt_operation :",
-"opt_operation : operation",
-"opt_operation : opt_operation operation",
-"outlist : uexpr",
-"outlist : other",
-"outlist : out2",
-"out2 : uexpr ',' expr",
-"out2 : uexpr ',' other",
-"out2 : other ',' expr",
-"out2 : other ',' other",
-"out2 : out2 ',' expr",
-"out2 : out2 ',' other",
-"out2 : uexpr",
-"out2 : predefinedfunction",
-"other : complex_const",
-"other : '(' expr ')'",
-"other : '(' uexpr ',' dospec ')'",
-"other : '(' other ',' dospec ')'",
-"other : '(' out2 ',' dospec ')'",
-"dospec : TOK_NAME '=' expr ',' expr",
-"dospec : TOK_NAME '=' expr ',' expr ',' expr",
-"labellist : label",
-"labellist : labellist ',' label",
-"label : TOK_CSTINT",
-"goto : TOK_PLAINGOTO '(' expr ',' expr ')' ',' expr",
-"goto : TOK_PLAINGOTO label",
-"allocation_list : allocate_object",
-"allocation_list : ident_dims",
-"allocation_list : allocation_list ',' allocate_object",
-"allocate_object : ident",
-"allocate_object : structure_component",
-"allocate_object : array_element",
-"array_element : ident '(' funargs ')'",
-"subscript_list : expr",
-"subscript_list : subscript_list ',' expr",
-"allocate_object_list : allocate_object",
-"allocate_object_list : allocate_object_list ',' allocate_object",
-"opt_stat_spec :",
-"opt_stat_spec : ',' TOK_STAT '=' ident",
-"pointer_name_list : ident",
-"pointer_name_list : pointer_name_list ',' ident",
-"opt_construct_name :",
-"opt_construct_name : TOK_NAME",
-"opt_construct_name_colon :",
-"opt_construct_name_colon : TOK_CONSTRUCTID ':'",
-"logif : TOK_LOGICALIF expr ')'",
-"do_var : ident",
-};
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
 #endif
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH 500
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
 #endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
 #endif
+{
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
 int yydebug;
-int yynerrs;
-int yyerrflag;
-int yychar;
-short *yyssp;
-YYSTYPE *yyvsp;
-YYSTYPE yyval;
-YYSTYPE yylval;
-short yyss[YYSTACKSIZE];
-YYSTYPE yyvs[YYSTACKSIZE];
-#define yystacksize YYSTACKSIZE
-#line 2567 "fortran.y"
-
-void processfortran(char *fichier_entree)
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static YYSIZE_T
+yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+    const char *yystr;
+#endif
 {
-   extern FILE *fortranin;
-   extern FILE *fortranout;
-   char nomfile[LONG_C];
-   int c;
-   int confirmyes;
-
-   /*fortrandebug = 1;*/
-   if ( mark == 1 ) printf("Firstpass == %d \n",firstpass);
-/******************************************************************************/
-/*  1-  Open input and output files                                           */
-/******************************************************************************/
-   strcpy(nomfile,commondirin);
-   strcat(nomfile,"/");
-   strcat(nomfile,fichier_entree);
-   fortranin=fopen( nomfile,"r");
-   if (! fortranin)
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+    char *yydest;
+    const char *yysrc;
+#endif
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
    {
-      printf("Error : File %s does not exist\n",nomfile);
-      exit(1);
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
    }
-
-   strcpy(curfile,nomfile);
-   strcpy(nomfile,commondirout);
-   strcat(nomfile,"/");
-   strcat(nomfile,fichier_entree);
-   strcpy(nomfileoutput,nomfile);
-   Save_Length(nomfileoutput,31);
-   if (firstpass == 1)
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
    {
-      if (checkexistcommon == 1)
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
       {
-         if (fopen(nomfile,"r"))
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
          {
-            printf("Warning : file %s already exist\n",nomfile);
-            confirmyes = 0;
-            while (confirmyes==0)
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
             {
-               printf("Override file %s ? [Y/N]\n",nomfile);
-               c=getchar();
-               getchar();
-               if (c==79 || c==110)
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
                {
-                  printf("We stop\n");
-                  exit(1);
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
                }
-               if (c==89 || c==121)
+	      else
                {
-                  confirmyes=1;
+		  yyp++;
+		  yyf++;
                }
             }
          }
+      return yysize;
       }
+}
+#endif /* YYERROR_VERBOSE */
+
+
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  switch (yytype)
+   {
+
+      default:
+	break;
    }
-
-/******************************************************************************/
-/*  2-  Variables initialization                                              */
-/******************************************************************************/
-
-   line_num_fortran_common=1;
-   line_num_fortran=1;
-   PublicDeclare = 0;
-   PrivateDeclare = 0;
-   ExternalDeclare = 0;
-   SaveDeclare = 0;
-   pointerdeclare = 0;
-   optionaldeclare = 0;
-   incalldeclare = 0;
-   VarType = 0;
-   VarTypepar = 0;
-   Allocatabledeclare = 0 ;
-   strcpy(NamePrecision," ");
-   VariableIsParameter =  0 ;
-   strcpy(NamePrecision,"");
-   c_star = 0 ;
-   functiondeclarationisdone = 0;
-   insubroutinedeclare = 0 ;
-   strcpy(subroutinename," ");
-   InitialValueGiven = 0 ;
-   strcpy(EmptyChar," ");
-   inmoduledeclare = 0;
-   colnum=0;
-   incom=0;
-   couldaddvariable=1;
-   aftercontainsdeclare = 1;
-   strcpy(nameinttypename,"");
-   /* Name of the file without format                                         */
-   tmp = strchr(fichier_entree, '.');
-   strncpy(curfilename,fichier_entree,strlen(fichier_entree)-strlen(tmp));
-   Save_Length(curfilename,30);
-/******************************************************************************/
-/*  3-  Parsing of the input file (1 time)                                    */
-/******************************************************************************/
-   if (firstpass == 0 )
-   {
-      fortranout=fopen(nomfileoutput,"w");
-
-      NewModule_Creation_0();
-   }
-
-   fortranparse();
-
-   strcpy(curfile,mainfile);
-
-   if (firstpass == 0 ) fclose(fortranout);
 }
-#line 7005 "y.tab.c"
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
-yyparse()
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
 {
-    register int yym, yyn, yystate;
-#if YYDEBUG
-    register char *yys;
-    extern char *getenv();
-
-    if (yys = getenv("YYDEBUG"))
-    {
-        yyn = *yys;
-        if (yyn >= '0' && yyn <= '9')
-            yydebug = yyn - '0';
-    }
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
     yynerrs = 0;
-    yyerrflag = 0;
-    yychar = (-1);
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
 
     yyssp = yyss;
     yyvsp = yyvs;
-    *yyssp = yystate = 0;
-
-yyloop:
-    if (yyn = yydefred[yystate]) goto yyreduce;
-    if (yychar < 0)
-    {
-        if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-        if (yydebug)
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, reading %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
+	/* Give user a chance to reallocate the stack.  Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	yytype_int16 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow (YY_("memory exhausted"),
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
         }
-#endif
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+    {
+	yytype_int16 *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+        }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
     }
-    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: state %d, shifting to state %d\n",
-                    YYPREFIX, yystate, yytable[yyn]);
-#endif
-        if (yyssp >= yyss + yystacksize - 1)
-        {
-            goto yyoverflow;
-        }
-        *++yyssp = yystate = yytable[yyn];
-        *++yyvsp = yylval;
-        yychar = (-1);
-        if (yyerrflag > 0)  --yyerrflag;
-        goto yyloop;
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
     }
-    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-        yyn = yytable[yyn];
-        goto yyreduce;
-    }
-    if (yyerrflag) goto yyinrecovery;
-#ifdef lint
-    goto yynewerror;
-#endif
-yynewerror:
-    yyerror("syntax error");
-#ifdef lint
-    goto yyerrlab;
-#endif
-yyerrlab:
-    ++yynerrs;
-yyinrecovery:
-    if (yyerrflag < 3)
-    {
-        yyerrflag = 3;
-        for (;;)
-        {
-            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
-                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
-#endif
-                if (yyssp >= yyss + yystacksize - 1)
-                {
-                    goto yyoverflow;
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
                 }
-                *++yyssp = yystate = yytable[yyn];
-                *++yyvsp = yylval;
-                goto yyloop;
-            }
             else
             {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: error recovery discarding state %d\n",
-                            YYPREFIX, *yyssp);
-#endif
-                if (yyssp <= yyss) goto yyabort;
-                --yyssp;
-                --yyvsp;
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
             }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
         }
-    }
-    else
-    {
-        if (yychar == 0) goto yyabort;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-        yychar = (-1);
-        goto yyloop;
-    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  yystate = yyn;
+  *++yyvsp = yylval;
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
 yyreduce:
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
-                YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
-    yym = yylen[yyn];
-    yyval = yyvsp[1-yym];
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
     switch (yyn)
     {
-case 7:
-#line 341 "fortran.y"
-{yyerrok;yyclearin;}
-break;
-case 12:
-#line 349 "fortran.y"
-{
+        case 8:
+#line 344 "fortran.y"
+    {yyerrok;yyclearin;;}
+    break;
+
+  case 13:
+#line 352 "fortran.y"
+    {
                      if (inmoduledeclare == 0 )
                      {
@@ -7156,43 +3683,54 @@
                                               pos_end-pos_curinclude);
                      }
-                  }
-break;
-case 17:
-#line 365 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 18:
+#line 368 "fortran.y"
+    {
             /* we should ignore the declaration until the keyword             */
             /*    TOK_ENDDONOTTREAT                                           */
             couldaddvariable = 0 ;
             RemoveWordCUR_0(fortranout,-20,20);
-         }
-break;
-case 18:
-#line 372 "fortran.y"
-{
+         ;}
+    break;
+
+  case 19:
+#line 375 "fortran.y"
+    {
              couldaddvariable = 1 ;
              RemoveWordCUR_0(fortranout,-24,24);
-          }
-break;
-case 21:
-#line 379 "fortran.y"
-{pos_cur = setposcur();}
-break;
-case 26:
-#line 388 "fortran.y"
-{incom = 1;}
-break;
-case 27:
-#line 391 "fortran.y"
-{if (incom !=1) {strcpy(curbuf,"");incom=0;}}
-break;
-case 31:
-#line 398 "fortran.y"
-{
-                      if ( couldaddvariable == 1 )
+          ;}
+    break;
+
+  case 22:
+#line 382 "fortran.y"
+    {pos_cur = setposcur();;}
+    break;
+
+  case 27:
+#line 394 "fortran.y"
+    {if (incom !=1) {strcpy(curbuf,"");incom=0;};}
+    break;
+
+  case 28:
+#line 397 "fortran.y"
+    {isrecursive = 0;;}
+    break;
+
+  case 29:
+#line 399 "fortran.y"
+    {isrecursive = 1;;}
+    break;
+
+  case 31:
+#line 403 "fortran.y"
+                      {
+                      if ( couldaddvariable == 1)
                       {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(3) - (4)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
@@ -7200,5 +3738,5 @@
 
                       }
-                      Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                      Add_SubroutineArgument_Var_1((yyvsp[(4) - (4)].l));
                       if ( inmodulemeet == 1 )
                       {
@@ -7214,13 +3752,14 @@
                       }
                       }
-                   }
-break;
-case 32:
-#line 426 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 32:
+#line 431 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[0].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (2)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
@@ -7228,5 +3767,5 @@
 
                       }
-                      strcpy(subroutinename,yyvsp[0].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (2)].nac));
                       /* Common case                                          */
                       insubroutinedeclare = 1;
@@ -7234,18 +3773,19 @@
                       /*    the subroutine sub_loop_<subroutinename>          */
                       writeheadnewsub_0(1);
-                   }
-break;
-case 33:
-#line 444 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 33:
+#line 449 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-3].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (5)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-3].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (5)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7253,5 +3793,5 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[-2].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (5)].l));
                          strcpy(DeclType,"");
                          /* in the second step we should write the head of    */
@@ -7264,23 +3804,24 @@
                             /* we should to list of the subroutine argument   */
                             /* name of the function which has to be defined   */
-                            Add_SubroutineArgument_Var_1(yyvsp[-2].l);
+                            Add_SubroutineArgument_Var_1((yyvsp[(3) - (5)].l));
                             strcpy(DeclType,"");
-                            Add_FunctionType_Var_1(yyvsp[-3].nac);
+                            Add_FunctionType_Var_1((yyvsp[(2) - (5)].nac));
                             writeheadnewsub_0(2);
                       }
-                   }
-break;
-case 34:
-#line 477 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 34:
+#line 482 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (3)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-1].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (3)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7288,7 +3829,7 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
                          strcpy(DeclType,"");
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7300,18 +3841,19 @@
                             /* we should to list of the subroutine argument   */
                             /* name of the function which has to be defined   */
-                            Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                            Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
                             strcpy(DeclType,"");
-                            Add_FunctionType_Var_1(yyvsp[-1].nac);
+                            Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                             writeheadnewsub_0(2);
                       }
-                   }
-break;
-case 35:
-#line 511 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 35:
+#line 516 "fortran.y"
+    {
                       GlobalDeclaration = 0;
-                      strcpy(curmodulename,yyvsp[0].nac);
+                      strcpy(curmodulename,(yyvsp[(2) - (2)].nac));
                       strcpy(subroutinename,"");
-                      Add_NameOfModule_1(yyvsp[0].nac);
+                      Add_NameOfModule_1((yyvsp[(2) - (2)].nac));
                       if ( inmoduledeclare == 0 )
                       {
@@ -7323,92 +3865,104 @@
                          aftercontainsdeclare = 0 ;
                       }
-                   }
-break;
-case 36:
-#line 528 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 36:
+#line 533 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,yyvsp[0].nac);strcpy(subroutinename,yyvsp[0].nac);
+                         strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));strcpy(subroutinename,(yyvsp[(1) - (1)].nac));
                       }
-                   }
-break;
-case 38:
-#line 537 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 38:
+#line 542 "fortran.y"
+    {
                       pos_curinclude = setposcur()-9;
-                   }
-break;
-case 39:
-#line 541 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) Add_Include_1(yyvsp[0].nac);
-                   }
-break;
-case 40:
-#line 545 "fortran.y"
-{
-                      if ( firstpass == 1 && couldaddvariable == 1) yyval.l=NULL;
-                   }
-break;
-case 41:
-#line 548 "fortran.y"
-{
-                      if ( firstpass == 1 && couldaddvariable == 1 ) yyval.l=NULL;
-                   }
-break;
-case 42:
-#line 552 "fortran.y"
-{
-                       if ( firstpass == 1 && couldaddvariable == 1 ) yyval.l=yyvsp[-1].l;
-                   }
-break;
-case 45:
-#line 559 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 39:
+#line 546 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) Add_Include_1((yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 40:
+#line 550 "fortran.y"
+    {
+                      if ( firstpass == 1 && couldaddvariable == 1) (yyval.l)=NULL;
+                   ;}
+    break;
+
+  case 41:
+#line 553 "fortran.y"
+    {
+                      if ( firstpass == 1 && couldaddvariable == 1 ) (yyval.l)=NULL;
+                   ;}
+    break;
+
+  case 42:
+#line 557 "fortran.y"
+    {
+                       if ( firstpass == 1 && couldaddvariable == 1 ) (yyval.l)=(yyvsp[(2) - (3)].l);
+                   ;}
+    break;
+
+  case 45:
+#line 564 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         Add_SubroutineArgument_Var_1(yyvsp[-1].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(2) - (3)].l));
                       }
-                   }
-break;
-case 46:
-#line 566 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 46:
+#line 571 "fortran.y"
+    {
                       if ( firstpass == 1  && couldaddvariable == 1)
                       {
                          strcpy(nameinttypenameback,nameinttypename);
                          strcpy(nameinttypename,"");
-                         curvar=createvar(yyvsp[0].na,NULL);
+                         curvar=createvar((yyvsp[(1) - (1)].na),NULL);
                         strcpy(nameinttypename,nameinttypenameback);
                          curlistvar=insertvar(NULL,curvar);
-                         yyval.l=settype("",curlistvar);
+                         (yyval.l)=settype("",curlistvar);
                       }
-                   }
-break;
-case 47:
-#line 578 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 47:
+#line 583 "fortran.y"
+    {
                       if ( firstpass == 1  && couldaddvariable == 1)
                       {
                          strcpy(nameinttypenameback,nameinttypename);
                          strcpy(nameinttypename,"");                      
-                         curvar=createvar(yyvsp[0].na,NULL);
+                         curvar=createvar((yyvsp[(3) - (3)].na),NULL);
                          strcpy(nameinttypename,nameinttypenameback);                         
-                         yyval.l=insertvar(yyvsp[-2].l,curvar);
+                         (yyval.l)=insertvar((yyvsp[(1) - (3)].l),curvar);
                       }
-                   }
-break;
-case 48:
-#line 589 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 49:
-#line 590 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,"*");}
-break;
-case 50:
-#line 593 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 48:
+#line 594 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 49:
+#line 595 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),"*");;}
+    break;
+
+  case 50:
+#line 598 "fortran.y"
+    {
                       if ( VarTypepar == 1 )
                       {
@@ -7416,9 +3970,10 @@
                          VarTypepar = 0;
                       }
-                   }
-break;
-case 51:
-#line 601 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 51:
+#line 606 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -7426,22 +3981,26 @@
                          couldaddvariable = 0 ;
                       }
-                   }
-break;
-case 52:
-#line 609 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 52:
+#line 614 "fortran.y"
+    {
                       if ( VarType == 1 ) couldaddvariable = 1 ;
                       VarType = 0;
                       VarTypepar = 0;
-                   }
-break;
-case 54:
-#line 616 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 54:
+#line 621 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[-1].l);
-                         else Add_Parameter_Var_1(yyvsp[-1].l);
+                         {
+                                                  Add_GlobalParameter_Var_1((yyvsp[(3) - (4)].l));
+                                                  }
+                         else Add_Parameter_Var_1((yyvsp[(3) - (4)].l));
                          pos_end = setposcur();
                         RemoveWordSET_0(fortranout,pos_cur_decl,
@@ -7449,14 +4008,15 @@
                       }
                       VariableIsParameter =  0 ;
-                   }
-break;
-case 55:
-#line 629 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 55:
+#line 636 "fortran.y"
+    {
                      if ( couldaddvariable == 1 )
                      {
                         if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[0].l);
-                         else Add_Parameter_Var_1(yyvsp[0].l);
+                                                  Add_GlobalParameter_Var_1((yyvsp[(2) - (2)].l));
+                         else Add_Parameter_Var_1((yyvsp[(2) - (2)].l));
                          pos_end = setposcur();
                          RemoveWordSET_0(fortranout,pos_cur_decl,
@@ -7464,17 +4024,19 @@
                       }
                       VariableIsParameter =  0 ;
-                   }
-break;
-case 57:
-#line 643 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 57:
+#line 650 "fortran.y"
+    {
                      pos_end = setposcur();
                      RemoveWordSET_0(fortranout,pos_cursave,
                                                 pos_end-pos_cursave);
-                  }
-break;
-case 59:
-#line 650 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 59:
+#line 657 "fortran.y"
+    {
                    /* if the variable is a parameter we can suppose that is   */
                    /*    value is the same on each grid. It is not useless to */
@@ -7482,10 +4044,10 @@
                       if ( couldaddvariable == 1 )
                       {
-                         Add_Globliste_1(yyvsp[0].l);
+                         Add_Globliste_1((yyvsp[(1) - (1)].l));
                          /* if variableparamlists has been declared in a      */
                          /*    subroutine                                     */
                          if ( insubroutinedeclare == 1 )
                          {
-                            Add_Dimension_Var_1(yyvsp[0].l);
+                            Add_Dimension_Var_1((yyvsp[(1) - (1)].l));
                          }
                          pos_end = setposcur();
@@ -7503,4 +4065,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -7510,26 +4073,28 @@
                       strcpy(nameinttypename,"");
                       strcpy(c_selectorname,"");
-                   }
-break;
-case 60:
-#line 686 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 60:
+#line 694 "fortran.y"
+    {
       if (firstpass == 0)
       {
-      if (yyvsp[0].lnn)
+      if ((yyvsp[(1) - (1)].lnn))
       {
-      removeglobfromlist(&(yyvsp[0].lnn));
+      removeglobfromlist(&((yyvsp[(1) - (1)].lnn)));
       pos_end = setposcur();
            RemoveWordSET_0(fortranout,pos_cur,pos_end-pos_cur);
-      writelistpublic(yyvsp[0].lnn);
+      writelistpublic((yyvsp[(1) - (1)].lnn));
       }
       }
-      }
-break;
-case 70:
-#line 708 "fortran.y"
-{
+      ;}
+    break;
+
+  case 70:
+#line 716 "fortran.y"
+    {
                       /* we should remove the data declaration                */
-                      if ( couldaddvariable == 1 && aftercontainsdeclare == 0 )
+                      if ( couldaddvariable == 1 && aftercontainsdeclare != 2 )
                       {
                         pos_end = setposcur();
@@ -7537,16 +4102,26 @@
                                               pos_end-pos_curdata);
                       }
+                      if ( couldaddvariable == 1 && aftercontainsdeclare == 1 )
+                      {
+                      if (firstpass == 0)
+                      {
+                        ReWriteDataStatement_0(fortranout);
+                        pos_end = setposcur();
                   }
-break;
-case 72:
-#line 720 "fortran.y"
-{
+                      }
+                  ;}
+    break;
+
+  case 72:
+#line 736 "fortran.y"
+    {
          PublicDeclare = 0 ;
          PrivateDeclare = 0 ;
-      }
-break;
-case 110:
-#line 771 "fortran.y"
-{
+      ;}
+    break;
+
+  case 110:
+#line 787 "fortran.y"
+    {
                       /* if the variable is a parameter we can suppose that is*/
                       /*    value is the same on each grid. It is not useless */
@@ -7563,5 +4138,5 @@
                       else
                        {*/
-                        ReWriteDeclarationAndAddTosubroutine_01(yyvsp[-1].l);
+                        ReWriteDeclarationAndAddTosubroutine_01((yyvsp[(1) - (2)].l));
                         pos_cur_decl = setposcur();
                         
@@ -7571,4 +4146,5 @@
                            insubroutinedeclare == 0 )
                       {
+
                          sprintf(ligne,"\n#include \"Module_Declar_%s.h\"\n"
                                                                 ,curmodulename);
@@ -7579,15 +4155,17 @@
                          tofich (module_declar, ligne,1);
                          GlobalDeclaration = 1 ;
+                         pos_cur_decl = setposcur();
+
                       }
-                         yyval.l = yyvsp[-1].l;
-                         Add_Globliste_1(yyvsp[-1].l);
+                         (yyval.l) = (yyvsp[(1) - (2)].l);
+                         Add_Globliste_1((yyvsp[(1) - (2)].l));
                                                   
                          if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[-1].l);
+                                                  Add_GlobalParameter_Var_1((yyvsp[(1) - (2)].l));
                          else
                          {
                             if ( pointerdeclare == 1 )
-                                                Add_Pointer_Var_From_List_1(yyvsp[-1].l);
-                            Add_Parameter_Var_1(yyvsp[-1].l);
+                                                Add_Pointer_Var_From_List_1((yyvsp[(1) - (2)].l));
+                            Add_Parameter_Var_1((yyvsp[(1) - (2)].l));
                          }
 
@@ -7604,6 +4182,6 @@
                               SaveDeclare == 1 && firstpass == 1 )
                          {
-                              if ( inmodulemeet == 0 ) Add_Save_Var_dcl_1(yyvsp[-1].l);
-                              else  Add_SubroutineDeclarationSave_Var_1(yyvsp[-1].l);
+                              if ( inmodulemeet == 0 ) Add_Save_Var_dcl_1((yyvsp[(1) - (2)].l));
+                              else  Add_SubroutineDeclarationSave_Var_1((yyvsp[(1) - (2)].l));
                          }
                       }
@@ -7618,4 +4196,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -7625,18 +4204,19 @@
                       strcpy(nameinttypename,"");
                       strcpy(c_selectorname,"");
-                   }
-break;
-case 111:
-#line 850 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 111:
+#line 870 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (3)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-1].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (3)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7644,6 +4224,6 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7655,6 +4235,6 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7663,50 +4243,67 @@
                       strcpy(nameinttypename,"");
 
-                   }
-break;
-case 112:
-#line 887 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 112:
+#line 907 "fortran.y"
+    {
                        functiondeclarationisdone = 1;
-                   }
-break;
-case 113:
-#line 893 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 113:
+#line 913 "fortran.y"
+    {
                       VariableIsParameter = 1;
                       pos_curparameter = setposcur()-9;
-                   }
-break;
-case 114:
-#line 898 "fortran.y"
-{
-                      pos_curdata = setposcur()-strlen(yyvsp[0].nac);
-                   }
-break;
-case 115:
-#line 902 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 114:
+#line 918 "fortran.y"
+    {
+                      pos_curdata = setposcur()-strlen((yyvsp[(1) - (1)].nac));
+                      Init_List_Data_Var();
+                   ;}
+    break;
+
+  case 115:
+#line 923 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",yyvsp[-1].na);
-                      Add_Data_Var_1(yyvsp[-3].nac,ligne);
+/*                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+/*                      sprintf(ligne,"%s",$3);*/
+                      createstringfromlistname(ligne,(yyvsp[(3) - (4)].lnn));
+                      if (firstpass == 1)
+                      Add_Data_Var_1(&List_Data_Var,(yyvsp[(1) - (4)].nac),ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,(yyvsp[(1) - (4)].nac),ligne);
                       }
-                   }
-break;
-case 116:
-#line 911 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 116:
+#line 937 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",yyvsp[-1].na);
-                      Add_Data_Var_1(yyvsp[-3].nac,ligne);
+                      /*if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+                      /*sprintf(ligne,"%s",$5);   */
+                      createstringfromlistname(ligne,(yyvsp[(5) - (6)].lnn));                      
+                      if (firstpass == 1)                      
+                      Add_Data_Var_1(&List_Data_Var,(yyvsp[(3) - (6)].nac),ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,(yyvsp[(3) - (6)].nac),ligne);                      
                       }
-                   }
-break;
-case 117:
-#line 920 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 117:
+#line 951 "fortran.y"
+    {
                        /*******************************************************/
                        /*******************************************************/
@@ -7716,78 +4313,132 @@
                        /*******************************************************/
                        /*******************************************************/
-                   }
-break;
-case 118:
-#line 931 "fortran.y"
-{
+                       if (firstpass == 1)
+                       Add_Data_Var_Names_01(&List_Data_Var,(yyvsp[(1) - (4)].lnn),(yyvsp[(3) - (4)].lnn));
+                       else
+                       Add_Data_Var_Names_01(&List_Data_Var_Cur,(yyvsp[(1) - (4)].lnn),(yyvsp[(3) - (4)].lnn));
+                   ;}
+    break;
+
+  case 118:
+#line 966 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.na,yyvsp[0].na);
+                         (yyval.lnn) = Insertname(NULL,(yyvsp[(1) - (1)].na),0);
                       }
-                   }
-break;
-case 119:
-#line 938 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 119:
+#line 973 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);
+                         (yyval.lnn) = Insertname((yyvsp[(3) - (3)].lnn),(yyvsp[(1) - (3)].na),1);
                       }
-                   }
-break;
-case 124:
-#line 952 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 124:
+#line 987 "fortran.y"
+    {
                      pos_cursave = setposcur()-4;
-                  }
-break;
-case 126:
-#line 958 "fortran.y"
-{
-                     if ( couldaddvariable == 1 ) Add_Save_Var_1(yyvsp[-1].nac,yyvsp[0].d);
-                  }
-break;
-case 130:
-#line 967 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].nac);}
-break;
-case 131:
-#line 969 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s+%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 132:
-#line 971 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s-%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 133:
-#line 973 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s*%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 134:
-#line 975 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s/%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 135:
-#line 978 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"");}
-break;
-case 136:
-#line 980 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 145:
-#line 995 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 126:
+#line 993 "fortran.y"
+    {
+                     if ( couldaddvariable == 1 ) Add_Save_Var_1((yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].d));
+                  ;}
+    break;
+
+  case 127:
+#line 998 "fortran.y"
+    {
+		(yyval.lnn)=Insertname(NULL,(yyvsp[(1) - (1)].nac),0);
+		;}
+    break;
+
+  case 128:
+#line 1002 "fortran.y"
+    {
+      printf("INSTRUCTION NON TRAITEE : INITIALISATION DE DATA AVEC EXPRESSION\n");
+      exit(0);
+      ;}
+    break;
+
+  case 129:
+#line 1007 "fortran.y"
+    {
+      (yyval.lnn) = concat_listname((yyvsp[(1) - (3)].lnn),(yyvsp[(3) - (3)].lnn));
+      ;}
+    break;
+
+  case 130:
+#line 1012 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 131:
+#line 1014 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s+%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 132:
+#line 1016 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s-%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 133:
+#line 1018 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s*%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 134:
+#line 1020 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s/%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 135:
+#line 1023 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"");;}
+    break;
+
+  case 136:
+#line 1025 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 143:
+#line 1037 "fortran.y"
+    {
+	ininterfacedeclare = 1 ;
+	printf("INTEFACE entree\n");
+	;}
+    break;
+
+  case 144:
+#line 1042 "fortran.y"
+    {
+      ininterfacedeclare = 0;
+      ;}
+    break;
+
+  case 145:
+#line 1047 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curdimension = setposcur()-9;
-                   }
-break;
-case 146:
-#line 1001 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 146:
+#line 1053 "fortran.y"
+    {
          if ( couldaddvariable == 1 )
          {
             /*                                                                */
-            curvar=createvar(yyvsp[-2].nac,yyvsp[-1].d);
+            curvar=createvar((yyvsp[(3) - (5)].nac),(yyvsp[(4) - (5)].d));
             /*                                                                */
             CreateAndFillin_Curvar("",curvar);
@@ -7795,160 +4446,178 @@
             curlistvar=insertvar(NULL,curvar);
             /*                                                                */
-            yyval.l=settype("",curlistvar);
+            (yyval.l)=settype("",curlistvar);
             /*                                                                */
             strcpy(vallengspec,"");
          }
-      }
-break;
-case 147:
-#line 1017 "fortran.y"
-{
+      ;}
+    break;
+
+  case 147:
+#line 1069 "fortran.y"
+    {
          if ( couldaddvariable == 1 )
          {
             /*                                                                */
-            curvar=createvar(yyvsp[-2].nac,yyvsp[-1].d);
+            curvar=createvar((yyvsp[(3) - (5)].nac),(yyvsp[(4) - (5)].d));
             /*                                                                */
             CreateAndFillin_Curvar("",curvar);
             /*                                                                */
-            curlistvar=insertvar(yyvsp[-4].l,curvar);
+            curlistvar=insertvar((yyvsp[(1) - (5)].l),curvar);
             /*                                                                */
-            yyval.l=curlistvar;
+            (yyval.l)=curlistvar;
             /*                                                                */
             strcpy(vallengspec,"");
          }
-      }
-break;
-case 150:
-#line 1037 "fortran.y"
-{
-        yyval.lnn=(listname *)NULL;
-        }
-break;
-case 151:
-#line 1041 "fortran.y"
-{
-          yyval.lnn=yyvsp[0].lnn;
-         }
-break;
-case 152:
-#line 1046 "fortran.y"
-{
-           yyval.lnn = Insertname(NULL,yyvsp[0].nac);
-           }
-break;
-case 153:
-#line 1050 "fortran.y"
-{
-          yyval.lnn = Insertname(yyvsp[-2].lnn,yyvsp[0].nac);
-          }
-break;
-case 154:
-#line 1055 "fortran.y"
-{
+      ;}
+    break;
+
+  case 150:
+#line 1089 "fortran.y"
+    {
+        (yyval.lnn)=(listname *)NULL;
+        ;}
+    break;
+
+  case 151:
+#line 1093 "fortran.y"
+    {
+          (yyval.lnn)=(yyvsp[(3) - (3)].lnn);
+         ;}
+    break;
+
+  case 152:
+#line 1098 "fortran.y"
+    {
+           (yyval.lnn) = Insertname(NULL,(yyvsp[(1) - (1)].nac),0);
+           ;}
+    break;
+
+  case 153:
+#line 1102 "fortran.y"
+    {
+          (yyval.lnn) = Insertname((yyvsp[(1) - (3)].lnn),(yyvsp[(3) - (3)].nac),0);
+          ;}
+    break;
+
+  case 154:
+#line 1107 "fortran.y"
+    {
                          pos_end = setposcur();
                          RemoveWordSET_0(fortranout,pos_curcommon,
                                                   pos_end-pos_curcommon);
-                   }
-break;
-case 155:
-#line 1061 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 155:
+#line 1113 "fortran.y"
+    {
                          if ( couldaddvariable == 1 )
                          {
-                            sprintf(charusemodule,"%s",yyvsp[-1].nac);
-                            Add_NameOfCommon_1(yyvsp[-1].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(2) - (3)].nac));
+                            Add_NameOfCommon_1((yyvsp[(2) - (3)].nac),subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
                                                        pos_end-pos_curcommon);
                          }
-                   }
-break;
-case 156:
-#line 1072 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 156:
+#line 1124 "fortran.y"
+    {
                          if ( couldaddvariable == 1 )
                          {
-                            sprintf(charusemodule,"%s",yyvsp[-2].nac);
-                            Add_NameOfCommon_1(yyvsp[-2].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(3) - (5)].nac));
+                            Add_NameOfCommon_1((yyvsp[(3) - (5)].nac),subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
                                                        pos_end-pos_curcommon);
                          }
-                   }
-break;
-case 157:
-#line 1084 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 157:
+#line 1136 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curcommon = setposcur()-6;
-                   }
-break;
-case 158:
-#line 1089 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 158:
+#line 1141 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curcommon = setposcur()-6-7;
-                   }
-break;
-case 159:
-#line 1095 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 159:
+#line 1147 "fortran.y"
+    {
                       if ( couldaddvariable == 1 ) Add_Common_var_1();
-                   }
-break;
-case 160:
-#line 1100 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 160:
+#line 1152 "fortran.y"
+    {
                       if ( couldaddvariable == 1 ) Add_Common_var_1();
-                   }
-break;
-case 161:
-#line 1104 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 161:
+#line 1156 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          positioninblock = positioninblock + 1 ;
-                         strcpy(commonvar,yyvsp[-1].nac);
-                         commondim = yyvsp[0].d;
+                         strcpy(commonvar,(yyvsp[(1) - (2)].nac));
+                         commondim = (yyvsp[(2) - (2)].d);
                       }
-                   }
-break;
-case 162:
-#line 1114 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 162:
+#line 1166 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,"");
+                         strcpy((yyval.nac),"");
                          positioninblock=0;
                          strcpy(commonblockname,"");
                       }
-                   }
-break;
-case 163:
-#line 1123 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 163:
+#line 1175 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,yyvsp[-1].nac);
+                         strcpy((yyval.nac),(yyvsp[(2) - (3)].nac));
                          positioninblock=0;
-                         strcpy(commonblockname,yyvsp[-1].nac);
+                         strcpy(commonblockname,(yyvsp[(2) - (3)].nac));
                       }
-                   }
-break;
-case 166:
-#line 1136 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) yyval.l=insertvar(NULL,yyvsp[0].v);
-                   }
-break;
-case 167:
-#line 1140 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) yyval.l=insertvar(yyvsp[-2].l,yyvsp[0].v);
-                   }
-break;
-case 168:
-#line 1145 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 166:
+#line 1188 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) (yyval.l)=insertvar(NULL,(yyvsp[(1) - (1)].v));
+                   ;}
+    break;
+
+  case 167:
+#line 1192 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) (yyval.l)=insertvar((yyvsp[(1) - (3)].l),(yyvsp[(3) - (3)].v));
+                   ;}
+    break;
+
+  case 168:
+#line 1197 "fortran.y"
+    {
                      if ( couldaddvariable == 1 )
                      {
@@ -7958,21 +4627,22 @@
                          /*                                                   */
                          curvar->v_VariableIsParameter=1;
-                         strcpy(curvar->v_nomvar,yyvsp[-2].nac);
-                         Save_Length(yyvsp[-2].nac,4);
+                         strcpy(curvar->v_nomvar,(yyvsp[(1) - (3)].nac));
+                         Save_Length((yyvsp[(1) - (3)].nac),4);
                          strcpy(curvar->v_subroutinename,subroutinename);
                          Save_Length(subroutinename,11);
                          strcpy(curvar->v_modulename,curmodulename);
                          Save_Length(curmodulename,6);
-                         strcpy(curvar->v_initialvalue,yyvsp[0].na);
-                         Save_Length(yyvsp[0].na,14);
+                         strcpy(curvar->v_initialvalue,(yyvsp[(3) - (3)].na));
+                         Save_Length((yyvsp[(3) - (3)].na),14);
                          strcpy(curvar->v_commoninfile,mainfile);
                          Save_Length(mainfile,10);
-                         yyval.v=curvar;
+                         (yyval.v)=curvar;
                       }
-                   }
-break;
-case 172:
-#line 1173 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 172:
+#line 1225 "fortran.y"
+    {
                        if ( insubroutinedeclare == 1 )
                        {
@@ -7982,9 +4652,10 @@
                                                              13);
                        }
-                    }
-break;
-case 175:
-#line 1187 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 175:
+#line 1239 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -7992,9 +4663,9 @@
                          if (dimsgiven == 1)
                          {
-                            curvar=createvar(yyvsp[-3].nac,curdim);
+                            curvar=createvar((yyvsp[(3) - (6)].nac),curdim);
                          }
                          else
                          {
-                            curvar=createvar(yyvsp[-3].nac,yyvsp[-2].d);
+                            curvar=createvar((yyvsp[(3) - (6)].nac),(yyvsp[(4) - (6)].d));
                          }
                          /*                                                   */
@@ -8013,29 +4684,30 @@
                             }
                          }
-                         yyval.l=settype(DeclType,curlistvar);
+                         (yyval.l)=settype(DeclType,curlistvar);
                       }
                       strcpy(vallengspec,"");
-                   }
-break;
-case 176:
-#line 1219 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 176:
+#line 1271 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          if (dimsgiven == 1)
                          {
-                            curvar=createvar(yyvsp[-3].nac,curdim);
+                            curvar=createvar((yyvsp[(4) - (7)].nac),curdim);
                          }
                          else
                          {
-                            curvar=createvar(yyvsp[-3].nac,yyvsp[-2].d);
+                            curvar=createvar((yyvsp[(4) - (7)].nac),(yyvsp[(5) - (7)].d));
                          }
                          /*                                                   */
-                         CreateAndFillin_Curvar(yyvsp[-6].l->var->v_typevar,curvar);
+                         CreateAndFillin_Curvar((yyvsp[(1) - (7)].l)->var->v_typevar,curvar);
                          /*                                                   */
-                         strcpy(curvar->v_typevar,(yyvsp[-6].l->var->v_typevar));
-                         Save_Length(yyvsp[-6].l->var->v_typevar,3);
+                         strcpy(curvar->v_typevar,((yyvsp[(1) - (7)].l)->var->v_typevar));
+                         Save_Length((yyvsp[(1) - (7)].l)->var->v_typevar,3);
                          /*                                                   */
-                         curlistvar=insertvar(yyvsp[-6].l,curvar);
+                         curlistvar=insertvar((yyvsp[(1) - (7)].l),curvar);
                          if (!strcasecmp(DeclType,"character"))
                          {
@@ -8049,563 +4721,697 @@
                             }
                          }
-                         yyval.l=curlistvar;
+                         (yyval.l)=curlistvar;
                       }
                       strcpy(vallengspec,"");
-                   }
-break;
-case 177:
-#line 1253 "fortran.y"
-{dimsgiven=0;}
-break;
-case 178:
-#line 1256 "fortran.y"
-{strcpy(DeclType,yyvsp[-1].nac);}
-break;
-case 179:
-#line 1258 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 177:
+#line 1305 "fortran.y"
+    {dimsgiven=0;;}
+    break;
+
+  case 178:
+#line 1308 "fortran.y"
+    {strcpy(DeclType,(yyvsp[(1) - (2)].nac));;}
+    break;
+
+  case 179:
+#line 1310 "fortran.y"
+    {
                       strcpy(DeclType,"CHARACTER");
-                   }
-break;
-case 180:
-#line 1262 "fortran.y"
-{
-                      strcpy(DeclType,yyvsp[-2].nac);
-                      strcpy(nameinttypename,yyvsp[0].nac);
-                   }
-break;
-case 181:
-#line 1267 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 180:
+#line 1314 "fortran.y"
+    {
+                      strcpy(DeclType,(yyvsp[(1) - (3)].nac));
+                      strcpy(nameinttypename,(yyvsp[(3) - (3)].nac));
+                   ;}
+    break;
+
+  case 181:
+#line 1319 "fortran.y"
+    {
                       strcpy(DeclType,"TYPE");
-                   }
-break;
-case 182:
-#line 1272 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 182:
+#line 1324 "fortran.y"
+    {
                  /*     if ( couldaddvariable == 1 ) VarTypepar = 1 ;
                       couldaddvariable = 0 ;
                       pos_cur_decl = setposcur()-5;*/
                    pos_cur_decl = setposcur()-5;
-                   }
-break;
-case 184:
-#line 1281 "fortran.y"
-{c_selectorgiven=1;strcpy(c_selectorname,yyvsp[0].nac);}
-break;
-case 185:
-#line 1282 "fortran.y"
-{c_star = 1;}
-break;
-case 190:
-#line 1290 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 184:
+#line 1333 "fortran.y"
+    {c_selectorgiven=1;strcpy(c_selectorname,(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 185:
+#line 1334 "fortran.y"
+    {c_star = 1;;}
+    break;
+
+  case 190:
+#line 1342 "fortran.y"
+    {
                       pos_cur_decl = setposcur()-9;
-                   }
-break;
-case 191:
-#line 1294 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 192:
-#line 1297 "fortran.y"
-{
-                      strcpy(yyval.nac,"INTEGER");
+                   ;}
+    break;
+
+  case 191:
+#line 1346 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 192:
+#line 1349 "fortran.y"
+    {
+                      strcpy((yyval.nac),"INTEGER");
                       pos_cur_decl = setposcur()-7;
-                   }
-break;
-case 193:
-#line 1301 "fortran.y"
-{
-                      strcpy(yyval.nac,"REAL");
+                   ;}
+    break;
+
+  case 193:
+#line 1353 "fortran.y"
+    {
+                      strcpy((yyval.nac),"REAL");
                       pos_cur_decl = setposcur()-4;
-                   }
-break;
-case 194:
-#line 1306 "fortran.y"
-{strcpy(yyval.nac,"COMPLEX");
-                   pos_cur_decl = setposcur()-7;}
-break;
-case 195:
-#line 1309 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 194:
+#line 1358 "fortran.y"
+    {strcpy((yyval.nac),"COMPLEX");
+                   pos_cur_decl = setposcur()-7;;}
+    break;
+
+  case 195:
+#line 1361 "fortran.y"
+    {
                       pos_cur_decl = setposcur()-16;
-                      strcpy(yyval.nac,"REAL");
+                      strcpy((yyval.nac),"REAL");
                       strcpy(nameinttypename,"8");
-                   }
-break;
-case 196:
-#line 1315 "fortran.y"
-{strcpy(yyval.nac,"DOUBLE COMPLEX");}
-break;
-case 197:
-#line 1317 "fortran.y"
-{
-                      strcpy(yyval.nac,"LOGICAL");
+                   ;}
+    break;
+
+  case 196:
+#line 1367 "fortran.y"
+    {strcpy((yyval.nac),"DOUBLE COMPLEX");;}
+    break;
+
+  case 197:
+#line 1369 "fortran.y"
+    {
+                      strcpy((yyval.nac),"LOGICAL");
                       pos_cur_decl = setposcur()-7;
-                   }
-break;
-case 199:
-#line 1323 "fortran.y"
-{strcpy(vallengspec,yyvsp[0].na);}
-break;
-case 200:
-#line 1325 "fortran.y"
-{sprintf(yyval.na,"*%s",yyvsp[0].na);}
-break;
-case 201:
-#line 1326 "fortran.y"
-{strcpy(yyval.na,"*(*)");}
-break;
-case 208:
-#line 1337 "fortran.y"
-{
-                      if ( strstr(yyvsp[0].na,"0.d0") )
+                   ;}
+    break;
+
+  case 199:
+#line 1375 "fortran.y"
+    {strcpy(vallengspec,(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 200:
+#line 1377 "fortran.y"
+    {sprintf((yyval.na),"*%s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 201:
+#line 1378 "fortran.y"
+    {strcpy((yyval.na),"*(*)");;}
+    break;
+
+  case 208:
+#line 1389 "fortran.y"
+                      {
+                      if ( strstr((yyvsp[(3) - (3)].na),"0.d0") )
                       {
                          strcpy(nameinttypename,"8");
                          sprintf(NamePrecision,"");
                       }
-                      else sprintf(NamePrecision,"%s = %s",yyvsp[-2].nac,yyvsp[0].na);
-                   }
-break;
-case 209:
-#line 1346 "fortran.y"
-{
-                      strcpy(NamePrecision,yyvsp[0].nac);
-                   }
-break;
-case 210:
-#line 1350 "fortran.y"
-{
-                      strcpy(NamePrecision,yyvsp[0].nac);
-                   }
-break;
-case 211:
-#line 1354 "fortran.y"
-{strcpy(CharacterSize,yyvsp[0].na);
-                    strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 212:
-#line 1356 "fortran.y"
-{strcpy(CharacterSize,"*");
-                    strcpy(yyval.na,"*");}
-break;
-case 220:
-#line 1370 "fortran.y"
-{
+                      else sprintf(NamePrecision,"%s = %s",(yyvsp[(1) - (3)].nac),(yyvsp[(3) - (3)].na));
+                   ;}
+    break;
+
+  case 209:
+#line 1398 "fortran.y"
+    {
+                      strcpy(NamePrecision,(yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 210:
+#line 1402 "fortran.y"
+    {
+                      strcpy(NamePrecision,(yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 211:
+#line 1406 "fortran.y"
+    {strcpy(CharacterSize,(yyvsp[(1) - (1)].na));
+                    strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 212:
+#line 1408 "fortran.y"
+    {strcpy(CharacterSize,"*");
+                    strcpy((yyval.na),"*");;}
+    break;
+
+  case 220:
+#line 1422 "fortran.y"
+    {
                       VariableIsParameter = 1;
-                   }
-break;
-case 222:
-#line 1375 "fortran.y"
-{Allocatabledeclare = 1;}
-break;
-case 223:
-#line 1377 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 222:
+#line 1427 "fortran.y"
+    {Allocatabledeclare = 1;;}
+    break;
+
+  case 223:
+#line 1429 "fortran.y"
+    {
                       dimsgiven=1;
-                      curdim=yyvsp[0].d;
-                   }
-break;
-case 224:
-#line 1382 "fortran.y"
-{ExternalDeclare = 1;}
-break;
-case 225:
-#line 1384 "fortran.y"
-{strcpy(IntentSpec,yyvsp[-1].nac);}
-break;
-case 227:
-#line 1386 "fortran.y"
-{optionaldeclare = 1 ;}
-break;
-case 228:
-#line 1387 "fortran.y"
-{pointerdeclare = 1 ;}
-break;
-case 229:
-#line 1388 "fortran.y"
-{
+                      curdim=(yyvsp[(2) - (2)].d);
+                   ;}
+    break;
+
+  case 224:
+#line 1434 "fortran.y"
+    {ExternalDeclare = 1;;}
+    break;
+
+  case 225:
+#line 1436 "fortran.y"
+    {strcpy(IntentSpec,(yyvsp[(3) - (4)].nac));;}
+    break;
+
+  case 227:
+#line 1438 "fortran.y"
+    {optionaldeclare = 1 ;;}
+    break;
+
+  case 228:
+#line 1439 "fortran.y"
+    {pointerdeclare = 1 ;;}
+    break;
+
+  case 229:
+#line 1440 "fortran.y"
+    {
 /*                       if ( inmodulemeet == 1 )
                        {*/
                           SaveDeclare = 1 ;
                      /*  }*/
-                    }
-break;
-case 231:
-#line 1396 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 232:
-#line 1397 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 233:
-#line 1398 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac); }
-break;
-case 234:
-#line 1401 "fortran.y"
-{PublicDeclare = 1;}
-break;
-case 235:
-#line 1403 "fortran.y"
-{PrivateDeclare = 1;}
-break;
-case 236:
-#line 1405 "fortran.y"
-{if ( created_dimensionlist == 1 )
+                    ;}
+    break;
+
+  case 230:
+#line 1447 "fortran.y"
+    {Targetdeclare = 1;;}
+    break;
+
+  case 231:
+#line 1449 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 232:
+#line 1450 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 233:
+#line 1451 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac)); ;}
+    break;
+
+  case 234:
+#line 1454 "fortran.y"
+    {PublicDeclare = 1;;}
+    break;
+
+  case 235:
+#line 1456 "fortran.y"
+    {PrivateDeclare = 1;;}
+    break;
+
+  case 236:
+#line 1458 "fortran.y"
+    {if ( created_dimensionlist == 1 )
                        {
-                           yyval.d=(listdim *)NULL;
+                           (yyval.d)=(listdim *)NULL;
                        }
-                   }
-break;
-case 237:
-#line 1411 "fortran.y"
-{if ( created_dimensionlist == 1 ||
-                         agrif_parentcall      == 1 ) yyval.d=yyvsp[-1].d;}
-break;
-case 238:
-#line 1414 "fortran.y"
-{if ( created_dimensionlist == 1 ||
-                         agrif_parentcall      == 1 ) yyval.d=insertdim(NULL,yyvsp[0].dim1);}
-break;
-case 239:
-#line 1417 "fortran.y"
-{if ( couldaddvariable == 1 )
-                         if ( created_dimensionlist == 1 ) yyval.d=insertdim(yyvsp[-2].d,yyvsp[0].dim1);}
-break;
-case 240:
-#line 1420 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"1");
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 241:
-#line 1425 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"");
-                      strcpy(yyval.dim1.last,"");
-                   }
-break;
-case 242:
-#line 1429 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,yyvsp[-1].na);
-                      Save_Length(yyvsp[-1].na,2);
-                      strcpy(yyval.dim1.last,"");
-                   }
-break;
-case 243:
-#line 1434 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"");
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 244:
-#line 1440 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,yyvsp[-2].na);
-                      Save_Length(yyvsp[-2].na,2);
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 245:
-#line 1447 "fortran.y"
-{strcpy(yyval.na,"*");}
-break;
-case 246:
-#line 1448 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 247:
-#line 1450 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 248:
-#line 1452 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s)",yyvsp[-1].na);}
-break;
-case 249:
-#line 1454 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 250:
-#line 1456 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 251:
-#line 1460 "fortran.y"
-{sprintf(yyval.na,"SUM(%s)",yyvsp[-1].na);}
-break;
-case 252:
-#line 1462 "fortran.y"
-{sprintf(yyval.na,"MAX(%s)",yyvsp[-1].na);}
-break;
-case 253:
+                   ;}
+    break;
+
+  case 237:
 #line 1464 "fortran.y"
-{sprintf(yyval.na,"TANH(%s)",yyvsp[-1].na);}
-break;
-case 254:
-#line 1466 "fortran.y"
-{sprintf(yyval.na,"MAXVAL(%s)",yyvsp[-1].na);}
-break;
-case 255:
-#line 1468 "fortran.y"
-{sprintf(yyval.na,"MIN(%s)",yyvsp[-1].na);}
-break;
-case 256:
+    {if ( created_dimensionlist == 1 ||
+                         agrif_parentcall      == 1 ) (yyval.d)=(yyvsp[(2) - (3)].d);;}
+    break;
+
+  case 238:
+#line 1467 "fortran.y"
+    {if ( created_dimensionlist == 1 ||
+                         agrif_parentcall      == 1 ) (yyval.d)=insertdim(NULL,(yyvsp[(1) - (1)].dim1));;}
+    break;
+
+  case 239:
 #line 1470 "fortran.y"
-{sprintf(yyval.na,"MINVAL(%s)",yyvsp[-1].na);}
-break;
-case 257:
-#line 1472 "fortran.y"
-{sprintf(yyval.na,"TRIM(%s)",yyvsp[-1].na);}
-break;
-case 258:
-#line 1474 "fortran.y"
-{sprintf(yyval.na,"SQRT(%s)",yyvsp[-1].na);}
-break;
-case 259:
-#line 1476 "fortran.y"
-{sprintf(yyval.na,"REAL(%s)",yyvsp[-1].na);}
-break;
-case 260:
+    {if ( couldaddvariable == 1 )
+                         if ( created_dimensionlist == 1 ) (yyval.d)=insertdim((yyvsp[(1) - (3)].d),(yyvsp[(3) - (3)].dim1));;}
+    break;
+
+  case 240:
+#line 1473 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,"1");
+                      strcpy((yyval.dim1).last,(yyvsp[(1) - (1)].na));
+                      Save_Length((yyvsp[(1) - (1)].na),1);
+                   ;}
+    break;
+
+  case 241:
 #line 1478 "fortran.y"
-{sprintf(yyval.na,"NINT(%s)",yyvsp[-1].na);}
-break;
-case 261:
-#line 1480 "fortran.y"
-{sprintf(yyval.na,"FLOAT(%s)",yyvsp[-1].na);}
-break;
-case 262:
+    {
+                      strcpy((yyval.dim1).first,"");
+                      strcpy((yyval.dim1).last,"");
+                   ;}
+    break;
+
+  case 242:
 #line 1482 "fortran.y"
-{sprintf(yyval.na,"EXP(%s)",yyvsp[-1].na);}
-break;
-case 263:
-#line 1484 "fortran.y"
-{sprintf(yyval.na,"COS(%s)",yyvsp[-1].na);}
-break;
-case 264:
-#line 1486 "fortran.y"
-{sprintf(yyval.na,"COSH(%s)",yyvsp[-1].na);}
-break;
-case 265:
-#line 1488 "fortran.y"
-{sprintf(yyval.na,"ACOS(%s)",yyvsp[-1].na);}
-break;
-case 266:
-#line 1490 "fortran.y"
-{sprintf(yyval.na,"SIN(%s)",yyvsp[-1].na);}
-break;
-case 267:
-#line 1492 "fortran.y"
-{sprintf(yyval.na,"SINH(%s)",yyvsp[-1].na);}
-break;
-case 268:
-#line 1494 "fortran.y"
-{sprintf(yyval.na,"ASIN(%s)",yyvsp[-1].na);}
-break;
-case 269:
-#line 1496 "fortran.y"
-{sprintf(yyval.na,"LOG(%s)",yyvsp[-1].na);}
-break;
-case 270:
-#line 1498 "fortran.y"
-{sprintf(yyval.na,"TAN(%s)",yyvsp[-1].na);}
-break;
-case 271:
+    {
+                      strcpy((yyval.dim1).first,(yyvsp[(1) - (2)].na));
+                      Save_Length((yyvsp[(1) - (2)].na),2);
+                      strcpy((yyval.dim1).last,"");
+                   ;}
+    break;
+
+  case 243:
+#line 1487 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,"");
+                      strcpy((yyval.dim1).last,(yyvsp[(2) - (2)].na));
+                      Save_Length((yyvsp[(2) - (2)].na),1);
+                   ;}
+    break;
+
+  case 244:
+#line 1493 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,(yyvsp[(1) - (3)].na));
+                      Save_Length((yyvsp[(1) - (3)].na),2);
+                      strcpy((yyval.dim1).last,(yyvsp[(3) - (3)].na));
+                      Save_Length((yyvsp[(3) - (3)].na),1);
+                   ;}
+    break;
+
+  case 245:
 #line 1500 "fortran.y"
-{sprintf(yyval.na,"ATAN(%s)",yyvsp[-1].na);}
-break;
-case 272:
-#line 1502 "fortran.y"
-{sprintf(yyval.na,"ABS(%s)",yyvsp[-1].na);}
-break;
-case 273:
-#line 1504 "fortran.y"
-{sprintf(yyval.na,"MOD(%s)",yyvsp[-1].na);}
-break;
-case 274:
-#line 1506 "fortran.y"
-{sprintf(yyval.na,"SIGN(%s)",yyvsp[-1].na);}
-break;
-case 275:
-#line 1508 "fortran.y"
-{sprintf(yyval.na,"MINLOC(%s)",yyvsp[-1].na);}
-break;
-case 276:
-#line 1510 "fortran.y"
-{sprintf(yyval.na,"MAXLOC(%s)",yyvsp[-1].na);}
-break;
-case 277:
-#line 1512 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 278:
-#line 1514 "fortran.y"
-{if ( couldaddvariable == 1 )
-                   { strcpy(yyval.na,yyvsp[-2].na);strcat(yyval.na,",");strcat(yyval.na,yyvsp[0].na);}}
-break;
-case 279:
+    {strcpy((yyval.na),"*");;}
+    break;
+
+  case 246:
+#line 1501 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 247:
+#line 1503 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 248:
+#line 1505 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 249:
+#line 1507 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 250:
+#line 1509 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 251:
+#line 1513 "fortran.y"
+    {sprintf((yyval.na),"SUM(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 252:
+#line 1515 "fortran.y"
+    {sprintf((yyval.na),"MAX(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 253:
 #line 1517 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 280:
+    {sprintf((yyval.na),"TANH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 254:
 #line 1519 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 281:
+    {sprintf((yyval.na),"MAXVAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 255:
 #line 1521 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 282:
+    {sprintf((yyval.na),"MIN(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 256:
 #line 1523 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].na,yyvsp[0].na);}
-break;
-case 283:
+    {sprintf((yyval.na),"MINVAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 257:
 #line 1525 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 284:
+    {sprintf((yyval.na),"TRIM(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 258:
 #line 1527 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 285:
+    {sprintf((yyval.na),"SQRT(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 259:
 #line 1529 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"+");}
-break;
-case 286:
-#line 1530 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"-");}
-break;
-case 287:
+    {sprintf((yyval.na),"REAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 260:
+#line 1531 "fortran.y"
+    {sprintf((yyval.na),"NINT(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 261:
 #line 1533 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"+%s",yyvsp[0].na);}
-break;
-case 288:
+    {sprintf((yyval.na),"FLOAT(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 262:
 #line 1535 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"-%s",yyvsp[0].na);}
-break;
-case 289:
+    {sprintf((yyval.na),"EXP(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 263:
 #line 1537 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"*%s",yyvsp[0].na);}
-break;
-case 290:
+    {sprintf((yyval.na),"COS(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 264:
 #line 1539 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 291:
+    {sprintf((yyval.na),"COSH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 265:
 #line 1541 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 292:
+    {sprintf((yyval.na),"ACOS(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 266:
 #line 1543 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 293:
+    {sprintf((yyval.na),"SIN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 267:
 #line 1545 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 294:
+    {sprintf((yyval.na),"SINH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 268:
 #line 1547 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," > %s",yyvsp[0].na);}
-break;
-case 295:
+    {sprintf((yyval.na),"ASIN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 269:
 #line 1549 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 296:
+    {sprintf((yyval.na),"LOG(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 270:
 #line 1551 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," < %s",yyvsp[0].na);}
-break;
-case 297:
+    {sprintf((yyval.na),"TAN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 271:
 #line 1553 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 298:
+    {sprintf((yyval.na),"ATAN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 272:
 #line 1555 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," >= %s",yyvsp[0].na);}
-break;
-case 299:
+    {sprintf((yyval.na),"ABS(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 273:
 #line 1557 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 300:
+    {sprintf((yyval.na),"MOD(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 274:
 #line 1559 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," <= %s",yyvsp[0].na);}
-break;
-case 301:
+    {sprintf((yyval.na),"SIGN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 275:
 #line 1561 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 302:
+    {sprintf((yyval.na),"MINLOC(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 276:
 #line 1563 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 303:
+    {sprintf((yyval.na),"MAXLOC(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 277:
 #line 1565 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 304:
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 278:
 #line 1567 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 305:
-#line 1569 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 306:
-#line 1571 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s",yyvsp[0].na);}
-break;
-case 307:
-#line 1573 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s",yyvsp[0].na);}
-break;
-case 308:
-#line 1575 "fortran.y"
-{strcpy(yyval.na,"");}
-break;
-case 309:
-#line 1577 "fortran.y"
-{sprintf(yyval.na,"/%s",yyvsp[0].na);}
-break;
-case 310:
-#line 1579 "fortran.y"
-{sprintf(yyval.na,"/= %s",yyvsp[0].na);}
-break;
-case 311:
-#line 1581 "fortran.y"
-{sprintf(yyval.na,"//%s",yyvsp[0].na);}
-break;
-case 312:
-#line 1584 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"==%s",yyvsp[0].na);}
-break;
-case 313:
+    {if ( couldaddvariable == 1 )
+                   { strcpy((yyval.na),(yyvsp[(1) - (3)].na));strcat((yyval.na),",");strcat((yyval.na),(yyvsp[(3) - (3)].na));};}
+    break;
+
+  case 279:
+#line 1570 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 280:
+#line 1572 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 281:
+#line 1574 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 282:
+#line 1576 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 283:
+#line 1578 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 284:
+#line 1580 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 285:
+#line 1582 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"+");;}
+    break;
+
+  case 286:
+#line 1583 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"-");;}
+    break;
+
+  case 287:
 #line 1586 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"= %s",yyvsp[0].na);}
-break;
-case 314:
-#line 1589 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 315:
-#line 1591 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 316:
-#line 1593 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 317:
-#line 1595 "fortran.y"
-{
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"+%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 288:
+#line 1588 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"-%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 289:
+#line 1590 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"*%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 290:
+#line 1592 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 291:
+#line 1594 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 292:
+#line 1596 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 293:
+#line 1598 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 294:
+#line 1600 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," > %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 295:
+#line 1602 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 296:
+#line 1604 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," < %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 297:
+#line 1606 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 298:
+#line 1608 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," >= %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 299:
+#line 1610 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 300:
+#line 1612 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," <= %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 301:
+#line 1614 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 302:
+#line 1616 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 303:
+#line 1618 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 304:
+#line 1620 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 305:
+#line 1622 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 306:
+#line 1624 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 307:
+#line 1626 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 308:
+#line 1628 "fortran.y"
+    {strcpy((yyval.na),"");;}
+    break;
+
+  case 309:
+#line 1630 "fortran.y"
+    {sprintf((yyval.na),"/%s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 310:
+#line 1632 "fortran.y"
+    {sprintf((yyval.na),"/= %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 311:
+#line 1634 "fortran.y"
+    {sprintf((yyval.na),"//%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 312:
+#line 1637 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"==%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 313:
+#line 1639 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"= %s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 314:
+#line 1642 "fortran.y"
+    {if ( couldaddvariable == 1 )
+						{
+						printf("ident = %s\n",(yyvsp[(1) - (1)].nac));
+						strcpy((yyval.na),(yyvsp[(1) - (1)].nac));}
+						;}
+    break;
+
+  case 315:
+#line 1648 "fortran.y"
+    {if ( couldaddvariable == 1 ) {
+                   printf("struct = %s\n",(yyvsp[(1) - (1)].na));
+                   strcpy((yyval.na),(yyvsp[(1) - (1)].na));}
+                   ;}
+    break;
+
+  case 316:
+#line 1653 "fortran.y"
+    {if ( couldaddvariable == 1 ) {
+                   printf("arrayref = %s\n",(yyvsp[(1) - (1)].na));
+                   strcpy((yyval.na),(yyvsp[(1) - (1)].na));
+                   };}
+    break;
+
+  case 317:
+#line 1658 "fortran.y"
+    {
                       agrif_parentcall =0;
                       if (!strcasecmp(identcopy,"Agrif_Parent") )
@@ -8617,119 +5423,141 @@
                                                         curmodulename);
                       }
-                   }
-break;
-case 318:
-#line 1608 "fortran.y"
-{
-                     strcpy(yyval.na,yyvsp[0].na);
+                   ;}
+    break;
+
+  case 318:
+#line 1671 "fortran.y"
+    {
+                     strcpy((yyval.na),(yyvsp[(1) - (1)].na));
                      if ( incalldeclare == 0 ) inagrifcallargument = 0;
-                   }
-break;
-case 319:
-#line 1613 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," %s %s ",yyvsp[-1].na,yyvsp[0].na);}
-break;
-case 320:
-#line 1615 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                                sprintf(yyval.na," %s ( %s )",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 321:
-#line 1618 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                         sprintf(yyval.na," %s ( %s ) %s ",yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 322:
-#line 1622 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 319:
+#line 1676 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," %s %s ",(yyvsp[(1) - (2)].na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 320:
+#line 1678 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                                sprintf((yyval.na)," %s ( %s )",(yyvsp[(1) - (4)].na),(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 321:
+#line 1681 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                         sprintf((yyval.na)," %s ( %s ) %s ",(yyvsp[(1) - (5)].na),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 322:
+#line 1685 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         sprintf(yyval.na," %s ( %s )",yyvsp[-3].nac,yyvsp[-1].na);
-                         ModifyTheAgrifFunction_0(yyvsp[-1].na);
+                         sprintf((yyval.na)," %s ( %s )",(yyvsp[(1) - (4)].nac),(yyvsp[(3) - (4)].na));
+                         ModifyTheAgrifFunction_0((yyvsp[(3) - (4)].na));
                          agrif_parentcall =0;
                       }
-                   }
-break;
-case 323:
-#line 1632 "fortran.y"
-{
-                      sprintf(yyval.na," %s %% %s ",yyvsp[-2].na,yyvsp[0].na);
+                   ;}
+    break;
+
+  case 323:
+#line 1695 "fortran.y"
+    {
+                      sprintf((yyval.na)," %s %% %s ",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));
                       if ( incalldeclare == 0 ) inagrifcallargument = 0;
-                   }
-break;
-case 324:
-#line 1638 "fortran.y"
-{sprintf(yyval.na,"(/%s/)",yyvsp[-1].na);}
-break;
-case 325:
-#line 1640 "fortran.y"
-{strcpy(yyval.na," ");}
-break;
-case 326:
-#line 1642 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 327:
-#line 1644 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 328:
-#line 1646 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 329:
-#line 1648 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 330:
-#line 1649 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 331:
-#line 1652 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s :%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 332:
-#line 1654 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                               sprintf(yyval.na,"%s :%s :%s",yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 333:
-#line 1657 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":%s :%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 334:
-#line 1658 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,": : %s",yyvsp[0].na);}
-break;
-case 335:
-#line 1659 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":%s",yyvsp[0].na);}
-break;
-case 336:
-#line 1660 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s :",yyvsp[-1].na);}
-break;
-case 337:
-#line 1661 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":");}
-break;
-case 338:
-#line 1663 "fortran.y"
-{
-                       if ( couldaddvariable == 1 )
+                   ;}
+    break;
+
+  case 324:
+#line 1701 "fortran.y"
+    {sprintf((yyval.na),"(/%s/)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 325:
+#line 1703 "fortran.y"
+    {strcpy((yyval.na)," ");;}
+    break;
+
+  case 326:
+#line 1705 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 327:
+#line 1707 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 328:
+#line 1709 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 329:
+#line 1711 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 330:
+#line 1712 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 331:
+#line 1715 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s :%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 332:
+#line 1717 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                               sprintf((yyval.na),"%s :%s :%s",(yyvsp[(1) - (5)].na),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 333:
+#line 1720 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":%s :%s",(yyvsp[(2) - (4)].na),(yyvsp[(4) - (4)].na));;}
+    break;
+
+  case 334:
+#line 1721 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),": : %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 335:
+#line 1722 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 336:
+#line 1723 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s :",(yyvsp[(1) - (2)].na));;}
+    break;
+
+  case 337:
+#line 1724 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":");;}
+    break;
+
+  case 338:
+#line 1726 "fortran.y"
                        {
-                       if ( Vartonumber(yyvsp[0].nac) == 1 )
+                       if ( couldaddvariable == 1 && afterpercent == 0)
+                       {
+                       if ( Vartonumber((yyvsp[(1) - (1)].nac)) == 1 )
                        {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                        }
-                       if (!strcasecmp(yyvsp[0].nac,"Agrif_Parent") )
+                       if (!strcasecmp((yyvsp[(1) - (1)].nac),"Agrif_Parent") )
                                                             agrif_parentcall =1;
-                       if ( VariableIsNotFunction(yyvsp[0].nac) == 0 )
+                       if ( VariableIsNotFunction((yyvsp[(1) - (1)].nac)) == 0 )
                        {
+                       printf("var = %s\n",(yyvsp[(1) - (1)].nac));
                           if ( inagrifcallargument == 1 )
                           {
-                             if ( !strcasecmp(yyvsp[0].nac,identcopy) )
+                             if ( !strcasecmp((yyvsp[(1) - (1)].nac),identcopy) )
                              {
                                 strcpy(sameagrifname,identcopy);
@@ -8737,155 +5565,156 @@
                              }
                           }
-                          strcpy(identcopy,yyvsp[0].nac);
+                          strcpy(identcopy,(yyvsp[(1) - (1)].nac));
                           pointedvar=0;
-                          strcpy(truename,yyvsp[0].nac);
-                          if (variscoupled_0(yyvsp[0].nac)) strcpy(truename,getcoupledname_0(yyvsp[0].nac));
-/*
-                          if ( VarIsNonGridDepend($1) == 0 &&
-                               Variableshouldberemove($1) == 0 )
-                          {
-                             if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0($1) == 1 ||
-                                  varispointer_0($1) == 1 )
-                             {
-                            if ((IsinListe(List_UsedInSubroutine_Var,$1) == 1) || (inagrifcallargument == 1))
-                             {
-                              if (varistyped_0($1) == 0)
-                                 {
-                                 ModifyTheVariableName_0($1);
-                                 }
-                                 }
-                                 else
-                                 {
-                                 }
-                             }
-                             if (variscoupled_0($1) == 1)
-                             {
-      printf("mla variable %s est couplee %s\n",$1,getcoupledname_0($1));
-                             ModifyTheVariableNamecoupled_0($1,getcoupledname_0($1));
-                             }
-                             if ( inagrifcallargument != 1 ||
-                                  sameagrifargument ==1 )
-                                  Add_UsedInSubroutine_Var_1($1);
-                          }
-                          NotifyAgrifFunction_0($1);
-*/
+                          strcpy(truename,(yyvsp[(1) - (1)].nac));
+                          if (variscoupled_0((yyvsp[(1) - (1)].nac))) strcpy(truename,getcoupledname_0((yyvsp[(1) - (1)].nac)));
+
                           if ( VarIsNonGridDepend(truename) == 0 &&
                                Variableshouldberemove(truename) == 0 )
-                          {
+                          {                      
                              if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0(truename) == 1 ||
                                   varispointer_0(truename) == 1 )
                              {
-                            if ((IsinListe(List_UsedInSubroutine_Var,yyvsp[0].nac) == 1) || (inagrifcallargument == 1))
+                             printf("var2 = %s\n",(yyvsp[(1) - (1)].nac));
+                            if ((IsinListe(List_UsedInSubroutine_Var,(yyvsp[(1) - (1)].nac)) == 1) || (inagrifcallargument == 1))
                              {
                               if (varistyped_0(truename) == 0)
                                  {
-                                 ModifyTheVariableName_0(truename,strlen(yyvsp[0].nac));
+                                 ModifyTheVariableName_0(truename,strlen((yyvsp[(1) - (1)].nac)));
                                  }
                                  }
                              }
+                             printf("ici3\n");
                              if ( inagrifcallargument != 1 ||
                                   sameagrifargument ==1 )
+                                  {
+                                  printf("ici5 %s\n",truename);
                                   Add_UsedInSubroutine_Var_1(truename);
+                          }
                           }
                           NotifyAgrifFunction_0(truename);
                        }
                        }
+                       else
+                       {
+                       afterpercent = 0;
                     }
-break;
-case 339:
-#line 1742 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,".TRUE.");}
-break;
-case 340:
-#line 1743 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,".FALSE.");}
-break;
-case 341:
-#line 1744 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 342:
-#line 1745 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 343:
-#line 1746 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 344:
-#line 1747 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 345:
-#line 1749 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.nac,"%s%s",yyvsp[-1].nac,yyvsp[0].nac);}
-break;
-case 347:
-#line 1753 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 349:
-#line 1756 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 350:
-#line 1758 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 351:
-#line 1760 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 352:
-#line 1761 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 353:
-#line 1764 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s :%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 354:
-#line 1766 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 355:
-#line 1767 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 356:
-#line 1769 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 357:
-#line 1770 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 358:
-#line 1772 "fortran.y"
-{InitialValueGiven = 0;}
-break;
-case 359:
-#line 1774 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 339:
+#line 1785 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),".TRUE.");;}
+    break;
+
+  case 340:
+#line 1786 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),".FALSE.");;}
+    break;
+
+  case 341:
+#line 1787 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 342:
+#line 1788 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 343:
+#line 1789 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 344:
+#line 1790 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 345:
+#line 1792 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.nac),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 347:
+#line 1796 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 349:
+#line 1799 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 350:
+#line 1801 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 351:
+#line 1803 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 352:
+#line 1804 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 353:
+#line 1807 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s :%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 354:
+#line 1809 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 355:
+#line 1810 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 356:
+#line 1812 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 357:
+#line 1813 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 358:
+#line 1815 "fortran.y"
+    {InitialValueGiven = 0;;}
+    break;
+
+  case 359:
+#line 1817 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
-                          strcpy(InitValue,yyvsp[0].na);
+                          strcpy(InitValue,(yyvsp[(3) - (3)].na));
                           InitialValueGiven = 1;
                        }
-                    }
-break;
-case 360:
-#line 1782 "fortran.y"
-{pos_curinit = setposcur();}
-break;
-case 361:
-#line 1785 "fortran.y"
-{sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 362:
-#line 1788 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 360:
+#line 1825 "fortran.y"
+    {pos_curinit = setposcur();;}
+    break;
+
+  case 361:
+#line 1828 "fortran.y"
+    {sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 362:
+#line 1831 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -8893,8 +5722,8 @@
                       if (insubroutinedeclare == 1)
                       {
-                         copyuse_0(yyvsp[0].nac);
+                         copyuse_0((yyvsp[(2) - (2)].nac));
                       }
-                      sprintf(charusemodule,"%s",yyvsp[0].nac);
-                      Add_NameOfModuleUsed_1(yyvsp[0].nac);
+                      sprintf(charusemodule,"%s",(yyvsp[(2) - (2)].nac));
+                      Add_NameOfModuleUsed_1((yyvsp[(2) - (2)].nac));
 
                       if ( inmoduledeclare == 0 )
@@ -8905,14 +5734,15 @@
                       }
                       }
-                    }
-break;
-case 363:
-#line 1808 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 363:
+#line 1851 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
                       if (insubroutinedeclare == 1)
                       {
-                         Add_CouplePointed_Var_1(yyvsp[-2].nac,yyvsp[0].lc);
+                         Add_CouplePointed_Var_1((yyvsp[(2) - (4)].nac),(yyvsp[(4) - (4)].lc));
                       }
                       if ( firstpass == 1 )
@@ -8920,5 +5750,5 @@
                          if ( insubroutinedeclare == 1 )
                          {
-                            coupletmp = yyvsp[0].lc;
+                            coupletmp = (yyvsp[(4) - (4)].lc);
                             strcpy(ligne,"");
                             while ( coupletmp )
@@ -8930,7 +5760,7 @@
                                if ( coupletmp ) strcat(ligne,",");
                             }
-                            sprintf(charusemodule,"%s",yyvsp[-2].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(2) - (4)].nac));
                          }
-                         Add_NameOfModuleUsed_1(yyvsp[-2].nac);
+                         Add_NameOfModuleUsed_1((yyvsp[(2) - (4)].nac));
                       }
                       if ( inmoduledeclare == 0 )
@@ -8941,9 +5771,10 @@
                       }
                       }
-                    }
-break;
-case 364:
-#line 1842 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 364:
+#line 1885 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -8951,8 +5782,8 @@
                       if (insubroutinedeclare == 1)
                       {
-                         copyuseonly_0(yyvsp[-4].nac);
+                         copyuseonly_0((yyvsp[(2) - (6)].nac));
                       }
-                      sprintf(charusemodule,"%s",yyvsp[-4].nac);
-                      Add_NameOfModuleUsed_1(yyvsp[-4].nac);
+                      sprintf(charusemodule,"%s",(yyvsp[(2) - (6)].nac));
+                      Add_NameOfModuleUsed_1((yyvsp[(2) - (6)].nac));
 
                        if ( inmoduledeclare == 0 )
@@ -8963,9 +5794,10 @@
                        }
                        }
-                    }
-break;
-case 365:
-#line 1862 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 365:
+#line 1905 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -8973,5 +5805,5 @@
                        if (insubroutinedeclare == 1)
                        {
-                          Add_CouplePointed_Var_1(yyvsp[-4].nac,yyvsp[0].lc);
+                          Add_CouplePointed_Var_1((yyvsp[(2) - (6)].nac),(yyvsp[(6) - (6)].lc));
                        }
                        if ( firstpass == 1 )
@@ -8979,5 +5811,5 @@
                          if ( insubroutinedeclare == 1 )
                          {
-                             coupletmp = yyvsp[0].lc;
+                             coupletmp = (yyvsp[(6) - (6)].lc);
                              strcpy(ligne,"");
                              while ( coupletmp )
@@ -8990,7 +5822,7 @@
                                 if ( coupletmp ) strcat(ligne,",");
                              }
-                             sprintf(charusemodule,"%s",yyvsp[-4].nac);
+                             sprintf(charusemodule,"%s",(yyvsp[(2) - (6)].nac));
                           }
-                          Add_NameOfModuleUsed_1(yyvsp[-4].nac);
+                          Add_NameOfModuleUsed_1((yyvsp[(2) - (6)].nac));
                        }
                        if ( firstpass == 0 )
@@ -9003,5 +5835,5 @@
                                                    pos_end-pos_curuse);
                        if (oldfortranout) 
-                         variableisglobalinmodule(yyvsp[0].lc,yyvsp[-4].nac,oldfortranout,pos_curuseold);
+                         variableisglobalinmodule((yyvsp[(6) - (6)].lc),(yyvsp[(2) - (6)].nac),oldfortranout,pos_curuseold);
                         
                           }
@@ -9011,113 +5843,125 @@
                              /* if we are in the module declare and if the    */
                              /* onlylist is a list of global variable         */
-                             variableisglobalinmodule(yyvsp[0].lc, yyvsp[-4].nac, fortranout,pos_curuse);
+                             variableisglobalinmodule((yyvsp[(6) - (6)].lc), (yyvsp[(2) - (6)].nac), fortranout,pos_curuse);
                           }
                        }
                        }
-                    }
-break;
-case 366:
-#line 1913 "fortran.y"
-{
-                      pos_curuse = setposcur()-strlen(yyvsp[0].nac);
+                    ;}
+    break;
+
+  case 366:
+#line 1956 "fortran.y"
+    {
+                      pos_curuse = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                      if (firstpass == 0 && oldfortranout) {
                      pos_curuseold = setposcurname(oldfortranout);
                      }
-                   }
-break;
-case 367:
-#line 1921 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 368:
-#line 1924 "fortran.y"
-{
-                       if ( couldaddvariable == 1 ) yyval.lc = yyvsp[0].lc;
-                    }
-break;
-case 369:
-#line 1928 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 367:
+#line 1964 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 368:
+#line 1967 "fortran.y"
+    {
+                       if ( couldaddvariable == 1 ) (yyval.lc) = (yyvsp[(1) - (1)].lc);
+                    ;}
+    break;
+
+  case 369:
+#line 1971 "fortran.y"
+    {
                         if ( couldaddvariable == 1 )
                         {
                         /* insert the variable in the list $1                 */
-                        yyvsp[0].lc->suiv = yyvsp[-2].lc;
-                        yyval.lc = yyvsp[0].lc;
+                        (yyvsp[(3) - (3)].lc)->suiv = (yyvsp[(1) - (3)].lc);
+                        (yyval.lc) = (yyvsp[(3) - (3)].lc);
                         }
-                    }
-break;
-case 370:
-#line 1938 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 370:
+#line 1981 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[-2].nac);
-                       Save_Length(yyvsp[-2].nac,21);
-                       strcpy(coupletmp->c_namepointedvar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,22);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (3)].nac));
+                       Save_Length((yyvsp[(1) - (3)].nac),21);
+                       strcpy(coupletmp->c_namepointedvar,(yyvsp[(3) - (3)].nac));
+                       Save_Length((yyvsp[(3) - (3)].nac),22);
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
-                     }
-break;
-case 371:
-#line 1949 "fortran.y"
-{
-                       if ( couldaddvariable == 1 ) yyval.lc = yyvsp[0].lc;
-                    }
-break;
-case 372:
-#line 1953 "fortran.y"
-{
+                       (yyval.lc) = coupletmp;
+                     ;}
+    break;
+
+  case 371:
+#line 1992 "fortran.y"
+    {
+                       if ( couldaddvariable == 1 ) (yyval.lc) = (yyvsp[(1) - (1)].lc);
+                    ;}
+    break;
+
+  case 372:
+#line 1996 "fortran.y"
+    {
                         if ( couldaddvariable == 1 )
                         {
                         /* insert the variable in the list $1                 */
-                        yyvsp[0].lc->suiv = yyvsp[-2].lc;
-                        yyval.lc = yyvsp[0].lc;
+                        (yyvsp[(3) - (3)].lc)->suiv = (yyvsp[(1) - (3)].lc);
+                        (yyval.lc) = (yyvsp[(3) - (3)].lc);
                         }
-                    }
-break;
-case 373:
-#line 1963 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 373:
+#line 2006 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[-2].nac);
-                       Save_Length(yyvsp[-2].nac,21);
-                       strcpy(coupletmp->c_namepointedvar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,22);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (3)].nac));
+                       Save_Length((yyvsp[(1) - (3)].nac),21);
+                       strcpy(coupletmp->c_namepointedvar,(yyvsp[(3) - (3)].nac));
+                       Save_Length((yyvsp[(3) - (3)].nac),22);
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
+                       (yyval.lc) = coupletmp;
                        pointedvar=1;
-                       Add_UsedInSubroutine_Var_1(yyvsp[-2].nac);
-                    }
-break;
-case 374:
-#line 1974 "fortran.y"
-{
+                       Add_UsedInSubroutine_Var_1((yyvsp[(1) - (3)].nac));
+                    ;}
+    break;
+
+  case 374:
+#line 2017 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,21);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (1)].nac));
+                       Save_Length((yyvsp[(1) - (1)].nac),21);
                        strcpy(coupletmp->c_namepointedvar,"");
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
-                     }
-break;
-case 376:
-#line 1985 "fortran.y"
-{
+                       (yyval.lc) = coupletmp;
+                     ;}
+    break;
+
+  case 376:
+#line 2028 "fortran.y"
+    {
                          Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 377:
-#line 1991 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 377:
+#line 2034 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                          curmodulename);
                                                          inallocate = 0;
-                     }
-break;
-case 379:
-#line 1998 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 379:
+#line 2041 "fortran.y"
+    {
                        GlobalDeclaration = 0 ;
                        if ( firstpass == 0 &&
@@ -9167,9 +6011,10 @@
                       }
                       strcpy(subroutinename,"");
-                    }
-break;
-case 380:
-#line 2048 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 380:
+#line 2091 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -9187,9 +6032,10 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 381:
-#line 2066 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 381:
+#line 2109 "fortran.y"
+    {
                        if ( couldaddvariable == 1 &&
                             strcasecmp(subroutinename,"") )
@@ -9209,9 +6055,10 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 382:
-#line 2086 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 382:
+#line 2129 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -9230,13 +6077,14 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 383:
-#line 2105 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 383:
+#line 2148 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
                        /* if we never meet the contains keyword               */
-                      Remove_Word_end_module_0(strlen(yyvsp[0].nac));
+                      Remove_Word_end_module_0(strlen((yyvsp[(2) - (2)].nac)));
                        if ( inmoduledeclare == 1 )
                        {
@@ -9265,9 +6113,10 @@
                       GlobalDeclaration = 0 ;
                       }
-                  }
-break;
-case 397:
-#line 2151 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 397:
+#line 2194 "fortran.y"
+    {
                       if (inmoduledeclare == 1 )
                       {
@@ -9282,4 +6131,6 @@
                       else
                       {
+                      incontainssubroutine = 1;
+                      strcpy(previoussubroutinename,subroutinename);
                        if ( couldaddvariable == 1 )
                        {
@@ -9301,94 +6152,106 @@
                          strcpy(subroutinename,"");
                       }
-                   }
-break;
-case 398:
-#line 2186 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 398:
+#line 2231 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        functiondeclarationisdone = 0;
                        }
-                    }
-break;
-case 399:
-#line 2196 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 399:
+#line 2241 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 400:
-#line 2205 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 400:
+#line 2250 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 401:
-#line 2214 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 401:
+#line 2259 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 413:
-#line 2236 "fortran.y"
-{strcpy(yyval.nac,"");}
-break;
-case 414:
-#line 2237 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 426:
-#line 2257 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 413:
+#line 2281 "fortran.y"
+    {strcpy((yyval.nac),"");;}
+    break;
+
+  case 414:
+#line 2282 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 424:
+#line 2302 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 427:
-#line 2263 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 425:
+#line 2308 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 433:
-#line 2274 "fortran.y"
-{if ( couldaddvariable == 1 ) created_dimensionlist = 0;}
-break;
-case 434:
-#line 2276 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 431:
+#line 2319 "fortran.y"
+    {if ( couldaddvariable == 1 ) created_dimensionlist = 0;;}
+    break;
+
+  case 432:
+#line 2321 "fortran.y"
+    {
                   created_dimensionlist = 1;
                   if  ( agrif_parentcall == 1 )
                   {
-                      ModifyTheAgrifFunction_0(yyvsp[-1].d->dim.last);
+                      ModifyTheAgrifFunction_0((yyvsp[(3) - (4)].d)->dim.last);
                       agrif_parentcall =0;
                       fprintf(fortranout," = ");
                   }
-              }
-break;
-case 435:
-#line 2286 "fortran.y"
-{created_dimensionlist = 1;}
-break;
-case 440:
-#line 2294 "fortran.y"
-{
+              ;}
+    break;
+
+  case 433:
+#line 2331 "fortran.y"
+    {created_dimensionlist = 1;;}
+    break;
+
+  case 438:
+#line 2339 "fortran.y"
+    {
                       inagrifcallargument = 0 ;
                       incalldeclare=0;
@@ -9415,10 +6278,11 @@
                       }
                       Instanciation_0(sameagrifname);
-                   }
-break;
-case 445:
-#line 2328 "fortran.y"
-{
-                       if (!strcasecmp(yyvsp[0].nac,"MPI_Init") )
+                   ;}
+    break;
+
+  case 443:
+#line 2373 "fortran.y"
+                       {
+                       if (!strcasecmp((yyvsp[(2) - (2)].nac),"MPI_Init") )
                        {
                           callmpiinit = 1;
@@ -9428,5 +6292,5 @@
                           callmpiinit = 0;
                        }
-                       if (!strcasecmp(yyvsp[0].nac,"Agrif_Init_Grids") )
+                       if (!strcasecmp((yyvsp[(2) - (2)].nac),"Agrif_Init_Grids") )
                        {
                           callagrifinitgrids = 1;
@@ -9434,10 +6298,10 @@
                        }
                        else callagrifinitgrids = 0;
-                       if ( !strcasecmp(yyvsp[0].nac,"Agrif_Open_File") )
+                       if ( !strcasecmp((yyvsp[(2) - (2)].nac),"Agrif_Open_File") )
                        {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                        }
-                       if ( Vartonumber(yyvsp[0].nac) == 1 )
+                       if ( Vartonumber((yyvsp[(2) - (2)].nac)) == 1 )
                        {
                           incalldeclare=1;
@@ -9446,16 +6310,18 @@
                                                         curmodulename);
                        }
-                    }
-break;
-case 446:
-#line 2358 "fortran.y"
-{pos_curcall=setposcur()-4;}
-break;
-case 449:
-#line 2363 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 444:
+#line 2403 "fortran.y"
+    {pos_curcall=setposcur()-4;;}
+    break;
+
+  case 447:
+#line 2408 "fortran.y"
+    {
                   if ( callmpiinit == 1 )
                   {
-                     strcpy(mpiinitvar,yyvsp[0].na);
+                     strcpy(mpiinitvar,(yyvsp[(1) - (1)].na));
                      if ( firstpass == 1 )
                      {
@@ -9467,154 +6333,464 @@
                      }
                   }
-               }
-break;
-case 528:
-#line 2485 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 529:
-#line 2486 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 530:
-#line 2487 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 531:
-#line 2490 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 532:
-#line 2492 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 533:
-#line 2494 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 534:
-#line 2496 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 535:
-#line 2498 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 536:
-#line 2500 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 537:
-#line 2501 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 538:
-#line 2502 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 539:
-#line 2505 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 540:
-#line 2507 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," (%s)",yyvsp[-1].na);}
-break;
-case 541:
-#line 2509 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 542:
-#line 2511 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 543:
-#line 2513 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 544:
-#line 2517 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                              sprintf(yyval.na,"%s=%s,%s)",yyvsp[-4].nac,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 545:
-#line 2520 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                        sprintf(yyval.na,"%s=%s,%s,%s)",yyvsp[-6].nac,yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 554:
-#line 2536 "fortran.y"
-{Add_Allocate_Var_1(yyvsp[0].nac,curmodulename);}
-break;
-case 557:
+               ;}
+    break;
+
+  case 517:
+#line 2530 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 518:
+#line 2531 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 519:
+#line 2532 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 520:
+#line 2535 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 521:
+#line 2537 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 522:
+#line 2539 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 523:
 #line 2541 "fortran.y"
-{Add_Allocate_Var_1(yyvsp[-3].nac,curmodulename);}
-break;
-case 571:
-#line 2564 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-#line 9558 "y.tab.c"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 524:
+#line 2543 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 525:
+#line 2545 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 526:
+#line 2546 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 527:
+#line 2547 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 528:
+#line 2550 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 529:
+#line 2552 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," (%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 530:
+#line 2554 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 531:
+#line 2556 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 532:
+#line 2558 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 533:
+#line 2562 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                              sprintf((yyval.na),"%s=%s,%s)",(yyvsp[(1) - (5)].nac),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 534:
+#line 2565 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                        sprintf((yyval.na),"%s=%s,%s,%s)",(yyvsp[(1) - (7)].nac),(yyvsp[(3) - (7)].na),(yyvsp[(5) - (7)].na),(yyvsp[(7) - (7)].na));;}
+    break;
+
+  case 541:
+#line 2581 "fortran.y"
+    {Add_Allocate_Var_1((yyvsp[(1) - (1)].nac),curmodulename);;}
+    break;
+
+  case 544:
+#line 2586 "fortran.y"
+    {Add_Allocate_Var_1((yyvsp[(1) - (4)].nac),curmodulename);;}
+    break;
+
+  case 552:
+#line 2609 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 6445 "fortran.tab.c"
+      default: break;
     }
-    yyssp -= yym;
-    yystate = *yyssp;
-    yyvsp -= yym;
-    yym = yylhs[yyn];
-    if (yystate == 0 && yym == 0)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
-        yystate = YYFINAL;
-        *++yyssp = YYFINAL;
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
         *++yyvsp = yyval;
-        if (yychar < 0)
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
         {
-            if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-            if (yydebug)
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
-                printf("%sdebug: state %d, reading %d (%s)\n",
-                        YYPREFIX, YYFINAL, yychar, yys);
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
             }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
-        goto yyloop;
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead token after an
+	 error, discard it.  */
+
+      if (yychar <= YYEOF)
+	{
+	  /* Return failure if at end of input.  */
+	  if (yychar == YYEOF)
+	    YYABORT;
     }
-    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
-        yystate = yytable[yyn];
     else
-        yystate = yydgoto[yym];
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
+	{
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++yyvsp = yylval;
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
 #endif
-    if (yyssp >= yyss + yystacksize - 1)
-    {
-        goto yyoverflow;
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp);
+      YYPOPSTACK (1);
     }
-    *++yyssp = yystate;
-    *++yyvsp = yyval;
-    goto yyloop;
-yyoverflow:
-    yyerror("yacc stack overflow");
-yyabort:
-    return (1);
-yyaccept:
-    return (0);
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
+
+
+#line 2611 "fortran.y"
+
+
+void processfortran(char *fichier_entree)
+{
+   extern FILE *fortranin;
+   extern FILE *fortranout;
+   char nomfile[LONG_C];
+   int c;
+   int confirmyes;
+
+/*   fortrandebug = 1;*/
+   if ( mark == 1 ) printf("Firstpass == %d \n",firstpass);
+/******************************************************************************/
+/*  1-  Open input and output files                                           */
+/******************************************************************************/
+   strcpy(nomfile,commondirin);
+   strcat(nomfile,"/");
+   strcat(nomfile,fichier_entree);
+   fortranin=fopen( nomfile,"r");
+   if (! fortranin)
+   {
+      printf("Error : File %s does not exist\n",nomfile);
+      exit(1);
+   }
+
+   strcpy(curfile,nomfile);
+   strcpy(nomfile,commondirout);
+   strcat(nomfile,"/");
+   strcat(nomfile,fichier_entree);
+   strcpy(nomfileoutput,nomfile);
+   Save_Length(nomfileoutput,31);
+   if (firstpass == 1)
+   {
+      if (checkexistcommon == 1)
+      {
+         if (fopen(nomfile,"r"))
+         {
+            printf("Warning : file %s already exist\n",nomfile);
+            confirmyes = 0;
+            while (confirmyes==0)
+            {
+               printf("Override file %s ? [Y/N]\n",nomfile);
+               c=getchar();
+               getchar();
+               if (c==79 || c==110)
+               {
+                  printf("We stop\n");
+                  exit(1);
+               }
+               if (c==89 || c==121)
+               {
+                  confirmyes=1;
+               }
+            }
+         }
+      }
+   }
+
+/******************************************************************************/
+/*  2-  Variables initialization                                              */
+/******************************************************************************/
+
+   line_num_fortran_common=1;
+   line_num_fortran=1;
+   PublicDeclare = 0;
+   PrivateDeclare = 0;
+   ExternalDeclare = 0;
+   SaveDeclare = 0;
+   pointerdeclare = 0;
+   optionaldeclare = 0;
+   incalldeclare = 0;
+   VarType = 0;
+   VarTypepar = 0;
+   Allocatabledeclare = 0 ;
+   Targetdeclare = 0 ;
+   strcpy(NamePrecision," ");
+   VariableIsParameter =  0 ;
+   strcpy(NamePrecision,"");
+   c_star = 0 ;
+   functiondeclarationisdone = 0;
+   insubroutinedeclare = 0 ;
+   ininterfacedeclare = 0 ;   
+   strcpy(subroutinename," ");
+   isrecursive = 0;
+   InitialValueGiven = 0 ;
+   strcpy(EmptyChar," ");
+   inmoduledeclare = 0;
+   incontainssubroutine = 0;
+   colnum=0;
+   incom=0;
+   couldaddvariable=1;
+   afterpercent = 0;
+   aftercontainsdeclare = 1;
+   strcpy(nameinttypename,"");
+   /* Name of the file without format                                         */
+   tmp = strchr(fichier_entree, '.');
+   strncpy(curfilename,fichier_entree,strlen(fichier_entree)-strlen(tmp));
+   Save_Length(curfilename,30);
+/******************************************************************************/
+/*  3-  Parsing of the input file (1 time)                                    */
+/******************************************************************************/
+   if (firstpass == 0 )
+   {
+      fortranout=fopen(nomfileoutput,"w");
+
+/*      NewModule_Creation_0();*/
+   }
+
+   fortranparse();
+
+   if (firstpass == 0 )
+   {
+   NewModule_Creation_0();
+   }
+   
+   strcpy(curfile,mainfile);
+
+   if (firstpass == 0 )
+   {
+   fclose(fortranout);
+   }
+}
+
+#line 2 "fortran.yy.c"
+
+#line 4 "fortran.yy.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
 #define yy_create_buffer fortran_create_buffer
 #define yy_delete_buffer fortran_delete_buffer
-#define yy_scan_buffer fortran_scan_buffer
-#define yy_scan_string fortran_scan_string
-#define yy_scan_bytes fortran_scan_bytes
 #define yy_flex_debug fortran_flex_debug
 #define yy_init_buffer fortran_init_buffer
@@ -9625,38 +6801,95 @@
 #define yyleng fortranleng
 #define yylex fortranlex
+#define yylineno fortranlineno
 #define yyout fortranout
 #define yyrestart fortranrestart
 #define yytext fortrantext
 #define yywrap fortranwrap
-
-#line 20 "fortran.yy.c"
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#define yyalloc fortranalloc
+#define yyrealloc fortranrealloc
+#define yyfree fortranfree
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
 #include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
 #endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
 #endif
-
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
 
 /* The "const" storage-class-modifier is valid. */
@@ -9665,20 +6898,11 @@
 #else	/* ! __cplusplus */
 
-#if __STDC__
-
-#define YY_USE_PROTOS
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
 #define YY_USE_CONST
 
-#endif	/* __STDC__ */
+#endif	/* defined (__STDC__) */
 #endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
 
 #ifdef YY_USE_CONST
@@ -9686,11 +6910,4 @@
 #else
 #define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
 #endif
 
@@ -9709,5 +6926,5 @@
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
@@ -9715,5 +6932,5 @@
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
@@ -9722,15 +6939,30 @@
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE fortranrestart(fortranin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
-
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t fortranleng;
+
+extern FILE *fortranin, *fortranout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
@@ -9738,40 +6970,24 @@
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
 		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
+		/* Undo effects of setting up fortrantext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = (yy_hold_char); \
 		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up fortrantext again */ \
 		} \
 	while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
@@ -9789,5 +7005,5 @@
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
@@ -9810,4 +7026,7 @@
 	int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
@@ -9816,4 +7035,5 @@
 
 	int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
@@ -9825,225 +7045,265 @@
 	 *
 	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
+	 * (via fortranrestart()), so that the user can continue scanning by
+	 * just pointing fortranin at a new input file.
 	 */
 #define YY_BUFFER_EOF_PENDING 2
+
 	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
  */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when fortrantext is formed. */
 static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
+yy_size_t fortranleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
+static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
+/* Flag which is used to allow fortranwrap()'s to do buffer switches
+ * instead of setting up a fresh fortranin.  A bit of a hack ...
  */
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
+void fortranrestart (FILE *input_file  );
+void fortran_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE fortran_create_buffer (FILE *file,int size  );
+void fortran_delete_buffer (YY_BUFFER_STATE b  );
+void fortran_flush_buffer (YY_BUFFER_STATE b  );
+void fortranpush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void fortranpop_buffer_state (void );
+
+static void fortranensure_buffer_stack (void );
+static void fortran_load_buffer_state (void );
+static void fortran_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER fortran_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE fortran_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE fortran_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE fortran_scan_bytes (yyconst char *bytes,yy_size_t len  );
+
+void *fortranalloc (yy_size_t  );
+void *fortranrealloc (void *,yy_size_t  );
+void fortranfree (void *  );
+
+#define yy_new_buffer fortran_create_buffer
 
 #define yy_set_interactive(is_interactive) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        fortranensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            fortran_create_buffer(fortranin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 	}
 
 #define yy_set_bol(at_bol) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
+	if ( ! YY_CURRENT_BUFFER ){\
+        fortranensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            fortran_create_buffer(fortranin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 	}
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
 
 typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+FILE *fortranin = (FILE *) 0, *fortranout = (FILE *) 0;
+
 typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+extern int fortranlineno;
+
+int fortranlineno = 1;
+
+extern char *fortrantext;
+#define yytext_ptr fortrantext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up fortrantext.
  */
 #define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
+	(yytext_ptr) = yy_bp; \
+	fortranleng = (size_t) (yy_cp - yy_bp); \
+	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 173
-#define YY_END_OF_BUFFER 174
-static yyconst short int yy_accept[1124] =
+	(yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 176
+#define YY_END_OF_BUFFER 177
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static yyconst flex_int16_t yy_accept[1162] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  174,  173,  163,  159,  162,  172,  151,  150,
-      153,  165,  151,  153,  153,  155,  152,  138,  149,  154,
-      157,  156,  158,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  163,  159,  162,  172,  149,  144,  144,  144,  144,
-      144,  173,  173,  170,  173,  153,  144,    0,    0,  163,
-      164,    0,  162,  172,  172,  172,    0,  142,    0,    0,
-      165,  165,  165,  165,    0,    0,    0,  141,    0,    0,
-      133,   25,    0,  145,    0,    0,    0,    0,    0,    0,
-
-        0,  134,    0,  149,   24,    0,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,   42,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,   84,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  163,  161,    0,  161,    0,    0,
-        0,    0,    0,  164,  160,  161,    0,  172,  171,  172,
-      172,  172,  161,  149,    4,  144,  144,  144,  144,  144,
-      144,    0,  170,    0,    0,    0,  167,   25,    0,    0,
-
-        4,    0,  144,  144,  144,  144,  144,  144,    0,    0,
-        0,  172,  172,    0,    0,  165,  165,    0,    0,    0,
-        0,  140,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  148,  145,    0,
-        0,    0,  143,    0,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  114,  144,  144,
-      144,    0,  144,  144,  144,  144,  144,   15,  144,  144,
-      144,  113,  144,  144,  144,  144,  144,    0,  144,    0,
-       95,  144,  144,  144,  144,  144,  120,  144,  144,  125,
-      144,  144,  144,  144,  144,  144,   88,  144,  144,  144,
-
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  117,  144,  144,  144,  144,  144,  121,  144,  144,
-      144,  144,  144,  163,  161,    0,  164,    0,    0,    0,
-        0,    0,    0,    0,  161,    0,  161,  172,  172,  172,
-      149,    4,    4,    4,    4,  144,  144,  144,  144,  144,
-      144,    0,    0,    0,  167,    0,    0,    4,    4,    4,
-        4,  143,    0,  144,  144,    0,  144,  144,  144,  144,
-        0,    0,    0,  172,  172,    0,    0,  165,  165,    0,
-        0,    0,    0,  146,    0,  145,    0,  147,    0,   27,
-        0,   29,   28,   31,   30,   33,    0,    0,   35,    0,
-
-      145,    0,  146,    0,  145,    0,  147,    0,  143,    0,
-      144,  144,  124,  116,  144,  119,  122,  144,   21,  144,
-      144,  144,  144,  144,  115,  144,  144,  144,    0,  144,
-      144,  144,   93,    0,  107,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,    0,  108,  144,  144,  144,  144,
-      144,  144,  144,    0,   87,  144,  144,  144,  144,  144,
-      144,  144,    0,   97,  144,  144,    0,  110,  144,  144,
-      144,  144,  111,   20,   59,   73,  144,  144,  144,  144,
-      144,  144,  144,  144,   78,   43,  144,  144,  144,  144,
-       68,  144,  126,  118,  144,   71,   53,  144,    0,   96,
-
-       98,  144,   91,  100,  144,  144,  163,  161,  164,    0,
-        0,    0,    0,    0,    0,  161,    0,  161,  172,  172,
-      172,  149,    4,    4,  144,  144,  144,  144,  144,   17,
-        0,    0,    0,    4,    4,    0,  143,    0,  144,  144,
-      144,  144,    0,    0,    0,  172,  172,    0,    0,  165,
-      165,    0,    0,   37,   26,    0,   34,   36,    0,  143,
-        0,  143,  144,  144,  144,  144,  144,   48,  144,  144,
-      144,  123,  144,  144,    0,  144,  144,  144,    0,  144,
-      144,    0,    0,    0,    0,    0,    0,    0,    0,   41,
-      144,   94,  144,  144,  144,  144,  144,  144,  144,  144,
-
-      144,   75,   75,   75,   75,  144,    0,  106,  112,  144,
-      144,   87,  144,  144,   89,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,   51,
-      144,   76,  144,  144,  144,    0,  144,  144,  144,  144,
-      144,  101,  144,  144,   54,   80,  163,  161,  164,    0,
-        0,    0,    0,    0,  161,    0,  161,  172,  172,  172,
-      149,    4,    3,    0,  103,  144,  144,   85,  144,   69,
-       70,   69,    0,    0,    0,    4,    3,    0,  143,    0,
-      143,  144,   48,  144,  123,    0,   22,    0,  172,   22,
-        0,   22,   22,  165,   22,    0,   22,   22,   22,   32,
-
-      144,   22,   22,   22,  144,  144,  144,   62,  144,  144,
-      144,  144,    0,  144,  144,  139,    0,    0,   92,  144,
-       41,    0,   94,    0,    0,    0,    0,    0,    0,    0,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,    0,
-      109,  144,  144,  144,  144,  144,  144,  144,   65,  144,
-      144,  144,  128,   99,  127,  129,   38,  144,  144,  144,
-      144,  144,  144,   82,    0,  144,   10,   74,   18,  144,
-      144,   81,  163,  161,  164,    0,    0,    0,  161,  172,
-      172,   22,    4,    3,    3,  144,  144,  144,    0,    0,
-       22,    4,    3,    3,  144,   22,   22,   22,   23,  166,
-
-       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
-      144,  144,  144,   57,  144,  144,  144,    0,    0,  144,
-      144,   39,   92,    0,  144,    0,    0,    0,    0,    0,
-        0,    0,    0,  144,  144,  144,  144,  144,  144,   72,
-      144,  144,  144,    0,    0,  144,  144,   16,   49,   44,
-      144,  144,   45,    0,  144,  144,  144,  144,   66,   83,
-        7,    0,    0,  144,    0,  144,  144,    0,    0,    0,
-      172,   23,    4,  144,  144,   63,    0,   23,    4,   23,
-       23,   23,  144,    8,  144,  144,   86,  144,  144,   39,
-        0,    0,  144,  144,    0,  144,    0,    0,    0,    0,
-
-        0,    0,   72,    0,  144,  144,  144,  144,  144,  144,
-       55,  144,   64,    0,    0,    0,  135,   11,   19,  144,
-      144,    0,  144,   79,   67,  144,    0,  144,    0,  144,
-      144,    0,    0,  172,    4,  144,   58,    0,    4,  144,
-      131,   46,  144,   50,    0,    0,  144,  144,    0,   56,
-        0,    0,    0,    0,    0,    0,   55,  144,  144,   40,
-      144,  105,  144,  144,    0,    0,    0,    0,  135,  130,
-       90,    0,  144,   60,    0,   61,    0,  144,  144,    0,
-       58,  172,    4,    4,  144,    0,    4,    4,  144,    9,
-        0,    0,  144,  144,   56,    0,    0,   40,    0,  105,
-
-        0,  144,  144,   13,  144,  144,    0,    0,    0,  144,
-        0,    0,  102,    6,    0,  172,    4,    4,  144,    0,
-        4,    4,   47,    0,    0,  144,  144,    0,    0,   13,
-        0,   14,  144,  144,   52,    0,    0,    0,  144,    0,
-      102,    0,  172,    4,    2,  104,    0,    4,    2,    0,
-        0,  144,  144,   14,    0,    0,  132,  144,    0,    0,
-        0,  144,    0,  104,  172,    4,    0,    4,    0,    0,
-      137,  144,  132,    0,   12,    0,    0,    0,  144,    0,
-      172,    1,    0,    1,  137,    0,  144,   12,    0,    0,
-        0,  144,    0,  172,    0,    0,  136,    0,    0,    0,
-
-       77,    5,  172,    0,  136,   77,  172,    0,  172,    0,
-      172,    0,  172,    0,  172,    0,  168,    0,    0,    0,
-        0,  169,    0
+        0,    0,  177,  176,  165,  161,  164,  175,  152,  151,
+      155,  167,  152,  154,  154,  154,  157,  153,  137,  150,
+      156,  159,  158,  160,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  165,  161,  164,  175,  150,  145,  145,  145,
+      145,  145,  145,  176,  176,  173,  176,  176,  176,  161,
+      161,  154,  145,    0,    0,  165,    0,  166,    0,  164,
+      175,  175,  175,    0,  141,    0,    0,  167,  167,  167,
+      167,    0,    0,    0,  140,    0,    0,  132,   26,    0,
+
+      146,    0,    0,    0,    0,    0,    0,    0,  133,    0,
+      150,   25,    0,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+       43,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,   85,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  165,  163,    0,  163,    0,    0,    0,    0,
+        0,    0,  166,  162,  163,    0,  175,  174,  175,  175,
+      175,  163,  150,    4,  145,  145,  145,  145,   85,  145,
+
+      145,    0,  173,    0,    0,    0,    0,    0,    0,    0,
+      169,   26,    0,    0,    4,    0,  145,  145,  145,  145,
+      145,  145,    0,    0,    0,  175,  175,    0,    0,  167,
+      167,    0,    0,    0,    0,  139,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  149,  146,    0,    0,    0,  142,    0,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  115,  145,  145,  145,    0,  145,  145,  145,  145,
+      145,   16,  145,  145,  145,  114,  145,  145,  145,  145,
+      145,    0,  145,    0,   96,  145,  145,  145,  145,  145,
+
+      121,  145,  145,  126,  145,  145,  145,  145,  145,  145,
+      145,   89,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  118,  145,  145,  145,
+      145,  145,  122,  145,  145,  145,  145,  145,  165,  163,
+        0,  166,    0,    0,    0,    0,    0,    0,    0,    0,
+      163,    0,  163,  175,  175,  175,  150,    4,    4,    4,
+        4,  145,  145,  145,  145,  145,  145,  145,    0,    0,
+        0,    0,  170,    0,    0,  169,    0,    0,    4,    4,
+        4,    4,  142,    0,  145,  145,    0,  145,  145,  145,
+      145,    0,    0,    0,  175,  175,    0,    0,  167,  167,
+
+        0,    0,    0,    0,  147,    0,  146,    0,  148,    0,
+       28,    0,   30,   29,   32,   31,   34,    0,    0,   36,
+        0,  146,    0,  147,    0,  146,    0,  148,    0,  142,
+        0,  125,  117,  145,  145,  120,  123,  145,  145,   22,
+      145,  145,  145,  145,  145,  116,  145,  145,  145,    0,
+      145,  145,  145,   94,    0,  108,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,    0,  109,  145,  145,  145,
+      145,  145,  145,  145,    0,   88,  145,  145,  145,  145,
+      145,  145,  145,    0,   98,  145,  145,    0,  111,  145,
+      145,  145,  145,  112,   21,  145,   60,   74,  145,  145,
+
+      145,  145,  145,  145,  145,  145,   79,   44,  145,  145,
+      145,  145,   69,  145,  127,  119,  145,   72,   54,  145,
+        0,   97,   99,  145,   92,  101,  145,  145,  165,  163,
+      166,    0,    0,    0,    0,    0,    0,    0,  163,    0,
+      163,  175,  175,  175,  150,    4,    4,  145,  145,  145,
+      145,  145,  145,   18,    0,    0,    0,    0,    0,  170,
+        0,    0,    4,    4,    0,  142,    0,  145,  145,  145,
+      145,    0,    0,    0,  175,  175,    0,    0,  167,  167,
+        0,    0,   38,   27,    0,   35,   37,    0,  142,    0,
+      142,  145,  145,  145,  145,  145,   49,  145,  145,  145,
+
+      124,  145,  145,    0,  145,  145,  145,    0,  145,  145,
+        0,    0,    0,    0,    0,    0,    0,    0,   42,  145,
+       95,  145,  145,  145,  145,  145,  145,  145,  145,   76,
+       76,   76,   76,  145,    0,  107,  113,  145,  145,   88,
+      145,  145,   90,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,   52,  145,   77,
+      145,  145,  145,    0,  145,  145,  145,  145,  145,  102,
+      145,  145,   55,   81,  165,  163,  166,    0,    0,    0,
+        0,    0,    0,  163,    0,  163,  175,  175,  175,  150,
+        4,    3,    0,  104,  145,  145,   86,  145,  145,   70,
+
+       71,   70,    0,    0,    0,    0,    4,    3,    0,  142,
+        0,  142,  145,   49,  145,  124,    0,   23,    0,  175,
+       23,    0,   23,   23,  167,   23,    0,   23,   23,   23,
+       33,  145,  145,   23,   23,   23,  145,  145,   63,  145,
+      145,  145,  145,    0,  145,  145,  138,    0,    0,   93,
+      145,   42,    0,   95,    0,    0,    0,    0,    0,    0,
+      145,  145,  145,  145,  145,  145,  145,  145,    0,  110,
+      145,  145,  145,  145,  145,  145,  145,   66,  145,  145,
+      129,  100,  128,  130,   39,  145,  145,  145,  145,  145,
+      145,  145,   83,    0,  145,   11,   75,   19,  145,  145,
+
+       82,  165,  163,  166,    0,    0,    0,    0,  163,  175,
+      175,   23,    4,    3,    3,  145,  145,  145,  145,    0,
+        0,    0,   23,    4,    3,    3,  145,   23,   23,   23,
+       24,    0,  168,   24,   24,   24,   24,   24,   24,   24,
+       24,   24,   24,  145,  145,  145,   58,  145,  145,  145,
+        0,    0,  145,  145,   40,   93,    0,  145,    0,    0,
+        0,    0,    0,    0,    0,  145,  145,  145,  145,  145,
+       73,  145,  145,  145,    0,    0,  145,  145,   17,   50,
+       45,  145,   46,    0,  145,  145,    9,  145,  145,   67,
+       84,    7,    0,    0,  145,    0,  145,  145,    0,    0,
+
+        0,    0,  175,   24,    4,  145,  145,   64,  145,    0,
+        0,   24,    4,   24,   24,   24,  145,    8,  145,  145,
+       87,  145,  145,   40,    0,    0,  145,  145,    0,  145,
+        0,    0,    0,    0,    0,   73,    0,  145,  145,  145,
+      145,  145,   56,  145,   65,    0,    0,    0,    0,  134,
+       12,   20,  145,    0,  145,   80,   68,  145,    0,  145,
+        0,  145,  145,    0,    0,    0,  175,    4,  145,   59,
+      145,    0,    0,    4,  145,  131,   47,  145,   51,    0,
+        0,  145,  145,    0,   57,    0,    0,    0,    0,    0,
+       56,  145,   41,  145,  106,  145,  145,    0,    0,    0,
+
+        0,    0,  134,   91,    0,  145,   61,    0,   62,    0,
+      145,  145,    0,   59,    0,  175,    4,    4,  145,  143,
+        0,    0,    4,    4,  145,   10,    0,    0,  145,  145,
+       57,    0,   41,    0,  106,    0,  145,   14,  145,  145,
+        0,    0,    0,  145,    0,    0,  103,    6,    0,  143,
+      175,    4,    4,  145,    0,    0,    4,    4,   48,    0,
+        0,  145,  145,    0,   14,    0,   15,  145,   53,    0,
+        0,    0,  145,    0,  103,    0,  175,    4,    2,  105,
+        0,    0,    4,    2,    0,    0,  145,  145,   15,    0,
+      145,    0,    0,    0,  145,    0,  105,  175,    4,    0,
+
+        0,    4,    0,    0,  136,  145,    0,   13,    0,    0,
+        0,  145,    0,  175,    1,    0,    0,  144,    1,  136,
+        0,  145,   13,    0,    0,    0,    0,  145,    0,  175,
+        0,    0,  135,    0,    0,    0,   78,    5,  175,    0,
+      135,   78,  175,    0,  175,    0,  175,    0,  175,    0,
+      175,    0,  175,  171,    0,    0,    0,    0,    0,  172,
+        0
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
@@ -10052,13 +7312,13 @@
         1,    4,    5,    6,    7,    8,    9,   10,   11,   12,
        13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
-       23,   24,   25,   26,   27,   28,   20,   29,   30,   31,
-       32,   33,    1,    1,   37,   38,   39,   40,   41,   42,
-       43,   44,   45,   46,   47,   48,   49,   50,   51,   52,
-       53,   54,   55,   56,   57,   58,   59,   60,   61,   62,
-       34,    1,   35,    1,   36,    1,   37,   38,   39,   40,
-
+       23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
+       33,   34,    1,    1,   35,   36,   37,   38,   39,   40,
        41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
        51,   52,   53,   54,   55,   56,   57,   58,   59,   60,
-       61,   62,   63,   63,   63,    1,    1,    1,    1,    1,
+       61,    1,   62,    1,   63,    1,   64,   65,   66,   67,
+
+       68,   69,   70,   71,   72,   44,   73,   74,   75,   76,
+       77,   78,   79,   80,   81,   82,   83,   84,   85,   86,
+       87,   88,   89,   89,   89,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -10077,754 +7337,1315 @@
     } ;
 
-static yyconst int yy_meta[64] =
+static yyconst flex_int32_t yy_meta[90] =
     {   0,
-        1,    2,    3,    4,    1,    5,    1,    1,    1,    6,
-        1,    1,    1,    1,    7,    1,    7,    8,    1,    9,
-        9,    9,    9,    9,    9,    9,    9,    9,    1,    1,
-        1,    1,    1,    1,    1,   10,   11,   10,   10,   12,
-       13,   14,   15,   16,   10,   10,   10,   15,   15,   15,
-       11,   10,   12,   15,   15,   14,   15,   10,   17,   10,
-       10,   10,    5
+        1,    2,    3,    2,    1,    4,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    5,    1,    6,
+        6,    6,    6,    6,    6,    6,    6,    6,    6,    1,
+        1,    1,    1,    1,    7,    8,    8,    9,    9,    5,
+       10,   11,    8,    8,    8,   10,   10,   10,    7,    8,
+        9,   10,   10,    5,   10,    8,   12,    8,    8,    8,
+        1,    1,    8,    7,    8,    8,    9,    9,    5,   10,
+       11,    8,    8,   10,   10,   10,    7,    8,    9,   10,
+       10,    5,   10,    8,   12,    8,    8,    8,    4
     } ;
 
-static yyconst short int yy_base[1180] =
+static yyconst flex_int16_t yy_base[1215] =
     {   0,
-        0,   62,    0,    0,    0,    0, 4185,   65,    0,   55,
-        0,    0, 4187,   35,   69,   70,   74,   37,   75,   50,
-       53,   72,   93,   78,   66,   56,  148,   87,   81,   65,
-       68,   99,   71,  191,  230,  108,  183,  225,  244,  103,
-      137,  152,  185,  250,  265,  262,  281,  220,  286,  296,
-      308,  368,  134,  424,  321,  350,  149, 4149,  310,  337,
-      270, 4189, 4182, 4189,  158,  380,  481, 4147, 4129,  138,
-      163,  175,  179,    0, 4145, 4127, 4174, 4189,  147,  133,
-     4176, 4175,  192,  156,  232,  393,  376, 4189,  402,  406,
-     4189, 4189,  543,  184, 4127, 4123,  204,  218,  226, 4121,
-
-     4123, 4189,  584,  358, 4189,  448,  532,  507,  514,  572,
-      534,  588,  593,  605,  617,  381,  242,  169,  195,  404,
-      384,  312,  517,  672,  524,  378,  403,  544,  365,  630,
-      597,  545,  424,  565,  651,  679,  425,  650,  626,  648,
-      672,  673,  603,  674,  680,  684,  698,  686,  699,  704,
-      706,  584,  707,  710,  711,  730,  683,  297,  732,  735,
-      734,  737,  742,  750,  788,  795, 4170,  389,  316, 4135,
-     4123,   72, 4115,  807, 4189,  863,  427, 4166, 4189,  225,
-      327,  543,  632,  660,  804,  765,  799,  770,  764,  785,
-      788, 4165, 4189,  343, 4164,  774, 4189, 4163,  820,  564,
-
-      856,  918,  946, 4147,  271,  661,  187,  270, 4116, 4106,
-      812, 4114, 4104,  547,  804,  617,  398,  859,  894,  906,
-      868, 4189,  889,  871,  815,  860,  896, 4120,  372, 4141,
-     4140, 4139, 4138,  275, 4099, 4136, 4099, 4189,  874,  907,
-      908,  914, 4111, 4110,  864,  973,  999,  977,  975,  983,
-      984,  981, 1002,  986,  987, 1006, 1007, 1008, 1011, 1020,
-     1010, 4091,  737, 1029, 1032, 1017, 1036, 1089, 1033, 1078,
-     1042, 1035, 1047, 1058, 1038, 1057, 1063, 1101, 1071, 1013,
-     4189, 1070, 1079, 1082, 1083, 1105, 1110, 1148, 1149, 1112,
-     1117, 1119, 1126, 1128, 1133, 1139, 1076, 1125, 1137, 1140,
-
-     1151, 1161, 1162, 1171, 1163, 1175, 1176, 1177, 1186, 1187,
-     1184, 1198, 1189, 1199, 1202, 1141, 1245, 1207, 1221, 1209,
-     1211, 1213, 1225, 1264, 1283, 4088, 1290, 4145, 4092, 4096,
-     4089, 4093, 4091, 4101, 1346,  715,  922,  557, 1120,  837,
-     1266,    0,  931, 4098, 4091, 1236, 1235, 1243, 1264, 1271,
-     1274,  800, 4020, 1311, 4189, 1268,  873, 4003, 1332, 1295,
-     1132, 1401, 1440,    0, 3971, 1479,  697,  659,  815,  998,
-     3883, 3892,  932, 3876, 3823, 1231,  551,  561, 1302, 1321,
-     1342, 1351, 1355, 1385, 1410, 1424, 1449, 1463, 3829, 4189,
-     3812, 4189, 4189, 4189, 4189, 4189, 3767, 3805, 4189, 3802,
-
-     1347, 1488, 1497, 1506, 1515, 1524, 1533, 1302, 3778, 1327,
-     1304, 1525, 4189, 1273, 1362, 1361, 1402, 1403, 1441, 1442,
-     1526, 1443, 1527, 1528, 1531, 1533, 1535, 1534, 3773, 1549,
-     1553, 1539, 1597, 1655, 4189, 1541, 1554, 1563, 1565, 1567,
-     1569, 1575, 1578, 1577, 1361, 4189, 1583, 1714, 1587, 1623,
-     1591, 1596, 1607, 3762, 1611, 1617, 1612, 1616, 1630, 1631,
-     1645, 1639, 1684, 4189, 1652, 1654, 1690, 4189, 1741, 1672,
-     1742, 1743, 1744, 1745, 1746, 1747, 1751, 1757, 1766, 1756,
-     1767, 1771, 1772, 1777, 1776, 1801, 1779, 1780, 1781, 1782,
-     1787, 1790, 1800, 1802, 1828, 1805, 1806, 1810, 1846, 4189,
-
-     1808, 1812, 1809, 1814, 1830, 1832, 1870, 1885, 1892, 3770,
-     3752, 3770, 3767, 3761, 3797, 1948, 1009, 1380, 1303,  663,
-     1414, 1873, 3746, 3747, 1903, 1863, 1902, 1839, 1943, 3794,
-     1306, 1438, 1451, 1849, 1566, 2003, 2029, 2068, 1591,  424,
-     1063, 1373, 3756,    0, 1392, 3755,    0,  815, 3788, 1875,
-     3790, 1919, 1702, 4189, 4189, 3774, 4189, 4189, 1987, 2013,
-     2038, 2052, 1844, 2096, 1864, 1882, 1884, 1883, 1927, 1924,
-     1929, 1909, 1945, 1930, 3746, 1949, 2123, 2124, 2160, 2045,
-     2126, 3738, 3728, 1588, 3733, 3680, 1623, 3668, 3683, 1963,
-     2129, 1965, 2030, 2132, 2130, 2128, 2136, 2148, 2150, 2138,
-
-     2191, 4189, 2186, 2178, 2162, 2180, 1990, 4189, 2164, 2166,
-     2184, 4189, 2187, 2196, 2188, 2190, 2194, 2200, 2209, 2203,
-     2206, 2210, 2218, 2222, 2221, 2230, 2225, 2228, 2236, 2231,
-     2246, 2237, 2243, 2244, 2249, 3696, 2252, 2255, 2258, 2256,
-     2264, 4189, 2265, 2267, 2276, 2277, 2322, 2331, 2341, 2313,
-     3686, 1416, 3684, 2336, 2397, 1449, 1648, 1854, 2040, 3697,
-     2324, 3654, 1783, 2335, 4189, 2313, 2312, 1910, 2335, 2392,
-     4189, 2389, 2194, 2341, 3693, 2249, 2042, 2452, 2478, 2504,
-     2530, 1870, 3675, 2558, 3672,    0, 4189, 2615,    0,    0,
-     3677, 3676, 4189, 3659, 3654, 2353, 2366, 2400, 4189, 4189,
-
-     2643, 2392, 2355, 2331, 2369, 2384, 2385, 2389, 2390, 2391,
-     2392, 2397, 3580, 2431, 2415, 2393, 3585, 3582, 2395, 2430,
-     4189, 3575, 4189, 3566, 3580, 3539, 3541, 3550, 3535, 3495,
-     2454, 2455, 2457, 2480, 2481, 2428, 2670, 2458, 2671, 2455,
-     4189, 2482, 2708, 2672, 2676, 2677, 2692, 2483, 2484, 2678,
-     2680, 2690, 2685, 2699, 2700, 2703, 2739, 2705, 2710, 2711,
-     2712, 2714, 2721, 2715, 2537, 2726, 2719, 2724, 2735, 2775,
-     2744, 2745, 2781, 2792, 2801, 3478, 3436, 3432,    0, 1637,
-     3476, 3475, 3435,    0, 1991, 2750, 2772, 2806, 1959, 3473,
-     3472, 2313, 3471, 2356, 2860, 2921,    0, 3455, 4189, 4189,
-
-        0, 3466, 4189, 3468, 2537, 2621, 4189, 2905, 2793, 2747,
-     2782, 2779, 2805, 2753, 2897, 2780, 2802, 3429, 2458, 2899,
-     2791, 2898, 4189, 3428, 2900, 3429, 3426, 3409, 3422, 3423,
-     3409, 3421, 3407, 2902, 2903, 2918, 2922, 2923, 2924, 2926,
-     2927, 2928, 2936, 2981, 2976, 2937, 2951, 2955, 2957, 2958,
-     2959, 2963, 2960, 2997, 2965, 2966, 2967, 2969, 2979, 2981,
-     2987, 3024, 3423, 2988, 2811, 2990, 2993, 3417, 3407, 2459,
-     2510, 3453, 3419, 2994, 2997, 2462, 3026, 3448, 3029, 3063,
-        0, 3426, 3002, 3000, 3016, 3006, 3013, 3018, 3021, 4189,
-     3389, 3309, 3024, 3022, 3272, 3027, 3215, 3209, 3187, 3150,
-
-     3134, 3029, 4189, 3004, 3055, 3040, 3056, 3042, 3058, 3061,
-     3062, 3067, 3065, 3098, 2484, 3110, 3119, 3070, 3088, 3089,
-     3094, 2917, 3090, 3091, 3097, 3098, 2953, 3099, 2930, 3100,
-     3109, 2818, 2796, 2785, 2502, 3110, 3102, 2383, 3135, 3112,
-     3120, 3124, 3128, 3125, 2746, 2687, 3131, 3133, 2605, 3134,
-     2590, 2592, 2586, 2479, 2459, 2433, 4189, 3139, 3143, 3144,
-     3147, 3149, 3152, 3155, 2541, 3192, 3208, 3204, 3210, 3162,
-     3178, 2438, 3185, 3182, 2414, 3188, 2340, 3189, 3190, 2333,
-     4189, 2018, 2288, 2260, 3192,  112, 3197, 3188, 3200, 3191,
-     2137, 2149, 3210, 3211, 4189, 2017, 2011, 4189, 1998, 4189,
-
-     1986, 3212, 3213, 3197, 3216, 3218, 2624, 3271, 1977, 3239,
-     1982, 1903, 3223, 3231, 1885, 3254, 1854, 1829, 3232, 3066,
-     1951, 1593, 3241, 1822, 1744, 3242, 3245, 1736, 1662, 4189,
-     1653, 3250, 3257, 3252, 3254, 2850, 3310, 1642, 3270, 1622,
-     4189, 1521, 3100, 1441,    0, 3255, 3294, 1280, 1416, 1354,
-     1309, 3268, 3280, 4189, 1314, 1246, 3264, 3278, 3325, 3333,
-     1178, 3284, 1155, 4189, 3300, 1072, 3313, 2771, 1054, 1064,
-     3294, 3296, 4189, 1044, 3302, 3350, 3377,  992, 3305,  960,
-     3102,    0, 3337,  892, 4189,  829, 3312, 4189, 3342, 3388,
-      696, 3345,  555, 3358, 3364,  406, 3367, 3414, 3415,  348,
-
-     3368, 4189, 3341, 3380, 4189, 4189, 3366, 3381, 3351, 3367,
-     2713, 3390, 3382, 3386,  281, 3404, 4189, 3405, 3416, 3426,
-      177, 4189, 4189, 3482, 3499, 3516, 3533, 3550, 3567, 3577,
-     3584, 3601, 3615, 3629, 3646, 3663, 3672, 3685, 3702, 3716,
-     3722, 3731, 3748, 3765, 3424, 3427, 3428, 3774, 3432, 3436,
-     3440,  362, 2185, 3786, 3800, 3806, 3441, 3445, 3812, 3818,
-     3827, 3844, 3861, 3878, 3895, 3912, 3926, 3935, 3952, 3969,
-     3986, 4003, 4020, 4037, 4054, 4071, 4088, 4105, 4122
+        0,   88,    0,    0,    0,    0, 1215,   93, 1196,   91,
+        0,    0, 1179,   64,   97,  117,  132,   87,  124,   98,
+       99,  142,  173,  154,  108,  135,  134,  254,  172,  179,
+      175,  178,  219,  180,  323,  388,  384,  318,  386,  319,
+      186,  128,  250,  256,  392,  404,  438,  428,  204,  455,
+      432,  465,  544,  120,  537,  548,  627,  624,  622,  544,
+      644,  658,  251, 9159, 1175, 9159,  267,   99,  162,  569,
+      572,  620,  745,  164,  107,  262,  307,  335,  376,  522,
+        0,  167,  157, 1162, 9159,  278,  321, 1160, 1118,  372,
+      304,  532,  593,  567, 9159,  633,  832, 9159, 9159,  911,
+
+      798,  318,  319,  450,  799,  552,  320,  354, 9159,  978,
+      834, 9159,  865,  860,  862,  866,  914,  863,  973,  980,
+      974, 1013, 1024, 1045,  869, 1049, 1075, 1095, 1098, 1101,
+     1182, 1177, 1161, 1181, 1214, 1212, 1237, 1239, 1235, 1270,
+     1290, 1316, 1325, 1293, 1346, 1323, 1366, 1368, 1391, 1399,
+     1403, 1429, 1430, 1455, 1452, 1478, 1498, 1482, 1523, 1521,
+     1554, 1548, 1579, 1586, 1606, 1629, 1649, 1675, 1681, 1698,
+     1707, 1729,  871, 1114, 1109,  140, 1023,  187,  372,  403,
+      553,  401, 1095,  565, 1792, 1818, 1083, 9159,  643,  669,
+      589, 1844, 1870, 1580, 1865, 1867, 1868, 1905, 1926, 1922,
+
+     1925, 1078, 9159,  837,  437,  677,  249,  660, 1072,  712,
+     9159, 1062,  844,  625, 1874, 1993, 2022, 1042,  864,  473,
+      904,  621,  506,  651,  721,  798,  791,  890,  912,  936,
+      907,  725, 1029, 1143,  729, 9159, 1114, 1179, 2097, 2112,
+     2127,  229,  937, 1033, 1012, 1006,  994,  943,  883,  974,
+      891, 9159, 1476, 2142, 2157, 2172, 2182, 2202, 2178, 2180,
+     2200, 2203, 2223, 2243, 2246, 2244, 2276, 2269, 2299, 2307,
+     2301, 2324, 2344, 2351, 2377,  901, 1018, 2374, 2394, 2397,
+     2414, 2495, 2434, 2440, 2465, 2472, 2518, 2521, 2515, 2548,
+     2556, 1138, 2564,  968, 9159, 2581, 2597, 2604, 2627, 2649,
+
+     2650, 2690, 2693, 2686, 2726, 2738, 2746, 2747, 2763, 2783,
+     2799, 2800, 2803, 2820, 2840, 2843, 2870, 2891, 2895, 2903,
+     2926, 2928, 2935, 2961, 2981, 2958, 2984, 2978, 3004, 3011,
+     3027, 3052, 3048, 3059, 3085, 3068, 3105, 3111,  196,  203,
+      976,  383,  974,  988, 1018, 1014, 1025, 1029, 1042,  253,
+     3174, 3200, 3226, 1067, 1182, 1172, 3252,    0,  418,  288,
+     1096, 3228, 3229, 3231, 3251, 3267, 3287, 3290, 1188, 1566,
+      973,  740, 9159,  938,  866, 9159, 1268, 1178,  931, 1170,
+     1241, 1299, 3354, 3381,    0,  903, 3408, 1148, 1116, 1177,
+     1322, 1145,  410, 1415, 1235,  460, 1292, 1218, 1323, 1022,
+
+      963, 1520, 1662, 3418, 3430, 3440, 3450, 3460, 3470,  889,
+     9159,  865, 9159, 9159, 9159, 9159, 9159, 1239,  853, 9159,
+      846, 2472, 3480, 3490, 3500, 3510, 3520, 3530, 3545, 3555,
+     3575, 9159, 3289, 3553, 3573, 3551, 3574, 3590, 3596, 3612,
+     3628, 3634, 3635, 3655, 3671, 3651, 3687, 3688, 3696,  459,
+     3728, 3736, 3740, 3784, 3868, 9159, 3780, 3776, 3807, 3811,
+     3850, 3912, 3872, 3920, 3921, 1351, 9159, 3828, 4005, 4060,
+     4095, 3904, 4063, 4069, 1258, 4096, 4104, 4126, 4134, 4156,
+     4165, 4196, 4205, 1409, 9159, 4208, 4197, 1476, 9159, 4235,
+     4241, 4257, 4261, 4273, 4284, 4293, 4305, 4309, 4332, 4336,
+
+     4353, 4316, 4359, 4362, 4384, 4407, 4385, 4416, 4423, 4448,
+     4455, 4456, 4486, 4494, 4488, 4511, 4527, 4519, 4531, 4554,
+     1498, 9159, 4552, 4575, 4584, 4587, 4607, 4610,  493,  529,
+      551,  476, 1287,  816,  953, 1119, 1293,  841, 4678, 4704,
+     4730, 1607, 1346, 1458, 4756, 1362, 1397, 4733, 4732, 4759,
+     4627, 4768, 4817,  733, 1619, 1594, 1406,  728, 1537, 9159,
+     1571, 1651, 1625, 1613, 4839, 4867, 4894, 1627, 1658, 1686,
+     1714, 1394,    0, 1756, 1574,    0, 1668,  724, 1709,  724,
+     1763, 1775, 9159, 9159,  708, 9159, 9159, 4904, 4916, 4926,
+     4936, 4771, 4931, 5013, 4934, 5068, 5069, 5071, 5075, 5072,
+
+     5120, 5121, 5123, 1725, 5127, 5153, 5176, 1832, 5175, 5179,
+     1458, 1493, 1739, 1516, 1519, 1873, 1592, 1739, 5201, 5224,
+     5202, 5241, 5240, 5257, 5278, 5280, 5301, 5284, 5352, 9159,
+     5351, 5346, 5349, 5353, 1802, 9159, 5355, 5385, 5401, 9159,
+     5405, 5408, 5412, 5428, 5449, 5451, 5458, 5460, 5495, 5501,
+     5531, 5527, 5539, 5571, 5564, 5575, 5591, 5602, 5623, 5614,
+     5634, 5635, 5660,  693, 5666, 5667, 5692, 5703, 5715, 9159,
+     5723, 5719, 5740, 5746,  846, 1103, 1234, 1788, 1768, 1386,
+     1788, 1615, 1847, 1854,  236,  590, 1781, 1913,  715, 5809,
+     1790, 1645, 2264, 9159, 5785, 5805, 1690, 5806, 5807, 2344,
+
+     9159, 1951, 1858, 1924, 2256,  679, 1930, 1879, 5870, 5880,
+     5907, 5917, 1811,  658, 5946,  624,    0, 9159, 6034,    0,
+        0,  613,  609, 9159,  604,  586, 2245, 2364, 2389, 9159,
+     9159, 6063, 6118, 6139, 6138, 6134, 6135, 6141, 6161, 6173,
+     6184, 6209, 6217, 1654, 6260, 6248, 6216, 1844, 1864, 6239,
+     6280, 9159, 1689, 9159, 1930, 1750, 1763, 1934, 1933, 2077,
+     6300, 6292, 6317, 6337, 6338, 6344, 6369, 6376, 2212, 9159,
+     6360, 6413, 6392, 6412, 6424, 6433, 6456, 6435, 6465, 6476,
+     6488, 6497, 6508, 6509, 6552, 6529, 6540, 6549, 6560, 6585,
+     6593, 6605, 6628, 2392, 6636, 6637, 6648, 6659, 6694, 6685,
+
+     6686, 6775, 2286,  518, 2092, 2103, 1938, 2148, 2420, 2303,
+      472,  442, 2196,    0, 1803, 6692, 6717, 6768, 6756, 2424,
+     2334,  426,  422, 2432,  378, 1883, 6858, 6945, 6974,  337,
+     9159, 1922, 9159,    0,  328, 9159,  314, 2481, 2510, 9159,
+     6929, 6757, 7029, 7031, 7037, 7040, 7033, 7077, 7070, 7086,
+     2264, 2842, 7093, 7097, 7118, 9159, 2372, 7129, 2384, 2060,
+     2411, 2418, 2078, 2421, 2139, 7138, 7149, 7170, 7179, 7195,
+     7201, 7227, 7234, 7236, 2483, 3160, 7259, 7257, 7279, 7280,
+     7282, 7302, 7318, 2564, 7325, 7319, 7345, 7356, 7377, 7357,
+     7368, 7388, 2513, 2467, 7400, 2603, 7389, 7425, 2468, 2371,
+
+     2235, 2479,  361,  296,  182, 7409, 7432, 2249, 7455,  622,
+     2529,  227, 1008, 7505,    0,  207, 7482, 7503, 7505, 7514,
+     7535, 7536, 7544, 9159, 2413, 2526, 7567, 7571, 2546, 7593,
+     2547, 2562, 2567, 2526, 2575, 9159, 2526, 7587, 7625, 7594,
+     7631, 7632, 7648, 7657, 7668, 3179, 3203, 2672, 3229, 3335,
+     7684, 7688, 7709, 2597, 7705, 7725, 7732, 7736,  178, 7758,
+     2596, 7775, 7769, 2619, 2617, 2641, 2696, 2668, 7795, 7801,
+     7807, 2677, 2720, 3150, 7827, 7818, 7834, 7867, 7850, 2625,
+     2685, 7870, 7890, 2688, 7859, 2699, 2731, 2741, 2661, 2665,
+     9159, 7911, 7907, 7910, 7927, 7933, 7963, 2822, 3360, 3384,
+
+     3411, 4103, 4220, 7959, 2702, 7970, 7966, 2741, 7986, 2738,
+     8003, 8019, 2758, 9159, 2765, 2781, 2809, 2818, 8030, 8026,
+     2900, 2883, 2903, 2951, 8042, 8051, 2820, 2829, 8063, 8086,
+     9159, 2838, 9159, 2846, 9159, 2846, 8088, 8090, 8113, 8134,
+     3067, 4430, 2880, 8136,  175, 2911, 8125, 8156, 2877, 9159,
+     1190, 2938, 2908, 8157, 3034, 3081, 3049, 3028, 8173, 2959,
+     2985, 8189, 8182, 3029, 9159, 3039, 8205, 8212, 8214, 3241,
+     4684, 3056, 8235, 3049, 9159, 3056, 3212, 3072,    0, 8237,
+     1210, 3169, 3157,  144, 3103, 3103, 8257, 8260, 9159, 3110,
+     8283, 3255, 4708, 3110, 8290,  123, 9159, 3235, 3207, 3329,
+
+     3387, 3558, 3232, 3256, 8306, 8313, 3278, 8315, 8396, 4870,
+     3259, 8391, 3280, 3664,    0, 3349, 3414, 9159,  103, 9159,
+     3346, 8392, 9159, 3745, 4900, 8473, 3347, 8450,   90, 1237,
+     1328, 3570, 8470, 4973, 4977, 3380, 8471, 9159, 3676, 3645,
+     9159, 9159, 3693, 3608, 3764, 3684, 3616, 1433, 3705, 3782,
+     3810, 3774, 3875, 9159, 3852, 3697, 3910, 3892, 3896, 9159,
+     9159, 8553, 8565, 8577, 8589, 8601, 8613, 8621, 8623, 8635,
+     8647, 8659, 8671, 8678, 8687, 8699, 8711, 8723, 8735, 8747,
+     8754, 8762, 8774, 8786, 8798, 8810, 8822, 8834, 8846, 8858,
+     8870, 8882, 8894, 8906, 8918, 8930, 8942, 8954, 8966, 8978,
+
+     8990, 9002, 9014, 9026, 9038, 9050, 9062, 9074, 9086, 9098,
+     9110, 9122, 9134, 9146
     } ;
 
-static yyconst short int yy_def[1180] =
+static yyconst flex_int16_t yy_def[1215] =
     {   0,
-     1123,    1, 1124, 1124,    1,    2, 1125, 1125,    1,    2,
-        1,    2, 1123, 1123, 1123, 1123, 1123, 1126, 1127, 1123,
-     1123, 1128, 1129, 1123, 1123, 1123, 1123, 1123, 1130, 1123,
-     1123, 1123, 1123, 1131, 1131,   35,   35,   35,   35,   38,
-       38,   38,   38,   38,   38,   38,   38,   38,   38,   37,
-       37, 1123, 1123, 1123, 1132, 1133,   37,   38,   38,   37,
-       38, 1123, 1134, 1123, 1134, 1135, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1126, 1126, 1126, 1127, 1123, 1127, 1127,
-     1128, 1123, 1128, 1128, 1129, 1136, 1129, 1123, 1129, 1129,
-     1123, 1123, 1123, 1137, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1138, 1130, 1123, 1123,   38,   38,   38,   38,
-       38,   38,   35,   38,   38,  115,  115,  115,  115,  115,
-      115,  115,  115, 1131,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1123, 1139, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1140, 1132, 1123, 1132,
-     1132, 1132, 1140, 1141, 1142,  115,  115,  115,  115,  115,
-      115, 1134, 1123, 1134, 1143, 1143, 1123, 1143, 1143, 1143,
-
-     1144, 1143, 1123,  203,  203,  203,  203,  203, 1123, 1123,
-     1123, 1126, 1126, 1127, 1127, 1128, 1128, 1136, 1136, 1136,
-     1136, 1123, 1129, 1129, 1145, 1146, 1147, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1148, 1149,
-     1150, 1151, 1152, 1153,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115, 1154,  124,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115, 1123,  115, 1123,
-     1123,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123, 1123, 1123, 1123, 1139, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1155, 1155, 1132, 1132, 1132,
-     1156, 1142, 1142, 1142, 1142,  115,  115,  115,  115,  115,
-      115, 1134, 1143, 1143, 1123, 1143, 1143, 1144, 1144, 1144,
-     1144, 1143, 1143,  203,  203, 1143,  203,  203,  203,  203,
-     1123, 1123, 1123, 1126, 1126, 1127, 1127, 1128, 1128, 1136,
-     1129, 1129, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1148, 1123, 1123, 1123, 1123, 1123, 1123, 1157, 1153, 1158,
-      115,  115, 1123,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115, 1123,  115,
-      115,  115,  115, 1123, 1123,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1123,  115, 1123,  115,  115,
-      115,  115,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115, 1123, 1123,  115,  115, 1123, 1123,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115, 1123, 1123,
-
-      115,  115,  115,  115,  115,  115, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1159, 1159, 1132, 1132,
-     1132, 1160, 1142, 1142,  115,  115,  115,  115,  115, 1123,
-     1134, 1143, 1143, 1144, 1144, 1143, 1143, 1143,  203,  203,
-      203,  203, 1123, 1161, 1123, 1126, 1162, 1127, 1163, 1128,
-     1164, 1129, 1165, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123,  115,  115,  115, 1123,  115,
-      115, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115, 1123, 1123,  115,  115,  115, 1123, 1123,  115,  115,
-      115, 1123,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115, 1123,  115,  115,  115,  115,
-      115, 1123,  115,  115,  115,  115, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1132, 1132, 1166,
-     1167, 1142, 1168, 1123, 1123,  115,  115, 1123,  115, 1123,
-     1123, 1123, 1134, 1143, 1169, 1144, 1170, 1143, 1143, 1143,
-     1143,  203,  203, 1123,  203, 1171, 1123, 1123, 1172, 1126,
-     1173, 1127, 1123, 1174, 1128, 1175, 1129, 1129, 1123, 1123,
-
-     1123, 1123,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115, 1123,  115,  115,  115, 1123, 1123,  115,  115,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-      115,  115,  115,  115,  115,  115,  115,  115,  115, 1123,
-     1123,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123,  115,  115,  115,  115,  115,
-      115,  115, 1123, 1123, 1123, 1123, 1123, 1123,  655, 1132,
-     1176, 1132, 1142, 1168, 1168,  115,  115,  115, 1134, 1177,
-     1143, 1144, 1170, 1170, 1123, 1143,  203,  203, 1123, 1123,
-
-     1126, 1127, 1123, 1128, 1129, 1129, 1123, 1123,  115,  115,
-      115,  115,  115,  115,  115,  115,  115, 1123, 1123,  115,
-      115,  115, 1123, 1123,  115, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123, 1178,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115, 1123, 1123,  115, 1123,  115,  115, 1123, 1123, 1123,
-     1132, 1132, 1142,  115,  115, 1123, 1134, 1143, 1144, 1143,
-      203,  203,  115,  115,  115,  115,  115,  115,  115, 1123,
-     1123, 1123,  115,  115, 1123,  115, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1178, 1123, 1179, 1178,  115,  115,  115,
-      115, 1123,  115,  115,  115,  115, 1123,  115, 1123,  115,
-      115, 1123, 1123, 1132, 1142,  115,  115, 1134, 1144,  115,
-      115,  115,  115,  115, 1123, 1123,  115,  115, 1123,  115,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1179, 1178, 1179, 1179,  115,
-      115, 1123,  115,  115, 1123,  115, 1123,  115,  115, 1123,
-     1123, 1132, 1142, 1142,  115, 1134, 1144, 1144,  115,  115,
-     1123, 1123,  115,  115, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123,  115,  115,  115,  115,  115, 1123, 1178, 1123,  115,
-     1123, 1123,  115,  115, 1123, 1132, 1142, 1142,  115, 1134,
-     1144, 1144,  115, 1123, 1123,  115,  115, 1123, 1123, 1123,
-     1123,  115,  115,  115,  115, 1123, 1178, 1123,  115, 1123,
-     1123, 1123, 1132, 1142, 1142,  115, 1134, 1144, 1144, 1123,
-     1123,  115,  115, 1123, 1123, 1123,  115,  115, 1123, 1178,
-     1123,  115, 1123, 1123, 1132, 1142, 1134, 1144, 1123, 1123,
-      115,  115, 1123, 1123,  115, 1123, 1178, 1123,  115, 1123,
-     1132, 1142, 1134, 1144, 1123, 1123,  115, 1123, 1178, 1178,
-     1123,  115, 1123, 1132, 1134, 1123,  115, 1178, 1179, 1123,
-
-      115, 1123, 1132, 1134, 1123, 1123, 1132, 1134, 1132, 1134,
-     1132, 1134, 1132, 1134, 1132, 1134, 1123, 1134, 1134, 1134,
-     1134, 1123,    0, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123
+     1161,    1, 1162, 1162,    1,    2, 1163, 1163,    1,    2,
+        1,    2, 1161, 1161, 1161, 1161, 1161, 1164, 1165, 1161,
+     1161, 1166, 1167, 1161, 1161, 1161, 1161, 1161, 1161, 1168,
+     1161, 1161, 1161, 1161, 1169, 1169,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36, 1161, 1161,   53, 1170, 1161,   36,   36,   36,
+       36,   36,   36, 1161, 1171, 1161, 1171, 1171, 1171, 1161,
+     1161, 1172, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1164, 1164, 1164, 1165, 1161, 1165, 1165, 1166, 1161, 1166,
+     1166, 1167, 1173, 1167, 1161, 1167, 1167, 1161, 1161, 1161,
+
+     1174, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1175,
+     1161, 1161, 1161,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1169,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   53,  173, 1176, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161,  173, 1161,  173, 1161, 1170, 1161, 1170, 1170,
+     1170, 1161, 1161, 1177,   36,   36,   36,   36,   36,   36,
+
+       36, 1171, 1161, 1171, 1171, 1171, 1171, 1178, 1179, 1179,
+     1161, 1179, 1179, 1179, 1180, 1179, 1161,  217,  217,  217,
+      217,  217, 1161, 1161, 1161, 1164, 1164, 1165, 1165, 1166,
+     1166, 1173, 1173, 1173, 1173, 1161, 1167, 1167, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1181, 1161, 1161, 1161, 1161, 1161,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36, 1182,  131,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36, 1161,   36, 1161, 1161,   36,   36,   36,   36,   36,
+
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,  173,  173,
+     1161,  173, 1176, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+      185, 1161, 1161, 1170, 1170, 1170, 1161, 1177, 1177, 1177,
+     1177,   36,   36,   36,   36,   36,   36,   36, 1171, 1171,
+     1183, 1183, 1161, 1179, 1179, 1161, 1179, 1179, 1180, 1180,
+     1180, 1180, 1179, 1179,  217,  217, 1179,  217,  217,  217,
+      217, 1161, 1161, 1161, 1164, 1164, 1165, 1165, 1166, 1166,
+
+     1173, 1167, 1167, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1181, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36, 1161,
+       36,   36,   36,   36, 1161, 1161,   36,   36,   36,   36,
+       36,   36,   36,   36,   36, 1161, 1161,   36, 1161,   36,
+       36,   36,   36,   36, 1161,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161, 1161,   36,   36, 1161, 1161,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1161, 1161,   36,   36,   36,   36,   36,   36,  173,  173,
+      173, 1161, 1161, 1161, 1161, 1161, 1161, 1161,  185, 1161,
+     1161, 1170, 1170, 1170, 1161, 1177, 1177,   36,   36,   36,
+       36,   36,   36, 1161, 1171, 1171, 1171, 1183, 1183, 1161,
+     1179, 1179, 1180, 1180, 1179, 1179, 1179,  217,  217,  217,
+      217, 1161, 1184, 1161, 1164, 1185, 1165, 1186, 1187, 1188,
+     1189, 1190, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+
+       36,   36,   36, 1161,   36,   36,   36, 1161,   36,   36,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36, 1161,
+     1161,   36,   36,   36, 1161, 1161,   36,   36,   36, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36, 1161,
+       36,   36,   36,   36,  173,  173,  173, 1161, 1161, 1161,
+     1161, 1161, 1161,  173, 1161, 1161, 1170, 1170, 1191, 1161,
+     1177, 1192, 1161, 1161,   36,   36, 1161,   36,   36, 1161,
+
+     1161, 1161, 1171, 1171, 1179, 1193, 1180, 1194, 1179, 1179,
+     1179, 1179,  217,  217, 1161,  217, 1195, 1161, 1161, 1196,
+     1197, 1198, 1199, 1161, 1200, 1201, 1202, 1203, 1203, 1161,
+     1161, 1161,   36, 1161,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36, 1161, 1161,   36,
+       36, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36, 1161, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+
+       36, 1161,  802,  802, 1161, 1161, 1161, 1161,  802, 1204,
+     1205, 1204, 1206, 1207, 1207,   36,   36,   36,   36, 1208,
+     1208, 1209, 1210, 1211, 1212, 1212, 1161, 1210, 1161,  829,
+     1161, 1161, 1161, 1197, 1199, 1161, 1201, 1203, 1203, 1161,
+     1161,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1161, 1161,   36,   36,   36, 1161, 1161,   36, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161,   36,   36,   36,   36,   36,
+       36,   36,   36,   36, 1161, 1213,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+       36,   36, 1161, 1161,   36, 1161,   36,   36, 1161, 1161,
+
+     1161, 1161, 1204, 1204, 1206,   36,   36, 1161,   36, 1208,
+     1208, 1210, 1211, 1210,  829,  829,   36,   36,   36,   36,
+       36,   36,   36, 1161, 1161, 1161,   36,   36, 1161,   36,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161,   36,   36,   36,
+       36,   36,   36,   36,   36, 1213, 1213, 1161, 1214, 1213,
+       36,   36,   36, 1161,   36,   36,   36,   36, 1161,   36,
+     1161,   36,   36, 1161, 1161, 1161, 1204, 1206,   36,   36,
+       36, 1208, 1208, 1211,   36,   36,   36,   36,   36, 1161,
+     1161,   36,   36, 1161,   36, 1161, 1161, 1161, 1161, 1161,
+     1161,   36,   36,   36,   36,   36,   36, 1161, 1214, 1214,
+
+     1213, 1214, 1214,   36, 1161,   36,   36, 1161,   36, 1161,
+       36,   36, 1161, 1161, 1161, 1204, 1206, 1206,   36,   36,
+     1208, 1208, 1211, 1211,   36,   36, 1161, 1161,   36,   36,
+     1161, 1161, 1161, 1161, 1161, 1161,   36,   36,   36,   36,
+     1161, 1213, 1161,   36, 1161, 1161,   36,   36, 1161, 1161,
+     1204, 1206, 1206,   36, 1208, 1208, 1211, 1211,   36, 1161,
+     1161,   36,   36, 1161, 1161, 1161,   36,   36,   36, 1161,
+     1213, 1161,   36, 1161, 1161, 1161, 1204, 1206, 1206,   36,
+     1208, 1208, 1211, 1211, 1161, 1161,   36,   36, 1161, 1161,
+       36, 1161, 1213, 1161,   36, 1161, 1161, 1204, 1206, 1208,
+
+     1208, 1211, 1161, 1161,   36,   36, 1161,   36, 1161, 1213,
+     1161,   36, 1161, 1204, 1206, 1208, 1208, 1161, 1211, 1161,
+     1161,   36, 1161, 1161, 1213, 1213, 1161,   36, 1161, 1204,
+     1208, 1161,   36, 1213, 1214, 1161,   36, 1161, 1204, 1208,
+     1161, 1161, 1204, 1208, 1204, 1208, 1204, 1208, 1204, 1208,
+     1204, 1208, 1204, 1161, 1208, 1208, 1208, 1208, 1208, 1161,
+        0, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161
     } ;
 
-static yyconst short int yy_nxt[4253] =
+static yyconst flex_int16_t yy_nxt[9249] =
     {   0,
        14,   15,   16,   17,   18,   19,   14,   20,   21,   22,
-       23,   24,   21,   25,   21,   26,   21,   27,   28,   29,
-       29,   29,   29,   29,   29,   29,   29,   29,   21,   30,
-       31,   32,   33,   21,   21,   34,   35,   36,   37,   38,
-       39,   40,   41,   34,   42,   34,   34,   43,   44,   45,
-       46,   47,   34,   48,   49,   50,   34,   34,   51,   34,
-       34,   34,   14,   52,   53,   54,   55,   64,   66,   65,
-       70,   72,   71,   72,   82,   71,   68,   73,   75,   92,
-       78,   56,   56,   56,   56,   56,   56,   56,   56,   56,
-       69,   68,   76,   67,   68,   86,   91,   68,  103,  102,
-
-       57,   58,   87,   88,   59,   69,   68,   68,   69,   68,
-       68,   69,   68,   83,  193,   68,   79,   60,   61,   68,
-       69,   69,   68,   69,   69,  210,   69,   84,   68,   69,
-       80,  105,  333,   69,   89,   72,   69,   72,   78,   70,
-       68,   71,   69,  108,  116,  108,  108,  131,   90,   93,
-      132,   93,   78,  133,   69,  108,  185,  108,   82,  134,
-      193, 1020,  108,  110,   71,  194,   71,   94,   94,   94,
-       94,   94,   94,   94,   94,   94,  211,  108,  211, 1122,
-       71,  108,   73,  214,   95,  186,  215,  135,   96,   68,
-       97,  108,  108,  136,   82,   98,  108,   99,  100,  187,
-
-      137,  138,  108,   69,  366,  254,  108,  101,  106,  217,
-      107,  107,  107,  107,  107,  107,  107,  107,  107,  117,
-      108,  108,  108,  225,  226,  108,  118,  179,  216,  108,
-      119,  108,  109,  120,   86,  139,  227,  108,  110,  108,
-      369,   87,   88,  121,  230,  255,  110,  106,  108,  107,
-      107,  107,  107,  107,  107,  107,  107,  107,  232,  231,
-      153,  338,  108,  108,  108,  122,  234,  111,  112,  123,
-      108,  109,  108,  233,  108,  124,  235,  113,  108,  125,
-      110,  108,  108, 1117,  114,  115,  140,  366,  366,  253,
-      108,  126,  396,  127,  141,  108,  128,  129,  108,  110,
-
-      142,  143,  108,  130,  108,  108,  108,  367,  370,  144,
-      108,  146,  108,  147,  108,  145,  108,  149,  148,  108,
-      108,  108,  154,  179,  191,  108,  155,  397,  180,  179,
-      156,  150,  160,  314,  151,  108,  108,  152,  157,  161,
-      108,  158,  159,  108,  108,  193,  108,  315,  260,  162,
-      108,  163,  329,  183,  108,  108,  108,  189,  108,  168,
-      135,  164,  181,  339,  108,  108,  330,  103,  108,  165,
-      243,  166,  167,  160,  243,  103,  182,  168,   86,  352,
-      161,  196,  197,  196,  108,   87,   88,  108, 1106,  390,
-      162,   68,  168,  198,  219,  220,  219,  190,  168, 1123,
-
-       82,  108,  221,  222,   86,   69,  169,  170,   86,   68,
-      171,   87,   88, 1123,  108,   87,   88,  108,  270,  252,
-      108,  199,  259,  172,  173,  174,  175,  176,  167,  391,
-      337,  108,  267,  168,  108,  200,  168,  108,  223,  108,
-      108,  366,  268,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  256,  257,  379, 1105,  108,  108,  258,  224,
-      108,  108,  169,  170,  683,   68,  171,  243,  243,  243,
-      243,  243,  243,  243,  243,  243,  282,  276,  108,  172,
-      173,  195,  196,  197,  196,  195,  195,  195,  201,  195,
-      195,  195,  195,  195,  195,  195,  195,  195,  202,  195,
-
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  195,
-      195,  195,  195,  195,  195,  195,  204,  186,  204,  204,
-      204,  204,  205,  204,  118,  204,  204,  204,  206,  204,
-      204,  187,  204,  204,  204,  204,  207,  204,  204,  204,
-      204,  208,  204,  195,   93,  179,   93,  108,  108,  244,
-      245,  108,   78,  108,  108,  108,   78,  108,  108,  179,
-      108,  108,  108,   82,  108,  261,  197, 1102,  108,  108,
-      108,  266,  108,  108,  108,  108,  108,  108,  108,   95,
-      108,  108,  108,   96,  108,   97,  108,  108,  247,  108,
-       98,  549,   99,  100,  376,  275,  340,  108,  108,  519,
-
-      269,  108,  101,  239,  239,  239,  239,  239,  239,  239,
-      239,  239,  108,  108,  277,  550,  108,  357,  108,   82,
-      108,  303,  108,  240,  241,  246,  108,  108,  108,  108,
-      108,  108,  108,  108,  108,  337,  242,  108,  248,  108,
-      249,  168,  108,  108,  274,  108,  108,  108,  108,  250,
-      108,  291,  278,  251,  278,  108,  108,  108,  108,  108,
-      108,  108,  108,  337,  378,  179,  108,  108,  287,  168,
-      246,  108,  108,  262,  271,  262,  366,  103,  366,  108,
-      280,  272,  280,  108,  108,  273,  108,  108,  283,  106,
-      281,  263,  263,  263,  263,  263,  263,  263,  263,  263,
-
-      284,  108,  285,  108,  108,  286,  279,  288,  108,  108,
-      108,  368,  290,  540,  366,  245,  108,  659,  518,  108,
-      108,  289,  108,  292,  168,  108,  108,  108,  264,  293,
-      265,  294,  108,  108,  108,  108,  313,  108,  295,  108,
-      108,  297,  108,  304,  539,  305,  108,  108,  300, 1100,
-      301,  108,  298,  296,  244,  299,  302,  108,  310,  108,
-      108,  306,  307,  108,  108,  308,  108,  309,  108,  316,
-      108,  108,  311,  108,  320,  354,  355,  354,  108,  312,
-      317,  321,  322,  108,  318,  108,  108,  108,  319,  324,
-      108,  325,  167,  108,  323,  108,  327,  168,  325,  167,
-
-      108,  108,  193,  108,  168,  343,  108,  343,  327,   78,
-      325,  167,  253,  373,  349,  373,  168,  108,  108,  346,
-       78,  108,  197,  108,  108,  348,  169,  170,  351,  383,
-      171,  383,  366,  169,  170,  108,  350,  171,  108,  179,
-      344,  108,  531,  326,  173,  169,  170,  256,  347,  171,
-      326,  173,  108,  258,  345,  691,  356,  359,  197,  359,
-      377,  220,  326,  173,  327,  175,  335,  167,  380,  222,
-      220,  541,  168,   86,  385,  197,  385,  380,  222, 1096,
-       87,   88,  336,  336,  336,  336,  336,  336,  336,  336,
-      336,   86,  360,  521,  197,  219,  220,  219,   87,   88,
-
-      108,  169,  170,  221,  222,  171,  361,  219,  220,  219,
-      387,  411,  387,  225,  226,  221,  222,  108,  326,  173,
-      197,  402,  404,  402,  404,  518,  227,  382,  406,  533,
-      406,  168,  343,  545,  343,  545,  381,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  353,  353,  197,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  363,  353,  364,  364,  364,  364,  364,
-      364,  364,  364,  364,  353,  353,  353,  353,  353,  353,
-      353,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-
-      365,  365,  365,  365,  365,  365,  365,  365,  353,  108,
-      413,  108,  657,  108,  280,  366,  280,  108,  168,  108,
-      108, 1093,  108,  108,  281,  415,  108,  418,  108,  412,
-      108,  414,  416,  417,  108,  108,  108,  108,  108,  420,
-      108,  421,  108,  108,  108,  542,  108,  108, 1091,  419,
-      428,  425,  108,  432,  422,  108,  108,  423,  426,  108,
-      108,  108,  424,  108,  108,  108,  430,  427,  108,  108,
-      108,  108,  108,  108,  451,  431,  433,  444,  108,  445,
-      366,  445,  108,  108, 1088,  108,  108,  449,  108,  108,
-      434,  108,  434,  108,  108,  108,  447,  448,  450,  108,
-
-      108,  453,  278,  684,  278,  452,  108,  108, 1086,  446,
-      108,  108,  108, 1085,  108,  108,  108,  456,  108,  108,
-      435,  455,  179,  108,  108,  108,  457, 1082,  436,  108,
-      437,  108,  108,  438,  197,  108,  108,  439,  458,  459,
-      440,  108,  108,  441,  442,  460,  108,  443,  108,  463,
-      467,  463,  467,  108,  462,  108,  454,  472,  461,  464,
-      468,  478,  108,  108,  108,  108,  474,  520,  471,  108,
-      108, 1080,  108,  108,  473,  108,  108,  108,  108,  108,
-      535,  108,  476,  477,  108,  108,  108,  108,  475,  480,
-      108,  479,  108,  108,  498,  465,  469,  108,  108,  108,
-
-      481,  108,  108,  483,  108,  466,  470,  108,  482,  484,
-      485,  108,  108,  108,  108,  108,  108, 1078,  486,  487,
-      108,  490,  108,  108,  108,  108,  491,  492,  108,  108,
-      108,  488,  489,  493,  108,  108,   78,  108,  108,  108,
-      108,  494,  108,  108,  495,  108,  499,  108,  499,  108,
-      501,  108,  108,  497,  496,  108,  500,  108,  503,  504,
-      108,  108,  108,  502,  108,  507,  505,  508,  167,  518,
-      197,  108,  108,  168,  108,  168,  525,  530,  108,  527,
-      506,  108,  197,  103,  509,  548,  508,  167,  108,  108,
-      526,  509,  168,  508,  167, 1074,  108,  197,  108,  168,
-
-      108,  528,  169,  170,   82,  179,  171,  108,  193,  108,
-      108,  529,  354,  355,  354,  532,  559,  108,  559,  326,
-      173,  169,  170,  220,  108,  171,  108,  108,  169,  170,
-      380,  222,  171,  359,  197,  359, 1068,  534,  326,  173,
-      108,  561,  551,  561,   86,  326,  173,  509,  175,  516,
-      167,   87,   88,   86, 1073,  168,  658,  108,  563,  673,
-       87,   88,  445, 1070,  445,  517,  517,  517,  517,  517,
-      517,  517,  517,  517,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  657,  169,  170,  225,  226,  171,  168,
-      366,  553,  446,  688, 1069,  688,  552,  108,  108,  227,
-
-      565,  326,  173,  197,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  685,  108,  108,  179,  668,  197,  668,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  108,  108,
-      197,  536,  197,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  168,  197,  660,  108,  108,  566,  168,  537,
-      537,  537,  537,  537,  537,  537,  537,  537,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  108,  567,  108,
-      538,  197,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  675,  674,  569,  108,  108,  108, 1066,  362,  362,
-
-      362,  362,  362,  362,  362,  362,  362,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  405,  405,  405,  405,  405,
-      405,  405,  405,  405,  405,  405,  405,  405,  405,  405,
-      405,  405,  405,  407,  407,  407,  407,  407,  407,  407,
+       23,   24,   25,   26,   25,   27,   25,   28,   29,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   25,
+       31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
+       41,   42,   43,   42,   42,   44,   45,   46,   47,   48,
+       42,   49,   50,   51,   42,   42,   52,   42,   42,   42,
+       25,   25,   42,   35,   36,   37,   38,   39,   40,   41,
+       42,   43,   42,   44,   45,   46,   47,   48,   42,   49,
+       50,   51,   42,   42,   52,   42,   42,   42,   14,   53,
+       54,   55,   56,   71,   67,   66,   67,   68,   76,   77,
+
+       78,  203, 1138,   74,   72,  211,  206,   57,   57,   57,
+       57,   57,   57,   57,   57,   57,   57,   75,   79,   77,
+       79,   79,   77,   79,   58,   59,   82,   73,   60,   85,
+       61,   69,   74,   78,   77,   80,   74,   74,   74, 1113,
+       83,   62,   63,  176,   89,   75,  211,   74,   99,  176,
+       75,   75,   75,   58,   59,   82,   73,   60,  224,   61,
+       69,   75,  115,   86,  203,   74,   74,   74,   83,   62,
+       63,   74,   98,   74,   74,   93,   74,   87,   75,   75,
+       75,   90,   94,   95,  109,   75,  224,   75,   75,   75,
+     1074,  115,   86,   74, 1008,   91,  110,  529,  223,  530,
+
+       74,  226,   74,   74,  531,   87,  530,   75,  227,  207,
+       90,   74,   96,   75,   74,   75,   75,   74,   74,   74,
+      115,  346,   74,   91,  387,   75,   97,  223,   75,  211,
+      226,   75,   75,   75,  142,   75,  227,  207,  115,  176,
+       74,   96,  161,   74,  968,  176,   74,   74,   74,  115,
+      346,  203,  112,   75,   97,  100,   75,  100,   74,   75,
+       75,   75,  142,   76,   77,   78,  410,  115,  204,  203,
+      204,  161,   75,  101,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,   85,  115,  115,  370,   74,  102,  143,
+      115,  538,  103,   74,  104,  410,  144,  145,  188,  105,
+
+       75,  106,  107,  201,  146,  205,   89,   75,   79,   77,
+       79,  108,  228,  115,  115,  370,   89,  102,  143,  115,
+      538,  103,   74,  104,  144,  145,   85,  105,  546,  106,
+      107,  201,  146,   85,  205,   75,   78,   77,   78,  108,
+      113,  228,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  115,  115,  387,  231,  129,  546,  116,  117,
+      130,  138,  118,  188,  139,  242,  131,  140,  119,  243,
+      132,  250,  229,  141,   89,  120,  121,  225,   77,  225,
+      211,  115,  115,  231,  531,  129,  530,  116,  117,  130,
+      138,  118,  139,  242,  131,  140,  119,  243,  132,  250,
+
+      229,  141,  251,  120,  121,  113,  230,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  347,  124,  359,
+      115,  359,  122,  967,  211,  125,  147,  118,  211,  126,
+      251,  133,  127,  134,  148,  230,  135,  136,  150,  203,
+      149,  123,  128,  137,  188,  347,  151,  124,  573,  115,
+      348,  122,  152,  350,  125,  147,  118,  126,  153,  133,
+      127,  134,  157,  148,  135,  136,  168,  150,  149,  123,
+      128,  137,  115,  169,  188,  151,  158,  573,  348,  159,
+      152,  350,  160,  170,  207,  154,  153,  155,  244,  162,
+      387,  157,  156,  163,  675,  168,  676,  164,  576,  115,
+
+      604,  115,  169,  245,  158,  165,  171,  159,  166,  167,
+      160,  170,  207,  154,  678,  155,  172,  244,  162,  804,
+      156,  389,  163,   78,   77,   80,  164,  576,  115,  604,
+      677,  245,  676,  165,   93,  171,  166,  167,  183,  184,
+      185,   94,   95,  678,  172,  173,   77,  174,  175,  389,
+      188,  392,  677,  176,  676,  189,  186,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,   79,   77,   79,   93,
+       79,   77,   79,   79,   77,   79,   94,   95,  115,  392,
+      177,  178,  208,   74,  179,  208,  180,  190,   89,  198,
+      248,  188,  142,  176,  233,  234,  233,  181,  182,  176,
+
+      249,  191,  235,  236,  224,  208,   89,  115,  208,  177,
+      178,  349,   74,  179,   85,  180,  190,  198,  836,  248,
+      142,  210,  211,  210,  203,  181,  182,  211,  249,  191,
+      192,  194,  224,  212,  208,   93,  176,  208,  387,  349,
+      356,  387,   94,   95,  110,  188,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  197,  391,  195,  213,
+      129,  372,  373,  372,  130,  125,   74,  237,  356,  126,
+      131,  188,  196,  214,  132,  387,  378,  354,  115,  203,
+       75,  211,  128,  143,  972,  197,  391,  195,  213,  129,
+      144,  199,  168,  130,  125,   74,  237,  126,  131,  169,
+
+      196,  214,  132,  355,  378,  393,  354,  115,   75,  170,
+      128,  369,  143,  375,  376,  375,  200,  188,  144,  199,
+      794,  168,  394,   77,  394,  731,   89,  234,  169,  724,
+      373,  234,  355,  393,  401,  236,  554,  170,  401,  236,
+      369,  559,  560,  559,  200,  209,  210,  211,  210,  209,
+      209,  209,  215,  209,  209,  209,  209,  209,  209,  209,
+      209,  209,  216,  209,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  209,  209,  209,  209,  209,  195,
+      218,  218,  218,  218,  219,  218,  125,  218,  218,  218,
+      220,  218,  218,  196,  218,  218,  218,  218,  221,  218,
+
+      218,  218,  218,  222,  218,  209,  209,  218,  195,  218,
+      218,  218,  218,  219,  218,  125,  218,  218,  220,  218,
+      218,  196,  218,  218,  218,  218,  221,  218,  218,  218,
+      218,  222,  218,  209,   93,  239,  240,  246,  204,  203,
+      204,   94,   95,  395,  554,  396,  211,  802,  241,  803,
+      680,  110,  247,  111,  111,  111,  111,  111,  111,  111,
+      111,  111,  111,  587,  239,  240,  246,  375,  376,  375,
+      586,  395,  339,  396,  340,  205,  241,  258,  377,  680,
+      247,  387,  584,  238,  257,  257,  257,  257,  257,  257,
+      257,  257,  257,  257,  115,   85,  115,  261,  388,  115,
+
+      115,  115,  115,  268,  205,  115,  583,  377,  115,   89,
+     1161,  238,  100,  115,  100,  115,  115,   85,  259,  115,
+      387,  387,  115,  115,  341,  115,  261,  388,  115,  115,
+      115,  115,  268,  211,  115,  397,  419,  115,   89, 1161,
+      211,  115,  421,  115,  115,  102,  259,  115,  115,  103,
+      115,  104,  341,  115,  411,  390,  105,  450,  106,  107,
+      417,  400,  260,  397,  419,  234,  398,  115,  108,  294,
+      421,  294,  401,  236,  102,  373,  188,  115,  103,  295,
+      104,  399,  115,  390,  105,  450,  106,  107,  681,  400,
+      260,  420,  412,  418,  398,  115,  108,  253,  253,  253,
+
+      253,  253,  253,  253,  253,  253,  253,  115,  264,  399,
+      211,  416,  115,  115,  115,  254,  255,  681,  262,  115,
+      412,  418,  263,  415,   89,  265,  115,  115,  256,  414,
+      233,  234,  233,  115,  349,  258,  115,  264,  235,  236,
+      532,  115,  115,  115,  254,  255,  262,  115,  115,  266,
+      413,  263,  115,  265,  115,  115,  256,  344,  115,  387,
+      580,  115,  349,  115,  211,  533,  115,  534,  532,  188,
+      974,  345,  115,  535,  211,  265,  115,  115,  266,  115,
+      203,  115,  536,  115,  115,  188,  344,  115,  115,  580,
+      267,  537,  115,  533,  115,  534,  342,  269,  115,  345,
+
+      115,  535,  115,  265,  804,  115,  803,  542,  115,  115,
+      536,  188,  115,  115,  115,  342,   93,  115,  267,  537,
+       89,  270,  271,   94,   95,  269,  115,  272,  115,  115,
+      115,  273,  274,  387,  115,  115,  542,  115,  115,  292,
+      115,  292,  547,  115,  233,  234,  233,  275,  115,  270,
+      271,  115,  235,  236,  115,  272,  115,  682,  115,  402,
+      273,  274,   89,  115,  115,  387,  115,   85,  569,  115,
+      547,  380,  211,  380,  188,  275,  115,  203, 1161,  115,
+      211,   93,  115,  276,  188,  276,  682,  402,   94,   95,
+      203,  475,  188,  568,  387,  115,  569,  572,   70,  113,
+
+      115,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  115,  203,  281,  115,  115,  115,   66,  282,  475,
+      115,  568,  280,   85,  115,  572,  544,  543,  555,  115,
+      115,  570,  562,  403,  115,  804,  278,  803,  279,  188,
+      115,  281,  115,  211,  115,  115,  115,  282,  115,  115,
+      280,  115, 1077,  115,  544,  543,  578,  555,  115,  570,
+      562,  403,  115,  284,  278,  115,  279,  115,  283,  115,
+      211,  115, 1100,  115,  115,  115,  115,  115,  115,  285,
+      115,  563,  115,  289,  288,  578,  286,  575,  115, 1161,
+      287,  284,  115,  115,  585,  115,  283,   85,  115, 1139,
+
+      115,  211,  115,  115,  115,  115,  640,  115,  285,  115,
+      563,  289,  288,  561,  286,  575,  115,  292,  287,  292,
+      115,  290,  585,  115,  115,   89,  294,  115,  294,  115,
+      203,  683,  115,  115,  640, 1161,  295,  291,  115,  387,
+      679,  561,  296,  115,  577,  564,  115, 1161,  188,  290,
+      115,  115,  466,  115,  466,  115,  115,  115,  115,  261,
+      683,  115,  115,  301,  115,  291, 1161,  571,  679,  293,
+      296,  115,  577,  564,  115,  579,  115, 1161,  115,  115,
+      115, 1161,  297,  467,  115,  115,  115,  697,  261,  697,
+     1140,  115,  301,  115,  298,  571,  299,  293,  688,  300,
+
+      115, 1161,  115,  579,  115,  115,  115,  115,  203,  115,
+      484,  297,  484,  691,  115,  303,  574,   77,  574,  115,
+      485,  115,  298,  302,  299,  115,  688,  300,  304,  115,
+      115,  115,  717,  115,  115,  203,  115,  115,  115, 1161,
+     1161,  691,  115,  303,  115,  305,  692,  115, 1161,  115,
+      306,  302,  115,  704,  115, 1161,  115,  304, 1161,  115,
+      188,  717,  115,  115,  115, 1161,  115,  115,  115,  115,
+     1161,  115,  115,  305,  692,  308,  307,  488,  306,  488,
+      115,  704,  115,  115,  115, 1161,  115,  489, 1161,  115,
+      310,  115,  115,  115,  115, 1150,  689,  115,  115,  521,
+
+      309,  521, 1161,  308,  307,  311,  752, 1161,  115,  522,
+      115,  115,  115,  239,  240,  115,  115,  115,  115,  310,
+      115,  115,   93,  115,  315,  689,  241, 1161,  309,   94,
+       95,  312,  115,  311,  752,  115,  115,  115,  559,  560,
+      559,  115,  239,  240, 1161,  115,  115,  753, 1161,  313,
+      115,  115,  314,  315,  241,  115,  318,  115, 1161,  312,
+      115,  115,  115,  115,  755,  316,  115,  556,  203,  556,
+      756,  317,  581,  211,  115,  753,  115,  313, 1161,  115,
+      314,  359,  115,  359,  115,  318,  115,  115,  319,  115,
+      320,  115,  755,  115,  316,  556,  203,  556,  756,  317,
+
+      581,  115,  115,  324,  115, 1161,  321,  322,  557,  188,
+      323,  115,  720,  115,  360,  211,  115,  319,  115,  320,
+      115,  203,  115,  705,  325,  115,  326,  211,  361,  115,
+     1161,  324,  115,  327,  321,  322,  557,  557,  323,  115,
+      115,  720,  115,  360,  387,  115,  815,  115,  815,  115,
+      759,  705,  325,  211,  115,  326,  361,  328,  687,  115,
+      115,  327,  708,  329,   93,  557,  808,  115,  115,  115,
+      703,   94,   95,   85,  115,  387,  707,  330,  759,  713,
+      265, 1161,  115,  115,  331,  328,  687,  115,  115,  706,
+      708,  697,  329,  697,  808,  332,  714,  115,  703,  851,
+
+      582, 1161,  115,  387,  707,  330,  722,  713,  265,  115,
+      115,   89,  115,  331,  115,  115, 1161,  115,  706,  335,
+      115, 1161,  333,  332,  715,  714,  334,  851,  115,  582,
+      115,  387,  115, 1161,  115,  722,  859,  115,  115, 1161,
+      336,  115, 1161,  115,  115,  337,  115,  725,  335,  115,
+      333,  115,  716,  715,  334, 1161,  115,  719,   77,  719,
+      115,  115,  115,  115,  859,   93,  115,  744,  115,  336,
+      115,  338,   94,   95,  337,  115,  725,   93,  754,  115,
+      760,  716,  115,  188,  729,  730, 1161, 1161,  115,  693,
+     1161,  693,  115,  342,  184,  351,  744,  115,  861,  694,
+
+      338,  727,  806,  635,  815,  635,  815,  754,  862,  760,
+      115,  352,  352,  352,  352,  352,  352,  352,  352,  352,
+      352,  353,  807,  810, 1161,  805,  861,  176,  387, 1161,
+      727,  806,  813,  608,  636,  608,  862,  352,  352,  352,
+      352,  352,  352,  352,  352,  352,  352,  353,  700,  827,
+      700,  807,  810,  176,  805,  804,  184,  809,  701, 1161,
+      203,  813,  702,  352,  352,  352,  352,  352,  352,  352,
+      352,  352,  352,  353,  748,  380,  211,  380,  827,  176,
+      826,  211,  826,  856,  826,  211,  826,  110,  749,  357,
+      357,  357,  357,  357,  357,  357,  357,  357,  357,  115,
+
+      820,  115,  115,  748,  115,  857,  115,  115,  381, 1161,
+      267,  757,  856,  270,  363,  188,  749,  362,  115,  272,
+      115,  364,  382,  832,   77,  832,  203,  758,  115,  820,
+      115,  115,  211,  115,  857,  115,  115,  381,  267,  115,
+      757,  270,  363, 1161,  115,  362,  115,  272,  115,  364,
+      382,  811,  702,  365,  702,  758,  115, 1161,  115,  115,
+      115,  115,  297,  368,  115,  115,  702,  860,  115,  863,
+     1161,  367,  824,  115,  298,  115,  299,  821,  115,  366,
+      811,  365,  864,  901, 1161,  115,  115, 1161,  115,  115,
+      115,  297,  368,  115,  115,  211,  860, 1161,  863,  367,
+
+     1161,  824,  298,  115,  299,  821,  115,  366, 1161, 1161,
+      864,  901,  383,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  374,  374,  211,  374,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  384,
+      374,  385,  385,  385,  385,  385,  385,  385,  385,  385,
+      385,  374,  374,  374,  374,  374,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  374,  374,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      374,  404, 1161,  404,  932,  865,  405,  405,  405,  405,
+      405,  405,  405,  405,  405,  405,  406, 1161,  406,  935,
+      899,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      407,  408,  932,  408,  865,  900,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  423,  935,  423,  899,
+     1161,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  425, 1161,  425,  900, 1161,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  427,  902,  427,  432,
+      937,  428,  428,  428,  428,  428,  428,  428,  428,  428,
+
+      428,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      257, 1161,  115,  769,  115,  769,  902,  115,  937,  115,
+      429,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  115,  433,  115,  115,  905,  908,  115,  908,  115,
+      431,  115,  115,  115,  770,  434,  115,   93,  115,  429,
+      908,  435,  908,  115,  839,  840,  115,  115,  211,  115,
+      433,  115,  115,  115,  905,  693,  115,  693,  115,  431,
+      436,  115, 1161,  434, 1161,  694,  115,  115,  115,  435,
+      115,  115,  115,  115,  115,  115,  115,  804,  439,  803,
+      437,  115, 1161, 1161,  822,  176,  115,  115,  436,  115,
+
+      438,  805,  924,  115,  115,  188,  115,  115,  115,  115,
+      115,  115,  115, 1161,  115,  115,  439, 1161,  437, 1161,
+      441,  440,  115,  822,  115,  115, 1161,  115,  438,  115,
+      805,  924,  115,  115, 1161,  115,  203,  115,  115,  115,
+      115,  115,  903, 1161,  115,  700,  115,  700,  441,  440,
+      115,  442,  115,  443,  445,  701,  444,  115,  115,  702,
+      115, 1161,  115,  115,  115,  446,   93,  115, 1161,  115,
+      115,  903,  911,   94,   95,  115, 1161,  115,  115,  442,
+      115,  443,  445,  115,  444,  115, 1161,  115,  115,  447,
+      115,   93,  115,  893,  446,  893,  448,  115,   94,   95,
+
+     1161,  911, 1161,  894,  115,  115, 1161,  115,  115,  451,
+      929,  115,  115,  115,  115,  449,  115,  447,  965,  115,
+      931,  804,  184,  809,  448,  115,  203,  115,  115,  176,
+      115,  453,  115,  115,  211,  452,  115,  115,  451,  929,
+      115,  466,  115,  466,  449,  115,  965,  115,  115,  931,
+      115,  933,  454,  115, 1161,  115,  934,  115,  115,  936,
+      453,  980,  115,  910,  452,  115, 1161,  115,  115, 1161,
+     1161,  913,  467,  115,  115,  115,  465,  115,  115,  115,
+      933,  454,  115,   93,  875,  934,  875,  115,  936,  980,
+       94,   95,  910,  115,  876,  115,  455,  115,  455,  115,
+
+      913,  959,  115,  115,  115,  465,  115,  964,  115,  239,
+      240,  115,   93,  966,  893,  115,  893,  468,  469,   94,
+       95,  115,  241, 1161,  894,  115, 1161,  456,  115,  115,
+      959,  203,  457,  115,  458,  115,  964,  459,  239,  240,
+      115,  460,  966, 1161,  461,  468,  469,  462,  463,  472,
+      241,  464,  115,  115,  115,  115,  470,  115,  115,  471,
+      115,  457,  989,  458,  991,  884,  459,  884,  115,  460,
+     1161,  115,  461, 1161,  115,  462,  463,  981,  472,  464,
+      973,  115,  115,  115,  115,  470,  115,  115,  471,  115,
+      115,  989,  474,  991,  473,  115,  115,  984,  115,  115,
+
+      986,  115,  115,  115,  896,  981,  896,  987,  973,  115,
+     1161,  115,  476,  954, 1161,  115,  115,  115,  988,  115,
+      115,  474,  473,  990,  115,  984,  477,  115,  986,  115,
+     1010,  115,  115, 1161,  115,  987,  115,  115,  115,  961,
+      476,  954,  478,  115,  115,  115,  988, 1161, 1005,  115,
+      115,  990, 1161, 1013,  477, 1161, 1161,  115,  479, 1010,
+      115,  115,  115, 1161, 1161,  115,  115,  115,  961, 1014,
+      478, 1027,  115,  998,  948,  998, 1005, 1015,  115,  203,
+      115,  480, 1013,  115,  115,  115,  479,  481,  115,  115,
+      115,  484,  483,  484,  488,  115,  488, 1014,  188, 1027,
+
+      482,  485,  115,  115,  489, 1017, 1015, 1018,  115,  480,
+     1161, 1161,  115,  115, 1035, 1021,  481,  115,  115, 1036,
+      115,  483,  203, 1028,  115,  115, 1031,  115,  482,  115,
+      115,  115,  115, 1016, 1017,  486, 1018, 1161,  490,  115,
+      492, 1032, 1035,  115, 1021,  487,  115, 1036,  491,  115,
+     1043, 1161, 1028,  115,  115, 1031,  115, 1161,  115, 1022,
+      115,  115, 1016,  486,  493,  115,  490,  115,  492, 1033,
+     1032,  115,  115,  487,  115, 1034,  491,  115, 1043,  115,
+      115,  115, 1045,  188,  495,  115,  115, 1161, 1022,  115,
+     1046,  494,  496,  493,  115, 1161, 1161,  115, 1033,  115,
+
+      115,  115,  115, 1050, 1034, 1161,  115,  115, 1161,  115,
+      115, 1045, 1049,  495,  115,  115,  115,  115, 1046,  494,
+      496,  497,  115, 1041,  948, 1041,  115,  115,  115, 1051,
+      498,  115, 1050,  115,  115, 1161,  115,  500,  115,  115,
+     1049,  499,  115,  852,  115,  852,  115, 1052, 1161,  497,
+     1161,  115,  115,  115,  115, 1161,  115, 1051,  498,  115,
+     1053, 1161,  115,  115,  115, 1061,  500,  115,  115, 1060,
+      499,  115,  501,  115,  115, 1161, 1052,  115,  925,  115,
+      115,  115,  115,  115,  115,  203, 1064,  502,  115, 1053,
+      503,  926, 1065,  115, 1061, 1161,  115, 1060,  504, 1066,
+
+      501,  115,  203,  115,  115,  211,  115,  925,  115,  115,
+      505,  115, 1161, 1161, 1064,  502, 1072, 1056,  503,  926,
+     1065,  115, 1076,  115,  115,  115,  504, 1066, 1161,  115,
+      115, 1161,  507,  115,  115, 1161,  506,  115,  115,  505,
+      508, 1057,  115, 1161,  115, 1072, 1056, 1055,  115, 1075,
+     1076,  115, 1161,  211,  115, 1079,  115,  509,  115,  115,
+      115,  507,  115,  115,  506,  115,  115,  115,  508,  115,
+     1057,  115,  115, 1078,  115, 1055,  115,  512, 1075,  115,
+      510,  115,  511, 1079,  115,  509, 1161, 1161,  115,  115,
+     1161,  115,  115, 1058,  115,  115,  115,  115,  115,  513,
+
+      115, 1161, 1078,  115, 1085,  515,  512,  115,  510,  115,
+      511,  115,  115, 1161,  115,  115,  115,  115,  115,  514,
+      115,  115, 1058,  115,  115,  516,  115, 1086,  513,  115,
+      211,  517, 1085,  515,  115, 1161,  203,  115,  115,  115,
+     1161,  115,  115,  115,  115,  115,  115,  115,  514,  115,
+      115,  211,  115,  521,  516,  521, 1086,  518, 1161,  517,
+      519,  115,  115,  522,  115,  115,  115,  115, 1070,  948,
+     1070, 1081,  115, 1161,  115, 1084, 1089, 1161,  520,  115,
+      115, 1090,  115,  203, 1083,  518,  115,  115,  519,  523,
+      115,  115,  115,  115, 1094,  115, 1161, 1096,  115,  524,
+
+     1081,  115,  115, 1084, 1089,  115,  520,  115,  115, 1097,
+     1090,  115,  115, 1083,  526,  115,  115, 1082,  523,  115,
+      115,  115,  115, 1094,  115, 1096, 1099,  115,  524,  115,
+     1161,  115,  525,  115, 1161, 1161,  115, 1097,  115,  115,
+      115, 1103,  526, 1161,  115,  115, 1082, 1111,  115,  115,
+      115, 1161,  211,  115, 1099, 1104,  527, 1107,  115,  211,
+      525,  947,  948,  947,  528, 1161,  115, 1161,  115,  949,
+     1103,  203,  950,  115,  115,  531, 1111,  539, 1161,  115,
+      947,  948,  947, 1104,  527, 1107,  115, 1023,  949, 1024,
+     1161,  950,  528,  540,  540,  540,  540,  540,  540,  540,
+
+      540,  540,  540,  541,  947,  948,  947, 1101, 1161,  176,
+     1161, 1102,  949, 1161,  188,  950, 1023, 1161, 1024,  540,
+      540,  540,  540,  540,  540,  540,  540,  540,  540,  541,
+     1000, 1001, 1000, 1161, 1161,  176, 1101,  188, 1002, 1102,
+     1161, 1003, 1092,  948, 1092,  540,  540,  540,  540,  540,
+      540,  540,  540,  540,  540,  541, 1109,  948, 1109, 1098,
+     1115,  176,  115,  115, 1161,  550,  548,  115,  115,  110,
+      115,  545,  545,  545,  545,  545,  545,  545,  545,  545,
+      545,  115,  549, 1114,  115,  115,  551, 1098, 1115, 1120,
+      115,  115,  115,  554,  550,  548,  115,  115, 1121,  115,
+
+     1161,  115, 1161, 1161,  115,  552,  115, 1161, 1161,  115,
+      549, 1114,  115, 1127,  115,  551, 1123, 1120,  482,  115,
+      115,  115, 1161,  115,  115,  553,  115, 1121,  115,  115,
+      115,  203,  115, 1161,  552,  115,  947,  948,  947, 1129,
+      115, 1127,  115,  115,  949, 1123,  482,  950,  115, 1161,
+      115,  203,  115,  115,  553,  115,  211,  115,  115, 1161,
+     1161, 1000, 1001, 1000, 1161, 1161, 1116, 1129,  115, 1002,
+      115,  115, 1003,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  211, 1161, 1000, 1001, 1000, 1117, 1118,
+     1117, 1161,  565, 1002, 1132, 1116, 1003, 1131, 1136, 1161,
+
+      566,  566,  566,  566,  566,  566,  566,  566,  566,  566,
+      211, 1161, 1042, 1001, 1042, 1117, 1118, 1117, 1142,  567,
+      949,  565, 1132,  950, 1161, 1131, 1136,  383,  383,  383,
+      383,  383,  383,  383,  383,  383,  383,  405,  405,  405,
+      405,  405,  405,  405,  405,  405,  405, 1142,  567,  405,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  407,
       407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  108,  108,  108,  108,  564,  568,  108,  197,  108,
-      108,  108,  571,  572,  570,  108, 1064,  108,  108,  108,
-      108,  108,  573,  574,  108,  108,  108,  108,  108,  108,
-      108,  590,  108,  578,  108,  197,  576,  577,  579,  108,
-
-      579,  108,  108,  108,  592,  108,  108,  108,  366,  596,
-      591,  108,  593,  108,  108,  594,  108,  677,  108,  108,
-      595,  599,  108,  108,  607,  597,  607,  108,  108,  723,
-      108,  108,  610,  108,  600,  598,  108,  724,  601,  179,
-      606,  580, 1049,  108,  108,  682,  609,  108,  108,  108,
-      108,  168,  108,  108,  608,  581,  434,  168,  434,  108,
-      108,  613,  611,  727,  108,  108,  108,  108,  614,  108,
-      108,  615, 1063,  617,  616,  108,  108,  621,  871,  728,
-      618,  108, 1061,  108,  619,  463,  435,  463,  108,  620,
-      623,  467,  108,  467,  582,  464,  583, 1056,  108,  584,
-
-     1055,  468,  622,  585,   86,  108,  586,  108,  625,  587,
-      588,  698,  699,  589,  602,  602,  602,  602,  602,  602,
-      602,  602,  602,  602,  602,  108,  602,  602,  602,  602,
-      602,  603,  602,  604,  604,  604,  604,  604,  604,  604,
-      604,  604,  602,  602,  602,  602,  602,  602,  602,  605,
-      605,  605,  605,  605,  605,  605,  605,  605,  605,  605,
-      605,  605,  605,  605,  605,  605,  605,  605,  605,  605,
-      605,  605,  605,  605,  605,  605,  602,  108,  108,  108,
-      108,  108,  108,  108,  785, 1054,  785,  108, 1051,  626,
-      627,  624,  108,  108,  108,  108,  108,  108,  108,  108,
-
-      108,  628,  108,  108,  108,  629,  630,  633,  108,  108,
-      108,  631,  108,  108,  636,  108,  108,  108,  108,  108,
-      108,  635,  632,  108,  108,  634,  108,  638,  641,  108,
-      108,  640,  637,  108,  639,  108,  108,  108,  108,  642,
-      108,  108,  108,  108,  108,  108,  108,  499,  108,  499,
-      108,  197,  644,  108,  108,  108,  179,  500,  108,  108,
-      643,  108,  108,  108,  108,  108,  108,  108,  108, 1050,
-      645,  647,  646,  648,  167,  669,  657,   82, 1045,  168,
-      108,  108,  168,  108,  701,  108,  649,  366,  648,  167,
-      103, 1044,  108,  649,  168,  648,  167,  108,  780,  667,
-
-      705,  168,  676,  668,  664,  668,  664,  571,  169,  170,
-      795,  668,  171,  668,  665,  694,  108,  108,  108,  108,
-      108,   86,  707,  169,  170,  326,  173,  171,   87,   88,
-      169,  170, 1042,  706,  171,  108,  108,  108,  108,  108,
-      326,  173,  666, 1041,  670,  108,  670,  326,  173,  649,
-      175,  655,  167,  197,  671,  108,  108,  168,  672,  696,
-      108,  193,  108,  108,  709,  108,  108,  656,  656,  656,
-      656,  656,  656,  656,  656,  656,  708,  108,  710,  108,
-      108,  108,  108,  108,  712,  108,  169,  170, 1048,  714,
-      171,  607,  785,  607,  785,  711,  108, 1040,  108,  108,
-
-      877,  108,  108,  326,  173,  197,  560,  560,  560,  560,
-      560,  560,  560,  560,  560, 1038,  108,  678,  108,  678,
-      179,  608,  679,  679,  679,  679,  679,  679,  679,  679,
-      679,  197,  560,  560,  560,  560,  560,  560,  560,  560,
-      560, 1031,  179,  794,  197,  794, 1030, 1029,  537,  537,
-      537,  537,  537,  537,  537,  537,  537,  562,  562,  562,
-      562,  562,  562,  562,  562,  562,  108, 1028, 1016,  536,
-      197,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      781,  108,  680,  108,  680,  732,  719,  681,  681,  681,
-      681,  681,  681,  681,  681,  681,  687,  687,  108,  687,
-
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  702,  687,  703,  703,  703,  703,  703,
-      703,  703,  703,  703,  687,  687,  687,  687,  687,  687,
-      687,  704,  704,  704,  704,  704,  704,  704,  704,  704,
-      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
-      704,  704,  704,  704,  704,  704,  704,  704,  687,  108,
-      108,  579,  108,  579,  108,  108,  108,  716,  108,  720,
-      715,  733,  108,  736,  739,  735,  108,  108,  731,  108,
-      734,  108,  108,  108,  108,  108,  108, 1025, 1024,  108,
-      738,  108,  740,  409,  740,  244,  193,  409,  108,  737,
-
-      108,  108,  108,  108,  717,  243,  243,  243,  243,  243,
-      243,  243,  243,  243,  108,  108,  108,  108,  718,  108,
-      108,  743,  741,  108,  108,  745,  108,  108,  744,  742,
-      108,  108,  108,  108,  748,  746,  108,  108,  789,  108,
-      108,  108,  752,  747,  108,  108,  108,  108,  753,  108,
-      750,  197,  751,  108,  108,  749,  108,  108,  108,  108,
-      755,  108,  108,  108,  108,  754,  108,  108,  756,  758,
-      757,  108,  108,  108,  108,  108,  760,  759,  108,  108,
-      763,  108,  108,  108,  108,  108,  761,  764,  108,  108,
-      108,  108,  108,  792,  108,  769,  108,  108,  762,  108,
-
-      108,  108,  108,  108, 1018,  108,  766,  768,  108,  108,
-      767,  108,  108,  108,  664,  197,  664,  108,  108,  770,
-      108,  771,  772,  773,  665,  774,  167,  168, 1017,  108,
-      108,  168,  775,  168,  774,  167,  664,  670,  664,  670,
-      168,  103,  775,  197,  774,  167,  665,  671,  108,  108,
-      168,  672,  776,  786,  879,   86,  787,  794,  197,  794,
-      169,  170,  806,  807,  171,  108,  108,  108,   86,  169,
-      170,  108,  244,  171,  776,   87,   88,  326,  173,  169,
-      170,  790,  788,  171,  108,  193,  326,  173,  108, 1015,
-      672,  108,  672,  670, 1012,  670,  326,  173,  775,  175,
-
-      779,  167,   86,  671,  672,  108,  168,  672,  108,   87,
-       88,  243,  243,  243,  243,  243,  243,  243,  243,  243,
-      812,  108,  108,  986,  811,  108,  108,  108,  108,  108,
-      816,  108,  819,  108,  819,  169,  170,  108,  108,  171,
-      813,  817,  108,  108,  108,  108,  108,  815,  108,  814,
-      108,  108,  326,  173,  197,  822,  740, 1011,  740,  819,
-      876,  819,  876,  876,  108,  876,  108,  108,  108,  820,
-      825,  679,  679,  679,  679,  679,  679,  679,  679,  679,
-      197,  839,  821,  108,  108,  965,  741,  965, 1009, 1001,
-      108,  108,  834,  108,  108,  835,  891,  679,  679,  679,
-
-      679,  679,  679,  679,  679,  679,  197,  108,  108,  892,
-      108,  841,  179,  836, 1000,  999,  108,  108,  843,  108,
-      108,  838,  837,  681,  681,  681,  681,  681,  681,  681,
-      681,  681,  197,  108,  108,  108,  850,  108,  862,   86,
-      862,  983, 1007,  984, 1007,  934,   87,   88,  863,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  791,  791,
-      197,  791,  791,  791,  791,  791,  791,  791,  791,  791,
-      791,  791,  791,  791,  791,  796,  791,  797,  797,  797,
-      797,  797,  797,  797,  797,  797,  791,  791,  791,  791,
-      791,  791,  791,  798,  798,  798,  798,  798,  798,  798,
-
-      798,  798,  798,  798,  798,  798,  798,  798,  798,  798,
-      798,  798,  798,  798,  798,  798,  798,  798,  798,  798,
-      791,  800,  800,   86,  800, 1036,  998, 1036,  800,  800,
-       87,   88,  800,  997,  996,  800,  800,  800,  800,  800,
-      800,  800,  800,  799,  799,  995,  799,  799,  799,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-      808,  799,  809,  809,  809,  809,  809,  809,  809,  809,
-      809,  799,  799,  799,  799,  799,  799,  799,  810,  810,
-      810,  810,  810,  810,  810,  810,  810,  810,  810,  810,
-      810,  810,  810,  810,  810,  810,  810,  810,  810,  810,
-
-      810,  810,  810,  810,  810,  799,  108,  108,  108,  844,
-      840,  844,  108,  108,  851,  179,  108,  848,  842,  845,
-      847,  108,  846,  108,  108,  108,  108,  992,  108,  108,
-      108,  108,  849,  108,  852,  108,  108,  853,  108,  108,
-      854,  108,  854,  108,  108,  108,  857,  108,  108, 1113,
-      108,  108,  108,  108,  860,  108,  108,  108,  108,  856,
-      108,  108,  108,  108,  108,  859,  858,  108,  108,  861,
-      864,  108,  108,  197,  108,  108,  865,  108,  865,  108,
-      108,  108,  773,  108,  775,  167,  108,  179,  108,  108,
-      855,  874,  108,  775,  991,  774,  167,  108,  108,  867,
-
-      108,  168,  775,  108,  775,  167,  108,  876,  108,  876,
-      244,  108,  865,  866,  865,  108,  888,  885,  883,  169,
-      170,  875,  884,  171,  982,  108, 1084,  108,  108,  108,
-      169,  170,  108,  108,  171,  108,  326,  173,  108,  169,
-      170,  108,  108,  171,  894,  886,  108,  326,  173,  929,
-      981, 1059,  889, 1059,  980,  108,  326,  173,  108,  108,
-      878,  878,  197,  878,  878,  878,  878,  878,  878,  878,
-      878,  878,  878,  878,  878,  878,  878,  880,  878,  881,
-      881,  881,  881,  881,  881,  881,  881,  881,  878,  878,
-      878,  878,  878,  878,  878,  882,  882,  882,  882,  882,
-
-      882,  882,  882,  882,  882,  882,  882,  882,  882,  882,
-      882,  882,  882,  882,  882,  882,  882,  882,  882,  882,
-      882,  882,  878,  197,  243,  243,  243,  243,  243,  243,
-      243,  243,  243,  108,  108,  108,  108,  887,  108,  108,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  893,
-      108,  108,  108,  896,  108,  108,  906,  905,  108,  108,
-      108,  909,  108,  108,  108,  907,  977,  911,  912,  975,
-      972,  108,  108,  108,  910,  908,  108,  108,  915,  108,
-      108,  108,  844,  913,  844,  916,  918,  108,  917,  108,
-      108,  108,  845,  108,  108,  108,  108,  920,  854,  108,
-
-      854,  108,  108,  108,  108,  108,  919,  921,  108,  926,
-      108,  108,  108,  108,  925,  108,  108,  108,  923,  108,
-      108,  924,  108,  108,  108,  862,  930,  862,  193,  108,
-      936,  197,  108,  108,  108,  863,  108,  931,  108,  940,
-      108,  108,  108,  108,  957,  928,  108,  108,  922,  108,
-      108,  937,  108,  108,  108,  108,  941,  108,  108,  942,
-      108,  938,  948,  108,  939,  197,  108,  950,  193,  108,
-      944,  108,  947,  943,  108,  108,  108,  108,  961,  956,
-      108,  959,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  108,  108,  108,  108,  108,  960,  108,  108,  958,
-
-      915,  108,  179,  108,  179, 1047,  108,  916,  108,  108,
-      917,  108,  967,  962,  108,  108,  964,  963,  108,  968,
-      108,  915,  969,  108,  108,  108,  108,  108,  916,  970,
-      108,  917,  971,  108,  108,  108,  108,  197,  108,  976,
-      973,  108,  108,  108,  108,  108,  108,  108,  108, 1065,
-      108,  974,  108,  108,  978,  108,  108, 1094,  979,  989,
-      108,  108,  108,  108,  108,  108,  985,  108,  990,  108,
-      108,  994,  955,  108,  987,  108,  988,  108,  108, 1003,
-      108,  108,  993,  108,  108,  108,  108,  108,  108, 1002,
-      197,  108,  108, 1006,  967, 1004,  108,  108,  108,  197,
-
-      108,  968,  108,  954,  969,  108,  967, 1005,  108, 1008,
-      967, 1008,  967,  968,  108,  108,  969,  916,  108,  968,
-      917,  108,  969, 1010,  108,  108,  108,  108,  108, 1013,
-     1014,  108, 1022,  108,  953,  108,  108, 1021,  108, 1019,
-     1023,  108,  108,  108,  108,  108,  108,  108,  108,  108,
-      108, 1033,  108,  108,  108, 1027,  179, 1026, 1035,  108,
-     1034, 1032,  952,  108,  108,  108,  108,  108,  108,  108,
-      951,  108, 1037,  915, 1037,  108,  108,  108,  108, 1039,
-      916,  108, 1052,  917,  108,  108,  108, 1046,  108, 1043,
-      108,  108,  108,  108,  108,  108,  193, 1057,  108, 1053,
-
-      108, 1058,  179,  108,  108,  108,  108,  108,  108, 1062,
-      108, 1060,  915, 1060,  108,  193,  108,  108, 1075,  916,
-      108,  108,  917,  108, 1072,  949, 1076, 1071, 1076, 1067,
-      108,  108,  108,  108, 1077,  915, 1077,  108,  108,  193,
-     1079,  108,  916,  179,  915,  917, 1087,  108,  108,  108,
-     1081,  916, 1083,  179,  917,  108, 1089, 1089, 1092, 1089,
-      179, 1097,  946, 1089, 1089,  108,  193, 1089,  179,  193,
-     1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1090,  915,
-     1090,  108,  193,  193,  179, 1101,  916, 1095,  193,  917,
-      915, 1111,  193, 1103, 1098, 1098, 1107, 1099,  108, 1104,
-
-      917, 1098, 1098,  108,  108, 1098,  193,  193, 1098, 1098,
-     1098, 1098, 1098, 1098, 1098, 1098,  915,  967,  193, 1109,
-      108,  108, 1112,  916,  968, 1114,  917,  969,  193, 1108,
-      384, 1110,  384,  386,  388,  386,  388, 1115,  403,  945,
-      403, 1116,  405,  366,  405, 1119,  407,  560,  407,  560,
-      197,  562, 1120,  562,  935,  179,  933, 1118,  932,  927,
-      904,  903,  902,  901,  900,  899,  898,  897,  895,  890,
-       82,   78,  366,  197,  197,  197,  873,  179,  179,  870,
-      869, 1121,   62,   62,   62,   62,   62,   62,   62,   62,
-       62,   62,   62,   62,   62,   62,   62,   62,   62,   63,
-
-       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
-       63,   63,   63,   63,   63,   63,   74,   74,  868,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   77,   77,  833,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
-       81,   81,   81,   81,   81,   81,   81,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,  104,  104,  832,  831,  830,  829,
-      104,  108,  108,  108,  108,  108,  108,  108,  108,  108,
-
-      108,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  184,  828,
-      184,  827,  184,  184,  826,  824,  823,  818,  184,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  195,  195,  195,  195,
-      195,  195,  195,  195,  195,  195,   82,  195,  195,  195,
-      195,   82,  195,  218,  218,  218,  218,  218,  218,  218,
-      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
-       94,   78,  803,   94,   94,  238,  238,  238,  238,  366,
-      238,  238,  366,  238,  238,  197,  238,  238,  783,  179,
-
-      238,  238,  328,  328,  328,  328,  328,  328,  328,  328,
-      328,  328,  328,  328,  328,  328,  328,  328,  328,  336,
-      778,  336,  777,  765,  336,  341,  730,  341,  729,  341,
-      341,  342,  342,  726,  342,  342,  342,  342,  342,  342,
-      342,  342,  342,  342,  342,  342,  342,  342,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  358,  358,  358,  358,  358,
-      358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
-      358,  358,  401,  725,  722,  401,  401,  262,  721,  262,
-      713,  700,   82,  693,  262,  689,  686,  530,  663,  662,
-
-      530,  654,  262,  517,  653,  517,  652,  651,  517,  522,
-      650,  522,  612,  522,  522,  656,  575,  656,  408,  558,
-      656,  661,  557,  661,  556,  661,  661,  687,  687,  555,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  687,  690,  690,  554,  690,  690,  690,
-      690,  690,  690,  690,  690,  690,  690,  690,  690,  690,
-      690,  692,  692,  547,  692,  692,  692,  692,  692,  692,
-      692,  692,  692,  692,  692,  692,  692,  692,  695,  695,
-      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
-      695,  695,  695,  695,  695,  697,  697,  697,  697,  697,
-
-      697,  697,  697,  697,  697,  697,  697,  697,  697,  697,
-      697,  697,  782,  782,  782,  782,  782,  782,  782,  782,
-      782,  782,  782,  782,  782,  782,  782,  782,  782,  104,
-      546,  104,  544,  104,  104,  784,  784,  543,  784,  784,
-      784,  784,  784,  784,  784,  784,  784,  784,  784,  784,
-      784,  784,  791,  791,  791,  791,  791,  791,  791,  791,
-      791,  791,  791,  791,  791,  791,  791,  791,  791,  793,
-      793,  793,  793,  793,  793,  793,  793,  793,  793,  793,
-      793,  793,  793,  793,  793,  793,  799,  799,  366,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-
-      799,  799,  799,  801,  801,  197,  801,  801,  801,  801,
-      801,  801,  801,  801,  801,  801,  801,  801,  801,  801,
-      802,  802,  197,  802,  802,  802,  802,  802,  802,  802,
-      802,  802,  802,  802,  802,  802,  802,  804,  804,  804,
-      804,  804,  804,  804,  804,  804,  804,  804,  804,  804,
-      804,  804,  804,  804,  805,  805,  805,  805,  805,  805,
-      805,  805,  805,  805,  805,  805,  805,  805,  805,  805,
-      805,  872,  872,  872,  872,  872,  872,  872,  872,  872,
-      872,  872,  872,  872,  872,  872,  872,  872,  878,  878,
-      878,  878,  878,  878,  878,  878,  878,  878,  878,  878,
-
-      878,  878,  878,  878,  878,  914,  914,  914,  914,  914,
-      914,  914,  914,  914,  914,  914,  914,  914,  914,  914,
-      914,  914,  966,  966,  966,  966,  966,  966,  966,  966,
-      966,  966,  966,  966,  966,  966,  966,  966,  966,  524,
-      523,  515,  514,  513,  512,  511,  510,  179,  333,  429,
-      410,  408,  400,  399,  398,  395,  394,  393,  392,  389,
-      375,  374,  372,  371,  366,  197,  197,  193,  179,  334,
-      332,  331,  179,  237,  236,  229,  228,   82,   82,   78,
-      213,  212,  210,  209,  193,  188, 1123,   64,   13, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123
+      407,  407,  407,  407,  407,  407,  407,  407,  407,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  424,
+
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  588,
+      211,  588, 1161, 1161,  589,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430, 1161,  115, 1161,  115, 1161,  590,
+      115,  590,  115,  429,  591,  591,  591,  591,  591,  591,
+
+      591,  591,  591,  591,  115,  592,  115,  115,  115,  593,
+      203, 1119,  115,  115,  115, 1161,  115, 1141,  188,  115,
+     1161,  115,  429, 1161,  115, 1161,  115,  115,  594,  115,
+      115, 1161,  115,  592,  115,  115,  115,  115,  593, 1119,
+     1161,  115,  115,  115, 1161, 1141,  115,  203,  595,  115,
+     1149,  115, 1161,  115,  115,  115, 1146,  594,  115,  115,
+     1161, 1161,  596, 1161,  115,  115,  188,  115,  115,  115,
+     1161,  115,  597,  115,  115,  115,  595,  115,  188, 1149,
+      115,  115, 1161,  598, 1146,  115,  203,  115,  115,  115,
+      115,  596, 1144,  115,  115,  188,  115,  115,  115,  203,
+
+      599,  597,  115,  115,  115,  115, 1161,  188,  115,  115,
+      115,  598, 1161,  600,  115,  115,  115, 1130,  115,  115,
+     1144,  115,  115,  115,  115,  601,  115,  115,  599, 1143,
+      115, 1157,  115,  602,  115,  115,  115, 1148, 1161,  115,
+      115,  115,  600,  603, 1145, 1130, 1124,  948, 1124,  115,
+      115,  115,  115, 1161,  601,  115,  115, 1143, 1151,  115,
+     1157,  602,  115, 1161,  115, 1148,  188,  115,  115,  115,
+      115,  603, 1145,  605,  115,  115,  203,  115,  606,  115,
+     1161,  115, 1161, 1161,  203,  608, 1151,  608, 1161,  115,
+     1161,  115,  607,  115, 1161, 1161,  115, 1161, 1161,  115,
+
+     1161,  605, 1147,  115,  115, 1161, 1161,  606,  115,  115,
+      115, 1153, 1154, 1153,  115,  115, 1161,  115,  115,  115,
+      607,  115, 1161,  115, 1161, 1155,  609, 1161,  619,  115,
+      620, 1147, 1161,  115, 1161, 1152, 1161,  115, 1161,  115,
+      610,  115, 1161,  115,  115,  115,  621,  115,  115, 1161,
+      115, 1161,  115, 1155,  203,  609,  619,  115,  620,  622,
+      115,  115,  115, 1152,  115,  115, 1161,  115,  610,  455,
+      115,  455, 1161, 1161,  115,  621, 1153, 1154, 1153,  115,
+     1161,  629, 1161, 1161,  115, 1161, 1161,  622,  115,  115,
+     1156,  115,  115, 1159, 1160, 1159,  115, 1159, 1160, 1159,
+
+      456,  623, 1161,  115, 1161,  611,  115,  612, 1161,  629,
+      613,  115,  203,  115,  614, 1161, 1161,  615,  115, 1156,
+      616,  617, 1161, 1161,  618,  115, 1161, 1161, 1161,  623,
+      626,  115, 1161, 1161,  611,  115,  612, 1161,  115,  613,
+      115, 1161,  614,  115, 1161,  615,  115, 1161,  616,  617,
+      624,  115,  618,  115,  115,  115, 1161,  637,  626,  115,
+      115,  627, 1161, 1158, 1161,  115,  625,  115, 1161, 1161,
+     1161, 1161,  115,  115,  115,  115,  628, 1161, 1161,  624,
+      115, 1161, 1161,  115,  115,  637, 1161, 1161,  115,  115,
+      627, 1158, 1161,  115,  625, 1161, 1161, 1161, 1161, 1161,
+
+     1161,  115,  115, 1161,  628,  630,  630,  630,  630,  630,
+      630,  630,  630,  630,  630,  630, 1161,  630,  630,  630,
+      630,  630,  631,  630,  632,  632,  632,  632,  632,  632,
+      632,  632,  632,  632,  630,  630,  630,  630,  630,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  630,  630,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  630,  115, 1161,  635,  638,  635,  115,
+
+     1161, 1161,  115,  115, 1000, 1001, 1000, 1161,  115, 1161,
+     1161,  634, 1002,  115, 1161, 1003,  115, 1161, 1161, 1161,
+     1161, 1161,  639,  115, 1161, 1161,  638,  636,  115,  115,
+      115,  115,  115, 1161,  115,  115, 1161,  115,  115,  634,
+     1161,  115, 1161,  115,  115, 1161,  641, 1161,  115,  115,
+      639, 1161, 1161, 1161, 1161, 1161, 1161,  115,  115,  115,
+      115, 1161, 1161,  115,  115,  115, 1161,  115,  115, 1161,
+     1161, 1161,  115,  115, 1161,  641,  115,  115, 1161,  115,
+      642, 1161, 1161, 1161, 1161,  115, 1161,  643, 1161,  115,
+      115, 1161, 1161, 1161,  115,  115, 1161,  115,  644,  115,
+
+     1161, 1161,  115, 1161,  115,  645, 1161,  115,  642,  115,
+     1161, 1161,  646, 1161, 1161,  643, 1161, 1161,  115,  115,
+     1161, 1000, 1001, 1000,  115, 1161, 1161,  644,  115, 1002,
+      115,  650, 1003,  115,  645,  115,  115,  115,  647,  115,
+      646,  648,  115, 1161,  115, 1161,  115,  115, 1161,  115,
+      115, 1161, 1161, 1161, 1161, 1161,  649, 1161,  115,  115,
+      650,  115, 1161, 1161,  115,  115, 1161,  647,  115,  115,
+      648,  115, 1161,  115,  115,  652,  115,  115,  115, 1161,
+      115, 1161, 1161,  651,  649, 1161,  115, 1161,  115,  115,
+     1161,  115, 1161, 1161,  115,  115,  115, 1161,  115, 1161,
+
+      115, 1161,  653,  115,  652, 1161,  654,  115, 1161,  115,
+      115,  651,  115, 1161,  115, 1161,  115, 1161,  115, 1161,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161,  115,
+      653, 1161,  115, 1161,  654,  655,  115,  115,  115,  115,
+     1161,  115,  115,  115,  115, 1161,  115,  115,  115, 1161,
+      115, 1161,  115, 1161,  115,  115,  115, 1161,  115, 1161,
+     1161,  115,  115, 1161,  655,  115,  115, 1161,  115,  659,
+      115,  115,  115,  115,  115,  115, 1161,  115, 1161,  115,
+      656, 1161,  657, 1161,  115,  115,  115,  115, 1161,  115,
+      115,  658,  115,  115, 1161,  115,  661,  659,  115,  115,
+
+      115,  115, 1161, 1161,  115, 1161,  115, 1161,  656, 1161,
+      657, 1161,  660,  115, 1161,  115,  115,  115,  115,  115,
+      658,  115,  115,  115,  115,  661, 1161,  115, 1161,  664,
+      115, 1071,  948, 1071,  115,  662, 1161,  115,  115,  949,
+      660,  115,  950,  115, 1161, 1161,  115,  115,  115,  663,
+      115, 1161,  115,  115, 1161,  115, 1161,  115, 1161, 1161,
+      115, 1161,  115,  662, 1161,  115,  115, 1161, 1161,  115,
+      115, 1161, 1161, 1161,  665,  115,  115, 1161,  663,  115,
+     1161, 1161,  115, 1161,  115, 1161,  115,  115,  115,  115,
+      115,  115, 1161,  666,  115,  115, 1161,  115, 1161, 1161,
+
+     1161,  115,  665,  668,  115, 1161,  667, 1161,  115,  115,
+     1161,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,
+      115,  666,  115,  115,  115,  115, 1161,  115,  115,  115,
+      669,  668, 1161,  115,  667, 1161,  115,  115,  670,  115,
+     1161,  115, 1161, 1161, 1161,  115, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  115, 1161,  115,  115,  115,  669,
+     1161,  115,  115, 1161,  115,  115,  115,  115, 1161,  115,
+      115, 1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161,  115, 1161,  115, 1161,  115,  115,  115, 1161,
+      115,  115,  115,  115,  115,  115, 1161, 1161, 1161,  115,
+
+      115, 1161,  671, 1161, 1161,  115, 1161,  115,  115,  115,
+     1161, 1161,  115,  672,  115,  115, 1161,  115,  115, 1161,
+      115,  115,  115,  115, 1161, 1161,  115, 1161,  115, 1161,
+      671, 1161, 1161,  115, 1161,  115, 1161,  115,  115, 1161,
+      115,  115,  672,  115,  115,  673,  115,  115,  674,  115,
+      115, 1161,  115, 1161, 1161,  115,  115, 1161, 1161, 1161,
+      115,  698, 1161,  115, 1161,  115,  115, 1161,  115, 1161,
+      115, 1161, 1161,  115,  673,  115, 1161,  674,  115,  677,
+      115,  684, 1161, 1161, 1161, 1093,  948, 1093,  115, 1161,
+      698,  115, 1161,  949, 1161,  115,  950,  685,  685,  685,
+
+      685,  685,  685,  685,  685,  685,  685,  686,  115, 1110,
+      948, 1110, 1161,  176, 1161, 1161, 1161,  949, 1161, 1161,
+      950, 1161, 1161,  685,  685,  685,  685,  685,  685,  685,
+      685,  685,  685,  686,  693, 1161,  693, 1161, 1161,  176,
+     1161, 1161, 1161, 1161,  694, 1161, 1161, 1161, 1161,  685,
+      685,  685,  685,  685,  685,  685,  685,  685,  685,  686,
+      697, 1161,  697, 1161, 1161,  176,  696,  115, 1161, 1161,
+      695,  115,  115,  110,  600,  690,  690,  690,  690,  690,
+      690,  690,  690,  690,  690,  115,  115, 1161, 1161, 1161,
+     1161, 1161, 1161,  115, 1161,  696,  115, 1161,  115,  695,
+
+      115,  115,  115,  600, 1161,  115, 1161,  115,  645,  732,
+      115, 1161,  115,  115,  115,  646, 1161, 1161,  700,  699,
+      700,  115,  115, 1161,  115, 1161, 1161,  115,  701, 1161,
+     1161,  115,  702, 1161,  115, 1161,  115,  645,  732,  115,
+      115,  211, 1161,  646, 1161, 1161, 1161,  699, 1161,  115,
+     1161,  115,  115,  709, 1161,  709,  115, 1161,  710,  710,
+      710,  710,  710,  710,  710,  710,  710,  710, 1161,  211,
+      115, 1126,  948, 1126, 1161, 1161, 1161, 1161, 1161,  949,
+      115, 1161,  950, 1161, 1161,  115,  566,  566,  566,  566,
+      566,  566,  566,  566,  566,  566,  211, 1161,  115, 1161,
+
+     1161,  947,  948,  947, 1161,  565, 1161, 1161,  711,  949,
+      711, 1161,  950,  712,  712,  712,  712,  712,  712,  712,
+      712,  712,  712,  589,  589,  589,  589,  589,  589,  589,
+      589,  589,  589, 1161,  565,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  589,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  733, 1161, 1161,  115, 1161,
+      115, 1161, 1161,  115,  947,  948,  947, 1161, 1000, 1001,
+     1000, 1161,  949,  737,  115,  950, 1002,  115, 1161, 1003,
+     1161, 1161, 1161, 1161,  733, 1161, 1161,  115, 1161,  115,
+
+     1161, 1161,  115, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,  737,  115,  718,  718,  115,  718,  718,  718,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+      734,  718,  735,  735,  735,  735,  735,  735,  735,  735,
+      735,  735,  718,  718,  718,  718,  718,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  718,  718,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+
+      736,  718,  115,  115,  738,  115,  115,  115,  115,  115,
+      115,  115, 1161,  740,  115, 1161, 1161, 1161,  739,  741,
+     1161,  115,  115, 1161,  115,  115, 1161, 1161,  115, 1161,
+     1161,  115,  115,  738,  115,  115,  115,  115,  115,  115,
+      115, 1161,  740,  115, 1161, 1161,  739,  741, 1161,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161,  115,
+      115,  115,  115, 1161, 1161,  745,  115, 1161, 1161,  742,
+     1161, 1161, 1161,  115,  115,  743,  115, 1161, 1161, 1161,
+      115, 1161, 1161,  115,  115, 1161,  115,  115,  115,  115,
+      115,  115,  115, 1161,  745,  115, 1161,  742,  746, 1161,
+
+     1161,  115,  115,  743,  115, 1161,  115, 1161,  115,  115,
+      115, 1161, 1161,  115,  750,  115,  115,  747,  115, 1161,
+      751,  115, 1161, 1161, 1161, 1161,  746, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+      115,  115,  115,  750,  115, 1161,  747,  115, 1161,  751,
+     1161, 1161, 1161, 1161,  115,  115,  115,  115,  115, 1161,
+      115, 1161, 1161,  115,  115,  115, 1161, 1161, 1161,  115,
+      115,  761, 1161, 1161,  115,  115, 1161,  115,  762,  115,
+      115, 1161,  115,  115, 1161, 1161, 1161,  115,  763, 1161,
+     1161,  115,  115,  115,  115, 1161,  115, 1161, 1161,  761,
+
+     1161, 1161,  764,  115,  115,  115, 1161,  762,  115,  115,
+      115, 1161,  115,  765,  115, 1161,  763,  115,  768,  115,
+      115,  115,  115,  115, 1161,  115, 1161, 1161, 1161,  766,
+      764,  115, 1161,  115, 1161,  115, 1161,  115,  115,  767,
+      115,  115,  765,  115, 1161, 1161,  115,  768,  115, 1161,
+     1161, 1161,  115,  769,  115,  769, 1161,  766, 1161,  115,
+     1161,  115, 1161,  258,  115,  115, 1161, 1161,  767,  115,
+      257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      115, 1161,  115,  115,  770,  115,  115,  115,  115,  115,
+     1161,  115,  115, 1161,  115, 1161, 1161, 1161, 1161,  115,
+
+      771, 1161,  115, 1161, 1161,  115,  115, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115,  115,  115,  115,
+      115,  115, 1161,  115,  115, 1161, 1161,  115,  771, 1161,
+      115, 1161, 1161,  115,  115,  115,  115, 1161,  772,  115,
+      115,  774,  115,  773,  115,  775,  115,  115,  115, 1161,
+     1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115, 1161,
+     1161,  115,  115, 1161,  115,  115,  772,  115,  115,  115,
+      774,  115,  773,  115,  775,  115,  115, 1161, 1161,  776,
+      115,  115,  115,  115, 1161,  115,  115,  777,  115,  115,
+      115,  115,  115,  115,  780, 1161,  115,  115, 1161,  115,
+
+     1161, 1161,  115, 1161,  778,  779, 1161,  776, 1161,  115,
+     1161,  115,  115,  115,  115, 1161,  777,  115, 1161,  115,
+     1161,  115, 1161,  780, 1161, 1161,  115, 1161,  115,  115,
+      115,  781,  778,  779,  115,  115, 1161, 1161, 1161,  115,
+      115,  115, 1161, 1161, 1161, 1161,  782, 1161,  115, 1161,
+     1161, 1161, 1161, 1161,  115, 1161, 1161, 1161,  115, 1161,
+      781,  115, 1161,  115,  115,  115,  115,  783, 1161,  115,
+      115, 1161,  784,  115,  782, 1161,  115,  785,  115, 1161,
+      115, 1161,  115, 1161,  115, 1161, 1161, 1161, 1161, 1161,
+      115, 1161,  115, 1161,  115,  115,  783, 1161,  115,  115,
+
+      784, 1161,  115,  787, 1161,  115,  785,  115,  115,  115,
+      115, 1161,  115,  786,  115, 1161, 1161,  115, 1161, 1161,
+      115, 1161,  788, 1161,  115,  115, 1161,  115,  115,  789,
+      115, 1161,  787, 1161,  115, 1161,  115, 1161,  115,  115,
+     1161,  115,  786,  115,  115,  115, 1161, 1161,  115, 1161,
+      788, 1161,  115,  115,  115,  115,  115,  115,  789,  115,
+     1161,  790,  115, 1161, 1161,  115, 1161,  115,  115,  792,
+      115, 1161,  115,  115,  115, 1161,  115,  115, 1161, 1161,
+     1161, 1161,  115,  115, 1161, 1161,  115,  791,  115, 1161,
+      790,  115, 1161, 1161,  115,  115,  793,  115,  792,  115,
+
+      115,  115,  115,  115,  115,  115,  115, 1161, 1161, 1161,
+     1161, 1161, 1161,  115, 1161,  791,  115, 1161,  795,  115,
+      796, 1161, 1161,  115, 1161,  793,  115, 1161,  115,  115,
+      115,  115, 1161, 1161,  115,  115, 1161,  115, 1161,  797,
+      798,  115,  115, 1161, 1161,  115,  795,  115,  796,  115,
+     1161, 1161, 1161,  115,  115,  115,  115,  115,  115, 1161,
+      115, 1161,  115, 1161, 1161, 1161,  115,  797,  799,  798,
+     1161,  115,  801,  115,  115, 1161,  115,  800,  115,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161, 1161,
+     1161,  115, 1161,  115, 1161, 1161,  799, 1161, 1161,  115,
+
+      801, 1161, 1161,  115,  115,  800, 1161, 1161,  115,  115,
+     1161, 1161,  176, 1161,  115, 1161, 1161, 1161,  176,  115,
+     1161,  115, 1161,  816,  115, 1161,  110,  115,  111,  111,
+      111,  111,  111,  111,  111,  111,  111,  111,  115,  115,
+      115,  115, 1161, 1161,  115,  115,  819,  817,  115, 1161,
+     1161,  818,  816,  115, 1161, 1161, 1161, 1161,  115,  115,
+      115, 1161, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,
+      115, 1161,  211,  115,  115,  819,  817, 1161, 1161,  818,
+     1161, 1161,  211, 1161, 1161, 1161,  115,  115,  115,  710,
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
+
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  211,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,  211,
+     1161, 1161, 1161, 1161, 1161, 1161,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  823,  823,  211,  823,
+      823,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+      823,  823,  823,  828,  823,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  823,  823,  823,  823,  823,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+
+      830,  830,  830,  830,  830,  830,  823,  823,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  823,  832,   77,  832, 1161, 1161,
+      833,  833, 1161,  833, 1161, 1161, 1161,  833,  833, 1161,
+     1161,  833, 1161, 1161,  833,  833,  833,  833,  833,  833,
+      833,  833,  833,  831,  831, 1161,  831,  831,  831,  831,
+      831,  831,  831,  831,  831,  831,  831,  831,  831,  831,
+      841,  831,  842,  842,  842,  842,  842,  842,  842,  842,
+      842,  842,  831,  831,  831,  831,  831,  843,  843,  843,
+
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  831,  831,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  831,  115, 1161, 1161,  258, 1161,  115,  257,  257,
+      257,  257,  257,  257,  257,  257,  257,  257,  115,  845,
+     1161,  844,  115,  115,  115,  115, 1161,  115, 1161, 1161,
+      115,  115, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+     1161,  115, 1161, 1161,  846,  115, 1161,  115,  845,  844,
+
+      115,  115,  115,  115,  115, 1161,  115,  115, 1161,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+     1161, 1161,  846,  115,  115, 1161,  115, 1161, 1161,  115,
+      847, 1161, 1161, 1161, 1161, 1161,  115,  115,  848, 1161,
+     1161,  115,  115,  115, 1161,  849, 1161,  115,  115, 1161,
+      115,  115,  115, 1161,  115,  115,  115, 1161,  847,  850,
+     1161,  852,  115,  852, 1161,  115,  848, 1161, 1161,  115,
+      115, 1161,  115,  115,  849, 1161, 1161,  115,  115,  115,
+      115, 1161,  115, 1161,  115,  115,  855,  115,  850, 1161,
+      115, 1161,  115, 1161,  115, 1161,  853,  115,  115,  115,
+
+     1161,  115,  115, 1161, 1161, 1161, 1161,  115, 1161,  854,
+     1161,  115, 1161,  115,  115,  855,  115, 1161,  858,  115,
+      115, 1161, 1161,  115, 1161,  853,  115, 1161,  115,  115,
+     1161,  115, 1161,  115,  115, 1161,  866,  854, 1161,  115,
+     1161,  115, 1161,  115, 1161,  115,  867,  858,  115, 1161,
+     1161,  115, 1161,  115, 1161,  115,  115,  868, 1161, 1161,
+      115,  115, 1161,  115, 1161,  866, 1161, 1161,  115, 1161,
+      115,  115,  115,  115,  867,  869,  115,  115,  115, 1161,
+      115,  115,  871,  115, 1161,  115,  868, 1161, 1161,  870,
+      115,  115, 1161, 1161,  874, 1161, 1161,  115,  115,  115,
+
+      115,  115, 1161,  115,  869,  115,  115,  115,  115, 1161,
+      115,  871,  115,  115,  875,  115,  875,  870,  115,  115,
+      872,  873,  115,  874,  876,  115,  115, 1161,  115,  115,
+     1161,  115,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      877,  115, 1161, 1161,  115,  115,  115,  115,  872,  873,
+      115,  115,  115, 1161,  878,  115, 1161,  115,  115, 1161,
+      115, 1161,  879,  115, 1161,  115,  115,  115,  877,  115,
+     1161,  880,  115,  115,  115,  115,  115,  115, 1161, 1161,
+      115,  115, 1161,  878, 1161, 1161,  115,  115,  115, 1161,
+      115,  879,  115,  115,  115,  115,  115, 1161,  115,  115,
+
+      880,  115, 1161,  115,  115,  115, 1161,  881, 1161,  115,
+      115, 1161, 1161, 1161,  115,  115,  115,  882,  115,  115,
+     1161,  883,  115, 1161,  115, 1161, 1161,  115,  115,  115,
+     1161,  115, 1161,  115, 1161,  881,  115,  115, 1161,  115,
+     1161,  115,  115,  115,  115,  882,  115,  115,  115,  883,
+      115,  115, 1161,  884, 1161,  884,  115,  115, 1161, 1161,
+      115,  115,  115,  115, 1161,  115, 1161, 1161,  115,  115,
+     1161,  115,  115, 1161,  115, 1161,  115,  115,  115,  115,
+     1161,  886,  115,  888, 1161, 1161,  115, 1161,  115,  115,
+      115,  115,  115,  115,  115, 1161, 1161,  115,  887,  115,
+
+     1161,  885,  115,  115, 1161,  115, 1161, 1161,  115,  886,
+      115, 1161,  888,  889, 1161,  115, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  115, 1161,  887,  115,  115,  885,
+      115,  891,  115,  115, 1161, 1161,  890, 1161,  115,  115,
+     1161,  889, 1161, 1161,  115, 1161,  115, 1161,  115, 1161,
+     1161,  892, 1161,  115, 1161, 1161,  115, 1161,  115, 1161,
+      891,  115,  115, 1161,  890, 1161,  115,  115,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1161,  895,  892,
+     1161,  115,  115, 1161, 1161, 1161,  115,  115, 1161,  115,
+      115,  115, 1161,  115, 1161,  896,  115,  896,  115,  115,
+
+      115,  115, 1161, 1161,  115,  115, 1161,  895, 1161,  115,
+     1161,  115,  115, 1161, 1161, 1161,  115,  115,  115,  115,
+      115, 1161,  115, 1161,  115,  115,  115,  115,  115,  115,
+      897,  906, 1161,  115, 1161, 1161, 1161, 1161,  898,  115,
+      115, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,  115,
+     1161,  115, 1161,  115,  115,  115,  115,  115, 1161,  897,
+      906, 1161,  115, 1161,  907, 1161,  898,  115, 1161,  908,
+      115,  908, 1161,  115,  258,  115,  802,   77,  804,  175,
+      115, 1161, 1161, 1161, 1161,  115, 1161, 1161, 1161, 1161,
+      909,  115,  907, 1161, 1161,  115,  115, 1161,  115, 1161,
+
+     1161, 1161,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      115,  177,  178, 1161, 1161,  179, 1161,  180, 1161,  909,
+      115,  115, 1161, 1161,  115,  115, 1161, 1161,  341,  182,
+     1161,  115, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+      177,  178, 1161, 1161,  179, 1161,  180, 1161, 1161,  115,
+     1161, 1161, 1161, 1161, 1161, 1161,  341,  182,  912,  912,
+      211,  912,  912,  912,  912,  912,  912,  912,  912,  912,
+      912,  912,  912,  912,  912,  914,  912,  915,  915,  915,
+      915,  915,  915,  915,  915,  915,  915,  912,  912,  912,
+      912,  912,  916,  916,  916,  916,  916,  916,  916,  916,
+
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  916,  916,  912,  912,
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  912,  211,  257,  257,
+      257,  257,  257,  257,  257,  257,  257,  257, 1161, 1161,
+     1161, 1161, 1161, 1161,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  383,  374,  374,  211,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      374,  384,  374,  385,  385,  385,  385,  385,  385,  385,
+
+      385,  385,  385,  374,  374,  374,  374,  374,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  374,  374,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  374,  115, 1161,  917, 1161,  115,  115,  918,
+      115,  115,  115,  919,  115, 1161,  115, 1161,  920,  115,
+     1161, 1161,  115, 1161,  115, 1161,  115, 1161, 1161, 1161,
+      115, 1161,  115,  115,  917, 1161,  115,  115,  918,  115,
+
+      115,  115,  919,  115,  922,  115, 1161,  920,  115,  115,
+      115,  115,  115, 1161,  115,  921,  115, 1161,  115, 1161,
+      115,  115, 1161,  115, 1161,  115, 1161,  115, 1161, 1161,
+      115,  115,  115,  922,  923, 1161,  115, 1161,  115,  115,
+      115,  927, 1161, 1161,  921,  115,  115, 1161,  928,  115,
+      115,  115,  115, 1161,  115, 1161,  115,  115,  115, 1161,
+      115,  115,  923,  115, 1161,  115, 1161,  115,  115,  927,
+     1161,  115,  115, 1161,  115, 1161,  928,  115,  115, 1161,
+      930,  115,  115,  115, 1161, 1161,  115, 1161,  115, 1161,
+     1161,  938,  115, 1161,  939, 1161, 1161,  115, 1161,  115,
+
+     1161,  115,  115, 1161,  115, 1161,  115, 1161,  930,  115,
+      115, 1161,  115,  115, 1161,  941, 1161,  115,  115,  938,
+     1161,  940,  939,  115, 1161, 1161, 1161, 1161, 1161,  115,
+      115, 1161,  115,  115,  115,  115, 1161, 1161,  115, 1161,
+      115, 1161,  115,  942,  941, 1161, 1161,  115,  115,  940,
+     1161,  115, 1161, 1161,  115, 1161, 1161, 1161,  115, 1161,
+      115,  115, 1161,  115,  115,  943,  115, 1161,  115,  115,
+      115,  942,  944,  115, 1161,  115,  115, 1161, 1161, 1161,
+      115,  945,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  943,  115,  115,  115,  115,  115,
+
+     1161,  944,  115, 1161,  115, 1161,  951, 1161,  115,  945,
+      952, 1161,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115, 1161, 1161,  115, 1161,  115, 1161, 1161,
+     1161, 1161,  115,  115,  951,  115,  115, 1161,  952, 1161,
+      115,  115,  115,  115,  953,  115, 1161,  115,  115, 1161,
+      115, 1161,  115,  115, 1161,  115, 1161,  115,  115,  115,
+      115,  115, 1161,  115,  115,  115, 1161, 1161, 1161, 1161,
+      115,  115,  956,  953, 1161, 1161,  955, 1161,  115,  115,
+     1161,  115,  115,  115,  115, 1161,  115,  115,  115, 1161,
+      115,  115, 1161,  115, 1161,  115,  115, 1161,  115,  115,
+
+      956,  957,  115, 1161,  955, 1161,  115,  115,  115,  115,
+      115,  115, 1161,  115, 1161,  958,  115, 1161, 1161,  115,
+      115,  115,  115,  962,  115,  115,  115,  115,  115,  957,
+      115,  115, 1161, 1161,  115, 1161,  115,  115,  115,  115,
+      115,  115,  115,  969,  958,  115, 1161, 1161,  115,  115,
+     1161,  115,  962,  115, 1161,  960,  115,  115,  115,  115,
+     1161, 1161,  115,  115,  115, 1161,  115,  963,  115,  115,
+      115,  115,  969, 1161, 1161, 1161, 1161,  115,  115, 1161,
+     1161,  115, 1161,  960,  970,  115, 1161, 1161,  115,  115,
+      115,  971, 1161,  115,  115,  115,  963, 1161, 1161, 1161,
+
+      115, 1161, 1161, 1161, 1161, 1161,  115,  211,  115, 1161,
+     1161, 1161,  970,  115, 1161, 1161,  115,  975,  115, 1161,
+      971,  115, 1161,  115,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  383, 1161,  115,  115,  115, 1161,  115,
+     1161, 1161,  115,  976,  115,  115,  975, 1161,  115, 1161,
+      115, 1161, 1161,  115, 1161, 1161,  115, 1161,  115, 1161,
+     1161, 1161, 1161,  115, 1161,  977,  115,  115,  115,  115,
+      115,  115,  976,  115,  115,  115, 1161,  115,  115, 1161,
+     1161, 1161,  115,  115,  115, 1161,  115, 1161,  115,  978,
+     1161,  979, 1161,  977, 1161,  115, 1161,  115,  115,  115,
+
+     1161,  115, 1161,  115,  115,  115,  115,  115, 1161,  983,
+      115, 1161,  115,  982, 1161, 1161,  115,  978, 1161,  979,
+      115,  115, 1161, 1161,  115,  115,  115,  115,  994,  992,
+      115,  985,  115,  115,  115,  115, 1161, 1161,  983,  115,
+      115,  982, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+      115, 1161,  115, 1161, 1161,  115,  115,  994,  992,  115,
+      985,  115,  115,  993,  115,  115,  115, 1161,  115, 1161,
+      115,  115, 1161, 1161,  115,  115, 1161, 1161,  115, 1161,
+     1161, 1161,  115, 1161,  995,  115,  996,  115,  115, 1161,
+     1161,  115,  993,  115,  115,  115,  115, 1161, 1161,  115,
+
+      115,  115,  115, 1161,  997, 1161,  115,  115, 1161, 1161,
+      115,  115,  995,  115,  996, 1161,  115, 1161,  115, 1161,
+      115,  115,  115,  115, 1161,  115, 1161,  115, 1161,  115,
+     1161,  115,  997, 1161, 1161, 1161,  115,  115,  115,  115,
+     1161,  115, 1161,  115,  115, 1004, 1161,  115,  115,  115,
+     1161,  115,  115, 1006, 1161, 1161,  115, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+      115,  115,  115,  115, 1004,  115, 1161,  115,  115, 1161,
+     1161, 1006, 1161, 1161, 1161,  115,  115, 1007,  115,  115,
+      115, 1161,  115,  115, 1161,  115, 1009,  115, 1161,  115,
+
+      115, 1161, 1161,  115,  115, 1161,  115, 1161,  115,  115,
+     1161,  115, 1161,  115,  115, 1007, 1012,  115, 1161, 1161,
+     1161,  115,  115, 1161, 1161, 1009,  115, 1011,  115,  115,
+     1161, 1161,  115, 1161,  115,  115, 1161,  115,  115,  115,
+      115,  115, 1161,  115, 1012, 1020,  115, 1161,  115, 1019,
+      115, 1161,  115, 1161,  115, 1011,  115,  115,  115, 1161,
+      115,  115, 1161,  115,  115, 1161,  115, 1161,  115,  115,
+      115,  115, 1025,  115, 1020,  115,  115, 1019, 1161, 1161,
+      115,  115,  115, 1161,  115, 1161,  115,  115,  115,  115,
+      115, 1161, 1161,  115, 1161,  115, 1161,  115,  115,  115,
+
+     1025,  115,  115,  115,  115, 1026,  115, 1161,  115,  115,
+     1161, 1161,  115,  115, 1161,  115, 1161, 1161,  115, 1029,
+      115, 1161,  115,  115,  115, 1161, 1030,  115, 1161,  115,
+      115,  115, 1161,  115, 1026,  115, 1161, 1161,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1029,  115,  115,
+      115,  115, 1161,  115, 1161, 1030, 1038, 1161,  115, 1037,
+      115,  115, 1161,  115,  115, 1161,  115,  115, 1161, 1161,
+      115,  115,  115,  115,  115,  115, 1161, 1161,  115,  115,
+      115, 1161, 1161, 1161, 1038, 1161, 1039, 1037,  115, 1161,
+      115,  115,  115,  115, 1161,  115,  115,  115,  115, 1040,
+
+      115,  115,  115, 1161,  115,  115, 1044, 1161,  115,  115,
+     1161, 1161,  115, 1161, 1039, 1161,  115, 1161, 1161,  115,
+      115, 1161,  115,  115, 1161,  115,  115,  115, 1040,  115,
+     1161,  115, 1161,  115,  115, 1044, 1161,  115,  115,  115,
+      115, 1047,  115, 1161,  115, 1161, 1161,  115, 1161,  115,
+     1161,  115, 1161,  115,  115, 1161,  115, 1048,  115, 1161,
+      115, 1161, 1161, 1161,  115,  115,  115,  115, 1161,  115,
+     1047,  115,  115, 1161, 1161, 1054,  115, 1161, 1161,  115,
+     1059,  115,  115,  115,  115,  115, 1048,  115, 1161,  115,
+      115, 1161, 1161,  115,  115,  115, 1161,  115,  115, 1161,
+
+      115, 1161,  115, 1054,  115,  115, 1161,  115, 1062, 1059,
+      115,  115, 1161, 1161,  115, 1161,  115, 1161, 1161,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1063,  115,
+     1161,  115,  115, 1161, 1161, 1067, 1062, 1161, 1161,  115,
+     1161,  115, 1161,  115,  115, 1161, 1161,  115, 1161,  115,
+     1161,  115,  115,  115,  115, 1068,  115, 1063,  115,  115,
+     1161, 1161, 1161, 1067,  115, 1161,  115,  115,  115,  115,
+      115,  115, 1069,  115, 1073,  115,  115, 1161,  115, 1161,
+     1161,  115, 1161, 1161, 1068, 1161, 1161,  115,  115,  115,
+      115,  115, 1161,  115,  115,  115,  115,  115, 1161,  115,
+
+     1161, 1069,  115, 1073,  115, 1161,  115,  115, 1161,  115,
+     1080, 1161,  115, 1161, 1161,  115,  115,  115, 1161,  115,
+      115,  115, 1161,  115,  115,  115,  115, 1087,  115, 1161,
+     1161, 1161, 1161, 1161, 1088,  115,  115,  115, 1080,  115,
+     1161,  115,  115, 1161,  115,  115,  115, 1161,  115, 1161,
+      115,  115,  115,  115,  115, 1161, 1087,  115,  115, 1091,
+     1161, 1161, 1088,  115, 1161,  115, 1161,  115,  115,  115,
+      115,  115, 1095,  115,  115,  115,  115,  115, 1161, 1161,
+      115, 1161,  115, 1161, 1161, 1161,  115, 1091,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1161,  115,  115,
+
+      115, 1095, 1106,  115, 1161,  115, 1161, 1161, 1161, 1161,
+      115, 1161, 1161,  115, 1105, 1161,  115,  115,  115, 1161,
+      115, 1108,  115,  115,  115,  115, 1161, 1161,  115,  115,
+     1161, 1106, 1161, 1161, 1161, 1161,  115, 1161,  115, 1161,
+      115,  115, 1105,  115, 1112,  115,  115,  115, 1161,  115,
+     1108,  115,  115,  115,  115, 1161, 1161, 1161,  115,  115,
+     1161, 1122, 1161, 1161,  115, 1161,  115, 1161,  115,  115,
+     1161,  115, 1112, 1161,  115, 1161,  115, 1161,  115, 1161,
+     1161,  115, 1161,  115, 1161, 1161, 1161,  115, 1161, 1122,
+     1161, 1161, 1161, 1161,  115, 1161,  115, 1124,  948, 1124,
+
+     1161, 1161, 1125, 1125, 1161, 1125, 1161, 1161, 1161, 1125,
+     1125, 1161, 1161, 1125, 1161, 1161, 1125, 1125, 1125, 1125,
+     1125, 1125, 1125, 1125, 1125,  115,  115, 1161, 1161, 1161,
+      115,  115, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1133,
+     1161, 1161, 1128, 1161,  115,  115, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161, 1161, 1161, 1161, 1161, 1161, 1133, 1161, 1161,
+     1128, 1161,  115,  115,  947,  948,  947, 1161, 1161, 1134,
+     1134, 1161, 1135, 1161,  115,  950, 1134, 1134, 1137,  115,
+     1134, 1161, 1161, 1134, 1134, 1134, 1134, 1134, 1134, 1134,
+
+     1134, 1134, 1161,  115,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161, 1161,  115, 1161, 1161, 1161, 1137,  115, 1161,
+     1161, 1161, 1161,  115,  115, 1161, 1161, 1161, 1161, 1161,
+     1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115,  115,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,  115,  115,   64,   64,   64,   64,   64,   64,   64,
+       64,   64,   64,   64,   64,   65,   65,   65,   65,   65,
+       65,   65,   65,   65,   65,   65,   65,   81,   81, 1161,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   84,
+       84, 1161,   84,   84,   84,   84,   84,   84,   84,   84,
+
+       84,   88,   88,   88,   88,   88,   88,   88,   88,   88,
+       88,   88,   88,   92,   92,   92,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,  111,  111,  115,  115,  115,
+      115,  115,  115,  115,  115,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  209,
+      209,  209,  209,  209,  209, 1161,  209,  209,  209, 1161,
+      209,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  101, 1161, 1161,  101,  252,  252,  252,
+     1161, 1161,  252, 1161,  252,  252, 1161,  252,  252,  343,
+
+      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
+      343,  358,  358, 1161,  358,  358,  358,  358,  358,  358,
+      358,  358,  358,  371,  371,  371,  371,  371,  371, 1161,
+      371,  371,  371, 1161,  371,  374,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  379,  379,  379,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  422,
+     1161, 1161,  422,  276, 1161, 1161, 1161,  276, 1161, 1161,
+     1161, 1161, 1161,  276,  558,  558,  558,  558,  558,  558,
+      558,  558,  558,  558,  558,  558,  718,  718, 1161,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  721,  721,
+
+     1161,  721,  721,  721,  721,  721,  721,  721,  721,  721,
+      723,  723, 1161,  723,  723,  723,  723,  723,  723,  723,
+      723,  723,   88,   88,   88,   88,   88,   88,   88,   88,
+       88,   88,   88,   88,  726,  726,  726,  726,  726,  726,
+      726,  726,  726,  726,  726,  726,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,   92,   92,   92,  728,  728,
+      728,  728,  728,  728,  728,  728,  728,  728,  728,  728,
+      812,  812,  812,  812,  812,  812,  812,  812,  812,  812,
+      812,  812,  814,  814, 1161,  814,  814,  814,  814,  814,
+      814,  814,  814,  814,  823,  823,  823,  823,  823,  823,
+
+      823,  823,  823,  823,  823,  823,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  831,  831,
+     1161,  831,  831,  831,  831,  831,  831,  831,  831,  831,
+      834,  834, 1161,  834,  834,  834,  834,  834,  834,  834,
+      834,  834,   81,   81, 1161,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,  835,  835, 1161,  835,  835,  835,
+      835,  835,  835,  835,  835,  835,   84,   84, 1161,   84,
+       84,   84,   84,   84,   84,   84,   84,   84,  837,  837,
+      837,  837,  837,  837,  837,  837,  837,  837,  837,  837,
+       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
+
+       88,   88,  838,  838,  838,  838,  838,  838,  838,  838,
+      838,  838,  838,  838,   92,   92,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,   92,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  904,  904,
+      904,  904,  904,  904,  904,  904,  904,  904,  904,  904,
+      358,  358, 1161,  358,  358,  358,  358,  358,  358,  358,
+      358,  358,  814,  814, 1161,  814,  814,  814,  814,  814,
+      814,  814,  814,  814,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  912,  912,  912,  912,
+      912,  912,  912,  912,  912,  912,  912,  912,  374,  374,
+
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
+      379,  379,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  946,  946,  946,  946,  946,  946,
+      946,  946,  946,  946,  946,  946,  999,  999,  999,  999,
+      999,  999,  999,  999,  999,  999,  999,  999,   13, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161
     } ;
 
-static yyconst short int yy_chk[4253] =
+static yyconst flex_int16_t yy_chk[9249] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -10834,470 +8655,1022 @@
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    2,    2,    2,    2,    8,   10,    8,
-       15,   16,   15,   16,   22,   17,   14,   17,   18,   25,
-       19,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-       14,   20,   18,   10,   21,   23,   24,   26,   29,   28,
-
-        2,    2,   23,   23,    2,   20,   30,   25,   21,   31,
-       15,   26,   33,   22,  986,   17,   19,    2,    2,   24,
-       30,   25,   29,   31,   15,  172,   33,   22,   28,   17,
-       19,   32,  172,   24,   23,   53,   29,   53,   80,   70,
-       32,   70,   28,   40,   36,   36,   36,   40,   23,   27,
-       40,   27,   79,   40,   32,   36,   57,   40,   84,   40,
-       65,  986,   36,   36,   71,   65,   71,   27,   27,   27,
-       27,   27,   27,   27,   27,   27,   72,   41,   72, 1121,
-       73,   41,   73,   79,   27,   57,   80,   41,   27,   27,
-       27,   41,   42,   42,   83,   27,   42,   27,   27,   57,
-
-       42,   42,   42,   27,  207,  118,   42,   27,   34,   84,
-       34,   34,   34,   34,   34,   34,   34,   34,   34,   37,
-       37,   37,  118,   94,   94,   43,   37,  180,   83,   43,
-       37,  119,   34,   37,   85,   43,   94,   37,   37,   43,
-      207,   85,   85,   37,   97,  119,   34,   35,  119,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   98,   97,
-       48,  180,   38,   38,   48,   38,   99,   35,   35,   38,
-       48,   35,   38,   98,   48,   38,   99,   35,  117,   38,
-       38,   39,   39, 1115,   35,   35,   44,  208,  205,  117,
-       44,   39,  234,   39,   44,  117,   39,   39,   39,   39,
-
-       44,   45,   46,   39,   44,   45,   46,  205,  208,   45,
-       61,   46,   46,   46,   61,   45,   46,   47,   46,   45,
-       61,   47,   49,   55,   61,   47,   49,  234,   55,  181,
-       49,   47,   50,  158,   47,   47,   49,   47,   49,   50,
-       49,   49,   49,   50,   51,  194,   50,  158,  122,   50,
-       59,   51,  169,   56,   59,   51,   50,   59,   51,   56,
-       59,   51,   55,  181,   59,  122,  169,   56,   51,   52,
-     1152,   52,   52,   60, 1152,  104,   55,   52,   87,  194,
-       60,   66,   66,   66,   60,   87,   87,   60, 1100,  229,
-       60,   56,  168,   66,   86,   86,   86,   60,  168,  104,
-
-      217,  129,   86,   86,   89,   56,   52,   52,   90,   52,
-       52,   89,   89,  104,  126,   90,   90,  116,  129,  116,
-      121,   66,  121,   52,   52,   54,   54,   54,   54,  229,
-      177,  126,  126,   54,  116,   66,  177,  121,   89,  127,
-      120,  540,  127,   54,   54,   54,   54,   54,   54,   54,
-       54,   54,  120,  120,  217, 1096,  127,  120,  120,   90,
-      133,  137,   54,   54,  540,   54,   54,  106,  106,  106,
-      106,  106,  106,  106,  106,  106,  137,  133,  137,   54,
-       54,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   93,  182,   93,  108,  108,  107,
-      109,  108,  214,  123,  109,  109,  377,  108,  109,  338,
-      125,  108,  108,  378,  109,  123,  200, 1093,  109,  109,
-      123,  125,  107,  107,  111,  111,  107,  125,  111,   93,
-      128,  132,  107,   93,  111,   93,  107,  107,  111,  111,
-       93,  377,   93,   93,  214,  132,  182,  128,  132,  338,
-
-      128,  134,   93,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  110,  110,  134,  378,  110,  200,  134,  216,
-      152,  152,  110,  103,  103,  110,  110,  110,  112,  112,
-      113,  113,  112,  131,  113,  183,  103,  152,  112,  143,
-      113,  183,  112,  112,  131,  114,  114,  113,  113,  114,
-      131,  143,  135,  115,  135,  114,  143,  115,  115,  114,
-      114,  115,  139,  184,  216,  520,  130,  115,  139,  184,
-      115,  115,  115,  124,  130,  124,  368,  184,  206,  139,
-      136,  130,  136,  130,  140,  130,  138,  135,  138,  124,
-      136,  124,  124,  124,  124,  124,  124,  124,  124,  124,
-
-      138,  140,  138,  138,  135,  138,  135,  140,  141,  142,
-      144,  206,  142,  368,  367,  136,  145,  520,  336,  157,
-      146,  141,  148,  144,  336,  141,  142,  144,  124,  145,
-      124,  146,  136,  145,  147,  149,  157,  146,  147,  148,
-      150,  148,  151,  153,  367,  153,  154,  155,  150, 1091,
-      151,  147,  149,  147,  263,  149,  151,  150,  155,  151,
-      153,  153,  153,  154,  155,  153,  156,  154,  159,  159,
-      161,  160,  156,  162,  161,  196,  196,  196,  163,  156,
-      159,  162,  163,  156,  160,  159,  164,  161,  160,  165,
-      162,  165,  165,  263,  164,  163,  166,  165,  166,  166,
-
-      189,  186,  352,  164,  166,  185,  188,  185,  174,  215,
-      174,  174,  186,  211,  189,  211,  174,  189,  186,  186,
-      548,  190,  199,  188,  191,  188,  165,  165,  191,  225,
-      165,  225,  369,  166,  166,  187,  190,  166,  190,  340,
-      185,  191,  352,  165,  165,  174,  174,  187,  187,  174,
-      166,  166,  187,  187,  185,  548,  199,  201,  201,  201,
-      215,  218,  174,  174,  176,  176,  176,  176,  218,  218,
-      221,  369,  176,  224,  226,  357,  226,  221,  221, 1086,
-      224,  224,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  223,  201,  340, 1084,  219,  219,  219,  223,  223,
-
-      245,  176,  176,  219,  219,  176,  201,  220,  220,  220,
-      227,  245,  227,  239,  239,  220,  220,  245,  176,  176,
-      202,  240,  241,  240,  241,  337,  239,  224,  242,  357,
-      242,  337,  343,  373,  343,  373,  223,  202,  202,  202,
-      202,  202,  202,  202,  202,  202,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  246,
-      247,  249,  517,  248,  280,  370,  280,  252,  517,  250,
-      251, 1080,  254,  255,  280,  249,  246,  252,  249,  246,
-      248,  248,  250,  251,  252,  247,  250,  251,  253,  254,
-      255,  255,  256,  257,  258,  370,  261,  259, 1078,  253,
-      261,  258,  247,  266,  256,  253,  260,  256,  259,  256,
-      257,  258,  257,  261,  259,  264,  264,  260,  265,  269,
-      266,  272,  267,  260,  275,  265,  267,  269,  271,  270,
-      541,  270,  264,  273, 1074,  265,  269,  273,  272,  267,
-      268,  275,  268,  276,  274,  271,  271,  271,  274,  277,
-
-      273,  277,  278,  541,  278,  276,  282,  279, 1070,  270,
-      276,  274,  297, 1069,  270,  283,  277,  282,  284,  285,
-      268,  279,  339,  282,  279,  268,  283, 1066,  268,  297,
-      268,  270,  283,  268,  361,  284,  285,  268,  284,  285,
-      268,  286,  268,  268,  268,  286,  287,  268,  290,  288,
-      289,  288,  289,  291,  287,  292,  278,  291,  286,  288,
-      289,  298,  293,  287,  294,  290,  293,  339,  290,  295,
-      291, 1063,  292,  299,  292,  296,  300,  316,  298,  293,
-      361,  294,  295,  296,  288,  289,  295,  301,  294,  300,
-      299,  299,  296,  300,  316,  288,  289,  302,  303,  305,
-
-      301,  288,  289,  302,  301,  288,  289,  304,  301,  303,
-      304,  306,  307,  308,  302,  303,  305, 1061,  304,  305,
-      311,  308,  309,  310,  304,  313,  309,  310,  306,  307,
-      308,  306,  307,  311,  312,  314,  376,  311,  315,  309,
-      310,  312,  313,  318,  313,  320,  317,  321,  317,  322,
-      318,  312,  314,  315,  314,  315,  317,  319,  320,  321,
-      318,  323,  320,  319,  321,  324,  322,  324,  324,  341,
-      356,  347,  346,  324,  319,  341,  346,  351,  323,  348,
-      323,  317, 1048,  341,  325,  376,  325,  325,  347,  346,
-      347,  327,  325,  327,  327, 1056,  348,  360,  317,  327,
-
-      349,  349,  324,  324,  379,  519,  324,  350,  531,  414,
-      351,  350,  354,  354,  354,  356,  408,  349,  408,  324,
-      324,  325,  325,  380,  350,  325,  414,  351,  327,  327,
-      380,  380,  327,  359,  359,  359, 1048,  360,  325,  325,
-      411,  410,  379,  410,  381,  327,  327,  335,  335,  335,
-      335,  381,  381,  382, 1055,  335,  519,  411,  411,  531,
-      382,  382,  445, 1051,  445,  335,  335,  335,  335,  335,
-      335,  335,  335,  335,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  518,  335,  335,  401,  401,  335,  518,
-      542,  382,  445,  545, 1050,  545,  381,  416,  415,  401,
-
-      415,  335,  335,  362,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  542,  416,  415,  521,  652, 1049,  652,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  417,  418,
-      532,  362,  363,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  656,  533,  521,  417,  418,  418,  656,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  419,  420,  422,
-      363,  366,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  533,  532,  422,  419,  420,  422, 1044,  366,  366,
-
-      366,  366,  366,  366,  366,  366,  366,  402,  402,  402,
-      402,  402,  402,  402,  402,  402,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  404,  404,  404,  404,  404,
-      404,  404,  404,  404,  405,  405,  405,  405,  405,  405,
-      405,  405,  405,  406,  406,  406,  406,  406,  406,  406,
-      406,  406,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  412,  421,  423,  424,  412,  421,  425,  535,  426,
-      428,  427,  424,  426,  423,  432, 1042,  436,  412,  421,
-      423,  424,  427,  428,  425,  430,  426,  428,  427,  431,
-      437,  436,  432,  432,  436, 1022,  430,  431,  433,  438,
-
-      433,  439,  430,  440,  438,  441,  431,  437,  539,  441,
-      437,  442,  438,  444,  443,  439,  438,  535,  439,  447,
-      440,  443,  441,  449,  450,  441,  450,  451,  442,  584,
-      444,  443,  452,  433,  444,  442,  447,  584,  447,  780,
-      449,  433, 1022,  453,  451,  539,  451,  455,  457,  452,
-      433,  657,  458,  456,  450,  433,  434,  657,  434,  450,
-      453,  456,  453,  587,  455,  457,  459,  460,  457,  458,
-      456,  458, 1040,  460,  459,  462,  450,  462,  780,  587,
-      460,  461, 1038,  459,  460,  463,  434,  463,  465,  461,
-      466,  467,  462,  467,  434,  463,  434, 1031,  461,  434,
-
-     1029,  467,  465,  434,  553,  465,  434,  466,  470,  434,
-      434,  553,  553,  434,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  470,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  469,  471,  472,
-      473,  474,  475,  476,  663, 1028,  663,  477, 1025,  471,
-      472,  469,  480,  478,  469,  471,  472,  473,  474,  475,
-
-      476,  477,  479,  481,  477,  478,  479,  482,  483,  480,
-      478,  480,  485,  484,  486,  487,  488,  489,  490,  479,
-      481,  484,  481,  491,  482,  483,  492,  488,  492,  485,
-      484,  490,  487,  488,  489,  490,  493,  486,  494,  495,
-      491,  496,  497,  492,  501,  503,  498,  499,  502,  499,
-      504,  534,  502,  493,  486,  494,  658,  499,  496,  497,
-      498,  501,  503,  498,  495,  502,  505,  504,  506, 1024,
-      505,  507,  506,  507,  507,  528,  522,  550, 1018,  507,
-      563,  495,  522,  505,  563,  506,  508,  682,  508,  508,
-      522, 1017,  528,  509,  508,  509,  509,  563,  658,  526,
-
-      565,  509,  534,  527,  525,  527,  525,  526,  507,  507,
-      682,  668,  507,  668,  525,  550,  526,  565,  566,  568,
-      567,  552,  567,  508,  508,  507,  507,  508,  552,  552,
-      509,  509, 1015,  566,  509,  566,  568,  567,  527,  525,
-      508,  508,  525, 1012,  529,  572,  529,  509,  509,  516,
-      516,  516,  516, 1021,  529,  527,  525,  516,  529,  552,
-      570,  789,  572,  569,  570,  571,  574,  516,  516,  516,
-      516,  516,  516,  516,  516,  516,  569,  570,  571,  529,
-      569,  573,  571,  574,  574,  576,  516,  516, 1021,  576,
-      516,  607,  785,  607,  785,  573,  529, 1011,  573,  590,
-
-      789,  592,  576,  516,  516,  536,  559,  559,  559,  559,
-      559,  559,  559,  559,  559, 1009,  590,  536,  592,  536,
-      982,  607,  536,  536,  536,  536,  536,  536,  536,  536,
-      536,  537,  560,  560,  560,  560,  560,  560,  560,  560,
-      560, 1001,  659,  677,  677,  677,  999,  997,  537,  537,
-      537,  537,  537,  537,  537,  537,  537,  561,  561,  561,
-      561,  561,  561,  561,  561,  561,  593,  996,  982,  537,
-      538,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      659,  580,  538,  593,  538,  593,  580,  538,  538,  538,
-      538,  538,  538,  538,  538,  538,  564,  564,  580,  564,
-
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  577,
-      578,  579,  581,  579,  596,  591,  595,  578,  594,  581,
-      577,  594,  597,  597,  600,  596,  577,  578,  591,  581,
-      595,  596,  591,  595,  598,  594,  599,  992,  991,  597,
-      599,  600,  601, 1153,  601,  604,  673, 1153,  605,  598,
-
-      609,  598,  610,  599,  579,  603,  603,  603,  603,  603,
-      603,  603,  603,  603,  604,  605,  606,  609,  579,  610,
-      611,  610,  601,  613,  615,  613,  616,  601,  611,  606,
-      617,  604,  614,  606,  617,  614,  618,  611,  673,  620,
-      613,  615,  621,  616,  601,  619,  622,  617,  622,  614,
-      619,  676,  620,  618,  623,  618,  620,  625,  624,  621,
-      624,  627,  619,  622,  628,  623,  626,  630,  625,  627,
-      626,  623,  629,  632,  625,  624,  629,  628,  627,  633,
-      634,  628,  631,  626,  630,  635,  631,  635,  637,  629,
-      632,  638,  640,  676,  639,  640,  633,  634,  633,  631,
-
-      641,  643,  635,  644,  984,  637,  637,  639,  638,  640,
-      638,  639,  645,  646,  650,  792,  650,  641,  643,  641,
-      644,  643,  644,  647,  650,  647,  647,  661,  983,  645,
-      646,  647,  648,  661,  648,  648,  664,  654,  664,  654,
-      648,  661,  649,  674,  649,  649,  664,  654,  667,  666,
-      649,  654,  650,  666,  792,  696,  667,  794,  794,  794,
-      647,  647,  696,  696,  647,  667,  666,  704,  697,  648,
-      648,  669,  703,  648,  664,  697,  697,  647,  647,  649,
-      649,  674,  669,  649,  704,  938,  648,  648,  669,  980,
-      672,  703,  672,  670,  977,  670,  649,  649,  655,  655,
-
-      655,  655,  698,  670,  672,  705,  655,  670,  703,  698,
-      698,  702,  702,  702,  702,  702,  702,  702,  702,  702,
-      706,  707,  705,  938,  705,  708,  709,  710,  711,  716,
-      711,  719,  714,  712,  714,  655,  655,  706,  707,  655,
-      707,  712,  708,  709,  710,  711,  716,  710,  719,  709,
-      712,  715,  655,  655,  678,  715,  740,  975,  740,  819,
-      870,  819,  870,  876,  736,  876,  720,  714,  715,  714,
-      720,  678,  678,  678,  678,  678,  678,  678,  678,  678,
-      679,  736,  714,  720,  714,  915,  740,  915,  972,  956,
-      731,  732,  731,  733,  738,  732,  819,  679,  679,  679,
-
-      679,  679,  679,  679,  679,  679,  680,  731,  732,  819,
-      733,  738,  871,  733,  955,  954,  734,  735,  742,  748,
-      749,  735,  734,  680,  680,  680,  680,  680,  680,  680,
-      680,  680,  681,  734,  735,  742,  748,  749,  765,  805,
-      765,  935,  965,  935,  965,  871,  805,  805,  765,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  688,  688,  806,  688, 1007,  953, 1007,  688,  688,
-      806,  806,  688,  952,  951,  688,  688,  688,  688,  688,
-      688,  688,  688,  701,  701,  949,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-
-      701,  701,  701,  701,  701,  701,  737,  739,  744,  743,
-      737,  743,  745,  746,  750, 1111,  751,  746,  739,  743,
-      745,  753,  744,  737,  739,  744,  752,  946,  747,  745,
-      746,  750,  747,  751,  751,  754,  755,  752,  753,  756,
-      757,  758,  757,  752,  743,  747,  759,  760,  761, 1111,
-      762,  764,  754,  755,  762,  767,  756,  763,  758,  758,
-      768,  743,  766,  759,  760,  761,  760,  762,  764,  763,
-      766,  769,  767, 1068,  763,  757,  770,  768,  770,  766,
-      771,  772,  773,  810,  773,  773,  786,  934,  769,  814,
-      757,  786,  757,  774,  945,  774,  774,  771,  772,  771,
-
-      810,  774,  775,  786,  775,  775,  814,  788,  787,  788,
-      809,  770,  865,  770,  865,  812,  816,  812,  811,  773,
-      773,  787,  811,  773,  934,  787, 1068,  821,  770,  809,
-      774,  774,  812,  816,  774,  811,  773,  773,  817,  775,
-      775,  813,  788,  775,  821,  813,  809,  774,  774,  865,
-      933, 1036,  817, 1036,  932,  817,  775,  775,  813,  788,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  796,  808,  808,  808,  808,  808,  808,
-      808,  808,  808,  815,  822,  820,  825,  815,  834,  835,
-      796,  796,  796,  796,  796,  796,  796,  796,  796,  820,
-      815,  822,  820,  825,  836,  834,  835,  834,  837,  838,
-      839,  838,  840,  841,  842,  836,  929,  841,  842,  927,
-      922,  836,  843,  846,  839,  837,  838,  839,  845,  840,
-      841,  842,  844,  843,  844,  845,  846,  847,  845,  843,
-      846,  848,  844,  849,  850,  851,  853,  851,  854,  852,
-
-      854,  855,  856,  857,  847,  858,  847,  852,  848,  858,
-      849,  850,  851,  853,  857,  859,  852,  860,  855,  856,
-      857,  856,  858,  861,  864,  862,  866,  862,  877,  867,
-      874,  879,  859,  875,  860,  862,  884,  867,  883,  883,
-      861,  864,  886,  866,  904,  864,  867,  874,  854,  887,
-      875,  875,  885,  884,  888,  883,  885,  889,  894,  886,
-      893,  877,  894,  896,  879,  880,  887,  896, 1020,  885,
-      889,  888,  893,  888,  889,  894,  906,  893,  908,  902,
-      896,  906,  880,  880,  880,  880,  880,  880,  880,  880,
-      880,  905,  907,  906,  909,  908,  907,  910,  911,  905,
-
-      914,  913, 1043,  912, 1081, 1020,  918,  914,  905,  907,
-      914,  909,  916,  909,  910,  911,  912,  910,  913,  916,
-      912,  917,  916,  918,  919,  920,  923,  924,  917,  920,
-      921,  917,  921,  925,  926,  928,  930,  939,  937,  928,
-      923,  919,  920,  923,  924,  931,  936,  921,  940, 1043,
-      925,  926,  928,  930,  930,  937,  941, 1081,  931,  940,
-      942,  944,  931,  936,  943,  940,  936,  947,  943,  948,
-      950,  948,  901,  941,  939,  958,  939,  942,  944,  959,
-      960,  943,  947,  961,  947,  962,  948,  950,  963,  958,
-      988,  964,  958,  964,  966,  961,  959,  960,  970,  987,
-
-      961,  966,  962,  900,  966,  963,  968,  963,  964,  967,
-      967,  967,  969,  968,  971,  970,  968,  967,  974,  969,
-      967,  973,  969,  973,  976,  978,  979,  990,  985,  978,
-      979,  971,  988, 1004,  899,  974,  989,  987,  973,  985,
-      989,  976,  978,  979,  990,  985,  993,  994, 1002, 1003,
-     1004, 1003, 1005,  989, 1006,  994, 1016,  993, 1006, 1013,
-     1005, 1002,  898,  993,  994, 1002, 1003, 1014, 1019, 1005,
-      897, 1006, 1008, 1008, 1008, 1010, 1013, 1023, 1026, 1010,
-     1008, 1027, 1026, 1008, 1014, 1019, 1032, 1019, 1034, 1016,
-     1035, 1046, 1010, 1033, 1023, 1026, 1047, 1033, 1027, 1027,
-
-     1057, 1034, 1065, 1032, 1052, 1034, 1039, 1035, 1046, 1039,
-     1033, 1037, 1037, 1037, 1058, 1067, 1053, 1057, 1058, 1037,
-     1062, 1052, 1037, 1039, 1053,  895, 1059, 1052, 1059, 1047,
-     1071, 1058, 1072, 1053, 1060, 1060, 1060, 1062, 1075, 1083,
-     1062, 1079, 1060, 1103, 1089, 1060, 1072, 1071, 1087, 1072,
-     1065, 1089, 1067, 1109, 1089, 1075, 1076, 1076, 1079, 1076,
-     1094, 1087,  892, 1076, 1076, 1087, 1095, 1076, 1107, 1110,
-     1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1077, 1077,
-     1077, 1092, 1104, 1108, 1113, 1092, 1077, 1083, 1114, 1077,
-     1090, 1109, 1112, 1094, 1090, 1090, 1103, 1090, 1092, 1095,
-
-     1090, 1090, 1090, 1097, 1101, 1090, 1116, 1118, 1090, 1090,
-     1090, 1090, 1090, 1090, 1090, 1090, 1098, 1099, 1119, 1107,
-     1097, 1101, 1110, 1098, 1099, 1112, 1098, 1099, 1120, 1104,
-     1145, 1108, 1145, 1146, 1147, 1146, 1147, 1113, 1149,  891,
-     1149, 1114, 1150,  882, 1150, 1118, 1151, 1157, 1151, 1157,
-      878, 1158, 1119, 1158,  873,  872,  869, 1116,  868,  863,
-      833,  832,  831,  830,  829,  828,  827,  826,  824,  818,
-      804,  802,  798,  793,  791,  790,  783,  782,  781,  778,
-      777, 1120, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
-     1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1125,
-
-     1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
-     1125, 1125, 1125, 1125, 1125, 1125, 1126, 1126,  776, 1126,
-     1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
-     1126, 1126, 1126, 1127, 1127,  730, 1127, 1127, 1127, 1127,
-     1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127,
-     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128,
-     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129,
-     1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
-     1129, 1129, 1129, 1129, 1130, 1130,  729,  728,  727,  726,
-     1130, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-
-     1131, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
-     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133,  725,
-     1133,  724, 1133, 1133,  722,  718,  717,  713, 1133, 1134,
-     1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134,
-     1134, 1134, 1134, 1134, 1134, 1134, 1135, 1135, 1135, 1135,
-     1135, 1135, 1135, 1135, 1135, 1135,  695, 1135, 1135, 1135,
-     1135,  694, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1136,
-     1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136,
-     1137,  692,  691, 1137, 1137, 1138, 1138, 1138, 1138,  685,
-     1138, 1138,  683, 1138, 1138,  675, 1138, 1138,  662,  660,
-
-     1138, 1138, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139,
-     1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1140,
-      653, 1140,  651,  636, 1140, 1141,  589, 1141,  588, 1141,
-     1141, 1142, 1142,  586, 1142, 1142, 1142, 1142, 1142, 1142,
-     1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1143, 1143,
-     1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143,
-     1143, 1143, 1143, 1143, 1143, 1144, 1144, 1144, 1144, 1144,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144,
-     1144, 1144, 1148,  585,  583, 1148, 1148, 1154,  582, 1154,
-      575,  556,  551,  549, 1154,  546,  543,  530,  524,  523,
-
-      515,  514, 1154, 1155,  513, 1155,  512,  511, 1155, 1156,
-      510, 1156,  454, 1156, 1156, 1159,  429, 1159,  409,  400,
-     1159, 1160,  398, 1160,  397, 1160, 1160, 1161, 1161,  391,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
+        2,    2,    2,   10,    8,    8,    8,    8,   15,   15,
+
+       15,   68, 1129,   14,   10, 1119,   68,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,   14,   16,   16,
+       16,   54,   54,   54,    2,    2,   18,   10,    2,   19,
+        2,    8,   14,   17,   17,   17,   15,   20,   21, 1096,
+       18,    2,    2,  176,   22,   14, 1084,   25,   26,  176,
+       15,   20,   21,    2,    2,   18,   10,    2,   75,    2,
+        8,   25,   42,   19,   69,   15,   20,   21,   18,    2,
+        2,   17,   24,   27,   26,   23,   25,   19,   15,   20,
+       21,   22,   23,   23,   29,   17,   75,   27,   26,   25,
+     1045,   42,   19,   24,  959,   22,   30,  339,   74,  339,
+
+       17,   82,   27,   26,  340,   19,  340,   24,   83,   69,
+       22,   29,   23,   17,   31,   27,   26,   32,   30,   34,
+       41,  178,   24,   22,  916,   29,   23,   74,   31,  912,
+       82,   32,   30,   34,   41,   24,   83,   69,   49,  685,
+       29,   23,   49,   31,  905,  685,   32,   30,   34,   41,
+      178,  207,   33,   29,   23,   28,   31,   28,   33,   32,
+       30,   34,   41,   76,   76,   76,  242,   49,   67,   67,
+       67,   49,   33,   28,   28,   28,   28,   28,   28,   28,
+       28,   28,   28,   86,   43,   63,  207,   33,   28,   43,
+       44,  350,   28,   28,   28,  242,   43,   43,  904,   28,
+
+       33,   28,   28,   63,   44,   67,   91,   28,   77,   77,
+       77,   28,   86,   43,   63,  207,  837,   28,   43,   44,
+      350,   28,   28,   28,   43,   43,   87,   28,  360,   28,
+       28,   63,   44,  835,   67,   28,   78,   78,   78,   28,
+       35,   86,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   38,   40,  830,   91,   38,  360,   35,   35,
+       38,   40,   35,  903,   40,  102,   38,   40,   35,  103,
+       38,  107,   87,   40,   90,   35,   35,   79,   79,   79,
+      825,   38,   40,   91,  342,   38,  342,   35,   35,   38,
+       40,   35,   40,  102,   38,   40,   35,  103,   38,  107,
+
+       87,   40,  108,   35,   35,   36,   90,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,  179,   37,  359,
+       39,  359,   36,  903,  823,   37,   45,   36,  822,   37,
+      108,   39,   37,   39,   45,   90,   39,   39,   46,  205,
+       45,   36,   37,   39,  812,  179,   46,   37,  393,   39,
+      180,   36,   46,  182,   37,   45,   36,   37,   46,   39,
+       37,   39,   48,   45,   39,   39,   51,   46,   45,   36,
+       37,   39,   47,   51,  811,   46,   48,  393,  180,   48,
+       46,  182,   48,   51,  205,   47,   46,   47,  104,   50,
+      220,   48,   47,   50,  529,   51,  529,   50,  396,   52,
+
+      450,   47,   51,  104,   48,   50,   52,   48,   50,   50,
+       48,   51,  205,   47,  532,   47,   52,  104,   50,  804,
+       47,  220,   50,   80,   80,   80,   50,  396,   52,  450,
+      530,  104,  530,   50,   92,   52,   50,   50,   55,   55,
+       55,   92,   92,  532,   52,   53,   53,   53,   53,  220,
+       56,  223,  531,   53,  531,   56,   55,   55,   55,   55,
+       55,   55,   55,   55,   55,   55,  184,  184,  184,   94,
+       70,   70,   70,   71,   71,   71,   94,   94,   60,  223,
+       53,   53,   70,   53,   53,   71,   53,   56,  726,   60,
+      106,  191,   60,  686,   93,   93,   93,   53,   53,  686,
+
+      106,   56,   93,   93,  181,   70,  725,   60,   71,   53,
+       53,  181,   53,   53,  723,   53,   56,   60,  722,  106,
+       60,   72,   72,   72,  910,   53,   53,  214,  106,   56,
+       57,   58,  181,   72,   70,   96,   57,   71,  222,  181,
+      191,  716,   96,   96,   57,  189,   57,   57,   57,   57,
+       57,   57,   57,   57,   57,   57,   59,  222,   58,   72,
+       59,  208,  208,  208,   59,   58,   57,   96,  191,   58,
+       59,  190,   58,   72,   59,  714,  214,  189,   61,  206,
+       57,  706,   58,   61,  910,   59,  222,   58,   72,   59,
+       61,   61,   62,   59,   58,   57,   96,   58,   59,   62,
+
+       58,   72,   59,  190,  214,  224,  189,   61,   57,   62,
+       58,  206,   61,  210,  210,  210,   62,  689,   61,   61,
+      664,   62,  225,  225,  225,  585,  580,  232,   62,  578,
+      558,  235,  190,  224,  232,  232,  554,   62,  235,  235,
+      206,  372,  372,  372,   62,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   97,  101,  101,  105,  204,  204,
+      204,   97,   97,  226,  538,  227,  213,  675,  101,  675,
+      534,  111,  105,  111,  111,  111,  111,  111,  111,  111,
+      111,  111,  111,  421,  101,  101,  105,  375,  375,  375,
+      419,  226,  173,  227,  173,  204,  101,  114,  213,  534,
+      105,  219,  412,   97,  113,  113,  113,  113,  113,  113,
+      113,  113,  113,  113,  114,  228,  115,  118,  219,  114,
+
+      116,  115,  118,  125,  204,  116,  410,  213,  125,  231,
+      173,   97,  100,  114,  100,  115,  118,  229,  116,  116,
+      386,  221,  125,  114,  173,  115,  118,  219,  114,  116,
+      115,  118,  125,  379,  116,  228,  249,  125,  230,  173,
+      374,  114,  251,  115,  118,  100,  116,  116,  117,  100,
+      125,  100,  173,  117,  243,  221,  100,  276,  100,  100,
+      248,  231,  117,  228,  249,  401,  229,  117,  100,  294,
+      251,  294,  401,  401,  100,  371,  343,  117,  100,  294,
+      100,  230,  117,  221,  100,  276,  100,  100,  535,  231,
+      117,  250,  243,  248,  229,  117,  100,  110,  110,  110,
+
+      110,  110,  110,  110,  110,  110,  110,  119,  121,  230,
+      913,  247,  119,  121,  120,  110,  110,  535,  119,  120,
+      243,  248,  120,  246,  400,  121,  119,  121,  110,  245,
+      233,  233,  233,  120,  341,  277,  119,  121,  233,  233,
+      344,  119,  121,  120,  110,  110,  119,  122,  120,  122,
+      244,  120,  122,  121,  119,  121,  110,  177,  123,  218,
+      400,  120,  341,  123,  212,  345,  122,  346,  344,  354,
+      913,  177,  277,  347,  209,  123,  122,  123,  122,  124,
+      202,  122,  348,  126,  124,  187,  177,  123,  126,  400,
+      124,  349,  123,  345,  122,  346,  183,  126,  124,  177,
+
+      277,  347,  126,  123,  676,  123,  676,  354,  124,  127,
+      348,  175,  126,  124,  127,  174,  237,  126,  124,  349,
+       89,  127,  127,  237,  237,  126,  124,  127,  127,  128,
+      126,  128,  129,  389,  128,  130,  354,  129,  127,  292,
+      130,  292,  361,  127,  234,  234,  234,  130,  128,  127,
+      127,  129,  234,  234,  130,  127,  127,  536,  128,  237,
+      128,  129,   88,  128,  130,  388,  129,   84,  389,  130,
+      361,  380,  380,  380,  356,  130,  128,   65,   13,  129,
+      378,  238,  130,  131,  355,  131,  536,  237,  238,  238,
+      369,  292, 1051,  388,  390,  133,  389,  392,    9,  131,
+
+      133,  131,  131,  131,  131,  131,  131,  131,  131,  131,
+      131,  132, 1081,  133,  133,  134,  132,    7,  134,  292,
+      134,  388,  132,  398,  133,  392,  356,  355,  369,  133,
+      132,  390,  378,  238,  134,  677,  131,  677,  131, 1130,
+      132,  133,  133,  381,  134,  132,  136,  134,  135,  134,
+      132,  136, 1051,  135,  356,  355,  398,  369,  132,  390,
+      378,  238,  134,  136,  131,  136,  131,  135,  135,  139,
+      377,  137, 1081,  138,  139,  136,  137,  135,  138,  137,
+      136,  381,  135,  139,  138,  398,  137,  395,  139,    0,
+      137,  136,  138,  136,  418,  135,  135,  397,  139, 1130,
+
+      137,  382,  138,  139,  140,  137,  475,  138,  137,  140,
+      381,  139,  138,  377,  137,  395,  139,  142,  137,  142,
+      138,  140,  418,  140,  141,  399,  143,  144,  143,  141,
+     1131,  537,  144,  140,  475,    0,  143,  141,  140,  391,
+      533,  377,  144,  141,  397,  382,  144,    0,  543,  140,
+      142,  140,  466,  141,  466,  142,  144,  146,  141,  143,
+      537,  144,  146,  146,  143,  141,    0,  391,  533,  142,
+      144,  141,  397,  382,  144,  399,  146,    0,  143,  142,
+      145,    0,  145,  466,  142,  145,  146,  680,  143,  680,
+     1131,  146,  146,  143,  145,  391,  145,  142,  543,  145,
+
+      147,    0,  148,  399,  146,  147,  143,  148,  557,  145,
+      484,  145,  484,  546,  145,  148,  394,  394,  394,  147,
+      484,  148,  145,  147,  145,  149,  543,  145,  149,  147,
+      149,  148,  572,  150,  147, 1148,  148,  151,  150,    0,
+        0,  546,  151,  148,  149,  150,  547,  147,    0,  148,
+      151,  147,  150,  557,  149,    0,  151,  149,    0,  149,
+      544,  572,  150,  152,  153,    0,  151,  150,  152,  153,
+        0,  151,  149,  150,  547,  153,  152,  488,  151,  488,
+      150,  557,  152,  153,  151,    0,  155,  488,    0,  154,
+      155,  155,  152,  153,  154, 1148,  544,  152,  153,  521,
+
+      154,  521,    0,  153,  152,  155,  611,    0,  154,  521,
+      152,  153,  156,  253,  253,  155,  158,  156,  154,  155,
+      155,  158,  402,  154,  158,  544,  253,    0,  154,  402,
+      402,  156,  157,  155,  611,  158,  154,  157,  559,  559,
+      559,  156,  253,  253,    0,  158,  156,  612,    0,  157,
+      158,  157,  157,  158,  253,  160,  160,  159,    0,  156,
+      160,  157,  159,  158,  614,  159,  157,  370,  370,  370,
+      615,  159,  402,  561,  160,  612,  159,  157,    0,  157,
+      157,  194,  162,  194,  160,  160,  159,  162,  161,  160,
+      161,  159,  614,  161,  159,  556,  556,  556,  615,  159,
+
+      402,  162,  160,  162,  159,    0,  161,  161,  370,  542,
+      161,  162,  575,  163,  194,  564,  162,  161,  163,  161,
+      164,  555,  161,  561,  163,  164,  164,  563,  194,  162,
+        0,  162,  163,  164,  161,  161,  556,  370,  161,  164,
+      165,  575,  163,  194,  568,  165,  692,  163,  692,  164,
+      617,  561,  163,  562,  164,  164,  194,  165,  542,  165,
+      163,  164,  564,  166,  403,  556,  682,  164,  166,  165,
+      555,  403,  403,  577,  165,  569,  563,  166,  617,  568,
+      166,    0,  166,  167,  167,  165,  542,  165,  167,  562,
+      564,  697,  166,  697,  682,  167,  569,  166,  555,  744,
+
+      403,    0,  167,  570,  563,  166,  577,  568,  166,  168,
+      166,  579,  167,  167,  168,  169,    0,  167,  562,  169,
+      169,    0,  168,  167,  570,  569,  168,  744,  168,  403,
+      167,  571,  170,    0,  169,  577,  753,  170,  168,    0,
+      170,  171,    0,  168,  169,  171,  171,  579,  169,  169,
+      168,  170,  571,  570,  168,    0,  168,  574,  574,  574,
+      171,  170,  169,  172,  753,  581,  170,  604,  172,  170,
+      171,  172,  581,  581,  171,  171,  579,  582,  613,  170,
+      618,  571,  172,  687,  582,  582,    0,    0,  171,  678,
+        0,  678,  172,  185,  185,  185,  604,  172,  756,  678,
+
+      172,  581,  679,  635,  815,  635,  815,  613,  757,  618,
+      172,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  186,  681,  687,    0,  678,  756,  186,  713,    0,
+      581,  679,  691,  608,  635,  608,  757,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,  186,  192,  683,  713,
+      683,  681,  687,  192,  678,  684,  684,  684,  683,    0,
+      703,  691,  683,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  193,  608,  215,  215,  215,  713,  193,
+      708,  708,  708,  748,  826,  826,  826,  193,  608,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  195,
+
+      703,  196,  197,  608,  195,  749,  196,  197,  215,    0,
+      195,  616,  748,  196,  196,  688,  608,  195,  195,  196,
+      196,  197,  215,  832,  832,  832,  704,  616,  195,  703,
+      196,  197,  707,  195,  749,  196,  197,  215,  195,  198,
+      616,  196,  196,    0,  198,  195,  195,  196,  196,  197,
+      215,  688,  702,  198,  702,  616,  200,    0,  198,  201,
+      199,  200,  199,  201,  201,  199,  702,  755,  198,  758,
+        0,  200,  707,  198,  199,  200,  199,  704,  201,  199,
+      688,  198,  759,  807,    0,  200,  198,    0,  201,  199,
+      200,  199,  201,  201,  199,  216,  755,    0,  758,  200,
+
+        0,  707,  199,  200,  199,  704,  201,  199,    0,    0,
+      759,  807,  216,  216,  216,  216,  216,  216,  216,  216,
+      216,  216,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  239,    0,  239,  860,  760,  239,  239,  239,  239,
+      239,  239,  239,  239,  239,  239,  240,    0,  240,  863,
+      805,  240,  240,  240,  240,  240,  240,  240,  240,  240,
+      240,  241,  860,  241,  760,  806,  241,  241,  241,  241,
+      241,  241,  241,  241,  241,  241,  254,  863,  254,  805,
+        0,  254,  254,  254,  254,  254,  254,  254,  254,  254,
+      254,  255,    0,  255,  806,    0,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  256,  808,  256,  259,
+      865,  256,  256,  256,  256,  256,  256,  256,  256,  256,
+
+      256,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      257,    0,  259,  769,  260,  769,  808,  259,  865,  260,
+      257,  258,  258,  258,  258,  258,  258,  258,  258,  258,
+      258,  259,  260,  260,  261,  813,  901,  262,  901,  261,
+      258,  259,  262,  260,  769,  261,  259,  727,  260,  257,
+      908,  262,  908,  261,  727,  727,  262,  263,  705,  259,
+      260,  260,  263,  261,  813,  693,  262,  693,  261,  258,
+      263,  262,    0,  261,    0,  693,  263,  264,  266,  262,
+      265,  261,  264,  266,  262,  265,  263,  803,  266,  803,
+      264,  263,    0,    0,  705,  803,  264,  266,  263,  265,
+
+      265,  693,  851,  268,  263,  810,  264,  266,  268,  265,
+      267,  264,  266,    0,  265,  267,  266,    0,  264,    0,
+      268,  267,  268,  705,  264,  266,    0,  265,  265,  267,
+      693,  851,  268,  269,    0,  271,  821,  268,  269,  267,
+      271,  270,  810,    0,  267,  700,  270,  700,  268,  267,
+      268,  269,  269,  270,  271,  700,  270,  267,  272,  700,
+      270,    0,  269,  272,  271,  272,  728,  269,    0,  271,
+      270,  810,  821,  728,  728,  270,    0,  272,  273,  269,
+      269,  270,  271,  273,  270,  274,    0,  272,  270,  273,
+      274,  729,  272,  794,  272,  794,  274,  273,  729,  729,
+
+        0,  821,    0,  794,  274,  272,    0,  273,  278,  278,
+      857,  275,  273,  278,  274,  275,  275,  273,  900,  274,
+      859,  809,  809,  809,  274,  273,  820,  278,  279,  809,
+      275,  280,  274,  279,  824,  279,  280,  278,  278,  857,
+      275,  284,  278,  284,  275,  275,  900,  279,  281,  859,
+      280,  861,  281,  281,    0,  278,  862,  279,  275,  864,
+      280,  925,  279,  820,  279,  280,    0,  281,  283,    0,
+        0,  824,  284,  283,  284,  279,  283,  281,  280,  284,
+      861,  281,  281,  838,  875,  862,  875,  283,  864,  925,
+      838,  838,  820,  284,  875,  281,  282,  283,  282,  285,
+
+      824,  894,  283,  284,  285,  283,  286,  899,  284,  422,
+      422,  286,  839,  902,  893,  283,  893,  285,  285,  839,
+      839,  284,  422,    0,  893,  286,    0,  282,  285,  282,
+      894,  911,  282,  285,  282,  286,  899,  282,  422,  422,
+      286,  282,  902,    0,  282,  285,  285,  282,  282,  289,
+      422,  282,  287,  286,  289,  288,  287,  287,  282,  288,
+      288,  282,  934,  282,  937,  884,  282,  884,  289,  282,
+        0,  287,  282,    0,  288,  282,  282,  926,  289,  282,
+      911,  287,  290,  289,  288,  287,  287,  290,  288,  288,
+      291,  934,  291,  937,  290,  291,  289,  929,  293,  287,
+
+      931,  290,  288,  293,  896,  926,  896,  932,  911,  291,
+        0,  290,  293,  884,    0,  296,  290,  293,  933,  291,
+      296,  291,  290,  935,  291,  929,  296,  293,  931,  290,
+      961,  297,  293,    0,  296,  932,  297,  291,  298,  896,
+      293,  884,  297,  298,  296,  293,  933,    0,  954,  296,
+      297,  935,    0,  964,  296,    0,    0,  298,  298,  961,
+      297,  299,  296,    0,    0,  297,  299,  298,  896,  965,
+      297,  980,  298,  948,  948,  948,  954,  966,  297,  972,
+      299,  299,  964,  300,  301,  298,  298,  300,  300,  301,
+      299,  302,  301,  302,  303,  299,  303,  965,  967,  980,
+
+      300,  302,  300,  301,  303,  968,  966,  968,  299,  299,
+        0,    0,  300,  301,  989,  972,  300,  300,  301,  990,
+      304,  301,  973,  981,  302,  304,  984,  303,  300,  302,
+      300,  301,  303,  967,  968,  302,  968,    0,  303,  304,
+      304,  986,  989,  302,  972,  302,  303,  990,  303,  304,
+     1005,    0,  981,  302,  304,  984,  303,    0,  302,  973,
+      305,  303,  967,  302,  305,  305,  303,  304,  304,  987,
+      986,  302,  306,  302,  303,  988,  303,  306, 1005,  305,
+      307,  308, 1008, 1016,  307,  307,  308,    0,  973,  305,
+     1010,  306,  308,  305,  305,    0,    0,  309,  987,  307,
+
+      308,  306,  309, 1015,  988,    0,  306,  305,    0,  307,
+      308, 1008, 1013,  307,  307,  308,  309,  310, 1010,  306,
+      308,  309,  310,  998,  998,  998,  309,  307,  308, 1016,
+      310,  309, 1015,  311,  312,    0,  310,  313,  311,  312,
+     1013,  311,  313,  852,  309,  852,  310, 1017,    0,  309,
+        0,  310,  311,  312,  314,    0,  313, 1016,  310,  314,
+     1018,    0,  311,  312,  310, 1028,  313,  311,  312, 1027,
+      311,  313,  314,  314,  315,    0, 1017,  316,  852,  315,
+      311,  312,  316,  314,  313, 1022, 1032,  315,  314, 1018,
+      316,  852, 1034,  315, 1028,    0,  316, 1027,  316, 1036,
+
+      314,  314, 1021,  315,  317, 1023,  316,  852,  315,  317,
+      317,  316,    0,    0, 1032,  315, 1043, 1022,  316,  852,
+     1034,  315, 1049,  317,  316,  318,  316, 1036,    0,  319,
+      318,    0,  319,  317,  319,    0,  318,  320,  317,  317,
+      319, 1023,  320,    0,  318, 1043, 1022, 1021,  319, 1046,
+     1049,  317,    0, 1024,  318, 1053,  320,  320,  319,  318,
+      321,  319,  322,  319,  318,  321,  320,  322,  319,  323,
+     1023,  320,  318, 1052,  323, 1021,  319,  323, 1046,  321,
+      321,  322,  322, 1053,  320,  320,    0,    0,  323,  321,
+        0,  322,  326, 1024,  321,  324,  322,  326,  323,  324,
+
+      324,    0, 1052,  323, 1060,  326,  323,  321,  321,  322,
+      322,  326,  328,    0,  324,  325,  323,  328,  327,  325,
+      325,  326, 1024,  327,  324,  327,  326, 1061,  324,  324,
+     1058,  328, 1060,  326,  325,    0, 1055,  327,  329,  326,
+        0,  328,  324,  329,  325,  330,  328,  327,  325,  325,
+      330, 1057,  327,  332,  327,  332, 1061,  329,    0,  328,
+      330,  331,  325,  332,  330,  327,  331,  329, 1041, 1041,
+     1041, 1055,  329,    0,  330, 1058, 1064,    0,  331,  330,
+      331, 1066,  333, 1056, 1057,  329,  332,  333,  330,  333,
+      331,  332,  330,  334, 1072,  331,    0, 1074,  334,  334,
+
+     1055,  333,  336, 1058, 1064,  332,  331,  336,  331, 1076,
+     1066,  333,  334, 1057,  336,  332,  333, 1056,  333,  335,
+      332,  336,  334, 1072,  335, 1074, 1078,  334,  334,  333,
+        0,  336,  335,  332,    0,    0,  336, 1076,  335,  337,
+      334, 1085,  336,    0,  337,  338, 1056, 1094,  335,  336,
+      338,    0,  974,  335, 1078, 1086,  337, 1090,  337, 1083,
+      335,  876,  876,  876,  338,    0,  335,    0,  337,  876,
+     1085, 1082,  876,  337,  338,  351, 1094,  351,    0,  338,
+      946,  946,  946, 1086,  337, 1090,  337,  974,  946,  974,
+        0,  946,  338,  351,  351,  351,  351,  351,  351,  351,
+
+      351,  351,  351,  352,  947,  947,  947, 1082,    0,  352,
+        0, 1083,  947,    0, 1077,  947,  974,    0,  974,  352,
+      352,  352,  352,  352,  352,  352,  352,  352,  352,  353,
+      949,  949,  949,    0,    0,  353, 1082, 1098,  949, 1083,
+        0,  949, 1070, 1070, 1070,  353,  353,  353,  353,  353,
+      353,  353,  353,  353,  353,  357, 1092, 1092, 1092, 1077,
+     1099,  357,  362,  363,    0,  364,  362,  362,  363,  357,
+      364,  357,  357,  357,  357,  357,  357,  357,  357,  357,
+      357,  362,  363, 1098,  364,  365,  365, 1077, 1099, 1103,
+      365,  362,  363,  368,  364,  362,  362,  363, 1104,  364,
+
+        0,  366,    0,    0,  365,  366,  366,    0,    0,  362,
+      363, 1098,  364, 1111,  365,  365, 1107, 1103,  366,  365,
+      366,  367,    0,  433,  368,  367,  367, 1104,  433,  368,
+      366, 1100,  365,    0,  366,  366,  950,  950,  950, 1113,
+      367, 1111,  433,  368,  950, 1107,  366,  950,  366,    0,
+      367, 1116,  433,  368,  367,  367,  383,  433,  368,    0,
+        0,  999,  999,  999,    0,    0, 1100, 1113,  367,  999,
+      433,  368,  999,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  384,    0, 1000, 1000, 1000, 1101, 1101,
+     1101,    0,  383, 1000, 1121, 1100, 1000, 1116, 1127,    0,
+
+      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
+      387,    0, 1001, 1001, 1001, 1117, 1117, 1117, 1136,  384,
+     1001,  383, 1121, 1001,    0, 1116, 1127,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  387,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404, 1136,  384,  405,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  406,
+      406,  406,  406,  406,  406,  406,  406,  406,  406,  407,
+      407,  407,  407,  407,  407,  407,  407,  407,  407,  408,
+      408,  408,  408,  408,  408,  408,  408,  408,  408,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  423,
+
+      423,  423,  423,  423,  423,  423,  423,  423,  423,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  425,
+      425,  425,  425,  425,  425,  425,  425,  425,  425,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  427,
+      427,  427,  427,  427,  427,  427,  427,  427,  427,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  429,
+     1102,  429,    0,    0,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,    0,  436,    0,  434,    0,  431,
+      436,  431,  434,  430,  431,  431,  431,  431,  431,  431,
+
+      431,  431,  431,  431,  436,  434,  434,  435,  437,  435,
+     1144, 1102,  435,  437,  436,    0,  434, 1132, 1147,  436,
+        0,  434,  430,    0,  438,    0,  435,  437,  438,  438,
+      439,    0,  436,  434,  434,  439,  435,  437,  435, 1102,
+        0,  435,  437,  438,    0, 1132,  440, 1140,  439,  439,
+     1147,  440,    0,  438,  435,  437, 1144,  438,  438,  439,
+        0,    0,  441,    0,  439,  440, 1114,  441,  442,  443,
+        0,  438,  442,  442,  443,  440,  439,  439, 1139, 1147,
+      440,  441,    0,  443, 1144,  446, 1146,  442,  443,  444,
+      446,  441, 1140,  440,  444, 1143,  441,  442,  443, 1156,
+
+      444,  442,  442,  443,  446,  445,    0, 1149,  444,  441,
+      445,  443,    0,  445,  446,  442,  443, 1114,  444,  446,
+     1140,  447,  448,  444,  445,  447,  447,  448,  444, 1139,
+      449, 1156,  446,  448,  445,  449,  444, 1146,    0,  445,
+      447,  448,  445,  449, 1143, 1114, 1124, 1124, 1124,  449,
+      447,  448,  445,    0,  447,  447,  448, 1139, 1149,  449,
+     1156,  448,  451,    0,  449, 1146, 1145,  451,  447,  448,
+      452,  449, 1143,  451,  453,  452, 1152,  449,  452,  453,
+        0,  451,    0,    0, 1150,  454, 1149,  454,    0,  452,
+        0,  451,  453,  453,    0,    0,  451,    0,    0,  452,
+
+        0,  451, 1145,  453,  452,    0,    0,  452,  453,  451,
+      458, 1151, 1151, 1151,  457,  458,    0,  452,  454,  457,
+      453,  453,    0,  454,    0, 1152,  454,    0,  457,  458,
+      458, 1145,    0,  457,    0, 1150,    0,  454,    0,  458,
+      454,  459,    0,  457,  458,  460,  459,  454,  457,    0,
+      460,    0,  454, 1152, 1155,  454,  457,  458,  458,  460,
+      459,  457,  468, 1150,  460,  454,    0,  468,  454,  455,
+      459,  455,    0,    0,  460,  459, 1153, 1153, 1153,  460,
+        0,  468,    0,    0,  461,    0,    0,  460,  459,  461,
+     1155,  468,  460, 1158, 1158, 1158,  468, 1159, 1159, 1159,
+
+      455,  461,    0,  461,    0,  455,  463,  455,    0,  468,
+      455,  463, 1157,  461,  455,    0,    0,  455,  461, 1155,
+      455,  455,    0,    0,  455,  463,    0,    0,    0,  461,
+      463,  461,    0,    0,  455,  463,  455,    0,  472,  455,
+      463,    0,  455,  472,    0,  455,  462,    0,  455,  455,
+      462,  462,  455,  463,  464,  465,    0,  472,  463,  464,
+      465,  464,    0, 1157,    0,  462,  462,  472,    0,    0,
+        0,    0,  472,  464,  465,  462,  465,    0,    0,  462,
+      462,    0,    0,  464,  465,  472,    0,    0,  464,  465,
+      464, 1157,    0,  462,  462,    0,    0,    0,    0,    0,
+
+        0,  464,  465,    0,  465,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,    0,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  470,    0,  471,  473,  471,  470,
+
+        0,    0,  473,  474, 1002, 1002, 1002,    0,  474,    0,
+        0,  470, 1002,  470,    0, 1002,  473,    0,    0,    0,
+        0,    0,  474,  470,    0,    0,  473,  471,  470,  471,
+      476,  473,  474,    0,  471,  476,    0,  474,  477,  470,
+        0,  470,    0,  477,  473,    0,  477,    0,  471,  476,
+      474,    0,    0,    0,    0,    0,    0,  477,  471,  476,
+      478,    0,    0,  471,  476,  478,    0,  477,  479,    0,
+        0,    0,  477,  479,    0,  477,  471,  476,    0,  478,
+      478,    0,    0,    0,    0,  477,    0,  479,    0,  478,
+      480,    0,    0,    0,  478,  480,    0,  479,  480,  481,
+
+        0,    0,  479,    0,  481,  481,    0,  478,  478,  480,
+        0,    0,  481,    0,    0,  479,    0,    0,  481,  480,
+        0, 1003, 1003, 1003,  480,    0,    0,  480,  481, 1003,
+      482,  487, 1003,  481,  481,  482,  487,  480,  482,  483,
+      481,  483,  486,    0,  483,    0,  481,  486,    0,  482,
+      487,    0,    0,    0,    0,    0,  486,    0,  483,  482,
+      487,  486,    0,    0,  482,  487,    0,  482,  483,  490,
+      483,  486,    0,  483,  490,  491,  486,  482,  487,    0,
+      491,    0,    0,  490,  486,    0,  483,    0,  490,  486,
+        0,  492,    0,    0,  491,  493,  492,    0,  490,    0,
+
+      493,    0,  492,  490,  491,    0,  493,  494,    0,  491,
+      492,  490,  494,    0,  493,    0,  490,    0,  495,    0,
+      492,    0,  491,  495,  493,  492,  494,  496,    0,  493,
+      492,    0,  496,    0,  493,  496,  494,  495,  492,  497,
+        0,  494,  493,  498,  497,    0,  496,  495,  498,    0,
+      502,    0,  495,    0,  494,  502,  496,    0,  497,    0,
+        0,  496,  498,    0,  496,  495,  499,    0,  497,  502,
+      500,  499,  498,  497,  496,  500,    0,  498,    0,  502,
+      499,    0,  500,    0,  502,  499,  497,  501,    0,  500,
+      498,  501,  501,  503,    0,  499,  504,  502,  503,  500,
+
+      499,  504,    0,    0,  500,    0,  501,    0,  499,    0,
+      500,    0,  503,  499,    0,  504,  501,  500,  505,  507,
+      501,  501,  503,  505,  507,  504,    0,  503,    0,  508,
+      504, 1042, 1042, 1042,  501,  505,    0,  505,  507, 1042,
+      503,  506, 1042,  504,    0,    0,  506,  505,  507,  506,
+      508,    0,  505,  507,    0,  508,    0,  509,    0,    0,
+      506,    0,  509,  505,    0,  505,  507,    0,    0,  508,
+      506,    0,    0,    0,  509,  506,  509,    0,  506,  508,
+        0,    0,  510,    0,  508,    0,  509,  510,  506,  511,
+      512,  509,    0,  510,  511,  512,    0,  508,    0,    0,
+
+        0,  510,  509,  512,  509,    0,  511,    0,  511,  512,
+        0,  510,    0,    0,    0,    0,  510,    0,  511,  512,
+      513,  510,  515,  511,  512,  513,    0,  515,  514,  510,
+      514,  512,    0,  514,  511,    0,  511,  512,  517,  513,
+        0,  515,    0,    0,    0,  516,    0,  514,    0,  513,
+      516,  515,    0,  518,  513,    0,  515,  514,  518,  514,
+        0,  517,  514,    0,  516,  519,  517,  513,    0,  515,
+      519,    0,  518,    0,  516,  514,    0,    0,    0,  516,
+      517,    0,  518,    0,  519,    0,  523,  518,  520,    0,
+      517,  523,  516,  520,  519,  517,    0,    0,    0,  519,
+
+      518,    0,  520,    0,    0,  523,    0,  520,  517,  524,
+        0,    0,  519,  524,  524,  523,    0,  520,  525,    0,
+      523,  526,  520,  525,    0,    0,  526,    0,  524,    0,
+      520,    0,    0,  523,    0,  520,    0,  525,  524,    0,
+      526,  527,  524,  524,  528,  527,  527,  525,  528,  528,
+      526,    0,  525,    0,    0,  526,  524,    0,    0,    0,
+      527,  551,    0,  528,    0,  525,  551,    0,  526,    0,
+      527,    0,    0,  528,  527,  527,    0,  528,  528,  539,
+      551,  539,    0,    0,    0, 1071, 1071, 1071,  527,    0,
+      551,  528,    0, 1071,    0,  551, 1071,  539,  539,  539,
+
+      539,  539,  539,  539,  539,  539,  539,  540,  551, 1093,
+     1093, 1093,    0,  540,    0,    0,    0, 1093,    0,    0,
+     1093,    0,    0,  540,  540,  540,  540,  540,  540,  540,
+      540,  540,  540,  541,  548,    0,  548,    0,    0,  541,
+        0,    0,    0,    0,  548,    0,    0,    0,    0,  541,
+      541,  541,  541,  541,  541,  541,  541,  541,  541,  545,
+      550,    0,  550,    0,    0,  545,  549,  548,    0,    0,
+      548,  549,  548,  545,  549,  545,  545,  545,  545,  545,
+      545,  545,  545,  545,  545,  549,  548,    0,    0,    0,
+        0,    0,    0,  550,    0,  549,  548,    0,  550,  548,
+
+      549,  548,  552,  549,    0,  592,    0,  552,  552,  592,
+      592,    0,  550,  549,  548,  552,    0,    0,  553,  552,
+      553,  552,  550,    0,  592,    0,    0,  550,  553,    0,
+        0,  552,  553,    0,  592,    0,  552,  552,  592,  592,
+      550,  565,    0,  552,    0,    0,    0,  552,    0,  552,
+        0,  553,  592,  565,    0,  565,  553,    0,  565,  565,
+      565,  565,  565,  565,  565,  565,  565,  565,    0,  566,
+      553, 1110, 1110, 1110,    0,    0,    0,    0,    0, 1110,
+      553,    0, 1110,    0,    0,  553,  566,  566,  566,  566,
+      566,  566,  566,  566,  566,  566,  567,    0,  553,    0,
+
+        0, 1125, 1125, 1125,    0,  566,    0,    0,  567, 1125,
+      567,    0, 1125,  567,  567,  567,  567,  567,  567,  567,
+      567,  567,  567,  588,  588,  588,  588,  588,  588,  588,
+      588,  588,  588,    0,  566,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  589,  590,  590,  590,  590,  590,
+      590,  590,  590,  590,  590,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  593,    0,    0,  595,    0,
+      593,    0,    0,  595, 1134, 1134, 1134,    0, 1135, 1135,
+     1135,    0, 1134,  595,  593, 1134, 1135,  595,    0, 1135,
+        0,    0,    0,    0,  593,    0,    0,  595,    0,  593,
+
+        0,    0,  595,    0,    0,    0,    0,    0,    0,    0,
+        0,  595,  593,  594,  594,  595,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+
+      594,  594,  596,  597,  596,  598,  600,  596,  597,  599,
+      598,  600,    0,  599,  599,    0,    0,    0,  598,  600,
+        0,  596,  597,    0,  598,  600,    0,    0,  599,    0,
+        0,  596,  597,  596,  598,  600,  596,  597,  599,  598,
+      600,    0,  599,  599,    0,    0,  598,  600,    0,  596,
+      597,    0,  598,  600,  601,  602,  599,  603,    0,  601,
+      602,  605,  603,    0,    0,  605,  605,    0,    0,  602,
+        0,    0,    0,  601,  602,  603,  603,    0,    0,    0,
+      605,    0,    0,  601,  602,    0,  603,  606,  601,  602,
+      605,  603,  606,    0,  605,  605,    0,  602,  606,    0,
+
+        0,  601,  602,  603,  603,    0,  606,    0,  605,  609,
+      607,    0,    0,  610,  609,  607,  606,  607,  610,    0,
+      610,  606,    0,    0,    0,    0,  606,    0,  609,  607,
+        0,    0,  610,    0,  606,  619,  621,    0,  609,  607,
+      619,  621,  610,  609,  607,    0,  607,  610,    0,  610,
+        0,    0,    0,    0,  619,  621,  609,  607,  620,    0,
+      610,    0,    0,  620,  619,  621,    0,    0,    0,  619,
+      621,  620,    0,    0,  623,  622,    0,  620,  622,  623,
+      622,    0,  619,  621,    0,    0,    0,  620,  623,    0,
+        0,  624,  620,  623,  622,    0,  624,    0,    0,  620,
+
+        0,    0,  624,  623,  622,  620,    0,  622,  623,  622,
+      624,    0,  625,  625,  626,    0,  623,  625,  628,  626,
+      624,  623,  622,  628,    0,  624,    0,    0,    0,  626,
+      624,  625,    0,  626,    0,  627,    0,  628,  624,  627,
+      627,  625,  625,  626,    0,    0,  625,  628,  626,    0,
+        0,    0,  628,  629,  627,  629,    0,  626,    0,  625,
+        0,  626,    0,  632,  627,  628,    0,    0,  627,  627,
+      631,  631,  631,  631,  631,  631,  631,  631,  631,  631,
+      632,    0,  627,  633,  629,  632,  629,  634,  633,  637,
+        0,  629,  634,    0,  637,    0,    0,    0,    0,  632,
+
+      634,    0,  633,    0,    0,  629,  634,    0,  637,  632,
+        0,    0,  633,    0,  632,  629,  634,  633,  637,  638,
+      629,  634,    0,  637,  638,    0,    0,  632,  634,    0,
+      633,    0,    0,  629,  634,  639,  637,    0,  638,  641,
+      639,  641,  642,  639,  641,  642,  643,  642,  638,    0,
+        0,  643,    0,  638,  639,    0,    0,    0,  641,    0,
+        0,  642,  644,    0,  639,  643,  638,  644,  641,  639,
+      641,  642,  639,  641,  642,  643,  642,    0,    0,  644,
+      643,  644,  639,  645,    0,  646,  641,  645,  645,  642,
+      646,  644,  647,  643,  648,    0,  644,  647,    0,  648,
+
+        0,    0,  645,    0,  646,  647,    0,  644,    0,  644,
+        0,  647,  645,  648,  646,    0,  645,  645,    0,  646,
+        0,  647,    0,  648,    0,    0,  647,    0,  648,  649,
+      645,  649,  646,  647,  649,  650,    0,    0,    0,  647,
+      650,  648,    0,    0,    0,    0,  650,    0,  649,    0,
+        0,    0,    0,    0,  650,    0,    0,    0,  649,    0,
+      649,  652,    0,  649,  650,  651,  652,  651,    0,  650,
+      651,    0,  652,  653,  650,    0,  649,  653,  653,    0,
+      652,    0,  650,    0,  651,    0,    0,    0,    0,    0,
+      652,    0,  653,    0,  651,  652,  651,    0,  655,  651,
+
+      652,    0,  653,  655,    0,  654,  653,  653,  652,  656,
+      654,    0,  651,  654,  656,    0,    0,  655,    0,    0,
+      653,    0,  656,    0,  654,  657,    0,  655,  656,  657,
+      657,    0,  655,    0,  654,    0,  658,    0,  656,  654,
+        0,  658,  654,  656,  657,  655,    0,    0,  660,    0,
+      656,    0,  654,  660,  657,  658,  656,  659,  657,  657,
+        0,  659,  659,    0,    0,  658,    0,  660,  661,  662,
+      658,    0,  657,  661,  662,    0,  659,  660,    0,    0,
+        0,    0,  660,  658,    0,    0,  659,  661,  662,    0,
+      659,  659,    0,    0,  663,  660,  663,  661,  662,  663,
+
+      665,  666,  661,  662,  659,  665,  666,    0,    0,    0,
+        0,    0,    0,  663,    0,  661,  662,    0,  665,  665,
+      666,    0,    0,  663,    0,  663,  667,    0,  663,  665,
+      666,  667,    0,    0,  665,  666,    0,  668,    0,  667,
+      668,  663,  668,    0,    0,  667,  665,  665,  666,  669,
+        0,    0,    0,  672,  669,  667,  668,  671,  672,    0,
+      667,    0,  671,    0,    0,    0,  668,  667,  669,  668,
+        0,  668,  672,  667,  673,    0,  671,  671,  669,  673,
+      674,    0,  672,  669,  668,  674,  671,  672,    0,    0,
+        0,  671,    0,  673,    0,    0,  669,    0,    0,  674,
+
+      672,    0,    0,  673,  671,  671,    0,    0,  673,  674,
+        0,    0,  690,    0,  674,    0,    0,    0,  690,  695,
+        0,  673,    0,  695,  695,    0,  690,  674,  690,  690,
+      690,  690,  690,  690,  690,  690,  690,  690,  695,  696,
+      698,  699,    0,    0,  696,  698,  699,  696,  695,    0,
+        0,  698,  695,  695,    0,    0,    0,    0,  696,  698,
+      699,    0,    0,    0,    0,    0,  695,    0,  696,  698,
+      699,    0,  709,  696,  698,  699,  696,    0,    0,  698,
+        0,    0,  710,    0,    0,    0,  696,  698,  699,  709,
+      709,  709,  709,  709,  709,  709,  709,  709,  709,  710,
+
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  711,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  712,
+        0,    0,    0,    0,    0,    0,  711,  711,  711,  711,
+      711,  711,  711,  711,  711,  711,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  719,  719,  719,    0,    0,
+      719,  719,    0,  719,    0,    0,    0,  719,  719,    0,
+        0,  719,    0,    0,  719,  719,  719,  719,  719,  719,
+      719,  719,  719,  732,  732,    0,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  733,    0,    0,  735,    0,  733,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  734,  736,  737,
+        0,  733,  735,  736,  737,  738,    0,  735,    0,    0,
+      738,  733,    0,    0,    0,    0,  733,  736,  737,    0,
+        0,  735,    0,    0,  738,  739,    0,  736,  737,  733,
+
+      739,  735,  736,  737,  738,    0,  735,  740,    0,  738,
+        0,    0,  740,    0,  739,  736,  737,    0,  741,  735,
+        0,    0,  738,  741,  739,    0,  740,    0,    0,  739,
+      740,    0,    0,    0,    0,    0,  740,  741,  741,    0,
+        0,  740,  739,  742,    0,  742,    0,  741,  742,    0,
+      747,  743,  741,    0,  740,  747,  743,    0,  740,  743,
+        0,  745,  742,  745,    0,  741,  741,    0,    0,  747,
+      743,    0,  742,  750,  742,    0,    0,  742,  750,  747,
+      743,    0,  746,    0,  747,  743,  746,  746,  743,    0,
+      742,    0,  750,    0,  745,    0,  745,  747,  743,  745,
+
+        0,  746,  750,    0,    0,    0,    0,  750,    0,  745,
+        0,  746,    0,  745,  751,  746,  746,    0,  751,  751,
+      750,    0,    0,  745,    0,  745,  762,    0,  745,  746,
+        0,  762,    0,  751,  761,    0,  761,  745,    0,  761,
+        0,  745,    0,  751,    0,  762,  762,  751,  751,    0,
+        0,  763,    0,  761,    0,  762,  763,  763,    0,    0,
+      762,  751,    0,  761,    0,  761,    0,    0,  761,    0,
+      763,  764,  765,  762,  762,  764,  764,  765,  766,    0,
+      763,  761,  766,  766,    0,  763,  763,    0,    0,  765,
+      764,  765,    0,    0,  771,    0,    0,  766,  763,  771,
+
+      764,  765,    0,  767,  764,  764,  765,  766,  767,    0,
+      768,  766,  766,  771,  772,  768,  772,  765,  764,  765,
+      767,  768,  767,  771,  772,  766,  773,    0,  771,  768,
+        0,  773,  767,    0,    0,    0,    0,  767,    0,  768,
+      773,  771,    0,    0,  768,  773,  774,  772,  767,  768,
+      767,  774,  772,    0,  774,  773,    0,  768,  775,    0,
+      773,    0,  775,  775,    0,  774,  772,  776,  773,  778,
+        0,  776,  776,  773,  778,  774,  772,  775,    0,    0,
+      774,  772,    0,  774,    0,    0,  776,  775,  778,    0,
+      777,  775,  775,  774,  772,  777,  776,    0,  778,  779,
+
+      776,  776,    0,  778,  779,  775,    0,  777,    0,  777,
+      780,    0,    0,    0,  776,  780,  778,  779,  779,  777,
+        0,  780,  781,    0,  777,    0,    0,  781,  779,  780,
+        0,  782,    0,  779,    0,  777,  782,  777,    0,  780,
+        0,  781,  783,  784,  780,  779,  779,  783,  784,  780,
+      782,  781,    0,  785,    0,  785,  781,  780,    0,    0,
+      782,  783,  784,  786,    0,  782,    0,    0,  786,  781,
+        0,  783,  784,    0,  787,    0,  783,  784,  782,  787,
+        0,  786,  786,  788,    0,    0,  785,    0,  788,  783,
+      784,  785,  786,  787,  789,    0,    0,  786,  787,  789,
+
+        0,  785,  788,  787,    0,  785,    0,    0,  787,  786,
+      786,    0,  788,  789,    0,  785,    0,  788,    0,  790,
+      785,  787,    0,  789,  790,    0,  787,  791,  789,  785,
+      788,  791,  791,  785,    0,    0,  790,    0,  790,  792,
+        0,  789,    0,    0,  792,    0,  791,    0,  790,    0,
+        0,  792,    0,  790,    0,    0,  791,    0,  792,    0,
+      791,  791,  793,    0,  790,    0,  790,  793,  792,    0,
+      795,  796,    0,  792,  791,  795,  796,    0,  795,  792,
+        0,  793,  797,    0,    0,    0,  792,  797,    0,  795,
+      796,  793,    0,  798,    0,  799,  793,  799,  798,  795,
+
+      796,  797,    0,    0,  795,  796,    0,  795,    0,  793,
+        0,  797,  798,    0,    0,    0,  797,  795,  796,  800,
+      801,    0,  798,    0,  800,  801,  816,  798,  799,  797,
+      799,  816,    0,  799,    0,    0,    0,    0,  800,  801,
+      798,    0,    0,    0,    0,  816,    0,  799,  800,  801,
+        0,  817,    0,  800,  801,  816,  817,  799,    0,  799,
+      816,    0,  799,    0,  817,    0,  800,  801,    0,  818,
+      817,  818,    0,  816,  842,  799,  802,  802,  802,  802,
+      817,    0,    0,    0,    0,  817,    0,    0,    0,    0,
+      819,  842,  817,    0,    0,  819,  842,    0,  817,    0,
+
+        0,    0,  818,    0,    0,    0,    0,  818,    0,  819,
+      842,  802,  802,    0,    0,  802,    0,  802,    0,  819,
+      842,  818,    0,    0,  819,  842,    0,    0,  802,  802,
+        0,  818,    0,    0,    0,    0,  818,  819,  842,    0,
+      802,  802,    0,    0,  802,    0,  802,    0,    0,  818,
+        0,    0,    0,    0,    0,    0,  802,  802,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  828,  841,  841,
+      841,  841,  841,  841,  841,  841,  841,  841,    0,    0,
+        0,    0,    0,    0,  828,  828,  828,  828,  828,  828,
+      828,  828,  828,  828,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  843,    0,  844,    0,  847,  843,  844,
+      844,  845,  847,  845,  846,    0,  845,    0,  846,  846,
+        0,    0,  843,    0,  844,    0,  847,    0,    0,    0,
+      845,    0,  843,  846,  844,    0,  847,  843,  844,  844,
+
+      845,  847,  845,  846,  849,  845,    0,  846,  846,  849,
+      843,  848,  844,    0,  847,  848,  848,    0,  845,    0,
+      850,  846,    0,  849,    0,  850,    0,  853,    0,    0,
+      848,  854,  853,  849,  850,    0,  854,    0,  849,  850,
+      848,  853,    0,    0,  848,  848,  853,    0,  854,  850,
+      854,  849,  855,    0,  850,    0,  853,  855,  848,    0,
+      854,  853,  850,  858,    0,  854,    0,  850,  858,  853,
+        0,  855,  866,    0,  853,    0,  854,  866,  854,    0,
+      858,  855,  858,  867,    0,    0,  855,    0,  867,    0,
+        0,  866,  858,    0,  867,    0,    0,  858,    0,  855,
+
+        0,  866,  867,    0,  868,    0,  866,    0,  858,  868,
+      858,    0,  867,  869,    0,  869,    0,  867,  869,  866,
+        0,  868,  867,  868,    0,    0,    0,    0,    0,  870,
+      867,    0,  869,  868,  870,  871,    0,    0,  868,    0,
+      871,    0,  869,  870,  869,    0,    0,  869,  870,  868,
+        0,  868,    0,    0,  871,    0,    0,    0,  870,    0,
+      869,  872,    0,  870,  871,  872,  872,    0,  873,  871,
+      874,  870,  873,  873,    0,  874,  870,    0,    0,    0,
+      872,  874,  871,    0,    0,    0,    0,  873,    0,  874,
+      872,  878,    0,  877,  872,  872,  878,  873,  877,  874,
+
+        0,  873,  873,    0,  874,    0,  877,    0,  872,  874,
+      878,    0,  877,  879,  880,  873,  881,  874,  879,  880,
+      878,  881,  877,    0,    0,  878,    0,  877,    0,    0,
+        0,    0,  879,  880,  877,  881,  882,    0,  878,    0,
+      877,  882,  879,  880,  882,  881,    0,  879,  880,    0,
+      881,    0,  883,  886,    0,  882,    0,  883,  886,  885,
+      879,  880,    0,  881,  885,  882,    0,    0,    0,    0,
+      882,  883,  886,  882,    0,    0,  885,    0,  885,  887,
+        0,  883,  886,  882,  887,    0,  883,  886,  885,    0,
+      888,  890,    0,  885,    0,  888,  890,    0,  887,  883,
+
+      886,  888,  891,    0,  885,    0,  885,  891,  887,  888,
+      890,  889,    0,  887,    0,  889,  889,    0,    0,  888,
+      890,  891,  892,  897,  888,  890,  887,  892,  897,  888,
+      889,  891,    0,    0,  895,    0,  891,  888,  890,  895,
+      889,  892,  897,  906,  889,  889,    0,    0,  906,  891,
+        0,  892,  897,  895,    0,  895,  892,  897,  889,  898,
+        0,    0,  906,  895,  898,    0,  907,  898,  895,  892,
+      897,  907,  906,    0,    0,    0,    0,  906,  898,    0,
+        0,  895,    0,  895,  907,  907,    0,    0,  898,  909,
+      906,  909,    0,  898,  909,  907,  898,    0,    0,    0,
+
+      907,    0,    0,    0,    0,    0,  898,  914,  909,    0,
+        0,    0,  907,  907,    0,    0,  917,  917,  909,    0,
+      909,  917,    0,  909,  914,  914,  914,  914,  914,  914,
+      914,  914,  914,  914,    0,  917,  909,  918,    0,  919,
+        0,    0,  918,  919,  919,  917,  917,    0,  920,    0,
+      917,    0,    0,  920,    0,    0,  918,    0,  919,    0,
+        0,    0,    0,  917,    0,  920,  918,  920,  919,  921,
+      922,  918,  919,  919,  921,  922,    0,  920,  923,    0,
+        0,    0,  920,  923,  918,    0,  919,    0,  921,  922,
+        0,  923,    0,  920,    0,  920,    0,  923,  921,  922,
+
+        0,  927,    0,  921,  922,  928,  927,  923,    0,  928,
+      928,    0,  923,  927,    0,    0,  921,  922,    0,  923,
+      927,  938,    0,    0,  928,  923,  938,  930,  940,  938,
+      927,  930,  930,  940,  928,  927,    0,    0,  928,  928,
+      938,  927,    0,    0,    0,    0,  930,  940,  927,    0,
+      938,    0,  928,    0,    0,  938,  930,  940,  938,  939,
+      930,  930,  940,  939,  939,  941,  942,    0,  938,    0,
+      941,  942,    0,    0,  930,  940,    0,    0,  939,    0,
+        0,    0,  943,    0,  941,  942,  942,  943,  939,    0,
+        0,  944,  939,  939,  941,  942,  944,    0,    0,  941,
+
+      942,  943,  945,    0,  944,    0,  939,  945,    0,    0,
+      944,  943,  941,  942,  942,    0,  943,    0,  951,    0,
+      944,  945,  952,  951,    0,  944,    0,  952,    0,  943,
+        0,  945,  944,    0,    0,    0,  945,  951,  944,  955,
+        0,  952,    0,  953,  955,  953,    0,  951,  953,  945,
+        0,  952,  951,  955,    0,    0,  952,    0,  955,  956,
+        0,    0,  953,    0,  956,  951,  957,    0,  955,  952,
+      958,  957,  953,  955,  953,  958,    0,  953,  956,    0,
+        0,  955,    0,    0,    0,  957,  955,  958,  956,  958,
+      953,    0,  960,  956,    0,  957,  960,  960,    0,  958,
+
+      957,    0,    0,  963,  958,    0,  956,    0,  963,  962,
+        0,  960,    0,  957,  962,  958,  963,  958,    0,    0,
+        0,  960,  963,    0,    0,  960,  960,  962,  962,  969,
+        0,    0,  963,    0,  969,  970,    0,  963,  962,  960,
+      970,  971,    0,  962,  963,  971,  971,    0,  969,  969,
+      963,    0,  976,    0,  970,  962,  962,  976,  969,    0,
+      971,  975,    0,  969,  970,    0,  975,    0,  977,  970,
+      971,  976,  975,  977,  971,  971,  969,  969,    0,    0,
+      975,  976,  970,    0,  979,    0,  976,  977,  971,  979,
+      975,    0,    0,  985,    0,  975,    0,  977,  985,  976,
+
+      975,  978,  977,  979,  982,  978,  978,    0,  975,  982,
+        0,    0,  985,  979,    0,  977,    0,    0,  979,  982,
+      978,    0,  985,  982,  983,    0,  983,  985,    0,  983,
+      978,  979,    0,  982,  978,  978,    0,    0,  982,    0,
+      985,  993,    0,  983,  994,  992,  993,  982,  978,  994,
+      992,  982,    0,  983,    0,  983,  994,    0,  983,  992,
+      993,  995,    0,  994,  992,    0,  995,  996,    0,    0,
+      993,  983,  996,  994,  992,  993,    0,    0,  994,  992,
+      995,    0,    0,    0,  994,    0,  996,  992,  993,    0,
+      995,  994,  992, 1004,    0,  995,  996,  997, 1004,  997,
+
+     1007,  996,  997,    0, 1006, 1007, 1006,    0,  995, 1006,
+        0,    0, 1004,    0,  996,    0,  997,    0,    0, 1007,
+     1009,    0, 1004, 1006,    0, 1009,  997, 1004,  997, 1007,
+        0,  997,    0, 1006, 1007, 1006,    0, 1011, 1006, 1009,
+     1004, 1011, 1011,    0,  997,    0,    0, 1007,    0, 1009,
+        0, 1006,    0, 1012, 1009,    0, 1011, 1012, 1012,    0,
+     1020,    0,    0,    0, 1019, 1020, 1011, 1009,    0, 1019,
+     1011, 1011, 1012,    0,    0, 1019, 1025,    0,    0, 1020,
+     1025, 1025, 1012, 1019, 1011, 1026, 1012, 1012,    0, 1020,
+     1026,    0,    0, 1019, 1020, 1025,    0, 1029, 1019,    0,
+
+     1012,    0, 1029, 1019, 1026, 1025,    0, 1020, 1029, 1025,
+     1025, 1019,    0,    0, 1026,    0, 1029,    0,    0, 1026,
+     1030,    0, 1037, 1025, 1038, 1030, 1029, 1037, 1030, 1038,
+        0, 1029, 1026,    0,    0, 1037, 1029,    0,    0, 1030,
+        0, 1037,    0, 1038, 1029,    0,    0, 1039,    0, 1030,
+        0, 1037, 1039, 1038, 1030, 1039, 1037, 1030, 1038, 1047,
+        0,    0,    0, 1037, 1047,    0, 1039, 1030, 1040, 1037,
+     1044, 1038, 1040, 1040, 1044, 1044, 1039,    0, 1047,    0,
+        0, 1039,    0,    0, 1039,    0,    0, 1040, 1047, 1044,
+     1048, 1054,    0, 1047, 1039, 1048, 1054, 1040,    0, 1044,
+
+        0, 1040, 1040, 1044, 1044,    0, 1047, 1059,    0, 1048,
+     1054,    0, 1059,    0,    0, 1040, 1063, 1044,    0, 1048,
+     1054, 1063,    0, 1062, 1048, 1054, 1059, 1062, 1062,    0,
+        0,    0,    0,    0, 1063, 1063, 1059, 1048, 1054, 1067,
+        0, 1059, 1062,    0, 1067, 1063, 1068,    0, 1069,    0,
+     1063, 1068, 1062, 1069, 1059,    0, 1062, 1062, 1067, 1068,
+        0,    0, 1063, 1063,    0, 1068,    0, 1069, 1067, 1073,
+     1062, 1080, 1073, 1067, 1073, 1068, 1080, 1069,    0,    0,
+     1068,    0, 1069,    0,    0,    0, 1067, 1068, 1073,    0,
+     1080, 1087,    0, 1068, 1088, 1069, 1087,    0, 1073, 1088,
+
+     1080, 1073, 1088, 1073,    0, 1080,    0,    0,    0,    0,
+     1087,    0,    0, 1088, 1087,    0, 1073, 1091, 1080,    0,
+     1087, 1091, 1091, 1088, 1095, 1087,    0,    0, 1088, 1095,
+        0, 1088,    0,    0,    0,    0, 1091,    0, 1087,    0,
+     1105, 1088, 1087, 1095, 1095, 1105, 1091, 1106,    0, 1108,
+     1091, 1091, 1106, 1095, 1108,    0,    0,    0, 1095, 1105,
+        0, 1106,    0,    0, 1091,    0, 1106,    0, 1108, 1105,
+        0, 1095, 1095,    0, 1105,    0, 1106,    0, 1108,    0,
+        0, 1106,    0, 1108,    0,    0,    0, 1105,    0, 1106,
+        0,    0,    0,    0, 1106,    0, 1108, 1109, 1109, 1109,
+
+        0,    0, 1109, 1109,    0, 1109,    0,    0,    0, 1109,
+     1109,    0,    0, 1109,    0,    0, 1109, 1109, 1109, 1109,
+     1109, 1109, 1109, 1109, 1109, 1112, 1122,    0,    0,    0,
+     1112, 1122,    0,    0,    0,    0,    0,    0,    0, 1122,
+        0,    0, 1112,    0, 1112, 1122,    0,    0,    0,    0,
+        0,    0,    0,    0, 1112, 1122,    0,    0,    0, 1112,
+     1122,    0,    0,    0,    0,    0,    0, 1122,    0,    0,
+     1112,    0, 1112, 1122, 1126, 1126, 1126,    0,    0, 1126,
+     1126,    0, 1126,    0, 1128, 1126, 1126, 1126, 1128, 1128,
+     1126,    0,    0, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
+
+     1126, 1126,    0, 1128, 1133, 1137,    0,    0,    0, 1133,
+     1137,    0,    0, 1128,    0,    0,    0, 1128, 1128,    0,
+        0,    0,    0, 1133, 1137,    0,    0,    0,    0,    0,
+        0, 1128,    0, 1133, 1137,    0,    0,    0, 1133, 1137,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0, 1133, 1137, 1162, 1162, 1162, 1162, 1162, 1162, 1162,
+     1162, 1162, 1162, 1162, 1162, 1163, 1163, 1163, 1163, 1163,
+     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164,    0,
+     1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1165,
+     1165,    0, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165,
+
+     1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166,
+     1166, 1166, 1166, 1167, 1167, 1167, 1167, 1167, 1167, 1167,
+     1167, 1167, 1167, 1167, 1167, 1168, 1168, 1169, 1169, 1169,
+     1169, 1169, 1169, 1169, 1169, 1170, 1170, 1170, 1170, 1170,
+     1170, 1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171, 1171,
+     1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1172,
+     1172, 1172, 1172, 1172, 1172,    0, 1172, 1172, 1172,    0,
+     1172, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173,
+     1173, 1173, 1173, 1174,    0,    0, 1174, 1175, 1175, 1175,
+        0,    0, 1175,    0, 1175, 1175,    0, 1175, 1175, 1176,
+
+     1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
+     1176, 1177, 1177,    0, 1177, 1177, 1177, 1177, 1177, 1177,
+     1177, 1177, 1177, 1178, 1178, 1178, 1178, 1178, 1178,    0,
+     1178, 1178, 1178,    0, 1178, 1179, 1179, 1179, 1179, 1179,
+     1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, 1180, 1180,
+     1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1181,
+        0,    0, 1181, 1182,    0,    0,    0, 1182,    0,    0,
+        0,    0,    0, 1182, 1183, 1183, 1183, 1183, 1183, 1183,
+     1183, 1183, 1183, 1183, 1183, 1183, 1184, 1184,    0, 1184,
+     1184, 1184, 1184, 1184, 1184, 1184, 1184, 1184, 1185, 1185,
+
+        0, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185,
+     1186, 1186,    0, 1186, 1186, 1186, 1186, 1186, 1186, 1186,
+     1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+     1187, 1187, 1187, 1187, 1188, 1188, 1188, 1188, 1188, 1188,
+     1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1189,
+     1189, 1189, 1189, 1189, 1189, 1189, 1189, 1189, 1190, 1190,
+     1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190,
+     1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191,
+     1191, 1191, 1192, 1192,    0, 1192, 1192, 1192, 1192, 1192,
+     1192, 1192, 1192, 1192, 1193, 1193, 1193, 1193, 1193, 1193,
+
+     1193, 1193, 1193, 1193, 1193, 1193, 1194, 1194, 1194, 1194,
+     1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1195, 1195,
+        0, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
+     1196, 1196,    0, 1196, 1196, 1196, 1196, 1196, 1196, 1196,
+     1196, 1196, 1197, 1197,    0, 1197, 1197, 1197, 1197, 1197,
+     1197, 1197, 1197, 1197, 1198, 1198,    0, 1198, 1198, 1198,
+     1198, 1198, 1198, 1198, 1198, 1198, 1199, 1199,    0, 1199,
+     1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1200,
+     1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200,
+     1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201,
+
+     1201, 1201, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1202,
+     1202, 1202, 1202, 1202, 1203, 1203, 1203, 1203, 1203, 1203,
+     1203, 1203, 1203, 1203, 1203, 1203, 1204, 1204, 1204, 1204,
+     1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1205, 1205,
+     1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205,
+     1206, 1206,    0, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1207, 1207,    0, 1207, 1207, 1207, 1207, 1207,
+     1207, 1207, 1207, 1207, 1208, 1208, 1208, 1208, 1208, 1208,
+     1208, 1208, 1208, 1208, 1208, 1208, 1209, 1209, 1209, 1209,
+     1209, 1209, 1209, 1209, 1209, 1209, 1209, 1209, 1210, 1210,
+
+     1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210,
+     1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211,
+     1211, 1211, 1212, 1212, 1212, 1212, 1212, 1212, 1212, 1212,
+     1212, 1212, 1212, 1212, 1213, 1213, 1213, 1213, 1213, 1213,
+     1213, 1213, 1213, 1213, 1213, 1213, 1214, 1214, 1214, 1214,
+     1214, 1214, 1214, 1214, 1214, 1214, 1214, 1214, 1161, 1161,
      1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
-     1161, 1161, 1161, 1161, 1162, 1162,  389, 1162, 1162, 1162,
-     1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162,
-     1162, 1163, 1163,  375, 1163, 1163, 1163, 1163, 1163, 1163,
-     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164,
-     1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
-     1164, 1164, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1165,
-
-     1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165,
-     1165, 1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166,
-     1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1167,
-      374, 1167,  372, 1167, 1167, 1168, 1168,  371, 1168, 1168,
-     1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
-     1168, 1168, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
-     1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1170,
-     1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170,
-     1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171,  365, 1171,
-     1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
-
-     1171, 1171, 1171, 1172, 1172,  358, 1172, 1172, 1172, 1172,
-     1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
-     1173, 1173,  353, 1173, 1173, 1173, 1173, 1173, 1173, 1173,
-     1173, 1173, 1173, 1173, 1173, 1173, 1173, 1174, 1174, 1174,
-     1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174,
-     1174, 1174, 1174, 1174, 1175, 1175, 1175, 1175, 1175, 1175,
-     1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175,
-     1175, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
-     1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1177, 1177,
-     1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177,
-
-     1177, 1177, 1177, 1177, 1177, 1178, 1178, 1178, 1178, 1178,
-     1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178,
-     1178, 1178, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179,
-     1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179,  345,
-      344,  334,  333,  332,  331,  330,  329,  328,  326,  262,
-      244,  243,  237,  236,  235,  233,  232,  231,  230,  228,
-      213,  212,  210,  209,  204,  198,  195,  192,  178,  173,
-      171,  170,  167,  101,  100,   96,   95,   82,   81,   77,
-       76,   75,   69,   68,   63,   58,   13,    7, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161
     } ;
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
+
+extern int fortran_flex_debug;
+int fortran_flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
@@ -11308,7 +9681,6 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+char *fortrantext;
 #line 1 "fortran.lex"
-#define INITIAL 0
 /******************************************************************************/
 /*                                                                            */
@@ -11345,13 +9717,8 @@
 /* version 1.7                                                                */
 /******************************************************************************/
-#define parameter 1
-
-#define character 2
-
-#define donottreat 3
-
-#define fortran77style 4
-
-#define fortran90style 5
+
+
+
+
 
 #line 41 "fortran.lex"
@@ -11359,5 +9726,5 @@
 #include <stdlib.h>
 #include <string.h>
-extern FILE * yyin;
+extern FILE * fortranin;
 #define MAX_INCLUDE_DEPTH 30
 #define tabsize 6
@@ -11381,17 +9748,67 @@
            if (firstpass == 0) \
            {\
-              strcat(curbuf,yytext); \
+              strcat(curbuf,fortrantext); \
               Save_Length(curbuf,38); \
-              strcpy(motparse,yytext);\
+              strcpy(motparse,fortrantext);\
               Save_Length(motparse,32); \
               colnum = colnum + strlen(motparse);\
               ECHO; \
            }\
-           strcpy(motparse1,yytext);\
-           /*printf("yytext = %s\n",yytext);*/\
+           strcpy(motparse1,fortrantext);\
+/*           printf("fortrantext = %s\n",fortrantext);*/\
         /*if ( firstpass == 1 ) 
-                      printf("yytext = %s %d\n",yytext,strlen(yytext));*/\
+                      printf("fortrantext = %s %d\n",fortrantext,strlen(fortrantext));*/\
         }
-#line 1783 "fortran.yy.c"
+#line 2979 "fortran.yy.c"
+
+#define INITIAL 0
+#define parameter 1
+#define character 2
+#define donottreat 3
+#define fortran77style 4
+#define fortran90style 5
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int fortranlex_destroy (void );
+
+int fortranget_debug (void );
+
+void fortranset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE fortranget_extra (void );
+
+void fortranset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *fortranget_in (void );
+
+void fortranset_in  (FILE * in_str  );
+
+FILE *fortranget_out (void );
+
+void fortranset_out  (FILE * out_str  );
+
+yy_size_t fortranget_leng (void );
+
+char *fortranget_text (void );
+
+int fortranget_lineno (void );
+
+void fortranset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
@@ -11401,63 +9818,28 @@
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int fortranwrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
+extern int fortranwrap (void );
 #endif
 #endif
 
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+    static void yyunput (int c,char *buf_ptr  );
+    
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
 #endif
 
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
 #endif
 
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
 #endif
 
@@ -11468,10 +9850,9 @@
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO fwrite( fortrantext, fortranleng, 1, fortranout )
 #endif
 
@@ -11481,19 +9862,33 @@
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
-		int c = '*', n; \
+		int c = '*'; \
+		yy_size_t n; \
 		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			     (c = getc( fortranin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
 		if ( c == '\n' ) \
 			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
+		if ( c == EOF && ferror( fortranin ) ) \
 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 		result = n; \
 		} \
-	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-		  && ferror( yyin ) ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, fortranin))==0 && ferror(fortranin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(fortranin); \
+			} \
+		}\
+\
+
 #endif
 
@@ -11516,12 +9911,18 @@
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
+#define YY_DECL_IS_OURS 1
+
+extern int fortranlex (void);
+
+#define YY_DECL int fortranlex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after fortrantext and fortranleng
  * have been set up.
  */
@@ -11536,25 +9937,27 @@
 
 #define YY_RULE_SETUP \
-	if ( yyleng > 0 ) \
-		yy_current_buffer->yy_at_bol = \
-				(yytext[yyleng - 1] == '\n'); \
+	if ( fortranleng > 0 ) \
+		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+				(fortrantext[fortranleng - 1] == '\n'); \
 	YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-	{
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-
-#line 106 "fortran.lex"
+    
+#line 107 "fortran.lex"
 
   if (infixed) BEGIN(fortran77style) ;
   if (infree) BEGIN(fortran90style)  ;
 
-#line 1942 "fortran.yy.c"
-
-	if ( yy_init )
+#line 3174 "fortran.yy.c"
+
+	if ( !(yy_init) )
 		{
-		yy_init = 0;
+		(yy_init) = 1;
 
 #ifdef YY_USER_INIT
@@ -11562,26 +9965,28 @@
 #endif
 
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
+		if ( ! (yy_start) )
+			(yy_start) = 1;	/* first start state */
+
+		if ( ! fortranin )
+			fortranin = stdin;
+
+		if ( ! fortranout )
+			fortranout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			fortranensure_buffer_stack ();
+			YY_CURRENT_BUFFER_LVALUE =
+				fortran_create_buffer(fortranin,YY_BUF_SIZE );
+		}
+
+		fortran_load_buffer_state( );
 		}
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
+		yy_cp = (yy_c_buf_p);
+
+		/* Support of fortrantext. */
+		*yy_cp = (yy_hold_char);
 
 		/* yy_bp points to the position in yy_ch_buf of the start of
@@ -11590,5 +9995,5 @@
 		yy_bp = yy_cp;
 
-		yy_current_state = yy_start;
+		yy_current_state = (yy_start);
 		yy_current_state += YY_AT_BOL();
 yy_match:
@@ -11598,11 +10003,11 @@
 			if ( yy_accept[yy_current_state] )
 				{
-				yy_last_accepting_state = yy_current_state;
-				yy_last_accepting_cpos = yy_cp;
+				(yy_last_accepting_state) = yy_current_state;
+				(yy_last_accepting_cpos) = yy_cp;
 				}
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 1124 )
+				if ( yy_current_state >= 1162 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
@@ -11610,5 +10015,5 @@
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 4189 );
+		while ( yy_base[yy_current_state] != 9159 );
 
 yy_find_action:
@@ -11616,6 +10021,6 @@
 		if ( yy_act == 0 )
 			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			yy_act = yy_accept[yy_current_state];
 			}
@@ -11623,7 +10028,5 @@
 		YY_DO_BEFORE_ACTION;
 
-
 do_action:	/* This label is used only to access EOF actions. */
-
 
 		switch ( yy_act )
@@ -11631,94 +10034,99 @@
 			case 0: /* must back up */
 			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			*yy_cp = (yy_hold_char);
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			goto yy_find_action;
 
 case 1:
 YY_RULE_SETUP
-#line 110 "fortran.lex"
+#line 111 "fortran.lex"
 return TOK_DEBUT;
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 111 "fortran.lex"
+#line 112 "fortran.lex"
 return TOK_FIN;
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 112 "fortran.lex"
+#line 113 "fortran.lex"
 return TOK_OMP;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 113 "fortran.lex"
+#line 114 "fortran.lex"
 return TOK_DOLLAR;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 115 "fortran.lex"
+#line 116 "fortran.lex"
 {return TOK_REAL8;}
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 116 "fortran.lex"
+#line 117 "fortran.lex"
 {return TOK_SUBROUTINE;}
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 117 "fortran.lex"
+#line 118 "fortran.lex"
 {return TOK_PROGRAM;}
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 118 "fortran.lex"
+#line 119 "fortran.lex"
 {inallocate = 1; return TOK_ALLOCATE;}
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 119 "fortran.lex"
+#line 120 "fortran.lex"
+{return TOK_NULLIFY;}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 121 "fortran.lex"
 {inallocate = 1; return TOK_DEALLOCATE;}
 	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 120 "fortran.lex"
+case 11:
+YY_RULE_SETUP
+#line 122 "fortran.lex"
 {return TOK_RESULT;}
 	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 121 "fortran.lex"
+case 12:
+YY_RULE_SETUP
+#line 123 "fortran.lex"
 {return TOK_FUNCTION;}
 	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 122 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDSUBROUTINE;}
-	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 123 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDPROGRAM;}
+#line 124 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDSUBROUTINE;}
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 124 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDFUNCTION;}
+#line 125 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDPROGRAM;}
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 125 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDUNIT;}
+#line 126 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDFUNCTION;}
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 126 "fortran.lex"
+#line 127 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDUNIT;}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 128 "fortran.lex"
 return TOK_INCLUDE;
 	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 127 "fortran.lex"
+case 18:
+YY_RULE_SETUP
+#line 129 "fortran.lex"
 {
-                            strcpy(yylval.na,yytext);
+                            strcpy(yylval.na,fortrantext);
                             tmpc = input();
                             unput(tmpc);
@@ -11737,758 +10145,778 @@
                          }
 	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 144 "fortran.lex"
+case 19:
+YY_RULE_SETUP
+#line 146 "fortran.lex"
 {return TOK_REWIND;}
 	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 145 "fortran.lex"
+case 20:
+YY_RULE_SETUP
+#line 147 "fortran.lex"
 return TOK_IMPLICIT;
 	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 146 "fortran.lex"
+case 21:
+YY_RULE_SETUP
+#line 148 "fortran.lex"
 return TOK_NONE;
 	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 147 "fortran.lex"
+case 22:
+YY_RULE_SETUP
+#line 149 "fortran.lex"
 return TOK_CALL;
 	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 148 "fortran.lex"
+case 23:
+YY_RULE_SETUP
+#line 150 "fortran.lex"
 return TOK_TRUE;
 	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 149 "fortran.lex"
+case 24:
+YY_RULE_SETUP
+#line 151 "fortran.lex"
 return TOK_FALSE;
 	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 150 "fortran.lex"
+case 25:
+YY_RULE_SETUP
+#line 152 "fortran.lex"
 {return TOK_POINT_TO;}
 	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 151 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DASTER;}
-	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 152 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_EQV;}
+#line 153 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DASTER;}
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 153 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_EQ;}
+#line 154 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_EQV;}
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 154 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_GT;}
+#line 155 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_EQ;}
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 155 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_GE;}
+#line 156 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_GT;}
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 156 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LT;}
+#line 157 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_GE;}
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 157 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LE;}
+#line 158 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LT;}
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 158 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NEQV;}
+#line 159 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LE;}
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 159 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NE;}
+#line 160 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NEQV;}
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 160 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NOT;}
+#line 161 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NE;}
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 161 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_OR;}
+#line 162 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NOT;}
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 162 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_XOR;}
+#line 163 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_OR;}
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 163 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_AND;}
+#line 164 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_XOR;}
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 164 "fortran.lex"
+#line 165 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_AND;}
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 166 "fortran.lex"
 {return TOK_MODULE;}
 	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 165 "fortran.lex"
+case 40:
+YY_RULE_SETUP
+#line 167 "fortran.lex"
 {return TOK_DOWHILE;}
 	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 166 "fortran.lex"
+case 41:
+YY_RULE_SETUP
+#line 168 "fortran.lex"
 return TOK_ENDMODULE;
 	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 167 "fortran.lex"
+case 42:
+YY_RULE_SETUP
+#line 169 "fortran.lex"
 return TOK_ENDDO;
 	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 168 "fortran.lex"
+case 43:
+YY_RULE_SETUP
+#line 170 "fortran.lex"
 {return TOK_PLAINDO;}
 	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 169 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_REAL;}
-	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 170 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_INTEGER;}
+#line 171 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_REAL;}
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 171 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LOGICAL;}
+#line 172 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_INTEGER;}
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 172 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHARACTER;}
+#line 173 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LOGICAL;}
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 173 "fortran.lex"
+#line 174 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHARACTER;}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 175 "fortran.lex"
 {return TOK_ALLOCATABLE;}
 	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 174 "fortran.lex"
+case 49:
+YY_RULE_SETUP
+#line 176 "fortran.lex"
 return TOK_CLOSE;
 	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 175 "fortran.lex"
+case 50:
+YY_RULE_SETUP
+#line 177 "fortran.lex"
 return TOK_INQUIRE;
 	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 176 "fortran.lex"
+case 51:
+YY_RULE_SETUP
+#line 178 "fortran.lex"
 {return TOK_DIMENSION;}
 	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 177 "fortran.lex"
+case 52:
+YY_RULE_SETUP
+#line 179 "fortran.lex"
 return TOK_PAUSE;
 	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 178 "fortran.lex"
+case 53:
+YY_RULE_SETUP
+#line 180 "fortran.lex"
 return TOK_EQUIVALENCE;
 	YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 179 "fortran.lex"
+case 54:
+YY_RULE_SETUP
+#line 181 "fortran.lex"
 return TOK_STOP;
 	YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 180 "fortran.lex"
+case 55:
+YY_RULE_SETUP
+#line 182 "fortran.lex"
 return TOK_WHERE;
 	YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 181 "fortran.lex"
+case 56:
+YY_RULE_SETUP
+#line 183 "fortran.lex"
 return TOK_ENDWHERE;
 	YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 182 "fortran.lex"
+case 57:
+YY_RULE_SETUP
+#line 184 "fortran.lex"
 return TOK_ELSEWHERE;
 	YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 183 "fortran.lex"
+case 58:
+YY_RULE_SETUP
+#line 185 "fortran.lex"
 {return TOK_COMPLEX;}
 	YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 184 "fortran.lex"
+case 59:
+YY_RULE_SETUP
+#line 186 "fortran.lex"
 {return TOK_CONTAINS;}
 	YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 185 "fortran.lex"
+case 60:
+YY_RULE_SETUP
+#line 187 "fortran.lex"
 {return TOK_ONLY;}
 	YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 186 "fortran.lex"
+case 61:
+YY_RULE_SETUP
+#line 188 "fortran.lex"
 {return TOK_PARAMETER;}
 	YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 187 "fortran.lex"
+case 62:
+YY_RULE_SETUP
+#line 189 "fortran.lex"
 {return TOK_RECURSIVE;}
 	YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 188 "fortran.lex"
+case 63:
+YY_RULE_SETUP
+#line 190 "fortran.lex"
 {return TOK_COMMON;}
 	YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 189 "fortran.lex"
+case 64:
+YY_RULE_SETUP
+#line 191 "fortran.lex"
 {return TOK_GLOBAL;}
 	YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 190 "fortran.lex"
+case 65:
+YY_RULE_SETUP
+#line 192 "fortran.lex"
 {return TOK_EXTERNAL;}
 	YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 191 "fortran.lex"
+case 66:
+YY_RULE_SETUP
+#line 193 "fortran.lex"
 {return TOK_INTENT;}
 	YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 192 "fortran.lex"
+case 67:
+YY_RULE_SETUP
+#line 194 "fortran.lex"
 {return TOK_POINTER;}
 	YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 193 "fortran.lex"
+case 68:
+YY_RULE_SETUP
+#line 195 "fortran.lex"
 {return TOK_OPTIONAL;}
 	YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 194 "fortran.lex"
+case 69:
+YY_RULE_SETUP
+#line 196 "fortran.lex"
 {return TOK_SAVE;}
 	YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 195 "fortran.lex"
+case 70:
+YY_RULE_SETUP
+#line 197 "fortran.lex"
 {return TOK_TYPE;}
 	YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 196 "fortran.lex"
+case 71:
+YY_RULE_SETUP
+#line 198 "fortran.lex"
 {return TOK_TYPEPAR;}
 	YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 197 "fortran.lex"
-{if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,yytext);return TOK_NAME;}}
-	YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 198 "fortran.lex"
+#line 199 "fortran.lex"
+{if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,fortrantext);return TOK_NAME;}}
+	YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 200 "fortran.lex"
 {return TOK_ENDTYPE;}
 	YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 199 "fortran.lex"
+case 74:
+YY_RULE_SETUP
+#line 201 "fortran.lex"
 return TOK_OPEN;
 	YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 200 "fortran.lex"
+case 75:
+YY_RULE_SETUP
+#line 202 "fortran.lex"
 return TOK_RETURN;
 	YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 201 "fortran.lex"
+case 76:
+/* rule 76 can match eol */
+YY_RULE_SETUP
+#line 203 "fortran.lex"
 return TOK_EXIT;
 	YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 202 "fortran.lex"
+case 77:
+YY_RULE_SETUP
+#line 204 "fortran.lex"
 return TOK_PRINT;
 	YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 203 "fortran.lex"
+case 78:
+YY_RULE_SETUP
+#line 205 "fortran.lex"
 {return TOK_PROCEDURE;}
 	YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 204 "fortran.lex"
+case 79:
+YY_RULE_SETUP
+#line 206 "fortran.lex"
 {return TOK_READ;}
 	YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 205 "fortran.lex"
+case 80:
+YY_RULE_SETUP
+#line 207 "fortran.lex"
 {return TOK_NAMELIST;}
 	YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 206 "fortran.lex"
+case 81:
+YY_RULE_SETUP
+#line 208 "fortran.lex"
 {return TOK_WRITE;}
 	YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 207 "fortran.lex"
+case 82:
+YY_RULE_SETUP
+#line 209 "fortran.lex"
 {return TOK_TARGET;}
 	YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 208 "fortran.lex"
+case 83:
+YY_RULE_SETUP
+#line 210 "fortran.lex"
 {return TOK_PUBLIC;}
 	YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 209 "fortran.lex"
+case 84:
+YY_RULE_SETUP
+#line 211 "fortran.lex"
 {return TOK_PRIVATE;}
 	YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 210 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_IN;}
-	YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 211 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DATA;}
+#line 212 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_IN;}
 	YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 212 "fortran.lex"
+#line 213 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DATA;}
+	YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 214 "fortran.lex"
 return TOK_CONTINUE;
 	YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 213 "fortran.lex"
+case 88:
+YY_RULE_SETUP
+#line 215 "fortran.lex"
 {return TOK_PLAINGOTO;}
 	YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 214 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_OUT;}
-	YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 215 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_INOUT;}
+#line 216 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_OUT;}
 	YY_BREAK
 case 90:
 YY_RULE_SETUP
-#line 216 "fortran.lex"
+#line 217 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_INOUT;}
+	YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 218 "fortran.lex"
 {return TOK_INTRINSIC;}
 	YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 217 "fortran.lex"
+case 92:
+YY_RULE_SETUP
+#line 219 "fortran.lex"
 {return TOK_THEN;}
 	YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 218 "fortran.lex"
+case 93:
+YY_RULE_SETUP
+#line 220 "fortran.lex"
 {return TOK_ELSEIF;}
 	YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 219 "fortran.lex"
+case 94:
+YY_RULE_SETUP
+#line 221 "fortran.lex"
 {return TOK_ELSE;}
 	YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 220 "fortran.lex"
+case 95:
+YY_RULE_SETUP
+#line 222 "fortran.lex"
 {return TOK_ENDIF;}
 	YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 221 "fortran.lex"
+case 96:
+YY_RULE_SETUP
+#line 223 "fortran.lex"
 {return TOK_LOGICALIF;}
 	YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 222 "fortran.lex"
+case 97:
+YY_RULE_SETUP
+#line 224 "fortran.lex"
 {return TOK_SUM;}
 	YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 223 "fortran.lex"
+case 98:
+YY_RULE_SETUP
+#line 225 "fortran.lex"
 {return TOK_MAX;}
 	YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 224 "fortran.lex"
+case 99:
+YY_RULE_SETUP
+#line 226 "fortran.lex"
 {return TOK_TANH;}
 	YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 225 "fortran.lex"
+case 100:
+YY_RULE_SETUP
+#line 227 "fortran.lex"
 {return TOK_MAXVAL;}
 	YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 226 "fortran.lex"
+case 101:
+YY_RULE_SETUP
+#line 228 "fortran.lex"
 {return TOK_TRIM;}
 	YY_BREAK
-case 101:
-YY_RULE_SETUP
-#line 227 "fortran.lex"
+case 102:
+YY_RULE_SETUP
+#line 229 "fortran.lex"
 {return TOK_SQRT;}
 	YY_BREAK
-case 102:
-YY_RULE_SETUP
-#line 228 "fortran.lex"
+case 103:
+YY_RULE_SETUP
+#line 230 "fortran.lex"
 {return TOK_SELECTCASE;}
 	YY_BREAK
-case 103:
-YY_RULE_SETUP
-#line 229 "fortran.lex"
+case 104:
+YY_RULE_SETUP
+#line 231 "fortran.lex"
 {return TOK_CASE;}
 	YY_BREAK
-case 104:
-YY_RULE_SETUP
-#line 230 "fortran.lex"
+case 105:
+YY_RULE_SETUP
+#line 232 "fortran.lex"
 {return TOK_CASEDEFAULT;}
 	YY_BREAK
-case 105:
-YY_RULE_SETUP
-#line 231 "fortran.lex"
+case 106:
+YY_RULE_SETUP
+#line 233 "fortran.lex"
 {return TOK_ENDSELECT;}
 	YY_BREAK
-case 106:
-YY_RULE_SETUP
-#line 232 "fortran.lex"
+case 107:
+YY_RULE_SETUP
+#line 234 "fortran.lex"
 {return TOK_FILE;}
 	YY_BREAK
-case 107:
-YY_RULE_SETUP
-#line 233 "fortran.lex"
+case 108:
+YY_RULE_SETUP
+#line 235 "fortran.lex"
 {return TOK_END;}
 	YY_BREAK
-case 108:
-YY_RULE_SETUP
-#line 234 "fortran.lex"
+case 109:
+YY_RULE_SETUP
+#line 236 "fortran.lex"
 {return TOK_ERR;}
 	YY_BREAK
-case 109:
-YY_RULE_SETUP
-#line 235 "fortran.lex"
+case 110:
+YY_RULE_SETUP
+#line 237 "fortran.lex"
 {return TOK_EXIST;}
 	YY_BREAK
-case 110:
-YY_RULE_SETUP
-#line 236 "fortran.lex"
+case 111:
+YY_RULE_SETUP
+#line 238 "fortran.lex"
 {return TOK_MIN;}
 	YY_BREAK
-case 111:
-YY_RULE_SETUP
-#line 237 "fortran.lex"
+case 112:
+YY_RULE_SETUP
+#line 239 "fortran.lex"
 {return TOK_NINT;}
 	YY_BREAK
-case 112:
-YY_RULE_SETUP
-#line 238 "fortran.lex"
+case 113:
+YY_RULE_SETUP
+#line 240 "fortran.lex"
 {return TOK_FLOAT;}
 	YY_BREAK
-case 113:
-YY_RULE_SETUP
-#line 239 "fortran.lex"
+case 114:
+YY_RULE_SETUP
+#line 241 "fortran.lex"
 {return TOK_EXP;}
 	YY_BREAK
-case 114:
-YY_RULE_SETUP
-#line 240 "fortran.lex"
+case 115:
+YY_RULE_SETUP
+#line 242 "fortran.lex"
 {return TOK_COS;}
 	YY_BREAK
-case 115:
-YY_RULE_SETUP
-#line 241 "fortran.lex"
+case 116:
+YY_RULE_SETUP
+#line 243 "fortran.lex"
 {return TOK_COSH;}
 	YY_BREAK
-case 116:
-YY_RULE_SETUP
-#line 242 "fortran.lex"
+case 117:
+YY_RULE_SETUP
+#line 244 "fortran.lex"
 {return TOK_ACOS;}
 	YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 243 "fortran.lex"
+case 118:
+YY_RULE_SETUP
+#line 245 "fortran.lex"
 {return TOK_SIN;}
 	YY_BREAK
-case 118:
-YY_RULE_SETUP
-#line 244 "fortran.lex"
+case 119:
+YY_RULE_SETUP
+#line 246 "fortran.lex"
 {return TOK_SINH;}
 	YY_BREAK
-case 119:
-YY_RULE_SETUP
-#line 245 "fortran.lex"
+case 120:
+YY_RULE_SETUP
+#line 247 "fortran.lex"
 {return TOK_ASIN;}
 	YY_BREAK
-case 120:
-YY_RULE_SETUP
-#line 246 "fortran.lex"
+case 121:
+YY_RULE_SETUP
+#line 248 "fortran.lex"
 {return TOK_LOG;}
 	YY_BREAK
-case 121:
-YY_RULE_SETUP
-#line 247 "fortran.lex"
+case 122:
+YY_RULE_SETUP
+#line 249 "fortran.lex"
 {return TOK_TAN;}
 	YY_BREAK
-case 122:
-YY_RULE_SETUP
-#line 248 "fortran.lex"
+case 123:
+YY_RULE_SETUP
+#line 250 "fortran.lex"
 {return TOK_ATAN;}
 	YY_BREAK
-case 123:
-YY_RULE_SETUP
-#line 249 "fortran.lex"
+case 124:
+YY_RULE_SETUP
+#line 251 "fortran.lex"
 {return TOK_CYCLE;}
 	YY_BREAK
-case 124:
-YY_RULE_SETUP
-#line 250 "fortran.lex"
+case 125:
+YY_RULE_SETUP
+#line 252 "fortran.lex"
 {return TOK_ABS;}
 	YY_BREAK
-case 125:
-YY_RULE_SETUP
-#line 251 "fortran.lex"
+case 126:
+YY_RULE_SETUP
+#line 253 "fortran.lex"
 {return TOK_MOD;}
 	YY_BREAK
-case 126:
-YY_RULE_SETUP
-#line 252 "fortran.lex"
+case 127:
+YY_RULE_SETUP
+#line 254 "fortran.lex"
 {return TOK_SIGN;}
 	YY_BREAK
-case 127:
-YY_RULE_SETUP
-#line 253 "fortran.lex"
+case 128:
+YY_RULE_SETUP
+#line 255 "fortran.lex"
 {return TOK_MINLOC;}
 	YY_BREAK
-case 128:
-YY_RULE_SETUP
-#line 254 "fortran.lex"
+case 129:
+YY_RULE_SETUP
+#line 256 "fortran.lex"
 {return TOK_MAXLOC;}
 	YY_BREAK
-case 129:
-YY_RULE_SETUP
-#line 255 "fortran.lex"
+case 130:
+YY_RULE_SETUP
+#line 257 "fortran.lex"
 {return TOK_MINVAL;}
 	YY_BREAK
-case 130:
-YY_RULE_SETUP
-#line 256 "fortran.lex"
-{return TOK_INTERFACE;}
-	YY_BREAK
 case 131:
 YY_RULE_SETUP
-#line 257 "fortran.lex"
+#line 258 "fortran.lex"
 {return TOK_BACKSPACE;}
 	YY_BREAK
 case 132:
-YY_RULE_SETUP
-#line 258 "fortran.lex"
-{return TOK_ENDINTERFACE;}
-	YY_BREAK
-case 133:
 YY_RULE_SETUP
 #line 259 "fortran.lex"
 {return TOK_LEFTAB;}
 	YY_BREAK
-case 134:
+case 133:
 YY_RULE_SETUP
 #line 260 "fortran.lex"
 {return TOK_RIGHTAB;}
 	YY_BREAK
-case 135:
+case 134:
+/* rule 134 can match eol */
 YY_RULE_SETUP
 #line 261 "fortran.lex"
 {return TOK_FORMAT;}
 	YY_BREAK
+case 135:
+YY_RULE_SETUP
+#line 262 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DOUBLEPRECISION;}
+	YY_BREAK
 case 136:
 YY_RULE_SETUP
-#line 262 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DOUBLEPRECISION;}
+#line 263 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DOUBLECOMPLEX;}
 	YY_BREAK
 case 137:
 YY_RULE_SETUP
-#line 263 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DOUBLECOMPLEX;}
+#line 264 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_SLASH;}
 	YY_BREAK
 case 138:
 YY_RULE_SETUP
-#line 264 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_SLASH;}
+#line 265 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DSLASH;}
 	YY_BREAK
 case 139:
-YY_RULE_SETUP
-#line 265 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DSLASH;}
+/* rule 139 can match eol */
+YY_RULE_SETUP
+#line 266 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_CUT;}
 	YY_BREAK
 case 140:
 YY_RULE_SETUP
-#line 266 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_CUT;}
+#line 267 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_CONSTANT;}
 	YY_BREAK
 case 141:
 YY_RULE_SETUP
-#line 267 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_CONSTANT;}
+#line 268 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_MESSAGE;}
 	YY_BREAK
 case 142:
 YY_RULE_SETUP
-#line 268 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_MESSAGE;}
+#line 269 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_INT;}
 	YY_BREAK
 case 143:
 YY_RULE_SETUP
-#line 269 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_INT;}
+#line 270 "fortran.lex"
+{printf("debug interfacer\n");BEGIN(donottreat);}
 	YY_BREAK
 case 144:
-YY_RULE_SETUP
-#line 270 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NAME;}
+/* rule 144 can match eol */
+YY_RULE_SETUP
+#line 271 "fortran.lex"
+{
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
 	YY_BREAK
 case 145:
 YY_RULE_SETUP
-#line 271 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREAL;}
+#line 278 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NAME;}
 	YY_BREAK
 case 146:
 YY_RULE_SETUP
-#line 272 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREALDP;}
+#line 279 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREAL;}
 	YY_BREAK
 case 147:
 YY_RULE_SETUP
-#line 273 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREALQP;}
+#line 280 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREALDP;}
 	YY_BREAK
 case 148:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 274 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREAL;}
+YY_RULE_SETUP
+#line 281 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREALQP;}
 	YY_BREAK
 case 149:
-YY_RULE_SETUP
-#line 275 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTINT;}
+/* rule 149 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up fortrantext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up fortrantext again */
+YY_RULE_SETUP
+#line 282 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREAL;}
 	YY_BREAK
 case 150:
 YY_RULE_SETUP
-#line 276 "fortran.lex"
+#line 283 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTINT;}
+	YY_BREAK
+case 151:
+YY_RULE_SETUP
+#line 284 "fortran.lex"
 {}
 	YY_BREAK
-case 151:
-YY_RULE_SETUP
-#line 277 "fortran.lex"
+case 152:
+YY_RULE_SETUP
+#line 285 "fortran.lex"
 {return TOK_QUOTE;}
 	YY_BREAK
-case 152:
-YY_RULE_SETUP
-#line 278 "fortran.lex"
+case 153:
+YY_RULE_SETUP
+#line 286 "fortran.lex"
 {}
 	YY_BREAK
-case 153:
-YY_RULE_SETUP
-#line 279 "fortran.lex"
-{strcpy(yylval.na,yytext);return (int) *yytext;}
-	YY_BREAK
 case 154:
 YY_RULE_SETUP
-#line 280 "fortran.lex"
+#line 287 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return (int) *fortrantext;}
+	YY_BREAK
+case 155:
+YY_RULE_SETUP
+#line 288 "fortran.lex"
+{afterpercent = 1; strcpy(yylval.na,fortrantext);return (int) *fortrantext;}
+	YY_BREAK
+case 156:
+YY_RULE_SETUP
+#line 289 "fortran.lex"
 {return TOK_SEMICOLON;}
 	YY_BREAK
-case 155:
-YY_RULE_SETUP
-#line 281 "fortran.lex"
-{return (int) *yytext;}
-	YY_BREAK
-case 156:
-YY_RULE_SETUP
-#line 282 "fortran.lex"
-{return (int) *yytext;}
-	YY_BREAK
 case 157:
 YY_RULE_SETUP
-#line 283 "fortran.lex"
-{return (int) *yytext;}
+#line 290 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 158:
 YY_RULE_SETUP
-#line 284 "fortran.lex"
-{return (int) *yytext;}
+#line 291 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 159:
 YY_RULE_SETUP
-#line 285 "fortran.lex"
-{colnum=0;line_num_fortran++;line_num_fortran_common++; return (int) *yytext;}
+#line 292 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 160:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 286 "fortran.lex"
-
+YY_RULE_SETUP
+#line 293 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 161:
-YY_RULE_SETUP
-#line 287 "fortran.lex"
+/* rule 161 can match eol */
+YY_RULE_SETUP
+#line 294 "fortran.lex"
+{colnum=0;line_num_fortran++;line_num_fortran_common++; return (int) *fortrantext;}
+	YY_BREAK
+case 162:
+*yy_cp = (yy_hold_char); /* undo effects of setting up fortrantext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up fortrantext again */
+YY_RULE_SETUP
+#line 295 "fortran.lex"
+
+	YY_BREAK
+case 163:
+YY_RULE_SETUP
+#line 296 "fortran.lex"
 {if (newlinef90 == 0) return TOK_LABEL; else newlinef90 = 0;}
 	YY_BREAK
-case 162:
-YY_RULE_SETUP
-#line 288 "fortran.lex"
-
-	YY_BREAK
-case 163:
-YY_RULE_SETUP
-#line 289 "fortran.lex"
+case 164:
+YY_RULE_SETUP
+#line 297 "fortran.lex"
+
+	YY_BREAK
+case 165:
+YY_RULE_SETUP
+#line 298 "fortran.lex"
 {colnum=colnum-1+tabsize;}
 	YY_BREAK
-case 164:
-YY_RULE_SETUP
-#line 290 "fortran.lex"
+case 166:
+YY_RULE_SETUP
+#line 299 "fortran.lex"
 ;
 	YY_BREAK
-case 165:
-YY_RULE_SETUP
-#line 291 "fortran.lex"
+case 167:
+/* rule 167 can match eol */
+YY_RULE_SETUP
+#line 300 "fortran.lex"
 {line_num_fortran++;line_num_fortran_common++;newlinef90=1;colnum=0;}
 	YY_BREAK
-case 166:
-YY_RULE_SETUP
-#line 292 "fortran.lex"
+case 168:
+/* rule 168 can match eol */
+YY_RULE_SETUP
+#line 301 "fortran.lex"
 {line_num_fortran++;line_num_fortran_common++;colnum=0;}
 	YY_BREAK
-case 167:
-YY_RULE_SETUP
-#line 293 "fortran.lex"
+case 169:
+/* rule 169 can match eol */
+YY_RULE_SETUP
+#line 302 "fortran.lex"
 {
                            convert2lower(motparse1);
@@ -12499,28 +10927,62 @@
                            else
                            {
-                              colnum=0;line_num_fortran++;line_num_fortran_common++;
-                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) return TOK_DONOTTREAT;
+                            /*  colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
                              if ( !strcasecmp(motparse1,"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
                            }
                          }
 	YY_BREAK
-case 168:
-YY_RULE_SETUP
-#line 306 "fortran.lex"
-BEGIN(donottreat);
-	YY_BREAK
-case 169:
-YY_RULE_SETUP
-#line 307 "fortran.lex"
-BEGIN(INITIAL);
-	YY_BREAK
 case 170:
-YY_RULE_SETUP
-#line 308 "fortran.lex"
-
+/* rule 170 can match eol */
+YY_RULE_SETUP
+#line 317 "fortran.lex"
+{
+                           convert2lower(&motparse1[1]);
+                           if ( strncasecmp(&motparse1[1],"contains",8) == 0 )
+                           {
+                              return TOK_CONTAINS;
+                           }
+                           else
+                           {
+                             /* colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
+                           }
+                         }                            
 	YY_BREAK
 case 171:
-YY_RULE_SETUP
-#line 309 "fortran.lex"
+/* rule 171 can match eol */
+YY_RULE_SETUP
+#line 332 "fortran.lex"
+{
+						BEGIN(donottreat);
+						}
+	YY_BREAK
+case 172:
+/* rule 172 can match eol */
+YY_RULE_SETUP
+#line 335 "fortran.lex"
+{
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
+	YY_BREAK
+case 173:
+/* rule 173 can match eol */
+YY_RULE_SETUP
+#line 342 "fortran.lex"
+{line_num_fortran++;line_num_fortran_common++;}
+	YY_BREAK
+case 174:
+/* rule 174 can match eol */
+YY_RULE_SETUP
+#line 343 "fortran.lex"
 {
                              colnum = 0;
@@ -12529,7 +10991,7 @@
                           }
 	YY_BREAK
-case 172:
-YY_RULE_SETUP
-#line 314 "fortran.lex"
+case 175:
+YY_RULE_SETUP
+#line 348 "fortran.lex"
 {
                              colnum = 0;
@@ -12538,10 +11000,10 @@
                           }
 	YY_BREAK
-case 173:
-YY_RULE_SETUP
-#line 319 "fortran.lex"
+case 176:
+YY_RULE_SETUP
+#line 353 "fortran.lex"
 ECHO;
 	YY_BREAK
-#line 2933 "fortran.yy.c"
+#line 4224 "fortran.yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(parameter):
@@ -12555,24 +11017,24 @@
 		{
 		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
+		*yy_cp = (yy_hold_char);
 		YY_RESTORE_YY_MORE_OFFSET
 
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 			{
 			/* We're scanning a new file or input source.  It's
 			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
+			 * just pointed fortranin at a new source and called
+			 * fortranlex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
 			 * globals.  Here is the right place to do so, because
 			 * this is the first action (other than possibly a
 			 * back-up) that will match for the new input source.
 			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = fortranin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 			}
 
@@ -12584,11 +11046,11 @@
 		 * in input().
 		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			{ /* This was really a NUL. */
 			yy_state_type yy_next_state;
 
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
+			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state(  );
 
 			/* Okay, we're now positioned to make the NUL
@@ -12603,10 +11065,10 @@
 			yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
+			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
 			if ( yy_next_state )
 				{
 				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
+				yy_cp = ++(yy_c_buf_p);
 				yy_current_state = yy_next_state;
 				goto yy_match;
@@ -12615,20 +11077,20 @@
 			else
 				{
-				yy_cp = yy_c_buf_p;
+				yy_cp = (yy_c_buf_p);
 				goto yy_find_action;
 				}
 			}
 
-		else switch ( yy_get_next_buffer() )
+		else switch ( yy_get_next_buffer(  ) )
 			{
 			case EOB_ACT_END_OF_FILE:
 				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
+				(yy_did_buffer_switch_on_eof) = 0;
+
+				if ( fortranwrap( ) )
 					{
 					/* Note: because we've taken care in
 					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
+					 * fortrantext, we can now set up
 					 * yy_c_buf_p so that if some total
 					 * hoser (like flex itself) wants to
@@ -12637,5 +11099,5 @@
 					 * YY_NULL will get returned.
 					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
 					yy_act = YY_STATE_EOF(YY_START);
@@ -12645,5 +11107,5 @@
 				else
 					{
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 					}
@@ -12652,21 +11114,21 @@
 
 			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+					(yytext_ptr) + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_match;
 
 			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_find_action;
 			}
@@ -12679,6 +11141,5 @@
 	} /* end of action switch */
 		} /* end of scanning one token */
-	} /* end of yylex */
-
+} /* end of fortranlex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -12689,19 +11150,18 @@
  *	EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = (yytext_ptr);
 	register int number_to_move, i;
 	int ret_val;
 
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 		YY_FATAL_ERROR(
 		"fatal flex scanner internal error--end of buffer missed" );
 
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 			{
 			/* We matched a single character, the EOB, so
@@ -12723,36 +11183,32 @@
 
 	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
 	for ( i = 0; i < number_to_move; ++i )
 		*(dest++) = *(source++);
 
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 		/* don't do the read, it's not guaranteed to return an EOF,
 		 * just force an EOF
 		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
 	else
 		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
+			yy_size_t num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
 
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
 			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
+				(int) ((yy_c_buf_p) - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				int new_size = b->yy_buf_size * 2;
+				yy_size_t new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
@@ -12763,6 +11219,5 @@
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
+					fortranrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 				}
 			else
@@ -12774,9 +11229,9 @@
 				"fatal error - scanner input buffer overflow" );
 
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
+			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 						number_to_move - 1;
-#endif
+
 			}
 
@@ -12785,16 +11240,16 @@
 
 		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			(yy_n_chars), num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	if ( yy_n_chars == 0 )
+	if ( (yy_n_chars) == 0 )
 		{
 		if ( number_to_move == YY_MORE_ADJ )
 			{
 			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
+			fortranrestart(fortranin  );
 			}
 
@@ -12802,5 +11257,5 @@
 			{
 			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 				YY_BUFFER_EOF_PENDING;
 			}
@@ -12810,36 +11265,43 @@
 		ret_val = EOB_ACT_CONTINUE_SCAN;
 
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fortranrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	(yy_n_chars) += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
 	return ret_val;
-	}
-
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-	{
+    static yy_state_type yy_get_previous_state (void)
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-
-	yy_current_state = yy_start;
+    
+	yy_current_state = (yy_start);
 	yy_current_state += YY_AT_BOL();
 
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 		{
 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 		if ( yy_accept[yy_current_state] )
 			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
+			(yy_last_accepting_state) = yy_current_state;
+			(yy_last_accepting_cpos) = yy_cp;
 			}
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 1124 )
+			if ( yy_current_state >= 1162 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
@@ -12848,6 +11310,5 @@
 
 	return yy_current_state;
-	}
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
@@ -12856,66 +11317,54 @@
  *	next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
 	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
+    	register char *yy_cp = (yy_c_buf_p);
 
 	register YY_CHAR yy_c = 1;
 	if ( yy_accept[yy_current_state] )
 		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
+		(yy_last_accepting_state) = yy_current_state;
+		(yy_last_accepting_cpos) = yy_cp;
 		}
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 1124 )
+		if ( yy_current_state >= 1162 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 1123);
+	yy_is_jam = (yy_current_state == 1161);
 
 	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+	register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
+
+	/* undo effects of setting up fortrantext */
+	*yy_cp = (yy_hold_char);
+
+	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 		{ /* need to shift things up to make room */
 		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
+		register yy_size_t number_to_move = (yy_n_chars) + 2;
+		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
 		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 			*--dest = *--source;
 
 		yy_cp += (int) (dest - source);
 		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
 		}
@@ -12923,23 +11372,22 @@
 	*--yy_cp = (char) c;
 
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
+	(yytext_ptr) = yy_bp;
+	(yy_hold_char) = *yy_cp;
+	(yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
+    static int input  (void)
 #endif
-	{
+
+{
 	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+    
+	*(yy_c_buf_p) = (yy_hold_char);
+
+	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
 		{
 		/* yy_c_buf_p now points to the character we want to return.
@@ -12947,14 +11395,14 @@
 		 * valid NUL; if not, then we've hit the end of the buffer.
 		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
+			*(yy_c_buf_p) = '\0';
 
 		else
 			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
+			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			++(yy_c_buf_p);
+
+			switch ( yy_get_next_buffer(  ) )
 				{
 				case EOB_ACT_LAST_MATCH:
@@ -12970,14 +11418,14 @@
 
 					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
+					fortranrestart(fortranin );
+
+					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( fortranwrap( ) )
+						return 0;
+
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 #ifdef __cplusplus
@@ -12989,5 +11437,5 @@
 
 				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
+					(yy_c_buf_p) = (yytext_ptr) + offset;
 					break;
 				}
@@ -12995,85 +11443,88 @@
 		}
 
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-	yy_current_buffer->yy_at_bol = (c == '\n');
+	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
+	*(yy_c_buf_p) = '\0';	/* preserve fortrantext */
+	(yy_hold_char) = *++(yy_c_buf_p);
+
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
 
 	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void fortranrestart  (FILE * input_file )
+{
+    
+	if ( ! YY_CURRENT_BUFFER ){
+        fortranensure_buffer_stack ();
+		YY_CURRENT_BUFFER_LVALUE =
+            fortran_create_buffer(fortranin,YY_BUF_SIZE );
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
+	fortran_init_buffer(YY_CURRENT_BUFFER,input_file );
+	fortran_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void fortran_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		fortranpop_buffer_state();
+	 *		fortranpush_buffer_state(new_buffer);
+     */
+	fortranensure_buffer_stack ();
+	if ( YY_CURRENT_BUFFER == new_buffer )
 		return;
 
-	if ( yy_current_buffer )
+	if ( YY_CURRENT_BUFFER )
 		{
 		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	fortran_load_buffer_state( );
 
 	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
+	 * EOF (fortranwrap()) processing, but the only time this flag
+	 * is looked at is after fortranwrap() is called, so it's safe
 	 * to go ahead and always set it.
 	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void fortran_load_buffer_state  (void)
+{
+    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	fortranin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	(yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE fortran_create_buffer  (FILE * file, int  size )
+{
 	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+	b = (YY_BUFFER_STATE) fortranalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_create_buffer()" );
 
 	b->yy_buf_size = size;
@@ -13082,77 +11533,72 @@
 	 * we need to put in 2 end-of-buffer characters.
 	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	b->yy_ch_buf = (char *) fortranalloc(b->yy_buf_size + 2  );
 	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_create_buffer()" );
 
 	b->yy_is_our_buffer = 1;
 
-	yy_init_buffer( b, file );
+	fortran_init_buffer(b,file );
 
 	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with fortran_create_buffer()
+ * 
+ */
+    void fortran_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
 	if ( ! b )
 		return;
 
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
+		fortranfree((void *) b->yy_ch_buf  );
+
+	fortranfree((void *) b  );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a fortranrestart() or at EOF.
+ */
+    static void fortran_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+	int oerrno = errno;
+    
+	fortran_flush_buffer(b );
 
 	b->yy_input_file = file;
 	b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
+    /* If b is the current buffer, then fortran_init_buffer was _probably_
+     * called from fortranrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void fortran_flush_buffer (YY_BUFFER_STATE  b )
+{
 	if ( ! b )
 		return;
@@ -13172,20 +11618,116 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
+	if ( b == YY_CURRENT_BUFFER )
+		fortran_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void fortranpush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+    	if (new_buffer == NULL)
+		return;
+
+	fortranensure_buffer_stack();
+
+	/* This block is copied from fortran_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+	{
+		/* Flush out information for old buffer. */
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+		}
+
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		(yy_buffer_stack_top)++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from fortran_switch_to_buffer. */
+	fortran_load_buffer_state( );
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void fortranpop_buffer_state (void)
+{
+    	if (!YY_CURRENT_BUFFER)
+		return;
+
+	fortran_delete_buffer(YY_CURRENT_BUFFER );
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if ((yy_buffer_stack_top) > 0)
+		--(yy_buffer_stack_top);
+
+	if (YY_CURRENT_BUFFER) {
+		fortran_load_buffer_state( );
+		(yy_did_buffer_switch_on_eof) = 1;
 	}
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void fortranensure_buffer_stack (void)
+{
+	yy_size_t num_to_alloc;
+    
+	if (!(yy_buffer_stack)) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+		num_to_alloc = 1;
+		(yy_buffer_stack) = (struct yy_buffer_state**)fortranalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in fortranensure_buffer_stack()" );
+								  
+		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		(yy_buffer_stack_max) = num_to_alloc;
+		(yy_buffer_stack_top) = 0;
+		return;
+	}
+
+	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = (yy_buffer_stack_max) + grow_size;
+		(yy_buffer_stack) = (struct yy_buffer_state**)fortranrealloc
+								((yy_buffer_stack),
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in fortranensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+		(yy_buffer_stack_max) = num_to_alloc;
+	}
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE fortran_scan_buffer  (char * base, yy_size_t  size )
+{
 	YY_BUFFER_STATE b;
-
+    
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
@@ -13194,7 +11736,7 @@
 		return 0;
 
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	b = (YY_BUFFER_STATE) fortranalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_scan_buffer()" );
 
 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
@@ -13208,56 +11750,50 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	yy_switch_to_buffer( b );
+	fortran_switch_to_buffer(b  );
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
+}
+
+/** Setup the input buffer state to scan a string. The next call to fortranlex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       fortran_scan_bytes() instead.
+ */
+YY_BUFFER_STATE fortran_scan_string (yyconst char * yystr )
+{
+    
+	return fortran_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to fortranlex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE fortran_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+{
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n;
-	int i;
-
+	yy_size_t n, i;
+    
 	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
+	n = _yybytes_len + 2;
+	buf = (char *) fortranalloc(n  );
 	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = fortran_scan_buffer(buf,n );
 	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+		YY_FATAL_ERROR( "bad buffer in fortran_scan_bytes()" );
 
 	/* It's okay to grow etc. this buffer, and we should throw it
@@ -13267,59 +11803,5 @@
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
+}
 
 #ifndef YY_EXIT_FAILURE
@@ -13327,16 +11809,9 @@
 #endif
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
+static void yy_fatal_error (yyconst char* msg )
+{
+    	(void) fprintf( stderr, "%s\n", msg );
 	exit( YY_EXIT_FAILURE );
-	}
-
-
+}
 
 /* Redefine yyless() so it works in section 3 code. */
@@ -13346,40 +11821,161 @@
 	do \
 		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
+		/* Undo effects of setting up fortrantext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		fortrantext[fortranleng] = (yy_hold_char); \
+		(yy_c_buf_p) = fortrantext + yyless_macro_arg; \
+		(yy_hold_char) = *(yy_c_buf_p); \
+		*(yy_c_buf_p) = '\0'; \
+		fortranleng = yyless_macro_arg; \
 		} \
 	while ( 0 )
 
-
-/* Internal utility routines. */
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int fortranget_lineno  (void)
+{
+        
+    return fortranlineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *fortranget_in  (void)
+{
+        return fortranin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *fortranget_out  (void)
+{
+        return fortranout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+yy_size_t fortranget_leng  (void)
+{
+        return fortranleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *fortranget_text  (void)
+{
+        return fortrantext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void fortranset_lineno (int  line_number )
+{
+    
+    fortranlineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see fortran_switch_to_buffer
+ */
+void fortranset_in (FILE *  in_str )
+{
+        fortranin = in_str ;
+}
+
+void fortranset_out (FILE *  out_str )
+{
+        fortranout = out_str ;
+}
+
+int fortranget_debug  (void)
+{
+        return fortran_flex_debug;
+}
+
+void fortranset_debug (int  bdebug )
+{
+        fortran_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from fortranlex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    fortranin = stdin;
+    fortranout = stdout;
+#else
+    fortranin = (FILE *) 0;
+    fortranout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * fortranlex_init()
+     */
+    return 0;
+}
+
+/* fortranlex_destroy is for both reentrant and non-reentrant scanners. */
+int fortranlex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		fortran_delete_buffer(YY_CURRENT_BUFFER  );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		fortranpop_buffer_state();
+	}
+
+	/* Destroy the stack itself. */
+	fortranfree((yy_buffer_stack) );
+	(yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * fortranlex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
 	register int i;
 	for ( i = 0; i < n; ++i )
 		s1[i] = s2[i];
-	}
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
+static int yy_flex_strlen (yyconst char * s )
+{
 	register int n;
 	for ( n = 0; s[n]; ++n )
@@ -13387,26 +11983,14 @@
 
 	return n;
-	}
+}
 #endif
 
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
+void *fortranalloc (yy_size_t  size )
+{
 	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
+}
+
+void *fortranrealloc  (void * ptr, yy_size_t  size )
+{
 	/* The cast to (char *) in the following accommodates both
 	 * implementations that use char* generic pointers, and those
@@ -13417,24 +12001,15 @@
 	 */
 	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-#line 319 "fortran.lex"
+}
+
+void fortranfree (void * ptr )
+{
+	free( (char *) ptr );	/* see fortranrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 353 "fortran.lex"
+
 
 
@@ -13443,11 +12018,11 @@
    if (!strcasecmp(curfile,mainfile))
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran,curfile);
+      printf("%s line %d, file %s motclef = %s\n",s,line_num_fortran,curfile,fortrantext);
    }
    else
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran_common,curfile);
+      printf("%s line %d, file %s motclef = %s curbuf = %s\n",s,line_num_fortran_common,curfile,fortrantext,curbuf);
    }
-   /*exit(0);*/
+/*   exit(0);*/
 }
 
@@ -13455,2 +12030,3 @@
 {
 }
+
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.lex
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.lex	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.lex	(revision 2715)
@@ -72,5 +72,5 @@
            }\
            strcpy(motparse1,yytext);\
-           /*printf("yytext = %s\n",yytext);*/\
+/*           printf("yytext = %s\n",yytext);*/\
         /*if ( firstpass == 1 ) 
                       printf("yytext = %s %d\n",yytext,strlen(yytext));*/\
@@ -100,8 +100,9 @@
 
 COMMENTAIRESFORTRAN77 ^([Cc*](([ \t]*\n)|([^AaHhOo\n]{NIMPORTEQUOI}*\n)))
+COMMENTAIRESFORTRAN77_2 \n([Cc*](([ \t]*\n)|([^AaHhOo\n]{NIMPORTEQUOI}*\n)))
 COMMENTAIRESFORTRAN90 ^([ \t]*!{NIMPORTEQUOI}*\n)
 COMMENTAIRESFORTRAN90_2 (!{NIMPORTEQUOI}*)
 NEXTLINEF90 "&"{NIMPORTEQUOI}*[\n]*
-NEXTLINEF77 \n[ \t]{5}("&"|"+"|"$"|"*"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"."|"#")
+NEXTLINEF77 [\n \t]*\n[ \t]{5}("&"|"+"|"$"|"*"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"."|"#")
 %%
   if (infixed) BEGIN(fortran77style) ;
@@ -117,4 +118,5 @@
 program                 {return TOK_PROGRAM;}
 allocate                {inallocate = 1; return TOK_ALLOCATE;}
+nullify			{return TOK_NULLIFY;}
 deallocate              {inallocate = 1; return TOK_DEALLOCATE;}
 result                  {return TOK_RESULT;}
@@ -254,7 +256,5 @@
 maxloc                  {return TOK_MAXLOC;}
 minval                  {return TOK_MINVAL;}
-interface               {return TOK_INTERFACE;}
 backspace               {return TOK_BACKSPACE;}
-end[ \t]*interface      {return TOK_ENDINTERFACE;}
 \({SLASH}               {return TOK_LEFTAB;}
 {SLASH}\)               {return TOK_RIGHTAB;}
@@ -268,4 +268,12 @@
 (\")[^\n"]*(\")         {strcpy(yylval.na,yytext);return TOK_CHAR_MESSAGE;}
 ({NAME}{REAL})          {strcpy(yylval.na,yytext);return TOK_CHAR_INT;}
+^[ \t]*interface        {printf("debug interfacer\n");BEGIN(donottreat);}
+<donottreat>^[ \t]*end[ \t]*interface[ \t]*\n {
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
 {NAME}                  {strcpy(yylval.na,yytext);return TOK_NAME;}
 {REAL}                  {strcpy(yylval.na,yytext);return TOK_CSTREAL;}
@@ -277,5 +285,6 @@
 \'|\"                   {return TOK_QUOTE;}
 \.                      {}
-\(|\)|:|\[|\]|\+|\-|\*|\% {strcpy(yylval.na,yytext);return (int) *yytext;}
+\(|\)|:|\[|\]|\+|\-|\* {strcpy(yylval.na,yytext);return (int) *yytext;}
+\%                     {afterpercent = 1; strcpy(yylval.na,yytext);return (int) *yytext;}
 \;                      {return TOK_SEMICOLON;}
 \,                      {return (int) *yytext;}
@@ -299,12 +308,37 @@
                            else
                            {
-                              colnum=0;line_num_fortran++;line_num_fortran_common++;
-                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) return TOK_DONOTTREAT;
+                            /*  colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
                              if ( !strcasecmp(motparse1,"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
                            }
                          }
-^"!$AGRIF_DO_NOT_TREAT\n" BEGIN(donottreat);
-<donottreat>^"!$AGRIF_END_DO_NOT_TREAT\n" BEGIN(INITIAL);
-<donottreat>.*\n
+<fortran77style>{COMMENTAIRESFORTRAN77_2} {
+                           convert2lower(&motparse1[1]);
+                           if ( strncasecmp(&motparse1[1],"contains",8) == 0 )
+                           {
+                              return TOK_CONTAINS;
+                           }
+                           else
+                           {
+                             /* colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
+                           }
+                         }                            
+^"!$AGRIF_DO_NOT_TREAT"[ \t]*\n {
+						BEGIN(donottreat);
+						}
+<donottreat>^"!$AGRIF_END_DO_NOT_TREAT"[ \t]*\n {
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
+<donottreat>.*\n        {line_num_fortran++;line_num_fortran_common++;}
 {COMMENTAIRESFORTRAN90}   {
                              colnum = 0;
@@ -323,11 +357,11 @@
    if (!strcasecmp(curfile,mainfile))
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran,curfile);
+      printf("%s line %d, file %s motclef = %s\n",s,line_num_fortran,curfile,yytext);
    }
    else
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran_common,curfile);
+      printf("%s line %d, file %s motclef = %s curbuf = %s\n",s,line_num_fortran_common,curfile,yytext,curbuf);
    }
-   /*exit(0);*/
+/*   exit(0);*/
 }
 
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.tab.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.tab.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.tab.c	(revision 2715)
@@ -1,37 +1,429 @@
-#ifndef lint
-static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
-#endif
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING (yyerrflag!=0)
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "2.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+/* Substitute the variable and function names.  */
 #define yyparse fortranparse
 #define yylex fortranlex
 #define yyerror fortranerror
-#define yychar fortranchar
-#define yyval fortranval
 #define yylval fortranlval
+#define yychar  fortranchar
 #define yydebug fortrandebug
 #define yynerrs fortrannerrs
-#define yyerrflag fortranerrflag
-#define yyss fortranss
-#define yyssp fortranssp
-#define yyvs fortranvs
-#define yyvsp fortranvsp
-#define yylhs fortranlhs
-#define yylen fortranlen
-#define yydefred fortrandefred
-#define yydgoto fortrandgoto
-#define yysindex fortransindex
-#define yyrindex fortranrindex
-#define yygindex fortrangindex
-#define yytable fortrantable
-#define yycheck fortrancheck
-#define yyname fortranname
-#define yyrule fortranrule
-#define YYPREFIX "fortran"
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     TOK_BINARY_OP = 258,
+     TOK_NEQV = 259,
+     TOK_EQV = 260,
+     TOK_XOR = 261,
+     TOK_OR = 262,
+     TOK_AND = 263,
+     TOK_NOT = 264,
+     TOK_NE = 265,
+     TOK_EQ = 266,
+     TOK_GE = 267,
+     TOK_LE = 268,
+     TOK_GT = 269,
+     TOK_LT = 270,
+     TOK_UNARY_OP = 271,
+     TOK_DSLASH = 272,
+     TOK_SLASH = 273,
+     TOK_DASTER = 274,
+     TOK_SEP = 275,
+     TOK_SEMICOLON = 276,
+     TOK_NEXTLINE = 277,
+     TOK_PARAMETER = 278,
+     TOK_RESULT = 279,
+     TOK_ONLY = 280,
+     TOK_INCLUDE = 281,
+     TOK_SUBROUTINE = 282,
+     TOK_PROGRAM = 283,
+     TOK_FUNCTION = 284,
+     TOK_OMP = 285,
+     TOK_DOLLAR = 286,
+     TOK_FORMAT = 287,
+     TOK_MAX = 288,
+     TOK_TANH = 289,
+     TOK_WHERE = 290,
+     TOK_ELSEWHERE = 291,
+     TOK_ENDWHERE = 292,
+     TOK_MAXVAL = 293,
+     TOK_TRIM = 294,
+     TOK_SUM = 295,
+     TOK_SQRT = 296,
+     TOK_CASE = 297,
+     TOK_SELECTCASE = 298,
+     TOK_FILE = 299,
+     TOK_END = 300,
+     TOK_ERR = 301,
+     TOK_DONOTTREAT = 302,
+     TOK_ENDDONOTTREAT = 303,
+     TOK_EXIST = 304,
+     TOK_MIN = 305,
+     TOK_FLOAT = 306,
+     TOK_EXP = 307,
+     TOK_COS = 308,
+     TOK_COSH = 309,
+     TOK_ACOS = 310,
+     TOK_NINT = 311,
+     TOK_CYCLE = 312,
+     TOK_SIN = 313,
+     TOK_SINH = 314,
+     TOK_ASIN = 315,
+     TOK_EQUIVALENCE = 316,
+     TOK_BACKSPACE = 317,
+     TOK_LOG = 318,
+     TOK_TAN = 319,
+     TOK_ATAN = 320,
+     TOK_RECURSIVE = 321,
+     TOK_ABS = 322,
+     TOK_MOD = 323,
+     TOK_SIGN = 324,
+     TOK_MINLOC = 325,
+     TOK_MAXLOC = 326,
+     TOK_EXIT = 327,
+     TOK_MINVAL = 328,
+     TOK_PUBLIC = 329,
+     TOK_PRIVATE = 330,
+     TOK_ALLOCATABLE = 331,
+     TOK_RETURN = 332,
+     TOK_THEN = 333,
+     TOK_ELSEIF = 334,
+     TOK_ELSE = 335,
+     TOK_ENDIF = 336,
+     TOK_PRINT = 337,
+     TOK_PLAINGOTO = 338,
+     TOK_CONSTRUCTID = 339,
+     TOK_LOGICALIF = 340,
+     TOK_PLAINDO = 341,
+     TOK_CONTAINS = 342,
+     TOK_ENDDO = 343,
+     TOK_MODULE = 344,
+     TOK_ENDMODULE = 345,
+     TOK_DOWHILE = 346,
+     TOK_ALLOCATE = 347,
+     TOK_OPEN = 348,
+     TOK_CLOSE = 349,
+     TOK_INQUIRE = 350,
+     TOK_WRITE = 351,
+     TOK_READ = 352,
+     TOK_REWIND = 353,
+     TOK_DEALLOCATE = 354,
+     TOK_NULLIFY = 355,
+     TOK_FIN = 356,
+     TOK_DEBUT = 357,
+     TOK_DIMENSION = 358,
+     TOK_ENDSELECT = 359,
+     TOK_EXTERNAL = 360,
+     TOK_INTENT = 361,
+     TOK_INTRINSIC = 362,
+     TOK_NAMELIST = 363,
+     TOK_CASEDEFAULT = 364,
+     TOK_OPTIONAL = 365,
+     TOK_POINTER = 366,
+     TOK_CONTINUE = 367,
+     TOK_SAVE = 368,
+     TOK_TARGET = 369,
+     TOK_QUOTE = 370,
+     TOK_IMPLICIT = 371,
+     TOK_NONE = 372,
+     TOK_CALL = 373,
+     TOK_STAT = 374,
+     TOK_POINT_TO = 375,
+     TOK_COMMON = 376,
+     TOK_GLOBAL = 377,
+     TOK_INTERFACE = 378,
+     TOK_ENDINTERFACE = 379,
+     TOK_LEFTAB = 380,
+     TOK_RIGHTAB = 381,
+     TOK_PAUSE = 382,
+     TOK_PROCEDURE = 383,
+     TOK_STOP = 384,
+     TOK_NAMEEQ = 385,
+     TOK_REAL8 = 386,
+     TOK_OUT = 387,
+     TOK_INOUT = 388,
+     TOK_IN = 389,
+     TOK_USE = 390,
+     TOK_TRUE = 391,
+     TOK_FALSE = 392,
+     TOK_LABEL = 393,
+     TOK_TYPE = 394,
+     TOK_TYPEPAR = 395,
+     TOK_ENDTYPE = 396,
+     TOK_REAL = 397,
+     TOK_INTEGER = 398,
+     TOK_LOGICAL = 399,
+     TOK_DOUBLEPRECISION = 400,
+     TOK_DOUBLEREAL = 401,
+     TOK_ENDSUBROUTINE = 402,
+     TOK_ENDFUNCTION = 403,
+     TOK_ENDPROGRAM = 404,
+     TOK_ENDUNIT = 405,
+     TOK_CHARACTER = 406,
+     TOK_CHAR_CONSTANT = 407,
+     TOK_CHAR_CUT = 408,
+     TOK_DATA = 409,
+     TOK_CHAR_INT = 410,
+     TOK_CHAR_MESSAGE = 411,
+     TOK_CSTREAL = 412,
+     TOK_CSTREALDP = 413,
+     TOK_CSTREALQP = 414,
+     TOK_SFREAL = 415,
+     TOK_COMPLEX = 416,
+     TOK_DOUBLECOMPLEX = 417,
+     TOK_NAME = 418,
+     TOK_NAME_CHAR = 419,
+     TOK_PROBTYPE = 420,
+     TOK_INTERPTYPE = 421,
+     TOK_VARTYPE = 422,
+     TOK_BC = 423,
+     TOK_OP = 424,
+     TOK_CSTINT = 425,
+     TOK_COMMENT = 426,
+     TOK_FILENAME = 427
+   };
+#endif
+/* Tokens.  */
+#define TOK_BINARY_OP 258
+#define TOK_NEQV 259
+#define TOK_EQV 260
+#define TOK_XOR 261
+#define TOK_OR 262
+#define TOK_AND 263
+#define TOK_NOT 264
+#define TOK_NE 265
+#define TOK_EQ 266
+#define TOK_GE 267
+#define TOK_LE 268
+#define TOK_GT 269
+#define TOK_LT 270
+#define TOK_UNARY_OP 271
+#define TOK_DSLASH 272
+#define TOK_SLASH 273
+#define TOK_DASTER 274
+#define TOK_SEP 275
+#define TOK_SEMICOLON 276
+#define TOK_NEXTLINE 277
+#define TOK_PARAMETER 278
+#define TOK_RESULT 279
+#define TOK_ONLY 280
+#define TOK_INCLUDE 281
+#define TOK_SUBROUTINE 282
+#define TOK_PROGRAM 283
+#define TOK_FUNCTION 284
+#define TOK_OMP 285
+#define TOK_DOLLAR 286
+#define TOK_FORMAT 287
+#define TOK_MAX 288
+#define TOK_TANH 289
+#define TOK_WHERE 290
+#define TOK_ELSEWHERE 291
+#define TOK_ENDWHERE 292
+#define TOK_MAXVAL 293
+#define TOK_TRIM 294
+#define TOK_SUM 295
+#define TOK_SQRT 296
+#define TOK_CASE 297
+#define TOK_SELECTCASE 298
+#define TOK_FILE 299
+#define TOK_END 300
+#define TOK_ERR 301
+#define TOK_DONOTTREAT 302
+#define TOK_ENDDONOTTREAT 303
+#define TOK_EXIST 304
+#define TOK_MIN 305
+#define TOK_FLOAT 306
+#define TOK_EXP 307
+#define TOK_COS 308
+#define TOK_COSH 309
+#define TOK_ACOS 310
+#define TOK_NINT 311
+#define TOK_CYCLE 312
+#define TOK_SIN 313
+#define TOK_SINH 314
+#define TOK_ASIN 315
+#define TOK_EQUIVALENCE 316
+#define TOK_BACKSPACE 317
+#define TOK_LOG 318
+#define TOK_TAN 319
+#define TOK_ATAN 320
+#define TOK_RECURSIVE 321
+#define TOK_ABS 322
+#define TOK_MOD 323
+#define TOK_SIGN 324
+#define TOK_MINLOC 325
+#define TOK_MAXLOC 326
+#define TOK_EXIT 327
+#define TOK_MINVAL 328
+#define TOK_PUBLIC 329
+#define TOK_PRIVATE 330
+#define TOK_ALLOCATABLE 331
+#define TOK_RETURN 332
+#define TOK_THEN 333
+#define TOK_ELSEIF 334
+#define TOK_ELSE 335
+#define TOK_ENDIF 336
+#define TOK_PRINT 337
+#define TOK_PLAINGOTO 338
+#define TOK_CONSTRUCTID 339
+#define TOK_LOGICALIF 340
+#define TOK_PLAINDO 341
+#define TOK_CONTAINS 342
+#define TOK_ENDDO 343
+#define TOK_MODULE 344
+#define TOK_ENDMODULE 345
+#define TOK_DOWHILE 346
+#define TOK_ALLOCATE 347
+#define TOK_OPEN 348
+#define TOK_CLOSE 349
+#define TOK_INQUIRE 350
+#define TOK_WRITE 351
+#define TOK_READ 352
+#define TOK_REWIND 353
+#define TOK_DEALLOCATE 354
+#define TOK_NULLIFY 355
+#define TOK_FIN 356
+#define TOK_DEBUT 357
+#define TOK_DIMENSION 358
+#define TOK_ENDSELECT 359
+#define TOK_EXTERNAL 360
+#define TOK_INTENT 361
+#define TOK_INTRINSIC 362
+#define TOK_NAMELIST 363
+#define TOK_CASEDEFAULT 364
+#define TOK_OPTIONAL 365
+#define TOK_POINTER 366
+#define TOK_CONTINUE 367
+#define TOK_SAVE 368
+#define TOK_TARGET 369
+#define TOK_QUOTE 370
+#define TOK_IMPLICIT 371
+#define TOK_NONE 372
+#define TOK_CALL 373
+#define TOK_STAT 374
+#define TOK_POINT_TO 375
+#define TOK_COMMON 376
+#define TOK_GLOBAL 377
+#define TOK_INTERFACE 378
+#define TOK_ENDINTERFACE 379
+#define TOK_LEFTAB 380
+#define TOK_RIGHTAB 381
+#define TOK_PAUSE 382
+#define TOK_PROCEDURE 383
+#define TOK_STOP 384
+#define TOK_NAMEEQ 385
+#define TOK_REAL8 386
+#define TOK_OUT 387
+#define TOK_INOUT 388
+#define TOK_IN 389
+#define TOK_USE 390
+#define TOK_TRUE 391
+#define TOK_FALSE 392
+#define TOK_LABEL 393
+#define TOK_TYPE 394
+#define TOK_TYPEPAR 395
+#define TOK_ENDTYPE 396
+#define TOK_REAL 397
+#define TOK_INTEGER 398
+#define TOK_LOGICAL 399
+#define TOK_DOUBLEPRECISION 400
+#define TOK_DOUBLEREAL 401
+#define TOK_ENDSUBROUTINE 402
+#define TOK_ENDFUNCTION 403
+#define TOK_ENDPROGRAM 404
+#define TOK_ENDUNIT 405
+#define TOK_CHARACTER 406
+#define TOK_CHAR_CONSTANT 407
+#define TOK_CHAR_CUT 408
+#define TOK_DATA 409
+#define TOK_CHAR_INT 410
+#define TOK_CHAR_MESSAGE 411
+#define TOK_CSTREAL 412
+#define TOK_CSTREALDP 413
+#define TOK_CSTREALQP 414
+#define TOK_SFREAL 415
+#define TOK_COMPLEX 416
+#define TOK_DOUBLECOMPLEX 417
+#define TOK_NAME 418
+#define TOK_NAME_CHAR 419
+#define TOK_PROBTYPE 420
+#define TOK_INTERPTYPE 421
+#define TOK_VARTYPE 422
+#define TOK_BC 423
+#define TOK_OP 424
+#define TOK_CSTINT 425
+#define TOK_COMMENT 426
+#define TOK_FILENAME 427
+
+
+
+
+/* Copy the first part of user declarations.  */
 #line 36 "fortran.y"
+
+#define YYMAXDEPTH 1000
 #include <stdlib.h>
 #include <stdio.h>
@@ -53,6 +445,28 @@
 int removeline=0;
 listvar *test;
-#line 57 "fortran.y"
-typedef union {
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 59 "fortran.y"
+{
        char      nac[LONG_C];
        char      na[LONGNOM];
@@ -64,286 +478,819 @@
        typedim   dim1;
        variable *v;
-       } YYSTYPE;
-#line 68 "y.tab.c"
-#define TOK_BINARY_OP 257
-#define TOK_EQV 258
-#define TOK_NEQV 259
-#define TOK_OR 260
-#define TOK_XOR 261
-#define TOK_AND 262
-#define TOK_NOT 263
-#define TOK_LT 264
-#define TOK_GT 265
-#define TOK_LE 266
-#define TOK_GE 267
-#define TOK_EQ 268
-#define TOK_NE 269
-#define TOK_UNARY_OP 270
-#define TOK_DSLASH 271
-#define TOK_SLASH 272
-#define TOK_DASTER 273
-#define TOK_SEP 274
-#define TOK_SEMICOLON 275
-#define TOK_NEXTLINE 276
-#define TOK_PARAMETER 277
-#define TOK_RESULT 278
-#define TOK_ONLY 279
-#define TOK_INCLUDE 280
-#define TOK_SUBROUTINE 281
-#define TOK_PROGRAM 282
-#define TOK_FUNCTION 283
-#define TOK_OMP 284
-#define TOK_DOLLAR 285
-#define TOK_FORMAT 286
-#define TOK_MAX 287
-#define TOK_TANH 288
-#define TOK_WHERE 289
-#define TOK_ELSEWHERE 290
-#define TOK_ENDWHERE 291
-#define TOK_MAXVAL 292
-#define TOK_TRIM 293
-#define TOK_SUM 294
-#define TOK_SQRT 295
-#define TOK_CASE 296
-#define TOK_SELECTCASE 297
-#define TOK_FILE 298
-#define TOK_END 299
-#define TOK_ERR 300
-#define TOK_DONOTTREAT 301
-#define TOK_ENDDONOTTREAT 302
-#define TOK_EXIST 303
-#define TOK_MIN 304
-#define TOK_FLOAT 305
-#define TOK_EXP 306
-#define TOK_COS 307
-#define TOK_COSH 308
-#define TOK_ACOS 309
-#define TOK_NINT 310
-#define TOK_CYCLE 311
-#define TOK_SIN 312
-#define TOK_SINH 313
-#define TOK_ASIN 314
-#define TOK_EQUIVALENCE 315
-#define TOK_BACKSPACE 316
-#define TOK_LOG 317
-#define TOK_TAN 318
-#define TOK_ATAN 319
-#define TOK_RECURSIVE 320
-#define TOK_ABS 321
-#define TOK_MOD 322
-#define TOK_SIGN 323
-#define TOK_MINLOC 324
-#define TOK_MAXLOC 325
-#define TOK_EXIT 326
-#define TOK_MINVAL 327
-#define TOK_PUBLIC 328
-#define TOK_PRIVATE 329
-#define TOK_ALLOCATABLE 330
-#define TOK_RETURN 331
-#define TOK_THEN 332
-#define TOK_ELSEIF 333
-#define TOK_ELSE 334
-#define TOK_ENDIF 335
-#define TOK_PRINT 336
-#define TOK_PLAINGOTO 337
-#define TOK_CONSTRUCTID 338
-#define TOK_LOGICALIF 339
-#define TOK_PLAINDO 340
-#define TOK_CONTAINS 341
-#define TOK_ENDDO 342
-#define TOK_MODULE 343
-#define TOK_ENDMODULE 344
-#define TOK_DOWHILE 345
-#define TOK_ALLOCATE 346
-#define TOK_OPEN 347
-#define TOK_CLOSE 348
-#define TOK_INQUIRE 349
-#define TOK_WRITE 350
-#define TOK_READ 351
-#define TOK_REWIND 352
-#define TOK_DEALLOCATE 353
-#define TOK_NULLIFY 354
-#define TOK_FIN 355
-#define TOK_DEBUT 356
-#define TOK_DIMENSION 357
-#define TOK_ENDSELECT 358
-#define TOK_EXTERNAL 359
-#define TOK_INTENT 360
-#define TOK_INTRINSIC 361
-#define TOK_NAMELIST 362
-#define TOK_CASEDEFAULT 363
-#define TOK_OPTIONAL 364
-#define TOK_POINTER 365
-#define TOK_CONTINUE 366
-#define TOK_SAVE 367
-#define TOK_TARGET 368
-#define TOK_QUOTE 369
-#define TOK_IMPLICIT 370
-#define TOK_NONE 371
-#define TOK_CALL 372
-#define TOK_STAT 373
-#define TOK_POINT_TO 374
-#define TOK_COMMON 375
-#define TOK_GLOBAL 376
-#define TOK_INTERFACE 377
-#define TOK_ENDINTERFACE 378
-#define TOK_LEFTAB 379
-#define TOK_RIGHTAB 380
-#define TOK_PAUSE 381
-#define TOK_PROCEDURE 382
-#define TOK_STOP 383
-#define TOK_NAMEEQ 384
-#define TOK_REAL8 385
-#define TOK_OUT 386
-#define TOK_INOUT 387
-#define TOK_IN 388
-#define TOK_USE 389
-#define TOK_TRUE 390
-#define TOK_FALSE 391
-#define TOK_LABEL 392
-#define TOK_TYPE 393
-#define TOK_TYPEPAR 394
-#define TOK_ENDTYPE 395
-#define TOK_REAL 396
-#define TOK_INTEGER 397
-#define TOK_LOGICAL 398
-#define TOK_DOUBLEPRECISION 399
-#define TOK_DOUBLEREAL 400
-#define TOK_ENDSUBROUTINE 401
-#define TOK_ENDFUNCTION 402
-#define TOK_ENDPROGRAM 403
-#define TOK_ENDUNIT 404
-#define TOK_CHARACTER 405
-#define TOK_CHAR_CONSTANT 406
-#define TOK_CHAR_CUT 407
-#define TOK_DATA 408
-#define TOK_CHAR_INT 409
-#define TOK_CHAR_MESSAGE 410
-#define TOK_CSTREAL 411
-#define TOK_CSTREALDP 412
-#define TOK_CSTREALQP 413
-#define TOK_SFREAL 414
-#define TOK_COMPLEX 415
-#define TOK_DOUBLECOMPLEX 416
-#define TOK_NAME 417
-#define TOK_NAME_CHAR 418
-#define TOK_PROBTYPE 419
-#define TOK_INTERPTYPE 420
-#define TOK_VARTYPE 421
-#define TOK_BC 422
-#define TOK_OP 423
-#define TOK_CSTINT 424
-#define TOK_COMMENT 425
-#define TOK_FILENAME 426
-#define YYERRCODE 256
-short fortranlhs[] = {                                        -1,
-    0,    0,   68,   68,   68,   68,   68,   71,   71,   76,
-   76,   76,   76,   76,   82,   78,   72,   72,   72,   72,
-   69,   70,   70,   73,   73,   83,   75,   84,   84,   77,
-   77,   77,   77,   77,   77,   16,   74,   80,   33,    6,
-    6,    6,   85,   85,   85,    5,    5,   38,   38,   79,
-   79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-   79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
-   86,   86,  103,  103,  103,  103,  103,  103,  103,  103,
-  103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-  103,  103,  103,  103,  103,  103,   98,   98,   88,   88,
-   99,   99,  105,  106,  106,  104,  104,   87,   87,    2,
-    2,  108,   89,  100,  101,  101,  101,   58,   58,   91,
-   91,   91,   91,  111,  112,  112,  110,  110,  110,   47,
-   47,   47,   47,   47,   32,   32,   97,  113,  113,  113,
-  113,  114,   96,   96,  115,    3,    3,   93,   93,   67,
-   67,   66,   66,   90,   90,   90,  117,  117,  118,  118,
-  119,   15,   15,  109,  109,    4,    4,   14,   95,  120,
-  120,   92,   92,  121,    1,    1,  107,   19,   19,   19,
-   19,  127,  126,  126,  126,  126,  128,  128,  128,  125,
-   25,   24,   24,   24,   24,   24,   24,  116,  116,   65,
-   65,  124,  124,  124,  130,  130,   34,   34,   34,   34,
-   37,   37,  129,  129,  122,  122,  122,  131,  131,  132,
-  132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-   30,   30,   30,  102,  102,   11,   11,   12,   12,   13,
-   13,   13,   13,   13,   63,   63,   62,   62,   62,   62,
-   61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-   61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-   61,   61,   61,   61,   61,   61,   40,   40,   39,   39,
-   39,   39,   39,   39,   31,   31,   64,   64,   64,   64,
-   64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
-   64,   64,   64,   64,   64,   64,   64,   59,   59,   59,
-   59,   60,   60,   41,   41,   41,  133,   49,   49,   49,
-   49,   36,   48,   42,   50,   50,   52,   52,   51,   51,
-   53,   53,   53,   53,   53,   53,   53,   28,   27,   27,
-   27,   27,   27,   27,   27,   27,   26,   26,   26,   26,
-   55,   55,   54,   57,   57,   56,   56,  123,  123,  134,
-   35,   94,   94,   94,   94,  135,   17,    9,    9,   10,
-    7,    7,    8,    8,   81,   81,   81,   81,   81,   81,
-   81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
-   81,   81,   81,   81,   81,   81,   81,   20,   23,   22,
-   21,  143,  143,  143,  141,  141,  141,  146,  146,  146,
-  145,  145,   18,   18,  148,  148,  144,  147,  149,  149,
-  136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
-  136,  136,  157,  150,  150,  156,  156,  151,  151,  154,
-  159,  159,  160,  160,  158,  162,  161,  161,  163,  163,
-  155,  155,  153,  153,  153,  153,  153,  153,  171,  171,
-  172,  172,  172,  173,  173,  174,  174,  168,  168,  178,
-  178,  177,  177,  166,  166,  170,  170,  170,  170,  170,
-  179,  179,  181,  181,  181,  181,  181,  181,  181,  181,
-  165,  165,  176,  176,  167,  167,  167,  169,  180,  180,
-  182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
-  182,  182,  182,  183,  183,  175,  175,  185,  185,  184,
-  184,  184,  184,  184,  186,  186,  186,   43,   43,   43,
-   44,   44,   44,   44,   44,   44,   44,   44,   45,   45,
-   45,   45,   45,   46,   46,  187,  187,  164,  152,  152,
-  137,  137,  137,  188,  188,  188,  189,  190,  190,  139,
-  139,  138,  138,  140,  140,  191,  191,  192,  192,  142,
-   29,
+       }
+/* Line 193 of yacc.c.  */
+#line 483 "fortran.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 496 "fortran.tab.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   5878
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  190
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  184
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  552
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  978
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   427
+
+#define YYTRANSLATE(YYX)						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+     187,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,   183,     2,     2,     2,   189,     2,     2,
+     179,   180,    23,    21,     3,    22,     2,   188,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     4,     2,
+     185,     5,   186,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,   181,     2,   182,     2,   184,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     6,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+      18,    19,    20,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
+      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
+      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
+      71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
+      81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
+      91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
+     101,   102,   103,   104,   105,   106,   107,   108,   109,   110,
+     111,   112,   113,   114,   115,   116,   117,   118,   119,   120,
+     121,   122,   123,   124,   125,   126,   127,   128,   129,   130,
+     131,   132,   133,   134,   135,   136,   137,   138,   139,   140,
+     141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
+     151,   152,   153,   154,   155,   156,   157,   158,   159,   160,
+     161,   162,   163,   164,   165,   166,   167,   168,   169,   170,
+     171,   172,   173,   174,   175,   176,   177,   178
 };
-short fortranlen[] = {                                         2,
-    0,    2,    2,    2,    1,    3,    3,    1,    3,    2,
-    2,    3,    3,    2,    2,    2,    1,    1,    1,    1,
-    0,    0,    2,    0,    1,    0,    0,    0,    1,    0,
-    4,    2,    5,    3,    2,    1,    0,    1,    1,    0,
-    2,    3,    0,    2,    3,    1,    3,    1,    1,    2,
-    4,    2,    2,    4,    2,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    4,    3,    3,    2,    3,
-    0,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     7,    10,    13,    15,    19,    23,
+      25,    29,    32,    35,    39,    43,    46,    49,    52,    54,
+      56,    58,    60,    61,    62,    65,    66,    68,    69,    70,
+      72,    73,    78,    81,    87,    91,    94,    96,    97,    99,
+     101,   102,   105,   109,   110,   113,   117,   119,   123,   125,
+     127,   130,   135,   138,   141,   146,   149,   151,   153,   155,
+     157,   159,   161,   163,   165,   167,   169,   174,   178,   182,
+     185,   189,   190,   192,   194,   196,   198,   200,   202,   204,
+     206,   208,   210,   212,   214,   216,   218,   220,   222,   224,
+     226,   228,   230,   232,   234,   236,   238,   240,   242,   246,
+     250,   256,   258,   262,   266,   269,   274,   276,   280,   281,
+     284,   287,   291,   293,   295,   297,   302,   309,   314,   316,
+     320,   323,   327,   333,   337,   339,   340,   343,   345,   350,
+     354,   357,   361,   365,   369,   373,   374,   376,   379,   382,
+     386,   392,   396,   397,   400,   403,   405,   411,   417,   420,
+     424,   427,   431,   433,   437,   440,   444,   450,   452,   455,
+     457,   461,   464,   466,   470,   471,   473,   475,   479,   483,
+     486,   488,   492,   495,   498,   499,   506,   514,   515,   518,
+     521,   525,   529,   531,   532,   535,   540,   544,   548,   553,
+     556,   558,   560,   562,   564,   566,   568,   570,   572,   573,
+     576,   578,   582,   583,   586,   590,   592,   596,   599,   603,
+     605,   607,   609,   611,   612,   616,   617,   620,   625,   627,
+     631,   633,   635,   637,   640,   642,   647,   649,   651,   653,
+     655,   657,   659,   661,   663,   665,   667,   668,   672,   674,
+     678,   680,   682,   685,   688,   692,   694,   696,   698,   702,
+     704,   706,   710,   714,   719,   724,   728,   733,   738,   742,
+     747,   752,   757,   762,   767,   772,   777,   782,   787,   792,
+     797,   802,   807,   811,   816,   821,   826,   831,   833,   837,
+     839,   841,   843,   846,   849,   852,   854,   856,   859,   862,
+     865,   868,   871,   874,   877,   880,   883,   886,   889,   893,
+     896,   900,   903,   906,   909,   912,   915,   918,   921,   922,
+     924,   927,   930,   933,   935,   937,   939,   941,   942,   944,
+     947,   952,   958,   963,   967,   971,   973,   976,   978,   982,
+     984,   986,   990,   996,  1001,  1005,  1008,  1011,  1013,  1015,
+    1017,  1019,  1021,  1023,  1025,  1027,  1030,  1033,  1035,  1038,
+    1040,  1042,  1043,  1045,  1051,  1052,  1054,  1056,  1058,  1059,
+    1063,  1064,  1070,  1073,  1078,  1085,  1092,  1094,  1096,  1098,
+    1102,  1106,  1108,  1112,  1116,  1118,  1120,  1126,  1132,  1137,
+    1139,  1142,  1145,  1148,  1151,  1153,  1156,  1162,  1164,  1166,
+    1169,  1175,  1177,  1180,  1184,  1189,  1191,  1193,  1195,  1197,
+    1199,  1201,  1203,  1205,  1209,  1213,  1217,  1220,  1223,  1224,
+    1230,  1238,  1239,  1242,  1244,  1246,  1247,  1249,  1251,  1253,
+    1255,  1258,  1260,  1262,  1264,  1270,  1276,  1279,  1282,  1285,
+    1288,  1290,  1291,  1296,  1303,  1305,  1309,  1312,  1315,  1318,
+    1319,  1323,  1324,  1326,  1329,  1331,  1333,  1337,  1339,  1342,
+    1344,  1346,  1349,  1352,  1355,  1359,  1362,  1364,  1365,  1367,
+    1370,  1373,  1374,  1377,  1381,  1385,  1389,  1393,  1395,  1399,
+    1401,  1403,  1407,  1409,  1411,  1413,  1416,  1421,  1426,  1429,
+    1432,  1434,  1436,  1438,  1440,  1442,  1444,  1446,  1448,  1450,
+    1454,  1456,  1458,  1462,  1466,  1470,  1474,  1477,  1481,  1484,
+    1487,  1490,  1493,  1497,  1499,  1501,  1503,  1507,  1508,  1510,
+    1513,  1518,  1521,  1524,  1530,  1531,  1533,  1536,  1538,  1540,
+    1542,  1546,  1550,  1554,  1558,  1562,  1566,  1568,  1570,  1572,
+    1576,  1582,  1588,  1594,  1600,  1608,  1610,  1619,  1622,  1624,
+    1626,  1630,  1632,  1634,  1636,  1641,  1643,  1647,  1648,  1653,
+    1655,  1659,  1663
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int16 yyrhs[] =
+{
+     191,     0,    -1,    -1,   191,   192,    -1,   187,   198,    -1,
+     199,   193,    -1,   177,    -1,   197,   200,   205,    -1,     1,
+     205,   201,    -1,   194,    -1,   193,    27,   194,    -1,   203,
+     196,    -1,   212,   196,    -1,   206,   207,   196,    -1,   315,
+     200,   205,    -1,   195,   196,    -1,   298,     4,    -1,   198,
+     200,    -1,    53,    -1,    54,    -1,    36,    -1,    37,    -1,
+      -1,    -1,   144,   201,    -1,    -1,   177,    -1,    -1,    -1,
+      72,    -1,    -1,   202,    33,   204,   208,    -1,    34,   204,
+      -1,    35,   204,   208,    30,   209,    -1,    35,   204,   208,
+      -1,    95,   169,    -1,   169,    -1,    -1,    32,    -1,   158,
+      -1,    -1,   179,   180,    -1,   179,   210,   180,    -1,    -1,
+     179,   180,    -1,   179,   210,   180,    -1,   211,    -1,   210,
+       3,   211,    -1,   169,    -1,    23,    -1,   257,   222,    -1,
+     145,   213,   221,   324,    -1,   147,   324,    -1,   117,   216,
+      -1,   224,   179,   249,   180,    -1,   224,   249,    -1,   243,
+      -1,   228,    -1,   253,    -1,   239,    -1,   241,    -1,   240,
+      -1,   308,    -1,   251,    -1,   237,    -1,   234,    -1,    68,
+     179,   280,   180,    -1,   111,   221,   242,    -1,   113,   221,
+     215,    -1,    67,   217,    -1,   225,   226,   187,    -1,    -1,
+     275,    -1,    46,    -1,    40,    -1,    44,    -1,    56,    -1,
+      79,    -1,    45,    -1,    47,    -1,    62,    -1,    57,    -1,
+      58,    -1,    59,    -1,    60,    -1,    61,    -1,    64,    -1,
+      65,    -1,    66,    -1,    69,    -1,    70,    -1,    71,    -1,
+      74,    -1,    75,    -1,    76,    -1,    77,    -1,   169,    -1,
+     214,    -1,   215,     3,   214,    -1,   179,   220,   180,    -1,
+     216,     3,   179,   220,   180,    -1,   218,    -1,   217,     3,
+     218,    -1,   179,   219,   180,    -1,   298,   276,    -1,   219,
+       3,   298,   276,    -1,   280,    -1,   220,     3,   280,    -1,
+      -1,     4,     4,    -1,   255,   256,    -1,   223,   204,   208,
+      -1,    35,    -1,    29,    -1,   160,    -1,   169,    24,   227,
+      24,    -1,   226,   248,   169,    24,   227,    24,    -1,   231,
+      24,   227,    24,    -1,   232,    -1,   232,     3,   227,    -1,
+     229,   230,    -1,   229,   247,   230,    -1,   228,   248,   247,
+     248,   230,    -1,   228,     3,   230,    -1,   119,    -1,    -1,
+     169,   276,    -1,   169,    -1,   169,   179,   280,   180,    -1,
+     231,     3,   231,    -1,   233,   299,    -1,   232,    21,   232,
+      -1,   232,    22,   232,    -1,   232,    23,   232,    -1,   232,
+     188,   232,    -1,    -1,   284,    -1,   235,   236,    -1,   114,
+     298,    -1,   114,   247,   298,    -1,   235,   248,   247,   248,
+     298,    -1,   235,     3,   298,    -1,    -1,   129,   324,    -1,
+     130,   324,    -1,   109,    -1,   238,   248,   169,   276,   264,
+      -1,   239,     3,   169,   276,   264,    -1,    81,   187,    -1,
+      81,   221,   242,    -1,    80,   187,    -1,    80,   221,   242,
+      -1,   169,    -1,   242,     3,   169,    -1,   244,   245,    -1,
+     244,   247,   245,    -1,   243,   248,   247,   248,   245,    -1,
+     127,    -1,   128,   127,    -1,   246,    -1,   245,     3,   246,
+      -1,   169,   276,    -1,    20,    -1,    24,   169,    24,    -1,
+      -1,     3,    -1,   250,    -1,   249,     3,   250,    -1,   169,
+       5,   280,    -1,   134,   252,    -1,   169,    -1,   252,     3,
+     169,    -1,   122,   123,    -1,   122,   137,    -1,    -1,   271,
+     254,   169,   276,   264,   305,    -1,   255,     3,   254,   169,
+     276,   264,   305,    -1,    -1,   262,   266,    -1,   261,   259,
+      -1,   263,    23,   176,    -1,   258,   268,   180,    -1,   146,
+      -1,    -1,    23,   176,    -1,    23,   179,   260,   180,    -1,
+     179,   260,   180,    -1,   169,   269,   270,    -1,   169,     5,
+     269,   270,    -1,   269,   270,    -1,   157,    -1,   263,    -1,
+     149,    -1,   148,    -1,   167,    -1,   151,    -1,   168,    -1,
+     150,    -1,    -1,    23,   265,    -1,   280,    -1,   179,    23,
+     180,    -1,    -1,    23,   267,    -1,   179,   268,   180,    -1,
+     280,    -1,   179,    23,   180,    -1,   169,   269,    -1,   169,
+       5,   269,    -1,   169,    -1,   176,    -1,   280,    -1,    23,
+      -1,    -1,     3,   169,   269,    -1,    -1,     4,     4,    -1,
+       3,   272,     4,     4,    -1,   273,    -1,   272,     3,   273,
+      -1,    29,    -1,   275,    -1,    82,    -1,   109,   276,    -1,
+     111,    -1,   112,   179,   274,   180,    -1,   113,    -1,   116,
+      -1,   117,    -1,   119,    -1,   120,    -1,   140,    -1,   138,
+      -1,   139,    -1,    80,    -1,    81,    -1,    -1,   179,   277,
+     180,    -1,   278,    -1,   277,     3,   278,    -1,   279,    -1,
+       4,    -1,   280,     4,    -1,     4,   280,    -1,   280,     4,
+     279,    -1,    23,    -1,   280,    -1,   283,    -1,   179,   280,
+     180,    -1,   307,    -1,   281,    -1,    46,   282,   180,    -1,
+      39,   282,   180,    -1,    40,   179,   282,   180,    -1,    44,
+     179,   282,   180,    -1,    56,   282,   180,    -1,    79,   179,
+     282,   180,    -1,    45,   179,   280,   180,    -1,    47,   280,
+     180,    -1,   148,   179,   282,   180,    -1,    62,   179,   280,
+     180,    -1,    57,   179,   280,   180,    -1,    58,   179,   280,
+     180,    -1,    59,   179,   280,   180,    -1,    60,   179,   280,
+     180,    -1,    61,   179,   280,   180,    -1,    64,   179,   280,
+     180,    -1,    65,   179,   280,   180,    -1,    66,   179,   280,
+     180,    -1,    69,   179,   280,   180,    -1,    70,   179,   280,
+     180,    -1,    71,   179,   280,   180,    -1,    73,   280,   180,
+      -1,    74,   179,   282,   180,    -1,    75,   179,   282,   180,
+      -1,    76,   179,   282,   180,    -1,    77,   179,   282,   180,
+      -1,   280,    -1,   282,     3,   280,    -1,   288,    -1,   299,
+      -1,   293,    -1,   280,   285,    -1,   284,   280,    -1,    12,
+     280,    -1,    21,    -1,    22,    -1,    21,   280,    -1,    22,
+     280,    -1,    23,   280,    -1,    25,   280,    -1,    14,   280,
+      -1,     8,   280,    -1,    17,   280,    -1,   186,   280,    -1,
+      18,   280,    -1,   185,   280,    -1,    15,   280,    -1,   186,
+       5,   280,    -1,    16,   280,    -1,   185,     5,   280,    -1,
+      13,   280,    -1,     7,   280,    -1,     9,   280,    -1,    10,
+     280,    -1,    11,   280,    -1,    24,   286,    -1,     5,   287,
+      -1,    -1,   280,    -1,     5,   280,    -1,    24,   280,    -1,
+       5,   280,    -1,   280,    -1,   298,    -1,   292,    -1,   290,
+      -1,    -1,   291,    -1,   291,   302,    -1,   292,   179,   294,
+     180,    -1,   292,   179,   294,   180,   302,    -1,   298,   179,
+     294,   180,    -1,   288,   189,   288,    -1,   131,   360,   132,
+      -1,   289,    -1,   289,   295,    -1,   296,    -1,   295,     3,
+     296,    -1,   280,    -1,   297,    -1,   280,     4,   280,    -1,
+     280,     4,   280,     4,   280,    -1,     4,   280,     4,   280,
+      -1,     4,     4,   280,    -1,     4,   280,    -1,   280,     4,
+      -1,     4,    -1,   169,    -1,   142,    -1,   143,    -1,   176,
+      -1,   163,    -1,   164,    -1,   165,    -1,   299,   169,    -1,
+     300,   301,    -1,   158,    -1,   300,   158,    -1,   162,    -1,
+     159,    -1,    -1,   302,    -1,   179,   303,     4,   303,   180,
+      -1,    -1,   280,    -1,   187,    -1,   280,    -1,    -1,   306,
+       5,   280,    -1,    -1,   179,   283,     3,   283,   180,    -1,
+     309,   310,    -1,   309,   310,     3,   311,    -1,   309,   310,
+       3,    31,     4,   187,    -1,   309,   310,     3,    31,     4,
+     313,    -1,   141,    -1,   169,    -1,   312,    -1,   311,     3,
+     312,    -1,   169,   126,   169,    -1,   314,    -1,   313,     3,
+     314,    -1,   169,   126,   169,    -1,   169,    -1,   328,    -1,
+      98,   179,   366,   370,   180,    -1,   105,   179,   369,   370,
+     180,    -1,   106,   179,   371,   180,    -1,   317,    -1,   318,
+     324,    -1,   316,   324,    -1,   319,   324,    -1,    96,   324,
+      -1,   321,    -1,   372,   328,    -1,    41,   179,   280,   180,
+     304,    -1,    42,    -1,    43,    -1,   372,    84,    -1,    85,
+     179,   280,   180,    84,    -1,    86,    -1,    87,   324,    -1,
+      48,   320,   180,    -1,    49,   179,   280,   180,    -1,   115,
+      -1,   110,    -1,    93,    -1,   153,    -1,   156,    -1,   155,
+      -1,   154,    -1,   280,    -1,   320,     3,   280,    -1,   320,
+       4,   280,    -1,   326,   323,   322,    -1,   327,   280,    -1,
+      94,   325,    -1,    -1,   373,     5,   280,     3,   280,    -1,
+     373,     5,   280,     3,   280,     3,   280,    -1,    -1,   176,
+     248,    -1,   187,    -1,   169,    -1,    -1,   169,    -1,    92,
+      -1,    97,    -1,   118,    -1,   330,   332,    -1,   365,    -1,
+     341,    -1,   333,    -1,    98,   179,   366,   370,   180,    -1,
+     105,   179,   369,   370,   180,    -1,    78,   303,    -1,    83,
+     304,    -1,    63,   304,    -1,   340,   304,    -1,   331,    -1,
+      -1,   298,   329,   276,   276,    -1,   330,   189,   298,   329,
+     276,   276,    -1,   176,    -1,   331,     3,   176,    -1,     5,
+     280,    -1,   126,   280,    -1,   336,   334,    -1,    -1,   179,
+     335,   180,    -1,    -1,   338,    -1,   337,   169,    -1,   124,
+      -1,   339,    -1,   338,     3,   339,    -1,   280,    -1,    23,
+     364,    -1,   133,    -1,   135,    -1,   349,   345,    -1,   351,
+     343,    -1,   352,   345,    -1,   352,   345,   360,    -1,   104,
+     346,    -1,    38,    -1,    -1,   356,    -1,   345,   342,    -1,
+     350,   344,    -1,    -1,     3,   356,    -1,   179,   347,   180,
+      -1,   179,   353,   180,    -1,   179,   298,   180,    -1,   179,
+     176,   180,    -1,   176,    -1,   179,   283,   180,    -1,   169,
+      -1,   348,    -1,   347,     3,   348,    -1,   353,    -1,    23,
+      -1,    25,    -1,   298,   280,    -1,   298,   280,   189,   330,
+      -1,   298,   179,   297,   180,    -1,   298,    23,    -1,   298,
+      25,    -1,    99,    -1,   100,    -1,   354,    -1,    23,    -1,
+     103,    -1,   101,    -1,    88,    -1,   102,    -1,   354,    -1,
+     179,   353,   180,    -1,   288,    -1,   299,    -1,   353,   355,
+     353,    -1,   353,    23,   353,    -1,   353,    24,   353,    -1,
+     353,    25,   353,    -1,   355,   353,    -1,   353,    20,   353,
+      -1,    50,   280,    -1,    55,   280,    -1,    52,   280,    -1,
+      51,   280,    -1,   169,     5,   280,    -1,    21,    -1,    22,
+      -1,   358,    -1,   356,     3,   358,    -1,    -1,   288,    -1,
+     357,   359,    -1,   179,   356,   180,   359,    -1,   281,   359,
+      -1,   299,   359,    -1,   179,   356,     3,   363,   180,    -1,
+      -1,   285,    -1,   359,   285,    -1,   283,    -1,   362,    -1,
+     361,    -1,   283,     3,   280,    -1,   283,     3,   362,    -1,
+     362,     3,   280,    -1,   362,     3,   362,    -1,   361,     3,
+     280,    -1,   361,     3,   362,    -1,   283,    -1,   281,    -1,
+     307,    -1,   179,   280,   180,    -1,   179,   283,     3,   363,
+     180,    -1,   179,   362,     3,   363,   180,    -1,   179,   361,
+       3,   363,   180,    -1,   169,     5,   280,     3,   280,    -1,
+     169,     5,   280,     3,   280,     3,   280,    -1,   176,    -1,
+      89,   179,   280,     3,   280,   180,     3,   280,    -1,    89,
+     364,    -1,   367,    -1,   330,    -1,   366,     3,   367,    -1,
+     298,    -1,   292,    -1,   368,    -1,   298,   179,   295,   180,
+      -1,   367,    -1,   369,     3,   367,    -1,    -1,     3,   125,
+       5,   298,    -1,   298,    -1,   371,     3,   298,    -1,    91,
+     280,   180,    -1,   298,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   336,   336,   337,   339,   340,   341,   342,   343,   346,
+     347,   349,   350,   351,   360,   361,   363,   365,   367,   374,
+     379,   380,   382,   384,   385,   387,   388,   394,   397,   398,
+     401,   402,   430,   448,   481,   515,   532,   539,   541,   545,
+     550,   553,   556,   561,   562,   563,   571,   582,   594,   595,
+     597,   605,   613,   619,   620,   635,   648,   649,   655,   656,
+     693,   706,   707,   708,   709,   710,   711,   712,   713,   714,
+     715,   734,   735,   741,   742,   743,   744,   745,   746,   747,
+     748,   749,   750,   751,   752,   753,   754,   755,   756,   757,
+     758,   759,   760,   761,   762,   763,   764,   766,   767,   769,
+     770,   772,   773,   775,   777,   778,   780,   781,   783,   784,
+     786,   869,   906,   912,   917,   922,   936,   950,   965,   972,
+     981,   982,   983,   984,   986,   991,   992,   997,  1001,  1006,
+    1011,  1013,  1015,  1017,  1019,  1023,  1024,  1027,  1029,  1030,
+    1031,  1032,  1034,  1036,  1041,  1046,  1052,  1068,  1085,  1086,
+    1088,  1092,  1097,  1101,  1106,  1112,  1123,  1135,  1140,  1146,
+    1151,  1155,  1165,  1174,  1184,  1185,  1187,  1191,  1196,  1219,
+    1221,  1222,  1224,  1234,  1236,  1238,  1270,  1305,  1307,  1309,
+    1313,  1318,  1323,  1331,  1332,  1334,  1335,  1337,  1338,  1339,
+    1341,  1346,  1348,  1353,  1357,  1360,  1366,  1368,  1374,  1375,
+    1377,  1378,  1380,  1381,  1382,  1384,  1385,  1387,  1388,  1397,
+    1401,  1406,  1408,  1411,  1412,  1414,  1415,  1416,  1418,  1419,
+    1421,  1425,  1426,  1428,  1433,  1435,  1437,  1438,  1439,  1440,
+    1446,  1449,  1450,  1451,  1453,  1455,  1458,  1463,  1467,  1469,
+    1473,  1478,  1482,  1487,  1492,  1500,  1501,  1503,  1504,  1506,
+    1508,  1512,  1514,  1516,  1518,  1520,  1522,  1524,  1526,  1528,
+    1530,  1532,  1534,  1536,  1538,  1540,  1542,  1544,  1546,  1548,
+    1550,  1552,  1554,  1556,  1558,  1560,  1562,  1565,  1566,  1570,
+    1571,  1573,  1575,  1577,  1579,  1582,  1583,  1585,  1587,  1589,
+    1591,  1593,  1595,  1597,  1599,  1601,  1603,  1605,  1607,  1609,
+    1611,  1613,  1615,  1617,  1619,  1621,  1623,  1625,  1628,  1629,
+    1631,  1633,  1636,  1638,  1642,  1647,  1652,  1658,  1670,  1675,
+    1677,  1680,  1684,  1694,  1700,  1703,  1704,  1707,  1708,  1711,
+    1712,  1714,  1716,  1719,  1721,  1722,  1723,  1724,  1726,  1784,
+    1786,  1787,  1788,  1789,  1790,  1791,  1793,  1795,  1797,  1798,
+    1800,  1803,  1804,  1806,  1809,  1810,  1812,  1813,  1815,  1816,
+    1825,  1827,  1830,  1850,  1884,  1904,  1955,  1963,  1966,  1970,
+    1980,  1991,  1995,  2005,  2017,  2026,  2027,  2033,  2039,  2040,
+    2090,  2108,  2128,  2147,  2180,  2181,  2182,  2183,  2184,  2185,
+    2186,  2187,  2188,  2189,  2190,  2191,  2192,  2193,  2230,  2240,
+    2249,  2258,  2267,  2268,  2269,  2271,  2272,  2273,  2275,  2276,
+    2277,  2278,  2279,  2281,  2282,  2284,  2285,  2287,  2289,  2296,
+    2297,  2298,  2299,  2300,  2301,  2307,  2313,  2314,  2315,  2316,
+    2317,  2319,  2320,  2330,  2332,  2333,  2335,  2336,  2338,  2366,
+    2367,  2369,  2370,  2372,  2402,  2404,  2405,  2408,  2422,  2425,
+    2426,  2429,  2430,  2431,  2432,  2433,  2434,  2446,  2447,  2449,
+    2450,  2455,  2456,  2458,  2459,  2461,  2462,  2463,  2464,  2465,
+    2467,  2468,  2470,  2471,  2472,  2473,  2474,  2475,  2476,  2477,
+    2479,  2480,  2482,  2483,  2486,  2487,  2488,  2491,  2494,  2495,
+    2497,  2498,  2499,  2500,  2501,  2502,  2503,  2504,  2505,  2506,
+    2507,  2508,  2509,  2511,  2512,  2514,  2515,  2517,  2518,  2520,
+    2521,  2522,  2523,  2524,  2526,  2527,  2528,  2530,  2531,  2532,
+    2534,  2536,  2538,  2540,  2542,  2544,  2546,  2547,  2549,  2551,
+    2553,  2555,  2557,  2561,  2564,  2571,  2573,  2574,  2576,  2577,
+    2578,  2580,  2582,  2583,  2585,  2592,  2593,  2595,  2596,  2598,
+    2599,  2607,  2609
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "','", "':'", "'='", "TOK_BINARY_OP",
+  "TOK_NEQV", "TOK_EQV", "TOK_XOR", "TOK_OR", "TOK_AND", "TOK_NOT",
+  "TOK_NE", "TOK_EQ", "TOK_GE", "TOK_LE", "TOK_GT", "TOK_LT",
+  "TOK_UNARY_OP", "TOK_DSLASH", "'+'", "'-'", "'*'", "TOK_SLASH",
+  "TOK_DASTER", "TOK_SEP", "TOK_SEMICOLON", "TOK_NEXTLINE",
+  "TOK_PARAMETER", "TOK_RESULT", "TOK_ONLY", "TOK_INCLUDE",
+  "TOK_SUBROUTINE", "TOK_PROGRAM", "TOK_FUNCTION", "TOK_OMP", "TOK_DOLLAR",
+  "TOK_FORMAT", "TOK_MAX", "TOK_TANH", "TOK_WHERE", "TOK_ELSEWHERE",
+  "TOK_ENDWHERE", "TOK_MAXVAL", "TOK_TRIM", "TOK_SUM", "TOK_SQRT",
+  "TOK_CASE", "TOK_SELECTCASE", "TOK_FILE", "TOK_END", "TOK_ERR",
+  "TOK_DONOTTREAT", "TOK_ENDDONOTTREAT", "TOK_EXIST", "TOK_MIN",
+  "TOK_FLOAT", "TOK_EXP", "TOK_COS", "TOK_COSH", "TOK_ACOS", "TOK_NINT",
+  "TOK_CYCLE", "TOK_SIN", "TOK_SINH", "TOK_ASIN", "TOK_EQUIVALENCE",
+  "TOK_BACKSPACE", "TOK_LOG", "TOK_TAN", "TOK_ATAN", "TOK_RECURSIVE",
+  "TOK_ABS", "TOK_MOD", "TOK_SIGN", "TOK_MINLOC", "TOK_MAXLOC", "TOK_EXIT",
+  "TOK_MINVAL", "TOK_PUBLIC", "TOK_PRIVATE", "TOK_ALLOCATABLE",
+  "TOK_RETURN", "TOK_THEN", "TOK_ELSEIF", "TOK_ELSE", "TOK_ENDIF",
+  "TOK_PRINT", "TOK_PLAINGOTO", "TOK_CONSTRUCTID", "TOK_LOGICALIF",
+  "TOK_PLAINDO", "TOK_CONTAINS", "TOK_ENDDO", "TOK_MODULE",
+  "TOK_ENDMODULE", "TOK_DOWHILE", "TOK_ALLOCATE", "TOK_OPEN", "TOK_CLOSE",
+  "TOK_INQUIRE", "TOK_WRITE", "TOK_READ", "TOK_REWIND", "TOK_DEALLOCATE",
+  "TOK_NULLIFY", "TOK_FIN", "TOK_DEBUT", "TOK_DIMENSION", "TOK_ENDSELECT",
+  "TOK_EXTERNAL", "TOK_INTENT", "TOK_INTRINSIC", "TOK_NAMELIST",
+  "TOK_CASEDEFAULT", "TOK_OPTIONAL", "TOK_POINTER", "TOK_CONTINUE",
+  "TOK_SAVE", "TOK_TARGET", "TOK_QUOTE", "TOK_IMPLICIT", "TOK_NONE",
+  "TOK_CALL", "TOK_STAT", "TOK_POINT_TO", "TOK_COMMON", "TOK_GLOBAL",
+  "TOK_INTERFACE", "TOK_ENDINTERFACE", "TOK_LEFTAB", "TOK_RIGHTAB",
+  "TOK_PAUSE", "TOK_PROCEDURE", "TOK_STOP", "TOK_NAMEEQ", "TOK_REAL8",
+  "TOK_OUT", "TOK_INOUT", "TOK_IN", "TOK_USE", "TOK_TRUE", "TOK_FALSE",
+  "TOK_LABEL", "TOK_TYPE", "TOK_TYPEPAR", "TOK_ENDTYPE", "TOK_REAL",
+  "TOK_INTEGER", "TOK_LOGICAL", "TOK_DOUBLEPRECISION", "TOK_DOUBLEREAL",
+  "TOK_ENDSUBROUTINE", "TOK_ENDFUNCTION", "TOK_ENDPROGRAM", "TOK_ENDUNIT",
+  "TOK_CHARACTER", "TOK_CHAR_CONSTANT", "TOK_CHAR_CUT", "TOK_DATA",
+  "TOK_CHAR_INT", "TOK_CHAR_MESSAGE", "TOK_CSTREAL", "TOK_CSTREALDP",
+  "TOK_CSTREALQP", "TOK_SFREAL", "TOK_COMPLEX", "TOK_DOUBLECOMPLEX",
+  "TOK_NAME", "TOK_NAME_CHAR", "TOK_PROBTYPE", "TOK_INTERPTYPE",
+  "TOK_VARTYPE", "TOK_BC", "TOK_OP", "TOK_CSTINT", "TOK_COMMENT",
+  "TOK_FILENAME", "'('", "')'", "'['", "']'", "'!'", "'_'", "'<'", "'>'",
+  "'\\n'", "'/'", "'%'", "$accept", "input", "line", "suite_line_list",
+  "suite_line", "instr", "fin_line", "keyword", "position", "thislabel",
+  "cmnt", "nulcurbuf", "opt_recursive", "entry", "name_routine",
+  "writedeclar", "before_include", "filename", "arglist", "arglist1",
+  "args", "arg", "spec", "opt_spec", "name_intrinsic",
+  "use_intrinsic_list", "list_couple", "list_expr_equi", "expr_equi",
+  "list_expr_equi1", "list_expr", "opt_sep", "after_type",
+  "before_function", "before_parameter", "before_data", "data",
+  "datavallist", "save", "before_save", "varsave", "datanamelist",
+  "expr_data", "opt_signe", "namelist", "namelist_action",
+  "after_namelist", "interface", "before_dimension", "dimension",
+  "private", "public", "use_name_list", "common", "before_common",
+  "var_common_list", "var_common", "comblock", "opt_comma", "paramlist",
+  "paramitem", "module_proc_stmt", "proc_name_list", "implicit",
+  "opt_retour", "dcl", "nodimsgiven", "type", "before_typepar",
+  "c_selector", "c_attribute", "before_character", "typespec", "typename",
+  "lengspec", "proper_lengspec", "selector", "proper_selector",
+  "attribute", "clause", "opt_clause", "options", "attr_spec_list",
+  "attr_spec", "intent_spec", "access_spec", "dims", "dimlist", "dim",
+  "ubound", "expr", "predefinedfunction", "minmaxlist", "uexpr", "signe",
+  "operation", "after_slash", "after_equal", "lhs", "beforefunctionuse",
+  "array_ele_substring_func_ref", "begin_array", "structure_component",
+  "vec", "funarglist", "funargs", "funarg", "triplet", "ident",
+  "simple_const", "string_constant", "opt_substring", "substring",
+  "optexpr", "opt_expr", "initial_value", "before_initial",
+  "complex_const", "use_stat", "word_use", "module_name", "rename_list",
+  "rename_name", "only_list", "only_name", "exec", "word_endsubroutine",
+  "word_endunit", "word_endprogram", "word_endfunction", "caselist",
+  "boucledo", "do_arg", "opt_int", "opt_name", "optname", "worddo",
+  "wordwhile", "iffable", "before_dims", "ident_dims", "int_list",
+  "after_ident_dims", "call", "opt_call", "opt_callarglist", "keywordcall",
+  "before_call", "callarglist", "callarg", "stop", "io", "option_inlist",
+  "option_read", "opt_inlist", "ioctl", "after_rewind", "ctllist",
+  "ioclause", "iofctl", "infmt", "read", "write", "fexpr", "unpar_fexpr",
+  "addop", "inlist", "opt_lhs", "inelt", "opt_operation", "outlist",
+  "out2", "other", "dospec", "label", "goto", "allocation_list",
+  "allocate_object", "array_element", "allocate_object_list",
+  "opt_stat_spec", "pointer_name_list", "logif", "do_var", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,    44,    58,    61,   258,   259,   260,   261,
+     262,   263,   264,   265,   266,   267,   268,   269,   270,   271,
+     272,    43,    45,    42,   273,   274,   275,   276,   277,   278,
+     279,   280,   281,   282,   283,   284,   285,   286,   287,   288,
+     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
+     299,   300,   301,   302,   303,   304,   305,   306,   307,   308,
+     309,   310,   311,   312,   313,   314,   315,   316,   317,   318,
+     319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
+     329,   330,   331,   332,   333,   334,   335,   336,   337,   338,
+     339,   340,   341,   342,   343,   344,   345,   346,   347,   348,
+     349,   350,   351,   352,   353,   354,   355,   356,   357,   358,
+     359,   360,   361,   362,   363,   364,   365,   366,   367,   368,
+     369,   370,   371,   372,   373,   374,   375,   376,   377,   378,
+     379,   380,   381,   382,   383,   384,   385,   386,   387,   388,
+     389,   390,   391,   392,   393,   394,   395,   396,   397,   398,
+     399,   400,   401,   402,   403,   404,   405,   406,   407,   408,
+     409,   410,   411,   412,   413,   414,   415,   416,   417,   418,
+     419,   420,   421,   422,   423,   424,   425,   426,   427,    40,
+      41,    91,    93,    33,    95,    60,    62,    10,    47,    37
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint16 yyr1[] =
+{
+       0,   190,   191,   191,   192,   192,   192,   192,   192,   193,
+     193,   194,   194,   194,   194,   194,   195,   196,   197,   197,
+     197,   197,   198,   199,   199,   200,   200,   201,   202,   202,
+     203,   203,   203,   203,   203,   203,   204,   205,   206,   207,
+     208,   208,   208,   209,   209,   209,   210,   210,   211,   211,
+     212,   212,   212,   212,   212,   212,   212,   212,   212,   212,
+     212,   212,   212,   212,   212,   212,   212,   212,   212,   212,
+     212,   213,   213,   214,   214,   214,   214,   214,   214,   214,
+     214,   214,   214,   214,   214,   214,   214,   214,   214,   214,
+     214,   214,   214,   214,   214,   214,   214,   215,   215,   216,
+     216,   217,   217,   218,   219,   219,   220,   220,   221,   221,
+     222,   222,   223,   224,   225,   226,   226,   226,   227,   227,
+     228,   228,   228,   228,   229,   230,   230,   231,   231,   231,
+     232,   232,   232,   232,   232,   233,   233,   234,   235,   235,
+     235,   235,   236,   237,   237,   238,   239,   239,   240,   240,
+     241,   241,   242,   242,   243,   243,   243,   244,   244,   245,
+     245,   246,   247,   247,   248,   248,   249,   249,   250,   251,
+     252,   252,   253,   253,   254,   255,   255,   256,   257,   257,
+     257,   257,   258,   259,   259,   259,   259,   260,   260,   260,
+     261,   262,   263,   263,   263,   263,   263,   263,   264,   264,
+     265,   265,   266,   266,   266,   267,   267,   268,   268,   268,
+     268,   269,   269,   270,   270,   271,   271,   271,   272,   272,
+     273,   273,   273,   273,   273,   273,   273,   273,   273,   273,
+     273,   274,   274,   274,   275,   275,   276,   276,   277,   277,
+     278,   278,   278,   278,   278,   279,   279,   280,   280,   280,
+     280,   281,   281,   281,   281,   281,   281,   281,   281,   281,
+     281,   281,   281,   281,   281,   281,   281,   281,   281,   281,
+     281,   281,   281,   281,   281,   281,   281,   282,   282,   283,
+     283,   283,   283,   283,   283,   284,   284,   285,   285,   285,
+     285,   285,   285,   285,   285,   285,   285,   285,   285,   285,
+     285,   285,   285,   285,   285,   285,   285,   285,   286,   286,
+     286,   286,   287,   287,   288,   288,   288,   289,   290,   290,
+     290,   290,   291,   292,   293,   294,   294,   295,   295,   296,
+     296,   297,   297,   297,   297,   297,   297,   297,   298,   299,
+     299,   299,   299,   299,   299,   299,   299,   300,   300,   300,
+     300,   301,   301,   302,   303,   303,   304,   304,   305,   305,
+     306,   307,   308,   308,   308,   308,   309,   310,   311,   311,
+     312,   313,   313,   314,   314,   315,   315,   315,   315,   315,
+     315,   315,   315,   315,   315,   315,   315,   315,   315,   315,
+     315,   315,   315,   315,   315,   315,   315,   315,   316,   317,
+     318,   319,   320,   320,   320,   321,   321,   321,   322,   322,
+     322,   323,   323,   324,   324,   325,   325,   326,   327,   328,
+     328,   328,   328,   328,   328,   328,   328,   328,   328,   328,
+     328,   329,   330,   330,   331,   331,   332,   332,   333,   334,
+     334,   335,   335,   336,   337,   338,   338,   339,   339,   340,
+     340,   341,   341,   341,   341,   341,   341,   342,   342,   343,
+     343,   344,   344,   345,   345,   346,   346,   346,   346,   346,
+     347,   347,   348,   348,   348,   348,   348,   348,   348,   348,
+     349,   349,   350,   350,   351,   351,   351,   352,   353,   353,
+     354,   354,   354,   354,   354,   354,   354,   354,   354,   354,
+     354,   354,   354,   355,   355,   356,   356,   357,   357,   358,
+     358,   358,   358,   358,   359,   359,   359,   360,   360,   360,
+     361,   361,   361,   361,   361,   361,   361,   361,   362,   362,
+     362,   362,   362,   363,   363,   364,   365,   365,   366,   366,
+     366,   367,   367,   367,   368,   369,   369,   370,   370,   371,
+     371,   372,   373
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     2,     2,     2,     1,     3,     3,     1,
+       3,     2,     2,     3,     3,     2,     2,     2,     1,     1,
+       1,     1,     0,     0,     2,     0,     1,     0,     0,     1,
+       0,     4,     2,     5,     3,     2,     1,     0,     1,     1,
+       0,     2,     3,     0,     2,     3,     1,     3,     1,     1,
+       2,     4,     2,     2,     4,     2,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     4,     3,     3,     2,
+       3,     0,     1,     1,     1,     1,     1,     1,     1,     1,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    1,    1,    3,    3,    5,
-    1,    3,    3,    2,    4,    1,    3,    0,    2,    2,
-    3,    1,    1,    1,    4,    6,    4,    1,    3,    2,
-    3,    5,    3,    1,    0,    2,    1,    4,    3,    2,
-    3,    3,    3,    3,    0,    1,    2,    2,    3,    5,
-    3,    0,    2,    2,    1,    5,    5,    2,    3,    2,
-    3,    1,    3,    2,    3,    5,    1,    2,    1,    3,
-    2,    1,    3,    0,    1,    1,    3,    3,    2,    1,
-    3,    2,    2,    0,    6,    7,    0,    2,    2,    3,
-    3,    1,    0,    2,    4,    3,    3,    4,    2,    1,
-    1,    1,    1,    1,    1,    1,    1,    0,    2,    1,
-    3,    0,    2,    3,    1,    3,    2,    3,    1,    1,
-    1,    1,    0,    3,    0,    2,    4,    1,    3,    1,
-    1,    1,    2,    1,    4,    1,    1,    1,    1,    1,
-    1,    1,    1,    1,    1,    0,    3,    1,    3,    1,
-    1,    2,    2,    3,    1,    1,    1,    3,    1,    1,
-    3,    3,    4,    4,    3,    4,    4,    3,    4,    4,
+       1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
+       5,     1,     3,     3,     2,     4,     1,     3,     0,     2,
+       2,     3,     1,     1,     1,     4,     6,     4,     1,     3,
+       2,     3,     5,     3,     1,     0,     2,     1,     4,     3,
+       2,     3,     3,     3,     3,     0,     1,     2,     2,     3,
+       5,     3,     0,     2,     2,     1,     5,     5,     2,     3,
+       2,     3,     1,     3,     2,     3,     5,     1,     2,     1,
+       3,     2,     1,     3,     0,     1,     1,     3,     3,     2,
+       1,     3,     2,     2,     0,     6,     7,     0,     2,     2,
+       3,     3,     1,     0,     2,     4,     3,     3,     4,     2,
+       1,     1,     1,     1,     1,     1,     1,     1,     0,     2,
+       1,     3,     0,     2,     3,     1,     3,     2,     3,     1,
+       1,     1,     1,     0,     3,     0,     2,     4,     1,     3,
+       1,     1,     1,     2,     1,     4,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     0,     3,     1,     3,
+       1,     1,     2,     2,     3,     1,     1,     1,     3,     1,
+       1,     3,     3,     4,     4,     3,     4,     4,     3,     4,
     4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
-    4,    3,    4,    4,    4,    4,    1,    3,    1,    1,
-    1,    2,    2,    2,    1,    1,    2,    2,    2,    2,
-    2,    2,    2,    2,    2,    2,    2,    3,    2,    3,
-    2,    2,    2,    2,    2,    2,    2,    0,    1,    2,
-    2,    2,    1,    1,    1,    1,    0,    1,    2,    4,
-    5,    4,    3,    3,    1,    2,    1,    3,    1,    1,
-    3,    5,    4,    3,    2,    2,    1,    1,    1,    1,
-    1,    1,    1,    1,    2,    2,    1,    2,    1,    1,
-    0,    1,    5,    0,    1,    1,    1,    0,    3,    0,
-    5,    2,    4,    6,    6,    1,    1,    1,    3,    3,
-    1,    3,    3,    1,    1,    5,    5,    4,    1,    2,
-    2,    2,    2,    1,    2,    5,    1,    1,    2,    5,
-    1,    2,    3,    4,    1,    1,    1,    1,    1,    1,
-    1,    1,    3,    3,    3,    2,    2,    0,    5,    7,
-    0,    2,    1,    1,    0,    1,    1,    1,    0,    1,
-    1,    2,    1,    1,    1,    5,    5,    2,    2,    2,
-    2,    1,    0,    4,    6,    1,    3,    2,    2,    2,
-    0,    3,    0,    1,    2,    1,    1,    3,    1,    2,
-    1,    1,    2,    2,    2,    3,    2,    1,    0,    2,
-    1,    1,    1,    0,    2,    0,    1,    2,    2,    0,
-    1,    0,    2,    3,    3,    3,    3,    1,    3,    1,
+       4,     4,     3,     4,     4,     4,     4,     1,     3,     1,
+       1,     1,     2,     2,     2,     1,     1,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     3,     2,
+       3,     2,     2,     2,     2,     2,     2,     2,     0,     1,
+       2,     2,     2,     1,     1,     1,     1,     0,     1,     2,
+       4,     5,     4,     3,     3,     1,     2,     1,     3,     1,
+       1,     3,     5,     4,     3,     2,     2,     1,     1,     1,
+       1,     1,     1,     1,     1,     2,     2,     1,     2,     1,
+       1,     0,     1,     5,     0,     1,     1,     1,     0,     3,
+       0,     5,     2,     4,     6,     6,     1,     1,     1,     3,
+       3,     1,     3,     3,     1,     1,     5,     5,     4,     1,
+       2,     2,     2,     2,     1,     2,     5,     1,     1,     2,
+       5,     1,     2,     3,     4,     1,     1,     1,     1,     1,
+       1,     1,     1,     3,     3,     3,     2,     2,     0,     5,
+       7,     0,     2,     1,     1,     0,     1,     1,     1,     1,
+       2,     1,     1,     1,     5,     5,     2,     2,     2,     2,
+       1,     0,     4,     6,     1,     3,     2,     2,     2,     0,
+       3,     0,     1,     2,     1,     1,     3,     1,     2,     1,
+       1,     2,     2,     2,     3,     2,     1,     0,     1,     2,
+       2,     0,     2,     3,     3,     3,     3,     1,     3,     1,
     1,    3,    1,    1,    1,    2,    4,    4,    2,    2,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
@@ -352,6802 +1299,2382 @@
     4,    2,    2,    5,    0,    1,    2,    1,    1,    1,
     3,    3,    3,    3,    3,    3,    1,    1,    1,    3,
-    5,    5,    5,    5,    7,    1,    3,    1,    8,    2,
-    1,    1,    3,    1,    1,    1,    4,    1,    3,    1,
-    3,    0,    4,    1,    3,    0,    1,    0,    2,    3,
-    1,
+       5,     5,     5,     5,     7,     1,     8,     2,     1,     1,
+       3,     1,     1,     1,     4,     1,     3,     0,     4,     1,
+       3,     3,     1
 };
-short fortrandefred[] = {                                      1,
-    0,   37,   19,   20,   17,   18,   27,    5,   21,    2,
-    0,    0,   27,   23,    3,  113,   38,    0,    0,  458,
-    0,  387,  388,    0,    0,    0,    0,    0,   29,    0,
-    0,    0,    0,    0,  391,    0,  497,    0,    0,  417,
-  397,    0,    0,    0,  418,    0,  491,  492,  496,  498,
-  495,    0,    0,    0,  145,  396,    0,    0,    0,  395,
-    0,  421,  124,    0,  446,  157,    0,    0,    0,  451,
-    0,  452,  366,    0,  182,    0,  193,  192,  197,  195,
-  398,  401,  400,  399,  190,  114,  194,  196,  338,  436,
-    0,    0,    0,    0,    0,  379,    0,    0,    0,   60,
-    0,    8,   21,   21,    0,    0,   21,    0,    0,    0,
-    0,   58,   61,   62,   63,   64,   65,    0,    0,    0,
-    0,    0,    0,    0,    0,  375,  384,    0,    0,    0,
-    0,  423,  424,  425,    0,    0,    0,    0,    0,    0,
-    0,   25,   37,    7,   36,   32,    0,    0,    0,  285,
-  286,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  339,  340,    0,
-  347,  350,  349,  342,  343,  344,  341,    0,    0,    0,
-    0,    0,  249,    0,  247,    0,  281,    0,  316,  250,
-    0,    0,    0,  356,  430,    0,    0,    0,  101,    0,
-  428,    0,    0,  150,    0,  148,    0,  429,    0,  414,
-  413,  392,  548,    0,  550,    0,  416,  407,   35,  383,
-    0,  480,  478,    0,  457,    0,    0,    0,    0,  162,
-    0,    0,  138,    0,    0,  172,  173,  158,  143,  144,
-  170,    0,  234,  235,    0,   72,   52,    0,    0,    0,
-  112,    0,   50,    0,  174,  381,  382,  380,    0,    0,
-    0,  178,   15,    0,    0,    0,   10,   11,   39,   21,
-   37,   14,    0,    0,    0,    0,  166,  165,    0,    0,
-    0,    0,    0,    0,    0,    0,  120,    0,    0,  137,
-    0,    0,    0,    0,  159,    0,    0,  179,    0,  210,
-    0,  367,    0,  389,    0,    0,  433,  385,    0,    0,
-    0,    0,    0,    0,  422,  431,    0,    0,  440,  445,
-    0,  453,  514,  515,  494,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  454,    0,    0,    0,    0,    0,
-    6,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  249,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  348,    0,  352,  346,  345,  317,    0,  319,
-    0,  317,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  282,    0,    0,  393,    0,    0,    0,    0,    0,
-  109,  152,    0,    0,    0,    0,  570,    0,    0,    0,
-    0,    0,  551,  556,    0,    0,    0,    0,    0,  560,
-  564,    0,    0,   74,   75,   78,   73,   79,   76,   81,
-   82,   83,   84,   85,   80,   86,   87,   88,   89,   90,
-   91,   92,   93,   94,   95,   77,   96,    0,   97,    0,
-  139,    0,    0,    0,    0,    0,    0,  220,  222,    0,
-  224,    0,  226,  227,  228,  229,  230,  221,    0,  218,
-  216,  174,  110,    0,    0,  180,    0,    0,  203,    0,
-    0,    0,    9,   16,   12,   13,    0,    0,    0,    0,
-    0,  123,    0,    0,    0,   70,    0,    0,    0,  126,
-  121,  141,    0,    0,  161,    0,    0,  184,    0,  212,
-    0,    0,    0,    0,    0,  207,  181,    0,    0,    0,
-  412,  571,    0,  405,    0,    0,  433,  437,    0,    0,
-    0,    0,  447,  484,  485,    0,    0,    0,    0,  481,
-  499,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  468,    0,  516,    0,    0,  469,    0,    0,    0,
-    0,    0,    0,  456,   49,   48,   41,    0,   46,    0,
-    0,    0,  252,    0,    0,    0,  251,  258,  255,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  272,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  324,    0,    0,    0,    0,  248,    0,    0,
-    0,    0,    0,    0,  307,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  306,    0,    0,    0,    0,    0,    0,    0,
-    0,  394,  104,    0,  103,  102,   66,    0,    0,    0,
-    0,    0,    0,  477,  476,  479,    0,    0,    0,  378,
-    0,  163,    0,   99,    0,  171,   51,    0,  223,    0,
-    0,    0,    0,  111,    0,    0,  204,    0,  245,    0,
-  238,    0,  240,  434,   31,    0,   54,  167,    0,    0,
-  136,    0,    0,    0,    0,    0,    0,  129,    0,    0,
-    0,  160,    0,    0,    0,    0,  189,  186,  208,    0,
-    0,    0,  368,    0,    0,    0,    0,  450,  442,    0,
-  489,  490,    0,    0,    0,    0,  474,  475,    0,    0,
-    0,  526,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   42,    0,   33,  386,    0,  253,  254,
-  257,  261,  262,  263,  264,  265,  260,  266,  267,  268,
-  269,  270,  271,  273,  274,  275,  276,  256,    0,    0,
-    0,  248,  532,    0,  536,    0,  534,    0,  259,    0,
-    0,  322,    0,  327,    0,  330,    0,    0,    0,    0,
-    0,    0,    0,    0,  153,  390,    0,    0,    0,  553,
-  376,  561,  377,  565,   98,    0,    0,    0,  147,  232,
-  233,  231,    0,  219,  217,    0,    0,  206,    0,    0,
-  237,    0,    0,  122,    0,    0,    0,    0,    0,    0,
-  115,  128,    0,  117,  140,  146,  185,    0,  187,    0,
-    0,    0,    0,    0,    0,    0,    0,  448,    0,    0,
-    0,  500,    0,  482,    0,    0,  527,  517,   47,   44,
-    0,    0,    0,    0,    0,  361,    0,    0,    0,    0,
-    0,  321,  105,    0,  557,    0,  100,    0,    0,  199,
-  225,    0,    0,  239,    0,  244,  119,    0,    0,    0,
-    0,    0,  188,  214,    0,  364,    0,  371,  370,  369,
-  426,  427,    0,  435,  488,    0,    0,    0,   45,    0,
-  541,  543,  542,  353,    0,    0,  328,    0,    0,  563,
-    0,    0,  175,    0,  116,    0,    0,    0,  524,    0,
-    0,    0,    0,  201,  176,    0,  373,  372,    0,    0,
-    0,    0,    0,    0,    0,    0,
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint16 yydefact[] =
+{
+       2,     0,     1,    37,    20,    21,    18,    19,    27,     6,
+      22,     3,    25,    30,    27,    24,     4,    26,    37,   113,
+      38,     0,     0,   456,     0,   387,   388,     0,     0,     0,
+       0,     0,    29,   354,   108,   108,     0,     0,   391,     0,
+     486,     0,     0,   417,   397,   415,     0,     0,   418,     0,
+     480,   481,   485,   487,   484,     0,     0,     0,   145,   396,
+     108,   108,     0,   395,     0,   419,   124,     0,   444,   157,
+       0,     0,     0,   449,     0,   450,   366,    71,   182,     0,
+     193,   192,   197,   195,   398,   401,   400,   399,   190,   114,
+     194,   196,   338,   434,     5,     9,    22,     0,    22,     0,
+      22,     0,     0,    57,   125,    65,   142,    64,   164,    59,
+      61,    60,    56,     0,    63,    58,   215,     0,   183,   202,
+     191,   431,    62,     0,    25,     0,   379,     0,     0,   384,
+     411,     0,   375,     0,   430,   423,   439,     0,     0,   422,
+       0,     0,     0,   421,     0,     8,     7,    36,    32,    40,
+       0,     0,   285,   286,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     339,   340,     0,   347,   350,   349,   342,   343,   344,   341,
+       0,   402,   250,   247,     0,   279,   316,   318,   315,   281,
+     314,   280,   351,   249,     0,     0,   356,   357,   428,     0,
+      69,   101,     0,   355,   426,     0,   150,     0,   148,     0,
+     427,     0,   414,   413,   392,   535,     0,   537,     0,   416,
+     407,    35,   383,     0,   469,   467,     0,   455,     0,     0,
+       0,     0,   162,     0,     0,   138,     0,    53,   172,   173,
+     158,   143,   144,   170,   169,   234,   235,   108,    72,    52,
+      30,    15,    25,     0,    11,    39,    22,    12,     0,     0,
+      55,   166,   127,   164,     0,   125,     0,   236,   120,   125,
+     165,   137,     0,   165,     0,     0,     0,   236,   154,   159,
+       0,     0,     0,   112,    50,     0,   177,   174,   209,   210,
+       0,     0,     0,   179,     0,     0,   178,     0,    16,   236,
+     367,   362,    37,   381,   380,   382,   164,   408,   406,     0,
+       0,     0,   420,     0,   441,   438,   443,   429,     0,   451,
+     503,   504,   483,     0,     0,     0,     0,   338,     0,   490,
+     491,   452,   457,   461,     0,   482,     0,   453,   389,     0,
+       0,   431,   385,     0,    34,     0,   284,   277,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,   527,   517,   249,     0,   519,
+     518,     0,     0,   247,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   308,
+       0,     0,     0,   282,   283,     0,   354,   319,   317,   317,
+     345,   348,   346,   352,     0,     0,   393,     0,     0,   236,
+       0,     0,   109,   152,   151,   149,     0,     0,   551,     0,
+     542,   431,   539,   547,   538,   543,   341,   247,   314,   541,
+     545,   547,   549,     0,    67,    74,    75,    78,    73,    79,
+      76,    81,    82,    83,    84,    85,    80,    86,    87,    88,
+      89,    90,    91,    92,    93,    94,    95,    77,    96,    97,
+      68,     0,   139,     0,   106,     0,     0,     0,    10,    17,
+      40,    13,     0,     0,     0,   135,     0,    70,     0,     0,
+     135,   123,   164,     0,   126,   121,   141,   164,   236,   236,
+     164,   161,     0,   155,   220,   222,   236,   224,     0,   226,
+     227,   228,   229,   230,     0,   218,   221,   216,    40,   174,
+     110,     0,     0,   212,   207,   211,   181,   184,     0,   338,
+       0,   213,     0,   203,   205,     0,   180,   236,     0,    14,
+     412,   552,   405,     0,   436,   437,   431,   435,     0,   447,
+       0,   442,   445,   473,   474,     0,   314,     0,   470,   472,
+     488,   498,   501,   500,   499,     0,   472,   507,   514,   508,
+     514,   459,   458,   514,   505,   507,   460,     0,     0,     0,
+       0,     0,   496,   454,     0,     0,    49,    48,    41,     0,
+      46,    43,     0,     0,   252,     0,     0,     0,   251,   258,
+     255,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,   272,     0,     0,     0,     0,     0,     0,
+     247,     0,     0,     0,   324,     0,     0,     0,   248,     0,
+       0,   313,   307,   302,   292,   303,   304,   305,   301,   291,
+     297,   299,   293,   295,   287,   288,   289,     0,     0,   309,
+     306,   290,     0,   296,     0,   294,   323,     0,   325,     0,
+       0,   403,   404,   394,     0,   103,   104,   102,    66,     0,
+       0,     0,   317,     0,     0,   466,   468,   465,     0,     0,
+       0,   378,     0,   163,     0,    99,     0,   171,    51,    31,
+     168,    54,   167,     0,   118,     0,   136,     0,     0,   127,
+     129,     0,   125,   241,   245,     0,   238,   240,   246,     0,
+     198,   198,     0,   160,   223,     0,     0,     0,   111,     0,
+     236,   208,     0,     0,   213,   186,     0,   189,     0,   204,
+     432,     0,     0,   363,   368,     0,   236,   448,   440,     0,
+       0,   478,   479,   317,   475,     0,   463,   464,   502,   464,
+       0,   515,   511,   512,   507,   509,   462,   497,   493,   494,
+     495,   492,   547,   547,     0,    42,     0,    33,   386,   278,
+     253,   254,   257,   261,   262,   263,   264,   265,   260,   266,
+     267,   268,   269,   270,   271,   273,   274,   275,   276,   256,
+     248,     0,     0,     0,   520,   521,   524,   525,   522,   523,
+     259,   247,   312,   310,   311,   300,   298,   354,   337,   329,
+     326,   327,   330,   320,   322,   236,   153,   390,     0,     0,
+       0,   540,   376,   546,   377,   550,    98,   107,     0,   115,
+     135,   135,   135,   135,   135,   130,   128,   135,   117,   122,
+     243,     0,   237,   242,   140,     0,   146,   147,   156,   232,
+     233,   231,     0,   219,   217,   236,   198,   185,   213,   187,
+       0,   206,     0,     0,     0,     0,   236,   446,   489,     0,
+       0,     0,   471,   472,   507,   514,   516,   506,     0,     0,
+      47,    44,     0,   338,     0,     0,     0,   361,     0,     0,
+     335,   336,     0,   321,   105,     0,   544,     0,   100,   119,
+     131,   132,   133,   134,     0,   239,   244,   246,     0,   199,
+     200,   225,   198,   358,   188,   214,   374,   364,   365,   371,
+     370,   369,     0,   433,   477,   476,     0,   510,   424,   425,
+      45,     0,   530,   532,   531,   353,   334,     0,   331,   328,
+       0,   548,   116,     0,   358,   175,     0,     0,     0,   409,
+     513,     0,   333,     0,   536,   201,   176,     0,   373,   372,
+       0,     0,   332,   359,   410,   533,     0,   534
 };
-short fortrandgoto[] = {                                       1,
-  262,  263,   91,  286,  598,  353,  927,  928,  742,  743,
-  512,  710,  711,  287,  242,  146,  313,  222,   92,   93,
-   94,   95,   96,   97,   98,  189,  190,  191,  553,  843,
-  192,  722,  280,  311,  193,  194,  542,  599,  195,  356,
-  196,  197,  385,  386,  387,  893,  723,  198,  199,  640,
-  814,  815,  816,  395,  396,  205,  211,  724,  663,  645,
-  200,  357,  713,  422,  910,  433,  100,   10,  276,   11,
-  101,   12,  143,   13,   14,  102,  103,  277,  104,  105,
-  106,  107,    0,  108,  776,  255,  215,  245,  109,  110,
-  111,  112,  113,  114,  115,  116,  117,  478,  208,  118,
-  293,  498,  479,  483,  209,  428,  503,  264,  289,  294,
-  119,  297,  120,  300,  121,  839,  122,  304,  305,  252,
-  505,  265,  953,  272,  123,  308,  124,  544,  737,  509,
-  499,  500,  641,  954,  125,  126,  441,  683,  449,  452,
-  127,  128,  202,  129,  320,  554,  130,  228,    0,  131,
-  325,  132,  133,  134,  135,  136,  274,  137,  329,  561,
-  562,  138,  563,  225,  139,  332,  140,  345,  141,  235,
-    0,    0,    0,  582,  583,  346,  587,    0,  568,  347,
-  570,  571,  349,  584,  585,  763,    0,  443,  444,    0,
-    0,    0,
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,    11,    94,    95,    96,   261,    12,   262,    13,
+      18,    15,    97,    98,   148,    14,    99,   266,   354,   777,
+     599,   600,   100,   257,   479,   480,   247,   210,   211,   428,
+     483,   217,   294,   295,   101,   102,   273,   703,   103,   104,
+     278,   274,   704,   705,   105,   106,   281,   107,   108,   109,
+     110,   111,   434,   112,   113,   288,   289,   244,   276,   270,
+     271,   114,   254,   115,   531,   296,   530,   116,   117,   303,
+     540,   118,   119,   120,   856,   919,   306,   543,   300,   541,
+     737,   297,   524,   525,   862,   526,   504,   715,   716,   717,
+     357,   192,   358,   193,   194,   413,   660,   642,   195,   668,
+     196,   197,   198,   199,   670,   820,   821,   822,   200,   201,
+     202,   422,   417,   214,   208,   955,   956,   203,   122,   123,
+     311,   743,   744,   928,   929,   124,   125,   126,   127,   128,
+     204,   129,   552,   317,   224,   230,   130,   131,   132,   309,
+     133,   134,   322,   135,   325,   560,   136,   137,   561,   562,
+     138,   139,   581,   341,   586,   329,   237,   567,   568,   140,
+     343,   141,   142,   344,   570,   346,   582,   583,   584,   762,
+     388,   389,   390,   894,   227,   143,   443,   444,   445,   451,
+     684,   453,   144,   553
 };
-short fortransindex[] = {                                      0,
-  121,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-27287, -307,    0,    0,    0,    0,    0, -289, -289,    0,
-  111,    0,    0,25188,  118, 1476,  147,  153,    0,25188,
-   91,  107, 1476,  163,    0,   27,    0,  -13,25188,    0,
-    0, -250, -178,   27,    0,  208,    0,    0,    0,    0,
-    0,  -14,  215,  229,    0,    0,  201,  201, -151,    0,
-  244,    0,    0, -237,    0,    0,  -89,   27,   27,    0,
- -100,    0,    0, -101,    0,   27,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  284,   35,   27,   27,   27,    0,  290,  134,  280,    0,
-   79,    0,    0,    0,   -5, -307,    0,  138,   -9,  387,
-  388,    0,    0,    0,    0,    0,    0,   42, -117,  404,
-  387, -110,  225, -312,   43,    0,    0, 3999,   54,25188,
-   41,    0,    0,    0, 1476,  420,  425,   59,  437,25721,
-  437,    0,    0,    0,    0,    0,  444,25188,25188,    0,
-    0,25188,  446,  448,  450,25188,25188,25188,  455,  456,
-  466,  478,  480,  486,  487,  497,  503,  504,  509,  513,
-25188,  515,  524,  528,  532,  533,25241,    0,    0,  539,
-    0,    0,    0,    0,    0,    0,    0,25188,   18,  149,
-  542,25188,    0,  548,    0,  553,    0,  563,    0,    0,
- 8597,  115,25188,    0,    0, 8597,  190,  570,    0,25188,
-    0, 8597,  558,    0,  222,    0,  222,    0,25188,    0,
-    0,    0,    0,25188,    0,25903,    0,    0,    0,    0,
-  190,    0,    0,25380,    0,  190,  190,  222, 3040,    0,
-  224,  190,    0,25188,  609,    0,    0,    0,    0,    0,
-    0,  610,    0,    0,  201,    0,    0,  255, 1930,  603,
-    0,  651,    0, -289,    0,    0,    0,    0,  283,25428,
- -312,    0,    0,  665,27287, -307,    0,    0,    0,    0,
-    0,    0, -289,  648,  296,  675,    0,    0,   19,  308,
-   19,  -12,   86,  -11,  665,  308,    0,  190,   19,    0,
-  313,  665,  318,  692,    0,  -10, 3093,    0,24098,    0,
-  703,    0,  711,    0,  717,  732,    0,    0,  387,  190,
- 8597,25188,25188,  190,    0,    0,  360, 4498,    0,    0,
-25685,    0,    0,    0,    0,25188,25188,25188,25188,  740,
-25685,  149,  553, 1423,    0,  764,  209,    0, 9398,25241,
-    0,    8,  535,25936, 3157,  236, 8597,25188,25188,25188,
-  281,26019,  461,25188,25188,25188,25188,25188,25188,25188,
-25188,25188,25188,25188,25188,26043,25188,25188,25188,25188,
-25188,25241,    0,  781,  451,  786,  789,    0, 8597,25188,
-  790,26094,    0,25188,    0,    0,    0,    0,   48,    0,
-  190,    0,24299,25188,25188,25188,25188,25188,25188,25188,
-25188,25188,25188,25188,25188,25188,25188, 2012,25188,24438,
-24486,    0,25188,25188,    0,26169,  665,  475,  147,26191,
-    0,    0,  791,  791,26213,27040,    0,  796,  553,  563,
-  793,  801,    0,    0,  798,  256,  799,  796,  797,    0,
-    0,  568,  791,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  800,    0,  571,
-    0, 8597,  577,  802,  428,   27,  665,    0,    0,  665,
-    0,  807,    0,    0,    0,    0,    0,    0,  119,    0,
-    0,    0,    0,  444,  436,    0,24627, 8597,    0,  819,
- 2554,  665,    0,    0,    0,    0,  444,25188,  599,  296,
-  387,    0,  387,  233,25188,    0,  447,  449,  233,    0,
-    0,    0,  387,  665,    0,  692,  318,    0, 3093,    0,
-24251,  817, 8597,  824,24675,    0,    0, -225,  190,  190,
-    0,    0,  806,    0, 8597, 8597,    0,    0,  445, 8597,
-  827,  826,    0,    0,    0, 9456, 9398,  605,  100,    0,
-    0, 8597, 8597, 8597, 8597,25188,  333, 1423,  538,  553,
- 8597,    0,  828,    0, 8597, 1423,    0, 9398, 9398, 9398,
- 9398, 9398,  598,    0,    0,    0,    0,  614,    0,  833,
- 1476,25188,    0,  618,  619,26276,    0,    0,    0,26327,
-26349,26446,26468,26509,26582,26604,26626,26701,26742,26764,
-26859,    0,  626,  634,  636,  638,  642,  831,  834,  835,
-26881,25241,    0,25241,25241,  644,25188,    0,  822,  840,
-24813,  553,  841,25188,    0, 8597, 2081, 2081, 2226, 2226,
- 3157,   84,   84,   84,   84,   84,   84,   90,   90,   48,
-25188,25188,    0, 8597,   48,25188,   84,25188,   84, 8597,
- 8597,    0,    0,  190,    0,    0,    0,  468,  551,25188,
-24813, -278,  845,    0,    0,    0, -278,  846,  190,    0,
- 3040,    0,25188,    0,25188,    0,    0,  852,    0, -170,
- 1930,  843,  485,    0,  665,  864,    0,25188,    0,  646,
-    0, 6917,    0,    0,    0, 8597,    0,    0,  318,  308,
-    0,  321,  550,  635,26934,  643,  870,    0,  645,  190,
-  852,    0,  878,24675,  817,  506,    0,    0,    0,  862,
-  547,  880,    0,  793,  797,25188,  665,    0,    0, 4498,
-    0,    0,24813,  631,  544,25685,    0,    0, 8597,    0,
-  656,    0, 8597, 8597, 1423, 8597,  828,  250,  598,  598,
-  598,   38,   -1,    0,   10,    0,    0, 8597,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,25563,25563,
-25563,    0,    0, 8597,    0, 8597,    0, 8597,    0,  885,
-25188,    0,24866,    0,  883,    0, 7337,  548,   84,   84,
-   48,   84,   84,  665,    0,    0,26997,  658,  867,    0,
-    0,    0,    0,    0,    0, 8597,  660,25616,    0,    0,
-    0,    0,  891,    0,    0,  665,  852,    0, 8597, 2554,
-    0,25005,  692,    0,  149,  233,  233,  233,  233,  233,
-    0,    0,  233,    0,    0,    0,    0,  817,    0,24675,
-   28,  516,  517,  894,  895,27113,  665,    0,  896,24169,
-  190,    0,  209,    0, 2501, 8597,    0,    0,    0,    0,
-  662,  879,  898,  900,  902,    0,  903,25188, 7757,24813,
-25188,    0,    0,  904,    0,  190,    0,25053, 8597,    0,
-    0,  852,    0,    0, 8597,    0,    0,  184,  184,  906,
-  491,  677,    0,    0,  573,    0,  917,    0,    0,    0,
-    0,    0,25188,    0,    0,  801,  909, 8597,    0,25188,
-    0,    0,    0,    0, 8597,25188,    0, 8177,25188,    0,
-  927,    0,    0,  911,    0,  557,  559,27166,    0,27187,
- 8597,25188, 8597,    0,    0,25188,    0,    0,25188,25188,
- 8597, 8597, 8597,27272,25188, 8597,
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -702
+static const yytype_int16 yypact[] =
+{
+    -702,   921,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,   -59,  5446,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,   -24,   -24,  -702,    -3,  -702,  -702,  4703,     3,  2638,
+      49,    56,  -702,  4703,    37,    38,  2638,   146,  -702,   -93,
+    -702,  -110,  4703,  -702,  -702,    43,    48,   -93,  -702,   148,
+    -702,  -702,  -702,  -702,  -702,   185,   156,   158,  -702,  -702,
+     164,   164,    79,  -702,   171,  -702,  -702,   -51,  -702,  -702,
+      -7,   -93,   -93,  -702,    75,  -702,  -702,    53,  -702,   -93,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,   179,  -702,  -702,   224,  -702,   130,
+    -702,   -81,   186,   136,   149,  -702,   138,  -702,   360,   363,
+    -702,  -702,   172,   150,  -702,  -702,   145,   -19,    16,    29,
+     370,   395,  -702,   231,   -59,   -93,  -702,   -93,   -93,  -702,
+     230,  4703,  -702,    27,   405,  -702,   233,   241,  2638,  -702,
+     236,  2722,   236,  -702,  5702,  -702,  -702,  -702,  -702,   253,
+    4703,  4703,  -702,  -702,  4703,   256,   257,   266,  4703,  4703,
+    4703,   267,   271,   277,   289,   292,   298,   304,   312,   313,
+     314,   315,   317,  4703,   318,   328,   329,   330,   331,  4831,
+    -702,  -702,   334,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    4703,  2443,  -702,  -702,  4703,   244,  -702,   335,   343,  -702,
+     344,   359,   228,  -702,    58,  4703,  -702,  2443,  -702,   362,
+     529,  -702,  4703,  2443,  -702,   536,  -702,   372,  -702,   372,
+    -702,  4703,  -702,  -702,  -702,  -702,  4703,  -702,  1425,  -702,
+    -702,  -702,  -702,   362,  -702,  -702,  4959,  -702,   362,   362,
+     372,  3079,  -702,   373,   362,  -702,  4703,   541,  -702,  -702,
+    -702,  -702,  -702,  -702,   544,  -702,  -702,   164,  -702,  -702,
+    5446,  -702,   -59,   -24,  -702,  -702,  -702,  -702,   548,   390,
+     563,  -702,    60,    28,   333,   408,   159,   399,  -702,   408,
+     362,  -702,   159,  -702,   410,   412,   159,   399,   571,  -702,
+     413,   445,   581,  -702,  -702,   -24,   583,  -702,  3039,  -702,
+     404,   147,  3935,  -702,  5087,   -19,  -702,   411,  -702,   399,
+    -702,   586,  -702,  -702,  -702,  -702,   360,   362,  2443,  4703,
+    4703,   362,  -702,   414,  4063,  -702,  -702,  -702,  2588,  -702,
+    -702,  -702,  -702,  4703,  4703,  4703,  4703,   587,  2588,   244,
+     359,  -702,  1096,   588,   403,   580,  2852,  4831,  -702,   416,
+     417,  -702,  -702,    17,   567,  1446,  2556,  2443,    23,  4703,
+    4703,  4703,    42,  1469,    52,  4703,  4703,  4703,  4703,  4703,
+    4703,  4703,  4703,  4703,  4703,  4703,  4703,  1491,  4703,  4703,
+    4703,  4703,  4703,  4831,  2443,  1512,   722,  -702,   461,   595,
+     604,  4703,  1548,   607,  3423,  4703,  4703,  4703,  4703,  4703,
+    4703,  4703,  4703,  4703,  4703,  4703,  4703,  4703,  4703,  3167,
+    4703,  3551,  3679,  -702,    19,   362,  4703,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  4703,  4703,  -702,  1570,    65,   399,
+      49,  1694,  -702,  -702,   608,   608,  1752,   791,  -702,   244,
+     -54,    22,   425,   612,  -702,  -702,   436,   437,     8,    22,
+    -702,   616,  -702,    70,   608,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+     617,   597,  -702,    74,  2443,   443,   454,   -93,  -702,  -702,
+     253,  -702,  4703,    76,   390,   260,  4703,  -702,   455,   457,
+     260,  -702,   360,  2489,  -702,  -702,  -702,   360,   399,   399,
+     360,  -702,   413,   571,  -702,  -702,   399,  -702,   449,  -702,
+    -702,  -702,  -702,  -702,   356,  -702,  -702,  -702,   253,  -702,
+    -702,   460,  4191,  -702,  -702,  2443,  -702,  -702,  3935,  3295,
+     452,   630,  4319,  -702,  2443,   462,  -702,   399,    33,  -702,
+    -702,  -702,  -702,   629,  2443,  2443,  -702,  -702,   467,  2443,
+     464,   642,  -702,  -702,  -702,  2852,  3807,    78,  -702,   106,
+    -702,  2443,  2443,  2443,  2443,  4703,   308,  5572,  2443,   244,
+    1773,  -702,   643,  2443,  -702,  5572,  -702,  2852,  2852,  2852,
+    2852,  2852,   623,  -702,   362,   362,  -702,  -702,  -702,    86,
+    -702,   471,  2638,  4703,  -702,    87,    89,  1794,  -702,  -702,
+    -702,  1815,  1836,  1876,  1897,  1939,  2018,  2079,  2121,  2142,
+    2163,  2200,  2221,  -702,    90,    92,    93,    94,    98,  2261,
+     648,   649,   650,  4831,  -702,  4831,  4831,   103,  -702,  4703,
+    4703,  2443,  -702,  2460,  2460,  2481,  2481,  2556,  2577,  2577,
+    2577,  2577,  2577,  2577,   119,   119,    19,  4703,  4703,  2443,
+    -702,    19,  4703,  2577,  4703,  2577,   244,   652,  2783,   477,
+     478,  2443,  2443,  -702,   362,  -702,  -702,  -702,  -702,   490,
+     576,  4703,  2783,    -8,   481,  -702,  -702,  -702,    -8,   482,
+     362,  -702,  3079,  -702,  4703,  -702,  4703,  -702,  -702,  -702,
+    2443,  -702,  -702,   639,    35,   387,  -702,  2345,   640,   486,
+    -702,   646,   408,  4703,  -702,   104,  -702,  -702,  1325,   362,
+     651,   651,   413,  -702,  -702,   264,   445,   662,  -702,   502,
+     399,  -702,   492,  4191,   630,  -702,   504,  -702,   495,  -702,
+    -702,   672,   552,   677,  -702,  4703,   399,  -702,  -702,  4063,
+     513,  -702,  -702,  2783,   674,  2588,  -702,  -702,  2443,   680,
+     105,  -702,  2443,  2443,  5572,  2443,   643,   547,   623,   623,
+     623,   396,   612,   616,    20,  -702,   141,  -702,  -702,  2443,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  5215,  5215,  5215,  2443,  -702,  2443,  -702,  2443,  -702,
+    -702,   514,  2577,  2577,    19,  2577,  2577,  4703,  2911,  1360,
+     698,  -702,  -702,   335,  -702,   399,  -702,  -702,  2403,   109,
+     697,  -702,  -702,  -702,  -702,  -702,  -702,  2443,   111,  -702,
+     260,   260,   260,   260,   260,   359,  -702,   260,  -702,  -702,
+    2443,  2489,  -702,  4447,  -702,  5343,  -702,  -702,   571,  -702,
+    -702,  -702,   523,  -702,  -702,   399,   651,  -702,   630,  -702,
+    4191,  -702,   -47,   535,   538,  1171,   399,  -702,  -702,   744,
+     525,   362,  -702,   403,  5613,  2443,  -702,  -702,   530,   531,
+    -702,  -702,   116,   704,   532,   533,   534,  -702,   537,  4703,
+    1382,  4703,  2783,  -702,  -702,   712,  -702,   362,  -702,  -702,
+      10,    10,   528,   115,   695,  -702,  -702,  2443,  4575,  -702,
+    2443,  -702,   651,   715,  -702,  -702,   598,  -702,   718,  -702,
+    -702,  -702,  4703,  -702,  -702,   425,   543,  2443,  -702,  -702,
+    -702,  4703,  -702,  -702,  -702,  -702,  2443,  4703,  1404,  -702,
+    4703,  -702,  -702,   554,   715,  -702,   723,   572,   573,  1194,
+    -702,  1280,  2443,  4703,  2443,  -702,  -702,  4703,  -702,  -702,
+    4703,  4703,  2443,  2443,  2443,  1303,  4703,  2443
 };
-short fortranrindex[] = {                                      0,
- 5433,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  223,23906,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,23602,
-  560,  560,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,22995,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  560, 3577,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   25,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-18370,  579,    0,    0,    0,    0,    4,  -15,   52,    0,
-23145,    0,    0,    0,    0,23906,    0,    0,    0, 5953,
-13515,    0,    0,    0,    0,    0,    0,    0,18586,13666,
-  580,    0,   11,    0,    0,    0,    0,    0,23298,    0,
-    0,    0,    0,    0,    0,18739,18890,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,16959,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0, 1107, 2724,
- 1277,    0,    0, 1646,    0, 2894,    0, 1816,    0,    0,
-  125,    0,    0,    0,    0,19043,    0,19194,    0,    0,
-    0,13884,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,19347,    0,    0,    0,    0,    0,
-    0,19498,    0,    0,   29,    0,    0,    0,    0,    0,
-    0,19651,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   24,  223,23906,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,19802,    0,    0,    0,14035,
-    0,  954,  580,    0,  908,14035,    0,   30,    0,    0,
-    0,  908,    0,14191,    0,    0,    0,    0,  960,    0,
-    0,    0,19955,    0,    0,    0,    0,    0,20106,23449,
-20259,    0,    0,    0,    0,    0,    0,  987,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0, 9631,
-    0,10472,10208, 5640,    0,20410,    0,10627,    0,23753,
-    0,    0,20563,    0, 6171,    0,  673,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0, 4668,    0,17110,17263, 3263,    0,    0,
-25786,    0,    0,  972,    0,    0,    0,    0, 3433,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0, 5271,    0,    0,
-    0,    0,    0,    0,    0,    0,  674,    0,    0,    0,
-    0,    0,20714,20867,    0,    0,    0,  165,    0,  510,
-  995,  679,    0,    0, 6497,  869, 9017,  526,  995,    0,
-    0,    0,21018,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,21171,    0,    0,
-    0,  680,    0,    0,    0,    0,14404,    0,    0,  127,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,21322,    0,    0,    0,   40,    0,    0,
-    0,   24,    0,    0,    0,    0,21322,    0,    0,    0,
-  580,    0,14555,  356,    0,    0,    0,    0,  356,    0,
-    0,    0,  580,14404,    0,14711,    0,    0,    0,    0,
- 5618, 1012,  708,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,21475,21626,    0,    0,    0,  709,
-    0, 1013,    0,    0,    0,   63,    0,    0, 1014,    0,
-    0,12251,12465,12620,12834,    0, 1014,25857,17479, 4299,
-14924,    0,21779,    0,14924, 5802,    0,    0,    0,    0,
-    0,    0,10891,    0,    0,    0,    0,    0,    0,21930,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,27019,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
- 1021, 2185,    0,    0,    0,11727, 9782,10051, 9111, 9262,
- 6322, 6591, 6742, 7011, 7162, 7431, 7582, 4838, 5101, 3696,
-    0,    0,    0,11882, 3866,    0, 7851,    0, 8002,  164,
-  212,    0,    0,    0,    0,    0,    0,    0,    0,    0,
- 1025,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,17632,    0,    0,
-    0,    0,    0,    0,12989,    0,    0,  710,    0,    0,
-    0,  720,    0,    0,    0,15080,    0,    0,    0,14035,
-    0,    0,  795,    0,    0,    0,   16,    0,    0,    0,
-17632,    0,    0,    0, 1012,    0,    0,    0,    0,    0,
-    0,22083,    0,  995,  995,    0,   24,    0,    0,    0,
-    0,    0,    0,  729,    0,    0,    0,    0,13203,  698,
-    0,    0,15293,15449, 5802,15662,22234,13358,11046,11309,
-11464,12096,    0,    0,    0,    0,    0,  730,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,15818,    0,15974,    0,16130,    0,27293,
- 1028,    0,  737,    0, 1030,    0,  738, 2355, 8271, 8422,
- 4129, 8691, 8842,  674,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  742,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,12989,16286,    0,  744,    0,
-    0,  749,16437,    0,  467,  356,  356,  356,  356,  356,
-    0,    0,  356,    0,    0,    0,    0, 1012,    0,    0,
-    0,    0,    0,    0,    0,    0,   24,    0,    0,    0,
-    0,    0,  750,    0,25857,14924,    0,    0,    0,    0,
-    0,  590,    0,    0,    0,    0,    0,    0,  751,    0,
-  768,    0,    0,    0,    0,    0,    0,    0,17848,    0,
-    0,16286,16655,    0,  720,    0,    0,   93,  146,   31,
-   44,    0,    0,    0,18001,    0,22387,    0,    0,    0,
-    0,    0,    0,    0,    0,  777,    0,16806,    0,    0,
-    0,    0,    0,    0,  778,    0,    0,  779,    0,    0,
-    0,16655,    0,    0,    0,    0,    0,22538,    0,    0,
-  783,    0,22691,    0,    0,    0,    0,    0,    0,    0,
-  788,18217,22842, 1031,    0, 1036,
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -702,  -702,  -702,  -702,   503,  -702,     2,  -702,   740,  -702,
+     -49,   756,  -702,  -702,    -1,     5,  -702,  -702,  -407,  -702,
+      -5,     4,  -702,  -702,    85,  -702,  -702,  -702,   349,  -702,
+      84,   -11,  -702,  -702,  -702,  -702,  -702,  -482,  -702,  -702,
+    -265,   282,  -402,  -702,  -702,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,   173,  -702,  -702,  -278,   270,   -39,   -21,   515,
+     291,  -702,  -702,  -702,   258,  -702,  -702,  -702,  -702,  -702,
+     245,  -702,  -702,  -702,  -701,  -702,  -702,  -702,   483,  -290,
+    -687,  -702,  -702,    63,  -702,   709,  -282,  -702,   -58,   -61,
+     -27,  -176,   -80,  -154,  -323,  -532,  -702,  -702,  -128,  -702,
+    -702,  -702,  -204,  -702,   377,   121,   -92,    64,   178,   -87,
+    -702,  -702,  -198,  -399,   -29,  -143,  -702,  -163,  -702,  -702,
+    -702,  -702,   -56,  -702,  -139,  -702,  -702,  -702,  -702,  -702,
+    -702,  -702,  -702,  -702,   -12,  -702,  -702,  -702,   676,   265,
+    -232,  -702,  -702,  -702,  -702,  -702,  -702,  -702,  -702,    73,
+    -702,  -702,  -702,  -702,  -702,   254,  -702,  -702,    68,  -702,
+    -702,  -702,  -702,  -275,   684,  -316,  -426,  -702,  -694,  -561,
+     480,   446,  -372,  -648,   272,  -702,   237,  -201,  -702,   238,
+    -421,  -702,  -702,  -702
 };
-short fortrangindex[] = {                                      0,
-    0,    0,    0,  813,  303, -401,    0,  126,    0,  211,
- -255,    0,  232,  565,  285,   -2,    0,  -23,    0,    0,
-    0,    0,    0,    0,    0,    0, -120,    7,    0,    0,
- -328,    0,    0,  815, -135,    0, -305,  339, -152,  181,
- -137,    0,  766,  736, -326, -686, -234, -220,    0,  718,
-  221,  438,  371, -189,    0,  -26, -371, -495,    0,    0,
- -169,  -24,  273, -397,    0,  -98,    0,    0, 1117,    0,
-    0,    0,  -39,  -56, 1119,  865,    0,   53,    0,    0,
-    0,    0,    0,    0,    0,    0,   65,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0, 1065,  452,  458,  716,    0,    0,    0,  -30,  627,
-    0, -277,    0,    0,    0, -667,    0, -281,  620,    0,
-  654,    0,  194,    0,    0,    0,    0,  608, -649,    0,
-    0,  457,    0,    0,    0, 1032,  612, -392,  613,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0, -230,
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -508
+static const yytype_int16 yytable[] =
+{
+     191,   442,   207,   385,   423,   511,   213,   220,   534,   207,
+     501,   632,   513,   339,   505,   228,   387,   667,   711,   763,
+     857,   149,   765,   146,   219,   386,   603,   547,   591,   440,
+     689,   283,   319,   843,   440,   232,   393,   450,   840,   301,
+     596,   215,   215,   596,   410,   603,   761,   869,   761,   240,
+     241,   761,   304,   569,   340,   603,   841,   842,   843,   251,
+     252,   424,   425,   576,   741,   279,   225,   259,   674,   226,
+     887,   592,   248,   690,   290,   312,   222,   694,   362,   494,
+     364,   755,   447,   699,   495,   282,   249,   284,   268,   774,
+     603,   286,   603,   603,   223,   603,   603,   603,   269,   242,
+     264,   603,   267,   243,   318,   439,   603,   851,   884,   327,
+     439,   207,   902,   313,   694,   314,   315,   830,    17,   774,
+     250,   728,   926,   355,   356,   418,   587,   330,   331,   588,
+     589,   590,   363,   255,   256,  -315,   841,   842,   843,   275,
+     927,   280,   408,   409,   410,   147,   377,   676,   291,   292,
+     298,   760,   384,   320,   895,   896,  -164,   299,  -164,   766,
+    -164,    92,  -164,   392,   596,   923,   578,   414,   215,   242,
+     242,   385,   706,   243,   243,   283,   150,   706,   427,   242,
+     293,   924,   205,   243,   387,   431,   597,   419,   687,   597,
+     887,   121,  -164,   386,   436,   302,  -164,   598,   844,   437,
+     339,   682,   742,   604,   411,   412,   260,   385,   305,   384,
+     339,  -314,   229,   489,   579,   497,   321,   231,   339,   484,
+     387,   954,   608,   844,   216,   218,   720,   721,   209,   630,
+     886,   886,   610,   886,   724,   212,   936,   502,   426,   496,
+     245,   340,   731,   507,   253,   675,   487,   510,    92,   734,
+     691,   340,   498,   591,   695,   580,   701,   263,   756,   340,
+     591,   805,   490,   807,   809,   740,   775,   780,   491,   781,
+     795,   535,   796,   797,   798,   535,   591,   544,   799,   605,
+     606,   152,   153,   810,   852,   885,   757,   666,   265,   906,
+     750,   908,   554,   555,   528,   550,   940,   559,   624,   625,
+     626,   627,   628,   844,   411,   412,   571,   572,   573,   574,
+     597,   637,   767,   768,   769,   770,   771,   549,   277,   287,
+     384,   891,   351,   537,   937,   221,   538,   233,   587,   330,
+     331,   588,   589,   590,   607,   238,   499,   239,   611,   612,
+     613,   614,   615,   616,   617,   618,   619,   620,   621,   622,
+     246,   888,   889,   761,   234,   272,   629,   500,   909,   726,
+     727,   235,   442,   283,   236,   914,   285,   641,   643,   644,
+     645,   646,   647,   648,   649,   650,   651,   652,   653,   654,
+     655,   656,   659,   661,   663,   665,   421,   429,   393,   213,
+     440,   440,   435,   307,   450,   342,   347,   671,   672,   308,
+     310,   578,   859,   860,   861,   886,   316,   416,   323,   578,
+     326,   441,   324,   454,   448,   328,   449,   452,   898,   588,
+     589,   590,   482,   587,   330,   331,   588,   589,   590,   805,
+     807,   809,   353,   415,   591,   359,   360,   339,   121,   910,
+     911,   912,   913,   868,   858,   361,   365,   849,   866,   579,
+     366,   591,   591,   591,   591,   591,   367,   579,   506,   339,
+     339,   339,   339,   339,   876,   700,   439,   439,   368,   707,
+     387,   369,   387,   387,   514,   698,   718,   370,   340,   440,
+     883,   712,   831,   371,   440,   811,   719,   833,   759,   722,
+     580,   372,   373,   374,   375,   551,   376,   378,   580,   556,
+     340,   340,   340,   340,   340,   535,   566,   379,   380,   381,
+     382,   535,   535,   391,   416,   392,   566,   706,   706,   706,
+     706,   706,   418,   419,   706,   255,   256,   515,   420,   180,
+     181,    92,   430,   587,   330,   331,   588,   589,   590,   754,
+     432,   433,   481,   904,   485,   183,   184,   486,   758,   185,
+     186,   187,   188,   492,   516,   439,   517,   518,   519,   268,
+     439,   520,   521,   189,   522,   523,   494,   591,   330,   331,
+     588,   589,   590,   778,   512,   207,   779,   277,   503,   508,
+     925,   509,   287,   922,   536,   527,   529,   546,   578,   548,
+     557,   585,   575,   634,   933,   594,   595,   601,   635,   393,
+    -488,  -488,  -488,  -488,  -488,  -488,   804,   636,   806,   808,
+     639,   679,   384,   812,   321,   683,   685,   686,   845,   688,
+     692,   693,   696,   697,   708,   903,   709,   339,   725,   730,
+     813,   814,   735,   736,   745,   815,   579,   816,   387,   387,
+     387,   819,   739,   225,   748,   749,   764,   811,   590,   935,
+     776,   801,   802,   803,   828,   819,   817,   823,   824,   826,
+     827,   832,   834,   839,   847,   496,   864,   837,   340,   484,
+     848,   865,   867,   870,   855,   871,   872,   580,   873,   394,
+     874,   395,   396,   397,   398,   399,   850,   400,   401,   402,
+     403,   404,   405,   878,   897,   406,   407,   408,   409,   410,
+    -489,   902,   907,   921,   930,   934,   535,   742,   578,   941,
+     938,   939,   942,   943,   944,   950,   844,   945,   875,   952,
+    -360,   958,   559,   960,   957,   633,   879,  -247,   967,  -247,
+    -247,  -247,  -247,  -247,   965,  -247,  -247,  -247,  -247,  -247,
+    -247,   968,   926,  -247,  -247,  -247,  -247,  -247,   901,   394,
+      16,   395,   396,   397,   398,   399,   579,   400,   401,   402,
+     403,   404,   405,   488,   393,   406,   407,   408,   409,   410,
+     145,   892,   441,   449,   804,   806,   808,   836,   890,   677,
+     838,   710,   723,   732,   493,   702,   258,   729,   545,   863,
+     213,   900,   916,   915,   681,   669,   394,   580,   395,   396,
+     397,   398,   399,   829,   400,   401,   402,   403,   404,   405,
+     949,   966,   406,   407,   408,   409,   410,   880,   931,   969,
+     352,   746,   877,   882,   718,   345,   917,   593,   920,   631,
+     747,   772,     0,   773,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,   535,     0,     0,     0,     0,     0,     0,
+       0,     0,   825,     0,     0,     0,     0,     0,     0,   411,
+     412,   449,     0,   881,     0,     0,   449,     0,   835,     0,
+       0,     0,   946,     0,   948,   819,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   392,     0,     0,     0,     0,     0,   854,     0,     0,
+       0,     0,     0,     0,     0,   959,     0,  -247,  -247,     0,
+       0,     0,     0,     0,   961,     0,     0,     0,     0,     0,
+     962,     2,     3,   964,   638,     0,     0,     0,     0,   411,
+     412,     0,     0,   566,     0,     0,   972,     0,     0,     0,
+     973,     0,     0,   974,   975,     0,     0,     0,   -23,   977,
+     -23,     0,     0,   -23,   -23,   -23,   -23,     4,     5,   -23,
+       0,     0,   -23,   -23,   -23,     0,     0,     0,     0,   -23,
+     -23,     0,     0,     0,     6,     7,   411,   412,     0,     0,
+       0,     0,     0,     0,   -23,     0,     0,     0,   -23,   -23,
+       0,     0,     0,   -23,     0,     0,     0,     0,     0,   -23,
+       0,   -23,   -23,     0,   -23,     0,   -23,   -23,   -23,   -23,
+     -23,     0,   -23,   -23,   -23,   -23,   -23,   -23,   -23,   -23,
+     -23,   -23,   -23,   -23,   -23,   -23,   -23,   -23,     0,     0,
+     -23,   -23,   -23,     0,   -23,   -23,   -23,     0,   -23,   -23,
+     -23,     0,     0,   -23,     0,   -23,     0,     0,   -23,   -23,
+     -23,   -23,     0,     0,   -23,   -23,   -23,     0,     0,   351,
+       0,     0,   -23,     0,     0,     8,   -23,   -23,   -23,   -23,
+     -23,   -23,   -23,     0,   -23,   -23,   -23,   -23,   -23,     0,
+       0,   -23,     0,     0,     0,   951,     0,     0,   -23,   -23,
+     -23,     0,     0,     0,     0,     0,     0,   -23,     9,  -507,
+       0,  -507,     0,  -507,  -507,  -507,  -507,  -507,    10,  -507,
+    -507,  -507,  -507,  -507,  -507,     0,     0,  -507,  -507,  -507,
+    -507,  -507,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   154,   155,     0,     0,     0,
+     156,   157,   158,   159,     0,     0,     0,     0,     0,     0,
+       0,     0,   160,   161,   162,   163,   164,   165,   166,     0,
+     167,   168,   169,     0,     0,   170,   171,   172,     0,   173,
+     174,   175,   176,   177,   932,   178,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,   970,     0,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   180,   181,
+       0,     0,     0,     0,   182,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   183,   184,     0,     0,   185,   186,
+     187,   188,     0,     0,     0,    92,     0,     0,     0,     0,
+       0,     0,   189,     0,     0,   577,     0,     0,     0,     0,
+       0,  -507,  -507,   971,     0,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,   976,     0,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   853,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,     0,     0,     0,     0,     0,   411,   412,     0,     0,
+       0,     0,     0,     0,   901,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,   411,
+     412,   406,   407,   408,   409,   410,   947,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   963,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,   411,   412,   406,   407,   408,
+     409,   410,     0,     0,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,   411,   412,
+     406,   407,   408,   409,   410,     0,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+     411,   412,   406,   407,   408,   409,   410,  -250,     0,  -250,
+    -250,  -250,  -250,  -250,     0,  -250,  -250,  -250,  -250,  -250,
+    -250,     0,     0,  -250,  -250,  -250,  -250,  -250,     0,     0,
+       0,     0,     0,     0,     0,   411,   412,     0,     0,     0,
+       0,     0,     0,   394,     0,   395,   396,   397,   398,   399,
+       0,   400,   401,   402,   403,   404,   405,   411,   412,   406,
+     407,   408,   409,   410,     0,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,   411,
+     412,   406,   407,   408,   409,   410,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   438,     0,     0,     0,     0,
+     411,   412,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    0,    0,    0,    0,    0,  602,    0,    0,    0,
-    0,    0,  412,  607,    0,  219,    0,    0,    0,    0,
-    0,    0,    0,    0, -408,    0,    0,    0,    0, -317,
-  414, 1033, -335, -688,    0, -522,    0, -226,    0,    0,
-    0,    0,
+       0,   411,   412,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   609,
+       0,     0,     0,     0,   411,   412,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   623,     0,     0,     0,     0,   411,   412,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,  -250,     0,     0,     0,     0,  -250,  -250,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+       0,     0,     0,     0,     0,     0,     0,     0,   638,     0,
+       0,     0,     0,   411,   412,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     673,     0,     0,     0,     0,   411,   412,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   394,
+       0,   395,   396,   397,   398,   399,     0,   400,   401,   402,
+     403,   404,   405,     0,     0,   406,   407,   408,   409,   410,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   678,     0,     0,     0,     0,   411,
+     412,   394,     0,   395,   396,   397,   398,   399,     0,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,   394,     0,   395,   396,   397,   398,   399,     0,
+     400,   401,   402,   403,   404,   405,     0,     0,   406,   407,
+     408,   409,   410,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   680,     0,     0,     0,     0,   411,   412,     0,
+       0,     0,   420,     0,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,   411,   412,
+     406,   407,   408,   409,   410,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   782,     0,     0,     0,     0,   411,
+     412,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   783,     0,     0,     0,     0,
+     411,   412,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   784,     0,     0,     0,
+       0,   411,   412,   394,     0,   395,   396,   397,   398,   399,
+       0,   400,   401,   402,   403,   404,   405,     0,     0,   406,
+     407,   408,   409,   410,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   785,     0,     0,     0,
+       0,   411,   412,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,   786,     0,     0,
+       0,     0,   411,   412,   394,     0,   395,   396,   397,   398,
+     399,     0,   400,   401,   402,   403,   404,   405,     0,     0,
+     406,   407,   408,   409,   410,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   787,
+       0,     0,     0,     0,   411,   412,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,   394,     0,   395,
+     396,   397,   398,   399,     0,   400,   401,   402,   403,   404,
+     405,     0,     0,   406,   407,   408,   409,   410,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   788,     0,
+       0,     0,     0,   411,   412,   394,     0,   395,   396,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   789,
+       0,     0,     0,     0,   411,   412,   394,     0,   395,   396,
+     397,   398,   399,     0,   400,   401,   402,   403,   404,   405,
+       0,     0,   406,   407,   408,   409,   410,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   790,     0,     0,     0,     0,   411,   412,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   791,     0,     0,     0,     0,   411,   412,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,   792,     0,     0,     0,     0,   411,   412,
+     394,     0,   395,   396,   397,   398,   399,     0,   400,   401,
+     402,   403,   404,   405,     0,     0,   406,   407,   408,   409,
+     410,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     793,     0,     0,     0,     0,   411,   412,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   794,     0,     0,     0,     0,   411,   412,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,   800,     0,     0,     0,     0,   411,   412,   394,     0,
+     395,   396,   397,   398,   399,     0,   400,   401,   402,   403,
+     404,   405,     0,     0,   406,   407,   408,   409,   410,   397,
+     398,   399,     0,   400,   401,   402,   403,   404,   405,     0,
+       0,   406,   407,   408,   409,   410,     0,     0,     0,     0,
+       0,     0,   399,   713,   400,   401,   402,   403,   404,   405,
+       0,   151,   406,   407,   408,   409,   410,     0,     0,     0,
+     152,   153,   714,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   846,     0,     0,   154,   155,
+     411,   412,     0,   156,   157,   158,   159,     0,     0,     0,
+       0,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,   400,
+     401,   402,   403,   404,   405,     0,     0,   406,   407,   408,
+     409,   410,     0,   905,     0,     0,     0,     0,   411,   412,
+    -508,  -508,  -508,  -508,  -508,  -508,     0,     0,   406,   407,
+     408,   409,   410,     0,     0,     0,     0,     0,     0,   330,
+     331,   563,     0,   564,     0,     0,     0,     0,     0,     0,
+     179,     0,     0,     0,     0,     0,     0,     0,   411,   412,
+       0,   180,   181,     0,     0,     0,     0,   182,   333,   334,
+     335,     0,     0,   336,     0,   411,   412,   183,   184,     0,
+     151,   185,   186,   187,   188,     0,     0,     0,    92,   152,
+     153,     0,     0,     0,     0,   189,   411,   412,   190,     0,
+       0,     0,     0,     0,     0,     0,     0,   154,   155,     0,
+       0,     0,   156,   157,   158,   159,     0,     0,     0,     0,
+       0,     0,     0,     0,   160,   161,   162,   163,   164,   165,
+     166,     0,   167,   168,   169,     0,     0,   170,   171,   172,
+       0,   173,   174,   175,   176,   177,     0,   178,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     180,   181,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,   411,   412,   330,   331,   332,   183,   184,     0,     0,
+     185,   186,   187,   188,     0,     0,     0,   337,     0,     0,
+       0,     0,   411,   412,   189,     0,     0,   565,     0,   179,
+       0,     0,   333,   334,   335,     0,     0,   336,     0,     0,
+     180,   181,     0,     0,     0,     0,   182,   818,     0,     0,
+       0,     0,     0,     0,     0,   151,   183,   184,     0,     0,
+     185,   186,   187,   188,   152,   153,     0,    92,     0,     0,
+       0,     0,     0,     0,   189,     0,     0,   190,     0,     0,
+       0,     0,   154,   155,     0,   206,     0,   156,   157,   158,
+     159,     0,     0,     0,     0,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,   180,   181,     0,     0,     0,     0,
+       0,     0,     0,   330,   331,     0,     0,     0,     0,     0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+       0,   337,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   338,   333,   334,   335,     0,     0,   336,     0,     0,
+       0,     0,     0,     0,   179,   899,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,   180,   181,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+       0,   337,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   565,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   179,     0,   532,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,   533,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,   455,
+       0,     0,     0,   456,   457,   458,   459,     0,     0,     0,
+       0,     0,     0,     0,     0,   460,   461,   462,   463,   464,
+     465,   466,     0,   467,   468,   469,     0,     0,   470,   471,
+     472,     0,     0,   473,   474,   475,   476,     0,   477,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,   657,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+       0,   658,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,   478,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+     733,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   533,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   190,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,   640,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,    92,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,   662,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   179,     0,   664,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,     0,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+     751,     0,   752,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   533,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   753,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,   558,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,   539,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,   533,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   179,     0,     0,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,   738,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     190,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+     714,     0,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   189,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,   953,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   190,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,    92,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   190,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,     0,     0,     0,     0,     0,
+       0,     0,     0,   151,     0,   180,   181,     0,     0,     0,
+       0,   182,   152,   153,     0,     0,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+     154,   155,    92,     0,     0,   156,   157,   158,   159,   189,
+       0,     0,   190,     0,     0,     0,     0,   160,   161,   162,
+     163,   164,   165,   166,     0,   167,   168,   169,     0,     0,
+     170,   171,   172,     0,   173,   174,   175,   176,   177,     0,
+     178,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,   179,     0,     0,     0,     0,     0,     0,     0,
+       0,   151,     0,   180,   181,     0,     0,     0,     0,   182,
+     152,   153,     0,     0,     0,     0,     0,     0,     0,   183,
+     184,     0,     0,   185,   186,   187,   188,     0,   154,   155,
+      92,     0,     0,   156,   157,   158,   159,   189,     0,     0,
+     383,     0,     0,     0,     0,   160,   161,   162,   163,   164,
+     165,   166,     0,   167,   168,   169,     0,     0,   170,   171,
+     172,     0,   173,   174,   175,   176,   177,     0,   178,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+     179,     0,     0,     0,     0,     0,     0,     0,     0,   151,
+       0,   180,   181,     0,     0,     0,     0,   182,   152,   153,
+       0,     0,     0,     0,     0,     0,     0,   183,   184,     0,
+       0,   185,   186,   187,   188,     0,   154,   155,    92,     0,
+       0,   156,   157,   158,   159,   446,     0,     0,   190,     0,
+       0,     0,     0,   160,   161,   162,   163,   164,   165,   166,
+       0,   167,   168,   169,     0,     0,   170,   171,   172,     0,
+     173,   174,   175,   176,   177,     0,   178,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,     0,     0,   179,     0,
+       0,     0,     0,     0,     0,     0,     0,   151,     0,   180,
+     181,     0,     0,     0,     0,   182,   152,   153,     0,     0,
+       0,     0,     0,     0,     0,   183,   184,     0,     0,   185,
+     186,   187,   188,     0,   154,   155,    92,     0,     0,   156,
+     157,   158,   159,   189,     0,     0,   542,     0,     0,     0,
+       0,   160,   161,   162,   163,   164,   165,   166,     0,   167,
+     168,   169,     0,     0,   170,   171,   172,     0,   173,   174,
+     175,   176,   177,     0,   178,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,     0,     0,   179,     0,     0,     0,
+       0,     0,     0,     0,     0,   151,     0,   180,   181,     0,
+       0,     0,     0,   182,   152,   153,     0,     0,     0,     0,
+       0,     0,     0,   183,   184,     0,     0,   185,   186,   187,
+     188,     0,   154,   155,   893,     0,     0,   156,   157,   158,
+     159,   189,     0,     0,   383,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   179,    19,     0,     0,    20,   -28,
+      21,    22,     0,     0,    23,   180,   181,    24,    25,    26,
+       0,   182,     0,     0,    27,    28,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,    29,
+       0,     0,    92,    30,    31,     0,     0,     0,    32,   189,
+       0,     0,   918,     0,    33,     0,    34,    35,     0,    36,
+       0,    37,    38,    39,    40,    41,     0,    42,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    56,    57,     0,     0,    58,    59,    60,     0,    61,
+      62,    63,     0,    64,    65,    66,     0,     0,    67,     0,
+      68,     0,     0,    69,    70,    71,    72,     0,     0,    73,
+      74,    75,     0,     0,     0,     0,     0,    76,     0,     0,
+       0,    77,    78,    79,    80,    81,    82,    83,     0,    84,
+      85,    86,    87,    88,     0,     0,    89,     0,     0,     0,
+       0,   154,   155,    90,    91,    92,   156,   157,   158,   159,
+       0,     0,    93,     0,     0,     0,     0,     0,   160,   161,
+     162,   163,   164,   165,   166,     0,   167,   168,   169,     0,
+       0,   170,   171,   172,     0,   173,   174,   175,   176,   177,
+       0,   178,   154,   155,     0,     0,     0,   156,   157,   158,
+     159,     0,     0,     0,     0,     0,     0,     0,     0,   160,
+     161,   162,   163,   164,   165,   166,     0,   167,   168,   169,
+       0,     0,   170,   171,   172,     0,   173,   174,   175,   176,
+     177,     0,   178,     0,     0,     0,     0,     0,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,     0,     0,     0,   180,   181,     0,     0,     0,     0,
+     182,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     183,   184,     0,     0,   185,   186,   187,   188,     0,     0,
+      23,    92,     0,     0,     0,     0,     0,     0,   189,     0,
+       0,   577,     0,     0,     0,   180,   181,     0,     0,     0,
+       0,   182,     0,     0,     0,    29,     0,     0,     0,     0,
+       0,   183,   184,     0,     0,   185,   186,   187,   188,     0,
+      33,     0,   893,     0,     0,    36,   348,     0,     0,   189,
+      40,    41,   577,     0,     0,     0,     0,     0,     0,     0,
+     349,    50,    51,    52,    53,    54,    55,   350,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      65,     0,     0,     0,     0,     0,    68,     0,     0,     0,
+       0,     0,     0,     0,     0,    73,     0,    75,     0,     0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       0,    92,     0,     0,     0,     0,     0,     0,    93
 };
-#define YYTABLESIZE 27711
-short fortrantable[] = {                                     201,
-  442,  206,  343,  546,  400,  212,  218,  388,  206,  450,
-  440,  592,  522,  569,  226,  440,  147,   99,  531,  342,
-  230,  536,  639,  577,  384,  234,  224,  525,  202,  539,
-  285,  593,  528,  729,   71,  391,  221,  926,  108,  530,
-  595,  383,  202,  191,  249,  250,  535,  191,  597,  595,
-  890,  595,  257,  740,  183,  630,  688,  394,  764,  127,
-  236,  191,  766,  866,  236,  243,  281,  236,  183,  266,
-  267,  268,  133,  133,  133,  133,  888,  324,  259,  589,
-  291,  447,   71,  205,  236,  869,  351,  134,  433,  299,
-  301,  433,  260,  439,  829,  526,  217,  205,  439,  338,
-  214,  322,  704,  338,  309,  321,  338,  420,  326,  421,
-  206,  310,  433,  894,  895,  715,  216,  142,  434,  240,
-  241,  238,  239,  354,  355,  417,  415,  145,  416,  288,
-    9,  417,  362,  246,  317,  131,  131,  131,   89,  453,
-  758,  589,  333,  420,  334,  421,  376,  247,  213,  420,
-  148,  421,  389,  240,  241,  425,  278,  203,  423,  282,
-  240,  241,  701,  392,  213,  402,  227,  399,  402,  761,
-  236,  673,  424,  271,  581,  270,  702,  767,  426,  913,
-  388,  762,  402,  762,  236,  430,  207,  762,  132,  132,
-  132,  741,  210,  343,  435,  721,  888,  384,  937,  436,
-  721,  314,  219,  343,  403,  433,  580,  403,  433,  389,
-  342,  343,  388,  427,  383,  840,  841,  842,  923,  482,
-  342,  403,   30,  579,  516,  859,  253,  254,  342,  628,
-  860,  698,   30,  592,  699,  735,  514,  438,  229,  739,
-  446,  592,  448,  451,  952,  508,  383,  231,  481,  755,
-  589,  333,  404,  334,  236,  404,  714,  592,  213,  524,
-  529,  504,  527,  642,  307,   89,  306,  202,  237,  404,
-  768,  769,  770,  771,  772,  150,  603,  151,  731,  602,
-  517,   99,  543,  244,  543,  248,  191,  127,  551,  240,
-  241,  589,  333,  183,  334,  398,  685,  555,  556,  295,
-  165,  165,  133,  560,  532,  803,  302,  805,  807,  590,
-  591,  572,  573,  574,  575,  134,  251,  261,  442,  486,
-  419,  607,  205,  450,  602,  389,  552,  258,  440,  440,
-  557,  269,  515,  338,  338,  606,  361,  273,  363,  610,
-  611,  612,  613,  614,  615,  616,  617,  618,  619,  620,
-  621,  874,  875,  275,  391,  418,  419,  631,  344,  350,
-  917,  418,  419,  938,  131,  887,  887,  922,  887,  212,
-  588,  590,  591,  760,  589,  333,    2,  334,  646,  647,
-  648,  649,  650,  651,  652,  653,  654,  655,  656,  657,
-  658,  659,  660,  664,  665,  667,  669,  236,  670,  671,
-  279,  202,  232,  296,    3,    4,  303,  284,  581,  233,
-  223,  439,  439,  538,  323,  596,  581,  132,  283,  592,
-  191,    5,    6,  393,  596,  433,  596,  183,  868,  343,
-  288,  290,  592,  592,  592,  592,  592,  853,  883,  897,
-  580,   71,  854,  220,  925,  108,  342,  298,  580,  847,
-  343,  343,  343,  343,  343,  830,  205,  579,  292,  312,
-  832,  440,  697,  327,  328,  579,  440,  342,  342,  342,
-  342,  342,  803,  805,  807,  330,  331,  319,   30,  588,
-  590,  591,  392,  352,  810,  358,  712,  359,  762,  360,
-  719,  877,  720,  716,  364,  365,  383,   30,  383,  383,
-  725,  609,  730,   28,  602,  366,   30,   30,  130,  130,
-  130,  130,    7,  130,  543,  675,  543,  367,  674,  368,
-  543,  590,  591,   30,   30,  369,  370,  721,  721,  721,
-  721,  721,  859,  857,  721,  858,  371,  860,  604,  605,
-  887,  754,  372,  373,  439,    8,  315,  592,  374,  439,
-  555,  759,  375,  555,  377,  438,  448,  623,  624,  625,
-  626,  627,  314,  378,  924,  397,  554,  379,  903,  554,
-  636,  380,  381,  521,  777,  523,  206,  778,  390,  417,
-  415,  398,  416,  533,  882,  589,  333,  394,  334,  401,
-  912,  859,  857,  856,  858,  581,  860,  420,  403,  421,
-  391,  855,  402,  588,  590,  591,   89,  804,  690,  806,
-  808,  689,  389,  429,   30,  431,  817,  694,  343,  819,
-  693,  934,  918,  919,  920,  921,  338,  580,  902,  338,
-  338,  338,  338,  338,  338,  342,  820,  821,  432,  717,
-  480,  822,  520,  823,  579,  757,  810,   30,  756,  338,
-  936,  338,  484,  485,  774,  827,  817,  773,  779,  780,
-  501,  602,  602,  383,  383,  383,  794,  881,  836,  602,
-  482,  487,  417,  415,  795,  416,  796,  602,  797,  602,
-  824,  602,  798,  849,  809,  602,  851,  602,  448,  850,
-  420,  403,  421,  448,  502,  834,  886,  475,  905,  885,
-  907,  900,  939,  693,  511,  773,  506,  475,  518,  543,
-  178,  179,  284,  277,  236,  581,  277,  236,  520,  552,
-  106,  876,  552,  106,  295,  560,  181,  182,  880,  534,
-  183,  184,  185,  186,  302,  537,  865,  475,  130,  475,
-  475,  475,  475,  547,  187,  135,  135,  580,  211,  449,
-  241,  211,  449,  241,  548,  391,  549,  475,  475,  475,
-  246,  135,  135,  246,  579,  135,  135,  135,  135,  486,
-  278,  550,  486,  278,  804,  806,  808,  337,  329,  135,
-  337,  329,  107,  558,  243,  107,  212,  243,  899,  242,
-  483,  335,  242,  483,  335,  404,  405,  406,  407,  408,
-  576,  409,  410,  411,  412,  413,  414,  586,  336,  418,
-  419,  336,  600,  909,  588,  590,  591,  487,  334,  331,
-  487,  334,  331,  333,  632,  712,  333,  915,  332,  634,
-  633,  332,  635,  637,  678,  681,  682,  324,  684,  686,
-  687,  695,  692,  691,  696,  543,  700,  338,  338,  338,
-  338,  338,  705,  338,  338,  338,  338,  338,  338,  707,
-  736,  338,  338,  726,  738,  727,  746,  749,  223,  750,
-  591,  765,  775,  945,  799,  817,  948,  800,  801,  811,
-  812,  818,  826,  392,  825,  831,  833,  317,  404,  405,
-  406,  407,  408,  838,  409,  410,  411,  412,  413,  414,
-  845,  846,  418,  419,  848,  314,  861,  236,  958,  525,
-  314,  314,  950,  314,  863,  960,  864,  236,  867,  871,
-  872,  961,  870,  873,  963,  896,  900,  906,  314,  314,
-  314,  911,  929,  741,  931,  932,  935,  971,  941,  940,
-  942,  972,  943,  944,  973,  974,  956,  949,  955,  959,
-  976,  236,  860,  475,  397,  475,  475,  475,  475,  475,
-  957,  475,  475,  475,  475,  475,  475,  964,  500,  475,
-  475,  966,  475,  967,  475,  925,  108,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  215,  164,  127,  475,  475,
-  209,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  443,  475,  354,
-  475,  475,  475,  475,  475,  562,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
-  475,  475,  213,  444,  475,  475,  475,  483,  475,  475,
-  475,  325,  475,  475,  475,  317,  118,  475,  354,  475,
-  326,  544,  475,  475,  475,  475,  545,  891,  475,  475,
-  475,  914,  968,  930,  718,  510,  475,  475,  475,  475,
-  475,  475,  475,  475,  475,  475,  475,  519,  475,  475,
-  475,  475,  475,  475,  475,  475,  351,  475,  475,  475,
-  475,  889,  475,  475,  475,  594,  351,  629,  828,  643,
-  947,  475,  475,  879,  916,   15,  314,  314,  314,  314,
-  314,  144,  314,  314,  314,  314,  314,  314,  256,  513,
-  314,  314,  835,  351,  676,  965,  733,  351,  351,  351,
-  351,  351,  837,  351,  728,  703,  732,  844,  747,  318,
-  744,  878,  745,  236,  351,  748,  351,  351,  351,  884,
-    0,    0,  348,    0,    0,    0,    0,    0,  236,  236,
-    0,    0,  236,    0,  236,    0,    0,  236,  236,  236,
-  236,  236,  236,  236,    0,    0,  236,  236,  236,    0,
-    0,    0,    0,  236,  236,    0,    0,    0,  236,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,  236,    0,
-    0,    0,  236,  236,    0,    0,    0,  236,    0,    0,
-    0,    0,    0,  236,    0,  236,  236,    0,  236,    0,
-  236,  236,  236,  236,  236,    0,  236,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,    0,    0,  236,  236,  236,    0,  236,  236,
-  236,    0,  236,  236,  236,    0,  314,  236,    0,  236,
-    0,    0,  236,  236,  236,  236,  314,    0,  236,  236,
-  236,    0,    0,    0,    0,    0,  236,    0,    0,  236,
-  236,  236,  236,  236,  236,  236,  236,    0,  236,  236,
-  236,  236,  236,  314,    0,  236,    0,  314,  314,  314,
-  314,  314,  236,  236,  236,    0,    0,    0,    0,    0,
-    0,  236,  236,    0,  314,    0,  314,  314,  314,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  351,    0,  351,  351,  351,  351,  351,    0,
-  351,  351,  351,  351,  351,  351,    0,  351,  351,  351,
-    0,  351,    0,  351,    0,    0,  351,  351,  351,  351,
-  351,  351,  351,    0,    0,  351,  351,  351,    0,    0,
-    0,    0,  351,  351,    0,    0,    0,  351,  351,    0,
-    0,    0,    0,    0,    0,    0,    0,  351,    0,    0,
-    0,  351,  351,    0,    0,    0,  351,    0,    0,    0,
-    0,    0,  351,    0,  351,  351,    0,  351,    0,  351,
-  351,  351,  351,  351,    0,  351,  351,  351,  351,  351,
-  351,  351,  351,  351,  351,  351,  351,  351,  351,  351,
-  351,    0,  578,  351,  351,  351,    0,  351,  351,  351,
-    0,  351,  351,  351,    0,    0,  351,    0,  351,    0,
-    0,  351,  351,  351,  351,  204,  351,  351,  351,  351,
-    0,    0,    0,    0,    0,  351,    0,    0,  351,  351,
-  351,  351,  351,  351,  351,  351,    0,  351,  351,  351,
-  351,  351,    0,    0,  351,  188,    0,    0,  150,    0,
-  151,  351,  351,  351,    0,    0,    0,    0,    0,    0,
-  351,  351,  314,    0,  314,  314,  314,  314,  314,    0,
-  314,  314,  314,  314,  314,  314,    0,  314,  314,  314,
-    0,  314,    0,  314,    0,    0,  314,  314,  314,  314,
-  314,  314,  314,    0,    0,  314,  314,  314,    0,    0,
-    0,    0,  314,  314,    0,    0,    0,  314,  314,    0,
-    0,    0,    0,    0,    0,    0,    0,  314,    0,    0,
-    0,  314,  314,    0,    0,    0,  314,    0,    0,    0,
-    0,    0,  314,    0,  314,  314,    0,  314,    0,  314,
-  314,  314,  314,  314,    0,  314,  314,  314,  314,  314,
-  314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
-  314,    0,    0,  314,  314,  314,    0,  314,  314,  314,
-    0,  314,  314,  314,    0,  318,  314,    0,  314,    0,
-    0,  314,  314,  314,  314,  318,  314,  314,  314,  314,
-    0,    0,    0,    0,    0,  314,    0,    0,  314,  314,
-  314,  314,  314,  314,  314,  314,    0,  314,  314,  314,
-  314,  314,  318,    0,  314,    0,  318,  318,  318,  318,
-  318,  314,  314,  314,    0,    0,    0,    0,    0,    0,
-  314,  314,    0,  318,    0,  318,  318,  318,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,    0,  176,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,  315,    0,    0,  180,    0,
-    0,    0,    0,    0,    0,  315,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,    0,    0,   89,
-    0,    0,    0,    0,    0,    0,  187,    0,    0,    0,
-    0,    0,  315,    0,  177,    0,  315,  315,  315,  315,
-  315,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,  315,    0,  315,  315,  315,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,  318,    0,  318,  318,  318,  318,  318,    0,  318,
-  318,  318,  318,  318,  318,    0,  318,  318,  318,    0,
-  318,    0,  318,    0,    0,  318,  318,  318,  318,  318,
-  318,  318,    0,    0,  318,  318,  318,    0,    0,    0,
-    0,  318,  318,    0,    0,    0,  318,  318,    0,    0,
-    0,    0,    0,    0,    0,    0,  318,    0,    0,    0,
-  318,  318,    0,    0,    0,  318,    0,    0,    0,    0,
-    0,  318,    0,  318,  318,    0,  318,    0,  318,  318,
-  318,  318,  318,    0,  318,  318,  318,  318,  318,  318,
-  318,  318,  318,  318,  318,  318,  318,  318,  318,  318,
-    0,    0,  318,  318,  318,    0,  318,  318,  318,    0,
-  318,  318,  318,    0,    0,  318,    0,  318,    0,    0,
-  318,  318,  318,  318,    0,  318,  318,  318,  318,    0,
-    0,    0,    0,    0,  318,    0,    0,  318,  318,  318,
-  318,  318,  318,  318,  318,    0,  318,  318,  318,  318,
-  318,  188,    0,  318,  150,    0,  151,    0,    0,    0,
-  318,  318,  318,    0,    0,    0,    0,    0,    0,  318,
-  318,  315,  661,  315,  315,  315,  315,  315,    0,  315,
-  315,  315,  315,  315,  315,    0,  315,  315,  315,    0,
-  315,    0,  315,    0,    0,  315,  315,  315,  315,  315,
-  315,  315,    0,    0,  315,  315,  315,    0,    0,    0,
-    0,  315,  315,    0,    0,    0,  315,  315,    0,    0,
-    0,    0,  417,  415,    0,  416,  315,    0,    0,    0,
-  315,  315,    0,    0,    0,  315,    0,    0,    0,    0,
-  420,  315,  421,  315,  315,    0,  315,    0,  315,  315,
-  315,  315,  315,    0,  315,  315,  315,  315,  315,  315,
-  315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-    0,    0,  315,  315,  315,    0,  315,  315,  315,    0,
-  315,  315,  315,    0,  323,  315,    0,  315,    0,    0,
-  315,  315,  315,  315,  323,  315,  315,  315,  315,    0,
-    0,    0,    0,    0,  315,    0,  488,  315,  315,  315,
-  315,  315,  315,  315,  315,    0,  315,  315,  315,  315,
-  315,    0,    0,  315,  323,  323,  323,  323,  323,  323,
-  315,  315,  315,    0,    0,    0,    0,    0,    0,  315,
-  315,    0,  323,    0,  323,  323,  323,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  253,  254,  489,
-    0,    0,    0,    0,    0,    0,    0,  417,  415,    0,
-  416,    0,    0,    0,  149,    0,    0,    0,    0,    0,
-    0,    0,    0,  662,    0,  420,  490,  421,  491,  492,
-  493,    0,    0,  494,  495,    0,  496,  497,  152,  153,
-    0,    0,    0,  154,  155,  156,  157,    0,    0,    0,
-    0,    0,    0,    0,    0,  158,  159,  160,  161,  162,
-  163,  164,    0,  165,  166,  167,    0,    0,  168,  169,
-  170,    0,  171,  172,  173,  174,  175,    0,  176,    0,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  320,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  320,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  177,  320,    0,    0,    0,  320,  320,  320,  320,  320,
-    0,  178,  179,    0,    0,    0,    0,  180,    0,    0,
-    0,    0,  320,    0,  320,  320,  320,  181,  182,    0,
-    0,  183,  184,  185,  186,    0,    0,    0,   89,    0,
-    0,    0,    0,    0,    0,  187,    0,    0,    0,    0,
-  323,    0,  323,  323,  323,  323,  323,    0,  323,  323,
-  323,  323,  323,  323,    0,  323,  323,  323,    0,  323,
-    0,  323,    0,    0,  323,  323,  323,  323,  323,  323,
-  323,    0,    0,  323,  323,  323,    0,    0,    0,    0,
-  323,  323,    0,    0,    0,  323,  323,  408,    0,  409,
-  410,  411,  412,  413,  414,  323,    0,  418,  419,  323,
-  323,    0,    0,    0,  323,    0,    0,    0,    0,    0,
-  323,    0,  323,  323,    0,  323,    0,  323,  323,  323,
-  323,  323,    0,  323,  323,  323,  323,  323,  323,  323,
-  323,  323,  323,  323,  323,  323,  323,  323,  323,    0,
-  578,  323,  323,  323,    0,  323,  323,  323,    0,  323,
-  323,  323,    0,    0,  323,    0,  323,    0,    0,  323,
-  323,  323,  323,    0,  323,  323,  323,  323,    0,    0,
-    0,    0,    0,  323,    0,    0,  323,  323,  323,  323,
-  323,  323,  323,  323,    0,  323,  323,  323,  323,  323,
-    0,    0,  323,  188,    0,  709,  150,    0,  151,  323,
-  323,  323,    0,    0,    0,    0,    0,    0,  323,  323,
-  320,  708,  320,  320,  320,  320,  320,    0,  320,  320,
-  320,  320,  320,  320,    0,  320,  320,  320,    0,  320,
-    0,  320,    0,    0,  320,  320,  320,  320,  320,  320,
-  320,    0,    0,  320,  320,  320,    0,    0,    0,    0,
-  320,  320,    0,    0,    0,  320,  320,    0,    0,    0,
-    0,    0,    0,    0,    0,  320,    0,    0,    0,  320,
-  320,    0,    0,    0,  320,    0,    0,    0,    0,    0,
-  320,    0,  320,  320,    0,  320,    0,  320,  320,  320,
-  320,  320,    0,  320,  320,  320,  320,  320,  320,  320,
-  320,  320,  320,  320,  320,  320,  320,  320,  320,    0,
-    0,  320,  320,  320,    0,  320,  320,  320,    0,  320,
-  320,  320,    0,  280,  320,    0,  320,    0,    0,  320,
-  320,  320,  320,  280,  320,  320,  320,  320,    0,    0,
-    0,    0,    0,  320,    0,    0,  320,  320,  320,  320,
-  320,  320,  320,  320,    0,  320,  320,  320,  320,  320,
-  280,    0,  320,    0,  280,  280,  280,  280,  280,  320,
-  320,  320,    0,    0,    0,    0,    0,    0,  320,  320,
-    0,  280,    0,  280,  280,  280,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,    0,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,    0,  165,  166,  167,    0,  149,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,    0,  176,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  152,  153,    0,    0,    0,  154,  155,  156,  157,    0,
-    0,    0,    0,    0,    0,    0,    0,  158,  159,  160,
-  161,  162,  163,  164,    0,  165,  166,  167,    0,    0,
-  168,  169,  170,    0,  171,  172,  173,  174,  175,    0,
-  176,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,  279,    0,    0,  180,    0,    0,    0,
-    0,    0,    0,  279,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,    0,    0,  892,    0,    0,
-    0,    0,    0,    0,  187,    0,    0,    0,    0,    0,
-    0,    0,  177,    0,  279,  279,  279,  279,  279,    0,
-    0,    0,    0,  178,  179,    0,    0,    0,    0,  180,
-    0,  279,    0,  279,  279,  279,    0,    0,    0,  181,
-  182,    0,    0,  183,  184,  185,  186,    0,    0,    0,
-   89,    0,    0,    0,    0,    0,    0,  187,    0,  280,
-    0,  280,  280,  280,  280,  280,    0,  280,  280,  280,
-  280,  280,  280,    0,  280,  280,  280,    0,  280,    0,
-  280,    0,    0,  280,  280,  280,  280,  280,  280,  280,
-    0,    0,  280,  280,  280,    0,    0,    0,    0,  280,
-  280,    0,    0,    0,  280,  280,    0,    0,    0,    0,
-    0,    0,    0,    0,  280,    0,    0,    0,  280,  280,
-    0,    0,    0,  280,    0,    0,    0,    0,    0,  280,
-    0,  280,  280,    0,  280,    0,  280,  280,  280,  280,
-  280,    0,  280,  280,  280,  280,  280,  280,  280,  280,
-  280,  280,  280,  280,  280,  280,  280,  280,    0,    0,
-  280,  280,  280,    0,  280,  280,  280,    0,  280,  280,
-  280,    0,    0,  280,    0,  280,    0,    0,  280,  280,
-  280,  280,    0,  280,  280,  280,  280,    0,    0,    0,
-    0,    0,  280,    0,    0,  280,  280,  280,  280,  280,
-  280,  280,  280,    0,  280,  280,  280,  280,  280,    0,
-    0,  280,  188,    0,  540,  150,    0,  151,  280,  280,
-    0,    0,    0,    0,    0,    0,    0,  280,  280,  279,
-    0,  279,  279,  279,  279,  279,    0,  279,  279,  279,
-  279,  279,  279,    0,  279,  279,  279,    0,  279,    0,
-  279,    0,    0,  279,  279,  279,  279,  279,  279,  279,
-    0,    0,  279,  279,  279,    0,    0,    0,    0,  279,
-  279,    0,    0,    0,  279,  279,    0,    0,  417,  415,
-    0,  416,    0,    0,  279,    0,    0,    0,  279,  279,
-    0,    0,    0,  279,    0,    0,  420,    0,  421,  279,
-    0,  279,  279,    0,  279,    0,  279,  279,  279,  279,
-  279,    0,  279,  279,  279,  279,  279,  279,  279,  279,
-  279,  279,  279,  279,  279,  279,  279,  279,    0,    0,
-  279,  279,  279,    0,  279,  279,  279,    0,  279,  279,
-  279,    0,  538,  279,    0,  279,    0,    0,  279,  279,
-  279,  279,  538,  279,  279,  279,  279,    0,    0,    0,
-    0,    0,  279,    0,    0,  279,  279,  279,  279,  279,
-  279,  279,  279,    0,  279,  279,  279,  279,  279,    0,
-    0,  279,    0,  250,  250,  250,  538,  250,  279,  279,
-  279,    0,    0,    0,    0,    0,    0,  279,  279,    0,
-    0,    0,  250,  250,  250,    0,    0,  454,    0,    0,
-    0,  455,  456,  457,  458,    0,    0,    0,    0,    0,
-    0,    0,    0,  459,  460,  461,  462,  463,  464,  465,
-    0,  466,  467,  468,    0,  149,  469,  470,  471,    0,
-    0,  472,  473,  474,  475,    0,  476,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,    0,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,  283,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  283,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  477,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  283,
-    0,  177,    0,  283,  283,  283,  283,  283,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-  283,    0,    0,  283,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,    0,    0,  541,
-    0,    0,    0,    0,    0,    0,  187,    0,  538,    0,
-  250,  250,  250,  250,  250,    0,  250,  250,  250,  250,
-  250,  250,    0,    0,  250,  250,    0,  538,    0,  538,
-    0,    0,  538,  538,  538,  538,  538,  538,  538,    0,
-    0,  538,  538,  538,    0,    0,    0,    0,  538,  538,
-    0,    0,    0,  538,  538,    0,    0,    0,    0,    0,
-    0,    0,    0,  538,    0,    0,    0,  538,  538,    0,
-    0,    0,  538,    0,    0,    0,    0,    0,  538,    0,
-  538,  538,    0,  538,    0,  538,  538,  538,  538,  538,
-    0,  538,  538,  538,  538,  538,  538,  538,  538,  538,
-  538,  538,  538,  538,  538,  538,  538,    0,    0,  538,
-  538,  538,    0,  538,  538,  538,    0,  538,  538,  538,
-    0,    0,  538,    0,  538,    0,    0,  538,  538,  538,
-  538,    0,  538,  538,  538,  538,    0,    0,    0,    0,
-    0,  538,    0,    0,  538,  538,  538,  538,  538,  538,
-  538,  538,    0,  538,  538,  538,  538,  538,    0,    0,
-  538,    0,    0,    0,    0,    0,    0,  538,  538,  538,
-    0,    0,    0,    0,    0,    0,  538,  538,  283,    0,
-  283,  283,  283,  283,  283,  289,  283,  283,  283,  283,
-  283,  283,    0,  283,  283,  289,    0,  283,    0,  283,
-    0,    0,  283,  283,  283,  283,  283,  283,  283,    0,
-    0,  283,  283,  283,    0,    0,    0,    0,  283,  283,
-    0,    0,  289,  283,  283,    0,  289,  289,  289,  289,
-  289,    0,    0,  283,    0,    0,    0,  283,  283,    0,
-    0,    0,  283,  289,    0,    0,  289,    0,  283,    0,
-  283,  283,    0,  283,    0,  283,  283,  283,  283,  283,
-    0,  283,  283,  283,  283,  283,  283,  283,  283,  283,
-  283,  283,  283,  283,  283,  283,  283,    0,    0,  283,
-  283,  283,    0,  283,  283,  283,    0,  283,  283,  283,
-    0,    0,  283,    0,  283,    0,    0,  283,  283,  283,
-  283,    0,  283,  283,  283,  283,    0,    0,    0,    0,
-    0,  283,    0,    0,  283,  283,  283,  283,  283,  283,
-  283,  283,    0,  283,  283,  283,  283,  283,    0,    0,
-  283,    0,    0,    0,    0,    0,    0,  283,  283,  283,
-    0,    0,    0,    0,    0,    0,  283,  283,    0,    0,
-    0,    0,    0,    0,  108,  290,    0,    0,  108,  108,
-  108,  108,    0,    0,    0,  290,    0,    0,    0,    0,
-  108,  108,  108,  108,  108,  108,  108,    0,  108,  108,
-  108,    0,    0,  108,  108,  108,    0,    0,  108,  108,
-  108,  108,  290,  108,    0,    0,  290,  290,  290,  290,
-  290,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  290,    0,    0,  290,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  289,    0,  289,  289,  289,  289,  289,    0,  289,
-  289,  289,  289,  289,  289,    0,  289,  289,    0,    0,
-  289,    0,  289,    0,    0,  289,  289,  289,  289,  289,
-  289,  289,    0,    0,  289,  289,  289,    0,    0,    0,
-    0,  289,  289,  108,    0,    0,  289,  289,    0,    0,
-    0,    0,    0,    0,    0,    0,  289,    0,    0,    0,
-  289,  289,    0,    0,    0,  289,    0,    0,    0,    0,
-    0,  289,    0,  289,  289,    0,  289,    0,  289,  289,
-  289,  289,  289,    0,  289,  289,  289,  289,  289,  289,
-  289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
-    0,    0,  289,  289,  289,    0,  289,  289,  289,    0,
-  289,  289,  289,    0,    0,  289,    0,  289,    0,    0,
-  289,  289,  289,  289,    0,  289,  289,  289,  289,    0,
-    0,    0,    0,    0,  289,    0,    0,  289,  289,  289,
-  289,  289,  289,  289,  289,    0,  289,  289,  289,  289,
-  289,    0,    0,  289,    0,    0,    0,    0,    0,    0,
-  289,  289,  289,    0,    0,    0,    0,    0,    0,  289,
-  289,  290,    0,  290,  290,  290,  290,  290,  311,  290,
-  290,  290,  290,  290,  290,    0,  290,  290,  311,    0,
-  290,    0,  290,    0,    0,  290,  290,  290,  290,  290,
-  290,  290,    0,    0,  290,  290,  290,    0,    0,    0,
-    0,  290,  290,    0,    0,  311,  290,  290,    0,  311,
-  311,  311,  311,  311,    0,    0,  290,    0,    0,    0,
-  290,  290,    0,    0,    0,  290,  311,    0,    0,  311,
-    0,  290,    0,  290,  290,    0,  290,    0,  290,  290,
-  290,  290,  290,    0,  290,  290,  290,  290,  290,  290,
-  290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
-    0,    0,  290,  290,  290,    0,  290,  290,  290,    0,
-  290,  290,  290,    0,    0,  290,    0,  290,    0,    0,
-  290,  290,  290,  290,    0,  290,  290,  290,  290,    0,
-    0,    0,    0,    0,  290,    0,    0,  290,  290,  290,
-  290,  290,  290,  290,  290,    0,  290,  290,  290,  290,
-  290,    0,    0,  290,    0,    0,    0,    0,    0,    0,
-  290,  290,  290,    0,   20,    0,    0,    0,    0,  290,
-  290,    0,    0,    0,    0,    0,    0,    0,  519,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  519,   26,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,   30,    0,    0,    0,    0,   33,
-  314,    0,    0,    0,   37,   38,    0,    0,    0,  519,
-  519,  519,  519,  519,  315,   47,   48,   49,   50,   51,
-   52,  316,    0,    0,    0,    0,    0,    0,  519,  519,
-  519,    0,    0,    0,   62,    0,    0,    0,    0,    0,
-   65,    0,    0,    0,    0,    0,    0,    0,    0,   70,
-    0,   72,    0,    0,  311,    0,  311,  311,  311,  311,
-  311,    0,  311,  311,  311,  311,  311,  311,    0,  311,
-  311,    0,    0,  311,    0,  311,    0,    0,  311,  311,
-  311,  311,  311,  311,  311,   89,    0,  311,  311,  311,
-    0,    0,   90,    0,  311,  311,    0,    0,    0,  311,
-  311,    0,    0,    0,    0,    0,    0,    0,    0,  311,
-    0,    0,    0,  311,  311,    0,    0,    0,  311,    0,
-    0,    0,    0,    0,  311,    0,  311,  311,    0,  311,
-    0,  311,  311,  311,  311,  311,    0,  311,  311,  311,
-  311,  311,  311,  311,  311,  311,  311,  311,  311,  311,
-  311,  311,  311,    0,    0,  311,  311,  311,    0,  311,
-  311,  311,    0,  311,  311,  311,    0,    0,  311,    0,
-  311,    0,    0,  311,  311,  311,  311,    0,  311,  311,
-  311,  311,    0,    0,    0,    0,    0,  311,    0,    0,
-  311,  311,  311,  311,  311,  311,  311,  311,    0,  311,
-  311,  311,  311,  311,    0,    0,  311,  188,    0,  559,
-  150,    0,  151,  311,  311,  311,    0,    0,    0,    0,
-    0,    0,  311,  311,  519,    0,  519,  519,  519,  519,
-  519,    0,  519,  519,  519,  519,  519,  519,    0,    0,
-  519,  519,    0,  519,    0,  519,    0,    0,  519,  519,
-  519,  519,  519,  519,  519,    0,    0,  519,  519,  519,
-    0,    0,    0,    0,  519,  519,    0,    0,    0,  519,
-  519,    0,    0,    0,    0,    0,    0,    0,    0,  519,
-    0,    0,    0,  519,  519,    0,    0,    0,  519,    0,
-    0,    0,    0,    0,  519,    0,  519,  519,    0,  519,
-    0,  519,  519,  519,  519,  519,    0,  519,  519,  519,
-  519,  519,  519,  519,  519,  519,  519,  519,  519,  519,
-  519,  519,  519,    0,    0,  519,  519,  519,    0,  519,
-  519,  519,    0,  519,  519,  519,    0,  528,  519,    0,
-  519,    0,    0,  519,  519,  519,  519,  528,    0,  519,
-  519,  519,    0,    0,    0,    0,    0,  519,    0,    0,
-  519,  519,  519,  519,  519,  519,  519,  519,    0,  519,
-  519,  519,  519,  519,    0,    0,  519,    0,    0,  247,
-  247,    0,  247,  519,  519,  519,    0,    0,    0,    0,
-    0,    0,  519,  519,    0,    0,    0,  247,  247,  247,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  149,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  287,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  287,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  287,    0,  177,    0,  287,    0,
-  287,  287,  287,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,  287,    0,    0,  287,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,    0,   89,    0,    0,    0,    0,    0,
-    0,  187,    0,  528,    0,  247,  247,  247,  247,  247,
-    0,  247,  247,  247,  247,  247,  247,    0,    0,  247,
-  247,    0,  528,    0,  528,    0,    0,  528,  528,  528,
-  528,  528,  528,  528,    0,    0,  528,  528,  528,    0,
-    0,    0,    0,  528,  528,    0,    0,    0,  528,  528,
-    0,    0,    0,    0,    0,    0,    0,    0,  528,    0,
-    0,    0,  528,  528,    0,    0,    0,  528,    0,    0,
-    0,    0,    0,  528,    0,  528,  528,    0,  528,    0,
-  528,  528,  528,  528,  528,    0,  528,  528,  528,  528,
-  528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-  528,  528,    0,    0,  528,  528,  528,    0,  528,  528,
-  528,    0,  528,  528,  528,    0,    0,  528,    0,  528,
-    0,    0,  528,  528,  528,  528,    0,  528,  528,  528,
-  528,    0,    0,    0,    0,    0,  528,    0,    0,  528,
-  528,  528,  528,  528,  528,  528,  528,    0,  528,  528,
-  528,  528,  528,    0,    0,  528,    0,    0,    0,    0,
-    0,    0,  528,  528,  528,    0,    0,    0,    0,    0,
-    0,  528,  528,  287,    0,  287,  287,  287,  287,  287,
-  288,  287,  287,  287,  287,  287,  287,    0,  287,    0,
-  288,    0,  287,    0,  287,    0,    0,  287,  287,  287,
-  287,  287,  287,  287,    0,    0,  287,  287,  287,    0,
-    0,    0,    0,  287,  287,    0,    0,  288,  287,  287,
-    0,  288,    0,  288,  288,  288,    0,    0,  287,    0,
-    0,    0,  287,  287,    0,    0,    0,  287,  288,    0,
-    0,  288,    0,  287,    0,  287,  287,    0,  287,    0,
-  287,  287,  287,  287,  287,    0,  287,  287,  287,  287,
-  287,  287,  287,  287,  287,  287,  287,  287,  287,  287,
-  287,  287,    0,    0,  287,  287,  287,    0,  287,  287,
-  287,    0,  287,  287,  287,    0,    0,  287,    0,  287,
-    0,    0,  287,  287,  287,  287,    0,  287,  287,  287,
-  287,    0,    0,    0,    0,    0,  287,    0,    0,  287,
-  287,  287,  287,  287,  287,  287,  287,    0,  287,  287,
-  287,  287,  287,    0,    0,  287,    0,    0,    0,    0,
-    0,    0,  287,  287,  287,    0,    0,    0,    0,    0,
-    0,  287,  287,    0,    0,    0,    0,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  308,    0,    0,
-    0,  308,  308,    0,  308,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  308,    0,
-  308,    0,  308,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  288,    0,  288,  288,
-  288,  288,  288,    0,  288,  288,  288,  288,  288,  288,
-    0,  288,    0,    0,    0,  288,    0,  288,    0,    0,
-  288,  288,  288,  288,  288,  288,  288,    0,    0,  288,
-  288,  288,    0,    0,    0,    0,  288,  288,    0,    0,
-    0,  288,  288,    0,    0,    0,    0,    0,    0,    0,
-    0,  288,    0,    0,    0,  288,  288,    0,    0,    0,
-  288,    0,    0,    0,    0,    0,  288,    0,  288,  288,
-    0,  288,   22,  288,  288,  288,  288,  288,    0,  288,
-  288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
-  288,  288,  288,  288,  288,    0,    0,  288,  288,  288,
-    0,  288,  288,  288,    0,  288,  288,  288,    0,    0,
-  288,    0,  288,    0,    0,  288,  288,  288,  288,    0,
-  288,  288,  288,  288,    0,    0,    0,    0,    0,  288,
-    0,    0,  288,  288,  288,  288,  288,  288,  288,  288,
-    0,  288,  288,  288,  288,  288,    0,    0,  288,    0,
-    0,    0,    0,    0,    0,  288,  288,  288,    0,    0,
-    0,    0,    0,    0,  288,  288,  308,    0,  308,  308,
-  308,  308,  308,    0,  308,  308,  308,  308,  308,  308,
-    0,  308,    0,  308,    0,  308,    0,  308,    0,    0,
-  308,  308,  308,  308,  308,  308,  308,    0,    0,  308,
-  308,  308,    0,    0,    0,    0,  308,  308,    0,    0,
-    0,  308,  308,    0,    0,    0,    0,    0,    0,    0,
-    0,  308,    0,    0,    0,  308,  308,    0,    0,    0,
-  308,    0,    0,    0,    0,    0,  308,    0,  308,  308,
-    0,  308,    0,  308,  308,  308,  308,  308,    0,  308,
-  308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
-  308,  308,  308,  308,  308,    0,    0,  308,  308,  308,
-    0,  308,  308,  308,    0,  308,  308,  308,    0,  466,
-  308,    0,  308,    0,    0,  308,  308,  308,  308,  466,
-  308,  308,  308,  308,  338,    0,    0,    0,  338,  308,
-    0,  338,  308,  308,  308,  308,    0,  308,  308,  308,
-    0,  308,  308,  308,  308,  308,    0,  338,  308,  338,
-    0,  518,  518,  518,  518,  308,  308,    0,    0,    0,
-    0,    0,    0,    0,    0,  308,    0,    0,    0,  518,
-  518,  518,    0,    0,    0,    0,    0,   22,    0,   22,
-    0,    0,   22,   22,   22,   22,    0,    0,   22,    0,
-    0,   22,   22,   22,    0,    0,    0,    0,   22,   22,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,   22,    0,    0,    0,   22,   22,    0,
-    0,    0,   22,    0,    0,    0,    0,    0,   22,    0,
-   22,   22,    0,   22,    0,   22,   22,   22,   22,   22,
-    0,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-   22,   22,   22,   22,   22,   22,   22,    0,    0,   22,
-   22,   22,    0,   22,   22,   22,    0,   22,   22,   22,
-    0,  518,   22,    0,   22,    0,    0,   22,   22,   22,
-   22,  518,    0,   22,   22,   22,    0,    0,    0,    0,
-    0,   22,    0,    0,    0,   22,   22,   22,   22,   22,
-   22,   22,    0,   22,   22,   22,   22,   22,    0,    0,
-   22,    0,    0,  518,  518,  518,  518,   22,   22,   22,
-    0,    0,    0,    0,    0,    0,   22,    0,    0,    0,
-    0,  518,  518,  518,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  338,  338,  338,  338,  338,
-    0,  338,  338,  338,  338,  338,  338,    0,    0,  338,
-  338,    0,    0,    0,    0,  466,    0,  518,  518,  518,
-  518,  518,    0,  518,  518,  518,  518,  518,  518,    0,
-    0,  518,  518,    0,  466,    0,  466,    0,    0,  466,
-  466,  466,  466,  466,  466,  466,    0,    0,  466,  466,
-  466,    0,    0,    0,    0,  466,  466,    0,    0,    0,
-  466,  466,    0,    0,    0,    0,    0,    0,    0,    0,
-  466,    0,   56,    0,  466,  466,    0,    0,    0,  466,
-    0,    0,   56,    0,    0,  466,    0,  466,  466,    0,
-  466,    0,  466,  466,  466,  466,  466,    0,  466,  466,
-  466,  466,  466,  466,  466,  466,  466,  466,  466,  466,
-  466,  466,  466,  466,    0,    0,  466,  466,  466,    0,
-  466,  466,  466,    0,  466,  466,  466,    0,    0,  466,
-    0,  466,    0,    0,  466,  466,  466,  466,    0,    0,
-  466,  466,  466,    0,    0,    0,    0,    0,  466,    0,
-    0,  466,  466,  466,  466,    0,  466,  466,  466,    0,
-  466,  466,  466,  466,  466,    0,    0,  466,    0,    0,
-    0,    0,    0,    0,  466,  466,    0,  518,    0,  518,
-  518,  518,  518,  518,  466,  518,  518,  518,  518,  518,
-  518,    0,    0,  518,  518,    0,  518,    0,  518,    0,
-    0,  518,  518,  518,  518,  518,  518,  518,    0,    0,
-  518,  518,  518,    0,    0,    0,    0,  518,  518,    0,
-    0,    0,  518,  518,    0,    0,    0,    0,    0,    0,
-    0,    0,  518,    0,    0,    0,  518,  518,    0,    0,
-    0,  518,    0,    0,    0,    0,    0,  518,    0,  518,
-  518,    0,  518,    0,  518,  518,  518,  518,  518,    0,
-  518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
-  518,  518,  518,  518,  518,  518,    0,    0,  518,  518,
-  518,    0,  518,  518,  518,    0,  518,  518,  518,    0,
-  284,  518,    0,  518,    0,    0,  518,  518,  518,  518,
-  284,    0,  518,  518,  518,    0,    0,    0,    0,    0,
-  518,    0,    0,  518,  518,  518,  518,    0,  518,  518,
-  518,    0,  518,  518,  518,  518,  518,  284,   56,  518,
-    0,  284,    0,    0,  284,    0,  518,  518,    0,    0,
-    0,    0,    0,  164,  164,    0,  518,   56,  284,   56,
-    0,  284,   56,   56,   56,   56,   56,   56,   56,    0,
-    0,   56,   56,   56,    0,    0,    0,    0,   56,   56,
-    0,    0,    0,   56,   56,    0,    0,    0,    0,    0,
-    0,    0,    0,   56,    0,    0,    0,   56,   56,    0,
-    0,    0,   56,    0,    0,    0,    0,    0,   56,    0,
-   56,   56,    0,   56,    0,   56,   56,   56,   56,   56,
-    0,   56,   56,   56,   56,   56,   56,   56,   56,   56,
-   56,   56,   56,   56,   56,   56,   56,    0,    0,   56,
-   56,   56,    0,   56,   56,   56,    0,   56,   56,   56,
-    0,  305,   56,    0,   56,    0,    0,   56,   56,   56,
-   56,  305,    0,   56,   56,   56,    0,    0,    0,    0,
-    0,   56,    0,    0,   56,   56,   56,   56,   56,   56,
-   56,   56,    0,   56,   56,   56,   56,   56,  305,    0,
-   56,    0,  305,    0,    0,  305,    0,   56,   56,   56,
-    0,    0,    0,    0,    0,    0,   56,   56,    0,  305,
-    0,    0,  305,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  284,    0,  284,  284,
-  284,  284,  284,    0,    0,    0,    0,    0,    0,    0,
-    0,  284,    0,    0,    0,  284,    0,  284,    0,    0,
-  284,  284,  284,  284,  284,  284,  284,    0,    0,  284,
-  284,  284,    0,    0,    0,    0,  284,  284,    0,    0,
-    0,  284,  284,    0,    0,    0,    0,    0,    0,    0,
-    0,  284,    0,    0,    0,  284,  284,    0,    0,    0,
-  284,    0,    0,    0,    0,    0,  284,    0,  284,  284,
-    0,  284,    0,  284,  284,  284,  284,  284,    0,  284,
-  284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
-  284,  284,  284,  284,  284,    0,    0,  284,  284,  284,
-    0,  284,  284,  284,    0,  284,  284,  284,  341,  341,
-  284,  341,  284,    0,    0,  284,  284,  284,  284,    0,
-  284,  284,  284,  284,    0,    0,  341,  341,  341,  284,
-    0,    0,  284,  284,  284,  284,  284,  284,  284,  284,
-    0,  284,  284,  284,  284,  284,    0,  305,  284,  305,
-  305,  305,  305,  305,    0,  284,  284,  284,    0,    0,
-  295,    0,  305,    0,  284,  284,  305,    0,  305,    0,
-  295,  305,  305,  305,  305,  305,  305,  305,    0,    0,
-  305,  305,  305,    0,    0,    0,    0,  305,  305,    0,
-    0,    0,  305,  305,    0,    0,    0,  295,    0,    0,
-    0,  295,  305,    0,  295,    0,  305,  305,    0,    0,
-    0,  305,    0,    0,    0,    0,    0,  305,  295,  305,
-  305,  295,  305,    0,  305,  305,  305,  305,  305,    0,
-  305,  305,  305,  305,  305,  305,  305,  305,  305,  305,
-  305,  305,  305,  305,  305,  305,    0,    0,  305,  305,
-  305,    0,  305,  305,  305,    0,  305,  305,  305,    0,
-    0,  305,    0,  305,    0,    0,  305,  305,  305,  305,
-    0,  305,  305,  305,  305,    0,    0,    0,    0,    0,
-  305,    0,    0,  305,  305,  305,  305,  305,  305,  305,
-  305,    0,  305,  305,  305,  305,  305,    0,    0,  305,
-    0,    0,    0,    0,    0,    0,  305,  305,  305,    0,
-    0,  293,    0,    0,    0,  305,  305,    0,    0,    0,
-    0,  293,    0,    0,  341,  341,  341,  341,  341,    0,
-  341,  341,  341,  341,  341,  341,    0,    0,  341,  341,
-    0,    0,    0,    0,    0,    0,    0,    0,  293,    0,
-    0,    0,  293,    0,    0,  293,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  293,
-    0,    0,  293,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  295,    0,  295,  295,
-  295,  295,  295,    0,    0,    0,    0,    0,    0,    0,
-    0,  295,    0,    0,    0,  295,    0,  295,    0,    0,
-  295,  295,  295,  295,  295,  295,  295,    0,    0,  295,
-  295,  295,    0,    0,    0,    0,  295,  295,    0,    0,
-    0,  295,  295,    0,    0,    0,    0,    0,    0,    0,
-    0,  295,    0,    0,    0,  295,  295,    0,    0,    0,
-  295,    0,    0,  341,    0,    0,  295,    0,  295,  295,
-    0,  295,    0,  295,  295,  295,  295,  295,    0,  295,
-  295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
-  295,  295,  295,  295,  295,    0,    0,  295,  295,  295,
-    0,  295,  295,  295,    0,  295,  295,  295,  417,  415,
-  295,  416,  295,    0,    0,  295,  295,  295,  295,    0,
-  295,  295,  295,  295,  852,    0,  420,  403,  421,  295,
-    0,    0,  295,  295,  295,  295,  295,  295,  295,  295,
-    0,  295,  295,  295,  295,  295,    0,  293,  295,  293,
-  293,  293,  293,  293,    0,  295,  295,  295,    0,    0,
-  299,    0,  293,    0,  295,  295,  293,    0,  293,    0,
-  299,  293,  293,  293,  293,  293,  293,  293,    0,    0,
-  293,  293,  293,    0,    0,    0,    0,  293,  293,    0,
-    0,    0,  293,  293,    0,    0,    0,  299,    0,    0,
-    0,  299,  293,    0,  299,    0,  293,  293,    0,    0,
-    0,  293,    0,    0,    0,    0,    0,  293,  299,  293,
-  293,  299,  293,    0,  293,  293,  293,  293,  293,    0,
-  293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-  293,  293,  293,  293,  293,  293,    0,    0,  293,  293,
-  293,    0,  293,  293,  293,    0,  293,  293,  293,    0,
-    0,  293,    0,  293,    0,    0,  293,  293,  293,  293,
-    0,  293,  293,  293,  293,    0,    0,    0,    0,    0,
-  293,    0,    0,  293,  293,  293,  293,  293,  293,  293,
-  293,    0,  293,  293,  293,  293,  293,    0,    0,  293,
-    0,    0,    0,    0,    0,    0,  293,  293,  293,    0,
-    0,  297,    0,    0,    0,  293,  293,    0,    0,    0,
-    0,  297,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  297,    0,
-    0,    0,  297,    0,    0,  297,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  297,
-    0,    0,  297,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  299,    0,  299,  299,
-  299,  299,  299,    0,    0,    0,    0,    0,    0,    0,
-    0,  299,    0,    0,    0,  299,    0,  299,    0,    0,
-  299,  299,  299,  299,  299,  299,  299,    0,    0,  299,
-  299,  299,    0,    0,    0,    0,  299,  299,    0,    0,
-    0,  299,  299,    0,    0,    0,    0,    0,    0,    0,
-    0,  299,    0,    0,    0,  299,  299,    0,    0,    0,
-  299,    0,    0,    0,    0,    0,  299,    0,  299,  299,
-    0,  299,    0,  299,  299,  299,  299,  299,    0,  299,
-  299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
-  299,  299,  299,  299,  299,    0,    0,  299,  299,  299,
-    0,  299,  299,  299,    0,  299,  299,  299,  417,  415,
-  299,  416,  299,    0,    0,  299,  299,  299,  299,    0,
-  299,  299,  299,  299,  901,    0,  420,  403,  421,  299,
-    0,    0,  299,  299,  299,  299,  299,  299,  299,  299,
-    0,  299,  299,  299,  299,  299,    0,  297,  299,  297,
-  297,  297,  297,  297,    0,  299,  299,  299,    0,    0,
-  291,    0,  297,    0,  299,  299,  297,    0,  297,    0,
-  291,  297,  297,  297,  297,  297,  297,  297,    0,    0,
-  297,  297,  297,    0,    0,    0,    0,  297,  297,    0,
-    0,    0,  297,  297,    0,    0,    0,  291,    0,    0,
-    0,  291,  297,    0,  291,    0,  297,  297,    0,    0,
-    0,  297,    0,    0,    0,    0,    0,  297,  291,  297,
-  297,  291,  297,    0,  297,  297,  297,  297,  297,    0,
-  297,  297,  297,  297,  297,  297,  297,  297,  297,  297,
-  297,  297,  297,  297,  297,  297,    0,    0,  297,  297,
-  297,    0,  297,  297,  297,    0,  297,  297,  297,    0,
-    0,  297,    0,  297,    0,    0,  297,  297,  297,  297,
-    0,  297,  297,  297,  297,    0,    0,    0,    0,    0,
-  297,    0,    0,  297,  297,  297,  297,  297,  297,  297,
-  297,    0,  297,  297,  297,  297,  297,    0,    0,  297,
-    0,    0,    0,    0,    0,    0,  297,  297,  297,    0,
-    0,  301,    0,    0,    0,  297,  297,    0,    0,    0,
-    0,  301,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  301,    0,
-    0,    0,  301,    0,    0,  301,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  301,
-    0,    0,  301,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  291,    0,  291,  291,
-  291,  291,  291,    0,    0,    0,    0,    0,    0,    0,
-    0,  291,    0,    0,    0,  291,    0,  291,    0,    0,
-  291,  291,  291,  291,  291,  291,  291,    0,    0,  291,
-  291,  291,    0,    0,    0,    0,  291,  291,    0,    0,
-    0,  291,  291,    0,    0,    0,    0,    0,    0,    0,
-    0,  291,    0,    0,    0,  291,  291,    0,    0,    0,
-  291,    0,    0,    0,    0,    0,  291,    0,  291,  291,
-    0,  291,    0,  291,  291,  291,  291,  291,    0,  291,
-  291,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-  291,  291,  291,  291,  291,    0,    0,  291,  291,  291,
-    0,  291,  291,  291,    0,  291,  291,  291,  417,  415,
-  291,  416,  291,    0,    0,  291,  291,  291,  291,    0,
-  291,  291,  291,  291,  946,    0,  420,  403,  421,  291,
-    0,    0,  291,  291,  291,  291,  291,  291,  291,  291,
-    0,  291,  291,  291,  291,  291,    0,  301,  291,  301,
-  301,  301,  301,  301,    0,  291,  291,  291,    0,    0,
-  296,    0,  301,    0,  291,  291,  301,    0,  301,    0,
-  296,  301,  301,  301,  301,  301,  301,  301,    0,    0,
-  301,  301,  301,    0,    0,    0,    0,  301,  301,    0,
-    0,    0,  301,  301,    0,    0,    0,  296,    0,    0,
-    0,  296,  301,    0,  296,    0,  301,  301,    0,    0,
-    0,  301,    0,    0,    0,    0,    0,  301,  296,  301,
-  301,  296,  301,    0,  301,  301,  301,  301,  301,    0,
-  301,  301,  301,  301,  301,  301,  301,  301,  301,  301,
-  301,  301,  301,  301,  301,  301,    0,    0,  301,  301,
-  301,    0,  301,  301,  301,    0,  301,  301,  301,    0,
-    0,  301,    0,  301,    0,    0,  301,  301,  301,  301,
-    0,  301,  301,  301,  301,    0,    0,    0,    0,    0,
-  301,    0,    0,  301,  301,  301,  301,  301,  301,  301,
-  301,    0,  301,  301,  301,  301,  301,    0,    0,  301,
-    0,    0,    0,    0,    0,    0,  301,  301,  301,    0,
-    0,  294,    0,    0,    0,  301,  301,    0,    0,    0,
-    0,  294,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  294,    0,
-    0,    0,  294,    0,    0,  294,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  294,
-    0,    0,  294,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  296,    0,  296,  296,
-  296,  296,  296,    0,    0,    0,    0,    0,    0,    0,
-    0,  296,    0,    0,    0,  296,    0,  296,    0,    0,
-  296,  296,  296,  296,  296,  296,  296,    0,    0,  296,
-  296,  296,    0,    0,    0,    0,  296,  296,    0,    0,
-    0,  296,  296,    0,    0,    0,    0,    0,    0,    0,
-    0,  296,    0,    0,    0,  296,  296,    0,    0,    0,
-  296,    0,    0,    0,    0,    0,  296,    0,  296,  296,
-    0,  296,    0,  296,  296,  296,  296,  296,    0,  296,
-  296,  296,  296,  296,  296,  296,  296,  296,  296,  296,
-  296,  296,  296,  296,  296,    0,    0,  296,  296,  296,
-    0,  296,  296,  296,    0,  296,  296,  296,  417,  415,
-  296,  416,  296,    0,    0,  296,  296,  296,  296,    0,
-  296,  296,  296,  296,  962,    0,  420,  403,  421,  296,
-    0,    0,  296,  296,  296,  296,  296,  296,  296,  296,
-    0,  296,  296,  296,  296,  296,    0,  294,  296,  294,
-  294,  294,  294,  294,    0,  296,  296,  296,    0,    0,
-  312,    0,  294,    0,  296,  296,  294,    0,  294,    0,
-  312,  294,  294,  294,  294,  294,  294,  294,    0,    0,
-  294,  294,  294,    0,    0,    0,    0,  294,  294,    0,
-    0,    0,  294,  294,    0,    0,    0,  312,    0,    0,
-    0,  312,  294,    0,  312,    0,  294,  294,    0,    0,
-    0,  294,    0,    0,    0,    0,    0,  294,  312,  294,
-  294,  312,  294,    0,  294,  294,  294,  294,  294,    0,
-  294,  294,  294,  294,  294,  294,  294,  294,  294,  294,
-  294,  294,  294,  294,  294,  294,    0,    0,  294,  294,
-  294,    0,  294,  294,  294,    0,  294,  294,  294,    0,
-    0,  294,    0,  294,    0,    0,  294,  294,  294,  294,
-    0,  294,  294,  294,  294,    0,    0,    0,    0,    0,
-  294,    0,    0,  294,  294,  294,  294,  294,  294,  294,
-  294,    0,  294,  294,  294,  294,  294,    0,    0,  294,
-    0,    0,    0,    0,    0,    0,  294,  294,  294,    0,
-    0,  310,    0,    0,    0,  294,  294,    0,    0,    0,
-    0,  310,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  310,    0,
-    0,    0,  310,    0,    0,  310,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  310,
-    0,    0,  310,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  312,    0,  312,  312,
-  312,  312,  312,    0,    0,    0,    0,    0,    0,    0,
-    0,  312,    0,    0,    0,  312,    0,  312,    0,    0,
-  312,  312,  312,  312,  312,  312,  312,    0,    0,  312,
-  312,  312,    0,    0,    0,    0,  312,  312,    0,    0,
-    0,  312,  312,    0,    0,    0,    0,    0,    0,    0,
-    0,  312,    0,    0,    0,  312,  312,    0,    0,    0,
-  312,    0,    0,    0,    0,    0,  312,    0,  312,  312,
-    0,  312,    0,  312,  312,  312,  312,  312,    0,  312,
-  312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
-  312,  312,  312,  312,  312,    0,    0,  312,  312,  312,
-    0,  312,  312,  312,    0,  312,  312,  312,  417,  415,
-  312,  416,  312,    0,    0,  312,  312,  312,  312,    0,
-  312,  312,  312,  312,    0,    0,  420,  403,  421,  312,
-    0,    0,  312,  312,  312,  312,  312,  312,  312,  312,
-    0,  312,  312,  312,  312,  312,    0,  310,  312,  310,
-  310,  310,  310,  310,    0,  312,  312,  312,    0,    0,
-  300,    0,  310,    0,  312,  312,  310,    0,  310,    0,
-  300,  310,  310,  310,  310,  310,  310,  310,    0,    0,
-  310,  310,  310,    0,    0,    0,    0,  310,  310,    0,
-    0,    0,  310,  310,    0,    0,    0,  300,    0,    0,
-    0,  300,  310,    0,  300,    0,  310,  310,    0,    0,
-    0,  310,    0,    0,    0,    0,    0,  310,  300,  310,
-  310,  300,  310,    0,  310,  310,  310,  310,  310,    0,
-  310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
-  310,  310,  310,  310,  310,  310,    0,    0,  310,  310,
-  310,    0,  310,  310,  310,    0,  310,  310,  310,    0,
-    0,  310,    0,  310,    0,    0,  310,  310,  310,  310,
-    0,  310,  310,  310,  310,    0,    0,    0,    0,    0,
-  310,    0,    0,  310,  310,  310,  310,  310,  310,  310,
-  310,    0,  310,  310,  310,  310,  310,    0,    0,  310,
-    0,    0,    0,    0,    0,    0,  310,  310,  310,    0,
-    0,  298,    0,    0,    0,  310,  310,    0,    0,    0,
-    0,  298,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,  298,    0,
-    0,    0,  298,    0,    0,  298,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  298,
-    0,    0,  298,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  300,    0,  300,  300,
-  300,  300,  300,    0,    0,    0,    0,    0,    0,    0,
-    0,  300,    0,    0,    0,  300,    0,  300,    0,    0,
-  300,  300,  300,  300,  300,  300,  300,    0,    0,  300,
-  300,  300,    0,    0,    0,    0,  300,  300,    0,    0,
-    0,  300,  300,    0,    0,    0,    0,    0,    0,    0,
-    0,  300,    0,    0,    0,  300,  300,    0,    0,    0,
-  300,    0,    0,    0,    0,    0,  300,    0,  300,  300,
-    0,  300,    0,  300,  300,  300,  300,  300,    0,  300,
-  300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
-  300,  300,  300,  300,  300,    0,    0,  300,  300,  300,
-    0,  300,  300,  300,    0,  300,  300,  300,  247,  247,
-  300,  247,  300,    0,    0,  300,  300,  300,  300,    0,
-  300,  300,  300,  300,    0,    0,  247,  247,  247,  300,
-    0,    0,  300,  300,  300,  300,  300,  300,  300,  300,
-    0,  300,  300,  300,  300,  300,    0,  298,  300,  298,
-  298,  298,  298,  298,    0,  300,  300,  300,    0,    0,
-  304,    0,  298,    0,  300,  300,  298,    0,  298,    0,
-  304,  298,  298,  298,  298,  298,  298,  298,    0,    0,
-  298,  298,  298,    0,    0,    0,    0,  298,  298,    0,
-    0,    0,  298,  298,    0,    0,    0,  304,    0,    0,
-    0,  304,  298,    0,  304,    0,  298,  298,    0,    0,
-    0,  298,    0,    0,    0,    0,    0,  298,  304,  298,
-  298,  304,  298,    0,  298,  298,  298,  298,  298,    0,
-  298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-  298,  298,  298,  298,  298,  298,    0,    0,  298,  298,
-  298,    0,  298,  298,  298,    0,  298,  298,  298,    0,
-    0,  298,    0,  298,    0,    0,  298,  298,  298,  298,
-    0,  298,  298,  298,  298,    0,    0,    0,    0,    0,
-  298,    0,    0,  298,  298,  298,  298,  298,  298,  298,
-  298,    0,  298,  298,  298,  298,  298,    0,    0,  298,
-    0,    0,    0,    0,    0,    0,  298,  298,  298,    0,
-    0,  303,    0,    0,    0,  298,  298,    0,    0,    0,
-    0,  303,    0,    0,  247,  247,  247,  247,  247,    0,
-  247,  247,  247,  247,  247,  247,    0,    0,  247,  247,
-    0,    0,    0,    0,    0,    0,    0,    0,  303,    0,
-    0,    0,  303,    0,    0,  303,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  303,
-    0,    0,  303,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  304,    0,  304,  304,
-  304,  304,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  304,    0,    0,    0,  304,    0,  304,    0,    0,
-  304,  304,  304,  304,  304,  304,  304,    0,    0,  304,
-  304,  304,    0,    0,    0,    0,  304,  304,    0,    0,
-    0,  304,  304,    0,    0,    0,    0,    0,    0,    0,
-    0,  304,    0,    0,    0,  304,  304,    0,    0,    0,
-  304,    0,    0,    0,    0,    0,  304,  567,  304,  304,
-  333,  304,  334,  304,  304,  304,  304,  304,    0,  304,
-  304,  304,  304,  304,  304,  304,  304,  304,  304,  304,
-  304,  304,  304,  304,  304,    0,    0,  304,  304,  304,
-    0,  304,  304,  304,    0,  304,  304,  304,    0,    0,
-  304,    0,  304,    0,    0,  304,  304,  304,  304,    0,
-  304,  304,  304,  304,    0,  753,    0,  751,  150,  304,
-  151,    0,  304,  304,  304,  304,  304,  304,  304,  304,
-    0,  304,  304,  304,  304,  304,  576,  303,  304,  303,
-  303,  303,  303,    0,    0,  304,  304,  304,    0,    0,
-    0,    0,  303,    0,  304,  304,  303,    0,  303,    0,
-    0,  303,  303,  303,  303,  303,  303,  303,    0,    0,
-  303,  303,  303,    0,    0,    0,    0,  303,  303,    0,
-    0,    0,  303,  303,    0,    0,    0,    0,    0,    0,
-    0,    0,  303,    0,    0,    0,  303,  303,    0,    0,
-    0,  303,    0,    0,    0,    0,    0,  303,    0,  303,
-  303,    0,  303,    0,  303,  303,  303,  303,  303,    0,
-  303,  303,  303,  303,  303,  303,  303,  303,  303,  303,
-  303,  303,  303,  303,  303,  303,    0,    0,  303,  303,
-  303,    0,  303,  303,  303,    0,  303,  303,  303,    0,
-  338,  303,    0,  303,    0,    0,  303,  303,  303,  303,
-  338,  303,  303,  303,  303,    0,    0,    0,    0,    0,
-  303,    0,    0,  303,  303,  303,  303,  303,  303,  303,
-  303,    0,  303,  303,  303,  303,  303,  338,    0,  303,
-  338,  338,  338,  338,  338,  338,  303,  303,  303,    0,
-    0,    0,    0,    0,    0,  303,  303,    0,    0,    0,
-    0,    0,    0,    0,    0,  336,  337,  338,    0,    0,
-  339,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  149,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  752,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  292,  176,    0,    0,    0,    0,  178,  179,    0,
-    0,  292,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,    0,  340,    0,    0,    0,  292,    0,
-    0,  187,  292,    0,    0,  292,    0,    0,    0,    0,
-    0,    0,    0,    0,  177,    0,    0,    0,    0,  292,
-    0,    0,  292,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,    0,    0,    0,    0,    0,  338,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  338,  338,  338,    0,  338,    0,  338,    0,    0,
-  338,  338,  338,  338,  338,  338,  338,    0,    0,  338,
-  338,  338,    0,    0,    0,    0,  338,  338,    0,    0,
-    0,  338,  338,    0,    0,    0,    0,    0,    0,    0,
-    0,  338,    0,    0,    0,  338,  338,    0,    0,    0,
-  338,    0,    0,    0,    0,    0,  338,    0,  338,  338,
-    0,  338,    0,  338,  338,  338,  338,  338,    0,  338,
-  338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-  338,  338,  338,  338,  338,    0,    0,  338,  338,  338,
-    0,  338,  338,  338,    0,  338,  338,  338,    0,    0,
-  338,    0,  338,    0,    0,  338,  338,  338,  338,    0,
-    0,  338,  338,  338,    0,    0,    0,    0,    0,  338,
-    0,    0,  338,  338,  338,  338,  338,  338,  338,  338,
-    0,  338,  338,  338,  338,  338,    0,  292,  338,  292,
-  292,    0,    0,    0,    0,  338,  338,  338,    0,    0,
-  302,    0,  292,    0,  338,  338,  292,    0,  292,    0,
-  302,  292,  292,  292,  292,  292,  292,  292,    0,    0,
-  292,  292,  292,    0,    0,    0,    0,  292,  292,    0,
-    0,    0,  292,  292,    0,    0,    0,  302,    0,    0,
-    0,  302,  292,    0,  302,    0,  292,  292,    0,    0,
-    0,  292,    0,    0,    0,    0,    0,  292,  302,  292,
-  292,  302,  292,    0,  292,  292,  292,  292,  292,    0,
-  292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-  292,  292,  292,  292,  292,  292,    0,    0,  292,  292,
-  292,    0,  292,  292,  292,    0,  292,  292,  292,    0,
-    0,  292,    0,  292,    0,    0,  292,  292,  292,  292,
-    0,  292,  292,  292,  292,    0,    0,    0,    0,    0,
-  292,    0,    0,  292,  292,  292,  292,  292,  292,  292,
-  292,    0,  292,  292,  292,  292,  292,    0,    0,  292,
-    0,    0,    0,    0,    0,    0,  292,  292,  292,    0,
-    0,    0,    0,    0,    0,  292,  292,  501,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  501,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  501,  501,
-  501,  501,  501,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  302,    0,  302,  302,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  302,    0,    0,    0,  302,    0,  302,    0,    0,
-  302,  302,  302,  302,  302,  302,  302,    0,    0,  302,
-  302,  302,    0,    0,    0,    0,  302,  302,    0,    0,
-    0,  302,  302,    0,    0,    0,    0,    0,    0,    0,
-    0,  302,    0,    0,    0,  302,  302,    0,    0,    0,
-  302,    0,    0,    0,    0,    0,  302,    0,  302,  302,
-    0,  302,    0,  302,  302,  302,  302,  302,    0,  302,
-  302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
-  302,  302,  302,  302,  302,    0,    0,  302,  302,  302,
-    0,  302,  302,  302,    0,  302,  302,  302,    0,    0,
-  302,    0,  302,    0,    0,  302,  302,  302,  302,    0,
-  302,  302,  302,  302,    0,    0,    0,    0,    0,  302,
-    0,    0,  302,  302,  302,  302,  302,  302,  302,  302,
-    0,  302,  302,  302,  302,  302,    0,    0,  302,    0,
-    0,    0,    0,  501,    0,  302,  302,  302,    0,    0,
-    0,  502,    0,    0,  302,  302,    0,    0,  501,  501,
-  501,  502,  501,    0,  501,    0,    0,  501,  501,  501,
-  501,  501,  501,  501,    0,    0,  501,  501,  501,    0,
-    0,    0,    0,  501,  501,    0,    0,    0,  501,  501,
-    0,    0,  502,  502,  502,  502,  502,    0,  501,    0,
-    0,    0,  501,  501,    0,    0,    0,  501,    0,    0,
-    0,    0,    0,  501,    0,  501,  501,    0,  501,    0,
-  501,  501,  501,  501,  501,    0,  501,  501,  501,  501,
-  501,  501,  501,  501,  501,  501,  501,  501,  501,  501,
-  501,  501,    0,    0,  501,  501,  501,    0,  501,  501,
-  501,    0,  501,  501,  501,    0,    0,  501,    0,  501,
-    0,    0,  501,  501,  501,  501,    0,    0,  501,  501,
-  501,    0,    0,    0,    0,    0,  501,    0,    0,  501,
-  501,  501,  501,  501,  501,  501,  501,    0,  501,  501,
-  501,  501,  501,    0,    0,  501,    0,    0,    0,    0,
-    0,    0,  501,  501,  501,    0,  493,    0,    0,    0,
-    0,  501,  501,    0,    0,    0,  493,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  499,  499,
-  493,  499,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  502,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  502,  502,  502,    0,  502,    0,  502,    0,
-    0,  502,  502,  502,  502,  502,  502,  502,    0,    0,
-  502,  502,  502,    0,    0,    0,    0,  502,  502,    0,
-    0,    0,  502,  502,    0,    0,    0,    0,    0,    0,
-    0,    0,  502,    0,    0,    0,  502,  502,    0,    0,
-    0,  502,    0,    0,    0,    0,    0,  502,    0,  502,
-  502,    0,  502,    0,  502,  502,  502,  502,  502,    0,
-  502,  502,  502,  502,  502,  502,  502,  502,  502,  502,
-  502,  502,  502,  502,  502,  502,    0,    0,  502,  502,
-  502,    0,  502,  502,  502,    0,  502,  502,  502,    0,
-    0,  502,    0,  502,    0,    0,  502,  502,  502,  502,
-    0,    0,  502,  502,  502,    0,    0,    0,    0,    0,
-  502,    0,    0,  502,  502,  502,  502,  502,  502,  502,
-  502,    0,  502,  502,  502,  502,  502,    0,    0,  502,
-    0,    0,  493,    0,    0,    0,  502,  502,    0,    0,
-  507,    0,    0,    0,    0,  502,  502,  499,  499,  499,
-  507,  493,    0,  493,    0,    0,  493,  493,  493,  493,
-  493,  493,  493,    0,    0,  493,  493,  493,    0,    0,
-    0,    0,  493,  493,    0,    0,    0,  493,  493,    0,
-    0,  507,  507,  507,  507,  507,    0,  493,    0,    0,
-    0,  493,  493,    0,    0,    0,  493,    0,    0,    0,
-    0,    0,  493,    0,  493,  493,    0,  493,    0,  493,
-  493,  493,  493,  493,    0,  493,  493,  493,  493,  493,
-  493,  493,  493,  493,  493,  493,  493,  493,  493,  493,
-  493,    0,    0,  493,  493,  493,    0,  493,  493,  493,
-    0,  493,  493,  493,    0,    0,  493,    0,  493,    0,
-    0,  493,  493,  493,  493,    0,    0,  493,  493,  493,
-    0,    0,    0,    0,    0,  493,    0,    0,  493,  493,
-  493,  493,  493,  493,  493,  493,    0,  493,  493,  493,
-  493,  493,    0,    0,  493,    0,    0,    0,    0,    0,
-    0,  493,  493,  493,    0,  504,    0,    0,    0,    0,
-  493,  493,    0,    0,    0,  504,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  504,  504,  504,  504,
-  504,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  507,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  507,  507,    0,    0,  507,    0,  507,    0,    0,
-  507,  507,  507,  507,  507,  507,  507,    0,    0,  507,
-  507,  507,    0,    0,    0,    0,  507,  507,    0,    0,
-    0,  507,  507,    0,    0,    0,    0,    0,    0,    0,
-    0,  507,    0,    0,    0,  507,  507,    0,    0,    0,
-  507,    0,    0,    0,    0,    0,  507,    0,  507,  507,
-    0,  507,    0,  507,  507,  507,  507,  507,    0,  507,
-  507,  507,  507,  507,  507,  507,  507,  507,  507,  507,
-  507,  507,  507,  507,  507,    0,    0,  507,  507,  507,
-    0,  507,  507,  507,    0,  507,  507,  507,    0,    0,
-  507,    0,  507,    0,    0,  507,  507,  507,  507,    0,
-    0,  507,  507,  507,    0,    0,    0,    0,    0,  507,
-    0,    0,  507,  507,  507,  507,  507,  507,  507,  507,
-    0,  507,  507,  507,  507,  507,    0,    0,  507,    0,
-    0,  504,    0,    0,    0,  507,  507,  507,  505,    0,
-    0,    0,    0,    0,  507,  507,  504,  504,  505,    0,
-  504,    0,  504,    0,    0,  504,  504,  504,  504,  504,
-  504,  504,    0,    0,  504,  504,  504,    0,    0,    0,
-    0,  504,  504,    0,    0,    0,  504,  504,    0,  505,
-  505,  505,  505,  505,    0,    0,  504,    0,    0,    0,
-  504,  504,    0,    0,    0,  504,    0,    0,    0,    0,
-    0,  504,    0,  504,  504,    0,  504,    0,  504,  504,
-  504,  504,  504,    0,  504,  504,  504,  504,  504,  504,
-  504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
-    0,    0,  504,  504,  504,    0,  504,  504,  504,    0,
-  504,  504,  504,    0,    0,  504,    0,  504,    0,    0,
-  504,  504,  504,  504,    0,    0,  504,  504,  504,    0,
-    0,    0,    0,    0,  504,    0,    0,  504,  504,  504,
-  504,  504,  504,  504,  504,    0,  504,  504,  504,  504,
-  504,    0,    0,  504,    0,    0,    0,    0,    0,    0,
-  504,  504,  504,  506,    0,    0,    0,    0,    0,  504,
-  504,    0,    0,  506,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  506,  506,  506,  506,  506,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  505,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  505,
-  505,    0,    0,  505,    0,  505,    0,    0,  505,  505,
-  505,  505,  505,  505,  505,    0,    0,  505,  505,  505,
-    0,    0,    0,    0,  505,  505,    0,    0,    0,  505,
-  505,    0,    0,    0,    0,    0,    0,    0,    0,  505,
-    0,    0,    0,  505,  505,    0,    0,    0,  505,    0,
-    0,    0,    0,    0,  505,    0,  505,  505,    0,  505,
-    0,  505,  505,  505,  505,  505,    0,  505,  505,  505,
-  505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
-  505,  505,  505,    0,    0,  505,  505,  505,    0,  505,
-  505,  505,    0,  505,  505,  505,    0,    0,  505,    0,
-  505,    0,    0,  505,  505,  505,  505,    0,    0,  505,
-  505,  505,    0,    0,    0,    0,    0,  505,    0,    0,
-  505,  505,  505,  505,  505,  505,  505,  505,    0,  505,
-  505,  505,  505,  505,    0,    0,  505,    0,    0,  506,
-    0,    0,    0,  505,  505,  505,  313,    0,    0,    0,
-    0,    0,  505,  505,  506,  506,  313,    0,  506,    0,
-  506,    0,    0,  506,  506,  506,  506,  506,  506,  506,
-    0,    0,  506,  506,  506,    0,    0,    0,    0,  506,
-  506,    0,    0,  313,  506,  506,    0,  313,    0,    0,
-  313,    0,    0,    0,  506,    0,    0,    0,  506,  506,
-    0,    0,    0,  506,  313,    0,    0,    0,    0,  506,
-    0,  506,  506,    0,  506,    0,  506,  506,  506,  506,
-  506,    0,  506,  506,  506,  506,  506,  506,  506,  506,
-  506,  506,  506,  506,  506,  506,  506,  506,    0,    0,
-  506,  506,  506,    0,  506,  506,  506,    0,  506,  506,
-  506,    0,    0,  506,    0,  506,    0,    0,  506,  506,
-  506,  506,    0,    0,  506,  506,  506,    0,    0,    0,
-    0,    0,  506,    0,    0,  506,  506,  506,  506,  506,
-  506,  506,  506,    0,  506,  506,  506,  506,  506,    0,
-    0,  506,    0,    0,    0,    0,    0,    0,  506,  506,
-  506,  309,    0,    0,    0,    0,    0,  506,  506,    0,
-    0,  309,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  309,    0,
-    0,    0,  309,    0,    0,  309,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  309,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  313,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  313,    0,    0,
-    0,  313,    0,  313,    0,    0,  313,  313,  313,  313,
-  313,  313,  313,    0,    0,  313,  313,  313,    0,    0,
-    0,    0,  313,  313,    0,    0,    0,  313,  313,    0,
-    0,    0,    0,    0,    0,    0,    0,  313,    0,    0,
-    0,  313,  313,    0,    0,    0,  313,    0,    0,    0,
-    0,    0,  313,    0,  313,  313,    0,  313,    0,  313,
-  313,  313,  313,  313,    0,  313,  313,  313,  313,  313,
-  313,  313,  313,  313,  313,  313,  313,  313,  313,  313,
-  313,    0,    0,  313,  313,  313,    0,  313,  313,  313,
-    0,  313,  313,  313,    0,  503,  313,    0,  313,    0,
-    0,  313,  313,  313,  313,  503,  313,  313,  313,  313,
-    0,    0,    0,    0,    0,  313,    0,    0,  313,  313,
-  313,  313,  313,  313,  313,  313,    0,  313,  313,  313,
-  313,  313,    0,    0,  313,    0,  503,  309,  503,  503,
-  503,  313,  313,  313,    0,    0,    0,    0,    0,    0,
-  313,  313,  309,    0,    0,    0,  309,    0,  309,    0,
-    0,  309,  309,  309,  309,  309,  309,  309,    0,    0,
-  309,  309,  309,    0,    0,    0,    0,  309,  309,    0,
-    0,    0,  309,  309,    0,    0,    0,    0,    0,    0,
-    0,    0,  309,    0,    0,    0,  309,  309,    0,    0,
-    0,  309,    0,    0,    0,    0,    0,  309,    0,  309,
-  309,    0,  309,    0,  309,  309,  309,  309,  309,    0,
-  309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
-  309,  309,  309,  309,  309,  309,    0,    0,  309,  309,
-  309,    0,  309,  309,  309,    0,  309,  309,  309,    0,
-  509,  309,    0,  309,    0,    0,  309,  309,  309,  309,
-  509,  309,  309,  309,  309,    0,    0,    0,    0,    0,
-  309,    0,    0,  309,  309,  309,  309,  309,  309,  309,
-  309,    0,  309,  309,  309,  309,  309,    0,    0,  309,
-    0,  509,    0,    0,  509,    0,  309,  309,  309,    0,
-    0,    0,    0,    0,    0,  309,  309,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  503,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  503,    0,    0,    0,
-  503,    0,  503,    0,    0,  503,  503,  503,  503,  503,
-  503,  503,    0,    0,  503,  503,  503,    0,    0,    0,
-    0,  503,  503,    0,    0,    0,  503,  503,    0,    0,
-    0,    0,    0,    0,    0,    0,  503,    0,    0,    0,
-  503,  503,    0,    0,    0,  503,    0,    0,    0,    0,
-    0,  503,    0,  503,  503,    0,  503,    0,  503,  503,
-  503,  503,  503,    0,  503,  503,  503,  503,  503,  503,
-  503,  503,  503,  503,  503,  503,  503,  503,  503,  503,
-    0,    0,  503,  503,  503,    0,  503,  503,  503,    0,
-  503,  503,  503,    0,  512,  503,    0,  503,    0,    0,
-  503,  503,  503,  503,  512,    0,  503,  503,  503,    0,
-    0,    0,    0,    0,  503,    0,    0,  503,  503,  503,
-  503,  503,  503,  503,  503,    0,  503,  503,  503,  503,
-  503,    0,    0,  503,    0,  512,  509,    0,  512,    0,
-  503,  503,  503,    0,    0,    0,    0,    0,    0,  503,
-  503,  509,    0,    0,    0,  509,    0,  509,    0,    0,
-  509,  509,  509,  509,  509,  509,  509,    0,    0,  509,
-  509,  509,    0,    0,    0,    0,  509,  509,    0,    0,
-    0,  509,  509,    0,    0,    0,    0,    0,    0,    0,
-    0,  509,    0,    0,    0,  509,  509,    0,    0,    0,
-  509,    0,    0,    0,    0,    0,  509,    0,  509,  509,
-    0,  509,    0,  509,  509,  509,  509,  509,    0,  509,
-  509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
-  509,  509,  509,  509,  509,    0,    0,  509,  509,  509,
-    0,  509,  509,  509,    0,  509,  509,  509,    0,  511,
-  509,    0,  509,    0,    0,  509,  509,  509,  509,  511,
-    0,  509,  509,  509,    0,    0,    0,    0,    0,  509,
-    0,    0,  509,  509,  509,  509,  509,  509,  509,  509,
-    0,  509,  509,  509,  509,  509,    0,    0,  509,    0,
-  511,    0,    0,  511,    0,  509,  509,  509,    0,    0,
-    0,    0,    0,    0,  509,  509,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  512,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  512,    0,    0,    0,  512,
-    0,  512,    0,    0,  512,  512,  512,  512,  512,  512,
-  512,    0,    0,  512,  512,  512,    0,    0,    0,    0,
-  512,  512,    0,    0,    0,  512,  512,    0,    0,    0,
-    0,    0,    0,    0,    0,  512,    0,    0,    0,  512,
-  512,    0,    0,    0,  512,    0,    0,    0,    0,    0,
-  512,    0,  512,  512,    0,  512,    0,  512,  512,  512,
-  512,  512,    0,  512,  512,  512,  512,  512,  512,  512,
-  512,  512,  512,  512,  512,  512,  512,  512,  512,    0,
-    0,  512,  512,  512,    0,  512,  512,  512,    0,  512,
-  512,  512,    0,  510,  512,    0,  512,    0,    0,  512,
-  512,  512,  512,  510,    0,  512,  512,  512,    0,    0,
-    0,    0,    0,  512,    0,    0,  512,  512,  512,  512,
-  512,  512,  512,  512,    0,  512,  512,  512,  512,  512,
-    0,    0,  512,    0,  510,  511,    0,  510,    0,  512,
-  512,  512,    0,    0,    0,    0,    0,    0,  512,  512,
-  511,    0,    0,    0,  511,    0,  511,    0,    0,  511,
-  511,  511,  511,  511,  511,  511,    0,    0,  511,  511,
-  511,    0,    0,    0,    0,  511,  511,    0,    0,    0,
-  511,  511,    0,    0,    0,    0,    0,    0,    0,    0,
-  511,    0,    0,    0,  511,  511,    0,    0,    0,  511,
-    0,    0,    0,    0,    0,  511,    0,  511,  511,    0,
-  511,    0,  511,  511,  511,  511,  511,    0,  511,  511,
-  511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
-  511,  511,  511,  511,    0,    0,  511,  511,  511,    0,
-  511,  511,  511,    0,  511,  511,  511,    0,  236,  511,
-    0,  511,    0,    0,  511,  511,  511,  511,  236,    0,
-  511,  511,  511,    0,    0,    0,    0,    0,  511,    0,
-    0,  511,  511,  511,  511,  511,  511,  511,  511,    0,
-  511,  511,  511,  511,  511,    0,    0,  511,    0,    0,
-  236,    0,  236,    0,  511,  511,  511,    0,    0,    0,
-    0,    0,    0,  511,  511,    0,    0,    0,    0,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  510,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  510,    0,    0,    0,  510,    0,
-  510,    0,    0,  510,  510,  510,  510,  510,  510,  510,
-    0,    0,  510,  510,  510,    0,    0,    0,    0,  510,
-  510,    0,    0,    0,  510,  510,    0,    0,    0,    0,
-    0,    0,    0,    0,  510,    0,    0,    0,  510,  510,
-    0,    0,    0,  510,    0,    0,    0,    0,    0,  510,
-    0,  510,  510,    0,  510,    0,  510,  510,  510,  510,
-  510,    0,  510,  510,  510,  510,  510,  510,  510,  510,
-  510,  510,  510,  510,  510,  510,  510,  510,    0,    0,
-  510,  510,  510,    0,  510,  510,  510,    0,  510,  510,
-  510,    0,  513,  510,    0,  510,    0,    0,  510,  510,
-  510,  510,  513,    0,  510,  510,  510,    0,    0,    0,
-    0,    0,  510,    0,    0,  510,  510,  510,  510,  510,
-  510,  510,  510,    0,  510,  510,  510,  510,  510,    0,
-    0,  510,    0,  513,  236,    0,  513,    0,  510,  510,
-  510,    0,    0,    0,    0,    0,    0,  510,  510,    0,
-    0,    0,    0,  236,    0,  236,    0,    0,  236,  236,
-  236,  236,  236,  236,  236,    0,    0,  236,  236,  236,
-    0,    0,    0,    0,  236,  236,    0,    0,    0,  236,
-  236,    0,    0,    0,    0,    0,    0,    0,    0,  236,
-    0,    0,    0,  236,  236,    0,    0,    0,  236,    0,
-    0,    0,    0,    0,  236,    0,  236,  236,    0,  236,
-    0,  236,  236,  236,  236,  236,    0,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,  236,    0,    0,  236,  236,  236,    0,  236,
-  236,  236,    0,  236,  236,  236,    0,  508,  236,    0,
-  236,    0,    0,  236,  236,  236,  236,  508,    0,  236,
-  236,  236,    0,    0,    0,    0,    0,  236,    0,    0,
-  236,  236,  236,  236,  236,  236,  236,  236,    0,  236,
-  236,  236,  236,  236,    0,    0,  236,    0,  508,    0,
-    0,  508,    0,  236,  236,  236,    0,    0,    0,    0,
-    0,    0,  236,  236,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  513,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  513,    0,    0,    0,  513,    0,  513,
-    0,    0,  513,  513,  513,  513,  513,  513,  513,    0,
-    0,  513,  513,  513,    0,    0,    0,    0,  513,  513,
-    0,    0,    0,  513,  513,    0,    0,    0,    0,    0,
-    0,    0,    0,  513,   57,    0,    0,  513,  513,    0,
-    0,    0,  513,    0,   57,    0,    0,    0,  513,    0,
-  513,  513,    0,  513,    0,  513,  513,  513,  513,  513,
-    0,  513,  513,  513,  513,  513,  513,  513,  513,  513,
-  513,  513,  513,  513,  513,  513,  513,    0,    0,  513,
-  513,  513,    0,  513,  513,  513,    0,  513,  513,  513,
-    0,    0,  513,    0,  513,    0,    0,  513,  513,  513,
-  513,    0,    0,  513,  513,  513,    0,    0,    0,    0,
-    0,  513,    0,    0,  513,  513,  513,  513,  513,  513,
-  513,  513,    0,  513,  513,  513,  513,  513,    0,    0,
-  513,    0,    0,  508,    0,    0,    0,  513,  513,  513,
-    0,    0,    0,    0,    0,    0,  513,  513,  508,    0,
-    0,    0,  508,    0,  508,    0,    0,  508,  508,  508,
-  508,  508,  508,  508,    0,    0,  508,  508,  508,    0,
-    0,    0,    0,  508,  508,    0,    0,    0,  508,  508,
-    0,    0,    0,    0,    0,  142,    0,    0,  508,    0,
-    0,    0,  508,  508,    0,  142,    0,  508,    0,    0,
-    0,    0,    0,  508,    0,  508,  508,    0,  508,    0,
-  508,  508,  508,  508,  508,    0,  508,  508,  508,  508,
-  508,  508,  508,  508,  508,  508,  508,  508,  508,  508,
-  508,  508,    0,    0,  508,  508,  508,    0,  508,  508,
-  508,    0,  508,  508,  508,    0,    0,  508,    0,  508,
-    0,    0,  508,  508,  508,  508,    0,    0,  508,  508,
-  508,    0,    0,    0,    0,    0,  508,    0,    0,  508,
-  508,  508,  508,  508,  508,  508,  508,    0,  508,  508,
-  508,  508,  508,    0,    0,  508,    0,    0,    0,    0,
-   57,    0,  508,  508,  508,    0,    0,    0,    0,    0,
-    0,  508,  508,    0,    0,  164,  164,    0,    0,   57,
-    0,   57,    0,    0,   57,   57,   57,   57,   57,   57,
-   57,    0,    0,   57,   57,   57,    0,    0,    0,    0,
-   57,   57,    0,    0,    0,   57,   57,    0,    0,    0,
-    0,    0,    0,    0,    0,   57,    0,    0,    0,   57,
-   57,    0,    0,    0,   57,    0,    0,    0,    0,    0,
-   57,    0,   57,   57,    0,   57,    0,   57,   57,   57,
-   57,   57,    0,   57,   57,   57,   57,   57,   57,   57,
-   57,   57,   57,   57,   57,   57,   57,   57,   57,    0,
-    0,   57,   57,   57,    0,   57,   57,   57,    0,   57,
-   57,   57,    0,  355,   57,    0,   57,    0,    0,   57,
-   57,   57,   57,  355,    0,   57,   57,   57,    0,    0,
-    0,    0,    0,   57,    0,    0,   57,   57,   57,   57,
-   57,   57,   57,   57,    0,   57,   57,   57,   57,   57,
-    0,  142,   57,    0,  355,    0,    0,    0,    0,   57,
-   57,   57,    0,    0,    0,    0,  164,  164,   57,   57,
-  142,  355,  142,    0,    0,  142,  142,  142,  142,  142,
-  142,  142,    0,    0,  142,  142,  142,    0,    0,    0,
-    0,  142,  142,    0,    0,    0,  142,  142,    0,    0,
-    0,    0,    0,    0,    0,    0,  142,    0,    0,    0,
-  142,  142,    0,    0,    0,  142,    0,    0,    0,    0,
-    0,  142,    0,  142,  142,    0,  142,    0,  142,  142,
-  142,  142,  142,    0,  142,  142,  142,  142,  142,  142,
-  142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
-    0,    0,  142,  142,  142,    0,  142,  142,  142,    0,
-  142,  142,  142,    0,  125,  142,    0,  142,    0,    0,
-  142,  142,  142,  142,  125,    0,  142,  142,  142,    0,
-    0,    0,    0,    0,  142,    0,    0,  142,  142,  142,
-  142,  142,  142,  142,  142,    0,  142,  142,  142,  142,
-  142,    0,    0,  142,    0,    0,    0,    0,  125,    0,
-  142,  142,  142,    0,    0,    0,    0,    0,    0,  142,
-  142,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  355,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  355,    0,
-  355,    0,    0,  355,  355,  355,  355,  355,  355,  355,
-    0,    0,  355,  355,  355,    0,    0,    0,    0,  355,
-  355,    0,    0,    0,  355,  355,    0,    0,    0,    0,
-  154,    0,    0,    0,  355,    0,    0,    0,  355,  355,
-  154,    0,    0,  355,    0,    0,    0,    0,    0,  355,
-    0,  355,  355,    0,  355,    0,  355,  355,  355,  355,
-  355,    0,  355,  355,  355,  355,  355,  355,  355,  355,
-  355,  355,  355,  355,  355,  355,  355,  355,    0,    0,
-  355,  355,  355,    0,  355,  355,  355,    0,  355,  355,
-  355,    0,    0,  355,    0,  355,    0,    0,  355,  355,
-  355,  355,    0,    0,  355,  355,  355,    0,    0,    0,
-    0,    0,  355,    0,    0,  355,  355,  355,  355,  355,
-  355,  355,  355,    0,  355,  355,  355,  355,  355,    0,
-  125,  355,    0,    0,    0,    0,    0,    0,  355,  355,
-  355,    0,    0,    0,    0,  125,  125,  355,  355,  125,
-    0,  125,    0,    0,  125,  125,  125,  125,  125,  125,
-  125,    0,    0,  125,  125,  125,    0,    0,    0,    0,
-  125,  125,    0,    0,    0,  125,  125,    0,    0,    0,
-    0,    0,    0,    0,    0,  125,    0,    0,    0,  125,
-  125,    0,    0,    0,  125,    0,    0,    0,    0,    0,
-  125,    0,  125,  125,    0,  125,    0,  125,  125,  125,
-  125,  125,    0,  125,  125,  125,  125,  125,  125,  125,
-  125,  125,  125,  125,  125,  125,  125,  125,  125,    0,
-    0,  125,  125,  125,    0,  125,  125,  125,    0,  125,
-  125,  125,    0,  236,  125,    0,  125,    0,    0,  125,
-  125,  125,  125,  236,    0,  125,  125,  125,    0,    0,
-    0,    0,    0,  125,    0,    0,  125,  125,  125,  125,
-  125,  125,  125,  125,    0,  125,  125,  125,  125,  125,
-    0,    0,  125,    0,    0,  236,  154,  236,    0,  125,
-  125,    0,    0,    0,    0,    0,    0,    0,  125,  125,
-    0,  154,  154,    0,    0,  154,    0,  154,    0,    0,
-  154,  154,  154,  154,  154,  154,  154,    0,    0,  154,
-  154,  154,    0,    0,    0,    0,  154,  154,    0,    0,
-    0,  154,  154,    0,    0,    0,    0,    0,    0,    0,
-    0,  154,    0,    0,    0,  154,  154,    0,    0,    0,
-  154,    0,    0,    0,    0,    0,  154,    0,  154,  154,
-    0,  154,    0,  154,  154,  154,  154,  154,    0,  154,
-  154,  154,  154,  154,  154,  154,  154,  154,  154,  154,
-  154,  154,  154,  154,  154,    0,    0,  154,  154,  154,
-    0,  154,  154,  154,  164,  154,  154,  154,    0,    0,
-  154,    0,  154,    0,  164,  154,  154,  154,  154,    0,
-    0,  154,  154,  154,    0,    0,    0,    0,    0,  154,
-    0,    0,  154,  154,  154,  154,  154,  154,  154,  154,
-    0,  154,  154,  154,  154,  154,    0,    0,  154,    0,
-    0,    0,    0,    0,    0,  154,  154,  154,    0,    0,
-    0,    0,    0,    0,  154,  154,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  236,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  236,    0,
-  236,    0,    0,  236,  236,  236,  236,  236,  236,  236,
-    0,    0,  236,  236,  236,    0,    0,    0,    0,  236,
-  236,    0,    0,    0,  236,  236,    0,    0,    0,    0,
-  155,    0,    0,    0,  236,    0,    0,    0,  236,  236,
-  155,    0,    0,  236,    0,    0,    0,    0,    0,  236,
-    0,  236,  236,    0,  236,    0,  236,  236,  236,  236,
-  236,    0,  236,  236,  236,  236,  236,  236,  236,  236,
-  236,  236,  236,  236,  236,  236,  236,  236,    0,    0,
-  236,  236,  236,    0,  236,  236,  236,    0,  236,  236,
-  236,    0,    0,  236,    0,  236,    0,    0,  236,  236,
-  236,  236,    0,    0,  236,  236,  236,    0,    0,    0,
-    0,    0,  236,    0,    0,  236,  236,  236,  236,  236,
-  236,  236,  236,    0,  236,  236,  236,  236,  236,    0,
-  164,  236,    0,    0,    0,    0,    0,    0,  236,  236,
-  236,    0,    0,    0,    0,  164,  164,  236,  236,  164,
-    0,  164,    0,    0,  164,  164,  164,  164,  164,  164,
-  164,    0,    0,  164,  164,  164,    0,    0,    0,    0,
-  164,  164,    0,    0,    0,  164,  164,    0,    0,    0,
-    0,    0,    0,    0,    0,  164,    0,    0,    0,  164,
-  164,    0,    0,    0,  164,    0,    0,    0,    0,    0,
-  164,    0,  164,  164,    0,  164,    0,  164,  164,  164,
-  164,  164,    0,  164,  164,  164,  164,  164,  164,  164,
-  164,  164,  164,  164,  164,  164,  164,  164,  164,    0,
-    0,  164,  164,  164,    0,  164,  164,  164,    0,  164,
-  164,  164,    0,  525,  164,    0,  164,    0,    0,  164,
-  164,  164,  164,  525,    0,  164,  164,  164,    0,    0,
-    0,    0,    0,  164,    0,    0,  164,  164,  164,  164,
-  164,  164,  164,  164,    0,  164,  164,  164,  164,  164,
-    0,    0,  164,    0,  525,    0,  155,  525,    0,  164,
-  164,  164,    0,    0,    0,    0,    0,    0,  164,  164,
-    0,  155,  155,    0,    0,  155,    0,  155,    0,    0,
-  155,  155,  155,  155,  155,  155,  155,    0,    0,  155,
-  155,  155,    0,    0,    0,    0,  155,  155,    0,    0,
-    0,  155,  155,    0,    0,    0,    0,    0,    0,    0,
-    0,  155,    0,    0,    0,  155,  155,    0,    0,    0,
-  155,    0,    0,    0,    0,    0,  155,    0,  155,  155,
-    0,  155,    0,  155,  155,  155,  155,  155,    0,  155,
-  155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
-  155,  155,  155,  155,  155,    0,    0,  155,  155,  155,
-    0,  155,  155,  155,    0,  155,  155,  155,    0,  168,
-  155,    0,  155,    0,    0,  155,  155,  155,  155,  168,
-    0,  155,  155,  155,    0,    0,    0,    0,    0,  155,
-    0,    0,  155,  155,  155,  155,  155,  155,  155,  155,
-    0,  155,  155,  155,  155,  155,    0,    0,  155,    0,
-  168,    0,    0,  168,    0,  155,  155,  155,    0,    0,
-    0,    0,    0,    0,  155,  155,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  525,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  525,    0,
-  525,    0,    0,  525,  525,  525,  525,  525,  525,  525,
-    0,    0,  525,  525,  525,    0,    0,    0,    0,  525,
-  525,    0,    0,    0,  525,  525,    0,    0,    0,    0,
-    0,    0,    0,    0,  525,    0,    0,    0,  525,  525,
-    0,    0,    0,  525,    0,    0,    0,    0,    0,  525,
-    0,  525,  525,    0,  525,    0,  525,  525,  525,  525,
-  525,    0,  525,  525,  525,  525,  525,  525,  525,  525,
-  525,  525,  525,  525,  525,  525,  525,  525,    0,    0,
-  525,  525,  525,    0,  525,  525,  525,    0,  525,  525,
-  525,    0,  523,  525,    0,  525,    0,    0,  525,  525,
-  525,  525,  523,    0,  525,  525,  525,    0,    0,    0,
-    0,    0,  525,    0,    0,  525,  525,  525,  525,  525,
-  525,  525,  525,    0,  525,  525,  525,  525,  525,    0,
-    0,  525,    0,  523,    0,  168,  523,    0,  525,  525,
-  525,    0,    0,    0,    0,    0,    0,  525,  525,    0,
-    0,    0,    0,    0,  168,    0,  168,    0,    0,  168,
-  168,  168,  168,  168,  168,  168,    0,    0,  168,  168,
-  168,    0,    0,    0,    0,  168,  168,    0,    0,    0,
-  168,  168,    0,    0,    0,    0,    0,    0,    0,    0,
-  168,    0,    0,    0,  168,  168,    0,    0,    0,  168,
-    0,    0,    0,    0,    0,  168,    0,  168,  168,    0,
-  168,    0,  168,  168,  168,  168,  168,    0,  168,  168,
-  168,  168,  168,  168,  168,  168,  168,  168,  168,  168,
-  168,  168,  168,  168,    0,    0,  168,  168,  168,    0,
-  168,  168,  168,    0,  168,  168,  168,    0,  522,  168,
-    0,  168,    0,    0,  168,  168,  168,  168,  522,    0,
-  168,  168,  168,    0,    0,    0,    0,    0,  168,    0,
-    0,  168,  168,  168,  168,  168,  168,  168,  168,    0,
-  168,  168,  168,  168,  168,    0,    0,  168,    0,  522,
-    0,    0,  522,    0,  168,  168,  168,    0,    0,    0,
-    0,    0,    0,  168,  168,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  523,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  523,    0,  523,
-    0,    0,  523,  523,  523,  523,  523,  523,  523,    0,
-    0,  523,  523,  523,    0,    0,    0,    0,  523,  523,
-    0,    0,    0,  523,  523,    0,    0,    0,    0,    0,
-    0,    0,    0,  523,    0,    0,    0,  523,  523,    0,
-    0,    0,  523,    0,    0,    0,    0,    0,  523,    0,
-  523,  523,    0,  523,    0,  523,  523,  523,  523,  523,
-    0,  523,  523,  523,  523,  523,  523,  523,  523,  523,
-  523,  523,  523,  523,  523,  523,  523,    0,    0,  523,
-  523,  523,    0,  523,  523,  523,    0,  523,  523,  523,
-    0,  520,  523,    0,  523,    0,    0,  523,  523,  523,
-  523,  520,    0,  523,  523,  523,    0,    0,    0,    0,
-    0,  523,    0,    0,  523,  523,  523,  523,  523,  523,
-  523,  523,    0,  523,  523,  523,  523,  523,    0,    0,
-  523,    0,  520,    0,  522,  520,    0,  523,  523,  523,
-    0,    0,    0,    0,    0,    0,  523,  523,    0,    0,
-    0,    0,    0,  522,    0,  522,    0,    0,  522,  522,
-  522,  522,  522,  522,  522,    0,    0,  522,  522,  522,
-    0,    0,    0,    0,  522,  522,    0,    0,    0,  522,
-  522,    0,    0,    0,    0,    0,    0,    0,    0,  522,
-    0,    0,    0,  522,  522,    0,    0,    0,  522,    0,
-    0,    0,    0,    0,  522,    0,  522,  522,    0,  522,
-    0,  522,  522,  522,  522,  522,    0,  522,  522,  522,
-  522,  522,  522,  522,  522,  522,  522,  522,  522,  522,
-  522,  522,  522,    0,    0,  522,  522,  522,    0,  522,
-  522,  522,    0,  522,  522,  522,    0,  531,  522,    0,
-  522,    0,    0,  522,  522,  522,  522,  531,    0,  522,
-  522,  522,    0,    0,    0,    0,    0,  522,    0,    0,
-  522,  522,  522,  522,  522,  522,  522,  522,    0,  522,
-  522,  522,  522,  522,    0,    0,  522,    0,    0,    0,
-    0,  531,    0,  522,  522,  522,    0,    0,    0,    0,
-    0,    0,  522,  522,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  520,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  520,    0,  520,    0,
-    0,  520,  520,  520,  520,  520,  520,  520,    0,    0,
-  520,  520,  520,    0,    0,    0,    0,  520,  520,    0,
-    0,    0,  520,  520,    0,    0,    0,    0,    0,    0,
-    0,    0,  520,  535,    0,    0,  520,  520,    0,    0,
-    0,  520,    0,  535,    0,    0,    0,  520,    0,  520,
-  520,    0,  520,    0,  520,  520,  520,  520,  520,    0,
-  520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
-  520,  520,  520,  520,  520,  520,    0,  535,  520,  520,
-  520,    0,  520,  520,  520,    0,  520,  520,  520,    0,
-    0,  520,    0,  520,    0,    0,  520,  520,  520,  520,
-    0,    0,  520,  520,  520,    0,    0,    0,    0,    0,
-  520,    0,    0,  520,  520,  520,  520,  520,  520,  520,
-  520,    0,  520,  520,  520,  520,  520,    0,    0,  520,
-    0,    0,    0,  531,    0,    0,  520,  520,  520,    0,
-    0,    0,    0,    0,    0,  520,  520,    0,    0,    0,
-    0,    0,  531,    0,  531,    0,    0,  531,  531,  531,
-  531,  531,  531,  531,    0,    0,  531,  531,  531,    0,
-    0,    0,    0,  531,  531,    0,    0,    0,  531,  531,
-    0,    0,    0,    0,    0,    0,    0,    0,  531,  533,
-    0,    0,  531,  531,    0,    0,    0,  531,    0,  533,
-    0,    0,    0,  531,    0,  531,  531,    0,  531,    0,
-  531,  531,  531,  531,  531,    0,  531,  531,  531,  531,
-  531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-  531,  531,    0,  533,  531,  531,  531,    0,  531,  531,
-  531,    0,  531,  531,  531,    0,    0,  531,    0,  531,
-    0,    0,  531,  531,  531,  531,    0,  531,  531,  531,
-  531,    0,    0,    0,    0,    0,  531,    0,    0,  531,
-  531,  531,  531,  531,  531,  531,  531,    0,  531,  531,
-  531,  531,  531,    0,    0,  531,    0,    0,    0,  535,
-    0,    0,  531,  531,  531,    0,    0,    0,    0,    0,
-    0,  531,  531,    0,    0,    0,    0,    0,  535,    0,
-  535,    0,    0,  535,  535,  535,  535,  535,  535,  535,
-    0,    0,  535,  535,  535,    0,    0,    0,    0,  535,
-  535,    0,    0,    0,  535,  535,    0,    0,    0,    0,
-    0,    0,    0,    0,  535,  198,    0,    0,  535,  535,
-    0,    0,    0,  535,    0,  198,    0,    0,    0,  535,
-    0,  535,  535,    0,  535,    0,  535,  535,  535,  535,
-  535,    0,  535,  535,  535,  535,  535,  535,  535,  535,
-  535,  535,  535,  535,  535,  535,  535,  535,    0,  198,
-  535,  535,  535,    0,  535,  535,  535,    0,  535,  535,
-  535,    0,    0,  535,    0,  535,  198,    0,  535,  535,
-  535,  535,    0,  535,  535,  535,  535,    0,    0,    0,
-    0,    0,  535,    0,    0,  535,  535,  535,  535,  535,
-  535,  535,  535,    0,  535,  535,  535,  535,  535,    0,
-    0,  535,    0,    0,    0,  533,    0,    0,  535,  535,
-  535,    0,    0,    0,    0,    0,    0,  535,  535,    0,
-    0,    0,    0,    0,  533,    0,  533,    0,    0,  533,
-  533,  533,  533,  533,  533,  533,    0,    0,  533,  533,
-  533,    0,    0,    0,    0,  533,  533,    0,    0,    0,
-  533,  533,    0,    0,    0,    0,  156,    0,    0,    0,
-  533,    0,    0,    0,  533,  533,  156,    0,    0,  533,
-    0,    0,    0,    0,    0,  533,    0,  533,  533,    0,
-  533,    0,  533,  533,  533,  533,  533,    0,  533,  533,
-  533,  533,  533,  533,  533,  533,  533,  533,  533,  533,
-  533,  533,  533,  533,    0,    0,  533,  533,  533,    0,
-  533,  533,  533,    0,  533,  533,  533,    0,    0,  533,
-    0,  533,    0,    0,  533,  533,  533,  533,    0,  533,
-  533,  533,  533,    0,    0,    0,    0,    0,  533,    0,
-    0,  533,  533,  533,  533,  533,  533,  533,  533,    0,
-  533,  533,  533,  533,  533,    0,    0,  533,    0,    0,
-    0,  198,    0,    0,  533,  533,  533,    0,    0,    0,
-    0,    0,    0,  533,  533,    0,    0,    0,    0,    0,
-  198,    0,  198,    0,    0,  198,  198,  198,  198,  198,
-  198,  198,    0,    0,  198,  198,  198,    0,    0,    0,
-    0,  198,  198,    0,    0,    0,  198,  198,    0,    0,
-    0,    0,    0,    0,    0,    0,  198,    0,    0,    0,
-  198,  198,    0,    0,    0,  198,    0,    0,    0,    0,
-    0,  198,    0,  198,  198,    0,  198,    0,  198,  198,
-  198,  198,  198,    0,  198,  198,  198,  198,  198,  198,
-  198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
-    0,    0,  198,  198,  198,    0,  198,  198,  198,    0,
-  198,  198,  198,    0,  358,  198,    0,  198,    0,    0,
-  198,  198,  198,  198,  358,    0,  198,  198,  198,    0,
-    0,    0,    0,    0,  198,    0,    0,  198,  198,  198,
-  198,  198,  198,  198,  198,    0,  198,  198,  198,  198,
-  198,    0,  156,  198,    0,    0,    0,    0,  358,    0,
-  198,  198,  198,    0,    0,    0,    0,  156,  156,  198,
-  198,  156,    0,  156,    0,  360,  156,  156,  156,  156,
-  156,  156,  156,    0,    0,  156,  156,  156,    0,    0,
-    0,    0,  156,  156,    0,    0,    0,  156,  156,    0,
-    0,    0,    0,    0,    0,    0,    0,  156,    0,    0,
-    0,  156,  156,    0,    0,    0,  156,    0,    0,    0,
-    0,    0,  156,    0,  156,  156,    0,  156,    0,  156,
-  156,  156,  156,  156,    0,  156,  156,  156,  156,  156,
-  156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
-  156,    0,    0,  156,  156,  156,    0,  156,  156,  156,
-    0,  156,  156,  156,    0,  521,  156,    0,  156,    0,
-    0,  156,  156,  156,  156,  521,    0,  156,  156,  156,
-    0,    0,    0,    0,    0,  156,    0,    0,  156,  156,
-  156,  156,  156,  156,  156,  156,    0,  156,  156,  156,
-  156,  156,    0,    0,  156,    0,  521,    0,    0,  521,
-    0,  156,  156,  156,    0,    0,    0,    0,    0,    0,
-  156,  156,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  358,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  358,
-    0,  358,    0,    0,  358,  358,  358,  358,  358,  358,
-  358,    0,    0,  358,  358,  358,    0,    0,    0,    0,
-  358,  358,    0,    0,    0,  358,  358,    0,   40,    0,
-    0,    0,    0,    0,    0,  358,    0,    0,   40,  358,
-  358,    0,    0,    0,  358,    0,    0,    0,    0,    0,
-  358,    0,  358,  358,    0,  358,    0,  358,  358,  358,
-  358,  358,    0,  358,  358,  358,  358,  358,  358,  358,
-  358,  358,  358,  358,  358,  358,  358,  358,  358,    0,
-    0,  358,  358,  358,    0,  358,  358,  358,    0,  358,
-  358,  358,    0,    0,  358,    0,  358,    0,    0,  358,
-  358,  358,  358,    0,    0,  358,  358,  358,    0,    0,
-    0,    0,    0,  358,    0,    0,  358,  358,  358,  358,
-  358,  358,  358,  358,    0,  358,  358,  358,  358,  358,
-    0,  521,  358,    0,    0,    0,    0,    0,    0,  358,
-  358,  358,    0,    0,    0,    0,    0,    0,  358,  358,
-  521,    0,  521,    0,    0,  521,  521,  521,  521,  521,
-  521,  521,    0,    0,  521,  521,  521,    0,    0,    0,
-    0,  521,  521,    0,    0,    0,  521,  521,    0,  530,
-    0,    0,    0,    0,    0,    0,  521,    0,    0,  530,
-  521,  521,    0,    0,    0,  521,    0,    0,    0,    0,
-    0,  521,    0,  521,  521,    0,  521,    0,  521,  521,
-  521,  521,  521,    0,  521,  521,  521,  521,  521,  521,
-  521,  521,  521,  521,  521,  521,  521,  521,  521,  521,
-    0,    0,  521,  521,  521,    0,  521,  521,  521,    0,
-  521,  521,  521,    0,    0,  521,    0,  521,    0,    0,
-  521,  521,  521,  521,    0,    0,  521,  521,  521,    0,
-    0,    0,    0,    0,  521,    0,    0,  521,  521,  521,
-  521,  521,  521,  521,  521,    0,  521,  521,  521,  521,
-  521,    0,    0,  521,   40,    0,    0,    0,    0,    0,
-  521,  521,  521,    0,    0,    0,    0,    0,    0,  521,
-  521,    0,    0,   40,    0,   40,   40,    0,   40,   40,
-   40,   40,   40,   40,   40,    0,    0,   40,   40,   40,
-    0,    0,    0,    0,   40,   40,    0,    0,    0,   40,
-   40,    0,  529,    0,    0,    0,    0,    0,    0,   40,
-    0,    0,  529,   40,   40,    0,    0,    0,   40,    0,
-    0,    0,    0,    0,   40,    0,   40,   40,    0,   40,
-    0,   40,   40,   40,   40,   40,    0,   40,   40,   40,
-   40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-   40,   40,   40,    0,    0,   40,   40,   40,    0,   40,
-   40,   40,    0,   40,   40,   40,    0,    0,   40,    0,
-   40,    0,    0,   40,   40,   40,   40,    0,    0,   40,
-   40,   40,    0,    0,    0,    0,    0,   40,    0,    0,
-   40,   40,   40,   40,   40,   40,   40,   40,    0,   40,
-   40,   40,   40,   40,    0,  530,   40,    0,    0,    0,
-    0,    0,    0,   40,   40,   40,    0,    0,    0,    0,
-    0,    0,   40,   40,  530,    0,  530,    0,    0,  530,
-  530,  530,  530,  530,  530,  530,    0,    0,  530,  530,
-  530,    0,    0,    0,    0,  530,  530,    0,    0,    0,
-  530,  530,    0,    0,    0,    0,    0,    0,    0,    0,
-  530,    0,    0,    0,  530,  530,    0,    0,    0,  530,
-    0,    0,    0,    0,    0,  530,    0,  530,  530,    0,
-  530,    0,  530,  530,  530,  530,  530,    0,  530,  530,
-  530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
-  530,  530,  530,  530,    0,    0,  530,  530,  530,    0,
-  530,  530,  530,    0,  530,  530,  530,    0,  525,  530,
-    0,  530,    0,    0,  530,  530,  530,  530,  525,  530,
-  530,  530,  530,    0,    0,    0,    0,    0,  530,    0,
-    0,  530,  530,  530,  530,  530,  530,  530,  530,    0,
-  530,  530,  530,  530,  530,    0,    0,  530,  529,  525,
-    0,    0,  525,    0,  530,  530,  530,    0,    0,    0,
-    0,    0,    0,  530,  530,    0,    0,  529,    0,  529,
-    0,    0,  529,  529,  529,  529,  529,  529,  529,    0,
-    0,  529,  529,  529,    0,    0,    0,    0,  529,  529,
-    0,    0,    0,  529,  529,    0,    0,    0,    0,    0,
-    0,    0,    0,  529,    0,    0,    0,  529,  529,    0,
-    0,    0,  529,    0,    0,    0,    0,    0,  529,    0,
-  529,  529,    0,  529,    0,  529,  529,  529,  529,  529,
-    0,  529,  529,  529,  529,  529,  529,  529,  529,  529,
-  529,  529,  529,  529,  529,  529,  529,    0,    0,  529,
-  529,  529,    0,  529,  529,  529,    0,  529,  529,  529,
-    0,  198,  529,    0,  529,    0,    0,  529,  529,  529,
-  529,  198,  529,  529,  529,  529,    0,    0,    0,    0,
-    0,  529,    0,    0,  529,  529,  529,  529,  529,  529,
-  529,  529,    0,  529,  529,  529,  529,  529,    0,    0,
-  529,    0,    0,    0,    0,  198,    0,  529,  529,  529,
-    0,    0,    0,    0,    0,    0,  529,  529,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  525,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  525,    0,  525,    0,    0,  525,  525,
-  525,  525,  525,  525,  525,    0,    0,  525,  525,  525,
-    0,    0,    0,    0,  525,  525,    0,    0,    0,  525,
-  525,    0,    0,    0,    0,    0,    0,    0,    0,  525,
-    0,    0,    0,  525,  525,    0,    0,    0,  525,    0,
-    0,    0,    0,    0,  525,    0,  525,  525,    0,  525,
-    0,  525,  525,  525,  525,  525,    0,  525,  525,  525,
-  525,  525,  525,  525,  525,  525,  525,  525,  525,  525,
-  525,  525,  525,    0,    0,  525,  525,  525,    0,  525,
-  525,  525,    0,  525,  525,  525,    0,  200,  525,    0,
-  525,    0,    0,  525,  525,  525,  525,  200,    0,  525,
-  525,  525,    0,    0,    0,    0,    0,  525,    0,    0,
-  525,  525,  525,  525,  525,  525,  525,  525,    0,  525,
-  525,  525,  525,  525,    0,    0,  525,  198,    0,    0,
-    0,  200,    0,  525,  525,    0,    0,    0,    0,    0,
-    0,    0,  525,  525,    0,    0,  198,    0,  198,    0,
-    0,  198,  198,  198,  198,  198,  198,  198,    0,    0,
-  198,  198,  198,    0,    0,    0,    0,  198,  198,    0,
-    0,    0,  198,  198,    0,    0,    0,    0,    0,    0,
-    0,    0,  198,    0,    0,    0,  198,  198,    0,    0,
-    0,  198,    0,    0,    0,    0,    0,  198,    0,  198,
-  198,    0,  198,    0,  198,  198,  198,  198,  198,    0,
-  198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
-  198,  198,  198,  198,  198,  198,    0,    0,  198,  198,
-  198,    0,  198,  198,  198,    0,  198,  198,  198,    0,
-  374,  198,    0,  198,    0,    0,  198,  198,  198,  198,
-  374,    0,  198,  198,  198,    0,    0,    0,    0,    0,
-  198,    0,    0,  198,  198,  198,  198,  198,  198,  198,
-  198,    0,  198,  198,  198,  198,  198,    0,    0,  198,
-    0,    0,    0,    0,  374,    0,  198,  198,  198,    0,
-    0,    0,    0,    0,    0,  198,  198,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  200,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  200,    0,  200,    0,    0,  200,  200,  200,
-  200,  200,  200,  200,    0,    0,  200,  200,  200,    0,
-    0,    0,    0,  200,  200,    0,    0,    0,  200,  200,
-    0,    0,    0,    0,    0,    0,    0,    0,  200,    0,
-    0,    0,  200,  200,    0,    0,    0,  200,    0,    0,
-    0,    0,    0,  200,    0,  200,  200,    0,  200,    0,
-  200,  200,  200,  200,  200,    0,  200,  200,  200,  200,
-  200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
-  200,  200,    0,    0,  200,  200,  200,    0,  200,  200,
-  200,    0,  200,  200,  200,    0,  359,  200,    0,  200,
-    0,    0,  200,  200,  200,  200,  359,    0,  200,  200,
-  200,    0,    0,    0,    0,    0,  200,    0,    0,  200,
-  200,  200,  200,  200,  200,  200,  200,    0,  200,  200,
-  200,  200,  200,    0,    0,  200,  374,    0,    0,    0,
-  359,    0,  200,  200,  200,    0,    0,    0,    0,    0,
-    0,  200,  200,    0,    0,  374,    0,  374,    0,    0,
-  374,  374,  374,  374,  374,  374,  374,    0,    0,  374,
-  374,  374,    0,    0,    0,    0,  374,  374,    0,    0,
-    0,  374,  374,    0,    0,    0,    0,    0,    0,    0,
-    0,  374,    0,    0,    0,  374,  374,    0,    0,    0,
-  374,    0,    0,    0,    0,    0,  374,    0,  374,  374,
-    0,  374,    0,  374,  374,  374,  374,  374,    0,  374,
-  374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
-  374,  374,  374,  374,  374,    0,    0,  374,  374,  374,
-    0,  374,  374,  374,    0,  374,  374,  374,    0,   59,
-  374,    0,  374,    0,    0,  374,  374,  374,  374,   59,
-    0,  374,  374,  374,    0,    0,    0,    0,    0,  374,
-    0,    0,  374,  374,  374,  374,  374,  374,  374,  374,
-    0,  374,  374,  374,  374,  374,    0,    0,  374,    0,
-    0,    0,    0,    0,    0,  374,  374,  374,    0,    0,
-    0,    0,    0,    0,  374,  374,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  359,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  359,    0,  359,    0,    0,  359,  359,  359,  359,
-  359,  359,  359,    0,    0,  359,  359,  359,    0,    0,
-    0,    0,  359,  359,    0,    0,    0,  359,  359,    0,
-    0,    0,    0,    0,    0,    0,    0,  359,    0,    0,
-    0,  359,  359,    0,    0,    0,  359,    0,    0,    0,
-    0,    0,  359,    0,  359,  359,    0,  359,    0,  359,
-  359,  359,  359,  359,    0,  359,  359,  359,  359,  359,
-  359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
-  359,    0,    0,  359,  359,  359,    0,  359,  359,  359,
-    0,  359,  359,  359,    0,  125,  359,    0,  359,    0,
-    0,  359,  359,  359,  359,  125,    0,  359,  359,  359,
-    0,    0,    0,    0,    0,  359,    0,    0,  359,  359,
-  359,  359,  359,  359,  359,  359,    0,  359,  359,  359,
-  359,  359,    0,    0,  359,   59,    0,    0,    0,  125,
-    0,  359,  359,  359,    0,    0,    0,    0,    0,    0,
-  359,  359,    0,    0,   59,    0,   59,    0,    0,   59,
-   59,   59,   59,   59,   59,   59,    0,    0,   59,   59,
-   59,    0,    0,    0,    0,   59,   59,    0,    0,    0,
-   59,   59,    0,    0,    0,    0,    0,    0,    0,    0,
-   59,    0,    0,    0,   59,   59,    0,    0,    0,   59,
-    0,    0,    0,    0,    0,   59,    0,   59,   59,    0,
-   59,    0,   59,   59,   59,   59,   59,    0,   59,   59,
-   59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
-   59,   59,   59,   59,    0,    0,   59,   59,   59,    0,
-   59,   59,   59,    0,   59,   59,   59,    0,  432,   59,
-    0,   59,    0,    0,   59,   59,   59,   59,  432,    0,
-   59,   59,   59,    0,    0,    0,    0,    0,   59,    0,
-    0,   59,   59,   59,   59,   59,   59,   59,   59,    0,
-   59,   59,   59,   59,   59,    0,    0,   59,    0,    0,
-    0,    0,    0,    0,   59,   59,   59,    0,    0,    0,
-    0,    0,    0,   59,   59,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  125,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  125,    0,  125,    0,    0,  125,  125,  125,  125,  125,
-  125,  125,    0,    0,  125,  125,  125,    0,    0,    0,
-    0,  125,  125,    0,    0,    0,  125,  125,    0,  441,
-    0,    0,    0,    0,    0,    0,  125,    0,    0,  441,
-  125,  125,    0,    0,    0,  125,    0,    0,    0,    0,
-    0,  125,    0,  125,  125,    0,  125,    0,  125,  125,
-  125,  125,  125,    0,  125,  125,  125,  125,  125,  125,
-  125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
-    0,    0,  125,  125,  125,    0,  125,  125,  125,    0,
-  125,  125,  125,    0,    0,  125,    0,  125,    0,    0,
-  125,  125,  125,  125,    0,    0,  125,  125,  125,    0,
-    0,    0,    0,    0,  125,    0,    0,  125,  125,  125,
-  125,  125,  125,  125,  125,    0,  125,  125,  125,  125,
-  125,    0,    0,  125,  432,    0,    0,    0,    0,    0,
-  125,  125,    0,    0,    0,    0,    0,    0,    0,  125,
-  125,    0,    0,  432,    0,  432,    0,    0,  432,  432,
-  432,  432,  432,  432,  432,    0,    0,  432,  432,  432,
-    0,    0,    0,    0,  432,  432,    0,    0,    0,  432,
-  432,    0,  357,    0,    0,    0,    0,    0,    0,  432,
-    0,    0,  357,  432,  432,    0,    0,    0,  432,    0,
-    0,    0,    0,    0,  432,    0,  432,  432,    0,  432,
-    0,  432,  432,  432,  432,  432,    0,  432,  432,  432,
-  432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
-  432,  432,  432,    0,    0,  432,  432,  432,    0,  432,
-  432,  432,    0,  432,  432,  432,    0,    0,  432,    0,
-  432,    0,    0,  432,  432,  432,  432,    0,    0,  432,
-  432,  432,    0,    0,    0,    0,    0,  432,    0,    0,
-  432,  432,  432,  432,  432,  432,  432,  432,    0,  432,
-  432,  432,  432,  432,    0,  441,  432,    0,    0,    0,
-    0,    0,    0,  432,  432,  432,    0,    0,    0,    0,
-    0,    0,  432,  432,  441,    0,  441,    0,    0,  441,
-  441,  441,  441,  441,  441,  441,    0,    0,  441,  441,
-  441,    0,    0,    0,    0,  441,  441,    0,    0,    0,
-  441,  441,    0,   69,    0,    0,    0,    0,    0,    0,
-  441,    0,    0,   69,  441,  441,    0,    0,    0,  441,
-    0,    0,    0,    0,    0,  441,    0,  441,  441,    0,
-  441,    0,  441,  441,  441,  441,  441,    0,  441,  441,
-  441,  441,  441,  441,  441,  441,  441,  441,  441,  441,
-  441,  441,  441,  441,    0,    0,  441,  441,  441,    0,
-  441,  441,  441,    0,  441,  441,  441,    0,    0,  441,
-    0,  441,    0,    0,  441,  441,  441,  441,    0,    0,
-  441,  441,  441,    0,    0,    0,    0,    0,  441,    0,
-    0,  441,  441,  441,  441,  441,  441,  441,  441,    0,
-  441,  441,  441,  441,  441,    0,    0,  441,  357,    0,
-    0,    0,    0,    0,  441,  441,  441,    0,    0,    0,
-    0,    0,    0,  441,  441,    0,    0,  357,    0,  357,
-    0,    0,  357,  357,  357,  357,  357,  357,  357,    0,
-    0,  357,  357,  357,    0,    0,    0,    0,  357,  357,
-    0,    0,    0,  357,  357,    0,   53,    0,    0,    0,
-    0,    0,    0,  357,    0,    0,   53,  357,  357,    0,
-    0,    0,  357,    0,    0,    0,    0,    0,  357,    0,
-  357,  357,    0,  357,    0,  357,  357,  357,  357,  357,
-    0,  357,  357,  357,  357,  357,  357,  357,  357,  357,
-  357,  357,  357,  357,  357,  357,  357,    0,    0,  357,
-  357,  357,    0,  357,  357,  357,    0,  357,  357,  357,
-    0,    0,  357,    0,  357,    0,    0,  357,  357,  357,
-  357,    0,    0,  357,  357,  357,    0,    0,    0,    0,
-    0,  357,    0,    0,  357,  357,  357,  357,  357,  357,
-  357,  357,    0,  357,  357,  357,  357,  357,    0,   69,
-  357,    0,    0,    0,    0,    0,    0,  357,  357,  357,
-    0,    0,    0,    0,    0,    0,  357,  357,   69,    0,
-   69,    0,    0,   69,   69,   69,   69,   69,   69,   69,
-    0,    0,   69,   69,   69,    0,    0,    0,    0,   69,
-   69,    0,    0,    0,   69,   69,    0,  169,    0,    0,
-    0,    0,    0,    0,   69,    0,    0,  169,   69,   69,
-    0,    0,    0,   69,    0,    0,    0,    0,    0,   69,
-    0,   69,   69,    0,   69,    0,   69,   69,   69,   69,
-   69,    0,   69,   69,   69,   69,   69,   69,   69,   69,
-   69,   69,   69,   69,   69,   69,   69,   69,    0,    0,
-   69,   69,   69,    0,   69,   69,   69,    0,   69,   69,
-   69,    0,    0,   69,    0,   69,    0,    0,   69,   69,
-   69,   69,    0,    0,   69,   69,   69,    0,    0,    0,
-    0,    0,   69,    0,    0,   69,   69,   69,   69,   69,
-   69,   69,   69,    0,   69,   69,   69,   69,   69,    0,
-    0,   69,   53,    0,    0,    0,    0,    0,   69,   69,
-   69,    0,    0,    0,    0,    0,    0,   69,   69,    0,
-    0,   53,    0,   53,    0,    0,   53,   53,   53,   53,
-   53,   53,   53,    0,    0,   53,   53,   53,    0,    0,
-    0,    0,   53,   53,    0,    0,    0,   53,   53,    0,
-  177,    0,    0,    0,    0,    0,    0,   53,    0,    0,
-  177,   53,   53,    0,    0,    0,   53,    0,    0,    0,
-    0,    0,   53,    0,   53,   53,    0,   53,    0,   53,
-   53,   53,   53,   53,    0,   53,   53,   53,   53,   53,
-   53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
-   53,    0,    0,   53,   53,   53,    0,   53,   53,   53,
-    0,   53,   53,   53,    0,    0,   53,    0,   53,    0,
-    0,   53,   53,   53,   53,    0,    0,   53,   53,   53,
-    0,    0,    0,    0,    0,   53,    0,    0,   53,   53,
-   53,   53,   53,   53,   53,   53,    0,   53,   53,   53,
-   53,   53,    0,  169,   53,    0,    0,    0,    0,    0,
-    0,   53,   53,   53,    0,    0,    0,    0,    0,    0,
-   53,   53,  169,    0,  169,    0,    0,  169,  169,  169,
-  169,  169,  169,  169,    0,    0,  169,  169,  169,    0,
-    0,    0,    0,  169,  169,    0,    0,    0,  169,  169,
-    0,   55,    0,    0,    0,    0,    0,    0,  169,    0,
-    0,   55,  169,  169,    0,    0,    0,  169,    0,    0,
-    0,    0,    0,  169,    0,  169,  169,    0,  169,    0,
-  169,  169,  169,  169,  169,    0,  169,  169,  169,  169,
-  169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
-  169,  169,    0,    0,  169,  169,  169,    0,  169,  169,
-  169,    0,  169,  169,  169,    0,    0,  169,    0,  169,
-    0,    0,  169,  169,  169,  169,    0,    0,  169,  169,
-  169,    0,    0,    0,    0,    0,  169,    0,    0,  169,
-  169,  169,  169,  169,  169,  169,  169,    0,  169,  169,
-  169,  169,  169,    0,    0,  169,  177,    0,    0,    0,
-    0,    0,  169,  169,  169,    0,    0,    0,    0,    0,
-    0,  169,  169,    0,    0,  177,    0,  177,    0,    0,
-  177,  177,  177,  177,  177,  177,  177,    0,    0,  177,
-  177,  177,    0,    0,    0,    0,  177,  177,    0,    0,
-    0,  177,  177,    0,  362,    0,    0,    0,    0,    0,
-    0,  177,    0,    0,  362,  177,  177,    0,    0,    0,
-  177,    0,    0,    0,    0,    0,  177,    0,  177,  177,
-    0,  177,    0,  177,  177,  177,  177,  177,    0,  177,
-  177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
-  177,  177,  177,  177,  177,    0,    0,  177,  177,  177,
-    0,  177,  177,  177,    0,  177,  177,  177,    0,    0,
-  177,    0,  177,    0,    0,  177,  177,  177,  177,    0,
-    0,  177,  177,  177,    0,    0,    0,    0,    0,  177,
-    0,    0,  177,  177,  177,  177,  177,  177,  177,  177,
-    0,  177,  177,  177,  177,  177,    0,   55,  177,    0,
-    0,    0,    0,    0,    0,  177,  177,  177,    0,    0,
-    0,    0,    0,    0,  177,  177,   55,    0,   55,    0,
-    0,   55,   55,   55,   55,   55,   55,   55,    0,    0,
-   55,   55,   55,    0,    0,    0,    0,   55,   55,    0,
-    0,    0,   55,   55,    0,  164,    0,    0,    0,    0,
-    0,    0,   55,    0,    0,  164,   55,   55,    0,    0,
-    0,   55,    0,    0,    0,    0,    0,   55,    0,   55,
-   55,    0,   55,    0,   55,   55,   55,   55,   55,    0,
-   55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-   55,   55,   55,   55,   55,   55,    0,    0,   55,   55,
-   55,    0,   55,   55,   55,    0,   55,   55,   55,    0,
-    0,   55,    0,   55,    0,    0,   55,   55,   55,   55,
-    0,    0,   55,   55,   55,    0,    0,    0,    0,    0,
-   55,    0,    0,   55,   55,   55,   55,   55,   55,   55,
-   55,    0,   55,   55,   55,   55,   55,    0,    0,   55,
-  362,    0,    0,    0,    0,    0,   55,   55,   55,    0,
-    0,    0,    0,    0,    0,   55,   55,    0,    0,  362,
-    0,  362,    0,    0,  362,  362,  362,  362,  362,  362,
-  362,    0,    0,  362,  362,  362,    0,    0,    0,    0,
-  362,  362,    0,    0,    0,  362,  362,    0,  406,    0,
-    0,    0,    0,    0,    0,  362,    0,    0,  406,  362,
-  362,    0,    0,    0,  362,    0,    0,    0,    0,    0,
-  362,    0,  362,  362,    0,  362,    0,  362,  362,  362,
-  362,  362,    0,  362,  362,  362,  362,  362,  362,  362,
-  362,  362,  362,  362,  362,  362,  362,  362,  362,    0,
-    0,  362,  362,  362,    0,  362,  362,  362,    0,  362,
-  362,  362,    0,    0,  362,    0,  362,    0,    0,  362,
-  362,  362,  362,    0,    0,  362,  362,  362,    0,    0,
-    0,    0,    0,  362,    0,    0,  362,  362,  362,  362,
-  362,  362,  362,  362,    0,  362,  362,  362,  362,  362,
-    0,  164,  362,    0,    0,    0,    0,    0,    0,  362,
-  362,  362,    0,    0,    0,    0,    0,    0,  362,  362,
-  164,    0,  164,    0,    0,  164,  164,  164,  164,  164,
-  164,  164,    0,    0,  164,  164,  164,    0,    0,    0,
-    0,  164,  164,    0,    0,    0,  164,  164,    0,  472,
-    0,    0,    0,    0,    0,    0,  164,    0,    0,  472,
-  164,  164,    0,    0,    0,  164,    0,    0,    0,    0,
-    0,  164,    0,  164,  164,    0,  164,    0,  164,  164,
-  164,  164,  164,    0,  164,  164,  164,  164,  164,  164,
-  164,  164,  164,  164,  164,  164,  164,  164,  164,  164,
-    0,    0,  164,  164,  164,    0,  164,  164,  164,    0,
-  164,  164,  164,    0,    0,  164,    0,  164,    0,    0,
-  164,  164,  164,  164,    0,    0,  164,  164,  164,    0,
-    0,    0,    0,    0,  164,    0,    0,  164,  164,  164,
-  164,  164,  164,  164,  164,    0,  164,  164,  164,  164,
-  164,    0,    0,  164,  406,    0,    0,    0,    0,    0,
-  164,  164,  164,    0,    0,    0,    0,    0,    0,  164,
-  164,    0,    0,  406,    0,  406,    0,    0,  406,  406,
-  406,  406,  406,  406,  406,    0,    0,  406,  406,  406,
-    0,    0,    0,    0,  406,  406,    0,    0,    0,  406,
-  406,    0,   34,    0,    0,    0,    0,    0,    0,  406,
-    0,    0,   34,  406,  406,    0,    0,    0,  406,    0,
-    0,    0,    0,    0,  406,    0,  406,  406,    0,  406,
-    0,  406,  406,  406,  406,  406,    0,  406,  406,  406,
-  406,  406,  406,  406,  406,  406,  406,  406,  406,  406,
-  406,  406,  406,    0,    0,  406,  406,  406,    0,  406,
-  406,  406,    0,  406,  406,  406,    0,    0,  406,    0,
-  406,    0,    0,  406,  406,  406,  406,    0,    0,  406,
-  406,  406,    0,    0,    0,    0,    0,  406,    0,    0,
-  406,  406,  406,  406,  406,  406,  406,  406,    0,  406,
-  406,  406,  406,  406,    0,  472,  406,    0,    0,    0,
-    0,    0,    0,  406,  406,  406,    0,    0,    0,    0,
-    0,    0,  406,  406,  472,    0,  472,    0,    0,  472,
-  472,  472,  472,  472,  472,  472,    0,    0,  472,  472,
-  472,    0,    0,    0,    0,  472,  472,    0,    0,    0,
-  472,  472,    0,  151,    0,    0,    0,    0,    0,    0,
-  472,    0,    0,  151,  472,  472,    0,    0,    0,  472,
-    0,    0,    0,    0,    0,  472,    0,  472,  472,    0,
-  472,    0,  472,  472,  472,  472,  472,    0,  472,  472,
-  472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
-  472,  472,  472,  472,    0,    0,  472,  472,  472,    0,
-  472,  472,  472,    0,  472,  472,  472,    0,    0,  472,
-    0,  472,    0,    0,  472,  472,  472,  472,    0,    0,
-  472,  472,  472,    0,    0,    0,    0,    0,  472,    0,
-    0,  472,  472,  472,  472,  472,  472,  472,  472,    0,
-  472,  472,  472,  472,  472,    0,    0,  472,   34,    0,
-    0,    0,    0,    0,  472,  472,  472,    0,    0,    0,
-    0,    0,    0,  472,  472,    0,    0,   34,    0,   34,
-    0,    0,   34,   34,   34,   34,   34,   34,   34,    0,
-    0,   34,   34,   34,    0,    0,    0,    0,   34,   34,
-    0,    0,    0,   34,   34,    0,  149,    0,    0,    0,
-    0,    0,    0,   34,    0,    0,  149,   34,   34,    0,
-    0,    0,   34,    0,    0,    0,    0,    0,   34,    0,
-   34,   34,    0,   34,    0,   34,   34,   34,   34,   34,
-    0,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-   34,   34,   34,   34,   34,   34,   34,    0,    0,   34,
-   34,   34,    0,   34,   34,   34,    0,   34,   34,   34,
-    0,    0,   34,    0,   34,    0,    0,   34,   34,   34,
-   34,    0,    0,   34,   34,   34,    0,    0,    0,    0,
-    0,   34,    0,    0,   34,   34,   34,   34,   34,   34,
-   34,   34,    0,   34,   34,   34,   34,   34,    0,  151,
-   34,    0,    0,    0,    0,    0,    0,   34,   34,   34,
-    0,    0,    0,    0,    0,    0,   34,   34,  151,    0,
-  151,    0,    0,  151,  151,  151,  151,  151,  151,  151,
-    0,    0,  151,  151,  151,    0,    0,    0,    0,  151,
-  151,    0,    0,    0,  151,  151,    0,   67,    0,    0,
-    0,    0,    0,    0,  151,    0,    0,   67,  151,  151,
-    0,    0,    0,  151,    0,    0,    0,    0,    0,  151,
-    0,  151,  151,    0,  151,    0,  151,  151,  151,  151,
-  151,    0,  151,  151,  151,  151,  151,  151,  151,  151,
-  151,  151,  151,  151,  151,  151,  151,  151,    0,    0,
-  151,  151,  151,    0,  151,  151,  151,    0,  151,  151,
-  151,    0,    0,  151,    0,  151,    0,    0,  151,  151,
-  151,  151,    0,    0,  151,  151,  151,    0,    0,    0,
-    0,    0,  151,    0,    0,  151,  151,  151,  151,  151,
-  151,  151,  151,    0,  151,  151,  151,  151,  151,    0,
-    0,  151,  149,    0,    0,    0,    0,    0,  151,  151,
-  151,    0,    0,    0,    0,    0,    0,  151,  151,    0,
-    0,  149,    0,  149,    0,    0,  149,  149,  149,  149,
-  149,  149,  149,    0,    0,  149,  149,  149,    0,    0,
-    0,    0,  149,  149,    0,    0,    0,  149,  149,    0,
-   68,    0,    0,    0,    0,    0,    0,  149,    0,    0,
-   68,  149,  149,    0,    0,    0,  149,    0,    0,    0,
-    0,    0,  149,    0,  149,  149,    0,  149,    0,  149,
-  149,  149,  149,  149,    0,  149,  149,  149,  149,  149,
-  149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
-  149,    0,    0,  149,  149,  149,    0,  149,  149,  149,
-    0,  149,  149,  149,    0,    0,  149,    0,  149,    0,
-    0,  149,  149,  149,  149,    0,    0,  149,  149,  149,
-    0,    0,    0,    0,    0,  149,    0,    0,  149,  149,
-  149,  149,  149,  149,  149,  149,    0,  149,  149,  149,
-  149,  149,    0,   67,  149,    0,    0,    0,    0,    0,
-    0,  149,  149,  149,    0,    0,    0,    0,    0,    0,
-  149,  149,   67,    0,   67,    0,    0,   67,   67,   67,
-   67,   67,   67,   67,    0,    0,   67,   67,   67,    0,
-    0,    0,    0,   67,   67,    0,    0,    0,   67,   67,
-    0,   40,    0,    0,    0,    0,    0,    0,   67,    0,
-    0,   40,   67,   67,    0,    0,    0,   67,    0,    0,
-    0,    0,    0,   67,    0,   67,   67,    0,   67,    0,
-   67,   67,   67,   67,   67,    0,   67,   67,   67,   67,
-   67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-   67,   67,    0,    0,   67,   67,   67,    0,   67,   67,
-   67,    0,   67,   67,   67,    0,    0,   67,    0,   67,
-    0,    0,   67,   67,   67,   67,    0,    0,   67,   67,
-   67,    0,    0,    0,    0,    0,   67,    0,    0,   67,
-   67,   67,   67,   67,   67,   67,   67,    0,   67,   67,
-   67,   67,   67,    0,    0,   67,   68,    0,    0,    0,
-    0,    0,   67,   67,   67,    0,    0,    0,    0,    0,
-    0,   67,   67,    0,    0,   68,    0,   68,    0,    0,
-   68,   68,   68,   68,   68,   68,   68,    0,    0,   68,
-   68,   68,    0,    0,    0,    0,   68,   68,    0,    0,
-    0,   68,   68,    0,  438,    0,    0,    0,    0,    0,
-    0,   68,    0,    0,  438,   68,   68,    0,    0,    0,
-   68,    0,    0,    0,    0,    0,   68,    0,   68,   68,
-    0,   68,    0,   68,   68,   68,   68,   68,    0,   68,
-   68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
-   68,   68,   68,   68,   68,    0,    0,   68,   68,   68,
-    0,   68,   68,   68,    0,   68,   68,   68,    0,    0,
-   68,    0,   68,    0,    0,   68,   68,   68,   68,    0,
-    0,   68,   68,   68,    0,    0,    0,    0,    0,   68,
-    0,    0,   68,   68,   68,   68,   68,   68,   68,   68,
-    0,   68,   68,   68,   68,   68,    0,   40,   68,    0,
-    0,    0,    0,    0,    0,   68,   68,   68,    0,    0,
-    0,    0,    0,    0,   68,   68,   40,    0,   40,    0,
-    0,   40,   40,   40,   40,   40,   40,   40,    0,    0,
-   40,   40,   40,    0,    0,    0,    0,   40,   40,    0,
-    0,    0,   40,   40,    0,  439,    0,    0,    0,    0,
-    0,    0,   40,    0,    0,  439,   40,   40,    0,    0,
-    0,   40,    0,    0,    0,    0,    0,   40,    0,   40,
-   40,    0,   40,    0,   40,   40,   40,   40,   40,    0,
-   40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
-   40,   40,   40,   40,   40,   40,    0,    0,   40,   40,
-   40,    0,   40,   40,   40,    0,   40,   40,   40,    0,
-    0,   40,    0,   40,    0,    0,   40,   40,   40,   40,
-    0,    0,   40,   40,   40,    0,    0,    0,    0,    0,
-   40,    0,    0,   40,   40,   40,   40,   40,   40,   40,
-   40,    0,   40,   40,   40,   40,   40,    0,    0,   40,
-  438,    0,    0,    0,    0,    0,   40,   40,   40,    0,
-    0,    0,    0,    0,    0,   40,   40,    0,    0,  438,
-    0,  438,    0,    0,  438,  438,  438,  438,  438,  438,
-  438,    0,    0,  438,  438,  438,    0,    0,    0,    0,
-  438,  438,    0,    0,    0,  438,  438,    0,  467,    0,
-    0,    0,    0,    0,    0,  438,    0,    0,  467,  438,
-  438,    0,    0,    0,  438,    0,    0,    0,    0,    0,
-  438,    0,  438,  438,    0,  438,    0,  438,  438,  438,
-  438,  438,    0,  438,  438,  438,  438,  438,  438,  438,
-  438,  438,  438,  438,  438,  438,  438,  438,  438,    0,
-    0,  438,  438,  438,    0,  438,  438,  438,    0,  438,
-  438,  438,    0,    0,  438,    0,  438,    0,    0,  438,
-  438,  438,  438,    0,    0,  438,  438,  438,    0,    0,
-    0,    0,    0,  438,    0,    0,  438,  438,  438,  438,
-  438,  438,  438,  438,    0,  438,  438,  438,  438,  438,
-    0,  439,  438,    0,    0,    0,    0,    0,    0,  438,
-  438,  438,    0,    0,    0,    0,    0,    0,  438,  438,
-  439,    0,  439,    0,    0,  439,  439,  439,  439,  439,
-  439,  439,    0,    0,  439,  439,  439,    0,    0,    0,
-    0,  439,  439,    0,    0,    0,  439,  439,    0,   43,
-    0,    0,    0,    0,    0,    0,  439,    0,    0,   43,
-  439,  439,    0,    0,    0,  439,    0,    0,    0,    0,
-    0,  439,    0,  439,  439,    0,  439,    0,  439,  439,
-  439,  439,  439,    0,  439,  439,  439,  439,  439,  439,
-  439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
-    0,    0,  439,  439,  439,    0,  439,  439,  439,    0,
-  439,  439,  439,    0,    0,  439,    0,  439,    0,    0,
-  439,  439,  439,  439,    0,    0,  439,  439,  439,    0,
-    0,    0,    0,    0,  439,    0,    0,  439,  439,  439,
-  439,  439,  439,  439,  439,    0,  439,  439,  439,  439,
-  439,    0,    0,  439,  467,    0,    0,    0,    0,    0,
-  439,  439,  439,    0,    0,    0,    0,    0,    0,  439,
-  439,    0,    0,  467,    0,  467,    0,    0,  467,  467,
-  467,  467,  467,  467,  467,    0,    0,  467,  467,  467,
-    0,    0,    0,    0,  467,  467,    0,    0,    0,  467,
-  467,    0,  363,    0,    0,    0,    0,    0,    0,  467,
-    0,    0,  363,  467,  467,    0,    0,    0,  467,    0,
-    0,    0,    0,    0,  467,    0,  467,  467,    0,  467,
-    0,  467,  467,  467,  467,  467,    0,  467,  467,  467,
-  467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
-  467,  467,  467,    0,    0,  467,  467,  467,    0,  467,
-  467,  467,    0,  467,  467,  467,    0,    0,  467,    0,
-  467,    0,    0,  467,  467,  467,  467,    0,    0,  467,
-  467,  467,    0,    0,    0,    0,    0,  467,    0,    0,
-  467,  467,  467,  467,  467,  467,  467,  467,    0,  467,
-  467,  467,  467,  467,    0,   43,  467,    0,    0,    0,
-    0,    0,    0,  467,  467,  467,    0,    0,    0,    0,
-    0,    0,  467,  467,   43,    0,   43,    0,    0,   43,
-   43,   43,   43,   43,   43,   43,    0,    0,   43,   43,
-   43,    0,    0,    0,    0,   43,   43,    0,    0,    0,
-   43,   43,    0,  473,    0,    0,    0,    0,    0,    0,
-   43,    0,    0,  473,   43,   43,    0,    0,    0,   43,
-    0,    0,    0,    0,    0,   43,    0,   43,   43,    0,
-   43,    0,   43,   43,   43,   43,   43,    0,   43,   43,
-   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
-   43,   43,   43,   43,    0,    0,   43,   43,   43,    0,
-   43,   43,   43,    0,   43,   43,   43,    0,    0,   43,
-    0,   43,    0,    0,   43,   43,   43,   43,    0,    0,
-   43,   43,   43,    0,    0,    0,    0,    0,   43,    0,
-    0,   43,   43,   43,   43,   43,   43,   43,   43,    0,
-   43,   43,   43,   43,   43,    0,    0,   43,  363,    0,
-    0,    0,    0,    0,   43,   43,   43,    0,    0,    0,
-    0,    0,    0,   43,   43,    0,    0,  363,    0,  363,
-    0,    0,  363,  363,  363,  363,  363,  363,  363,    0,
-    0,  363,  363,  363,    0,    0,    0,    0,  363,  363,
-    0,    0,    0,  363,  363,    0,  365,    0,    0,    0,
-    0,    0,    0,  363,    0,    0,  365,  363,  363,    0,
-    0,    0,  363,    0,    0,    0,    0,    0,  363,    0,
-  363,  363,    0,  363,    0,  363,  363,  363,  363,  363,
-    0,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-  363,  363,  363,  363,  363,  363,  363,    0,    0,  363,
-  363,  363,    0,  363,  363,  363,    0,  363,  363,  363,
-    0,    0,  363,    0,  363,    0,    0,  363,  363,  363,
-  363,    0,    0,  363,  363,  363,    0,    0,    0,    0,
-    0,  363,    0,    0,  363,  363,  363,  363,  363,  363,
-  363,  363,    0,  363,  363,  363,  363,  363,    0,  473,
-  363,    0,    0,    0,    0,    0,    0,  363,  363,  363,
-    0,    0,    0,    0,    0,    0,  363,  363,  473,    0,
-  473,    0,    0,  473,  473,  473,  473,  473,  473,  473,
-    0,    0,  473,  473,  473,    0,    0,    0,    0,  473,
-  473,    0,    0,    0,  473,  473,    0,  409,    0,    0,
-    0,    0,    0,    0,  473,    0,    0,  409,  473,  473,
-    0,    0,    0,  473,    0,    0,    0,    0,    0,  473,
-    0,  473,  473,    0,  473,    0,  473,  473,  473,  473,
-  473,    0,  473,  473,  473,  473,  473,  473,  473,  473,
-  473,  473,  473,  473,  473,  473,  473,  473,    0,    0,
-  473,  473,  473,    0,  473,  473,  473,    0,  473,  473,
-  473,    0,    0,  473,    0,  473,    0,    0,  473,  473,
-  473,  473,    0,    0,  473,  473,  473,    0,    0,    0,
-    0,    0,  473,    0,    0,  473,  473,  473,  473,  473,
-  473,  473,  473,    0,  473,  473,  473,  473,  473,    0,
-    0,  473,  365,    0,    0,    0,    0,    0,  473,  473,
-  473,    0,    0,    0,    0,    0,    0,  473,  473,    0,
-    0,  365,    0,  365,    0,    0,  365,  365,  365,  365,
-  365,  365,  365,    0,    0,  365,  365,  365,    0,    0,
-    0,    0,  365,  365,    0,    0,    0,  365,  365,    0,
-  549,    0,    0,    0,    0,    0,    0,  365,    0,    0,
-  549,  365,  365,    0,    0,    0,  365,    0,    0,    0,
-    0,    0,  365,    0,  365,  365,    0,  365,    0,  365,
-  365,  365,  365,  365,    0,  365,  365,  365,  365,  365,
-  365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-  365,    0,    0,  365,  365,  365,    0,  365,  365,  365,
-    0,  365,  365,  365,    0,    0,  365,    0,  365,    0,
-    0,  365,  365,  365,  365,    0,    0,  365,  365,  365,
-    0,    0,    0,    0,    0,  365,    0,    0,  365,  365,
-  365,  365,  365,  365,  365,  365,    0,  365,  365,  365,
-  365,  365,    0,  409,  365,    0,    0,    0,    0,    0,
-    0,  365,  365,  365,    0,    0,    0,    0,    0,    0,
-  365,  365,  409,    0,  409,    0,    0,  409,  409,  409,
-  409,  409,  409,  409,    0,    0,  409,  409,  409,    0,
-    0,    0,    0,  409,  409,    0,    0,    0,  409,  409,
-    0,  410,    0,    0,    0,    0,    0,    0,  409,    0,
-    0,  410,  409,  409,    0,    0,    0,  409,    0,    0,
-    0,    0,    0,  409,    0,  409,  409,    0,  409,    0,
-  409,  409,  409,  409,  409,    0,  409,  409,  409,  409,
-  409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
-  409,  409,    0,    0,  409,  409,  409,    0,  409,  409,
-  409,    0,  409,  409,  409,    0,    0,  409,    0,  409,
-    0,    0,  409,  409,  409,  409,    0,    0,  409,  409,
-  409,    0,    0,    0,    0,    0,  409,    0,    0,  409,
-  409,  409,  409,  409,  409,  409,  409,    0,  409,  409,
-  409,  409,  409,    0,    0,  409,  549,    0,    0,    0,
-    0,    0,  409,  409,  409,    0,    0,    0,    0,    0,
-    0,  409,  409,    0,    0,  549,    0,  549,    0,    0,
-  549,  549,  549,  549,  549,  549,  549,    0,    0,  549,
-  549,  549,    0,    0,    0,    0,  549,  549,    0,    0,
-    0,  549,  549,    0,  415,    0,    0,    0,    0,    0,
-    0,  549,    0,    0,  415,  549,  549,    0,    0,    0,
-  549,    0,    0,    0,    0,    0,  549,    0,  549,  549,
-    0,  549,    0,  549,  549,  549,  549,  549,    0,  549,
-  549,  549,  549,  549,  549,  549,  549,  549,  549,  549,
-  549,  549,  549,  549,  549,    0,    0,  549,  549,  549,
-    0,  549,  549,  549,    0,  549,  549,  549,    0,    0,
-  549,    0,  549,    0,    0,  549,  549,  549,  549,    0,
-    0,  549,  549,  549,    0,    0,    0,    0,    0,  549,
-    0,    0,  549,  549,  549,  549,  549,  549,  549,  549,
-    0,  549,  549,  549,  549,  549,    0,  410,  549,    0,
-    0,    0,    0,    0,    0,  549,  549,  549,    0,    0,
-    0,    0,    0,    0,  549,  549,  410,    0,  410,    0,
-    0,  410,  410,  410,  410,  410,  410,  410,    0,    0,
-  410,  410,  410,    0,    0,    0,    0,  410,  410,    0,
-    0,    0,  410,  410,    4,    0,    0,    0,    0,    0,
-    0,    0,  410,    0,    4,    0,  410,  410,    0,    0,
-    0,  410,    0,    0,    0,    0,    0,  410,    0,  410,
-  410,    0,  410,    0,  410,  410,  410,  410,  410,    0,
-  410,  410,  410,  410,  410,  410,  410,  410,  410,  410,
-  410,  410,  410,  410,  410,  410,    0,    0,  410,  410,
-  410,    0,  410,  410,  410,    0,  410,  410,  410,    0,
-    0,  410,    0,  410,    0,    0,  410,  410,  410,  410,
-    0,    0,  410,  410,  410,    0,    0,    0,    0,    0,
-  410,    0,    0,  410,  410,  410,  410,  410,  410,  410,
-  410,    0,  410,  410,  410,  410,  410,    0,    0,  410,
-  415,    0,    0,    0,    0,    0,  410,  410,  410,    0,
-    0,    0,    0,    0,    0,  410,  410,    0,    0,  415,
-    0,  415,    0,    0,  415,  415,  415,  415,  415,  415,
-  415,    0,    0,  415,  415,  415,    0,    0,    0,    0,
-  415,  415,    0,    0,    0,  415,  415,  411,    0,    0,
-    0,    0,    0,    0,    0,  415,    0,  411,    0,  415,
-  415,    0,    0,    0,  415,    0,    0,    0,    0,    0,
-  415,    0,  415,  415,    0,  415,    0,  415,  415,  415,
-  415,  415,    0,  415,  415,  415,  415,  415,  415,  415,
-  415,  415,  415,  415,  415,  415,  415,  415,  415,    0,
-    0,  415,  415,  415,    0,  415,  415,  415,    0,  415,
-  415,  415,    0,    0,  415,    0,  415,    0,    0,  415,
-  415,  415,  415,    0,    0,  415,  415,  415,    0,    0,
-    0,    0,    0,  415,    0,    0,  415,  415,  415,  415,
-  415,  415,  415,  415,    0,  415,  415,  415,  415,  415,
-    4,    0,  415,    0,    0,    0,    0,    0,    0,  415,
-  415,    0,    0,    0,    0,    0,    0,    0,  415,  415,
-    0,    4,    0,    0,    4,    4,    4,    4,    4,    4,
-    4,    0,    0,    4,    4,    4,    0,    0,    0,    0,
-    4,    4,    0,    0,    0,    4,    4,    0,  408,    0,
-    0,    0,    0,    0,    0,    4,    0,    0,  408,    4,
-    4,    0,    0,    0,    4,    0,    0,    0,    0,    0,
-    4,    0,    4,    4,    0,    4,    0,    4,    4,    4,
-    4,    4,    0,    4,    4,    4,    4,    4,    4,    4,
-    4,    4,    4,    4,    4,    4,    4,    4,    4,    0,
-    0,    4,    4,    4,    0,    4,    4,    4,    0,    4,
-    4,    4,    0,    0,    4,    0,    4,    0,    0,    4,
-    4,    4,    4,    0,    0,    4,    4,    4,    0,    0,
-    0,    0,    0,    4,    0,    0,    4,    4,    4,    4,
-    4,    4,    4,    4,    0,    4,    4,    4,    4,    4,
-    0,    0,    4,  411,    0,    0,    0,    0,    0,    4,
-    4,    4,    0,    0,    0,    0,    0,    0,    4,    4,
-    0,    0,  411,    0,  411,    0,    0,  411,  411,  411,
-  411,  411,  411,  411,    0,    0,  411,  411,  411,    0,
-    0,    0,    0,  411,  411,    0,    0,    0,  411,  411,
-    0,  354,    0,    0,    0,    0,    0,    0,  411,    0,
-    0,  354,  411,  411,    0,    0,    0,  411,    0,    0,
-    0,    0,    0,  411,    0,  411,  411,    0,  411,    0,
-  411,  411,  411,  411,  411,    0,  411,  411,  411,  411,
-  411,  411,  411,  411,  411,  411,  411,  411,  411,  411,
-  411,  411,    0,    0,  411,  411,  411,    0,  411,  411,
-  411,    0,  411,  411,  411,    0,    0,  411,    0,  411,
-    0,    0,  411,  411,  411,  411,    0,    0,  411,  411,
-  411,    0,    0,    0,    0,    0,  411,    0,    0,  411,
-  411,  411,  411,  411,  411,  411,  411,    0,  411,  411,
-  411,  411,  411,    0,  408,  411,    0,    0,    0,    0,
-    0,    0,  411,  411,  411,    0,    0,    0,    0,    0,
-    0,    0,  411,  408,    0,  408,    0,    0,  408,  408,
-  408,  408,  408,  408,  408,    0,    0,  408,  408,  408,
-    0,    0,    0,    0,  408,  408,    0,    0,    0,  408,
-  408,    0,  455,    0,    0,    0,    0,    0,    0,  408,
-    0,    0,  455,  408,  408,    0,    0,    0,  408,    0,
-    0,    0,    0,    0,  408,    0,  408,  408,    0,  408,
-    0,  408,  408,  408,  408,  408,    0,  408,  408,  408,
-  408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
-  408,  408,  408,    0,    0,  408,  408,  408,    0,  408,
-  408,  408,    0,  408,  408,  408,    0,    0,  408,    0,
-  408,    0,    0,  408,  408,  408,  408,    0,    0,  408,
-  408,  408,    0,    0,    0,    0,    0,  408,    0,    0,
-  408,  408,  408,  408,  408,  408,  408,  408,    0,  408,
-  408,  408,  408,  408,    0,    0,  408,  354,    0,    0,
-    0,    0,    0,  408,  408,    0,    0,    0,    0,    0,
-    0,    0,  408,  408,    0,    0,  354,    0,  354,    0,
-    0,  354,  354,  354,  354,  354,  354,  354,    0,    0,
-  354,  354,  354,    0,    0,    0,    0,  354,  354,    0,
-    0,    0,  354,  354,    0,   24,    0,    0,    0,    0,
-    0,    0,  354,    0,    0,   24,  354,  354,    0,    0,
-    0,  354,    0,    0,    0,    0,    0,  354,    0,  354,
-  354,    0,  354,    0,  354,  354,  354,  354,  354,    0,
-  354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
-  354,  354,  354,  354,  354,  354,    0,    0,  354,  354,
-  354,    0,  354,  354,  354,    0,  354,  354,  354,    0,
-    0,  354,    0,  354,    0,    0,  354,  354,  354,  354,
-    0,    0,  354,  354,  354,    0,    0,    0,    0,    0,
-  354,    0,    0,  354,  354,  354,  354,    0,  354,  354,
-  354,    0,  354,  354,  354,  354,  354,    0,  455,  354,
-    0,    0,    0,    0,    0,    0,  354,  354,    0,    0,
-    0,    0,    0,    0,    0,    0,  354,  455,    0,  455,
-    0,    0,  455,  455,  455,  455,  455,  455,  455,    0,
-    0,  455,  455,  455,    0,    0,    0,    0,  455,  455,
-    0,    0,    0,  455,  455,    0,    0,    0,    0,    0,
-    0,    0,    0,  455,    0,    0,    0,  455,  455,    0,
-    0,    0,  455,    0,    0,    0,    0,    0,  455,    0,
-  455,  455,    0,  455,    0,  455,  455,  455,  455,  455,
-    0,  455,  455,  455,  455,  455,  455,  455,  455,  455,
-  455,  455,  455,  455,  455,  455,  455,    0,    0,  455,
-  455,  455,    0,  455,  455,  455,    0,  455,  455,  455,
-    0,    0,  455,    0,  455,    0,    0,  455,  455,  455,
-  455,    0,    0,  455,  455,  455,    0,  188,    0,  540,
-  150,  455,  151,    0,  455,  455,  455,  455,    0,  455,
-  455,  455,    0,  455,  455,  455,  455,  455,  545,    0,
-  455,   24,    0,    0,    0,    0,    0,  455,  455,    0,
-    0,    0,    0,    0,    0,    0,    0,  455,    0,    0,
-   24,    0,   24,    0,    0,   24,   24,   24,   24,   24,
-   24,   24,    0,    0,   24,   24,   24,    0,    0,    0,
-    0,   24,   24,    0,    0,    0,   24,   24,    0,  638,
-  417,  415,    0,  416,    0,    0,   24,    0,    0,    0,
-   24,   24,    0,    0,    0,   24,  901,    0,  420,  403,
-  421,   24,    0,   24,   24,    0,   24,    0,   24,   24,
-   24,   24,   24,    0,   24,   24,   24,   24,   24,   24,
-   24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
-    0,    0,   24,   24,   24,    0,   24,   24,   24,    0,
-   24,   24,   24,    0,    0,   24,    0,   24,    0,    0,
-   24,   24,   24,   24,    0,    0,   24,   24,   24,    0,
-  188,    0,  540,  150,   24,  151,    0,   24,   24,   24,
-   24,   24,   24,   24,   24,    0,   24,   24,   24,   24,
-   24,  734,    0,   24,    0,    0,    0,    0,    0,    0,
-   24,   24,   24,    0,    0,    0,    0,    0,    0,   24,
-    0,    0,    0,    0,    0,    0,    0,    0,  188,    0,
-    0,  150,    0,  151,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  644,
-  149,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  177,  188,    0,    0,
-  150,    0,  151,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,  666,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,  149,   89,    0,    0,    0,    0,    0,
-    0,  187,    0,    0,    0,  188,    0,    0,  150,    0,
-  151,    0,    0,    0,    0,    0,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,  668,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,  149,  165,  166,  167,    0,    0,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,    0,  176,    0,    0,
-    0,    0,    0,    0,    0,  152,  153,    0,    0,    0,
-  154,  155,  156,  157,    0,    0,    0,    0,    0,    0,
-    0,    0,  158,  159,  160,  161,  162,  163,  164,    0,
-  165,  166,  167,    0,    0,  168,  169,  170,    0,  171,
-  172,  173,  174,  175,    0,  176,    0,    0,    0,  177,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,    0,    0,    0,  180,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,    0,  188,   89,  706,  150,
-    0,  151,    0,    0,  187,    0,    0,  177,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  178,  179,
-    0,    0,    0,    0,  180,    0,    0,    0,    0,    0,
-  149,    0,    0,    0,  181,  182,    0,    0,  183,  184,
-  185,  186,    0,    0,  188,   89,  540,  150,    0,  151,
-    0,    0,  187,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,  149,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,    0,  176,    0,    0,    0,  177,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,  188,    0,   89,  150,    0,  151,    0,    0,
-    0,  187,    0,    0,  177,    0,    0,    0,    0,    0,
-  813,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,    0,  149,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,  188,    0,    0,  150,  187,
-  151,    0,    0,  152,  153,    0,    0,    0,  154,  155,
-  156,  157,    0,  898,    0,    0,    0,    0,    0,    0,
-  158,  159,  160,  161,  162,  163,  164,  149,  165,  166,
-  167,    0,    0,  168,  169,  170,    0,  171,  172,  173,
-  174,  175,    0,  176,    0,    0,    0,    0,    0,    0,
-    0,  152,  153,    0,    0,    0,  154,  155,  156,  157,
-    0,    0,    0,    0,    0,    0,    0,    0,  158,  159,
-  160,  161,  162,  163,  164,    0,  165,  166,  167,    0,
-    0,  168,  169,  170,    0,  171,  172,  173,  174,  175,
-    0,  176,    0,    0,    0,  177,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  178,  179,    0,    0,
-    0,    0,  180,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  181,  182,    0,    0,  183,  184,  185,  186,
-    0,    0,    0,   89,  188,    0,  709,  150,    0,  151,
-  187,    0,    0,  177,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,    0,    0,
-  180,    0,    0,    0,    0,  149,    0,    0,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,    0,
-    0,   89,  188,    0,  951,  150,    0,  151,  187,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,    0,    0,    0,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  177,  176,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,  188,    0,   89,
-  150,    0,  151,    0,    0,    0,  187,    0,    0,    0,
-    0,    0,    0,    0,  177,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,  149,    0,    0,
-    0,  181,  182,    0,    0,  183,  184,  185,  186,    0,
-  382,    0,   89,  150,    0,  151,    0,    0,    0,  187,
-    0,  152,  153,    0,    0,    0,  154,  155,  156,  157,
-    0,    0,    0,    0,    0,    0,    0,    0,  158,  159,
-  160,  161,  162,  163,  164,  149,  165,  166,  167,    0,
-    0,  168,  169,  170,    0,  171,  172,  173,  174,  175,
-    0,  176,    0,    0,    0,    0,    0,    0,    0,  152,
-  153,    0,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,    0,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,  177,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,    0,    0,
-  180,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,  188,
-    0,   89,  150,    0,  151,    0,    0,    0,  187,    0,
-    0,  177,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,    0,  180,    0,
-  149,    0,    0,    0,    0,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,    0,  507,    0,   89,
-  150,    0,  151,    0,  152,  153,  187,    0,    0,  154,
-  155,  156,  157,    0,    0,    0,    0,    0,    0,    0,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,  149,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  152,  153,    0,
-    0,    0,  154,  155,  156,  157,    0,    0,    0,    0,
-    0,    0,    0,    0,  158,  159,  160,  161,  162,  163,
-  164,    0,  165,  166,  167,    0,    0,  168,  169,  170,
-    0,  171,  172,  173,  174,  175,  177,  176,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,  382,    0,   89,  150,    0,  151,    0,    0,
-    0,  187,    0,    0,    0,    0,    0,    0,    0,  177,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  178,  179,    0,    0,    0,    0,  180,    0,    0,    0,
-    0,    0,  149,    0,    0,    0,  181,  182,    0,    0,
-  183,  184,  185,  186,    0,  908,    0,   89,  150,    0,
-  151,    0,    0,    0,  187,    0,  152,  153,    0,    0,
-    0,  154,  155,  156,  157,    0,    0,    0,    0,    0,
-    0,    0,    0,  158,  159,  160,  161,  162,  163,  164,
-  149,  165,  166,  167,    0,    0,  168,  169,  170,    0,
-  171,  172,  173,  174,  175,    0,  176,    0,    0,    0,
-    0,    0,    0,    0,  152,  153,    0,    0,    0,  154,
-  155,  156,  157,    0,  567,    0,  564,  333,    0,  334,
-    0,  158,  159,  160,  161,  162,  163,  164,    0,  165,
-  166,  167,    0,    0,  168,  169,  170,    0,  171,  172,
-  173,  174,  175,    0,  176,    0,    0,    0,  177,    0,
-  341,    0,  335,  333,    0,  334,    0,    0,    0,  178,
-  179,    0,    0,    0,    0,  180,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  181,  182,    0,    0,  183,
-  184,  185,  186,    0,    0,    0,   89,    0,    0,    0,
-    0,    0,    0,  445,    0,    0,  177,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  178,  179,    0,
-    0,    0,    0,  180,    0,  149,  247,  247,  247,    0,
-  247,    0,    0,  181,  182,    0,    0,  183,  184,  185,
-  186,    0,    0,  247,   89,  247,  247,  247,    0,  152,
-  153,  187,    0,    0,  154,  155,  156,  157,    0,    0,
-    0,    0,    0,    0,    0,    0,  158,  159,  160,  161,
-  162,  163,  164,    0,  165,  166,  167,    0,  149,  168,
-  169,  170,    0,  171,  172,  173,  174,  175,    0,  176,
-    0,    0,    0,    0,    0,    0,    0,  518,  518,  518,
-  518,  518,  152,  153,    0,    0,    0,  154,  155,  156,
-  157,    0,    0,    0,    0,    0,  518,  518,  518,  158,
-  159,  160,  161,  162,  163,  164,    0,  165,  166,  167,
-    0,    0,  168,  169,  170,    0,  171,  172,  173,  174,
-  175,  177,  176,  437,  417,  415,    0,  416,    0,    0,
-    0,    0,  178,  179,    0,    0,    0,  565,  180,    0,
-    0,    0,  420,  403,  421,    0,    0,    0,  181,  182,
-    0,    0,  183,  184,  185,  186,  601,  417,  415,  892,
-  416,    0,  336,  337,  338,    0,  187,  339,    0,    0,
-    0,    0,    0,    0,  177,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,  178,  179,    0,    0,    0,
-    0,  180,    0,    0,    0,    0,    0,    0,  336,  337,
-  338,  181,  182,  339,    0,  183,  184,  185,  186,    0,
-    0,    0,   89,    0,    0,    0,    0,    0,    0,  187,
-    0,    0,    0,  247,  247,  247,  247,  247,    0,  247,
-  247,  247,  247,  247,  247,    0,    0,  247,  247,  608,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  178,  179,    0,    0,  420,  403,
-  421,    0,    0,  622,  417,  415,    0,  416,    0,    0,
-  181,  182,    0,    0,  183,  184,  185,  186,    0,    0,
-    0,  566,  420,  403,  421,    0,    0,    0,  187,    0,
-  178,  179,    0,    0,  518,  518,  518,  518,  518,    0,
-  518,  518,  518,  518,  518,  518,  181,  182,  518,  518,
-  183,  184,  185,  186,  638,  417,  415,  340,  416,    0,
-    0,    0,    0,    0,  187,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  672,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,  677,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,  679,  417,  415,    0,  416,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  420,  403,  421,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,  781,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  782,  417,  415,
-    0,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,  783,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,  784,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,  785,  417,
-  415,    0,  416,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,  420,  403,  421,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  786,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,  787,  417,  415,    0,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  788,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,  789,  417,  415,    0,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,    0,
-    0,    0,    0,    0,    0,  404,  405,  406,  407,  408,
-    0,  409,  410,  411,  412,  413,  414,    0,    0,  418,
-  419,  790,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,  791,  417,  415,    0,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  792,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,  793,
-  417,  415,    0,  416,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  420,  403,
-  421,  802,  417,  415,    0,  416,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  420,  403,  421,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  862,  417,  415,    0,  416,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  420,  403,  421,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  904,  417,  415,
-    0,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,  247,
-  247,  247,    0,  247,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,  247,  247,
-  247,  417,  415,  680,  416,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  420,
-  403,  421,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  404,  405,  406,  407,
-  408,    0,  409,  410,  411,  412,  413,  414,    0,    0,
-  418,  419,    0,    0,    0,    0,    0,    0,  404,  405,
-  406,  407,  408,    0,  409,  410,  411,  412,  413,  414,
-    0,    0,  418,  419,  417,  415,  933,  416,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  420,  403,  421,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  404,  405,  406,  407,  408,    0,  409,  410,  411,
-  412,  413,  414,    0,    0,  418,  419,  417,  415,  969,
-  416,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,  420,  403,  421,  417,  415,
-  970,  416,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,  420,  403,  421,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,  247,  247,  247,  247,
-  247,    0,  247,  247,  247,  247,  247,  247,    0,    0,
-  247,  247,    0,    0,    0,    0,    0,  404,  405,  406,
-  407,  408,    0,  409,  410,  411,  412,  413,  414,    0,
-    0,  418,  419,  417,  415,  975,  416,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,  420,  403,  421,  247,  247,  247,  247,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,  247,  247,  247,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-  404,  405,  406,  407,  408,    0,  409,  410,  411,  412,
-  413,  414,    0,    0,  418,  419,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,  404,  405,  406,  407,  408,    0,  409,
-  410,  411,  412,  413,  414,    0,    0,  418,  419,    0,
-    0,    0,    0,    0,  404,  405,  406,  407,  408,    0,
-  409,  410,  411,  412,  413,  414,    0,    0,  418,  419,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  404,
-  405,  406,  407,  408,    0,  409,  410,  411,  412,  413,
-  414,    0,    0,  418,  419,    0,    0,    0,    0,    0,
-  247,  247,  247,  247,  247,    0,  247,  247,  247,  247,
-  247,  247,    0,   16,  247,  247,   17,    0,   18,   19,
-    0,    0,   20,    0,    0,   21,   22,   23,    0,    0,
-    0,    0,   24,   25,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,   26,    0,    0,
-    0,   27,   28,    0,    0,    0,   29,    0,    0,    0,
-    0,    0,   30,    0,   31,   32,    0,   33,    0,   34,
-   35,   36,   37,   38,    0,   39,   40,   41,   42,   43,
-   44,   45,   46,   47,   48,   49,   50,   51,   52,   53,
-   54,    0,    0,   55,   56,   57,    0,   58,   59,   60,
-    0,   61,   62,   63,    0,    0,   64,    0,   65,    0,
-    0,   66,   67,   68,   69,    0,    0,   70,   71,   72,
-    0,    0,    0,    0,    0,   73,    0,    0,    0,   74,
-   75,   76,   77,   78,   79,   80,    0,   81,   82,   83,
-   84,   85,    0,    0,   86,    0,    0,    0,    0,    0,
-    0,   87,   88,   89,    0,    0,    0,    0,    0,    0,
-   90,
+
+static const yytype_int16 yycheck[] =
+{
+      27,   233,    29,   179,   202,   287,    33,    36,   298,    36,
+     275,   383,   290,   141,   279,    42,   179,   416,   500,   580,
+     721,    22,   583,    18,    35,   179,     3,   309,   344,   233,
+     451,     3,     5,    23,   238,    47,   190,   238,     3,    23,
+      23,     4,     4,    23,    25,     3,   578,   734,   580,    60,
+      61,   583,    23,   328,   141,     3,    21,    22,    23,    71,
+      72,     3,     4,   338,    31,   104,   176,    79,     3,   179,
+     764,   346,   123,     3,   113,   124,   169,     3,   158,     3,
+     160,     3,   236,   490,    24,   106,   137,   108,   169,     3,
+       3,   112,     3,     3,   187,     3,     3,     3,   179,    20,
+      98,     3,   100,    24,   131,   233,     3,     3,     3,   138,
+     238,   138,     3,   125,     3,   127,   128,   125,   177,     3,
+     127,   528,   169,   150,   151,   179,    20,    21,    22,    23,
+      24,    25,   159,    80,    81,   189,    21,    22,    23,     3,
+     187,     3,    23,    24,    25,   169,   173,   429,     3,     4,
+     169,   577,   179,   126,   802,   803,    20,   176,    20,   585,
+      24,   169,    24,   190,    23,   866,   342,   194,     4,    20,
+      20,   347,   495,    24,    24,     3,   179,   500,   205,    20,
+      35,   868,   179,    24,   347,   212,   169,   179,   180,   169,
+     884,    13,    20,   347,   221,   179,    24,   180,   188,   226,
+     328,   179,   169,   180,   185,   186,    27,   383,   179,   236,
+     338,   189,   169,   262,   342,   187,   189,   169,   346,   246,
+     383,   922,   180,   188,   187,   187,   508,   509,   179,   383,
+     762,   763,   180,   765,   516,   179,   884,   276,   180,   179,
+      62,   328,   532,   282,   169,   180,   257,   286,   169,   539,
+     180,   338,   273,   569,   180,   342,   180,    33,   180,   346,
+     576,   633,   263,   635,   636,   547,   180,   180,   266,   180,
+     180,   298,   180,   180,   180,   302,   592,   304,   180,   359,
+     360,    21,    22,   180,   180,   180,   180,   415,   158,   180,
+     565,   180,   319,   320,   295,   316,   180,   324,   378,   379,
+     380,   381,   382,   188,   185,   186,   333,   334,   335,   336,
+     169,   391,   587,   588,   589,   590,   591,   312,   169,   169,
+     347,   180,   144,   176,   885,   179,   179,   179,    20,    21,
+      22,    23,    24,    25,   361,   179,     3,   179,   365,   366,
+     367,   368,   369,   370,   371,   372,   373,   374,   375,   376,
+     179,   772,   773,   885,   169,   169,   383,    24,   840,     3,
+       4,   176,   594,     3,   179,   847,     3,   394,   395,   396,
+     397,   398,   399,   400,   401,   402,   403,   404,   405,   406,
+     407,   408,   409,   410,   411,   412,   158,   209,   542,   416,
+     594,   595,   219,    23,   595,   141,   142,   424,   425,     4,
+     169,   577,   138,   139,   140,   937,   176,   179,     3,   585,
+     169,   233,   179,   240,   236,   179,   238,   239,   817,    23,
+      24,    25,   244,    20,    21,    22,    23,    24,    25,   801,
+     802,   803,   179,   189,   750,   179,   179,   565,   260,   841,
+     842,   843,   844,   733,   722,   179,   179,   712,   730,   577,
+     179,   767,   768,   769,   770,   771,   179,   585,   280,   587,
+     588,   589,   590,   591,   746,   492,   594,   595,   179,   496,
+     633,   179,   635,   636,    29,   487,   503,   179,   565,   683,
+     755,   502,   683,   179,   688,   639,   507,   688,   180,   510,
+     577,   179,   179,   179,   179,   317,   179,   179,   585,   321,
+     587,   588,   589,   590,   591,   532,   328,   179,   179,   179,
+     179,   538,   539,   179,   179,   542,   338,   840,   841,   842,
+     843,   844,   179,   179,   847,    80,    81,    82,   169,   142,
+     143,   169,     3,    20,    21,    22,    23,    24,    25,   566,
+       4,   169,   169,   825,     3,   158,   159,     3,   575,   162,
+     163,   164,   165,     5,   109,   683,   111,   112,   113,   169,
+     688,   116,   117,   176,   119,   120,     3,   883,    21,    22,
+      23,    24,    25,   602,     3,   602,   603,   169,   179,   169,
+     870,   169,   169,   865,   180,     4,     3,   176,   764,     3,
+     176,     3,     5,   132,   876,   179,   179,    30,     3,   753,
+      20,    21,    22,    23,    24,    25,   633,     3,   635,   636,
+       3,     3,   639,   640,   189,     3,   180,   180,   705,     3,
+       3,    24,   179,   169,   169,   823,   169,   755,   179,   169,
+     657,   658,   180,     3,     5,   662,   764,   664,   801,   802,
+     803,   668,   180,   176,   180,     3,     3,   801,    25,   881,
+     179,     3,     3,     3,   681,   682,     4,   180,   180,   169,
+      84,   180,   180,    24,    24,   179,     4,   694,   755,   696,
+      24,   169,   180,   169,    23,   180,     4,   764,   126,     5,
+       3,     7,     8,     9,    10,    11,   713,    13,    14,    15,
+      16,    17,    18,   180,   180,    21,    22,    23,    24,    25,
+      20,     3,     5,   180,   169,   180,   733,   169,   884,     5,
+     180,   180,   180,   180,   180,     3,   188,   180,   745,    24,
+       5,     3,   749,   180,   126,     3,   753,     5,     5,     7,
+       8,     9,    10,    11,   180,    13,    14,    15,    16,    17,
+      18,   169,   169,    21,    22,    23,    24,    25,     4,     5,
+      10,     7,     8,     9,    10,    11,   884,    13,    14,    15,
+      16,    17,    18,   260,   918,    21,    22,    23,    24,    25,
+      14,   776,   594,   595,   801,   802,   803,   692,   774,   430,
+     696,   499,   512,   538,   269,   494,    77,   529,   305,   726,
+     817,   818,   853,   851,     3,   418,     5,   884,     7,     8,
+       9,    10,    11,   682,    13,    14,    15,    16,    17,    18,
+     902,   954,    21,    22,    23,    24,    25,   753,   874,   958,
+     144,   556,   749,   755,   851,   141,   853,   347,   855,   383,
+     558,   594,    -1,   595,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   870,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   674,    -1,    -1,    -1,    -1,    -1,    -1,   185,
+     186,   683,    -1,   189,    -1,    -1,   688,    -1,   690,    -1,
+      -1,    -1,   899,    -1,   901,   902,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   918,    -1,    -1,    -1,    -1,    -1,   719,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   932,    -1,   185,   186,    -1,
+      -1,    -1,    -1,    -1,   941,    -1,    -1,    -1,    -1,    -1,
+     947,     0,     1,   950,   180,    -1,    -1,    -1,    -1,   185,
+     186,    -1,    -1,   755,    -1,    -1,   963,    -1,    -1,    -1,
+     967,    -1,    -1,   970,   971,    -1,    -1,    -1,    27,   976,
+      29,    -1,    -1,    32,    33,    34,    35,    36,    37,    38,
+      -1,    -1,    41,    42,    43,    -1,    -1,    -1,    -1,    48,
+      49,    -1,    -1,    -1,    53,    54,   185,   186,    -1,    -1,
+      -1,    -1,    -1,    -1,    63,    -1,    -1,    -1,    67,    68,
+      -1,    -1,    -1,    72,    -1,    -1,    -1,    -1,    -1,    78,
+      -1,    80,    81,    -1,    83,    -1,    85,    86,    87,    88,
+      89,    -1,    91,    92,    93,    94,    95,    96,    97,    98,
+      99,   100,   101,   102,   103,   104,   105,   106,    -1,    -1,
+     109,   110,   111,    -1,   113,   114,   115,    -1,   117,   118,
+     119,    -1,    -1,   122,    -1,   124,    -1,    -1,   127,   128,
+     129,   130,    -1,    -1,   133,   134,   135,    -1,    -1,   881,
+      -1,    -1,   141,    -1,    -1,   144,   145,   146,   147,   148,
+     149,   150,   151,    -1,   153,   154,   155,   156,   157,    -1,
+      -1,   160,    -1,    -1,    -1,   907,    -1,    -1,   167,   168,
+     169,    -1,    -1,    -1,    -1,    -1,    -1,   176,   177,     3,
+      -1,     5,    -1,     7,     8,     9,    10,    11,   187,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    39,    40,    -1,    -1,    -1,
+      44,    45,    46,    47,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    56,    57,    58,    59,    60,    61,    62,    -1,
+      64,    65,    66,    -1,    -1,    69,    70,    71,    -1,    73,
+      74,    75,    76,    77,     3,    79,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,     3,    -1,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   142,   143,
+      -1,    -1,    -1,    -1,   148,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,
+     164,   165,    -1,    -1,    -1,   169,    -1,    -1,    -1,    -1,
+      -1,    -1,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,
+      -1,   185,   186,     3,    -1,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,     3,    -1,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     4,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,    -1,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
+      -1,    -1,    -1,    -1,     4,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,   185,
+     186,    21,    22,    23,    24,    25,     4,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     4,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,   185,   186,    21,    22,    23,
+      24,    25,    -1,    -1,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,   185,   186,
+      21,    22,    23,    24,    25,    -1,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+     185,   186,    21,    22,    23,    24,    25,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,
+      -1,    -1,    -1,     5,    -1,     7,     8,     9,    10,    11,
+      -1,    13,    14,    15,    16,    17,    18,   185,   186,    21,
+      22,    23,    24,    25,    -1,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,   185,
+     186,    21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,
+     185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,
+      -1,    -1,    -1,   185,   186,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     5,
+      -1,     7,     8,     9,    10,    11,    -1,    13,    14,    15,
+      16,    17,    18,    -1,    -1,    21,    22,    23,    24,    25,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,
+     186,     5,    -1,     7,     8,     9,    10,    11,    -1,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,     5,    -1,     7,     8,     9,    10,    11,    -1,
+      13,    14,    15,    16,    17,    18,    -1,    -1,    21,    22,
+      23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,
+      -1,    -1,   169,    -1,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,   185,   186,
+      21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,
+     186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,
+     185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,     5,    -1,     7,     8,     9,    10,    11,
+      -1,    13,    14,    15,    16,    17,    18,    -1,    -1,    21,
+      22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    -1,
+      -1,   185,   186,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,
+      -1,    -1,   185,   186,     5,    -1,     7,     8,     9,    10,
+      11,    -1,    13,    14,    15,    16,    17,    18,    -1,    -1,
+      21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,     5,    -1,     7,
+       8,     9,    10,    11,    -1,    13,    14,    15,    16,    17,
+      18,    -1,    -1,    21,    22,    23,    24,    25,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,    -1,
+      -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   180,
+      -1,    -1,    -1,    -1,   185,   186,     5,    -1,     7,     8,
+       9,    10,    11,    -1,    13,    14,    15,    16,    17,    18,
+      -1,    -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,
+       5,    -1,     7,     8,     9,    10,    11,    -1,    13,    14,
+      15,    16,    17,    18,    -1,    -1,    21,    22,    23,    24,
+      25,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+     180,    -1,    -1,    -1,    -1,   185,   186,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   180,    -1,    -1,    -1,    -1,   185,   186,     5,    -1,
+       7,     8,     9,    10,    11,    -1,    13,    14,    15,    16,
+      17,    18,    -1,    -1,    21,    22,    23,    24,    25,     9,
+      10,    11,    -1,    13,    14,    15,    16,    17,    18,    -1,
+      -1,    21,    22,    23,    24,    25,    -1,    -1,    -1,    -1,
+      -1,    -1,    11,     4,    13,    14,    15,    16,    17,    18,
+      -1,    12,    21,    22,    23,    24,    25,    -1,    -1,    -1,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   180,    -1,    -1,    39,    40,
+     185,   186,    -1,    44,    45,    46,    47,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    13,
+      14,    15,    16,    17,    18,    -1,    -1,    21,    22,    23,
+      24,    25,    -1,   180,    -1,    -1,    -1,    -1,   185,   186,
+      13,    14,    15,    16,    17,    18,    -1,    -1,    21,    22,
+      23,    24,    25,    -1,    -1,    -1,    -1,    -1,    -1,    21,
+      22,    23,    -1,    25,    -1,    -1,    -1,    -1,    -1,    -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   185,   186,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    50,    51,
+      52,    -1,    -1,    55,    -1,   185,   186,   158,   159,    -1,
+      12,   162,   163,   164,   165,    -1,    -1,    -1,   169,    21,
+      22,    -1,    -1,    -1,    -1,   176,   185,   186,   179,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,    40,    -1,
+      -1,    -1,    44,    45,    46,    47,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,    61,
+      62,    -1,    64,    65,    66,    -1,    -1,    69,    70,    71,
+      -1,    73,    74,    75,    76,    77,    -1,    79,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     142,   143,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   185,   186,    21,    22,    23,   158,   159,    -1,    -1,
+     162,   163,   164,   165,    -1,    -1,    -1,   169,    -1,    -1,
+      -1,    -1,   185,   186,   176,    -1,    -1,   179,    -1,   131,
+      -1,    -1,    50,    51,    52,    -1,    -1,    55,    -1,    -1,
+     142,   143,    -1,    -1,    -1,    -1,   148,     4,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,   158,   159,    -1,    -1,
+     162,   163,   164,   165,    21,    22,    -1,   169,    -1,    -1,
+      -1,    -1,    -1,    -1,   176,    -1,    -1,   179,    -1,    -1,
+      -1,    -1,    39,    40,    -1,   187,    -1,    44,    45,    46,
+      47,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,   142,   143,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    21,    22,    -1,    -1,    -1,    -1,    -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    50,    51,    52,    -1,    -1,    55,    -1,    -1,
+      -1,    -1,    -1,    -1,   131,     4,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   131,    -1,     5,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    40,
+      -1,    -1,    -1,    44,    45,    46,    47,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    -1,    74,    75,    76,    77,    -1,    79,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,     5,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      -1,    24,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,   169,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+       5,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,     5,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,     5,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   131,    -1,     5,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      23,    -1,    25,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    23,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    23,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    23,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      23,    -1,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    23,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    12,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    21,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      39,    40,   169,    -1,    -1,    44,    45,    46,    47,   176,
+      -1,    -1,   179,    -1,    -1,    -1,    -1,    56,    57,    58,
+      59,    60,    61,    62,    -1,    64,    65,    66,    -1,    -1,
+      69,    70,    71,    -1,    73,    74,    75,    76,    77,    -1,
+      79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,   131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    12,    -1,   142,   143,    -1,    -1,    -1,    -1,   148,
+      21,    22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,
+     159,    -1,    -1,   162,   163,   164,   165,    -1,    39,    40,
+     169,    -1,    -1,    44,    45,    46,    47,   176,    -1,    -1,
+     179,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
+      61,    62,    -1,    64,    65,    66,    -1,    -1,    69,    70,
+      71,    -1,    73,    74,    75,    76,    77,    -1,    79,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     131,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,
+      -1,   142,   143,    -1,    -1,    -1,    -1,   148,    21,    22,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   158,   159,    -1,
+      -1,   162,   163,   164,   165,    -1,    39,    40,   169,    -1,
+      -1,    44,    45,    46,    47,   176,    -1,    -1,   179,    -1,
+      -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
+      -1,    64,    65,    66,    -1,    -1,    69,    70,    71,    -1,
+      73,    74,    75,    76,    77,    -1,    79,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    12,    -1,   142,
+     143,    -1,    -1,    -1,    -1,   148,    21,    22,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   158,   159,    -1,    -1,   162,
+     163,   164,   165,    -1,    39,    40,   169,    -1,    -1,    44,
+      45,    46,    47,   176,    -1,    -1,   179,    -1,    -1,    -1,
+      -1,    56,    57,    58,    59,    60,    61,    62,    -1,    64,
+      65,    66,    -1,    -1,    69,    70,    71,    -1,    73,    74,
+      75,    76,    77,    -1,    79,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,    -1,    -1,   131,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    12,    -1,   142,   143,    -1,
+      -1,    -1,    -1,   148,    21,    22,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,   158,   159,    -1,    -1,   162,   163,   164,
+     165,    -1,    39,    40,   169,    -1,    -1,    44,    45,    46,
+      47,   176,    -1,    -1,   179,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   131,    29,    -1,    -1,    32,    33,
+      34,    35,    -1,    -1,    38,   142,   143,    41,    42,    43,
+      -1,   148,    -1,    -1,    48,    49,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    63,
+      -1,    -1,   169,    67,    68,    -1,    -1,    -1,    72,   176,
+      -1,    -1,   179,    -1,    78,    -1,    80,    81,    -1,    83,
+      -1,    85,    86,    87,    88,    89,    -1,    91,    92,    93,
+      94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
+     104,   105,   106,    -1,    -1,   109,   110,   111,    -1,   113,
+     114,   115,    -1,   117,   118,   119,    -1,    -1,   122,    -1,
+     124,    -1,    -1,   127,   128,   129,   130,    -1,    -1,   133,
+     134,   135,    -1,    -1,    -1,    -1,    -1,   141,    -1,    -1,
+      -1,   145,   146,   147,   148,   149,   150,   151,    -1,   153,
+     154,   155,   156,   157,    -1,    -1,   160,    -1,    -1,    -1,
+      -1,    39,    40,   167,   168,   169,    44,    45,    46,    47,
+      -1,    -1,   176,    -1,    -1,    -1,    -1,    -1,    56,    57,
+      58,    59,    60,    61,    62,    -1,    64,    65,    66,    -1,
+      -1,    69,    70,    71,    -1,    73,    74,    75,    76,    77,
+      -1,    79,    39,    40,    -1,    -1,    -1,    44,    45,    46,
+      47,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
+      57,    58,    59,    60,    61,    62,    -1,    64,    65,    66,
+      -1,    -1,    69,    70,    71,    -1,    73,    74,    75,    76,
+      77,    -1,    79,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,    -1,
+     148,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+     158,   159,    -1,    -1,   162,   163,   164,   165,    -1,    -1,
+      38,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176,    -1,
+      -1,   179,    -1,    -1,    -1,   142,   143,    -1,    -1,    -1,
+      -1,   148,    -1,    -1,    -1,    63,    -1,    -1,    -1,    -1,
+      -1,   158,   159,    -1,    -1,   162,   163,   164,   165,    -1,
+      78,    -1,   169,    -1,    -1,    83,    84,    -1,    -1,   176,
+      88,    89,   179,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      98,    99,   100,   101,   102,   103,   104,   105,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+     118,    -1,    -1,    -1,    -1,    -1,   124,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   133,    -1,   135,    -1,    -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+      -1,   169,    -1,    -1,    -1,    -1,    -1,    -1,   176
 };
-short fortrancheck[] = {                                      24,
-  231,   26,  140,  309,  194,   30,   33,  177,   33,  236,
-  231,  347,  290,  331,   39,  236,   19,   11,  296,  140,
-   44,  303,  394,  341,  177,   40,   40,   40,   44,   40,
-   40,  349,   44,  529,   10,  188,   10,   10,   10,  295,
-   42,  177,   58,   40,   68,   69,  302,   44,   41,   42,
-   41,   42,   76,  279,   44,  382,  449,   40,  581,   44,
-   37,   58,  585,  731,   41,   59,  106,   44,   58,   93,
-   94,   95,   42,   43,   44,   45,  765,   37,   44,   42,
-  111,  234,   58,   44,   61,  735,  143,   44,   37,  120,
-  121,   40,   58,  231,  373,   10,   32,   58,  236,   37,
-   10,   61,  504,   41,  417,  130,   44,   60,  135,   62,
-  135,  424,   61,  800,  801,  517,   10,  425,  217,  271,
-  272,   57,   58,  148,  149,   42,   43,  417,   45,   44,
-   10,   42,  157,  371,  128,   43,   44,   45,  417,  238,
-   41,   42,   43,   60,   45,   62,  171,  385,   58,   60,
-   40,   62,  177,  271,  272,   41,  104,   40,   44,  107,
-  271,  272,   44,  188,   58,   41,  417,  192,   44,  578,
-   44,  427,   58,   40,  344,   42,   58,  586,  203,  847,
-  350,  579,   58,  581,   58,  210,   40,  585,   43,   44,
-   45,  417,   40,  331,  219,  524,  885,  350,  885,  224,
-  529,   37,   40,  341,   41,   41,  344,   44,   44,  234,
-  331,  349,  382,  207,  350,  386,  387,  388,  868,  244,
-  341,   58,    0,  344,  281,   42,  328,  329,  349,  382,
-   47,  487,   10,  569,  490,  541,  276,  231,  417,  545,
-  234,  577,  236,  237,  912,  270,  382,   40,  242,  567,
-   42,   43,   41,   45,   40,   44,  512,  593,   58,  272,
-  272,  264,  293,  401,   40,  417,   42,  283,   40,   58,
-  588,  589,  590,  591,  592,   43,   41,   45,  534,   44,
-  283,  275,  307,   40,  309,  375,  283,  272,  319,  271,
-  272,   42,   43,  283,   45,   40,   41,  322,  323,  417,
-  271,  272,  272,  328,  298,  632,  417,  634,  635,  272,
-  273,  336,  337,  338,  339,  272,  417,  283,  549,  255,
-  273,   41,  283,  550,   44,  350,  320,   44,  549,  550,
-  324,   42,  280,  271,  272,  360,  156,   58,  158,  364,
-  365,  366,  367,  368,  369,  370,  371,  372,  373,  374,
-  375,  744,  745,  275,  507,  272,  273,  382,  140,  141,
-  856,  272,  273,  886,  272,  763,  764,  863,  766,  394,
-  271,  272,  273,   41,   42,   43,  256,   45,  403,  404,
-  405,  406,  407,  408,  409,  410,  411,  412,  413,  414,
-  415,  416,  417,  418,  419,  420,  421,  374,  423,  424,
-  406,  417,  417,  119,  284,  285,  122,  417,  578,  424,
-  424,  549,  550,  424,  374,  417,  586,  272,  281,  755,
-  417,  301,  302,  406,  417,  374,  417,  417,  734,  567,
-   44,   44,  768,  769,  770,  771,  772,  719,  756,  811,
-  578,  417,  720,  417,  417,  417,  567,   44,  586,  705,
-  588,  589,  590,  591,  592,  682,  417,  578,  417,  417,
-  687,  682,  486,   44,   40,  586,  687,  588,  589,  590,
-  591,  592,  799,  800,  801,  417,   40,  424,  256,  271,
-  272,  273,  507,   40,  637,   40,  511,   40,  886,   40,
-  521,  747,  523,  518,   40,   40,  632,  275,  634,  635,
-  525,   41,  533,  281,   44,   40,  284,  285,   42,   43,
-   44,   45,  392,   47,  539,   41,  541,   40,   44,   40,
-  545,  272,  273,  301,  302,   40,   40,  856,  857,  858,
-  859,  860,   42,   43,  863,   45,   40,   47,  358,  359,
-  938,  566,   40,   40,  682,  425,   37,  883,   40,  687,
-   41,  576,   40,   44,   40,  549,  550,  377,  378,  379,
-  380,  381,   37,   40,  870,  417,   41,   40,  824,   44,
-  390,   40,   40,  289,  601,  291,  601,  602,   40,   42,
-   43,   40,   45,  299,   41,   42,   43,   40,   45,   37,
-  846,   42,   43,   44,   45,  765,   47,   60,   61,   62,
-  753,  722,   40,  271,  272,  273,  417,  632,   41,  634,
-  635,   44,  637,   44,  392,   58,  641,   41,  756,  644,
-   44,  877,  857,  858,  859,  860,   37,  765,  818,   40,
-   41,   42,   43,   44,   45,  756,  661,  662,  417,   41,
-  417,  666,   44,  668,  765,   41,  799,  425,   44,   60,
-  881,   62,   44,   44,   41,  680,  681,   44,   41,   41,
-   58,   44,   44,  799,  800,  801,   41,   37,  693,   44,
-  695,  417,   42,   43,   41,   45,   41,   44,   41,   44,
-  674,   44,   41,  708,   41,   44,   41,   44,  682,   44,
-   60,   61,   62,  687,   44,  689,   41,    0,   41,   44,
-   41,   44,   41,   44,   40,   44,  424,   10,   61,  734,
-  390,  391,  417,   41,   41,  885,   44,   44,   44,   41,
-   41,  746,   44,   44,  417,  750,  406,  407,  753,  417,
-  410,  411,  412,  413,  417,   44,  730,   40,  272,   42,
-   43,   44,   45,   41,  424,  390,  391,  885,   41,   41,
-   41,   44,   44,   44,   44,  908,   40,   60,   61,   62,
-   41,  406,  407,   44,  885,  410,  411,  412,  413,   41,
-   41,   40,   44,   44,  799,  800,  801,   41,   41,  424,
-   44,   44,   41,  424,   41,   44,  811,   44,  813,   41,
-   41,   41,   44,   44,   44,  258,  259,  260,  261,  262,
-   61,  264,  265,  266,  267,  268,  269,   44,   41,  272,
-  273,   44,  278,  838,  271,  272,  273,   41,   41,   41,
-   44,   44,   44,   41,   44,  850,   44,  852,   41,   44,
-  380,   44,   44,   44,   44,   40,   44,   37,   41,   41,
-   44,   40,  272,   44,  417,  870,   40,  258,  259,  260,
-  261,  262,  417,  264,  265,  266,  267,  268,  269,   41,
-   44,  272,  273,  417,   41,  417,   61,   41,  424,   44,
-  273,   44,   40,  898,   44,  900,  901,   44,   44,   58,
-   41,   41,  332,  908,  417,   41,   41,  881,  258,  259,
-  260,  261,  262,   42,  264,  265,  266,  267,  268,  269,
-   58,  417,  272,  273,   41,   37,  272,    0,  933,   40,
-   42,   43,  906,   45,  272,  940,  272,   10,   41,   58,
-  374,  946,  417,   44,  949,   41,   44,   61,   60,   61,
-   62,   41,  417,  417,   41,   41,   41,  962,   41,   61,
-   41,  966,   41,   41,  969,  970,  374,   44,  272,   41,
-  975,   44,   47,  256,  417,  258,  259,  260,  261,  262,
-   44,  264,  265,  266,  267,  268,  269,   41,  271,  272,
-  273,   61,  275,  417,  277,  417,  417,  280,  281,  282,
-  283,  284,  285,  286,  287,  288,  289,  290,  291,  292,
-  293,  294,  295,  296,  297,  417,  417,   44,  301,  302,
-   41,  304,  305,  306,  307,  308,  309,  310,  311,  312,
-  313,  314,  315,  316,  317,  318,  319,  320,  321,  322,
-  323,  324,  325,  326,  327,  328,  329,   41,  331,   58,
-  333,  334,  335,  336,  337,   41,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   41,   41,  357,  358,  359,   44,  361,  362,
-  363,   41,  365,  366,  367,   41,  272,  370,   41,  372,
-   41,   41,  375,  376,  377,  378,   41,  775,  381,  382,
-  383,  850,  957,  873,  520,  271,  389,  390,  391,  392,
-  393,  394,  395,  396,  397,  398,  399,  285,  401,  402,
-  403,  404,  405,  406,  407,  408,    0,  410,  411,  412,
-  413,  773,  415,  416,  417,  350,   10,  382,  681,  402,
-  900,  424,  425,  753,  852,    9,  258,  259,  260,  261,
-  262,   13,  264,  265,  266,  267,  268,  269,   74,  275,
-  272,  273,  691,   37,  429,  952,  539,   41,   42,   43,
-   44,   45,  695,   47,  528,  502,  537,  701,  557,  128,
-  549,  750,  550,  256,   58,  559,   60,   61,   62,  756,
-   -1,   -1,  140,   -1,   -1,   -1,   -1,   -1,  271,  272,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   37,   -1,  408,   -1,   41,   42,   43,
-   44,   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   58,   -1,   60,   61,   62,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,  271,  272,  273,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   40,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   40,   -1,   -1,   43,   -1,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  256,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,  271,  272,  273,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   37,   -1,  408,   -1,   41,   42,   43,   44,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   58,   -1,   60,   61,   62,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,    0,   -1,   -1,  396,   -1,
-   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   -1,   37,   -1,  379,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   58,   -1,   60,   61,   62,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,  273,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   40,   -1,  408,   43,   -1,   45,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  256,   61,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,  273,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   42,   43,   -1,   45,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   60,  326,   62,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,  277,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   40,   41,   42,   43,   44,   45,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   58,   -1,   60,   61,   62,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  328,  329,  330,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   42,   43,   -1,
-   45,   -1,   -1,   -1,  263,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  272,   -1,   60,  357,   62,  359,  360,
-  361,   -1,   -1,  364,  365,   -1,  367,  368,  287,  288,
-   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,
-  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,  318,
-  319,   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  379,   37,   -1,   -1,   -1,   41,   42,   43,   44,   45,
-   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,
-   -1,   -1,   58,   -1,   60,   61,   62,  406,  407,   -1,
-   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,
-  256,   -1,  258,  259,  260,  261,  262,   -1,  264,  265,
-  266,  267,  268,  269,   -1,  271,  272,  273,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,  262,   -1,  264,
-  265,  266,  267,  268,  269,  311,   -1,  272,  273,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   40,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   40,   -1,   42,   43,   -1,   45,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  256,   58,  258,  259,  260,  261,  262,   -1,  264,  265,
-  266,  267,  268,  269,   -1,  271,  272,  273,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,  380,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   37,   -1,  408,   -1,   41,   42,   43,   44,   45,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,   58,   -1,   60,   61,   62,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,   -1,  312,  313,  314,   -1,  263,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,
-  307,  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,
-  317,  318,  319,   -1,  321,  322,  323,  324,  325,   -1,
-  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,    0,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,   -1,   10,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   -1,   -1,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  379,   -1,   41,   42,   43,   44,   45,   -1,
-   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,
-   -1,   58,   -1,   60,   61,   62,   -1,   -1,   -1,  406,
-  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,  256,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,  271,  272,  273,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   40,   -1,   42,   43,   -1,   45,  415,  416,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  256,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,  271,  272,  273,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   42,   43,
-   -1,   45,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   60,   -1,   62,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,   42,   43,   44,   45,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,  288,   -1,   -1,
-   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,  310,
-   -1,  312,  313,  314,   -1,  263,  317,  318,  319,   -1,
-   -1,  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,
-   -1,  379,   -1,   41,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-   58,   -1,   -1,   61,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   -1,   -1,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,  256,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  256,   -1,
-  258,  259,  260,  261,  262,    0,  264,  265,  266,  267,
-  268,  269,   -1,  271,  272,   10,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   37,  301,  302,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   58,   -1,   -1,   61,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,   -1,  288,    0,   -1,   -1,  292,  293,
-  294,  295,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,
-  304,  305,  306,  307,  308,  309,  310,   -1,  312,  313,
-  314,   -1,   -1,  317,  318,  319,   -1,   -1,  322,  323,
-  324,  325,   37,  327,   -1,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   58,   -1,   -1,   61,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,  417,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  256,   -1,  258,  259,  260,  261,  262,    0,  264,
-  265,  266,  267,  268,  269,   -1,  271,  272,   10,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   37,  301,  302,   -1,   41,
-   42,   43,   44,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   58,   -1,   -1,   61,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,  380,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,  286,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,  311,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,   -1,   -1,   -1,  331,
-  332,   -1,   -1,   -1,  336,  337,   -1,   -1,   -1,   41,
-   42,   43,   44,   45,  346,  347,  348,  349,  350,  351,
-  352,  353,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,  366,   -1,   -1,   -1,   -1,   -1,
-  372,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  381,
-   -1,  383,   -1,   -1,  256,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,  271,
-  272,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,  417,   -1,  289,  290,  291,
-   -1,   -1,  424,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   40,   -1,   42,
-   43,   -1,   45,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  256,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,   42,
-   43,   -1,   45,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   60,   61,   62,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   37,   -1,  379,   -1,   41,   -1,
-   43,   44,   45,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   58,   -1,   -1,   61,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,   -1,  256,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,  256,   -1,  258,  259,  260,  261,  262,
-    0,  264,  265,  266,  267,  268,  269,   -1,  271,   -1,
-   10,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   37,  301,  302,
-   -1,   41,   -1,   43,   44,   45,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   58,   -1,
-   -1,   61,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,   42,   -1,   44,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,   -1,
-   60,   -1,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,    0,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  256,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,  271,   -1,  273,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-  380,  381,  382,  383,   37,   -1,   -1,   -1,   41,  389,
-   -1,   44,  392,  393,  394,  395,   -1,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   60,  408,   62,
-   -1,   42,   43,   44,   45,  415,  416,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  425,   -1,   -1,   -1,   60,
-   61,   62,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,   -1,   -1,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,   -1,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   42,   43,   44,   45,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,  260,
-  261,  262,   -1,  264,  265,  266,  267,  268,  269,   -1,
-   -1,  272,  273,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,    0,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   10,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,   -1,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,   -1,   -1,   -1,  415,  416,   -1,  256,   -1,  258,
-  259,  260,  261,  262,  425,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,   -1,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   37,  256,  408,
-   -1,   41,   -1,   -1,   44,   -1,  415,  416,   -1,   -1,
-   -1,   -1,   -1,  271,  272,   -1,  425,  275,   58,  277,
-   -1,   61,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   37,   -1,
-  408,   -1,   41,   -1,   -1,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,  417,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   58,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,  262,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   42,   43,
-  370,   45,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   60,   61,   62,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,  260,  261,  262,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,    0,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   10,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-  260,  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   40,  328,  329,
-   43,  331,   45,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   40,   -1,   42,   43,  389,
-   45,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   61,  256,  408,  258,
-  259,  260,  261,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   37,   -1,  408,
-   40,   41,   42,   43,   44,   45,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  298,  299,  300,   -1,   -1,
-  303,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  263,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  273,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,    0,  327,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,   37,   -1,
-   -1,  424,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   61,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,  272,  273,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,  258,
-  259,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-    0,   -1,  271,   -1,  424,  425,  275,   -1,  277,   -1,
-   10,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   37,   -1,   -1,
-   -1,   41,  311,   -1,   44,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   58,  328,
-  329,   61,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   10,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,
-   43,   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  258,  259,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,  256,   -1,  415,  416,  417,   -1,   -1,
-   -1,    0,   -1,   -1,  424,  425,   -1,   -1,  271,  272,
-  273,   10,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   41,   42,   43,   44,   45,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,    0,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   10,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   42,   43,
-   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  271,  272,  273,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,  256,   -1,   -1,   -1,  415,  416,   -1,   -1,
-    0,   -1,   -1,   -1,   -1,  424,  425,  271,  272,  273,
-   10,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   41,   42,   43,   44,   45,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,    0,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,   -1,   10,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,  256,   -1,   -1,   -1,  415,  416,  417,    0,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  271,  272,   10,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   41,
-   42,   43,   44,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,    0,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   41,   42,   43,   44,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  271,
-  272,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,  256,
-   -1,   -1,   -1,  415,  416,  417,    0,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  271,  272,   10,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   37,  301,  302,   -1,   41,   -1,   -1,
-   44,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   58,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,    0,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   10,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   37,   -1,
-   -1,   -1,   41,   -1,   -1,   44,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   58,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,  380,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   41,  256,   43,   44,
-   45,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   41,  256,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   41,  256,   -1,   44,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  271,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   42,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   61,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,  256,   -1,   44,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   41,   -1,
-   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  271,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,    0,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   10,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,  256,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  271,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,    0,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   10,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,
-  256,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  271,  272,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   41,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,
-  275,   58,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   10,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   -1,   42,  256,   44,   -1,  415,
-  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,    0,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   10,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-    0,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   10,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,  271,  272,  424,  425,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,   -1,   41,   -1,  256,   44,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  271,  272,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   41,   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   41,   -1,  256,   44,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   41,
-   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   41,   -1,  256,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,
-   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,    0,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   10,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   44,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,  256,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,    0,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   10,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   44,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,  380,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,   -1,   -1,   -1,  256,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,    0,   -1,   -1,  315,  316,
-   -1,   -1,   -1,  320,   -1,   10,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   44,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   61,   -1,  375,  376,
-  377,  378,   -1,  380,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,   -1,   -1,   -1,  256,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,    0,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   10,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,  380,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,  256,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   10,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   44,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,  271,  272,  424,
-  425,  275,   -1,  277,   -1,   61,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   41,   -1,   -1,   44,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,  278,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,  380,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   41,
-   -1,   -1,   44,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   10,  380,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,
-  408,   -1,   -1,   -1,   -1,   44,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,
-   -1,   44,   -1,  415,  416,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-    0,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   10,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-   -1,   -1,   -1,   -1,   44,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   10,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   44,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,    0,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,    0,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   10,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   44,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   -1,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,    0,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   10,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,   -1,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,
-   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,
-  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,
-   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-  425,   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,
-   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,  275,   -1,  277,   -1,   -1,  280,
-  281,  282,  283,  284,  285,  286,   -1,   -1,  289,  290,
-  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,
-  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,
-  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,
-   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,
-  331,   -1,  333,  334,  335,  336,  337,   -1,  339,  340,
-  341,  342,  343,  344,  345,  346,  347,  348,  349,  350,
-  351,  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,
-  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,
-   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,
-  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,
-   -1,  392,  393,  394,  395,  396,  397,  398,  399,   -1,
-  401,  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,
-   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,
-   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   -1,  256,
-  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,
-   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,  275,   -1,
-  277,   -1,   -1,  280,  281,  282,  283,  284,  285,  286,
-   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,
-  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,  316,
-   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,
-   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,  336,
-  337,   -1,  339,  340,  341,  342,  343,  344,  345,  346,
-  347,  348,  349,  350,  351,  352,  353,  354,   -1,   -1,
-  357,  358,  359,   -1,  361,  362,  363,   -1,  365,  366,
-  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,
-  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,   -1,
-   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,  396,
-  397,  398,  399,   -1,  401,  402,  403,  404,  405,   -1,
-   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,
-  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,
-   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,
-  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,
-    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,  425,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,   -1,
-  280,  281,  282,  283,  284,  285,  286,   -1,   -1,  289,
-  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,
-   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,   -1,
-  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,  329,
-   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,  339,
-  340,  341,  342,  343,  344,  345,  346,  347,  348,  349,
-  350,  351,  352,  353,  354,   -1,   -1,  357,  358,  359,
-   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,   -1,
-  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,   -1,
-   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,  389,
-   -1,   -1,  392,  393,  394,  395,  396,  397,  398,  399,
-   -1,  401,  402,  403,  404,  405,   -1,  256,  408,   -1,
-   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,   -1,
-   -1,   -1,   -1,   -1,  424,  425,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,    0,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   10,   -1,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,  396,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,   -1,  408,
-  256,   -1,   -1,   -1,   -1,   -1,  415,  416,  417,   -1,
-   -1,   -1,   -1,   -1,   -1,  424,  425,   -1,   -1,  275,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,    0,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   10,   -1,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-  256,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,  415,
-  416,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,  285,
-  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,   -1,
-  296,  297,   -1,   -1,   -1,  301,  302,   -1,    0,   -1,
-   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,   10,  315,
-  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,
-  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,  335,
-  336,  337,   -1,  339,  340,  341,  342,  343,  344,  345,
-  346,  347,  348,  349,  350,  351,  352,  353,  354,   -1,
-   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,  365,
-  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,  375,
-  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,   -1,
-   -1,   -1,   -1,  389,   -1,   -1,  392,  393,  394,  395,
-  396,  397,  398,  399,   -1,  401,  402,  403,  404,  405,
-   -1,   -1,  408,  256,   -1,   -1,   -1,   -1,   -1,  415,
-  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,  425,
-   -1,   -1,  275,   -1,  277,   -1,   -1,  280,  281,  282,
-  283,  284,  285,  286,   -1,   -1,  289,  290,  291,   -1,
-   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,  302,
-   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,
-   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,
-   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,
-  333,  334,  335,  336,  337,   -1,  339,  340,  341,  342,
-  343,  344,  345,  346,  347,  348,  349,  350,  351,  352,
-  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,
-  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,
-   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,
-  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,  392,
-  393,  394,  395,  396,  397,  398,  399,   -1,  401,  402,
-  403,  404,  405,   -1,  256,  408,   -1,   -1,   -1,   -1,
-   -1,   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  425,  275,   -1,  277,   -1,   -1,  280,  281,
-  282,  283,  284,  285,  286,   -1,   -1,  289,  290,  291,
-   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,  301,
-  302,   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,  311,
-   -1,   -1,   10,  315,  316,   -1,   -1,   -1,  320,   -1,
-   -1,   -1,   -1,   -1,  326,   -1,  328,  329,   -1,  331,
-   -1,  333,  334,  335,  336,  337,   -1,  339,  340,  341,
-  342,  343,  344,  345,  346,  347,  348,  349,  350,  351,
-  352,  353,  354,   -1,   -1,  357,  358,  359,   -1,  361,
-  362,  363,   -1,  365,  366,  367,   -1,   -1,  370,   -1,
-  372,   -1,   -1,  375,  376,  377,  378,   -1,   -1,  381,
-  382,  383,   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,
-  392,  393,  394,  395,  396,  397,  398,  399,   -1,  401,
-  402,  403,  404,  405,   -1,   -1,  408,  256,   -1,   -1,
-   -1,   -1,   -1,  415,  416,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  424,  425,   -1,   -1,  275,   -1,  277,   -1,
-   -1,  280,  281,  282,  283,  284,  285,  286,   -1,   -1,
-  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,   -1,
-   -1,   -1,  301,  302,   -1,    0,   -1,   -1,   -1,   -1,
-   -1,   -1,  311,   -1,   -1,   10,  315,  316,   -1,   -1,
-   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,  328,
-  329,   -1,  331,   -1,  333,  334,  335,  336,  337,   -1,
-  339,  340,  341,  342,  343,  344,  345,  346,  347,  348,
-  349,  350,  351,  352,  353,  354,   -1,   -1,  357,  358,
-  359,   -1,  361,  362,  363,   -1,  365,  366,  367,   -1,
-   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,  378,
-   -1,   -1,  381,  382,  383,   -1,   -1,   -1,   -1,   -1,
-  389,   -1,   -1,  392,  393,  394,  395,   -1,  397,  398,
-  399,   -1,  401,  402,  403,  404,  405,   -1,  256,  408,
-   -1,   -1,   -1,   -1,   -1,   -1,  415,  416,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  425,  275,   -1,  277,
-   -1,   -1,  280,  281,  282,  283,  284,  285,  286,   -1,
-   -1,  289,  290,  291,   -1,   -1,   -1,   -1,  296,  297,
-   -1,   -1,   -1,  301,  302,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  311,   -1,   -1,   -1,  315,  316,   -1,
-   -1,   -1,  320,   -1,   -1,   -1,   -1,   -1,  326,   -1,
-  328,  329,   -1,  331,   -1,  333,  334,  335,  336,  337,
-   -1,  339,  340,  341,  342,  343,  344,  345,  346,  347,
-  348,  349,  350,  351,  352,  353,  354,   -1,   -1,  357,
-  358,  359,   -1,  361,  362,  363,   -1,  365,  366,  367,
-   -1,   -1,  370,   -1,  372,   -1,   -1,  375,  376,  377,
-  378,   -1,   -1,  381,  382,  383,   -1,   40,   -1,   42,
-   43,  389,   45,   -1,  392,  393,  394,  395,   -1,  397,
-  398,  399,   -1,  401,  402,  403,  404,  405,   61,   -1,
-  408,  256,   -1,   -1,   -1,   -1,   -1,  415,  416,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  425,   -1,   -1,
-  275,   -1,  277,   -1,   -1,  280,  281,  282,  283,  284,
-  285,  286,   -1,   -1,  289,  290,  291,   -1,   -1,   -1,
-   -1,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   41,
-   42,   43,   -1,   45,   -1,   -1,  311,   -1,   -1,   -1,
-  315,  316,   -1,   -1,   -1,  320,   58,   -1,   60,   61,
-   62,  326,   -1,  328,  329,   -1,  331,   -1,  333,  334,
-  335,  336,  337,   -1,  339,  340,  341,  342,  343,  344,
-  345,  346,  347,  348,  349,  350,  351,  352,  353,  354,
-   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,   -1,
-  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,   -1,
-  375,  376,  377,  378,   -1,   -1,  381,  382,  383,   -1,
-   40,   -1,   42,   43,  389,   45,   -1,  392,  393,  394,
-  395,  396,  397,  398,  399,   -1,  401,  402,  403,  404,
-  405,   61,   -1,  408,   -1,   -1,   -1,   -1,   -1,   -1,
-  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   40,   -1,
-   -1,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   61,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  379,   40,   -1,   -1,
-   43,   -1,   45,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   61,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,  263,  417,   -1,   -1,   -1,   -1,   -1,
-   -1,  424,   -1,   -1,   -1,   40,   -1,   -1,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   61,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,  263,  312,  313,  314,   -1,   -1,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,
-  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  304,  305,  306,  307,  308,  309,  310,   -1,
-  312,  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,
-  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,  379,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   -1,   40,  417,   42,   43,
-   -1,   45,   -1,   -1,  424,   -1,   -1,  379,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,
-   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,
-  263,   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,
-  412,  413,   -1,   -1,   40,  417,   42,   43,   -1,   45,
-   -1,   -1,  424,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,  263,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,   -1,  327,   -1,   -1,   -1,  379,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   40,   -1,  417,   43,   -1,   45,   -1,   -1,
-   -1,  424,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,
-   58,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  263,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   40,   -1,   -1,   43,  424,
-   45,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,
-  294,  295,   -1,   58,   -1,   -1,   -1,   -1,   -1,   -1,
-  304,  305,  306,  307,  308,  309,  310,  263,  312,  313,
-  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,
-  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,
-  306,  307,  308,  309,  310,   -1,  312,  313,  314,   -1,
-   -1,  317,  318,  319,   -1,  321,  322,  323,  324,  325,
-   -1,  327,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,
-   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,
-   -1,   -1,   -1,  417,   40,   -1,   42,   43,   -1,   45,
-  424,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,
-  396,   -1,   -1,   -1,   -1,  263,   -1,   -1,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,
-   -1,  417,   40,   -1,   42,   43,   -1,   45,  424,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,  379,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   40,   -1,  417,
-   43,   -1,   45,   -1,   -1,   -1,  424,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,  263,   -1,   -1,
-   -1,  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,
-   40,   -1,  417,   43,   -1,   45,   -1,   -1,   -1,  424,
-   -1,  287,  288,   -1,   -1,   -1,  292,  293,  294,  295,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,
-  306,  307,  308,  309,  310,  263,  312,  313,  314,   -1,
-   -1,  317,  318,  319,   -1,  321,  322,  323,  324,  325,
-   -1,  327,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,
-  288,   -1,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,   -1,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,
-  396,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   40,
-   -1,  417,   43,   -1,   45,   -1,   -1,   -1,  424,   -1,
-   -1,  379,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,   -1,  396,   -1,
-  263,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   -1,   40,   -1,  417,
-   43,   -1,   45,   -1,  287,  288,  424,   -1,   -1,  292,
-  293,  294,  295,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,  263,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  287,  288,   -1,
-   -1,   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,
-  310,   -1,  312,  313,  314,   -1,   -1,  317,  318,  319,
-   -1,  321,  322,  323,  324,  325,  379,  327,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   40,   -1,  417,   43,   -1,   45,   -1,   -1,
-   -1,  424,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  379,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  390,  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,
-   -1,   -1,  263,   -1,   -1,   -1,  406,  407,   -1,   -1,
-  410,  411,  412,  413,   -1,   40,   -1,  417,   43,   -1,
-   45,   -1,   -1,   -1,  424,   -1,  287,  288,   -1,   -1,
-   -1,  292,  293,  294,  295,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  304,  305,  306,  307,  308,  309,  310,
-  263,  312,  313,  314,   -1,   -1,  317,  318,  319,   -1,
-  321,  322,  323,  324,  325,   -1,  327,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,  292,
-  293,  294,  295,   -1,   40,   -1,   42,   43,   -1,   45,
-   -1,  304,  305,  306,  307,  308,  309,  310,   -1,  312,
-  313,  314,   -1,   -1,  317,  318,  319,   -1,  321,  322,
-  323,  324,  325,   -1,  327,   -1,   -1,   -1,  379,   -1,
-   40,   -1,   42,   43,   -1,   45,   -1,   -1,   -1,  390,
-  391,   -1,   -1,   -1,   -1,  396,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  406,  407,   -1,   -1,  410,
-  411,  412,  413,   -1,   -1,   -1,  417,   -1,   -1,   -1,
-   -1,   -1,   -1,  424,   -1,   -1,  379,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,
-   -1,   -1,   -1,  396,   -1,  263,   41,   42,   43,   -1,
-   45,   -1,   -1,  406,  407,   -1,   -1,  410,  411,  412,
-  413,   -1,   -1,   58,  417,   60,   61,   62,   -1,  287,
-  288,  424,   -1,   -1,  292,  293,  294,  295,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  304,  305,  306,  307,
-  308,  309,  310,   -1,  312,  313,  314,   -1,  263,  317,
-  318,  319,   -1,  321,  322,  323,  324,  325,   -1,  327,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   41,   42,   43,
-   44,   45,  287,  288,   -1,   -1,   -1,  292,  293,  294,
-  295,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,  304,
-  305,  306,  307,  308,  309,  310,   -1,  312,  313,  314,
-   -1,   -1,  317,  318,  319,   -1,  321,  322,  323,  324,
-  325,  379,  327,   41,   42,   43,   -1,   45,   -1,   -1,
-   -1,   -1,  390,  391,   -1,   -1,   -1,  273,  396,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,  406,  407,
-   -1,   -1,  410,  411,  412,  413,   41,   42,   43,  417,
-   45,   -1,  298,  299,  300,   -1,  424,  303,   -1,   -1,
-   -1,   -1,   -1,   -1,  379,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,
-   -1,  396,   -1,   -1,   -1,   -1,   -1,   -1,  298,  299,
-  300,  406,  407,  303,   -1,  410,  411,  412,  413,   -1,
-   -1,   -1,  417,   -1,   -1,   -1,   -1,   -1,   -1,  424,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  390,  391,   -1,   -1,   60,   61,
-   62,   -1,   -1,   41,   42,   43,   -1,   45,   -1,   -1,
-  406,  407,   -1,   -1,  410,  411,  412,  413,   -1,   -1,
-   -1,  417,   60,   61,   62,   -1,   -1,   -1,  424,   -1,
-  390,  391,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,  406,  407,  272,  273,
-  410,  411,  412,  413,   41,   42,   43,  417,   45,   -1,
-   -1,   -1,   -1,   -1,  424,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   41,   42,   43,   -1,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   41,   42,   43,
-   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,   42,
-   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   41,   42,   43,   -1,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   -1,
-   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,
-   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,  272,
-  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   41,   42,   43,   -1,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   41,   42,   43,   -1,   45,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   60,   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   41,   42,   43,   -1,   45,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   60,   61,   62,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   41,   42,   43,
-   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   41,
-   42,   43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,
-   62,   42,   43,   44,   45,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   60,
-   61,   62,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,
-  260,  261,  262,   -1,  264,  265,  266,  267,  268,  269,
-   -1,   -1,  272,  273,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,  258,  259,  260,  261,  262,   -1,  264,  265,  266,
-  267,  268,  269,   -1,   -1,  272,  273,   42,   43,   44,
-   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   42,   43,
-   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   60,   61,   62,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,  261,
-  262,   -1,  264,  265,  266,  267,  268,  269,   -1,   -1,
-  272,  273,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,
-  261,  262,   -1,  264,  265,  266,  267,  268,  269,   -1,
-   -1,  272,  273,   42,   43,   44,   45,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   60,   61,   62,   42,   43,   44,   45,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   60,   61,   62,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,  264,
-  265,  266,  267,  268,  269,   -1,   -1,  272,  273,   -1,
-   -1,   -1,   -1,   -1,  258,  259,  260,  261,  262,   -1,
-  264,  265,  266,  267,  268,  269,   -1,   -1,  272,  273,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,
-  259,  260,  261,  262,   -1,  264,  265,  266,  267,  268,
-  269,   -1,   -1,  272,  273,   -1,   -1,   -1,   -1,   -1,
-  258,  259,  260,  261,  262,   -1,  264,  265,  266,  267,
-  268,  269,   -1,  277,  272,  273,  280,   -1,  282,  283,
-   -1,   -1,  286,   -1,   -1,  289,  290,  291,   -1,   -1,
-   -1,   -1,  296,  297,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  311,   -1,   -1,
-   -1,  315,  316,   -1,   -1,   -1,  320,   -1,   -1,   -1,
-   -1,   -1,  326,   -1,  328,  329,   -1,  331,   -1,  333,
-  334,  335,  336,  337,   -1,  339,  340,  341,  342,  343,
-  344,  345,  346,  347,  348,  349,  350,  351,  352,  353,
-  354,   -1,   -1,  357,  358,  359,   -1,  361,  362,  363,
-   -1,  365,  366,  367,   -1,   -1,  370,   -1,  372,   -1,
-   -1,  375,  376,  377,  378,   -1,   -1,  381,  382,  383,
-   -1,   -1,   -1,   -1,   -1,  389,   -1,   -1,   -1,  393,
-  394,  395,  396,  397,  398,  399,   -1,  401,  402,  403,
-  404,  405,   -1,   -1,  408,   -1,   -1,   -1,   -1,   -1,
-   -1,  415,  416,  417,   -1,   -1,   -1,   -1,   -1,   -1,
-  424,
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint16 yystos[] =
+{
+       0,   191,     0,     1,    36,    37,    53,    54,   144,   177,
+     187,   192,   197,   199,   205,   201,   198,   177,   200,    29,
+      32,    34,    35,    38,    41,    42,    43,    48,    49,    63,
+      67,    68,    72,    78,    80,    81,    83,    85,    86,    87,
+      88,    89,    91,    92,    93,    94,    95,    96,    97,    98,
+      99,   100,   101,   102,   103,   104,   105,   106,   109,   110,
+     111,   113,   114,   115,   117,   118,   119,   122,   124,   127,
+     128,   129,   130,   133,   134,   135,   141,   145,   146,   147,
+     148,   149,   150,   151,   153,   154,   155,   156,   157,   160,
+     167,   168,   169,   176,   193,   194,   195,   202,   203,   206,
+     212,   224,   225,   228,   229,   234,   235,   237,   238,   239,
+     240,   241,   243,   244,   251,   253,   257,   258,   261,   262,
+     263,   298,   308,   309,   315,   316,   317,   318,   319,   321,
+     326,   327,   328,   330,   331,   333,   336,   337,   340,   341,
+     349,   351,   352,   365,   372,   201,   205,   169,   204,   204,
+     179,    12,    21,    22,    39,    40,    44,    45,    46,    47,
+      56,    57,    58,    59,    60,    61,    62,    64,    65,    66,
+      69,    70,    71,    73,    74,    75,    76,    77,    79,   131,
+     142,   143,   148,   158,   159,   162,   163,   164,   165,   176,
+     179,   280,   281,   283,   284,   288,   290,   291,   292,   293,
+     298,   299,   300,   307,   320,   179,   187,   280,   304,   179,
+     217,   218,   179,   280,   303,     4,   187,   221,   187,   221,
+     304,   179,   169,   187,   324,   176,   179,   364,   280,   169,
+     325,   169,   324,   179,   169,   176,   179,   346,   179,   179,
+     221,   221,    20,    24,   247,   298,   179,   216,   123,   137,
+     127,   324,   324,   169,   252,    80,    81,   213,   275,   324,
+      27,   196,   198,    33,   196,   158,   207,   196,   169,   179,
+     249,   250,   169,   226,   231,     3,   248,   169,   230,   247,
+       3,   236,   248,     3,   248,     3,   248,   169,   245,   246,
+     247,     3,     4,    35,   222,   223,   255,   271,   169,   176,
+     268,    23,   179,   259,    23,   179,   266,    23,     4,   329,
+     169,   310,   200,   324,   324,   324,   176,   323,   280,     5,
+     126,   189,   332,     3,   179,   334,   169,   304,   179,   345,
+      21,    22,    23,    50,    51,    52,    55,   169,   179,   288,
+     299,   343,   345,   350,   353,   354,   355,   345,    84,    98,
+     105,   298,   328,   179,   208,   280,   280,   280,   282,   179,
+     179,   179,   282,   280,   282,   179,   179,   179,   179,   179,
+     179,   179,   179,   179,   179,   179,   179,   280,   179,   179,
+     179,   179,   179,   179,   280,   281,   283,   307,   360,   361,
+     362,   179,   280,   283,     5,     7,     8,     9,    10,    11,
+      13,    14,    15,    16,    17,    18,    21,    22,    23,    24,
+      25,   185,   186,   285,   280,   189,   179,   302,   179,   179,
+     169,   158,   301,   302,     3,     4,   180,   280,   219,   298,
+       3,   280,     4,   169,   242,   242,   280,   280,   180,   288,
+     292,   298,   330,   366,   367,   368,   176,   283,   298,   298,
+     367,   369,   298,   371,   242,    40,    44,    45,    46,    47,
+      56,    57,    58,    59,    60,    61,    62,    64,    65,    66,
+      69,    70,    71,    74,    75,    76,    77,    79,   169,   214,
+     215,   169,   298,   220,   280,     3,     3,   221,   194,   200,
+     204,   196,     5,   249,     3,    24,   179,   187,   248,     3,
+      24,   230,   247,   179,   276,   230,   298,   247,   169,   169,
+     247,   276,     3,   245,    29,    82,   109,   111,   112,   113,
+     116,   117,   119,   120,   272,   273,   275,     4,   204,     3,
+     256,   254,     5,    23,   269,   280,   180,   176,   179,   169,
+     260,   269,   179,   267,   280,   268,   176,   276,     3,   205,
+     248,   298,   322,   373,   280,   280,   298,   176,    23,   280,
+     335,   338,   339,    23,    25,   179,   298,   347,   348,   353,
+     354,   280,   280,   280,   280,     5,   353,   179,   281,   288,
+     299,   342,   356,   357,   358,     3,   344,    20,    23,    24,
+      25,   355,   353,   360,   179,   179,    23,   169,   180,   210,
+     211,    30,   180,     3,   180,   282,   282,   280,   180,   180,
+     180,   280,   280,   280,   280,   280,   280,   280,   280,   280,
+     280,   280,   280,   180,   282,   282,   282,   282,   282,   280,
+     283,   361,   362,     3,   132,     3,     3,   282,   180,     3,
+       5,   280,   287,   280,   280,   280,   280,   280,   280,   280,
+     280,   280,   280,   280,   280,   280,   280,     5,    24,   280,
+     286,   280,     5,   280,     5,   280,   288,   303,   289,   294,
+     294,   280,   280,   180,     3,   180,   276,   218,   180,     3,
+     180,     3,   179,     3,   370,   180,   180,   180,     3,   370,
+       3,   180,     3,    24,     3,   180,   179,   169,   324,   208,
+     280,   180,   250,   227,   232,   233,   284,   280,   169,   169,
+     231,   227,   248,     4,    23,   277,   278,   279,   280,   248,
+     276,   276,   248,   246,   276,   179,     3,     4,   208,   254,
+     169,   269,   260,     5,   269,   180,     3,   270,    23,   180,
+     276,    31,   169,   311,   312,     5,   329,   364,   180,     3,
+     353,    23,    25,   179,   280,     3,   180,   180,   280,   180,
+     356,   285,   359,   359,     3,   359,   356,   353,   353,   353,
+     353,   353,   366,   369,     3,   180,   179,   209,   304,   280,
+     180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
+     180,   180,   180,   180,   180,   180,   180,   180,   180,   180,
+     180,     3,     3,     3,   280,   362,   280,   362,   280,   362,
+     180,   283,   280,   280,   280,   280,   280,     4,     4,   280,
+     295,   296,   297,   180,   180,   298,   169,    84,   280,   295,
+     125,   367,   180,   367,   180,   298,   214,   280,   220,    24,
+       3,    21,    22,    23,   188,   299,   180,    24,    24,   230,
+     280,     3,   180,     4,   298,    23,   264,   264,   245,   138,
+     139,   140,   274,   273,     4,   169,   276,   180,   269,   270,
+     169,   180,     4,   126,     3,   280,   276,   339,   180,   280,
+     297,   189,   348,   353,     3,   180,   285,   358,   370,   370,
+     211,   180,   210,   169,   363,   363,   363,   180,   303,     4,
+     280,     4,     3,   302,   276,   180,   180,     5,   180,   227,
+     232,   232,   232,   232,   227,   278,   279,   280,   179,   265,
+     280,   180,   276,   264,   270,   269,   169,   187,   313,   314,
+     169,   312,     3,   276,   180,   330,   363,   359,   180,   180,
+     180,     5,   180,   180,   180,   180,   280,     4,   280,   296,
+       3,   298,    24,    23,   264,   305,   306,   126,     3,   280,
+     180,   280,   280,     4,   280,   180,   305,     5,   169,   314,
+       3,     3,   280,   280,   280,   280,     3,   280
 };
-#define YYFINAL 1
-#ifndef YYDEBUG
-#define YYDEBUG 1
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (YY_("syntax error: cannot back up")); \
+      YYERROR;							\
+    }								\
+while (YYID (0))
+
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
 #endif
-#define YYMAXTOKEN 426
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
 #if YYDEBUG
-char *fortranname[] = {
-"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,"'!'",0,0,0,"'%'",0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,
-0,0,0,0,0,"':'",0,"'<'","'='","'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,"'['",0,"']'",0,"'_'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TOK_BINARY_OP","TOK_EQV","TOK_NEQV",
-"TOK_OR","TOK_XOR","TOK_AND","TOK_NOT","TOK_LT","TOK_GT","TOK_LE","TOK_GE",
-"TOK_EQ","TOK_NE","TOK_UNARY_OP","TOK_DSLASH","TOK_SLASH","TOK_DASTER",
-"TOK_SEP","TOK_SEMICOLON","TOK_NEXTLINE","TOK_PARAMETER","TOK_RESULT",
-"TOK_ONLY","TOK_INCLUDE","TOK_SUBROUTINE","TOK_PROGRAM","TOK_FUNCTION",
-"TOK_OMP","TOK_DOLLAR","TOK_FORMAT","TOK_MAX","TOK_TANH","TOK_WHERE",
-"TOK_ELSEWHERE","TOK_ENDWHERE","TOK_MAXVAL","TOK_TRIM","TOK_SUM","TOK_SQRT",
-"TOK_CASE","TOK_SELECTCASE","TOK_FILE","TOK_END","TOK_ERR","TOK_DONOTTREAT",
-"TOK_ENDDONOTTREAT","TOK_EXIST","TOK_MIN","TOK_FLOAT","TOK_EXP","TOK_COS",
-"TOK_COSH","TOK_ACOS","TOK_NINT","TOK_CYCLE","TOK_SIN","TOK_SINH","TOK_ASIN",
-"TOK_EQUIVALENCE","TOK_BACKSPACE","TOK_LOG","TOK_TAN","TOK_ATAN",
-"TOK_RECURSIVE","TOK_ABS","TOK_MOD","TOK_SIGN","TOK_MINLOC","TOK_MAXLOC",
-"TOK_EXIT","TOK_MINVAL","TOK_PUBLIC","TOK_PRIVATE","TOK_ALLOCATABLE",
-"TOK_RETURN","TOK_THEN","TOK_ELSEIF","TOK_ELSE","TOK_ENDIF","TOK_PRINT",
-"TOK_PLAINGOTO","TOK_CONSTRUCTID","TOK_LOGICALIF","TOK_PLAINDO","TOK_CONTAINS",
-"TOK_ENDDO","TOK_MODULE","TOK_ENDMODULE","TOK_DOWHILE","TOK_ALLOCATE",
-"TOK_OPEN","TOK_CLOSE","TOK_INQUIRE","TOK_WRITE","TOK_READ","TOK_REWIND",
-"TOK_DEALLOCATE","TOK_NULLIFY","TOK_FIN","TOK_DEBUT","TOK_DIMENSION",
-"TOK_ENDSELECT","TOK_EXTERNAL","TOK_INTENT","TOK_INTRINSIC","TOK_NAMELIST",
-"TOK_CASEDEFAULT","TOK_OPTIONAL","TOK_POINTER","TOK_CONTINUE","TOK_SAVE",
-"TOK_TARGET","TOK_QUOTE","TOK_IMPLICIT","TOK_NONE","TOK_CALL","TOK_STAT",
-"TOK_POINT_TO","TOK_COMMON","TOK_GLOBAL","TOK_INTERFACE","TOK_ENDINTERFACE",
-"TOK_LEFTAB","TOK_RIGHTAB","TOK_PAUSE","TOK_PROCEDURE","TOK_STOP","TOK_NAMEEQ",
-"TOK_REAL8","TOK_OUT","TOK_INOUT","TOK_IN","TOK_USE","TOK_TRUE","TOK_FALSE",
-"TOK_LABEL","TOK_TYPE","TOK_TYPEPAR","TOK_ENDTYPE","TOK_REAL","TOK_INTEGER",
-"TOK_LOGICAL","TOK_DOUBLEPRECISION","TOK_DOUBLEREAL","TOK_ENDSUBROUTINE",
-"TOK_ENDFUNCTION","TOK_ENDPROGRAM","TOK_ENDUNIT","TOK_CHARACTER",
-"TOK_CHAR_CONSTANT","TOK_CHAR_CUT","TOK_DATA","TOK_CHAR_INT","TOK_CHAR_MESSAGE",
-"TOK_CSTREAL","TOK_CSTREALDP","TOK_CSTREALQP","TOK_SFREAL","TOK_COMPLEX",
-"TOK_DOUBLECOMPLEX","TOK_NAME","TOK_NAME_CHAR","TOK_PROBTYPE","TOK_INTERPTYPE",
-"TOK_VARTYPE","TOK_BC","TOK_OP","TOK_CSTINT","TOK_COMMENT","TOK_FILENAME",
-};
-char *fortranrule[] = {
-"$accept : input",
-"input :",
-"input : input line",
-"line : '\\n' position",
-"line : thislabel suite_line_list",
-"line : TOK_COMMENT",
-"line : keyword cmnt writedeclar",
-"line : error writedeclar nulcurbuf",
-"suite_line_list : suite_line",
-"suite_line_list : suite_line_list TOK_SEMICOLON suite_line",
-"suite_line : entry fin_line",
-"suite_line : spec fin_line",
-"suite_line : before_include filename fin_line",
-"suite_line : exec cmnt writedeclar",
-"suite_line : instr fin_line",
-"instr : ident ':'",
-"fin_line : position cmnt",
-"keyword : TOK_DONOTTREAT",
-"keyword : TOK_ENDDONOTTREAT",
-"keyword : TOK_OMP",
-"keyword : TOK_DOLLAR",
-"position :",
-"thislabel :",
-"thislabel : TOK_LABEL nulcurbuf",
-"cmnt :",
-"cmnt : TOK_COMMENT",
-"incomment :",
-"nulcurbuf :",
-"opt_recursive :",
-"opt_recursive : TOK_RECURSIVE",
-"entry :",
-"entry : opt_recursive TOK_SUBROUTINE name_routine arglist",
-"entry : TOK_PROGRAM name_routine",
-"entry : TOK_FUNCTION name_routine arglist TOK_RESULT arglist1",
-"entry : TOK_FUNCTION name_routine arglist",
-"entry : TOK_MODULE TOK_NAME",
-"name_routine : TOK_NAME",
-"writedeclar :",
-"before_include : TOK_INCLUDE",
-"filename : TOK_CHAR_CONSTANT",
-"arglist :",
-"arglist : '(' ')'",
-"arglist : '(' args ')'",
-"arglist1 :",
-"arglist1 : '(' ')'",
-"arglist1 : '(' args ')'",
-"args : arg",
-"args : args ',' arg",
-"arg : TOK_NAME",
-"arg : '*'",
-"spec : type after_type",
-"spec : TOK_TYPE opt_spec opt_sep opt_name",
-"spec : TOK_ENDTYPE opt_name",
-"spec : TOK_POINTER list_couple",
-"spec : before_parameter '(' paramlist ')'",
-"spec : before_parameter paramlist",
-"spec : common",
-"spec : save",
-"spec : implicit",
-"spec : dimension",
-"spec : public",
-"spec : private",
-"spec : use_stat",
-"spec : module_proc_stmt",
-"spec : interface",
-"spec : namelist",
-"spec : TOK_BACKSPACE '(' expr ')'",
-"spec : TOK_EXTERNAL opt_sep use_name_list",
-"spec : TOK_INTRINSIC opt_sep use_intrinsic_list",
-"spec : TOK_EQUIVALENCE list_expr_equi",
-"spec : before_data data '\\n'",
-"opt_spec :",
-"opt_spec : access_spec",
-"name_intrinsic : TOK_SUM",
-"name_intrinsic : TOK_TANH",
-"name_intrinsic : TOK_MAXVAL",
-"name_intrinsic : TOK_MIN",
-"name_intrinsic : TOK_MINVAL",
-"name_intrinsic : TOK_TRIM",
-"name_intrinsic : TOK_SQRT",
-"name_intrinsic : TOK_NINT",
-"name_intrinsic : TOK_FLOAT",
-"name_intrinsic : TOK_EXP",
-"name_intrinsic : TOK_COS",
-"name_intrinsic : TOK_COSH",
-"name_intrinsic : TOK_ACOS",
-"name_intrinsic : TOK_SIN",
-"name_intrinsic : TOK_SINH",
-"name_intrinsic : TOK_ASIN",
-"name_intrinsic : TOK_LOG",
-"name_intrinsic : TOK_TAN",
-"name_intrinsic : TOK_ATAN",
-"name_intrinsic : TOK_MOD",
-"name_intrinsic : TOK_SIGN",
-"name_intrinsic : TOK_MINLOC",
-"name_intrinsic : TOK_MAXLOC",
-"name_intrinsic : TOK_NAME",
-"use_intrinsic_list : name_intrinsic",
-"use_intrinsic_list : use_intrinsic_list ',' name_intrinsic",
-"list_couple : '(' list_expr ')'",
-"list_couple : list_couple ',' '(' list_expr ')'",
-"list_expr_equi : expr_equi",
-"list_expr_equi : list_expr_equi ',' expr_equi",
-"expr_equi : '(' list_expr_equi1 ')'",
-"list_expr_equi1 : ident dims",
-"list_expr_equi1 : list_expr_equi1 ',' ident dims",
-"list_expr : expr",
-"list_expr : list_expr ',' expr",
-"opt_sep :",
-"opt_sep : ':' ':'",
-"after_type : dcl nodimsgiven",
-"after_type : before_function name_routine arglist",
-"before_function : TOK_FUNCTION",
-"before_parameter : TOK_PARAMETER",
-"before_data : TOK_DATA",
-"data : TOK_NAME TOK_SLASH datavallist TOK_SLASH",
-"data : data opt_comma TOK_NAME TOK_SLASH datavallist TOK_SLASH",
-"data : datanamelist TOK_SLASH datavallist TOK_SLASH",
-"datavallist : expr_data",
-"datavallist : expr_data ',' datavallist",
-"save : before_save varsave",
-"save : before_save comblock varsave",
-"save : save opt_comma comblock opt_comma varsave",
-"save : save ',' varsave",
-"before_save : TOK_SAVE",
-"varsave :",
-"varsave : TOK_NAME dims",
-"datanamelist : TOK_NAME",
-"datanamelist : TOK_NAME '(' expr ')'",
-"datanamelist : datanamelist ',' datanamelist",
-"expr_data : opt_signe simple_const",
-"expr_data : expr_data '+' expr_data",
-"expr_data : expr_data '-' expr_data",
-"expr_data : expr_data '*' expr_data",
-"expr_data : expr_data '/' expr_data",
-"opt_signe :",
-"opt_signe : signe",
-"namelist : namelist_action after_namelist",
-"namelist_action : TOK_NAMELIST ident",
-"namelist_action : TOK_NAMELIST comblock ident",
-"namelist_action : namelist_action opt_comma comblock opt_comma ident",
-"namelist_action : namelist_action ',' ident",
-"after_namelist :",
-"interface : TOK_INTERFACE opt_name",
-"interface : TOK_ENDINTERFACE opt_name",
-"before_dimension : TOK_DIMENSION",
-"dimension : before_dimension opt_comma TOK_NAME dims lengspec",
-"dimension : dimension ',' TOK_NAME dims lengspec",
-"private : TOK_PRIVATE '\\n'",
-"private : TOK_PRIVATE opt_sep use_name_list",
-"public : TOK_PUBLIC '\\n'",
-"public : TOK_PUBLIC opt_sep use_name_list",
-"use_name_list : TOK_NAME",
-"use_name_list : use_name_list ',' TOK_NAME",
-"common : before_common var_common_list",
-"common : before_common comblock var_common_list",
-"common : common opt_comma comblock opt_comma var_common_list",
-"before_common : TOK_COMMON",
-"before_common : TOK_GLOBAL TOK_COMMON",
-"var_common_list : var_common",
-"var_common_list : var_common_list ',' var_common",
-"var_common : TOK_NAME dims",
-"comblock : TOK_DSLASH",
-"comblock : TOK_SLASH TOK_NAME TOK_SLASH",
-"opt_comma :",
-"opt_comma : ','",
-"paramlist : paramitem",
-"paramlist : paramlist ',' paramitem",
-"paramitem : TOK_NAME '=' expr",
-"module_proc_stmt : TOK_PROCEDURE proc_name_list",
-"proc_name_list : TOK_NAME",
-"proc_name_list : proc_name_list ',' TOK_NAME",
-"implicit : TOK_IMPLICIT TOK_NONE",
-"implicit : TOK_IMPLICIT TOK_REAL8",
-"opt_retour :",
-"dcl : options opt_retour TOK_NAME dims lengspec initial_value",
-"dcl : dcl ',' opt_retour TOK_NAME dims lengspec initial_value",
-"nodimsgiven :",
-"type : typespec selector",
-"type : before_character c_selector",
-"type : typename '*' TOK_CSTINT",
-"type : before_typepar attribute ')'",
-"before_typepar : TOK_TYPEPAR",
-"c_selector :",
-"c_selector : '*' TOK_CSTINT",
-"c_selector : '*' '(' c_attribute ')'",
-"c_selector : '(' c_attribute ')'",
-"c_attribute : TOK_NAME clause opt_clause",
-"c_attribute : TOK_NAME '=' clause opt_clause",
-"c_attribute : clause opt_clause",
-"before_character : TOK_CHARACTER",
-"typespec : typename",
-"typename : TOK_INTEGER",
-"typename : TOK_REAL",
-"typename : TOK_COMPLEX",
-"typename : TOK_DOUBLEPRECISION",
-"typename : TOK_DOUBLECOMPLEX",
-"typename : TOK_LOGICAL",
-"lengspec :",
-"lengspec : '*' proper_lengspec",
-"proper_lengspec : expr",
-"proper_lengspec : '(' '*' ')'",
-"selector :",
-"selector : '*' proper_selector",
-"selector : '(' attribute ')'",
-"proper_selector : expr",
-"proper_selector : '(' '*' ')'",
-"attribute : TOK_NAME clause",
-"attribute : TOK_NAME '=' clause",
-"attribute : TOK_NAME",
-"attribute : TOK_CSTINT",
-"clause : expr",
-"clause : '*'",
-"opt_clause :",
-"opt_clause : ',' TOK_NAME clause",
-"options :",
-"options : ':' ':'",
-"options : ',' attr_spec_list ':' ':'",
-"attr_spec_list : attr_spec",
-"attr_spec_list : attr_spec_list ',' attr_spec",
-"attr_spec : TOK_PARAMETER",
-"attr_spec : access_spec",
-"attr_spec : TOK_ALLOCATABLE",
-"attr_spec : TOK_DIMENSION dims",
-"attr_spec : TOK_EXTERNAL",
-"attr_spec : TOK_INTENT '(' intent_spec ')'",
-"attr_spec : TOK_INTRINSIC",
-"attr_spec : TOK_OPTIONAL",
-"attr_spec : TOK_POINTER",
-"attr_spec : TOK_SAVE",
-"attr_spec : TOK_TARGET",
-"intent_spec : TOK_IN",
-"intent_spec : TOK_OUT",
-"intent_spec : TOK_INOUT",
-"access_spec : TOK_PUBLIC",
-"access_spec : TOK_PRIVATE",
-"dims :",
-"dims : '(' dimlist ')'",
-"dimlist : dim",
-"dimlist : dimlist ',' dim",
-"dim : ubound",
-"dim : ':'",
-"dim : expr ':'",
-"dim : ':' expr",
-"dim : expr ':' ubound",
-"ubound : '*'",
-"ubound : expr",
-"expr : uexpr",
-"expr : '(' expr ')'",
-"expr : complex_const",
-"expr : predefinedfunction",
-"predefinedfunction : TOK_SUM minmaxlist ')'",
-"predefinedfunction : TOK_MAX minmaxlist ')'",
-"predefinedfunction : TOK_TANH '(' minmaxlist ')'",
-"predefinedfunction : TOK_MAXVAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_MIN minmaxlist ')'",
-"predefinedfunction : TOK_MINVAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_TRIM '(' expr ')'",
-"predefinedfunction : TOK_SQRT expr ')'",
-"predefinedfunction : TOK_REAL '(' minmaxlist ')'",
-"predefinedfunction : TOK_NINT '(' expr ')'",
-"predefinedfunction : TOK_FLOAT '(' expr ')'",
-"predefinedfunction : TOK_EXP '(' expr ')'",
-"predefinedfunction : TOK_COS '(' expr ')'",
-"predefinedfunction : TOK_COSH '(' expr ')'",
-"predefinedfunction : TOK_ACOS '(' expr ')'",
-"predefinedfunction : TOK_SIN '(' expr ')'",
-"predefinedfunction : TOK_SINH '(' expr ')'",
-"predefinedfunction : TOK_ASIN '(' expr ')'",
-"predefinedfunction : TOK_LOG '(' expr ')'",
-"predefinedfunction : TOK_TAN '(' expr ')'",
-"predefinedfunction : TOK_ATAN '(' expr ')'",
-"predefinedfunction : TOK_ABS expr ')'",
-"predefinedfunction : TOK_MOD '(' minmaxlist ')'",
-"predefinedfunction : TOK_SIGN '(' minmaxlist ')'",
-"predefinedfunction : TOK_MINLOC '(' minmaxlist ')'",
-"predefinedfunction : TOK_MAXLOC '(' minmaxlist ')'",
-"minmaxlist : expr",
-"minmaxlist : minmaxlist ',' expr",
-"uexpr : lhs",
-"uexpr : simple_const",
-"uexpr : vec",
-"uexpr : expr operation",
-"uexpr : signe expr",
-"uexpr : TOK_NOT expr",
-"signe : '+'",
-"signe : '-'",
-"operation : '+' expr",
-"operation : '-' expr",
-"operation : '*' expr",
-"operation : TOK_DASTER expr",
-"operation : TOK_EQ expr",
-"operation : TOK_EQV expr",
-"operation : TOK_GT expr",
-"operation : '>' expr",
-"operation : TOK_LT expr",
-"operation : '<' expr",
-"operation : TOK_GE expr",
-"operation : '>' '=' expr",
-"operation : TOK_LE expr",
-"operation : '<' '=' expr",
-"operation : TOK_NE expr",
-"operation : TOK_NEQV expr",
-"operation : TOK_XOR expr",
-"operation : TOK_OR expr",
-"operation : TOK_AND expr",
-"operation : TOK_SLASH after_slash",
-"operation : '=' after_equal",
-"after_slash :",
-"after_slash : expr",
-"after_slash : '=' expr",
-"after_slash : TOK_SLASH expr",
-"after_equal : '=' expr",
-"after_equal : expr",
-"lhs : ident",
-"lhs : structure_component",
-"lhs : array_ele_substring_func_ref",
-"beforefunctionuse :",
-"array_ele_substring_func_ref : begin_array",
-"array_ele_substring_func_ref : begin_array substring",
-"array_ele_substring_func_ref : structure_component '(' funarglist ')'",
-"array_ele_substring_func_ref : structure_component '(' funarglist ')' substring",
-"begin_array : ident '(' funarglist ')'",
-"structure_component : lhs '%' lhs",
-"vec : TOK_LEFTAB outlist TOK_RIGHTAB",
-"funarglist : beforefunctionuse",
-"funarglist : beforefunctionuse funargs",
-"funargs : funarg",
-"funargs : funargs ',' funarg",
-"funarg : expr",
-"funarg : triplet",
-"triplet : expr ':' expr",
-"triplet : expr ':' expr ':' expr",
-"triplet : ':' expr ':' expr",
-"triplet : ':' ':' expr",
-"triplet : ':' expr",
-"triplet : expr ':'",
-"triplet : ':'",
-"ident : TOK_NAME",
-"simple_const : TOK_TRUE",
-"simple_const : TOK_FALSE",
-"simple_const : TOK_CSTINT",
-"simple_const : TOK_CSTREAL",
-"simple_const : TOK_CSTREALDP",
-"simple_const : TOK_CSTREALQP",
-"simple_const : simple_const TOK_NAME",
-"simple_const : string_constant opt_substring",
-"string_constant : TOK_CHAR_CONSTANT",
-"string_constant : string_constant TOK_CHAR_CONSTANT",
-"string_constant : TOK_CHAR_MESSAGE",
-"string_constant : TOK_CHAR_CUT",
-"opt_substring :",
-"opt_substring : substring",
-"substring : '(' optexpr ':' optexpr ')'",
-"optexpr :",
-"optexpr : expr",
-"opt_expr : '\\n'",
-"opt_expr : expr",
-"initial_value :",
-"initial_value : before_initial '=' expr",
-"before_initial :",
-"complex_const : '(' uexpr ',' uexpr ')'",
-"use_stat : word_use module_name",
-"use_stat : word_use module_name ',' rename_list",
-"use_stat : word_use module_name ',' TOK_ONLY ':' '\\n'",
-"use_stat : word_use module_name ',' TOK_ONLY ':' only_list",
-"word_use : TOK_USE",
-"module_name : TOK_NAME",
-"rename_list : rename_name",
-"rename_list : rename_list ',' rename_name",
-"rename_name : TOK_NAME TOK_POINT_TO TOK_NAME",
-"only_list : only_name",
-"only_list : only_list ',' only_name",
-"only_name : TOK_NAME TOK_POINT_TO TOK_NAME",
-"only_name : TOK_NAME",
-"exec : iffable",
-"exec : TOK_ALLOCATE '(' allocation_list opt_stat_spec ')'",
-"exec : TOK_DEALLOCATE '(' allocate_object_list opt_stat_spec ')'",
-"exec : TOK_NULLIFY '(' pointer_name_list ')'",
-"exec : word_endunit",
-"exec : word_endprogram opt_name",
-"exec : word_endsubroutine opt_name",
-"exec : word_endfunction opt_name",
-"exec : TOK_ENDMODULE opt_name",
-"exec : boucledo",
-"exec : logif iffable",
-"exec : TOK_WHERE '(' expr ')' opt_expr",
-"exec : TOK_ELSEWHERE",
-"exec : TOK_ENDWHERE",
-"exec : logif TOK_THEN",
-"exec : TOK_ELSEIF '(' expr ')' TOK_THEN",
-"exec : TOK_ELSE",
-"exec : TOK_ENDIF opt_name",
-"exec : TOK_CASE caselist ')'",
-"exec : TOK_SELECTCASE '(' expr ')'",
-"exec : TOK_CASEDEFAULT",
-"exec : TOK_ENDSELECT",
-"exec : TOK_CONTAINS",
-"word_endsubroutine : TOK_ENDSUBROUTINE",
-"word_endunit : TOK_ENDUNIT",
-"word_endprogram : TOK_ENDPROGRAM",
-"word_endfunction : TOK_ENDFUNCTION",
-"caselist : expr",
-"caselist : caselist ',' expr",
-"caselist : caselist ':' expr",
-"boucledo : worddo opt_int do_arg",
-"boucledo : wordwhile expr",
-"boucledo : TOK_ENDDO optname",
-"do_arg :",
-"do_arg : do_var '=' expr ',' expr",
-"do_arg : do_var '=' expr ',' expr ',' expr",
-"opt_int :",
-"opt_int : TOK_CSTINT opt_comma",
-"opt_name : '\\n'",
-"opt_name : TOK_NAME",
-"optname :",
-"optname : TOK_NAME",
-"worddo : TOK_PLAINDO",
-"wordwhile : TOK_DOWHILE",
-"dotarget :",
-"dotarget : TOK_CSTINT",
-"iffable : TOK_CONTINUE",
-"iffable : ident_dims after_ident_dims",
-"iffable : goto",
-"iffable : io",
-"iffable : call",
-"iffable : TOK_ALLOCATE '(' allocation_list opt_stat_spec ')'",
-"iffable : TOK_DEALLOCATE '(' allocate_object_list opt_stat_spec ')'",
-"iffable : TOK_EXIT optexpr",
-"iffable : TOK_RETURN opt_expr",
-"iffable : TOK_CYCLE opt_expr",
-"iffable : stop opt_expr",
-"iffable : int_list",
-"before_dims :",
-"ident_dims : ident before_dims dims dims",
-"ident_dims : ident_dims '%' ident before_dims dims dims",
-"int_list : TOK_CSTINT",
-"int_list : int_list ',' TOK_CSTINT",
-"after_ident_dims : '=' expr",
-"after_ident_dims : TOK_POINT_TO expr",
-"call : keywordcall opt_call",
-"opt_call :",
-"opt_call : '(' opt_callarglist ')'",
-"opt_callarglist :",
-"opt_callarglist : callarglist",
-"keywordcall : before_call TOK_NAME",
-"before_call : TOK_CALL",
-"callarglist : callarg",
-"callarglist : callarglist ',' callarg",
-"callarg : expr",
-"callarg : '*' label",
-"stop : TOK_PAUSE",
-"stop : TOK_STOP",
-"io : iofctl ioctl",
-"io : read option_read",
-"io : write ioctl",
-"io : write ioctl outlist",
-"io : TOK_REWIND after_rewind",
-"io : TOK_FORMAT",
-"opt_CHAR_INT :",
-"opt_CHAR_INT : TOK_CSTINT TOK_NAME",
-"idfile : '*'",
-"idfile : TOK_CSTINT",
-"idfile : ident",
-"option_print :",
-"option_print : ',' outlist",
-"option_inlist :",
-"option_inlist : inlist",
-"option_read : ioctl option_inlist",
-"option_read : infmt opt_inlist",
-"opt_outlist :",
-"opt_outlist : outlist",
-"opt_inlist :",
-"opt_inlist : ',' inlist",
-"ioctl : '(' ctllist ')'",
-"ioctl : '(' fexpr ')'",
-"after_rewind : '(' ident ')'",
-"after_rewind : '(' TOK_CSTINT ')'",
-"after_rewind : TOK_CSTINT",
-"after_rewind : '(' uexpr ')'",
-"after_rewind : TOK_NAME",
-"ctllist : ioclause",
-"ctllist : ctllist ',' ioclause",
-"ioclause : fexpr",
-"ioclause : '*'",
-"ioclause : TOK_DASTER",
-"ioclause : TOK_NAME expr",
-"ioclause : TOK_NAME expr '%' ident_dims",
-"ioclause : TOK_NAME '(' triplet ')'",
-"ioclause : TOK_NAME '*'",
-"ioclause : TOK_NAME TOK_DASTER",
-"iofctl : TOK_OPEN",
-"iofctl : TOK_CLOSE",
-"infmt : unpar_fexpr",
-"infmt : '*'",
-"read : TOK_READ",
-"read : TOK_INQUIRE",
-"read : TOK_PRINT",
-"write : TOK_WRITE",
-"fexpr : unpar_fexpr",
-"fexpr : '(' fexpr ')'",
-"unpar_fexpr : lhs",
-"unpar_fexpr : simple_const",
-"unpar_fexpr : fexpr addop fexpr",
-"unpar_fexpr : fexpr '*' fexpr",
-"unpar_fexpr : fexpr TOK_SLASH fexpr",
-"unpar_fexpr : fexpr TOK_DASTER fexpr",
-"unpar_fexpr : addop fexpr",
-"unpar_fexpr : fexpr TOK_DSLASH fexpr",
-"unpar_fexpr : TOK_FILE expr",
-"unpar_fexpr : TOK_EXIST expr",
-"unpar_fexpr : TOK_ERR expr",
-"unpar_fexpr : TOK_END expr",
-"unpar_fexpr : TOK_NAME '=' expr",
-"addop : '+'",
-"addop : '-'",
-"inlist : inelt",
-"inlist : inlist ',' inelt",
-"opt_lhs :",
-"opt_lhs : lhs",
-"inelt : opt_lhs opt_operation",
-"inelt : '(' inlist ')' opt_operation",
-"inelt : predefinedfunction opt_operation",
-"inelt : simple_const opt_operation",
-"inelt : '(' inlist ',' dospec ')'",
-"opt_operation :",
-"opt_operation : operation",
-"opt_operation : opt_operation operation",
-"outlist : uexpr",
-"outlist : other",
-"outlist : out2",
-"out2 : uexpr ',' expr",
-"out2 : uexpr ',' other",
-"out2 : other ',' expr",
-"out2 : other ',' other",
-"out2 : out2 ',' expr",
-"out2 : out2 ',' other",
-"out2 : uexpr",
-"out2 : predefinedfunction",
-"other : complex_const",
-"other : '(' expr ')'",
-"other : '(' uexpr ',' dospec ')'",
-"other : '(' other ',' dospec ')'",
-"other : '(' out2 ',' dospec ')'",
-"dospec : TOK_NAME '=' expr ',' expr",
-"dospec : TOK_NAME '=' expr ',' expr ',' expr",
-"labellist : label",
-"labellist : labellist ',' label",
-"label : TOK_CSTINT",
-"goto : TOK_PLAINGOTO '(' expr ',' expr ')' ',' expr",
-"goto : TOK_PLAINGOTO label",
-"allocation_list : allocate_object",
-"allocation_list : ident_dims",
-"allocation_list : allocation_list ',' allocate_object",
-"allocate_object : ident",
-"allocate_object : structure_component",
-"allocate_object : array_element",
-"array_element : ident '(' funargs ')'",
-"subscript_list : expr",
-"subscript_list : subscript_list ',' expr",
-"allocate_object_list : allocate_object",
-"allocate_object_list : allocate_object_list ',' allocate_object",
-"opt_stat_spec :",
-"opt_stat_spec : ',' TOK_STAT '=' ident",
-"pointer_name_list : ident",
-"pointer_name_list : pointer_name_list ',' ident",
-"opt_construct_name :",
-"opt_construct_name : TOK_NAME",
-"opt_construct_name_colon :",
-"opt_construct_name_colon : TOK_CONSTRUCTID ':'",
-"logif : TOK_LOGICALIF expr ')'",
-"do_var : ident",
-};
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
 #endif
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH 500
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
 #endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
 #endif
+{
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
 int yydebug;
-int yynerrs;
-int yyerrflag;
-int yychar;
-short *yyssp;
-YYSTYPE *yyvsp;
-YYSTYPE yyval;
-YYSTYPE yylval;
-short yyss[YYSTACKSIZE];
-YYSTYPE yyvs[YYSTACKSIZE];
-#define yystacksize YYSTACKSIZE
-#line 2567 "fortran.y"
-
-void processfortran(char *fichier_entree)
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static YYSIZE_T
+yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+    const char *yystr;
+#endif
 {
-   extern FILE *fortranin;
-   extern FILE *fortranout;
-   char nomfile[LONG_C];
-   int c;
-   int confirmyes;
-
-   /*fortrandebug = 1;*/
-   if ( mark == 1 ) printf("Firstpass == %d \n",firstpass);
-/******************************************************************************/
-/*  1-  Open input and output files                                           */
-/******************************************************************************/
-   strcpy(nomfile,commondirin);
-   strcat(nomfile,"/");
-   strcat(nomfile,fichier_entree);
-   fortranin=fopen( nomfile,"r");
-   if (! fortranin)
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+    char *yydest;
+    const char *yysrc;
+#endif
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
    {
-      printf("Error : File %s does not exist\n",nomfile);
-      exit(1);
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
    }
-
-   strcpy(curfile,nomfile);
-   strcpy(nomfile,commondirout);
-   strcat(nomfile,"/");
-   strcat(nomfile,fichier_entree);
-   strcpy(nomfileoutput,nomfile);
-   Save_Length(nomfileoutput,31);
-   if (firstpass == 1)
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
    {
-      if (checkexistcommon == 1)
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
       {
-         if (fopen(nomfile,"r"))
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
          {
-            printf("Warning : file %s already exist\n",nomfile);
-            confirmyes = 0;
-            while (confirmyes==0)
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
             {
-               printf("Override file %s ? [Y/N]\n",nomfile);
-               c=getchar();
-               getchar();
-               if (c==79 || c==110)
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
                {
-                  printf("We stop\n");
-                  exit(1);
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
                }
-               if (c==89 || c==121)
+	      else
                {
-                  confirmyes=1;
+		  yyp++;
+		  yyf++;
                }
             }
          }
+      return yysize;
       }
+}
+#endif /* YYERROR_VERBOSE */
+
+
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  switch (yytype)
+   {
+
+      default:
+	break;
    }
-
-/******************************************************************************/
-/*  2-  Variables initialization                                              */
-/******************************************************************************/
-
-   line_num_fortran_common=1;
-   line_num_fortran=1;
-   PublicDeclare = 0;
-   PrivateDeclare = 0;
-   ExternalDeclare = 0;
-   SaveDeclare = 0;
-   pointerdeclare = 0;
-   optionaldeclare = 0;
-   incalldeclare = 0;
-   VarType = 0;
-   VarTypepar = 0;
-   Allocatabledeclare = 0 ;
-   strcpy(NamePrecision," ");
-   VariableIsParameter =  0 ;
-   strcpy(NamePrecision,"");
-   c_star = 0 ;
-   functiondeclarationisdone = 0;
-   insubroutinedeclare = 0 ;
-   strcpy(subroutinename," ");
-   InitialValueGiven = 0 ;
-   strcpy(EmptyChar," ");
-   inmoduledeclare = 0;
-   colnum=0;
-   incom=0;
-   couldaddvariable=1;
-   aftercontainsdeclare = 1;
-   strcpy(nameinttypename,"");
-   /* Name of the file without format                                         */
-   tmp = strchr(fichier_entree, '.');
-   strncpy(curfilename,fichier_entree,strlen(fichier_entree)-strlen(tmp));
-   Save_Length(curfilename,30);
-/******************************************************************************/
-/*  3-  Parsing of the input file (1 time)                                    */
-/******************************************************************************/
-   if (firstpass == 0 )
-   {
-      fortranout=fopen(nomfileoutput,"w");
-
-      NewModule_Creation_0();
-   }
-
-   fortranparse();
-
-   strcpy(curfile,mainfile);
-
-   if (firstpass == 0 ) fclose(fortranout);
 }
-#line 7005 "y.tab.c"
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
-yyparse()
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
 {
-    register int yym, yyn, yystate;
-#if YYDEBUG
-    register char *yys;
-    extern char *getenv();
-
-    if (yys = getenv("YYDEBUG"))
-    {
-        yyn = *yys;
-        if (yyn >= '0' && yyn <= '9')
-            yydebug = yyn - '0';
-    }
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
     yynerrs = 0;
-    yyerrflag = 0;
-    yychar = (-1);
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
 
     yyssp = yyss;
     yyvsp = yyvs;
-    *yyssp = yystate = 0;
-
-yyloop:
-    if (yyn = yydefred[yystate]) goto yyreduce;
-    if (yychar < 0)
-    {
-        if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-        if (yydebug)
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
         {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, reading %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
+	/* Give user a chance to reallocate the stack.  Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	yytype_int16 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow (YY_("memory exhausted"),
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
         }
-#endif
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+    {
+	yytype_int16 *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+        }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
     }
-    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: state %d, shifting to state %d\n",
-                    YYPREFIX, yystate, yytable[yyn]);
-#endif
-        if (yyssp >= yyss + yystacksize - 1)
-        {
-            goto yyoverflow;
-        }
-        *++yyssp = yystate = yytable[yyn];
-        *++yyvsp = yylval;
-        yychar = (-1);
-        if (yyerrflag > 0)  --yyerrflag;
-        goto yyloop;
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
     }
-    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-        yyn = yytable[yyn];
-        goto yyreduce;
-    }
-    if (yyerrflag) goto yyinrecovery;
-#ifdef lint
-    goto yynewerror;
-#endif
-yynewerror:
-    yyerror("syntax error");
-#ifdef lint
-    goto yyerrlab;
-#endif
-yyerrlab:
-    ++yynerrs;
-yyinrecovery:
-    if (yyerrflag < 3)
-    {
-        yyerrflag = 3;
-        for (;;)
-        {
-            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
-                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
-#endif
-                if (yyssp >= yyss + yystacksize - 1)
-                {
-                    goto yyoverflow;
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
                 }
-                *++yyssp = yystate = yytable[yyn];
-                *++yyvsp = yylval;
-                goto yyloop;
-            }
             else
             {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: error recovery discarding state %d\n",
-                            YYPREFIX, *yyssp);
-#endif
-                if (yyssp <= yyss) goto yyabort;
-                --yyssp;
-                --yyvsp;
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
             }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
         }
-    }
-    else
-    {
-        if (yychar == 0) goto yyabort;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-        yychar = (-1);
-        goto yyloop;
-    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  yystate = yyn;
+  *++yyvsp = yylval;
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
 yyreduce:
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
-                YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
-    yym = yylen[yyn];
-    yyval = yyvsp[1-yym];
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
     switch (yyn)
     {
-case 7:
-#line 341 "fortran.y"
-{yyerrok;yyclearin;}
-break;
-case 12:
-#line 349 "fortran.y"
-{
+        case 8:
+#line 344 "fortran.y"
+    {yyerrok;yyclearin;;}
+    break;
+
+  case 13:
+#line 352 "fortran.y"
+    {
                      if (inmoduledeclare == 0 )
                      {
@@ -7156,43 +3683,54 @@
                                               pos_end-pos_curinclude);
                      }
-                  }
-break;
-case 17:
-#line 365 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 18:
+#line 368 "fortran.y"
+    {
             /* we should ignore the declaration until the keyword             */
             /*    TOK_ENDDONOTTREAT                                           */
             couldaddvariable = 0 ;
             RemoveWordCUR_0(fortranout,-20,20);
-         }
-break;
-case 18:
-#line 372 "fortran.y"
-{
+         ;}
+    break;
+
+  case 19:
+#line 375 "fortran.y"
+    {
              couldaddvariable = 1 ;
              RemoveWordCUR_0(fortranout,-24,24);
-          }
-break;
-case 21:
-#line 379 "fortran.y"
-{pos_cur = setposcur();}
-break;
-case 26:
-#line 388 "fortran.y"
-{incom = 1;}
-break;
-case 27:
-#line 391 "fortran.y"
-{if (incom !=1) {strcpy(curbuf,"");incom=0;}}
-break;
-case 31:
-#line 398 "fortran.y"
-{
-                      if ( couldaddvariable == 1 )
+          ;}
+    break;
+
+  case 22:
+#line 382 "fortran.y"
+    {pos_cur = setposcur();;}
+    break;
+
+  case 27:
+#line 394 "fortran.y"
+    {if (incom !=1) {strcpy(curbuf,"");incom=0;};}
+    break;
+
+  case 28:
+#line 397 "fortran.y"
+    {isrecursive = 0;;}
+    break;
+
+  case 29:
+#line 399 "fortran.y"
+    {isrecursive = 1;;}
+    break;
+
+  case 31:
+#line 403 "fortran.y"
+                      {
+                      if ( couldaddvariable == 1)
                       {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(3) - (4)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
@@ -7200,5 +3738,5 @@
 
                       }
-                      Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                      Add_SubroutineArgument_Var_1((yyvsp[(4) - (4)].l));
                       if ( inmodulemeet == 1 )
                       {
@@ -7214,13 +3752,14 @@
                       }
                       }
-                   }
-break;
-case 32:
-#line 426 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 32:
+#line 431 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[0].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (2)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
@@ -7228,5 +3767,5 @@
 
                       }
-                      strcpy(subroutinename,yyvsp[0].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (2)].nac));
                       /* Common case                                          */
                       insubroutinedeclare = 1;
@@ -7234,18 +3773,19 @@
                       /*    the subroutine sub_loop_<subroutinename>          */
                       writeheadnewsub_0(1);
-                   }
-break;
-case 33:
-#line 444 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 33:
+#line 449 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-3].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (5)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-3].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (5)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7253,5 +3793,5 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[-2].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (5)].l));
                          strcpy(DeclType,"");
                          /* in the second step we should write the head of    */
@@ -7264,23 +3804,24 @@
                             /* we should to list of the subroutine argument   */
                             /* name of the function which has to be defined   */
-                            Add_SubroutineArgument_Var_1(yyvsp[-2].l);
+                            Add_SubroutineArgument_Var_1((yyvsp[(3) - (5)].l));
                             strcpy(DeclType,"");
-                            Add_FunctionType_Var_1(yyvsp[-3].nac);
+                            Add_FunctionType_Var_1((yyvsp[(2) - (5)].nac));
                             writeheadnewsub_0(2);
                       }
-                   }
-break;
-case 34:
-#line 477 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 34:
+#line 482 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (3)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-1].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (3)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7288,7 +3829,7 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
                          strcpy(DeclType,"");
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7300,18 +3841,19 @@
                             /* we should to list of the subroutine argument   */
                             /* name of the function which has to be defined   */
-                            Add_SubroutineArgument_Var_1(yyvsp[0].l);
+                            Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
                             strcpy(DeclType,"");
-                            Add_FunctionType_Var_1(yyvsp[-1].nac);
+                            Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                             writeheadnewsub_0(2);
                       }
-                   }
-break;
-case 35:
-#line 511 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 35:
+#line 516 "fortran.y"
+    {
                       GlobalDeclaration = 0;
-                      strcpy(curmodulename,yyvsp[0].nac);
+                      strcpy(curmodulename,(yyvsp[(2) - (2)].nac));
                       strcpy(subroutinename,"");
-                      Add_NameOfModule_1(yyvsp[0].nac);
+                      Add_NameOfModule_1((yyvsp[(2) - (2)].nac));
                       if ( inmoduledeclare == 0 )
                       {
@@ -7323,92 +3865,104 @@
                          aftercontainsdeclare = 0 ;
                       }
-                   }
-break;
-case 36:
-#line 528 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 36:
+#line 533 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,yyvsp[0].nac);strcpy(subroutinename,yyvsp[0].nac);
+                         strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));strcpy(subroutinename,(yyvsp[(1) - (1)].nac));
                       }
-                   }
-break;
-case 38:
-#line 537 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 38:
+#line 542 "fortran.y"
+    {
                       pos_curinclude = setposcur()-9;
-                   }
-break;
-case 39:
-#line 541 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) Add_Include_1(yyvsp[0].nac);
-                   }
-break;
-case 40:
-#line 545 "fortran.y"
-{
-                      if ( firstpass == 1 && couldaddvariable == 1) yyval.l=NULL;
-                   }
-break;
-case 41:
-#line 548 "fortran.y"
-{
-                      if ( firstpass == 1 && couldaddvariable == 1 ) yyval.l=NULL;
-                   }
-break;
-case 42:
-#line 552 "fortran.y"
-{
-                       if ( firstpass == 1 && couldaddvariable == 1 ) yyval.l=yyvsp[-1].l;
-                   }
-break;
-case 45:
-#line 559 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 39:
+#line 546 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) Add_Include_1((yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 40:
+#line 550 "fortran.y"
+    {
+                      if ( firstpass == 1 && couldaddvariable == 1) (yyval.l)=NULL;
+                   ;}
+    break;
+
+  case 41:
+#line 553 "fortran.y"
+    {
+                      if ( firstpass == 1 && couldaddvariable == 1 ) (yyval.l)=NULL;
+                   ;}
+    break;
+
+  case 42:
+#line 557 "fortran.y"
+    {
+                       if ( firstpass == 1 && couldaddvariable == 1 ) (yyval.l)=(yyvsp[(2) - (3)].l);
+                   ;}
+    break;
+
+  case 45:
+#line 564 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         Add_SubroutineArgument_Var_1(yyvsp[-1].l);
+                         Add_SubroutineArgument_Var_1((yyvsp[(2) - (3)].l));
                       }
-                   }
-break;
-case 46:
-#line 566 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 46:
+#line 571 "fortran.y"
+    {
                       if ( firstpass == 1  && couldaddvariable == 1)
                       {
                          strcpy(nameinttypenameback,nameinttypename);
                          strcpy(nameinttypename,"");
-                         curvar=createvar(yyvsp[0].na,NULL);
+                         curvar=createvar((yyvsp[(1) - (1)].na),NULL);
                         strcpy(nameinttypename,nameinttypenameback);
                          curlistvar=insertvar(NULL,curvar);
-                         yyval.l=settype("",curlistvar);
+                         (yyval.l)=settype("",curlistvar);
                       }
-                   }
-break;
-case 47:
-#line 578 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 47:
+#line 583 "fortran.y"
+    {
                       if ( firstpass == 1  && couldaddvariable == 1)
                       {
                          strcpy(nameinttypenameback,nameinttypename);
                          strcpy(nameinttypename,"");                      
-                         curvar=createvar(yyvsp[0].na,NULL);
+                         curvar=createvar((yyvsp[(3) - (3)].na),NULL);
                          strcpy(nameinttypename,nameinttypenameback);                         
-                         yyval.l=insertvar(yyvsp[-2].l,curvar);
+                         (yyval.l)=insertvar((yyvsp[(1) - (3)].l),curvar);
                       }
-                   }
-break;
-case 48:
-#line 589 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 49:
-#line 590 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,"*");}
-break;
-case 50:
-#line 593 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 48:
+#line 594 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 49:
+#line 595 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),"*");;}
+    break;
+
+  case 50:
+#line 598 "fortran.y"
+    {
                       if ( VarTypepar == 1 )
                       {
@@ -7416,9 +3970,10 @@
                          VarTypepar = 0;
                       }
-                   }
-break;
-case 51:
-#line 601 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 51:
+#line 606 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -7426,22 +3981,26 @@
                          couldaddvariable = 0 ;
                       }
-                   }
-break;
-case 52:
-#line 609 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 52:
+#line 614 "fortran.y"
+    {
                       if ( VarType == 1 ) couldaddvariable = 1 ;
                       VarType = 0;
                       VarTypepar = 0;
-                   }
-break;
-case 54:
-#line 616 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 54:
+#line 621 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[-1].l);
-                         else Add_Parameter_Var_1(yyvsp[-1].l);
+                         {
+                                                  Add_GlobalParameter_Var_1((yyvsp[(3) - (4)].l));
+                                                  }
+                         else Add_Parameter_Var_1((yyvsp[(3) - (4)].l));
                          pos_end = setposcur();
                         RemoveWordSET_0(fortranout,pos_cur_decl,
@@ -7449,14 +4008,15 @@
                       }
                       VariableIsParameter =  0 ;
-                   }
-break;
-case 55:
-#line 629 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 55:
+#line 636 "fortran.y"
+    {
                      if ( couldaddvariable == 1 )
                      {
                         if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[0].l);
-                         else Add_Parameter_Var_1(yyvsp[0].l);
+                                                  Add_GlobalParameter_Var_1((yyvsp[(2) - (2)].l));
+                         else Add_Parameter_Var_1((yyvsp[(2) - (2)].l));
                          pos_end = setposcur();
                          RemoveWordSET_0(fortranout,pos_cur_decl,
@@ -7464,17 +4024,19 @@
                       }
                       VariableIsParameter =  0 ;
-                   }
-break;
-case 57:
-#line 643 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 57:
+#line 650 "fortran.y"
+    {
                      pos_end = setposcur();
                      RemoveWordSET_0(fortranout,pos_cursave,
                                                 pos_end-pos_cursave);
-                  }
-break;
-case 59:
-#line 650 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 59:
+#line 657 "fortran.y"
+    {
                    /* if the variable is a parameter we can suppose that is   */
                    /*    value is the same on each grid. It is not useless to */
@@ -7482,10 +4044,10 @@
                       if ( couldaddvariable == 1 )
                       {
-                         Add_Globliste_1(yyvsp[0].l);
+                         Add_Globliste_1((yyvsp[(1) - (1)].l));
                          /* if variableparamlists has been declared in a      */
                          /*    subroutine                                     */
                          if ( insubroutinedeclare == 1 )
                          {
-                            Add_Dimension_Var_1(yyvsp[0].l);
+                            Add_Dimension_Var_1((yyvsp[(1) - (1)].l));
                          }
                          pos_end = setposcur();
@@ -7503,4 +4065,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -7510,26 +4073,28 @@
                       strcpy(nameinttypename,"");
                       strcpy(c_selectorname,"");
-                   }
-break;
-case 60:
-#line 686 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 60:
+#line 694 "fortran.y"
+    {
       if (firstpass == 0)
       {
-      if (yyvsp[0].lnn)
+      if ((yyvsp[(1) - (1)].lnn))
       {
-      removeglobfromlist(&(yyvsp[0].lnn));
+      removeglobfromlist(&((yyvsp[(1) - (1)].lnn)));
       pos_end = setposcur();
            RemoveWordSET_0(fortranout,pos_cur,pos_end-pos_cur);
-      writelistpublic(yyvsp[0].lnn);
+      writelistpublic((yyvsp[(1) - (1)].lnn));
       }
       }
-      }
-break;
-case 70:
-#line 708 "fortran.y"
-{
+      ;}
+    break;
+
+  case 70:
+#line 716 "fortran.y"
+    {
                       /* we should remove the data declaration                */
-                      if ( couldaddvariable == 1 && aftercontainsdeclare == 0 )
+                      if ( couldaddvariable == 1 && aftercontainsdeclare != 2 )
                       {
                         pos_end = setposcur();
@@ -7537,16 +4102,26 @@
                                               pos_end-pos_curdata);
                       }
+                      if ( couldaddvariable == 1 && aftercontainsdeclare == 1 )
+                      {
+                      if (firstpass == 0)
+                      {
+                        ReWriteDataStatement_0(fortranout);
+                        pos_end = setposcur();
                   }
-break;
-case 72:
-#line 720 "fortran.y"
-{
+                      }
+                  ;}
+    break;
+
+  case 72:
+#line 736 "fortran.y"
+    {
          PublicDeclare = 0 ;
          PrivateDeclare = 0 ;
-      }
-break;
-case 110:
-#line 771 "fortran.y"
-{
+      ;}
+    break;
+
+  case 110:
+#line 787 "fortran.y"
+    {
                       /* if the variable is a parameter we can suppose that is*/
                       /*    value is the same on each grid. It is not useless */
@@ -7563,5 +4138,5 @@
                       else
                        {*/
-                        ReWriteDeclarationAndAddTosubroutine_01(yyvsp[-1].l);
+                        ReWriteDeclarationAndAddTosubroutine_01((yyvsp[(1) - (2)].l));
                         pos_cur_decl = setposcur();
                         
@@ -7571,4 +4146,5 @@
                            insubroutinedeclare == 0 )
                       {
+
                          sprintf(ligne,"\n#include \"Module_Declar_%s.h\"\n"
                                                                 ,curmodulename);
@@ -7579,15 +4155,17 @@
                          tofich (module_declar, ligne,1);
                          GlobalDeclaration = 1 ;
+                         pos_cur_decl = setposcur();
+
                       }
-                         yyval.l = yyvsp[-1].l;
-                         Add_Globliste_1(yyvsp[-1].l);
+                         (yyval.l) = (yyvsp[(1) - (2)].l);
+                         Add_Globliste_1((yyvsp[(1) - (2)].l));
                                                   
                          if ( insubroutinedeclare == 0 )
-                                                  Add_GlobalParameter_Var_1(yyvsp[-1].l);
+                                                  Add_GlobalParameter_Var_1((yyvsp[(1) - (2)].l));
                          else
                          {
                             if ( pointerdeclare == 1 )
-                                                Add_Pointer_Var_From_List_1(yyvsp[-1].l);
-                            Add_Parameter_Var_1(yyvsp[-1].l);
+                                                Add_Pointer_Var_From_List_1((yyvsp[(1) - (2)].l));
+                            Add_Parameter_Var_1((yyvsp[(1) - (2)].l));
                          }
 
@@ -7604,6 +4182,6 @@
                               SaveDeclare == 1 && firstpass == 1 )
                          {
-                              if ( inmodulemeet == 0 ) Add_Save_Var_dcl_1(yyvsp[-1].l);
-                              else  Add_SubroutineDeclarationSave_Var_1(yyvsp[-1].l);
+                              if ( inmodulemeet == 0 ) Add_Save_Var_dcl_1((yyvsp[(1) - (2)].l));
+                              else  Add_SubroutineDeclarationSave_Var_1((yyvsp[(1) - (2)].l));
                          }
                       }
@@ -7618,4 +4196,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -7625,18 +4204,19 @@
                       strcpy(nameinttypename,"");
                       strcpy(c_selectorname,"");
-                   }
-break;
-case 111:
-#line 850 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 111:
+#line 870 "fortran.y"
+    {
                       /* open param file                                      */
                       if ( firstpass == 0 )
                       {
-                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,yyvsp[-1].nac);
+                         sprintf(ligne,"%s/ParamFile%s.h",nomdir,(yyvsp[(2) - (3)].nac));
                          paramout=fopen(ligne,"w");
                          if ( retour77 == 0 ) fprintf(paramout,"!\n");
                          else fprintf(paramout,"C\n");
                       }
-                      strcpy(subroutinename,yyvsp[-1].nac);
+                      strcpy(subroutinename,(yyvsp[(2) - (3)].nac));
                       if ( inmodulemeet == 1 )
                       {
@@ -7644,6 +4224,6 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7655,6 +4235,6 @@
                          /* we should to list of the subroutine argument the  */
                          /*    name of the function which has to be defined   */
-                         Add_SubroutineArgument_Var_1(yyvsp[0].l);
-                         Add_FunctionType_Var_1(yyvsp[-1].nac);
+                         Add_SubroutineArgument_Var_1((yyvsp[(3) - (3)].l));
+                         Add_FunctionType_Var_1((yyvsp[(2) - (3)].nac));
                          /* in the second step we should write the head of    */
                          /*    the subroutine sub_loop_<subroutinename>       */
@@ -7663,50 +4243,67 @@
                       strcpy(nameinttypename,"");
 
-                   }
-break;
-case 112:
-#line 887 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 112:
+#line 907 "fortran.y"
+    {
                        functiondeclarationisdone = 1;
-                   }
-break;
-case 113:
-#line 893 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 113:
+#line 913 "fortran.y"
+    {
                       VariableIsParameter = 1;
                       pos_curparameter = setposcur()-9;
-                   }
-break;
-case 114:
-#line 898 "fortran.y"
-{
-                      pos_curdata = setposcur()-strlen(yyvsp[0].nac);
-                   }
-break;
-case 115:
-#line 902 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 114:
+#line 918 "fortran.y"
+    {
+                      pos_curdata = setposcur()-strlen((yyvsp[(1) - (1)].nac));
+                      Init_List_Data_Var();
+                   ;}
+    break;
+
+  case 115:
+#line 923 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",yyvsp[-1].na);
-                      Add_Data_Var_1(yyvsp[-3].nac,ligne);
+/*                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+/*                      sprintf(ligne,"%s",$3);*/
+                      createstringfromlistname(ligne,(yyvsp[(3) - (4)].lnn));
+                      if (firstpass == 1)
+                      Add_Data_Var_1(&List_Data_Var,(yyvsp[(1) - (4)].nac),ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,(yyvsp[(1) - (4)].nac),ligne);
                       }
-                   }
-break;
-case 116:
-#line 911 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 116:
+#line 937 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",yyvsp[-1].na);
-                      Add_Data_Var_1(yyvsp[-3].nac,ligne);
+                      /*if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+                      /*sprintf(ligne,"%s",$5);   */
+                      createstringfromlistname(ligne,(yyvsp[(5) - (6)].lnn));                      
+                      if (firstpass == 1)                      
+                      Add_Data_Var_1(&List_Data_Var,(yyvsp[(3) - (6)].nac),ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,(yyvsp[(3) - (6)].nac),ligne);                      
                       }
-                   }
-break;
-case 117:
-#line 920 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 117:
+#line 951 "fortran.y"
+    {
                        /*******************************************************/
                        /*******************************************************/
@@ -7716,78 +4313,132 @@
                        /*******************************************************/
                        /*******************************************************/
-                   }
-break;
-case 118:
-#line 931 "fortran.y"
-{
+                       if (firstpass == 1)
+                       Add_Data_Var_Names_01(&List_Data_Var,(yyvsp[(1) - (4)].lnn),(yyvsp[(3) - (4)].lnn));
+                       else
+                       Add_Data_Var_Names_01(&List_Data_Var_Cur,(yyvsp[(1) - (4)].lnn),(yyvsp[(3) - (4)].lnn));
+                   ;}
+    break;
+
+  case 118:
+#line 966 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.na,yyvsp[0].na);
+                         (yyval.lnn) = Insertname(NULL,(yyvsp[(1) - (1)].na),0);
                       }
-                   }
-break;
-case 119:
-#line 938 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 119:
+#line 973 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);
+                         (yyval.lnn) = Insertname((yyvsp[(3) - (3)].lnn),(yyvsp[(1) - (3)].na),1);
                       }
-                   }
-break;
-case 124:
-#line 952 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 124:
+#line 987 "fortran.y"
+    {
                      pos_cursave = setposcur()-4;
-                  }
-break;
-case 126:
-#line 958 "fortran.y"
-{
-                     if ( couldaddvariable == 1 ) Add_Save_Var_1(yyvsp[-1].nac,yyvsp[0].d);
-                  }
-break;
-case 130:
-#line 967 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].nac);}
-break;
-case 131:
-#line 969 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s+%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 132:
-#line 971 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s-%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 133:
-#line 973 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s*%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 134:
-#line 975 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s/%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 135:
-#line 978 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"");}
-break;
-case 136:
-#line 980 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 145:
-#line 995 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 126:
+#line 993 "fortran.y"
+    {
+                     if ( couldaddvariable == 1 ) Add_Save_Var_1((yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].d));
+                  ;}
+    break;
+
+  case 127:
+#line 998 "fortran.y"
+    {
+		(yyval.lnn)=Insertname(NULL,(yyvsp[(1) - (1)].nac),0);
+		;}
+    break;
+
+  case 128:
+#line 1002 "fortran.y"
+    {
+      printf("INSTRUCTION NON TRAITEE : INITIALISATION DE DATA AVEC EXPRESSION\n");
+      exit(0);
+      ;}
+    break;
+
+  case 129:
+#line 1007 "fortran.y"
+    {
+      (yyval.lnn) = concat_listname((yyvsp[(1) - (3)].lnn),(yyvsp[(3) - (3)].lnn));
+      ;}
+    break;
+
+  case 130:
+#line 1012 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 131:
+#line 1014 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s+%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 132:
+#line 1016 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s-%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 133:
+#line 1018 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s*%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 134:
+#line 1020 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s/%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 135:
+#line 1023 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"");;}
+    break;
+
+  case 136:
+#line 1025 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 143:
+#line 1037 "fortran.y"
+    {
+	ininterfacedeclare = 1 ;
+	printf("INTEFACE entree\n");
+	;}
+    break;
+
+  case 144:
+#line 1042 "fortran.y"
+    {
+      ininterfacedeclare = 0;
+      ;}
+    break;
+
+  case 145:
+#line 1047 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curdimension = setposcur()-9;
-                   }
-break;
-case 146:
-#line 1001 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 146:
+#line 1053 "fortran.y"
+    {
          if ( couldaddvariable == 1 )
          {
             /*                                                                */
-            curvar=createvar(yyvsp[-2].nac,yyvsp[-1].d);
+            curvar=createvar((yyvsp[(3) - (5)].nac),(yyvsp[(4) - (5)].d));
             /*                                                                */
             CreateAndFillin_Curvar("",curvar);
@@ -7795,160 +4446,178 @@
             curlistvar=insertvar(NULL,curvar);
             /*                                                                */
-            yyval.l=settype("",curlistvar);
+            (yyval.l)=settype("",curlistvar);
             /*                                                                */
             strcpy(vallengspec,"");
          }
-      }
-break;
-case 147:
-#line 1017 "fortran.y"
-{
+      ;}
+    break;
+
+  case 147:
+#line 1069 "fortran.y"
+    {
          if ( couldaddvariable == 1 )
          {
             /*                                                                */
-            curvar=createvar(yyvsp[-2].nac,yyvsp[-1].d);
+            curvar=createvar((yyvsp[(3) - (5)].nac),(yyvsp[(4) - (5)].d));
             /*                                                                */
             CreateAndFillin_Curvar("",curvar);
             /*                                                                */
-            curlistvar=insertvar(yyvsp[-4].l,curvar);
+            curlistvar=insertvar((yyvsp[(1) - (5)].l),curvar);
             /*                                                                */
-            yyval.l=curlistvar;
+            (yyval.l)=curlistvar;
             /*                                                                */
             strcpy(vallengspec,"");
          }
-      }
-break;
-case 150:
-#line 1037 "fortran.y"
-{
-        yyval.lnn=(listname *)NULL;
-        }
-break;
-case 151:
-#line 1041 "fortran.y"
-{
-          yyval.lnn=yyvsp[0].lnn;
-         }
-break;
-case 152:
-#line 1046 "fortran.y"
-{
-           yyval.lnn = Insertname(NULL,yyvsp[0].nac);
-           }
-break;
-case 153:
-#line 1050 "fortran.y"
-{
-          yyval.lnn = Insertname(yyvsp[-2].lnn,yyvsp[0].nac);
-          }
-break;
-case 154:
-#line 1055 "fortran.y"
-{
+      ;}
+    break;
+
+  case 150:
+#line 1089 "fortran.y"
+    {
+        (yyval.lnn)=(listname *)NULL;
+        ;}
+    break;
+
+  case 151:
+#line 1093 "fortran.y"
+    {
+          (yyval.lnn)=(yyvsp[(3) - (3)].lnn);
+         ;}
+    break;
+
+  case 152:
+#line 1098 "fortran.y"
+    {
+           (yyval.lnn) = Insertname(NULL,(yyvsp[(1) - (1)].nac),0);
+           ;}
+    break;
+
+  case 153:
+#line 1102 "fortran.y"
+    {
+          (yyval.lnn) = Insertname((yyvsp[(1) - (3)].lnn),(yyvsp[(3) - (3)].nac),0);
+          ;}
+    break;
+
+  case 154:
+#line 1107 "fortran.y"
+    {
                          pos_end = setposcur();
                          RemoveWordSET_0(fortranout,pos_curcommon,
                                                   pos_end-pos_curcommon);
-                   }
-break;
-case 155:
-#line 1061 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 155:
+#line 1113 "fortran.y"
+    {
                          if ( couldaddvariable == 1 )
                          {
-                            sprintf(charusemodule,"%s",yyvsp[-1].nac);
-                            Add_NameOfCommon_1(yyvsp[-1].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(2) - (3)].nac));
+                            Add_NameOfCommon_1((yyvsp[(2) - (3)].nac),subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
                                                        pos_end-pos_curcommon);
                          }
-                   }
-break;
-case 156:
-#line 1072 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 156:
+#line 1124 "fortran.y"
+    {
                          if ( couldaddvariable == 1 )
                          {
-                            sprintf(charusemodule,"%s",yyvsp[-2].nac);
-                            Add_NameOfCommon_1(yyvsp[-2].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(3) - (5)].nac));
+                            Add_NameOfCommon_1((yyvsp[(3) - (5)].nac),subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
                                                        pos_end-pos_curcommon);
                          }
-                   }
-break;
-case 157:
-#line 1084 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 157:
+#line 1136 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curcommon = setposcur()-6;
-                   }
-break;
-case 158:
-#line 1089 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 158:
+#line 1141 "fortran.y"
+    {
                       positioninblock=0;
                       pos_curcommon = setposcur()-6-7;
-                   }
-break;
-case 159:
-#line 1095 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 159:
+#line 1147 "fortran.y"
+    {
                       if ( couldaddvariable == 1 ) Add_Common_var_1();
-                   }
-break;
-case 160:
-#line 1100 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 160:
+#line 1152 "fortran.y"
+    {
                       if ( couldaddvariable == 1 ) Add_Common_var_1();
-                   }
-break;
-case 161:
-#line 1104 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 161:
+#line 1156 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          positioninblock = positioninblock + 1 ;
-                         strcpy(commonvar,yyvsp[-1].nac);
-                         commondim = yyvsp[0].d;
+                         strcpy(commonvar,(yyvsp[(1) - (2)].nac));
+                         commondim = (yyvsp[(2) - (2)].d);
                       }
-                   }
-break;
-case 162:
-#line 1114 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 162:
+#line 1166 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,"");
+                         strcpy((yyval.nac),"");
                          positioninblock=0;
                          strcpy(commonblockname,"");
                       }
-                   }
-break;
-case 163:
-#line 1123 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 163:
+#line 1175 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy(yyval.nac,yyvsp[-1].nac);
+                         strcpy((yyval.nac),(yyvsp[(2) - (3)].nac));
                          positioninblock=0;
-                         strcpy(commonblockname,yyvsp[-1].nac);
+                         strcpy(commonblockname,(yyvsp[(2) - (3)].nac));
                       }
-                   }
-break;
-case 166:
-#line 1136 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) yyval.l=insertvar(NULL,yyvsp[0].v);
-                   }
-break;
-case 167:
-#line 1140 "fortran.y"
-{
-                      if ( couldaddvariable == 1 ) yyval.l=insertvar(yyvsp[-2].l,yyvsp[0].v);
-                   }
-break;
-case 168:
-#line 1145 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 166:
+#line 1188 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) (yyval.l)=insertvar(NULL,(yyvsp[(1) - (1)].v));
+                   ;}
+    break;
+
+  case 167:
+#line 1192 "fortran.y"
+    {
+                      if ( couldaddvariable == 1 ) (yyval.l)=insertvar((yyvsp[(1) - (3)].l),(yyvsp[(3) - (3)].v));
+                   ;}
+    break;
+
+  case 168:
+#line 1197 "fortran.y"
+    {
                      if ( couldaddvariable == 1 )
                      {
@@ -7958,21 +4627,22 @@
                          /*                                                   */
                          curvar->v_VariableIsParameter=1;
-                         strcpy(curvar->v_nomvar,yyvsp[-2].nac);
-                         Save_Length(yyvsp[-2].nac,4);
+                         strcpy(curvar->v_nomvar,(yyvsp[(1) - (3)].nac));
+                         Save_Length((yyvsp[(1) - (3)].nac),4);
                          strcpy(curvar->v_subroutinename,subroutinename);
                          Save_Length(subroutinename,11);
                          strcpy(curvar->v_modulename,curmodulename);
                          Save_Length(curmodulename,6);
-                         strcpy(curvar->v_initialvalue,yyvsp[0].na);
-                         Save_Length(yyvsp[0].na,14);
+                         strcpy(curvar->v_initialvalue,(yyvsp[(3) - (3)].na));
+                         Save_Length((yyvsp[(3) - (3)].na),14);
                          strcpy(curvar->v_commoninfile,mainfile);
                          Save_Length(mainfile,10);
-                         yyval.v=curvar;
+                         (yyval.v)=curvar;
                       }
-                   }
-break;
-case 172:
-#line 1173 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 172:
+#line 1225 "fortran.y"
+    {
                        if ( insubroutinedeclare == 1 )
                        {
@@ -7982,9 +4652,10 @@
                                                              13);
                        }
-                    }
-break;
-case 175:
-#line 1187 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 175:
+#line 1239 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -7992,9 +4663,9 @@
                          if (dimsgiven == 1)
                          {
-                            curvar=createvar(yyvsp[-3].nac,curdim);
+                            curvar=createvar((yyvsp[(3) - (6)].nac),curdim);
                          }
                          else
                          {
-                            curvar=createvar(yyvsp[-3].nac,yyvsp[-2].d);
+                            curvar=createvar((yyvsp[(3) - (6)].nac),(yyvsp[(4) - (6)].d));
                          }
                          /*                                                   */
@@ -8013,29 +4684,30 @@
                             }
                          }
-                         yyval.l=settype(DeclType,curlistvar);
+                         (yyval.l)=settype(DeclType,curlistvar);
                       }
                       strcpy(vallengspec,"");
-                   }
-break;
-case 176:
-#line 1219 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 176:
+#line 1271 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
                          if (dimsgiven == 1)
                          {
-                            curvar=createvar(yyvsp[-3].nac,curdim);
+                            curvar=createvar((yyvsp[(4) - (7)].nac),curdim);
                          }
                          else
                          {
-                            curvar=createvar(yyvsp[-3].nac,yyvsp[-2].d);
+                            curvar=createvar((yyvsp[(4) - (7)].nac),(yyvsp[(5) - (7)].d));
                          }
                          /*                                                   */
-                         CreateAndFillin_Curvar(yyvsp[-6].l->var->v_typevar,curvar);
+                         CreateAndFillin_Curvar((yyvsp[(1) - (7)].l)->var->v_typevar,curvar);
                          /*                                                   */
-                         strcpy(curvar->v_typevar,(yyvsp[-6].l->var->v_typevar));
-                         Save_Length(yyvsp[-6].l->var->v_typevar,3);
+                         strcpy(curvar->v_typevar,((yyvsp[(1) - (7)].l)->var->v_typevar));
+                         Save_Length((yyvsp[(1) - (7)].l)->var->v_typevar,3);
                          /*                                                   */
-                         curlistvar=insertvar(yyvsp[-6].l,curvar);
+                         curlistvar=insertvar((yyvsp[(1) - (7)].l),curvar);
                          if (!strcasecmp(DeclType,"character"))
                          {
@@ -8049,563 +4721,697 @@
                             }
                          }
-                         yyval.l=curlistvar;
+                         (yyval.l)=curlistvar;
                       }
                       strcpy(vallengspec,"");
-                   }
-break;
-case 177:
-#line 1253 "fortran.y"
-{dimsgiven=0;}
-break;
-case 178:
-#line 1256 "fortran.y"
-{strcpy(DeclType,yyvsp[-1].nac);}
-break;
-case 179:
-#line 1258 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 177:
+#line 1305 "fortran.y"
+    {dimsgiven=0;;}
+    break;
+
+  case 178:
+#line 1308 "fortran.y"
+    {strcpy(DeclType,(yyvsp[(1) - (2)].nac));;}
+    break;
+
+  case 179:
+#line 1310 "fortran.y"
+    {
                       strcpy(DeclType,"CHARACTER");
-                   }
-break;
-case 180:
-#line 1262 "fortran.y"
-{
-                      strcpy(DeclType,yyvsp[-2].nac);
-                      strcpy(nameinttypename,yyvsp[0].nac);
-                   }
-break;
-case 181:
-#line 1267 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 180:
+#line 1314 "fortran.y"
+    {
+                      strcpy(DeclType,(yyvsp[(1) - (3)].nac));
+                      strcpy(nameinttypename,(yyvsp[(3) - (3)].nac));
+                   ;}
+    break;
+
+  case 181:
+#line 1319 "fortran.y"
+    {
                       strcpy(DeclType,"TYPE");
-                   }
-break;
-case 182:
-#line 1272 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 182:
+#line 1324 "fortran.y"
+    {
                  /*     if ( couldaddvariable == 1 ) VarTypepar = 1 ;
                       couldaddvariable = 0 ;
                       pos_cur_decl = setposcur()-5;*/
                    pos_cur_decl = setposcur()-5;
-                   }
-break;
-case 184:
-#line 1281 "fortran.y"
-{c_selectorgiven=1;strcpy(c_selectorname,yyvsp[0].nac);}
-break;
-case 185:
-#line 1282 "fortran.y"
-{c_star = 1;}
-break;
-case 190:
-#line 1290 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 184:
+#line 1333 "fortran.y"
+    {c_selectorgiven=1;strcpy(c_selectorname,(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 185:
+#line 1334 "fortran.y"
+    {c_star = 1;;}
+    break;
+
+  case 190:
+#line 1342 "fortran.y"
+    {
                       pos_cur_decl = setposcur()-9;
-                   }
-break;
-case 191:
-#line 1294 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 192:
-#line 1297 "fortran.y"
-{
-                      strcpy(yyval.nac,"INTEGER");
+                   ;}
+    break;
+
+  case 191:
+#line 1346 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 192:
+#line 1349 "fortran.y"
+    {
+                      strcpy((yyval.nac),"INTEGER");
                       pos_cur_decl = setposcur()-7;
-                   }
-break;
-case 193:
-#line 1301 "fortran.y"
-{
-                      strcpy(yyval.nac,"REAL");
+                   ;}
+    break;
+
+  case 193:
+#line 1353 "fortran.y"
+    {
+                      strcpy((yyval.nac),"REAL");
                       pos_cur_decl = setposcur()-4;
-                   }
-break;
-case 194:
-#line 1306 "fortran.y"
-{strcpy(yyval.nac,"COMPLEX");
-                   pos_cur_decl = setposcur()-7;}
-break;
-case 195:
-#line 1309 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 194:
+#line 1358 "fortran.y"
+    {strcpy((yyval.nac),"COMPLEX");
+                   pos_cur_decl = setposcur()-7;;}
+    break;
+
+  case 195:
+#line 1361 "fortran.y"
+    {
                       pos_cur_decl = setposcur()-16;
-                      strcpy(yyval.nac,"REAL");
+                      strcpy((yyval.nac),"REAL");
                       strcpy(nameinttypename,"8");
-                   }
-break;
-case 196:
-#line 1315 "fortran.y"
-{strcpy(yyval.nac,"DOUBLE COMPLEX");}
-break;
-case 197:
-#line 1317 "fortran.y"
-{
-                      strcpy(yyval.nac,"LOGICAL");
+                   ;}
+    break;
+
+  case 196:
+#line 1367 "fortran.y"
+    {strcpy((yyval.nac),"DOUBLE COMPLEX");;}
+    break;
+
+  case 197:
+#line 1369 "fortran.y"
+    {
+                      strcpy((yyval.nac),"LOGICAL");
                       pos_cur_decl = setposcur()-7;
-                   }
-break;
-case 199:
-#line 1323 "fortran.y"
-{strcpy(vallengspec,yyvsp[0].na);}
-break;
-case 200:
-#line 1325 "fortran.y"
-{sprintf(yyval.na,"*%s",yyvsp[0].na);}
-break;
-case 201:
-#line 1326 "fortran.y"
-{strcpy(yyval.na,"*(*)");}
-break;
-case 208:
-#line 1337 "fortran.y"
-{
-                      if ( strstr(yyvsp[0].na,"0.d0") )
+                   ;}
+    break;
+
+  case 199:
+#line 1375 "fortran.y"
+    {strcpy(vallengspec,(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 200:
+#line 1377 "fortran.y"
+    {sprintf((yyval.na),"*%s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 201:
+#line 1378 "fortran.y"
+    {strcpy((yyval.na),"*(*)");;}
+    break;
+
+  case 208:
+#line 1389 "fortran.y"
+                      {
+                      if ( strstr((yyvsp[(3) - (3)].na),"0.d0") )
                       {
                          strcpy(nameinttypename,"8");
                          sprintf(NamePrecision,"");
                       }
-                      else sprintf(NamePrecision,"%s = %s",yyvsp[-2].nac,yyvsp[0].na);
-                   }
-break;
-case 209:
-#line 1346 "fortran.y"
-{
-                      strcpy(NamePrecision,yyvsp[0].nac);
-                   }
-break;
-case 210:
-#line 1350 "fortran.y"
-{
-                      strcpy(NamePrecision,yyvsp[0].nac);
-                   }
-break;
-case 211:
-#line 1354 "fortran.y"
-{strcpy(CharacterSize,yyvsp[0].na);
-                    strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 212:
-#line 1356 "fortran.y"
-{strcpy(CharacterSize,"*");
-                    strcpy(yyval.na,"*");}
-break;
-case 220:
-#line 1370 "fortran.y"
-{
+                      else sprintf(NamePrecision,"%s = %s",(yyvsp[(1) - (3)].nac),(yyvsp[(3) - (3)].na));
+                   ;}
+    break;
+
+  case 209:
+#line 1398 "fortran.y"
+    {
+                      strcpy(NamePrecision,(yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 210:
+#line 1402 "fortran.y"
+    {
+                      strcpy(NamePrecision,(yyvsp[(1) - (1)].nac));
+                   ;}
+    break;
+
+  case 211:
+#line 1406 "fortran.y"
+    {strcpy(CharacterSize,(yyvsp[(1) - (1)].na));
+                    strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 212:
+#line 1408 "fortran.y"
+    {strcpy(CharacterSize,"*");
+                    strcpy((yyval.na),"*");;}
+    break;
+
+  case 220:
+#line 1422 "fortran.y"
+    {
                       VariableIsParameter = 1;
-                   }
-break;
-case 222:
-#line 1375 "fortran.y"
-{Allocatabledeclare = 1;}
-break;
-case 223:
-#line 1377 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 222:
+#line 1427 "fortran.y"
+    {Allocatabledeclare = 1;;}
+    break;
+
+  case 223:
+#line 1429 "fortran.y"
+    {
                       dimsgiven=1;
-                      curdim=yyvsp[0].d;
-                   }
-break;
-case 224:
-#line 1382 "fortran.y"
-{ExternalDeclare = 1;}
-break;
-case 225:
-#line 1384 "fortran.y"
-{strcpy(IntentSpec,yyvsp[-1].nac);}
-break;
-case 227:
-#line 1386 "fortran.y"
-{optionaldeclare = 1 ;}
-break;
-case 228:
-#line 1387 "fortran.y"
-{pointerdeclare = 1 ;}
-break;
-case 229:
-#line 1388 "fortran.y"
-{
+                      curdim=(yyvsp[(2) - (2)].d);
+                   ;}
+    break;
+
+  case 224:
+#line 1434 "fortran.y"
+    {ExternalDeclare = 1;;}
+    break;
+
+  case 225:
+#line 1436 "fortran.y"
+    {strcpy(IntentSpec,(yyvsp[(3) - (4)].nac));;}
+    break;
+
+  case 227:
+#line 1438 "fortran.y"
+    {optionaldeclare = 1 ;;}
+    break;
+
+  case 228:
+#line 1439 "fortran.y"
+    {pointerdeclare = 1 ;;}
+    break;
+
+  case 229:
+#line 1440 "fortran.y"
+    {
 /*                       if ( inmodulemeet == 1 )
                        {*/
                           SaveDeclare = 1 ;
                      /*  }*/
-                    }
-break;
-case 231:
-#line 1396 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 232:
-#line 1397 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 233:
-#line 1398 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac); }
-break;
-case 234:
-#line 1401 "fortran.y"
-{PublicDeclare = 1;}
-break;
-case 235:
-#line 1403 "fortran.y"
-{PrivateDeclare = 1;}
-break;
-case 236:
-#line 1405 "fortran.y"
-{if ( created_dimensionlist == 1 )
+                    ;}
+    break;
+
+  case 230:
+#line 1447 "fortran.y"
+    {Targetdeclare = 1;;}
+    break;
+
+  case 231:
+#line 1449 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 232:
+#line 1450 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 233:
+#line 1451 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac)); ;}
+    break;
+
+  case 234:
+#line 1454 "fortran.y"
+    {PublicDeclare = 1;;}
+    break;
+
+  case 235:
+#line 1456 "fortran.y"
+    {PrivateDeclare = 1;;}
+    break;
+
+  case 236:
+#line 1458 "fortran.y"
+    {if ( created_dimensionlist == 1 )
                        {
-                           yyval.d=(listdim *)NULL;
+                           (yyval.d)=(listdim *)NULL;
                        }
-                   }
-break;
-case 237:
-#line 1411 "fortran.y"
-{if ( created_dimensionlist == 1 ||
-                         agrif_parentcall      == 1 ) yyval.d=yyvsp[-1].d;}
-break;
-case 238:
-#line 1414 "fortran.y"
-{if ( created_dimensionlist == 1 ||
-                         agrif_parentcall      == 1 ) yyval.d=insertdim(NULL,yyvsp[0].dim1);}
-break;
-case 239:
-#line 1417 "fortran.y"
-{if ( couldaddvariable == 1 )
-                         if ( created_dimensionlist == 1 ) yyval.d=insertdim(yyvsp[-2].d,yyvsp[0].dim1);}
-break;
-case 240:
-#line 1420 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"1");
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 241:
-#line 1425 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"");
-                      strcpy(yyval.dim1.last,"");
-                   }
-break;
-case 242:
-#line 1429 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,yyvsp[-1].na);
-                      Save_Length(yyvsp[-1].na,2);
-                      strcpy(yyval.dim1.last,"");
-                   }
-break;
-case 243:
-#line 1434 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,"");
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 244:
-#line 1440 "fortran.y"
-{
-                      strcpy(yyval.dim1.first,yyvsp[-2].na);
-                      Save_Length(yyvsp[-2].na,2);
-                      strcpy(yyval.dim1.last,yyvsp[0].na);
-                      Save_Length(yyvsp[0].na,1);
-                   }
-break;
-case 245:
-#line 1447 "fortran.y"
-{strcpy(yyval.na,"*");}
-break;
-case 246:
-#line 1448 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 247:
-#line 1450 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 248:
-#line 1452 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s)",yyvsp[-1].na);}
-break;
-case 249:
-#line 1454 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 250:
-#line 1456 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 251:
-#line 1460 "fortran.y"
-{sprintf(yyval.na,"SUM(%s)",yyvsp[-1].na);}
-break;
-case 252:
-#line 1462 "fortran.y"
-{sprintf(yyval.na,"MAX(%s)",yyvsp[-1].na);}
-break;
-case 253:
+                   ;}
+    break;
+
+  case 237:
 #line 1464 "fortran.y"
-{sprintf(yyval.na,"TANH(%s)",yyvsp[-1].na);}
-break;
-case 254:
-#line 1466 "fortran.y"
-{sprintf(yyval.na,"MAXVAL(%s)",yyvsp[-1].na);}
-break;
-case 255:
-#line 1468 "fortran.y"
-{sprintf(yyval.na,"MIN(%s)",yyvsp[-1].na);}
-break;
-case 256:
+    {if ( created_dimensionlist == 1 ||
+                         agrif_parentcall      == 1 ) (yyval.d)=(yyvsp[(2) - (3)].d);;}
+    break;
+
+  case 238:
+#line 1467 "fortran.y"
+    {if ( created_dimensionlist == 1 ||
+                         agrif_parentcall      == 1 ) (yyval.d)=insertdim(NULL,(yyvsp[(1) - (1)].dim1));;}
+    break;
+
+  case 239:
 #line 1470 "fortran.y"
-{sprintf(yyval.na,"MINVAL(%s)",yyvsp[-1].na);}
-break;
-case 257:
-#line 1472 "fortran.y"
-{sprintf(yyval.na,"TRIM(%s)",yyvsp[-1].na);}
-break;
-case 258:
-#line 1474 "fortran.y"
-{sprintf(yyval.na,"SQRT(%s)",yyvsp[-1].na);}
-break;
-case 259:
-#line 1476 "fortran.y"
-{sprintf(yyval.na,"REAL(%s)",yyvsp[-1].na);}
-break;
-case 260:
+    {if ( couldaddvariable == 1 )
+                         if ( created_dimensionlist == 1 ) (yyval.d)=insertdim((yyvsp[(1) - (3)].d),(yyvsp[(3) - (3)].dim1));;}
+    break;
+
+  case 240:
+#line 1473 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,"1");
+                      strcpy((yyval.dim1).last,(yyvsp[(1) - (1)].na));
+                      Save_Length((yyvsp[(1) - (1)].na),1);
+                   ;}
+    break;
+
+  case 241:
 #line 1478 "fortran.y"
-{sprintf(yyval.na,"NINT(%s)",yyvsp[-1].na);}
-break;
-case 261:
-#line 1480 "fortran.y"
-{sprintf(yyval.na,"FLOAT(%s)",yyvsp[-1].na);}
-break;
-case 262:
+    {
+                      strcpy((yyval.dim1).first,"");
+                      strcpy((yyval.dim1).last,"");
+                   ;}
+    break;
+
+  case 242:
 #line 1482 "fortran.y"
-{sprintf(yyval.na,"EXP(%s)",yyvsp[-1].na);}
-break;
-case 263:
-#line 1484 "fortran.y"
-{sprintf(yyval.na,"COS(%s)",yyvsp[-1].na);}
-break;
-case 264:
-#line 1486 "fortran.y"
-{sprintf(yyval.na,"COSH(%s)",yyvsp[-1].na);}
-break;
-case 265:
-#line 1488 "fortran.y"
-{sprintf(yyval.na,"ACOS(%s)",yyvsp[-1].na);}
-break;
-case 266:
-#line 1490 "fortran.y"
-{sprintf(yyval.na,"SIN(%s)",yyvsp[-1].na);}
-break;
-case 267:
-#line 1492 "fortran.y"
-{sprintf(yyval.na,"SINH(%s)",yyvsp[-1].na);}
-break;
-case 268:
-#line 1494 "fortran.y"
-{sprintf(yyval.na,"ASIN(%s)",yyvsp[-1].na);}
-break;
-case 269:
-#line 1496 "fortran.y"
-{sprintf(yyval.na,"LOG(%s)",yyvsp[-1].na);}
-break;
-case 270:
-#line 1498 "fortran.y"
-{sprintf(yyval.na,"TAN(%s)",yyvsp[-1].na);}
-break;
-case 271:
+    {
+                      strcpy((yyval.dim1).first,(yyvsp[(1) - (2)].na));
+                      Save_Length((yyvsp[(1) - (2)].na),2);
+                      strcpy((yyval.dim1).last,"");
+                   ;}
+    break;
+
+  case 243:
+#line 1487 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,"");
+                      strcpy((yyval.dim1).last,(yyvsp[(2) - (2)].na));
+                      Save_Length((yyvsp[(2) - (2)].na),1);
+                   ;}
+    break;
+
+  case 244:
+#line 1493 "fortran.y"
+    {
+                      strcpy((yyval.dim1).first,(yyvsp[(1) - (3)].na));
+                      Save_Length((yyvsp[(1) - (3)].na),2);
+                      strcpy((yyval.dim1).last,(yyvsp[(3) - (3)].na));
+                      Save_Length((yyvsp[(3) - (3)].na),1);
+                   ;}
+    break;
+
+  case 245:
 #line 1500 "fortran.y"
-{sprintf(yyval.na,"ATAN(%s)",yyvsp[-1].na);}
-break;
-case 272:
-#line 1502 "fortran.y"
-{sprintf(yyval.na,"ABS(%s)",yyvsp[-1].na);}
-break;
-case 273:
-#line 1504 "fortran.y"
-{sprintf(yyval.na,"MOD(%s)",yyvsp[-1].na);}
-break;
-case 274:
-#line 1506 "fortran.y"
-{sprintf(yyval.na,"SIGN(%s)",yyvsp[-1].na);}
-break;
-case 275:
-#line 1508 "fortran.y"
-{sprintf(yyval.na,"MINLOC(%s)",yyvsp[-1].na);}
-break;
-case 276:
-#line 1510 "fortran.y"
-{sprintf(yyval.na,"MAXLOC(%s)",yyvsp[-1].na);}
-break;
-case 277:
-#line 1512 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 278:
-#line 1514 "fortran.y"
-{if ( couldaddvariable == 1 )
-                   { strcpy(yyval.na,yyvsp[-2].na);strcat(yyval.na,",");strcat(yyval.na,yyvsp[0].na);}}
-break;
-case 279:
+    {strcpy((yyval.na),"*");;}
+    break;
+
+  case 246:
+#line 1501 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 247:
+#line 1503 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 248:
+#line 1505 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 249:
+#line 1507 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 250:
+#line 1509 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 251:
+#line 1513 "fortran.y"
+    {sprintf((yyval.na),"SUM(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 252:
+#line 1515 "fortran.y"
+    {sprintf((yyval.na),"MAX(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 253:
 #line 1517 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 280:
+    {sprintf((yyval.na),"TANH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 254:
 #line 1519 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 281:
+    {sprintf((yyval.na),"MAXVAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 255:
 #line 1521 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 282:
+    {sprintf((yyval.na),"MIN(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 256:
 #line 1523 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].na,yyvsp[0].na);}
-break;
-case 283:
+    {sprintf((yyval.na),"MINVAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 257:
 #line 1525 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 284:
+    {sprintf((yyval.na),"TRIM(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 258:
 #line 1527 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 285:
+    {sprintf((yyval.na),"SQRT(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 259:
 #line 1529 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"+");}
-break;
-case 286:
-#line 1530 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,"-");}
-break;
-case 287:
+    {sprintf((yyval.na),"REAL(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 260:
+#line 1531 "fortran.y"
+    {sprintf((yyval.na),"NINT(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 261:
 #line 1533 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"+%s",yyvsp[0].na);}
-break;
-case 288:
+    {sprintf((yyval.na),"FLOAT(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 262:
 #line 1535 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"-%s",yyvsp[0].na);}
-break;
-case 289:
+    {sprintf((yyval.na),"EXP(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 263:
 #line 1537 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"*%s",yyvsp[0].na);}
-break;
-case 290:
+    {sprintf((yyval.na),"COS(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 264:
 #line 1539 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 291:
+    {sprintf((yyval.na),"COSH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 265:
 #line 1541 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 292:
+    {sprintf((yyval.na),"ACOS(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 266:
 #line 1543 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 293:
+    {sprintf((yyval.na),"SIN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 267:
 #line 1545 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 294:
+    {sprintf((yyval.na),"SINH(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 268:
 #line 1547 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," > %s",yyvsp[0].na);}
-break;
-case 295:
+    {sprintf((yyval.na),"ASIN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 269:
 #line 1549 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 296:
+    {sprintf((yyval.na),"LOG(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 270:
 #line 1551 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," < %s",yyvsp[0].na);}
-break;
-case 297:
+    {sprintf((yyval.na),"TAN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 271:
 #line 1553 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 298:
+    {sprintf((yyval.na),"ATAN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 272:
 #line 1555 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," >= %s",yyvsp[0].na);}
-break;
-case 299:
+    {sprintf((yyval.na),"ABS(%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 273:
 #line 1557 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 300:
+    {sprintf((yyval.na),"MOD(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 274:
 #line 1559 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," <= %s",yyvsp[0].na);}
-break;
-case 301:
+    {sprintf((yyval.na),"SIGN(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 275:
 #line 1561 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 302:
+    {sprintf((yyval.na),"MINLOC(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 276:
 #line 1563 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 303:
+    {sprintf((yyval.na),"MAXLOC(%s)",(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 277:
 #line 1565 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 304:
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 278:
 #line 1567 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 305:
-#line 1569 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s%s",yyvsp[-1].nac,yyvsp[0].na);}
-break;
-case 306:
-#line 1571 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s",yyvsp[0].na);}
-break;
-case 307:
-#line 1573 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s",yyvsp[0].na);}
-break;
-case 308:
-#line 1575 "fortran.y"
-{strcpy(yyval.na,"");}
-break;
-case 309:
-#line 1577 "fortran.y"
-{sprintf(yyval.na,"/%s",yyvsp[0].na);}
-break;
-case 310:
-#line 1579 "fortran.y"
-{sprintf(yyval.na,"/= %s",yyvsp[0].na);}
-break;
-case 311:
-#line 1581 "fortran.y"
-{sprintf(yyval.na,"//%s",yyvsp[0].na);}
-break;
-case 312:
-#line 1584 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"==%s",yyvsp[0].na);}
-break;
-case 313:
+    {if ( couldaddvariable == 1 )
+                   { strcpy((yyval.na),(yyvsp[(1) - (3)].na));strcat((yyval.na),",");strcat((yyval.na),(yyvsp[(3) - (3)].na));};}
+    break;
+
+  case 279:
+#line 1570 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 280:
+#line 1572 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 281:
+#line 1574 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 282:
+#line 1576 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 283:
+#line 1578 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 284:
+#line 1580 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 285:
+#line 1582 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"+");;}
+    break;
+
+  case 286:
+#line 1583 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),"-");;}
+    break;
+
+  case 287:
 #line 1586 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"= %s",yyvsp[0].na);}
-break;
-case 314:
-#line 1589 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].nac);}
-break;
-case 315:
-#line 1591 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 316:
-#line 1593 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 317:
-#line 1595 "fortran.y"
-{
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"+%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 288:
+#line 1588 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"-%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 289:
+#line 1590 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"*%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 290:
+#line 1592 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 291:
+#line 1594 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 292:
+#line 1596 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 293:
+#line 1598 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 294:
+#line 1600 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," > %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 295:
+#line 1602 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 296:
+#line 1604 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," < %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 297:
+#line 1606 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 298:
+#line 1608 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," >= %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 299:
+#line 1610 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 300:
+#line 1612 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," <= %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 301:
+#line 1614 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 302:
+#line 1616 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 303:
+#line 1618 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 304:
+#line 1620 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 305:
+#line 1622 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 306:
+#line 1624 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 307:
+#line 1626 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 308:
+#line 1628 "fortran.y"
+    {strcpy((yyval.na),"");;}
+    break;
+
+  case 309:
+#line 1630 "fortran.y"
+    {sprintf((yyval.na),"/%s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 310:
+#line 1632 "fortran.y"
+    {sprintf((yyval.na),"/= %s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 311:
+#line 1634 "fortran.y"
+    {sprintf((yyval.na),"//%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 312:
+#line 1637 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"==%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 313:
+#line 1639 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"= %s",(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 314:
+#line 1642 "fortran.y"
+    {if ( couldaddvariable == 1 )
+						{
+						printf("ident = %s\n",(yyvsp[(1) - (1)].nac));
+						strcpy((yyval.na),(yyvsp[(1) - (1)].nac));}
+						;}
+    break;
+
+  case 315:
+#line 1648 "fortran.y"
+    {if ( couldaddvariable == 1 ) {
+                   printf("struct = %s\n",(yyvsp[(1) - (1)].na));
+                   strcpy((yyval.na),(yyvsp[(1) - (1)].na));}
+                   ;}
+    break;
+
+  case 316:
+#line 1653 "fortran.y"
+    {if ( couldaddvariable == 1 ) {
+                   printf("arrayref = %s\n",(yyvsp[(1) - (1)].na));
+                   strcpy((yyval.na),(yyvsp[(1) - (1)].na));
+                   };}
+    break;
+
+  case 317:
+#line 1658 "fortran.y"
+    {
                       agrif_parentcall =0;
                       if (!strcasecmp(identcopy,"Agrif_Parent") )
@@ -8617,119 +5423,141 @@
                                                         curmodulename);
                       }
-                   }
-break;
-case 318:
-#line 1608 "fortran.y"
-{
-                     strcpy(yyval.na,yyvsp[0].na);
+                   ;}
+    break;
+
+  case 318:
+#line 1671 "fortran.y"
+    {
+                     strcpy((yyval.na),(yyvsp[(1) - (1)].na));
                      if ( incalldeclare == 0 ) inagrifcallargument = 0;
-                   }
-break;
-case 319:
-#line 1613 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," %s %s ",yyvsp[-1].na,yyvsp[0].na);}
-break;
-case 320:
-#line 1615 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                                sprintf(yyval.na," %s ( %s )",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 321:
-#line 1618 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                         sprintf(yyval.na," %s ( %s ) %s ",yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 322:
-#line 1622 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 319:
+#line 1676 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," %s %s ",(yyvsp[(1) - (2)].na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 320:
+#line 1678 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                                sprintf((yyval.na)," %s ( %s )",(yyvsp[(1) - (4)].na),(yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 321:
+#line 1681 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                         sprintf((yyval.na)," %s ( %s ) %s ",(yyvsp[(1) - (5)].na),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 322:
+#line 1685 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                         sprintf(yyval.na," %s ( %s )",yyvsp[-3].nac,yyvsp[-1].na);
-                         ModifyTheAgrifFunction_0(yyvsp[-1].na);
+                         sprintf((yyval.na)," %s ( %s )",(yyvsp[(1) - (4)].nac),(yyvsp[(3) - (4)].na));
+                         ModifyTheAgrifFunction_0((yyvsp[(3) - (4)].na));
                          agrif_parentcall =0;
                       }
-                   }
-break;
-case 323:
-#line 1632 "fortran.y"
-{
-                      sprintf(yyval.na," %s %% %s ",yyvsp[-2].na,yyvsp[0].na);
+                   ;}
+    break;
+
+  case 323:
+#line 1695 "fortran.y"
+    {
+                      sprintf((yyval.na)," %s %% %s ",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));
                       if ( incalldeclare == 0 ) inagrifcallargument = 0;
-                   }
-break;
-case 324:
-#line 1638 "fortran.y"
-{sprintf(yyval.na,"(/%s/)",yyvsp[-1].na);}
-break;
-case 325:
-#line 1640 "fortran.y"
-{strcpy(yyval.na," ");}
-break;
-case 326:
-#line 1642 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 327:
-#line 1644 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 328:
-#line 1646 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 329:
-#line 1648 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 330:
-#line 1649 "fortran.y"
-{strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 331:
-#line 1652 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s :%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 332:
-#line 1654 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                               sprintf(yyval.na,"%s :%s :%s",yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 333:
-#line 1657 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":%s :%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 334:
-#line 1658 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,": : %s",yyvsp[0].na);}
-break;
-case 335:
-#line 1659 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":%s",yyvsp[0].na);}
-break;
-case 336:
-#line 1660 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s :",yyvsp[-1].na);}
-break;
-case 337:
-#line 1661 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,":");}
-break;
-case 338:
-#line 1663 "fortran.y"
-{
-                       if ( couldaddvariable == 1 )
+                   ;}
+    break;
+
+  case 324:
+#line 1701 "fortran.y"
+    {sprintf((yyval.na),"(/%s/)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 325:
+#line 1703 "fortran.y"
+    {strcpy((yyval.na)," ");;}
+    break;
+
+  case 326:
+#line 1705 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 327:
+#line 1707 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 328:
+#line 1709 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 329:
+#line 1711 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 330:
+#line 1712 "fortran.y"
+    {strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 331:
+#line 1715 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s :%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 332:
+#line 1717 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                               sprintf((yyval.na),"%s :%s :%s",(yyvsp[(1) - (5)].na),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 333:
+#line 1720 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":%s :%s",(yyvsp[(2) - (4)].na),(yyvsp[(4) - (4)].na));;}
+    break;
+
+  case 334:
+#line 1721 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),": : %s",(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 335:
+#line 1722 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":%s",(yyvsp[(2) - (2)].na));;}
+    break;
+
+  case 336:
+#line 1723 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s :",(yyvsp[(1) - (2)].na));;}
+    break;
+
+  case 337:
+#line 1724 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),":");;}
+    break;
+
+  case 338:
+#line 1726 "fortran.y"
                        {
-                       if ( Vartonumber(yyvsp[0].nac) == 1 )
+                       if ( couldaddvariable == 1 && afterpercent == 0)
+                       {
+                       if ( Vartonumber((yyvsp[(1) - (1)].nac)) == 1 )
                        {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                        }
-                       if (!strcasecmp(yyvsp[0].nac,"Agrif_Parent") )
+                       if (!strcasecmp((yyvsp[(1) - (1)].nac),"Agrif_Parent") )
                                                             agrif_parentcall =1;
-                       if ( VariableIsNotFunction(yyvsp[0].nac) == 0 )
+                       if ( VariableIsNotFunction((yyvsp[(1) - (1)].nac)) == 0 )
                        {
+                       printf("var = %s\n",(yyvsp[(1) - (1)].nac));
                           if ( inagrifcallargument == 1 )
                           {
-                             if ( !strcasecmp(yyvsp[0].nac,identcopy) )
+                             if ( !strcasecmp((yyvsp[(1) - (1)].nac),identcopy) )
                              {
                                 strcpy(sameagrifname,identcopy);
@@ -8737,155 +5565,156 @@
                              }
                           }
-                          strcpy(identcopy,yyvsp[0].nac);
+                          strcpy(identcopy,(yyvsp[(1) - (1)].nac));
                           pointedvar=0;
-                          strcpy(truename,yyvsp[0].nac);
-                          if (variscoupled_0(yyvsp[0].nac)) strcpy(truename,getcoupledname_0(yyvsp[0].nac));
-/*
-                          if ( VarIsNonGridDepend($1) == 0 &&
-                               Variableshouldberemove($1) == 0 )
-                          {
-                             if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0($1) == 1 ||
-                                  varispointer_0($1) == 1 )
-                             {
-                            if ((IsinListe(List_UsedInSubroutine_Var,$1) == 1) || (inagrifcallargument == 1))
-                             {
-                              if (varistyped_0($1) == 0)
-                                 {
-                                 ModifyTheVariableName_0($1);
-                                 }
-                                 }
-                                 else
-                                 {
-                                 }
-                             }
-                             if (variscoupled_0($1) == 1)
-                             {
-      printf("mla variable %s est couplee %s\n",$1,getcoupledname_0($1));
-                             ModifyTheVariableNamecoupled_0($1,getcoupledname_0($1));
-                             }
-                             if ( inagrifcallargument != 1 ||
-                                  sameagrifargument ==1 )
-                                  Add_UsedInSubroutine_Var_1($1);
-                          }
-                          NotifyAgrifFunction_0($1);
-*/
+                          strcpy(truename,(yyvsp[(1) - (1)].nac));
+                          if (variscoupled_0((yyvsp[(1) - (1)].nac))) strcpy(truename,getcoupledname_0((yyvsp[(1) - (1)].nac)));
+
                           if ( VarIsNonGridDepend(truename) == 0 &&
                                Variableshouldberemove(truename) == 0 )
-                          {
+                          {                      
                              if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0(truename) == 1 ||
                                   varispointer_0(truename) == 1 )
                              {
-                            if ((IsinListe(List_UsedInSubroutine_Var,yyvsp[0].nac) == 1) || (inagrifcallargument == 1))
+                             printf("var2 = %s\n",(yyvsp[(1) - (1)].nac));
+                            if ((IsinListe(List_UsedInSubroutine_Var,(yyvsp[(1) - (1)].nac)) == 1) || (inagrifcallargument == 1))
                              {
                               if (varistyped_0(truename) == 0)
                                  {
-                                 ModifyTheVariableName_0(truename,strlen(yyvsp[0].nac));
+                                 ModifyTheVariableName_0(truename,strlen((yyvsp[(1) - (1)].nac)));
                                  }
                                  }
                              }
+                             printf("ici3\n");
                              if ( inagrifcallargument != 1 ||
                                   sameagrifargument ==1 )
+                                  {
+                                  printf("ici5 %s\n",truename);
                                   Add_UsedInSubroutine_Var_1(truename);
+                          }
                           }
                           NotifyAgrifFunction_0(truename);
                        }
                        }
+                       else
+                       {
+                       afterpercent = 0;
                     }
-break;
-case 339:
-#line 1742 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,".TRUE.");}
-break;
-case 340:
-#line 1743 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,".FALSE.");}
-break;
-case 341:
-#line 1744 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 342:
-#line 1745 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 343:
-#line 1746 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 344:
-#line 1747 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 345:
-#line 1749 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.nac,"%s%s",yyvsp[-1].nac,yyvsp[0].nac);}
-break;
-case 347:
-#line 1753 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 349:
-#line 1756 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 350:
-#line 1758 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 351:
-#line 1760 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 352:
-#line 1761 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 353:
-#line 1764 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s :%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 354:
-#line 1766 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 355:
-#line 1767 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 356:
-#line 1769 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na," ");}
-break;
-case 357:
-#line 1770 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 358:
-#line 1772 "fortran.y"
-{InitialValueGiven = 0;}
-break;
-case 359:
-#line 1774 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 339:
+#line 1785 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),".TRUE.");;}
+    break;
+
+  case 340:
+#line 1786 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),".FALSE.");;}
+    break;
+
+  case 341:
+#line 1787 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 342:
+#line 1788 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 343:
+#line 1789 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 344:
+#line 1790 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 345:
+#line 1792 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.nac),"%s%s",(yyvsp[(1) - (2)].nac),(yyvsp[(2) - (2)].nac));;}
+    break;
+
+  case 347:
+#line 1796 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 349:
+#line 1799 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 350:
+#line 1801 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 351:
+#line 1803 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 352:
+#line 1804 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 353:
+#line 1807 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s :%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 354:
+#line 1809 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 355:
+#line 1810 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 356:
+#line 1812 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na)," ");;}
+    break;
+
+  case 357:
+#line 1813 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 358:
+#line 1815 "fortran.y"
+    {InitialValueGiven = 0;;}
+    break;
+
+  case 359:
+#line 1817 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
-                          strcpy(InitValue,yyvsp[0].na);
+                          strcpy(InitValue,(yyvsp[(3) - (3)].na));
                           InitialValueGiven = 1;
                        }
-                    }
-break;
-case 360:
-#line 1782 "fortran.y"
-{pos_curinit = setposcur();}
-break;
-case 361:
-#line 1785 "fortran.y"
-{sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 362:
-#line 1788 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 360:
+#line 1825 "fortran.y"
+    {pos_curinit = setposcur();;}
+    break;
+
+  case 361:
+#line 1828 "fortran.y"
+    {sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 362:
+#line 1831 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
@@ -8893,8 +5722,8 @@
                       if (insubroutinedeclare == 1)
                       {
-                         copyuse_0(yyvsp[0].nac);
+                         copyuse_0((yyvsp[(2) - (2)].nac));
                       }
-                      sprintf(charusemodule,"%s",yyvsp[0].nac);
-                      Add_NameOfModuleUsed_1(yyvsp[0].nac);
+                      sprintf(charusemodule,"%s",(yyvsp[(2) - (2)].nac));
+                      Add_NameOfModuleUsed_1((yyvsp[(2) - (2)].nac));
 
                       if ( inmoduledeclare == 0 )
@@ -8905,14 +5734,15 @@
                       }
                       }
-                    }
-break;
-case 363:
-#line 1808 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 363:
+#line 1851 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
                       if (insubroutinedeclare == 1)
                       {
-                         Add_CouplePointed_Var_1(yyvsp[-2].nac,yyvsp[0].lc);
+                         Add_CouplePointed_Var_1((yyvsp[(2) - (4)].nac),(yyvsp[(4) - (4)].lc));
                       }
                       if ( firstpass == 1 )
@@ -8920,5 +5750,5 @@
                          if ( insubroutinedeclare == 1 )
                          {
-                            coupletmp = yyvsp[0].lc;
+                            coupletmp = (yyvsp[(4) - (4)].lc);
                             strcpy(ligne,"");
                             while ( coupletmp )
@@ -8930,7 +5760,7 @@
                                if ( coupletmp ) strcat(ligne,",");
                             }
-                            sprintf(charusemodule,"%s",yyvsp[-2].nac);
+                            sprintf(charusemodule,"%s",(yyvsp[(2) - (4)].nac));
                          }
-                         Add_NameOfModuleUsed_1(yyvsp[-2].nac);
+                         Add_NameOfModuleUsed_1((yyvsp[(2) - (4)].nac));
                       }
                       if ( inmoduledeclare == 0 )
@@ -8941,9 +5771,10 @@
                       }
                       }
-                    }
-break;
-case 364:
-#line 1842 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 364:
+#line 1885 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -8951,8 +5782,8 @@
                       if (insubroutinedeclare == 1)
                       {
-                         copyuseonly_0(yyvsp[-4].nac);
+                         copyuseonly_0((yyvsp[(2) - (6)].nac));
                       }
-                      sprintf(charusemodule,"%s",yyvsp[-4].nac);
-                      Add_NameOfModuleUsed_1(yyvsp[-4].nac);
+                      sprintf(charusemodule,"%s",(yyvsp[(2) - (6)].nac));
+                      Add_NameOfModuleUsed_1((yyvsp[(2) - (6)].nac));
 
                        if ( inmoduledeclare == 0 )
@@ -8963,9 +5794,10 @@
                        }
                        }
-                    }
-break;
-case 365:
-#line 1862 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 365:
+#line 1905 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -8973,5 +5805,5 @@
                        if (insubroutinedeclare == 1)
                        {
-                          Add_CouplePointed_Var_1(yyvsp[-4].nac,yyvsp[0].lc);
+                          Add_CouplePointed_Var_1((yyvsp[(2) - (6)].nac),(yyvsp[(6) - (6)].lc));
                        }
                        if ( firstpass == 1 )
@@ -8979,5 +5811,5 @@
                          if ( insubroutinedeclare == 1 )
                          {
-                             coupletmp = yyvsp[0].lc;
+                             coupletmp = (yyvsp[(6) - (6)].lc);
                              strcpy(ligne,"");
                              while ( coupletmp )
@@ -8990,7 +5822,7 @@
                                 if ( coupletmp ) strcat(ligne,",");
                              }
-                             sprintf(charusemodule,"%s",yyvsp[-4].nac);
+                             sprintf(charusemodule,"%s",(yyvsp[(2) - (6)].nac));
                           }
-                          Add_NameOfModuleUsed_1(yyvsp[-4].nac);
+                          Add_NameOfModuleUsed_1((yyvsp[(2) - (6)].nac));
                        }
                        if ( firstpass == 0 )
@@ -9003,5 +5835,5 @@
                                                    pos_end-pos_curuse);
                        if (oldfortranout) 
-                         variableisglobalinmodule(yyvsp[0].lc,yyvsp[-4].nac,oldfortranout,pos_curuseold);
+                         variableisglobalinmodule((yyvsp[(6) - (6)].lc),(yyvsp[(2) - (6)].nac),oldfortranout,pos_curuseold);
                         
                           }
@@ -9011,113 +5843,125 @@
                              /* if we are in the module declare and if the    */
                              /* onlylist is a list of global variable         */
-                             variableisglobalinmodule(yyvsp[0].lc, yyvsp[-4].nac, fortranout,pos_curuse);
+                             variableisglobalinmodule((yyvsp[(6) - (6)].lc), (yyvsp[(2) - (6)].nac), fortranout,pos_curuse);
                           }
                        }
                        }
-                    }
-break;
-case 366:
-#line 1913 "fortran.y"
-{
-                      pos_curuse = setposcur()-strlen(yyvsp[0].nac);
+                    ;}
+    break;
+
+  case 366:
+#line 1956 "fortran.y"
+    {
+                      pos_curuse = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                      if (firstpass == 0 && oldfortranout) {
                      pos_curuseold = setposcurname(oldfortranout);
                      }
-                   }
-break;
-case 367:
-#line 1921 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 368:
-#line 1924 "fortran.y"
-{
-                       if ( couldaddvariable == 1 ) yyval.lc = yyvsp[0].lc;
-                    }
-break;
-case 369:
-#line 1928 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 367:
+#line 1964 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 368:
+#line 1967 "fortran.y"
+    {
+                       if ( couldaddvariable == 1 ) (yyval.lc) = (yyvsp[(1) - (1)].lc);
+                    ;}
+    break;
+
+  case 369:
+#line 1971 "fortran.y"
+    {
                         if ( couldaddvariable == 1 )
                         {
                         /* insert the variable in the list $1                 */
-                        yyvsp[0].lc->suiv = yyvsp[-2].lc;
-                        yyval.lc = yyvsp[0].lc;
+                        (yyvsp[(3) - (3)].lc)->suiv = (yyvsp[(1) - (3)].lc);
+                        (yyval.lc) = (yyvsp[(3) - (3)].lc);
                         }
-                    }
-break;
-case 370:
-#line 1938 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 370:
+#line 1981 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[-2].nac);
-                       Save_Length(yyvsp[-2].nac,21);
-                       strcpy(coupletmp->c_namepointedvar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,22);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (3)].nac));
+                       Save_Length((yyvsp[(1) - (3)].nac),21);
+                       strcpy(coupletmp->c_namepointedvar,(yyvsp[(3) - (3)].nac));
+                       Save_Length((yyvsp[(3) - (3)].nac),22);
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
-                     }
-break;
-case 371:
-#line 1949 "fortran.y"
-{
-                       if ( couldaddvariable == 1 ) yyval.lc = yyvsp[0].lc;
-                    }
-break;
-case 372:
-#line 1953 "fortran.y"
-{
+                       (yyval.lc) = coupletmp;
+                     ;}
+    break;
+
+  case 371:
+#line 1992 "fortran.y"
+    {
+                       if ( couldaddvariable == 1 ) (yyval.lc) = (yyvsp[(1) - (1)].lc);
+                    ;}
+    break;
+
+  case 372:
+#line 1996 "fortran.y"
+    {
                         if ( couldaddvariable == 1 )
                         {
                         /* insert the variable in the list $1                 */
-                        yyvsp[0].lc->suiv = yyvsp[-2].lc;
-                        yyval.lc = yyvsp[0].lc;
+                        (yyvsp[(3) - (3)].lc)->suiv = (yyvsp[(1) - (3)].lc);
+                        (yyval.lc) = (yyvsp[(3) - (3)].lc);
                         }
-                    }
-break;
-case 373:
-#line 1963 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 373:
+#line 2006 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[-2].nac);
-                       Save_Length(yyvsp[-2].nac,21);
-                       strcpy(coupletmp->c_namepointedvar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,22);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (3)].nac));
+                       Save_Length((yyvsp[(1) - (3)].nac),21);
+                       strcpy(coupletmp->c_namepointedvar,(yyvsp[(3) - (3)].nac));
+                       Save_Length((yyvsp[(3) - (3)].nac),22);
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
+                       (yyval.lc) = coupletmp;
                        pointedvar=1;
-                       Add_UsedInSubroutine_Var_1(yyvsp[-2].nac);
-                    }
-break;
-case 374:
-#line 1974 "fortran.y"
-{
+                       Add_UsedInSubroutine_Var_1((yyvsp[(1) - (3)].nac));
+                    ;}
+    break;
+
+  case 374:
+#line 2017 "fortran.y"
+    {
                        coupletmp =(listcouple *)malloc(sizeof(listcouple));
-                       strcpy(coupletmp->c_namevar,yyvsp[0].nac);
-                       Save_Length(yyvsp[0].nac,21);
+                       strcpy(coupletmp->c_namevar,(yyvsp[(1) - (1)].nac));
+                       Save_Length((yyvsp[(1) - (1)].nac),21);
                        strcpy(coupletmp->c_namepointedvar,"");
                        coupletmp->suiv = NULL;
-                       yyval.lc = coupletmp;
-                     }
-break;
-case 376:
-#line 1985 "fortran.y"
-{
+                       (yyval.lc) = coupletmp;
+                     ;}
+    break;
+
+  case 376:
+#line 2028 "fortran.y"
+    {
                          Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 377:
-#line 1991 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 377:
+#line 2034 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                          curmodulename);
                                                          inallocate = 0;
-                     }
-break;
-case 379:
-#line 1998 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 379:
+#line 2041 "fortran.y"
+    {
                        GlobalDeclaration = 0 ;
                        if ( firstpass == 0 &&
@@ -9167,9 +6011,10 @@
                       }
                       strcpy(subroutinename,"");
-                    }
-break;
-case 380:
-#line 2048 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 380:
+#line 2091 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -9187,9 +6032,10 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 381:
-#line 2066 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 381:
+#line 2109 "fortran.y"
+    {
                        if ( couldaddvariable == 1 &&
                             strcasecmp(subroutinename,"") )
@@ -9209,9 +6055,10 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 382:
-#line 2086 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 382:
+#line 2129 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
@@ -9230,13 +6077,14 @@
                       strcpy(subroutinename,"");
                       }
-                    }
-break;
-case 383:
-#line 2105 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 383:
+#line 2148 "fortran.y"
+    {
                        if ( couldaddvariable == 1 )
                        {
                        /* if we never meet the contains keyword               */
-                      Remove_Word_end_module_0(strlen(yyvsp[0].nac));
+                      Remove_Word_end_module_0(strlen((yyvsp[(2) - (2)].nac)));
                        if ( inmoduledeclare == 1 )
                        {
@@ -9265,9 +6113,10 @@
                       GlobalDeclaration = 0 ;
                       }
-                  }
-break;
-case 397:
-#line 2151 "fortran.y"
-{
+                  ;}
+    break;
+
+  case 397:
+#line 2194 "fortran.y"
+    {
                       if (inmoduledeclare == 1 )
                       {
@@ -9282,4 +6131,6 @@
                       else
                       {
+                      incontainssubroutine = 1;
+                      strcpy(previoussubroutinename,subroutinename);
                        if ( couldaddvariable == 1 )
                        {
@@ -9301,94 +6152,106 @@
                          strcpy(subroutinename,"");
                       }
-                   }
-break;
-case 398:
-#line 2186 "fortran.y"
-{
+                   ;}
+    break;
+
+  case 398:
+#line 2231 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        functiondeclarationisdone = 0;
                        }
-                    }
-break;
-case 399:
-#line 2196 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 399:
+#line 2241 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 400:
-#line 2205 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 400:
+#line 2250 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 401:
-#line 2214 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 401:
+#line 2259 "fortran.y"
+    {
                       if ( couldaddvariable == 1 )
                       {
-                       strcpy(yyval.nac,yyvsp[0].nac);
-                       pos_endsubroutine = setposcur()-strlen(yyvsp[0].nac);
+                       strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));
+                       pos_endsubroutine = setposcur()-strlen((yyvsp[(1) - (1)].nac));
                        }
-                    }
-break;
-case 413:
-#line 2236 "fortran.y"
-{strcpy(yyval.nac,"");}
-break;
-case 414:
-#line 2237 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-case 426:
-#line 2257 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 413:
+#line 2281 "fortran.y"
+    {strcpy((yyval.nac),"");;}
+    break;
+
+  case 414:
+#line 2282 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+  case 424:
+#line 2302 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 427:
-#line 2263 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 425:
+#line 2308 "fortran.y"
+    {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                                                         inallocate = 0;
-                     }
-break;
-case 433:
-#line 2274 "fortran.y"
-{if ( couldaddvariable == 1 ) created_dimensionlist = 0;}
-break;
-case 434:
-#line 2276 "fortran.y"
-{
+                     ;}
+    break;
+
+  case 431:
+#line 2319 "fortran.y"
+    {if ( couldaddvariable == 1 ) created_dimensionlist = 0;;}
+    break;
+
+  case 432:
+#line 2321 "fortran.y"
+    {
                   created_dimensionlist = 1;
                   if  ( agrif_parentcall == 1 )
                   {
-                      ModifyTheAgrifFunction_0(yyvsp[-1].d->dim.last);
+                      ModifyTheAgrifFunction_0((yyvsp[(3) - (4)].d)->dim.last);
                       agrif_parentcall =0;
                       fprintf(fortranout," = ");
                   }
-              }
-break;
-case 435:
-#line 2286 "fortran.y"
-{created_dimensionlist = 1;}
-break;
-case 440:
-#line 2294 "fortran.y"
-{
+              ;}
+    break;
+
+  case 433:
+#line 2331 "fortran.y"
+    {created_dimensionlist = 1;;}
+    break;
+
+  case 438:
+#line 2339 "fortran.y"
+    {
                       inagrifcallargument = 0 ;
                       incalldeclare=0;
@@ -9415,10 +6278,11 @@
                       }
                       Instanciation_0(sameagrifname);
-                   }
-break;
-case 445:
-#line 2328 "fortran.y"
-{
-                       if (!strcasecmp(yyvsp[0].nac,"MPI_Init") )
+                   ;}
+    break;
+
+  case 443:
+#line 2373 "fortran.y"
+                       {
+                       if (!strcasecmp((yyvsp[(2) - (2)].nac),"MPI_Init") )
                        {
                           callmpiinit = 1;
@@ -9428,5 +6292,5 @@
                           callmpiinit = 0;
                        }
-                       if (!strcasecmp(yyvsp[0].nac,"Agrif_Init_Grids") )
+                       if (!strcasecmp((yyvsp[(2) - (2)].nac),"Agrif_Init_Grids") )
                        {
                           callagrifinitgrids = 1;
@@ -9434,10 +6298,10 @@
                        }
                        else callagrifinitgrids = 0;
-                       if ( !strcasecmp(yyvsp[0].nac,"Agrif_Open_File") )
+                       if ( !strcasecmp((yyvsp[(2) - (2)].nac),"Agrif_Open_File") )
                        {
                           Add_SubroutineWhereAgrifUsed_1(subroutinename,
                                                         curmodulename);
                        }
-                       if ( Vartonumber(yyvsp[0].nac) == 1 )
+                       if ( Vartonumber((yyvsp[(2) - (2)].nac)) == 1 )
                        {
                           incalldeclare=1;
@@ -9446,16 +6310,18 @@
                                                         curmodulename);
                        }
-                    }
-break;
-case 446:
-#line 2358 "fortran.y"
-{pos_curcall=setposcur()-4;}
-break;
-case 449:
-#line 2363 "fortran.y"
-{
+                    ;}
+    break;
+
+  case 444:
+#line 2403 "fortran.y"
+    {pos_curcall=setposcur()-4;;}
+    break;
+
+  case 447:
+#line 2408 "fortran.y"
+    {
                   if ( callmpiinit == 1 )
                   {
-                     strcpy(mpiinitvar,yyvsp[0].na);
+                     strcpy(mpiinitvar,(yyvsp[(1) - (1)].na));
                      if ( firstpass == 1 )
                      {
@@ -9467,147 +6333,452 @@
                      }
                   }
-               }
-break;
-case 528:
-#line 2485 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 529:
-#line 2486 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 530:
-#line 2487 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 531:
-#line 2490 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 532:
-#line 2492 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 533:
-#line 2494 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 534:
-#line 2496 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 535:
-#line 2498 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 536:
-#line 2500 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"%s,%s",yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 537:
-#line 2501 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 538:
-#line 2502 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 539:
-#line 2505 "fortran.y"
-{if ( couldaddvariable == 1 ) strcpy(yyval.na,yyvsp[0].na);}
-break;
-case 540:
-#line 2507 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na," (%s)",yyvsp[-1].na);}
-break;
-case 541:
-#line 2509 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 542:
-#line 2511 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 543:
-#line 2513 "fortran.y"
-{if ( couldaddvariable == 1 ) sprintf(yyval.na,"(%s,%s)",yyvsp[-3].na,yyvsp[-1].na);}
-break;
-case 544:
-#line 2517 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                              sprintf(yyval.na,"%s=%s,%s)",yyvsp[-4].nac,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 545:
-#line 2520 "fortran.y"
-{if ( couldaddvariable == 1 )
-                                        sprintf(yyval.na,"%s=%s,%s,%s)",yyvsp[-6].nac,yyvsp[-4].na,yyvsp[-2].na,yyvsp[0].na);}
-break;
-case 554:
-#line 2536 "fortran.y"
-{Add_Allocate_Var_1(yyvsp[0].nac,curmodulename);}
-break;
-case 557:
+               ;}
+    break;
+
+  case 517:
+#line 2530 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 518:
+#line 2531 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 519:
+#line 2532 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 520:
+#line 2535 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 521:
+#line 2537 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 522:
+#line 2539 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 523:
 #line 2541 "fortran.y"
-{Add_Allocate_Var_1(yyvsp[-3].nac,curmodulename);}
-break;
-case 571:
-#line 2564 "fortran.y"
-{strcpy(yyval.nac,yyvsp[0].nac);}
-break;
-#line 9558 "y.tab.c"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 524:
+#line 2543 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 525:
+#line 2545 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"%s,%s",(yyvsp[(1) - (3)].na),(yyvsp[(3) - (3)].na));;}
+    break;
+
+  case 526:
+#line 2546 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 527:
+#line 2547 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 528:
+#line 2550 "fortran.y"
+    {if ( couldaddvariable == 1 ) strcpy((yyval.na),(yyvsp[(1) - (1)].na));;}
+    break;
+
+  case 529:
+#line 2552 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na)," (%s)",(yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 530:
+#line 2554 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 531:
+#line 2556 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 532:
+#line 2558 "fortran.y"
+    {if ( couldaddvariable == 1 ) sprintf((yyval.na),"(%s,%s)",(yyvsp[(2) - (5)].na),(yyvsp[(4) - (5)].na));;}
+    break;
+
+  case 533:
+#line 2562 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                              sprintf((yyval.na),"%s=%s,%s)",(yyvsp[(1) - (5)].nac),(yyvsp[(3) - (5)].na),(yyvsp[(5) - (5)].na));;}
+    break;
+
+  case 534:
+#line 2565 "fortran.y"
+    {if ( couldaddvariable == 1 )
+                                        sprintf((yyval.na),"%s=%s,%s,%s)",(yyvsp[(1) - (7)].nac),(yyvsp[(3) - (7)].na),(yyvsp[(5) - (7)].na),(yyvsp[(7) - (7)].na));;}
+    break;
+
+  case 541:
+#line 2581 "fortran.y"
+    {Add_Allocate_Var_1((yyvsp[(1) - (1)].nac),curmodulename);;}
+    break;
+
+  case 544:
+#line 2586 "fortran.y"
+    {Add_Allocate_Var_1((yyvsp[(1) - (4)].nac),curmodulename);;}
+    break;
+
+  case 552:
+#line 2609 "fortran.y"
+    {strcpy((yyval.nac),(yyvsp[(1) - (1)].nac));;}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 6445 "fortran.tab.c"
+      default: break;
     }
-    yyssp -= yym;
-    yystate = *yyssp;
-    yyvsp -= yym;
-    yym = yylhs[yyn];
-    if (yystate == 0 && yym == 0)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
-        yystate = YYFINAL;
-        *++yyssp = YYFINAL;
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
         *++yyvsp = yyval;
-        if (yychar < 0)
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
         {
-            if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-            if (yydebug)
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
             {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
-                printf("%sdebug: state %d, reading %d (%s)\n",
-                        YYPREFIX, YYFINAL, yychar, yys);
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
             }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
-        goto yyloop;
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead token after an
+	 error, discard it.  */
+
+      if (yychar <= YYEOF)
+	{
+	  /* Return failure if at end of input.  */
+	  if (yychar == YYEOF)
+	    YYABORT;
     }
-    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
-        yystate = yytable[yyn];
     else
-        yystate = yydgoto[yym];
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
+	{
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++yyvsp = yylval;
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
 #endif
-    if (yyssp >= yyss + yystacksize - 1)
-    {
-        goto yyoverflow;
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp);
+      YYPOPSTACK (1);
     }
-    *++yyssp = yystate;
-    *++yyvsp = yyval;
-    goto yyloop;
-yyoverflow:
-    yyerror("yacc stack overflow");
-yyabort:
-    return (1);
-yyaccept:
-    return (0);
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
+
+
+#line 2611 "fortran.y"
+
+
+void processfortran(char *fichier_entree)
+{
+   extern FILE *fortranin;
+   extern FILE *fortranout;
+   char nomfile[LONG_C];
+   int c;
+   int confirmyes;
+
+/*   fortrandebug = 1;*/
+   if ( mark == 1 ) printf("Firstpass == %d \n",firstpass);
+/******************************************************************************/
+/*  1-  Open input and output files                                           */
+/******************************************************************************/
+   strcpy(nomfile,commondirin);
+   strcat(nomfile,"/");
+   strcat(nomfile,fichier_entree);
+   fortranin=fopen( nomfile,"r");
+   if (! fortranin)
+   {
+      printf("Error : File %s does not exist\n",nomfile);
+      exit(1);
+   }
+
+   strcpy(curfile,nomfile);
+   strcpy(nomfile,commondirout);
+   strcat(nomfile,"/");
+   strcat(nomfile,fichier_entree);
+   strcpy(nomfileoutput,nomfile);
+   Save_Length(nomfileoutput,31);
+   if (firstpass == 1)
+   {
+      if (checkexistcommon == 1)
+      {
+         if (fopen(nomfile,"r"))
+         {
+            printf("Warning : file %s already exist\n",nomfile);
+            confirmyes = 0;
+            while (confirmyes==0)
+            {
+               printf("Override file %s ? [Y/N]\n",nomfile);
+               c=getchar();
+               getchar();
+               if (c==79 || c==110)
+               {
+                  printf("We stop\n");
+                  exit(1);
+               }
+               if (c==89 || c==121)
+               {
+                  confirmyes=1;
+               }
+            }
+         }
+      }
+   }
+
+/******************************************************************************/
+/*  2-  Variables initialization                                              */
+/******************************************************************************/
+
+   line_num_fortran_common=1;
+   line_num_fortran=1;
+   PublicDeclare = 0;
+   PrivateDeclare = 0;
+   ExternalDeclare = 0;
+   SaveDeclare = 0;
+   pointerdeclare = 0;
+   optionaldeclare = 0;
+   incalldeclare = 0;
+   VarType = 0;
+   VarTypepar = 0;
+   Allocatabledeclare = 0 ;
+   Targetdeclare = 0 ;
+   strcpy(NamePrecision," ");
+   VariableIsParameter =  0 ;
+   strcpy(NamePrecision,"");
+   c_star = 0 ;
+   functiondeclarationisdone = 0;
+   insubroutinedeclare = 0 ;
+   ininterfacedeclare = 0 ;   
+   strcpy(subroutinename," ");
+   isrecursive = 0;
+   InitialValueGiven = 0 ;
+   strcpy(EmptyChar," ");
+   inmoduledeclare = 0;
+   incontainssubroutine = 0;
+   colnum=0;
+   incom=0;
+   couldaddvariable=1;
+   afterpercent = 0;
+   aftercontainsdeclare = 1;
+   strcpy(nameinttypename,"");
+   /* Name of the file without format                                         */
+   tmp = strchr(fichier_entree, '.');
+   strncpy(curfilename,fichier_entree,strlen(fichier_entree)-strlen(tmp));
+   Save_Length(curfilename,30);
+/******************************************************************************/
+/*  3-  Parsing of the input file (1 time)                                    */
+/******************************************************************************/
+   if (firstpass == 0 )
+   {
+      fortranout=fopen(nomfileoutput,"w");
+
+/*      NewModule_Creation_0();*/
+   }
+
+   fortranparse();
+
+   if (firstpass == 0 )
+   {
+   NewModule_Creation_0();
+   }
+   
+   strcpy(curfile,mainfile);
+
+   if (firstpass == 0 )
+   {
+   fclose(fortranout);
+   }
+}
+
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.y
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.y	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.y	(revision 2715)
@@ -33,5 +33,7 @@
 /* version 1.7                                                                */
 /******************************************************************************/
+
 %{
+#define YYMAXDEPTH 1000
 #include <stdlib.h>
 #include <stdio.h>
@@ -318,5 +320,6 @@
 %type <na> opt_expr
 %type <na> optexpr
-%type <na> datavallist
+%type <lnn> datavallist
+%type <lnn> datanamelist
 %type <na> after_slash
 %type <na> after_equal
@@ -392,10 +395,12 @@
       ;
 opt_recursive :
+		{isrecursive = 0;}
       | TOK_RECURSIVE
+		{isrecursive = 1;}
       ;
 entry :
       | opt_recursive TOK_SUBROUTINE name_routine arglist
                    {
-                      if ( couldaddvariable == 1 )
+                      if ( couldaddvariable == 1)
                       {
                       /* open param file                                      */
@@ -618,5 +623,7 @@
                       {
                          if ( insubroutinedeclare == 0 )
+                         {
                                                   Add_GlobalParameter_Var_1($3);
+                                                  }
                          else Add_Parameter_Var_1($3);
                          pos_end = setposcur();
@@ -675,4 +682,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -708,9 +716,17 @@
                    {
                       /* we should remove the data declaration                */
-                      if ( couldaddvariable == 1 && aftercontainsdeclare == 0 )
+                      if ( couldaddvariable == 1 && aftercontainsdeclare != 2 )
                       {
                         pos_end = setposcur();
                         RemoveWordSET_0(fortranout,pos_curdata,
                                               pos_end-pos_curdata);
+                      }
+                      if ( couldaddvariable == 1 && aftercontainsdeclare == 1 )
+                      {
+                      if (firstpass == 0)
+                      {
+                        ReWriteDataStatement_0(fortranout);
+                        pos_end = setposcur();
+                  }
                       }
                   }
@@ -792,4 +808,5 @@
                            insubroutinedeclare == 0 )
                       {
+
                          sprintf(ligne,"\n#include \"Module_Declar_%s.h\"\n"
                                                                 ,curmodulename);
@@ -800,4 +817,6 @@
                          tofich (module_declar, ligne,1);
                          GlobalDeclaration = 1 ;
+                         pos_cur_decl = setposcur();
+
                       }
                          $$ = $1;
@@ -839,4 +858,5 @@
                       VariableIsParameter =  0 ;
                       Allocatabledeclare = 0 ;
+                      Targetdeclare = 0 ;
                       SaveDeclare = 0;
                       pointerdeclare = 0;
@@ -898,4 +918,5 @@
                    {
                       pos_curdata = setposcur()-strlen($1);
+                      Init_List_Data_Var();
                    }
 data : TOK_NAME TOK_SLASH datavallist TOK_SLASH
@@ -903,7 +924,12 @@
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",$3);
-                      Add_Data_Var_1($1,ligne);
+/*                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+/*                      sprintf(ligne,"%s",$3);*/
+                      createstringfromlistname(ligne,$3);
+                      if (firstpass == 1)
+                      Add_Data_Var_1(&List_Data_Var,$1,ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,$1,ligne);
                       }
                    }
@@ -912,7 +938,12 @@
                       if ( couldaddvariable == 1 )
                       {
-                      if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
-                      else sprintf(ligne,"(/ %s /)",$5);
-                      Add_Data_Var_1($3,ligne);
+                      /*if ( aftercontainsdeclare == 1 ) strcpy(ligne,"");
+                      else */
+                      /*sprintf(ligne,"%s",$5);   */
+                      createstringfromlistname(ligne,$5);                      
+                      if (firstpass == 1)                      
+                      Add_Data_Var_1(&List_Data_Var,$3,ligne);
+                      else
+                      Add_Data_Var_1(&List_Data_Var_Cur,$3,ligne);                      
                       }
                    }
@@ -926,4 +957,8 @@
                        /*******************************************************/
                        /*******************************************************/
+                       if (firstpass == 1)
+                       Add_Data_Var_Names_01(&List_Data_Var,$1,$3);
+                       else
+                       Add_Data_Var_Names_01(&List_Data_Var_Cur,$1,$3);
                    }
       ;
@@ -932,5 +967,5 @@
                       if ( couldaddvariable == 1 )
                       {
-                         strcpy($$,$1);
+                         $$ = Insertname(NULL,$1,0);
                       }
                    }
@@ -939,5 +974,5 @@
                       if ( couldaddvariable == 1 )
                       {
-                         sprintf($$,"%s,%s",$1,$3);
+                         $$ = Insertname($3,$1,1);
                       }
                    }
@@ -961,6 +996,16 @@
       ;
 datanamelist : TOK_NAME
+		{
+		$$=Insertname(NULL,$1,0);
+		}
       | TOK_NAME '(' expr ')'
+      {
+      printf("INSTRUCTION NON TRAITEE : INITIALISATION DE DATA AVEC EXPRESSION\n");
+      exit(0);
+      }
       | datanamelist ',' datanamelist
+      {
+      $$ = concat_listname($1,$3);
+      }
       ;
 expr_data : opt_signe simple_const
@@ -990,5 +1035,12 @@
       ;
 interface : TOK_INTERFACE opt_name
+	{
+	ininterfacedeclare = 1 ;
+	printf("INTEFACE entree\n");
+	}
       | TOK_ENDINTERFACE opt_name
+      {
+      ininterfacedeclare = 0;
+      }
       ;
 before_dimension : TOK_DIMENSION
@@ -1045,9 +1097,9 @@
 use_name_list : TOK_NAME
            {
-           $$ = Insertname(NULL,$1);
+           $$ = Insertname(NULL,$1,0);
            }
       | use_name_list ',' TOK_NAME
           {
-          $$ = Insertname($1,$3);
+          $$ = Insertname($1,$3,0);
           }
       ;
@@ -1063,5 +1115,5 @@
                          {
                             sprintf(charusemodule,"%s",$2);
-                            Add_NameOfCommon_1($2);
+                            Add_NameOfCommon_1($2,subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
@@ -1074,5 +1126,5 @@
                          {
                             sprintf(charusemodule,"%s",$3);
-                            Add_NameOfCommon_1($3);
+                            Add_NameOfCommon_1($3,subroutinename);
                             pos_end = setposcur();
                             RemoveWordSET_0(fortranout,pos_curcommon,
@@ -1393,4 +1445,5 @@
                     }
       | TOK_TARGET
+      				{Targetdeclare = 1;}
       ;
 intent_spec : TOK_IN {strcpy($$,$1);}
@@ -1587,9 +1640,19 @@
       ;
 
-lhs : ident         {if ( couldaddvariable == 1 ) strcpy($$,$1);}
+lhs : ident         {if ( couldaddvariable == 1 )
+						{
+						printf("ident = %s\n",$1);
+						strcpy($$,$1);}
+						}
       | structure_component
-                   {if ( couldaddvariable == 1 ) strcpy($$,$1);}
+                   {if ( couldaddvariable == 1 ) {
+                   printf("struct = %s\n",$1);
+                   strcpy($$,$1);}
+                   }
       | array_ele_substring_func_ref
-                   {if ( couldaddvariable == 1 ) strcpy($$,$1);}
+                   {if ( couldaddvariable == 1 ) {
+                   printf("arrayref = %s\n",$1);
+                   strcpy($$,$1);
+                   }}
       ;
 beforefunctionuse : {
@@ -1662,5 +1725,5 @@
       ;
 ident : TOK_NAME    {
-                       if ( couldaddvariable == 1 )
+                       if ( couldaddvariable == 1 && afterpercent == 0)
                        {
                        if ( Vartonumber($1) == 1 )
@@ -1673,4 +1736,5 @@
                        if ( VariableIsNotFunction($1) == 0 )
                        {
+                       printf("var = %s\n",$1);
                           if ( inagrifcallargument == 1 )
                           {
@@ -1685,41 +1749,12 @@
                           strcpy(truename,$1);
                           if (variscoupled_0($1)) strcpy(truename,getcoupledname_0($1));
-/*
-                          if ( VarIsNonGridDepend($1) == 0 &&
-                               Variableshouldberemove($1) == 0 )
-                          {
-                             if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0($1) == 1 ||
-                                  varispointer_0($1) == 1 )
-                             {
-                            if ((IsinListe(List_UsedInSubroutine_Var,$1) == 1) || (inagrifcallargument == 1))
-                             {
-                              if (varistyped_0($1) == 0)
-                                 {
-                                 ModifyTheVariableName_0($1);
-                                 }
-                                 }
-                                 else
-                                 {
-                                 }
-                             }
-                             if (variscoupled_0($1) == 1)
-                             {
-      printf("mla variable %s est couplee %s\n",$1,getcoupledname_0($1));
-                             ModifyTheVariableNamecoupled_0($1,getcoupledname_0($1));
-                             }
-                             if ( inagrifcallargument != 1 ||
-                                  sameagrifargument ==1 )
-                                  Add_UsedInSubroutine_Var_1($1);
-                          }
-                          NotifyAgrifFunction_0($1);
-*/
+
                           if ( VarIsNonGridDepend(truename) == 0 &&
                                Variableshouldberemove(truename) == 0 )
-                          {
+                          {                      
                              if ( inagrifcallargument == 1 ||
-                                  varisallocatable_0(truename) == 1 ||
                                   varispointer_0(truename) == 1 )
                              {
+                             printf("var2 = %s\n",$1);
                             if ((IsinListe(List_UsedInSubroutine_Var,$1) == 1) || (inagrifcallargument == 1))
                              {
@@ -1730,11 +1765,19 @@
                                  }
                              }
+                             printf("ici3\n");
                              if ( inagrifcallargument != 1 ||
                                   sameagrifargument ==1 )
+                                  {
+                                  printf("ici5 %s\n",truename);
                                   Add_UsedInSubroutine_Var_1(truename);
+                          }
                           }
                           NotifyAgrifFunction_0(truename);
                        }
                        }
+                       else
+                       {
+                       afterpercent = 0;
+                    }
                     }
       ;
@@ -2162,4 +2205,6 @@
                       else
                       {
+                      incontainssubroutine = 1;
+                      strcpy(previoussubroutinename,subroutinename);
                        if ( couldaddvariable == 1 )
                        {
@@ -2426,9 +2471,9 @@
       | '*'
       | TOK_DASTER
-      | TOK_NAME expr
-      | TOK_NAME expr '%' ident_dims
-      | TOK_NAME '(' triplet ')'
-      | TOK_NAME '*'
-      | TOK_NAME TOK_DASTER
+      | ident expr
+      | ident expr '%' ident_dims
+      | ident '(' triplet ')'
+      | ident '*'
+      | ident TOK_DASTER
       ;
 iofctl : TOK_OPEN
@@ -2574,5 +2619,5 @@
    int confirmyes;
 
-   /*fortrandebug = 1;*/
+/*   fortrandebug = 1;*/
    if ( mark == 1 ) printf("Firstpass == %d \n",firstpass);
 /******************************************************************************/
@@ -2638,4 +2683,5 @@
    VarTypepar = 0;
    Allocatabledeclare = 0 ;
+   Targetdeclare = 0 ;
    strcpy(NamePrecision," ");
    VariableIsParameter =  0 ;
@@ -2644,11 +2690,15 @@
    functiondeclarationisdone = 0;
    insubroutinedeclare = 0 ;
+   ininterfacedeclare = 0 ;   
    strcpy(subroutinename," ");
+   isrecursive = 0;
    InitialValueGiven = 0 ;
    strcpy(EmptyChar," ");
    inmoduledeclare = 0;
+   incontainssubroutine = 0;
    colnum=0;
    incom=0;
    couldaddvariable=1;
+   afterpercent = 0;
    aftercontainsdeclare = 1;
    strcpy(nameinttypename,"");
@@ -2664,11 +2714,19 @@
       fortranout=fopen(nomfileoutput,"w");
 
-      NewModule_Creation_0();
+/*      NewModule_Creation_0();*/
    }
 
    fortranparse();
 
+   if (firstpass == 0 )
+   {
+   NewModule_Creation_0();
+   }
+   
    strcpy(curfile,mainfile);
 
-   if (firstpass == 0 ) fclose(fortranout);
+   if (firstpass == 0 )
+   {
+   fclose(fortranout);
+   }
 }
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.yy.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.yy.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/fortran.yy.c	(revision 2715)
@@ -1,7 +1,12 @@
+#line 2 "fortran.yy.c"
+
+#line 4 "fortran.yy.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
 #define yy_create_buffer fortran_create_buffer
 #define yy_delete_buffer fortran_delete_buffer
-#define yy_scan_buffer fortran_scan_buffer
-#define yy_scan_string fortran_scan_string
-#define yy_scan_bytes fortran_scan_bytes
 #define yy_flex_debug fortran_flex_debug
 #define yy_init_buffer fortran_init_buffer
@@ -12,38 +17,95 @@
 #define yyleng fortranleng
 #define yylex fortranlex
+#define yylineno fortranlineno
 #define yyout fortranout
 #define yyrestart fortranrestart
 #define yytext fortrantext
 #define yywrap fortranwrap
-
-#line 20 "fortran.yy.c"
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#define yyalloc fortranalloc
+#define yyrealloc fortranrealloc
+#define yyfree fortranfree
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
 #include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
 #endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
 #endif
-
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
 
 /* The "const" storage-class-modifier is valid. */
@@ -52,20 +114,11 @@
 #else	/* ! __cplusplus */
 
-#if __STDC__
-
-#define YY_USE_PROTOS
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
 #define YY_USE_CONST
 
-#endif	/* __STDC__ */
+#endif	/* defined (__STDC__) */
 #endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
 
 #ifdef YY_USE_CONST
@@ -73,11 +126,4 @@
 #else
 #define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
 #endif
 
@@ -96,5 +142,5 @@
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
@@ -102,5 +148,5 @@
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
@@ -109,15 +155,30 @@
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE fortranrestart(fortranin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
-
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t fortranleng;
+
+extern FILE *fortranin, *fortranout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
@@ -125,40 +186,24 @@
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
 		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
+		/* Undo effects of setting up fortrantext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = (yy_hold_char); \
 		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up fortrantext again */ \
 		} \
 	while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
@@ -176,5 +221,5 @@
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
@@ -197,4 +242,7 @@
 	int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
@@ -203,4 +251,5 @@
 
 	int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
@@ -212,225 +261,265 @@
 	 *
 	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
+	 * (via fortranrestart()), so that the user can continue scanning by
+	 * just pointing fortranin at a new input file.
 	 */
 #define YY_BUFFER_EOF_PENDING 2
+
 	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
  */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when fortrantext is formed. */
 static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
+yy_size_t fortranleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
+static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
+/* Flag which is used to allow fortranwrap()'s to do buffer switches
+ * instead of setting up a fresh fortranin.  A bit of a hack ...
  */
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
+void fortranrestart (FILE *input_file  );
+void fortran_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE fortran_create_buffer (FILE *file,int size  );
+void fortran_delete_buffer (YY_BUFFER_STATE b  );
+void fortran_flush_buffer (YY_BUFFER_STATE b  );
+void fortranpush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void fortranpop_buffer_state (void );
+
+static void fortranensure_buffer_stack (void );
+static void fortran_load_buffer_state (void );
+static void fortran_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER fortran_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE fortran_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE fortran_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE fortran_scan_bytes (yyconst char *bytes,yy_size_t len  );
+
+void *fortranalloc (yy_size_t  );
+void *fortranrealloc (void *,yy_size_t  );
+void fortranfree (void *  );
+
+#define yy_new_buffer fortran_create_buffer
 
 #define yy_set_interactive(is_interactive) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        fortranensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            fortran_create_buffer(fortranin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 	}
 
 #define yy_set_bol(at_bol) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
+	if ( ! YY_CURRENT_BUFFER ){\
+        fortranensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            fortran_create_buffer(fortranin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 	}
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
 
 typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+FILE *fortranin = (FILE *) 0, *fortranout = (FILE *) 0;
+
 typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+extern int fortranlineno;
+
+int fortranlineno = 1;
+
+extern char *fortrantext;
+#define yytext_ptr fortrantext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up fortrantext.
  */
 #define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
+	(yytext_ptr) = yy_bp; \
+	fortranleng = (size_t) (yy_cp - yy_bp); \
+	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 173
-#define YY_END_OF_BUFFER 174
-static yyconst short int yy_accept[1124] =
+	(yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 176
+#define YY_END_OF_BUFFER 177
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static yyconst flex_int16_t yy_accept[1162] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  174,  173,  163,  159,  162,  172,  151,  150,
-      153,  165,  151,  153,  153,  155,  152,  138,  149,  154,
-      157,  156,  158,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  163,  159,  162,  172,  149,  144,  144,  144,  144,
-      144,  173,  173,  170,  173,  153,  144,    0,    0,  163,
-      164,    0,  162,  172,  172,  172,    0,  142,    0,    0,
-      165,  165,  165,  165,    0,    0,    0,  141,    0,    0,
-      133,   25,    0,  145,    0,    0,    0,    0,    0,    0,
-
-        0,  134,    0,  149,   24,    0,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,   42,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,   84,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  163,  161,    0,  161,    0,    0,
-        0,    0,    0,  164,  160,  161,    0,  172,  171,  172,
-      172,  172,  161,  149,    4,  144,  144,  144,  144,  144,
-      144,    0,  170,    0,    0,    0,  167,   25,    0,    0,
-
-        4,    0,  144,  144,  144,  144,  144,  144,    0,    0,
-        0,  172,  172,    0,    0,  165,  165,    0,    0,    0,
-        0,  140,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  148,  145,    0,
-        0,    0,  143,    0,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  114,  144,  144,
-      144,    0,  144,  144,  144,  144,  144,   15,  144,  144,
-      144,  113,  144,  144,  144,  144,  144,    0,  144,    0,
-       95,  144,  144,  144,  144,  144,  120,  144,  144,  125,
-      144,  144,  144,  144,  144,  144,   88,  144,  144,  144,
-
-      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  117,  144,  144,  144,  144,  144,  121,  144,  144,
-      144,  144,  144,  163,  161,    0,  164,    0,    0,    0,
-        0,    0,    0,    0,  161,    0,  161,  172,  172,  172,
-      149,    4,    4,    4,    4,  144,  144,  144,  144,  144,
-      144,    0,    0,    0,  167,    0,    0,    4,    4,    4,
-        4,  143,    0,  144,  144,    0,  144,  144,  144,  144,
-        0,    0,    0,  172,  172,    0,    0,  165,  165,    0,
-        0,    0,    0,  146,    0,  145,    0,  147,    0,   27,
-        0,   29,   28,   31,   30,   33,    0,    0,   35,    0,
-
-      145,    0,  146,    0,  145,    0,  147,    0,  143,    0,
-      144,  144,  124,  116,  144,  119,  122,  144,   21,  144,
-      144,  144,  144,  144,  115,  144,  144,  144,    0,  144,
-      144,  144,   93,    0,  107,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,    0,  108,  144,  144,  144,  144,
-      144,  144,  144,    0,   87,  144,  144,  144,  144,  144,
-      144,  144,    0,   97,  144,  144,    0,  110,  144,  144,
-      144,  144,  111,   20,   59,   73,  144,  144,  144,  144,
-      144,  144,  144,  144,   78,   43,  144,  144,  144,  144,
-       68,  144,  126,  118,  144,   71,   53,  144,    0,   96,
-
-       98,  144,   91,  100,  144,  144,  163,  161,  164,    0,
-        0,    0,    0,    0,    0,  161,    0,  161,  172,  172,
-      172,  149,    4,    4,  144,  144,  144,  144,  144,   17,
-        0,    0,    0,    4,    4,    0,  143,    0,  144,  144,
-      144,  144,    0,    0,    0,  172,  172,    0,    0,  165,
-      165,    0,    0,   37,   26,    0,   34,   36,    0,  143,
-        0,  143,  144,  144,  144,  144,  144,   48,  144,  144,
-      144,  123,  144,  144,    0,  144,  144,  144,    0,  144,
-      144,    0,    0,    0,    0,    0,    0,    0,    0,   41,
-      144,   94,  144,  144,  144,  144,  144,  144,  144,  144,
-
-      144,   75,   75,   75,   75,  144,    0,  106,  112,  144,
-      144,   87,  144,  144,   89,  144,  144,  144,  144,  144,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,   51,
-      144,   76,  144,  144,  144,    0,  144,  144,  144,  144,
-      144,  101,  144,  144,   54,   80,  163,  161,  164,    0,
-        0,    0,    0,    0,  161,    0,  161,  172,  172,  172,
-      149,    4,    3,    0,  103,  144,  144,   85,  144,   69,
-       70,   69,    0,    0,    0,    4,    3,    0,  143,    0,
-      143,  144,   48,  144,  123,    0,   22,    0,  172,   22,
-        0,   22,   22,  165,   22,    0,   22,   22,   22,   32,
-
-      144,   22,   22,   22,  144,  144,  144,   62,  144,  144,
-      144,  144,    0,  144,  144,  139,    0,    0,   92,  144,
-       41,    0,   94,    0,    0,    0,    0,    0,    0,    0,
-      144,  144,  144,  144,  144,  144,  144,  144,  144,    0,
-      109,  144,  144,  144,  144,  144,  144,  144,   65,  144,
-      144,  144,  128,   99,  127,  129,   38,  144,  144,  144,
-      144,  144,  144,   82,    0,  144,   10,   74,   18,  144,
-      144,   81,  163,  161,  164,    0,    0,    0,  161,  172,
-      172,   22,    4,    3,    3,  144,  144,  144,    0,    0,
-       22,    4,    3,    3,  144,   22,   22,   22,   23,  166,
-
-       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
-      144,  144,  144,   57,  144,  144,  144,    0,    0,  144,
-      144,   39,   92,    0,  144,    0,    0,    0,    0,    0,
-        0,    0,    0,  144,  144,  144,  144,  144,  144,   72,
-      144,  144,  144,    0,    0,  144,  144,   16,   49,   44,
-      144,  144,   45,    0,  144,  144,  144,  144,   66,   83,
-        7,    0,    0,  144,    0,  144,  144,    0,    0,    0,
-      172,   23,    4,  144,  144,   63,    0,   23,    4,   23,
-       23,   23,  144,    8,  144,  144,   86,  144,  144,   39,
-        0,    0,  144,  144,    0,  144,    0,    0,    0,    0,
-
-        0,    0,   72,    0,  144,  144,  144,  144,  144,  144,
-       55,  144,   64,    0,    0,    0,  135,   11,   19,  144,
-      144,    0,  144,   79,   67,  144,    0,  144,    0,  144,
-      144,    0,    0,  172,    4,  144,   58,    0,    4,  144,
-      131,   46,  144,   50,    0,    0,  144,  144,    0,   56,
-        0,    0,    0,    0,    0,    0,   55,  144,  144,   40,
-      144,  105,  144,  144,    0,    0,    0,    0,  135,  130,
-       90,    0,  144,   60,    0,   61,    0,  144,  144,    0,
-       58,  172,    4,    4,  144,    0,    4,    4,  144,    9,
-        0,    0,  144,  144,   56,    0,    0,   40,    0,  105,
-
-        0,  144,  144,   13,  144,  144,    0,    0,    0,  144,
-        0,    0,  102,    6,    0,  172,    4,    4,  144,    0,
-        4,    4,   47,    0,    0,  144,  144,    0,    0,   13,
-        0,   14,  144,  144,   52,    0,    0,    0,  144,    0,
-      102,    0,  172,    4,    2,  104,    0,    4,    2,    0,
-        0,  144,  144,   14,    0,    0,  132,  144,    0,    0,
-        0,  144,    0,  104,  172,    4,    0,    4,    0,    0,
-      137,  144,  132,    0,   12,    0,    0,    0,  144,    0,
-      172,    1,    0,    1,  137,    0,  144,   12,    0,    0,
-        0,  144,    0,  172,    0,    0,  136,    0,    0,    0,
-
-       77,    5,  172,    0,  136,   77,  172,    0,  172,    0,
-      172,    0,  172,    0,  172,    0,  168,    0,    0,    0,
-        0,  169,    0
+        0,    0,  177,  176,  165,  161,  164,  175,  152,  151,
+      155,  167,  152,  154,  154,  154,  157,  153,  137,  150,
+      156,  159,  158,  160,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  165,  161,  164,  175,  150,  145,  145,  145,
+      145,  145,  145,  176,  176,  173,  176,  176,  176,  161,
+      161,  154,  145,    0,    0,  165,    0,  166,    0,  164,
+      175,  175,  175,    0,  141,    0,    0,  167,  167,  167,
+      167,    0,    0,    0,  140,    0,    0,  132,   26,    0,
+
+      146,    0,    0,    0,    0,    0,    0,    0,  133,    0,
+      150,   25,    0,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+       43,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,   85,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  165,  163,    0,  163,    0,    0,    0,    0,
+        0,    0,  166,  162,  163,    0,  175,  174,  175,  175,
+      175,  163,  150,    4,  145,  145,  145,  145,   85,  145,
+
+      145,    0,  173,    0,    0,    0,    0,    0,    0,    0,
+      169,   26,    0,    0,    4,    0,  145,  145,  145,  145,
+      145,  145,    0,    0,    0,  175,  175,    0,    0,  167,
+      167,    0,    0,    0,    0,  139,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  149,  146,    0,    0,    0,  142,    0,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  115,  145,  145,  145,    0,  145,  145,  145,  145,
+      145,   16,  145,  145,  145,  114,  145,  145,  145,  145,
+      145,    0,  145,    0,   96,  145,  145,  145,  145,  145,
+
+      121,  145,  145,  126,  145,  145,  145,  145,  145,  145,
+      145,   89,  145,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  118,  145,  145,  145,
+      145,  145,  122,  145,  145,  145,  145,  145,  165,  163,
+        0,  166,    0,    0,    0,    0,    0,    0,    0,    0,
+      163,    0,  163,  175,  175,  175,  150,    4,    4,    4,
+        4,  145,  145,  145,  145,  145,  145,  145,    0,    0,
+        0,    0,  170,    0,    0,  169,    0,    0,    4,    4,
+        4,    4,  142,    0,  145,  145,    0,  145,  145,  145,
+      145,    0,    0,    0,  175,  175,    0,    0,  167,  167,
+
+        0,    0,    0,    0,  147,    0,  146,    0,  148,    0,
+       28,    0,   30,   29,   32,   31,   34,    0,    0,   36,
+        0,  146,    0,  147,    0,  146,    0,  148,    0,  142,
+        0,  125,  117,  145,  145,  120,  123,  145,  145,   22,
+      145,  145,  145,  145,  145,  116,  145,  145,  145,    0,
+      145,  145,  145,   94,    0,  108,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,    0,  109,  145,  145,  145,
+      145,  145,  145,  145,    0,   88,  145,  145,  145,  145,
+      145,  145,  145,    0,   98,  145,  145,    0,  111,  145,
+      145,  145,  145,  112,   21,  145,   60,   74,  145,  145,
+
+      145,  145,  145,  145,  145,  145,   79,   44,  145,  145,
+      145,  145,   69,  145,  127,  119,  145,   72,   54,  145,
+        0,   97,   99,  145,   92,  101,  145,  145,  165,  163,
+      166,    0,    0,    0,    0,    0,    0,    0,  163,    0,
+      163,  175,  175,  175,  150,    4,    4,  145,  145,  145,
+      145,  145,  145,   18,    0,    0,    0,    0,    0,  170,
+        0,    0,    4,    4,    0,  142,    0,  145,  145,  145,
+      145,    0,    0,    0,  175,  175,    0,    0,  167,  167,
+        0,    0,   38,   27,    0,   35,   37,    0,  142,    0,
+      142,  145,  145,  145,  145,  145,   49,  145,  145,  145,
+
+      124,  145,  145,    0,  145,  145,  145,    0,  145,  145,
+        0,    0,    0,    0,    0,    0,    0,    0,   42,  145,
+       95,  145,  145,  145,  145,  145,  145,  145,  145,   76,
+       76,   76,   76,  145,    0,  107,  113,  145,  145,   88,
+      145,  145,   90,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  145,  145,  145,  145,  145,   52,  145,   77,
+      145,  145,  145,    0,  145,  145,  145,  145,  145,  102,
+      145,  145,   55,   81,  165,  163,  166,    0,    0,    0,
+        0,    0,    0,  163,    0,  163,  175,  175,  175,  150,
+        4,    3,    0,  104,  145,  145,   86,  145,  145,   70,
+
+       71,   70,    0,    0,    0,    0,    4,    3,    0,  142,
+        0,  142,  145,   49,  145,  124,    0,   23,    0,  175,
+       23,    0,   23,   23,  167,   23,    0,   23,   23,   23,
+       33,  145,  145,   23,   23,   23,  145,  145,   63,  145,
+      145,  145,  145,    0,  145,  145,  138,    0,    0,   93,
+      145,   42,    0,   95,    0,    0,    0,    0,    0,    0,
+      145,  145,  145,  145,  145,  145,  145,  145,    0,  110,
+      145,  145,  145,  145,  145,  145,  145,   66,  145,  145,
+      129,  100,  128,  130,   39,  145,  145,  145,  145,  145,
+      145,  145,   83,    0,  145,   11,   75,   19,  145,  145,
+
+       82,  165,  163,  166,    0,    0,    0,    0,  163,  175,
+      175,   23,    4,    3,    3,  145,  145,  145,  145,    0,
+        0,    0,   23,    4,    3,    3,  145,   23,   23,   23,
+       24,    0,  168,   24,   24,   24,   24,   24,   24,   24,
+       24,   24,   24,  145,  145,  145,   58,  145,  145,  145,
+        0,    0,  145,  145,   40,   93,    0,  145,    0,    0,
+        0,    0,    0,    0,    0,  145,  145,  145,  145,  145,
+       73,  145,  145,  145,    0,    0,  145,  145,   17,   50,
+       45,  145,   46,    0,  145,  145,    9,  145,  145,   67,
+       84,    7,    0,    0,  145,    0,  145,  145,    0,    0,
+
+        0,    0,  175,   24,    4,  145,  145,   64,  145,    0,
+        0,   24,    4,   24,   24,   24,  145,    8,  145,  145,
+       87,  145,  145,   40,    0,    0,  145,  145,    0,  145,
+        0,    0,    0,    0,    0,   73,    0,  145,  145,  145,
+      145,  145,   56,  145,   65,    0,    0,    0,    0,  134,
+       12,   20,  145,    0,  145,   80,   68,  145,    0,  145,
+        0,  145,  145,    0,    0,    0,  175,    4,  145,   59,
+      145,    0,    0,    4,  145,  131,   47,  145,   51,    0,
+        0,  145,  145,    0,   57,    0,    0,    0,    0,    0,
+       56,  145,   41,  145,  106,  145,  145,    0,    0,    0,
+
+        0,    0,  134,   91,    0,  145,   61,    0,   62,    0,
+      145,  145,    0,   59,    0,  175,    4,    4,  145,  143,
+        0,    0,    4,    4,  145,   10,    0,    0,  145,  145,
+       57,    0,   41,    0,  106,    0,  145,   14,  145,  145,
+        0,    0,    0,  145,    0,    0,  103,    6,    0,  143,
+      175,    4,    4,  145,    0,    0,    4,    4,   48,    0,
+        0,  145,  145,    0,   14,    0,   15,  145,   53,    0,
+        0,    0,  145,    0,  103,    0,  175,    4,    2,  105,
+        0,    0,    4,    2,    0,    0,  145,  145,   15,    0,
+      145,    0,    0,    0,  145,    0,  105,  175,    4,    0,
+
+        0,    4,    0,    0,  136,  145,    0,   13,    0,    0,
+        0,  145,    0,  175,    1,    0,    0,  144,    1,  136,
+        0,  145,   13,    0,    0,    0,    0,  145,    0,  175,
+        0,    0,  135,    0,    0,    0,   78,    5,  175,    0,
+      135,   78,  175,    0,  175,    0,  175,    0,  175,    0,
+      175,    0,  175,  171,    0,    0,    0,    0,    0,  172,
+        0
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
@@ -439,13 +528,13 @@
         1,    4,    5,    6,    7,    8,    9,   10,   11,   12,
        13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
-       23,   24,   25,   26,   27,   28,   20,   29,   30,   31,
-       32,   33,    1,    1,   37,   38,   39,   40,   41,   42,
-       43,   44,   45,   46,   47,   48,   49,   50,   51,   52,
-       53,   54,   55,   56,   57,   58,   59,   60,   61,   62,
-       34,    1,   35,    1,   36,    1,   37,   38,   39,   40,
-
+       23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
+       33,   34,    1,    1,   35,   36,   37,   38,   39,   40,
        41,   42,   43,   44,   45,   46,   47,   48,   49,   50,
        51,   52,   53,   54,   55,   56,   57,   58,   59,   60,
-       61,   62,   63,   63,   63,    1,    1,    1,    1,    1,
+       61,    1,   62,    1,   63,    1,   64,   65,   66,   67,
+
+       68,   69,   70,   71,   72,   44,   73,   74,   75,   76,
+       77,   78,   79,   80,   81,   82,   83,   84,   85,   86,
+       87,   88,   89,   89,   89,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -464,754 +553,1315 @@
     } ;
 
-static yyconst int yy_meta[64] =
+static yyconst flex_int32_t yy_meta[90] =
     {   0,
-        1,    2,    3,    4,    1,    5,    1,    1,    1,    6,
-        1,    1,    1,    1,    7,    1,    7,    8,    1,    9,
-        9,    9,    9,    9,    9,    9,    9,    9,    1,    1,
-        1,    1,    1,    1,    1,   10,   11,   10,   10,   12,
-       13,   14,   15,   16,   10,   10,   10,   15,   15,   15,
-       11,   10,   12,   15,   15,   14,   15,   10,   17,   10,
-       10,   10,    5
+        1,    2,    3,    2,    1,    4,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    5,    1,    6,
+        6,    6,    6,    6,    6,    6,    6,    6,    6,    1,
+        1,    1,    1,    1,    7,    8,    8,    9,    9,    5,
+       10,   11,    8,    8,    8,   10,   10,   10,    7,    8,
+        9,   10,   10,    5,   10,    8,   12,    8,    8,    8,
+        1,    1,    8,    7,    8,    8,    9,    9,    5,   10,
+       11,    8,    8,   10,   10,   10,    7,    8,    9,   10,
+       10,    5,   10,    8,   12,    8,    8,    8,    4
     } ;
 
-static yyconst short int yy_base[1180] =
+static yyconst flex_int16_t yy_base[1215] =
     {   0,
-        0,   62,    0,    0,    0,    0, 4185,   65,    0,   55,
-        0,    0, 4187,   35,   69,   70,   74,   37,   75,   50,
-       53,   72,   93,   78,   66,   56,  148,   87,   81,   65,
-       68,   99,   71,  191,  230,  108,  183,  225,  244,  103,
-      137,  152,  185,  250,  265,  262,  281,  220,  286,  296,
-      308,  368,  134,  424,  321,  350,  149, 4149,  310,  337,
-      270, 4189, 4182, 4189,  158,  380,  481, 4147, 4129,  138,
-      163,  175,  179,    0, 4145, 4127, 4174, 4189,  147,  133,
-     4176, 4175,  192,  156,  232,  393,  376, 4189,  402,  406,
-     4189, 4189,  543,  184, 4127, 4123,  204,  218,  226, 4121,
-
-     4123, 4189,  584,  358, 4189,  448,  532,  507,  514,  572,
-      534,  588,  593,  605,  617,  381,  242,  169,  195,  404,
-      384,  312,  517,  672,  524,  378,  403,  544,  365,  630,
-      597,  545,  424,  565,  651,  679,  425,  650,  626,  648,
-      672,  673,  603,  674,  680,  684,  698,  686,  699,  704,
-      706,  584,  707,  710,  711,  730,  683,  297,  732,  735,
-      734,  737,  742,  750,  788,  795, 4170,  389,  316, 4135,
-     4123,   72, 4115,  807, 4189,  863,  427, 4166, 4189,  225,
-      327,  543,  632,  660,  804,  765,  799,  770,  764,  785,
-      788, 4165, 4189,  343, 4164,  774, 4189, 4163,  820,  564,
-
-      856,  918,  946, 4147,  271,  661,  187,  270, 4116, 4106,
-      812, 4114, 4104,  547,  804,  617,  398,  859,  894,  906,
-      868, 4189,  889,  871,  815,  860,  896, 4120,  372, 4141,
-     4140, 4139, 4138,  275, 4099, 4136, 4099, 4189,  874,  907,
-      908,  914, 4111, 4110,  864,  973,  999,  977,  975,  983,
-      984,  981, 1002,  986,  987, 1006, 1007, 1008, 1011, 1020,
-     1010, 4091,  737, 1029, 1032, 1017, 1036, 1089, 1033, 1078,
-     1042, 1035, 1047, 1058, 1038, 1057, 1063, 1101, 1071, 1013,
-     4189, 1070, 1079, 1082, 1083, 1105, 1110, 1148, 1149, 1112,
-     1117, 1119, 1126, 1128, 1133, 1139, 1076, 1125, 1137, 1140,
-
-     1151, 1161, 1162, 1171, 1163, 1175, 1176, 1177, 1186, 1187,
-     1184, 1198, 1189, 1199, 1202, 1141, 1245, 1207, 1221, 1209,
-     1211, 1213, 1225, 1264, 1283, 4088, 1290, 4145, 4092, 4096,
-     4089, 4093, 4091, 4101, 1346,  715,  922,  557, 1120,  837,
-     1266,    0,  931, 4098, 4091, 1236, 1235, 1243, 1264, 1271,
-     1274,  800, 4020, 1311, 4189, 1268,  873, 4003, 1332, 1295,
-     1132, 1401, 1440,    0, 3971, 1479,  697,  659,  815,  998,
-     3883, 3892,  932, 3876, 3823, 1231,  551,  561, 1302, 1321,
-     1342, 1351, 1355, 1385, 1410, 1424, 1449, 1463, 3829, 4189,
-     3812, 4189, 4189, 4189, 4189, 4189, 3767, 3805, 4189, 3802,
-
-     1347, 1488, 1497, 1506, 1515, 1524, 1533, 1302, 3778, 1327,
-     1304, 1525, 4189, 1273, 1362, 1361, 1402, 1403, 1441, 1442,
-     1526, 1443, 1527, 1528, 1531, 1533, 1535, 1534, 3773, 1549,
-     1553, 1539, 1597, 1655, 4189, 1541, 1554, 1563, 1565, 1567,
-     1569, 1575, 1578, 1577, 1361, 4189, 1583, 1714, 1587, 1623,
-     1591, 1596, 1607, 3762, 1611, 1617, 1612, 1616, 1630, 1631,
-     1645, 1639, 1684, 4189, 1652, 1654, 1690, 4189, 1741, 1672,
-     1742, 1743, 1744, 1745, 1746, 1747, 1751, 1757, 1766, 1756,
-     1767, 1771, 1772, 1777, 1776, 1801, 1779, 1780, 1781, 1782,
-     1787, 1790, 1800, 1802, 1828, 1805, 1806, 1810, 1846, 4189,
-
-     1808, 1812, 1809, 1814, 1830, 1832, 1870, 1885, 1892, 3770,
-     3752, 3770, 3767, 3761, 3797, 1948, 1009, 1380, 1303,  663,
-     1414, 1873, 3746, 3747, 1903, 1863, 1902, 1839, 1943, 3794,
-     1306, 1438, 1451, 1849, 1566, 2003, 2029, 2068, 1591,  424,
-     1063, 1373, 3756,    0, 1392, 3755,    0,  815, 3788, 1875,
-     3790, 1919, 1702, 4189, 4189, 3774, 4189, 4189, 1987, 2013,
-     2038, 2052, 1844, 2096, 1864, 1882, 1884, 1883, 1927, 1924,
-     1929, 1909, 1945, 1930, 3746, 1949, 2123, 2124, 2160, 2045,
-     2126, 3738, 3728, 1588, 3733, 3680, 1623, 3668, 3683, 1963,
-     2129, 1965, 2030, 2132, 2130, 2128, 2136, 2148, 2150, 2138,
-
-     2191, 4189, 2186, 2178, 2162, 2180, 1990, 4189, 2164, 2166,
-     2184, 4189, 2187, 2196, 2188, 2190, 2194, 2200, 2209, 2203,
-     2206, 2210, 2218, 2222, 2221, 2230, 2225, 2228, 2236, 2231,
-     2246, 2237, 2243, 2244, 2249, 3696, 2252, 2255, 2258, 2256,
-     2264, 4189, 2265, 2267, 2276, 2277, 2322, 2331, 2341, 2313,
-     3686, 1416, 3684, 2336, 2397, 1449, 1648, 1854, 2040, 3697,
-     2324, 3654, 1783, 2335, 4189, 2313, 2312, 1910, 2335, 2392,
-     4189, 2389, 2194, 2341, 3693, 2249, 2042, 2452, 2478, 2504,
-     2530, 1870, 3675, 2558, 3672,    0, 4189, 2615,    0,    0,
-     3677, 3676, 4189, 3659, 3654, 2353, 2366, 2400, 4189, 4189,
-
-     2643, 2392, 2355, 2331, 2369, 2384, 2385, 2389, 2390, 2391,
-     2392, 2397, 3580, 2431, 2415, 2393, 3585, 3582, 2395, 2430,
-     4189, 3575, 4189, 3566, 3580, 3539, 3541, 3550, 3535, 3495,
-     2454, 2455, 2457, 2480, 2481, 2428, 2670, 2458, 2671, 2455,
-     4189, 2482, 2708, 2672, 2676, 2677, 2692, 2483, 2484, 2678,
-     2680, 2690, 2685, 2699, 2700, 2703, 2739, 2705, 2710, 2711,
-     2712, 2714, 2721, 2715, 2537, 2726, 2719, 2724, 2735, 2775,
-     2744, 2745, 2781, 2792, 2801, 3478, 3436, 3432,    0, 1637,
-     3476, 3475, 3435,    0, 1991, 2750, 2772, 2806, 1959, 3473,
-     3472, 2313, 3471, 2356, 2860, 2921,    0, 3455, 4189, 4189,
-
-        0, 3466, 4189, 3468, 2537, 2621, 4189, 2905, 2793, 2747,
-     2782, 2779, 2805, 2753, 2897, 2780, 2802, 3429, 2458, 2899,
-     2791, 2898, 4189, 3428, 2900, 3429, 3426, 3409, 3422, 3423,
-     3409, 3421, 3407, 2902, 2903, 2918, 2922, 2923, 2924, 2926,
-     2927, 2928, 2936, 2981, 2976, 2937, 2951, 2955, 2957, 2958,
-     2959, 2963, 2960, 2997, 2965, 2966, 2967, 2969, 2979, 2981,
-     2987, 3024, 3423, 2988, 2811, 2990, 2993, 3417, 3407, 2459,
-     2510, 3453, 3419, 2994, 2997, 2462, 3026, 3448, 3029, 3063,
-        0, 3426, 3002, 3000, 3016, 3006, 3013, 3018, 3021, 4189,
-     3389, 3309, 3024, 3022, 3272, 3027, 3215, 3209, 3187, 3150,
-
-     3134, 3029, 4189, 3004, 3055, 3040, 3056, 3042, 3058, 3061,
-     3062, 3067, 3065, 3098, 2484, 3110, 3119, 3070, 3088, 3089,
-     3094, 2917, 3090, 3091, 3097, 3098, 2953, 3099, 2930, 3100,
-     3109, 2818, 2796, 2785, 2502, 3110, 3102, 2383, 3135, 3112,
-     3120, 3124, 3128, 3125, 2746, 2687, 3131, 3133, 2605, 3134,
-     2590, 2592, 2586, 2479, 2459, 2433, 4189, 3139, 3143, 3144,
-     3147, 3149, 3152, 3155, 2541, 3192, 3208, 3204, 3210, 3162,
-     3178, 2438, 3185, 3182, 2414, 3188, 2340, 3189, 3190, 2333,
-     4189, 2018, 2288, 2260, 3192,  112, 3197, 3188, 3200, 3191,
-     2137, 2149, 3210, 3211, 4189, 2017, 2011, 4189, 1998, 4189,
-
-     1986, 3212, 3213, 3197, 3216, 3218, 2624, 3271, 1977, 3239,
-     1982, 1903, 3223, 3231, 1885, 3254, 1854, 1829, 3232, 3066,
-     1951, 1593, 3241, 1822, 1744, 3242, 3245, 1736, 1662, 4189,
-     1653, 3250, 3257, 3252, 3254, 2850, 3310, 1642, 3270, 1622,
-     4189, 1521, 3100, 1441,    0, 3255, 3294, 1280, 1416, 1354,
-     1309, 3268, 3280, 4189, 1314, 1246, 3264, 3278, 3325, 3333,
-     1178, 3284, 1155, 4189, 3300, 1072, 3313, 2771, 1054, 1064,
-     3294, 3296, 4189, 1044, 3302, 3350, 3377,  992, 3305,  960,
-     3102,    0, 3337,  892, 4189,  829, 3312, 4189, 3342, 3388,
-      696, 3345,  555, 3358, 3364,  406, 3367, 3414, 3415,  348,
-
-     3368, 4189, 3341, 3380, 4189, 4189, 3366, 3381, 3351, 3367,
-     2713, 3390, 3382, 3386,  281, 3404, 4189, 3405, 3416, 3426,
-      177, 4189, 4189, 3482, 3499, 3516, 3533, 3550, 3567, 3577,
-     3584, 3601, 3615, 3629, 3646, 3663, 3672, 3685, 3702, 3716,
-     3722, 3731, 3748, 3765, 3424, 3427, 3428, 3774, 3432, 3436,
-     3440,  362, 2185, 3786, 3800, 3806, 3441, 3445, 3812, 3818,
-     3827, 3844, 3861, 3878, 3895, 3912, 3926, 3935, 3952, 3969,
-     3986, 4003, 4020, 4037, 4054, 4071, 4088, 4105, 4122
+        0,   88,    0,    0,    0,    0, 1215,   93, 1196,   91,
+        0,    0, 1179,   64,   97,  117,  132,   87,  124,   98,
+       99,  142,  173,  154,  108,  135,  134,  254,  172,  179,
+      175,  178,  219,  180,  323,  388,  384,  318,  386,  319,
+      186,  128,  250,  256,  392,  404,  438,  428,  204,  455,
+      432,  465,  544,  120,  537,  548,  627,  624,  622,  544,
+      644,  658,  251, 9159, 1175, 9159,  267,   99,  162,  569,
+      572,  620,  745,  164,  107,  262,  307,  335,  376,  522,
+        0,  167,  157, 1162, 9159,  278,  321, 1160, 1118,  372,
+      304,  532,  593,  567, 9159,  633,  832, 9159, 9159,  911,
+
+      798,  318,  319,  450,  799,  552,  320,  354, 9159,  978,
+      834, 9159,  865,  860,  862,  866,  914,  863,  973,  980,
+      974, 1013, 1024, 1045,  869, 1049, 1075, 1095, 1098, 1101,
+     1182, 1177, 1161, 1181, 1214, 1212, 1237, 1239, 1235, 1270,
+     1290, 1316, 1325, 1293, 1346, 1323, 1366, 1368, 1391, 1399,
+     1403, 1429, 1430, 1455, 1452, 1478, 1498, 1482, 1523, 1521,
+     1554, 1548, 1579, 1586, 1606, 1629, 1649, 1675, 1681, 1698,
+     1707, 1729,  871, 1114, 1109,  140, 1023,  187,  372,  403,
+      553,  401, 1095,  565, 1792, 1818, 1083, 9159,  643,  669,
+      589, 1844, 1870, 1580, 1865, 1867, 1868, 1905, 1926, 1922,
+
+     1925, 1078, 9159,  837,  437,  677,  249,  660, 1072,  712,
+     9159, 1062,  844,  625, 1874, 1993, 2022, 1042,  864,  473,
+      904,  621,  506,  651,  721,  798,  791,  890,  912,  936,
+      907,  725, 1029, 1143,  729, 9159, 1114, 1179, 2097, 2112,
+     2127,  229,  937, 1033, 1012, 1006,  994,  943,  883,  974,
+      891, 9159, 1476, 2142, 2157, 2172, 2182, 2202, 2178, 2180,
+     2200, 2203, 2223, 2243, 2246, 2244, 2276, 2269, 2299, 2307,
+     2301, 2324, 2344, 2351, 2377,  901, 1018, 2374, 2394, 2397,
+     2414, 2495, 2434, 2440, 2465, 2472, 2518, 2521, 2515, 2548,
+     2556, 1138, 2564,  968, 9159, 2581, 2597, 2604, 2627, 2649,
+
+     2650, 2690, 2693, 2686, 2726, 2738, 2746, 2747, 2763, 2783,
+     2799, 2800, 2803, 2820, 2840, 2843, 2870, 2891, 2895, 2903,
+     2926, 2928, 2935, 2961, 2981, 2958, 2984, 2978, 3004, 3011,
+     3027, 3052, 3048, 3059, 3085, 3068, 3105, 3111,  196,  203,
+      976,  383,  974,  988, 1018, 1014, 1025, 1029, 1042,  253,
+     3174, 3200, 3226, 1067, 1182, 1172, 3252,    0,  418,  288,
+     1096, 3228, 3229, 3231, 3251, 3267, 3287, 3290, 1188, 1566,
+      973,  740, 9159,  938,  866, 9159, 1268, 1178,  931, 1170,
+     1241, 1299, 3354, 3381,    0,  903, 3408, 1148, 1116, 1177,
+     1322, 1145,  410, 1415, 1235,  460, 1292, 1218, 1323, 1022,
+
+      963, 1520, 1662, 3418, 3430, 3440, 3450, 3460, 3470,  889,
+     9159,  865, 9159, 9159, 9159, 9159, 9159, 1239,  853, 9159,
+      846, 2472, 3480, 3490, 3500, 3510, 3520, 3530, 3545, 3555,
+     3575, 9159, 3289, 3553, 3573, 3551, 3574, 3590, 3596, 3612,
+     3628, 3634, 3635, 3655, 3671, 3651, 3687, 3688, 3696,  459,
+     3728, 3736, 3740, 3784, 3868, 9159, 3780, 3776, 3807, 3811,
+     3850, 3912, 3872, 3920, 3921, 1351, 9159, 3828, 4005, 4060,
+     4095, 3904, 4063, 4069, 1258, 4096, 4104, 4126, 4134, 4156,
+     4165, 4196, 4205, 1409, 9159, 4208, 4197, 1476, 9159, 4235,
+     4241, 4257, 4261, 4273, 4284, 4293, 4305, 4309, 4332, 4336,
+
+     4353, 4316, 4359, 4362, 4384, 4407, 4385, 4416, 4423, 4448,
+     4455, 4456, 4486, 4494, 4488, 4511, 4527, 4519, 4531, 4554,
+     1498, 9159, 4552, 4575, 4584, 4587, 4607, 4610,  493,  529,
+      551,  476, 1287,  816,  953, 1119, 1293,  841, 4678, 4704,
+     4730, 1607, 1346, 1458, 4756, 1362, 1397, 4733, 4732, 4759,
+     4627, 4768, 4817,  733, 1619, 1594, 1406,  728, 1537, 9159,
+     1571, 1651, 1625, 1613, 4839, 4867, 4894, 1627, 1658, 1686,
+     1714, 1394,    0, 1756, 1574,    0, 1668,  724, 1709,  724,
+     1763, 1775, 9159, 9159,  708, 9159, 9159, 4904, 4916, 4926,
+     4936, 4771, 4931, 5013, 4934, 5068, 5069, 5071, 5075, 5072,
+
+     5120, 5121, 5123, 1725, 5127, 5153, 5176, 1832, 5175, 5179,
+     1458, 1493, 1739, 1516, 1519, 1873, 1592, 1739, 5201, 5224,
+     5202, 5241, 5240, 5257, 5278, 5280, 5301, 5284, 5352, 9159,
+     5351, 5346, 5349, 5353, 1802, 9159, 5355, 5385, 5401, 9159,
+     5405, 5408, 5412, 5428, 5449, 5451, 5458, 5460, 5495, 5501,
+     5531, 5527, 5539, 5571, 5564, 5575, 5591, 5602, 5623, 5614,
+     5634, 5635, 5660,  693, 5666, 5667, 5692, 5703, 5715, 9159,
+     5723, 5719, 5740, 5746,  846, 1103, 1234, 1788, 1768, 1386,
+     1788, 1615, 1847, 1854,  236,  590, 1781, 1913,  715, 5809,
+     1790, 1645, 2264, 9159, 5785, 5805, 1690, 5806, 5807, 2344,
+
+     9159, 1951, 1858, 1924, 2256,  679, 1930, 1879, 5870, 5880,
+     5907, 5917, 1811,  658, 5946,  624,    0, 9159, 6034,    0,
+        0,  613,  609, 9159,  604,  586, 2245, 2364, 2389, 9159,
+     9159, 6063, 6118, 6139, 6138, 6134, 6135, 6141, 6161, 6173,
+     6184, 6209, 6217, 1654, 6260, 6248, 6216, 1844, 1864, 6239,
+     6280, 9159, 1689, 9159, 1930, 1750, 1763, 1934, 1933, 2077,
+     6300, 6292, 6317, 6337, 6338, 6344, 6369, 6376, 2212, 9159,
+     6360, 6413, 6392, 6412, 6424, 6433, 6456, 6435, 6465, 6476,
+     6488, 6497, 6508, 6509, 6552, 6529, 6540, 6549, 6560, 6585,
+     6593, 6605, 6628, 2392, 6636, 6637, 6648, 6659, 6694, 6685,
+
+     6686, 6775, 2286,  518, 2092, 2103, 1938, 2148, 2420, 2303,
+      472,  442, 2196,    0, 1803, 6692, 6717, 6768, 6756, 2424,
+     2334,  426,  422, 2432,  378, 1883, 6858, 6945, 6974,  337,
+     9159, 1922, 9159,    0,  328, 9159,  314, 2481, 2510, 9159,
+     6929, 6757, 7029, 7031, 7037, 7040, 7033, 7077, 7070, 7086,
+     2264, 2842, 7093, 7097, 7118, 9159, 2372, 7129, 2384, 2060,
+     2411, 2418, 2078, 2421, 2139, 7138, 7149, 7170, 7179, 7195,
+     7201, 7227, 7234, 7236, 2483, 3160, 7259, 7257, 7279, 7280,
+     7282, 7302, 7318, 2564, 7325, 7319, 7345, 7356, 7377, 7357,
+     7368, 7388, 2513, 2467, 7400, 2603, 7389, 7425, 2468, 2371,
+
+     2235, 2479,  361,  296,  182, 7409, 7432, 2249, 7455,  622,
+     2529,  227, 1008, 7505,    0,  207, 7482, 7503, 7505, 7514,
+     7535, 7536, 7544, 9159, 2413, 2526, 7567, 7571, 2546, 7593,
+     2547, 2562, 2567, 2526, 2575, 9159, 2526, 7587, 7625, 7594,
+     7631, 7632, 7648, 7657, 7668, 3179, 3203, 2672, 3229, 3335,
+     7684, 7688, 7709, 2597, 7705, 7725, 7732, 7736,  178, 7758,
+     2596, 7775, 7769, 2619, 2617, 2641, 2696, 2668, 7795, 7801,
+     7807, 2677, 2720, 3150, 7827, 7818, 7834, 7867, 7850, 2625,
+     2685, 7870, 7890, 2688, 7859, 2699, 2731, 2741, 2661, 2665,
+     9159, 7911, 7907, 7910, 7927, 7933, 7963, 2822, 3360, 3384,
+
+     3411, 4103, 4220, 7959, 2702, 7970, 7966, 2741, 7986, 2738,
+     8003, 8019, 2758, 9159, 2765, 2781, 2809, 2818, 8030, 8026,
+     2900, 2883, 2903, 2951, 8042, 8051, 2820, 2829, 8063, 8086,
+     9159, 2838, 9159, 2846, 9159, 2846, 8088, 8090, 8113, 8134,
+     3067, 4430, 2880, 8136,  175, 2911, 8125, 8156, 2877, 9159,
+     1190, 2938, 2908, 8157, 3034, 3081, 3049, 3028, 8173, 2959,
+     2985, 8189, 8182, 3029, 9159, 3039, 8205, 8212, 8214, 3241,
+     4684, 3056, 8235, 3049, 9159, 3056, 3212, 3072,    0, 8237,
+     1210, 3169, 3157,  144, 3103, 3103, 8257, 8260, 9159, 3110,
+     8283, 3255, 4708, 3110, 8290,  123, 9159, 3235, 3207, 3329,
+
+     3387, 3558, 3232, 3256, 8306, 8313, 3278, 8315, 8396, 4870,
+     3259, 8391, 3280, 3664,    0, 3349, 3414, 9159,  103, 9159,
+     3346, 8392, 9159, 3745, 4900, 8473, 3347, 8450,   90, 1237,
+     1328, 3570, 8470, 4973, 4977, 3380, 8471, 9159, 3676, 3645,
+     9159, 9159, 3693, 3608, 3764, 3684, 3616, 1433, 3705, 3782,
+     3810, 3774, 3875, 9159, 3852, 3697, 3910, 3892, 3896, 9159,
+     9159, 8553, 8565, 8577, 8589, 8601, 8613, 8621, 8623, 8635,
+     8647, 8659, 8671, 8678, 8687, 8699, 8711, 8723, 8735, 8747,
+     8754, 8762, 8774, 8786, 8798, 8810, 8822, 8834, 8846, 8858,
+     8870, 8882, 8894, 8906, 8918, 8930, 8942, 8954, 8966, 8978,
+
+     8990, 9002, 9014, 9026, 9038, 9050, 9062, 9074, 9086, 9098,
+     9110, 9122, 9134, 9146
     } ;
 
-static yyconst short int yy_def[1180] =
+static yyconst flex_int16_t yy_def[1215] =
     {   0,
-     1123,    1, 1124, 1124,    1,    2, 1125, 1125,    1,    2,
-        1,    2, 1123, 1123, 1123, 1123, 1123, 1126, 1127, 1123,
-     1123, 1128, 1129, 1123, 1123, 1123, 1123, 1123, 1130, 1123,
-     1123, 1123, 1123, 1131, 1131,   35,   35,   35,   35,   38,
-       38,   38,   38,   38,   38,   38,   38,   38,   38,   37,
-       37, 1123, 1123, 1123, 1132, 1133,   37,   38,   38,   37,
-       38, 1123, 1134, 1123, 1134, 1135, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1126, 1126, 1126, 1127, 1123, 1127, 1127,
-     1128, 1123, 1128, 1128, 1129, 1136, 1129, 1123, 1129, 1129,
-     1123, 1123, 1123, 1137, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1138, 1130, 1123, 1123,   38,   38,   38,   38,
-       38,   38,   35,   38,   38,  115,  115,  115,  115,  115,
-      115,  115,  115, 1131,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1123, 1139, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1140, 1132, 1123, 1132,
-     1132, 1132, 1140, 1141, 1142,  115,  115,  115,  115,  115,
-      115, 1134, 1123, 1134, 1143, 1143, 1123, 1143, 1143, 1143,
-
-     1144, 1143, 1123,  203,  203,  203,  203,  203, 1123, 1123,
-     1123, 1126, 1126, 1127, 1127, 1128, 1128, 1136, 1136, 1136,
-     1136, 1123, 1129, 1129, 1145, 1146, 1147, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1148, 1149,
-     1150, 1151, 1152, 1153,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115, 1154,  124,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115, 1123,  115, 1123,
-     1123,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123, 1123, 1123, 1123, 1139, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1155, 1155, 1132, 1132, 1132,
-     1156, 1142, 1142, 1142, 1142,  115,  115,  115,  115,  115,
-      115, 1134, 1143, 1143, 1123, 1143, 1143, 1144, 1144, 1144,
-     1144, 1143, 1143,  203,  203, 1143,  203,  203,  203,  203,
-     1123, 1123, 1123, 1126, 1126, 1127, 1127, 1128, 1128, 1136,
-     1129, 1129, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1148, 1123, 1123, 1123, 1123, 1123, 1123, 1157, 1153, 1158,
-      115,  115, 1123,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115, 1123,  115,
-      115,  115,  115, 1123, 1123,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1123,  115, 1123,  115,  115,
-      115,  115,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115, 1123, 1123,  115,  115, 1123, 1123,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115, 1123, 1123,
-
-      115,  115,  115,  115,  115,  115, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1159, 1159, 1132, 1132,
-     1132, 1160, 1142, 1142,  115,  115,  115,  115,  115, 1123,
-     1134, 1143, 1143, 1144, 1144, 1143, 1143, 1143,  203,  203,
-      203,  203, 1123, 1161, 1123, 1126, 1162, 1127, 1163, 1128,
-     1164, 1129, 1165, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123,  115,  115,  115, 1123,  115,
-      115, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-
-      115, 1123, 1123,  115,  115,  115, 1123, 1123,  115,  115,
-      115, 1123,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115, 1123,  115,  115,  115,  115,
-      115, 1123,  115,  115,  115,  115, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1132, 1132, 1166,
-     1167, 1142, 1168, 1123, 1123,  115,  115, 1123,  115, 1123,
-     1123, 1123, 1134, 1143, 1169, 1144, 1170, 1143, 1143, 1143,
-     1143,  203,  203, 1123,  203, 1171, 1123, 1123, 1172, 1126,
-     1173, 1127, 1123, 1174, 1128, 1175, 1129, 1129, 1123, 1123,
-
-     1123, 1123,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115, 1123,  115,  115,  115, 1123, 1123,  115,  115,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-      115,  115,  115,  115,  115,  115,  115,  115,  115, 1123,
-     1123,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115, 1123,  115,  115,  115,  115,  115,
-      115,  115, 1123, 1123, 1123, 1123, 1123, 1123,  655, 1132,
-     1176, 1132, 1142, 1168, 1168,  115,  115,  115, 1134, 1177,
-     1143, 1144, 1170, 1170, 1123, 1143,  203,  203, 1123, 1123,
-
-     1126, 1127, 1123, 1128, 1129, 1129, 1123, 1123,  115,  115,
-      115,  115,  115,  115,  115,  115,  115, 1123, 1123,  115,
-      115,  115, 1123, 1123,  115, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123, 1178,  115,  115,  115,  115,  115,
-      115,  115,  115, 1123,  115,  115,  115,  115,  115,  115,
-      115, 1123, 1123,  115, 1123,  115,  115, 1123, 1123, 1123,
-     1132, 1132, 1142,  115,  115, 1123, 1134, 1143, 1144, 1143,
-      203,  203,  115,  115,  115,  115,  115,  115,  115, 1123,
-     1123, 1123,  115,  115, 1123,  115, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123,  115,  115,  115,  115,  115,  115,
-      115,  115,  115, 1178, 1123, 1179, 1178,  115,  115,  115,
-      115, 1123,  115,  115,  115,  115, 1123,  115, 1123,  115,
-      115, 1123, 1123, 1132, 1142,  115,  115, 1134, 1144,  115,
-      115,  115,  115,  115, 1123, 1123,  115,  115, 1123,  115,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123,  115,  115,  115,
-      115,  115,  115,  115, 1123, 1179, 1178, 1179, 1179,  115,
-      115, 1123,  115,  115, 1123,  115, 1123,  115,  115, 1123,
-     1123, 1132, 1142, 1142,  115, 1134, 1144, 1144,  115,  115,
-     1123, 1123,  115,  115, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123,  115,  115,  115,  115,  115, 1123, 1178, 1123,  115,
-     1123, 1123,  115,  115, 1123, 1132, 1142, 1142,  115, 1134,
-     1144, 1144,  115, 1123, 1123,  115,  115, 1123, 1123, 1123,
-     1123,  115,  115,  115,  115, 1123, 1178, 1123,  115, 1123,
-     1123, 1123, 1132, 1142, 1142,  115, 1134, 1144, 1144, 1123,
-     1123,  115,  115, 1123, 1123, 1123,  115,  115, 1123, 1178,
-     1123,  115, 1123, 1123, 1132, 1142, 1134, 1144, 1123, 1123,
-      115,  115, 1123, 1123,  115, 1123, 1178, 1123,  115, 1123,
-     1132, 1142, 1134, 1144, 1123, 1123,  115, 1123, 1178, 1178,
-     1123,  115, 1123, 1132, 1134, 1123,  115, 1178, 1179, 1123,
-
-      115, 1123, 1132, 1134, 1123, 1123, 1132, 1134, 1132, 1134,
-     1132, 1134, 1132, 1134, 1132, 1134, 1123, 1134, 1134, 1134,
-     1134, 1123,    0, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123
+     1161,    1, 1162, 1162,    1,    2, 1163, 1163,    1,    2,
+        1,    2, 1161, 1161, 1161, 1161, 1161, 1164, 1165, 1161,
+     1161, 1166, 1167, 1161, 1161, 1161, 1161, 1161, 1161, 1168,
+     1161, 1161, 1161, 1161, 1169, 1169,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36, 1161, 1161,   53, 1170, 1161,   36,   36,   36,
+       36,   36,   36, 1161, 1171, 1161, 1171, 1171, 1171, 1161,
+     1161, 1172, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1164, 1164, 1164, 1165, 1161, 1165, 1165, 1166, 1161, 1166,
+     1166, 1167, 1173, 1167, 1161, 1167, 1167, 1161, 1161, 1161,
+
+     1174, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1175,
+     1161, 1161, 1161,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1169,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   53,  173, 1176, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161,  173, 1161,  173, 1161, 1170, 1161, 1170, 1170,
+     1170, 1161, 1161, 1177,   36,   36,   36,   36,   36,   36,
+
+       36, 1171, 1161, 1171, 1171, 1171, 1171, 1178, 1179, 1179,
+     1161, 1179, 1179, 1179, 1180, 1179, 1161,  217,  217,  217,
+      217,  217, 1161, 1161, 1161, 1164, 1164, 1165, 1165, 1166,
+     1166, 1173, 1173, 1173, 1173, 1161, 1167, 1167, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1181, 1161, 1161, 1161, 1161, 1161,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36, 1182,  131,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36, 1161,   36, 1161, 1161,   36,   36,   36,   36,   36,
+
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,  173,  173,
+     1161,  173, 1176, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+      185, 1161, 1161, 1170, 1170, 1170, 1161, 1177, 1177, 1177,
+     1177,   36,   36,   36,   36,   36,   36,   36, 1171, 1171,
+     1183, 1183, 1161, 1179, 1179, 1161, 1179, 1179, 1180, 1180,
+     1180, 1180, 1179, 1179,  217,  217, 1179,  217,  217,  217,
+      217, 1161, 1161, 1161, 1164, 1164, 1165, 1165, 1166, 1166,
+
+     1173, 1167, 1167, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1181, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36, 1161,
+       36,   36,   36,   36, 1161, 1161,   36,   36,   36,   36,
+       36,   36,   36,   36,   36, 1161, 1161,   36, 1161,   36,
+       36,   36,   36,   36, 1161,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161, 1161,   36,   36, 1161, 1161,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1161, 1161,   36,   36,   36,   36,   36,   36,  173,  173,
+      173, 1161, 1161, 1161, 1161, 1161, 1161, 1161,  185, 1161,
+     1161, 1170, 1170, 1170, 1161, 1177, 1177,   36,   36,   36,
+       36,   36,   36, 1161, 1171, 1171, 1171, 1183, 1183, 1161,
+     1179, 1179, 1180, 1180, 1179, 1179, 1179,  217,  217,  217,
+      217, 1161, 1184, 1161, 1164, 1185, 1165, 1186, 1187, 1188,
+     1189, 1190, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+
+       36,   36,   36, 1161,   36,   36,   36, 1161,   36,   36,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36, 1161,
+     1161,   36,   36,   36, 1161, 1161,   36,   36,   36, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36, 1161,
+       36,   36,   36,   36,  173,  173,  173, 1161, 1161, 1161,
+     1161, 1161, 1161,  173, 1161, 1161, 1170, 1170, 1191, 1161,
+     1177, 1192, 1161, 1161,   36,   36, 1161,   36,   36, 1161,
+
+     1161, 1161, 1171, 1171, 1179, 1193, 1180, 1194, 1179, 1179,
+     1179, 1179,  217,  217, 1161,  217, 1195, 1161, 1161, 1196,
+     1197, 1198, 1199, 1161, 1200, 1201, 1202, 1203, 1203, 1161,
+     1161, 1161,   36, 1161,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36, 1161, 1161,   36,
+       36, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36, 1161, 1161,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+
+       36, 1161,  802,  802, 1161, 1161, 1161, 1161,  802, 1204,
+     1205, 1204, 1206, 1207, 1207,   36,   36,   36,   36, 1208,
+     1208, 1209, 1210, 1211, 1212, 1212, 1161, 1210, 1161,  829,
+     1161, 1161, 1161, 1197, 1199, 1161, 1201, 1203, 1203, 1161,
+     1161,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+     1161, 1161,   36,   36,   36, 1161, 1161,   36, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161,   36,   36,   36,   36,   36,
+       36,   36,   36,   36, 1161, 1213,   36,   36,   36,   36,
+       36,   36,   36, 1161,   36,   36,   36,   36,   36,   36,
+       36,   36, 1161, 1161,   36, 1161,   36,   36, 1161, 1161,
+
+     1161, 1161, 1204, 1204, 1206,   36,   36, 1161,   36, 1208,
+     1208, 1210, 1211, 1210,  829,  829,   36,   36,   36,   36,
+       36,   36,   36, 1161, 1161, 1161,   36,   36, 1161,   36,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161,   36,   36,   36,
+       36,   36,   36,   36,   36, 1213, 1213, 1161, 1214, 1213,
+       36,   36,   36, 1161,   36,   36,   36,   36, 1161,   36,
+     1161,   36,   36, 1161, 1161, 1161, 1204, 1206,   36,   36,
+       36, 1208, 1208, 1211,   36,   36,   36,   36,   36, 1161,
+     1161,   36,   36, 1161,   36, 1161, 1161, 1161, 1161, 1161,
+     1161,   36,   36,   36,   36,   36,   36, 1161, 1214, 1214,
+
+     1213, 1214, 1214,   36, 1161,   36,   36, 1161,   36, 1161,
+       36,   36, 1161, 1161, 1161, 1204, 1206, 1206,   36,   36,
+     1208, 1208, 1211, 1211,   36,   36, 1161, 1161,   36,   36,
+     1161, 1161, 1161, 1161, 1161, 1161,   36,   36,   36,   36,
+     1161, 1213, 1161,   36, 1161, 1161,   36,   36, 1161, 1161,
+     1204, 1206, 1206,   36, 1208, 1208, 1211, 1211,   36, 1161,
+     1161,   36,   36, 1161, 1161, 1161,   36,   36,   36, 1161,
+     1213, 1161,   36, 1161, 1161, 1161, 1204, 1206, 1206,   36,
+     1208, 1208, 1211, 1211, 1161, 1161,   36,   36, 1161, 1161,
+       36, 1161, 1213, 1161,   36, 1161, 1161, 1204, 1206, 1208,
+
+     1208, 1211, 1161, 1161,   36,   36, 1161,   36, 1161, 1213,
+     1161,   36, 1161, 1204, 1206, 1208, 1208, 1161, 1211, 1161,
+     1161,   36, 1161, 1161, 1213, 1213, 1161,   36, 1161, 1204,
+     1208, 1161,   36, 1213, 1214, 1161,   36, 1161, 1204, 1208,
+     1161, 1161, 1204, 1208, 1204, 1208, 1204, 1208, 1204, 1208,
+     1204, 1208, 1204, 1161, 1208, 1208, 1208, 1208, 1208, 1161,
+        0, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161
     } ;
 
-static yyconst short int yy_nxt[4253] =
+static yyconst flex_int16_t yy_nxt[9249] =
     {   0,
        14,   15,   16,   17,   18,   19,   14,   20,   21,   22,
-       23,   24,   21,   25,   21,   26,   21,   27,   28,   29,
-       29,   29,   29,   29,   29,   29,   29,   29,   21,   30,
-       31,   32,   33,   21,   21,   34,   35,   36,   37,   38,
-       39,   40,   41,   34,   42,   34,   34,   43,   44,   45,
-       46,   47,   34,   48,   49,   50,   34,   34,   51,   34,
-       34,   34,   14,   52,   53,   54,   55,   64,   66,   65,
-       70,   72,   71,   72,   82,   71,   68,   73,   75,   92,
-       78,   56,   56,   56,   56,   56,   56,   56,   56,   56,
-       69,   68,   76,   67,   68,   86,   91,   68,  103,  102,
-
-       57,   58,   87,   88,   59,   69,   68,   68,   69,   68,
-       68,   69,   68,   83,  193,   68,   79,   60,   61,   68,
-       69,   69,   68,   69,   69,  210,   69,   84,   68,   69,
-       80,  105,  333,   69,   89,   72,   69,   72,   78,   70,
-       68,   71,   69,  108,  116,  108,  108,  131,   90,   93,
-      132,   93,   78,  133,   69,  108,  185,  108,   82,  134,
-      193, 1020,  108,  110,   71,  194,   71,   94,   94,   94,
-       94,   94,   94,   94,   94,   94,  211,  108,  211, 1122,
-       71,  108,   73,  214,   95,  186,  215,  135,   96,   68,
-       97,  108,  108,  136,   82,   98,  108,   99,  100,  187,
-
-      137,  138,  108,   69,  366,  254,  108,  101,  106,  217,
-      107,  107,  107,  107,  107,  107,  107,  107,  107,  117,
-      108,  108,  108,  225,  226,  108,  118,  179,  216,  108,
-      119,  108,  109,  120,   86,  139,  227,  108,  110,  108,
-      369,   87,   88,  121,  230,  255,  110,  106,  108,  107,
-      107,  107,  107,  107,  107,  107,  107,  107,  232,  231,
-      153,  338,  108,  108,  108,  122,  234,  111,  112,  123,
-      108,  109,  108,  233,  108,  124,  235,  113,  108,  125,
-      110,  108,  108, 1117,  114,  115,  140,  366,  366,  253,
-      108,  126,  396,  127,  141,  108,  128,  129,  108,  110,
-
-      142,  143,  108,  130,  108,  108,  108,  367,  370,  144,
-      108,  146,  108,  147,  108,  145,  108,  149,  148,  108,
-      108,  108,  154,  179,  191,  108,  155,  397,  180,  179,
-      156,  150,  160,  314,  151,  108,  108,  152,  157,  161,
-      108,  158,  159,  108,  108,  193,  108,  315,  260,  162,
-      108,  163,  329,  183,  108,  108,  108,  189,  108,  168,
-      135,  164,  181,  339,  108,  108,  330,  103,  108,  165,
-      243,  166,  167,  160,  243,  103,  182,  168,   86,  352,
-      161,  196,  197,  196,  108,   87,   88,  108, 1106,  390,
-      162,   68,  168,  198,  219,  220,  219,  190,  168, 1123,
-
-       82,  108,  221,  222,   86,   69,  169,  170,   86,   68,
-      171,   87,   88, 1123,  108,   87,   88,  108,  270,  252,
-      108,  199,  259,  172,  173,  174,  175,  176,  167,  391,
-      337,  108,  267,  168,  108,  200,  168,  108,  223,  108,
-      108,  366,  268,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  256,  257,  379, 1105,  108,  108,  258,  224,
-      108,  108,  169,  170,  683,   68,  171,  243,  243,  243,
-      243,  243,  243,  243,  243,  243,  282,  276,  108,  172,
-      173,  195,  196,  197,  196,  195,  195,  195,  201,  195,
-      195,  195,  195,  195,  195,  195,  195,  195,  202,  195,
-
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  195,
-      195,  195,  195,  195,  195,  195,  204,  186,  204,  204,
-      204,  204,  205,  204,  118,  204,  204,  204,  206,  204,
-      204,  187,  204,  204,  204,  204,  207,  204,  204,  204,
-      204,  208,  204,  195,   93,  179,   93,  108,  108,  244,
-      245,  108,   78,  108,  108,  108,   78,  108,  108,  179,
-      108,  108,  108,   82,  108,  261,  197, 1102,  108,  108,
-      108,  266,  108,  108,  108,  108,  108,  108,  108,   95,
-      108,  108,  108,   96,  108,   97,  108,  108,  247,  108,
-       98,  549,   99,  100,  376,  275,  340,  108,  108,  519,
-
-      269,  108,  101,  239,  239,  239,  239,  239,  239,  239,
-      239,  239,  108,  108,  277,  550,  108,  357,  108,   82,
-      108,  303,  108,  240,  241,  246,  108,  108,  108,  108,
-      108,  108,  108,  108,  108,  337,  242,  108,  248,  108,
-      249,  168,  108,  108,  274,  108,  108,  108,  108,  250,
-      108,  291,  278,  251,  278,  108,  108,  108,  108,  108,
-      108,  108,  108,  337,  378,  179,  108,  108,  287,  168,
-      246,  108,  108,  262,  271,  262,  366,  103,  366,  108,
-      280,  272,  280,  108,  108,  273,  108,  108,  283,  106,
-      281,  263,  263,  263,  263,  263,  263,  263,  263,  263,
-
-      284,  108,  285,  108,  108,  286,  279,  288,  108,  108,
-      108,  368,  290,  540,  366,  245,  108,  659,  518,  108,
-      108,  289,  108,  292,  168,  108,  108,  108,  264,  293,
-      265,  294,  108,  108,  108,  108,  313,  108,  295,  108,
-      108,  297,  108,  304,  539,  305,  108,  108,  300, 1100,
-      301,  108,  298,  296,  244,  299,  302,  108,  310,  108,
-      108,  306,  307,  108,  108,  308,  108,  309,  108,  316,
-      108,  108,  311,  108,  320,  354,  355,  354,  108,  312,
-      317,  321,  322,  108,  318,  108,  108,  108,  319,  324,
-      108,  325,  167,  108,  323,  108,  327,  168,  325,  167,
-
-      108,  108,  193,  108,  168,  343,  108,  343,  327,   78,
-      325,  167,  253,  373,  349,  373,  168,  108,  108,  346,
-       78,  108,  197,  108,  108,  348,  169,  170,  351,  383,
-      171,  383,  366,  169,  170,  108,  350,  171,  108,  179,
-      344,  108,  531,  326,  173,  169,  170,  256,  347,  171,
-      326,  173,  108,  258,  345,  691,  356,  359,  197,  359,
-      377,  220,  326,  173,  327,  175,  335,  167,  380,  222,
-      220,  541,  168,   86,  385,  197,  385,  380,  222, 1096,
-       87,   88,  336,  336,  336,  336,  336,  336,  336,  336,
-      336,   86,  360,  521,  197,  219,  220,  219,   87,   88,
-
-      108,  169,  170,  221,  222,  171,  361,  219,  220,  219,
-      387,  411,  387,  225,  226,  221,  222,  108,  326,  173,
-      197,  402,  404,  402,  404,  518,  227,  382,  406,  533,
-      406,  168,  343,  545,  343,  545,  381,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  353,  353,  197,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  363,  353,  364,  364,  364,  364,  364,
-      364,  364,  364,  364,  353,  353,  353,  353,  353,  353,
-      353,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-
-      365,  365,  365,  365,  365,  365,  365,  365,  353,  108,
-      413,  108,  657,  108,  280,  366,  280,  108,  168,  108,
-      108, 1093,  108,  108,  281,  415,  108,  418,  108,  412,
-      108,  414,  416,  417,  108,  108,  108,  108,  108,  420,
-      108,  421,  108,  108,  108,  542,  108,  108, 1091,  419,
-      428,  425,  108,  432,  422,  108,  108,  423,  426,  108,
-      108,  108,  424,  108,  108,  108,  430,  427,  108,  108,
-      108,  108,  108,  108,  451,  431,  433,  444,  108,  445,
-      366,  445,  108,  108, 1088,  108,  108,  449,  108,  108,
-      434,  108,  434,  108,  108,  108,  447,  448,  450,  108,
-
-      108,  453,  278,  684,  278,  452,  108,  108, 1086,  446,
-      108,  108,  108, 1085,  108,  108,  108,  456,  108,  108,
-      435,  455,  179,  108,  108,  108,  457, 1082,  436,  108,
-      437,  108,  108,  438,  197,  108,  108,  439,  458,  459,
-      440,  108,  108,  441,  442,  460,  108,  443,  108,  463,
-      467,  463,  467,  108,  462,  108,  454,  472,  461,  464,
-      468,  478,  108,  108,  108,  108,  474,  520,  471,  108,
-      108, 1080,  108,  108,  473,  108,  108,  108,  108,  108,
-      535,  108,  476,  477,  108,  108,  108,  108,  475,  480,
-      108,  479,  108,  108,  498,  465,  469,  108,  108,  108,
-
-      481,  108,  108,  483,  108,  466,  470,  108,  482,  484,
-      485,  108,  108,  108,  108,  108,  108, 1078,  486,  487,
-      108,  490,  108,  108,  108,  108,  491,  492,  108,  108,
-      108,  488,  489,  493,  108,  108,   78,  108,  108,  108,
-      108,  494,  108,  108,  495,  108,  499,  108,  499,  108,
-      501,  108,  108,  497,  496,  108,  500,  108,  503,  504,
-      108,  108,  108,  502,  108,  507,  505,  508,  167,  518,
-      197,  108,  108,  168,  108,  168,  525,  530,  108,  527,
-      506,  108,  197,  103,  509,  548,  508,  167,  108,  108,
-      526,  509,  168,  508,  167, 1074,  108,  197,  108,  168,
-
-      108,  528,  169,  170,   82,  179,  171,  108,  193,  108,
-      108,  529,  354,  355,  354,  532,  559,  108,  559,  326,
-      173,  169,  170,  220,  108,  171,  108,  108,  169,  170,
-      380,  222,  171,  359,  197,  359, 1068,  534,  326,  173,
-      108,  561,  551,  561,   86,  326,  173,  509,  175,  516,
-      167,   87,   88,   86, 1073,  168,  658,  108,  563,  673,
-       87,   88,  445, 1070,  445,  517,  517,  517,  517,  517,
-      517,  517,  517,  517,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  657,  169,  170,  225,  226,  171,  168,
-      366,  553,  446,  688, 1069,  688,  552,  108,  108,  227,
-
-      565,  326,  173,  197,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  685,  108,  108,  179,  668,  197,  668,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  108,  108,
-      197,  536,  197,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  168,  197,  660,  108,  108,  566,  168,  537,
-      537,  537,  537,  537,  537,  537,  537,  537,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  108,  567,  108,
-      538,  197,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  675,  674,  569,  108,  108,  108, 1066,  362,  362,
-
-      362,  362,  362,  362,  362,  362,  362,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  405,  405,  405,  405,  405,
-      405,  405,  405,  405,  405,  405,  405,  405,  405,  405,
-      405,  405,  405,  407,  407,  407,  407,  407,  407,  407,
+       23,   24,   25,   26,   25,   27,   25,   28,   29,   30,
+       30,   30,   30,   30,   30,   30,   30,   30,   30,   25,
+       31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
+       41,   42,   43,   42,   42,   44,   45,   46,   47,   48,
+       42,   49,   50,   51,   42,   42,   52,   42,   42,   42,
+       25,   25,   42,   35,   36,   37,   38,   39,   40,   41,
+       42,   43,   42,   44,   45,   46,   47,   48,   42,   49,
+       50,   51,   42,   42,   52,   42,   42,   42,   14,   53,
+       54,   55,   56,   71,   67,   66,   67,   68,   76,   77,
+
+       78,  203, 1138,   74,   72,  211,  206,   57,   57,   57,
+       57,   57,   57,   57,   57,   57,   57,   75,   79,   77,
+       79,   79,   77,   79,   58,   59,   82,   73,   60,   85,
+       61,   69,   74,   78,   77,   80,   74,   74,   74, 1113,
+       83,   62,   63,  176,   89,   75,  211,   74,   99,  176,
+       75,   75,   75,   58,   59,   82,   73,   60,  224,   61,
+       69,   75,  115,   86,  203,   74,   74,   74,   83,   62,
+       63,   74,   98,   74,   74,   93,   74,   87,   75,   75,
+       75,   90,   94,   95,  109,   75,  224,   75,   75,   75,
+     1074,  115,   86,   74, 1008,   91,  110,  529,  223,  530,
+
+       74,  226,   74,   74,  531,   87,  530,   75,  227,  207,
+       90,   74,   96,   75,   74,   75,   75,   74,   74,   74,
+      115,  346,   74,   91,  387,   75,   97,  223,   75,  211,
+      226,   75,   75,   75,  142,   75,  227,  207,  115,  176,
+       74,   96,  161,   74,  968,  176,   74,   74,   74,  115,
+      346,  203,  112,   75,   97,  100,   75,  100,   74,   75,
+       75,   75,  142,   76,   77,   78,  410,  115,  204,  203,
+      204,  161,   75,  101,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,   85,  115,  115,  370,   74,  102,  143,
+      115,  538,  103,   74,  104,  410,  144,  145,  188,  105,
+
+       75,  106,  107,  201,  146,  205,   89,   75,   79,   77,
+       79,  108,  228,  115,  115,  370,   89,  102,  143,  115,
+      538,  103,   74,  104,  144,  145,   85,  105,  546,  106,
+      107,  201,  146,   85,  205,   75,   78,   77,   78,  108,
+      113,  228,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  115,  115,  387,  231,  129,  546,  116,  117,
+      130,  138,  118,  188,  139,  242,  131,  140,  119,  243,
+      132,  250,  229,  141,   89,  120,  121,  225,   77,  225,
+      211,  115,  115,  231,  531,  129,  530,  116,  117,  130,
+      138,  118,  139,  242,  131,  140,  119,  243,  132,  250,
+
+      229,  141,  251,  120,  121,  113,  230,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  347,  124,  359,
+      115,  359,  122,  967,  211,  125,  147,  118,  211,  126,
+      251,  133,  127,  134,  148,  230,  135,  136,  150,  203,
+      149,  123,  128,  137,  188,  347,  151,  124,  573,  115,
+      348,  122,  152,  350,  125,  147,  118,  126,  153,  133,
+      127,  134,  157,  148,  135,  136,  168,  150,  149,  123,
+      128,  137,  115,  169,  188,  151,  158,  573,  348,  159,
+      152,  350,  160,  170,  207,  154,  153,  155,  244,  162,
+      387,  157,  156,  163,  675,  168,  676,  164,  576,  115,
+
+      604,  115,  169,  245,  158,  165,  171,  159,  166,  167,
+      160,  170,  207,  154,  678,  155,  172,  244,  162,  804,
+      156,  389,  163,   78,   77,   80,  164,  576,  115,  604,
+      677,  245,  676,  165,   93,  171,  166,  167,  183,  184,
+      185,   94,   95,  678,  172,  173,   77,  174,  175,  389,
+      188,  392,  677,  176,  676,  189,  186,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,   79,   77,   79,   93,
+       79,   77,   79,   79,   77,   79,   94,   95,  115,  392,
+      177,  178,  208,   74,  179,  208,  180,  190,   89,  198,
+      248,  188,  142,  176,  233,  234,  233,  181,  182,  176,
+
+      249,  191,  235,  236,  224,  208,   89,  115,  208,  177,
+      178,  349,   74,  179,   85,  180,  190,  198,  836,  248,
+      142,  210,  211,  210,  203,  181,  182,  211,  249,  191,
+      192,  194,  224,  212,  208,   93,  176,  208,  387,  349,
+      356,  387,   94,   95,  110,  188,  193,  193,  193,  193,
+      193,  193,  193,  193,  193,  193,  197,  391,  195,  213,
+      129,  372,  373,  372,  130,  125,   74,  237,  356,  126,
+      131,  188,  196,  214,  132,  387,  378,  354,  115,  203,
+       75,  211,  128,  143,  972,  197,  391,  195,  213,  129,
+      144,  199,  168,  130,  125,   74,  237,  126,  131,  169,
+
+      196,  214,  132,  355,  378,  393,  354,  115,   75,  170,
+      128,  369,  143,  375,  376,  375,  200,  188,  144,  199,
+      794,  168,  394,   77,  394,  731,   89,  234,  169,  724,
+      373,  234,  355,  393,  401,  236,  554,  170,  401,  236,
+      369,  559,  560,  559,  200,  209,  210,  211,  210,  209,
+      209,  209,  215,  209,  209,  209,  209,  209,  209,  209,
+      209,  209,  216,  209,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  209,  209,  209,  209,  209,  195,
+      218,  218,  218,  218,  219,  218,  125,  218,  218,  218,
+      220,  218,  218,  196,  218,  218,  218,  218,  221,  218,
+
+      218,  218,  218,  222,  218,  209,  209,  218,  195,  218,
+      218,  218,  218,  219,  218,  125,  218,  218,  220,  218,
+      218,  196,  218,  218,  218,  218,  221,  218,  218,  218,
+      218,  222,  218,  209,   93,  239,  240,  246,  204,  203,
+      204,   94,   95,  395,  554,  396,  211,  802,  241,  803,
+      680,  110,  247,  111,  111,  111,  111,  111,  111,  111,
+      111,  111,  111,  587,  239,  240,  246,  375,  376,  375,
+      586,  395,  339,  396,  340,  205,  241,  258,  377,  680,
+      247,  387,  584,  238,  257,  257,  257,  257,  257,  257,
+      257,  257,  257,  257,  115,   85,  115,  261,  388,  115,
+
+      115,  115,  115,  268,  205,  115,  583,  377,  115,   89,
+     1161,  238,  100,  115,  100,  115,  115,   85,  259,  115,
+      387,  387,  115,  115,  341,  115,  261,  388,  115,  115,
+      115,  115,  268,  211,  115,  397,  419,  115,   89, 1161,
+      211,  115,  421,  115,  115,  102,  259,  115,  115,  103,
+      115,  104,  341,  115,  411,  390,  105,  450,  106,  107,
+      417,  400,  260,  397,  419,  234,  398,  115,  108,  294,
+      421,  294,  401,  236,  102,  373,  188,  115,  103,  295,
+      104,  399,  115,  390,  105,  450,  106,  107,  681,  400,
+      260,  420,  412,  418,  398,  115,  108,  253,  253,  253,
+
+      253,  253,  253,  253,  253,  253,  253,  115,  264,  399,
+      211,  416,  115,  115,  115,  254,  255,  681,  262,  115,
+      412,  418,  263,  415,   89,  265,  115,  115,  256,  414,
+      233,  234,  233,  115,  349,  258,  115,  264,  235,  236,
+      532,  115,  115,  115,  254,  255,  262,  115,  115,  266,
+      413,  263,  115,  265,  115,  115,  256,  344,  115,  387,
+      580,  115,  349,  115,  211,  533,  115,  534,  532,  188,
+      974,  345,  115,  535,  211,  265,  115,  115,  266,  115,
+      203,  115,  536,  115,  115,  188,  344,  115,  115,  580,
+      267,  537,  115,  533,  115,  534,  342,  269,  115,  345,
+
+      115,  535,  115,  265,  804,  115,  803,  542,  115,  115,
+      536,  188,  115,  115,  115,  342,   93,  115,  267,  537,
+       89,  270,  271,   94,   95,  269,  115,  272,  115,  115,
+      115,  273,  274,  387,  115,  115,  542,  115,  115,  292,
+      115,  292,  547,  115,  233,  234,  233,  275,  115,  270,
+      271,  115,  235,  236,  115,  272,  115,  682,  115,  402,
+      273,  274,   89,  115,  115,  387,  115,   85,  569,  115,
+      547,  380,  211,  380,  188,  275,  115,  203, 1161,  115,
+      211,   93,  115,  276,  188,  276,  682,  402,   94,   95,
+      203,  475,  188,  568,  387,  115,  569,  572,   70,  113,
+
+      115,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  115,  203,  281,  115,  115,  115,   66,  282,  475,
+      115,  568,  280,   85,  115,  572,  544,  543,  555,  115,
+      115,  570,  562,  403,  115,  804,  278,  803,  279,  188,
+      115,  281,  115,  211,  115,  115,  115,  282,  115,  115,
+      280,  115, 1077,  115,  544,  543,  578,  555,  115,  570,
+      562,  403,  115,  284,  278,  115,  279,  115,  283,  115,
+      211,  115, 1100,  115,  115,  115,  115,  115,  115,  285,
+      115,  563,  115,  289,  288,  578,  286,  575,  115, 1161,
+      287,  284,  115,  115,  585,  115,  283,   85,  115, 1139,
+
+      115,  211,  115,  115,  115,  115,  640,  115,  285,  115,
+      563,  289,  288,  561,  286,  575,  115,  292,  287,  292,
+      115,  290,  585,  115,  115,   89,  294,  115,  294,  115,
+      203,  683,  115,  115,  640, 1161,  295,  291,  115,  387,
+      679,  561,  296,  115,  577,  564,  115, 1161,  188,  290,
+      115,  115,  466,  115,  466,  115,  115,  115,  115,  261,
+      683,  115,  115,  301,  115,  291, 1161,  571,  679,  293,
+      296,  115,  577,  564,  115,  579,  115, 1161,  115,  115,
+      115, 1161,  297,  467,  115,  115,  115,  697,  261,  697,
+     1140,  115,  301,  115,  298,  571,  299,  293,  688,  300,
+
+      115, 1161,  115,  579,  115,  115,  115,  115,  203,  115,
+      484,  297,  484,  691,  115,  303,  574,   77,  574,  115,
+      485,  115,  298,  302,  299,  115,  688,  300,  304,  115,
+      115,  115,  717,  115,  115,  203,  115,  115,  115, 1161,
+     1161,  691,  115,  303,  115,  305,  692,  115, 1161,  115,
+      306,  302,  115,  704,  115, 1161,  115,  304, 1161,  115,
+      188,  717,  115,  115,  115, 1161,  115,  115,  115,  115,
+     1161,  115,  115,  305,  692,  308,  307,  488,  306,  488,
+      115,  704,  115,  115,  115, 1161,  115,  489, 1161,  115,
+      310,  115,  115,  115,  115, 1150,  689,  115,  115,  521,
+
+      309,  521, 1161,  308,  307,  311,  752, 1161,  115,  522,
+      115,  115,  115,  239,  240,  115,  115,  115,  115,  310,
+      115,  115,   93,  115,  315,  689,  241, 1161,  309,   94,
+       95,  312,  115,  311,  752,  115,  115,  115,  559,  560,
+      559,  115,  239,  240, 1161,  115,  115,  753, 1161,  313,
+      115,  115,  314,  315,  241,  115,  318,  115, 1161,  312,
+      115,  115,  115,  115,  755,  316,  115,  556,  203,  556,
+      756,  317,  581,  211,  115,  753,  115,  313, 1161,  115,
+      314,  359,  115,  359,  115,  318,  115,  115,  319,  115,
+      320,  115,  755,  115,  316,  556,  203,  556,  756,  317,
+
+      581,  115,  115,  324,  115, 1161,  321,  322,  557,  188,
+      323,  115,  720,  115,  360,  211,  115,  319,  115,  320,
+      115,  203,  115,  705,  325,  115,  326,  211,  361,  115,
+     1161,  324,  115,  327,  321,  322,  557,  557,  323,  115,
+      115,  720,  115,  360,  387,  115,  815,  115,  815,  115,
+      759,  705,  325,  211,  115,  326,  361,  328,  687,  115,
+      115,  327,  708,  329,   93,  557,  808,  115,  115,  115,
+      703,   94,   95,   85,  115,  387,  707,  330,  759,  713,
+      265, 1161,  115,  115,  331,  328,  687,  115,  115,  706,
+      708,  697,  329,  697,  808,  332,  714,  115,  703,  851,
+
+      582, 1161,  115,  387,  707,  330,  722,  713,  265,  115,
+      115,   89,  115,  331,  115,  115, 1161,  115,  706,  335,
+      115, 1161,  333,  332,  715,  714,  334,  851,  115,  582,
+      115,  387,  115, 1161,  115,  722,  859,  115,  115, 1161,
+      336,  115, 1161,  115,  115,  337,  115,  725,  335,  115,
+      333,  115,  716,  715,  334, 1161,  115,  719,   77,  719,
+      115,  115,  115,  115,  859,   93,  115,  744,  115,  336,
+      115,  338,   94,   95,  337,  115,  725,   93,  754,  115,
+      760,  716,  115,  188,  729,  730, 1161, 1161,  115,  693,
+     1161,  693,  115,  342,  184,  351,  744,  115,  861,  694,
+
+      338,  727,  806,  635,  815,  635,  815,  754,  862,  760,
+      115,  352,  352,  352,  352,  352,  352,  352,  352,  352,
+      352,  353,  807,  810, 1161,  805,  861,  176,  387, 1161,
+      727,  806,  813,  608,  636,  608,  862,  352,  352,  352,
+      352,  352,  352,  352,  352,  352,  352,  353,  700,  827,
+      700,  807,  810,  176,  805,  804,  184,  809,  701, 1161,
+      203,  813,  702,  352,  352,  352,  352,  352,  352,  352,
+      352,  352,  352,  353,  748,  380,  211,  380,  827,  176,
+      826,  211,  826,  856,  826,  211,  826,  110,  749,  357,
+      357,  357,  357,  357,  357,  357,  357,  357,  357,  115,
+
+      820,  115,  115,  748,  115,  857,  115,  115,  381, 1161,
+      267,  757,  856,  270,  363,  188,  749,  362,  115,  272,
+      115,  364,  382,  832,   77,  832,  203,  758,  115,  820,
+      115,  115,  211,  115,  857,  115,  115,  381,  267,  115,
+      757,  270,  363, 1161,  115,  362,  115,  272,  115,  364,
+      382,  811,  702,  365,  702,  758,  115, 1161,  115,  115,
+      115,  115,  297,  368,  115,  115,  702,  860,  115,  863,
+     1161,  367,  824,  115,  298,  115,  299,  821,  115,  366,
+      811,  365,  864,  901, 1161,  115,  115, 1161,  115,  115,
+      115,  297,  368,  115,  115,  211,  860, 1161,  863,  367,
+
+     1161,  824,  298,  115,  299,  821,  115,  366, 1161, 1161,
+      864,  901,  383,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  374,  374,  211,  374,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  384,
+      374,  385,  385,  385,  385,  385,  385,  385,  385,  385,
+      385,  374,  374,  374,  374,  374,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  374,  374,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      374,  404, 1161,  404,  932,  865,  405,  405,  405,  405,
+      405,  405,  405,  405,  405,  405,  406, 1161,  406,  935,
+      899,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      407,  408,  932,  408,  865,  900,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  423,  935,  423,  899,
+     1161,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  425, 1161,  425,  900, 1161,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  427,  902,  427,  432,
+      937,  428,  428,  428,  428,  428,  428,  428,  428,  428,
+
+      428,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      257, 1161,  115,  769,  115,  769,  902,  115,  937,  115,
+      429,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  115,  433,  115,  115,  905,  908,  115,  908,  115,
+      431,  115,  115,  115,  770,  434,  115,   93,  115,  429,
+      908,  435,  908,  115,  839,  840,  115,  115,  211,  115,
+      433,  115,  115,  115,  905,  693,  115,  693,  115,  431,
+      436,  115, 1161,  434, 1161,  694,  115,  115,  115,  435,
+      115,  115,  115,  115,  115,  115,  115,  804,  439,  803,
+      437,  115, 1161, 1161,  822,  176,  115,  115,  436,  115,
+
+      438,  805,  924,  115,  115,  188,  115,  115,  115,  115,
+      115,  115,  115, 1161,  115,  115,  439, 1161,  437, 1161,
+      441,  440,  115,  822,  115,  115, 1161,  115,  438,  115,
+      805,  924,  115,  115, 1161,  115,  203,  115,  115,  115,
+      115,  115,  903, 1161,  115,  700,  115,  700,  441,  440,
+      115,  442,  115,  443,  445,  701,  444,  115,  115,  702,
+      115, 1161,  115,  115,  115,  446,   93,  115, 1161,  115,
+      115,  903,  911,   94,   95,  115, 1161,  115,  115,  442,
+      115,  443,  445,  115,  444,  115, 1161,  115,  115,  447,
+      115,   93,  115,  893,  446,  893,  448,  115,   94,   95,
+
+     1161,  911, 1161,  894,  115,  115, 1161,  115,  115,  451,
+      929,  115,  115,  115,  115,  449,  115,  447,  965,  115,
+      931,  804,  184,  809,  448,  115,  203,  115,  115,  176,
+      115,  453,  115,  115,  211,  452,  115,  115,  451,  929,
+      115,  466,  115,  466,  449,  115,  965,  115,  115,  931,
+      115,  933,  454,  115, 1161,  115,  934,  115,  115,  936,
+      453,  980,  115,  910,  452,  115, 1161,  115,  115, 1161,
+     1161,  913,  467,  115,  115,  115,  465,  115,  115,  115,
+      933,  454,  115,   93,  875,  934,  875,  115,  936,  980,
+       94,   95,  910,  115,  876,  115,  455,  115,  455,  115,
+
+      913,  959,  115,  115,  115,  465,  115,  964,  115,  239,
+      240,  115,   93,  966,  893,  115,  893,  468,  469,   94,
+       95,  115,  241, 1161,  894,  115, 1161,  456,  115,  115,
+      959,  203,  457,  115,  458,  115,  964,  459,  239,  240,
+      115,  460,  966, 1161,  461,  468,  469,  462,  463,  472,
+      241,  464,  115,  115,  115,  115,  470,  115,  115,  471,
+      115,  457,  989,  458,  991,  884,  459,  884,  115,  460,
+     1161,  115,  461, 1161,  115,  462,  463,  981,  472,  464,
+      973,  115,  115,  115,  115,  470,  115,  115,  471,  115,
+      115,  989,  474,  991,  473,  115,  115,  984,  115,  115,
+
+      986,  115,  115,  115,  896,  981,  896,  987,  973,  115,
+     1161,  115,  476,  954, 1161,  115,  115,  115,  988,  115,
+      115,  474,  473,  990,  115,  984,  477,  115,  986,  115,
+     1010,  115,  115, 1161,  115,  987,  115,  115,  115,  961,
+      476,  954,  478,  115,  115,  115,  988, 1161, 1005,  115,
+      115,  990, 1161, 1013,  477, 1161, 1161,  115,  479, 1010,
+      115,  115,  115, 1161, 1161,  115,  115,  115,  961, 1014,
+      478, 1027,  115,  998,  948,  998, 1005, 1015,  115,  203,
+      115,  480, 1013,  115,  115,  115,  479,  481,  115,  115,
+      115,  484,  483,  484,  488,  115,  488, 1014,  188, 1027,
+
+      482,  485,  115,  115,  489, 1017, 1015, 1018,  115,  480,
+     1161, 1161,  115,  115, 1035, 1021,  481,  115,  115, 1036,
+      115,  483,  203, 1028,  115,  115, 1031,  115,  482,  115,
+      115,  115,  115, 1016, 1017,  486, 1018, 1161,  490,  115,
+      492, 1032, 1035,  115, 1021,  487,  115, 1036,  491,  115,
+     1043, 1161, 1028,  115,  115, 1031,  115, 1161,  115, 1022,
+      115,  115, 1016,  486,  493,  115,  490,  115,  492, 1033,
+     1032,  115,  115,  487,  115, 1034,  491,  115, 1043,  115,
+      115,  115, 1045,  188,  495,  115,  115, 1161, 1022,  115,
+     1046,  494,  496,  493,  115, 1161, 1161,  115, 1033,  115,
+
+      115,  115,  115, 1050, 1034, 1161,  115,  115, 1161,  115,
+      115, 1045, 1049,  495,  115,  115,  115,  115, 1046,  494,
+      496,  497,  115, 1041,  948, 1041,  115,  115,  115, 1051,
+      498,  115, 1050,  115,  115, 1161,  115,  500,  115,  115,
+     1049,  499,  115,  852,  115,  852,  115, 1052, 1161,  497,
+     1161,  115,  115,  115,  115, 1161,  115, 1051,  498,  115,
+     1053, 1161,  115,  115,  115, 1061,  500,  115,  115, 1060,
+      499,  115,  501,  115,  115, 1161, 1052,  115,  925,  115,
+      115,  115,  115,  115,  115,  203, 1064,  502,  115, 1053,
+      503,  926, 1065,  115, 1061, 1161,  115, 1060,  504, 1066,
+
+      501,  115,  203,  115,  115,  211,  115,  925,  115,  115,
+      505,  115, 1161, 1161, 1064,  502, 1072, 1056,  503,  926,
+     1065,  115, 1076,  115,  115,  115,  504, 1066, 1161,  115,
+      115, 1161,  507,  115,  115, 1161,  506,  115,  115,  505,
+      508, 1057,  115, 1161,  115, 1072, 1056, 1055,  115, 1075,
+     1076,  115, 1161,  211,  115, 1079,  115,  509,  115,  115,
+      115,  507,  115,  115,  506,  115,  115,  115,  508,  115,
+     1057,  115,  115, 1078,  115, 1055,  115,  512, 1075,  115,
+      510,  115,  511, 1079,  115,  509, 1161, 1161,  115,  115,
+     1161,  115,  115, 1058,  115,  115,  115,  115,  115,  513,
+
+      115, 1161, 1078,  115, 1085,  515,  512,  115,  510,  115,
+      511,  115,  115, 1161,  115,  115,  115,  115,  115,  514,
+      115,  115, 1058,  115,  115,  516,  115, 1086,  513,  115,
+      211,  517, 1085,  515,  115, 1161,  203,  115,  115,  115,
+     1161,  115,  115,  115,  115,  115,  115,  115,  514,  115,
+      115,  211,  115,  521,  516,  521, 1086,  518, 1161,  517,
+      519,  115,  115,  522,  115,  115,  115,  115, 1070,  948,
+     1070, 1081,  115, 1161,  115, 1084, 1089, 1161,  520,  115,
+      115, 1090,  115,  203, 1083,  518,  115,  115,  519,  523,
+      115,  115,  115,  115, 1094,  115, 1161, 1096,  115,  524,
+
+     1081,  115,  115, 1084, 1089,  115,  520,  115,  115, 1097,
+     1090,  115,  115, 1083,  526,  115,  115, 1082,  523,  115,
+      115,  115,  115, 1094,  115, 1096, 1099,  115,  524,  115,
+     1161,  115,  525,  115, 1161, 1161,  115, 1097,  115,  115,
+      115, 1103,  526, 1161,  115,  115, 1082, 1111,  115,  115,
+      115, 1161,  211,  115, 1099, 1104,  527, 1107,  115,  211,
+      525,  947,  948,  947,  528, 1161,  115, 1161,  115,  949,
+     1103,  203,  950,  115,  115,  531, 1111,  539, 1161,  115,
+      947,  948,  947, 1104,  527, 1107,  115, 1023,  949, 1024,
+     1161,  950,  528,  540,  540,  540,  540,  540,  540,  540,
+
+      540,  540,  540,  541,  947,  948,  947, 1101, 1161,  176,
+     1161, 1102,  949, 1161,  188,  950, 1023, 1161, 1024,  540,
+      540,  540,  540,  540,  540,  540,  540,  540,  540,  541,
+     1000, 1001, 1000, 1161, 1161,  176, 1101,  188, 1002, 1102,
+     1161, 1003, 1092,  948, 1092,  540,  540,  540,  540,  540,
+      540,  540,  540,  540,  540,  541, 1109,  948, 1109, 1098,
+     1115,  176,  115,  115, 1161,  550,  548,  115,  115,  110,
+      115,  545,  545,  545,  545,  545,  545,  545,  545,  545,
+      545,  115,  549, 1114,  115,  115,  551, 1098, 1115, 1120,
+      115,  115,  115,  554,  550,  548,  115,  115, 1121,  115,
+
+     1161,  115, 1161, 1161,  115,  552,  115, 1161, 1161,  115,
+      549, 1114,  115, 1127,  115,  551, 1123, 1120,  482,  115,
+      115,  115, 1161,  115,  115,  553,  115, 1121,  115,  115,
+      115,  203,  115, 1161,  552,  115,  947,  948,  947, 1129,
+      115, 1127,  115,  115,  949, 1123,  482,  950,  115, 1161,
+      115,  203,  115,  115,  553,  115,  211,  115,  115, 1161,
+     1161, 1000, 1001, 1000, 1161, 1161, 1116, 1129,  115, 1002,
+      115,  115, 1003,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  211, 1161, 1000, 1001, 1000, 1117, 1118,
+     1117, 1161,  565, 1002, 1132, 1116, 1003, 1131, 1136, 1161,
+
+      566,  566,  566,  566,  566,  566,  566,  566,  566,  566,
+      211, 1161, 1042, 1001, 1042, 1117, 1118, 1117, 1142,  567,
+      949,  565, 1132,  950, 1161, 1131, 1136,  383,  383,  383,
+      383,  383,  383,  383,  383,  383,  383,  405,  405,  405,
+      405,  405,  405,  405,  405,  405,  405, 1142,  567,  405,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  407,
       407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  108,  108,  108,  108,  564,  568,  108,  197,  108,
-      108,  108,  571,  572,  570,  108, 1064,  108,  108,  108,
-      108,  108,  573,  574,  108,  108,  108,  108,  108,  108,
-      108,  590,  108,  578,  108,  197,  576,  577,  579,  108,
-
-      579,  108,  108,  108,  592,  108,  108,  108,  366,  596,
-      591,  108,  593,  108,  108,  594,  108,  677,  108,  108,
-      595,  599,  108,  108,  607,  597,  607,  108,  108,  723,
-      108,  108,  610,  108,  600,  598,  108,  724,  601,  179,
-      606,  580, 1049,  108,  108,  682,  609,  108,  108,  108,
-      108,  168,  108,  108,  608,  581,  434,  168,  434,  108,
-      108,  613,  611,  727,  108,  108,  108,  108,  614,  108,
-      108,  615, 1063,  617,  616,  108,  108,  621,  871,  728,
-      618,  108, 1061,  108,  619,  463,  435,  463,  108,  620,
-      623,  467,  108,  467,  582,  464,  583, 1056,  108,  584,
-
-     1055,  468,  622,  585,   86,  108,  586,  108,  625,  587,
-      588,  698,  699,  589,  602,  602,  602,  602,  602,  602,
-      602,  602,  602,  602,  602,  108,  602,  602,  602,  602,
-      602,  603,  602,  604,  604,  604,  604,  604,  604,  604,
-      604,  604,  602,  602,  602,  602,  602,  602,  602,  605,
-      605,  605,  605,  605,  605,  605,  605,  605,  605,  605,
-      605,  605,  605,  605,  605,  605,  605,  605,  605,  605,
-      605,  605,  605,  605,  605,  605,  602,  108,  108,  108,
-      108,  108,  108,  108,  785, 1054,  785,  108, 1051,  626,
-      627,  624,  108,  108,  108,  108,  108,  108,  108,  108,
-
-      108,  628,  108,  108,  108,  629,  630,  633,  108,  108,
-      108,  631,  108,  108,  636,  108,  108,  108,  108,  108,
-      108,  635,  632,  108,  108,  634,  108,  638,  641,  108,
-      108,  640,  637,  108,  639,  108,  108,  108,  108,  642,
-      108,  108,  108,  108,  108,  108,  108,  499,  108,  499,
-      108,  197,  644,  108,  108,  108,  179,  500,  108,  108,
-      643,  108,  108,  108,  108,  108,  108,  108,  108, 1050,
-      645,  647,  646,  648,  167,  669,  657,   82, 1045,  168,
-      108,  108,  168,  108,  701,  108,  649,  366,  648,  167,
-      103, 1044,  108,  649,  168,  648,  167,  108,  780,  667,
-
-      705,  168,  676,  668,  664,  668,  664,  571,  169,  170,
-      795,  668,  171,  668,  665,  694,  108,  108,  108,  108,
-      108,   86,  707,  169,  170,  326,  173,  171,   87,   88,
-      169,  170, 1042,  706,  171,  108,  108,  108,  108,  108,
-      326,  173,  666, 1041,  670,  108,  670,  326,  173,  649,
-      175,  655,  167,  197,  671,  108,  108,  168,  672,  696,
-      108,  193,  108,  108,  709,  108,  108,  656,  656,  656,
-      656,  656,  656,  656,  656,  656,  708,  108,  710,  108,
-      108,  108,  108,  108,  712,  108,  169,  170, 1048,  714,
-      171,  607,  785,  607,  785,  711,  108, 1040,  108,  108,
-
-      877,  108,  108,  326,  173,  197,  560,  560,  560,  560,
-      560,  560,  560,  560,  560, 1038,  108,  678,  108,  678,
-      179,  608,  679,  679,  679,  679,  679,  679,  679,  679,
-      679,  197,  560,  560,  560,  560,  560,  560,  560,  560,
-      560, 1031,  179,  794,  197,  794, 1030, 1029,  537,  537,
-      537,  537,  537,  537,  537,  537,  537,  562,  562,  562,
-      562,  562,  562,  562,  562,  562,  108, 1028, 1016,  536,
-      197,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      781,  108,  680,  108,  680,  732,  719,  681,  681,  681,
-      681,  681,  681,  681,  681,  681,  687,  687,  108,  687,
-
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  702,  687,  703,  703,  703,  703,  703,
-      703,  703,  703,  703,  687,  687,  687,  687,  687,  687,
-      687,  704,  704,  704,  704,  704,  704,  704,  704,  704,
-      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
-      704,  704,  704,  704,  704,  704,  704,  704,  687,  108,
-      108,  579,  108,  579,  108,  108,  108,  716,  108,  720,
-      715,  733,  108,  736,  739,  735,  108,  108,  731,  108,
-      734,  108,  108,  108,  108,  108,  108, 1025, 1024,  108,
-      738,  108,  740,  409,  740,  244,  193,  409,  108,  737,
-
-      108,  108,  108,  108,  717,  243,  243,  243,  243,  243,
-      243,  243,  243,  243,  108,  108,  108,  108,  718,  108,
-      108,  743,  741,  108,  108,  745,  108,  108,  744,  742,
-      108,  108,  108,  108,  748,  746,  108,  108,  789,  108,
-      108,  108,  752,  747,  108,  108,  108,  108,  753,  108,
-      750,  197,  751,  108,  108,  749,  108,  108,  108,  108,
-      755,  108,  108,  108,  108,  754,  108,  108,  756,  758,
-      757,  108,  108,  108,  108,  108,  760,  759,  108,  108,
-      763,  108,  108,  108,  108,  108,  761,  764,  108,  108,
-      108,  108,  108,  792,  108,  769,  108,  108,  762,  108,
-
-      108,  108,  108,  108, 1018,  108,  766,  768,  108,  108,
-      767,  108,  108,  108,  664,  197,  664,  108,  108,  770,
-      108,  771,  772,  773,  665,  774,  167,  168, 1017,  108,
-      108,  168,  775,  168,  774,  167,  664,  670,  664,  670,
-      168,  103,  775,  197,  774,  167,  665,  671,  108,  108,
-      168,  672,  776,  786,  879,   86,  787,  794,  197,  794,
-      169,  170,  806,  807,  171,  108,  108,  108,   86,  169,
-      170,  108,  244,  171,  776,   87,   88,  326,  173,  169,
-      170,  790,  788,  171,  108,  193,  326,  173,  108, 1015,
-      672,  108,  672,  670, 1012,  670,  326,  173,  775,  175,
-
-      779,  167,   86,  671,  672,  108,  168,  672,  108,   87,
-       88,  243,  243,  243,  243,  243,  243,  243,  243,  243,
-      812,  108,  108,  986,  811,  108,  108,  108,  108,  108,
-      816,  108,  819,  108,  819,  169,  170,  108,  108,  171,
-      813,  817,  108,  108,  108,  108,  108,  815,  108,  814,
-      108,  108,  326,  173,  197,  822,  740, 1011,  740,  819,
-      876,  819,  876,  876,  108,  876,  108,  108,  108,  820,
-      825,  679,  679,  679,  679,  679,  679,  679,  679,  679,
-      197,  839,  821,  108,  108,  965,  741,  965, 1009, 1001,
-      108,  108,  834,  108,  108,  835,  891,  679,  679,  679,
-
-      679,  679,  679,  679,  679,  679,  197,  108,  108,  892,
-      108,  841,  179,  836, 1000,  999,  108,  108,  843,  108,
-      108,  838,  837,  681,  681,  681,  681,  681,  681,  681,
-      681,  681,  197,  108,  108,  108,  850,  108,  862,   86,
-      862,  983, 1007,  984, 1007,  934,   87,   88,  863,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  791,  791,
-      197,  791,  791,  791,  791,  791,  791,  791,  791,  791,
-      791,  791,  791,  791,  791,  796,  791,  797,  797,  797,
-      797,  797,  797,  797,  797,  797,  791,  791,  791,  791,
-      791,  791,  791,  798,  798,  798,  798,  798,  798,  798,
-
-      798,  798,  798,  798,  798,  798,  798,  798,  798,  798,
-      798,  798,  798,  798,  798,  798,  798,  798,  798,  798,
-      791,  800,  800,   86,  800, 1036,  998, 1036,  800,  800,
-       87,   88,  800,  997,  996,  800,  800,  800,  800,  800,
-      800,  800,  800,  799,  799,  995,  799,  799,  799,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-      808,  799,  809,  809,  809,  809,  809,  809,  809,  809,
-      809,  799,  799,  799,  799,  799,  799,  799,  810,  810,
-      810,  810,  810,  810,  810,  810,  810,  810,  810,  810,
-      810,  810,  810,  810,  810,  810,  810,  810,  810,  810,
-
-      810,  810,  810,  810,  810,  799,  108,  108,  108,  844,
-      840,  844,  108,  108,  851,  179,  108,  848,  842,  845,
-      847,  108,  846,  108,  108,  108,  108,  992,  108,  108,
-      108,  108,  849,  108,  852,  108,  108,  853,  108,  108,
-      854,  108,  854,  108,  108,  108,  857,  108,  108, 1113,
-      108,  108,  108,  108,  860,  108,  108,  108,  108,  856,
-      108,  108,  108,  108,  108,  859,  858,  108,  108,  861,
-      864,  108,  108,  197,  108,  108,  865,  108,  865,  108,
-      108,  108,  773,  108,  775,  167,  108,  179,  108,  108,
-      855,  874,  108,  775,  991,  774,  167,  108,  108,  867,
-
-      108,  168,  775,  108,  775,  167,  108,  876,  108,  876,
-      244,  108,  865,  866,  865,  108,  888,  885,  883,  169,
-      170,  875,  884,  171,  982,  108, 1084,  108,  108,  108,
-      169,  170,  108,  108,  171,  108,  326,  173,  108,  169,
-      170,  108,  108,  171,  894,  886,  108,  326,  173,  929,
-      981, 1059,  889, 1059,  980,  108,  326,  173,  108,  108,
-      878,  878,  197,  878,  878,  878,  878,  878,  878,  878,
-      878,  878,  878,  878,  878,  878,  878,  880,  878,  881,
-      881,  881,  881,  881,  881,  881,  881,  881,  878,  878,
-      878,  878,  878,  878,  878,  882,  882,  882,  882,  882,
-
-      882,  882,  882,  882,  882,  882,  882,  882,  882,  882,
-      882,  882,  882,  882,  882,  882,  882,  882,  882,  882,
-      882,  882,  878,  197,  243,  243,  243,  243,  243,  243,
-      243,  243,  243,  108,  108,  108,  108,  887,  108,  108,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  893,
-      108,  108,  108,  896,  108,  108,  906,  905,  108,  108,
-      108,  909,  108,  108,  108,  907,  977,  911,  912,  975,
-      972,  108,  108,  108,  910,  908,  108,  108,  915,  108,
-      108,  108,  844,  913,  844,  916,  918,  108,  917,  108,
-      108,  108,  845,  108,  108,  108,  108,  920,  854,  108,
-
-      854,  108,  108,  108,  108,  108,  919,  921,  108,  926,
-      108,  108,  108,  108,  925,  108,  108,  108,  923,  108,
-      108,  924,  108,  108,  108,  862,  930,  862,  193,  108,
-      936,  197,  108,  108,  108,  863,  108,  931,  108,  940,
-      108,  108,  108,  108,  957,  928,  108,  108,  922,  108,
-      108,  937,  108,  108,  108,  108,  941,  108,  108,  942,
-      108,  938,  948,  108,  939,  197,  108,  950,  193,  108,
-      944,  108,  947,  943,  108,  108,  108,  108,  961,  956,
-      108,  959,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  108,  108,  108,  108,  108,  960,  108,  108,  958,
-
-      915,  108,  179,  108,  179, 1047,  108,  916,  108,  108,
-      917,  108,  967,  962,  108,  108,  964,  963,  108,  968,
-      108,  915,  969,  108,  108,  108,  108,  108,  916,  970,
-      108,  917,  971,  108,  108,  108,  108,  197,  108,  976,
-      973,  108,  108,  108,  108,  108,  108,  108,  108, 1065,
-      108,  974,  108,  108,  978,  108,  108, 1094,  979,  989,
-      108,  108,  108,  108,  108,  108,  985,  108,  990,  108,
-      108,  994,  955,  108,  987,  108,  988,  108,  108, 1003,
-      108,  108,  993,  108,  108,  108,  108,  108,  108, 1002,
-      197,  108,  108, 1006,  967, 1004,  108,  108,  108,  197,
-
-      108,  968,  108,  954,  969,  108,  967, 1005,  108, 1008,
-      967, 1008,  967,  968,  108,  108,  969,  916,  108,  968,
-      917,  108,  969, 1010,  108,  108,  108,  108,  108, 1013,
-     1014,  108, 1022,  108,  953,  108,  108, 1021,  108, 1019,
-     1023,  108,  108,  108,  108,  108,  108,  108,  108,  108,
-      108, 1033,  108,  108,  108, 1027,  179, 1026, 1035,  108,
-     1034, 1032,  952,  108,  108,  108,  108,  108,  108,  108,
-      951,  108, 1037,  915, 1037,  108,  108,  108,  108, 1039,
-      916,  108, 1052,  917,  108,  108,  108, 1046,  108, 1043,
-      108,  108,  108,  108,  108,  108,  193, 1057,  108, 1053,
-
-      108, 1058,  179,  108,  108,  108,  108,  108,  108, 1062,
-      108, 1060,  915, 1060,  108,  193,  108,  108, 1075,  916,
-      108,  108,  917,  108, 1072,  949, 1076, 1071, 1076, 1067,
-      108,  108,  108,  108, 1077,  915, 1077,  108,  108,  193,
-     1079,  108,  916,  179,  915,  917, 1087,  108,  108,  108,
-     1081,  916, 1083,  179,  917,  108, 1089, 1089, 1092, 1089,
-      179, 1097,  946, 1089, 1089,  108,  193, 1089,  179,  193,
-     1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1090,  915,
-     1090,  108,  193,  193,  179, 1101,  916, 1095,  193,  917,
-      915, 1111,  193, 1103, 1098, 1098, 1107, 1099,  108, 1104,
-
-      917, 1098, 1098,  108,  108, 1098,  193,  193, 1098, 1098,
-     1098, 1098, 1098, 1098, 1098, 1098,  915,  967,  193, 1109,
-      108,  108, 1112,  916,  968, 1114,  917,  969,  193, 1108,
-      384, 1110,  384,  386,  388,  386,  388, 1115,  403,  945,
-      403, 1116,  405,  366,  405, 1119,  407,  560,  407,  560,
-      197,  562, 1120,  562,  935,  179,  933, 1118,  932,  927,
-      904,  903,  902,  901,  900,  899,  898,  897,  895,  890,
-       82,   78,  366,  197,  197,  197,  873,  179,  179,  870,
-      869, 1121,   62,   62,   62,   62,   62,   62,   62,   62,
-       62,   62,   62,   62,   62,   62,   62,   62,   62,   63,
-
-       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
-       63,   63,   63,   63,   63,   63,   74,   74,  868,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   77,   77,  833,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
-       81,   81,   81,   81,   81,   81,   81,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,  104,  104,  832,  831,  830,  829,
-      104,  108,  108,  108,  108,  108,  108,  108,  108,  108,
-
-      108,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  184,  828,
-      184,  827,  184,  184,  826,  824,  823,  818,  184,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  195,  195,  195,  195,
-      195,  195,  195,  195,  195,  195,   82,  195,  195,  195,
-      195,   82,  195,  218,  218,  218,  218,  218,  218,  218,
-      218,  218,  218,  218,  218,  218,  218,  218,  218,  218,
-       94,   78,  803,   94,   94,  238,  238,  238,  238,  366,
-      238,  238,  366,  238,  238,  197,  238,  238,  783,  179,
-
-      238,  238,  328,  328,  328,  328,  328,  328,  328,  328,
-      328,  328,  328,  328,  328,  328,  328,  328,  328,  336,
-      778,  336,  777,  765,  336,  341,  730,  341,  729,  341,
-      341,  342,  342,  726,  342,  342,  342,  342,  342,  342,
-      342,  342,  342,  342,  342,  342,  342,  342,  353,  353,
-      353,  353,  353,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  353,  353,  353,  358,  358,  358,  358,  358,
-      358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
-      358,  358,  401,  725,  722,  401,  401,  262,  721,  262,
-      713,  700,   82,  693,  262,  689,  686,  530,  663,  662,
-
-      530,  654,  262,  517,  653,  517,  652,  651,  517,  522,
-      650,  522,  612,  522,  522,  656,  575,  656,  408,  558,
-      656,  661,  557,  661,  556,  661,  661,  687,  687,  555,
-      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
-      687,  687,  687,  687,  690,  690,  554,  690,  690,  690,
-      690,  690,  690,  690,  690,  690,  690,  690,  690,  690,
-      690,  692,  692,  547,  692,  692,  692,  692,  692,  692,
-      692,  692,  692,  692,  692,  692,  692,  692,  695,  695,
-      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
-      695,  695,  695,  695,  695,  697,  697,  697,  697,  697,
-
-      697,  697,  697,  697,  697,  697,  697,  697,  697,  697,
-      697,  697,  782,  782,  782,  782,  782,  782,  782,  782,
-      782,  782,  782,  782,  782,  782,  782,  782,  782,  104,
-      546,  104,  544,  104,  104,  784,  784,  543,  784,  784,
-      784,  784,  784,  784,  784,  784,  784,  784,  784,  784,
-      784,  784,  791,  791,  791,  791,  791,  791,  791,  791,
-      791,  791,  791,  791,  791,  791,  791,  791,  791,  793,
-      793,  793,  793,  793,  793,  793,  793,  793,  793,  793,
-      793,  793,  793,  793,  793,  793,  799,  799,  366,  799,
-      799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
-
-      799,  799,  799,  801,  801,  197,  801,  801,  801,  801,
-      801,  801,  801,  801,  801,  801,  801,  801,  801,  801,
-      802,  802,  197,  802,  802,  802,  802,  802,  802,  802,
-      802,  802,  802,  802,  802,  802,  802,  804,  804,  804,
-      804,  804,  804,  804,  804,  804,  804,  804,  804,  804,
-      804,  804,  804,  804,  805,  805,  805,  805,  805,  805,
-      805,  805,  805,  805,  805,  805,  805,  805,  805,  805,
-      805,  872,  872,  872,  872,  872,  872,  872,  872,  872,
-      872,  872,  872,  872,  872,  872,  872,  872,  878,  878,
-      878,  878,  878,  878,  878,  878,  878,  878,  878,  878,
-
-      878,  878,  878,  878,  878,  914,  914,  914,  914,  914,
-      914,  914,  914,  914,  914,  914,  914,  914,  914,  914,
-      914,  914,  966,  966,  966,  966,  966,  966,  966,  966,
-      966,  966,  966,  966,  966,  966,  966,  966,  966,  524,
-      523,  515,  514,  513,  512,  511,  510,  179,  333,  429,
-      410,  408,  400,  399,  398,  395,  394,  393,  392,  389,
-      375,  374,  372,  371,  366,  197,  197,  193,  179,  334,
-      332,  331,  179,  237,  236,  229,  228,   82,   82,   78,
-      213,  212,  210,  209,  193,  188, 1123,   64,   13, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123
+      407,  407,  407,  407,  407,  407,  407,  407,  407,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  424,
+
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  588,
+      211,  588, 1161, 1161,  589,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430, 1161,  115, 1161,  115, 1161,  590,
+      115,  590,  115,  429,  591,  591,  591,  591,  591,  591,
+
+      591,  591,  591,  591,  115,  592,  115,  115,  115,  593,
+      203, 1119,  115,  115,  115, 1161,  115, 1141,  188,  115,
+     1161,  115,  429, 1161,  115, 1161,  115,  115,  594,  115,
+      115, 1161,  115,  592,  115,  115,  115,  115,  593, 1119,
+     1161,  115,  115,  115, 1161, 1141,  115,  203,  595,  115,
+     1149,  115, 1161,  115,  115,  115, 1146,  594,  115,  115,
+     1161, 1161,  596, 1161,  115,  115,  188,  115,  115,  115,
+     1161,  115,  597,  115,  115,  115,  595,  115,  188, 1149,
+      115,  115, 1161,  598, 1146,  115,  203,  115,  115,  115,
+      115,  596, 1144,  115,  115,  188,  115,  115,  115,  203,
+
+      599,  597,  115,  115,  115,  115, 1161,  188,  115,  115,
+      115,  598, 1161,  600,  115,  115,  115, 1130,  115,  115,
+     1144,  115,  115,  115,  115,  601,  115,  115,  599, 1143,
+      115, 1157,  115,  602,  115,  115,  115, 1148, 1161,  115,
+      115,  115,  600,  603, 1145, 1130, 1124,  948, 1124,  115,
+      115,  115,  115, 1161,  601,  115,  115, 1143, 1151,  115,
+     1157,  602,  115, 1161,  115, 1148,  188,  115,  115,  115,
+      115,  603, 1145,  605,  115,  115,  203,  115,  606,  115,
+     1161,  115, 1161, 1161,  203,  608, 1151,  608, 1161,  115,
+     1161,  115,  607,  115, 1161, 1161,  115, 1161, 1161,  115,
+
+     1161,  605, 1147,  115,  115, 1161, 1161,  606,  115,  115,
+      115, 1153, 1154, 1153,  115,  115, 1161,  115,  115,  115,
+      607,  115, 1161,  115, 1161, 1155,  609, 1161,  619,  115,
+      620, 1147, 1161,  115, 1161, 1152, 1161,  115, 1161,  115,
+      610,  115, 1161,  115,  115,  115,  621,  115,  115, 1161,
+      115, 1161,  115, 1155,  203,  609,  619,  115,  620,  622,
+      115,  115,  115, 1152,  115,  115, 1161,  115,  610,  455,
+      115,  455, 1161, 1161,  115,  621, 1153, 1154, 1153,  115,
+     1161,  629, 1161, 1161,  115, 1161, 1161,  622,  115,  115,
+     1156,  115,  115, 1159, 1160, 1159,  115, 1159, 1160, 1159,
+
+      456,  623, 1161,  115, 1161,  611,  115,  612, 1161,  629,
+      613,  115,  203,  115,  614, 1161, 1161,  615,  115, 1156,
+      616,  617, 1161, 1161,  618,  115, 1161, 1161, 1161,  623,
+      626,  115, 1161, 1161,  611,  115,  612, 1161,  115,  613,
+      115, 1161,  614,  115, 1161,  615,  115, 1161,  616,  617,
+      624,  115,  618,  115,  115,  115, 1161,  637,  626,  115,
+      115,  627, 1161, 1158, 1161,  115,  625,  115, 1161, 1161,
+     1161, 1161,  115,  115,  115,  115,  628, 1161, 1161,  624,
+      115, 1161, 1161,  115,  115,  637, 1161, 1161,  115,  115,
+      627, 1158, 1161,  115,  625, 1161, 1161, 1161, 1161, 1161,
+
+     1161,  115,  115, 1161,  628,  630,  630,  630,  630,  630,
+      630,  630,  630,  630,  630,  630, 1161,  630,  630,  630,
+      630,  630,  631,  630,  632,  632,  632,  632,  632,  632,
+      632,  632,  632,  632,  630,  630,  630,  630,  630,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  630,  630,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  633,  633,  633,  633,  633,
+      633,  633,  633,  630,  115, 1161,  635,  638,  635,  115,
+
+     1161, 1161,  115,  115, 1000, 1001, 1000, 1161,  115, 1161,
+     1161,  634, 1002,  115, 1161, 1003,  115, 1161, 1161, 1161,
+     1161, 1161,  639,  115, 1161, 1161,  638,  636,  115,  115,
+      115,  115,  115, 1161,  115,  115, 1161,  115,  115,  634,
+     1161,  115, 1161,  115,  115, 1161,  641, 1161,  115,  115,
+      639, 1161, 1161, 1161, 1161, 1161, 1161,  115,  115,  115,
+      115, 1161, 1161,  115,  115,  115, 1161,  115,  115, 1161,
+     1161, 1161,  115,  115, 1161,  641,  115,  115, 1161,  115,
+      642, 1161, 1161, 1161, 1161,  115, 1161,  643, 1161,  115,
+      115, 1161, 1161, 1161,  115,  115, 1161,  115,  644,  115,
+
+     1161, 1161,  115, 1161,  115,  645, 1161,  115,  642,  115,
+     1161, 1161,  646, 1161, 1161,  643, 1161, 1161,  115,  115,
+     1161, 1000, 1001, 1000,  115, 1161, 1161,  644,  115, 1002,
+      115,  650, 1003,  115,  645,  115,  115,  115,  647,  115,
+      646,  648,  115, 1161,  115, 1161,  115,  115, 1161,  115,
+      115, 1161, 1161, 1161, 1161, 1161,  649, 1161,  115,  115,
+      650,  115, 1161, 1161,  115,  115, 1161,  647,  115,  115,
+      648,  115, 1161,  115,  115,  652,  115,  115,  115, 1161,
+      115, 1161, 1161,  651,  649, 1161,  115, 1161,  115,  115,
+     1161,  115, 1161, 1161,  115,  115,  115, 1161,  115, 1161,
+
+      115, 1161,  653,  115,  652, 1161,  654,  115, 1161,  115,
+      115,  651,  115, 1161,  115, 1161,  115, 1161,  115, 1161,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161,  115,
+      653, 1161,  115, 1161,  654,  655,  115,  115,  115,  115,
+     1161,  115,  115,  115,  115, 1161,  115,  115,  115, 1161,
+      115, 1161,  115, 1161,  115,  115,  115, 1161,  115, 1161,
+     1161,  115,  115, 1161,  655,  115,  115, 1161,  115,  659,
+      115,  115,  115,  115,  115,  115, 1161,  115, 1161,  115,
+      656, 1161,  657, 1161,  115,  115,  115,  115, 1161,  115,
+      115,  658,  115,  115, 1161,  115,  661,  659,  115,  115,
+
+      115,  115, 1161, 1161,  115, 1161,  115, 1161,  656, 1161,
+      657, 1161,  660,  115, 1161,  115,  115,  115,  115,  115,
+      658,  115,  115,  115,  115,  661, 1161,  115, 1161,  664,
+      115, 1071,  948, 1071,  115,  662, 1161,  115,  115,  949,
+      660,  115,  950,  115, 1161, 1161,  115,  115,  115,  663,
+      115, 1161,  115,  115, 1161,  115, 1161,  115, 1161, 1161,
+      115, 1161,  115,  662, 1161,  115,  115, 1161, 1161,  115,
+      115, 1161, 1161, 1161,  665,  115,  115, 1161,  663,  115,
+     1161, 1161,  115, 1161,  115, 1161,  115,  115,  115,  115,
+      115,  115, 1161,  666,  115,  115, 1161,  115, 1161, 1161,
+
+     1161,  115,  665,  668,  115, 1161,  667, 1161,  115,  115,
+     1161,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,
+      115,  666,  115,  115,  115,  115, 1161,  115,  115,  115,
+      669,  668, 1161,  115,  667, 1161,  115,  115,  670,  115,
+     1161,  115, 1161, 1161, 1161,  115, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  115, 1161,  115,  115,  115,  669,
+     1161,  115,  115, 1161,  115,  115,  115,  115, 1161,  115,
+      115, 1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161,  115, 1161,  115, 1161,  115,  115,  115, 1161,
+      115,  115,  115,  115,  115,  115, 1161, 1161, 1161,  115,
+
+      115, 1161,  671, 1161, 1161,  115, 1161,  115,  115,  115,
+     1161, 1161,  115,  672,  115,  115, 1161,  115,  115, 1161,
+      115,  115,  115,  115, 1161, 1161,  115, 1161,  115, 1161,
+      671, 1161, 1161,  115, 1161,  115, 1161,  115,  115, 1161,
+      115,  115,  672,  115,  115,  673,  115,  115,  674,  115,
+      115, 1161,  115, 1161, 1161,  115,  115, 1161, 1161, 1161,
+      115,  698, 1161,  115, 1161,  115,  115, 1161,  115, 1161,
+      115, 1161, 1161,  115,  673,  115, 1161,  674,  115,  677,
+      115,  684, 1161, 1161, 1161, 1093,  948, 1093,  115, 1161,
+      698,  115, 1161,  949, 1161,  115,  950,  685,  685,  685,
+
+      685,  685,  685,  685,  685,  685,  685,  686,  115, 1110,
+      948, 1110, 1161,  176, 1161, 1161, 1161,  949, 1161, 1161,
+      950, 1161, 1161,  685,  685,  685,  685,  685,  685,  685,
+      685,  685,  685,  686,  693, 1161,  693, 1161, 1161,  176,
+     1161, 1161, 1161, 1161,  694, 1161, 1161, 1161, 1161,  685,
+      685,  685,  685,  685,  685,  685,  685,  685,  685,  686,
+      697, 1161,  697, 1161, 1161,  176,  696,  115, 1161, 1161,
+      695,  115,  115,  110,  600,  690,  690,  690,  690,  690,
+      690,  690,  690,  690,  690,  115,  115, 1161, 1161, 1161,
+     1161, 1161, 1161,  115, 1161,  696,  115, 1161,  115,  695,
+
+      115,  115,  115,  600, 1161,  115, 1161,  115,  645,  732,
+      115, 1161,  115,  115,  115,  646, 1161, 1161,  700,  699,
+      700,  115,  115, 1161,  115, 1161, 1161,  115,  701, 1161,
+     1161,  115,  702, 1161,  115, 1161,  115,  645,  732,  115,
+      115,  211, 1161,  646, 1161, 1161, 1161,  699, 1161,  115,
+     1161,  115,  115,  709, 1161,  709,  115, 1161,  710,  710,
+      710,  710,  710,  710,  710,  710,  710,  710, 1161,  211,
+      115, 1126,  948, 1126, 1161, 1161, 1161, 1161, 1161,  949,
+      115, 1161,  950, 1161, 1161,  115,  566,  566,  566,  566,
+      566,  566,  566,  566,  566,  566,  211, 1161,  115, 1161,
+
+     1161,  947,  948,  947, 1161,  565, 1161, 1161,  711,  949,
+      711, 1161,  950,  712,  712,  712,  712,  712,  712,  712,
+      712,  712,  712,  589,  589,  589,  589,  589,  589,  589,
+      589,  589,  589, 1161,  565,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  589,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  733, 1161, 1161,  115, 1161,
+      115, 1161, 1161,  115,  947,  948,  947, 1161, 1000, 1001,
+     1000, 1161,  949,  737,  115,  950, 1002,  115, 1161, 1003,
+     1161, 1161, 1161, 1161,  733, 1161, 1161,  115, 1161,  115,
+
+     1161, 1161,  115, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,  737,  115,  718,  718,  115,  718,  718,  718,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
+      734,  718,  735,  735,  735,  735,  735,  735,  735,  735,
+      735,  735,  718,  718,  718,  718,  718,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  718,  718,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
+
+      736,  718,  115,  115,  738,  115,  115,  115,  115,  115,
+      115,  115, 1161,  740,  115, 1161, 1161, 1161,  739,  741,
+     1161,  115,  115, 1161,  115,  115, 1161, 1161,  115, 1161,
+     1161,  115,  115,  738,  115,  115,  115,  115,  115,  115,
+      115, 1161,  740,  115, 1161, 1161,  739,  741, 1161,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161,  115,
+      115,  115,  115, 1161, 1161,  745,  115, 1161, 1161,  742,
+     1161, 1161, 1161,  115,  115,  743,  115, 1161, 1161, 1161,
+      115, 1161, 1161,  115,  115, 1161,  115,  115,  115,  115,
+      115,  115,  115, 1161,  745,  115, 1161,  742,  746, 1161,
+
+     1161,  115,  115,  743,  115, 1161,  115, 1161,  115,  115,
+      115, 1161, 1161,  115,  750,  115,  115,  747,  115, 1161,
+      751,  115, 1161, 1161, 1161, 1161,  746, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+      115,  115,  115,  750,  115, 1161,  747,  115, 1161,  751,
+     1161, 1161, 1161, 1161,  115,  115,  115,  115,  115, 1161,
+      115, 1161, 1161,  115,  115,  115, 1161, 1161, 1161,  115,
+      115,  761, 1161, 1161,  115,  115, 1161,  115,  762,  115,
+      115, 1161,  115,  115, 1161, 1161, 1161,  115,  763, 1161,
+     1161,  115,  115,  115,  115, 1161,  115, 1161, 1161,  761,
+
+     1161, 1161,  764,  115,  115,  115, 1161,  762,  115,  115,
+      115, 1161,  115,  765,  115, 1161,  763,  115,  768,  115,
+      115,  115,  115,  115, 1161,  115, 1161, 1161, 1161,  766,
+      764,  115, 1161,  115, 1161,  115, 1161,  115,  115,  767,
+      115,  115,  765,  115, 1161, 1161,  115,  768,  115, 1161,
+     1161, 1161,  115,  769,  115,  769, 1161,  766, 1161,  115,
+     1161,  115, 1161,  258,  115,  115, 1161, 1161,  767,  115,
+      257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      115, 1161,  115,  115,  770,  115,  115,  115,  115,  115,
+     1161,  115,  115, 1161,  115, 1161, 1161, 1161, 1161,  115,
+
+      771, 1161,  115, 1161, 1161,  115,  115, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115,  115,  115,  115,
+      115,  115, 1161,  115,  115, 1161, 1161,  115,  771, 1161,
+      115, 1161, 1161,  115,  115,  115,  115, 1161,  772,  115,
+      115,  774,  115,  773,  115,  775,  115,  115,  115, 1161,
+     1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115, 1161,
+     1161,  115,  115, 1161,  115,  115,  772,  115,  115,  115,
+      774,  115,  773,  115,  775,  115,  115, 1161, 1161,  776,
+      115,  115,  115,  115, 1161,  115,  115,  777,  115,  115,
+      115,  115,  115,  115,  780, 1161,  115,  115, 1161,  115,
+
+     1161, 1161,  115, 1161,  778,  779, 1161,  776, 1161,  115,
+     1161,  115,  115,  115,  115, 1161,  777,  115, 1161,  115,
+     1161,  115, 1161,  780, 1161, 1161,  115, 1161,  115,  115,
+      115,  781,  778,  779,  115,  115, 1161, 1161, 1161,  115,
+      115,  115, 1161, 1161, 1161, 1161,  782, 1161,  115, 1161,
+     1161, 1161, 1161, 1161,  115, 1161, 1161, 1161,  115, 1161,
+      781,  115, 1161,  115,  115,  115,  115,  783, 1161,  115,
+      115, 1161,  784,  115,  782, 1161,  115,  785,  115, 1161,
+      115, 1161,  115, 1161,  115, 1161, 1161, 1161, 1161, 1161,
+      115, 1161,  115, 1161,  115,  115,  783, 1161,  115,  115,
+
+      784, 1161,  115,  787, 1161,  115,  785,  115,  115,  115,
+      115, 1161,  115,  786,  115, 1161, 1161,  115, 1161, 1161,
+      115, 1161,  788, 1161,  115,  115, 1161,  115,  115,  789,
+      115, 1161,  787, 1161,  115, 1161,  115, 1161,  115,  115,
+     1161,  115,  786,  115,  115,  115, 1161, 1161,  115, 1161,
+      788, 1161,  115,  115,  115,  115,  115,  115,  789,  115,
+     1161,  790,  115, 1161, 1161,  115, 1161,  115,  115,  792,
+      115, 1161,  115,  115,  115, 1161,  115,  115, 1161, 1161,
+     1161, 1161,  115,  115, 1161, 1161,  115,  791,  115, 1161,
+      790,  115, 1161, 1161,  115,  115,  793,  115,  792,  115,
+
+      115,  115,  115,  115,  115,  115,  115, 1161, 1161, 1161,
+     1161, 1161, 1161,  115, 1161,  791,  115, 1161,  795,  115,
+      796, 1161, 1161,  115, 1161,  793,  115, 1161,  115,  115,
+      115,  115, 1161, 1161,  115,  115, 1161,  115, 1161,  797,
+      798,  115,  115, 1161, 1161,  115,  795,  115,  796,  115,
+     1161, 1161, 1161,  115,  115,  115,  115,  115,  115, 1161,
+      115, 1161,  115, 1161, 1161, 1161,  115,  797,  799,  798,
+     1161,  115,  801,  115,  115, 1161,  115,  800,  115,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1161, 1161,
+     1161,  115, 1161,  115, 1161, 1161,  799, 1161, 1161,  115,
+
+      801, 1161, 1161,  115,  115,  800, 1161, 1161,  115,  115,
+     1161, 1161,  176, 1161,  115, 1161, 1161, 1161,  176,  115,
+     1161,  115, 1161,  816,  115, 1161,  110,  115,  111,  111,
+      111,  111,  111,  111,  111,  111,  111,  111,  115,  115,
+      115,  115, 1161, 1161,  115,  115,  819,  817,  115, 1161,
+     1161,  818,  816,  115, 1161, 1161, 1161, 1161,  115,  115,
+      115, 1161, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,
+      115, 1161,  211,  115,  115,  819,  817, 1161, 1161,  818,
+     1161, 1161,  211, 1161, 1161, 1161,  115,  115,  115,  710,
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
+
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  211,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,  211,
+     1161, 1161, 1161, 1161, 1161, 1161,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  823,  823,  211,  823,
+      823,  823,  823,  823,  823,  823,  823,  823,  823,  823,
+      823,  823,  823,  828,  823,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  823,  823,  823,  823,  823,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+
+      830,  830,  830,  830,  830,  830,  823,  823,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  830,  830,  830,  830,  830,  830,
+      830,  830,  830,  830,  823,  832,   77,  832, 1161, 1161,
+      833,  833, 1161,  833, 1161, 1161, 1161,  833,  833, 1161,
+     1161,  833, 1161, 1161,  833,  833,  833,  833,  833,  833,
+      833,  833,  833,  831,  831, 1161,  831,  831,  831,  831,
+      831,  831,  831,  831,  831,  831,  831,  831,  831,  831,
+      841,  831,  842,  842,  842,  842,  842,  842,  842,  842,
+      842,  842,  831,  831,  831,  831,  831,  843,  843,  843,
+
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  831,  831,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  843,  843,  843,  843,  843,  843,  843,  843,  843,
+      843,  831,  115, 1161, 1161,  258, 1161,  115,  257,  257,
+      257,  257,  257,  257,  257,  257,  257,  257,  115,  845,
+     1161,  844,  115,  115,  115,  115, 1161,  115, 1161, 1161,
+      115,  115, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+     1161,  115, 1161, 1161,  846,  115, 1161,  115,  845,  844,
+
+      115,  115,  115,  115,  115, 1161,  115,  115, 1161,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+     1161, 1161,  846,  115,  115, 1161,  115, 1161, 1161,  115,
+      847, 1161, 1161, 1161, 1161, 1161,  115,  115,  848, 1161,
+     1161,  115,  115,  115, 1161,  849, 1161,  115,  115, 1161,
+      115,  115,  115, 1161,  115,  115,  115, 1161,  847,  850,
+     1161,  852,  115,  852, 1161,  115,  848, 1161, 1161,  115,
+      115, 1161,  115,  115,  849, 1161, 1161,  115,  115,  115,
+      115, 1161,  115, 1161,  115,  115,  855,  115,  850, 1161,
+      115, 1161,  115, 1161,  115, 1161,  853,  115,  115,  115,
+
+     1161,  115,  115, 1161, 1161, 1161, 1161,  115, 1161,  854,
+     1161,  115, 1161,  115,  115,  855,  115, 1161,  858,  115,
+      115, 1161, 1161,  115, 1161,  853,  115, 1161,  115,  115,
+     1161,  115, 1161,  115,  115, 1161,  866,  854, 1161,  115,
+     1161,  115, 1161,  115, 1161,  115,  867,  858,  115, 1161,
+     1161,  115, 1161,  115, 1161,  115,  115,  868, 1161, 1161,
+      115,  115, 1161,  115, 1161,  866, 1161, 1161,  115, 1161,
+      115,  115,  115,  115,  867,  869,  115,  115,  115, 1161,
+      115,  115,  871,  115, 1161,  115,  868, 1161, 1161,  870,
+      115,  115, 1161, 1161,  874, 1161, 1161,  115,  115,  115,
+
+      115,  115, 1161,  115,  869,  115,  115,  115,  115, 1161,
+      115,  871,  115,  115,  875,  115,  875,  870,  115,  115,
+      872,  873,  115,  874,  876,  115,  115, 1161,  115,  115,
+     1161,  115,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      877,  115, 1161, 1161,  115,  115,  115,  115,  872,  873,
+      115,  115,  115, 1161,  878,  115, 1161,  115,  115, 1161,
+      115, 1161,  879,  115, 1161,  115,  115,  115,  877,  115,
+     1161,  880,  115,  115,  115,  115,  115,  115, 1161, 1161,
+      115,  115, 1161,  878, 1161, 1161,  115,  115,  115, 1161,
+      115,  879,  115,  115,  115,  115,  115, 1161,  115,  115,
+
+      880,  115, 1161,  115,  115,  115, 1161,  881, 1161,  115,
+      115, 1161, 1161, 1161,  115,  115,  115,  882,  115,  115,
+     1161,  883,  115, 1161,  115, 1161, 1161,  115,  115,  115,
+     1161,  115, 1161,  115, 1161,  881,  115,  115, 1161,  115,
+     1161,  115,  115,  115,  115,  882,  115,  115,  115,  883,
+      115,  115, 1161,  884, 1161,  884,  115,  115, 1161, 1161,
+      115,  115,  115,  115, 1161,  115, 1161, 1161,  115,  115,
+     1161,  115,  115, 1161,  115, 1161,  115,  115,  115,  115,
+     1161,  886,  115,  888, 1161, 1161,  115, 1161,  115,  115,
+      115,  115,  115,  115,  115, 1161, 1161,  115,  887,  115,
+
+     1161,  885,  115,  115, 1161,  115, 1161, 1161,  115,  886,
+      115, 1161,  888,  889, 1161,  115, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  115, 1161,  887,  115,  115,  885,
+      115,  891,  115,  115, 1161, 1161,  890, 1161,  115,  115,
+     1161,  889, 1161, 1161,  115, 1161,  115, 1161,  115, 1161,
+     1161,  892, 1161,  115, 1161, 1161,  115, 1161,  115, 1161,
+      891,  115,  115, 1161,  890, 1161,  115,  115,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1161,  895,  892,
+     1161,  115,  115, 1161, 1161, 1161,  115,  115, 1161,  115,
+      115,  115, 1161,  115, 1161,  896,  115,  896,  115,  115,
+
+      115,  115, 1161, 1161,  115,  115, 1161,  895, 1161,  115,
+     1161,  115,  115, 1161, 1161, 1161,  115,  115,  115,  115,
+      115, 1161,  115, 1161,  115,  115,  115,  115,  115,  115,
+      897,  906, 1161,  115, 1161, 1161, 1161, 1161,  898,  115,
+      115, 1161, 1161, 1161, 1161,  115, 1161,  115,  115,  115,
+     1161,  115, 1161,  115,  115,  115,  115,  115, 1161,  897,
+      906, 1161,  115, 1161,  907, 1161,  898,  115, 1161,  908,
+      115,  908, 1161,  115,  258,  115,  802,   77,  804,  175,
+      115, 1161, 1161, 1161, 1161,  115, 1161, 1161, 1161, 1161,
+      909,  115,  907, 1161, 1161,  115,  115, 1161,  115, 1161,
+
+     1161, 1161,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      115,  177,  178, 1161, 1161,  179, 1161,  180, 1161,  909,
+      115,  115, 1161, 1161,  115,  115, 1161, 1161,  341,  182,
+     1161,  115, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+      177,  178, 1161, 1161,  179, 1161,  180, 1161, 1161,  115,
+     1161, 1161, 1161, 1161, 1161, 1161,  341,  182,  912,  912,
+      211,  912,  912,  912,  912,  912,  912,  912,  912,  912,
+      912,  912,  912,  912,  912,  914,  912,  915,  915,  915,
+      915,  915,  915,  915,  915,  915,  915,  912,  912,  912,
+      912,  912,  916,  916,  916,  916,  916,  916,  916,  916,
+
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  916,  916,  912,  912,
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  916,  916,  916,  916,
+      916,  916,  916,  916,  916,  916,  912,  211,  257,  257,
+      257,  257,  257,  257,  257,  257,  257,  257, 1161, 1161,
+     1161, 1161, 1161, 1161,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  383,  374,  374,  211,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      374,  384,  374,  385,  385,  385,  385,  385,  385,  385,
+
+      385,  385,  385,  374,  374,  374,  374,  374,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  374,  374,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
+      386,  386,  374,  115, 1161,  917, 1161,  115,  115,  918,
+      115,  115,  115,  919,  115, 1161,  115, 1161,  920,  115,
+     1161, 1161,  115, 1161,  115, 1161,  115, 1161, 1161, 1161,
+      115, 1161,  115,  115,  917, 1161,  115,  115,  918,  115,
+
+      115,  115,  919,  115,  922,  115, 1161,  920,  115,  115,
+      115,  115,  115, 1161,  115,  921,  115, 1161,  115, 1161,
+      115,  115, 1161,  115, 1161,  115, 1161,  115, 1161, 1161,
+      115,  115,  115,  922,  923, 1161,  115, 1161,  115,  115,
+      115,  927, 1161, 1161,  921,  115,  115, 1161,  928,  115,
+      115,  115,  115, 1161,  115, 1161,  115,  115,  115, 1161,
+      115,  115,  923,  115, 1161,  115, 1161,  115,  115,  927,
+     1161,  115,  115, 1161,  115, 1161,  928,  115,  115, 1161,
+      930,  115,  115,  115, 1161, 1161,  115, 1161,  115, 1161,
+     1161,  938,  115, 1161,  939, 1161, 1161,  115, 1161,  115,
+
+     1161,  115,  115, 1161,  115, 1161,  115, 1161,  930,  115,
+      115, 1161,  115,  115, 1161,  941, 1161,  115,  115,  938,
+     1161,  940,  939,  115, 1161, 1161, 1161, 1161, 1161,  115,
+      115, 1161,  115,  115,  115,  115, 1161, 1161,  115, 1161,
+      115, 1161,  115,  942,  941, 1161, 1161,  115,  115,  940,
+     1161,  115, 1161, 1161,  115, 1161, 1161, 1161,  115, 1161,
+      115,  115, 1161,  115,  115,  943,  115, 1161,  115,  115,
+      115,  942,  944,  115, 1161,  115,  115, 1161, 1161, 1161,
+      115,  945,  115, 1161, 1161, 1161, 1161,  115, 1161,  115,
+      115,  115, 1161,  115,  943,  115,  115,  115,  115,  115,
+
+     1161,  944,  115, 1161,  115, 1161,  951, 1161,  115,  945,
+      952, 1161,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115, 1161, 1161,  115, 1161,  115, 1161, 1161,
+     1161, 1161,  115,  115,  951,  115,  115, 1161,  952, 1161,
+      115,  115,  115,  115,  953,  115, 1161,  115,  115, 1161,
+      115, 1161,  115,  115, 1161,  115, 1161,  115,  115,  115,
+      115,  115, 1161,  115,  115,  115, 1161, 1161, 1161, 1161,
+      115,  115,  956,  953, 1161, 1161,  955, 1161,  115,  115,
+     1161,  115,  115,  115,  115, 1161,  115,  115,  115, 1161,
+      115,  115, 1161,  115, 1161,  115,  115, 1161,  115,  115,
+
+      956,  957,  115, 1161,  955, 1161,  115,  115,  115,  115,
+      115,  115, 1161,  115, 1161,  958,  115, 1161, 1161,  115,
+      115,  115,  115,  962,  115,  115,  115,  115,  115,  957,
+      115,  115, 1161, 1161,  115, 1161,  115,  115,  115,  115,
+      115,  115,  115,  969,  958,  115, 1161, 1161,  115,  115,
+     1161,  115,  962,  115, 1161,  960,  115,  115,  115,  115,
+     1161, 1161,  115,  115,  115, 1161,  115,  963,  115,  115,
+      115,  115,  969, 1161, 1161, 1161, 1161,  115,  115, 1161,
+     1161,  115, 1161,  960,  970,  115, 1161, 1161,  115,  115,
+      115,  971, 1161,  115,  115,  115,  963, 1161, 1161, 1161,
+
+      115, 1161, 1161, 1161, 1161, 1161,  115,  211,  115, 1161,
+     1161, 1161,  970,  115, 1161, 1161,  115,  975,  115, 1161,
+      971,  115, 1161,  115,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  383, 1161,  115,  115,  115, 1161,  115,
+     1161, 1161,  115,  976,  115,  115,  975, 1161,  115, 1161,
+      115, 1161, 1161,  115, 1161, 1161,  115, 1161,  115, 1161,
+     1161, 1161, 1161,  115, 1161,  977,  115,  115,  115,  115,
+      115,  115,  976,  115,  115,  115, 1161,  115,  115, 1161,
+     1161, 1161,  115,  115,  115, 1161,  115, 1161,  115,  978,
+     1161,  979, 1161,  977, 1161,  115, 1161,  115,  115,  115,
+
+     1161,  115, 1161,  115,  115,  115,  115,  115, 1161,  983,
+      115, 1161,  115,  982, 1161, 1161,  115,  978, 1161,  979,
+      115,  115, 1161, 1161,  115,  115,  115,  115,  994,  992,
+      115,  985,  115,  115,  115,  115, 1161, 1161,  983,  115,
+      115,  982, 1161, 1161, 1161, 1161,  115,  115,  115, 1161,
+      115, 1161,  115, 1161, 1161,  115,  115,  994,  992,  115,
+      985,  115,  115,  993,  115,  115,  115, 1161,  115, 1161,
+      115,  115, 1161, 1161,  115,  115, 1161, 1161,  115, 1161,
+     1161, 1161,  115, 1161,  995,  115,  996,  115,  115, 1161,
+     1161,  115,  993,  115,  115,  115,  115, 1161, 1161,  115,
+
+      115,  115,  115, 1161,  997, 1161,  115,  115, 1161, 1161,
+      115,  115,  995,  115,  996, 1161,  115, 1161,  115, 1161,
+      115,  115,  115,  115, 1161,  115, 1161,  115, 1161,  115,
+     1161,  115,  997, 1161, 1161, 1161,  115,  115,  115,  115,
+     1161,  115, 1161,  115,  115, 1004, 1161,  115,  115,  115,
+     1161,  115,  115, 1006, 1161, 1161,  115, 1161,  115,  115,
+     1161, 1161,  115, 1161,  115,  115,  115, 1161,  115,  115,
+      115,  115,  115,  115, 1004,  115, 1161,  115,  115, 1161,
+     1161, 1006, 1161, 1161, 1161,  115,  115, 1007,  115,  115,
+      115, 1161,  115,  115, 1161,  115, 1009,  115, 1161,  115,
+
+      115, 1161, 1161,  115,  115, 1161,  115, 1161,  115,  115,
+     1161,  115, 1161,  115,  115, 1007, 1012,  115, 1161, 1161,
+     1161,  115,  115, 1161, 1161, 1009,  115, 1011,  115,  115,
+     1161, 1161,  115, 1161,  115,  115, 1161,  115,  115,  115,
+      115,  115, 1161,  115, 1012, 1020,  115, 1161,  115, 1019,
+      115, 1161,  115, 1161,  115, 1011,  115,  115,  115, 1161,
+      115,  115, 1161,  115,  115, 1161,  115, 1161,  115,  115,
+      115,  115, 1025,  115, 1020,  115,  115, 1019, 1161, 1161,
+      115,  115,  115, 1161,  115, 1161,  115,  115,  115,  115,
+      115, 1161, 1161,  115, 1161,  115, 1161,  115,  115,  115,
+
+     1025,  115,  115,  115,  115, 1026,  115, 1161,  115,  115,
+     1161, 1161,  115,  115, 1161,  115, 1161, 1161,  115, 1029,
+      115, 1161,  115,  115,  115, 1161, 1030,  115, 1161,  115,
+      115,  115, 1161,  115, 1026,  115, 1161, 1161,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1029,  115,  115,
+      115,  115, 1161,  115, 1161, 1030, 1038, 1161,  115, 1037,
+      115,  115, 1161,  115,  115, 1161,  115,  115, 1161, 1161,
+      115,  115,  115,  115,  115,  115, 1161, 1161,  115,  115,
+      115, 1161, 1161, 1161, 1038, 1161, 1039, 1037,  115, 1161,
+      115,  115,  115,  115, 1161,  115,  115,  115,  115, 1040,
+
+      115,  115,  115, 1161,  115,  115, 1044, 1161,  115,  115,
+     1161, 1161,  115, 1161, 1039, 1161,  115, 1161, 1161,  115,
+      115, 1161,  115,  115, 1161,  115,  115,  115, 1040,  115,
+     1161,  115, 1161,  115,  115, 1044, 1161,  115,  115,  115,
+      115, 1047,  115, 1161,  115, 1161, 1161,  115, 1161,  115,
+     1161,  115, 1161,  115,  115, 1161,  115, 1048,  115, 1161,
+      115, 1161, 1161, 1161,  115,  115,  115,  115, 1161,  115,
+     1047,  115,  115, 1161, 1161, 1054,  115, 1161, 1161,  115,
+     1059,  115,  115,  115,  115,  115, 1048,  115, 1161,  115,
+      115, 1161, 1161,  115,  115,  115, 1161,  115,  115, 1161,
+
+      115, 1161,  115, 1054,  115,  115, 1161,  115, 1062, 1059,
+      115,  115, 1161, 1161,  115, 1161,  115, 1161, 1161,  115,
+      115, 1161,  115,  115,  115,  115,  115,  115, 1063,  115,
+     1161,  115,  115, 1161, 1161, 1067, 1062, 1161, 1161,  115,
+     1161,  115, 1161,  115,  115, 1161, 1161,  115, 1161,  115,
+     1161,  115,  115,  115,  115, 1068,  115, 1063,  115,  115,
+     1161, 1161, 1161, 1067,  115, 1161,  115,  115,  115,  115,
+      115,  115, 1069,  115, 1073,  115,  115, 1161,  115, 1161,
+     1161,  115, 1161, 1161, 1068, 1161, 1161,  115,  115,  115,
+      115,  115, 1161,  115,  115,  115,  115,  115, 1161,  115,
+
+     1161, 1069,  115, 1073,  115, 1161,  115,  115, 1161,  115,
+     1080, 1161,  115, 1161, 1161,  115,  115,  115, 1161,  115,
+      115,  115, 1161,  115,  115,  115,  115, 1087,  115, 1161,
+     1161, 1161, 1161, 1161, 1088,  115,  115,  115, 1080,  115,
+     1161,  115,  115, 1161,  115,  115,  115, 1161,  115, 1161,
+      115,  115,  115,  115,  115, 1161, 1087,  115,  115, 1091,
+     1161, 1161, 1088,  115, 1161,  115, 1161,  115,  115,  115,
+      115,  115, 1095,  115,  115,  115,  115,  115, 1161, 1161,
+      115, 1161,  115, 1161, 1161, 1161,  115, 1091,  115, 1161,
+      115,  115, 1161,  115,  115,  115,  115, 1161,  115,  115,
+
+      115, 1095, 1106,  115, 1161,  115, 1161, 1161, 1161, 1161,
+      115, 1161, 1161,  115, 1105, 1161,  115,  115,  115, 1161,
+      115, 1108,  115,  115,  115,  115, 1161, 1161,  115,  115,
+     1161, 1106, 1161, 1161, 1161, 1161,  115, 1161,  115, 1161,
+      115,  115, 1105,  115, 1112,  115,  115,  115, 1161,  115,
+     1108,  115,  115,  115,  115, 1161, 1161, 1161,  115,  115,
+     1161, 1122, 1161, 1161,  115, 1161,  115, 1161,  115,  115,
+     1161,  115, 1112, 1161,  115, 1161,  115, 1161,  115, 1161,
+     1161,  115, 1161,  115, 1161, 1161, 1161,  115, 1161, 1122,
+     1161, 1161, 1161, 1161,  115, 1161,  115, 1124,  948, 1124,
+
+     1161, 1161, 1125, 1125, 1161, 1125, 1161, 1161, 1161, 1125,
+     1125, 1161, 1161, 1125, 1161, 1161, 1125, 1125, 1125, 1125,
+     1125, 1125, 1125, 1125, 1125,  115,  115, 1161, 1161, 1161,
+      115,  115, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1133,
+     1161, 1161, 1128, 1161,  115,  115, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161, 1161, 1161, 1161, 1161, 1161, 1133, 1161, 1161,
+     1128, 1161,  115,  115,  947,  948,  947, 1161, 1161, 1134,
+     1134, 1161, 1135, 1161,  115,  950, 1134, 1134, 1137,  115,
+     1134, 1161, 1161, 1134, 1134, 1134, 1134, 1134, 1134, 1134,
+
+     1134, 1134, 1161,  115,  115,  115, 1161, 1161, 1161,  115,
+      115, 1161, 1161,  115, 1161, 1161, 1161, 1137,  115, 1161,
+     1161, 1161, 1161,  115,  115, 1161, 1161, 1161, 1161, 1161,
+     1161,  115, 1161,  115,  115, 1161, 1161, 1161,  115,  115,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161,  115,  115,   64,   64,   64,   64,   64,   64,   64,
+       64,   64,   64,   64,   64,   65,   65,   65,   65,   65,
+       65,   65,   65,   65,   65,   65,   65,   81,   81, 1161,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   84,
+       84, 1161,   84,   84,   84,   84,   84,   84,   84,   84,
+
+       84,   88,   88,   88,   88,   88,   88,   88,   88,   88,
+       88,   88,   88,   92,   92,   92,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,  111,  111,  115,  115,  115,
+      115,  115,  115,  115,  115,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  209,
+      209,  209,  209,  209,  209, 1161,  209,  209,  209, 1161,
+      209,  232,  232,  232,  232,  232,  232,  232,  232,  232,
+      232,  232,  232,  101, 1161, 1161,  101,  252,  252,  252,
+     1161, 1161,  252, 1161,  252,  252, 1161,  252,  252,  343,
+
+      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
+      343,  358,  358, 1161,  358,  358,  358,  358,  358,  358,
+      358,  358,  358,  371,  371,  371,  371,  371,  371, 1161,
+      371,  371,  371, 1161,  371,  374,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  379,  379,  379,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  422,
+     1161, 1161,  422,  276, 1161, 1161, 1161,  276, 1161, 1161,
+     1161, 1161, 1161,  276,  558,  558,  558,  558,  558,  558,
+      558,  558,  558,  558,  558,  558,  718,  718, 1161,  718,
+      718,  718,  718,  718,  718,  718,  718,  718,  721,  721,
+
+     1161,  721,  721,  721,  721,  721,  721,  721,  721,  721,
+      723,  723, 1161,  723,  723,  723,  723,  723,  723,  723,
+      723,  723,   88,   88,   88,   88,   88,   88,   88,   88,
+       88,   88,   88,   88,  726,  726,  726,  726,  726,  726,
+      726,  726,  726,  726,  726,  726,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,   92,   92,   92,  728,  728,
+      728,  728,  728,  728,  728,  728,  728,  728,  728,  728,
+      812,  812,  812,  812,  812,  812,  812,  812,  812,  812,
+      812,  812,  814,  814, 1161,  814,  814,  814,  814,  814,
+      814,  814,  814,  814,  823,  823,  823,  823,  823,  823,
+
+      823,  823,  823,  823,  823,  823,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  831,  831,
+     1161,  831,  831,  831,  831,  831,  831,  831,  831,  831,
+      834,  834, 1161,  834,  834,  834,  834,  834,  834,  834,
+      834,  834,   81,   81, 1161,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,  835,  835, 1161,  835,  835,  835,
+      835,  835,  835,  835,  835,  835,   84,   84, 1161,   84,
+       84,   84,   84,   84,   84,   84,   84,   84,  837,  837,
+      837,  837,  837,  837,  837,  837,  837,  837,  837,  837,
+       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
+
+       88,   88,  838,  838,  838,  838,  838,  838,  838,  838,
+      838,  838,  838,  838,   92,   92,   92,   92,   92,   92,
+       92,   92,   92,   92,   92,   92,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  904,  904,
+      904,  904,  904,  904,  904,  904,  904,  904,  904,  904,
+      358,  358, 1161,  358,  358,  358,  358,  358,  358,  358,
+      358,  358,  814,  814, 1161,  814,  814,  814,  814,  814,
+      814,  814,  814,  814,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  912,  912,  912,  912,
+      912,  912,  912,  912,  912,  912,  912,  912,  374,  374,
+
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      379,  379,  379,  379,  379,  379,  379,  379,  379,  379,
+      379,  379,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  946,  946,  946,  946,  946,  946,
+      946,  946,  946,  946,  946,  946,  999,  999,  999,  999,
+      999,  999,  999,  999,  999,  999,  999,  999,   13, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161
     } ;
 
-static yyconst short int yy_chk[4253] =
+static yyconst flex_int16_t yy_chk[9249] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -1221,470 +1871,1022 @@
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    2,    2,    2,    2,    8,   10,    8,
-       15,   16,   15,   16,   22,   17,   14,   17,   18,   25,
-       19,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-       14,   20,   18,   10,   21,   23,   24,   26,   29,   28,
-
-        2,    2,   23,   23,    2,   20,   30,   25,   21,   31,
-       15,   26,   33,   22,  986,   17,   19,    2,    2,   24,
-       30,   25,   29,   31,   15,  172,   33,   22,   28,   17,
-       19,   32,  172,   24,   23,   53,   29,   53,   80,   70,
-       32,   70,   28,   40,   36,   36,   36,   40,   23,   27,
-       40,   27,   79,   40,   32,   36,   57,   40,   84,   40,
-       65,  986,   36,   36,   71,   65,   71,   27,   27,   27,
-       27,   27,   27,   27,   27,   27,   72,   41,   72, 1121,
-       73,   41,   73,   79,   27,   57,   80,   41,   27,   27,
-       27,   41,   42,   42,   83,   27,   42,   27,   27,   57,
-
-       42,   42,   42,   27,  207,  118,   42,   27,   34,   84,
-       34,   34,   34,   34,   34,   34,   34,   34,   34,   37,
-       37,   37,  118,   94,   94,   43,   37,  180,   83,   43,
-       37,  119,   34,   37,   85,   43,   94,   37,   37,   43,
-      207,   85,   85,   37,   97,  119,   34,   35,  119,   35,
-       35,   35,   35,   35,   35,   35,   35,   35,   98,   97,
-       48,  180,   38,   38,   48,   38,   99,   35,   35,   38,
-       48,   35,   38,   98,   48,   38,   99,   35,  117,   38,
-       38,   39,   39, 1115,   35,   35,   44,  208,  205,  117,
-       44,   39,  234,   39,   44,  117,   39,   39,   39,   39,
-
-       44,   45,   46,   39,   44,   45,   46,  205,  208,   45,
-       61,   46,   46,   46,   61,   45,   46,   47,   46,   45,
-       61,   47,   49,   55,   61,   47,   49,  234,   55,  181,
-       49,   47,   50,  158,   47,   47,   49,   47,   49,   50,
-       49,   49,   49,   50,   51,  194,   50,  158,  122,   50,
-       59,   51,  169,   56,   59,   51,   50,   59,   51,   56,
-       59,   51,   55,  181,   59,  122,  169,   56,   51,   52,
-     1152,   52,   52,   60, 1152,  104,   55,   52,   87,  194,
-       60,   66,   66,   66,   60,   87,   87,   60, 1100,  229,
-       60,   56,  168,   66,   86,   86,   86,   60,  168,  104,
-
-      217,  129,   86,   86,   89,   56,   52,   52,   90,   52,
-       52,   89,   89,  104,  126,   90,   90,  116,  129,  116,
-      121,   66,  121,   52,   52,   54,   54,   54,   54,  229,
-      177,  126,  126,   54,  116,   66,  177,  121,   89,  127,
-      120,  540,  127,   54,   54,   54,   54,   54,   54,   54,
-       54,   54,  120,  120,  217, 1096,  127,  120,  120,   90,
-      133,  137,   54,   54,  540,   54,   54,  106,  106,  106,
-      106,  106,  106,  106,  106,  106,  137,  133,  137,   54,
-       54,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-       67,   67,   67,   67,   93,  182,   93,  108,  108,  107,
-      109,  108,  214,  123,  109,  109,  377,  108,  109,  338,
-      125,  108,  108,  378,  109,  123,  200, 1093,  109,  109,
-      123,  125,  107,  107,  111,  111,  107,  125,  111,   93,
-      128,  132,  107,   93,  111,   93,  107,  107,  111,  111,
-       93,  377,   93,   93,  214,  132,  182,  128,  132,  338,
-
-      128,  134,   93,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  110,  110,  134,  378,  110,  200,  134,  216,
-      152,  152,  110,  103,  103,  110,  110,  110,  112,  112,
-      113,  113,  112,  131,  113,  183,  103,  152,  112,  143,
-      113,  183,  112,  112,  131,  114,  114,  113,  113,  114,
-      131,  143,  135,  115,  135,  114,  143,  115,  115,  114,
-      114,  115,  139,  184,  216,  520,  130,  115,  139,  184,
-      115,  115,  115,  124,  130,  124,  368,  184,  206,  139,
-      136,  130,  136,  130,  140,  130,  138,  135,  138,  124,
-      136,  124,  124,  124,  124,  124,  124,  124,  124,  124,
-
-      138,  140,  138,  138,  135,  138,  135,  140,  141,  142,
-      144,  206,  142,  368,  367,  136,  145,  520,  336,  157,
-      146,  141,  148,  144,  336,  141,  142,  144,  124,  145,
-      124,  146,  136,  145,  147,  149,  157,  146,  147,  148,
-      150,  148,  151,  153,  367,  153,  154,  155,  150, 1091,
-      151,  147,  149,  147,  263,  149,  151,  150,  155,  151,
-      153,  153,  153,  154,  155,  153,  156,  154,  159,  159,
-      161,  160,  156,  162,  161,  196,  196,  196,  163,  156,
-      159,  162,  163,  156,  160,  159,  164,  161,  160,  165,
-      162,  165,  165,  263,  164,  163,  166,  165,  166,  166,
-
-      189,  186,  352,  164,  166,  185,  188,  185,  174,  215,
-      174,  174,  186,  211,  189,  211,  174,  189,  186,  186,
-      548,  190,  199,  188,  191,  188,  165,  165,  191,  225,
-      165,  225,  369,  166,  166,  187,  190,  166,  190,  340,
-      185,  191,  352,  165,  165,  174,  174,  187,  187,  174,
-      166,  166,  187,  187,  185,  548,  199,  201,  201,  201,
-      215,  218,  174,  174,  176,  176,  176,  176,  218,  218,
-      221,  369,  176,  224,  226,  357,  226,  221,  221, 1086,
-      224,  224,  176,  176,  176,  176,  176,  176,  176,  176,
-      176,  223,  201,  340, 1084,  219,  219,  219,  223,  223,
-
-      245,  176,  176,  219,  219,  176,  201,  220,  220,  220,
-      227,  245,  227,  239,  239,  220,  220,  245,  176,  176,
-      202,  240,  241,  240,  241,  337,  239,  224,  242,  357,
-      242,  337,  343,  373,  343,  373,  223,  202,  202,  202,
-      202,  202,  202,  202,  202,  202,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  246,
-      247,  249,  517,  248,  280,  370,  280,  252,  517,  250,
-      251, 1080,  254,  255,  280,  249,  246,  252,  249,  246,
-      248,  248,  250,  251,  252,  247,  250,  251,  253,  254,
-      255,  255,  256,  257,  258,  370,  261,  259, 1078,  253,
-      261,  258,  247,  266,  256,  253,  260,  256,  259,  256,
-      257,  258,  257,  261,  259,  264,  264,  260,  265,  269,
-      266,  272,  267,  260,  275,  265,  267,  269,  271,  270,
-      541,  270,  264,  273, 1074,  265,  269,  273,  272,  267,
-      268,  275,  268,  276,  274,  271,  271,  271,  274,  277,
-
-      273,  277,  278,  541,  278,  276,  282,  279, 1070,  270,
-      276,  274,  297, 1069,  270,  283,  277,  282,  284,  285,
-      268,  279,  339,  282,  279,  268,  283, 1066,  268,  297,
-      268,  270,  283,  268,  361,  284,  285,  268,  284,  285,
-      268,  286,  268,  268,  268,  286,  287,  268,  290,  288,
-      289,  288,  289,  291,  287,  292,  278,  291,  286,  288,
-      289,  298,  293,  287,  294,  290,  293,  339,  290,  295,
-      291, 1063,  292,  299,  292,  296,  300,  316,  298,  293,
-      361,  294,  295,  296,  288,  289,  295,  301,  294,  300,
-      299,  299,  296,  300,  316,  288,  289,  302,  303,  305,
-
-      301,  288,  289,  302,  301,  288,  289,  304,  301,  303,
-      304,  306,  307,  308,  302,  303,  305, 1061,  304,  305,
-      311,  308,  309,  310,  304,  313,  309,  310,  306,  307,
-      308,  306,  307,  311,  312,  314,  376,  311,  315,  309,
-      310,  312,  313,  318,  313,  320,  317,  321,  317,  322,
-      318,  312,  314,  315,  314,  315,  317,  319,  320,  321,
-      318,  323,  320,  319,  321,  324,  322,  324,  324,  341,
-      356,  347,  346,  324,  319,  341,  346,  351,  323,  348,
-      323,  317, 1048,  341,  325,  376,  325,  325,  347,  346,
-      347,  327,  325,  327,  327, 1056,  348,  360,  317,  327,
-
-      349,  349,  324,  324,  379,  519,  324,  350,  531,  414,
-      351,  350,  354,  354,  354,  356,  408,  349,  408,  324,
-      324,  325,  325,  380,  350,  325,  414,  351,  327,  327,
-      380,  380,  327,  359,  359,  359, 1048,  360,  325,  325,
-      411,  410,  379,  410,  381,  327,  327,  335,  335,  335,
-      335,  381,  381,  382, 1055,  335,  519,  411,  411,  531,
-      382,  382,  445, 1051,  445,  335,  335,  335,  335,  335,
-      335,  335,  335,  335,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  518,  335,  335,  401,  401,  335,  518,
-      542,  382,  445,  545, 1050,  545,  381,  416,  415,  401,
-
-      415,  335,  335,  362,  384,  384,  384,  384,  384,  384,
-      384,  384,  384,  542,  416,  415,  521,  652, 1049,  652,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  385,
-      385,  385,  385,  385,  385,  385,  385,  385,  417,  418,
-      532,  362,  363,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  656,  533,  521,  417,  418,  418,  656,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  419,  420,  422,
-      363,  366,  388,  388,  388,  388,  388,  388,  388,  388,
-      388,  533,  532,  422,  419,  420,  422, 1044,  366,  366,
-
-      366,  366,  366,  366,  366,  366,  366,  402,  402,  402,
-      402,  402,  402,  402,  402,  402,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  404,  404,  404,  404,  404,
-      404,  404,  404,  404,  405,  405,  405,  405,  405,  405,
-      405,  405,  405,  406,  406,  406,  406,  406,  406,  406,
-      406,  406,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  412,  421,  423,  424,  412,  421,  425,  535,  426,
-      428,  427,  424,  426,  423,  432, 1042,  436,  412,  421,
-      423,  424,  427,  428,  425,  430,  426,  428,  427,  431,
-      437,  436,  432,  432,  436, 1022,  430,  431,  433,  438,
-
-      433,  439,  430,  440,  438,  441,  431,  437,  539,  441,
-      437,  442,  438,  444,  443,  439,  438,  535,  439,  447,
-      440,  443,  441,  449,  450,  441,  450,  451,  442,  584,
-      444,  443,  452,  433,  444,  442,  447,  584,  447,  780,
-      449,  433, 1022,  453,  451,  539,  451,  455,  457,  452,
-      433,  657,  458,  456,  450,  433,  434,  657,  434,  450,
-      453,  456,  453,  587,  455,  457,  459,  460,  457,  458,
-      456,  458, 1040,  460,  459,  462,  450,  462,  780,  587,
-      460,  461, 1038,  459,  460,  463,  434,  463,  465,  461,
-      466,  467,  462,  467,  434,  463,  434, 1031,  461,  434,
-
-     1029,  467,  465,  434,  553,  465,  434,  466,  470,  434,
-      434,  553,  553,  434,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  470,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
-      448,  448,  448,  448,  448,  448,  448,  469,  471,  472,
-      473,  474,  475,  476,  663, 1028,  663,  477, 1025,  471,
-      472,  469,  480,  478,  469,  471,  472,  473,  474,  475,
-
-      476,  477,  479,  481,  477,  478,  479,  482,  483,  480,
-      478,  480,  485,  484,  486,  487,  488,  489,  490,  479,
-      481,  484,  481,  491,  482,  483,  492,  488,  492,  485,
-      484,  490,  487,  488,  489,  490,  493,  486,  494,  495,
-      491,  496,  497,  492,  501,  503,  498,  499,  502,  499,
-      504,  534,  502,  493,  486,  494,  658,  499,  496,  497,
-      498,  501,  503,  498,  495,  502,  505,  504,  506, 1024,
-      505,  507,  506,  507,  507,  528,  522,  550, 1018,  507,
-      563,  495,  522,  505,  563,  506,  508,  682,  508,  508,
-      522, 1017,  528,  509,  508,  509,  509,  563,  658,  526,
-
-      565,  509,  534,  527,  525,  527,  525,  526,  507,  507,
-      682,  668,  507,  668,  525,  550,  526,  565,  566,  568,
-      567,  552,  567,  508,  508,  507,  507,  508,  552,  552,
-      509,  509, 1015,  566,  509,  566,  568,  567,  527,  525,
-      508,  508,  525, 1012,  529,  572,  529,  509,  509,  516,
-      516,  516,  516, 1021,  529,  527,  525,  516,  529,  552,
-      570,  789,  572,  569,  570,  571,  574,  516,  516,  516,
-      516,  516,  516,  516,  516,  516,  569,  570,  571,  529,
-      569,  573,  571,  574,  574,  576,  516,  516, 1021,  576,
-      516,  607,  785,  607,  785,  573,  529, 1011,  573,  590,
-
-      789,  592,  576,  516,  516,  536,  559,  559,  559,  559,
-      559,  559,  559,  559,  559, 1009,  590,  536,  592,  536,
-      982,  607,  536,  536,  536,  536,  536,  536,  536,  536,
-      536,  537,  560,  560,  560,  560,  560,  560,  560,  560,
-      560, 1001,  659,  677,  677,  677,  999,  997,  537,  537,
-      537,  537,  537,  537,  537,  537,  537,  561,  561,  561,
-      561,  561,  561,  561,  561,  561,  593,  996,  982,  537,
-      538,  562,  562,  562,  562,  562,  562,  562,  562,  562,
-      659,  580,  538,  593,  538,  593,  580,  538,  538,  538,
-      538,  538,  538,  538,  538,  538,  564,  564,  580,  564,
-
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  564,  564,  564,  564,  564,  564,  577,
-      578,  579,  581,  579,  596,  591,  595,  578,  594,  581,
-      577,  594,  597,  597,  600,  596,  577,  578,  591,  581,
-      595,  596,  591,  595,  598,  594,  599,  992,  991,  597,
-      599,  600,  601, 1153,  601,  604,  673, 1153,  605,  598,
-
-      609,  598,  610,  599,  579,  603,  603,  603,  603,  603,
-      603,  603,  603,  603,  604,  605,  606,  609,  579,  610,
-      611,  610,  601,  613,  615,  613,  616,  601,  611,  606,
-      617,  604,  614,  606,  617,  614,  618,  611,  673,  620,
-      613,  615,  621,  616,  601,  619,  622,  617,  622,  614,
-      619,  676,  620,  618,  623,  618,  620,  625,  624,  621,
-      624,  627,  619,  622,  628,  623,  626,  630,  625,  627,
-      626,  623,  629,  632,  625,  624,  629,  628,  627,  633,
-      634,  628,  631,  626,  630,  635,  631,  635,  637,  629,
-      632,  638,  640,  676,  639,  640,  633,  634,  633,  631,
-
-      641,  643,  635,  644,  984,  637,  637,  639,  638,  640,
-      638,  639,  645,  646,  650,  792,  650,  641,  643,  641,
-      644,  643,  644,  647,  650,  647,  647,  661,  983,  645,
-      646,  647,  648,  661,  648,  648,  664,  654,  664,  654,
-      648,  661,  649,  674,  649,  649,  664,  654,  667,  666,
-      649,  654,  650,  666,  792,  696,  667,  794,  794,  794,
-      647,  647,  696,  696,  647,  667,  666,  704,  697,  648,
-      648,  669,  703,  648,  664,  697,  697,  647,  647,  649,
-      649,  674,  669,  649,  704,  938,  648,  648,  669,  980,
-      672,  703,  672,  670,  977,  670,  649,  649,  655,  655,
-
-      655,  655,  698,  670,  672,  705,  655,  670,  703,  698,
-      698,  702,  702,  702,  702,  702,  702,  702,  702,  702,
-      706,  707,  705,  938,  705,  708,  709,  710,  711,  716,
-      711,  719,  714,  712,  714,  655,  655,  706,  707,  655,
-      707,  712,  708,  709,  710,  711,  716,  710,  719,  709,
-      712,  715,  655,  655,  678,  715,  740,  975,  740,  819,
-      870,  819,  870,  876,  736,  876,  720,  714,  715,  714,
-      720,  678,  678,  678,  678,  678,  678,  678,  678,  678,
-      679,  736,  714,  720,  714,  915,  740,  915,  972,  956,
-      731,  732,  731,  733,  738,  732,  819,  679,  679,  679,
-
-      679,  679,  679,  679,  679,  679,  680,  731,  732,  819,
-      733,  738,  871,  733,  955,  954,  734,  735,  742,  748,
-      749,  735,  734,  680,  680,  680,  680,  680,  680,  680,
-      680,  680,  681,  734,  735,  742,  748,  749,  765,  805,
-      765,  935,  965,  935,  965,  871,  805,  805,  765,  681,
-      681,  681,  681,  681,  681,  681,  681,  681,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  684,  684,  684,  684,  684,  684,  684,  684,  684,
-      684,  688,  688,  806,  688, 1007,  953, 1007,  688,  688,
-      806,  806,  688,  952,  951,  688,  688,  688,  688,  688,
-      688,  688,  688,  701,  701,  949,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-
-      701,  701,  701,  701,  701,  701,  737,  739,  744,  743,
-      737,  743,  745,  746,  750, 1111,  751,  746,  739,  743,
-      745,  753,  744,  737,  739,  744,  752,  946,  747,  745,
-      746,  750,  747,  751,  751,  754,  755,  752,  753,  756,
-      757,  758,  757,  752,  743,  747,  759,  760,  761, 1111,
-      762,  764,  754,  755,  762,  767,  756,  763,  758,  758,
-      768,  743,  766,  759,  760,  761,  760,  762,  764,  763,
-      766,  769,  767, 1068,  763,  757,  770,  768,  770,  766,
-      771,  772,  773,  810,  773,  773,  786,  934,  769,  814,
-      757,  786,  757,  774,  945,  774,  774,  771,  772,  771,
-
-      810,  774,  775,  786,  775,  775,  814,  788,  787,  788,
-      809,  770,  865,  770,  865,  812,  816,  812,  811,  773,
-      773,  787,  811,  773,  934,  787, 1068,  821,  770,  809,
-      774,  774,  812,  816,  774,  811,  773,  773,  817,  775,
-      775,  813,  788,  775,  821,  813,  809,  774,  774,  865,
-      933, 1036,  817, 1036,  932,  817,  775,  775,  813,  788,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
-      795,  795,  795,  796,  808,  808,  808,  808,  808,  808,
-      808,  808,  808,  815,  822,  820,  825,  815,  834,  835,
-      796,  796,  796,  796,  796,  796,  796,  796,  796,  820,
-      815,  822,  820,  825,  836,  834,  835,  834,  837,  838,
-      839,  838,  840,  841,  842,  836,  929,  841,  842,  927,
-      922,  836,  843,  846,  839,  837,  838,  839,  845,  840,
-      841,  842,  844,  843,  844,  845,  846,  847,  845,  843,
-      846,  848,  844,  849,  850,  851,  853,  851,  854,  852,
-
-      854,  855,  856,  857,  847,  858,  847,  852,  848,  858,
-      849,  850,  851,  853,  857,  859,  852,  860,  855,  856,
-      857,  856,  858,  861,  864,  862,  866,  862,  877,  867,
-      874,  879,  859,  875,  860,  862,  884,  867,  883,  883,
-      861,  864,  886,  866,  904,  864,  867,  874,  854,  887,
-      875,  875,  885,  884,  888,  883,  885,  889,  894,  886,
-      893,  877,  894,  896,  879,  880,  887,  896, 1020,  885,
-      889,  888,  893,  888,  889,  894,  906,  893,  908,  902,
-      896,  906,  880,  880,  880,  880,  880,  880,  880,  880,
-      880,  905,  907,  906,  909,  908,  907,  910,  911,  905,
-
-      914,  913, 1043,  912, 1081, 1020,  918,  914,  905,  907,
-      914,  909,  916,  909,  910,  911,  912,  910,  913,  916,
-      912,  917,  916,  918,  919,  920,  923,  924,  917,  920,
-      921,  917,  921,  925,  926,  928,  930,  939,  937,  928,
-      923,  919,  920,  923,  924,  931,  936,  921,  940, 1043,
-      925,  926,  928,  930,  930,  937,  941, 1081,  931,  940,
-      942,  944,  931,  936,  943,  940,  936,  947,  943,  948,
-      950,  948,  901,  941,  939,  958,  939,  942,  944,  959,
-      960,  943,  947,  961,  947,  962,  948,  950,  963,  958,
-      988,  964,  958,  964,  966,  961,  959,  960,  970,  987,
-
-      961,  966,  962,  900,  966,  963,  968,  963,  964,  967,
-      967,  967,  969,  968,  971,  970,  968,  967,  974,  969,
-      967,  973,  969,  973,  976,  978,  979,  990,  985,  978,
-      979,  971,  988, 1004,  899,  974,  989,  987,  973,  985,
-      989,  976,  978,  979,  990,  985,  993,  994, 1002, 1003,
-     1004, 1003, 1005,  989, 1006,  994, 1016,  993, 1006, 1013,
-     1005, 1002,  898,  993,  994, 1002, 1003, 1014, 1019, 1005,
-      897, 1006, 1008, 1008, 1008, 1010, 1013, 1023, 1026, 1010,
-     1008, 1027, 1026, 1008, 1014, 1019, 1032, 1019, 1034, 1016,
-     1035, 1046, 1010, 1033, 1023, 1026, 1047, 1033, 1027, 1027,
-
-     1057, 1034, 1065, 1032, 1052, 1034, 1039, 1035, 1046, 1039,
-     1033, 1037, 1037, 1037, 1058, 1067, 1053, 1057, 1058, 1037,
-     1062, 1052, 1037, 1039, 1053,  895, 1059, 1052, 1059, 1047,
-     1071, 1058, 1072, 1053, 1060, 1060, 1060, 1062, 1075, 1083,
-     1062, 1079, 1060, 1103, 1089, 1060, 1072, 1071, 1087, 1072,
-     1065, 1089, 1067, 1109, 1089, 1075, 1076, 1076, 1079, 1076,
-     1094, 1087,  892, 1076, 1076, 1087, 1095, 1076, 1107, 1110,
-     1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1077, 1077,
-     1077, 1092, 1104, 1108, 1113, 1092, 1077, 1083, 1114, 1077,
-     1090, 1109, 1112, 1094, 1090, 1090, 1103, 1090, 1092, 1095,
-
-     1090, 1090, 1090, 1097, 1101, 1090, 1116, 1118, 1090, 1090,
-     1090, 1090, 1090, 1090, 1090, 1090, 1098, 1099, 1119, 1107,
-     1097, 1101, 1110, 1098, 1099, 1112, 1098, 1099, 1120, 1104,
-     1145, 1108, 1145, 1146, 1147, 1146, 1147, 1113, 1149,  891,
-     1149, 1114, 1150,  882, 1150, 1118, 1151, 1157, 1151, 1157,
-      878, 1158, 1119, 1158,  873,  872,  869, 1116,  868,  863,
-      833,  832,  831,  830,  829,  828,  827,  826,  824,  818,
-      804,  802,  798,  793,  791,  790,  783,  782,  781,  778,
-      777, 1120, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
-     1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1125,
-
-     1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
-     1125, 1125, 1125, 1125, 1125, 1125, 1126, 1126,  776, 1126,
-     1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
-     1126, 1126, 1126, 1127, 1127,  730, 1127, 1127, 1127, 1127,
-     1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127,
-     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128,
-     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1129, 1129, 1129,
-     1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
-     1129, 1129, 1129, 1129, 1130, 1130,  729,  728,  727,  726,
-     1130, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-
-     1131, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
-     1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133,  725,
-     1133,  724, 1133, 1133,  722,  718,  717,  713, 1133, 1134,
-     1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134,
-     1134, 1134, 1134, 1134, 1134, 1134, 1135, 1135, 1135, 1135,
-     1135, 1135, 1135, 1135, 1135, 1135,  695, 1135, 1135, 1135,
-     1135,  694, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1136,
-     1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136,
-     1137,  692,  691, 1137, 1137, 1138, 1138, 1138, 1138,  685,
-     1138, 1138,  683, 1138, 1138,  675, 1138, 1138,  662,  660,
-
-     1138, 1138, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139,
-     1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1140,
-      653, 1140,  651,  636, 1140, 1141,  589, 1141,  588, 1141,
-     1141, 1142, 1142,  586, 1142, 1142, 1142, 1142, 1142, 1142,
-     1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1143, 1143,
-     1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143,
-     1143, 1143, 1143, 1143, 1143, 1144, 1144, 1144, 1144, 1144,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144,
-     1144, 1144, 1148,  585,  583, 1148, 1148, 1154,  582, 1154,
-      575,  556,  551,  549, 1154,  546,  543,  530,  524,  523,
-
-      515,  514, 1154, 1155,  513, 1155,  512,  511, 1155, 1156,
-      510, 1156,  454, 1156, 1156, 1159,  429, 1159,  409,  400,
-     1159, 1160,  398, 1160,  397, 1160, 1160, 1161, 1161,  391,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
+        2,    2,    2,   10,    8,    8,    8,    8,   15,   15,
+
+       15,   68, 1129,   14,   10, 1119,   68,    2,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,   14,   16,   16,
+       16,   54,   54,   54,    2,    2,   18,   10,    2,   19,
+        2,    8,   14,   17,   17,   17,   15,   20,   21, 1096,
+       18,    2,    2,  176,   22,   14, 1084,   25,   26,  176,
+       15,   20,   21,    2,    2,   18,   10,    2,   75,    2,
+        8,   25,   42,   19,   69,   15,   20,   21,   18,    2,
+        2,   17,   24,   27,   26,   23,   25,   19,   15,   20,
+       21,   22,   23,   23,   29,   17,   75,   27,   26,   25,
+     1045,   42,   19,   24,  959,   22,   30,  339,   74,  339,
+
+       17,   82,   27,   26,  340,   19,  340,   24,   83,   69,
+       22,   29,   23,   17,   31,   27,   26,   32,   30,   34,
+       41,  178,   24,   22,  916,   29,   23,   74,   31,  912,
+       82,   32,   30,   34,   41,   24,   83,   69,   49,  685,
+       29,   23,   49,   31,  905,  685,   32,   30,   34,   41,
+      178,  207,   33,   29,   23,   28,   31,   28,   33,   32,
+       30,   34,   41,   76,   76,   76,  242,   49,   67,   67,
+       67,   49,   33,   28,   28,   28,   28,   28,   28,   28,
+       28,   28,   28,   86,   43,   63,  207,   33,   28,   43,
+       44,  350,   28,   28,   28,  242,   43,   43,  904,   28,
+
+       33,   28,   28,   63,   44,   67,   91,   28,   77,   77,
+       77,   28,   86,   43,   63,  207,  837,   28,   43,   44,
+      350,   28,   28,   28,   43,   43,   87,   28,  360,   28,
+       28,   63,   44,  835,   67,   28,   78,   78,   78,   28,
+       35,   86,   35,   35,   35,   35,   35,   35,   35,   35,
+       35,   35,   38,   40,  830,   91,   38,  360,   35,   35,
+       38,   40,   35,  903,   40,  102,   38,   40,   35,  103,
+       38,  107,   87,   40,   90,   35,   35,   79,   79,   79,
+      825,   38,   40,   91,  342,   38,  342,   35,   35,   38,
+       40,   35,   40,  102,   38,   40,   35,  103,   38,  107,
+
+       87,   40,  108,   35,   35,   36,   90,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,  179,   37,  359,
+       39,  359,   36,  903,  823,   37,   45,   36,  822,   37,
+      108,   39,   37,   39,   45,   90,   39,   39,   46,  205,
+       45,   36,   37,   39,  812,  179,   46,   37,  393,   39,
+      180,   36,   46,  182,   37,   45,   36,   37,   46,   39,
+       37,   39,   48,   45,   39,   39,   51,   46,   45,   36,
+       37,   39,   47,   51,  811,   46,   48,  393,  180,   48,
+       46,  182,   48,   51,  205,   47,   46,   47,  104,   50,
+      220,   48,   47,   50,  529,   51,  529,   50,  396,   52,
+
+      450,   47,   51,  104,   48,   50,   52,   48,   50,   50,
+       48,   51,  205,   47,  532,   47,   52,  104,   50,  804,
+       47,  220,   50,   80,   80,   80,   50,  396,   52,  450,
+      530,  104,  530,   50,   92,   52,   50,   50,   55,   55,
+       55,   92,   92,  532,   52,   53,   53,   53,   53,  220,
+       56,  223,  531,   53,  531,   56,   55,   55,   55,   55,
+       55,   55,   55,   55,   55,   55,  184,  184,  184,   94,
+       70,   70,   70,   71,   71,   71,   94,   94,   60,  223,
+       53,   53,   70,   53,   53,   71,   53,   56,  726,   60,
+      106,  191,   60,  686,   93,   93,   93,   53,   53,  686,
+
+      106,   56,   93,   93,  181,   70,  725,   60,   71,   53,
+       53,  181,   53,   53,  723,   53,   56,   60,  722,  106,
+       60,   72,   72,   72,  910,   53,   53,  214,  106,   56,
+       57,   58,  181,   72,   70,   96,   57,   71,  222,  181,
+      191,  716,   96,   96,   57,  189,   57,   57,   57,   57,
+       57,   57,   57,   57,   57,   57,   59,  222,   58,   72,
+       59,  208,  208,  208,   59,   58,   57,   96,  191,   58,
+       59,  190,   58,   72,   59,  714,  214,  189,   61,  206,
+       57,  706,   58,   61,  910,   59,  222,   58,   72,   59,
+       61,   61,   62,   59,   58,   57,   96,   58,   59,   62,
+
+       58,   72,   59,  190,  214,  224,  189,   61,   57,   62,
+       58,  206,   61,  210,  210,  210,   62,  689,   61,   61,
+      664,   62,  225,  225,  225,  585,  580,  232,   62,  578,
+      558,  235,  190,  224,  232,  232,  554,   62,  235,  235,
+      206,  372,  372,  372,   62,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
+       73,   73,   73,   73,   97,  101,  101,  105,  204,  204,
+      204,   97,   97,  226,  538,  227,  213,  675,  101,  675,
+      534,  111,  105,  111,  111,  111,  111,  111,  111,  111,
+      111,  111,  111,  421,  101,  101,  105,  375,  375,  375,
+      419,  226,  173,  227,  173,  204,  101,  114,  213,  534,
+      105,  219,  412,   97,  113,  113,  113,  113,  113,  113,
+      113,  113,  113,  113,  114,  228,  115,  118,  219,  114,
+
+      116,  115,  118,  125,  204,  116,  410,  213,  125,  231,
+      173,   97,  100,  114,  100,  115,  118,  229,  116,  116,
+      386,  221,  125,  114,  173,  115,  118,  219,  114,  116,
+      115,  118,  125,  379,  116,  228,  249,  125,  230,  173,
+      374,  114,  251,  115,  118,  100,  116,  116,  117,  100,
+      125,  100,  173,  117,  243,  221,  100,  276,  100,  100,
+      248,  231,  117,  228,  249,  401,  229,  117,  100,  294,
+      251,  294,  401,  401,  100,  371,  343,  117,  100,  294,
+      100,  230,  117,  221,  100,  276,  100,  100,  535,  231,
+      117,  250,  243,  248,  229,  117,  100,  110,  110,  110,
+
+      110,  110,  110,  110,  110,  110,  110,  119,  121,  230,
+      913,  247,  119,  121,  120,  110,  110,  535,  119,  120,
+      243,  248,  120,  246,  400,  121,  119,  121,  110,  245,
+      233,  233,  233,  120,  341,  277,  119,  121,  233,  233,
+      344,  119,  121,  120,  110,  110,  119,  122,  120,  122,
+      244,  120,  122,  121,  119,  121,  110,  177,  123,  218,
+      400,  120,  341,  123,  212,  345,  122,  346,  344,  354,
+      913,  177,  277,  347,  209,  123,  122,  123,  122,  124,
+      202,  122,  348,  126,  124,  187,  177,  123,  126,  400,
+      124,  349,  123,  345,  122,  346,  183,  126,  124,  177,
+
+      277,  347,  126,  123,  676,  123,  676,  354,  124,  127,
+      348,  175,  126,  124,  127,  174,  237,  126,  124,  349,
+       89,  127,  127,  237,  237,  126,  124,  127,  127,  128,
+      126,  128,  129,  389,  128,  130,  354,  129,  127,  292,
+      130,  292,  361,  127,  234,  234,  234,  130,  128,  127,
+      127,  129,  234,  234,  130,  127,  127,  536,  128,  237,
+      128,  129,   88,  128,  130,  388,  129,   84,  389,  130,
+      361,  380,  380,  380,  356,  130,  128,   65,   13,  129,
+      378,  238,  130,  131,  355,  131,  536,  237,  238,  238,
+      369,  292, 1051,  388,  390,  133,  389,  392,    9,  131,
+
+      133,  131,  131,  131,  131,  131,  131,  131,  131,  131,
+      131,  132, 1081,  133,  133,  134,  132,    7,  134,  292,
+      134,  388,  132,  398,  133,  392,  356,  355,  369,  133,
+      132,  390,  378,  238,  134,  677,  131,  677,  131, 1130,
+      132,  133,  133,  381,  134,  132,  136,  134,  135,  134,
+      132,  136, 1051,  135,  356,  355,  398,  369,  132,  390,
+      378,  238,  134,  136,  131,  136,  131,  135,  135,  139,
+      377,  137, 1081,  138,  139,  136,  137,  135,  138,  137,
+      136,  381,  135,  139,  138,  398,  137,  395,  139,    0,
+      137,  136,  138,  136,  418,  135,  135,  397,  139, 1130,
+
+      137,  382,  138,  139,  140,  137,  475,  138,  137,  140,
+      381,  139,  138,  377,  137,  395,  139,  142,  137,  142,
+      138,  140,  418,  140,  141,  399,  143,  144,  143,  141,
+     1131,  537,  144,  140,  475,    0,  143,  141,  140,  391,
+      533,  377,  144,  141,  397,  382,  144,    0,  543,  140,
+      142,  140,  466,  141,  466,  142,  144,  146,  141,  143,
+      537,  144,  146,  146,  143,  141,    0,  391,  533,  142,
+      144,  141,  397,  382,  144,  399,  146,    0,  143,  142,
+      145,    0,  145,  466,  142,  145,  146,  680,  143,  680,
+     1131,  146,  146,  143,  145,  391,  145,  142,  543,  145,
+
+      147,    0,  148,  399,  146,  147,  143,  148,  557,  145,
+      484,  145,  484,  546,  145,  148,  394,  394,  394,  147,
+      484,  148,  145,  147,  145,  149,  543,  145,  149,  147,
+      149,  148,  572,  150,  147, 1148,  148,  151,  150,    0,
+        0,  546,  151,  148,  149,  150,  547,  147,    0,  148,
+      151,  147,  150,  557,  149,    0,  151,  149,    0,  149,
+      544,  572,  150,  152,  153,    0,  151,  150,  152,  153,
+        0,  151,  149,  150,  547,  153,  152,  488,  151,  488,
+      150,  557,  152,  153,  151,    0,  155,  488,    0,  154,
+      155,  155,  152,  153,  154, 1148,  544,  152,  153,  521,
+
+      154,  521,    0,  153,  152,  155,  611,    0,  154,  521,
+      152,  153,  156,  253,  253,  155,  158,  156,  154,  155,
+      155,  158,  402,  154,  158,  544,  253,    0,  154,  402,
+      402,  156,  157,  155,  611,  158,  154,  157,  559,  559,
+      559,  156,  253,  253,    0,  158,  156,  612,    0,  157,
+      158,  157,  157,  158,  253,  160,  160,  159,    0,  156,
+      160,  157,  159,  158,  614,  159,  157,  370,  370,  370,
+      615,  159,  402,  561,  160,  612,  159,  157,    0,  157,
+      157,  194,  162,  194,  160,  160,  159,  162,  161,  160,
+      161,  159,  614,  161,  159,  556,  556,  556,  615,  159,
+
+      402,  162,  160,  162,  159,    0,  161,  161,  370,  542,
+      161,  162,  575,  163,  194,  564,  162,  161,  163,  161,
+      164,  555,  161,  561,  163,  164,  164,  563,  194,  162,
+        0,  162,  163,  164,  161,  161,  556,  370,  161,  164,
+      165,  575,  163,  194,  568,  165,  692,  163,  692,  164,
+      617,  561,  163,  562,  164,  164,  194,  165,  542,  165,
+      163,  164,  564,  166,  403,  556,  682,  164,  166,  165,
+      555,  403,  403,  577,  165,  569,  563,  166,  617,  568,
+      166,    0,  166,  167,  167,  165,  542,  165,  167,  562,
+      564,  697,  166,  697,  682,  167,  569,  166,  555,  744,
+
+      403,    0,  167,  570,  563,  166,  577,  568,  166,  168,
+      166,  579,  167,  167,  168,  169,    0,  167,  562,  169,
+      169,    0,  168,  167,  570,  569,  168,  744,  168,  403,
+      167,  571,  170,    0,  169,  577,  753,  170,  168,    0,
+      170,  171,    0,  168,  169,  171,  171,  579,  169,  169,
+      168,  170,  571,  570,  168,    0,  168,  574,  574,  574,
+      171,  170,  169,  172,  753,  581,  170,  604,  172,  170,
+      171,  172,  581,  581,  171,  171,  579,  582,  613,  170,
+      618,  571,  172,  687,  582,  582,    0,    0,  171,  678,
+        0,  678,  172,  185,  185,  185,  604,  172,  756,  678,
+
+      172,  581,  679,  635,  815,  635,  815,  613,  757,  618,
+      172,  185,  185,  185,  185,  185,  185,  185,  185,  185,
+      185,  186,  681,  687,    0,  678,  756,  186,  713,    0,
+      581,  679,  691,  608,  635,  608,  757,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,  186,  192,  683,  713,
+      683,  681,  687,  192,  678,  684,  684,  684,  683,    0,
+      703,  691,  683,  192,  192,  192,  192,  192,  192,  192,
+      192,  192,  192,  193,  608,  215,  215,  215,  713,  193,
+      708,  708,  708,  748,  826,  826,  826,  193,  608,  193,
+      193,  193,  193,  193,  193,  193,  193,  193,  193,  195,
+
+      703,  196,  197,  608,  195,  749,  196,  197,  215,    0,
+      195,  616,  748,  196,  196,  688,  608,  195,  195,  196,
+      196,  197,  215,  832,  832,  832,  704,  616,  195,  703,
+      196,  197,  707,  195,  749,  196,  197,  215,  195,  198,
+      616,  196,  196,    0,  198,  195,  195,  196,  196,  197,
+      215,  688,  702,  198,  702,  616,  200,    0,  198,  201,
+      199,  200,  199,  201,  201,  199,  702,  755,  198,  758,
+        0,  200,  707,  198,  199,  200,  199,  704,  201,  199,
+      688,  198,  759,  807,    0,  200,  198,    0,  201,  199,
+      200,  199,  201,  201,  199,  216,  755,    0,  758,  200,
+
+        0,  707,  199,  200,  199,  704,  201,  199,    0,    0,
+      759,  807,  216,  216,  216,  216,  216,  216,  216,  216,
+      216,  216,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+
+      217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
+      217,  239,    0,  239,  860,  760,  239,  239,  239,  239,
+      239,  239,  239,  239,  239,  239,  240,    0,  240,  863,
+      805,  240,  240,  240,  240,  240,  240,  240,  240,  240,
+      240,  241,  860,  241,  760,  806,  241,  241,  241,  241,
+      241,  241,  241,  241,  241,  241,  254,  863,  254,  805,
+        0,  254,  254,  254,  254,  254,  254,  254,  254,  254,
+      254,  255,    0,  255,  806,    0,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  256,  808,  256,  259,
+      865,  256,  256,  256,  256,  256,  256,  256,  256,  256,
+
+      256,  257,  257,  257,  257,  257,  257,  257,  257,  257,
+      257,    0,  259,  769,  260,  769,  808,  259,  865,  260,
+      257,  258,  258,  258,  258,  258,  258,  258,  258,  258,
+      258,  259,  260,  260,  261,  813,  901,  262,  901,  261,
+      258,  259,  262,  260,  769,  261,  259,  727,  260,  257,
+      908,  262,  908,  261,  727,  727,  262,  263,  705,  259,
+      260,  260,  263,  261,  813,  693,  262,  693,  261,  258,
+      263,  262,    0,  261,    0,  693,  263,  264,  266,  262,
+      265,  261,  264,  266,  262,  265,  263,  803,  266,  803,
+      264,  263,    0,    0,  705,  803,  264,  266,  263,  265,
+
+      265,  693,  851,  268,  263,  810,  264,  266,  268,  265,
+      267,  264,  266,    0,  265,  267,  266,    0,  264,    0,
+      268,  267,  268,  705,  264,  266,    0,  265,  265,  267,
+      693,  851,  268,  269,    0,  271,  821,  268,  269,  267,
+      271,  270,  810,    0,  267,  700,  270,  700,  268,  267,
+      268,  269,  269,  270,  271,  700,  270,  267,  272,  700,
+      270,    0,  269,  272,  271,  272,  728,  269,    0,  271,
+      270,  810,  821,  728,  728,  270,    0,  272,  273,  269,
+      269,  270,  271,  273,  270,  274,    0,  272,  270,  273,
+      274,  729,  272,  794,  272,  794,  274,  273,  729,  729,
+
+        0,  821,    0,  794,  274,  272,    0,  273,  278,  278,
+      857,  275,  273,  278,  274,  275,  275,  273,  900,  274,
+      859,  809,  809,  809,  274,  273,  820,  278,  279,  809,
+      275,  280,  274,  279,  824,  279,  280,  278,  278,  857,
+      275,  284,  278,  284,  275,  275,  900,  279,  281,  859,
+      280,  861,  281,  281,    0,  278,  862,  279,  275,  864,
+      280,  925,  279,  820,  279,  280,    0,  281,  283,    0,
+        0,  824,  284,  283,  284,  279,  283,  281,  280,  284,
+      861,  281,  281,  838,  875,  862,  875,  283,  864,  925,
+      838,  838,  820,  284,  875,  281,  282,  283,  282,  285,
+
+      824,  894,  283,  284,  285,  283,  286,  899,  284,  422,
+      422,  286,  839,  902,  893,  283,  893,  285,  285,  839,
+      839,  284,  422,    0,  893,  286,    0,  282,  285,  282,
+      894,  911,  282,  285,  282,  286,  899,  282,  422,  422,
+      286,  282,  902,    0,  282,  285,  285,  282,  282,  289,
+      422,  282,  287,  286,  289,  288,  287,  287,  282,  288,
+      288,  282,  934,  282,  937,  884,  282,  884,  289,  282,
+        0,  287,  282,    0,  288,  282,  282,  926,  289,  282,
+      911,  287,  290,  289,  288,  287,  287,  290,  288,  288,
+      291,  934,  291,  937,  290,  291,  289,  929,  293,  287,
+
+      931,  290,  288,  293,  896,  926,  896,  932,  911,  291,
+        0,  290,  293,  884,    0,  296,  290,  293,  933,  291,
+      296,  291,  290,  935,  291,  929,  296,  293,  931,  290,
+      961,  297,  293,    0,  296,  932,  297,  291,  298,  896,
+      293,  884,  297,  298,  296,  293,  933,    0,  954,  296,
+      297,  935,    0,  964,  296,    0,    0,  298,  298,  961,
+      297,  299,  296,    0,    0,  297,  299,  298,  896,  965,
+      297,  980,  298,  948,  948,  948,  954,  966,  297,  972,
+      299,  299,  964,  300,  301,  298,  298,  300,  300,  301,
+      299,  302,  301,  302,  303,  299,  303,  965,  967,  980,
+
+      300,  302,  300,  301,  303,  968,  966,  968,  299,  299,
+        0,    0,  300,  301,  989,  972,  300,  300,  301,  990,
+      304,  301,  973,  981,  302,  304,  984,  303,  300,  302,
+      300,  301,  303,  967,  968,  302,  968,    0,  303,  304,
+      304,  986,  989,  302,  972,  302,  303,  990,  303,  304,
+     1005,    0,  981,  302,  304,  984,  303,    0,  302,  973,
+      305,  303,  967,  302,  305,  305,  303,  304,  304,  987,
+      986,  302,  306,  302,  303,  988,  303,  306, 1005,  305,
+      307,  308, 1008, 1016,  307,  307,  308,    0,  973,  305,
+     1010,  306,  308,  305,  305,    0,    0,  309,  987,  307,
+
+      308,  306,  309, 1015,  988,    0,  306,  305,    0,  307,
+      308, 1008, 1013,  307,  307,  308,  309,  310, 1010,  306,
+      308,  309,  310,  998,  998,  998,  309,  307,  308, 1016,
+      310,  309, 1015,  311,  312,    0,  310,  313,  311,  312,
+     1013,  311,  313,  852,  309,  852,  310, 1017,    0,  309,
+        0,  310,  311,  312,  314,    0,  313, 1016,  310,  314,
+     1018,    0,  311,  312,  310, 1028,  313,  311,  312, 1027,
+      311,  313,  314,  314,  315,    0, 1017,  316,  852,  315,
+      311,  312,  316,  314,  313, 1022, 1032,  315,  314, 1018,
+      316,  852, 1034,  315, 1028,    0,  316, 1027,  316, 1036,
+
+      314,  314, 1021,  315,  317, 1023,  316,  852,  315,  317,
+      317,  316,    0,    0, 1032,  315, 1043, 1022,  316,  852,
+     1034,  315, 1049,  317,  316,  318,  316, 1036,    0,  319,
+      318,    0,  319,  317,  319,    0,  318,  320,  317,  317,
+      319, 1023,  320,    0,  318, 1043, 1022, 1021,  319, 1046,
+     1049,  317,    0, 1024,  318, 1053,  320,  320,  319,  318,
+      321,  319,  322,  319,  318,  321,  320,  322,  319,  323,
+     1023,  320,  318, 1052,  323, 1021,  319,  323, 1046,  321,
+      321,  322,  322, 1053,  320,  320,    0,    0,  323,  321,
+        0,  322,  326, 1024,  321,  324,  322,  326,  323,  324,
+
+      324,    0, 1052,  323, 1060,  326,  323,  321,  321,  322,
+      322,  326,  328,    0,  324,  325,  323,  328,  327,  325,
+      325,  326, 1024,  327,  324,  327,  326, 1061,  324,  324,
+     1058,  328, 1060,  326,  325,    0, 1055,  327,  329,  326,
+        0,  328,  324,  329,  325,  330,  328,  327,  325,  325,
+      330, 1057,  327,  332,  327,  332, 1061,  329,    0,  328,
+      330,  331,  325,  332,  330,  327,  331,  329, 1041, 1041,
+     1041, 1055,  329,    0,  330, 1058, 1064,    0,  331,  330,
+      331, 1066,  333, 1056, 1057,  329,  332,  333,  330,  333,
+      331,  332,  330,  334, 1072,  331,    0, 1074,  334,  334,
+
+     1055,  333,  336, 1058, 1064,  332,  331,  336,  331, 1076,
+     1066,  333,  334, 1057,  336,  332,  333, 1056,  333,  335,
+      332,  336,  334, 1072,  335, 1074, 1078,  334,  334,  333,
+        0,  336,  335,  332,    0,    0,  336, 1076,  335,  337,
+      334, 1085,  336,    0,  337,  338, 1056, 1094,  335,  336,
+      338,    0,  974,  335, 1078, 1086,  337, 1090,  337, 1083,
+      335,  876,  876,  876,  338,    0,  335,    0,  337,  876,
+     1085, 1082,  876,  337,  338,  351, 1094,  351,    0,  338,
+      946,  946,  946, 1086,  337, 1090,  337,  974,  946,  974,
+        0,  946,  338,  351,  351,  351,  351,  351,  351,  351,
+
+      351,  351,  351,  352,  947,  947,  947, 1082,    0,  352,
+        0, 1083,  947,    0, 1077,  947,  974,    0,  974,  352,
+      352,  352,  352,  352,  352,  352,  352,  352,  352,  353,
+      949,  949,  949,    0,    0,  353, 1082, 1098,  949, 1083,
+        0,  949, 1070, 1070, 1070,  353,  353,  353,  353,  353,
+      353,  353,  353,  353,  353,  357, 1092, 1092, 1092, 1077,
+     1099,  357,  362,  363,    0,  364,  362,  362,  363,  357,
+      364,  357,  357,  357,  357,  357,  357,  357,  357,  357,
+      357,  362,  363, 1098,  364,  365,  365, 1077, 1099, 1103,
+      365,  362,  363,  368,  364,  362,  362,  363, 1104,  364,
+
+        0,  366,    0,    0,  365,  366,  366,    0,    0,  362,
+      363, 1098,  364, 1111,  365,  365, 1107, 1103,  366,  365,
+      366,  367,    0,  433,  368,  367,  367, 1104,  433,  368,
+      366, 1100,  365,    0,  366,  366,  950,  950,  950, 1113,
+      367, 1111,  433,  368,  950, 1107,  366,  950,  366,    0,
+      367, 1116,  433,  368,  367,  367,  383,  433,  368,    0,
+        0,  999,  999,  999,    0,    0, 1100, 1113,  367,  999,
+      433,  368,  999,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  384,    0, 1000, 1000, 1000, 1101, 1101,
+     1101,    0,  383, 1000, 1121, 1100, 1000, 1116, 1127,    0,
+
+      384,  384,  384,  384,  384,  384,  384,  384,  384,  384,
+      387,    0, 1001, 1001, 1001, 1117, 1117, 1117, 1136,  384,
+     1001,  383, 1121, 1001,    0, 1116, 1127,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  387,  404,  404,  404,
+      404,  404,  404,  404,  404,  404,  404, 1136,  384,  405,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  406,
+      406,  406,  406,  406,  406,  406,  406,  406,  406,  407,
+      407,  407,  407,  407,  407,  407,  407,  407,  407,  408,
+      408,  408,  408,  408,  408,  408,  408,  408,  408,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  423,
+
+      423,  423,  423,  423,  423,  423,  423,  423,  423,  424,
+      424,  424,  424,  424,  424,  424,  424,  424,  424,  425,
+      425,  425,  425,  425,  425,  425,  425,  425,  425,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  427,
+      427,  427,  427,  427,  427,  427,  427,  427,  427,  428,
+      428,  428,  428,  428,  428,  428,  428,  428,  428,  429,
+     1102,  429,    0,    0,  429,  429,  429,  429,  429,  429,
+      429,  429,  429,  429,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,    0,  436,    0,  434,    0,  431,
+      436,  431,  434,  430,  431,  431,  431,  431,  431,  431,
+
+      431,  431,  431,  431,  436,  434,  434,  435,  437,  435,
+     1144, 1102,  435,  437,  436,    0,  434, 1132, 1147,  436,
+        0,  434,  430,    0,  438,    0,  435,  437,  438,  438,
+      439,    0,  436,  434,  434,  439,  435,  437,  435, 1102,
+        0,  435,  437,  438,    0, 1132,  440, 1140,  439,  439,
+     1147,  440,    0,  438,  435,  437, 1144,  438,  438,  439,
+        0,    0,  441,    0,  439,  440, 1114,  441,  442,  443,
+        0,  438,  442,  442,  443,  440,  439,  439, 1139, 1147,
+      440,  441,    0,  443, 1144,  446, 1146,  442,  443,  444,
+      446,  441, 1140,  440,  444, 1143,  441,  442,  443, 1156,
+
+      444,  442,  442,  443,  446,  445,    0, 1149,  444,  441,
+      445,  443,    0,  445,  446,  442,  443, 1114,  444,  446,
+     1140,  447,  448,  444,  445,  447,  447,  448,  444, 1139,
+      449, 1156,  446,  448,  445,  449,  444, 1146,    0,  445,
+      447,  448,  445,  449, 1143, 1114, 1124, 1124, 1124,  449,
+      447,  448,  445,    0,  447,  447,  448, 1139, 1149,  449,
+     1156,  448,  451,    0,  449, 1146, 1145,  451,  447,  448,
+      452,  449, 1143,  451,  453,  452, 1152,  449,  452,  453,
+        0,  451,    0,    0, 1150,  454, 1149,  454,    0,  452,
+        0,  451,  453,  453,    0,    0,  451,    0,    0,  452,
+
+        0,  451, 1145,  453,  452,    0,    0,  452,  453,  451,
+      458, 1151, 1151, 1151,  457,  458,    0,  452,  454,  457,
+      453,  453,    0,  454,    0, 1152,  454,    0,  457,  458,
+      458, 1145,    0,  457,    0, 1150,    0,  454,    0,  458,
+      454,  459,    0,  457,  458,  460,  459,  454,  457,    0,
+      460,    0,  454, 1152, 1155,  454,  457,  458,  458,  460,
+      459,  457,  468, 1150,  460,  454,    0,  468,  454,  455,
+      459,  455,    0,    0,  460,  459, 1153, 1153, 1153,  460,
+        0,  468,    0,    0,  461,    0,    0,  460,  459,  461,
+     1155,  468,  460, 1158, 1158, 1158,  468, 1159, 1159, 1159,
+
+      455,  461,    0,  461,    0,  455,  463,  455,    0,  468,
+      455,  463, 1157,  461,  455,    0,    0,  455,  461, 1155,
+      455,  455,    0,    0,  455,  463,    0,    0,    0,  461,
+      463,  461,    0,    0,  455,  463,  455,    0,  472,  455,
+      463,    0,  455,  472,    0,  455,  462,    0,  455,  455,
+      462,  462,  455,  463,  464,  465,    0,  472,  463,  464,
+      465,  464,    0, 1157,    0,  462,  462,  472,    0,    0,
+        0,    0,  472,  464,  465,  462,  465,    0,    0,  462,
+      462,    0,    0,  464,  465,  472,    0,    0,  464,  465,
+      464, 1157,    0,  462,  462,    0,    0,    0,    0,    0,
+
+        0,  464,  465,    0,  465,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,    0,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,
+      469,  469,  469,  469,  470,    0,  471,  473,  471,  470,
+
+        0,    0,  473,  474, 1002, 1002, 1002,    0,  474,    0,
+        0,  470, 1002,  470,    0, 1002,  473,    0,    0,    0,
+        0,    0,  474,  470,    0,    0,  473,  471,  470,  471,
+      476,  473,  474,    0,  471,  476,    0,  474,  477,  470,
+        0,  470,    0,  477,  473,    0,  477,    0,  471,  476,
+      474,    0,    0,    0,    0,    0,    0,  477,  471,  476,
+      478,    0,    0,  471,  476,  478,    0,  477,  479,    0,
+        0,    0,  477,  479,    0,  477,  471,  476,    0,  478,
+      478,    0,    0,    0,    0,  477,    0,  479,    0,  478,
+      480,    0,    0,    0,  478,  480,    0,  479,  480,  481,
+
+        0,    0,  479,    0,  481,  481,    0,  478,  478,  480,
+        0,    0,  481,    0,    0,  479,    0,    0,  481,  480,
+        0, 1003, 1003, 1003,  480,    0,    0,  480,  481, 1003,
+      482,  487, 1003,  481,  481,  482,  487,  480,  482,  483,
+      481,  483,  486,    0,  483,    0,  481,  486,    0,  482,
+      487,    0,    0,    0,    0,    0,  486,    0,  483,  482,
+      487,  486,    0,    0,  482,  487,    0,  482,  483,  490,
+      483,  486,    0,  483,  490,  491,  486,  482,  487,    0,
+      491,    0,    0,  490,  486,    0,  483,    0,  490,  486,
+        0,  492,    0,    0,  491,  493,  492,    0,  490,    0,
+
+      493,    0,  492,  490,  491,    0,  493,  494,    0,  491,
+      492,  490,  494,    0,  493,    0,  490,    0,  495,    0,
+      492,    0,  491,  495,  493,  492,  494,  496,    0,  493,
+      492,    0,  496,    0,  493,  496,  494,  495,  492,  497,
+        0,  494,  493,  498,  497,    0,  496,  495,  498,    0,
+      502,    0,  495,    0,  494,  502,  496,    0,  497,    0,
+        0,  496,  498,    0,  496,  495,  499,    0,  497,  502,
+      500,  499,  498,  497,  496,  500,    0,  498,    0,  502,
+      499,    0,  500,    0,  502,  499,  497,  501,    0,  500,
+      498,  501,  501,  503,    0,  499,  504,  502,  503,  500,
+
+      499,  504,    0,    0,  500,    0,  501,    0,  499,    0,
+      500,    0,  503,  499,    0,  504,  501,  500,  505,  507,
+      501,  501,  503,  505,  507,  504,    0,  503,    0,  508,
+      504, 1042, 1042, 1042,  501,  505,    0,  505,  507, 1042,
+      503,  506, 1042,  504,    0,    0,  506,  505,  507,  506,
+      508,    0,  505,  507,    0,  508,    0,  509,    0,    0,
+      506,    0,  509,  505,    0,  505,  507,    0,    0,  508,
+      506,    0,    0,    0,  509,  506,  509,    0,  506,  508,
+        0,    0,  510,    0,  508,    0,  509,  510,  506,  511,
+      512,  509,    0,  510,  511,  512,    0,  508,    0,    0,
+
+        0,  510,  509,  512,  509,    0,  511,    0,  511,  512,
+        0,  510,    0,    0,    0,    0,  510,    0,  511,  512,
+      513,  510,  515,  511,  512,  513,    0,  515,  514,  510,
+      514,  512,    0,  514,  511,    0,  511,  512,  517,  513,
+        0,  515,    0,    0,    0,  516,    0,  514,    0,  513,
+      516,  515,    0,  518,  513,    0,  515,  514,  518,  514,
+        0,  517,  514,    0,  516,  519,  517,  513,    0,  515,
+      519,    0,  518,    0,  516,  514,    0,    0,    0,  516,
+      517,    0,  518,    0,  519,    0,  523,  518,  520,    0,
+      517,  523,  516,  520,  519,  517,    0,    0,    0,  519,
+
+      518,    0,  520,    0,    0,  523,    0,  520,  517,  524,
+        0,    0,  519,  524,  524,  523,    0,  520,  525,    0,
+      523,  526,  520,  525,    0,    0,  526,    0,  524,    0,
+      520,    0,    0,  523,    0,  520,    0,  525,  524,    0,
+      526,  527,  524,  524,  528,  527,  527,  525,  528,  528,
+      526,    0,  525,    0,    0,  526,  524,    0,    0,    0,
+      527,  551,    0,  528,    0,  525,  551,    0,  526,    0,
+      527,    0,    0,  528,  527,  527,    0,  528,  528,  539,
+      551,  539,    0,    0,    0, 1071, 1071, 1071,  527,    0,
+      551,  528,    0, 1071,    0,  551, 1071,  539,  539,  539,
+
+      539,  539,  539,  539,  539,  539,  539,  540,  551, 1093,
+     1093, 1093,    0,  540,    0,    0,    0, 1093,    0,    0,
+     1093,    0,    0,  540,  540,  540,  540,  540,  540,  540,
+      540,  540,  540,  541,  548,    0,  548,    0,    0,  541,
+        0,    0,    0,    0,  548,    0,    0,    0,    0,  541,
+      541,  541,  541,  541,  541,  541,  541,  541,  541,  545,
+      550,    0,  550,    0,    0,  545,  549,  548,    0,    0,
+      548,  549,  548,  545,  549,  545,  545,  545,  545,  545,
+      545,  545,  545,  545,  545,  549,  548,    0,    0,    0,
+        0,    0,    0,  550,    0,  549,  548,    0,  550,  548,
+
+      549,  548,  552,  549,    0,  592,    0,  552,  552,  592,
+      592,    0,  550,  549,  548,  552,    0,    0,  553,  552,
+      553,  552,  550,    0,  592,    0,    0,  550,  553,    0,
+        0,  552,  553,    0,  592,    0,  552,  552,  592,  592,
+      550,  565,    0,  552,    0,    0,    0,  552,    0,  552,
+        0,  553,  592,  565,    0,  565,  553,    0,  565,  565,
+      565,  565,  565,  565,  565,  565,  565,  565,    0,  566,
+      553, 1110, 1110, 1110,    0,    0,    0,    0,    0, 1110,
+      553,    0, 1110,    0,    0,  553,  566,  566,  566,  566,
+      566,  566,  566,  566,  566,  566,  567,    0,  553,    0,
+
+        0, 1125, 1125, 1125,    0,  566,    0,    0,  567, 1125,
+      567,    0, 1125,  567,  567,  567,  567,  567,  567,  567,
+      567,  567,  567,  588,  588,  588,  588,  588,  588,  588,
+      588,  588,  588,    0,  566,  589,  589,  589,  589,  589,
+      589,  589,  589,  589,  589,  590,  590,  590,  590,  590,
+      590,  590,  590,  590,  590,  591,  591,  591,  591,  591,
+      591,  591,  591,  591,  591,  593,    0,    0,  595,    0,
+      593,    0,    0,  595, 1134, 1134, 1134,    0, 1135, 1135,
+     1135,    0, 1134,  595,  593, 1134, 1135,  595,    0, 1135,
+        0,    0,    0,    0,  593,    0,    0,  595,    0,  593,
+
+        0,    0,  595,    0,    0,    0,    0,    0,    0,    0,
+        0,  595,  593,  594,  594,  595,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+
+      594,  594,  596,  597,  596,  598,  600,  596,  597,  599,
+      598,  600,    0,  599,  599,    0,    0,    0,  598,  600,
+        0,  596,  597,    0,  598,  600,    0,    0,  599,    0,
+        0,  596,  597,  596,  598,  600,  596,  597,  599,  598,
+      600,    0,  599,  599,    0,    0,  598,  600,    0,  596,
+      597,    0,  598,  600,  601,  602,  599,  603,    0,  601,
+      602,  605,  603,    0,    0,  605,  605,    0,    0,  602,
+        0,    0,    0,  601,  602,  603,  603,    0,    0,    0,
+      605,    0,    0,  601,  602,    0,  603,  606,  601,  602,
+      605,  603,  606,    0,  605,  605,    0,  602,  606,    0,
+
+        0,  601,  602,  603,  603,    0,  606,    0,  605,  609,
+      607,    0,    0,  610,  609,  607,  606,  607,  610,    0,
+      610,  606,    0,    0,    0,    0,  606,    0,  609,  607,
+        0,    0,  610,    0,  606,  619,  621,    0,  609,  607,
+      619,  621,  610,  609,  607,    0,  607,  610,    0,  610,
+        0,    0,    0,    0,  619,  621,  609,  607,  620,    0,
+      610,    0,    0,  620,  619,  621,    0,    0,    0,  619,
+      621,  620,    0,    0,  623,  622,    0,  620,  622,  623,
+      622,    0,  619,  621,    0,    0,    0,  620,  623,    0,
+        0,  624,  620,  623,  622,    0,  624,    0,    0,  620,
+
+        0,    0,  624,  623,  622,  620,    0,  622,  623,  622,
+      624,    0,  625,  625,  626,    0,  623,  625,  628,  626,
+      624,  623,  622,  628,    0,  624,    0,    0,    0,  626,
+      624,  625,    0,  626,    0,  627,    0,  628,  624,  627,
+      627,  625,  625,  626,    0,    0,  625,  628,  626,    0,
+        0,    0,  628,  629,  627,  629,    0,  626,    0,  625,
+        0,  626,    0,  632,  627,  628,    0,    0,  627,  627,
+      631,  631,  631,  631,  631,  631,  631,  631,  631,  631,
+      632,    0,  627,  633,  629,  632,  629,  634,  633,  637,
+        0,  629,  634,    0,  637,    0,    0,    0,    0,  632,
+
+      634,    0,  633,    0,    0,  629,  634,    0,  637,  632,
+        0,    0,  633,    0,  632,  629,  634,  633,  637,  638,
+      629,  634,    0,  637,  638,    0,    0,  632,  634,    0,
+      633,    0,    0,  629,  634,  639,  637,    0,  638,  641,
+      639,  641,  642,  639,  641,  642,  643,  642,  638,    0,
+        0,  643,    0,  638,  639,    0,    0,    0,  641,    0,
+        0,  642,  644,    0,  639,  643,  638,  644,  641,  639,
+      641,  642,  639,  641,  642,  643,  642,    0,    0,  644,
+      643,  644,  639,  645,    0,  646,  641,  645,  645,  642,
+      646,  644,  647,  643,  648,    0,  644,  647,    0,  648,
+
+        0,    0,  645,    0,  646,  647,    0,  644,    0,  644,
+        0,  647,  645,  648,  646,    0,  645,  645,    0,  646,
+        0,  647,    0,  648,    0,    0,  647,    0,  648,  649,
+      645,  649,  646,  647,  649,  650,    0,    0,    0,  647,
+      650,  648,    0,    0,    0,    0,  650,    0,  649,    0,
+        0,    0,    0,    0,  650,    0,    0,    0,  649,    0,
+      649,  652,    0,  649,  650,  651,  652,  651,    0,  650,
+      651,    0,  652,  653,  650,    0,  649,  653,  653,    0,
+      652,    0,  650,    0,  651,    0,    0,    0,    0,    0,
+      652,    0,  653,    0,  651,  652,  651,    0,  655,  651,
+
+      652,    0,  653,  655,    0,  654,  653,  653,  652,  656,
+      654,    0,  651,  654,  656,    0,    0,  655,    0,    0,
+      653,    0,  656,    0,  654,  657,    0,  655,  656,  657,
+      657,    0,  655,    0,  654,    0,  658,    0,  656,  654,
+        0,  658,  654,  656,  657,  655,    0,    0,  660,    0,
+      656,    0,  654,  660,  657,  658,  656,  659,  657,  657,
+        0,  659,  659,    0,    0,  658,    0,  660,  661,  662,
+      658,    0,  657,  661,  662,    0,  659,  660,    0,    0,
+        0,    0,  660,  658,    0,    0,  659,  661,  662,    0,
+      659,  659,    0,    0,  663,  660,  663,  661,  662,  663,
+
+      665,  666,  661,  662,  659,  665,  666,    0,    0,    0,
+        0,    0,    0,  663,    0,  661,  662,    0,  665,  665,
+      666,    0,    0,  663,    0,  663,  667,    0,  663,  665,
+      666,  667,    0,    0,  665,  666,    0,  668,    0,  667,
+      668,  663,  668,    0,    0,  667,  665,  665,  666,  669,
+        0,    0,    0,  672,  669,  667,  668,  671,  672,    0,
+      667,    0,  671,    0,    0,    0,  668,  667,  669,  668,
+        0,  668,  672,  667,  673,    0,  671,  671,  669,  673,
+      674,    0,  672,  669,  668,  674,  671,  672,    0,    0,
+        0,  671,    0,  673,    0,    0,  669,    0,    0,  674,
+
+      672,    0,    0,  673,  671,  671,    0,    0,  673,  674,
+        0,    0,  690,    0,  674,    0,    0,    0,  690,  695,
+        0,  673,    0,  695,  695,    0,  690,  674,  690,  690,
+      690,  690,  690,  690,  690,  690,  690,  690,  695,  696,
+      698,  699,    0,    0,  696,  698,  699,  696,  695,    0,
+        0,  698,  695,  695,    0,    0,    0,    0,  696,  698,
+      699,    0,    0,    0,    0,    0,  695,    0,  696,  698,
+      699,    0,  709,  696,  698,  699,  696,    0,    0,  698,
+        0,    0,  710,    0,    0,    0,  696,  698,  699,  709,
+      709,  709,  709,  709,  709,  709,  709,  709,  709,  710,
+
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  711,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  712,
+        0,    0,    0,    0,    0,    0,  711,  711,  711,  711,
+      711,  711,  711,  711,  711,  711,  712,  712,  712,  712,
+      712,  712,  712,  712,  712,  712,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  715,  719,  719,  719,    0,    0,
+      719,  719,    0,  719,    0,    0,    0,  719,  719,    0,
+        0,  719,    0,    0,  719,  719,  719,  719,  719,  719,
+      719,  719,  719,  732,  732,    0,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
+      732,  732,  733,    0,    0,  735,    0,  733,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  734,  736,  737,
+        0,  733,  735,  736,  737,  738,    0,  735,    0,    0,
+      738,  733,    0,    0,    0,    0,  733,  736,  737,    0,
+        0,  735,    0,    0,  738,  739,    0,  736,  737,  733,
+
+      739,  735,  736,  737,  738,    0,  735,  740,    0,  738,
+        0,    0,  740,    0,  739,  736,  737,    0,  741,  735,
+        0,    0,  738,  741,  739,    0,  740,    0,    0,  739,
+      740,    0,    0,    0,    0,    0,  740,  741,  741,    0,
+        0,  740,  739,  742,    0,  742,    0,  741,  742,    0,
+      747,  743,  741,    0,  740,  747,  743,    0,  740,  743,
+        0,  745,  742,  745,    0,  741,  741,    0,    0,  747,
+      743,    0,  742,  750,  742,    0,    0,  742,  750,  747,
+      743,    0,  746,    0,  747,  743,  746,  746,  743,    0,
+      742,    0,  750,    0,  745,    0,  745,  747,  743,  745,
+
+        0,  746,  750,    0,    0,    0,    0,  750,    0,  745,
+        0,  746,    0,  745,  751,  746,  746,    0,  751,  751,
+      750,    0,    0,  745,    0,  745,  762,    0,  745,  746,
+        0,  762,    0,  751,  761,    0,  761,  745,    0,  761,
+        0,  745,    0,  751,    0,  762,  762,  751,  751,    0,
+        0,  763,    0,  761,    0,  762,  763,  763,    0,    0,
+      762,  751,    0,  761,    0,  761,    0,    0,  761,    0,
+      763,  764,  765,  762,  762,  764,  764,  765,  766,    0,
+      763,  761,  766,  766,    0,  763,  763,    0,    0,  765,
+      764,  765,    0,    0,  771,    0,    0,  766,  763,  771,
+
+      764,  765,    0,  767,  764,  764,  765,  766,  767,    0,
+      768,  766,  766,  771,  772,  768,  772,  765,  764,  765,
+      767,  768,  767,  771,  772,  766,  773,    0,  771,  768,
+        0,  773,  767,    0,    0,    0,    0,  767,    0,  768,
+      773,  771,    0,    0,  768,  773,  774,  772,  767,  768,
+      767,  774,  772,    0,  774,  773,    0,  768,  775,    0,
+      773,    0,  775,  775,    0,  774,  772,  776,  773,  778,
+        0,  776,  776,  773,  778,  774,  772,  775,    0,    0,
+      774,  772,    0,  774,    0,    0,  776,  775,  778,    0,
+      777,  775,  775,  774,  772,  777,  776,    0,  778,  779,
+
+      776,  776,    0,  778,  779,  775,    0,  777,    0,  777,
+      780,    0,    0,    0,  776,  780,  778,  779,  779,  777,
+        0,  780,  781,    0,  777,    0,    0,  781,  779,  780,
+        0,  782,    0,  779,    0,  777,  782,  777,    0,  780,
+        0,  781,  783,  784,  780,  779,  779,  783,  784,  780,
+      782,  781,    0,  785,    0,  785,  781,  780,    0,    0,
+      782,  783,  784,  786,    0,  782,    0,    0,  786,  781,
+        0,  783,  784,    0,  787,    0,  783,  784,  782,  787,
+        0,  786,  786,  788,    0,    0,  785,    0,  788,  783,
+      784,  785,  786,  787,  789,    0,    0,  786,  787,  789,
+
+        0,  785,  788,  787,    0,  785,    0,    0,  787,  786,
+      786,    0,  788,  789,    0,  785,    0,  788,    0,  790,
+      785,  787,    0,  789,  790,    0,  787,  791,  789,  785,
+      788,  791,  791,  785,    0,    0,  790,    0,  790,  792,
+        0,  789,    0,    0,  792,    0,  791,    0,  790,    0,
+        0,  792,    0,  790,    0,    0,  791,    0,  792,    0,
+      791,  791,  793,    0,  790,    0,  790,  793,  792,    0,
+      795,  796,    0,  792,  791,  795,  796,    0,  795,  792,
+        0,  793,  797,    0,    0,    0,  792,  797,    0,  795,
+      796,  793,    0,  798,    0,  799,  793,  799,  798,  795,
+
+      796,  797,    0,    0,  795,  796,    0,  795,    0,  793,
+        0,  797,  798,    0,    0,    0,  797,  795,  796,  800,
+      801,    0,  798,    0,  800,  801,  816,  798,  799,  797,
+      799,  816,    0,  799,    0,    0,    0,    0,  800,  801,
+      798,    0,    0,    0,    0,  816,    0,  799,  800,  801,
+        0,  817,    0,  800,  801,  816,  817,  799,    0,  799,
+      816,    0,  799,    0,  817,    0,  800,  801,    0,  818,
+      817,  818,    0,  816,  842,  799,  802,  802,  802,  802,
+      817,    0,    0,    0,    0,  817,    0,    0,    0,    0,
+      819,  842,  817,    0,    0,  819,  842,    0,  817,    0,
+
+        0,    0,  818,    0,    0,    0,    0,  818,    0,  819,
+      842,  802,  802,    0,    0,  802,    0,  802,    0,  819,
+      842,  818,    0,    0,  819,  842,    0,    0,  802,  802,
+        0,  818,    0,    0,    0,    0,  818,  819,  842,    0,
+      802,  802,    0,    0,  802,    0,  802,    0,    0,  818,
+        0,    0,    0,    0,    0,    0,  802,  802,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  827,  827,  827,
+      827,  827,  827,  827,  827,  827,  827,  828,  841,  841,
+      841,  841,  841,  841,  841,  841,  841,  841,    0,    0,
+        0,    0,    0,    0,  828,  828,  828,  828,  828,  828,
+      828,  828,  828,  828,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  829,  829,  829,  829,  829,  829,  829,
+      829,  829,  829,  843,    0,  844,    0,  847,  843,  844,
+      844,  845,  847,  845,  846,    0,  845,    0,  846,  846,
+        0,    0,  843,    0,  844,    0,  847,    0,    0,    0,
+      845,    0,  843,  846,  844,    0,  847,  843,  844,  844,
+
+      845,  847,  845,  846,  849,  845,    0,  846,  846,  849,
+      843,  848,  844,    0,  847,  848,  848,    0,  845,    0,
+      850,  846,    0,  849,    0,  850,    0,  853,    0,    0,
+      848,  854,  853,  849,  850,    0,  854,    0,  849,  850,
+      848,  853,    0,    0,  848,  848,  853,    0,  854,  850,
+      854,  849,  855,    0,  850,    0,  853,  855,  848,    0,
+      854,  853,  850,  858,    0,  854,    0,  850,  858,  853,
+        0,  855,  866,    0,  853,    0,  854,  866,  854,    0,
+      858,  855,  858,  867,    0,    0,  855,    0,  867,    0,
+        0,  866,  858,    0,  867,    0,    0,  858,    0,  855,
+
+        0,  866,  867,    0,  868,    0,  866,    0,  858,  868,
+      858,    0,  867,  869,    0,  869,    0,  867,  869,  866,
+        0,  868,  867,  868,    0,    0,    0,    0,    0,  870,
+      867,    0,  869,  868,  870,  871,    0,    0,  868,    0,
+      871,    0,  869,  870,  869,    0,    0,  869,  870,  868,
+        0,  868,    0,    0,  871,    0,    0,    0,  870,    0,
+      869,  872,    0,  870,  871,  872,  872,    0,  873,  871,
+      874,  870,  873,  873,    0,  874,  870,    0,    0,    0,
+      872,  874,  871,    0,    0,    0,    0,  873,    0,  874,
+      872,  878,    0,  877,  872,  872,  878,  873,  877,  874,
+
+        0,  873,  873,    0,  874,    0,  877,    0,  872,  874,
+      878,    0,  877,  879,  880,  873,  881,  874,  879,  880,
+      878,  881,  877,    0,    0,  878,    0,  877,    0,    0,
+        0,    0,  879,  880,  877,  881,  882,    0,  878,    0,
+      877,  882,  879,  880,  882,  881,    0,  879,  880,    0,
+      881,    0,  883,  886,    0,  882,    0,  883,  886,  885,
+      879,  880,    0,  881,  885,  882,    0,    0,    0,    0,
+      882,  883,  886,  882,    0,    0,  885,    0,  885,  887,
+        0,  883,  886,  882,  887,    0,  883,  886,  885,    0,
+      888,  890,    0,  885,    0,  888,  890,    0,  887,  883,
+
+      886,  888,  891,    0,  885,    0,  885,  891,  887,  888,
+      890,  889,    0,  887,    0,  889,  889,    0,    0,  888,
+      890,  891,  892,  897,  888,  890,  887,  892,  897,  888,
+      889,  891,    0,    0,  895,    0,  891,  888,  890,  895,
+      889,  892,  897,  906,  889,  889,    0,    0,  906,  891,
+        0,  892,  897,  895,    0,  895,  892,  897,  889,  898,
+        0,    0,  906,  895,  898,    0,  907,  898,  895,  892,
+      897,  907,  906,    0,    0,    0,    0,  906,  898,    0,
+        0,  895,    0,  895,  907,  907,    0,    0,  898,  909,
+      906,  909,    0,  898,  909,  907,  898,    0,    0,    0,
+
+      907,    0,    0,    0,    0,    0,  898,  914,  909,    0,
+        0,    0,  907,  907,    0,    0,  917,  917,  909,    0,
+      909,  917,    0,  909,  914,  914,  914,  914,  914,  914,
+      914,  914,  914,  914,    0,  917,  909,  918,    0,  919,
+        0,    0,  918,  919,  919,  917,  917,    0,  920,    0,
+      917,    0,    0,  920,    0,    0,  918,    0,  919,    0,
+        0,    0,    0,  917,    0,  920,  918,  920,  919,  921,
+      922,  918,  919,  919,  921,  922,    0,  920,  923,    0,
+        0,    0,  920,  923,  918,    0,  919,    0,  921,  922,
+        0,  923,    0,  920,    0,  920,    0,  923,  921,  922,
+
+        0,  927,    0,  921,  922,  928,  927,  923,    0,  928,
+      928,    0,  923,  927,    0,    0,  921,  922,    0,  923,
+      927,  938,    0,    0,  928,  923,  938,  930,  940,  938,
+      927,  930,  930,  940,  928,  927,    0,    0,  928,  928,
+      938,  927,    0,    0,    0,    0,  930,  940,  927,    0,
+      938,    0,  928,    0,    0,  938,  930,  940,  938,  939,
+      930,  930,  940,  939,  939,  941,  942,    0,  938,    0,
+      941,  942,    0,    0,  930,  940,    0,    0,  939,    0,
+        0,    0,  943,    0,  941,  942,  942,  943,  939,    0,
+        0,  944,  939,  939,  941,  942,  944,    0,    0,  941,
+
+      942,  943,  945,    0,  944,    0,  939,  945,    0,    0,
+      944,  943,  941,  942,  942,    0,  943,    0,  951,    0,
+      944,  945,  952,  951,    0,  944,    0,  952,    0,  943,
+        0,  945,  944,    0,    0,    0,  945,  951,  944,  955,
+        0,  952,    0,  953,  955,  953,    0,  951,  953,  945,
+        0,  952,  951,  955,    0,    0,  952,    0,  955,  956,
+        0,    0,  953,    0,  956,  951,  957,    0,  955,  952,
+      958,  957,  953,  955,  953,  958,    0,  953,  956,    0,
+        0,  955,    0,    0,    0,  957,  955,  958,  956,  958,
+      953,    0,  960,  956,    0,  957,  960,  960,    0,  958,
+
+      957,    0,    0,  963,  958,    0,  956,    0,  963,  962,
+        0,  960,    0,  957,  962,  958,  963,  958,    0,    0,
+        0,  960,  963,    0,    0,  960,  960,  962,  962,  969,
+        0,    0,  963,    0,  969,  970,    0,  963,  962,  960,
+      970,  971,    0,  962,  963,  971,  971,    0,  969,  969,
+      963,    0,  976,    0,  970,  962,  962,  976,  969,    0,
+      971,  975,    0,  969,  970,    0,  975,    0,  977,  970,
+      971,  976,  975,  977,  971,  971,  969,  969,    0,    0,
+      975,  976,  970,    0,  979,    0,  976,  977,  971,  979,
+      975,    0,    0,  985,    0,  975,    0,  977,  985,  976,
+
+      975,  978,  977,  979,  982,  978,  978,    0,  975,  982,
+        0,    0,  985,  979,    0,  977,    0,    0,  979,  982,
+      978,    0,  985,  982,  983,    0,  983,  985,    0,  983,
+      978,  979,    0,  982,  978,  978,    0,    0,  982,    0,
+      985,  993,    0,  983,  994,  992,  993,  982,  978,  994,
+      992,  982,    0,  983,    0,  983,  994,    0,  983,  992,
+      993,  995,    0,  994,  992,    0,  995,  996,    0,    0,
+      993,  983,  996,  994,  992,  993,    0,    0,  994,  992,
+      995,    0,    0,    0,  994,    0,  996,  992,  993,    0,
+      995,  994,  992, 1004,    0,  995,  996,  997, 1004,  997,
+
+     1007,  996,  997,    0, 1006, 1007, 1006,    0,  995, 1006,
+        0,    0, 1004,    0,  996,    0,  997,    0,    0, 1007,
+     1009,    0, 1004, 1006,    0, 1009,  997, 1004,  997, 1007,
+        0,  997,    0, 1006, 1007, 1006,    0, 1011, 1006, 1009,
+     1004, 1011, 1011,    0,  997,    0,    0, 1007,    0, 1009,
+        0, 1006,    0, 1012, 1009,    0, 1011, 1012, 1012,    0,
+     1020,    0,    0,    0, 1019, 1020, 1011, 1009,    0, 1019,
+     1011, 1011, 1012,    0,    0, 1019, 1025,    0,    0, 1020,
+     1025, 1025, 1012, 1019, 1011, 1026, 1012, 1012,    0, 1020,
+     1026,    0,    0, 1019, 1020, 1025,    0, 1029, 1019,    0,
+
+     1012,    0, 1029, 1019, 1026, 1025,    0, 1020, 1029, 1025,
+     1025, 1019,    0,    0, 1026,    0, 1029,    0,    0, 1026,
+     1030,    0, 1037, 1025, 1038, 1030, 1029, 1037, 1030, 1038,
+        0, 1029, 1026,    0,    0, 1037, 1029,    0,    0, 1030,
+        0, 1037,    0, 1038, 1029,    0,    0, 1039,    0, 1030,
+        0, 1037, 1039, 1038, 1030, 1039, 1037, 1030, 1038, 1047,
+        0,    0,    0, 1037, 1047,    0, 1039, 1030, 1040, 1037,
+     1044, 1038, 1040, 1040, 1044, 1044, 1039,    0, 1047,    0,
+        0, 1039,    0,    0, 1039,    0,    0, 1040, 1047, 1044,
+     1048, 1054,    0, 1047, 1039, 1048, 1054, 1040,    0, 1044,
+
+        0, 1040, 1040, 1044, 1044,    0, 1047, 1059,    0, 1048,
+     1054,    0, 1059,    0,    0, 1040, 1063, 1044,    0, 1048,
+     1054, 1063,    0, 1062, 1048, 1054, 1059, 1062, 1062,    0,
+        0,    0,    0,    0, 1063, 1063, 1059, 1048, 1054, 1067,
+        0, 1059, 1062,    0, 1067, 1063, 1068,    0, 1069,    0,
+     1063, 1068, 1062, 1069, 1059,    0, 1062, 1062, 1067, 1068,
+        0,    0, 1063, 1063,    0, 1068,    0, 1069, 1067, 1073,
+     1062, 1080, 1073, 1067, 1073, 1068, 1080, 1069,    0,    0,
+     1068,    0, 1069,    0,    0,    0, 1067, 1068, 1073,    0,
+     1080, 1087,    0, 1068, 1088, 1069, 1087,    0, 1073, 1088,
+
+     1080, 1073, 1088, 1073,    0, 1080,    0,    0,    0,    0,
+     1087,    0,    0, 1088, 1087,    0, 1073, 1091, 1080,    0,
+     1087, 1091, 1091, 1088, 1095, 1087,    0,    0, 1088, 1095,
+        0, 1088,    0,    0,    0,    0, 1091,    0, 1087,    0,
+     1105, 1088, 1087, 1095, 1095, 1105, 1091, 1106,    0, 1108,
+     1091, 1091, 1106, 1095, 1108,    0,    0,    0, 1095, 1105,
+        0, 1106,    0,    0, 1091,    0, 1106,    0, 1108, 1105,
+        0, 1095, 1095,    0, 1105,    0, 1106,    0, 1108,    0,
+        0, 1106,    0, 1108,    0,    0,    0, 1105,    0, 1106,
+        0,    0,    0,    0, 1106,    0, 1108, 1109, 1109, 1109,
+
+        0,    0, 1109, 1109,    0, 1109,    0,    0,    0, 1109,
+     1109,    0,    0, 1109,    0,    0, 1109, 1109, 1109, 1109,
+     1109, 1109, 1109, 1109, 1109, 1112, 1122,    0,    0,    0,
+     1112, 1122,    0,    0,    0,    0,    0,    0,    0, 1122,
+        0,    0, 1112,    0, 1112, 1122,    0,    0,    0,    0,
+        0,    0,    0,    0, 1112, 1122,    0,    0,    0, 1112,
+     1122,    0,    0,    0,    0,    0,    0, 1122,    0,    0,
+     1112,    0, 1112, 1122, 1126, 1126, 1126,    0,    0, 1126,
+     1126,    0, 1126,    0, 1128, 1126, 1126, 1126, 1128, 1128,
+     1126,    0,    0, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
+
+     1126, 1126,    0, 1128, 1133, 1137,    0,    0,    0, 1133,
+     1137,    0,    0, 1128,    0,    0,    0, 1128, 1128,    0,
+        0,    0,    0, 1133, 1137,    0,    0,    0,    0,    0,
+        0, 1128,    0, 1133, 1137,    0,    0,    0, 1133, 1137,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0, 1133, 1137, 1162, 1162, 1162, 1162, 1162, 1162, 1162,
+     1162, 1162, 1162, 1162, 1162, 1163, 1163, 1163, 1163, 1163,
+     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164,    0,
+     1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1165,
+     1165,    0, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165,
+
+     1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166,
+     1166, 1166, 1166, 1167, 1167, 1167, 1167, 1167, 1167, 1167,
+     1167, 1167, 1167, 1167, 1167, 1168, 1168, 1169, 1169, 1169,
+     1169, 1169, 1169, 1169, 1169, 1170, 1170, 1170, 1170, 1170,
+     1170, 1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171, 1171,
+     1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1172,
+     1172, 1172, 1172, 1172, 1172,    0, 1172, 1172, 1172,    0,
+     1172, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173,
+     1173, 1173, 1173, 1174,    0,    0, 1174, 1175, 1175, 1175,
+        0,    0, 1175,    0, 1175, 1175,    0, 1175, 1175, 1176,
+
+     1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
+     1176, 1177, 1177,    0, 1177, 1177, 1177, 1177, 1177, 1177,
+     1177, 1177, 1177, 1178, 1178, 1178, 1178, 1178, 1178,    0,
+     1178, 1178, 1178,    0, 1178, 1179, 1179, 1179, 1179, 1179,
+     1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, 1180, 1180,
+     1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1181,
+        0,    0, 1181, 1182,    0,    0,    0, 1182,    0,    0,
+        0,    0,    0, 1182, 1183, 1183, 1183, 1183, 1183, 1183,
+     1183, 1183, 1183, 1183, 1183, 1183, 1184, 1184,    0, 1184,
+     1184, 1184, 1184, 1184, 1184, 1184, 1184, 1184, 1185, 1185,
+
+        0, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185, 1185,
+     1186, 1186,    0, 1186, 1186, 1186, 1186, 1186, 1186, 1186,
+     1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187,
+     1187, 1187, 1187, 1187, 1188, 1188, 1188, 1188, 1188, 1188,
+     1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1189,
+     1189, 1189, 1189, 1189, 1189, 1189, 1189, 1189, 1190, 1190,
+     1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190,
+     1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191,
+     1191, 1191, 1192, 1192,    0, 1192, 1192, 1192, 1192, 1192,
+     1192, 1192, 1192, 1192, 1193, 1193, 1193, 1193, 1193, 1193,
+
+     1193, 1193, 1193, 1193, 1193, 1193, 1194, 1194, 1194, 1194,
+     1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1195, 1195,
+        0, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
+     1196, 1196,    0, 1196, 1196, 1196, 1196, 1196, 1196, 1196,
+     1196, 1196, 1197, 1197,    0, 1197, 1197, 1197, 1197, 1197,
+     1197, 1197, 1197, 1197, 1198, 1198,    0, 1198, 1198, 1198,
+     1198, 1198, 1198, 1198, 1198, 1198, 1199, 1199,    0, 1199,
+     1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1200,
+     1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200,
+     1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201,
+
+     1201, 1201, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1202,
+     1202, 1202, 1202, 1202, 1203, 1203, 1203, 1203, 1203, 1203,
+     1203, 1203, 1203, 1203, 1203, 1203, 1204, 1204, 1204, 1204,
+     1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1205, 1205,
+     1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1205,
+     1206, 1206,    0, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1207, 1207,    0, 1207, 1207, 1207, 1207, 1207,
+     1207, 1207, 1207, 1207, 1208, 1208, 1208, 1208, 1208, 1208,
+     1208, 1208, 1208, 1208, 1208, 1208, 1209, 1209, 1209, 1209,
+     1209, 1209, 1209, 1209, 1209, 1209, 1209, 1209, 1210, 1210,
+
+     1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210,
+     1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211,
+     1211, 1211, 1212, 1212, 1212, 1212, 1212, 1212, 1212, 1212,
+     1212, 1212, 1212, 1212, 1213, 1213, 1213, 1213, 1213, 1213,
+     1213, 1213, 1213, 1213, 1213, 1213, 1214, 1214, 1214, 1214,
+     1214, 1214, 1214, 1214, 1214, 1214, 1214, 1214, 1161, 1161,
      1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
-     1161, 1161, 1161, 1161, 1162, 1162,  389, 1162, 1162, 1162,
-     1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162,
-     1162, 1163, 1163,  375, 1163, 1163, 1163, 1163, 1163, 1163,
-     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164,
-     1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
-     1164, 1164, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1165,
-
-     1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165,
-     1165, 1165, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166,
-     1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1167,
-      374, 1167,  372, 1167, 1167, 1168, 1168,  371, 1168, 1168,
-     1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
-     1168, 1168, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
-     1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1170,
-     1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 1170,
-     1170, 1170, 1170, 1170, 1170, 1170, 1171, 1171,  365, 1171,
-     1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
-
-     1171, 1171, 1171, 1172, 1172,  358, 1172, 1172, 1172, 1172,
-     1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172,
-     1173, 1173,  353, 1173, 1173, 1173, 1173, 1173, 1173, 1173,
-     1173, 1173, 1173, 1173, 1173, 1173, 1173, 1174, 1174, 1174,
-     1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174,
-     1174, 1174, 1174, 1174, 1175, 1175, 1175, 1175, 1175, 1175,
-     1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175,
-     1175, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
-     1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1177, 1177,
-     1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177,
-
-     1177, 1177, 1177, 1177, 1177, 1178, 1178, 1178, 1178, 1178,
-     1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178,
-     1178, 1178, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179,
-     1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179,  345,
-      344,  334,  333,  332,  331,  330,  329,  328,  326,  262,
-      244,  243,  237,  236,  235,  233,  232,  231,  230,  228,
-      213,  212,  210,  209,  204,  198,  195,  192,  178,  173,
-      171,  170,  167,  101,  100,   96,   95,   82,   81,   77,
-       76,   75,   69,   68,   63,   58,   13,    7, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161
     } ;
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
+
+extern int fortran_flex_debug;
+int fortran_flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
@@ -1695,7 +2897,6 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+char *fortrantext;
 #line 1 "fortran.lex"
-#define INITIAL 0
 /******************************************************************************/
 /*                                                                            */
@@ -1732,13 +2933,8 @@
 /* version 1.7                                                                */
 /******************************************************************************/
-#define parameter 1
-
-#define character 2
-
-#define donottreat 3
-
-#define fortran77style 4
-
-#define fortran90style 5
+
+
+
+
 
 #line 41 "fortran.lex"
@@ -1746,5 +2942,5 @@
 #include <stdlib.h>
 #include <string.h>
-extern FILE * yyin;
+extern FILE * fortranin;
 #define MAX_INCLUDE_DEPTH 30
 #define tabsize 6
@@ -1768,17 +2964,67 @@
            if (firstpass == 0) \
            {\
-              strcat(curbuf,yytext); \
+              strcat(curbuf,fortrantext); \
               Save_Length(curbuf,38); \
-              strcpy(motparse,yytext);\
+              strcpy(motparse,fortrantext);\
               Save_Length(motparse,32); \
               colnum = colnum + strlen(motparse);\
               ECHO; \
            }\
-           strcpy(motparse1,yytext);\
-           /*printf("yytext = %s\n",yytext);*/\
+           strcpy(motparse1,fortrantext);\
+/*           printf("fortrantext = %s\n",fortrantext);*/\
         /*if ( firstpass == 1 ) 
-                      printf("yytext = %s %d\n",yytext,strlen(yytext));*/\
+                      printf("fortrantext = %s %d\n",fortrantext,strlen(fortrantext));*/\
         }
-#line 1783 "fortran.yy.c"
+#line 2979 "fortran.yy.c"
+
+#define INITIAL 0
+#define parameter 1
+#define character 2
+#define donottreat 3
+#define fortran77style 4
+#define fortran90style 5
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int fortranlex_destroy (void );
+
+int fortranget_debug (void );
+
+void fortranset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE fortranget_extra (void );
+
+void fortranset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *fortranget_in (void );
+
+void fortranset_in  (FILE * in_str  );
+
+FILE *fortranget_out (void );
+
+void fortranset_out  (FILE * out_str  );
+
+yy_size_t fortranget_leng (void );
+
+char *fortranget_text (void );
+
+int fortranget_lineno (void );
+
+void fortranset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
@@ -1788,63 +3034,28 @@
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int fortranwrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
+extern int fortranwrap (void );
 #endif
 #endif
 
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+    static void yyunput (int c,char *buf_ptr  );
+    
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
 #endif
 
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
 #endif
 
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
 #endif
 
@@ -1855,10 +3066,9 @@
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO fwrite( fortrantext, fortranleng, 1, fortranout )
 #endif
 
@@ -1868,19 +3078,33 @@
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
-		int c = '*', n; \
+		int c = '*'; \
+		yy_size_t n; \
 		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			     (c = getc( fortranin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
 		if ( c == '\n' ) \
 			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
+		if ( c == EOF && ferror( fortranin ) ) \
 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 		result = n; \
 		} \
-	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-		  && ferror( yyin ) ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, fortranin))==0 && ferror(fortranin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(fortranin); \
+			} \
+		}\
+\
+
 #endif
 
@@ -1903,12 +3127,18 @@
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
+#define YY_DECL_IS_OURS 1
+
+extern int fortranlex (void);
+
+#define YY_DECL int fortranlex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after fortrantext and fortranleng
  * have been set up.
  */
@@ -1923,25 +3153,27 @@
 
 #define YY_RULE_SETUP \
-	if ( yyleng > 0 ) \
-		yy_current_buffer->yy_at_bol = \
-				(yytext[yyleng - 1] == '\n'); \
+	if ( fortranleng > 0 ) \
+		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+				(fortrantext[fortranleng - 1] == '\n'); \
 	YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-	{
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-
-#line 106 "fortran.lex"
+    
+#line 107 "fortran.lex"
 
   if (infixed) BEGIN(fortran77style) ;
   if (infree) BEGIN(fortran90style)  ;
 
-#line 1942 "fortran.yy.c"
-
-	if ( yy_init )
+#line 3174 "fortran.yy.c"
+
+	if ( !(yy_init) )
 		{
-		yy_init = 0;
+		(yy_init) = 1;
 
 #ifdef YY_USER_INIT
@@ -1949,26 +3181,28 @@
 #endif
 
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
+		if ( ! (yy_start) )
+			(yy_start) = 1;	/* first start state */
+
+		if ( ! fortranin )
+			fortranin = stdin;
+
+		if ( ! fortranout )
+			fortranout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			fortranensure_buffer_stack ();
+			YY_CURRENT_BUFFER_LVALUE =
+				fortran_create_buffer(fortranin,YY_BUF_SIZE );
+		}
+
+		fortran_load_buffer_state( );
 		}
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
+		yy_cp = (yy_c_buf_p);
+
+		/* Support of fortrantext. */
+		*yy_cp = (yy_hold_char);
 
 		/* yy_bp points to the position in yy_ch_buf of the start of
@@ -1977,5 +3211,5 @@
 		yy_bp = yy_cp;
 
-		yy_current_state = yy_start;
+		yy_current_state = (yy_start);
 		yy_current_state += YY_AT_BOL();
 yy_match:
@@ -1985,11 +3219,11 @@
 			if ( yy_accept[yy_current_state] )
 				{
-				yy_last_accepting_state = yy_current_state;
-				yy_last_accepting_cpos = yy_cp;
+				(yy_last_accepting_state) = yy_current_state;
+				(yy_last_accepting_cpos) = yy_cp;
 				}
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 1124 )
+				if ( yy_current_state >= 1162 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
@@ -1997,5 +3231,5 @@
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 4189 );
+		while ( yy_base[yy_current_state] != 9159 );
 
 yy_find_action:
@@ -2003,6 +3237,6 @@
 		if ( yy_act == 0 )
 			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			yy_act = yy_accept[yy_current_state];
 			}
@@ -2010,7 +3244,5 @@
 		YY_DO_BEFORE_ACTION;
 
-
 do_action:	/* This label is used only to access EOF actions. */
-
 
 		switch ( yy_act )
@@ -2018,94 +3250,99 @@
 			case 0: /* must back up */
 			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			*yy_cp = (yy_hold_char);
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			goto yy_find_action;
 
 case 1:
 YY_RULE_SETUP
-#line 110 "fortran.lex"
+#line 111 "fortran.lex"
 return TOK_DEBUT;
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 111 "fortran.lex"
+#line 112 "fortran.lex"
 return TOK_FIN;
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 112 "fortran.lex"
+#line 113 "fortran.lex"
 return TOK_OMP;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 113 "fortran.lex"
+#line 114 "fortran.lex"
 return TOK_DOLLAR;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 115 "fortran.lex"
+#line 116 "fortran.lex"
 {return TOK_REAL8;}
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 116 "fortran.lex"
+#line 117 "fortran.lex"
 {return TOK_SUBROUTINE;}
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 117 "fortran.lex"
+#line 118 "fortran.lex"
 {return TOK_PROGRAM;}
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 118 "fortran.lex"
+#line 119 "fortran.lex"
 {inallocate = 1; return TOK_ALLOCATE;}
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 119 "fortran.lex"
+#line 120 "fortran.lex"
+{return TOK_NULLIFY;}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 121 "fortran.lex"
 {inallocate = 1; return TOK_DEALLOCATE;}
 	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 120 "fortran.lex"
+case 11:
+YY_RULE_SETUP
+#line 122 "fortran.lex"
 {return TOK_RESULT;}
 	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 121 "fortran.lex"
+case 12:
+YY_RULE_SETUP
+#line 123 "fortran.lex"
 {return TOK_FUNCTION;}
 	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 122 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDSUBROUTINE;}
-	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 123 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDPROGRAM;}
+#line 124 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDSUBROUTINE;}
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 124 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDFUNCTION;}
+#line 125 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDPROGRAM;}
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 125 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_ENDUNIT;}
+#line 126 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDFUNCTION;}
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 126 "fortran.lex"
+#line 127 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_ENDUNIT;}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 128 "fortran.lex"
 return TOK_INCLUDE;
 	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 127 "fortran.lex"
+case 18:
+YY_RULE_SETUP
+#line 129 "fortran.lex"
 {
-                            strcpy(yylval.na,yytext);
+                            strcpy(yylval.na,fortrantext);
                             tmpc = input();
                             unput(tmpc);
@@ -2124,758 +3361,778 @@
                          }
 	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 144 "fortran.lex"
+case 19:
+YY_RULE_SETUP
+#line 146 "fortran.lex"
 {return TOK_REWIND;}
 	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 145 "fortran.lex"
+case 20:
+YY_RULE_SETUP
+#line 147 "fortran.lex"
 return TOK_IMPLICIT;
 	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 146 "fortran.lex"
+case 21:
+YY_RULE_SETUP
+#line 148 "fortran.lex"
 return TOK_NONE;
 	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 147 "fortran.lex"
+case 22:
+YY_RULE_SETUP
+#line 149 "fortran.lex"
 return TOK_CALL;
 	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 148 "fortran.lex"
+case 23:
+YY_RULE_SETUP
+#line 150 "fortran.lex"
 return TOK_TRUE;
 	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 149 "fortran.lex"
+case 24:
+YY_RULE_SETUP
+#line 151 "fortran.lex"
 return TOK_FALSE;
 	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 150 "fortran.lex"
+case 25:
+YY_RULE_SETUP
+#line 152 "fortran.lex"
 {return TOK_POINT_TO;}
 	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 151 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DASTER;}
-	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 152 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_EQV;}
+#line 153 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DASTER;}
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 153 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_EQ;}
+#line 154 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_EQV;}
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 154 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_GT;}
+#line 155 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_EQ;}
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 155 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_GE;}
+#line 156 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_GT;}
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 156 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LT;}
+#line 157 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_GE;}
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 157 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LE;}
+#line 158 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LT;}
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 158 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NEQV;}
+#line 159 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LE;}
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 159 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NE;}
+#line 160 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NEQV;}
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 160 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NOT;}
+#line 161 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NE;}
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 161 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_OR;}
+#line 162 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NOT;}
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 162 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_XOR;}
+#line 163 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_OR;}
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 163 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_AND;}
+#line 164 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_XOR;}
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 164 "fortran.lex"
+#line 165 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_AND;}
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 166 "fortran.lex"
 {return TOK_MODULE;}
 	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 165 "fortran.lex"
+case 40:
+YY_RULE_SETUP
+#line 167 "fortran.lex"
 {return TOK_DOWHILE;}
 	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 166 "fortran.lex"
+case 41:
+YY_RULE_SETUP
+#line 168 "fortran.lex"
 return TOK_ENDMODULE;
 	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 167 "fortran.lex"
+case 42:
+YY_RULE_SETUP
+#line 169 "fortran.lex"
 return TOK_ENDDO;
 	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 168 "fortran.lex"
+case 43:
+YY_RULE_SETUP
+#line 170 "fortran.lex"
 {return TOK_PLAINDO;}
 	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 169 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_REAL;}
-	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 170 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_INTEGER;}
+#line 171 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_REAL;}
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 171 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_LOGICAL;}
+#line 172 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_INTEGER;}
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 172 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHARACTER;}
+#line 173 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_LOGICAL;}
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 173 "fortran.lex"
+#line 174 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHARACTER;}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 175 "fortran.lex"
 {return TOK_ALLOCATABLE;}
 	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 174 "fortran.lex"
+case 49:
+YY_RULE_SETUP
+#line 176 "fortran.lex"
 return TOK_CLOSE;
 	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 175 "fortran.lex"
+case 50:
+YY_RULE_SETUP
+#line 177 "fortran.lex"
 return TOK_INQUIRE;
 	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 176 "fortran.lex"
+case 51:
+YY_RULE_SETUP
+#line 178 "fortran.lex"
 {return TOK_DIMENSION;}
 	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 177 "fortran.lex"
+case 52:
+YY_RULE_SETUP
+#line 179 "fortran.lex"
 return TOK_PAUSE;
 	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 178 "fortran.lex"
+case 53:
+YY_RULE_SETUP
+#line 180 "fortran.lex"
 return TOK_EQUIVALENCE;
 	YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 179 "fortran.lex"
+case 54:
+YY_RULE_SETUP
+#line 181 "fortran.lex"
 return TOK_STOP;
 	YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 180 "fortran.lex"
+case 55:
+YY_RULE_SETUP
+#line 182 "fortran.lex"
 return TOK_WHERE;
 	YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 181 "fortran.lex"
+case 56:
+YY_RULE_SETUP
+#line 183 "fortran.lex"
 return TOK_ENDWHERE;
 	YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 182 "fortran.lex"
+case 57:
+YY_RULE_SETUP
+#line 184 "fortran.lex"
 return TOK_ELSEWHERE;
 	YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 183 "fortran.lex"
+case 58:
+YY_RULE_SETUP
+#line 185 "fortran.lex"
 {return TOK_COMPLEX;}
 	YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 184 "fortran.lex"
+case 59:
+YY_RULE_SETUP
+#line 186 "fortran.lex"
 {return TOK_CONTAINS;}
 	YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 185 "fortran.lex"
+case 60:
+YY_RULE_SETUP
+#line 187 "fortran.lex"
 {return TOK_ONLY;}
 	YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 186 "fortran.lex"
+case 61:
+YY_RULE_SETUP
+#line 188 "fortran.lex"
 {return TOK_PARAMETER;}
 	YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 187 "fortran.lex"
+case 62:
+YY_RULE_SETUP
+#line 189 "fortran.lex"
 {return TOK_RECURSIVE;}
 	YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 188 "fortran.lex"
+case 63:
+YY_RULE_SETUP
+#line 190 "fortran.lex"
 {return TOK_COMMON;}
 	YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 189 "fortran.lex"
+case 64:
+YY_RULE_SETUP
+#line 191 "fortran.lex"
 {return TOK_GLOBAL;}
 	YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 190 "fortran.lex"
+case 65:
+YY_RULE_SETUP
+#line 192 "fortran.lex"
 {return TOK_EXTERNAL;}
 	YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 191 "fortran.lex"
+case 66:
+YY_RULE_SETUP
+#line 193 "fortran.lex"
 {return TOK_INTENT;}
 	YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 192 "fortran.lex"
+case 67:
+YY_RULE_SETUP
+#line 194 "fortran.lex"
 {return TOK_POINTER;}
 	YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 193 "fortran.lex"
+case 68:
+YY_RULE_SETUP
+#line 195 "fortran.lex"
 {return TOK_OPTIONAL;}
 	YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 194 "fortran.lex"
+case 69:
+YY_RULE_SETUP
+#line 196 "fortran.lex"
 {return TOK_SAVE;}
 	YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 195 "fortran.lex"
+case 70:
+YY_RULE_SETUP
+#line 197 "fortran.lex"
 {return TOK_TYPE;}
 	YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 196 "fortran.lex"
+case 71:
+YY_RULE_SETUP
+#line 198 "fortran.lex"
 {return TOK_TYPEPAR;}
 	YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 197 "fortran.lex"
-{if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,yytext);return TOK_NAME;}}
-	YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 198 "fortran.lex"
+#line 199 "fortran.lex"
+{if (inallocate == 1) return TOK_STAT; else {strcpy(yylval.na,fortrantext);return TOK_NAME;}}
+	YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 200 "fortran.lex"
 {return TOK_ENDTYPE;}
 	YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 199 "fortran.lex"
+case 74:
+YY_RULE_SETUP
+#line 201 "fortran.lex"
 return TOK_OPEN;
 	YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 200 "fortran.lex"
+case 75:
+YY_RULE_SETUP
+#line 202 "fortran.lex"
 return TOK_RETURN;
 	YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 201 "fortran.lex"
+case 76:
+/* rule 76 can match eol */
+YY_RULE_SETUP
+#line 203 "fortran.lex"
 return TOK_EXIT;
 	YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 202 "fortran.lex"
+case 77:
+YY_RULE_SETUP
+#line 204 "fortran.lex"
 return TOK_PRINT;
 	YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 203 "fortran.lex"
+case 78:
+YY_RULE_SETUP
+#line 205 "fortran.lex"
 {return TOK_PROCEDURE;}
 	YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 204 "fortran.lex"
+case 79:
+YY_RULE_SETUP
+#line 206 "fortran.lex"
 {return TOK_READ;}
 	YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 205 "fortran.lex"
+case 80:
+YY_RULE_SETUP
+#line 207 "fortran.lex"
 {return TOK_NAMELIST;}
 	YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 206 "fortran.lex"
+case 81:
+YY_RULE_SETUP
+#line 208 "fortran.lex"
 {return TOK_WRITE;}
 	YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 207 "fortran.lex"
+case 82:
+YY_RULE_SETUP
+#line 209 "fortran.lex"
 {return TOK_TARGET;}
 	YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 208 "fortran.lex"
+case 83:
+YY_RULE_SETUP
+#line 210 "fortran.lex"
 {return TOK_PUBLIC;}
 	YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 209 "fortran.lex"
+case 84:
+YY_RULE_SETUP
+#line 211 "fortran.lex"
 {return TOK_PRIVATE;}
 	YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 210 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_IN;}
-	YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 211 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DATA;}
+#line 212 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_IN;}
 	YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 212 "fortran.lex"
+#line 213 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DATA;}
+	YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 214 "fortran.lex"
 return TOK_CONTINUE;
 	YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 213 "fortran.lex"
+case 88:
+YY_RULE_SETUP
+#line 215 "fortran.lex"
 {return TOK_PLAINGOTO;}
 	YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 214 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_OUT;}
-	YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 215 "fortran.lex"
-{strcpy(yylval.nac,yytext);return TOK_INOUT;}
+#line 216 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_OUT;}
 	YY_BREAK
 case 90:
 YY_RULE_SETUP
-#line 216 "fortran.lex"
+#line 217 "fortran.lex"
+{strcpy(yylval.nac,fortrantext);return TOK_INOUT;}
+	YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 218 "fortran.lex"
 {return TOK_INTRINSIC;}
 	YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 217 "fortran.lex"
+case 92:
+YY_RULE_SETUP
+#line 219 "fortran.lex"
 {return TOK_THEN;}
 	YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 218 "fortran.lex"
+case 93:
+YY_RULE_SETUP
+#line 220 "fortran.lex"
 {return TOK_ELSEIF;}
 	YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 219 "fortran.lex"
+case 94:
+YY_RULE_SETUP
+#line 221 "fortran.lex"
 {return TOK_ELSE;}
 	YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 220 "fortran.lex"
+case 95:
+YY_RULE_SETUP
+#line 222 "fortran.lex"
 {return TOK_ENDIF;}
 	YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 221 "fortran.lex"
+case 96:
+YY_RULE_SETUP
+#line 223 "fortran.lex"
 {return TOK_LOGICALIF;}
 	YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 222 "fortran.lex"
+case 97:
+YY_RULE_SETUP
+#line 224 "fortran.lex"
 {return TOK_SUM;}
 	YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 223 "fortran.lex"
+case 98:
+YY_RULE_SETUP
+#line 225 "fortran.lex"
 {return TOK_MAX;}
 	YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 224 "fortran.lex"
+case 99:
+YY_RULE_SETUP
+#line 226 "fortran.lex"
 {return TOK_TANH;}
 	YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 225 "fortran.lex"
+case 100:
+YY_RULE_SETUP
+#line 227 "fortran.lex"
 {return TOK_MAXVAL;}
 	YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 226 "fortran.lex"
+case 101:
+YY_RULE_SETUP
+#line 228 "fortran.lex"
 {return TOK_TRIM;}
 	YY_BREAK
-case 101:
-YY_RULE_SETUP
-#line 227 "fortran.lex"
+case 102:
+YY_RULE_SETUP
+#line 229 "fortran.lex"
 {return TOK_SQRT;}
 	YY_BREAK
-case 102:
-YY_RULE_SETUP
-#line 228 "fortran.lex"
+case 103:
+YY_RULE_SETUP
+#line 230 "fortran.lex"
 {return TOK_SELECTCASE;}
 	YY_BREAK
-case 103:
-YY_RULE_SETUP
-#line 229 "fortran.lex"
+case 104:
+YY_RULE_SETUP
+#line 231 "fortran.lex"
 {return TOK_CASE;}
 	YY_BREAK
-case 104:
-YY_RULE_SETUP
-#line 230 "fortran.lex"
+case 105:
+YY_RULE_SETUP
+#line 232 "fortran.lex"
 {return TOK_CASEDEFAULT;}
 	YY_BREAK
-case 105:
-YY_RULE_SETUP
-#line 231 "fortran.lex"
+case 106:
+YY_RULE_SETUP
+#line 233 "fortran.lex"
 {return TOK_ENDSELECT;}
 	YY_BREAK
-case 106:
-YY_RULE_SETUP
-#line 232 "fortran.lex"
+case 107:
+YY_RULE_SETUP
+#line 234 "fortran.lex"
 {return TOK_FILE;}
 	YY_BREAK
-case 107:
-YY_RULE_SETUP
-#line 233 "fortran.lex"
+case 108:
+YY_RULE_SETUP
+#line 235 "fortran.lex"
 {return TOK_END;}
 	YY_BREAK
-case 108:
-YY_RULE_SETUP
-#line 234 "fortran.lex"
+case 109:
+YY_RULE_SETUP
+#line 236 "fortran.lex"
 {return TOK_ERR;}
 	YY_BREAK
-case 109:
-YY_RULE_SETUP
-#line 235 "fortran.lex"
+case 110:
+YY_RULE_SETUP
+#line 237 "fortran.lex"
 {return TOK_EXIST;}
 	YY_BREAK
-case 110:
-YY_RULE_SETUP
-#line 236 "fortran.lex"
+case 111:
+YY_RULE_SETUP
+#line 238 "fortran.lex"
 {return TOK_MIN;}
 	YY_BREAK
-case 111:
-YY_RULE_SETUP
-#line 237 "fortran.lex"
+case 112:
+YY_RULE_SETUP
+#line 239 "fortran.lex"
 {return TOK_NINT;}
 	YY_BREAK
-case 112:
-YY_RULE_SETUP
-#line 238 "fortran.lex"
+case 113:
+YY_RULE_SETUP
+#line 240 "fortran.lex"
 {return TOK_FLOAT;}
 	YY_BREAK
-case 113:
-YY_RULE_SETUP
-#line 239 "fortran.lex"
+case 114:
+YY_RULE_SETUP
+#line 241 "fortran.lex"
 {return TOK_EXP;}
 	YY_BREAK
-case 114:
-YY_RULE_SETUP
-#line 240 "fortran.lex"
+case 115:
+YY_RULE_SETUP
+#line 242 "fortran.lex"
 {return TOK_COS;}
 	YY_BREAK
-case 115:
-YY_RULE_SETUP
-#line 241 "fortran.lex"
+case 116:
+YY_RULE_SETUP
+#line 243 "fortran.lex"
 {return TOK_COSH;}
 	YY_BREAK
-case 116:
-YY_RULE_SETUP
-#line 242 "fortran.lex"
+case 117:
+YY_RULE_SETUP
+#line 244 "fortran.lex"
 {return TOK_ACOS;}
 	YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 243 "fortran.lex"
+case 118:
+YY_RULE_SETUP
+#line 245 "fortran.lex"
 {return TOK_SIN;}
 	YY_BREAK
-case 118:
-YY_RULE_SETUP
-#line 244 "fortran.lex"
+case 119:
+YY_RULE_SETUP
+#line 246 "fortran.lex"
 {return TOK_SINH;}
 	YY_BREAK
-case 119:
-YY_RULE_SETUP
-#line 245 "fortran.lex"
+case 120:
+YY_RULE_SETUP
+#line 247 "fortran.lex"
 {return TOK_ASIN;}
 	YY_BREAK
-case 120:
-YY_RULE_SETUP
-#line 246 "fortran.lex"
+case 121:
+YY_RULE_SETUP
+#line 248 "fortran.lex"
 {return TOK_LOG;}
 	YY_BREAK
-case 121:
-YY_RULE_SETUP
-#line 247 "fortran.lex"
+case 122:
+YY_RULE_SETUP
+#line 249 "fortran.lex"
 {return TOK_TAN;}
 	YY_BREAK
-case 122:
-YY_RULE_SETUP
-#line 248 "fortran.lex"
+case 123:
+YY_RULE_SETUP
+#line 250 "fortran.lex"
 {return TOK_ATAN;}
 	YY_BREAK
-case 123:
-YY_RULE_SETUP
-#line 249 "fortran.lex"
+case 124:
+YY_RULE_SETUP
+#line 251 "fortran.lex"
 {return TOK_CYCLE;}
 	YY_BREAK
-case 124:
-YY_RULE_SETUP
-#line 250 "fortran.lex"
+case 125:
+YY_RULE_SETUP
+#line 252 "fortran.lex"
 {return TOK_ABS;}
 	YY_BREAK
-case 125:
-YY_RULE_SETUP
-#line 251 "fortran.lex"
+case 126:
+YY_RULE_SETUP
+#line 253 "fortran.lex"
 {return TOK_MOD;}
 	YY_BREAK
-case 126:
-YY_RULE_SETUP
-#line 252 "fortran.lex"
+case 127:
+YY_RULE_SETUP
+#line 254 "fortran.lex"
 {return TOK_SIGN;}
 	YY_BREAK
-case 127:
-YY_RULE_SETUP
-#line 253 "fortran.lex"
+case 128:
+YY_RULE_SETUP
+#line 255 "fortran.lex"
 {return TOK_MINLOC;}
 	YY_BREAK
-case 128:
-YY_RULE_SETUP
-#line 254 "fortran.lex"
+case 129:
+YY_RULE_SETUP
+#line 256 "fortran.lex"
 {return TOK_MAXLOC;}
 	YY_BREAK
-case 129:
-YY_RULE_SETUP
-#line 255 "fortran.lex"
+case 130:
+YY_RULE_SETUP
+#line 257 "fortran.lex"
 {return TOK_MINVAL;}
 	YY_BREAK
-case 130:
-YY_RULE_SETUP
-#line 256 "fortran.lex"
-{return TOK_INTERFACE;}
-	YY_BREAK
 case 131:
 YY_RULE_SETUP
-#line 257 "fortran.lex"
+#line 258 "fortran.lex"
 {return TOK_BACKSPACE;}
 	YY_BREAK
 case 132:
-YY_RULE_SETUP
-#line 258 "fortran.lex"
-{return TOK_ENDINTERFACE;}
-	YY_BREAK
-case 133:
 YY_RULE_SETUP
 #line 259 "fortran.lex"
 {return TOK_LEFTAB;}
 	YY_BREAK
-case 134:
+case 133:
 YY_RULE_SETUP
 #line 260 "fortran.lex"
 {return TOK_RIGHTAB;}
 	YY_BREAK
-case 135:
+case 134:
+/* rule 134 can match eol */
 YY_RULE_SETUP
 #line 261 "fortran.lex"
 {return TOK_FORMAT;}
 	YY_BREAK
+case 135:
+YY_RULE_SETUP
+#line 262 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DOUBLEPRECISION;}
+	YY_BREAK
 case 136:
 YY_RULE_SETUP
-#line 262 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DOUBLEPRECISION;}
+#line 263 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DOUBLECOMPLEX;}
 	YY_BREAK
 case 137:
 YY_RULE_SETUP
-#line 263 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DOUBLECOMPLEX;}
+#line 264 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_SLASH;}
 	YY_BREAK
 case 138:
 YY_RULE_SETUP
-#line 264 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_SLASH;}
+#line 265 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_DSLASH;}
 	YY_BREAK
 case 139:
-YY_RULE_SETUP
-#line 265 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_DSLASH;}
+/* rule 139 can match eol */
+YY_RULE_SETUP
+#line 266 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_CUT;}
 	YY_BREAK
 case 140:
 YY_RULE_SETUP
-#line 266 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_CUT;}
+#line 267 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_CONSTANT;}
 	YY_BREAK
 case 141:
 YY_RULE_SETUP
-#line 267 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_CONSTANT;}
+#line 268 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_MESSAGE;}
 	YY_BREAK
 case 142:
 YY_RULE_SETUP
-#line 268 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_MESSAGE;}
+#line 269 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CHAR_INT;}
 	YY_BREAK
 case 143:
 YY_RULE_SETUP
-#line 269 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CHAR_INT;}
+#line 270 "fortran.lex"
+{printf("debug interfacer\n");BEGIN(donottreat);}
 	YY_BREAK
 case 144:
-YY_RULE_SETUP
-#line 270 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_NAME;}
+/* rule 144 can match eol */
+YY_RULE_SETUP
+#line 271 "fortran.lex"
+{
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
 	YY_BREAK
 case 145:
 YY_RULE_SETUP
-#line 271 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREAL;}
+#line 278 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_NAME;}
 	YY_BREAK
 case 146:
 YY_RULE_SETUP
-#line 272 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREALDP;}
+#line 279 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREAL;}
 	YY_BREAK
 case 147:
 YY_RULE_SETUP
-#line 273 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREALQP;}
+#line 280 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREALDP;}
 	YY_BREAK
 case 148:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 274 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTREAL;}
+YY_RULE_SETUP
+#line 281 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREALQP;}
 	YY_BREAK
 case 149:
-YY_RULE_SETUP
-#line 275 "fortran.lex"
-{strcpy(yylval.na,yytext);return TOK_CSTINT;}
+/* rule 149 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up fortrantext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up fortrantext again */
+YY_RULE_SETUP
+#line 282 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTREAL;}
 	YY_BREAK
 case 150:
 YY_RULE_SETUP
-#line 276 "fortran.lex"
+#line 283 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return TOK_CSTINT;}
+	YY_BREAK
+case 151:
+YY_RULE_SETUP
+#line 284 "fortran.lex"
 {}
 	YY_BREAK
-case 151:
-YY_RULE_SETUP
-#line 277 "fortran.lex"
+case 152:
+YY_RULE_SETUP
+#line 285 "fortran.lex"
 {return TOK_QUOTE;}
 	YY_BREAK
-case 152:
-YY_RULE_SETUP
-#line 278 "fortran.lex"
+case 153:
+YY_RULE_SETUP
+#line 286 "fortran.lex"
 {}
 	YY_BREAK
-case 153:
-YY_RULE_SETUP
-#line 279 "fortran.lex"
-{strcpy(yylval.na,yytext);return (int) *yytext;}
-	YY_BREAK
 case 154:
 YY_RULE_SETUP
-#line 280 "fortran.lex"
+#line 287 "fortran.lex"
+{strcpy(yylval.na,fortrantext);return (int) *fortrantext;}
+	YY_BREAK
+case 155:
+YY_RULE_SETUP
+#line 288 "fortran.lex"
+{afterpercent = 1; strcpy(yylval.na,fortrantext);return (int) *fortrantext;}
+	YY_BREAK
+case 156:
+YY_RULE_SETUP
+#line 289 "fortran.lex"
 {return TOK_SEMICOLON;}
 	YY_BREAK
-case 155:
-YY_RULE_SETUP
-#line 281 "fortran.lex"
-{return (int) *yytext;}
-	YY_BREAK
-case 156:
-YY_RULE_SETUP
-#line 282 "fortran.lex"
-{return (int) *yytext;}
-	YY_BREAK
 case 157:
 YY_RULE_SETUP
-#line 283 "fortran.lex"
-{return (int) *yytext;}
+#line 290 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 158:
 YY_RULE_SETUP
-#line 284 "fortran.lex"
-{return (int) *yytext;}
+#line 291 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 159:
 YY_RULE_SETUP
-#line 285 "fortran.lex"
-{colnum=0;line_num_fortran++;line_num_fortran_common++; return (int) *yytext;}
+#line 292 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 160:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 286 "fortran.lex"
-
+YY_RULE_SETUP
+#line 293 "fortran.lex"
+{return (int) *fortrantext;}
 	YY_BREAK
 case 161:
-YY_RULE_SETUP
-#line 287 "fortran.lex"
+/* rule 161 can match eol */
+YY_RULE_SETUP
+#line 294 "fortran.lex"
+{colnum=0;line_num_fortran++;line_num_fortran_common++; return (int) *fortrantext;}
+	YY_BREAK
+case 162:
+*yy_cp = (yy_hold_char); /* undo effects of setting up fortrantext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up fortrantext again */
+YY_RULE_SETUP
+#line 295 "fortran.lex"
+
+	YY_BREAK
+case 163:
+YY_RULE_SETUP
+#line 296 "fortran.lex"
 {if (newlinef90 == 0) return TOK_LABEL; else newlinef90 = 0;}
 	YY_BREAK
-case 162:
-YY_RULE_SETUP
-#line 288 "fortran.lex"
-
-	YY_BREAK
-case 163:
-YY_RULE_SETUP
-#line 289 "fortran.lex"
+case 164:
+YY_RULE_SETUP
+#line 297 "fortran.lex"
+
+	YY_BREAK
+case 165:
+YY_RULE_SETUP
+#line 298 "fortran.lex"
 {colnum=colnum-1+tabsize;}
 	YY_BREAK
-case 164:
-YY_RULE_SETUP
-#line 290 "fortran.lex"
+case 166:
+YY_RULE_SETUP
+#line 299 "fortran.lex"
 ;
 	YY_BREAK
-case 165:
-YY_RULE_SETUP
-#line 291 "fortran.lex"
+case 167:
+/* rule 167 can match eol */
+YY_RULE_SETUP
+#line 300 "fortran.lex"
 {line_num_fortran++;line_num_fortran_common++;newlinef90=1;colnum=0;}
 	YY_BREAK
-case 166:
-YY_RULE_SETUP
-#line 292 "fortran.lex"
+case 168:
+/* rule 168 can match eol */
+YY_RULE_SETUP
+#line 301 "fortran.lex"
 {line_num_fortran++;line_num_fortran_common++;colnum=0;}
 	YY_BREAK
-case 167:
-YY_RULE_SETUP
-#line 293 "fortran.lex"
+case 169:
+/* rule 169 can match eol */
+YY_RULE_SETUP
+#line 302 "fortran.lex"
 {
                            convert2lower(motparse1);
@@ -2886,28 +4143,62 @@
                            else
                            {
-                              colnum=0;line_num_fortran++;line_num_fortran_common++;
-                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) return TOK_DONOTTREAT;
+                            /*  colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(motparse1,"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
                              if ( !strcasecmp(motparse1,"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
                            }
                          }
 	YY_BREAK
-case 168:
-YY_RULE_SETUP
-#line 306 "fortran.lex"
-BEGIN(donottreat);
-	YY_BREAK
-case 169:
-YY_RULE_SETUP
-#line 307 "fortran.lex"
-BEGIN(INITIAL);
-	YY_BREAK
 case 170:
-YY_RULE_SETUP
-#line 308 "fortran.lex"
-
+/* rule 170 can match eol */
+YY_RULE_SETUP
+#line 317 "fortran.lex"
+{
+                           convert2lower(&motparse1[1]);
+                           if ( strncasecmp(&motparse1[1],"contains",8) == 0 )
+                           {
+                              return TOK_CONTAINS;
+                           }
+                           else
+                           {
+                             /* colnum=0;line_num_fortran++;line_num_fortran_common++;*/
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_DO_NOT_TREAT\n")) 
+                             return TOK_DONOTTREAT;
+                             if ( !strcasecmp(&motparse1[1],"C$AGRIF_END_DO_NOT_TREAT\n")) return TOK_ENDDONOTTREAT;
+                             unput('\n');
+                           }
+                         }                            
 	YY_BREAK
 case 171:
-YY_RULE_SETUP
-#line 309 "fortran.lex"
+/* rule 171 can match eol */
+YY_RULE_SETUP
+#line 332 "fortran.lex"
+{
+						BEGIN(donottreat);
+						}
+	YY_BREAK
+case 172:
+/* rule 172 can match eol */
+YY_RULE_SETUP
+#line 335 "fortran.lex"
+{
+						BEGIN(INITIAL);
+                        if (infixed) BEGIN(fortran77style) ;
+                        if (infree) BEGIN(fortran90style)  ;
+                        line_num_fortran++;line_num_fortran_common++;
+                        return '\n';
+						}
+	YY_BREAK
+case 173:
+/* rule 173 can match eol */
+YY_RULE_SETUP
+#line 342 "fortran.lex"
+{line_num_fortran++;line_num_fortran_common++;}
+	YY_BREAK
+case 174:
+/* rule 174 can match eol */
+YY_RULE_SETUP
+#line 343 "fortran.lex"
 {
                              colnum = 0;
@@ -2916,7 +4207,7 @@
                           }
 	YY_BREAK
-case 172:
-YY_RULE_SETUP
-#line 314 "fortran.lex"
+case 175:
+YY_RULE_SETUP
+#line 348 "fortran.lex"
 {
                              colnum = 0;
@@ -2925,10 +4216,10 @@
                           }
 	YY_BREAK
-case 173:
-YY_RULE_SETUP
-#line 319 "fortran.lex"
+case 176:
+YY_RULE_SETUP
+#line 353 "fortran.lex"
 ECHO;
 	YY_BREAK
-#line 2933 "fortran.yy.c"
+#line 4224 "fortran.yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(parameter):
@@ -2942,24 +4233,24 @@
 		{
 		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
+		*yy_cp = (yy_hold_char);
 		YY_RESTORE_YY_MORE_OFFSET
 
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 			{
 			/* We're scanning a new file or input source.  It's
 			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
+			 * just pointed fortranin at a new source and called
+			 * fortranlex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
 			 * globals.  Here is the right place to do so, because
 			 * this is the first action (other than possibly a
 			 * back-up) that will match for the new input source.
 			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = fortranin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 			}
 
@@ -2971,11 +4262,11 @@
 		 * in input().
 		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			{ /* This was really a NUL. */
 			yy_state_type yy_next_state;
 
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
+			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state(  );
 
 			/* Okay, we're now positioned to make the NUL
@@ -2990,10 +4281,10 @@
 			yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
+			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
 			if ( yy_next_state )
 				{
 				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
+				yy_cp = ++(yy_c_buf_p);
 				yy_current_state = yy_next_state;
 				goto yy_match;
@@ -3002,20 +4293,20 @@
 			else
 				{
-				yy_cp = yy_c_buf_p;
+				yy_cp = (yy_c_buf_p);
 				goto yy_find_action;
 				}
 			}
 
-		else switch ( yy_get_next_buffer() )
+		else switch ( yy_get_next_buffer(  ) )
 			{
 			case EOB_ACT_END_OF_FILE:
 				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
+				(yy_did_buffer_switch_on_eof) = 0;
+
+				if ( fortranwrap( ) )
 					{
 					/* Note: because we've taken care in
 					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
+					 * fortrantext, we can now set up
 					 * yy_c_buf_p so that if some total
 					 * hoser (like flex itself) wants to
@@ -3024,5 +4315,5 @@
 					 * YY_NULL will get returned.
 					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
 					yy_act = YY_STATE_EOF(YY_START);
@@ -3032,5 +4323,5 @@
 				else
 					{
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 					}
@@ -3039,21 +4330,21 @@
 
 			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+					(yytext_ptr) + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_match;
 
 			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_find_action;
 			}
@@ -3066,6 +4357,5 @@
 	} /* end of action switch */
 		} /* end of scanning one token */
-	} /* end of yylex */
-
+} /* end of fortranlex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -3076,19 +4366,18 @@
  *	EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = (yytext_ptr);
 	register int number_to_move, i;
 	int ret_val;
 
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 		YY_FATAL_ERROR(
 		"fatal flex scanner internal error--end of buffer missed" );
 
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 			{
 			/* We matched a single character, the EOB, so
@@ -3110,36 +4399,32 @@
 
 	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
 	for ( i = 0; i < number_to_move; ++i )
 		*(dest++) = *(source++);
 
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 		/* don't do the read, it's not guaranteed to return an EOF,
 		 * just force an EOF
 		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
 	else
 		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
+			yy_size_t num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
 
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
 			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
+				(int) ((yy_c_buf_p) - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				int new_size = b->yy_buf_size * 2;
+				yy_size_t new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
@@ -3150,6 +4435,5 @@
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
+					fortranrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 				}
 			else
@@ -3161,9 +4445,9 @@
 				"fatal error - scanner input buffer overflow" );
 
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
+			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 						number_to_move - 1;
-#endif
+
 			}
 
@@ -3172,16 +4456,16 @@
 
 		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			(yy_n_chars), num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	if ( yy_n_chars == 0 )
+	if ( (yy_n_chars) == 0 )
 		{
 		if ( number_to_move == YY_MORE_ADJ )
 			{
 			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
+			fortranrestart(fortranin  );
 			}
 
@@ -3189,5 +4473,5 @@
 			{
 			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 				YY_BUFFER_EOF_PENDING;
 			}
@@ -3197,36 +4481,43 @@
 		ret_val = EOB_ACT_CONTINUE_SCAN;
 
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) fortranrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	(yy_n_chars) += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
 	return ret_val;
-	}
-
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-	{
+    static yy_state_type yy_get_previous_state (void)
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-
-	yy_current_state = yy_start;
+    
+	yy_current_state = (yy_start);
 	yy_current_state += YY_AT_BOL();
 
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 		{
 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 		if ( yy_accept[yy_current_state] )
 			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
+			(yy_last_accepting_state) = yy_current_state;
+			(yy_last_accepting_cpos) = yy_cp;
 			}
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 1124 )
+			if ( yy_current_state >= 1162 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
@@ -3235,6 +4526,5 @@
 
 	return yy_current_state;
-	}
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
@@ -3243,66 +4533,54 @@
  *	next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
 	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
+    	register char *yy_cp = (yy_c_buf_p);
 
 	register YY_CHAR yy_c = 1;
 	if ( yy_accept[yy_current_state] )
 		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
+		(yy_last_accepting_state) = yy_current_state;
+		(yy_last_accepting_cpos) = yy_cp;
 		}
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 1124 )
+		if ( yy_current_state >= 1162 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 1123);
+	yy_is_jam = (yy_current_state == 1161);
 
 	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+	register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
+
+	/* undo effects of setting up fortrantext */
+	*yy_cp = (yy_hold_char);
+
+	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 		{ /* need to shift things up to make room */
 		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
+		register yy_size_t number_to_move = (yy_n_chars) + 2;
+		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
 		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 			*--dest = *--source;
 
 		yy_cp += (int) (dest - source);
 		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
 		}
@@ -3310,23 +4588,22 @@
 	*--yy_cp = (char) c;
 
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
+	(yytext_ptr) = yy_bp;
+	(yy_hold_char) = *yy_cp;
+	(yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
+    static int input  (void)
 #endif
-	{
+
+{
 	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+    
+	*(yy_c_buf_p) = (yy_hold_char);
+
+	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
 		{
 		/* yy_c_buf_p now points to the character we want to return.
@@ -3334,14 +4611,14 @@
 		 * valid NUL; if not, then we've hit the end of the buffer.
 		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
+			*(yy_c_buf_p) = '\0';
 
 		else
 			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
+			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			++(yy_c_buf_p);
+
+			switch ( yy_get_next_buffer(  ) )
 				{
 				case EOB_ACT_LAST_MATCH:
@@ -3357,14 +4634,14 @@
 
 					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
+					fortranrestart(fortranin );
+
+					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( fortranwrap( ) )
+						return 0;
+
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 #ifdef __cplusplus
@@ -3376,5 +4653,5 @@
 
 				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
+					(yy_c_buf_p) = (yytext_ptr) + offset;
 					break;
 				}
@@ -3382,85 +4659,88 @@
 		}
 
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-	yy_current_buffer->yy_at_bol = (c == '\n');
+	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
+	*(yy_c_buf_p) = '\0';	/* preserve fortrantext */
+	(yy_hold_char) = *++(yy_c_buf_p);
+
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
 
 	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void fortranrestart  (FILE * input_file )
+{
+    
+	if ( ! YY_CURRENT_BUFFER ){
+        fortranensure_buffer_stack ();
+		YY_CURRENT_BUFFER_LVALUE =
+            fortran_create_buffer(fortranin,YY_BUF_SIZE );
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
+	fortran_init_buffer(YY_CURRENT_BUFFER,input_file );
+	fortran_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void fortran_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		fortranpop_buffer_state();
+	 *		fortranpush_buffer_state(new_buffer);
+     */
+	fortranensure_buffer_stack ();
+	if ( YY_CURRENT_BUFFER == new_buffer )
 		return;
 
-	if ( yy_current_buffer )
+	if ( YY_CURRENT_BUFFER )
 		{
 		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	fortran_load_buffer_state( );
 
 	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
+	 * EOF (fortranwrap()) processing, but the only time this flag
+	 * is looked at is after fortranwrap() is called, so it's safe
 	 * to go ahead and always set it.
 	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void fortran_load_buffer_state  (void)
+{
+    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	fortranin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	(yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE fortran_create_buffer  (FILE * file, int  size )
+{
 	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+	b = (YY_BUFFER_STATE) fortranalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_create_buffer()" );
 
 	b->yy_buf_size = size;
@@ -3469,77 +4749,72 @@
 	 * we need to put in 2 end-of-buffer characters.
 	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	b->yy_ch_buf = (char *) fortranalloc(b->yy_buf_size + 2  );
 	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_create_buffer()" );
 
 	b->yy_is_our_buffer = 1;
 
-	yy_init_buffer( b, file );
+	fortran_init_buffer(b,file );
 
 	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with fortran_create_buffer()
+ * 
+ */
+    void fortran_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
 	if ( ! b )
 		return;
 
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
+		fortranfree((void *) b->yy_ch_buf  );
+
+	fortranfree((void *) b  );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a fortranrestart() or at EOF.
+ */
+    static void fortran_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+	int oerrno = errno;
+    
+	fortran_flush_buffer(b );
 
 	b->yy_input_file = file;
 	b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
+    /* If b is the current buffer, then fortran_init_buffer was _probably_
+     * called from fortranrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void fortran_flush_buffer (YY_BUFFER_STATE  b )
+{
 	if ( ! b )
 		return;
@@ -3559,20 +4834,116 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
+	if ( b == YY_CURRENT_BUFFER )
+		fortran_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void fortranpush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+    	if (new_buffer == NULL)
+		return;
+
+	fortranensure_buffer_stack();
+
+	/* This block is copied from fortran_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 	}
 
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		(yy_buffer_stack_top)++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from fortran_switch_to_buffer. */
+	fortran_load_buffer_state( );
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void fortranpop_buffer_state (void)
+{
+    	if (!YY_CURRENT_BUFFER)
+		return;
+
+	fortran_delete_buffer(YY_CURRENT_BUFFER );
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if ((yy_buffer_stack_top) > 0)
+		--(yy_buffer_stack_top);
+
+	if (YY_CURRENT_BUFFER) {
+		fortran_load_buffer_state( );
+		(yy_did_buffer_switch_on_eof) = 1;
+	}
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void fortranensure_buffer_stack (void)
+{
+	yy_size_t num_to_alloc;
+    
+	if (!(yy_buffer_stack)) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+		num_to_alloc = 1;
+		(yy_buffer_stack) = (struct yy_buffer_state**)fortranalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in fortranensure_buffer_stack()" );
+								  
+		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		(yy_buffer_stack_max) = num_to_alloc;
+		(yy_buffer_stack_top) = 0;
+		return;
+	}
+
+	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = (yy_buffer_stack_max) + grow_size;
+		(yy_buffer_stack) = (struct yy_buffer_state**)fortranrealloc
+								((yy_buffer_stack),
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in fortranensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+		(yy_buffer_stack_max) = num_to_alloc;
+	}
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE fortran_scan_buffer  (char * base, yy_size_t  size )
+{
 	YY_BUFFER_STATE b;
-
+    
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
@@ -3581,7 +4952,7 @@
 		return 0;
 
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	b = (YY_BUFFER_STATE) fortranalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_scan_buffer()" );
 
 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
@@ -3595,56 +4966,50 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	yy_switch_to_buffer( b );
+	fortran_switch_to_buffer(b  );
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
+}
+
+/** Setup the input buffer state to scan a string. The next call to fortranlex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       fortran_scan_bytes() instead.
+ */
+YY_BUFFER_STATE fortran_scan_string (yyconst char * yystr )
+{
+    
+	return fortran_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to fortranlex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE fortran_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+{
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n;
-	int i;
-
+	yy_size_t n, i;
+    
 	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
+	n = _yybytes_len + 2;
+	buf = (char *) fortranalloc(n  );
 	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
+		YY_FATAL_ERROR( "out of dynamic memory in fortran_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = fortran_scan_buffer(buf,n );
 	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+		YY_FATAL_ERROR( "bad buffer in fortran_scan_bytes()" );
 
 	/* It's okay to grow etc. this buffer, and we should throw it
@@ -3654,59 +5019,5 @@
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
+}
 
 #ifndef YY_EXIT_FAILURE
@@ -3714,16 +5025,9 @@
 #endif
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
+static void yy_fatal_error (yyconst char* msg )
+{
+    	(void) fprintf( stderr, "%s\n", msg );
 	exit( YY_EXIT_FAILURE );
-	}
-
-
+}
 
 /* Redefine yyless() so it works in section 3 code. */
@@ -3733,40 +5037,161 @@
 	do \
 		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
+		/* Undo effects of setting up fortrantext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		fortrantext[fortranleng] = (yy_hold_char); \
+		(yy_c_buf_p) = fortrantext + yyless_macro_arg; \
+		(yy_hold_char) = *(yy_c_buf_p); \
+		*(yy_c_buf_p) = '\0'; \
+		fortranleng = yyless_macro_arg; \
 		} \
 	while ( 0 )
 
-
-/* Internal utility routines. */
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int fortranget_lineno  (void)
+{
+        
+    return fortranlineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *fortranget_in  (void)
+{
+        return fortranin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *fortranget_out  (void)
+{
+        return fortranout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+yy_size_t fortranget_leng  (void)
+{
+        return fortranleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *fortranget_text  (void)
+{
+        return fortrantext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void fortranset_lineno (int  line_number )
+{
+    
+    fortranlineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see fortran_switch_to_buffer
+ */
+void fortranset_in (FILE *  in_str )
+{
+        fortranin = in_str ;
+}
+
+void fortranset_out (FILE *  out_str )
+{
+        fortranout = out_str ;
+}
+
+int fortranget_debug  (void)
+{
+        return fortran_flex_debug;
+}
+
+void fortranset_debug (int  bdebug )
+{
+        fortran_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from fortranlex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    fortranin = stdin;
+    fortranout = stdout;
+#else
+    fortranin = (FILE *) 0;
+    fortranout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * fortranlex_init()
+     */
+    return 0;
+}
+
+/* fortranlex_destroy is for both reentrant and non-reentrant scanners. */
+int fortranlex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		fortran_delete_buffer(YY_CURRENT_BUFFER  );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		fortranpop_buffer_state();
+	}
+
+	/* Destroy the stack itself. */
+	fortranfree((yy_buffer_stack) );
+	(yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * fortranlex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
 	register int i;
 	for ( i = 0; i < n; ++i )
 		s1[i] = s2[i];
-	}
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
+static int yy_flex_strlen (yyconst char * s )
+{
 	register int n;
 	for ( n = 0; s[n]; ++n )
@@ -3774,26 +5199,14 @@
 
 	return n;
-	}
+}
 #endif
 
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
+void *fortranalloc (yy_size_t  size )
+{
 	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
+}
+
+void *fortranrealloc  (void * ptr, yy_size_t  size )
+{
 	/* The cast to (char *) in the following accommodates both
 	 * implementations that use char* generic pointers, and those
@@ -3804,24 +5217,15 @@
 	 */
 	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-#line 319 "fortran.lex"
+}
+
+void fortranfree (void * ptr )
+{
+	free( (char *) ptr );	/* see fortranrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 353 "fortran.lex"
+
 
 
@@ -3830,11 +5234,11 @@
    if (!strcasecmp(curfile,mainfile))
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran,curfile);
+      printf("%s line %d, file %s motclef = %s\n",s,line_num_fortran,curfile,fortrantext);
    }
    else
    {
-      printf("%s line %d, file %s\n",s,line_num_fortran_common,curfile);
+      printf("%s line %d, file %s motclef = %s curbuf = %s\n",s,line_num_fortran_common,curfile,fortrantext,curbuf);
    }
-   /*exit(0);*/
+/*   exit(0);*/
 }
 
@@ -3842,2 +5246,3 @@
 {
 }
+
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/main.c	(revision 2715)
@@ -1,169 +1,1595 @@
-#ifndef lint
-static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
-#endif
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING (yyerrflag!=0)
-#define YYPREFIX "yy"
-#line 36 "convert.y"
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "2.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     TOK_SEP = 258,
+     TOK_USE = 259,
+     TOK_MODULEMAIN = 260,
+     TOK_NOTGRIDDEP = 261,
+     TOK_USEITEM = 262,
+     TOK_NAME = 263,
+     TOK_PROBTYPE = 264
+   };
+#endif
+/* Tokens.  */
+#define TOK_SEP 258
+#define TOK_USE 259
+#define TOK_MODULEMAIN 260
+#define TOK_NOTGRIDDEP 261
+#define TOK_USEITEM 262
+#define TOK_NAME 263
+#define TOK_PROBTYPE 264
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 35 "convert.y"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include "decl.h"
+
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 42 "convert.y"
-typedef union {
+{
        int ival;
        char na[LONG_C];
        listnom * ln;
-       } YYSTYPE;
-#line 23 "y.tab.c"
-#define TOK_SEP 257
-#define TOK_USE 258
-#define TOK_MODULEMAIN 259
-#define TOK_NOTGRIDDEP 260
-#define TOK_USEITEM 261
-#define TOK_NAME 262
-#define TOK_PROBTYPE 263
-#define YYERRCODE 256
-short yylhs[] = {                                        -1,
-    0,    0,    1,    1,    1,    1,    1,    1,    1,
+       }
+/* Line 193 of yacc.c.  */
+#line 127 "convert.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 140 "convert.tab.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   23
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  18
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  3
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  10
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  24
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   264
+
+#define YYTRANSLATE(YYX)						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      17,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      13,    14,     2,     2,    10,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    12,    11,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    15,     2,    16,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9
 };
-short yylen[] = {                                         2,
-    0,    2,    1,    3,    5,    7,    3,    4,    3,
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint8 yyprhs[] =
+{
+       0,     0,     3,     4,     7,     9,    13,    19,    27,    31,
+      36
 };
-short yydefred[] = {                                      1,
-    0,    0,    0,    0,    0,    3,    2,    0,    0,    0,
-    0,    9,    7,    0,    0,    4,    8,    0,    0,    5,
-    0,    6,
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      19,     0,    -1,    -1,    19,    20,    -1,    17,    -1,     9,
+       8,    11,    -1,     9,     8,    10,     8,    11,    -1,     9,
+       8,    10,     8,    10,     8,    11,    -1,     5,     8,    11,
+      -1,     6,     3,     8,    11,    -1,     4,     7,    11,    -1
 };
-short yydgoto[] = {                                       1,
-    7,
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint8 yyrline[] =
+{
+       0,    63,    63,    64,    66,    67,    68,    69,    71,    74,
+      75
 };
-short yysindex[] = {                                      0,
-  -10, -258, -257, -253, -256,    0,    0,  -52,  -51, -252,
-  -43,    0,    0,  -50, -251,    0,    0,  -42, -250,    0,
-  -46,    0,
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "TOK_SEP", "TOK_USE", "TOK_MODULEMAIN",
+  "TOK_NOTGRIDDEP", "TOK_USEITEM", "TOK_NAME", "TOK_PROBTYPE", "','",
+  "';'", "':'", "'('", "')'", "'['", "']'", "'\\n'", "$accept", "input",
+  "line", 0
 };
-short yyrindex[] = {                                      0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+      44,    59,    58,    40,    41,    91,    93,    10
 };
-short yygindex[] = {                                      0,
-    0,
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    18,    19,    19,    20,    20,    20,    20,    20,    20,
+      20
 };
-#define YYTABLESIZE 253
-short yytable[] = {                                       6,
-   15,   19,    8,   10,    9,   11,   12,   13,   17,   14,
-   18,   21,   22,    0,    0,   16,   20,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-    0,    0,    0,    0,    0,    0,    0,    2,    3,    4,
-    0,    0,    5,
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     2,     1,     3,     5,     7,     3,     4,
+       3
 };
-short yycheck[] = {                                      10,
-   44,   44,  261,  257,  262,  262,   59,   59,   59,  262,
-  262,  262,   59,   -1,   -1,   59,   59,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,  260,
-   -1,   -1,  263,
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       2,     0,     1,     0,     0,     0,     0,     4,     3,     0,
+       0,     0,     0,    10,     8,     0,     0,     5,     9,     0,
+       0,     6,     0,     7
 };
-#define YYFINAL 1
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-#define YYMAXTOKEN 263
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     1,     8
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -10
+static const yytype_int8 yypact[] =
+{
+     -10,     0,   -10,    -4,     2,     8,     4,   -10,   -10,     3,
+       5,     7,    -9,   -10,   -10,     9,    10,   -10,   -10,    -3,
+      11,   -10,    12,   -10
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -10,   -10,   -10
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const yytype_uint8 yytable[] =
+{
+       2,    16,    17,     9,     3,     4,     5,    20,    21,     6,
+      10,    11,    12,     0,    13,    15,    14,     7,    19,    22,
+      18,     0,     0,    23
+};
+
+static const yytype_int8 yycheck[] =
+{
+       0,    10,    11,     7,     4,     5,     6,    10,    11,     9,
+       8,     3,     8,    -1,    11,     8,    11,    17,     8,     8,
+      11,    -1,    -1,    11
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    19,     0,     4,     5,     6,     9,    17,    20,     7,
+       8,     3,     8,    11,    11,     8,    10,    11,    11,     8,
+      10,    11,     8,    11
+};
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (YY_("syntax error: cannot back up")); \
+      YYERROR;							\
+    }								\
+while (YYID (0))
+
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested.  */
 #if YYDEBUG
-char *yyname[] = {
-"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-"TOK_SEP","TOK_USE","TOK_MODULEMAIN","TOK_NOTGRIDDEP","TOK_USEITEM","TOK_NAME",
-"TOK_PROBTYPE",
-};
-char *yyrule[] = {
-"$accept : input",
-"input :",
-"input : input line",
-"line : '\\n'",
-"line : TOK_PROBTYPE TOK_NAME ';'",
-"line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ';'",
-"line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ',' TOK_NAME ';'",
-"line : TOK_MODULEMAIN TOK_NAME ';'",
-"line : TOK_NOTGRIDDEP TOK_SEP TOK_NAME ';'",
-"line : TOK_USE TOK_USEITEM ';'",
-};
-#endif
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH 500
-#endif
-#endif
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#endif
+{
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
 int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static YYSIZE_T
+yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+    const char *yystr;
+#endif
+{
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+    char *yydest;
+    const char *yysrc;
+#endif
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
+	  }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#endif /* YYERROR_VERBOSE */
+
+
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  switch (yytype)
+    {
+
+      default:
+	break;
+    }
+}
+
+
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
 int yynerrs;
-int yyerrflag;
-int yychar;
-short *yyssp;
-YYSTYPE *yyvsp;
-YYSTYPE yyval;
-YYSTYPE yylval;
-short yyss[YYSTACKSIZE];
-YYSTYPE yyvs[YYSTACKSIZE];
-#define yystacksize YYSTACKSIZE
-#line 83 "convert.y"
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack.  Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	yytype_int16 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow (YY_("memory exhausted"),
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	yytype_int16 *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  yystate = yyn;
+  *++yyvsp = yylval;
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 5:
+#line 67 "convert.y"
+    {initdimprob(1,(yyvsp[(2) - (3)].na),"0","0");;}
+    break;
+
+  case 6:
+#line 68 "convert.y"
+    {initdimprob(2,(yyvsp[(2) - (5)].na), (yyvsp[(4) - (5)].na),"0");;}
+    break;
+
+  case 7:
+#line 70 "convert.y"
+    {initdimprob(3,(yyvsp[(2) - (7)].na), (yyvsp[(4) - (7)].na), (yyvsp[(6) - (7)].na));;}
+    break;
+
+  case 8:
+#line 72 "convert.y"
+    {listofmodules = Addtolistnom((yyvsp[(2) - (3)].na),listofmodules,0);
+                                                        Addmoduletothelist((yyvsp[(2) - (3)].na));;}
+    break;
+
+  case 9:
+#line 74 "convert.y"
+    {Add_NotGridDepend_Var_1((yyvsp[(3) - (4)].na));;}
+    break;
+
+  case 10:
+#line 75 "convert.y"
+    {
+                                    if (!strcasecmp((yyvsp[(2) - (3)].na),"FIXED_GRIDS"))
+                                                                 fixedgrids=1;
+                                    if (!strcasecmp((yyvsp[(2) - (3)].na),"ONLY_FIXED_GRIDS"))
+                                                             onlyfixedgrids=1;
+                                 ;}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 1376 "convert.tab.c"
+      default: break;
+    }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead token after an
+	 error, discard it.  */
+
+      if (yychar <= YYEOF)
+	{
+	  /* Return failure if at end of input.  */
+	  if (yychar == YYEOF)
+	    YYABORT;
+	}
+      else
+	{
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++yyvsp = yylval;
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp);
+      YYPOPSTACK (1);
+    }
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
+}
+
+
+#line 82 "convert.y"
+
 
 int main(int argc,char *argv[])
@@ -534,261 +1960,95 @@
    return 0;
 }
-#line 537 "y.tab.c"
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
-int
-yyparse()
-{
-    register int yym, yyn, yystate;
-#if YYDEBUG
-    register char *yys;
-    extern char *getenv();
-
-    if (yys = getenv("YYDEBUG"))
-    {
-        yyn = *yys;
-        if (yyn >= '0' && yyn <= '9')
-            yydebug = yyn - '0';
-    }
-#endif
-
-    yynerrs = 0;
-    yyerrflag = 0;
-    yychar = (-1);
-
-    yyssp = yyss;
-    yyvsp = yyvs;
-    *yyssp = yystate = 0;
-
-yyloop:
-    if (yyn = yydefred[yystate]) goto yyreduce;
-    if (yychar < 0)
-    {
-        if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, reading %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-    }
-    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: state %d, shifting to state %d\n",
-                    YYPREFIX, yystate, yytable[yyn]);
-#endif
-        if (yyssp >= yyss + yystacksize - 1)
-        {
-            goto yyoverflow;
-        }
-        *++yyssp = yystate = yytable[yyn];
-        *++yyvsp = yylval;
-        yychar = (-1);
-        if (yyerrflag > 0)  --yyerrflag;
-        goto yyloop;
-    }
-    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
-    {
-        yyn = yytable[yyn];
-        goto yyreduce;
-    }
-    if (yyerrflag) goto yyinrecovery;
-#ifdef lint
-    goto yynewerror;
-#endif
-yynewerror:
-    yyerror("syntax error");
-#ifdef lint
-    goto yyerrlab;
-#endif
-yyerrlab:
-    ++yynerrs;
-yyinrecovery:
-    if (yyerrflag < 3)
-    {
-        yyerrflag = 3;
-        for (;;)
-        {
-            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
-                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
-#endif
-                if (yyssp >= yyss + yystacksize - 1)
-                {
-                    goto yyoverflow;
-                }
-                *++yyssp = yystate = yytable[yyn];
-                *++yyvsp = yylval;
-                goto yyloop;
-            }
-            else
-            {
-#if YYDEBUG
-                if (yydebug)
-                    printf("%sdebug: error recovery discarding state %d\n",
-                            YYPREFIX, *yyssp);
-#endif
-                if (yyssp <= yyss) goto yyabort;
-                --yyssp;
-                --yyvsp;
-            }
-        }
-    }
-    else
-    {
-        if (yychar == 0) goto yyabort;
-#if YYDEBUG
-        if (yydebug)
-        {
-            yys = 0;
-            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-            if (!yys) yys = "illegal-symbol";
-            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
-                    YYPREFIX, yystate, yychar, yys);
-        }
-#endif
-        yychar = (-1);
-        goto yyloop;
-    }
-yyreduce:
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
-                YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
-    yym = yylen[yyn];
-    yyval = yyvsp[1-yym];
-    switch (yyn)
-    {
-case 4:
-#line 67 "convert.y"
-{initdimprob(1,yyvsp[-1].na,"0","0");}
-break;
-case 5:
-#line 68 "convert.y"
-{initdimprob(2,yyvsp[-3].na, yyvsp[-1].na,"0");}
-break;
-case 6:
-#line 70 "convert.y"
-{initdimprob(3,yyvsp[-5].na, yyvsp[-3].na, yyvsp[-1].na);}
-break;
-case 7:
-#line 72 "convert.y"
-{listofmodules = Addtolistnom(yyvsp[-1].na,listofmodules,0);
-                                                        Addmoduletothelist(yyvsp[-1].na);}
-break;
-case 8:
-#line 74 "convert.y"
-{Add_NotGridDepend_Var_1(yyvsp[-1].na);}
-break;
-case 9:
-#line 75 "convert.y"
-{
-                                    if (!strcasecmp(yyvsp[-1].na,"FIXED_GRIDS"))
-                                                                 fixedgrids=1;
-                                    if (!strcasecmp(yyvsp[-1].na,"ONLY_FIXED_GRIDS"))
-                                                             onlyfixedgrids=1;
-                                 }
-break;
-#line 708 "y.tab.c"
-    }
-    yyssp -= yym;
-    yystate = *yyssp;
-    yyvsp -= yym;
-    yym = yylhs[yyn];
-    if (yystate == 0 && yym == 0)
-    {
-#if YYDEBUG
-        if (yydebug)
-            printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
-        yystate = YYFINAL;
-        *++yyssp = YYFINAL;
-        *++yyvsp = yyval;
-        if (yychar < 0)
-        {
-            if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
-            if (yydebug)
-            {
-                yys = 0;
-                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
-                if (!yys) yys = "illegal-symbol";
-                printf("%sdebug: state %d, reading %d (%s)\n",
-                        YYPREFIX, YYFINAL, yychar, yys);
-            }
-#endif
-        }
-        if (yychar == 0) goto yyaccept;
-        goto yyloop;
-    }
-    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
-            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
-        yystate = yytable[yyn];
-    else
-        yystate = yydgoto[yym];
-#if YYDEBUG
-    if (yydebug)
-        printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
-#endif
-    if (yyssp >= yyss + yystacksize - 1)
-    {
-        goto yyoverflow;
-    }
-    *++yyssp = yystate;
-    *++yyvsp = yyval;
-    goto yyloop;
-yyoverflow:
-    yyerror("yacc stack overflow");
-yyabort:
-    return (1);
-yyaccept:
-    return (0);
-}
+
 #line 2 "convert.yy.c"
+
+#line 4 "convert.yy.c"
+
+#define  YY_INT_ALIGNED short int
+
 /* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
 #include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
 
 /* The "const" storage-class-modifier is valid. */
@@ -797,20 +2057,11 @@
 #else	/* ! __cplusplus */
 
-#if __STDC__
-
-#define YY_USE_PROTOS
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
 #define YY_USE_CONST
 
-#endif	/* __STDC__ */
+#endif	/* defined (__STDC__) */
 #endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
 
 #ifdef YY_USE_CONST
@@ -820,11 +2071,4 @@
 #endif
 
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
@@ -841,5 +2085,5 @@
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
@@ -847,5 +2091,5 @@
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
@@ -854,14 +2098,29 @@
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart(yyin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
-
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t yyleng;
+
 extern FILE *yyin, *yyout;
 
@@ -870,40 +2129,24 @@
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
 		{ \
 		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = (yy_hold_char); \
 		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 		} \
 	while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
@@ -921,5 +2164,5 @@
 	 * characters.
 	 */
-	int yy_n_chars;
+	yy_size_t yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
@@ -942,4 +2185,7 @@
 	int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
@@ -948,4 +2194,5 @@
 
 	int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
@@ -961,26 +2208,36 @@
 	 */
 #define YY_BUFFER_EOF_PENDING 2
+
 	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
+static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
+yy_size_t yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
+static int yy_init = 0;		/* whether we need to initialize */
 static int yy_start = 0;	/* start state number */
 
@@ -990,21 +2247,25 @@
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
+
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
 
 #define yy_new_buffer yy_create_buffer
@@ -1012,28 +2273,43 @@
 #define yy_set_interactive(is_interactive) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 	}
 
 #define yy_set_bol(at_bol) \
 	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
+	if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 	}
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
 
 typedef unsigned char YY_CHAR;
+
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
 typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
 extern char *yytext;
 #define yytext_ptr yytext
 
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
@@ -1041,25 +2317,32 @@
  */
 #define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
+	(yytext_ptr) = yy_bp; \
+	yyleng = (size_t) (yy_cp - yy_bp); \
+	(yy_hold_char) = *yy_cp; \
 	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
+	(yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 12
 #define YY_END_OF_BUFFER 13
-static yyconst short int yy_accept[74] =
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static yyconst flex_int16_t yy_accept[77] =
     {   0,
         0,    0,    0,    0,   13,   12,   11,   10,   12,    9,
        12,   12,   12,    9,    8,    8,    8,    8,    8,    8,
-       11,    0,    4,    7,    5,    8,    8,    8,    8,    8,
-        8,    8,    6,    8,    8,    8,    8,    3,    8,    8,
+       11,    0,    4,    7,    7,    7,    5,    8,    8,    8,
+        8,    8,    8,    8,    6,    8,    8,    8,    8,    3,
         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
-        8,    8,    8,    2,    8,    8,    8,    1,    8,    8,
-        8,    8,    0
+        8,    8,    8,    8,    8,    2,    8,    8,    8,    1,
+        8,    8,    8,    8,    6,    0
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
@@ -1069,12 +2352,12 @@
         6,    1,    1,    7,    1,    1,    1,    8,    9,   10,
        11,    8,    8,    8,   12,    8,    8,   13,   14,    1,
-        1,    1,    1,    1,   18,   19,   19,   20,   21,   22,
-       23,   19,   24,   19,   19,   25,   26,   27,   28,   29,
-       19,   30,   31,   32,   33,   19,   19,   34,   35,   19,
-       15,    1,   16,    1,   17,    1,   18,   19,   19,   20,
-
-       21,   22,   23,   19,   24,   19,   19,   25,   26,   27,
-       28,   29,   19,   30,   31,   32,   33,   19,   19,   34,
-       35,   19,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,   15,   16,   16,   17,   18,   19,
+       20,   16,   21,   16,   16,   22,   23,   24,   25,   26,
+       16,   27,   28,   29,   30,   16,   16,   31,   32,   16,
+       33,    1,   34,    1,   35,    1,   36,   16,   16,   37,
+
+       38,   39,   40,   16,   41,   16,   16,   42,   43,   44,
+       45,   46,   16,   47,   48,   49,   50,   16,   16,   51,
+       52,   16,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -1093,76 +2376,99 @@
     } ;
 
-static yyconst int yy_meta[36] =
+static yyconst flex_int32_t yy_meta[53] =
     {   0,
         1,    1,    2,    1,    1,    1,    1,    3,    3,    3,
-        3,    3,    1,    1,    1,    1,    3,    3,    3,    3,
+        3,    3,    1,    1,    3,    3,    3,    3,    3,    3,
         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3
+        3,    3,    1,    1,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3
     } ;
 
-static yyconst short int yy_base[76] =
+static yyconst flex_int16_t yy_base[79] =
     {   0,
-        0,    0,    0,    0,   96,   97,   93,   97,   90,   97,
-       73,   72,   71,   77,    0,   24,   61,   61,   69,   55,
-       83,   80,   79,   97,   97,    0,   70,   47,   48,   54,
-       48,   56,    0,   55,   52,   39,   55,    0,   52,   41,
-       53,   43,   51,   43,   44,   39,   41,   43,   38,   33,
-       30,   39,   24,   37,   32,   34,   33,   20,   32,   21,
-       27,   21,   14,    0,   27,   22,   19,    0,   11,   16,
-       19,    7,   97,   48,   34
+        0,    0,    0,    0,  150,  164,  147,  164,  144,  164,
+       36,   37,   38,  134,    0,   44,   32,   34,   44,   33,
+      144,  141,  140,  164,  164,  164,  164,    0,  131,   31,
+       34,   42,   39,   49,    0,   50,   49,   38,   56,    0,
+       59,   52,  107,   68,  106,   72,   75,   72,   77,   81,
+       79,   76,   75,   86,   73,   88,   85,   89,   90,   79,
+       93,   86,   99,   97,  103,    0,   37,  115,  114,    0,
+      108,  116,  121,  112,    0,  164,  160,   57
     } ;
 
-static yyconst short int yy_def[76] =
+static yyconst flex_int16_t yy_def[79] =
     {   0,
-       73,    1,    1,    1,   73,   73,   73,   73,   74,   73,
-       73,   73,   73,   73,   75,   75,   75,   75,   75,   75,
-       73,   74,   74,   73,   73,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,    0,   73,   73
+       76,    1,    1,    1,   76,   76,   76,   76,   77,   76,
+       76,   76,   76,   76,   78,   78,   78,   78,   78,   78,
+       76,   77,   77,   76,   76,   76,   76,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,    0,   76,   76
     } ;
 
-static yyconst short int yy_nxt[133] =
+static yyconst flex_int16_t yy_nxt[217] =
     {   0,
         6,    7,    8,    9,   10,   10,   10,    6,   11,   12,
-       13,    6,   14,   10,   10,   10,   15,   15,   15,   15,
-       15,   16,   15,   15,   15,   15,   17,   18,   19,   15,
-       15,   15,   20,   15,   15,   27,   26,   33,   72,   71,
-       70,   69,   68,   67,   33,   66,   65,   28,   22,   64,
-       22,   63,   62,   61,   60,   59,   58,   57,   56,   55,
-       54,   53,   52,   51,   50,   49,   48,   47,   46,   45,
-       44,   43,   42,   41,   40,   39,   38,   37,   36,   35,
-       34,   33,   23,   23,   21,   32,   31,   30,   29,   25,
-       24,   24,   24,   23,   21,   73,    5,   73,   73,   73,
-
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73
+       13,    6,   14,   10,   15,   15,   15,   15,   16,   15,
+       15,   15,   15,   17,   18,   19,   15,   15,   15,   20,
+       15,   15,   10,   10,   15,   15,   15,   15,   16,   15,
+       15,   15,   15,   17,   18,   19,   15,   15,   15,   20,
+       15,   15,   24,   25,   26,   29,   31,   32,   33,   28,
+       34,   36,   37,   38,   30,   39,   40,   41,   42,   43,
+       44,   69,   24,   25,   26,   45,   31,   32,   46,   33,
+       34,   36,   37,   38,   30,   39,   40,   41,   42,   43,
+       48,   44,   50,   51,   52,   45,   53,   54,   46,   55,
+
+       56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
+       48,   66,   50,   51,   52,   67,   53,   54,   68,   55,
+       56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
+       35,   66,   70,   71,   72,   67,   73,   74,   68,   75,
+       49,   47,   35,   23,   23,   21,   27,   23,   21,   76,
+       35,   76,   70,   71,   72,   76,   73,   74,   76,   75,
+       22,   76,   22,    5,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76
     } ;
 
-static yyconst short int yy_chk[133] =
+static yyconst flex_int16_t yy_chk[217] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,   16,   75,   72,   71,   70,
-       69,   67,   66,   65,   63,   62,   61,   16,   74,   60,
-       74,   59,   58,   57,   56,   55,   54,   53,   52,   51,
-       50,   49,   48,   47,   46,   45,   44,   43,   42,   41,
-       40,   39,   37,   36,   35,   34,   32,   31,   30,   29,
-       28,   27,   23,   22,   21,   20,   19,   18,   17,   14,
-       13,   12,   11,    9,    7,    5,   73,   73,   73,   73,
-
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
-       73,   73
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,   11,   12,   13,   16,   17,   18,   19,   78,
+       20,   30,   31,   32,   16,   33,   34,   36,   37,   38,
+       39,   67,   11,   12,   13,   41,   17,   18,   42,   19,
+       20,   30,   31,   32,   16,   33,   34,   36,   37,   38,
+       44,   39,   46,   47,   48,   41,   49,   50,   42,   51,
+
+       52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
+       44,   62,   46,   47,   48,   63,   49,   50,   64,   51,
+       52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
+       65,   62,   68,   69,   71,   63,   72,   73,   64,   74,
+       45,   43,   29,   23,   22,   21,   14,    9,    7,    5,
+       65,    0,   68,   69,   71,    0,   72,   73,    0,   74,
+       77,    0,   77,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+
+       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
+       76,   76,   76,   76,   76,   76
     } ;
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
@@ -1175,5 +2481,4 @@
 char *yytext;
 #line 1 "convert.lex"
-#define INITIAL 0
 /******************************************************************************/
 /*                                                                            */
@@ -1210,5 +2515,4 @@
 /* version 1.7                                                                */
 /******************************************************************************/
-#define character 1
 
 #line 37 "convert.lex"
@@ -1220,5 +2524,51 @@
 #define MAX_INCLUDE_DEPTH 30
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
-#line 460 "convert.yy.c"
+#line 565 "convert.yy.c"
+
+#define INITIAL 0
+#define character 1
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+yy_size_t yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
@@ -1228,63 +2578,28 @@
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int yywrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
+extern int yywrap (void );
+#endif
+#endif
+
+    static void yyunput (int c,char *buf_ptr  );
+    
 #ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
 #endif
 
 #ifndef YY_NO_INPUT
+
 #ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
+static int yyinput (void );
 #else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
+static int input (void );
+#endif
+
 #endif
 
@@ -1295,10 +2610,9 @@
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
 #endif
 
@@ -1308,7 +2622,8 @@
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
-		int c = '*', n; \
+		int c = '*'; \
+		yy_size_t n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
@@ -1320,7 +2635,20 @@
 		result = n; \
 		} \
-	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-		  && ferror( yyin ) ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
+\
+
 #endif
 
@@ -1343,10 +2671,16 @@
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
 
 /* Code executed at the beginning of each rule, after yytext and yyleng
@@ -1365,17 +2699,19 @@
 	YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-	{
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
-
+    
 #line 55 "convert.lex"
 
-#line 613 "convert.yy.c"
-
-	if ( yy_init )
+#line 750 "convert.yy.c"
+
+	if ( !(yy_init) )
 		{
-		yy_init = 0;
+		(yy_init) = 1;
 
 #ifdef YY_USER_INIT
@@ -1383,6 +2719,6 @@
 #endif
 
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
+		if ( ! (yy_start) )
+			(yy_start) = 1;	/* first start state */
 
 		if ( ! yyin )
@@ -1392,17 +2728,19 @@
 			yyout = stdout;
 
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
+		if ( ! YY_CURRENT_BUFFER ) {
+			yyensure_buffer_stack ();
+			YY_CURRENT_BUFFER_LVALUE =
+				yy_create_buffer(yyin,YY_BUF_SIZE );
+		}
+
+		yy_load_buffer_state( );
 		}
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
-		yy_cp = yy_c_buf_p;
+		yy_cp = (yy_c_buf_p);
 
 		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
+		*yy_cp = (yy_hold_char);
 
 		/* yy_bp points to the position in yy_ch_buf of the start of
@@ -1411,5 +2749,5 @@
 		yy_bp = yy_cp;
 
-		yy_current_state = yy_start;
+		yy_current_state = (yy_start);
 yy_match:
 		do
@@ -1418,11 +2756,11 @@
 			if ( yy_accept[yy_current_state] )
 				{
-				yy_last_accepting_state = yy_current_state;
-				yy_last_accepting_cpos = yy_cp;
+				(yy_last_accepting_state) = yy_current_state;
+				(yy_last_accepting_cpos) = yy_cp;
 				}
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 74 )
+				if ( yy_current_state >= 77 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
@@ -1430,5 +2768,5 @@
 			++yy_cp;
 			}
-		while ( yy_base[yy_current_state] != 97 );
+		while ( yy_base[yy_current_state] != 164 );
 
 yy_find_action:
@@ -1436,6 +2774,6 @@
 		if ( yy_act == 0 )
 			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			yy_act = yy_accept[yy_current_state];
 			}
@@ -1443,7 +2781,5 @@
 		YY_DO_BEFORE_ACTION;
 
-
 do_action:	/* This label is used only to access EOF actions. */
-
 
 		switch ( yy_act )
@@ -1451,7 +2787,7 @@
 			case 0: /* must back up */
 			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
+			*yy_cp = (yy_hold_char);
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
 			goto yy_find_action;
 
@@ -1503,4 +2839,5 @@
 	YY_BREAK
 case 10:
+/* rule 10 can match eol */
 YY_RULE_SETUP
 #line 66 "convert.lex"
@@ -1517,5 +2854,5 @@
 ECHO;
 	YY_BREAK
-#line 757 "convert.yy.c"
+#line 895 "convert.yy.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(character):
@@ -1525,11 +2862,11 @@
 		{
 		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
+		*yy_cp = (yy_hold_char);
 		YY_RESTORE_YY_MORE_OFFSET
 
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
 			{
 			/* We're scanning a new file or input source.  It's
@@ -1537,12 +2874,12 @@
 			 * just pointed yyin at a new source and called
 			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
+			 * consistency between YY_CURRENT_BUFFER and our
 			 * globals.  Here is the right place to do so, because
 			 * this is the first action (other than possibly a
 			 * back-up) that will match for the new input source.
 			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
 			}
 
@@ -1554,11 +2891,11 @@
 		 * in input().
 		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			{ /* This was really a NUL. */
 			yy_state_type yy_next_state;
 
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
+			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state(  );
 
 			/* Okay, we're now positioned to make the NUL
@@ -1573,10 +2910,10 @@
 			yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
+			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
 			if ( yy_next_state )
 				{
 				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
+				yy_cp = ++(yy_c_buf_p);
 				yy_current_state = yy_next_state;
 				goto yy_match;
@@ -1585,16 +2922,16 @@
 			else
 				{
-				yy_cp = yy_c_buf_p;
+				yy_cp = (yy_c_buf_p);
 				goto yy_find_action;
 				}
 			}
 
-		else switch ( yy_get_next_buffer() )
+		else switch ( yy_get_next_buffer(  ) )
 			{
 			case EOB_ACT_END_OF_FILE:
 				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
+				(yy_did_buffer_switch_on_eof) = 0;
+
+				if ( yywrap( ) )
 					{
 					/* Note: because we've taken care in
@@ -1607,5 +2944,5 @@
 					 * YY_NULL will get returned.
 					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
 					yy_act = YY_STATE_EOF(YY_START);
@@ -1615,5 +2952,5 @@
 				else
 					{
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 					}
@@ -1622,21 +2959,21 @@
 
 			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+					(yytext_ptr) + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_match;
 
 			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				(yy_c_buf_p) =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 				goto yy_find_action;
 			}
@@ -1649,6 +2986,5 @@
 	} /* end of action switch */
 		} /* end of scanning one token */
-	} /* end of yylex */
-
+} /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
@@ -1659,19 +2995,18 @@
  *	EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = (yytext_ptr);
 	register int number_to_move, i;
 	int ret_val;
 
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
 		YY_FATAL_ERROR(
 		"fatal flex scanner internal error--end of buffer missed" );
 
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
 		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
 			{
 			/* We matched a single character, the EOB, so
@@ -1693,36 +3028,32 @@
 
 	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
 	for ( i = 0; i < number_to_move; ++i )
 		*(dest++) = *(source++);
 
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 		/* don't do the read, it's not guaranteed to return an EOF,
 		 * just force an EOF
 		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
 	else
 		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
+			yy_size_t num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
 
 			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
 			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
+				(int) ((yy_c_buf_p) - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				int new_size = b->yy_buf_size * 2;
+				yy_size_t new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
@@ -1733,6 +3064,5 @@
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
+					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
 				}
 			else
@@ -1744,9 +3074,9 @@
 				"fatal error - scanner input buffer overflow" );
 
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
+			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
 						number_to_move - 1;
-#endif
+
 			}
 
@@ -1755,16 +3085,16 @@
 
 		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			(yy_n_chars), num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	if ( yy_n_chars == 0 )
+	if ( (yy_n_chars) == 0 )
 		{
 		if ( number_to_move == YY_MORE_ADJ )
 			{
 			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
+			yyrestart(yyin  );
 			}
 
@@ -1772,5 +3102,5 @@
 			{
 			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
 				YY_BUFFER_EOF_PENDING;
 			}
@@ -1780,35 +3110,42 @@
 		ret_val = EOB_ACT_CONTINUE_SCAN;
 
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	(yy_n_chars) += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
 	return ret_val;
-	}
-
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-	{
+    static yy_state_type yy_get_previous_state (void)
+{
 	register yy_state_type yy_current_state;
 	register char *yy_cp;
-
-	yy_current_state = yy_start;
-
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+    
+	yy_current_state = (yy_start);
+
+	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
 		{
 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
 		if ( yy_accept[yy_current_state] )
 			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
+			(yy_last_accepting_state) = yy_current_state;
+			(yy_last_accepting_cpos) = yy_cp;
 			}
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 74 )
+			if ( yy_current_state >= 77 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
@@ -1817,6 +3154,5 @@
 
 	return yy_current_state;
-	}
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
@@ -1825,66 +3161,54 @@
  *	next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
 	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
+    	register char *yy_cp = (yy_c_buf_p);
 
 	register YY_CHAR yy_c = 1;
 	if ( yy_accept[yy_current_state] )
 		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
+		(yy_last_accepting_state) = yy_current_state;
+		(yy_last_accepting_cpos) = yy_cp;
 		}
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 74 )
+		if ( yy_current_state >= 77 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 73);
+	yy_is_jam = (yy_current_state == 76);
 
 	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+	register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
 
 	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+	*yy_cp = (yy_hold_char);
+
+	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 		{ /* need to shift things up to make room */
 		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
+		register yy_size_t number_to_move = (yy_n_chars) + 2;
+		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
 		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
 			*--dest = *--source;
 
 		yy_cp += (int) (dest - source);
 		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
 		}
@@ -1892,23 +3216,22 @@
 	*--yy_cp = (char) c;
 
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
+	(yytext_ptr) = yy_bp;
+	(yy_hold_char) = *yy_cp;
+	(yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
-#endif
-	{
+    static int input  (void)
+#endif
+
+{
 	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+    
+	*(yy_c_buf_p) = (yy_hold_char);
+
+	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
 		{
 		/* yy_c_buf_p now points to the character we want to return.
@@ -1916,14 +3239,14 @@
 		 * valid NUL; if not, then we've hit the end of the buffer.
 		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
 			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
+			*(yy_c_buf_p) = '\0';
 
 		else
 			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
+			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
+			++(yy_c_buf_p);
+
+			switch ( yy_get_next_buffer(  ) )
 				{
 				case EOB_ACT_LAST_MATCH:
@@ -1939,14 +3262,14 @@
 
 					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
+					yyrestart(yyin );
+
+					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
+					if ( yywrap( ) )
+						return 0;
+
+					if ( ! (yy_did_buffer_switch_on_eof) )
 						YY_NEW_FILE;
 #ifdef __cplusplus
@@ -1958,5 +3281,5 @@
 
 				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
+					(yy_c_buf_p) = (yytext_ptr) + offset;
 					break;
 				}
@@ -1964,48 +3287,56 @@
 		}
 
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
+	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
+	*(yy_c_buf_p) = '\0';	/* preserve yytext */
+	(yy_hold_char) = *++(yy_c_buf_p);
 
 	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+	if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+		YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
+	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+	yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		yypop_buffer_state();
+	 *		yypush_buffer_state(new_buffer);
+     */
+	yyensure_buffer_stack ();
+	if ( YY_CURRENT_BUFFER == new_buffer )
 		return;
 
-	if ( yy_current_buffer )
+	if ( YY_CURRENT_BUFFER )
 		{
 		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 		}
 
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	yy_load_buffer_state( );
 
 	/* We don't actually know whether we did this switch during
@@ -2014,32 +3345,26 @@
 	 * to go ahead and always set it.
 	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy_load_buffer_state  (void)
+{
+    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	(yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
 	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -2050,5 +3375,5 @@
 	 * we need to put in 2 end-of-buffer characters.
 	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
 	if ( ! b->yy_ch_buf )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -2056,71 +3381,66 @@
 	b->yy_is_our_buffer = 1;
 
-	yy_init_buffer( b, file );
+	yy_init_buffer(b,file );
 
 	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
 	if ( ! b )
 		return;
 
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
 	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
+		yyfree((void *) b->yy_ch_buf  );
+
+	yyfree((void *) b  );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+	int oerrno = errno;
+    
+	yy_flush_buffer(b );
 
 	b->yy_input_file = file;
 	b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
 	}
 
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
 	if ( ! b )
 		return;
@@ -2140,20 +3460,116 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
+	if ( b == YY_CURRENT_BUFFER )
+		yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+    	if (new_buffer == NULL)
+		return;
+
+	yyensure_buffer_stack();
+
+	/* This block is copied from yy_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
 	}
 
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		(yy_buffer_stack_top)++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from yy_switch_to_buffer. */
+	yy_load_buffer_state( );
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+    	if (!YY_CURRENT_BUFFER)
+		return;
+
+	yy_delete_buffer(YY_CURRENT_BUFFER );
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if ((yy_buffer_stack_top) > 0)
+		--(yy_buffer_stack_top);
+
+	if (YY_CURRENT_BUFFER) {
+		yy_load_buffer_state( );
+		(yy_did_buffer_switch_on_eof) = 1;
+	}
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+	yy_size_t num_to_alloc;
+    
+	if (!(yy_buffer_stack)) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+		num_to_alloc = 1;
+		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+								  
+		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		(yy_buffer_stack_max) = num_to_alloc;
+		(yy_buffer_stack_top) = 0;
+		return;
+	}
+
+	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = (yy_buffer_stack_max) + grow_size;
+		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+								((yy_buffer_stack),
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+		(yy_buffer_stack_max) = num_to_alloc;
+	}
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
 	YY_BUFFER_STATE b;
-
+    
 	if ( size < 2 ||
 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
@@ -2162,5 +3578,5 @@
 		return 0;
 
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
 	if ( ! b )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
@@ -2176,54 +3592,48 @@
 	b->yy_buffer_status = YY_BUFFER_NEW;
 
-	yy_switch_to_buffer( b );
+	yy_switch_to_buffer(b  );
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+	return yy_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
+{
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n;
-	int i;
-
+	yy_size_t n, i;
+    
 	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
+	n = _yybytes_len + 2;
+	buf = (char *) yyalloc(n  );
 	if ( ! buf )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer(buf,n );
 	if ( ! b )
 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
@@ -2235,59 +3645,5 @@
 
 	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
+}
 
 #ifndef YY_EXIT_FAILURE
@@ -2295,16 +3651,9 @@
 #endif
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
+static void yy_fatal_error (yyconst char* msg )
+{
+    	(void) fprintf( stderr, "%s\n", msg );
 	exit( YY_EXIT_FAILURE );
-	}
-
-
+}
 
 /* Redefine yyless() so it works in section 3 code. */
@@ -2315,39 +3664,160 @@
 		{ \
 		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		yytext[yyleng] = (yy_hold_char); \
+		(yy_c_buf_p) = yytext + yyless_macro_arg; \
+		(yy_hold_char) = *(yy_c_buf_p); \
+		*(yy_c_buf_p) = '\0'; \
+		yyleng = yyless_macro_arg; \
 		} \
 	while ( 0 )
 
-
-/* Internal utility routines. */
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+yy_size_t yyget_leng  (void)
+{
+        return yyleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *yyget_text  (void)
+{
+        return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
+
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
+
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
+#else
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		yy_delete_buffer(YY_CURRENT_BUFFER  );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		yypop_buffer_state();
+	}
+
+	/* Destroy the stack itself. */
+	yyfree((yy_buffer_stack) );
+	(yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
 	register int i;
 	for ( i = 0; i < n; ++i )
 		s1[i] = s2[i];
-	}
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
+static int yy_flex_strlen (yyconst char * s )
+{
 	register int n;
 	for ( n = 0; s[n]; ++n )
@@ -2355,26 +3825,14 @@
 
 	return n;
-	}
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
+}
+#endif
+
+void *yyalloc (yy_size_t  size )
+{
 	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
+}
+
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
 	/* The cast to (char *) in the following accommodates both
 	 * implementations that use char* generic pointers, and those
@@ -2385,27 +3843,18 @@
 	 */
 	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
+}
+
+void yyfree (void * ptr )
+{
+	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
 #line 68 "convert.lex"
 
 
 
+
 int yywrap()
 {
@@ -2425,2 +3874,3 @@
 exit(0);
 }
+
Index: /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/toamr.c
===================================================================
--- /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/toamr.c	(revision 2714)
+++ /trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/toamr.c	(revision 2715)
@@ -243,4 +243,5 @@
   strcpy(lvargridname2,"");
   sprintf(lvargridname,"Agrif_%s_var(Agrif_Curgrid%%fixedrank)%%%s",var->v_modulename,var->v_nomvar);
+  printf("modulename = %s %s\n",var->v_nomvar, var->v_modulename);
   }
   else
@@ -665,4 +666,5 @@
    FILE *paramtoamr;
    char ligne[LONGNOM];
+   char ligne2[LONGNOM];   
    variable *v;
    int IndiceMax;
@@ -829,5 +831,14 @@
            }
            strcat (ligne," = ");
-           strcat (ligne,initialvalue);
+
+           if (v->v_nbdim == 0)
+           {
+           strcpy(ligne2,initialvalue);
+           }
+           else
+           {
+           sprintf(ligne2,"RESHAPE(%s,SHAPE(%s))",initialvalue,vargridnametabvars(v,0));
+           }
+           strcat (ligne,ligne2);
            /*                                                                 */
            Save_Length(ligne,48);
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/dom_ice_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/dom_ice_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/dom_ice_2.F90	(revision 2715)
@@ -15,8 +15,10 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-   USE par_ice_2
+   USE par_ice_2   ! LIM parameters
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC    dom_ice_alloc_2    ! Called from nemogcm.F90
 
    LOGICAL, PUBLIC ::   l_jeq     = .TRUE.     !: Equator inside the domain flag
@@ -25,18 +27,45 @@
       !                                        !  (otherwise = jpj+10 (SH) or -10 (SH) )
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   fs2cor , fcor     !: coriolis factor and coeficient
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   covrai            !: sine of geographic latitude
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   area              !: surface of grid cell 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   tms    , tmu      !: temperature and velocity points masks
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2)     ::   wght              !: weight of the 4 neighbours to compute averages
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   fs2cor , fcor     !: coriolis factor and coeficient
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   covrai            !: sine of geographic latitude
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   area              !: surface of grid cell 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   tms    , tmu      !: temperature and velocity points masks
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)     ::   wght              !: weight of the 4 neighbours to compute averages
 
 
 # if defined key_lim2_vp
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2)     ::   akappa , bkappa   !: first and third group of metric coefficients
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2,2,2) ::   alambd            !: second group of metric coefficients
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)     ::   akappa , bkappa   !: first and third group of metric coefficients
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:,:) ::   alambd            !: second group of metric coefficients
 # else
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   tmv    , tmf      !: y-velocity and F-points masks
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)         ::   tmi               !: ice mask: =1 if ice thick > 0
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   tmv    , tmf      !: y-velocity and F-points masks
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)         ::   tmi               !: ice mask: =1 if ice thick > 0
 # endif
+   !!----------------------------------------------------------------------
+   CONTAINS
+
+   INTEGER FUNCTION dom_ice_alloc_2()
+      !!----------------------------------------------------------------------
+      USE lib_mpp, ONLY:   ctl_warn   ! MPP library
+      INTEGER :: ierr(2)
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( fs2cor(jpi,jpj)     , fcor(jpi,jpj) ,                                   &
+         &      covrai(jpi,jpj)     , area(jpi,jpj) , tms(jpi,jpj) , tmu(jpi,jpj) ,     &
+         &      wght  (jpi,jpj,2,2)                                               , STAT=ierr(1) )
+         !
+      ALLOCATE(                                                    &
+#if defined key_lim2_vp 
+         &        akappa(jpi,jpj,2,2)     , bkappa(jpi,jpj,2,2),   &
+         &        alambd(jpi,jpj,2,2,2,2) ,                        &
+#else
+         &        tmv(jpi,jpj) , tmf(jpi,jpj) , tmi(jpi,jpj) ,     &
+#endif
+         &        STAT=ierr(2) )
+         !
+      dom_ice_alloc_2 = MAXVAL(ierr)
+      IF( dom_ice_alloc_2 /= 0 )   CALL ctl_warn('dom_ice_alloc_2: failed to allocate arrays')
+      !
+   END FUNCTION dom_ice_alloc_2
 
 #else
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/ice_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/ice_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/ice_2.F90	(revision 2715)
@@ -4,6 +4,7 @@
    !! Sea Ice physics:  diagnostics variables of ice defined in memory
    !!=====================================================================
-   !! History :  2.0  !  2003-08  (C. Ethe)  F90: Free form and module
-   !!            3.3  !  2009-05  (G.Garric) addition of the lim2_evp cas
+   !! History :  2.0  ! 2003-08  (C. Ethe)  F90: Free form and module
+   !!            3.3  ! 2009-05  (G.Garric) addition of the lim2_evp cas
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim2
@@ -11,9 +12,11 @@
    !!   'key_lim2' :                                  LIM 2.0 sea-ice model
    !!----------------------------------------------------------------------
-   USE par_ice_2          ! LIM sea-ice parameters
+   USE par_ice_2      ! LIM sea-ice parameters
 
    IMPLICIT NONE
    PRIVATE
    
+   PUBLIC    ice_alloc_2  !  Called in iceini_2.F90
+
    INTEGER , PUBLIC ::   numit     !: ice iteration index
    REAL(wp), PUBLIC ::   rdt_ice   !: ice time step
@@ -54,7 +57,7 @@
    REAL(wp), PUBLIC ::   pstarh                !: pstar / 2.0
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ahiu , ahiv   !: hor. diffusivity coeff. at ocean U- and V-points (m2/s)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   pahu , pahv   !: ice hor. eddy diffusivity coef. at ocean U- and V-points
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ust2s         !: friction velocity
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ahiu , ahiv   !: hor. diffusivity coeff. at ocean U- and V-points (m2/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   pahu , pahv   !: ice hor. eddy diffusivity coef. at ocean U- and V-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ust2s         !: friction velocity
 
    !!* Ice Rheology
@@ -63,5 +66,5 @@
    LOGICAL , PUBLIC ::   lk_lim2_vp = .TRUE.               !: Visco-Plactic reology flag 
    !
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hsnm , hicm   !: mean snow and ice thicknesses
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hsnm , hicm   !: mean snow and ice thicknesses
    !
 # else
@@ -69,56 +72,116 @@
    LOGICAL , PUBLIC::   lk_lim2_vp = .FALSE.               !: Visco-Plactic reology flag 
    !
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   stress1_i     !: first stress tensor element       
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   stress2_i     !: second stress tensor element
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   stress12_i    !: diagonal stress tensor element
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   delta_i       !: rheology delta factor (see Flato and Hibler 95) [s-1]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   divu_i        !: Divergence of the velocity field [s-1] -> limrhg.F90
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   shear_i       !: Shear of the velocity field [s-1] -> limrhg.F90
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   at_i          !: ice fraction
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stress1_i     !: first stress tensor element       
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stress2_i     !: second stress tensor element
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stress12_i    !: diagonal stress tensor element
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   delta_i       !: rheology delta factor (see Flato and Hibler 95) [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   divu_i        !: Divergence of the velocity field [s-1] -> limrhg.F90
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   shear_i       !: Shear of the velocity field [s-1] -> limrhg.F90
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   at_i          !: ice fraction
    !
    REAL(wp), PUBLIC, DIMENSION(:,:)    , POINTER :: vt_s ,vt_i    !: mean snow and ice thicknesses
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj), TARGET  :: hsnm , hicm   !: target vt_s,vt_i pointers 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET  :: hsnm , hicm   !: target vt_s,vt_i pointers 
 #endif
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rdvosif       !: ice volume change at ice surface (only used for outputs)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rdvobif       !: ice volume change at ice bottom  (only used for outputs)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fdvolif       !: Total   ice volume change (only used for outputs)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rdvonif       !: Lateral ice volume change (only used for outputs)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sist          !: Sea-Ice Surface Temperature [Kelvin]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tfu           !: Freezing/Melting point temperature of sea water at SSS
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hicif         !: Ice thickness
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hsnif         !: Snow thickness
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hicifp        !: Ice production/melting
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   frld          !: Leads fraction = 1-a/totalarea
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   phicif        !: ice thickness  at previous time 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   pfrld         !: Leads fraction at previous time  
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qstoif        !: Energy stored in the brine pockets
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fbif          !: Heat flux at the ice base
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rdmsnif       !: Variation of snow mass
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rdmicif       !: Variation of ice mass
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qldif         !: heat balance of the lead (or of the open ocean)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qcmif         !: Energy needed to freeze the ocean surface layer
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fdtcn         !: net downward heat flux from the ice to the ocean
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qdtcn         !: energy from the ice to the ocean point (at a factor 2)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   thcm          !: part of the solar energy used in the lead heat budget
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fstric        !: Solar flux transmitted trough the ice
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ffltbif       !: linked with the max heat contained in brine pockets (?)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fscmbq        !: Linked with the solar flux below the ice (?)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fsbbq         !: Also linked with the solar flux below the ice (?)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qfvbq         !: used to store energy in case of toral lateral ablation (?)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   dmgwi         !: Variation of the mass of snow ice
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   u_ice, v_ice  !: two components of the ice   velocity at I-point (m/s)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   u_oce, v_oce  !: two components of the ocean velocity at I-point (m/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvosif       !: ice volume change at ice surface (only used for outputs)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvobif       !: ice volume change at ice bottom  (only used for outputs)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fdvolif       !: Total   ice volume change (only used for outputs)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvonif       !: Lateral ice volume change (only used for outputs)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sist          !: Sea-Ice Surface Temperature [Kelvin]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tfu           !: Freezing/Melting point temperature of sea water at SSS
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hicif         !: Ice thickness
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hsnif         !: Snow thickness
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hicifp        !: Ice production/melting
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frld          !: Leads fraction = 1-a/totalarea
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   phicif        !: ice thickness  at previous time 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   pfrld         !: Leads fraction at previous time  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qstoif        !: Energy stored in the brine pockets
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fbif          !: Heat flux at the ice base
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdmsnif       !: Variation of snow mass
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdmicif       !: Variation of ice mass
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qldif         !: heat balance of the lead (or of the open ocean)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qcmif         !: Energy needed to freeze the ocean surface layer
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fdtcn         !: net downward heat flux from the ice to the ocean
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qdtcn         !: energy from the ice to the ocean point (at a factor 2)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   thcm          !: part of the solar energy used in the lead heat budget
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fstric        !: Solar flux transmitted trough the ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ffltbif       !: linked with the max heat contained in brine pockets (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fscmbq        !: Linked with the solar flux below the ice (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fsbbq         !: Also linked with the solar flux below the ice (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qfvbq         !: used to store energy in case of toral lateral ablation (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dmgwi         !: Variation of the mass of snow ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_ice, v_ice  !: two components of the ice   velocity at I-point (m/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce, v_oce  !: two components of the ocean velocity at I-point (m/s)
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jplayersp1) ::   tbif  !: Temperature inside the ice/snow layer
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tbif  !: Temperature inside the ice/snow layer
 
    !!* moment used in the advection scheme
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxice, syice, sxxice, syyice, sxyice   !: for ice  volume
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxsn,  sysn,  sxxsn,  syysn,  sxysn    !: for snow volume
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxa,   sya,   sxxa,   syya,   sxya     !: for ice cover area
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxc0,  syc0,  sxxc0,  syyc0,  sxyc0    !: for heat content of snow
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxc1,  syc1,  sxxc1,  syyc1,  sxyc1    !: for heat content of 1st ice layer
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxc2,  syc2,  sxxc2,  syyc2,  sxyc2    !: for heat content of 2nd ice layer
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sxst,  syst,  sxxst,  syyst,  sxyst    !: for heat content of brine pockets
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxice, syice, sxxice, syyice, sxyice   !: for ice  volume
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxsn,  sysn,  sxxsn,  syysn,  sxysn    !: for snow volume                  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxa,   sya,   sxxa,   syya,   sxya     !: for ice cover area               
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxc0,  syc0,  sxxc0,  syyc0,  sxyc0    !: for heat content of snow         
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxc1,  syc1,  sxxc1,  syyc1,  sxyc1    !: for heat content of 1st ice layer
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxc2,  syc2,  sxxc2,  syyc2,  sxyc2    !: for heat content of 2nd ice layer
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sxst,  syst,  sxxst,  syyst,  sxyst    !: for heat content of brine pockets
+   !!----------------------------------------------------------------------
+   CONTAINS
+
+   INTEGER FUNCTION ice_alloc_2()
+      !!-----------------------------------------------------------------
+      !!               *** FUNCTION ice_alloc_2 ***
+      !!-----------------------------------------------------------------
+      USE lib_mpp, ONLY:   ctl_warn   ! MPP library
+      INTEGER :: ierr(9)              ! Local variables
+      !!-----------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( ahiu(jpi,jpj) , pahu(jpi,jpj) ,                      &
+         &      ahiv(jpi,jpj) , pahv(jpi,jpj) , ust2s(jpi,jpj) , STAT=ierr(1) )
+         !
+      !* Ice Rheology
+#if defined key_lim2_vp
+      ALLOCATE( hsnm(jpi,jpj) , hicm(jpi,jpj) , STAT=ierr(2) )
+#else
+      ALLOCATE( stress1_i (jpi,jpj) , delta_i(jpi,jpj) , at_i(jpi,jpj) ,     &
+                stress2_i (jpi,jpj) , divu_i (jpi,jpj) , hsnm(jpi,jpj) ,     &
+                stress12_i(jpi,jpj) , shear_i(jpi,jpj) , hicm(jpi,jpj) , STAT=ierr(2) )
+#endif
+      ALLOCATE( rdvosif(jpi,jpj) , rdvobif(jpi,jpj) ,                      &
+         &      fdvolif(jpi,jpj) , rdvonif(jpi,jpj) ,                      &
+         &      sist   (jpi,jpj) , tfu    (jpi,jpj) , hicif(jpi,jpj) ,     &
+         &      hsnif  (jpi,jpj) , hicifp (jpi,jpj) , frld (jpi,jpj) , STAT=ierr(3) )
+
+      ALLOCATE(phicif(jpi,jpj) , pfrld  (jpi,jpj) , qstoif (jpi,jpj) ,     &
+         &     fbif  (jpi,jpj) , rdmsnif(jpi,jpj) , rdmicif(jpi,jpj) ,     &
+         &     qldif (jpi,jpj) , qcmif  (jpi,jpj) , fdtcn  (jpi,jpj) ,     &
+         &     qdtcn (jpi,jpj) , thcm   (jpi,jpj)                    , STAT=ierr(4) )
+
+      ALLOCATE(fstric(jpi,jpj) , ffltbif(jpi,jpj) , fscmbq(jpi,jpj) ,     &
+         &     fsbbq (jpi,jpj) , qfvbq  (jpi,jpj) , dmgwi (jpi,jpj) ,     &
+         &     u_ice (jpi,jpj) , v_ice  (jpi,jpj) ,                       &
+         &     u_oce (jpi,jpj) , v_oce  (jpi,jpj) ,                       &
+         &     tbif  (jpi,jpj,jplayersp1)                           , STAT=ierr(5))
+
+      !* moment used in the advection scheme
+      ALLOCATE(sxice (jpi,jpj) , syice (jpi,jpj) , sxxice(jpi,jpj) ,     &
+         &     syyice(jpi,jpj) , sxyice(jpi,jpj) ,                       &
+         &     sxsn  (jpi,jpj) , sysn  (jpi,jpj) , sxxsn (jpi,jpj) ,     &
+         &     syysn (jpi,jpj) , sxysn (jpi,jpj)                   , STAT=ierr(6) )
+      ALLOCATE(sxa   (jpi,jpj) , sya   (jpi,jpj) , sxxa  (jpi,jpj) ,     &
+         &     syya  (jpi,jpj) , sxya  (jpi,jpj) ,                       & 
+         &     sxc0  (jpi,jpj) , syc0  (jpi,jpj) , sxxc0 (jpi,jpj) ,     &
+         &     syyc0 (jpi,jpj) , sxyc0 (jpi,jpj)                   , STAT=ierr(7))
+      ALLOCATE(sxc1  (jpi,jpj) , syc1  (jpi,jpj) , sxxc1 (jpi,jpj) ,     &
+         &     syyc1 (jpi,jpj) , sxyc1 (jpi,jpj) ,                       &
+         &     sxc2  (jpi,jpj) , syc2  (jpi,jpj) , sxxc2 (jpi,jpj) ,     &
+         &     syyc2 (jpi,jpj) , sxyc2 (jpi,jpj)                   , STAT=ierr(8))
+      ALLOCATE(sxst  (jpi,jpj) , syst  (jpi,jpj) , sxxst (jpi,jpj) ,     &
+         &     syyst (jpi,jpj) , sxyst (jpi,jpj)                   , STAT=ierr(9))
+         !
+      ice_alloc_2 = MAXVAL( ierr )
+      !
+      IF( ice_alloc_2 /= 0 )   CALL ctl_warn('ice_alloc_2: failed to allocate arrays')
+      !
+   END FUNCTION ice_alloc_2
 
 #else
@@ -127,6 +190,5 @@
    !!----------------------------------------------------------------------
 #endif
-
-   !!----------------------------------------------------------------------
+   !!-----------------------------------------------------------------
    !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
    !! $Id$
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/iceini_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/iceini_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/iceini_2.F90	(revision 2715)
@@ -4,7 +4,8 @@
    !!   Sea-ice model : LIM 2.0 Sea ice model Initialization
    !!======================================================================
-   !! History :   1.0  !  02-08  (G. Madec)  F90: Free form and modules
-   !!             2.0  !  03-08  (C. Ethe)  add ice_run
-   !!             3.3  !  09-05  (G.Garric, C. Bricaud) addition of the lim2_evp case
+   !! History :  1.0  ! 2002-08  (G. Madec)  F90: Free form and modules
+   !!            2.0  ! 2003-08  (C. Ethe)  add ice_run
+   !!            3.3  ! 2009-05  (G. Garric, C. Bricaud) addition of the lim2_evp case
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim2
@@ -12,19 +13,23 @@
    !!   'key_lim2' :                                  LIM 2.0 sea-ice model
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
    !!   ice_init_2       : sea-ice model initialization
    !!   ice_run_2        : Definition some run parameter for ice model
    !!----------------------------------------------------------------------
+   USE phycst           ! physical constants
    USE dom_oce          ! ocean domain
-   USE dom_ice_2        ! LIM2: ice domain
    USE sbc_oce          ! surface boundary condition: ocean
-   USE sbc_ice          ! surface boundary condition: ice
-   USE phycst           ! Define parameters for the routines
-   USE ice_2            ! LIM2: ice variable
-   USE limmsh_2         ! LIM2: mesh
-   USE limistate_2      ! LIM2: initial state
-   USE limrst_2         ! LIM2: restart
+   USE sbc_ice          ! LIM2 surface boundary condition
+   USE dom_ice_2        ! LIM2 ice domain
+   USE par_ice_2        ! LIM2 parameters
+   USE thd_ice_2        ! LIM2 thermodynamical variables
+   USE limrhg           ! LIM2 rheology
+   USE ice_2            ! LIM2 ice variable
+   USE limmsh_2         ! LIM2 mesh
+   USE limistate_2      ! LIM2 initial state
+   USE limrst_2         ! LIM2 restart
+   USE limsbc_2         ! LIM2 surface boundary condition
    USE in_out_manager   ! I/O manager
-      
+   USE lib_mpp          ! MPP library
+
    IMPLICIT NONE
    PRIVATE
@@ -33,5 +38,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -45,5 +50,28 @@
       !! ** purpose :   initialisation of LIM-2 domain and variables  
       !!----------------------------------------------------------------------
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
       !
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'ice_init_2 : LIM-2 sea-ice - initialization'
+         WRITE(numout,*) '~~~~~~~~~~~   '
+      ENDIF
+      !                                ! Allocate the ice arrays
+      ierr =        ice_alloc_2    ()       ! ice variables
+      ierr = ierr + dom_ice_alloc_2()       ! domain
+      ierr = ierr + sbc_ice_alloc  ()       ! surface forcing
+      ierr = ierr + thd_ice_alloc_2()       ! thermodynamics
+#if ! defined key_lim2_vp
+      ierr = ierr + lim_rhg_alloc  ()
+#endif
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'ice_init_2 : unable to allocate ice arrays' )
+
+      !                                ! adequation jpk versus ice/snow layers
+      IF( jpl > jpk  .OR.  jplayersp1 > jpk  )   CALL ctl_stop( 'STOP',           &
+         &     'ice_init: the 3rd dimension of workspace arrays is too small.',   &
+         &     'use more ocean levels or less ice layers/categories.' )
+
       !                                ! Open the namelist file 
       CALL ctl_opn( numnam_ice, 'namelist_ice', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
@@ -61,6 +89,12 @@
       ENDIF
       !
-      tn_ice(:,:,1) = sist(:,:)        ! initialisation of ice temperature   
-      fr_i  (:,:) = 1.0 - frld(:,:)    ! initialisation of sea-ice fraction    
+      tn_ice(:,:,1) = sist(:,:)        ! ice temperature  known by the ocean
+      fr_i  (:,:)   = 1.0 - frld(:,:)  ! sea-ice fraction known by the ocean
+      !
+      CALL lim_sbc_init_2              ! ice surface boundary condition   
+      !
+      IF( lk_lim2_vp )   THEN   ;   WRITE(numout,*) '                VP  rheology - B-grid case'
+      ELSE                      ;   WRITE(numout,*) '                EVP rheology - C-grid case'
+      ENDIF
       !
    END SUBROUTINE ice_init_2
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limadv_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limadv_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limadv_2.F90	(revision 2715)
@@ -22,4 +22,5 @@
    USE lbclnk
    USE in_out_manager     ! I/O manager
+   USE lib_mpp            ! MPP library
    USE prtctl             ! Print control
 
@@ -58,4 +59,9 @@
       !! Reference:  Prather, 1986, JGR, 91, D6. 6671-6681.
       !!--------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zf0  => wrk_2d_11 , zfx   => wrk_2d_12 , zfy    => wrk_2d_13 , zbet => wrk_2d_14   ! 2D workspace
+      USE wrk_nemo, ONLY:   zfm  => wrk_2d_15 , zfxx  => wrk_2d_16 , zfyy   => wrk_2d_17 , zfxy => wrk_2d_18   !  -      -
+      USE wrk_nemo, ONLY:   zalg => wrk_2d_19 , zalg1 => wrk_2d_20 , zalg1q => wrk_2d_21                       !  -      -
+      !
       REAL(wp)                    , INTENT(in   ) ::   pdf                ! reduction factor for the time step
       REAL(wp)                    , INTENT(in   ) ::   pcrh               ! call lim_adv_x then lim_adv_y (=1) or the opposite (=0)
@@ -65,13 +71,14 @@
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   psx , psy          ! 1st moments 
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   psxx, psyy, psxy   ! 2nd moments
-      !! 
+      ! 
       INTEGER  ::   ji, jj                               ! dummy loop indices
       REAL(wp) ::   zs1max, zrdt, zslpmax, ztemp, zin0   ! temporary scalars
       REAL(wp) ::   zs1new, zalf , zalfq , zbt           !    -         -
       REAL(wp) ::   zs2new, zalf1, zalf1q, zbt1          !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zf0, zfx , zfy , zbet   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfm, zfxx, zfyy, zfxy   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zalg, zalg1, zalg1q     !  -      -
       !---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 11,12,13,14,15,16,17,18,19,20,21) ) THEN
+         CALL ctl_stop( 'lim_adv_x_2 : requested workspace arrays unavailable.' )   ;   RETURN
+      ENDIF
 
       ! Limitation of moments.                                           
@@ -218,4 +225,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 11,12,13,14,15,16,17,18,19,20,21) )   &
+          CALL ctl_stop( 'lim_adv_x_2 : failed to release workspace arrays.' )
+      !
    END SUBROUTINE lim_adv_x_2
 
@@ -235,4 +245,9 @@
       !! Reference:  Prather, 1986, JGR, 91, D6. 6671-6681.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zf0  => wrk_2d_11 , zfx   => wrk_2d_12 , zfy    => wrk_2d_13 , zbet => wrk_2d_14   ! 2D workspace
+      USE wrk_nemo, ONLY:   zfm  => wrk_2d_15 , zfxx  => wrk_2d_16 , zfyy   => wrk_2d_17 , zfxy => wrk_2d_18   !  -      -
+      USE wrk_nemo, ONLY:   zalg => wrk_2d_19 , zalg1 => wrk_2d_20 , zalg1q => wrk_2d_21                       !  -      -
+      !!
       REAL(wp)                    , INTENT(in   ) ::   pdf                ! reduction factor for the time step
       REAL(wp)                    , INTENT(in   ) ::   pcrh               ! call lim_adv_x then lim_adv_y (=1) or the opposite (=0)
@@ -247,8 +262,9 @@
       REAL(wp) ::   zs1new, zalf , zalfq , zbt           !    -         -
       REAL(wp) ::   zs2new, zalf1, zalf1q, zbt1          !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zf0, zfx , zfy , zbet   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfm, zfxx, zfyy, zfxy   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zalg, zalg1, zalg1q     !  -      -
       !---------------------------------------------------------------------
+
+      IF(wrk_in_use(2, 11,12,13,14,15,16,17,18,19,20,21) ) THEN
+         CALL ctl_stop( 'lim_adv_y_2 : requested workspace arrays unavailable.' )   ;   RETURN
+      END IF
 
       ! Limitation of moments.
@@ -398,4 +414,8 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 11,12,13,14,15,16,17,18,19,20,21) ) THEN
+        CALL ctl_stop( 'lim_adv_y_2 : failed to release workspace arrays.' )
+      END IF
+      !
    END SUBROUTINE lim_adv_y_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdia_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdia_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdia_2.F90	(revision 2715)
@@ -12,5 +12,4 @@
    !!   'key_lim2' :                                  LIM 2.0 sea-ice model
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
    !!   lim_dia_2      : computation of the time evolution of keys var.
    !!   lim_dia_init_2 : initialization and namelist read
@@ -24,4 +23,5 @@
    USE limistate_2     !
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -29,4 +29,5 @@
 
    PUBLIC               lim_dia_2          ! called by sbc_ice_lim_2
+
    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
@@ -52,5 +53,5 @@
    REAL(wp)                     ::   epsi06 = 1.e-06      ! ???
    REAL(wp), DIMENSION(jpinfmx) ::   vinfom               ! temporary working space
-   REAL(wp), DIMENSION(jpi,jpj) ::   aire                 ! masked grid cell area
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   aire                 ! masked grid cell area
 
    !! * Substitutions
@@ -61,5 +62,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -173,17 +173,15 @@
        !!-------------------------------------------------------------------
        CHARACTER(len=jpchinf) ::   titinf
-       INTEGER  ::   jv            ! dummy loop indice
-       INTEGER  ::   ntot , ndeb 
-       INTEGER  ::   nv            ! indice of variable 
-       REAL(wp) ::   zxx0, zxx1    ! temporary scalars
+       INTEGER  ::   jv   ! dummy loop indice
+       INTEGER  ::   ntot , ndeb, nv, ierr   ! local integer
+       REAL(wp) ::   zxx0, zxx1              ! local scalars
 
        NAMELIST/namicedia/fmtinf, nfrinf, ninfo, ntmoy
        !!-------------------------------------------------------------------
 
-       ! Read Namelist namicedia
-       REWIND ( numnam_ice )
-       READ   ( numnam_ice  , namicedia )
+       REWIND( numnam_ice )                     ! Read Namelist namicedia
+       READ  ( numnam_ice  , namicedia )
        
-       IF(lwp) THEN
+       IF(lwp) THEN                             ! control print
           WRITE(numout,*)
           WRITE(numout,*) 'lim_dia_init_2 : ice parameters for ice diagnostics '
@@ -195,15 +193,14 @@
        ENDIF
 
-       ! masked grid cell area
+       ALLOCATE( aire(jpi,jpj) , STAT=ierr )    ! masked grid cell area
+       IF( lk_mpp    )   CALL mpp_sum( ierr )
+       IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'lim_dia_init_2 : unable to allocate standard arrays' )
        aire(:,:) = area(:,:) * tms(:,:)
 
-       ! Titles of ice key variables :
-       nv = 1
+       nv = 1                                   ! Titles of ice key variables
        titvar(nv) = 'NoIt'  ! iteration number
        nv = nv + 1
        titvar(nv) = 'T yr'  ! time step in years
-       
        nbvt = nv - 1
-
        nv = nv + 1   ;   titvar(nv) = 'AEFN' ! sea ice area in the northern Hemisp.(10^12 km2)
        nv = nv + 1   ;   titvar(nv) = 'AEFS' ! sea ice area in the southern Hemisp.(10^12 km2)
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdmp_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdmp_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdmp_2.F90	(revision 2715)
@@ -13,10 +13,11 @@
    !!   lim_dmp_2      : ice model damping
    !!----------------------------------------------------------------------
-   USE in_out_manager  ! I/O manager
    USE ice_2           ! ice variables 
    USE sbc_oce, ONLY : nn_fsbc ! for fldread
    USE dom_oce         ! for mi0; mi1 etc ...
    USE fldread         ! read input fields
-   
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
+
    IMPLICIT NONE
    PRIVATE
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdyn_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdyn_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limdyn_2.F90	(revision 2715)
@@ -58,4 +58,8 @@
       !!              - treatment of the case if no ice dynamic
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_1d_1, wrk_1d_2
+      USE wrk_nemo, ONLY:   zu_io => wrk_2d_1, zv_io => wrk_2d_2  ! ice-ocean velocity
+      !
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -63,8 +67,13 @@
       INTEGER  ::   i_j1, i_jpj        ! Starting/ending j-indices for rheology
       REAL(wp) ::   zcoef              ! temporary scalar
-      REAL(wp), DIMENSION(jpj)     ::   zind           ! i-averaged indicator of sea-ice
-      REAL(wp), DIMENSION(jpj)     ::   zmsk           ! i-averaged of tmask
-      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io   ! ice-ocean velocity
+      REAL(wp), POINTER, DIMENSION(:) ::   zind     ! i-averaged indicator of sea-ice
+      REAL(wp), POINTER, DIMENSION(:) ::   zmsk     ! i-averaged of tmask
       !!---------------------------------------------------------------------
+
+      IF(  wrk_in_use(1, 1,2)  .OR.  wrk_in_use(2, 1,2)  ) THEN
+         CALL ctl_stop( 'lim_dyn_2 : requested workspace arrays unavailable' )   ;   RETURN
+      ENDIF
+      zind => wrk_1d_1(1:jpj)      ! Set-up pointers to sub-arrays of workspaces
+      zmsk => wrk_1d_2(1:jpj)
 
       IF( kt == nit000 )   CALL lim_dyn_init_2   ! Initialization (first time-step only)
@@ -93,6 +102,6 @@
             !
             DO jj = 1, jpj
-               zind(jj) = SUM( frld (:,jj  ) )   ! = FLOAT(jpj) if ocean everywhere on a j-line
-               zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0          if land  everywhere on a j-line
+               zind(jj) = SUM( frld (:,jj  ) )   ! = REAL(jpj) if ocean everywhere on a j-line
+               zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0         if land  everywhere on a j-line
             END DO
             !
@@ -200,4 +209,7 @@
       !
       IF(ln_ctl)   CALL prt_ctl(tab2d_1=ust2s , clinfo1=' lim_dyn  : ust2s :')
+      !
+      IF( wrk_not_released(1, 1,2)     .OR.   &
+          wrk_not_released(2, 1,2) )   CALL ctl_stop('lim_dyn_2 : failed to release workspace arrays')
       !
    END SUBROUTINE lim_dyn_2
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limhdf_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limhdf_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limhdf_2.F90	(revision 2715)
@@ -4,4 +4,8 @@
    !! LIM 2.0 ice model : horizontal diffusion of sea-ice quantities
    !!======================================================================
+   !! History :  LIM  !  2000-01 (LIM) Original code
+   !!             -   !  2001-05 (G. Madec, R. Hordoir) opa norm
+   !!            1.0  !  2002-08 (C. Ethe)  F90, free form
+   !!----------------------------------------------------------------------
 #if defined key_lim2
    !!----------------------------------------------------------------------
@@ -10,31 +14,28 @@
    !!   lim_hdf_2  : diffusion trend on sea-ice variable
    !!----------------------------------------------------------------------
-   !! * Modules used
-   USE dom_oce
-   USE in_out_manager
-   USE ice_2
-   USE lbclnk
-   USE lib_mpp
-   USE prtctl          ! Print control
+   USE dom_oce          ! ocean domain
+   USE ice_2            ! LIM-2: ice variables
+   USE lbclnk           ! lateral boundary condition - MPP exchanges
+   USE lib_mpp          ! MPP library
+   USE prtctl           ! Print control
+   USE in_out_manager   ! I/O manager
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_hdf_2    ! called by lim_tra_2
+   PUBLIC   lim_hdf_2         ! called by limtrp_2.F90
 
-   !! * Module variables
-   LOGICAL  ::   linit = .TRUE.              ! ???
-   REAL(wp) ::   epsi04 = 1e-04              ! constant
-   REAL(wp), DIMENSION(jpi,jpj) ::   zfact   ! ???
+   LOGICAL  ::   linit = .TRUE.   ! ! initialization flag (set to flase after the 1st call)
+   REAL(wp) ::   epsi04 = 1e-04   ! constant
+   
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   efact   ! metric coefficient
 
    !! * Substitution 
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -43,79 +44,64 @@
       !!                  ***  ROUTINE lim_hdf_2  ***
       !!
-      !! ** purpose :   Compute and add the diffusive trend on sea-ice
-      !!      variables
+      !! ** purpose :   Compute and add the diffusive trend on sea-ice variables
       !!
       !! ** method  :   Second order diffusive operator evaluated using a
-      !!      Cranck-Nicholson time Scheme.
+      !!              Cranck-Nicholson time Scheme.
       !!
       !! ** Action  :    update ptab with the diffusive contribution
-      !!
-      !! History :
-      !!        !  00-01 (LIM) Original code
-      !!        !  01-05 (G. Madec, R. Hordoir) opa norm
-      !!        !  02-08 (C. Ethe)  F90, free form
       !!-------------------------------------------------------------------
-      ! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) ::   &
-         ptab                 ! Field on which the diffusion is applied  
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         ptab0                ! ???
-
-      ! * Local variables
-      INTEGER ::  ji, jj      ! dummy loop indices
-      INTEGER ::  &
-         its, iter            ! temporary integers
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zflu => wrk_2d_11, zdiv  => wrk_2d_13, zrlx  => wrk_2d_15 
+      USE wrk_nemo, ONLY:   zflv => wrk_2d_12, zdiv0 => wrk_2d_14, ztab0 => wrk_2d_16
+      !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) ::   ptab   ! Field on which the diffusion is applied  
+      !
+      INTEGER  ::   ji, jj            ! dummy loop indices
+      INTEGER  ::   its, iter, ierr   ! local integers
+      REAL(wp) ::   zalfa, zrlxint, zconv, zeps   ! local scalars
       CHARACTER (len=55) :: charout
-      REAL(wp) ::  &
-         zalfa, zrlxint, zconv, zeps   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::  & 
-         zrlx, zflu, zflv, &  ! temporary workspaces
-         zdiv0, zdiv          !    "           "
       !!-------------------------------------------------------------------
 
-      ! Initialisation
-      ! ---------------   
-      ! Time integration parameters
-      zalfa = 0.5       ! =1.0/0.5/0.0 = implicit/Cranck-Nicholson/explicit
-      its   = 100       ! Maximum number of iteration
-      zeps  =  2. * epsi04
+      IF( wrk_in_use(2, 11,12,13,14,15,16) ) THEN
+         CALL ctl_stop( 'lim_hdf_2 : requested workspace arrays unavailable.' )   ;   RETURN
+      END IF
 
-      ! Arrays initialization
-      ptab0 (:, : ) = ptab(:,:)
-!bug  zflu (:,jpj) = 0.e0
-!bug  zflv (:,jpj) = 0.e0
-      zdiv0(:, 1 ) = 0.e0
-      zdiv0(:,jpj) = 0.e0
-      IF( .NOT.lk_vopt_loop ) THEN
-         zflu (jpi,:) = 0.e0   
-         zflv (jpi,:) = 0.e0
-         zdiv0(1,  :) = 0.e0
-         zdiv0(jpi,:) = 0.e0
-      ENDIF
-
-      ! Metric coefficient (compute at the first call and saved in
-      IF( linit ) THEN
+      !                       !==  Initialisation  ==!
+      !
+      IF( linit ) THEN              ! Metric coefficient (compute at the first call and saved in efact)
+         ALLOCATE( efact(jpi,jpj) , STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'lim_hdf_2 : unable to allocate standard arrays' )
          DO jj = 2, jpjm1  
             DO ji = fs_2 , fs_jpim1   ! vector opt.
-               zfact(ji,jj) = ( e2u(ji,jj) + e2u(ji-1,jj  ) + e1v(ji,jj) + e1v(ji,jj-1) ) &
-                  &          / ( e1t(ji,jj) * e2t(ji,jj) )
+               efact(ji,jj) = ( e2u(ji,jj) + e2u(ji-1,jj) + e1v(ji,jj) + e1v(ji,jj-1) ) / ( e1t(ji,jj) * e2t(ji,jj) )
             END DO
          END DO
          linit = .FALSE.
       ENDIF
+      !
+      !                             ! Time integration parameters
+      zalfa = 0.5_wp                      ! =1.0/0.5/0.0 = implicit/Cranck-Nicholson/explicit
+      its   = 100                         ! Maximum number of iteration
+      zeps  =  2._wp * epsi04
+      !
+      ztab0(:, : ) = ptab(:,:)      ! Arrays initialization
+      zdiv0(:, 1 ) = 0._wp
+      zdiv0(:,jpj) = 0._wp
+      IF( .NOT.lk_vopt_loop ) THEN
+         zflu (jpi,:) = 0._wp   
+         zflv (jpi,:) = 0._wp
+         zdiv0(1,  :) = 0._wp
+         zdiv0(jpi,:) = 0._wp
+      ENDIF
 
-
-      ! Sub-time step loop
-      zconv = 1.e0
+      zconv = 1._wp           !==  horizontal diffusion using a Crant-Nicholson scheme  ==!
       iter  = 0
-
-      !                                                   !===================
-      DO WHILE ( ( zconv > zeps ) .AND. (iter <= its) )   ! Sub-time step loop
-         !                                                !===================
-         ! incrementation of the sub-time step number
-         iter = iter + 1
-
-         ! diffusive fluxes in U- and V- direction
-         DO jj = 1, jpjm1
+      !
+      DO WHILE (  zconv > zeps  .AND.  iter <= its  )    ! Sub-time step loop
+         !
+         iter = iter + 1                                       ! incrementation of the sub-time step number
+         !
+         DO jj = 1, jpjm1                                      ! diffusive fluxes in U- and V- direction
             DO ji = 1 , fs_jpim1   ! vector opt.
                zflu(ji,jj) = pahu(ji,jj) * e2u(ji,jj) / e1u(ji,jj) * ( ptab(ji+1,jj) - ptab(ji,jj) )
@@ -123,7 +109,6 @@
             END DO
          END DO
-
-         ! diffusive trend : divergence of the fluxes
-         DO jj= 2, jpjm1
+         !
+         DO jj= 2, jpjm1                                       ! diffusive trend : divergence of the fluxes
             DO ji = fs_2 , fs_jpim1   ! vector opt. 
                zdiv (ji,jj) = (  zflu(ji,jj) - zflu(ji-1,jj  )   &
@@ -131,24 +116,20 @@
             END DO
          END DO
-
-         ! save the first evaluation of the diffusive trend in zdiv0
-         IF( iter == 1 )   zdiv0(:,:) = zdiv(:,:)       
-
-         ! XXXX iterative evaluation?????
-         DO jj = 2, jpjm1
+         !
+         IF( iter == 1 )   zdiv0(:,:) = zdiv(:,:)              ! save the 1st evaluation of the diffusive trend in zdiv0
+         !
+         DO jj = 2, jpjm1                                      ! iterative evaluation
             DO ji = fs_2 , fs_jpim1   ! vector opt.
-               zrlxint = (   ptab0(ji,jj)    &
-                  &       +  rdt_ice * (           zalfa   * ( zdiv(ji,jj) + zfact(ji,jj) * ptab(ji,jj) )   &
+               zrlxint = (   ztab0(ji,jj)    &
+                  &       +  rdt_ice * (           zalfa   * ( zdiv(ji,jj) + efact(ji,jj) * ptab(ji,jj) )   &
                   &                      + ( 1.0 - zalfa ) *   zdiv0(ji,jj) )  )                             & 
-                  &    / ( 1.0 + zalfa * rdt_ice * zfact(ji,jj) )
+                  &    / ( 1.0 + zalfa * rdt_ice * efact(ji,jj) )
                zrlx(ji,jj) = ptab(ji,jj) + om * ( zrlxint - ptab(ji,jj) )
             END DO
          END DO
+         CALL lbc_lnk( zrlx, 'T', 1. )                         ! lateral boundary condition
 
-         ! lateral boundary condition on ptab
-         CALL lbc_lnk( zrlx, 'T', 1. )
+         zconv = 0._wp                                         ! convergence test
 
-         ! convergence test
-         zconv = 0.e0
          DO jj = 2, jpjm1
             DO ji = 2, jpim1
@@ -156,18 +137,18 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mpp_max( zconv )   ! max over the global domain
+         IF( lk_mpp )   CALL mpp_max( zconv )                  ! max over the global domain
 
          ptab(:,:) = zrlx(:,:)
-
-         !                                         !==========================
-      END DO                                       ! end of sub-time step loop
-      !                                            !==========================
+         !
+      END DO                                             ! end of sub-time step loop
 
       IF(ln_ctl)   THEN
-         zrlx(:,:) = ptab(:,:) - ptab0(:,:)
+         zrlx(:,:) = ptab(:,:) - ztab0(:,:)
          WRITE(charout,FMT="(' lim_hdf  : zconv =',D23.16, ' iter =',I4,2X)") zconv, iter
-         CALL prt_ctl(tab2d_1=zrlx, clinfo1=charout)
+         CALL prt_ctl( tab2d_1=zrlx, clinfo1=charout )
       ENDIF
-
+      !
+      IF( wrk_not_released(2, 11,12,13,14,15,16) )   CALL ctl_stop('lim_hdf_2: failed to release workspace arrays')
+      !
    END SUBROUTINE lim_hdf_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limmsh_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limmsh_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limmsh_2.F90	(revision 2715)
@@ -19,4 +19,5 @@
    USE lbclnk
    USE in_out_manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -45,4 +46,6 @@
       !! ** Refer.  : Deleersnijder et al. Ocean Modelling 100, 7-10 
       !!--------------------------------------------------------------------- 
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zd2d1 => wrk_2d_1, zd1d2 => wrk_2d_2
       INTEGER :: ji, jj      ! dummy loop indices
       REAL(wp) ::   zusden   ! local scalars
@@ -51,7 +54,10 @@
       REAL(wp) ::   zh1p  , zh2p      !   -      -
       REAL(wp) ::   zd2d1p, zd1d2p    !   -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zd2d1 , zd1d2   ! 2D workspace
 #endif
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('lim_msh_2 : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) THEN
@@ -275,4 +281,6 @@
       area(:,:) = e1t(:,:) * e2t(:,:)
       !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('lim_msh_2 : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_msh_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limrhg_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limrhg_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limrhg_2.F90	(revision 2715)
@@ -33,8 +33,18 @@
    PRIVATE
 
-   PUBLIC   lim_rhg_2 ! routine called by lim_dyn
+   PUBLIC   lim_rhg_2         ! routine called by lim_dyn
+   PUBLIC   lim_rhg_alloc_2   ! routine called by lim_dyn_alloc_2
 
    REAL(wp) ::   rzero   = 0._wp   ! constant value: zero
    REAL(wp) ::   rone    = 1._wp   !            and  one
+
+   ! 2D workspaces for lim_rhg_2. Can't use wrk_nemo module for them because
+   ! extent in 2nd dimension is > jpj.
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zu0, zv0
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zu_n, zv_n
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zu_a, zv_a
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zviszeta, zviseta
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zzfrld, zztms
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   zi1, zi2, zmasst, zpresh
 
    !! * Substitutions
@@ -46,4 +56,22 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION lim_rhg_alloc_2()
+      !!-------------------------------------------------------------------
+      !!               ***  FUNCTION lim_rhg_alloc_2  ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( zu0(jpi,0:jpj+1),      zv0(jpi,0:jpj+1),     &
+         &      zu_n(jpi,0:jpj+1),     zv_n(jpi,0:jpj+1),    &
+         &      zu_a(jpi,0:jpj+1),     zv_a(jpi,0:jpj+1),    &
+         &      zviszeta(jpi,0:jpj+1), zviseta(jpi,0:jpj+1), &
+         &      zzfrld(jpi,0:jpj+1),   zztms(jpi,0:jpj+1),   &
+         &      zi1(jpi,0:jpj+1),      zi2(jpi,0:jpj+1),     &
+         &      zmasst(jpi,0:jpj+1),   zpresh(jpi,0:jpj+1),  &
+         &      Stat=lim_rhg_alloc_2)
+         !
+      IF( lim_rhg_alloc_2 /= 0 )   CALL ctl_warn('lim_rhg_alloc_2 : failed to allocate arrays')
+      !
+   END FUNCTION lim_rhg_alloc_2
+
 
    SUBROUTINE lim_rhg_2( k_j1, k_jpj )
@@ -59,4 +87,10 @@
       !!              at I-point
       !!-------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zfrld => wrk_2d_1, zmass => wrk_2d_2, zcorl => wrk_2d_3
+      USE wrk_nemo, ONLY: za1ct => wrk_2d_4, za2ct => wrk_2d_5, zresr => wrk_2d_6
+      USE wrk_nemo, ONLY: zc1u  => wrk_2d_7, zc1v  => wrk_2d_8, zc2u => wrk_2d_9
+      USE wrk_nemo, ONLY: zc2v  => wrk_2d_10, zsang => wrk_2d_11
+      !!
       INTEGER, INTENT(in) ::   k_j1    ! southern j-index for ice computation
       INTEGER, INTENT(in) ::   k_jpj   ! northern j-index for ice computation
@@ -79,14 +113,4 @@
       REAL(wp) ::   zs21_11, zs21_12, zs21_21, zs21_22
       REAL(wp) ::   zs22_11, zs22_12, zs22_21, zs22_22
-      REAL(wp), DIMENSION(jpi,  jpj  ) ::   zfrld, zmass, zcorl
-      REAL(wp), DIMENSION(jpi,  jpj  ) ::   za1ct, za2ct, zresr
-      REAL(wp), DIMENSION(jpi,  jpj  ) ::   zc1u, zc1v, zc2u, zc2v
-      REAL(wp), DIMENSION(jpi,  jpj  ) ::   zsang
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zu0, zv0
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zu_n, zv_n
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zu_a, zv_a
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zviszeta, zviseta
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zzfrld, zztms
-      REAL(wp), DIMENSION(jpi,0:jpj+1) ::   zi1, zi2, zmasst, zpresh
       !!-------------------------------------------------------------------
       
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 2715)
@@ -9,4 +9,5 @@
    !!            3.3  ! 2009-05 (G. Garric, C. Bricaud) addition of the lim2_evp case
    !!             -   ! 2010-11 (G. Madec) ice-ocean stress computed at each ocean time-step
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim2
@@ -14,6 +15,8 @@
    !!   'key_lim2'                                    LIM 2.0 sea-ice model
    !!----------------------------------------------------------------------
-   !!   lim_sbc_flx_2  : update mass, heat and salt fluxes at the ocean surface
-   !!   lim_sbc_tau_2  : update i- and j-stresses, and its modulus at the ocean surface
+   !!   lim_sbc_alloc_2 : allocate the limsbc arrays
+   !!   lim_sbc_init    : initialisation
+   !!   lim_sbc_flx_2   : update mass, heat and salt fluxes at the ocean surface
+   !!   lim_sbc_tau_2   : update i- and j-stresses, and its modulus at the ocean surface
    !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
@@ -27,4 +30,5 @@
    USE albedo           ! albedo parameters
    USE lbclnk           ! ocean lateral boundary condition - MPP exchanges
+   USE lib_mpp          ! MPP library
    USE in_out_manager   ! I/O manager
    USE diaar5, ONLY :   lk_diaar5
@@ -36,6 +40,7 @@
    PRIVATE
 
-   PUBLIC   lim_sbc_flx_2   ! called by sbc_ice_lim_2
-   PUBLIC   lim_sbc_tau_2   ! called by sbc_ice_lim_2
+   PUBLIC   lim_sbc_init_2     ! called by ice_init_2
+   PUBLIC   lim_sbc_flx_2      ! called by sbc_ice_lim_2
+   PUBLIC   lim_sbc_tau_2      ! called by sbc_ice_lim_2
 
    REAL(wp)  ::   r1_rdtice            ! = 1. / rdt_ice 
@@ -44,17 +49,30 @@
    REAL(wp)  ::   rone   = 1._wp       !     -      -
    !
-   REAL(wp), DIMENSION(jpi,jpj) ::   soce_0, sice_0   ! constant SSS and ice salinity used in levitating sea-ice case
-
-   REAL(wp), DIMENSION(jpi,jpj) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress              [N/m2]
-   REAL(wp), DIMENSION(jpi,jpj) ::   tmod_io              ! modulus of the ice-ocean relative velocity   [m/s]
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   soce_0, sice_0   ! constant SSS and ice salinity used in levitating sea-ice case
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress              [N/m2]
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean relative velocity   [m/s]
 
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION lim_sbc_alloc_2()
+      !!-------------------------------------------------------------------
+      !!             ***  ROUTINE lim_sbc_alloc_2 ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( soce_0(jpi,jpj) , utau_oce(jpi,jpj) ,                       &
+         &      sice_0(jpi,jpj) , vtau_oce(jpi,jpj) , tmod_io(jpi,jpj), STAT=lim_sbc_alloc_2)
+         !
+      IF( lk_mpp               )   CALL mpp_sum( lim_sbc_alloc_2 )
+      IF( lim_sbc_alloc_2 /= 0 )   CALL ctl_warn('lim_sbc_alloc_2: failed to allocate arrays.')
+      !
+   END FUNCTION lim_sbc_alloc_2
+
 
    SUBROUTINE lim_sbc_flx_2( kt )
@@ -82,4 +100,7 @@
       !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_not_released, wrk_in_use
+      USE wrk_nemo, ONLY: zqnsoce => wrk_2d_1 ! 2D workspace
+      USE wrk_nemo, ONLY: wrk_3d_4, wrk_3d_5
       INTEGER, INTENT(in) ::   kt    ! number of iteration
       !!
@@ -90,27 +111,12 @@
       REAL(wp) ::   zqsr, zqns, zfm            ! local scalars
       REAL(wp) ::   zinda, zfons, zemp         !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)   ::   zqnsoce       ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalb, zalbp   ! 2D/3D workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp   ! 2D/3D workspace
       !!---------------------------------------------------------------------
      
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'lim_sbc_flx_2 : LIM-2 sea-ice - surface boundary condition - Mass, heat & salt fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   '
-         !
-         r1_rdtice = 1._wp / rdt_ice
-         !
-         soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
-         sice_0(:,:) = sice
-         !
-         IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea 
-            WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
-               &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
-               soce_0(:,:) = 4._wp
-               sice_0(:,:) = 2._wp
-            END WHERE
-         ENDIF
-         !
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 4,5) )THEN
+         CALL ctl_stop('lim_sbc_flx_2 : requested workspace arrays unavailable')   ;   RETURN
       ENDIF
+      zalb  => wrk_3d_4(:,:,1:1)      ! Set-up pointers to sub-arrays of 3d workspaces
+      zalbp => wrk_3d_5(:,:,1:1)
 
       !------------------------------------------!
@@ -150,5 +156,5 @@
 !!$!                -> ice aera increases  ???         -> ice aera decreases ???
 !!$
-!!$            iadv    = ( 1  - i1mfr ) * zinda  
+!!$            iadv    = ( 1  - i1mfr ) * zinda
 !!$!                     pure ocean      ice at
 !!$!                     at current      previous
@@ -159,7 +165,7 @@
 !!$!                            current         
 !!$!                         -> ???
-!!$ 
-!!$            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
-!!$!                                                    ice disapear                           
+!!$
+!!$            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv
+!!$!                                                    ice disapear
 !!$
 !!$
@@ -229,7 +235,6 @@
 
       IF( lk_cpl ) THEN          ! coupled case
-         ! Ice surface temperature 
          tn_ice(:,:,1) = sist(:,:)          ! sea-ice surface temperature       
-         ! Computation of snow/ice and ocean albedo
+         !                                  ! Computation of snow/ice and ocean albedo
          CALL albedo_ice( tn_ice, reshape( hicif, (/jpi,jpj,1/) ), reshape( hsnif, (/jpi,jpj,1/) ), zalbp, zalb )
          alb_ice(:,:,1) =  0.5 * ( zalbp(:,:,1) + zalb (:,:,1) )   ! Ice albedo (mean clear and overcast skys)
@@ -244,4 +249,7 @@
          CALL prt_ctl(tab2d_1=fr_i  , clinfo1=' lim_sbc: fr_i   : ', tab2d_2=tn_ice(:,:,1), clinfo2=' tn_ice  : ')
       ENDIF 
+      !
+      IF( wrk_not_released(2, 1)     .OR.    &
+          wrk_not_released(3, 4,5) )   CALL ctl_stop('lim_sbc_flx_2 : failed to release workspace arrays')
       !
    END SUBROUTINE lim_sbc_flx_2
@@ -274,4 +282,6 @@
       !!              - taum       : modulus of the surface ocean stress (T-point) updated with ice-ocean fluxes
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztio_u => wrk_2d_1, ztio_v => wrk_2d_2     ! ocean stress below sea-ice
       INTEGER ,                     INTENT(in) ::   kt               ! ocean time-step index
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pu_oce, pv_oce   ! surface ocean currents
@@ -281,14 +291,8 @@
       REAL(wp) ::   zfrldv, zat_v, zv_i, zvtau_ice, zv_t, zmodi   !   -      -
       REAL(wp) ::   zsang, zumt                                   !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztio_u, ztio_v   ! ocean stress below sea-ice
       !!---------------------------------------------------------------------
       !
-      IF( kt == nit000 .AND. lwp ) THEN         ! control print
-         WRITE(numout,*)
-         WRITE(numout,*) 'lim_sbc_tau_2 : LIM 2.0 sea-ice - surface ocean momentum fluxes'
-         WRITE(numout,*) '~~~~~~~~~~~~~ '
-         IF( lk_lim2_vp )   THEN   ;   WRITE(numout,*) '                VP  rheology - B-grid case'
-         ELSE                      ;   WRITE(numout,*) '                EVP rheology - C-grid case'
-         ENDIF
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('lim_sbc_tau_2 : requested workspace arrays unavailable.')   ;   RETURN
       ENDIF
       !
@@ -405,5 +409,40 @@
          &                       tab2d_2=vtau, clinfo2=' vtau    : '        , mask2=vmask )
       !  
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('lim_sbc_tau_2 : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_sbc_tau_2
+
+
+   SUBROUTINE lim_sbc_init_2
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE lim_sbc_init  ***
+      !!             
+      !! ** Purpose : Preparation of the file ice_evolu for the output of
+      !!      the temporal evolution of key variables
+      !!
+      !! ** input   : Namelist namicedia
+      !!-------------------------------------------------------------------
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'lim_sbc_init_2 : LIM-2 sea-ice - surface boundary condition'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~   '
+
+      !                                      ! allocate lim_sbc arrays
+      IF( lim_sbc_alloc_2() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_flx_2 : unable to allocate arrays' )
+      !
+      r1_rdtice = 1._wp / rdt_ice
+      !
+      soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
+      sice_0(:,:) = sice
+      !
+      IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea 
+         WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
+            &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
+            soce_0(:,:) = 4._wp
+            sice_0(:,:) = 2._wp
+         END WHERE
+      ENDIF
+      !
+   END SUBROUTINE lim_sbc_init_2
 
 #else
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtab_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtab_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtab_2.F90	(revision 2715)
@@ -2,12 +2,11 @@
    !!======================================================================
    !!                       ***  MODULE limtab_2   ***
-   !!              transform 1D (2D) array to a 2D (1D) table
+   !!   LIM : transform 1D (2D) array to a 2D (1D) table
    !!======================================================================
 #if defined key_lim2
    !!----------------------------------------------------------------------
-   !!   tab_2d_1d  : 2-D to 1-D
-   !!   tab_1d_2d  : 1-D to 2-D
+   !!   tab_2d_1d  : 2-D <==> 1-D
+   !!   tab_1d_2d  : 1-D <==> 2-D
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_kind
 
@@ -15,66 +14,56 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC tab_2d_1d_2  ! called by lim_ther
-   PUBLIC tab_1d_2d_2  ! called by lim_ther
+   PUBLIC   tab_2d_1d_2   ! called by limthd
+   PUBLIC   tab_1d_2d_2   ! called by limthd
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
 
    SUBROUTINE tab_2d_1d_2 ( ndim1d, tab1d, tab2d, ndim2d_x, ndim2d_y, tab_ind )
-
-      INTEGER, INTENT(in) :: &
-         ndim1d, ndim2d_x, ndim2d_y
-
-      REAL(wp), DIMENSION (ndim2d_x, ndim2d_y), INTENT(in) ::  &
-         tab2d
-
-      INTEGER, DIMENSION ( ndim1d), INTENT ( in) :: &
-         tab_ind
-
-      REAL(wp), DIMENSION(ndim1d), INTENT ( out) ::  & 
-         tab1d
-
-      INTEGER ::  &
-         jn , jid, jjd
-        
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tab_2d_1d  ***
+      !!----------------------------------------------------------------------
+      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1D & 2D sizes
+      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(in   ) ::   tab2d                        ! input 2D field
+      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
+      REAL(wp), DIMENSION(ndim1d)           , INTENT(  out) ::   tab1d                        ! output 1D field
+      !
+      INTEGER ::   jn , jid, jjd
+      !!----------------------------------------------------------------------
       DO jn = 1, ndim1d
-         jid        = MOD( tab_ind(jn) - 1, ndim2d_x ) + 1
-         jjd        = ( tab_ind(jn) - 1 ) / ndim2d_x + 1
+         jid        = MOD( tab_ind(jn) - 1 , ndim2d_x ) + 1
+         jjd        =    ( tab_ind(jn) - 1 ) / ndim2d_x + 1
          tab1d( jn) = tab2d( jid, jjd)
       END DO 
-
    END SUBROUTINE tab_2d_1d_2
 
 
    SUBROUTINE tab_1d_2d_2 ( ndim1d, tab2d, tab_ind, tab1d, ndim2d_x, ndim2d_y )
-
-      INTEGER, INTENT ( in) :: &
-         ndim1d, ndim2d_x, ndim2d_y
-
-      INTEGER, DIMENSION (ndim1d) , INTENT (in) :: &
-         tab_ind
-
-      REAL(wp), DIMENSION(ndim1d), INTENT (in) ::  &
-         tab1d  
-
-      REAL(wp), DIMENSION (ndim2d_x, ndim2d_y), INTENT ( out) :: &
-         tab2d
-
-      INTEGER :: &
-         jn, jid, jjd
-
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tab_2d_1d  ***
+      !!----------------------------------------------------------------------
+      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1d & 2D sizes
+      REAL(wp), DIMENSION(ndim1d)           , INTENT(in   ) ::   tab1d                        ! input 1D field
+      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
+      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(  out) ::   tab2d                        ! output 2D field
+      !
+      INTEGER ::   jn , jid, jjd
+      !!----------------------------------------------------------------------
       DO jn = 1, ndim1d
-         jid             = MOD( tab_ind(jn) - 1, ndim2d_x) + 1
+         jid             = MOD( tab_ind(jn) - 1 , ndim2d_x ) + 1
          jjd             =    ( tab_ind(jn) - 1 ) / ndim2d_x  + 1
          tab2d(jid, jjd) = tab1d( jn)
       END DO
-
    END SUBROUTINE tab_1d_2d_2
 
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option        Dummy module             NO LIM sea-ice model
+   !!----------------------------------------------------------------------
 #endif
+   !!======================================================================
 END MODULE limtab_2
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90	(revision 2715)
@@ -75,4 +75,17 @@
       !! References :   Goosse et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztmp    => wrk_2d_1, & ! 2D workspace
+                          zqlbsbq => wrk_2d_2, & ! link with lead energy budget qldif
+                          zlicegr => wrk_2d_3    ! link with lateral ice growth 
+      USE wrk_nemo, ONLY: zmsk => wrk_3d_4       ! 3D workspace
+      USE wrk_nemo, ONLY: zdvosif => wrk_2d_4, & !: Variation of volume at surface
+                          zdvobif => wrk_2d_5, & !: Variation of ice volume at the bottom ice     (outputs only)
+                          zdvolif => wrk_2d_6, & !: Total variation of ice volume                 (outputs only)
+                          zdvonif => wrk_2d_7, & !: Surface accretion Snow to Ice transformation  (outputs only)
+                          zdvomif => wrk_2d_8, & !: Bottom variation of ice volume due to melting (outputs only)
+                          zu_imasstr =>wrk_2d_9, & !: Sea-ice transport along i-axis at U-point     (outputs only) 
+                          zv_imasstr =>wrk_2d_10   !: Sea-ice transport along j-axis at V-point     (outputs only) 
+      !!
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -91,6 +104,5 @@
       REAL(wp) ::   zfontn               ! heat flux from snow thickness
       REAL(wp) ::   zfntlat, zpareff     ! test. the val. of lead heat budget
-      REAL(wp), DIMENSION(jpi,jpj)     ::   ztmp      ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zqlbsbq   ! link with lead energy budget qldif
+
       REAL(wp) ::   zuice_m, zvice_m     ! Sea-ice velocities at U & V-points
       REAL(wp) ::   zhice_u, zhice_v     ! Sea-ice volume at U & V-points
@@ -98,18 +110,14 @@
       REAL(wp) ::   zrhoij, zrhoijm1     ! temporary scalars
       REAL(wp) ::   zztmp                ! temporary scalars within a loop
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zlicegr   ! link with lateral ice growth 
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmsk      ! 3D workspace
 !!$      REAL(wp), DIMENSION(jpi,jpj) ::   firic         !: IR flux over the ice            (outputs only)
 !!$      REAL(wp), DIMENSION(jpi,jpj) ::   fcsic         !: Sensible heat flux over the ice (outputs only)
 !!$      REAL(wp), DIMENSION(jpi,jpj) ::   fleic         !: Latent heat flux over the ice   (outputs only)
 !!$      REAL(wp), DIMENSION(jpi,jpj) ::   qlatic        !: latent flux                     (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdvosif       !: Variation of volume at surface                (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdvobif       !: Variation of ice volume at the bottom ice     (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdvolif       !: Total variation of ice volume                 (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdvonif       !: Surface accretion Snow to Ice transformation  (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdvomif       !: Bottom variation of ice volume due to melting (outputs only)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zu_imasstr    !: Sea-ice transport along i-axis at U-point     (outputs only) 
-      REAL(wp), DIMENSION(jpi,jpj) ::   zv_imasstr    !: Sea-ice transport along j-axis at V-point     (outputs only) 
       !!-------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10)   .OR.  &
+          wrk_in_use(3, 4)                    ) THEN
+         CALL ctl_stop('lim_thd_2 : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )   CALL lim_thd_init_2  ! Initialization (first time-step only)
@@ -512,4 +520,9 @@
       ENDIF
        !
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10)   .OR.  &
+          wrk_not_released(3, 4)                    ) THEN
+         CALL ctl_stop('lim_thd_2 : failed to release workspace arrays')
+      ENDIF
+      !
     END SUBROUTINE lim_thd_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_lac_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_lac_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_lac_2.F90	(revision 2715)
@@ -7,6 +7,6 @@
 
    !!----------------------------------------------------------------------
-   !!   lim_lat_acr_2    : lateral accretion of ice
-   !! * Modules used
+   !!   lim_lat_acr_2   : lateral accretion of ice
+   !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
    USE phycst
@@ -14,12 +14,11 @@
    USE ice_2
    USE limistate_2 
-     
+   USE lib_mpp          ! MPP library
+
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_thd_lac_2   ! called by lim_thd_2
-
-   !! * Module variables
+   PUBLIC   lim_thd_lac_2   ! called by lim_thd_2
+
    REAL(wp)  ::           &  ! constant values
       epsi20 = 1.e-20  ,  &
@@ -27,4 +26,5 @@
       zzero  = 0.e0    ,  &
       zone   = 1.e0
+
    !!----------------------------------------------------------------------
    !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
@@ -68,10 +68,12 @@
       !!   2.0  !  02-08 (C. Ethe, G. Madec)  F90, mpp
       !!-------------------------------------------------------------------
-      !! * Arguments
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_1d_1, wrk_1d_2, wrk_1d_3, wrk_1d_4, wrk_1d_5, wrk_1d_6
+      !
       INTEGER , INTENT(IN)::  &
          kideb          ,   &  ! start point on which the the computation is applied
          kiut                  ! end point on which the the computation is applied
 
-      !! * Local variables
+      ! * Local variables
       INTEGER ::            &
          ji             ,   &  !  dummy loop indices
@@ -79,5 +81,5 @@
          iiceform       ,   &  !  1 = ice formed   ; 0 = no ice formed
          ihemis                !  dummy indice
-      REAL(wp), DIMENSION(jpij) :: &
+      REAL(wp), POINTER, DIMENSION(:) :: &
          zqbgow           ,  &  !  heat budget of the open water (negative)
          zfrl_old         ,  &  !  previous sea/ice fraction
@@ -101,5 +103,16 @@
          zah, zalpha , zbeta
       !!---------------------------------------------------------------------      
-                   
+               
+      IF( wrk_in_use(1, 1,2,3,4,5,6) ) THEN
+         CALL ctl_stop('lim_thd_lac_2 : requestead workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      ! Set-up pointers to sub-arrays of workspace arrays
+      zqbgow    => wrk_1d_1(1:jpij)
+      zfrl_old  => wrk_1d_2(1:jpij)         
+      zhice_old => wrk_1d_3(1:jpij)        
+      zhice0    => wrk_1d_4(1:jpij)        
+      zfrlmin   => wrk_1d_5(1:jpij)        
+      zdhicbot  => wrk_1d_6(1:jpij) 
+      
       !--------------------------------------------------------------
       !   Computation of the heat budget of the open water (negative)
@@ -219,13 +232,16 @@
       END DO
       
+      IF( wrk_not_released(1, 1,2,3,4,5,6) )   CALL ctl_stop('lim_thd_lac_2 : failed to release workspace arrays.')
+      !
    END SUBROUTINE lim_thd_lac_2
 #else
-   !!======================================================================
+   !!----------------------------------------------------------------------
    !!                       ***  MODULE limthd_lac_2   ***
    !!                           no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_thd_lac_2           ! Empty routine
    END SUBROUTINE lim_thd_lac_2
 #endif
+   !!======================================================================
 END MODULE limthd_lac_2
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_zdf_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_zdf_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_zdf_2.F90	(revision 2715)
@@ -11,8 +11,6 @@
    !!   'key_lim2'                                    LIM 2.0 sea-ice model
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
    !!   lim_thd_zdf_2 : vertical accr./abl. and lateral ablation of sea ice
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_oce          ! ocean parameters
    USE phycst           ! ???
@@ -21,4 +19,5 @@
    USE limistate_2
    USE in_out_manager
+   USE lib_mpp          ! MPP library
    USE cpl_oasis3, ONLY : lk_cpl
       
@@ -35,7 +34,6 @@
    !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -69,10 +67,19 @@
       !!              Fichefet T. and M. Maqueda 1999, Clim. Dyn, 15(4), 251-268  
       !!------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_1d_1,  wrk_1d_2,  wrk_1d_3,  wrk_1d_4,  wrk_1d_5 
+      USE wrk_nemo, ONLY: wrk_1d_6,  wrk_1d_7,  wrk_1d_8,  wrk_1d_9,  wrk_1d_10
+      USE wrk_nemo, ONLY: wrk_1d_11, wrk_1d_12, wrk_1d_13, wrk_1d_14, wrk_1d_15
+      USE wrk_nemo, ONLY: wrk_1d_16, wrk_1d_17, wrk_1d_18, wrk_1d_19, wrk_1d_20
+      USE wrk_nemo, ONLY: wrk_1d_21, wrk_1d_22, wrk_1d_23, wrk_1d_24, wrk_1d_25
+      USE wrk_nemo, ONLY: wrk_1d_26, wrk_1d_27
+      !!
       INTEGER, INTENT(in) ::   kideb    ! Start point on which the  the computation is applied
       INTEGER, INTENT(in) ::   kiut     ! End point on which the  the computation is applied
       !!
       INTEGER ::   ji       ! dummy loop indices
-      REAL(wp), DIMENSION(jpij,2) ::   zqcmlt        ! energy due to surface( /1 ) and bottom melting( /2 )
-      REAL(wp), DIMENSION(jpij) ::  &
+      REAL(wp), POINTER, DIMENSION(:) ::   zqcmlts        ! energy due to surface melting
+      REAL(wp), POINTER, DIMENSION(:) ::   zqcmltb        ! energy due to bottom melting
+      REAL(wp), POINTER, DIMENSION(:) ::  &
          ztsmlt      &    ! snow/ice surface melting temperature
          ,ztbif      &    ! int. temp. at the mid-point of the 1st layer of the snow/ice sys. 
@@ -88,5 +95,5 @@
          , zts_old   &    ! previous surface temperature
          , zidsn , z1midsn , zidsnic ! tempory variables
-      REAL(wp), DIMENSION(jpij) ::   &
+      REAL(wp), POINTER, DIMENSION(:) ::   &
           zfnet       &  ! net heat flux at the top surface( incl. conductive heat flux)
           , zsprecip  &    ! snow accumulation
@@ -160,4 +167,40 @@
        !!----------------------------------------------------------------------
 
+       IF(wrk_in_use(1, 1,  2, 3, 4, 5, 6, 7, 8, 9,10, &
+          &             11,12,13,14,15,16,17,18,19,20, &
+          &             21,22,23,24,25,26,27) ) THEN
+          CALL ctl_stop('lim_thd_zdf_2 : requested workspace arrays unavailable')   ;   RETURN
+       ENDIF
+
+       ztsmlt  => wrk_1d_1(1:jpij)
+       ztbif   => wrk_1d_2(1:jpij)  
+       zksn    => wrk_1d_3(1:jpij)  
+       zkic    => wrk_1d_4(1:jpij)   
+       zksndh  => wrk_1d_5(1:jpij)   
+       zfcsu   => wrk_1d_6(1:jpij)   
+       zfcsudt => wrk_1d_7(1:jpij)  
+       zi0     => wrk_1d_8(1:jpij)   
+       z1mi0   => wrk_1d_9(1:jpij)    
+       zqmax   => wrk_1d_10(1:jpij)    
+       zrcpdt  => wrk_1d_11(1:jpij)  
+       zts_old => wrk_1d_12(1:jpij)  
+       zidsn   => wrk_1d_13(1:jpij) 
+       z1midsn => wrk_1d_14(1:jpij) 
+       zidsnic => wrk_1d_15(1:jpij)
+
+       zfnet     => wrk_1d_16(1:jpij)
+       zsprecip  => wrk_1d_17(1:jpij)  
+       zhsnw_old => wrk_1d_18(1:jpij) 
+       zdhictop  => wrk_1d_19(1:jpij) 
+       zdhicbot  => wrk_1d_20(1:jpij)
+       zqsup     => wrk_1d_21(1:jpij)  
+       zqocea    => wrk_1d_22(1:jpij)
+       zfrl_old  => wrk_1d_23(1:jpij) 
+       zfrld_1d  => wrk_1d_24(1:jpij) 
+       zep       => wrk_1d_25(1:jpij) 
+
+       zqcmlts   => wrk_1d_26(1:jpij)
+       zqcmltb   => wrk_1d_27(1:jpij)
+
        !-----------------------------------------------------------------------
        !  1. Boundaries conditions for snow/ice system internal temperature
@@ -171,8 +214,8 @@
           zihic = MAX( zzero , SIGN( zone , hicdif - h_ice_1d(ji) ) )
           !--computation of energy due to surface melting
-          zqcmlt(ji,1) = ( MAX ( zzero ,  &
+          zqcmlts(ji) = ( MAX ( zzero ,  &
              &                   rcpsn * h_snow_1d(ji) * ( tbif_1d(ji,1) - rt0_snow ) ) ) * ( 1.0 - zihsn )
           !--computation of energy due to bottom melting
-          zqcmlt(ji,2) = ( MAX( zzero , &
+          zqcmltb(ji) = ( MAX( zzero , &
              &                  rcpic * ( tbif_1d(ji,2) - rt0_ice ) * ( h_ice_1d(ji) / 2. ) ) &
              &           + MAX( zzero , &
@@ -467,5 +510,5 @@
           zhsnw_old(ji) =  h_snow_1d(ji)
           !--computation of the energy needed to melt snow
-          zqsnw_mlt  = zfnet(ji) * rdt_ice - zqcmlt(ji,1)
+          zqsnw_mlt  = zfnet(ji) * rdt_ice - zqcmlts(ji)
           !--change in snow thickness due to melt
           zdhsmlt = - zqsnw_mlt / xlsn
@@ -587,6 +630,6 @@
 
           !---treatment of the case of melting/growing
-          zqice_bot   =         zibmlt   * ( zqice_bot_mlt - zqcmlt(ji,2) )   &
-             &        + ( 1.0 - zibmlt ) * ( zqice_bot - zqcmlt(ji,2)  )
+          zqice_bot   =         zibmlt   * ( zqice_bot_mlt - zqcmltb(ji) )   &
+             &        + ( 1.0 - zibmlt ) * ( zqice_bot - zqcmltb(ji)  )
           qstbif_1d(ji) =         zibmlt   * qstbif_1d(ji)   &
              &           + ( 1.0 - zibmlt ) * zqstbif_bot
@@ -762,4 +805,9 @@
        END DO
        ! 
+       IF( wrk_not_released(1, 1,  2, 3, 4, 5, 6, 7, 8, 9,10,   &
+           &                   11,12,13,14,15,16,17,18,19,20,   &
+           &                   21,22,23,24,25,26,27)        )   &
+           CALL ctl_stop('lim_thd_zdf_2 : failed to release workspace arrays.')
+       !
     END SUBROUTINE lim_thd_zdf_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limtrp_2.F90	(revision 2715)
@@ -63,4 +63,10 @@
       !! ** action :
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zui_u  => wrk_2d_1, zvi_v => wrk_2d_2, zsm  => wrk_2d_3
+      USE wrk_nemo, ONLY: zs0ice => wrk_2d_4, zs0sn => wrk_2d_5, zs0a => wrk_2d_6
+      USE wrk_nemo, ONLY: zs0c0 => wrk_2d_7,  zs0c1 => wrk_2d_8, zs0c2 => wrk_2d_9, &
+                          zs0st => wrk_2d_10
+      !!
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -71,8 +77,9 @@
       REAL(wp) ::   zvbord , zcfl   , zusnit            !   -      -
       REAL(wp) ::   zrtt   , ztsn   , ztic1 , ztic2     !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)  ::   zui_u , zvi_v , zsm             ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj)  ::   zs0ice, zs0sn , zs0a            !  -      -
-      REAL(wp), DIMENSION(jpi,jpj)  ::   zs0c0 , zs0c1 , zs0c2 , zs0st   !  -      -
       !---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10) ) THEN
+         CALL ctl_stop('lim_trp_2 : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000  )   CALL lim_trp_init_2      ! Initialization (first time-step only)
@@ -266,4 +273,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10) )   CALL ctl_stop('lim_trp_2 : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_trp_2
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_2.F90	(revision 2715)
@@ -26,7 +26,8 @@
    USE ice_2
 
+   USE dianam          ! build name of file (routine)
    USE lbclnk
-   USE dianam          ! build name of file (routine)
    USE in_out_manager
+   USE lib_mpp         ! MPP library
    USE iom
    USE ioipsl
@@ -39,4 +40,5 @@
 #endif
    PUBLIC   lim_wri_state_2   ! called by dia_wri_state 
+   PUBLIC   lim_wri_alloc_2   ! called by nemogcm.F90
 
    INTEGER, PARAMETER                       ::   jpnoumax = 40   ! maximum number of variable for ice output
@@ -50,10 +52,12 @@
 
    INTEGER ::   nice, nhorid, ndim, niter, ndepid       ! ????
-   INTEGER , DIMENSION( jpij ) ::   ndex51              ! ????
-
-   REAL(wp)  ::            &  ! constant values
-      epsi16 = 1.e-16   ,  &
-      zzero  = 0.e0     ,  &
-      zone   = 1.e0
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: ndex51   ! ????
+
+   REAL(wp) ::   epsi16 = 1.e-16_wp   ! constant values
+   REAL(wp) ::   zzero  = 0._wp       !     -      -
+   REAL(wp) ::   zone   = 1._wp       !     -      -
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zcmo      ! Workspace array for netcdf writer. 
+
 
    !! * Substitutions
@@ -64,6 +68,17 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION lim_wri_alloc_2()
+      !!-------------------------------------------------------------------
+      !!                  ***   ROUTINE lim_wri_alloc_2  ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( ndex51(jpij), zcmo(jpi,jpj,jpnoumax), STAT=lim_wri_alloc_2)
+      !
+      IF( lk_mpp               )   CALL mpp_sum ( lim_wri_alloc_2 )
+      IF( lim_wri_alloc_2 /= 0 )   CALL ctl_warn('lim_wri_alloc_2: failed to allocate array ndex51')
+      !
+   END FUNCTION lim_wri_alloc_2
+
 
 #if ! defined key_iomput
@@ -85,4 +100,7 @@
       !!      of a day
       !!-------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zfield => wrk_2d_1
+      !!
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -92,10 +110,13 @@
          &          zindh, zinda, zindb, ztmu
       REAL(wp), DIMENSION(1)                ::   zdept
-      REAL(wp), DIMENSION(jpi,jpj)          ::   zfield
-      REAL(wp), DIMENSION(jpi,jpj,jpnoumax) ::   zcmo
-      !!-------------------------------------------------------------------
+      !!-------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('lim_wri_2 : requested workspace array unavailable')   ;   RETURN
+      ENDIF
                                                  !--------------------!
       IF( kt == nit000 ) THEN                    !   Initialisation   !
          !                                       !--------------------!
+
          CALL lim_wri_init_2 
                            
@@ -186,4 +207,6 @@
       IF( ( nn_fsbc * niter ) >= nitend )   CALL histclo( nice ) 
 
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('lim_wri_2 : failed to release workspace array.')
+      !
    END SUBROUTINE lim_wri_2
      
@@ -222,4 +245,8 @@
          field_19
       !!-------------------------------------------------------------------
+      !
+      IF( lim_wri_alloc_2() /= 0 ) THEN      ! allocate lim_wri arrrays
+         CALL ctl_stop( 'STOP', 'lim_wri_init_2 : unable to allocate standard arrays' )   ;   RETURN
+      ENDIF
 
       REWIND ( numnam_ice )                ! Read Namelist namicewri
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_dimg_2.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_dimg_2.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/limwri_dimg_2.h90	(revision 2715)
@@ -18,20 +18,19 @@
     INTEGER, INTENT(in) ::   kt     ! number of iteration
 
-    REAL(wp),DIMENSION(1) ::   zdept
+    INTEGER , SAVE ::   nmoyice   !: counter for averaging
+    INTEGER , SAVE ::   nwf       !: number of fields to write on disk
+    INTEGER , SAVE, DIMENSION(:), ALLOCATABLE  :: nsubindex   !: subindex to be saved
+    INTEGER , SAVE ::   nice, nhorid, ndim, niter, ndepid
+    REAL(wp), SAVE, DIMENSION(jpi,jpj,jpnoumax) :: rcmoy
 
-    REAL(wp) :: &
-         zsto, zsec, zjulian,zout, &
-         zindh,zinda,zindb,  &
-         ztmu
-    REAL(wp), DIMENSION(jpi,jpj,jpnoumax) :: &
-         zcmo
-    REAL(wp), DIMENSION(jpi,jpj) ::  &
-         zfield
-    INTEGER, SAVE :: nmoyice, &  !: counter for averaging
-         &             nwf         !: number of fields to write on disk
-    INTEGER, SAVE,DIMENSION (:), ALLOCATABLE  :: nsubindex   !: subindex to be saved
-    ! according to namelist
+    INTEGER ::  ji, jj, jf, ii   ! dummy loop indices and array index
+    INTEGER :: iyear, iday, imon ! 
+    CHARACTER(LEN=80) :: clname, cltext, clmode
+    REAL(wp), DIMENSION(1) ::   zdept
+    REAL(wp) ::   zsto, zsec, zjulian,zout
+    REAL(wp) ::   zindh,zinda,zindb, ztmu
+    REAL(wp), DIMENSION(jpi,jpj,jpnoumax) ::   zcmo   !ARPDBGWORK
+    REAL(wp), DIMENSION(jpi,jpj)          ::   zfield
 
-    REAL(wp), SAVE, DIMENSION(jpi,jpj,jpnoumax) :: rcmoy
 #if ! defined key_diainstant
     LOGICAL, PARAMETER :: ll_dia_inst=.false.      ! local logical variable 
@@ -39,17 +38,8 @@
     LOGICAL, PARAMETER :: ll_dia_inst=.true.
 #endif
-    INTEGER ::  ji, jj, jf, ii   ! dummy loop indices and array index
-    INTEGER :: iyear, iday, imon ! 
+    !!-------------------------------------------------------------------
 
-    CHARACTER(LEN=80) :: clname, cltext, clmode
-
-
-    INTEGER , SAVE ::      &
-         nice, nhorid, ndim, niter, ndepid
-    INTEGER , DIMENSION( jpij ) , SAVE ::  &
-         ndex51  
-    !!-------------------------------------------------------------------
-    IF ( kt == nit000 ) THEN 
-
+    IF( kt == nit000 ) THEN 
+       !
        CALL lim_wri_init_2 
 
@@ -57,5 +47,5 @@
        ii  = 0
 
-       IF (lwp ) THEN
+       IF(lwp ) THEN
           WRITE(numout,*) 'lim_wri_2 : Write ice outputs in dimg'
           WRITE(numout,*) '~~~~~~~~'
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_2/thd_ice_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_2/thd_ice_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_2/thd_ice_2.F90	(revision 2715)
@@ -12,9 +12,10 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_ice_2
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC thd_ice_alloc_2 ! Routine called by nemogcm.F90
 
    !! * Share Module variables
@@ -43,9 +44,9 @@
       cnscg                  !: ratio  rcpsn/rcpic
 
-   INTEGER , PUBLIC, DIMENSION(jpij) ::   &  !:
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   &  !:
       npb     ,   &   !: number of points where computations has to be done
       npac            !: correspondance between the points
 
-   REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !: 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   &  !: 
       qldif_1d    ,     &  !: corresponding to the 2D var  qldif
       qcmif_1d    ,     &  !: corresponding to the 2D var  qcmif
@@ -80,8 +81,45 @@
       dqla_ice_1d          !:    "                  "      dqla_ice
 
-   REAL(wp), PUBLIC, DIMENSION(jpij,jplayersp1) ::   &  !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &  !:
       tbif_1d              !: corresponding to the 2D var  tbif
 
+   !!----------------------------------------------------------------------
+   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+ CONTAINS
+
+   INTEGER FUNCTION thd_ice_alloc_2()
+      !!----------------------------------------------------------------------
+      USE lib_mpp        ! MPP library
+      INTEGER :: ierr(4)
+      !!----------------------------------------------------------------------
+      !
+      ierr(:) = 0
+      !
+      ALLOCATE( npb(jpij), npac(jpij),                             &
+         &      qldif_1d(jpij), qcmif_1d(jpij), thcm_1d(jpij),     &
+         &      fstbif_1d(jpij), fltbif_1d(jpij), fscbq_1d(jpij),  &
+         &      qsr_ice_1d(jpij),fr1_i0_1d(jpij), fr2_i0_1d(jpij), Stat=ierr(1))
+         !
+      ALLOCATE( qns_ice_1d(jpij), qfvbq_1d(jpij), sist_1d(jpij), tfu_1d(jpij), &
+         &      sprecip_1d(jpij), h_snow_1d(jpij),h_ice_1d(jpij),frld_1d(jpij),&
+         &      qstbif_1d(jpij),  fbif_1d(jpij),  Stat=ierr(2))
+         !
+      ALLOCATE( rdmicif_1d(jpij), rdmsnif_1d(jpij), qlbbq_1d(jpij),   &
+         &      dmgwi_1d(jpij)  , dvsbq_1d(jpij)  , rdvomif_1d(jpij), &
+         &      dvbbq_1d(jpij)  , dvlbq_1d(jpij)  , dvnbq_1d(jpij)  , &
+         &      Stat=ierr(3))
+         !
+      ALLOCATE( dqns_ice_1d(jpij) ,qla_ice_1d(jpij), dqla_ice_1d(jpij), &
+         &      tbif_1d(jpij, jplayersp1), Stat=ierr(4))
+         !
+      thd_ice_alloc_2 = MAXVAL(ierr)
+      IF( thd_ice_alloc_2 /= 0 )   CALL ctl_warn('thd_ice_alloc_2: failed to allocate arrays')
+      !
+   END FUNCTION thd_ice_alloc_2
+
+#endif
    !!======================================================================
-#endif
 END MODULE thd_ice_2
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/dom_ice.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/dom_ice.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/dom_ice.F90	(revision 2715)
@@ -4,10 +4,15 @@
    !! LIM-3 Sea Ice :   Domain  variables
    !!======================================================================
-   !! History :  3.0  ! 2003-08  (M. Vancoppenolle)  LIM-3
+   !! History :  3.0  ! 2003-08  (M. Vancoppenolle)  LIM-3 original code
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
-   USE par_ice
+   USE par_ice        ! LIM-3 parameter
+   USE in_out_manager ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC dom_ice_alloc   ! Routine called by nemogcm.F90
 
    LOGICAL, PUBLIC ::   l_jeq = .TRUE.       !: Equator inside the domain flag
@@ -15,18 +20,38 @@
    INTEGER, PUBLIC ::   njeq , njeqm1        !: j-index of the equator if it is inside the domain
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fs2cor     !: coriolis factor
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fcor       !: coriolis coefficient
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   covrai     !: sine of geographic latitude
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   area       !: surface of grid cell 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tms, tmi   !: temperature mask, mask for stress
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tmu, tmv   !: mask at u and v velocity points
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tmf        !: mask at f-point
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fcor       !: coriolis coefficient
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   covrai     !: sine of geographic latitude
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   area       !: surface of grid cell 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tms, tmi   !: temperature mask, mask for stress
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmu, tmv   !: mask at u and v velocity points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmf        !: mask at f-point
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2) ::   wght     !: weight of the 4 neighbours to compute averages
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   wght   !: weight of the 4 neighbours to compute averages
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   FUNCTION dom_ice_alloc
+      !!-------------------------------------------------------------------
+      !!            *** Routine dom_ice_alloc ***
+      !!-------------------------------------------------------------------
+      INTEGER :: dom_ice_alloc
+      !!-------------------------------------------------------------------
+      !
+      ALLOCATE( fcor(jpi,jpj)                   ,      &
+         &      covrai(jpi,jpj) , area(jpi,jpj) ,      &
+         &      tms   (jpi,jpj) , tmi (jpi,jpj) ,      &
+         &      tmu   (jpi,jpj) , tmv (jpi,jpj) ,      &
+         &      tmf   (jpi,jpj) ,                      &
+         &      wght(jpi,jpj,2,2)               , STAT = dom_ice_alloc )
+      !
+      IF( dom_ice_alloc /= 0 )   CALL ctl_warn( 'dom_ice_alloc: failed to allocate arrays.' )
+      !
+   END FUNCTION dom_ice_alloc
+
    !!======================================================================
 END MODULE dom_ice
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/ice.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/ice.F90	(revision 2715)
@@ -4,5 +4,6 @@
    !! LIM-3 Sea Ice physics:  diagnostics variables of ice defined in memory
    !!=====================================================================
-   !! History :  3.0  ! 2008-03  (M. Vancoppenolle) : original code LIM-3
+   !! History :  3.0  ! 2008-03  (M. Vancoppenolle) original code LIM-3
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -11,41 +12,37 @@
    !!----------------------------------------------------------------------
    USE par_ice          ! LIM sea-ice parameters
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC    ice_alloc  !  Called in iceini.F90
 
    !!======================================================================
    !! LIM3 by the use of sweat, agile fingers and sometimes brain juice, 
    !!  was developed in Louvain-la-Neuve by : 
-   !!
    !!    * Martin Vancoppenolle (UCL-ASTR, Belgium)
    !!    * Sylvain Bouillon (UCL-ASTR, Belgium)
-   !!    * Miguel Angel Morales Maqueda (POL, UK)
+   !!    * Miguel Angel Morales Maqueda (NOC-L, UK)
    !! 
    !! Based on extremely valuable earlier work by
-   !!
    !!    * Thierry Fichefet
    !!    * Hugues Goosse
    !!
    !! The following persons also contributed to the code in various ways
-   !!
-   !!    * Gurvan Madec, Claude Talandier, Christian Ethe 
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !!    * Gurvan Madec, Claude Talandier, Christian Ethe (LOCEAN, France)
    !!    * Xavier Fettweis (UCL-ASTR), Ralph Timmermann (AWI, Germany)
    !!    * Bill Lipscomb (LANL), Cecilia Bitz (UWa) 
    !!      and Elisabeth Hunke (LANL), USA.
    !! 
-   !! (c) UCL-ASTR, 2005-2008
-   !!
-   !! For more info, the interested user is kindly invited to consult the
-   !! following references
+   !! For more info, the interested user is kindly invited to consult the following references
    !!    For model description and validation :
    !!    * Vancoppenolle et al., Ocean Modelling, 2008a.
    !!    * Vancoppenolle et al., Ocean Modelling, 2008b.
+   !!    For a specific description of EVP :
+   !!    * Bouillon et al., Ocean Modelling 2009.
    !!
-   !!    For a specific description of EVP :
-   !!    * Bouillon et al., in prep for 2008.
-   !!
-   !!    Or the reference manual, that should be available by 2010
+   !!    Or the reference manual, that should be available by 2011
    !!======================================================================
    !!                                                                     |
@@ -168,151 +165,130 @@
    REAL(wp), PUBLIC ::   rdt_ice   !: ice time step
 
-   INTEGER , PUBLIC ::   &     !!: ** ice-dynamic namelist (namicedyn) **
-      nbiter = 1      ,  &     !: number of sub-time steps for relaxation
-      nbitdr = 250    ,  &     !: maximum number of iterations for relaxation
-      nevp   = 400    ,  &     !: number of iterations for subcycling
-      nlay_i = 5               !: number of layers in the ice
-
-   REAL(wp), PUBLIC ::   &     !!: ** ice-dynamic namelist (namicedyn) **
-      epsd   = 1.0e-20,  &     !: tolerance parameter for dynamic
-      alpha  = 0.5    ,  &     !: coefficient for semi-implicit coriolis
-      dm     = 0.6e+03,  &     !: diffusion constant for dynamics
-      om     = 0.5    ,  &     !: relaxation constant
-      resl   = 5.0e-05,  &     !: maximum value for the residual of relaxation
-      cw     = 5.0e-03,  &     !: drag coefficient for oceanic stress
-      angvg  = 0.0    ,  &     !: turning angle for oceanic stress
-      pstar  = 1.0e+04,  &     !: determines ice strength (N/M), Hibler JPO79
-      c_rhg  = 20.0   ,  &     !: determines changes in ice strength
-      etamn  = 0.0e+07,  &     !: minimun value for viscosity : has to be 0
-      creepl = 2.0e-08,  &     !: creep limit : has to be under 1.0e-9
-      ecc    = 2.0    ,  &  !: eccentricity of the elliptical yield curve
-      ahi0   = 350.e0 ,  &  !: sea-ice hor. eddy diffusivity coeff. (m2/s)
-      telast = 2880.0 ,  &  !: timescale for elastic waves (s) !SB
-      alphaevp = 1.0  ,  &  !: coeficient of the internal stresses !SB
-      unit_fac = 1.0e9      !: conversion factor for ice / snow enthalpy
-
-   REAL(wp), PUBLIC ::   & !!: ** ice-salinity namelist (namicesal) **
-      s_i_max  = 20.0 ,  &  !: maximum ice salinity (ppt)
-      s_i_min  =  0.1 ,  &  !: minimum ice salinity (ppt)
-      s_i_0    =  3.5 ,  &  !: 1st sal. value for the computation of sal .prof.
-                                !: (ppt)
-      s_i_1    =  4.5 ,  &  !: 2nd sal. value for the computation of sal .prof.
-                                !: (ppt)
-      sal_G    = 5.00 ,  &  !: restoring salinity for gravity drainage
-                                !: (ppt)
-      sal_F    = 2.50 ,  &  !: restoring salinity for flushing
-                                !: (ppt)
-      time_G   = 1.728e+06,&!: restoring time constant for gravity drainage
-                                !: (= 20 days, in s)
-      time_F   = 8.640e+05,&!: restoring time constant for gravity drainage 
-                                !: (= 10 days, in s)
-      bulk_sal = 4.0        !: bulk salinity (ppt) in case of constant salinity
-
-   INTEGER , PUBLIC ::   & !!: ** ice-salinity namelist (namicesal) **
-      num_sal  = 1    ,  &  !: salinity configuration used in the model
-                                !: 1 - s constant in space and time
-                                !: 2 - prognostic salinity (s(z,t))
-                                !: 3 - salinity profile, constant in time
-                                !: 4 - salinity variations affect only ice
-                                !      thermodynamics
-      sal_prof = 1    ,  &  !: salinity profile or not 
-      thcon_i_swi = 1       !: thermal conductivity of Untersteiner (1964) (1) or
-   !: Pringle et al (2007) (2)
-
-   REAL(wp), PUBLIC ::   & !!: ** ice-mechanical redistribution namelist (namiceitdme)
-      Cs = 0.25       ,  & !!: fraction of shearing energy contributing to ridging            
-      Cf = 17.0       ,  & !!: ratio of ridging work to PE loss
-      fsnowrdg = 0.5  ,  & !!: fractional snow loss to the ocean during ridging
-      fsnowrft = 0.5  ,  & !!: fractional snow loss to the ocean during ridging
-      Gstar = 0.15    ,  & !!: fractional area of young ice contributing to ridging
-      astar = 0.05    ,  & !!: equivalent of G* for an exponential participation function
-      Hstar = 100.0   ,  & !!: thickness that determines the maximal thickness of ridged
-                                !!: ice
-      hparmeter = 0.75,  & !!: threshold thickness (m) for rafting / ridging 
-      Craft = 5.0     ,  & !!: coefficient for smoothness of the hyperbolic tangent in rafting
-      ridge_por = 0.0 ,  & !!: initial porosity of ridges (0.3 regular value)
-      sal_max_ridge = 15.0, & !!: maximum ridged ice salinity (ppt)
-      betas    = 1.0      , & !:: coef. for partitioning of snowfall between leads and sea ice
-      kappa_i  = 1.0      , & !!: coefficient for the extinction of radiation
-                                !!: Grenfell et al. (2006) (m-1)
-      nconv_i_thd = 50    , & !!: maximal number of iterations for heat diffusion
-      maxer_i_thd = 1.0e-4    !!: maximal tolerated error (C) for heat diffusion
-
-   INTEGER , PUBLIC ::   & !!: ** ice-mechanical redistribution namelist (namiceitdme)
-      ridge_scheme_swi = 0, & !!: scheme used for ice ridging
-      raftswi          = 1, & !!: rafting of ice or not                        
-      partfun_swi      = 1, & !!: participation function Thorndike et al. JGR75 (0) 
-                                !!: or Lipscomb et al. JGR07 (1) 
-      transfun_swi     = 0, & !!: transfer function of Hibler, MWR80 (0) 
-                                !!: or Lipscomb et al., 2007 (1)
-      brinstren_swi    = 0    !!: use brine volume to diminish ice strength
-
-   REAL(wp), PUBLIC ::   &  !:
-      usecc2          ,  &  !:  = 1.0 / ( ecc * ecc )
-      rhoco           ,  &  !: = rau0 * cw
-      sangvg, cangvg  ,  &  !: sin and cos of the turning angle for ocean stress
-      pstarh                !: pstar / 2.0
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  &  !:
-      u_oce, v_oce    ,  &  !: surface ocean velocity used in ice dynamics
-      ahiu , ahiv     ,  &  !: hor. diffusivity coeff. at ocean U- and V-points (m2/s)
-      pahu , pahv     ,  &  !: ice hor. eddy diffusivity coef. at ocean U- and V-points
-      ust2s, hicol    ,  &  !: friction velocity, ice collection thickness accreted in leads
-      strength        ,  &  !: ice strength
-      strp1, strp2    ,  &  !: strength at previous time steps
-      stress1_i       ,  &  !: first stress tensor element
-      stress2_i       ,  &  !: second stress tensor element
-      stress12_i      ,  &  !: diagonal stress tensor element
-      delta_i         ,  &  !: Delta factor for the ice rheology (see Flato and Hibler 95) [s-1] -> limrhg.F90
-      divu_i          ,  &  !: Divergence of the velocity field [s-1] -> limrhg.F90
-      shear_i               !: Shear of the velocity field [s-1] -> limrhg.F90
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !:
-      firic  ,   &  !: IR flux over the ice (only used for outputs)
-      fcsic  ,   &  !: Sensible heat flux over the ice (only used for outputs)
-      fleic  ,   &  !: Latent heat flux over the ice (only used for outputs)
-      qlatic ,   &  !: latent flux
-      rdvosif,   &  !: Variation of volume at surface (only used for outputs)
-      rdvobif,   &  !: Variation of ice volume at the bottom ice (only used for outputs)
-      fdvolif,   &  !: Total variation of ice volume (only used for outputs)
-      rdvonif,   &  !: Lateral Variation of ice volume (only used for outputs)
-      sist   ,   &  !: Average Sea-Ice Surface Temperature (Kelvin)
-      icethi ,   &  !: total ice thickness (for all categories) (only used for outputs)
-      t_bo   ,   &  !: Sea-Ice bottom temperature (Kelvin)      
-      hicifp ,   &  !: Ice production/melting
-                                !obsolete... can be removed
-      frld   ,   &  !: Leads fraction = 1-a/totalarea REFERS TO LEAD FRACTION everywhere
-                                !: except in the OUTPUTS!!!!
-      pfrld  ,   &  !: Leads fraction at previous time  
-      phicif ,   &  !: Old ice thickness
-      fbif   ,   &  !: Heat flux at the ice base
-      rdmsnif,   &  !: Variation of snow mass
-      rdmicif,   &  !: Variation of ice mass
-      qldif  ,   &  !: heat balance of the lead (or of the open ocean)
-      qcmif  ,   &  !: Energy needed to bring the ocean surface layer until its freezing 
-      fdtcn  ,   &  !: net downward heat flux from the ice to the ocean
-      qdtcn  ,   &  !: energy from the ice to the ocean
-      fstric ,   &  !: transmitted solar radiation under ice
-      fscmbq ,   &  !: associated with lead chipotage with solar flux
-      ffltbif,   &  !: Array linked with the max heat contained in brine pockets (?)
-      fsbbq  ,   &  !: Also linked with the solar flux below the ice (?)
-      qfvbq  ,   &  !: Array used to store energy in case of toral lateral ablation (?)
-      dmgwi  ,   &  !: Variation of the mass of snow ice
-      fsalt_res, &  !: Residual salt flux due to correction of ice thickness
-      fsbri  ,   &  !: Salt flux due to brine rejection
-      fsalt_rpo, &  !: Salt flux associated with porous ridged ice formation
-      fheat_rpo, &  !: Heat flux associated with porous ridged ice formation
-      fhbri  ,   &  !: heat flux due to brine rejection
-      fmmec  ,   &  !: Mass flux due to snow loss during compression
-      fseqv  ,   &  !: Equivalent salt flux due to ice growth/melt
-      fheat_res, &  !: Residual heat flux due to correction of ice thickness
-      fhmec         !: Heat flux due to snow loss during compression
+   !                                          !!** ice-dynamic namelist (namicedyn) **
+   INTEGER , PUBLIC ::   nbiter = 1            !: number of sub-time steps for relaxation
+   INTEGER , PUBLIC ::   nbitdr = 250          !: maximum number of iterations for relaxation
+   INTEGER , PUBLIC ::   nevp   = 400          !: number of iterations for subcycling
+   INTEGER , PUBLIC ::   nlay_i = 5            !: number of layers in the ice
+
+   !                                          !!** ice-dynamic namelist (namicedyn) **
+   REAL(wp), PUBLIC ::   epsd   = 1.0e-20_wp   !: tolerance parameter for dynamic
+   REAL(wp), PUBLIC ::   alpha  = 0.5_wp       !: coefficient for semi-implicit coriolis
+   REAL(wp), PUBLIC ::   dm     = 0.6e+03_wp   !: diffusion constant for dynamics
+   REAL(wp), PUBLIC ::   om     = 0.5_wp       !: relaxation constant
+   REAL(wp), PUBLIC ::   resl   = 5.0e-05_wp   !: maximum value for the residual of relaxation
+   REAL(wp), PUBLIC ::   cw     = 5.0e-03_wp   !: drag coefficient for oceanic stress
+   REAL(wp), PUBLIC ::   angvg  = 0._wp        !: turning angle for oceanic stress
+   REAL(wp), PUBLIC ::   pstar  = 1.0e+04_wp   !: determines ice strength (N/M), Hibler JPO79
+   REAL(wp), PUBLIC ::   c_rhg  = 20._wp       !: determines changes in ice strength
+   REAL(wp), PUBLIC ::   etamn  = 0.0e+07_wp   !: minimun value for viscosity : has to be 0
+   REAL(wp), PUBLIC ::   creepl = 2.0e-08_wp   !: creep limit : has to be under 1.0e-9
+   REAL(wp), PUBLIC ::   ecc    = 2._wp        !: eccentricity of the elliptical yield curve
+   REAL(wp), PUBLIC ::   ahi0   = 350._wp      !: sea-ice hor. eddy diffusivity coeff. (m2/s)
+   REAL(wp), PUBLIC ::   telast = 2880._wp     !: timescale for elastic waves (s) !SB
+   REAL(wp), PUBLIC ::   alphaevp = 1._wp      !: coeficient of the internal stresses !SB
+   REAL(wp), PUBLIC ::   unit_fac = 1.e+09_wp  !: conversion factor for ice / snow enthalpy
+
+   !                                              !!** ice-salinity namelist (namicesal) **
+   REAL(wp), PUBLIC ::   s_i_max  = 20.0_wp        !: maximum ice salinity [PSU]
+   REAL(wp), PUBLIC ::   s_i_min  =  0.1_wp        !: minimum ice salinity [PSU]
+   REAL(wp), PUBLIC ::   s_i_0    =  3.5_wp        !: 1st sal. value for the computation of sal .prof. [PSU]
+   REAL(wp), PUBLIC ::   s_i_1    =  4.5_wp        !: 2nd sal. value for the computation of sal .prof. [PSU]
+   REAL(wp), PUBLIC ::   sal_G    =  5.0_wp        !: restoring salinity for gravity drainage [PSU]
+   REAL(wp), PUBLIC ::   sal_F    =  2.5_wp        !: restoring salinity for flushing [PSU]
+   REAL(wp), PUBLIC ::   time_G   =  1.728e+06_wp  !: restoring time constant for gravity drainage (= 20 days) [s]
+   REAL(wp), PUBLIC ::   time_F   =  8.640e+05_wp  !: restoring time constant for gravity drainage (= 10 days) [s]
+   REAL(wp), PUBLIC ::   bulk_sal =  4.0_wp        !: bulk salinity (ppt) in case of constant salinity
+
+   !                                              !!** ice-salinity namelist (namicesal) **
+   INTEGER , PUBLIC ::   num_sal     = 1           !: salinity configuration used in the model
+   !                                               ! 1 - s constant in space and time
+   !                                               ! 2 - prognostic salinity (s(z,t))
+   !                                               ! 3 - salinity profile, constant in time
+   !                                               ! 4 - salinity variations affect only ice thermodynamics
+   INTEGER , PUBLIC ::   sal_prof    = 1           !: salinity profile or not 
+   INTEGER , PUBLIC ::   thcon_i_swi = 1           !: thermal conductivity: =1 Untersteiner (1964) ; =2 Pringle et al (2007)
+
+   !                                              !!** ice-mechanical redistribution namelist (namiceitdme)
+   REAL(wp), PUBLIC ::   Cs        = 0.25_wp       !: fraction of shearing energy contributing to ridging            
+   REAL(wp), PUBLIC ::   Cf        = 17.0_wp       !: ratio of ridging work to PE loss
+   REAL(wp), PUBLIC ::   fsnowrdg  = 0.5_wp        !: fractional snow loss to the ocean during ridging
+   REAL(wp), PUBLIC ::   fsnowrft  = 0.5_wp        !: fractional snow loss to the ocean during ridging
+   REAL(wp), PUBLIC ::   Gstar     = 0.15_wp       !: fractional area of young ice contributing to ridging
+   REAL(wp), PUBLIC ::   astar     = 0.05_wp       !: equivalent of G* for an exponential participation function
+   REAL(wp), PUBLIC ::   Hstar     = 100.0_wp      !: thickness that determines the maximal thickness of ridged ice
+   REAL(wp), PUBLIC ::   hparmeter = 0.75_wp       !: threshold thickness (m) for rafting / ridging 
+   REAL(wp), PUBLIC ::   Craft     = 5.0_wp        !: coefficient for smoothness of the hyperbolic tangent in rafting
+   REAL(wp), PUBLIC ::   ridge_por = 0.0_wp        !: initial porosity of ridges (0.3 regular value)
+   REAL(wp), PUBLIC ::   sal_max_ridge = 15.0_wp   !: maximum ridged ice salinity (ppt)
+   REAL(wp), PUBLIC ::   betas    = 1.0_wp         !: coef. for partitioning of snowfall between leads and sea ice
+   REAL(wp), PUBLIC ::   kappa_i  = 1.0_wp         !: coef. for the extinction of radiation Grenfell et al. (2006) [1/m]
+   REAL(wp), PUBLIC ::   nconv_i_thd = 50_wp       !: maximal number of iterations for heat diffusion
+   REAL(wp), PUBLIC ::   maxer_i_thd = 1.0e-4_wp   !: maximal tolerated error (C) for heat diffusion
+
+   !                                              !!** ice-mechanical redistribution namelist (namiceitdme)
+   INTEGER , PUBLIC ::   ridge_scheme_swi = 0      !: scheme used for ice ridging
+   INTEGER , PUBLIC ::   raftswi          = 1      !: rafting of ice or not                        
+   INTEGER , PUBLIC ::   partfun_swi      = 1      !: participation function: =0 Thorndike et al. (1975), =1 Lipscomb et al. (2007)
+   INTEGER , PUBLIC ::   transfun_swi     = 0      !: transfer function: =0 Hibler 1980, =1 Lipscomb et al. 2007
+   INTEGER , PUBLIC ::   brinstren_swi    = 0      !: use brine volume to diminish ice strength
+
+   REAL(wp), PUBLIC ::   usecc2           !:  = 1.0 / ( ecc * ecc )
+   REAL(wp), PUBLIC ::   rhoco            !: = rau0 * cw
+   REAL(wp), PUBLIC ::   sangvg, cangvg   !: sin and cos of the turning angle for ocean stress
+   REAL(wp), PUBLIC ::   pstarh           !: pstar / 2.0
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce, v_oce   !: surface ocean velocity used in ice dynamics
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ahiu , ahiv    !: hor. diffusivity coeff. at U- and V-points [m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   pahu , pahv    !: ice hor. eddy diffusivity coef. at U- and V-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ust2s, hicol   !: friction velocity, ice collection thickness accreted in leads
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   strp1, strp2   !: strength at previous time steps
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   strength       !: ice strength
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stress1_i, stress2_i, stress12_i   !: 1st, 2nd & diagonal stress tensor element
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   delta_i        !: ice rheology elta factor (Flato & Hibler 95) [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   divu_i         !: Divergence of the velocity field [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   shear_i        !: Shear of the velocity field [s-1]
+   !
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   firic       !: IR flux over the ice (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fcsic       !: Sensible heat flux over the ice (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fleic       !: Latent heat flux over the ice (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qlatic      !: latent flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvosif     !: Variation of volume at surface (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvobif     !: Variation of ice volume at the bottom ice (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fdvolif     !: Total variation of ice volume (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdvonif     !: Lateral Variation of ice volume (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sist        !: Average Sea-Ice Surface Temperature [Kelvin]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   icethi      !: total ice thickness (for all categories) (diag only)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   t_bo        !: Sea-Ice bottom temperature [Kelvin]     
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hicifp      !: Ice production/melting==>!obsolete... can be removed
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   frld        !: Leads fraction = 1 - ice fraction
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   pfrld       !: Leads fraction at previous time  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   phicif      !: Old ice thickness
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fbif        !: Heat flux at the ice base
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdmsnif     !: Variation of snow mass
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rdmicif     !: Variation of ice mass
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qldif       !: heat balance of the lead (or of the open ocean)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qcmif       !: Energy needed to bring the ocean to freezing 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fdtcn       !: net downward heat flux from the ice to the ocean
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qdtcn       !: energy from the ice to the ocean
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fstric      !: transmitted solar radiation under ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fscmbq      !: associated with lead chipotage with solar flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ffltbif     !: related to max heat contained in brine pockets (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fsbbq       !: Also linked with the solar flux below the ice (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qfvbq       !: store energy in case of total lateral ablation (?)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dmgwi       !: Variation of the mass of snow ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fsalt_res   !: Residual salt flux due to correction of ice thickness
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fsbri       !: Salt flux due to brine rejection
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fsalt_rpo   !: Salt flux associated with porous ridged ice formation
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fheat_rpo   !: Heat flux associated with porous ridged ice formation
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fhbri       !: heat flux due to brine rejection
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmec       !: Mass flux due to snow loss during compression
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fseqv       !: Equivalent salt flux due to ice growth/melt
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fhmec       !: Heat flux due to snow loss during compression
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fheat_res   !: Residual heat flux due to correction of ice thickness
 
    ! temporary arrays for dummy version of the code
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !:
-      dh_i_surf2D, dh_i_bott2D, fstbif, fsup2D, focea2D, q_s
-
-   INTEGER, PUBLIC, DIMENSION(jpi, jpj, jpl) ::          &   !::
-      patho_case ! number of the pathological case (if any, of course)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dh_i_surf2D, dh_i_bott2D, fstbif, fsup2D, focea2D, q_s
+
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   patho_case ! number of the pathological case (if any, of course)
 
    !!--------------------------------------------------------------------------
@@ -320,79 +296,62 @@
    !!--------------------------------------------------------------------------
    !! Variables defined for each ice category
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl)        ::   &  !:
-      ht_i   ,   &  !: Ice thickness (m)
-      a_i    ,   &  !: Ice fractional areas (concentration)
-      v_i    ,   &  !: Ice volume per unit area (m)
-      v_s    ,   &  !: Snow volume per unit area(m)
-      ht_s   ,   &  !: Snow thickness (m)
-      t_su   ,   &  !: Sea-Ice Surface Temperature (K)
-      sm_i   ,   &  !: Sea-Ice Bulk salinity (ppt)
-      smv_i  ,   &  !: Sea-Ice Bulk salinity times volume per area (ppt.m)
-                                !: this is an extensive variable that has to be transported
-      o_i    ,   &  !: Sea-Ice Age (days)
-      ov_i   ,   &  !: Sea-Ice Age times volume per area (days.m)
-      oa_i          !: Sea-Ice Age times ice area (days)
-
-   !! Variables summed over all categories, or associated to 
-   !! all the ice in a single grid cell
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !:
-      u_ice, v_ice,   &  !: two components of the ice velocity (m/s)
-      tio_u, tio_v,   &  !: two components of the ice-ocean stress (N/m2)
-      vt_i        ,   &  !: ice total volume per unit area (m)
-      vt_s        ,   &  !: snow total volume per unit area (m)
-      at_i        ,   &  !: ice total fractional area (ice concentration)
-      ato_i       ,   &  !: total open water fractional area (1-at_i)
-      et_i        ,   &  !: total ice heat content
-      et_s        ,   &  !: total snow heat content
-      ot_i        ,   &  !: mean age over all categories
-      tm_i        ,   &  !: mean ice temperature over all categories
-      bv_i        ,   &  !: brine volume averaged over all categories
-      smt_i              !: mean sea ice salinity averaged over all categories
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpm) ::   &  !:
-      at_i_typ    ,   &  !: total area contained in each ice type
-      vt_i_typ           !: total volume contained in each ice type
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,nlay_s,jpl) :: & !:
-      t_s,            &  !: Snow temperatures (K)
-      e_s
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   &  !: ! go to trash
-      e_i_cat
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jkmax,jpl) :: & !:
-      t_i,            &  !: Ice temperatures     [ Kelvins     ]
-      e_i,            &  !: Ice thermal contents [ Joules*10^9 ]
-      s_i                !: Ice salinities
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ht_i    !: Ice thickness (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   a_i     !: Ice fractional areas (concentration)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_i     !: Ice volume per unit area (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_s     !: Snow volume per unit area(m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ht_s    !: Snow thickness (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   t_su    !: Sea-Ice Surface Temperature (K)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sm_i    !: Sea-Ice Bulk salinity (ppt)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   smv_i   !: Sea-Ice Bulk salinity times volume per area (ppt.m)
+   !                                                                  !  this is an extensive variable that has to be transported
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   o_i     !: Sea-Ice Age (days)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ov_i    !: Sea-Ice Age times volume per area (days.m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   oa_i    !: Sea-Ice Age times ice area (days)
+
+   !! Variables summed over all categories, or associated to all the ice in a single grid cell
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_ice, v_ice   !: components of the ice velocity (m/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tio_u, tio_v   !: components of the ice-ocean stress (N/m2)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vt_i , vt_s    !: ice and snow total volume per unit area (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   at_i           !: ice total fractional area (ice concentration)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ato_i          !: =1-at_i ; total open water fractional area
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   et_i , et_s    !: ice and snow total heat content
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ot_i           !: mean age over all categories
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tm_i           !: mean ice temperature over all categories
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bv_i           !: brine volume averaged over all categories
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   smt_i          !: mean sea ice salinity averaged over all categories [PSU]
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   at_i_typ     !: total area   contained in each ice type [m^2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   vt_i_typ     !: total volume contained in each ice type [m^3]
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_s        !: Snow temperatures [K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_s        !: Snow ...      
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   e_i_cat    !: ! go to trash
+      
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   t_i        !: ice temperatures          [K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e_i        !: ice thermal contents [Giga J]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   s_i        !: ice salinities          [PSU]
 
    !!--------------------------------------------------------------------------
    !! * Moments for advection
    !!--------------------------------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   &  !:
-      sxopw, syopw, sxxopw, syyopw, sxyopw          !: open water in sea ice
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   &  !:
-      sxice, syice, sxxice, syyice, sxyice,      &  !: ice thickness moments for advection
-      sxsn,  sysn,  sxxsn,  syysn,  sxysn,       &  !: snow thickness
-      sxa,   sya,   sxxa,   syya,   sxya,        &  !: lead fraction
-      sxc0,  syc0,  sxxc0,  syyc0,  sxyc0,       &  !: snow thermal content
-      sxsal, sysal, sxxsal, syysal, sxysal,      &  !: ice salinity
-      sxage, syage, sxxage, syyage, sxyage          !: ice age
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jkmax,jpl) ::   &  !:
-      sxe ,  sye ,  sxxe ,  syye ,  sxye            !: ice layers heat content
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   sxopw, syopw, sxxopw, syyopw, sxyopw   !: open water in sea ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxice, syice, sxxice, syyice, sxyice   !: ice thickness 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsn , sysn , sxxsn , syysn , sxysn    !: snow thickness
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxa  , sya  , sxxa  , syya  , sxya     !: lead fraction
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxc0 , syc0 , sxxc0 , syyc0 , sxyc0    !: snow thermal content
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxsal, sysal, sxxsal, syysal, sxysal   !: ice salinity
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sxage, syage, sxxage, syyage, sxyage   !: ice age
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   sxe  , sye  , sxxe  , syye  , sxye     !: ice layers heat content
 
    !!--------------------------------------------------------------------------
    !! * Old values of global variables
    !!--------------------------------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   &  !: 
-      old_v_s, old_v_i,                          &  !: snow and ice volumes
-      old_a_i, old_smv_i, old_oa_i
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,nlay_s,jpl) ::   &  !:
-      old_e_s                                       !: snow heat content
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jkmax,jpl) ::   &  !:
-      old_e_i                          !: ice temperatures
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !: ice velocity (gv6 and gv7)
-      old_u_ice, old_v_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   old_v_s, old_v_i               !: snow and ice volumes
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   old_a_i, old_smv_i, old_oa_i   !: ???
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   old_e_s                        !: snow heat content
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   old_e_i                        !: ice temperatures
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   old_u_ice, old_v_ice           !: ice velocity (gv6 and gv7)
+      
 
    !!--------------------------------------------------------------------------
@@ -401,52 +360,34 @@
    ! thd refers to changes induced by thermodynamics
    ! trp   ''         ''     ''       advection (transport of ice)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   &  !: 
-      d_a_i_thd  , d_a_i_trp ,                   &  !: icefractions                  
-      d_v_s_thd  , d_v_s_trp,                    &  !: snow volume
-      d_v_i_thd  , d_v_i_trp,                    &  !: ice  volume
-      d_smv_i_thd, d_smv_i_trp,                  &     
-      d_sm_i_fl  , d_sm_i_gd ,                   &
-      d_sm_i_se  , d_sm_i_si , d_sm_i_la ,       &
-      d_oa_i_thd , d_oa_i_trp, s_i_newice
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,nlay_s,jpl) ::  &  !:
-      d_e_s_thd, d_e_s_trp
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jkmax,jpl) ::   &  !:
-      d_e_i_thd, d_e_i_trp
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::       &  !: ice velocity 
-      d_u_ice_dyn, d_v_ice_dyn
-
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_a_i_thd  , d_a_i_trp                 !: icefractions                  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_v_s_thd  , d_v_s_trp                 !: snow volume
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_v_i_thd  , d_v_i_trp                 !: ice  volume
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_smv_i_thd, d_smv_i_trp               !:     
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_sm_i_fl  , d_sm_i_gd                 !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_sm_i_se  , d_sm_i_si  , d_sm_i_la    !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   d_oa_i_thd , d_oa_i_trp , s_i_newice   !:
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   d_e_s_thd  , d_e_s_trp     !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   d_e_i_thd  , d_e_i_trp     !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   d_u_ice_dyn, d_v_ice_dyn   !: ice velocity 
+      
    !!--------------------------------------------------------------------------
    !! * Ice thickness distribution variables
    !!--------------------------------------------------------------------------
    ! REMOVE
-   INTEGER, PUBLIC, DIMENSION(jpl)                ::   &  !:
-      ice_types      !: Vector making the connection between types and categories
-
-   INTEGER, PUBLIC, DIMENSION(jpm,2)              ::   &  !:
-      ice_cat_bounds !: Matrix containing the integer upper and 
-   !: lower boundaries of ice thickness categories
-
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   ice_types      !: Vector connecting types and categories
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ice_cat_bounds !: Matrix containing the integer upper and 
+   !                                                                       !  lower boundaries of ice thickness categories
    ! REMOVE
-   INTEGER, PUBLIC, DIMENSION(jpm)                ::   &  !:
-      ice_ncat_types !: Vector containing the number of thickness categories in each ice type
-
-   REAL(wp), PUBLIC, DIMENSION(0:jpl)             ::   &  !:
-      hi_max          !: Boundary of ice thickness categories in thickness space
-
-   REAL(wp), PUBLIC, DIMENSION(jpl)               ::   &  !:
-      hi_mean         !: Mean ice thickness in catgories 
-
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   ice_ncat_types !: nb of thickness categories in each ice type
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_max         !: Boundary of ice thickness categories in thickness space
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   hi_mean        !: Mean ice thickness in catgories 
    ! REMOVE
-   REAL(wp), PUBLIC, DIMENSION(0:jpl,jpm)         ::   &  !:
-      hi_max_typ     !: Boundary of ice thickness categories 
-   !:in thickness space (same but specific for each ice type)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hi_max_typ     !: Boundary of ice thickness categories in thickness space
 
    !!--------------------------------------------------------------------------
    !! * Ice Run
    !!--------------------------------------------------------------------------
-   !! Namelist namicerun read in iceini
+   !                                                                     !!: ** Namelist namicerun read in iceini **
    CHARACTER(len=32)     , PUBLIC ::   cn_icerst_in  = "restart_ice_in"   !: suffix of ice restart name (input)
    CHARACTER(len=32)     , PUBLIC ::   cn_icerst_out = "restart_ice"      !: suffix of ice restart name (output)
@@ -463,17 +404,131 @@
    !!--------------------------------------------------------------------------
    !! Check if everything down here is necessary
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !: volume of ice formed in the leads
-      v_newice
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   &  !: thermodynamic growth rates 
-      dv_dt_thd,  &
-      izero, fstroc, fhbricat
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   & 
-      diag_sni_gr,                           & ! snow ice growth 
-      diag_lat_gr,                           & ! lateral ice growth 
-      diag_bot_gr,                           & ! bottom ice growth 
-      diag_dyn_gr,                           & ! dynamical ice growth 
-      diag_bot_me,                           & ! vertical bottom melt 
-      diag_sur_me                              ! vertical surface melt
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   v_newice   !: volume of ice formed in the leads
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dv_dt_thd  !: thermodynamic growth rates 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   izero, fstroc, fhbricat
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_sni_gr   ! snow ice growth 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_lat_gr   ! lateral ice growth 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_bot_gr   ! bottom ice growth 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_dyn_gr   ! dynamical ice growth 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_bot_me   ! vertical bottom melt 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   diag_sur_me   ! vertical surface melt
    INTEGER , PUBLIC ::   jiindx, jjindx        !: indexes of the debugging point
+
+   !!----------------------------------------------------------------------
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   FUNCTION ice_alloc()
+      !!-----------------------------------------------------------------
+      !!               *** Routine ice_alloc_2 ***
+      !!-----------------------------------------------------------------
+      INTEGER :: ice_alloc
+      !
+      INTEGER :: ierr(20), ii
+      !!-----------------------------------------------------------------
+
+      ierr(:) = 0
+
+      ! What could be one huge allocate statement is broken-up to try to
+      ! stay within Fortran's max-line length limit.
+      ii = 1
+      ALLOCATE( u_oce    (jpi,jpj) , v_oce    (jpi,jpj) ,                           &
+         &      ahiu     (jpi,jpj) , ahiv     (jpi,jpj) ,                           &
+         &      pahu     (jpi,jpj) , pahv     (jpi,jpj) ,                           &
+         &      ust2s    (jpi,jpj) , hicol    (jpi,jpj) ,                           &
+         &      strp1    (jpi,jpj) , strp2    (jpi,jpj) , strength  (jpi,jpj) ,     &
+         &      stress1_i(jpi,jpj) , stress2_i(jpi,jpj) , stress12_i(jpi,jpj) ,     &
+         &      delta_i  (jpi,jpj) , divu_i   (jpi,jpj) , shear_i   (jpi,jpj) , STAT=ierr(ii) )
+
+      ii = ii + 1
+      ALLOCATE( firic    (jpi,jpj) , fcsic  (jpi,jpj) , fleic    (jpi,jpj) , qlatic   (jpi,jpj) ,     &
+         &      rdvosif  (jpi,jpj) , rdvobif(jpi,jpj) , fdvolif  (jpi,jpj) , rdvonif  (jpi,jpj) ,     &
+         &      sist     (jpi,jpj) , icethi (jpi,jpj) , t_bo     (jpi,jpj) , hicifp   (jpi,jpj) ,     &
+         &      frld     (jpi,jpj) , pfrld  (jpi,jpj) , phicif   (jpi,jpj) , fbif     (jpi,jpj) ,     &
+         &      rdmsnif  (jpi,jpj) , rdmicif(jpi,jpj) , qldif    (jpi,jpj) , qcmif    (jpi,jpj) ,     &
+         &      fdtcn    (jpi,jpj) , qdtcn  (jpi,jpj) , fstric   (jpi,jpj) , fscmbq   (jpi,jpj) ,     &
+         &      ffltbif  (jpi,jpj) , fsbbq  (jpi,jpj) , qfvbq    (jpi,jpj) , dmgwi    (jpi,jpj) ,     &
+         &      fsalt_res(jpi,jpj) , fsbri  (jpi,jpj) , fsalt_rpo(jpi,jpj) , fheat_rpo(jpi,jpj) ,     &
+         &      fhbri    (jpi,jpj) , fmmec  (jpi,jpj) , fseqv    (jpi,jpj) , fhmec    (jpi,jpj) ,     &
+         &      fheat_res(jpi,jpj)                                                              , STAT=ierr(ii) )
+
+      ii = ii + 1
+      ALLOCATE( dh_i_surf2D(jpi,jpj) , dh_i_bott2D(jpi,jpj) , fstbif(jpi,jpj) ,     &
+         &      fsup2D     (jpi,jpj) , focea2D    (jpi,jpj) , q_s   (jpi,jpj) , STAT=ierr(ii) )
+
+      ii = ii + 1
+      ALLOCATE( patho_case(jpi, jpj, jpl)  , STAT=ierr(ii) )
+
+      ! * Ice global state variables
+      ii = ii + 1
+      ALLOCATE( ht_i (jpi,jpj,jpl) , a_i  (jpi,jpj,jpl) , v_i  (jpi,jpj,jpl) ,     &
+         &      v_s  (jpi,jpj,jpl) , ht_s (jpi,jpj,jpl) , t_su (jpi,jpj,jpl) ,     &
+         &      sm_i (jpi,jpj,jpl) , smv_i(jpi,jpj,jpl) , o_i  (jpi,jpj,jpl) ,     &
+         &      ov_i (jpi,jpj,jpl) , oa_i (jpi,jpj,jpl)                      , STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( u_ice(jpi,jpj) , v_ice(jpi,jpj) , tio_u(jpi,jpj) , tio_v(jpi,jpj) ,     &
+         &      vt_i (jpi,jpj) , vt_s (jpi,jpj) , at_i (jpi,jpj) , ato_i(jpi,jpj) ,     &
+         &      et_i (jpi,jpj) , et_s (jpi,jpj) , ot_i (jpi,jpj) , tm_i (jpi,jpj) ,     &
+         &      bv_i (jpi,jpj) , smt_i(jpi,jpj)                                   , STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( t_s(jpi,jpj,nlay_s,jpl) , at_i_typ(jpi,jpj,jpm) ,                            &
+         &      e_s(jpi,jpj,nlay_s,jpl) , vt_i_typ(jpi,jpj,jpm) , e_i_cat(jpi,jpj,jpl) , STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( t_i(jpi,jpj,jkmax,jpl) , e_i(jpi,jpj,jkmax,jpl) , s_i(jpi,jpj,jkmax,jpl) , STAT=ierr(ii) )
+
+      ! * Moments for advection
+      ii = ii + 1
+      ALLOCATE( sxopw(jpi,jpj) , syopw(jpi,jpj) , sxxopw(jpi,jpj) , syyopw(jpi,jpj) , sxyopw(jpi,jpj) , STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( sxice(jpi,jpj,jpl) , syice(jpi,jpj,jpl) , sxxice(jpi,jpj,jpl) , syyice(jpi,jpj,jpl) , sxyice(jpi,jpj,jpl) ,   &
+         &      sxsn (jpi,jpj,jpl) , sysn (jpi,jpj,jpl) , sxxsn (jpi,jpj,jpl) , syysn (jpi,jpj,jpl) , sxysn (jpi,jpj,jpl) ,   &
+         &      STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( sxa  (jpi,jpj,jpl) , sya  (jpi,jpj,jpl) , sxxa  (jpi,jpj,jpl) , syya  (jpi,jpj,jpl) , sxya  (jpi,jpj,jpl) ,   &
+         &      sxc0 (jpi,jpj,jpl) , syc0 (jpi,jpj,jpl) , sxxc0 (jpi,jpj,jpl) , syyc0 (jpi,jpj,jpl) , sxyc0 (jpi,jpj,jpl) ,   &
+         &      sxsal(jpi,jpj,jpl) , sysal(jpi,jpj,jpl) , sxxsal(jpi,jpj,jpl) , syysal(jpi,jpj,jpl) , sxysal(jpi,jpj,jpl) ,   &
+         &      sxage(jpi,jpj,jpl) , syage(jpi,jpj,jpl) , sxxage(jpi,jpj,jpl) , syyage(jpi,jpj,jpl) , sxyage(jpi,jpj,jpl) ,   &
+         &      STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( sxe (jpi,jpj,jkmax,jpl) , sye (jpi,jpj,jkmax,jpl) , sxxe(jpi,jpj,jkmax,jpl) ,     &
+         &      syye(jpi,jpj,jkmax,jpl) , sxye(jpi,jpj,jkmax,jpl)                           , STAT=ierr(ii) )
+
+      ! * Old values of global variables
+      ii = ii + 1
+      ALLOCATE( old_v_s  (jpi,jpj,jpl) , old_v_i  (jpi,jpj,jpl) , old_e_s(jpi,jpj,nlay_s,jpl) ,     &
+         &      old_a_i  (jpi,jpj,jpl) , old_smv_i(jpi,jpj,jpl) , old_e_i(jpi,jpj,jkmax ,jpl) ,     &
+         &      old_oa_i (jpi,jpj,jpl)                                                        ,     &
+         &      old_u_ice(jpi,jpj)     , old_v_ice(jpi,jpj)                                   , STAT=ierr(ii) )
+
+      ! * Increment of global variables
+      ii = ii + 1
+      ALLOCATE( d_a_i_thd(jpi,jpj,jpl) , d_a_i_trp (jpi,jpj,jpl) , d_v_s_thd  (jpi,jpj,jpl) , d_v_s_trp  (jpi,jpj,jpl) ,   &
+         &      d_v_i_thd(jpi,jpj,jpl) , d_v_i_trp (jpi,jpj,jpl) , d_smv_i_thd(jpi,jpj,jpl) , d_smv_i_trp(jpi,jpj,jpl) ,   &     
+         &      d_sm_i_fl(jpi,jpj,jpl) , d_sm_i_gd (jpi,jpj,jpl) , d_sm_i_se  (jpi,jpj,jpl) , d_sm_i_si  (jpi,jpj,jpl) ,   &
+         &      d_sm_i_la(jpi,jpj,jpl) , d_oa_i_thd(jpi,jpj,jpl) , d_oa_i_trp (jpi,jpj,jpl) , s_i_newice (jpi,jpj,jpl) ,   &
+         &     STAT=ierr(ii) )
+      ii = ii + 1
+      ALLOCATE( d_e_s_thd(jpi,jpj,nlay_s,jpl) , d_e_i_thd(jpi,jpj,jkmax,jpl) , d_u_ice_dyn(jpi,jpj) ,     &
+         &      d_e_s_trp(jpi,jpj,nlay_s,jpl) , d_e_i_trp(jpi,jpj,jkmax,jpl) , d_v_ice_dyn(jpi,jpj) , STAT=ierr(ii) )
+      
+      ! * Ice thickness distribution variables
+      ii = ii + 1
+      ALLOCATE( ice_types(jpl) , ice_cat_bounds(jpm,2) , ice_ncat_types  (jpm) ,     &
+         &      hi_max (0:jpl) , hi_mean(jpl)          , hi_max_typ(0:jpl,jpm) , STAT=ierr(ii) )
+
+      ! * Ice diagnostics
+      ii = ii + 1
+      ALLOCATE( dv_dt_thd(jpi,jpj,jpl) , diag_sni_gr(jpi,jpj) , diag_lat_gr(jpi,jpj) ,     &
+         &      izero    (jpi,jpj,jpl) , diag_bot_gr(jpi,jpj) , diag_dyn_gr(jpi,jpj) ,     &
+         &      fstroc   (jpi,jpj,jpl) , diag_bot_me(jpi,jpj) , diag_sur_me(jpi,jpj) ,     &
+         &      fhbricat (jpi,jpj,jpl) , v_newice   (jpi,jpj)                        , STAT=ierr(ii) )
+
+      ice_alloc = MAXVAL( ierr(:) )
+      IF( ice_alloc /= 0 )   CALL ctl_warn('ice_alloc_2: failed to allocate arrays.')
+      !
+   END FUNCTION ice_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/iceini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/iceini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/iceini.F90	(revision 2715)
@@ -6,4 +6,5 @@
    !! History :  3.0  ! 2008-03  (M. Vancoppenolle) LIM-3 original code
    !!            3.3  ! 2010-12  (G. Madec) add call to lim_thd_init and lim_thd_sal_init
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -13,26 +14,31 @@
    !!   ice_init       : sea-ice model initialization
    !!----------------------------------------------------------------------
-   USE phycst         ! physical constants
-   USE dom_oce        ! ocean domain
-   USE sbc_oce        ! Surface boundary condition: ocean fields
-   USE sbc_ice        ! Surface boundary condition: ice fields
-   USE ice            ! LIM: sea-ice variables
-   USE limmsh         ! LIM: mesh
-   USE limistate      ! LIM: initial state
-   USE limrst         ! LIM: restart
-   USE limthd         ! LIM: ice thermodynamics
-   USE limthd_sal     ! LIM: ice thermodynamics: salinity
-   USE par_ice        ! LIM: sea-ice parameters
-   USE limvar         ! LIM: variables
-   USE in_out_manager ! I/O manager
-   USE lib_mpp        ! MPP library
+   USE phycst           ! physical constants
+   USE dom_oce          ! ocean domain
+   USE sbc_oce          ! Surface boundary condition: ocean fields
+   USE sbc_ice          ! Surface boundary condition: ice   fields
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE dom_ice          ! LIM domain
+   USE thd_ice          ! LIM thermodynamical variables
+   USE limitd_me        ! LIM ice thickness distribution
+   USE limrhg           ! LIM dynamics
+   USE limmsh           ! LIM mesh
+   USE limistate        ! LIM initial state
+   USE limrst           ! LIM restart
+   USE limthd           ! LIM ice thermodynamics
+   USE limthd_sal       ! LIM ice thermodynamics: salinity
+   USE limvar           ! LIM variables
+   USE limsbc           ! LIM surface boundary condition
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   ice_init   ! called by opa.F90
-
-   !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   PUBLIC   ice_init   ! called by sbcice_lim.F90
+
+   !!----------------------------------------------------------------------
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -44,15 +50,34 @@
       !!                  ***  ROUTINE ice_init  ***
       !!
-      !! ** purpose :   
+      !! ** purpose :   Allocate all the dynamic arrays of the LIM-3 modules
       !!----------------------------------------------------------------------
-      !
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
+
+      !                                ! Allocate the ice arrays
+      ierr =        ice_alloc       ()       ! ice variables
+      ierr = ierr + dom_ice_alloc   ()       ! domain
+      ierr = ierr + sbc_ice_alloc   ()       ! surface forcing
+      ierr = ierr + thd_ice_alloc   ()       ! thermodynamics
+      ierr = ierr + lim_itd_me_alloc()       ! ice thickness distribution - mechanics
+      ierr = ierr + lim_rhg_alloc   ()       ! dynamics
+      !
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'ice_init : unable to allocate ice arrays')
+      !
+      !                                ! adequation jpk versus ice/snow layers/categories
+      IF( jpl   > jpk  .OR.  jpm    > jpk .OR.                                    &
+          jkmax > jpk  .OR.  nlay_s > jpk      )   CALL ctl_stop( 'STOP',         &
+         &     'ice_init: the 3rd dimension of workspace arrays is too small.',   &
+         &     'use more ocean levels or less ice/snow layers/categories.' )
+
       !                                ! Open the namelist file 
       CALL ctl_opn( numnam_ice, 'namelist_ice', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
       !
-      CALL ice_run                     ! namelist read some ice run parameters
-      !
-      CALL lim_thd_init                ! namelist read ice thermodynics parameters
-      !
-      CALL lim_thd_sal_init            ! namelist read ice salinity parameters
+      CALL ice_run                     ! set some ice run parameters
+      !
+      CALL lim_thd_init                ! set ice thermodynics parameters
+      !
+      CALL lim_thd_sal_init            ! set ice salinity parameters
       !
       rdt_ice = nn_fsbc * rdttra(1)    ! sea-ice timestep
@@ -60,5 +85,8 @@
       CALL lim_msh                     ! ice mesh initialization
       !
-      CALL lim_itd_ini                 ! initialize the ice thickness distribution
+      CALL lim_itd_ini                 ! ice thickness distribution initialization
+      !
+      CALL lim_sbc_init                ! ice surface boundary condition   
+
 
       !                                ! Initial sea-ice state
@@ -94,5 +122,5 @@
       !!
       !! ** Method  :   Read the namicerun namelist and check the parameter 
-      !!       values called at the first timestep (nit000)
+      !!              values called at the first timestep (nit000)
       !!
       !! ** input   :   Namelist namicerun
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limadv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limadv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limadv.F90	(revision 2715)
@@ -6,4 +6,5 @@
    !! History :  LIM  ! 2008-03 (M. Vancoppenolle)  LIM-3 from LIM-2 code
    !!            3.2  ! 2009-06 (F. Dupont)  correct a error in the North fold b. c.
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!--------------------------------------------------------------------
 #if defined key_lim3
@@ -14,10 +15,11 @@
    !!   lim_adv_y  : advection of sea ice on y axis
    !!----------------------------------------------------------------------
-   USE dom_oce
-   USE dom_ice
-   USE ice
-   USE lbclnk
-   USE in_out_manager  ! I/O manager
-   USE prtctl          ! Print control
+   USE dom_oce          ! ocean domain
+   USE dom_ice          ! LIM-3 domain
+   USE ice              ! LIM-3 variables
+   USE lbclnk           ! lateral boundary condition - MPP exchanges
+   USE in_out_manager   ! I/O manager
+   USE prtctl           ! Print control
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -27,16 +29,15 @@
    PUBLIC   lim_adv_y   ! called by lim_trp
 
-   REAL(wp)  ::   epsi20 = 1.e-20   ! constant values
-   REAL(wp)  ::   rzero  = 0.e0     !    -       -
-   REAL(wp)  ::   rone   = 1.e0     !    -       -
+   REAL(wp)  ::   epsi20 = 1.e-20_wp   ! constant values
+   REAL(wp)  ::   rzero  = 0._wp       !    -       -
+   REAL(wp)  ::   rone   = 1._wp       !    -       -
 
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -55,4 +56,9 @@
       !! Reference:  Prather, 1986, JGR, 91, D6. 6671-6681.
       !!--------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zf0  => wrk_2d_11 , zfx   => wrk_2d_12 , zfy    => wrk_2d_13 , zbet => wrk_2d_14   ! 2D workspace
+      USE wrk_nemo, ONLY:   zfm  => wrk_2d_15 , zfxx  => wrk_2d_16 , zfyy   => wrk_2d_17 , zfxy => wrk_2d_18   !  -      -
+      USE wrk_nemo, ONLY:   zalg => wrk_2d_19 , zalg1 => wrk_2d_20 , zalg1q => wrk_2d_21                       !  -      -
+      !
       REAL(wp)                    , INTENT(in   ) ::   pdf                ! reduction factor for the time step
       REAL(wp)                    , INTENT(in   ) ::   pcrh               ! call lim_adv_x then lim_adv_y (=1) or the opposite (=0)
@@ -64,11 +70,12 @@
       !! 
       INTEGER  ::   ji, jj                               ! dummy loop indices
-      REAL(wp) ::   zs1max, zrdt, zslpmax, ztemp, zin0   ! temporary scalars
-      REAL(wp) ::   zs1new, zalf , zalfq , zbt           !    -         -
-      REAL(wp) ::   zs2new, zalf1, zalf1q, zbt1          !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zf0, zfx , zfy , zbet   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfm, zfxx, zfyy, zfxy   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zalg, zalg1, zalg1q     !  -      -
+      REAL(wp) ::   zs1max, zrdt, zslpmax, ztemp, zin0   ! local scalars
+      REAL(wp) ::   zs1new, zalf , zalfq , zbt           !   -      -
+      REAL(wp) ::   zs2new, zalf1, zalf1q, zbt1          !   -      -
       !---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 11,12,13,14,15,16,17,18,19,20,21) ) THEN
+         CALL ctl_stop('lim_adv_x: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! Limitation of moments.                                           
@@ -216,4 +223,7 @@
          CALL prt_ctl(tab2d_1=psxy , clinfo1=' lim_adv_x: psxy :')
       ENDIF
+      !
+      IF( wrk_not_released(2, 11,12,13,14,15,16,17,18,19,20,21) )    &
+          CALL ctl_stop('lim_adv_x : failed to release workspace arrays')
       !
    END SUBROUTINE lim_adv_x
@@ -234,4 +244,9 @@
       !! Reference:  Prather, 1986, JGR, 91, D6. 6671-6681.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zf0  => wrk_2d_11 , zfx   => wrk_2d_12 , zfy    => wrk_2d_13 , zbet => wrk_2d_14   ! 2D workspace
+      USE wrk_nemo, ONLY:   zfm  => wrk_2d_15 , zfxx  => wrk_2d_16 , zfyy   => wrk_2d_17 , zfxy => wrk_2d_18   !  -      -
+      USE wrk_nemo, ONLY:   zalg => wrk_2d_19 , zalg1 => wrk_2d_20 , zalg1q => wrk_2d_21                       !  -      -
+      !
       REAL(wp)                    , INTENT(in   ) ::   pdf                ! reduction factor for the time step
       REAL(wp)                    , INTENT(in   ) ::   pcrh               ! call lim_adv_x then lim_adv_y (=1) or the opposite (=0)
@@ -246,8 +261,9 @@
       REAL(wp) ::   zs1new, zalf , zalfq , zbt           !    -         -
       REAL(wp) ::   zs2new, zalf1, zalf1q, zbt1          !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zf0, zfx , zfy , zbet   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfm, zfxx, zfyy, zfxy   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zalg, zalg1, zalg1q     !  -      -
       !---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 11,12,13,14,15,16,17,18,19,20,21) ) THEN
+         CALL ctl_stop('lim_adv_y : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! Limitation of moments.
@@ -397,6 +413,8 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 11,12,13,14,15,16,17,18,19,20,21) )    &
+         CALL ctl_stop('lim_adv_y: failed to release workspace arrays')
+      !
    END SUBROUTINE lim_adv_y
-
 
 #else
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limcons.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limcons.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limcons.F90	(revision 2715)
@@ -1,96 +1,64 @@
 MODULE limcons
+   !!======================================================================
+   !!                   ***  MODULE  limcons  ***
+   !! LIM-3 Sea Ice :   conservation check
+   !!======================================================================
+   !! History :   -   ! Original code from William H. Lipscomb, LANL
+   !!            3.0  ! 2004-06  (M. Vancoppenolle)   Energy Conservation 
+   !!            4.0  ! 2011-02  (G. Madec)  add mpp considerations
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
    !!   'key_lim3' :                                   LIM3 sea-ice model
    !!----------------------------------------------------------------------
-   !!
-   !!======================================================================
-   !!                     ***  MODULE  limcons  ***
-   !!
-   !! This module checks whether
-   !!   Ice Total Energy
-   !!   Ice Total Mass
-   !!   Salt Mass
-   !! Are conserved !
-   !! 
-   !!======================================================================
-   !!    lim_cons   :   checks whether energy/mass are conserved 
+   !!    lim_cons   :   checks whether energy, mass and salt are conserved 
    !!----------------------------------------------------------------------
-   !!
-   !! * Modules used
-
-   USE par_ice
-   USE dom_oce
-   USE dom_ice
-   USE ice
-   USE in_out_manager  ! I/O manager
+   USE par_ice          ! LIM-3 parameter
+   USE ice              ! LIM-3 variables
+   USE dom_ice          ! LIM-3 domain
+   USE dom_oce          ! ocean domain
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC lim_column_sum
-   PUBLIC lim_column_sum_energy
-   PUBLIC lim_cons_check
-
-   !! * Module variables
-   !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
+   PUBLIC   lim_column_sum
+   PUBLIC   lim_column_sum_energy
+   PUBLIC   lim_cons_check
 
    !!----------------------------------------------------------------------
-
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   !===============================================================================
-
-   SUBROUTINE lim_column_sum(nsum,xin,xout)
-      !     !!-------------------------------------------------------------------
-      !     !!               ***  ROUTINE lim_column_sum ***
-      !     !!
-      !     !! ** Purpose : Compute the sum of xin over nsum categories
-      !     !!
-      !     !! ** Method  : Arithmetics
-      !     !!
-      !     !! ** Action  : Gets xin(ji,jj,jl) and computes xout(ji,jj)
-      !     !!
-      !     !! History :
-      !     !!   author: William H. Lipscomb, LANL
-      !     !!   2.1  !  04-06  (M. Vancoppenolle)   Energy Conservation 
-      !     !!---------------------------------------------------------------------
-      !     !! * Local variables
-      INTEGER, INTENT(in) ::     &
-         nsum                  ! number of categories/layers
-
-      REAL (wp), DIMENSION(jpi, jpj, jpl), INTENT(IN) ::   &
-         xin                   ! input field
-
-      REAL (wp), DIMENSION(jpi, jpj), INTENT(OUT) ::  &
-         xout                  ! output field
-      INTEGER ::                 &
-         ji, jj, jl         ! horizontal indices
-
-      !     !!---------------------------------------------------------------------
-      !     WRITE(numout,*) ' lim_column_sum '
-      !     WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
-
-      xout(:,:) = 0.00
-
-      DO jl = 1, nsum
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               xout(ji,jj) = xout(ji,jj) + xin(ji,jj,jl)
-            END DO ! ji 
-         END DO  ! jj 
-      END DO  ! jl 
-
+   SUBROUTINE lim_column_sum( ksum, pin, pout )
+      !!-------------------------------------------------------------------
+      !!               ***  ROUTINE lim_column_sum ***
+      !!
+      !! ** Purpose : Compute the sum of xin over nsum categories
+      !!
+      !! ** Method  : Arithmetics
+      !!
+      !! ** Action  : Gets xin(ji,jj,jl) and computes xout(ji,jj)
+      !!---------------------------------------------------------------------
+      INTEGER                   , INTENT(in   ) ::   ksum   ! number of categories/layers
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pin    ! input field
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   pout   ! output field
+      !
+      INTEGER ::   jl   ! dummy loop indices
+      !!---------------------------------------------------------------------
+      !
+      pout(:,:) = pin(:,:,1)
+      DO jl = 2, ksum
+         pout(:,:) = pout(:,:) + pin(:,:,jl)
+      END DO
+      !
    END SUBROUTINE lim_column_sum
 
-   !===============================================================================
 
-   SUBROUTINE lim_column_sum_energy(nsum,nlay,xin,xout)
-
+   SUBROUTINE lim_column_sum_energy( ksum, klay, pin, pout)
       !!-------------------------------------------------------------------
       !!               ***  ROUTINE lim_column_sum_energy ***
@@ -100,47 +68,24 @@
       !!
       !! ** Method  : Arithmetics
-      !!
-      !! ** Action  : Gets xin(ji,jj,jl) and computes xout(ji,jj)
-      !!
-      !! History :
-      !!   author: William H. Lipscomb, LANL
-      !!   2.1  !  04-06  (M. Vancoppenolle)   Energy Conservation 
       !!---------------------------------------------------------------------
-      !! * Local variables
-      INTEGER, INTENT(in) ::  &
-         nsum,              &  !: number of categories
-         nlay                  !: number of vertical layers
-
-      REAL (wp), DIMENSION(jpi, jpj, jkmax, jpl), INTENT(IN) :: &
-         xin                   !: input field
-
-      REAL (wp), DIMENSION(jpi, jpj), INTENT(OUT) ::  &
-         xout                  !: output field
-
-      INTEGER ::              &
-         ji, jj,            &  !: horizontal indices
-         jk, jl                !: layer and category  indices
+      INTEGER                               , INTENT(in   ) ::   ksum   !: number of categories
+      INTEGER                               , INTENT(in   ) ::   klay   !: number of vertical layers
+      REAL(wp), DIMENSION(jpi,jpj,jkmax,jpl), INTENT(in   ) ::   pin   !: input field
+      REAL(wp), DIMENSION(jpi,jpj)          , INTENT(  out) ::   pout   !: output field
+      !
+      INTEGER ::   jk, jl   ! dummy loop indices
       !!---------------------------------------------------------------------
-
-      !     WRITE(numout,*) ' lim_column_sum_energy '
-      !     WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~ '
-
-      xout(:,:) = 0.00
-
-      DO jl = 1, nsum
-         DO jk = 1, nlay 
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  xout(ji,jj) = xout(ji,jj) + xin(ji,jj,jk,jl)
-               END DO ! ji 
-            END DO  ! jj 
-         END DO  ! jk
-      END DO ! jl
-
+      !
+      DO jl = 1, ksum
+         pout(:,:) = pin(:,:,1,jl)
+         DO jk = 2, klay 
+            pout(:,:) = pout(:,:) + pin(:,:,jk,jl)
+         END DO
+      END DO
+      !
    END SUBROUTINE lim_column_sum_energy
 
-   !===============================================================================
 
-   SUBROUTINE lim_cons_check(x1, x2, max_err, fieldid)
+   SUBROUTINE lim_cons_check( px1, px2, pmax_err, cd_fieldid )
       !!-------------------------------------------------------------------
       !!               ***  ROUTINE lim_cons_check ***
@@ -152,77 +97,55 @@
       !!
       !! ** Method  :
-      !!
-      !! ** Action  : -
-      !! History :
-      !!   author: William H. Lipscomb, LANL
-      !!   2.1  !  04-06  (M. Vancoppenolle)   Energy Conservation 
       !!---------------------------------------------------------------------
-      !! * Local variables
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   px1          !: initial field
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   px2          !: final field
+      REAL(wp)                , INTENT(in   ) ::   pmax_err     !: max allowed error
+      CHARACTER(len=15)       , INTENT(in   ) ::   cd_fieldid   !: field identifyer
+      !
+      INTEGER  ::   ji, jj          ! dummy loop indices
+      INTEGER  ::   inb_error       ! number of g.c where there is a cons. error
+      LOGICAL  ::   llconserv_err   ! = .true. if conservation check failed
+      REAL(wp) ::   zmean_error     ! mean error on error points
+      !!---------------------------------------------------------------------
+      !
+      IF(lwp) WRITE(numout,*) ' lim_cons_check '
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
 
-      REAL (wp), DIMENSION(jpi, jpj), INTENT(IN) ::   &
-         x1 (jpi,jpj) , & !: initial field
-         x2 (jpi,jpj)     !: final field
+      llconserv_err = .FALSE.
+      inb_error     = 0
+      zmean_error   = 0._wp
+      IF( MAXVAL( px2(:,:) - px1(:,:) ) > pmax_err )   llconserv_err = .TRUE.
 
-      REAL (wp) , INTENT ( IN )                  ::   &
-         max_err          !: max allowed error
-
-      REAL (wp)                                  ::   &
-         mean_error       !: mean error on error points
-
-      INTEGER                                    ::   &
-         num_error        !: number of g.c where there is a cons. error
-
-      CHARACTER(len=15) , INTENT(IN)             ::   &
-         fieldid          !: field identifyer
-
-      INTEGER ::              &
-         ji, jj           !: horizontal indices      
-
-      LOGICAL ::              &
-         conserv_err      !: = .true. if conservation check failed
-
-      !!---------------------------------------------------------------------
-      WRITE(numout,*) ' lim_cons_check '
-      WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
-
-      conserv_err = .FALSE.
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            IF (ABS(x2(ji,jj) - x1(ji,jj)) .GT. max_err) THEN
-               conserv_err = .TRUE.
-            ENDIF
-         END DO
-      END DO
-
-      IF ( conserv_err ) THEN
-
-         num_error  = 0
-         mean_error = 0.0
+      IF( llconserv_err ) THEN
          DO jj = 1, jpj 
             DO ji = 1, jpi
-               IF (ABS(x2(ji,jj) - x1(ji,jj)) .GT. max_err ) THEN
-                  num_error  = num_error + 1
-                  mean_error = mean_error + ABS(x2(ji,jj) - x1(ji,jj))
-
-                  WRITE (numout,*) ' ALERTE 99 '
-                  WRITE (numout,*) ' Conservation error: ', fieldid
-                  WRITE (numout,*) ' Point         : ', ji, jj 
-                  WRITE (numout,*) ' lat, lon      : ', gphit(ji,jj), & 
-                     glamt(ji,jj)
-                  WRITE (numout,*) ' Initial value : ', x1(ji,jj)
-                  WRITE (numout,*) ' Final value   : ', x2(ji,jj)
-                  WRITE (numout,*) ' Difference    : ', x2(ji,jj) - x1(ji,jj)
-
+               IF( ABS( px2(ji,jj) - px1(ji,jj) ) > pmax_err ) THEN
+                  inb_error   = inb_error + 1
+                  zmean_error = zmean_error + ABS( px2(ji,jj) - px1(ji,jj) )
+                  !
+                  IF(lwp) THEN
+                     WRITE (numout,*) ' ALERTE 99 '
+                     WRITE (numout,*) ' Conservation error: ', cd_fieldid
+                     WRITE (numout,*) ' Point             : ', ji, jj 
+                     WRITE (numout,*) ' lat, lon          : ', gphit(ji,jj), glamt(ji,jj)
+                     WRITE (numout,*) ' Initial value     : ', px1(ji,jj)
+                     WRITE (numout,*) ' Final value       : ', px2(ji,jj)
+                     WRITE (numout,*) ' Difference        : ', px2(ji,jj) - px1(ji,jj)
+                  ENDIF
                ENDIF
             END DO
          END DO
-
-         IF ( num_error .GT. 0 ) mean_error = mean_error / num_error
-         WRITE(numout,*) ' Conservation check for : ', fieldid
-         WRITE(numout,*) ' Number of error points : ', num_error
-         WRITE(numout,*) ' Mean error on these pts: ', mean_error
-
-      ENDIF ! conserv_err
-
+         !
+      ENDIF
+      IF(lk_mpp)   CALL mpp_sum( inb_error   )
+      IF(lk_mpp)   CALL mpp_sum( zmean_error )
+      !
+      IF( inb_error > 0 .AND. lwp ) THEN
+         zmean_error = zmean_error / REAL( inb_error, wp )
+         WRITE(numout,*) ' Conservation check for : ', cd_fieldid
+         WRITE(numout,*) ' Number of error points : ', inb_error
+         WRITE(numout,*) ' Mean error on these pts: ', zmean_error
+      ENDIF
+      !
    END SUBROUTINE lim_cons_check
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdia.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdia.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdia.F90	(revision 2715)
@@ -52,5 +52,5 @@
 
    REAL(wp), DIMENSION(jpinfmx) ::   vinfom     ! temporary working space
-   REAL(wp), DIMENSION(jpi,jpj) ::   aire       ! masked grid cell area
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   aire       ! masked grid cell area
 
    !! * Substitutions
@@ -67,6 +67,6 @@
       !!                  ***  ROUTINE lim_dia  ***
       !!   
-      !! ** Purpose : Computation and outputs on file ice.evolu 
-      !!      the temporal evolution of some key variables
+      !! ** Purpose :   Computation and outputs on file ice.evolu 
+      !!              the temporal evolution of some key variables
       !!-------------------------------------------------------------------
       INTEGER  ::   jv, ji, jj, jl   ! dummy loop indices
@@ -410,5 +410,5 @@
       !!-------------------------------------------------------------------
       INTEGER  ::   jv    ! dummy loop indice
-      INTEGER  ::   ntot , ndeb , irecl   ! local integers
+      INTEGER  ::   ierr, ntot , ndeb , irecl   ! local integers
       REAL(wp) ::   zxx0, zxx1    ! local scalars
       CHARACTER(len=jpchinf) ::   titinf
@@ -431,10 +431,13 @@
       ENDIF
 
-      aire(:,:) = area(:,:) * tms(:,:) * tmask_i(:,:)      ! masked grid cell area (interior domain only)
+      ALLOCATE( aire(jpi,jpj) , STAT=ierr )      ! masked grid cell area (interior domain only)
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'lim_dia_init_2 : unable to allocate arrays' )
+      aire(:,:) = area(:,:) * tms(:,:) * tmask_i(:,:)
 
       ! Titles of ice key variables :
       titvar(1) = 'NoIt'  ! iteration number
       titvar(2) = 'T yr'  ! time step in years
-      nbvt = 2            ! number of time variables
+      nbvt      = 2       ! number of time variables
 
       titvar(3) = 'AI_N'  ! sea ice area in the northern Hemisp.(10^12 km2)
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limdyn.F90	(revision 2715)
@@ -4,6 +4,7 @@
    !!   Sea-Ice dynamics :  
    !!======================================================================
-   !! history :  1.0  ! 2002-08 (C. Ethe, G. Madec)  original VP code 
-   !!            3.0  ! 2007-03 (MA Morales Maqueda, S. Bouillon, M. Vancoppenolle)  LIM3: EVP-Cgrid
+   !! history :  1.0  ! 2002-08  (C. Ethe, G. Madec)  original VP code 
+   !!            3.0  ! 2007-03  (MA Morales Maqueda, S. Bouillon, M. Vancoppenolle)  LIM3: EVP-Cgrid
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -14,16 +15,16 @@
    !!    lim_dyn_init : initialization and namelist read
    !!----------------------------------------------------------------------
-   USE phycst
-   USE in_out_manager  ! I/O manager
-   USE dom_ice
-   USE dom_oce         ! ocean space and time domain
-   USE ice
-   USE par_ice
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbc_ice         ! Surface boundary condition: ice fields
-   USE limrhg          ! ice rheology
-   USE lbclnk
-   USE lib_mpp
-   USE prtctl          ! Print control
+   USE phycst           ! physical constants
+   USE dom_oce          ! ocean space and time domain
+   USE sbc_oce          ! Surface boundary condition: ocean fields
+   USE sbc_ice          ! Surface boundary condition: ice   fields
+   USE ice              ! LIM-3 variables
+   USE par_ice          ! LIM-3 parameters
+   USE dom_ice          ! LIM-3 domain
+   USE limrhg           ! LIM-3 rheology
+   USE lbclnk           ! lateral boundary conditions - MPP exchanges
+   USE lib_mpp          ! MPP library
+   USE in_out_manager   ! I/O manager
+   USE prtctl           ! Print control
 
    IMPLICIT NONE
@@ -35,5 +36,5 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -54,4 +55,8 @@
       !!              - treatment of the case if no ice dynamic
       !!------------------------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_1d_1, wrk_1d_2
+      USE wrk_nemo, ONLY:   zu_io => wrk_2d_1, zv_io => wrk_2d_2  ! ice-ocean velocity
+      !
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -59,18 +64,18 @@
       INTEGER  ::   i_j1, i_jpj       ! Starting/ending j-indices for rheology
       REAL(wp) ::   zcoef             ! local scalar
-      REAL(wp), DIMENSION(jpj)     ::   zind           ! i-averaged indicator of sea-ice
-      REAL(wp), DIMENSION(jpj)     ::   zmsk           ! i-averaged of tmask
-      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io   ! ice-ocean velocity
+      REAL(wp), POINTER, DIMENSION(:) ::   zind     ! i-averaged indicator of sea-ice
+      REAL(wp), POINTER, DIMENSION(:) ::   zmsk     ! i-averaged of tmask
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 .AND. lwp ) THEN
-         WRITE(numout,*) ' lim_dyn : Ice dynamics '
-         WRITE(numout,*) ' ~~~~~~~ '
-      ENDIF
-
-      IF( numit == nstart  )   CALL lim_dyn_init   ! Initialization (first time-step only)
-
-      IF ( ln_limdyn ) THEN
-
+      IF(  wrk_in_use(1, 1,2)  .OR.  wrk_in_use(2, 1,2)  ) THEN
+         CALL ctl_stop('lim_dyn : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      zind => wrk_1d_1(1:jpj)      ! Set-up pointers to sub-arrays of workspaces
+      zmsk => wrk_1d_2(1:jpj)
+
+      IF( kt == nit000 )   CALL lim_dyn_init   ! Initialization (first time-step only)
+
+      IF( ln_limdyn ) THEN
+         !
          old_u_ice(:,:) = u_ice(:,:) * tmu(:,:)
          old_v_ice(:,:) = v_ice(:,:) * tmv(:,:)
@@ -88,8 +93,8 @@
             CALL lim_rhg( i_j1, i_jpj )
          ELSE                                 ! optimization of the computational area
-
+            !
             DO jj = 1, jpj
-               zind(jj) = SUM( 1.0 - at_i (:,jj  ) )   ! = FLOAT(jpj) if ocean everywhere on a j-line
-               zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0          if land  everywhere on a j-line
+               zind(jj) = SUM( 1.0 - at_i(:,jj) )   ! = REAL(jpj) if ocean everywhere on a j-line
+               zmsk(jj) = SUM( tmask(:,jj,1)    )   ! = 0         if land  everywhere on a j-line
             END DO
 
@@ -106,5 +111,5 @@
                IF(ln_ctl) CALL prt_ctl_info( 'lim_dyn  : NH  i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
                CALL lim_rhg( i_j1, i_jpj )
-
+               !
                ! Southern hemisphere
                i_j1  =  1
@@ -115,11 +120,11 @@
                i_jpj = MIN( jpj, i_jpj+1 )
                IF(ln_ctl) CALL prt_ctl_info( 'lim_dyn  : SH  i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
-
-       CALL lim_rhg( i_j1, i_jpj )
-
-    ELSE                                 ! local domain extends over one hemisphere only
-       !                                 ! Rheology is computed only over the ice cover
-       !                                 ! latitude strip
-       i_j1  = 1
+               !
+               CALL lim_rhg( i_j1, i_jpj )
+               !
+            ELSE                                 ! local domain extends over one hemisphere only
+               !                                 ! Rheology is computed only over the ice cover
+               !                                 ! latitude strip
+               i_j1  = 1
                DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
                   i_j1 = i_j1 + 1
@@ -132,11 +137,11 @@
                END DO
                i_jpj = MIN( jpj, i_jpj+1)
-
+               !
                IF(ln_ctl) CALL prt_ctl_info( 'lim_dyn  : one hemisphere:  i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
-
+               !
                CALL lim_rhg( i_j1, i_jpj )
-
+               !
             ENDIF
-
+            !
          ENDIF
 
@@ -147,5 +152,5 @@
          zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
          ! frictional velocity at T-point
-         zcoef = 0.5 * cw
+         zcoef = 0.5_wp * cw
          DO jj = 2, jpjm1 
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -157,5 +162,5 @@
       ELSE      ! no ice dynamics : transmit directly the atmospheric stress to the ocean
          !
-         zcoef = SQRT( 0.5 ) / rau0
+         zcoef = SQRT( 0.5_wp ) / rau0
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -207,4 +212,7 @@
       ENDIF
       !
+      IF( wrk_not_released(1, 1,2) .OR.   &
+          wrk_not_released(2, 1,2)  )   CALL ctl_stop('lim_dyn : failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_dyn
 
@@ -271,5 +279,5 @@
       ahiu(:,:) = ahi0 * umask(:,:,1)
       ahiv(:,:) = ahi0 * vmask(:,:,1)
-
+      !
    END SUBROUTINE lim_dyn_init
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limhdf.F90	(revision 2715)
@@ -4,4 +4,8 @@
    !! LIM ice model : horizontal diffusion of sea-ice quantities
    !!======================================================================
+   !! History :  LIM  !  2000-01 (LIM) Original code
+   !!             -   !  2001-05 (G. Madec, R. Hordoir) opa norm
+   !!            1.0  !  2002-08 (C. Ethe)  F90, free form
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
@@ -10,31 +14,27 @@
    !!   lim_hdf  : diffusion trend on sea-ice variable
    !!----------------------------------------------------------------------
-   !! * Modules used
-   USE dom_oce
-   USE in_out_manager
-   USE ice
-   USE lbclnk
-   USE lib_mpp
-   USE prtctl          ! Print control
+   USE dom_oce          ! ocean domain
+   USE ice              ! LIM-3: ice variables
+   USE lbclnk           ! lateral boundary condition - MPP exchanges
+   USE lib_mpp          ! MPP library
+   USE prtctl           ! Print control
+   USE in_out_manager   ! I/O manager
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_hdf    ! called by lim_tra
+   PUBLIC   lim_hdf     ! called by lim_tra
 
-   !! * Module variables
-   LOGICAL  ::   linit = .TRUE.              ! ???
+   LOGICAL  ::   linit = .TRUE.              ! initialization flag (set to flase after the 1st call)
    REAL(wp) ::   epsi04 = 1e-04              ! constant
-   REAL(wp), DIMENSION(jpi,jpj) ::   zfact   ! ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   efact   ! metric coefficient
 
    !! * Substitution 
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -43,79 +43,63 @@
       !!                  ***  ROUTINE lim_hdf  ***
       !!
-      !! ** purpose :   Compute and add the diffusive trend on sea-ice
-      !!      variables
+      !! ** purpose :   Compute and add the diffusive trend on sea-ice variables
       !!
       !! ** method  :   Second order diffusive operator evaluated using a
-      !!      Cranck-Nicholson time Scheme.
+      !!              Cranck-Nicholson time Scheme.
       !!
       !! ** Action  :    update ptab with the diffusive contribution
-      !!
-      !! History :
-      !!        !  00-01 (LIM) Original code
-      !!        !  01-05 (G. Madec, R. Hordoir) opa norm
-      !!        !  02-08 (C. Ethe)  F90, free form
       !!-------------------------------------------------------------------
-      ! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) ::   &
-         ptab                 ! Field on which the diffusion is applied  
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         ptab0                ! ???
-
-      ! * Local variables
-      INTEGER ::  ji, jj      ! dummy loop indices
-      INTEGER ::  &
-         its, iter            ! temporary integers
-      CHARACTER (len=55) :: charout
-      REAL(wp) ::  &
-         zalfa, zrlxint, zconv, zeps   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::  & 
-         zrlx, zflu, zflv, &  ! temporary workspaces
-         zdiv0, zdiv          !    "           "
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zflu => wrk_2d_11, zdiv  => wrk_2d_13, zrlx  => wrk_2d_15 
+      USE wrk_nemo, ONLY:   zflv => wrk_2d_12, zdiv0 => wrk_2d_14, ztab0 => wrk_2d_16
+      !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT( inout ) ::   ptab    ! Field on which the diffusion is applied
+      !
+      INTEGER  ::  ji, jj            ! dummy loop indices
+      INTEGER  ::  its, iter, ierr   ! local integers
+      REAL(wp) ::   zalfa, zrlxint, zconv, zeps   ! local scalars
+      CHARACTER(lc) ::   charout   ! local character
       !!-------------------------------------------------------------------
-
-      ! Initialisation
-      ! ---------------   
-      ! Time integration parameters
-      zalfa = 0.5       ! =1.0/0.5/0.0 = implicit/Cranck-Nicholson/explicit
-      its   = 100       ! Maximum number of iteration
-      zeps  =  2. * epsi04
-
-      ! Arrays initialization
-      ptab0 (:, : ) = ptab(:,:)
-      !bug  zflu (:,jpj) = 0.e0
-      !bug  zflv (:,jpj) = 0.e0
-      zdiv0(:, 1 ) = 0.e0
-      zdiv0(:,jpj) = 0.e0
-      IF( .NOT.lk_vopt_loop ) THEN
-         zflu (jpi,:) = 0.e0   
-         zflv (jpi,:) = 0.e0
-         zdiv0(1,  :) = 0.e0
-         zdiv0(jpi,:) = 0.e0
+      
+      IF( wrk_in_use(2, 11,12,13,14,15,16) ) THEN
+         CALL ctl_stop( 'lim_hdf: requested workspace arrays unavailable' )   ;   RETURN
       ENDIF
 
-      ! Metric coefficient (compute at the first call and saved in
-      IF( linit ) THEN
+      !                       !==  Initialisation  ==!
+      !
+      IF( linit ) THEN              ! Metric coefficient (compute at the first call and saved in efact)
+         ALLOCATE( efact(jpi,jpj) , STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'lim_hdf : unable to allocate arrays' )
          DO jj = 2, jpjm1  
             DO ji = fs_2 , fs_jpim1   ! vector opt.
-               zfact(ji,jj) = ( e2u(ji,jj) + e2u(ji-1,jj  ) + e1v(ji,jj) + e1v(ji,jj-1) ) &
-                  &          / ( e1t(ji,jj) * e2t(ji,jj) )
+               efact(ji,jj) = ( e2u(ji,jj) + e2u(ji-1,jj) + e1v(ji,jj) + e1v(ji,jj-1) ) / ( e1t(ji,jj) * e2t(ji,jj) )
             END DO
          END DO
          linit = .FALSE.
       ENDIF
+      !                             ! Time integration parameters
+      zalfa = 0.5_wp                      ! =1.0/0.5/0.0 = implicit/Cranck-Nicholson/explicit
+      its   = 100                         ! Maximum number of iteration
+      zeps  =  2._wp * epsi04
+      !
+      ztab0(:, : ) = ptab(:,:)      ! Arrays initialization
+      zdiv0(:, 1 ) = 0._wp
+      zdiv0(:,jpj) = 0._wp
+      IF( .NOT.lk_vopt_loop ) THEN
+         zflu (jpi,:) = 0._wp   
+         zflv (jpi,:) = 0._wp
+         zdiv0(1,  :) = 0._wp
+         zdiv0(jpi,:) = 0._wp
+      ENDIF
 
-
-      ! Sub-time step loop
-      zconv = 1.e0
+      zconv = 1._wp           !==  horizontal diffusion using a Crant-Nicholson scheme  ==!
       iter  = 0
-
-      !                                                   !===================
-      DO WHILE ( ( zconv > zeps ) .AND. (iter <= its) )   ! Sub-time step loop
-         !                                                !===================
-         ! incrementation of the sub-time step number
-         iter = iter + 1
-
-         ! diffusive fluxes in U- and V- direction
-         DO jj = 1, jpjm1
+      !
+      DO WHILE( zconv > zeps .AND. iter <= its )   ! Sub-time step loop
+         !
+         iter = iter + 1                                 ! incrementation of the sub-time step number
+         !
+         DO jj = 1, jpjm1                                ! diffusive fluxes in U- and V- direction
             DO ji = 1 , fs_jpim1   ! vector opt.
                zflu(ji,jj) = pahu(ji,jj) * e2u(ji,jj) / e1u(ji,jj) * ( ptab(ji+1,jj) - ptab(ji,jj) )
@@ -123,7 +107,6 @@
             END DO
          END DO
-
-         ! diffusive trend : divergence of the fluxes
-         DO jj= 2, jpjm1
+         !
+         DO jj= 2, jpjm1                                 ! diffusive trend : divergence of the fluxes
             DO ji = fs_2 , fs_jpim1   ! vector opt. 
                zdiv (ji,jj) = (  zflu(ji,jj) - zflu(ji-1,jj  )   &
@@ -131,24 +114,19 @@
             END DO
          END DO
-
-         ! save the first evaluation of the diffusive trend in zdiv0
-         IF( iter == 1 )   zdiv0(:,:) = zdiv(:,:)       
-
-         ! XXXX iterative evaluation?????
-         DO jj = 2, jpjm1
+         !
+         IF( iter == 1 )   zdiv0(:,:) = zdiv(:,:)        ! save the 1st evaluation of the diffusive trend in zdiv0
+         !
+         DO jj = 2, jpjm1                                ! iterative evaluation
             DO ji = fs_2 , fs_jpim1   ! vector opt.
-               zrlxint = (   ptab0(ji,jj)    &
-                  &       +  rdt_ice * (           zalfa   * ( zdiv(ji,jj) + zfact(ji,jj) * ptab(ji,jj) )   &
+               zrlxint = (   ztab0(ji,jj)    &
+                  &       +  rdt_ice * (           zalfa   * ( zdiv(ji,jj) + efact(ji,jj) * ptab(ji,jj) )   &
                   &                      + ( 1.0 - zalfa ) *   zdiv0(ji,jj) )  )                             & 
-                  &    / ( 1.0 + zalfa * rdt_ice * zfact(ji,jj) )
+                  &    / ( 1.0 + zalfa * rdt_ice * efact(ji,jj) )
                zrlx(ji,jj) = ptab(ji,jj) + om * ( zrlxint - ptab(ji,jj) )
             END DO
          END DO
-
-         ! lateral boundary condition on zrlx
-         CALL lbc_lnk( zrlx, 'T', 1. )
-
-         ! convergence test
-         zconv = 0.e0
+         CALL lbc_lnk( zrlx, 'T', 1. )                   ! lateral boundary condition
+         !
+         zconv = 0._wp                                   ! convergence test
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1
@@ -156,23 +134,18 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mpp_max( zconv )   ! max over the global domain
-
-         DO jj = 1, jpj
-            DO ji = 1 , jpi
-               ptab(ji,jj) = zrlx(ji,jj)
-            END DO
-         END DO
-
-         !                                         !==========================
+         IF( lk_mpp )   CALL mpp_max( zconv )            ! max over the global domain
+         !
+         ptab(:,:) = zrlx(:,:)
+         !
       END DO                                       ! end of sub-time step loop
-      !                                            !==========================
 
       IF(ln_ctl)   THEN
-         zrlx(:,:) = ptab(:,:) - ptab0(:,:)
+         zrlx(:,:) = ptab(:,:) - ztab0(:,:)
          WRITE(charout,FMT="(' lim_hdf  : zconv =',D23.16, ' iter =',I4,2X)") zconv, iter
-         CALL prt_ctl(tab2d_1=zrlx, clinfo1=charout)
+         CALL prt_ctl( tab2d_1=zrlx, clinfo1=charout )
       ENDIF
-
-
+      !
+      IF( wrk_not_released(2, 11,12,13,14,15,16) )   CALL ctl_stop('lim_hdf: failed to release workspace arrays')
+      !
    END SUBROUTINE lim_hdf
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90	(revision 2715)
@@ -5,4 +5,5 @@
    !!======================================================================
    !! History :  2.0  ! 2004-01 (C. Ethe, G. Madec)  Original code
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -23,4 +24,5 @@
    USE in_out_manager   ! I/O manager
    USE lbclnk           ! lateral boundary condition - MPP exchanges
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -45,5 +47,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -60,11 +62,20 @@
       !!                or from arbitrary sea-ice conditions
       !!-------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_1d_1, wrk_1d_2, wrk_1d_3, wrk_1d_4
+      USE wrk_nemo, ONLY:   zidto => wrk_2d_1   ! ice indicator
+      !
       INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices
       REAL(wp) ::   zeps6, zeps, ztmelts, epsi06   ! local scalars
-      REAL(wp) ::  zvol, zare, zh, zh1, zh2, zh3, zan, zbn, zas, zbs 
-      REAL(wp), DIMENSION(jpm)     ::   zgfactorn, zhin 
-      REAL(wp), DIMENSION(jpm)     ::   zgfactors, zhis
-      REAL(wp), DIMENSION(jpi,jpj) ::   zidto      ! ice indicator
-      !--------------------------------------------------------------------
+      REAL(wp) ::   zvol, zare, zh, zh1, zh2, zh3, zan, zbn, zas, zbs 
+      REAL(wp), POINTER, DIMENSION(:) ::   zgfactorn, zhin 
+      REAL(wp), POINTER, DIMENSION(:) ::   zgfactors, zhis
+      !--------------------------------------------------------------------
+
+      IF(  wrk_in_use(1, 1,2)  ) THEN
+         CALL ctl_stop( 'lim_istate: requested workspace arrays unavailable' )   ;   RETURN
+      ENDIF
+      zgfactorn => wrk_1d_1(1:jpm)   ;   zhin => wrk_1d_3(1:jpm)   ! Set-up pointers to sub-arrays of workspaces
+      zgfactors => wrk_1d_2(1:jpm)   ;   zhis => wrk_1d_4(1:jpm)
 
       !--------------------------------------------------------------------
@@ -506,4 +517,6 @@
       CALL lbc_lnk( fsbbq  , 'T', 1. )
       !
+      IF( wrk_not_released(1, 1,2) )   CALL ctl_stop('lim_istate : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_istate
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90	(revision 2715)
@@ -2,9 +2,9 @@
    !!======================================================================
    !!                       ***  MODULE limitd_me ***
-   !!            Mechanical impact on ice thickness distribution
-   !!                     computation of changes in g(h)      
+   !! LIM-3 : Mechanical impact on ice thickness distribution      
    !!======================================================================
    !! History :  LIM  ! 2006-02  (M. Vancoppenolle) Original code 
    !!            3.2  ! 2009-07  (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in smsw & fsalt_rpo
+   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -12,188 +12,140 @@
    !!   'key_lim3' :                                    LIM3 sea-ice model
    !!----------------------------------------------------------------------
-   USE dom_ice
    USE par_oce          ! ocean parameters
-   USE dom_oce
-   USE lbclnk
+   USE dom_oce          ! ocean domain
    USE phycst           ! physical constants (ocean directory) 
-   USE sbc_oce          ! Surface boundary condition: ocean fields
-   USE thd_ice
-   USE in_out_manager
-   USE ice
-   USE par_ice
-   USE limthd_lac
-   USE limvar
-   USE limcons
+   USE sbc_oce          ! surface boundary condition: ocean fields
+   USE thd_ice          ! LIM thermodynamics
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE dom_ice          ! LIM domain
+   USE limthd_lac       ! LIM
+   USE limvar           ! LIM
+   USE limcons          ! LIM
+   USE in_out_manager   ! I/O manager
+   USE lbclnk           ! lateral boundary condition - MPP exchanges
+   USE lib_mpp          ! MPP library
    USE prtctl           ! Print control
-   USE lib_mpp
+   USE wrk_nemo         ! workspace manager
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_itd_me        ! called by ice_stp
-   PUBLIC lim_itd_me_icestrength
-   PUBLIC lim_itd_me_ridgeprep
-   PUBLIC lim_itd_me_ridgeshift
-   PUBLIC lim_itd_me_asumr
-   PUBLIC lim_itd_me_init
-   PUBLIC lim_itd_me_zapsmall
-
-   !! * Module variables
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1e-20   ,  &
-      epsi13 = 1e-13   ,  &
-      epsi11 = 1e-11   ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0
+   PUBLIC   lim_itd_me               ! called by ice_stp
+   PUBLIC   lim_itd_me_icestrength
+   PUBLIC   lim_itd_me_init
+   PUBLIC   lim_itd_me_zapsmall
+   PUBLIC   lim_itd_me_alloc        ! called by nemogcm.F90
+
+   REAL(wp)  ::   epsi11 = 1.e-11_wp   ! constant values
+   REAL(wp)  ::   epsi10 = 1.e-10_wp   ! constant values
+   REAL(wp)  ::   epsi06 = 1.e-06_wp   ! constant values
 
    !-----------------------------------------------------------------------
    ! Variables shared among ridging subroutines
    !-----------------------------------------------------------------------
-   REAL(wp), DIMENSION (jpi,jpj) ::    &
-      asum         , & ! sum of total ice and open water area
-      aksum            ! ratio of area removed to area ridged
-
-   REAL(wp), DIMENSION(jpi,jpj,0:jpl) :: &     
-      athorn           ! participation function; fraction of ridging/
-   !  closing associated w/ category n
-
-   REAL(wp), DIMENSION(jpi,jpj,jpl) ::  &
-      hrmin      , &   ! minimum ridge thickness
-      hrmax      , &   ! maximum ridge thickness
-      hraft      , &   ! thickness of rafted ice
-      krdg       , &   ! mean ridge thickness/thickness of ridging ice 
-      aridge     , &   ! participating ice ridging
-      araft            ! participating ice rafting
-
-   REAL(wp), PARAMETER :: &
-      krdgmin = 1.1, &    ! min ridge thickness multiplier
-      kraft   = 2.0       ! rafting multipliyer
-
-   REAL(wp) :: &                               
-      Cp 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   asum     ! sum of total ice and open water area
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   aksum    ! ratio of area removed to area ridged
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   athorn   ! participation function; fraction of ridging/
+   !                                                           !  closing associated w/ category n
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hrmin    ! minimum ridge thickness
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hrmax    ! maximum ridge thickness
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hraft    ! thickness of rafted ice
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   krdg     ! mean ridge thickness/thickness of ridging ice 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aridge   ! participating ice ridging
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   araft    ! participating ice rafting
+
+   REAL(wp), PARAMETER ::   krdgmin = 1.1_wp    ! min ridge thickness multiplier
+   REAL(wp), PARAMETER ::   kraft   = 2.0_wp    ! rafting multipliyer
+
+   REAL(wp) ::   Cp                             ! 
    !
    !-----------------------------------------------------------------------
    ! Ridging diagnostic arrays for history files
    !-----------------------------------------------------------------------
-   !
-   REAL (wp), DIMENSION(jpi,jpj) :: &
-      dardg1dt     , & ! rate of fractional area loss by ridging ice (1/s)
-      dardg2dt     , & ! rate of fractional area gain by new ridges (1/s)
-      dvirdgdt     , & ! rate of ice volume ridged (m/s)
-      opening          ! rate of opening due to divergence/shear (1/s)
-
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dardg1dt   ! rate of fractional area loss by ridging ice (1/s)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dardg2dt   ! rate of fractional area gain by new ridges (1/s)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dvirdgdt   ! rate of ice volume ridged (m/s)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   opening    ! rate of opening due to divergence/shear (1/s)
 
    !!----------------------------------------------------------------------
    !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
-
 CONTAINS
 
-   !!-----------------------------------------------------------------------------!
-   !!-----------------------------------------------------------------------------!
-
-   SUBROUTINE lim_itd_me ! (subroutine 1/6)
+   INTEGER FUNCTION lim_itd_me_alloc()
+      !!---------------------------------------------------------------------!
+      !!                ***  ROUTINE lim_itd_me_alloc ***
+      !!---------------------------------------------------------------------!
+      ALLOCATE(                                                                     &
+         !* Variables shared among ridging subroutines
+         &      asum (jpi,jpj)     , athorn(jpi,jpj,0:jpl)                    ,     &
+         &      aksum(jpi,jpj)                                                ,     &
+         !
+         &      hrmin(jpi,jpj,jpl) , hraft(jpi,jpj,jpl) , aridge(jpi,jpj,jpl) ,     &
+         &      hrmax(jpi,jpj,jpl) , krdg (jpi,jpj,jpl) , araft (jpi,jpj,jpl) ,     &
+         !
+         !* Ridging diagnostic arrays for history files
+         &      dardg1dt(jpi,jpj)  , dardg2dt(jpi,jpj)                        ,     & 
+         &      dvirdgdt(jpi,jpj)  , opening(jpi,jpj)                         , STAT=lim_itd_me_alloc )
+         !
+      IF( lim_itd_me_alloc /= 0 )   CALL ctl_warn( 'lim_itd_me_alloc: failed to allocate arrays' )
+      !
+   END FUNCTION lim_itd_me_alloc
+
+
+   SUBROUTINE lim_itd_me
       !!---------------------------------------------------------------------!
       !!                ***  ROUTINE lim_itd_me ***
-      !! ** Purpose :
-      !!        This routine computes the mechanical redistribution
-      !!                      of ice thickness
-      !!
-      !! ** Method  : a very simple method :-)
-      !!
-      !! ** Arguments :
-      !!           kideb , kiut : Starting and ending points on which the 
-      !!                         the computation is applied
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** Steps :
-      !!  1) Thickness categories boundaries, ice / o.w. concentrations
-      !!     Ridge preparation
-      !!  2) Dynamical inputs (closing rate, divu_adv, opning)
-      !!  3) Ridging iteration
-      !!  4) Ridging diagnostics
-      !!  5) Heat, salt and freshwater fluxes
-      !!  6) Compute increments of tate variables and come back to old values
-      !!
-      !! ** References : There are a lot of references and can be difficult / 
-      !!                 boring to read
-      !!
-      !! Flato, G. M., and W. D. Hibler III, 1995: Ridging and strength
-      !!  in modeling the thickness distribution of Arctic sea ice,
-      !!  J. Geophys. Res., 100, 18,611-18,626.
-      !!
-      !! Hibler, W. D. III, 1980: Modeling a variable thickness sea ice
-      !!  cover, Mon. Wea. Rev., 108, 1943-1973, 1980.
-      !!
-      !! Rothrock, D. A., 1975: The energetics of the plastic deformation of
-      !!  pack ice by ridging, J. Geophys. Res., 80, 4514-4519.
-      !!
-      !! Thorndike, A. S., D. A. Rothrock, G. A. Maykut, and R. Colony, 
-      !!  1975: The thickness distribution of sea ice, J. Geophys. Res., 
-      !!  80, 4501-4513. 
-      !!
-      !! Bitz et al., JGR 2001
-      !!
-      !! Amundrud and Melling, JGR 2005
-      !!
-      !! Babko et al., JGR 2002 
+      !!
+      !! ** Purpose :   computes the mechanical redistribution of ice thickness
+      !!
+      !! ** Method  :   Steps :
+      !!       1) Thickness categories boundaries, ice / o.w. concentrations
+      !!          Ridge preparation
+      !!       2) Dynamical inputs (closing rate, divu_adv, opning)
+      !!       3) Ridging iteration
+      !!       4) Ridging diagnostics
+      !!       5) Heat, salt and freshwater fluxes
+      !!       6) Compute increments of tate variables and come back to old values
+      !!
+      !! References :   Flato, G. M., and W. D. Hibler III, 1995, JGR, 100, 18,611-18,626.
+      !!                Hibler, W. D. III, 1980, MWR, 108, 1943-1973, 1980.
+      !!                Rothrock, D. A., 1975: JGR, 80, 4514-4519.
+      !!                Thorndike et al., 1975, JGR, 80, 4501-4513. 
+      !!                Bitz et al., JGR, 2001
+      !!                Amundrud and Melling, JGR 2005
+      !!                Babko et al., JGR 2002 
       !!
       !!     This routine is based on CICE code and authors William H. Lipscomb,
       !!  and Elizabeth C. Hunke, LANL are gratefully acknowledged
       !!--------------------------------------------------------------------!
-      !! * Arguments
-
-      !! * Local variables
-      INTEGER ::   ji,       &   ! spatial dummy loop index
-         jj,       &   ! spatial dummy loop index
-         jk,       &   ! vertical layering dummy loop index
-         jl,       &   ! ice category dummy loop index
-         niter,    &   ! iteration counter
-         nitermax = 20 ! max number of ridging iterations 
-
-      REAL(wp)  ::             &  ! constant values
-         zeps      =  1.0e-10, &
-         epsi10    =  1.0e-10, &
-         epsi06    =  1.0e-6
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         closing_net,        &  ! net rate at which area is removed    (1/s)
-                                ! (ridging ice area - area of new ridges) / dt
-         divu_adv   ,        &  ! divu as implied by transport scheme  (1/s)
-         opning     ,        &  ! rate of opening due to divergence/shear
-         closing_gross,      &  ! rate at which area removed, not counting
-                                ! area of new ridges
-         msnow_mlt  ,        &  ! mass of snow added to ocean (kg m-2)
-         esnow_mlt              ! energy needed to melt snow in ocean (J m-2)
-
-      REAL(wp) ::            &
-         w1,                 &  ! temporary variable
-         tmpfac,             &  ! factor by which opening/closing rates are cut
-         dti                    ! 1 / dt
-
-      LOGICAL   ::           &
-         asum_error              ! flag for asum .ne. 1
-
-      INTEGER :: iterate_ridging ! if true, repeat the ridging
-
-      REAL(wp) ::  &         
-         big = 1.0e8
-
-      REAL (wp), DIMENSION(jpi,jpj) :: &  ! 
-         vt_i_init, vt_i_final       !  ice volume summed over categories
-
-      CHARACTER (len = 15) :: fieldid
-
-      !!-- End of declarations
-      !-----------------------------------------------------------------------------!
-
-      IF( numit == nstart  ) CALL lim_itd_me_init ! Initialization (first time-step only)
+      USE wrk_nemo, ONLY:   closing_net   => wrk_2d_1   ! net rate at which area is removed    (1/s)
+      !                                                 ! (ridging ice area - area of new ridges) / dt
+      USE wrk_nemo, ONLY:   divu_adv      => wrk_2d_2   ! divu as implied by transport scheme  (1/s)
+      USE wrk_nemo, ONLY:   opning        => wrk_2d_3   ! rate of opening due to divergence/shear
+      USE wrk_nemo, ONLY:   closing_gross => wrk_2d_4   ! rate at which area removed, not counting area of new ridges
+      USE wrk_nemo, ONLY:   msnow_mlt     => wrk_2d_5   ! mass of snow added to ocean (kg m-2)
+      USE wrk_nemo, ONLY:   esnow_mlt     => wrk_2d_6   ! energy needed to melt snow in ocean (J m-2)
+      USE wrk_nemo, ONLY:   vt_i_init     => wrk_2d_7   !  ice volume summed over 
+      USE wrk_nemo, ONLY:   vt_i_final    => wrk_2d_8   !  categories
+      !
+      INTEGER ::   ji, jj, jk, jl   ! dummy loop index
+      INTEGER ::   niter, nitermax = 20   ! local integer 
+      LOGICAL  ::   asum_error              ! flag for asum .ne. 1
+      INTEGER  ::   iterate_ridging         ! if true, repeat the ridging
+      REAL(wp) ::   w1, tmpfac, dti         ! local scalar
+      CHARACTER (len = 15) ::   fieldid
+      !!-----------------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8) ) THEN
+         CALL ctl_stop('lim_itd_me: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      IF( numit == nstart  )   CALL lim_itd_me_init   ! Initialization (first time-step only)
 
       IF(ln_ctl) THEN
@@ -210,20 +162,17 @@
       hi_max(jpl) = 999.99
 
-      Cp = 0.5* grav * (rau0-rhoic)*rhoic/rau0    ! proport const for PE
+      Cp = 0.5 * grav * (rau0-rhoic) * rhoic / rau0      ! proport const for PE
       CALL lim_itd_me_ridgeprep ! prepare ridging
 
-      ! conservation check
-      IF ( con_i) CALL lim_column_sum (jpl,   v_i, vt_i_init)
-
-      ! Initialize arrays.
-      DO jj = 1, jpj
+      IF( con_i)   CALL lim_column_sum( jpl, v_i, vt_i_init )      ! conservation check
+
+      DO jj = 1, jpj                                     ! Initialize arrays.
          DO ji = 1, jpi
-
-            msnow_mlt(ji,jj) = 0.0
-            esnow_mlt(ji,jj) = 0.0
-            dardg1dt(ji,jj)  = 0.0
-            dardg2dt(ji,jj)  = 0.0
-            dvirdgdt(ji,jj)  = 0.0
-            opening (ji,jj)  = 0.0
+            msnow_mlt(ji,jj) = 0._wp
+            esnow_mlt(ji,jj) = 0._wp
+            dardg1dt (ji,jj)  = 0._wp
+            dardg2dt (ji,jj)  = 0._wp
+            dvirdgdt (ji,jj)  = 0._wp
+            opening  (ji,jj)  = 0._wp
 
             !-----------------------------------------------------------------------------!
@@ -246,6 +195,5 @@
             !  (thick, newly ridged ice).
 
-            closing_net(ji,jj) = &
-               Cs*0.5*(Delta_i(ji,jj)-ABS(divu_i(ji,jj))) - MIN(divu_i(ji,jj),0.0)
+            closing_net(ji,jj) = Cs * 0.5 * ( Delta_i(ji,jj) - ABS( divu_i(ji,jj) ) ) - MIN( divu_i(ji,jj), 0._wp )
 
             ! 2.2 divu_adv
@@ -258,8 +206,7 @@
             ! to give asum = 1.0 after ridging.
 
-            divu_adv(ji,jj) = (1.0-asum(ji,jj)) / rdt_ice  ! asum found in ridgeprep
-
-            IF (divu_adv(ji,jj) .LT. 0.0) &
-               closing_net(ji,jj) = max(closing_net(ji,jj), -divu_adv(ji,jj))
+            divu_adv(ji,jj) = ( 1._wp - asum(ji,jj) ) / rdt_ice  ! asum found in ridgeprep
+
+            IF( divu_adv(ji,jj) < 0._wp )   closing_net(ji,jj) = MAX( closing_net(ji,jj), -divu_adv(ji,jj) )
 
             ! 2.3 opning
@@ -268,5 +215,4 @@
             ! asum = 1.0 after ridging.
             opning(ji,jj) = closing_net(ji,jj) + divu_adv(ji,jj)
-
          END DO
       END DO
@@ -275,7 +221,6 @@
       ! 3) Ridging iteration
       !-----------------------------------------------------------------------------!
-      niter = 1                 ! iteration counter
+      niter           = 1                 ! iteration counter
       iterate_ridging = 1
-
 
       DO WHILE ( iterate_ridging > 0 .AND. niter < nitermax )
@@ -315,10 +260,10 @@
             DO jj = 1, jpj
                DO ji = 1, jpi
-                  IF ( a_i(ji,jj,jl) .GT. epsi11 .AND. athorn(ji,jj,jl) .GT. 0.0 ) THEN
+                  IF ( a_i(ji,jj,jl) > epsi11 .AND. athorn(ji,jj,jl) > 0._wp )THEN
                      w1 = athorn(ji,jj,jl) * closing_gross(ji,jj) * rdt_ice
-                     IF ( w1 .GT. a_i(ji,jj,jl) ) THEN
+                     IF ( w1 > a_i(ji,jj,jl) ) THEN
                         tmpfac = a_i(ji,jj,jl) / w1
                         closing_gross(ji,jj) = closing_gross(ji,jj) * tmpfac
-                        opning(ji,jj) = opning(ji,jj) * tmpfac
+                        opning       (ji,jj) = opning       (ji,jj) * tmpfac
                      ENDIF
                   ENDIF
@@ -330,6 +275,5 @@
          !-----------------------------------------------------------------------------!
 
-         CALL lim_itd_me_ridgeshift (opning,    closing_gross, &
-            msnow_mlt, esnow_mlt)
+         CALL lim_itd_me_ridgeshift( opning, closing_gross, msnow_mlt, esnow_mlt )
 
          ! 3.4 Compute total area of ice plus open water after ridging.
@@ -348,16 +292,16 @@
             DO ji = 1, jpi
                IF (ABS(asum(ji,jj) - 1.0) .LT. epsi11) THEN
-                  closing_net(ji,jj) = 0.0 
-                  opning(ji,jj)      = 0.0
+                  closing_net(ji,jj) = 0._wp
+                  opning     (ji,jj) = 0._wp
                ELSE
                   iterate_ridging    = 1
-                  divu_adv(ji,jj)    = (1.0 - asum(ji,jj)) / rdt_ice
-                  closing_net(ji,jj) = MAX(0.0, -divu_adv(ji,jj))
-                  opning(ji,jj)      = MAX(0.0, divu_adv(ji,jj))
+                  divu_adv   (ji,jj) = (1._wp - asum(ji,jj)) / rdt_ice
+                  closing_net(ji,jj) = MAX( 0._wp, -divu_adv(ji,jj) )
+                  opning     (ji,jj) = MAX( 0._wp,  divu_adv(ji,jj) )
                ENDIF
             END DO
          END DO
 
-         IF( lk_mpp ) CALL mpp_max(iterate_ridging)
+         IF( lk_mpp )   CALL mpp_max( iterate_ridging )
 
          ! Repeat if necessary.
@@ -368,6 +312,6 @@
          niter = niter + 1
 
-         IF (iterate_ridging == 1) THEN
-            IF (niter .GT. nitermax) THEN
+         IF( iterate_ridging == 1 ) THEN
+            IF( niter .GT. nitermax ) THEN
                WRITE(numout,*) ' ALERTE : non-converging ridging scheme '
                WRITE(numout,*) ' niter, iterate_ridging ', niter, iterate_ridging
@@ -384,5 +328,5 @@
       ! Update fresh water and heat fluxes due to snow melt.
 
-      dti = 1.0/rdt_ice
+      dti = 1._wp / rdt_ice
 
       asum_error = .false. 
@@ -401,9 +345,6 @@
             ! 5) Heat, salt and freshwater fluxes
             !-----------------------------------------------------------------------------!
-            ! fresh water source for ocean
-            fmmec(ji,jj)      = fmmec(ji,jj)      + msnow_mlt(ji,jj)*dti  
-
-            ! heat sink for ocean
-            fhmec(ji,jj)      = fhmec(ji,jj)      + esnow_mlt(ji,jj)*dti
+            fmmec(ji,jj) = fmmec(ji,jj) + msnow_mlt(ji,jj) * dti     ! fresh water source for ocean
+            fhmec(ji,jj) = fhmec(ji,jj) + esnow_mlt(ji,jj) * dti     ! heat sink for ocean
 
          END DO
@@ -446,15 +387,14 @@
       !-----------------
 
-      d_u_ice_dyn(:,:) = u_ice(:,:) - old_u_ice(:,:)
-      d_v_ice_dyn(:,:) = v_ice(:,:) - old_v_ice(:,:)
-      d_a_i_trp(:,:,:)    = a_i(:,:,:)   - old_a_i(:,:,:)
-      d_v_s_trp(:,:,:)    = v_s(:,:,:)   - old_v_s(:,:,:)  
-      d_v_i_trp(:,:,:)    = v_i(:,:,:)   - old_v_i(:,:,:)   
-      d_e_s_trp(:,:,:,:)  = e_s(:,:,:,:) - old_e_s(:,:,:,:)  
-      d_e_i_trp(:,:,:,:)  = e_i(:,:,:,:) - old_e_i(:,:,:,:)
-      d_oa_i_trp(:,:,:)   = oa_i(:,:,:)  - old_oa_i(:,:,:)
-      d_smv_i_trp(:,:,:)   = 0.0
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) &
-         d_smv_i_trp(:,:,:)  = smv_i(:,:,:) - old_smv_i(:,:,:)
+      d_u_ice_dyn(:,:)     = u_ice(:,:)     - old_u_ice(:,:)
+      d_v_ice_dyn(:,:)     = v_ice(:,:)     - old_v_ice(:,:)
+      d_a_i_trp  (:,:,:)   = a_i  (:,:,:)   - old_a_i  (:,:,:)
+      d_v_s_trp  (:,:,:)   = v_s  (:,:,:)   - old_v_s  (:,:,:)  
+      d_v_i_trp  (:,:,:)   = v_i  (:,:,:)   - old_v_i  (:,:,:)   
+      d_e_s_trp  (:,:,:,:) = e_s  (:,:,:,:) - old_e_s  (:,:,:,:)  
+      d_e_i_trp  (:,:,:,:) = e_i  (:,:,:,:) - old_e_i  (:,:,:,:)
+      d_oa_i_trp (:,:,:)   = oa_i (:,:,:)   - old_oa_i (:,:,:)
+      d_smv_i_trp(:,:,:)   = 0._wp
+      IF(  num_sal == 2  .OR.  num_sal == 4  )   d_smv_i_trp(:,:,:)  = smv_i(:,:,:) - old_smv_i(:,:,:)
 
       IF(ln_ctl) THEN     ! Control print
@@ -503,6 +443,5 @@
       e_i(:,:,:,:)  = old_e_i(:,:,:,:)
       oa_i(:,:,:)   = old_oa_i(:,:,:)
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) & 
-         smv_i(:,:,:)  = old_smv_i(:,:,:)
+      IF(  num_sal == 2  .OR.  num_sal == 4  )   smv_i(:,:,:)  = old_smv_i(:,:,:)
 
       !----------------------------------------------------!
@@ -518,8 +457,8 @@
             DO jj = 1, jpj
                DO ji = 1, jpi
-                  IF ( ( old_v_i(ji,jj,jl) .LT. epsi06 ) .AND. &
-                     ( d_v_i_trp(ji,jj,jl) .GT. epsi06 ) ) THEN
+                  IF ( ( old_v_i(ji,jj,jl) < epsi06 ) .AND. &
+                     ( d_v_i_trp(ji,jj,jl) > epsi06 ) ) THEN
                      old_e_i(ji,jj,jk,jl)   = d_e_i_trp(ji,jj,jk,jl)
-                     d_e_i_trp(ji,jj,jk,jl) = 0.0
+                     d_e_i_trp(ji,jj,jk,jl) = 0._wp
                   ENDIF
                END DO
@@ -531,19 +470,18 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               IF ( ( old_v_i(ji,jj,jl) .LT. epsi06 ) .AND. &
-                  ( d_v_i_trp(ji,jj,jl) .GT. epsi06 ) ) THEN
+               IF ( ( old_v_i(ji,jj,jl) < epsi06 ) .AND. &
+                  ( d_v_i_trp(ji,jj,jl) > epsi06 ) ) THEN
                   old_v_i(ji,jj,jl)     = d_v_i_trp(ji,jj,jl)
-                  d_v_i_trp(ji,jj,jl)   = 0.0
+                  d_v_i_trp(ji,jj,jl)   = 0._wp
                   old_a_i(ji,jj,jl)     = d_a_i_trp(ji,jj,jl)
-                  d_a_i_trp(ji,jj,jl)   = 0.0
+                  d_a_i_trp(ji,jj,jl)   = 0._wp
                   old_v_s(ji,jj,jl)     = d_v_s_trp(ji,jj,jl)
-                  d_v_s_trp(ji,jj,jl)   = 0.0
+                  d_v_s_trp(ji,jj,jl)   = 0._wp
                   old_e_s(ji,jj,1,jl)   = d_e_s_trp(ji,jj,1,jl)
-                  d_e_s_trp(ji,jj,1,jl) = 0.0
+                  d_e_s_trp(ji,jj,1,jl) = 0._wp
                   old_oa_i(ji,jj,jl)    = d_oa_i_trp(ji,jj,jl)
-                  d_oa_i_trp(ji,jj,jl)  = 0.0
-                  IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) & 
-                     old_smv_i(ji,jj,jl)   = d_smv_i_trp(ji,jj,jl)
-                  d_smv_i_trp(ji,jj,jl) = 0.0
+                  d_oa_i_trp(ji,jj,jl)  = 0._wp
+                  IF(  num_sal == 2  .OR.  num_sal == 4  )   old_smv_i(ji,jj,jl)   = d_smv_i_trp(ji,jj,jl)
+                  d_smv_i_trp(ji,jj,jl) = 0._wp
                ENDIF
             END DO
@@ -551,54 +489,42 @@
       END DO
 
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8) )   CALL ctl_stop('lim_itd_me: failed to release workspace arrays')
+      !
    END SUBROUTINE lim_itd_me
 
-   !===============================================================================
-
-   SUBROUTINE lim_itd_me_icestrength (kstrngth) ! (subroutine 2/6)
-
+
+   SUBROUTINE lim_itd_me_icestrength( kstrngth )
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_me_icestrength ***
-      !! ** Purpose :
-      !!        This routine computes ice strength used in dynamics routines
-      !!                      of ice thickness
-      !!
-      !! ** Method  :
-      !!       Compute the strength of the ice pack, defined as the energy (J m-2) 
-      !! dissipated per unit area removed from the ice pack under compression,
-      !! and assumed proportional to the change in potential energy caused
-      !! by ridging. Note that only Hibler's formulation is stable and that
-      !! ice strength has to be smoothed
+      !!
+      !! ** Purpose :   computes ice strength used in dynamics routines of ice thickness
+      !!
+      !! ** Method  :   Compute the strength of the ice pack, defined as the energy (J m-2) 
+      !!              dissipated per unit area removed from the ice pack under compression,
+      !!              and assumed proportional to the change in potential energy caused
+      !!              by ridging. Note that only Hibler's formulation is stable and that
+      !!              ice strength has to be smoothed
       !!
       !! ** Inputs / Ouputs : kstrngth (what kind of ice strength we are using)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!                
       !!----------------------------------------------------------------------
-      !! * Arguments
-
-      INTEGER, INTENT(in) :: &
-         kstrngth    ! = 1 for Rothrock formulation, 0 for Hibler (1979)
-
-      INTEGER ::   &
-         ji,jj,    &         !: horizontal indices
-         jl,       &         !: thickness category index
-         ksmooth,  &         !: smoothing the resistance to deformation
-         numts_rm            !: number of time steps for the P smoothing
-
-      REAL(wp) ::  &  
-         hi,       &         !: ice thickness (m)
-         zw1,      &         !: temporary variable
-         zp,       &         !: temporary ice strength 
-         zdummy
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zworka              !: temporary array used here
+      USE wrk_nemo, ONLY: zworka => wrk_2d_1    ! 2D workspace
+      !
+      INTEGER, INTENT(in) ::   kstrngth    ! = 1 for Rothrock formulation, 0 for Hibler (1979)
+
+      INTEGER ::   ji,jj, jl   ! dummy loop indices
+      INTEGER ::   ksmooth     ! smoothing the resistance to deformation
+      INTEGER ::   numts_rm    ! number of time steps for the P smoothing
+
+      REAL(wp) ::   hi, zw1, zp, zdummy, zzc, z1_3   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('lim_itd_me_icestrength : requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       !------------------------------------------------------------------------------!
       ! 1) Initialize
       !------------------------------------------------------------------------------!
-      strength(:,:) = 0.0
+      strength(:,:) = 0._wp
 
       !------------------------------------------------------------------------------!
@@ -610,46 +536,37 @@
       ! 3) Rothrock(1975)'s method
       !------------------------------------------------------------------------------!
-      IF (kstrngth == 1) then
-
+      IF( kstrngth == 1 ) THEN
+         z1_3 = 1._wp / 3._wp
          DO jl = 1, jpl
             DO jj= 1, jpj
                DO ji = 1, jpi
-
-                  IF(     ( a_i(ji,jj,jl)    .GT. epsi11 )                     &
-                     .AND. ( athorn(ji,jj,jl) .GT. 0.0    ) ) THEN
+                  !
+                  IF(  a_i(ji,jj,jl)    > epsi11  .AND.     &
+                       athorn(ji,jj,jl) > 0._wp   ) THEN
                      hi = v_i(ji,jj,jl) / a_i(ji,jj,jl)
                      !----------------------------
                      ! PE loss from deforming ice
                      !----------------------------
-                     strength(ji,jj) = strength(ji,jj) - athorn(ji,jj,jl) *    &
-                        hi * hi
+                     strength(ji,jj) = strength(ji,jj) - athorn(ji,jj,jl) * hi * hi
 
                      !--------------------------
                      ! PE gain from rafting ice
                      !--------------------------
-                     strength(ji,jj) = strength(ji,jj) + 2.0 * araft(ji,jj,jl) &
-                        * hi * hi
+                     strength(ji,jj) = strength(ji,jj) + 2._wp * araft(ji,jj,jl) * hi * hi
 
                      !----------------------------
                      ! PE gain from ridging ice
                      !----------------------------
-                     strength(ji,jj) = strength(ji,jj)                         &
-                        + aridge(ji,jj,jl)/krdg(ji,jj,jl)                         &
-                        * 1.0/3.0 * (hrmax(ji,jj,jl)**3 - hrmin(ji,jj,jl)**3)     &
-                        / (hrmax(ji,jj,jl)-hrmin(ji,jj,jl))                      
+                     strength(ji,jj) = strength(ji,jj) + aridge(ji,jj,jl)/krdg(ji,jj,jl)     &
+                        * z1_3 * (hrmax(ji,jj,jl)**3 - hrmin(ji,jj,jl)**3) / ( hrmax(ji,jj,jl)-hrmin(ji,jj,jl) )   
+!!gm Optimization:  (a**3-b**3)/(a-b) = a*a+ab+b*b   ==> less costly operations even if a**3 is replaced by a*a*a...                    
                   ENDIF            ! aicen > epsi11
-
+                  !
                END DO ! ji
             END DO !jj
          END DO !jl
 
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               strength(ji,jj) = Cf * Cp * strength(ji,jj) / aksum(ji,jj) 
-               ! Cp = (g/2)*(rhow-rhoi)*(rhoi/rhow)
-               ! Cf accounts for frictional dissipation
-
-            END DO              ! j
-         END DO                 ! i
+         zzc = Cf * Cp     ! where Cp = (g/2)*(rhow-rhoi)*(rhoi/rhow) and Cf accounts for frictional dissipation
+         strength(:,:) = zzc * strength(:,:) / aksum(:,:)
 
          ksmooth = 1
@@ -659,13 +576,9 @@
          !------------------------------------------------------------------------------!
       ELSE                      ! kstrngth ne 1:  Hibler (1979) form
-
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               strength(ji,jj) = Pstar*vt_i(ji,jj)*exp(-C_rhg*(1.0-at_i(ji,jj)))
-            END DO              ! j
-         END DO                 ! i
-
+         !
+         strength(:,:) = Pstar * vt_i(:,:) * EXP( - C_rhg * ( 1._wp - at_i(:,:) )  )
+         !
          ksmooth = 1
-
+         !
       ENDIF                     ! kstrngth
 
@@ -676,5 +589,5 @@
       ! CAN BE REMOVED
       !
-      IF ( brinstren_swi .EQ. 1 ) THEN
+      IF ( brinstren_swi == 1 ) THEN
 
          DO jj = 1, jpj
@@ -699,5 +612,5 @@
       ! Spatial smoothing
       !-------------------
-      IF ( ksmooth .EQ. 1 ) THEN
+      IF ( ksmooth == 1 ) THEN
 
          CALL lbc_lnk( strength, 'T', 1. )
@@ -713,6 +626,5 @@
                      + strength(ji,jj+1) * tms(ji,jj+1)    
 
-                  zw1 = 4.0 + tms(ji-1,jj) + tms(ji+1,jj)            &
-                     + tms(ji,jj-1) + tms(ji,jj+1)
+                  zw1 = 4.0 + tms(ji-1,jj) + tms(ji+1,jj) + tms(ji,jj-1) + tms(ji,jj+1)
                   zworka(ji,jj) = zworka(ji,jj) / zw1
                ELSE
@@ -734,10 +646,10 @@
       ! Temporal smoothing
       !--------------------
-      IF ( numit .EQ. nit000 + nn_fsbc - 1 ) THEN
+      IF ( numit == nit000 + nn_fsbc - 1 ) THEN
          strp1(:,:) = 0.0            
          strp2(:,:) = 0.0            
       ENDIF
 
-      IF ( ksmooth .EQ. 2 ) THEN
+      IF ( ksmooth == 2 ) THEN
 
 
@@ -746,11 +658,9 @@
          DO jj = 1, jpj - 1
             DO ji = 1, jpi - 1
-               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) .GT. epsi11) THEN ! ice is
-                  ! present
+               IF ( ( asum(ji,jj) - ato_i(ji,jj) ) .GT. epsi11) THEN       ! ice is present
                   numts_rm = 1 ! number of time steps for the running mean
                   IF ( strp1(ji,jj) .GT. 0.0 ) numts_rm = numts_rm + 1
                   IF ( strp2(ji,jj) .GT. 0.0 ) numts_rm = numts_rm + 1
-                  zp = ( strength(ji,jj) + strp1(ji,jj) + strp2(ji,jj) ) /   &
-                     numts_rm
+                  zp = ( strength(ji,jj) + strp1(ji,jj) + strp2(ji,jj) ) / numts_rm
                   strp2(ji,jj) = strp1(ji,jj)
                   strp1(ji,jj) = strength(ji,jj)
@@ -763,52 +673,28 @@
       ENDIF ! ksmooth
 
-      ! Boundary conditions
-      CALL lbc_lnk( strength, 'T', 1. )
-
+      CALL lbc_lnk( strength, 'T', 1. )      ! Boundary conditions
+
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('lim_itd_me_icestrength: failed to release workspace array')
+      !
    END SUBROUTINE lim_itd_me_icestrength
 
-   !===============================================================================
-
-   SUBROUTINE lim_itd_me_ridgeprep !(subroutine 3/6)
-
+
+   SUBROUTINE lim_itd_me_ridgeprep
       !!---------------------------------------------------------------------!
       !!                ***  ROUTINE lim_itd_me_ridgeprep ***
-      !! ** Purpose :
-      !!         preparation for ridging and strength calculations
-      !!
-      !! ** Method  :
-      !! Compute the thickness distribution of the ice and open water 
-      !! participating in ridging and of the resulting ridges.
-      !!
-      !! ** Arguments :
-      !!
-      !! ** External : 
-      !!
+      !!
+      !! ** Purpose :   preparation for ridging and strength calculations
+      !!
+      !! ** Method  :   Compute the thickness distribution of the ice and open water 
+      !!              participating in ridging and of the resulting ridges.
       !!---------------------------------------------------------------------!
-      !! * Arguments
-
-      INTEGER :: &
-         ji,jj,  &          ! horizontal indices
-         jl,     &          ! thickness category index
-         krdg_index         ! which participation function using
-
-      REAL(wp)            ::     &
-         Gstari, &          !  = 1.0/Gstar    
-         astari             !  = 1.0/astar
-
-      REAL(wp), DIMENSION(jpi,jpj,-1:jpl) ::    &
-         Gsum             ! Gsum(n) = sum of areas in categories 0 to n
-
-      REAL(wp) ::    &
-         hi,         &    ! ice thickness for each cat (m)
-         hrmean           ! mean ridge thickness (m)
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zworka            ! temporary array used here
-
-      REAL(wp)            ::     &
-         zdummy,                 &
-         epsi06 = 1.0e-6
-
+      INTEGER ::   ji,jj, jl    ! dummy loop indices
+      INTEGER ::   krdg_index   ! 
+
+      REAL(wp) ::   Gstari, astari, hi, hrmean, zdummy   ! local scalar
+
+      REAL(wp), DIMENSION(jpi,jpj,-1:jpl) ::   Gsum   ! Gsum(n) = sum of areas in categories 0 to n
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   zworka            ! temporary array used here
       !------------------------------------------------------------------------------!
 
@@ -841,12 +727,10 @@
       ! initial value (in h = 0) equals open water area
 
-      Gsum(:,:,-1) = 0.0
+      Gsum(:,:,-1) = 0._wp
 
       DO jj = 1, jpj
          DO ji = 1, jpi
-            IF (ato_i(ji,jj) .GT. epsi11) THEN
-               Gsum(ji,jj,0) = ato_i(ji,jj)
-            ELSE
-               Gsum(ji,jj,0) = 0.0
+            IF( ato_i(ji,jj) > epsi11 ) THEN   ;   Gsum(ji,jj,0) = ato_i(ji,jj)
+            ELSE                               ;   Gsum(ji,jj,0) = 0._wp
             ENDIF
          END DO
@@ -857,8 +741,6 @@
          DO jj = 1, jpj 
             DO ji = 1, jpi
-               IF ( a_i(ji,jj,jl) .GT. epsi11 ) THEN
-                  Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1) + a_i(ji,jj,jl)
-               ELSE
-                  Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1)
+               IF( a_i(ji,jj,jl) .GT. epsi11 ) THEN   ;   Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1) + a_i(ji,jj,jl)
+               ELSE                                   ;   Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1)
                ENDIF
             END DO
@@ -867,16 +749,7 @@
 
       ! Normalize the cumulative distribution to 1
-      DO jj = 1, jpj 
-         DO ji = 1, jpi
-            zworka(ji,jj) = 1.0 / Gsum(ji,jj,jpl)
-         END DO
-      END DO
-
+      zworka(:,:) = 1._wp / Gsum(:,:,jpl)
       DO jl = 0, jpl
-         DO jj = 1, jpj 
-            DO ji = 1, jpi
-               Gsum(ji,jj,jl) = Gsum(ji,jj,jl) * zworka(ji,jj)
-            END DO
-         END DO
+         Gsum(:,:,jl) = Gsum(:,:,jl) * zworka(:,:)
       END DO
 
@@ -895,11 +768,9 @@
       krdg_index = 1
 
-      IF ( krdg_index .EQ. 0 ) THEN
-
-         !--- Linear formulation (Thorndike et al., 1975)
-         DO jl = 0, ice_cat_bounds(1,2) ! only undeformed ice participates
+      IF( krdg_index == 0 ) THEN       !--- Linear formulation (Thorndike et al., 1975)
+         DO jl = 0, ice_cat_bounds(1,2)       ! only undeformed ice participates
             DO jj = 1, jpj 
                DO ji = 1, jpi
-                  IF (Gsum(ji,jj,jl) < Gstar) THEN
+                  IF( Gsum(ji,jj,jl) < Gstar) THEN
                      athorn(ji,jj,jl) = Gstari * (Gsum(ji,jj,jl)-Gsum(ji,jj,jl-1)) * &
                         (2.0 - (Gsum(ji,jj,jl-1)+Gsum(ji,jj,jl))*Gstari)
@@ -914,44 +785,28 @@
          END DO ! jl 
 
-      ELSE ! krdg_index = 1
-
-         !--- Exponential, more stable formulation (Lipscomb et al, 2007)
-         ! precompute exponential terms using Gsum as a work array
-         zdummy = 1.0 / (1.0-EXP(-astari))
+      ELSE                             !--- Exponential, more stable formulation (Lipscomb et al, 2007)
+         !                        
+         zdummy = 1._wp / ( 1._wp - EXP(-astari) )        ! precompute exponential terms using Gsum as a work array
 
          DO jl = -1, jpl
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  Gsum(ji,jj,jl) = EXP(-Gsum(ji,jj,jl)*astari)*zdummy
-               END DO !ji
-            END DO !jj
+            Gsum(:,:,jl) = EXP( -Gsum(:,:,jl) * astari ) * zdummy
          END DO !jl
-
-         ! compute athorn
          DO jl = 0, ice_cat_bounds(1,2)
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  athorn(ji,jj,jl) = Gsum(ji,jj,jl-1) - Gsum(ji,jj,jl)
-               END DO !ji
-            END DO ! jj
-         END DO !jl
-
+             athorn(:,:,jl) = Gsum(:,:,jl-1) - Gsum(:,:,jl)
+         END DO
+         !
       ENDIF ! krdg_index
 
-      ! Ridging and rafting ice participation functions
-      IF ( raftswi .EQ. 1 ) THEN
-
+      IF( raftswi == 1 ) THEN      ! Ridging and rafting ice participation functions
+         !
          DO jl = 1, jpl
             DO jj = 1, jpj 
                DO ji = 1, jpi
-                  IF ( athorn(ji,jj,jl) .GT. 0.0 ) THEN
-                     aridge(ji,jj,jl) = ( TANH ( Craft * ( ht_i(ji,jj,jl) - &
-                        hparmeter ) ) + 1.0 ) / 2.0 * & 
-                        athorn(ji,jj,jl)
-                     araft (ji,jj,jl) = ( TANH ( - Craft * ( ht_i(ji,jj,jl) - &
-                        hparmeter ) ) + 1.0 ) / 2.0 * &
-                        athorn(ji,jj,jl)
-                     IF ( araft(ji,jj,jl) .LT. epsi06 ) araft(ji,jj,jl)  = 0.0
-                     aridge(ji,jj,jl) = MAX( athorn(ji,jj,jl) - araft(ji,jj,jl), 0.0)
+                  IF ( athorn(ji,jj,jl) .GT. 0._wp ) THEN
+!!gm  TANH( -X ) = - TANH( X )  so can be computed only 1 time....
+                     aridge(ji,jj,jl) = ( TANH (  Craft * ( ht_i(ji,jj,jl) - hparmeter ) ) + 1.0 ) * 0.5 * athorn(ji,jj,jl)
+                     araft (ji,jj,jl) = ( TANH ( -Craft * ( ht_i(ji,jj,jl) - hparmeter ) ) + 1.0 ) * 0.5 * athorn(ji,jj,jl)
+                     IF ( araft(ji,jj,jl) < epsi06 )   araft(ji,jj,jl)  = 0._wp
+                     aridge(ji,jj,jl) = MAX( athorn(ji,jj,jl) - araft(ji,jj,jl), 0.0 )
                   ENDIF ! athorn
                END DO ! ji
@@ -960,16 +815,12 @@
 
       ELSE  ! raftswi = 0
-
+         !
          DO jl = 1, jpl
-            DO jj = 1, jpj 
-               DO ji = 1, jpi
-                  aridge(ji,jj,jl) = 1.0*athorn(ji,jj,jl)
-               END DO
-            END DO
-         END DO
-
+            aridge(:,:,jl) = athorn(:,:,jl)
+         END DO
+         !
       ENDIF
 
-      IF ( raftswi .EQ. 1 ) THEN
+      IF ( raftswi == 1 ) THEN
 
          IF( MAXVAL(aridge + araft - athorn(:,:,1:jpl)) .GT. epsi11 ) THEN
@@ -1043,146 +894,79 @@
 
       ! Normalization factor : aksum, ensures mass conservation
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            aksum(ji,jj) = athorn(ji,jj,0)
-         END DO
+      aksum(:,:) = athorn(ji,jj,0)
+      DO jl = 1, jpl 
+         aksum(:,:)    = aksum(:,:) + aridge(:,:,jl) * ( 1._wp - 1._wp / krdg(:,:,jl) )    &
+            &                       + araft (:,:,jl) * ( 1._wp - 1._wp / kraft        )
       END DO
-
-      DO jl = 1, jpl 
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               aksum(ji,jj)    = aksum(ji,jj)                          &
-                  + aridge(ji,jj,jl) * (1.0 - 1.0/krdg(ji,jj,jl))    &
-                  + araft (ji,jj,jl) * (1.0 - 1.0/kraft)
-            END DO
-         END DO
-      END DO
-
+      !
    END SUBROUTINE lim_itd_me_ridgeprep
 
-   !===============================================================================
-
-   SUBROUTINE lim_itd_me_ridgeshift(opning,    closing_gross,       &
-      msnow_mlt, esnow_mlt) ! (subroutine 4/6)
-
-      !!-----------------------------------------------------------------------------
+
+   SUBROUTINE lim_itd_me_ridgeshift( opning, closing_gross, msnow_mlt, esnow_mlt )
+      !!----------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_me_icestrength ***
-      !! ** Purpose :
-      !!        This routine shift ridging ice among thickness categories
-      !!                      of ice thickness
-      !!
-      !! ** Method  :
-      !! Remove area, volume, and energy from each ridging category
-      !! and add to thicker ice categories.
-      !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : 
-      !!
-      !! ** External : 
-      !!
-
-      REAL (wp), DIMENSION(jpi,jpj), INTENT(IN)   :: &
-         opning,         & ! rate of opening due to divergence/shear
-         closing_gross     ! rate at which area removed, not counting
-      ! area of new ridges
-
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: &
-         msnow_mlt,     & ! mass of snow added to ocean (kg m-2)
-         esnow_mlt        ! energy needed to melt snow in ocean (J m-2)
-
-      INTEGER :: &
-         ji, jj, &         ! horizontal indices
-         jl, jl1, jl2, &   ! thickness category indices
-         jk,           &   ! ice layer index
-         ij,           &   ! horizontal index, combines i and j loops
-         icells            ! number of cells with aicen > puny
-
-      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) :: &
-         indxi, indxj      ! compressed indices
-
-      REAL(wp), DIMENSION(jpi,jpj) ::          &
-         vice_init, vice_final, &  ! ice volume summed over categories
-         eice_init, eice_final     ! ice energy summed over layers
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::      &
-         aicen_init,            &  ! ice area before ridging
-         vicen_init,            &  ! ice volume before ridging
-         vsnon_init,            &  ! snow volume before ridging
-         esnon_init,            &  ! snow energy before ridging
-         smv_i_init,            &  ! ice salinity before ridging
-         oa_i_init                 ! ice age before ridging
-
-      REAL(wp), DIMENSION(jpi,jpj,jkmax,jpl) :: &
-         eicen_init        ! ice energy before ridging
-
-      REAL(wp), DIMENSION(jpi,jpj) ::           &
-         afrac      , &     ! fraction of category area ridged
-         ardg1      , &     ! area of ice ridged
-         ardg2      , &     ! area of new ridges
-         vsrdg      , &     ! snow volume of ridging ice
-         esrdg      , &     ! snow energy of ridging ice
-         oirdg1     , &     ! areal age content of ridged ice
-         oirdg2     , &     ! areal age content of ridging ice
-         dhr        , &     ! hrmax - hrmin
-         dhr2       , &     ! hrmax^2 - hrmin^2
-         fvol               ! fraction of new ridge volume going to n2
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         vrdg1      , &     ! volume of ice ridged
-         vrdg2      , &     ! volume of new ridges
-         vsw        , &     ! volume of seawater trapped into ridges
-         srdg1      , &     ! sal*volume of ice ridged
-         srdg2      , &     ! sal*volume of new ridges
-         smsw               ! sal*volume of water trapped into ridges
-
-      REAL(wp), DIMENSION(jpi,jpj) ::           &
-         afrft      , &     ! fraction of category area rafted
-         arft1      , &     ! area of ice rafted
-         arft2      , &     ! area of new rafted zone
-         virft      , &     ! ice volume of rafting ice
-         vsrft      , &     ! snow volume of rafting ice
-         esrft      , &     ! snow energy of rafting ice
-         smrft      , &     ! salinity of rafting ice
-         oirft1     , &     ! areal age content of rafted ice
-         oirft2             ! areal age content of rafting ice
-
-      REAL(wp), DIMENSION(jpi,jpj,jkmax) ::    &
-         eirft      , &     ! ice energy of rafting ice
-         erdg1      , &     ! enth*volume of ice ridged
-         erdg2      , &     ! enth*volume of new ridges
-         ersw               ! enth of water trapped into ridges
-
-      REAL(wp) ::     &
-         hL, hR     , &    ! left and right limits of integration
-         farea      , &    ! fraction of new ridge area going to n2
-         zdummy     , &    ! dummy argument
-         zdummy0    , &    ! dummy argument
-         ztmelts           ! ice melting point
-
-      REAL(wp) ::   zsrdg2
-
-      CHARACTER (len=80) :: &
-         fieldid           ! field identifier
-
-      LOGICAL, PARAMETER :: &
-         l_conservation_check = .true.  ! if true, check conservation 
-      ! (useful for debugging)
-      LOGICAL ::         &
-         neg_ato_i     , &  ! flag for ato_i(i,j) < -puny
-         large_afrac   , &  ! flag for afrac > 1
-         large_afrft        ! flag for afrac > 1
-
-      REAL(wp) ::        &
-         zeps          , &
-         epsi10        , &
-         zindb              ! switch for the presence of ridge poros or not
-
-      !----------------------------------------------------------------------------
+      !!
+      !! ** Purpose :   shift ridging ice among thickness categories of ice thickness
+      !!
+      !! ** Method  :   Remove area, volume, and energy from each ridging category
+      !!              and add to thicker ice categories.
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   opning         ! rate of opening due to divergence/shear
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   closing_gross  ! rate at which area removed, excluding area of new ridges
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   msnow_mlt      ! mass of snow added to ocean (kg m-2)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   esnow_mlt      ! energy needed to melt snow in ocean (J m-2)
+      !
+      CHARACTER (len=80) ::   fieldid   ! field identifier
+      LOGICAL, PARAMETER ::   l_conservation_check = .true.  ! if true, check conservation (useful for debugging)
+      !
+      LOGICAL ::   neg_ato_i      ! flag for ato_i(i,j) < -puny
+      LOGICAL ::   large_afrac    ! flag for afrac > 1
+      LOGICAL ::   large_afrft    ! flag for afrac > 1
+      INTEGER ::   ji, jj, jl, jl1, jl2, jk   ! dummy loop indices
+      INTEGER ::   ij                ! horizontal index, combines i and j loops
+      INTEGER ::   icells            ! number of cells with aicen > puny
+      REAL(wp) ::   zeps, zindb, zsrdg2   ! local scalar
+      REAL(wp) ::   hL, hR, farea, zdummy, zdummy0, ztmelts    ! left and right limits of integration
+
+      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) ::   indxi, indxj   ! compressed indices
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   vice_init, vice_final   ! ice volume summed over categories
+      REAL(wp), DIMENSION(jpi,jpj) ::   eice_init, eice_final   ! ice energy summed over layers
+
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   aicen_init, vicen_init   ! ice  area    & volume before ridging
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   vsnon_init, esnon_init   ! snow volume  & energy before ridging
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   smv_i_init, oa_i_init    ! ice salinity & age    before ridging
+
+      REAL(wp), DIMENSION(jpi,jpj,jkmax,jpl) ::   eicen_init        ! ice energy before ridging
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   afrac , fvol     ! fraction of category area ridged & new ridge volume going to n2
+      REAL(wp), DIMENSION(jpi,jpj) ::   ardg1 , ardg2    ! area of ice ridged & new ridges
+      REAL(wp), DIMENSION(jpi,jpj) ::   vsrdg , esrdg    ! snow volume & energy of ridging ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   oirdg1, oirdg2   ! areal age content of ridged & rifging ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   dhr   , dhr2     ! hrmax - hrmin  &  hrmax^2 - hrmin^2
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   vrdg1   ! volume of ice ridged
+      REAL(wp), DIMENSION(jpi,jpj) ::   vrdg2   ! volume of new ridges
+      REAL(wp), DIMENSION(jpi,jpj) ::   vsw     ! volume of seawater trapped into ridges
+      REAL(wp), DIMENSION(jpi,jpj) ::   srdg1   ! sal*volume of ice ridged
+      REAL(wp), DIMENSION(jpi,jpj) ::   srdg2   ! sal*volume of new ridges
+      REAL(wp), DIMENSION(jpi,jpj) ::   smsw    ! sal*volume of water trapped into ridges
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   afrft            ! fraction of category area rafted
+      REAL(wp), DIMENSION(jpi,jpj) ::   arft1 , arft2    ! area of ice rafted and new rafted zone
+      REAL(wp), DIMENSION(jpi,jpj) ::   virft , vsrft    ! ice & snow volume of rafting ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   esrft , smrft    ! snow energy & salinity of rafting ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   oirft1, oirft2   ! areal age content of rafted ice & rafting ice
+
+      REAL(wp), DIMENSION(jpi,jpj,jkmax) ::   eirft      ! ice energy of rafting ice
+      REAL(wp), DIMENSION(jpi,jpj,jkmax) ::   erdg1      ! enth*volume of ice ridged
+      REAL(wp), DIMENSION(jpi,jpj,jkmax) ::   erdg2      ! enth*volume of new ridges
+      REAL(wp), DIMENSION(jpi,jpj,jkmax) ::   ersw       ! enth of water trapped into ridges
+   !!----------------------------------------------------------------------
 
       ! Conservation check
-      eice_init(:,:) = 0.0 
-
-      IF ( con_i ) THEN
+      eice_init(:,:) = 0._wp
+
+      IF( con_i ) THEN
          CALL lim_column_sum (jpl,   v_i, vice_init )
          WRITE(numout,*) ' vice_init  : ', vice_init(jiindx,jjindx)
@@ -1191,6 +975,5 @@
       ENDIF
 
-      zeps   = 1.0d-20
-      epsi10 = 1.0d-10
+      zeps   = 1.e-20_wp
 
       !-------------------------------------------------------------------------------
@@ -1202,11 +985,10 @@
       DO jj = 1, jpj
          DO ji = 1, jpi
-            ato_i(ji,jj) = ato_i(ji,jj)                                   &
-               - athorn(ji,jj,0)*closing_gross(ji,jj)*rdt_ice        &
-               + opning(ji,jj)*rdt_ice
-            IF (ato_i(ji,jj) .LT. -epsi11) THEN
-               neg_ato_i = .true.
-            ELSEIF (ato_i(ji,jj) .LT. 0.0) THEN    ! roundoff error
-               ato_i(ji,jj) = 0.0
+            ato_i(ji,jj) = ato_i(ji,jj) - athorn(ji,jj,0) * closing_gross(ji,jj) * rdt_ice        &
+               &                        + opning(ji,jj)                          * rdt_ice
+            IF( ato_i(ji,jj) < -epsi11 ) THEN
+               neg_ato_i = .TRUE.
+            ELSEIF( ato_i(ji,jj) < 0._wp ) THEN    ! roundoff error
+               ato_i(ji,jj) = 0._wp
             ENDIF
          END DO !jj
@@ -1214,15 +996,15 @@
 
       ! if negative open water area alert it
-      IF (neg_ato_i) THEN       ! there is a bug
+      IF( neg_ato_i ) THEN       ! there is a bug
          DO jj = 1, jpj 
             DO ji = 1, jpi
-               IF (ato_i(ji,jj) .LT. -epsi11) THEN 
+               IF( ato_i(ji,jj) < -epsi11 ) THEN 
                   WRITE(numout,*) ''  
                   WRITE(numout,*) 'Ridging error: ato_i < 0'
                   WRITE(numout,*) 'ato_i : ', ato_i(ji,jj)
                ENDIF               ! ato_i < -epsi11
-            END DO              ! ji
-         END DO                 ! jj
-      ENDIF                     ! neg_ato_i
+            END DO
+         END DO
+      ENDIF
 
       !-----------------------------------------------------------------
@@ -1231,14 +1013,10 @@
 
       DO jl = 1, jpl
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               aicen_init(ji,jj,jl) = a_i(ji,jj,jl)
-               vicen_init(ji,jj,jl) = v_i(ji,jj,jl)
-               vsnon_init(ji,jj,jl) = v_s(ji,jj,jl)
-
-               smv_i_init(ji,jj,jl) = smv_i(ji,jj,jl)
-               oa_i_init (ji,jj,jl) = oa_i(ji,jj,jl)
-            END DO !ji
-         END DO ! jj
+         aicen_init(:,:,jl) = a_i(:,:,jl)
+         vicen_init(:,:,jl) = v_i(:,:,jl)
+         vsnon_init(:,:,jl) = v_s(:,:,jl)
+         !
+         smv_i_init(:,:,jl) = smv_i(:,:,jl)
+         oa_i_init (:,:,jl) = oa_i (:,:,jl)
       END DO !jl
 
@@ -1247,11 +1025,7 @@
       DO jl = 1, jpl  
          DO jk = 1, nlay_i
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  eicen_init(ji,jj,jk,jl) = e_i(ji,jj,jk,jl)
-               END DO !ji
-            END DO !jj
-         END DO !jk
-      END DO !jl
+            eicen_init(:,:,jk,jl) = e_i(:,:,jk,jl)
+         END DO
+      END DO
 
       !
@@ -1324,6 +1098,5 @@
             !     / rafting category n1.
             !--------------------------------------------------------------------------
-            vrdg1(ji,jj) = vicen_init(ji,jj,jl1) * afrac(ji,jj) /             &
-               ( 1.0 + ridge_por )
+            vrdg1(ji,jj) = vicen_init(ji,jj,jl1) * afrac(ji,jj) / ( 1._wp + ridge_por )
             vrdg2(ji,jj) = vrdg1(ji,jj) * ( 1. + ridge_por )
             vsw  (ji,jj) = vrdg1(ji,jj) * ridge_por
@@ -1331,6 +1104,5 @@
             vsrdg(ji,jj) = vsnon_init(ji,jj,jl1) * afrac(ji,jj)
             esrdg(ji,jj) = esnon_init(ji,jj,jl1) * afrac(ji,jj)
-            srdg1(ji,jj) = smv_i_init(ji,jj,jl1) * afrac(ji,jj) /            &
-               ( 1. + ridge_por )
+            srdg1(ji,jj) = smv_i_init(ji,jj,jl1) * afrac(ji,jj) / ( 1._wp + ridge_por )
             srdg2(ji,jj) = smv_i_init(ji,jj,jl1) * afrac(ji,jj)
 
@@ -1371,10 +1143,10 @@
             !           ij looping 1-icells
 
-            dardg1dt(ji,jj) = dardg1dt(ji,jj) + ardg1(ji,jj) + arft1(ji,jj)
-            dardg2dt(ji,jj) = dardg2dt(ji,jj) + ardg2(ji,jj) + arft2(ji,jj)
+            dardg1dt   (ji,jj) = dardg1dt(ji,jj) + ardg1(ji,jj) + arft1(ji,jj)
+            dardg2dt   (ji,jj) = dardg2dt(ji,jj) + ardg2(ji,jj) + arft2(ji,jj)
             diag_dyn_gr(ji,jj) = diag_dyn_gr(ji,jj) + ( vrdg2(ji,jj) + virft(ji,jj) ) / rdt_ice
-            opening(ji,jj)  = opening (ji,jj) + opning(ji,jj)*rdt_ice
-
-            IF (con_i) vice_init(ji,jj) = vice_init(ji,jj) + vrdg2(ji,jj) - vrdg1(ji,jj)
+            opening    (ji,jj) = opening (ji,jj) + opning(ji,jj)*rdt_ice
+
+            IF( con_i )   vice_init(ji,jj) = vice_init(ji,jj) + vrdg2(ji,jj) - vrdg1(ji,jj)
 
             !------------------------------------------            
@@ -1390,13 +1162,9 @@
             !           ij looping 1-icells
 
-            msnow_mlt(ji,jj) = msnow_mlt(ji,jj)                  &
-               + rhosn*vsrdg(ji,jj)*(1.0-fsnowrdg)   &
-                                !rafting included
-               + rhosn*vsrft(ji,jj)*(1.0-fsnowrft)
-
-            esnow_mlt(ji,jj) = esnow_mlt(ji,jj)                  &
-               + esrdg(ji,jj)*(1.0-fsnowrdg)         &
-                                !rafting included
-               + esrft(ji,jj)*(1.0-fsnowrft)          
+            msnow_mlt(ji,jj) = msnow_mlt(ji,jj) + rhosn*vsrdg(ji,jj)*(1.0-fsnowrdg)   &   ! rafting included
+               &                                + rhosn*vsrft(ji,jj)*(1.0-fsnowrft)
+
+            esnow_mlt(ji,jj) = esnow_mlt(ji,jj) + esrdg(ji,jj)*(1.0-fsnowrdg)         &   !rafting included
+               &                                + esrft(ji,jj)*(1.0-fsnowrft)          
 
             !-----------------------------------------------------------------
@@ -1409,6 +1177,5 @@
 
             dhr(ji,jj)  = hrmax(ji,jj,jl1) - hrmin(ji,jj,jl1)
-            dhr2(ji,jj) = hrmax(ji,jj,jl1) * hrmax(ji,jj,jl1)    &
-               - hrmin(ji,jj,jl1)   * hrmin(ji,jj,jl1)
+            dhr2(ji,jj) = hrmax(ji,jj,jl1) * hrmax(ji,jj,jl1) - hrmin(ji,jj,jl1) * hrmin(ji,jj,jl1)
 
 
@@ -1425,10 +1192,7 @@
                jj = indxj(ij)
                ! heat content of ridged ice
-               erdg1(ji,jj,jk)      = eicen_init(ji,jj,jk,jl1) * afrac(ji,jj) / & 
-                  ( 1.0 + ridge_por ) 
+               erdg1(ji,jj,jk)      = eicen_init(ji,jj,jk,jl1) * afrac(ji,jj) / ( 1._wp + ridge_por ) 
                eirft(ji,jj,jk)      = eicen_init(ji,jj,jk,jl1) * afrft(ji,jj)
-               e_i(ji,jj,jk,jl1)    = e_i(ji,jj,jk,jl1)             &
-                  - erdg1(ji,jj,jk)        &
-                  - eirft(ji,jj,jk)
+               e_i  (ji,jj,jk,jl1)  = e_i(ji,jj,jk,jl1) - erdg1(ji,jj,jk) - eirft(ji,jj,jk)
                ! sea water heat content
                ztmelts          = - tmut * sss_m(ji,jj) + rtt
@@ -1437,7 +1201,6 @@
 
                ! corrected sea water salinity
-               zindb  = MAX( 0.0, SIGN( 1.0, vsw(ji,jj) - zeps ) )
-               zdummy = zindb * ( srdg1(ji,jj) - srdg2(ji,jj) ) / &
-                  MAX( ridge_por * vsw(ji,jj), zeps )
+               zindb  = MAX( 0._wp , SIGN( 1._wp , vsw(ji,jj) - zeps ) )
+               zdummy = zindb * ( srdg1(ji,jj) - srdg2(ji,jj) ) / MAX( ridge_por * vsw(ji,jj), zeps )
 
                ztmelts          = - tmut * zdummy + rtt
@@ -1445,14 +1208,11 @@
 
                ! heat flux
-               fheat_rpo(ji,jj) = fheat_rpo(ji,jj) + ( ersw(ji,jj,jk) - zdummy0 ) / &
-                  rdt_ice
+               fheat_rpo(ji,jj) = fheat_rpo(ji,jj) + ( ersw(ji,jj,jk) - zdummy0 ) / rdt_ice
 
                ! Correct dimensions to avoid big values
-               ersw(ji,jj,jk)   = ersw(ji,jj,jk) / 1.0d+09
+               ersw(ji,jj,jk)   = ersw(ji,jj,jk) * 1.e-09
 
                ! Mutliply by ice volume, and divide by number of layers to get heat content in 10^9 J
-               ersw(ji,jj,jk)   = ersw(ji,jj,jk) * &
-                  area(ji,jj) * vsw(ji,jj) / &
-                  nlay_i
+               ersw (ji,jj,jk)  = ersw(ji,jj,jk) * area(ji,jj) * vsw(ji,jj) / nlay_i
 
                erdg2(ji,jj,jk)  = erdg1(ji,jj,jk) + ersw(ji,jj,jk)
@@ -1461,5 +1221,5 @@
 
 
-         IF ( con_i ) THEN
+         IF( con_i ) THEN
             DO jk = 1, nlay_i
 !CDIR NODEP
@@ -1467,36 +1227,33 @@
                   ji = indxi(ij)
                   jj = indxj(ij)
-                  eice_init(ji,jj) = eice_init(ji,jj) + erdg2(ji,jj,jk) - &
-                     erdg1(ji,jj,jk)
+                  eice_init(ji,jj) = eice_init(ji,jj) + erdg2(ji,jj,jk) - erdg1(ji,jj,jk)
                END DO ! ij
             END DO !jk
          ENDIF
 
-         IF (large_afrac) THEN  ! there is a bug
+         IF( large_afrac ) THEN   ! there is a bug
 !CDIR NODEP
             DO ij = 1, icells
                ji = indxi(ij)
                jj = indxj(ij)
-               IF ( afrac(ji,jj) > 1.0 + epsi11 ) THEN 
+               IF( afrac(ji,jj) > 1.0 + epsi11 ) THEN 
                   WRITE(numout,*) ''
                   WRITE(numout,*) ' ardg > a_i'
-                  WRITE(numout,*) ' ardg, aicen_init : ', &
-                     ardg1(ji,jj), aicen_init(ji,jj,jl1)
-               ENDIF            ! afrac > 1 + puny
-            ENDDO               ! if
-         ENDIF                  ! large_afrac
-         IF (large_afrft) THEN  ! there is a bug
+                  WRITE(numout,*) ' ardg, aicen_init : ', ardg1(ji,jj), aicen_init(ji,jj,jl1)
+               ENDIF
+            END DO
+         ENDIF
+         IF( large_afrft ) THEN  ! there is a bug
 !CDIR NODEP
             DO ij = 1, icells
                ji = indxi(ij)
                jj = indxj(ij)
-               IF ( afrft(ji,jj) > 1.0 + epsi11 ) THEN 
+               IF( afrft(ji,jj) > 1.0 + epsi11 ) THEN 
                   WRITE(numout,*) ''
                   WRITE(numout,*) ' arft > a_i'
-                  WRITE(numout,*) ' arft, aicen_init : ', &
-                     arft1(ji,jj), aicen_init(ji,jj,jl1)
-               ENDIF            ! afrft > 1 + puny
-            ENDDO               ! if
-         ENDIF                  ! large_afrft
+                  WRITE(numout,*) ' arft, aicen_init : ', arft1(ji,jj), aicen_init(ji,jj,jl1)
+               ENDIF
+            END DO
+         ENDIF
 
          !-------------------------------------------------------------------------------
@@ -1528,12 +1285,10 @@
                fvol(ji,jj) = (hR*hR - hL*hL) / dhr2(ji,jj)
 
-               a_i(ji,jj,jl2)    = a_i(ji,jj,jl2) + farea * ardg2(ji,jj)
-               v_i(ji,jj,jl2)    = v_i(ji,jj,jl2) + fvol(ji,jj) * vrdg2(ji,jj)
-               v_s(ji,jj,jl2)    = v_s(ji,jj,jl2)                             &
-                  + fvol(ji,jj) * vsrdg(ji,jj) * fsnowrdg
-               e_s(ji,jj,1,jl2)  = e_s(ji,jj,1,jl2)                           &
-                  + fvol(ji,jj) * esrdg(ji,jj) * fsnowrdg
-               smv_i(ji,jj,jl2)  = smv_i(ji,jj,jl2) + fvol(ji,jj) * srdg2(ji,jj)
-               oa_i(ji,jj,jl2)   = oa_i(ji,jj,jl2)  + farea * oirdg2(ji,jj)
+               a_i  (ji,jj,jl2)   = a_i  (ji,jj,jl2)   + ardg2 (ji,jj) * farea
+               v_i  (ji,jj,jl2)   = v_i  (ji,jj,jl2)   + vrdg2 (ji,jj) * fvol(ji,jj)
+               v_s  (ji,jj,jl2)   = v_s  (ji,jj,jl2)   + vsrdg (ji,jj) * fvol(ji,jj) * fsnowrdg
+               e_s  (ji,jj,1,jl2) = e_s  (ji,jj,1,jl2) + esrdg (ji,jj) * fvol(ji,jj) * fsnowrdg
+               smv_i(ji,jj,jl2)   = smv_i(ji,jj,jl2)   + srdg2 (ji,jj) * fvol(ji,jj)
+               oa_i (ji,jj,jl2)   = oa_i (ji,jj,jl2)   + oirdg2(ji,jj) * farea
 
             END DO ! ij
@@ -1545,13 +1300,11 @@
                   ji = indxi(ij)
                   jj = indxj(ij)
-                  e_i(ji,jj,jk,jl2) = e_i(ji,jj,jk,jl2)          &
-                     + fvol(ji,jj)*erdg2(ji,jj,jk)
-               END DO           ! ij
-            END DO !jk
-
-
+                  e_i(ji,jj,jk,jl2) = e_i(ji,jj,jk,jl2) + fvol(ji,jj)*erdg2(ji,jj,jk)
+               END DO
+            END DO
+            !
          END DO                 ! jl2 (new ridges)            
 
-         DO jl2  = ice_cat_bounds(1,1), ice_cat_bounds(1,2) 
+         DO jl2 = ice_cat_bounds(1,1), ice_cat_bounds(1,2) 
 
 !CDIR NODEP
@@ -1566,12 +1319,8 @@
                   a_i(ji,jj,jl2) = a_i(ji,jj,jl2) + arft2(ji,jj)
                   v_i(ji,jj,jl2) = v_i(ji,jj,jl2) + virft(ji,jj)
-                  v_s(ji,jj,jl2) = v_s(ji,jj,jl2)                   &
-                     + vsrft(ji,jj)*fsnowrft
-                  e_s(ji,jj,1,jl2) = e_s(ji,jj,1,jl2)                   &
-                     + esrft(ji,jj)*fsnowrft
-                  smv_i(ji,jj,jl2) = smv_i(ji,jj,jl2)                 &
-                     + smrft(ji,jj)    
-                  oa_i(ji,jj,jl2)  = oa_i(ji,jj,jl2)                  &
-                     + oirft2(ji,jj)    
+                  v_s(ji,jj,jl2) = v_s(ji,jj,jl2) + vsrft(ji,jj)*fsnowrft
+                  e_s(ji,jj,1,jl2) = e_s(ji,jj,1,jl2) + esrft(ji,jj)*fsnowrft
+                  smv_i(ji,jj,jl2) = smv_i(ji,jj,jl2) + smrft(ji,jj)    
+                  oa_i(ji,jj,jl2)  = oa_i(ji,jj,jl2)  + oirft2(ji,jj)    
                ENDIF ! hraft
 
@@ -1586,6 +1335,5 @@
                   IF (hraft(ji,jj,jl1) .LE. hi_max(jl2) .AND.        &
                      hraft(ji,jj,jl1) .GT. hi_max(jl2-1)) THEN
-                     e_i(ji,jj,jk,jl2) = e_i(ji,jj,jk,jl2)             &
-                        + eirft(ji,jj,jk)
+                     e_i(ji,jj,jk,jl2) = e_i(ji,jj,jk,jl2) + eirft(ji,jj,jk)
                   ENDIF
                END DO           ! ij
@@ -1610,54 +1358,31 @@
          WRITE(numout,*) ' eice_final : ', eice_final(jiindx,jjindx)
       ENDIF
-
+      !
    END SUBROUTINE lim_itd_me_ridgeshift
 
-   !==============================================================================
-
-   SUBROUTINE lim_itd_me_asumr !(subroutine 5/6)
-
+
+   SUBROUTINE lim_itd_me_asumr
       !!-----------------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_me_asumr ***
-      !! ** Purpose :
-      !!        This routine finds total fractional area
-      !!
-      !! ** Method  :
-      !! Find the total area of ice plus open water in each grid cell.
-      !!
-      !! This is similar to the aggregate_area subroutine except that the
-      !! total area can be greater than 1, so the open water area is 
-      !! included in the sum instead of being computed as a residual. 
-      !!
-      !! ** Arguments :
-
-      INTEGER :: ji, jj, jl
-
-      !-----------------------------------------------------------------
-      ! open water
-      !-----------------------------------------------------------------
-
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            asum(ji,jj) = ato_i(ji,jj)
-         END DO
+      !!
+      !! ** Purpose :   finds total fractional area
+      !!
+      !! ** Method  :   Find the total area of ice plus open water in each grid cell.
+      !!              This is similar to the aggregate_area subroutine except that the
+      !!              total area can be greater than 1, so the open water area is 
+      !!              included in the sum instead of being computed as a residual. 
+      !!-----------------------------------------------------------------------------
+      INTEGER ::   jl   ! dummy loop index
+      !!-----------------------------------------------------------------------------
+      !
+      asum(:,:) = ato_i(:,:)                    ! open water
+      DO jl = 1, jpl                            ! ice categories
+         asum(:,:) = asum(:,:) + a_i(:,:,jl)
       END DO
-
-      !-----------------------------------------------------------------
-      ! ice categories
-      !-----------------------------------------------------------------
-
-      DO jl = 1, jpl
-         DO jj= 1, jpj
-            DO ji = 1, jpi
-               asum(ji,jj) = asum(ji,jj) + a_i(ji,jj,jl)
-            END DO !ji
-         END DO !jj
-      END DO ! jl
-
+      !
    END SUBROUTINE lim_itd_me_asumr
 
-   !==============================================================================
-
-   SUBROUTINE lim_itd_me_init ! (subroutine 6/6)
+
+   SUBROUTINE lim_itd_me_init
       !!-------------------------------------------------------------------
       !!                   ***  ROUTINE lim_itd_me_init ***
@@ -1671,7 +1396,4 @@
       !!
       !! ** input   :   Namelist namiceitdme
-      !!
-      !! history :
-      !!  9.0, LIM3.0 - 02-2006 (M. Vancoppenolle) original code
       !!-------------------------------------------------------------------
       NAMELIST/namiceitdme/ ridge_scheme_swi, Cs, Cf, fsnowrdg, fsnowrft,& 
@@ -1681,10 +1403,9 @@
          brinstren_swi
       !!-------------------------------------------------------------------
-
-      ! Define the initial parameters
-      ! -------------------------
-      REWIND( numnam_ice )
+      !
+      REWIND( numnam_ice )                   ! read namiceitdme namelist
       READ  ( numnam_ice , namiceitdme)
-      IF (lwp) THEN
+      !
+      IF (lwp) THEN                          ! control print
          WRITE(numout,*)
          WRITE(numout,*)' lim_itd_me_init : ice parameters for mechanical ice redistribution '
@@ -1707,8 +1428,7 @@
          WRITE(numout,*)'   Switch for including brine volume in ice strength comp. brinstren_swi   ', brinstren_swi
       ENDIF
-
+      !
    END SUBROUTINE lim_itd_me_init
 
-   !==============================================================================
 
    SUBROUTINE lim_itd_me_zapsmall
@@ -1717,5 +1437,4 @@
       !!
       !! ** Purpose :   Remove too small sea ice areas and correct salt fluxes
-      !!
       !!
       !! history :
@@ -1726,21 +1445,11 @@
       !!  9.0, LIM3.0 - 02-2006 (M. Vancoppenolle) original code
       !!-------------------------------------------------------------------
-
-      INTEGER ::   &
-         ji,jj,  & ! horizontal indices
-         jl,     & ! ice category index
-         jk,     & ! ice layer index
-         !           ij,     &   ! combined i/j horizontal index
-         icells      ! number of cells with ice to zap
-
-      !      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) :: &
-      !           indxi,  & ! compressed indices for i/j directions
-      !           indxj
-
-      INTEGER, DIMENSION(jpi,jpj) :: zmask
-
-
-      REAL(wp) :: &
-         xtmp      ! temporary variable
+      INTEGER ::   ji, jj, jl, jk   ! dummy loop indices
+      INTEGER ::   icells           ! number of cells with ice to zap
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   zmask   ! 2D workspace
+      
+!!gm      REAL(wp) ::   xtmp      ! temporary variable
+      !!-------------------------------------------------------------------
 
       DO jl = 1, jpl
@@ -1763,20 +1472,14 @@
 
          icells = 0
-         zmask = 0.e0
+         zmask  = 0._wp
          DO jj = 1, jpj
             DO ji = 1, jpi
-               IF ( ( a_i(ji,jj,jl) .GE. -epsi11 .AND. a_i(ji,jj,jl) .LT. 0.0)       &
-                  .OR.                                         &
-                  ( a_i(ji,jj,jl) .GT. 0.0     .AND. a_i(ji,jj,jl) .LE. 1.0e-11 )  &
-                  .OR.                                         &
-                                !new line
-                  ( v_i(ji,jj,jl) .EQ. 0.0     .AND. a_i(ji,jj,jl) .GT. 0.0    )   &
-                  .OR.                                         &
-                  ( v_i(ji,jj,jl) .GT. 0.0     .AND. v_i(ji,jj,jl) .LT. 1.e-12 ) ) THEN
-                  zmask(ji,jj) = 1
-               ENDIF
-            END DO
-         END DO
-         IF( ln_nicep ) WRITE(numout,*) SUM(zmask), ' cells of ice zapped in the ocean '
+               IF(  ( a_i(ji,jj,jl) .GE. -epsi11 .AND. a_i(ji,jj,jl) .LT. 0._wp   ) .OR.   &
+                  & ( a_i(ji,jj,jl) .GT. 0._wp   .AND. a_i(ji,jj,jl) .LE. 1.0e-11 ) .OR.   &
+                  & ( v_i(ji,jj,jl)  ==  0._wp   .AND. a_i(ji,jj,jl) .GT. 0._wp   ) .OR.   &
+                  & ( v_i(ji,jj,jl) .GT. 0._wp   .AND. v_i(ji,jj,jl) .LT. 1.e-12  )      )   zmask(ji,jj) = 1._wp
+            END DO
+         END DO
+         IF( ln_nicep )   WRITE(numout,*) SUM(zmask), ' cells of ice zapped in the ocean '
 
          !-----------------------------------------------------------------
@@ -1787,12 +1490,11 @@
             DO jj = 1 , jpj
                DO ji = 1 , jpi
-
-                  xtmp = e_i(ji,jj,jk,jl) / area(ji,jj) / rdt_ice
-                  xtmp = xtmp * unit_fac
-                  !              fheat_res(ji,jj) = fheat_res(ji,jj) - xtmp
+!!gm                  xtmp = e_i(ji,jj,jk,jl) / area(ji,jj) / rdt_ice
+!!gm                  xtmp = xtmp * unit_fac
+                  ! fheat_res(ji,jj) = fheat_res(ji,jj) - xtmp
                   e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * ( 1 - zmask(ji,jj) )
-               END DO           ! ji
-            END DO           ! jj
-         END DO           ! jk
+               END DO
+            END DO
+         END DO
 
          DO jj = 1 , jpj
@@ -1802,5 +1504,4 @@
                ! Zap snow energy and use ocean heat to melt snow
                !-----------------------------------------------------------------
-
                !           xtmp = esnon(i,j,n) / dt ! < 0
                !           fhnet(i,j)      = fhnet(i,j)      + xtmp
@@ -1809,8 +1510,8 @@
                ! fluxes are positive to the ocean
                ! here the flux has to be negative for the ocean
-               xtmp = ( rhosn*cpic*( rtt-t_s(ji,jj,1,jl) ) + rhosn*lfus ) / rdt_ice
+!!gm               xtmp = ( rhosn*cpic*( rtt-t_s(ji,jj,1,jl) ) + rhosn*lfus ) / rdt_ice
                !           fheat_res(ji,jj) = fheat_res(ji,jj) - xtmp
 
-               xtmp = ( rhosn*cpic*( rtt-t_s(ji,jj,1,jl) ) + rhosn*lfus ) / rdt_ice !RB   ???????
+!!gm               xtmp = ( rhosn*cpic*( rtt-t_s(ji,jj,1,jl) ) + rhosn*lfus ) / rdt_ice !RB   ???????
 
                t_s(ji,jj,1,jl) = rtt * zmask(ji,jj) + t_s(ji,jj,1,jl) * ( 1 - zmask(ji,jj) )
@@ -1833,37 +1534,28 @@
                !           fsalt_hist(i,j) = fsalt_hist(i,j) + xtmp
 
-               ato_i(ji,jj)   = a_i(ji,jj,jl)  * zmask(ji,jj) + ato_i(ji,jj)
-               a_i(ji,jj,jl)  = a_i(ji,jj,jl) * ( 1 - zmask(ji,jj) )
-               v_i(ji,jj,jl)  = v_i(ji,jj,jl) * ( 1 - zmask(ji,jj) )
-               v_s(ji,jj,jl)  = v_s(ji,jj,jl) * ( 1 - zmask(ji,jj) )
-               t_su(ji,jj,jl) = t_su(ji,jj,jl) * (1 -zmask(ji,jj) ) + t_bo(ji,jj) * zmask(ji,jj)
-               oa_i(ji,jj,jl) = oa_i(ji,jj,jl) * ( 1 - zmask(ji,jj) )
+               ato_i(ji,jj)    = a_i  (ji,jj,jl) *       zmask(ji,jj)   + ato_i(ji,jj)
+               a_i  (ji,jj,jl) = a_i  (ji,jj,jl) * ( 1 - zmask(ji,jj) )
+               v_i  (ji,jj,jl) = v_i  (ji,jj,jl) * ( 1 - zmask(ji,jj) )
+               v_s  (ji,jj,jl) = v_s  (ji,jj,jl) * ( 1 - zmask(ji,jj) )
+               t_su (ji,jj,jl) = t_su (ji,jj,jl) * ( 1 - zmask(ji,jj) ) + t_bo(ji,jj) * zmask(ji,jj)
+               oa_i (ji,jj,jl) = oa_i (ji,jj,jl) * ( 1 - zmask(ji,jj) )
                smv_i(ji,jj,jl) = smv_i(ji,jj,jl) * ( 1 - zmask(ji,jj) )
-
-            END DO                 ! ji
-         END DO                 ! jj
-
+               !
+            END DO
+         END DO
+         !
       END DO                 ! jl 
-
+      !
    END SUBROUTINE lim_itd_me_zapsmall
 
 #else
-   !!======================================================================
-   !!                       ***  MODULE limitd_me    ***
-   !!                            no sea ice model
-   !!======================================================================
-
+   !!----------------------------------------------------------------------
+   !!   Default option         Empty module          NO LIM-3 sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
-
    SUBROUTINE lim_itd_me           ! Empty routines
    END SUBROUTINE lim_itd_me
    SUBROUTINE lim_itd_me_icestrength
    END SUBROUTINE lim_itd_me_icestrength
-   SUBROUTINE lim_itd_me_ridgeprep
-   END SUBROUTINE lim_itd_me_ridgeprep
-   SUBROUTINE lim_itd_me_ridgeshift
-   END SUBROUTINE lim_itd_me_ridgeshift
-   SUBROUTINE lim_itd_me_asumr
-   END SUBROUTINE lim_itd_me_asumr
    SUBROUTINE lim_itd_me_sort
    END SUBROUTINE lim_itd_me_sort
@@ -1873,3 +1565,4 @@
    END SUBROUTINE lim_itd_me_zapsmall
 #endif
+   !!======================================================================
 END MODULE limitd_me
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_th.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_th.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_th.F90	(revision 2715)
@@ -5,45 +5,51 @@
    !!                   computation of changes in g(h)      
    !!======================================================================
+   !! History :   -   !          (W. H. Lipscomb and E.C. Hunke) CICE (c) original code
+   !!            3.0  ! 2005-12  (M. Vancoppenolle) adaptation to LIM-3
+   !!             -   ! 2006-06  (M. Vancoppenolle) adaptation to include salt, age and types
+   !!             -   ! 2007-04  (M. Vancoppenolle) Mass conservation checked
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
    !!   'key_lim3' :                                   LIM3 sea-ice model
    !!----------------------------------------------------------------------
+   !!   lim_itd_th       : thermodynamics of ice thickness distribution
+   !!   lim_itd_th_rem   :
+   !!   lim_itd_th_reb   :
+   !!   lim_itd_fitline  :
+   !!   lim_itd_shiftice :
    !!----------------------------------------------------------------------
-   USE dom_ice
+   USE dom_ice          ! LIM-3 domain
    USE par_oce          ! ocean parameters
-   USE dom_oce
+   USE dom_oce          ! ocean domain
    USE phycst           ! physical constants (ocean directory) 
-   USE thd_ice
-   USE ice
-   USE par_ice
-   USE limthd_lac
-   USE limvar
-   USE limcons
+   USE thd_ice          ! LIM-3 thermodynamic variables
+   USE ice              ! LIM-3 variables
+   USE par_ice          ! LIM-3 parameters
+   USE limthd_lac       ! LIM-3 lateral accretion
+   USE limvar           ! LIM-3 variables
+   USE limcons          ! LIM-3 conservation
    USE prtctl           ! Print control
-   USE in_out_manager
-   USE lib_mpp 
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC lim_itd_th        ! called by ice_stp
-   PUBLIC lim_itd_th_rem
-   PUBLIC lim_itd_th_reb
-   PUBLIC lim_itd_fitline
-   PUBLIC lim_itd_shiftice
-
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1e-20   ,  &
-      epsi13 = 1e-13   ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0
+   PUBLIC   lim_itd_th        ! called by ice_stp
+   PUBLIC   lim_itd_th_rem
+   PUBLIC   lim_itd_th_reb
+   PUBLIC   lim_itd_fitline
+   PUBLIC   lim_itd_shiftice
+
+   REAL(wp) ::   epsi20 = 1e-20_wp   ! constant values
+   REAL(wp) ::   epsi13 = 1e-13_wp   !
+   REAL(wp) ::   epsi10 = 1e-10_wp   !
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
-
 CONTAINS
 
@@ -51,34 +57,14 @@
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_th ***
-      !! ** Purpose :
-      !!        This routine computes the thermodynamics of ice thickness
-      !!         distribution
+      !!
+      !! ** Purpose :   computes the thermodynamics of ice thickness distribution
+      !!
       !! ** Method  :
-      !!
-      !! ** Arguments :
-      !!           kideb , kiut : Starting and ending points on which the 
-      !!                         the computation is applied
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !!           (12-2005) Martin Vancoppenolle 
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT(in) :: kt
-      !! * Local variables
-      INTEGER ::   jl, ja,   &   ! ice category, layers
-         jm,       &   ! ice types    dummy loop index
-         jbnd1,    &
-         jbnd2
-
-      REAL(wp)  ::           &  ! constant values
-         zeps      =  1.0e-10, &
-         epsi10    =  1.0e-10
+      !!------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! time step index
+      !
+      INTEGER ::   jl, ja, jm, jbnd1, jbnd2   ! ice types    dummy loop index         
+
+      !!------------------------------------------------------------------
 
       IF( kt == nit000 .AND. lwp ) THEN
@@ -96,8 +82,8 @@
          jbnd1 = ice_cat_bounds(jm,1)
          jbnd2 = ice_cat_bounds(jm,2)
-         IF (ice_ncat_types(jm) .GT. 1 ) CALL lim_itd_th_rem( jbnd1, jbnd2, jm, kt )
+         IF( ice_ncat_types(jm) > 1 )   CALL lim_itd_th_rem( jbnd1, jbnd2, jm, kt )
       END DO
-
-      CALL lim_var_glo2eqv ! only for info
+      !
+      CALL lim_var_glo2eqv    ! only for info
       CALL lim_var_agg(1)
 
@@ -107,5 +93,5 @@
 
       CALL lim_thd_lac
-      CALL lim_var_glo2eqv ! only for info
+      CALL lim_var_glo2eqv    ! only for info
 
       !----------------------------------------------------------------------------------------
@@ -120,7 +106,6 @@
       d_e_i_thd(:,:,:,:) = e_i(:,:,:,:) - old_e_i(:,:,:,:)
 
-      d_smv_i_thd(:,:,:) = 0.0
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) &
-         d_smv_i_thd(:,:,:) = smv_i(:,:,:) - old_smv_i(:,:,:)
+      d_smv_i_thd(:,:,:) = 0._wp
+      IF( num_sal == 2 .OR. num_sal == 4 )   d_smv_i_thd(:,:,:) = smv_i(:,:,:) - old_smv_i(:,:,:)
 
       IF(ln_ctl) THEN   ! Control print
@@ -157,13 +142,12 @@
 
       !- Recover Old values
-      a_i(:,:,:)         = old_a_i (:,:,:)
-      v_s(:,:,:)         = old_v_s (:,:,:)
-      v_i(:,:,:)         = old_v_i (:,:,:)
-      e_s(:,:,:,:)       = old_e_s (:,:,:,:)
-      e_i(:,:,:,:)       = old_e_i (:,:,:,:)
-
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) &
-         smv_i(:,:,:)       = old_smv_i (:,:,:)
-
+      a_i(:,:,:)   = old_a_i (:,:,:)
+      v_s(:,:,:)   = old_v_s (:,:,:)
+      v_i(:,:,:)   = old_v_i (:,:,:)
+      e_s(:,:,:,:) = old_e_s (:,:,:,:)
+      e_i(:,:,:,:) = old_e_i (:,:,:,:)
+      !
+      IF( num_sal == 2 .OR. num_sal == 4 )   smv_i(:,:,:)       = old_smv_i (:,:,:)
+      !
    END SUBROUTINE lim_itd_th
    !
@@ -172,60 +156,25 @@
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_th_rem ***
-      !! ** Purpose :
-      !!        This routine computes the redistribution of ice thickness
-      !!        after thermodynamic growth of ice thickness
+      !!
+      !! ** Purpose :   computes the redistribution of ice thickness
+      !!              after thermodynamic growth of ice thickness
       !!
       !! ** Method  : Linear remapping 
       !!
-      !! ** Arguments :
-      !!           klbnd, kubnd : Starting and ending category index on which the 
-      !!                         the computation is applied
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References : W.H. Lipscomb, JGR 2001
-      !!
-      !! ** History :
-      !!           largely inspired from CICE (c) W. H. Lipscomb and E.C. Hunke
-      !! 
-      !!           (01-2006) Martin Vancoppenolle, UCL-ASTR, translation from
-      !!                     CICE
-      !!           (06-2006) Adaptation to include salt, age and types
-      !!           (04-2007) Mass conservation checked
-      !!------------------------------------------------------------------
-      !! * Arguments
-
-      INTEGER , INTENT (IN) ::  &
-         klbnd ,  &  ! Start thickness category index point
-         kubnd ,  &  ! End point on which the  the computation is applied
-         ntyp  ,  &  ! Number of the type used
-         kt          ! Ocean time step 
-
-      !! * Local variables
-      INTEGER ::   ji,       &   ! spatial dummy loop index
-         jj,       &   ! spatial dummy loop index
-         jl,       &   ! ice category dummy loop index
-         zji, zjj, &   ! dummy indices used when changing coordinates
-         nd            ! used for thickness categories
-
-      INTEGER , DIMENSION(jpi,jpj,jpl-1) :: & 
-         zdonor        ! donor category index
-
-      REAL(wp)  ::           &   ! constant values
-         zeps      =  1.0e-10
-
-      REAL(wp)  ::           &  ! constant values for ice enthalpy
-         zindb     ,         &
-         zareamin  ,         &  ! minimum tolerated area in a thickness category
-         zwk1, zwk2,         &  ! all the following are dummy arguments
-         zx1, zx2, zx3,      &  !
-         zetamin   ,         &  ! minimum value of eta
-         zetamax   ,         &  ! maximum value of eta
-         zdh0      ,         &  ! 
-         zda0      ,         &  !
-         zdamax    ,         &  !
-         zhimin
+      !! References : W.H. Lipscomb, JGR 2001
+      !!------------------------------------------------------------------
+      INTEGER , INTENT (in) ::   klbnd   ! Start thickness category index point
+      INTEGER , INTENT (in) ::   kubnd   ! End point on which the  the computation is applied
+      INTEGER , INTENT (in) ::   ntyp    ! Number of the type used
+      INTEGER , INTENT (in) ::   kt      ! Ocean time step 
+      !
+      INTEGER  ::   ji, jj, jl     ! dummy loop index
+      INTEGER  ::   zji, zjj, nd   ! local integer
+      REAL(wp) ::   zx1, zwk1, zdh0, zetamin, zdamax   ! local scalars
+      REAL(wp) ::   zx2, zwk2, zda0, zetamax, zhimin   !   -      -
+      REAL(wp) ::   zx3,             zareamin, zindb   !   -      -
+      CHARACTER (len = 15) :: fieldid
+
+      INTEGER , DIMENSION(jpi,jpj,jpl-1) ::   zdonor   ! donor category index
 
       REAL(wp), DIMENSION(jpi,jpj,jpl) :: &
@@ -238,47 +187,33 @@
          dummy_es
 
-      REAL(wp), DIMENSION(jpi,jpj,jpl-1) :: &
-         zdaice           ,  &  ! local increment of ice area 
-         zdvice                 ! local increment of ice volume
-
-      REAL(wp), DIMENSION(jpi,jpj,0:jpl) :: &
-         zhbnew                 ! new boundaries of ice categories
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zhb0, zhb1             ! category boundaries for thinnes categories
-
-      REAL, DIMENSION(1:(jpi+1)*(jpj+1)) :: &
-         zvetamin, zvetamax     ! maximum values for etas
-
-      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) :: &
-         nind_i      ,  &  ! compressed indices for i/j directions
-         nind_j
-
-      INTEGER :: &
-         nbrem             ! number of cells with ice to transfer
-
-      LOGICAL, DIMENSION(jpi,jpj) ::   &  !:
-         zremap_flag             ! compute remapping or not ????
-
-      REAL(wp)  ::           &  ! constant values for ice enthalpy
-         zslope                 ! used to compute local thermodynamic "speeds"
-
-      REAL (wp), DIMENSION(jpi,jpj) :: &  ! 
-         vt_i_init, vt_i_final,   &  !  ice volume summed over categories
-         vt_s_init, vt_s_final,   &  !  snow volume summed over categories
-         et_i_init, et_i_final,   &  !  ice energy summed over categories
-         et_s_init, et_s_final       !  snow energy summed over categories
-
-      CHARACTER (len = 15) :: fieldid
-
-      !!-- End of declarations
-      !!----------------------------------------------------------------------------------------------
-      zhimin = 0.1      !minimum ice thickness tolerated by the model
-      zareamin = zeps   !minimum area in thickness categories tolerated by the conceptors of the model
+      REAL(wp), DIMENSION(jpi,jpj,jpl-1) ::   zdaice, zdvice   ! local increment of ice area and volume
+
+      REAL(wp), DIMENSION(jpi,jpj,0:jpl) ::   zhbnew           ! new boundaries of ice categories
+
+
+      REAL, DIMENSION(1:(jpi+1)*(jpj+1)) ::   zvetamin, zvetamax     ! maximum values for etas
+
+      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) ::   nind_i, nind_j  ! compressed indices for i/j directions
+
+      INTEGER ::   nbrem             ! number of cells with ice to transfer
+
+      LOGICAL, DIMENSION(jpi,jpj) ::   zremap_flag             ! compute remapping or not ????
+
+      REAL(wp)  ::   zslope                 ! used to compute local thermodynamic "speeds"
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   zhb0, zhb1             ! category boundaries for thinnes categories
+      REAL(wp), DIMENSION(jpi,jpj) ::   vt_i_init, vt_i_final   !  ice volume summed over categories
+      REAL(wp), DIMENSION(jpi,jpj) ::   vt_s_init, vt_s_final   !  snow volume summed over categories
+      REAL(wp), DIMENSION(jpi,jpj) ::   et_i_init, et_i_final   !  ice energy summed over categories
+      REAL(wp), DIMENSION(jpi,jpj) ::   et_s_init, et_s_final   !  snow energy summed over categories
+      !!------------------------------------------------------------------
+
+      zhimin   = 0.1      !minimum ice thickness tolerated by the model
+      zareamin = epsi10   !minimum area in thickness categories tolerated by the conceptors of the model
 
       !!----------------------------------------------------------------------------------------------
       !! 0) Conservation checkand changes in each ice category
       !!----------------------------------------------------------------------------------------------
-      IF ( con_i ) THEN
+      IF( con_i ) THEN
          CALL lim_column_sum (jpl,   v_i, vt_i_init)
          CALL lim_column_sum (jpl,   v_s, vt_s_init)
@@ -291,5 +226,5 @@
       !! 1) Compute thickness and changes in each ice category
       !!----------------------------------------------------------------------------------------------
-      IF (kt == nit000 .AND. lwp) THEN
+      IF( kt == nit000 .AND. lwp) THEN
          WRITE(numout,*)
          WRITE(numout,*) 'lim_itd_th_rem  : Remapping the ice thickness distribution'
@@ -300,15 +235,13 @@
       ENDIF
 
-      zdhice(:,:,:) = 0.0
+      zdhice(:,:,:) = 0._wp
       DO jl = klbnd, kubnd
          DO jj = 1, jpj
             DO ji = 1, jpi
                zindb             = 1.0-MAX(0.0,SIGN(1.0,-a_i(ji,jj,jl)))     !0 if no ice and 1 if yes
-               ht_i(ji,jj,jl)    = v_i(ji,jj,jl) / MAX(a_i(ji,jj,jl),zeps) * zindb
+               ht_i(ji,jj,jl)    = v_i(ji,jj,jl) / MAX(a_i(ji,jj,jl),epsi10) * zindb
                zindb             = 1.0-MAX(0.0,SIGN(1.0,-old_a_i(ji,jj,jl))) !0 if no ice and 1 if yes
-               zht_i_o(ji,jj,jl) = old_v_i(ji,jj,jl) / MAX(old_a_i(ji,jj,jl),zeps) * zindb
-               IF (a_i(ji,jj,jl).gt.1e-6) THEN
-                  zdhice(ji,jj,jl) = ht_i(ji,jj,jl) - zht_i_o(ji,jj,jl) 
-               ENDIF
+               zht_i_o(ji,jj,jl) = old_v_i(ji,jj,jl) / MAX(old_a_i(ji,jj,jl),epsi10) * zindb
+               IF( a_i(ji,jj,jl) > 1e-6 )   zdhice(ji,jj,jl) = ht_i(ji,jj,jl) - zht_i_o(ji,jj,jl) 
             END DO
          END DO
@@ -318,11 +251,7 @@
       !  2) Compute fractional ice area in each grid cell
       !-----------------------------------------------------------------------------------------------
-      at_i(:,:) = 0.0
+      at_i(:,:) = 0._wp
       DO jl = klbnd, kubnd
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               at_i(ji,jj) = at_i(ji,jj) + a_i(ji,jj,jl)
-            END DO
-         END DO
+         at_i(:,:) = at_i(:,:) + a_i(:,:,jl)
       END DO
 
@@ -351,15 +280,13 @@
       ! will be soon removed, CT
       ! hi_max(kubnd) = 999.99
-      zhbnew(:,:,:) = 0.0
+      zhbnew(:,:,:) = 0._wp
 
       DO jl = klbnd, kubnd - 1
-         ! jl
          DO ji = 1, nbrem
-            ! jl, ji
             zji = nind_i(ji)
             zjj = nind_j(ji)
             !
-            IF ( ( zht_i_o(zji,zjj,jl)  .GT.zeps ) .AND. & 
-               ( zht_i_o(zji,zjj,jl+1).GT.zeps ) ) THEN
+            IF ( ( zht_i_o(zji,zjj,jl)  .GT.epsi10 ) .AND. & 
+               ( zht_i_o(zji,zjj,jl+1).GT.epsi10 ) ) THEN
                !interpolate between adjacent category growth rates
                zslope = ( zdhice(zji,zjj,jl+1)     - zdhice(zji,zjj,jl) ) / &
@@ -367,14 +294,12 @@
                zhbnew(zji,zjj,jl) = hi_max(jl) + zdhice(zji,zjj,jl) + &
                   zslope * ( hi_max(jl) - zht_i_o(zji,zjj,jl) )
-            ELSEIF (zht_i_o(zji,zjj,jl).gt.zeps) THEN
+            ELSEIF (zht_i_o(zji,zjj,jl).gt.epsi10) THEN
                zhbnew(zji,zjj,jl) = hi_max(jl) + zdhice(zji,zjj,jl)
-            ELSEIF (zht_i_o(zji,zjj,jl+1).gt.zeps) THEN
+            ELSEIF (zht_i_o(zji,zjj,jl+1).gt.epsi10) THEN
                zhbnew(zji,zjj,jl) = hi_max(jl) + zdhice(zji,zjj,jl+1)
             ELSE
                zhbnew(zji,zjj,jl) = hi_max(jl)
             ENDIF
-            ! jl, ji
-         END DO !ji
-         ! jl
+         END DO
 
          !- 4.2 Check that each zhbnew lies between adjacent values of ice thickness
@@ -384,9 +309,9 @@
             zjj = nind_j(ji)
             ! jl, ji
-            IF ( ( a_i(zji,zjj,jl) .GT.zeps) .AND. & 
+            IF ( ( a_i(zji,zjj,jl) .GT.epsi10) .AND. & 
                ( ht_i(zji,zjj,jl).GE. zhbnew(zji,zjj,jl) ) &
                ) THEN
                zremap_flag(zji,zjj) = .false.
-            ELSEIF ( ( a_i(zji,zjj,jl+1) .GT. zeps ) .AND. &
+            ELSEIF ( ( a_i(zji,zjj,jl+1) .GT. epsi10 ) .AND. &
                ( ht_i(zji,zjj,jl+1).LE. zhbnew(zji,zjj,jl) ) &
                ) THEN
@@ -430,14 +355,13 @@
             zhb1(ji,jj) = hi_max_typ(1,ntyp) ! 1er
 
-            zhbnew(ji,jj,klbnd-1) = 0.0
-
-            IF ( a_i(ji,jj,kubnd) .GT. zeps ) THEN
-               zhbnew(ji,jj,kubnd) = 3.0*ht_i(ji,jj,kubnd) - 2.0*zhbnew(ji,jj,kubnd-1)
+            zhbnew(ji,jj,klbnd-1) = 0._wp
+
+            IF( a_i(ji,jj,kubnd) > epsi10 ) THEN
+               zhbnew(ji,jj,kubnd) = 3._wp * ht_i(ji,jj,kubnd) - 2._wp * zhbnew(ji,jj,kubnd-1)
             ELSE
                zhbnew(ji,jj,kubnd) = hi_max(kubnd)
             ENDIF
 
-            IF ( zhbnew(ji,jj,kubnd) .LT. hi_max(kubnd-1) ) &
-               zhbnew(ji,jj,kubnd) = hi_max(kubnd-1)
+            IF( zhbnew(ji,jj,kubnd) < hi_max(kubnd-1) )   zhbnew(ji,jj,kubnd) = hi_max(kubnd-1)
 
          END DO !jj
@@ -448,7 +372,7 @@
       !-----------------------------------------------------------------------------------------------
       !- 7.1 g(h) for category 1 at start of time step
-      CALL lim_itd_fitline(klbnd, zhb0, zhb1, zht_i_o(:,:,klbnd), &
-         g0(:,:,klbnd), g1(:,:,klbnd), hL(:,:,klbnd), &
-         hR(:,:,klbnd), zremap_flag)
+      CALL lim_itd_fitline( klbnd, zhb0, zhb1, zht_i_o(:,:,klbnd),         &
+         &                  g0(:,:,klbnd), g1(:,:,klbnd), hL(:,:,klbnd),   &
+         &                  hR(:,:,klbnd), zremap_flag )
 
       !- 7.2 Area lost due to melting of thin ice (first category,  klbnd)
@@ -458,9 +382,9 @@
 
          !ji
-         IF (a_i(zji,zjj,klbnd) .gt. zeps) THEN
+         IF (a_i(zji,zjj,klbnd) .gt. epsi10) THEN
             zdh0 = zdhice(zji,zjj,klbnd) !decrease of ice thickness in the lower category
-            ! ji, a_i > zeps
+            ! ji, a_i > epsi10
             IF (zdh0 .lt. 0.0) THEN !remove area from category 1
-               ! ji, a_i > zeps; zdh0 < 0
+               ! ji, a_i > epsi10; zdh0 < 0
                zdh0 = MIN(-zdh0,hi_max(klbnd))
 
@@ -483,8 +407,8 @@
                   v_i(zji,zjj,klbnd)  = a_i(zji,zjj,klbnd)*ht_i(zji,zjj,klbnd)
                ENDIF     ! zetamax > 0
-               ! ji, a_i > zeps
+               ! ji, a_i > epsi10
 
             ELSE ! if ice accretion
-               ! ji, a_i > zeps; zdh0 > 0
+               ! ji, a_i > epsi10; zdh0 > 0
                IF ( ntyp .EQ. 1 ) zhbnew(zji,zjj,klbnd-1) = MIN(zdh0,hi_max(klbnd)) 
                ! zhbnew was 0, and is shifted to the right to account for thin ice
@@ -495,6 +419,6 @@
             ENDIF ! zdh0 
 
-            ! a_i > zeps
-         ENDIF ! a_i > zeps
+            ! a_i > epsi10
+         ENDIF ! a_i > epsi10
 
       END DO ! ji
@@ -571,5 +495,5 @@
          zjj = nind_j(ji)
          IF ( ( zhimin .GT. 0.0 ) .AND. & 
-            ( ( a_i(zji,zjj,1) .GT. zeps ) .AND. ( ht_i(zji,zjj,1) .LT. zhimin ) ) &
+            ( ( a_i(zji,zjj,1) .GT. epsi10 ) .AND. ( ht_i(zji,zjj,1) .LT. zhimin ) ) &
             ) THEN
             a_i(zji,zjj,1)  = a_i(zji,zjj,1) * ht_i(zji,zjj,1) / zhimin 
@@ -602,72 +526,41 @@
 
    END SUBROUTINE lim_itd_th_rem
-   !
-
-   SUBROUTINE lim_itd_fitline(num_cat, HbL, Hbr, hice, g0, g1, hL, hR, zremap_flag )
-
+
+
+   SUBROUTINE lim_itd_fitline( num_cat, HbL, Hbr, hice,   &
+      &                        g0, g1, hL, hR, zremap_flag )
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_fitline ***
-      !! ** Purpose :
-      !! fit g(h) with a line using area, volume constraints
       !!
-      !! ** Method  :
-      !! Fit g(h) with a line, satisfying area and volume constraints.
-      !! To reduce roundoff errors caused by large values of g0 and g1,
-      !! we actually compute g(eta), where eta = h - hL, and hL is the
-      !! left boundary.
+      !! ** Purpose :   fit g(h) with a line using area, volume constraints
       !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !! authors: William H. Lipscomb, LANL, Elizabeth C. Hunke, LANL
-      !!          (01-2006) Martin Vancoppenolle 
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-
-      INTEGER, INTENT(in) :: num_cat      ! category index
-
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(IN)   ::   &  !:
-         HbL, HbR        ! left and right category boundaries
-
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(IN)   ::   &  !:
-         hice            ! ice thickness
-
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(OUT)  ::   &  !:
-         g0, g1      , & ! coefficients in linear equation for g(eta)
-         hL          , & ! min value of range over which g(h) > 0
-         hR              ! max value of range over which g(h) > 0
-
-      LOGICAL, DIMENSION(jpi,jpj), INTENT(IN)    ::   &  !:
-         zremap_flag
-
-      INTEGER :: &              
-         ji,jj           ! horizontal indices
-
-      REAL(wp) :: &           
-         zh13        , & ! HbL + 1/3 * (HbR - HbL)
-         zh23        , & ! HbL + 2/3 * (HbR - HbL)
-         zdhr        , & ! 1 / (hR - hL)
-         zwk1, zwk2  , & ! temporary variables
-         zacrith         ! critical minimum concentration in an ice category
-
-      REAL(wp)  ::           &  ! constant values
-         zeps      =  1.0e-10
-
+      !! ** Method  :   Fit g(h) with a line, satisfying area and volume constraints.
+      !!              To reduce roundoff errors caused by large values of g0 and g1,
+      !!              we actually compute g(eta), where eta = h - hL, and hL is the
+      !!              left boundary.
+      !!------------------------------------------------------------------
+      INTEGER                     , INTENT(in   ) ::   num_cat      ! category index
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   HbL, HbR     ! left and right category boundaries
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   hice         ! ice thickness
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   g0, g1       ! coefficients in linear equation for g(eta)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   hL           ! min value of range over which g(h) > 0
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   hR           ! max value of range over which g(h) > 0
+      LOGICAL , DIMENSION(jpi,jpj), INTENT(in   ) ::   zremap_flag  !
+      !
+      INTEGER ::   ji,jj           ! horizontal indices
+      REAL(wp) ::   zh13         ! HbL + 1/3 * (HbR - HbL)
+      REAL(wp) ::   zh23         ! HbL + 2/3 * (HbR - HbL)
+      REAL(wp) ::   zdhr         ! 1 / (hR - hL)
+      REAL(wp) ::   zwk1, zwk2   ! temporary variables
+      REAL(wp) ::   zacrith      ! critical minimum concentration in an ice category
+      !!------------------------------------------------------------------
+      !
       zacrith       = 1.0e-6
-      !!-- End of declarations
-      !!----------------------------------------------------------------------------------------------
-
+      !
       DO jj = 1, jpj
          DO ji = 1, jpi
-
-            IF ( zremap_flag(ji,jj) .AND. a_i(ji,jj,num_cat) .gt. zacrith &
-               .AND. hice(ji,jj) .GT. 0.0 ) THEN
+            !
+            IF( zremap_flag(ji,jj) .AND. a_i(ji,jj,num_cat) > zacrith   &
+               &                   .AND. hice(ji,jj)        > 0._wp     ) THEN
 
                ! Initialize hL and hR
@@ -681,107 +574,70 @@
                zh23 = 1.0/3.0 * (hL(ji,jj) + 2.0*hR(ji,jj))
 
-               IF (hice(ji,jj) < zh13) THEN
-                  hR(ji,jj) = 3.0*hice(ji,jj) - 2.0*hL(ji,jj)
-               ELSEIF (hice(ji,jj) > zh23) THEN
-                  hL(ji,jj) = 3.0*hice(ji,jj) - 2.0*hR(ji,jj)
+               IF    ( hice(ji,jj) < zh13 ) THEN   ;   hR(ji,jj) = 3._wp * hice(ji,jj) - 2._wp * hL(ji,jj)
+               ELSEIF( hice(ji,jj) > zh23 ) THEN   ;   hL(ji,jj) = 3._wp * hice(ji,jj) - 2._wp * hR(ji,jj)
                ENDIF
 
                ! Compute coefficients of g(eta) = g0 + g1*eta
 
-               zdhr = 1.0 / (hR(ji,jj) - hL(ji,jj))
-               zwk1 = 6.0 * a_i(ji,jj,num_cat) * zdhr
-               zwk2 = (hice(ji,jj) - hL(ji,jj)) * zdhr
-               g0(ji,jj) = zwk1 * (2.0/3.0 - zwk2)
-               g1(ji,jj) = 2.0*zdhr * zwk1 * (zwk2 - 0.5)
-
-            ELSE                   ! remap_flag = .false. or a_i < zeps 
-
-               hL(ji,jj) = 0.0
-               hR(ji,jj) = 0.0
-               g0(ji,jj) = 0.0
-               g1(ji,jj) = 0.0
-
-            ENDIF                  ! a_i > zeps
-
-         END DO !ji
-      END DO ! jj
-
+               zdhr = 1._wp / (hR(ji,jj) - hL(ji,jj))
+               zwk1 = 6._wp * a_i(ji,jj,num_cat) * zdhr
+               zwk2 = ( hice(ji,jj) - hL(ji,jj) ) * zdhr
+               g0(ji,jj) = zwk1 * ( 2._wp/3._wp - zwk2 )
+               g1(ji,jj) = 2._wp * zdhr * zwk1 * (zwk2 - 0.5)
+               !
+            ELSE                   ! remap_flag = .false. or a_i < epsi10 
+               hL(ji,jj) = 0._wp
+               hR(ji,jj) = 0._wp
+               g0(ji,jj) = 0._wp
+               g1(ji,jj) = 0._wp
+            ENDIF                  ! a_i > epsi10
+            !
+         END DO
+      END DO
+      !
    END SUBROUTINE lim_itd_fitline
-   !
-
-   SUBROUTINE lim_itd_shiftice (klbnd, kubnd, zdonor, zdaice, zdvice)
+
+
+   SUBROUTINE lim_itd_shiftice( klbnd, kubnd, zdonor, zdaice, zdvice )
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_shiftice ***
-      !! ** Purpose : shift ice across category boundaries, conserving everything
+      !!
+      !! ** Purpose :   shift ice across category boundaries, conserving everything
       !!              ( area, volume, energy, age*vol, and mass of salt )
       !!
       !! ** Method  :
-      !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !! authors: William H. Lipscomb, LANL, Elizabeth C. Hunke, LANL
-      !!          (01-2006) Martin Vancoppenolle 
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-
-      INTEGER , INTENT (IN) ::  &
-         klbnd ,  &  ! Start thickness category index point
-         kubnd       ! End point on which the  the computation is applied
-
-      INTEGER , DIMENSION(jpi,jpj,jpl-1), INTENT(IN) :: & 
-         zdonor             ! donor category index
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl-1), INTENT(INOUT) :: & 
-         zdaice     ,  &   ! ice area transferred across boundary
-         zdvice            ! ice volume transferred across boundary
-
-      INTEGER :: &
-         ji,jj,jl,      &  ! horizontal indices, thickness category index
-         jl2,           &  ! receiver category
-         jl1,           &  ! donor category
-         jk,            &  ! ice layer index
-         zji, zjj          ! indices when changing from 2D-1D is done
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl) :: &
-         zaTsfn
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zworka            ! temporary array used here
-
-      REAL(wp) :: &          
-         zdvsnow     ,  &  ! snow volume transferred
-         zdesnow     ,  &  ! snow energy transferred
-         zdeice      ,  &  ! ice energy transferred
-         zdsm_vice      ,  &  ! ice salinity times volume transferred
-         zdo_aice      ,  &  ! ice age times volume transferred
-         zdaTsf      ,  &  ! aicen*Tsfcn transferred
-         zindsn      ,  &  ! snow or not
-         zindb             ! ice or not
-
-      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) :: &
-         nind_i      ,  &  ! compressed indices for i/j directions
-         nind_j
-
-      INTEGER :: &
-         nbrem             ! number of cells with ice to transfer
-
-      LOGICAL :: &
-         zdaice_negative       , & ! true if daice < -puny
-         zdvice_negative       , & ! true if dvice < -puny
-         zdaice_greater_aicen  , & ! true if daice > aicen
-         zdvice_greater_vicen      ! true if dvice > vicen
-
-      REAL(wp)  ::           &  ! constant values
-         zeps      =  1.0e-10
-
-      !!-- End of declarations
+      !!------------------------------------------------------------------
+      INTEGER , INTENT(in   ) ::   klbnd   ! Start thickness category index point
+      INTEGER , INTENT(in   ) ::   kubnd   ! End point on which the  the computation is applied
+
+      INTEGER , DIMENSION(jpi,jpj,jpl-1), INTENT(in   ) ::   zdonor   ! donor category index
+
+      REAL(wp), DIMENSION(jpi,jpj,jpl-1), INTENT(inout) ::   zdaice   ! ice area transferred across boundary
+      REAL(wp), DIMENSION(jpi,jpj,jpl-1), INTENT(inout) ::   zdvice   ! ice volume transferred across boundary
+
+      INTEGER ::   ji, jj, jl, jl2, jl1, jk   ! dummy loop indices
+      INTEGER ::   zji, zjj          ! indices when changing from 2D-1D is done
+
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zaTsfn
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   zworka            ! temporary array used here
+
+      REAL(wp) ::   zdvsnow, zdesnow   ! snow volume and energy transferred
+      REAL(wp) ::   zdeice             ! ice energy transferred
+      REAL(wp) ::   zdsm_vice          ! ice salinity times volume transferred
+      REAL(wp) ::   zdo_aice           ! ice age times volume transferred
+      REAL(wp) ::   zdaTsf             ! aicen*Tsfcn transferred
+      REAL(wp) ::   zindsn             ! snow or not
+      REAL(wp) ::   zindb              ! ice or not
+
+      INTEGER, DIMENSION(1:(jpi+1)*(jpj+1)) ::   nind_i, nind_j   ! compressed indices for i/j directions
+
+      INTEGER ::   nbrem             ! number of cells with ice to transfer
+
+      LOGICAL ::   zdaice_negative         ! true if daice < -puny
+      LOGICAL ::   zdvice_negative         ! true if dvice < -puny
+      LOGICAL ::   zdaice_greater_aicen    ! true if daice > aicen
+      LOGICAL ::   zdvice_greater_vicen    ! true if dvice > vicen
+      !!------------------------------------------------------------------
 
       !----------------------------------------------------------------------------------------------
@@ -790,10 +646,6 @@
 
       DO jl = klbnd, kubnd
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zaTsfn(ji,jj,jl) = a_i(ji,jj,jl)*t_su(ji,jj,jl)
-            END DO ! ji
-         END DO ! jj
-      END DO ! jl
+         zaTsfn(:,:,jl) = a_i(:,:,jl)*t_su(:,:,jl)
+      END DO
 
       !----------------------------------------------------------------------------------------------
@@ -821,5 +673,5 @@
 
                   IF (zdaice(ji,jj,jl) .LT. 0.0) THEN
-                     IF (zdaice(ji,jj,jl) .GT. -zeps) THEN
+                     IF (zdaice(ji,jj,jl) .GT. -epsi10) THEN
                         IF ( ( jl1.EQ.jl   .AND. ht_i(ji,jj,jl1) .GT. hi_max(jl) )           &
                            .OR.                                      &
@@ -838,5 +690,5 @@
 
                   IF (zdvice(ji,jj,jl) .LT. 0.0) THEN
-                     IF (zdvice(ji,jj,jl) .GT. -zeps ) THEN
+                     IF (zdvice(ji,jj,jl) .GT. -epsi10 ) THEN
                         IF ( ( jl1.EQ.jl .AND. ht_i(ji,jj,jl1).GT.hi_max(jl) )     &
                            .OR.                                     &
@@ -855,6 +707,6 @@
 
                   ! If daice is close to aicen, set daice = aicen.
-                  IF (zdaice(ji,jj,jl) .GT. a_i(ji,jj,jl1) - zeps ) THEN
-                     IF (zdaice(ji,jj,jl) .LT. a_i(ji,jj,jl1)+zeps) THEN
+                  IF (zdaice(ji,jj,jl) .GT. a_i(ji,jj,jl1) - epsi10 ) THEN
+                     IF (zdaice(ji,jj,jl) .LT. a_i(ji,jj,jl1)+epsi10) THEN
                         zdaice(ji,jj,jl) = a_i(ji,jj,jl1)
                         zdvice(ji,jj,jl) = v_i(ji,jj,jl1) 
@@ -864,6 +716,6 @@
                   ENDIF
 
-                  IF (zdvice(ji,jj,jl) .GT. v_i(ji,jj,jl1)-zeps) THEN
-                     IF (zdvice(ji,jj,jl) .LT. v_i(ji,jj,jl1)+zeps) THEN
+                  IF (zdvice(ji,jj,jl) .GT. v_i(ji,jj,jl1)-epsi10) THEN
+                     IF (zdvice(ji,jj,jl) .LT. v_i(ji,jj,jl1)+epsi10) THEN
                         zdaice(ji,jj,jl) = a_i(ji,jj,jl1)
                         zdvice(ji,jj,jl) = v_i(ji,jj,jl1) 
@@ -900,10 +752,8 @@
 
             jl1 = zdonor(zji,zjj,jl)
-            zindb             = MAX( 0.0 , SIGN( 1.0 , v_i(zji,zjj,jl1) - zeps ) )
-            zworka(zji,zjj)   = zdvice(zji,zjj,jl) / MAX(v_i(zji,zjj,jl1),zeps) * zindb
-            IF (jl1 .eq. jl) THEN
-               jl2 = jl1+1
-            ELSE                ! n1 = n+1
-               jl2 = jl 
+            zindb             = MAX( 0.0 , SIGN( 1.0 , v_i(zji,zjj,jl1) - epsi10 ) )
+            zworka(zji,zjj)   = zdvice(zji,zjj,jl) / MAX(v_i(zji,zjj,jl1),epsi10) * zindb
+            IF( jl1 == jl) THEN   ;   jl2 = jl1+1
+            ELSE                    ;   jl2 = jl 
             ENDIF
 
@@ -996,10 +846,10 @@
          DO jj = 1, jpj
             DO ji = 1, jpi 
-               IF ( a_i(ji,jj,jl) .GT. zeps ) THEN 
-                  ht_i(ji,jj,jl)  =  v_i(ji,jj,jl) / a_i(ji,jj,jl) 
+               IF ( a_i(ji,jj,jl) > epsi10 ) THEN 
+                  ht_i(ji,jj,jl)  =  v_i   (ji,jj,jl) / a_i(ji,jj,jl) 
                   t_su(ji,jj,jl)  =  zaTsfn(ji,jj,jl) / a_i(ji,jj,jl) 
                   zindsn          =  1.0 - MAX(0.0,SIGN(1.0,-v_s(ji,jj,jl))) !0 if no ice and 1 if yes
                ELSE
-                  ht_i(ji,jj,jl)  = 0.0
+                  ht_i(ji,jj,jl)  = 0._wp
                   t_su(ji,jj,jl)  = rtt
                ENDIF
@@ -1007,66 +857,32 @@
          END DO                 ! jj
       END DO                    ! jl
-
+      !
    END SUBROUTINE lim_itd_shiftice
-   !
-
-   SUBROUTINE lim_itd_th_reb(klbnd, kubnd, ntyp)
+   
+
+   SUBROUTINE lim_itd_th_reb( klbnd, kubnd, ntyp )
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_itd_th_reb ***
+      !!
       !! ** Purpose : rebin - rebins thicknesses into defined categories
       !!
       !! ** Method  :
-      !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History : (2005) Translation from CICE
-      !!              (2006) Adaptation to include salt, age and types
-      !!              (2007) Mass conservation checked
-      !!
-      !! authors: William H. Lipscomb, LANL, Elizabeth C. Hunke, LANL
-      !!          (01-2006) Martin Vancoppenolle (adaptation)
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-      INTEGER , INTENT (in) ::  &
-         klbnd ,  &  ! Start thickness category index point
-         kubnd ,  &  ! End point on which the  the computation is applied
-         ntyp        ! number of the ice type involved in the rebinning process
-
-      INTEGER :: &
-         ji,jj,          &  ! horizontal indices
-         jl                 ! category index
-
-      INTEGER ::   &  !:
-         zshiftflag          ! = .true. if ice must be shifted
-
-      INTEGER, DIMENSION(jpi,jpj,jpl) :: &
-         zdonor             ! donor category index
-
-      REAL(wp), DIMENSION(jpi, jpj, jpl) :: &
-         zdaice         , & ! ice area transferred
-         zdvice             ! ice volume transferred
-
-      REAL(wp)  ::           &  ! constant values
-         zeps      =  1.0e-10, &
-         epsi10    =  1.0e-10
-
-      REAL (wp), DIMENSION(jpi,jpj) :: &  ! 
-         vt_i_init, vt_i_final,   &  !  ice volume summed over categories
-         vt_s_init, vt_s_final       !  snow volume summed over categories
-
+      !!------------------------------------------------------------------
+      INTEGER , INTENT (in) ::   klbnd   ! Start thickness category index point
+      INTEGER , INTENT (in) ::   kubnd   ! End point on which the  the computation is applied
+      INTEGER , INTENT (in) ::   ntyp    ! number of the ice type involved in the rebinning process
+      !
+      INTEGER ::   ji,jj, jl   ! dummy loop indices
+      INTEGER ::   zshiftflag          ! = .true. if ice must be shifted
       CHARACTER (len = 15) :: fieldid
 
-      !!-- End of declarations
-      !------------------------------------------------------------------------------
-
-      !     ! conservation check
-      IF ( con_i ) THEN
+      INTEGER , DIMENSION(jpi,jpj,jpl) ::   zdonor           ! donor category index
+      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zdaice, zdvice   ! ice area and volume transferred
+
+      REAL (wp), DIMENSION(jpi,jpj) ::   vt_i_init, vt_i_final   ! ice volume summed over categories
+      REAL (wp), DIMENSION(jpi,jpj) ::   vt_s_init, vt_s_final   ! snow volume summed over categories
+      !!------------------------------------------------------------------
+      !     
+      IF( con_i ) THEN                 ! conservation check
          CALL lim_column_sum (jpl,   v_i, vt_i_init)
          CALL lim_column_sum (jpl,   v_s, vt_s_init)
@@ -1080,12 +896,12 @@
          DO jj = 1, jpj
             DO ji = 1, jpi 
-               IF (a_i(ji,jj,jl) .GT. zeps) THEN 
+               IF( a_i(ji,jj,jl) > epsi10 ) THEN 
                   ht_i(ji,jj,jl) = v_i(ji,jj,jl) / a_i(ji,jj,jl)
                ELSE
-                  ht_i(ji,jj,jl) = 0.0
+                  ht_i(ji,jj,jl) = 0._wp
                ENDIF
-            END DO                 ! i
-         END DO                 ! j
-      END DO                    ! n
+            END DO
+         END DO
+      END DO
 
       !------------------------------------------------------------------------------
@@ -1094,13 +910,12 @@
       DO jj = 1, jpj 
          DO ji = 1, jpi 
-
-            IF (a_i(ji,jj,klbnd) > zeps) THEN
-               IF (ht_i(ji,jj,klbnd) .LE. hi_max_typ(0,ntyp) .AND. hi_max_typ(0,ntyp) .GT. 0.0 ) THEN
+            IF( a_i(ji,jj,klbnd) > epsi10 ) THEN
+               IF( ht_i(ji,jj,klbnd) <= hi_max_typ(0,ntyp) .AND. hi_max_typ(0,ntyp) > 0._wp ) THEN
                   a_i(ji,jj,klbnd)  = v_i(ji,jj,klbnd) / hi_max_typ(0,ntyp) 
                   ht_i(ji,jj,klbnd) = hi_max_typ(0,ntyp)
                ENDIF
             ENDIF
-         END DO                    ! i
-      END DO                    ! j
+         END DO
+      END DO
 
       !------------------------------------------------------------------------------
@@ -1111,13 +926,8 @@
       ! Initialize shift arrays
       !-------------------------
-
       DO jl = klbnd, kubnd
-         DO jj = 1, jpj 
-            DO ji = 1, jpi
-               zdonor(ji,jj,jl) = 0
-               zdaice(ji,jj,jl) = 0.0
-               zdvice(ji,jj,jl) = 0.0
-            END DO
-         END DO
+         zdonor(:,:,jl) = 0
+         zdaice(:,:,jl) = 0._wp
+         zdvice(:,:,jl) = 0._wp
       END DO
 
@@ -1135,5 +945,5 @@
          DO jj = 1, jpj 
             DO ji = 1, jpi 
-               IF (a_i(ji,jj,jl) .GT. zeps .AND. ht_i(ji,jj,jl) .GT. hi_max(jl) ) THEN 
+               IF( a_i(ji,jj,jl) > epsi10 .AND. ht_i(ji,jj,jl) > hi_max(jl) ) THEN 
                   zshiftflag        = 1
                   zdonor(ji,jj,jl)  = jl 
@@ -1143,26 +953,14 @@
             END DO                 ! ji
          END DO                 ! jj
-         IF( lk_mpp ) CALL mpp_max(zshiftflag)
-
-         IF ( zshiftflag == 1 ) THEN
-
-            !------------------------------
-            ! Shift ice between categories
-            !------------------------------
-            CALL lim_itd_shiftice (klbnd, kubnd, zdonor, zdaice, zdvice)
-
-            !------------------------
+         IF(lk_mpp)   CALL mpp_max( zshiftflag )
+
+         IF( zshiftflag == 1 ) THEN            ! Shift ice between categories
+            CALL lim_itd_shiftice( klbnd, kubnd, zdonor, zdaice, zdvice )
             ! Reset shift parameters
-            !------------------------
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zdonor(ji,jj,jl) = 0
-                  zdaice(ji,jj,jl) = 0.0
-                  zdvice(ji,jj,jl) = 0.0
-               END DO
-            END DO
-
-         ENDIF                  ! zshiftflag
-
+            zdonor(:,:,jl) = 0
+            zdaice(:,:,jl) = 0._wp
+            zdvice(:,:,jl) = 0._wp
+         ENDIF
+         !
       END DO                    ! jl
 
@@ -1180,7 +978,7 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               IF (a_i(ji,jj,jl+1) .GT. zeps .AND. &
-                  ht_i(ji,jj,jl+1) .LE. hi_max(jl)) THEN
-
+               IF( a_i(ji,jj,jl+1) >  epsi10 .AND.   &
+                  ht_i(ji,jj,jl+1) <= hi_max(jl) ) THEN
+                  !
                   zshiftflag = 1
                   zdonor(ji,jj,jl) = jl + 1
@@ -1191,24 +989,13 @@
          END DO                 ! jj
 
-         IF(lk_mpp) CALL mpp_max(zshiftflag)
-         IF (zshiftflag==1) THEN
-
-            !------------------------------
-            ! Shift ice between categories
-            !------------------------------
-            CALL lim_itd_shiftice (klbnd, kubnd, zdonor, zdaice, zdvice)
-
-            !------------------------
+         IF(lk_mpp)   CALL mpp_max( zshiftflag )
+         
+         IF( zshiftflag == 1 ) THEN            ! Shift ice between categories
+            CALL lim_itd_shiftice( klbnd, kubnd, zdonor, zdaice, zdvice )
             ! Reset shift parameters
-            !------------------------
-            DO jj = 1, jpj 
-               DO ji = 1, jpi 
-                  zdonor(ji,jj,jl)  = 0
-                  zdaice(ji,jj,jl)  = 0.0
-                  zdvice(ji,jj,jl)  = 0.0
-               END DO
-            END DO
-
-         ENDIF                  ! zshiftflag
+            zdonor(:,:,jl) = 0
+            zdaice(:,:,jl) = 0._wp
+            zdvice(:,:,jl) = 0._wp
+         ENDIF
 
       END DO                    ! jl
@@ -1218,5 +1005,5 @@
       !------------------------------------------------------------------------------
 
-      IF ( con_i ) THEN
+      IF( con_i ) THEN
          CALL lim_column_sum (jpl,   v_i, vt_i_final)
          fieldid = ' v_i : limitd_reb '
@@ -1227,12 +1014,11 @@
          CALL lim_cons_check (vt_s_init, vt_s_final, 1.0e-6, fieldid) 
       ENDIF
-
+      !
    END SUBROUTINE lim_itd_th_reb
 
 #else
-   !!======================================================================
-   !!                       ***  MODULE limitd_th    ***
-   !!                              no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
+   !!   Default option            Dummy module         NO LIM sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_itd_th           ! Empty routines
@@ -1249,3 +1035,4 @@
    END SUBROUTINE lim_itd_th_reb
 #endif
+   !!======================================================================
 END MODULE limitd_th
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90	(revision 2715)
@@ -16,5 +16,6 @@
    USE dom_ice        ! sea-ice domain
    USE in_out_manager ! I/O manager
-   USE lbclnk         ! 
+   USE lbclnk         ! lateral boundary condition - MPP exchanges
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
@@ -24,9 +25,8 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -45,5 +45,5 @@
       !!--------------------------------------------------------------------- 
       INTEGER  ::   ji, jj   ! dummy loop indices
-      REAL(wp) ::   zusden   ! temporary scalar
+      REAL(wp) ::   zusden   ! local scalar
       !!---------------------------------------------------------------------
 
@@ -55,5 +55,5 @@
 
       IF( jphgr_msh == 2 .OR. jphgr_msh == 3 .OR. jphgr_msh == 5 )   &
-          &      CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane' )
+          &      CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane')
 
       !                           !==  coriolis factor & Equator position ==!
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90	(revision 2715)
@@ -8,4 +8,5 @@
    !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy 
    !!            3.3  !  2009-05  (G.Garric) addition of the lim2_evp cas
+   !!            4.0  !  2011-01  (A Porter)  dynamical allocation 
    !!----------------------------------------------------------------------
 #if defined key_lim3 || (  defined key_lim2 && ! defined key_lim2_vp )
@@ -37,17 +38,63 @@
    PRIVATE
 
-   PUBLIC   lim_rhg   ! routine called by lim_dyn (or lim_dyn_2)
+   PUBLIC   lim_rhg        ! routine called by lim_dyn (or lim_dyn_2)
+   PUBLIC   lim_rhg_alloc  ! routine called by nemo_alloc in nemogcm.F90
 
    REAL(wp) ::   rzero   = 0._wp   ! constant values
    REAL(wp) ::   rone    = 1._wp   ! constant values
       
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zpresh           ! temporary array for ice strength
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zpreshc          ! Ice strength on grid cell corners (zpreshc)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zfrld1, zfrld2   ! lead fraction on U/V points                                    
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zmass1, zmass2   ! ice/snow mass on U/V points                                    
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zcorl1, zcorl2   ! coriolis parameter on U/V points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   za1ct , za2ct    ! temporary arrays
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zc1              ! ice mass
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zusw             ! temporary weight for ice strength computation
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce1, v_oce1   ! ocean u/v component on U points                           
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_oce2, v_oce2   ! ocean u/v component on V points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   u_ice2, v_ice1   ! ice u/v component on V/U point
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zf1   , zf2      ! arrays for internal stresses
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zdd   , zdt      ! Divergence and tension at centre of grid cells
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zds              ! Shear on northeast corner of grid cells
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   deltat, deltac   ! Delta at centre and corners of grid cells
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zs1   , zs2      ! Diagonal stress tensor components zs1 and zs2 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zs12             ! Non-diagonal stress tensor component zs12
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zu_ice, zv_ice, zresr   ! Local error on velocity
+
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   FUNCTION lim_rhg_alloc()
+      !!-------------------------------------------------------------------
+      !!                 ***  FUNCTION lim_rhg_alloc  ***
+      !!-------------------------------------------------------------------
+      INTEGER :: lim_rhg_alloc   ! return value
+      INTEGER :: ierr(2)         ! local integer
+      !!-------------------------------------------------------------------
+      !
+      ierr(:) = 0
+      !
+      ALLOCATE( zpresh (jpi,jpj) , zfrld1(jpi,jpj), zmass1(jpi,jpj), zcorl1(jpi,jpj), za1ct(jpi,jpj) ,      &
+         &      zpreshc(jpi,jpj) , zfrld2(jpi,jpj), zmass2(jpi,jpj), zcorl2(jpi,jpj), za2ct(jpi,jpj) ,      &
+         &      zc1    (jpi,jpj) , u_oce1(jpi,jpj), u_oce2(jpi,jpj), u_ice2(jpi,jpj),                       &
+         &      zusw   (jpi,jpj) , v_oce1(jpi,jpj), v_oce2(jpi,jpj), v_ice1(jpi,jpj)                 ,  STAT=ierr(1) )
+         !
+      ALLOCATE( zf1(jpi,jpj) , deltat(jpi,jpj) , zu_ice(jpi,jpj) ,                     &
+         &      zf2(jpi,jpj) , deltac(jpi,jpj) , zv_ice(jpi,jpj) ,                     &
+         &      zdd(jpi,jpj) , zdt   (jpi,jpj) , zds   (jpi,jpj) ,                     &
+         &      zs1(jpi,jpj) , zs2   (jpi,jpj) , zs12  (jpi,jpj) , zresr(jpi,jpj), STAT=ierr(2) )
+         !
+      lim_rhg_alloc = MAXVAL(ierr)
+      !
+   END FUNCTION lim_rhg_alloc
+
 
    SUBROUTINE lim_rhg( k_j1, k_jpj )
@@ -111,49 +158,15 @@
       REAL(wp) ::   za, zstms, zsang, zmask   ! local scalars
 
-      REAL(wp),DIMENSION(jpi,jpj) :: &
-         zpresh        ,             & !: temporary array for ice strength
-         zpreshc       ,             & !: Ice strength on grid cell corners (zpreshc)
-         zfrld1, zfrld2,             & !: lead fraction on U/V points                                    
-         zmass1, zmass2,             & !: ice/snow mass on U/V points                                    
-         zcorl1, zcorl2,             & !: coriolis parameter on U/V points
-         za1ct, za2ct  ,             & !: temporary arrays
-         zc1           ,             & !: ice mass
-         zusw          ,             & !: temporary weight for the computation
-                                !: of ice strength
-         u_oce1, v_oce1,             & !: ocean u/v component on U points                           
-         u_oce2, v_oce2,             & !: ocean u/v component on V points
-         u_ice2,                     & !: ice u component on V point
-         v_ice1                        !: ice v component on U point
-
-      REAL(wp) :: &
-         dtevp,                      & ! time step for subcycling
-         dtotel,                     & !
-         ecc2,                       & ! square of yield ellipse eccenticity
-         z0,                         & ! temporary scalar
-         zr,                         & ! temporary scalar
-         zcca, zccb,                 & ! temporary scalars
-         zu_ice2,                    & ! 
-         zv_ice1,                    & !
-         zddc, zdtc,                 & ! temporary array for delta on corners
-         zdst,                       & ! temporary array for delta on centre
-         zdsshx, zdsshy,             & ! term for the gradient of ocean surface
-         sigma1, sigma2                ! internal ice stress
-
-      REAL(wp),DIMENSION(jpi,jpj) ::   zf1, zf2   ! arrays for internal stresses
-
-      REAL(wp),DIMENSION(jpi,jpj) :: &
-         zdd, zdt,                   & ! Divergence and tension at centre of grid cells
-         zds,                        & ! Shear on northeast corner of grid cells
-         deltat,                     & ! Delta at centre of grid cells
-         deltac,                     & ! Delta on corners
-         zs1, zs2,                   & ! Diagonal stress tensor components zs1 and zs2 
-         zs12                          ! Non-diagonal stress tensor component zs12
-
-      REAL(wp) :: &
-         zresm            ,          & ! Maximal error on ice velocity
-         zindb            ,          & ! ice (1) or not (0)      
-         zdummy                        ! dummy argument
-
-      REAL(wp),DIMENSION(jpi,jpj) ::   zu_ice, zv_ice, zresr   ! Local error on velocity
+      REAL(wp) ::   dtevp              ! time step for subcycling
+      REAL(wp) ::   dtotel, ecc2       ! square of yield ellipse eccenticity
+      REAL(wp) ::   z0, zr, zcca, zccb ! temporary scalars
+      REAL(wp) ::   zu_ice2, zv_ice1   !
+      REAL(wp) ::   zddc, zdtc, zdst   ! delta on corners and on centre
+      REAL(wp) ::   zdsshx, zdsshy     ! term for the gradient of ocean surface
+      REAL(wp) ::   sigma1, sigma2     ! internal ice stress
+
+      REAL(wp) ::   zresm         ! Maximal error on ice velocity
+      REAL(wp) ::   zindb         ! ice (1) or not (0)      
+      REAL(wp) ::   zdummy        ! dummy argument
       !!-------------------------------------------------------------------
 #if  defined key_lim2 && ! defined key_lim2_vp
@@ -747,5 +760,5 @@
          ENDIF
       ENDIF
-
+      !
    END SUBROUTINE lim_rhg
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90	(revision 2715)
@@ -6,4 +6,5 @@
    !! History:   -   ! 2005-04 (M. Vancoppenolle) Original code
    !!           3.0  ! 2008-03 (C. Ethe) restart files in using IOM interface
+   !!           4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -22,4 +23,5 @@
    USE in_out_manager   ! I/O manager
    USE iom              ! I/O library
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -34,5 +36,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -90,4 +92,7 @@
       !! ** purpose  :   output of sea-ice variable in a netcdf file
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   z2d  => wrk_2d_1   ! 2D workspace
+      !
       INTEGER, INTENT(in) ::   kt     ! number of iteration
       !!
@@ -96,6 +101,9 @@
       CHARACTER(len=15) ::   znam
       CHARACTER(len=1)  ::   zchar, zchar1
-      REAL(wp), DIMENSION(jpi,jpj) :: z2d
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop( 'lim_rst_write : requested workspace arrays unavailable' )   ;   RETURN
+      END IF
 
       iter = kt + nn_fsbc - 1   ! ice restarts are written at kt == nitrst - nn_fsbc + 1
@@ -287,4 +295,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop( 'lim_rst_write : failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_rst_write
 
@@ -296,9 +306,11 @@
       !! ** purpose  :   read of sea-ice variable restart in a netcdf file
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   z2d  => wrk_2d_1   ! 2D workspace
+      !
       INTEGER :: ji, jj, jk, jl, indx
       REAL(wp) ::   zfice, ziter
       REAL(wp) ::   zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb   ! local scalars used for the salinity profile
       REAL(wp), DIMENSION(nlay_i)  ::   zs_zero 
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d
       CHARACTER(len=15) ::   znam
       CHARACTER(len=1)  ::   zchar, zchar1
@@ -307,8 +319,12 @@
       !!----------------------------------------------------------------------
 
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop( 'lim_rst_read : requested workspace arrays unavailable.' )   ;   RETURN
+      ENDIF
+
       IF(lwp) THEN
          WRITE(numout,*)
          WRITE(numout,*) 'lim_rst_read : read ice NetCDF restart file'
-         WRITE(numout,*) '~~~~~~~~~~~~~~'
+         WRITE(numout,*) '~~~~~~~~~~~~~'
       ENDIF
 
@@ -554,4 +570,8 @@
       CALL iom_close( numrir )
       !
+      IF( wrk_not_released(2, 1) ) THEN
+         CALL ctl_stop( 'lim_rst_read : failed to release workspace arrays.' )
+      END IF
+      !
    END SUBROUTINE lim_rst_read
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 2715)
@@ -9,4 +9,5 @@
    !!            3.3  ! 2010-05 (G. Madec) decrease ocean & ice reference salinities in the Baltic sea
    !!                 !                  + simplification of the ice-ocean stress calculation
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -14,6 +15,8 @@
    !!   'key_lim3'                                    LIM 3.0 sea-ice model
    !!----------------------------------------------------------------------
-   !!   lim_sbc_flx  : updates mass, heat and salt fluxes at the ocean surface
-   !!   lim_sbc_tau  : update i- and j-stresses, and its modulus at the ocean surface
+   !!   lim_sbc_alloc : allocate the limsbc arrays
+   !!   lim_sbc_init  : initialisation
+   !!   lim_sbc_flx   : updates mass, heat and salt fluxes at the ocean surface
+   !!   lim_sbc_tau   : update i- and j-stresses, and its modulus at the ocean surface
    !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
@@ -27,11 +30,14 @@
    USE lbclnk           ! ocean lateral boundary condition
    USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
    USE prtctl           ! Print control
+   USE cpl_oasis3, ONLY : lk_cpl
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   lim_sbc_flx   ! called by sbc_ice_lim
-   PUBLIC   lim_sbc_tau   ! called by sbc_ice_lim
+   PUBLIC   lim_sbc_init   ! called by ice_init
+   PUBLIC   lim_sbc_flx    ! called by sbc_ice_lim
+   PUBLIC   lim_sbc_tau    ! called by sbc_ice_lim
 
    REAL(wp)  ::   r1_rdtice            ! = 1. / rdt_ice 
@@ -40,17 +46,28 @@
    REAL(wp)  ::   rone   = 1._wp
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress              [N/m2]
-   REAL(wp), DIMENSION(jpi,jpj) ::   tmod_io              ! modulus of the ice-ocean relative velocity   [m/s]
-
-   REAL(wp), DIMENSION(jpi,jpj) ::   soce_0, sice_0   ! constant SSS and ice salinity used in levitating sea-ice case
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress     [N/m2]
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean velocity   [m/s]
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   soce_0  , sice_0     ! cst SSS and ice salinity (levitating sea-ice) 
 
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION lim_sbc_alloc()
+      !!-------------------------------------------------------------------
+      !!             ***  ROUTINE lim_sbc_alloc ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( soce_0(jpi,jpj) , utau_oce(jpi,jpj) ,                       &
+         &      sice_0(jpi,jpj) , vtau_oce(jpi,jpj) , tmod_io(jpi,jpj), STAT=lim_sbc_alloc)
+         !
+      IF( lk_mpp             )   CALL mpp_sum( lim_sbc_alloc )
+      IF( lim_sbc_alloc /= 0 )   CALL ctl_warn('lim_sbc_alloc: failed to allocate arrays')
+   END FUNCTION lim_sbc_alloc
+
 
    SUBROUTINE lim_sbc_flx( kt )
@@ -76,38 +93,25 @@
       !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_not_released, wrk_in_use
+      USE wrk_nemo, ONLY:   zfcm1 => wrk_2d_1 , zfcm2 => wrk_2d_2   ! 2D workspace
+      USE wrk_nemo, ONLY:   wrk_3d_4, wrk_3d_5                      ! 3D workspace
+      !
       INTEGER, INTENT(in) ::   kt    ! number of iteration
-      !!
+      !
       INTEGER  ::   ji, jj           ! dummy loop indices
+      INTEGER  ::   ierr             ! local integer
       INTEGER  ::   ifvt, i1mfr, idfr               ! some switches
       INTEGER  ::   iflt, ial, iadv, ifral, ifrdv
-      REAL(wp) ::   zinda            ! switch for testing the values of ice concentration
-      REAL(wp) ::   zfons            ! salt exchanges at the ice/ocean interface
-      REAL(wp) ::   zpme             ! freshwater exchanges at the ice/ocean interface
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfcm1 , zfcm2    ! solar/non solar heat fluxes
-#if defined key_coupled    
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb     ! albedo of ice under overcast sky
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalbp    ! albedo of ice under clear sky
-#endif
+      REAL(wp) ::   zinda, zfons, zpme              ! local scalars
+      !
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalb, zalbp   ! 2D/3D workspace
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'lim_sbc_flx : LIM 3.0 sea-ice - heat salt and mass ocean surface fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
-         !
-         r1_rdtice = 1. / rdt_ice
-         !
-         soce_0(:,:) = soce
-         sice_0(:,:) = sice
-         !
-         IF( cp_cfg == "orca" ) THEN           ! decrease ocean & ice reference salinities in the Baltic sea 
-            WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
-               &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
-               soce_0(:,:) = 4._wp
-               sice_0(:,:) = 2._wp
-            END WHERE
-         ENDIF
-         !
-      ENDIF
+      IF( wrk_in_use(2, 1,2) .OR. wrk_in_use(3, 4,5) ) THEN
+         CALL ctl_stop( 'lim_sbc_flx : requested workspace arrays unavailable' )   ;   RETURN
+      ENDIF
+      ! Set-up pointers to sub-arrays of 3d workspaces
+      zalb  => wrk_3d_4(:,:,1:jpl)
+      zalbp => wrk_3d_5(:,:,1:jpl)
 
       !------------------------------------------!
@@ -168,5 +172,5 @@
             ! qdtcn Energy from the turbulent oceanic heat flux heat flux coming in the lead
 
-            IF ( num_sal .EQ. 2 ) zfcm2(ji,jj) = zfcm2(ji,jj) + &
+            IF ( num_sal == 2 ) zfcm2(ji,jj) = zfcm2(ji,jj) + &
                fhbri(ji,jj) ! new contribution due to brine drainage 
 
@@ -181,5 +185,5 @@
 
             !!gm   this IF prevents the vertorisation of the whole loop
-            IF ( ( ji .EQ. jiindx ) .AND. ( jj .EQ. jjindx) ) THEN
+            IF ( ( ji == jiindx ) .AND. ( jj == jjindx) ) THEN
                WRITE(numout,*) ' lim_sbc : heat fluxes '
                WRITE(numout,*) ' qsr       : ', qsr(jiindx,jjindx)
@@ -274,19 +278,15 @@
       !   Storing the transmitted variables           !
       !-----------------------------------------------!
-
       fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction            
       tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                      
 
-#if defined key_coupled            
       !------------------------------------------------!
       !    Computation of snow/ice and ocean albedo    !
       !------------------------------------------------!
-      zalb  (:,:,:) = 0.e0
-      zalbp (:,:,:) = 0.e0
-
-      CALL albedo_ice( t_su, ht_i, ht_s, zalbp, zalb )
-
-      alb_ice(:,:,:) =  0.5 * zalbp(:,:,:) + 0.5 * zalb (:,:,:)   ! Ice albedo (mean clear and overcast skys)
-#endif
+      IF( lk_cpl ) THEN          ! coupled case
+         CALL albedo_ice( t_su, ht_i, ht_s, zalbp, zalb )                  ! snow/ice albedo
+         !
+         alb_ice(:,:,:) =  0.5_wp * zalbp(:,:,:) + 0.5_wp * zalb (:,:,:)   ! Ice albedo (mean clear and overcast skys)
+      ENDIF
 
       IF(ln_ctl) THEN
@@ -296,4 +296,8 @@
          CALL prt_ctl( tab3d_1=tn_ice, clinfo1=' lim_sbc: tn_ice : ', kdim=jpl )
       ENDIF
+      !
+      IF( wrk_not_released(2, 1,2)    .OR.   &
+          wrk_not_released(3, 4,5)  )        &
+          CALL ctl_stop( 'lim_sbc_flx: failed to release workspace arrays' )
       ! 
    END SUBROUTINE lim_sbc_flx
@@ -331,12 +335,6 @@
       REAL(wp) ::   zat_u, zutau_ice, zu_t, zmodt   ! local scalar
       REAL(wp) ::   zat_v, zvtau_ice, zv_t          !   -      -
-     !!---------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'lim_sbc_tau : LIM-3 sea-ice - surface ocean momentum fluxes'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
-      ENDIF
-
+      !!---------------------------------------------------------------------
+      !
       IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==!   (i.e. surface module time-step)
 !CDIR NOVERRCHK
@@ -360,7 +358,7 @@
          !
       ENDIF
-         !
-         !                                     !==  every ocean time-step  ==!
-         !
+      !
+      !                                      !==  every ocean time-step  ==!
+      !
       DO jj = 2, jpjm1                                !* update the stress WITHOUT a ice-ocean rotation angle
          DO ji = fs_2, fs_jpim1   ! Vect. Opt.
@@ -382,4 +380,37 @@
    END SUBROUTINE lim_sbc_tau
 
+
+   SUBROUTINE lim_sbc_init
+      !!-------------------------------------------------------------------
+      !!                  ***  ROUTINE lim_sbc_init  ***
+      !!             
+      !! ** Purpose : Preparation of the file ice_evolu for the output of
+      !!      the temporal evolution of key variables
+      !!
+      !! ** input   : Namelist namicedia
+      !!-------------------------------------------------------------------
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'lim_sbc_init : LIM-3 sea-ice - surface boundary condition'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~   '
+
+      !                                      ! allocate lim_sbc array
+      IF( lim_sbc_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_init : unable to allocate standard arrays' )
+      !
+      r1_rdtice = 1. / rdt_ice
+      !
+      soce_0(:,:) = soce                     ! constant SSS and ice salinity used in levitating sea-ice case
+      sice_0(:,:) = sice
+      !
+      IF( cp_cfg == "orca" ) THEN            ! decrease ocean & ice reference salinities in the Baltic sea 
+         WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.   &
+            &   54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp         ) 
+            soce_0(:,:) = 4._wp
+            sice_0(:,:) = 2._wp
+         END WHERE
+      ENDIF
+      !
+   END SUBROUTINE lim_sbc_init
+
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtab.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtab.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtab.F90	(revision 2715)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE limtab   ***
-   !!              transform 1D (2D) array to a 2D (1D) table
+   !!   LIM : transform 1D (2D) array to a 2D (1D) table
    !!======================================================================
 #if defined key_lim3
@@ -8,8 +8,7 @@
    !!   'key_lim3'                                      LIM3 sea-ice model
    !!----------------------------------------------------------------------
-   !!   tab_2d_1d  : 2-D to 1-D
-   !!   tab_1d_2d  : 1-D to 2-D
+   !!   tab_2d_1d  : 2-D <==> 1-D
+   !!   tab_1d_2d  : 1-D <==> 2-D
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_kind
 
@@ -17,66 +16,56 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC tab_2d_1d  ! called by lim_ther
-   PUBLIC tab_1d_2d  ! called by lim_ther
+   PUBLIC   tab_2d_1d   ! called by limthd
+   PUBLIC   tab_1d_2d   ! called by limthd
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE tab_2d_1d ( ndim1d, tab1d, tab2d, ndim2d_x, ndim2d_y, tab_ind )
-
-      INTEGER, INTENT(in) :: &
-         ndim1d, ndim2d_x, ndim2d_y
-
-      REAL(wp), DIMENSION (ndim2d_x, ndim2d_y), INTENT(in) ::  &
-         tab2d
-
-      INTEGER, DIMENSION ( ndim1d), INTENT ( in) :: &
-         tab_ind
-
-      REAL(wp), DIMENSION(ndim1d), INTENT ( out) ::  & 
-         tab1d
-
-      INTEGER ::  &
-         jn , jid, jjd
-
+   SUBROUTINE tab_2d_1d( ndim1d, tab1d, tab2d, ndim2d_x, ndim2d_y, tab_ind )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tab_2d_1d  ***
+      !!----------------------------------------------------------------------
+      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1d & 2D sizes
+      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(in   ) ::   tab2d                        ! input 2D field
+      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
+      REAL(wp), DIMENSION(ndim1d)           , INTENT(  out) ::   tab1d                        ! output 1D field
+      !
+      INTEGER ::   jn , jid, jjd
+      !!----------------------------------------------------------------------
       DO jn = 1, ndim1d
-         jid        = MOD( tab_ind(jn) - 1, ndim2d_x ) + 1
-         jjd        = ( tab_ind(jn) - 1 ) / ndim2d_x + 1
+         jid        = MOD( tab_ind(jn) - 1 , ndim2d_x ) + 1
+         jjd        =    ( tab_ind(jn) - 1 ) / ndim2d_x + 1
          tab1d( jn) = tab2d( jid, jjd)
       END DO
-
    END SUBROUTINE tab_2d_1d
 
 
-   SUBROUTINE tab_1d_2d ( ndim1d, tab2d, tab_ind, tab1d, ndim2d_x, ndim2d_y )
-
-      INTEGER, INTENT ( in) :: &
-         ndim1d, ndim2d_x, ndim2d_y
-
-      INTEGER, DIMENSION (ndim1d) , INTENT (in) :: &
-         tab_ind
-
-      REAL(wp), DIMENSION(ndim1d), INTENT (in) ::  &
-         tab1d  
-
-      REAL(wp), DIMENSION (ndim2d_x, ndim2d_y), INTENT ( out) :: &
-         tab2d
-
-      INTEGER :: &
-         jn, jid, jjd
-
+   SUBROUTINE tab_1d_2d( ndim1d, tab2d, tab_ind, tab1d, ndim2d_x, ndim2d_y )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE tab_2d_1d  ***
+      !!----------------------------------------------------------------------
+      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1d & 2D sizes
+      REAL(wp), DIMENSION(ndim1d)           , INTENT(in   ) ::   tab1d                        ! input 1D field
+      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
+      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(  out) ::   tab2d                        ! output 2D field
+      !
+      INTEGER ::   jn , jid, jjd
+      !!----------------------------------------------------------------------
       DO jn = 1, ndim1d
-         jid             = MOD( tab_ind(jn) - 1, ndim2d_x) + 1
+         jid             = MOD( tab_ind(jn) - 1 ,  ndim2d_x ) + 1
          jjd             =    ( tab_ind(jn) - 1 ) / ndim2d_x  + 1
          tab2d(jid, jjd) = tab1d( jn)
       END DO
-
    END SUBROUTINE tab_1d_2d
 
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option        Dummy module             NO LIM sea-ice model
+   !!----------------------------------------------------------------------
 #endif
+   !!======================================================================
 END MODULE limtab
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90	(revision 2715)
@@ -10,4 +10,5 @@
    !!            3.2  ! 2009-07 (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in rdmsnif
    !!            3.3  ! 2010-11 (G. Madec) corrected snow melting heat (due to factor betas)
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -46,4 +47,5 @@
    REAL(wp) ::   epsi20 = 1e-20_wp   ! constant values
    REAL(wp) ::   epsi16 = 1e-16_wp   !
+   REAL(wp) ::   epsi10 = 1e-10_wp   !
    REAL(wp) ::   epsi06 = 1e-06_wp   !
    REAL(wp) ::   epsi04 = 1e-04_wp   !
@@ -79,20 +81,24 @@
       !! ** References : H. Goosse et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zqlbsbq => wrk_2d_1   ! 2D workspace
+      !
       INTEGER, INTENT(in) ::   kt    ! number of iteration
       !!
       INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
       INTEGER  ::   nbpb             ! nb of icy pts for thermo. cal.
-      REAL(wp) ::   zfric_umin = 5e-03    ! lower bound for the friction velocity
-      REAL(wp) ::   zfric_umax = 2e-02    ! upper bound for the friction velocity
-      REAL(wp) ::   zinda, zindb, zthsnice, zfric_u    ! temporary scalar
-      REAL(wp) ::   zfntlat, zpareff   !    -         -
-      REAL(wp) ::   zeps, zareamin, zcoef
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqlbsbq   ! link with lead energy budget qldif
+      REAL(wp) ::   zfric_umin = 5e-03_wp    ! lower bound for the friction velocity
+      REAL(wp) ::   zfric_umax = 2e-02_wp    ! upper bound for the friction velocity
+      REAL(wp) ::   zinda, zindb, zthsnice, zfric_u     ! local scalar
+      REAL(wp) ::   zfntlat, zpareff, zareamin, zcoef   !    -         -
       !!-------------------------------------------------------------------
-      
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop( 'lim_thd : requested workspace arrays unavailable' )   ;   RETURN
+      ENDIF
+   
       !------------------------------------------------------------------------------!
       ! 1) Initialization of diagnostic variables                                    !
       !------------------------------------------------------------------------------!
-      zeps = 1.e-10
 
       !--------------------
@@ -240,5 +246,5 @@
          !------------------------------------------------------------------------------!
 
-         IF( lk_mpp )   CALL mpp_ini_ice( nbpb )
+         IF( lk_mpp )   CALL mpp_ini_ice( nbpb , numout )
 
          IF( nbpb > 0 ) THEN  ! If there is no ice, do nothing.
@@ -387,5 +393,5 @@
       !------------------------
       ! Enthalpies are global variables we have to readjust the units
-      zcoef = 1.e0 / ( unit_fac * REAL(nlay_i) )
+      zcoef = 1._wp / ( unit_fac * REAL( nlay_i ) )
       DO jl = 1, jpl
          DO jk = 1, nlay_i
@@ -399,5 +405,5 @@
       !------------------------
       ! Enthalpies are global variables we have to readjust the units
-      zcoef = 1.e0 / ( unit_fac * REAL(nlay_s) )
+      zcoef = 1._wp / ( unit_fac * REAL( nlay_s ) )
       DO jl = 1, jpl
          DO jk = 1, nlay_s
@@ -452,4 +458,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop( 'lim_thd: failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_thd
 
@@ -468,10 +476,8 @@
       !!
       INTEGER  ::   ji,jk   ! loop indices
-      REAL(wp) ::   zeps    ! very small value (1.e-10)
       !!-----------------------------------------------------------------------
-      eti(:,:) = 0.e0
-      ets(:,:) = 0.e0
-      zeps     = 1.e-10
-
+      eti(:,:) = 0._wp
+      ets(:,:) = 0._wp
+      !
       DO jk = 1, nlay_i                ! total q over all layers, ice [J.m-2]
          DO ji = kideb, kiut
@@ -483,5 +489,5 @@
          ets(ji,jl) = ets(ji,jl) + q_s_b(ji,1) * ht_s_b(ji) / nlay_s
       END DO
-
+      !
       IF(lwp) WRITE(numout,*) ' lim_thd_glohec '
       IF(lwp) WRITE(numout,*) ' qt_i_in : ', eti(jiindex_1d,jl) / rdt_ice
@@ -508,6 +514,6 @@
       !!---------------------------------------------------------------------
 
-      max_cons_err =  1.0          ! maximum tolerated conservation error
-      max_surf_err =  0.001        ! maximum tolerated surface error
+      max_cons_err =  1.0_wp          ! maximum tolerated conservation error
+      max_surf_err =  0.001_wp        ! maximum tolerated surface error
 
       !--------------------------
@@ -539,5 +545,5 @@
 
       numce  = 0
-      meance = 0.0
+      meance = 0._wp
       DO ji = kideb, kiut
          IF ( cons_error(ji,jl) .GT. max_cons_err ) THEN
@@ -546,5 +552,5 @@
          ENDIF
       END DO
-      IF( numce .GT. 0 ) meance = meance / numce
+      IF( numce > 0 )   meance = meance / numce
 
       WRITE(numout,*) ' Maximum tolerated conservation error : ', max_cons_err
@@ -557,5 +563,5 @@
       !-------------------------------------------------------
       numce  = 0
-      meance = 0.0
+      meance = 0._wp
 
       DO ji = kideb, kiut
@@ -566,5 +572,5 @@
          ENDIF
       ENDDO
-      IF( numce .GT. 0 ) meance = meance / numce
+      IF( numce > 0 )   meance = meance / numce
 
       WRITE(numout,*) ' Maximum tolerated surface error : ', max_surf_err
@@ -639,5 +645,5 @@
 
          ENDIF
-
+         !
       END DO
       !
@@ -651,47 +657,32 @@
       !! ** Purpose :   Test energy conservation after enthalpy redistr.
       !!-----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::        &
-         kideb, kiut,               &  !: bounds for the spatial loop
-         jl                            !: category number
-
-      REAL(wp)                 ::   &  !: ! goes to trash
-         meance,                    &  !: mean conservation error
-         max_cons_err                  !: maximum tolerated conservation error
-
-      INTEGER ::                    &
-         numce                         !: number of points for which conservation
-      !  is violated
-      INTEGER  ::  ji, zji, zjj        ! loop indices
+      INTEGER, INTENT(in) ::   kideb, kiut   ! bounds for the spatial loop
+      INTEGER, INTENT(in) ::   jl            ! category number
+      !
+      INTEGER  ::   ji                ! loop indices
+      INTEGER  ::   zji, zjj, numce         ! local integers
+      REAL(wp) ::   meance, max_cons_err    !local scalar
       !!---------------------------------------------------------------------
 
-      max_cons_err = 1.0
+      max_cons_err = 1._wp
 
       !--------------------------
       ! Increment of energy
       !--------------------------
-      ! global
-      DO ji = kideb, kiut
-         dq_i(ji,jl) = qt_i_fin(ji,jl) - qt_i_in(ji,jl)  &
-            + qt_s_fin(ji,jl) - qt_s_in(ji,jl)
-      END DO
-      ! layer by layer
-      dq_i_layer(:,:)    = q_i_layer_fin(:,:) - q_i_layer_in(:,:)
+      DO ji = kideb, kiut
+         dq_i(ji,jl) = qt_i_fin(ji,jl) - qt_i_in(ji,jl) + qt_s_fin(ji,jl) - qt_s_in(ji,jl)   ! global
+      END DO
+      dq_i_layer(:,:)    = q_i_layer_fin(:,:) - q_i_layer_in(:,:)                            ! layer by layer
 
       !----------------------------------------
       ! Atmospheric heat flux, ice heat budget
       !----------------------------------------
-
-      DO ji = kideb, kiut
-         zji                 = MOD( npb(ji) - 1, jpi ) + 1
-         zjj                 = ( npb(ji) - 1 ) / jpi + 1
-
-         fatm(ji,jl) = &
-            qnsr_ice_1d(ji)                  + & ! atm non solar
-            !         (1.0-i0(ji))*qsr_ice_1d(ji)          ! atm solar
-            qsr_ice_1d(ji)                       ! atm solar
-
-         sum_fluxq(ji,jl)     = fatm(ji,jl) + fbif_1d(ji) - ftotal_fin(ji) & 
-            - fstroc(zji,zjj,jl) 
-         cons_error(ji,jl)   = ABS( dq_i(ji,jl) / rdt_ice + sum_fluxq(ji,jl) )
+      DO ji = kideb, kiut
+         zji = MOD( npb(ji) - 1 , jpi ) + 1
+         zjj =    ( npb(ji) - 1 ) / jpi + 1
+
+         fatm      (ji,jl) = qnsr_ice_1d(ji) + qsr_ice_1d(ji)                       ! total heat flux
+         sum_fluxq (ji,jl) = fatm(ji,jl) + fbif_1d(ji) - ftotal_fin(ji) - fstroc(zji,zjj,jl) 
+         cons_error(ji,jl) = ABS( dq_i(ji,jl) / rdt_ice + sum_fluxq(ji,jl) )
       END DO
 
@@ -699,5 +690,4 @@
       ! Conservation error
       !--------------------
-
       DO ji = kideb, kiut
          cons_error(ji,jl) = ABS( dq_i(ji,jl) / rdt_ice + sum_fluxq(ji,jl) )
@@ -705,12 +695,12 @@
 
       numce = 0
-      meance = 0.0
-      DO ji = kideb, kiut
-         IF ( cons_error(ji,jl) .GT. max_cons_err ) THEN
+      meance = 0._wp
+      DO ji = kideb, kiut
+         IF( cons_error(ji,jl) .GT. max_cons_err ) THEN
             numce = numce + 1
             meance = meance + cons_error(ji,jl)
          ENDIF
       ENDDO
-      IF (numce .GT. 0 ) meance = meance / numce
+      IF(numce > 0 ) meance = meance / numce
 
       WRITE(numout,*) ' Error report - Category : ', jl
@@ -718,6 +708,5 @@
       WRITE(numout,*) ' Maximum tolerated conservation error : ', max_cons_err
       WRITE(numout,*) ' After lim_thd_ent, category : ', jl
-      WRITE(numout,*) ' Mean conservation error on big error points ', meance, &
-         numit
+      WRITE(numout,*) ' Mean conservation error on big error points ', meance, numit
       WRITE(numout,*) ' Number of points where there is a cons err gt than 0.1 W/m2 : ', numce, numit
 
@@ -727,6 +716,6 @@
       DO ji = kideb, kiut
          IF ( cons_error(ji,jl) .GT. max_cons_err  ) THEN
-            zji                 = MOD( npb(ji) - 1, jpi ) + 1
-            zjj                 = ( npb(ji) - 1 ) / jpi + 1
+            zji = MOD( npb(ji) - 1, jpi ) + 1
+            zjj =    ( npb(ji) - 1 ) / jpi + 1
             !
             WRITE(numout,*) ' alerte 1 - category : ', jl
@@ -779,8 +768,7 @@
       INTEGER, INTENT(in) ::   kideb, kiut   ! bounds for the spatial loop
       !!
-      INTEGER  ::   ji, jk   !dummy loop indices
-      REAL(wp) ::   ztmelts, zeps   ! temporary scalar 
+      INTEGER  ::   ji, jk   ! dummy loop indices
+      REAL(wp) ::   ztmelts  ! local scalar 
       !!-------------------------------------------------------------------
-      zeps = 1.e-10
       !
       DO jk = 1, nlay_i             ! Sea ice energy of melting
@@ -788,10 +776,10 @@
             ztmelts      =  - tmut  * s_i_b(ji,jk) + rtt 
             q_i_b(ji,jk) =    rhoic * ( cpic * ( ztmelts - t_i_b(ji,jk) )                                 &
-               &                      + lfus * ( 1.0 - (ztmelts-rtt) / MIN( t_i_b(ji,jk)-rtt, -zeps ) )   &
+               &                      + lfus * ( 1.0 - (ztmelts-rtt) / MIN( t_i_b(ji,jk)-rtt, -epsi10 ) )   &
                &                      - rcp  * ( ztmelts-rtt  )  ) 
          END DO
       END DO
       DO jk = 1, nlay_s             ! Snow energy of melting
-         DO ji = kideb,kiut
+         DO ji = kideb, kiut
             q_s_b(ji,jk) = rhosn * ( cpic * ( rtt - t_s_b(ji,jk) ) + lfus )
          END DO
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90	(revision 2715)
@@ -7,4 +7,5 @@
    !!                 ! 2005-06 (M. Vancoppenolle) 3D version 
    !!            3.2  ! 2009-07 (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in rdmsnif & rdmicif
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -17,9 +18,10 @@
    USE phycst           ! physical constants (OCE directory) 
    USE sbc_oce          ! Surface boundary condition: ocean fields
-   USE ice
-   USE par_ice
-   USE thd_ice
-   USE in_out_manager
-   USE lib_mpp
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE thd_ice          ! LIM thermodynamics
+   USE wrk_nemo         ! workspace manager
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -35,12 +37,11 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
-   SUBROUTINE lim_thd_dh(kideb,kiut,jl)
+   SUBROUTINE lim_thd_dh( kideb, kiut, jl )
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_thd_dh  ***
@@ -75,9 +76,11 @@
       INTEGER  ::   i_ice_switch   ! ice thickness above a certain treshold or not
       INTEGER  ::   iter
-
-      REAL(wp) ::   zzfmass_i, zzfmass_s   ! temporary scalar
-      REAL(wp) ::   zhsnew, zihgnew, ztmelts               ! temporary scalar
+      INTEGER  ::   num_iter_max, numce_dh
+
+      REAL(wp) ::   meance_dh
+      REAL(wp) ::   zzfmass_i, zihgnew                     ! local scalar
+      REAL(wp) ::   zzfmass_s, zhsnew, ztmelts             ! local scalar
       REAL(wp) ::   zhn, zdhcf, zdhbf, zhni, zhnfi, zihg   !
-      REAL(wp) ::   zdhnm, zhnnew, zhisn, zihic            !
+      REAL(wp) ::   zdhnm, zhnnew, zhisn, zihic, zzc       !
       REAL(wp) ::   zfracs       ! fractionation coefficient for bottom salt entrapment
       REAL(wp) ::   zds          ! increment of bottom ice salinity
@@ -89,43 +92,49 @@
       REAL(wp) ::   zgrr         ! bottom growth rate
       REAL(wp) ::   ztform       ! bottom formation temperature
-
-      REAL(wp), DIMENSION(jpij) ::   zh_i        ! ice layer thickness
-      REAL(wp), DIMENSION(jpij) ::   zh_s        ! snow layer thickness
-      REAL(wp), DIMENSION(jpij) ::   ztfs        ! melting point
-      REAL(wp), DIMENSION(jpij) ::   zhsold      ! old snow thickness
-      REAL(wp), DIMENSION(jpij) ::   zqprec      ! energy of fallen snow
-      REAL(wp), DIMENSION(jpij) ::   zqfont_su   ! incoming, remaining surface energy
-      REAL(wp), DIMENSION(jpij) ::   zqfont_bo   ! incoming, bottom energy
-      REAL(wp), DIMENSION(jpij) ::   z_f_surf    ! surface heat for ablation
-      REAL(wp), DIMENSION(jpij) ::   zhgnew      ! new ice thickness
-      REAL(wp), DIMENSION(jpij) ::   zfmass_i    ! 
-
-      REAL(wp), DIMENSION(jpij) ::   zdh_s_mel     ! snow melt 
-      REAL(wp), DIMENSION(jpij) ::   zdh_s_pre     ! snow precipitation 
-      REAL(wp), DIMENSION(jpij) ::   zdh_s_sub     ! snow sublimation
-      REAL(wp), DIMENSION(jpij) ::   zfsalt_melt   ! salt flux due to ice melt
-
-      REAL(wp) , DIMENSION(jpij,jkmax) ::   zdeltah
-
-      ! Pathological cases
-      REAL(wp), DIMENSION(jpij) ::   zfdt_init   ! total incoming heat for ice melt
-      REAL(wp), DIMENSION(jpij) ::   zfdt_final  ! total remaing heat for ice melt
-      REAL(wp), DIMENSION(jpij) ::   zqt_i       ! total ice heat content
-      REAL(wp), DIMENSION(jpij) ::   zqt_s       ! total snow heat content
-      REAL(wp), DIMENSION(jpij) ::   zqt_dummy   ! dummy heat content
-
+      !
+      REAL(wp), POINTER, DIMENSION(:) ::   zh_i, ztfs  , zqfont_su, zqprec  , zhgnew
+      REAL(wp), POINTER, DIMENSION(:) ::   zh_s, zhsold, zqfont_bo, z_f_surf, zfmass_i
+      REAL(wp), POINTER, DIMENSION(:) ::   zdh_s_mel, zdh_s_sub  , zfdt_init , zqt_i, zqt_dummy, zdq_i
+      REAL(wp), POINTER, DIMENSION(:) ::   zdh_s_pre, zfsalt_melt, zfdt_final, zqt_s, zfbase   , zinnermelt
+      !
+      REAL(wp), DIMENSION(jpij,jkmax) ::   zdeltah
       REAL(wp), DIMENSION(jpij,jkmax) ::   zqt_i_lay   ! total ice heat content
-
-      ! Heat conservation 
-      INTEGER  ::   num_iter_max, numce_dh
-      REAL(wp) ::   meance_dh
-      INTEGER , DIMENSION(jpij) ::   innermelt
-      REAL(wp), DIMENSION(jpij) ::   zfbase, zdq_i
       !!------------------------------------------------------------------
 
-      zfsalt_melt(:)  = 0.0
-      ftotal_fin(:)   = 0.0
-      zfdt_init(:)    = 0.0
-      zfdt_final(:)   = 0.0
+      IF( wrk_in_use(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22) ) THEN
+         CALL ctl_stop('lim_thd_dh: requestead workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      ! Set-up pointers to sub-arrays of workspace arrays
+      zh_i        => wrk_1d_1 (1:jpij)   ! ice layer thickness
+      zh_s        => wrk_1d_2 (1:jpij)   ! snow layer thickness
+      ztfs        => wrk_1d_3 (1:jpij)   ! melting point
+      zhsold      => wrk_1d_4 (1:jpij)   ! old snow thickness
+      zqprec      => wrk_1d_5 (1:jpij)   ! energy of fallen snow
+      zqfont_su   => wrk_1d_6 (1:jpij)   ! incoming, remaining surface energy
+      zqfont_bo   => wrk_1d_7 (1:jpij)   ! incoming, bottom energy
+      z_f_surf    => wrk_1d_8 (1:jpij)   ! surface heat for ablation
+      zhgnew      => wrk_1d_9 (1:jpij)   ! new ice thickness
+      zfmass_i    => wrk_1d_10(1:jpij)   ! 
+      !
+      zdh_s_mel   => wrk_1d_11(1:jpij)   ! snow melt 
+      zdh_s_pre   => wrk_1d_12(1:jpij)   ! snow precipitation 
+      zdh_s_sub   => wrk_1d_13(1:jpij)   ! snow sublimation
+      zfsalt_melt => wrk_1d_14(1:jpij)   ! salt flux due to ice melt
+      !
+      !                              ! Pathological cases
+      zfdt_init   => wrk_1d_15(1:jpij)   ! total incoming heat for ice melt
+      zfdt_final  => wrk_1d_16(1:jpij)   ! total remaing heat for ice melt
+      zqt_i       => wrk_1d_17(1:jpij)   ! total ice heat content
+      zqt_s       => wrk_1d_18(1:jpij)   ! total snow heat content
+      zqt_dummy   => wrk_1d_19(1:jpij)   ! dummy heat content
+           
+      zfbase      => wrk_1d_20(1:jpij)        
+      zdq_i       => wrk_1d_21(1:jpij) 
+      zinnermelt  => wrk_1d_22(1:jpij) 
+
+      zfsalt_melt(:)  = 0._wp
+      ftotal_fin(:)   = 0._wp
+      zfdt_init(:)    = 0._wp
+      zfdt_final(:)   = 0._wp
 
       DO ji = kideb, kiut
@@ -138,5 +147,5 @@
       !------------------------------------------------------------------------------!
       !
-      DO ji = kideb,kiut
+      DO ji = kideb, kiut
          isnow         = INT( 1.0 - MAX ( 0.0 , SIGN ( 1.0 , - ht_s_b(ji) ) ) )
          ztfs(ji)      = isnow * rtt + ( 1.0 - isnow ) * rtt
@@ -146,8 +155,8 @@
       END DO ! ji
 
-      zqfont_su(:) = 0.0
-      zqfont_bo(:) = 0.0
-      dsm_i_se_1d(:) = 0.0     
-      dsm_i_si_1d(:) = 0.0     
+      zqfont_su  (:) = 0._wp
+      zqfont_bo  (:) = 0._wp
+      dsm_i_se_1d(:) = 0._wp     
+      dsm_i_si_1d(:) = 0._wp   
       !
       !------------------------------------------------------------------------------!
@@ -155,24 +164,22 @@
       !------------------------------------------------------------------------------!
       !
-      ! Layer thickness
-      DO ji = kideb,kiut
+      DO ji = kideb, kiut     ! Layer thickness
          zh_i(ji) = ht_i_b(ji) / nlay_i
          zh_s(ji) = ht_s_b(ji) / nlay_s
       END DO
-
-      ! Total enthalpy of the snow
-      zqt_s(:) = 0.0
+      !
+      zqt_s(:) = 0._wp        ! Total enthalpy of the snow
       DO jk = 1, nlay_s
-         DO ji = kideb,kiut
+         DO ji = kideb, kiut
             zqt_s(ji) =  zqt_s(ji) + q_s_b(ji,jk) * ht_s_b(ji) / nlay_s
          END DO
       END DO
-
-      ! Total enthalpy of the ice
-      zqt_i(:) = 0.0
+      !
+      zqt_i(:) = 0._wp        ! Total enthalpy of the ice
       DO jk = 1, nlay_i
-         DO ji = kideb,kiut
-            zqt_i(ji)        =  zqt_i(ji) + q_i_b(ji,jk) * ht_i_b(ji) / nlay_i
-            zqt_i_lay(ji,jk) =              q_i_b(ji,jk) * ht_i_b(ji) / nlay_i
+         DO ji = kideb, kiut
+            zzc = q_i_b(ji,jk) * ht_i_b(ji) / nlay_i
+            zqt_i(ji)        =  zqt_i(ji) + zzc
+            zqt_i_lay(ji,jk) =              zzc
          END DO
       END DO
@@ -201,5 +208,5 @@
          zdh_s_pre(ji) = zcoeff * sprecip_1d(ji) * rdt_ice / rhosn
       END DO
-      zdh_s_mel(:) =  0.0
+      zdh_s_mel(:) =  0._wp
 
       ! Melt of fallen snow
@@ -248,7 +255,7 @@
       !--------------------------
       DO ji = kideb, kiut 
-         dh_i_surf(ji) =  0.e0
+         dh_i_surf(ji) =  0._wp
          z_f_surf (ji) =  zqfont_su(ji) / rdt_ice ! heat conservation test
-         zdq_i    (ji) =  0.e0
+         zdq_i    (ji) =  0._wp
       END DO ! ji
 
@@ -267,6 +274,6 @@
             !
             ! contribution to ice-ocean salt flux 
-            zji = MOD( npb(ji) - 1, jpi ) + 1
-            zjj = ( npb(ji) - 1 ) / jpi + 1
+            zji = MOD( npb(ji) - 1 , jpi ) + 1
+            zjj =    ( npb(ji) - 1 ) / jpi + 1
             zfsalt_melt(ji) = zfsalt_melt(ji) + ( sss_m(zji,zjj) - sm_i_b(ji) ) * a_i_b(ji)    &
                &                              * MIN( zdeltah(ji,jk) , 0.e0 ) * rhoic / rdt_ice 
@@ -278,5 +285,5 @@
          !                  !-------------------
          numce_dh  = 0
-         meance_dh = 0.e0
+         meance_dh = 0._wp
          DO ji = kideb, kiut
             IF ( ( z_f_surf(ji) + zdq_i(ji) ) .GE. 1.0e-3 ) THEN
@@ -287,13 +294,13 @@
                WRITE(numout,*) ' ALERTE heat loss for surface melt '
                WRITE(numout,*) ' zji, zjj, jl :', zji, zjj, jl
-               WRITE(numout,*) ' ht_i_b  : ', ht_i_b(ji)
-               WRITE(numout,*) ' z_f_surf  : ', z_f_surf(ji)
-               WRITE(numout,*) ' zdq_i   : ', zdq_i(ji)
-               WRITE(numout,*) ' ht_i_b  : ', ht_i_b(ji)
-               WRITE(numout,*) ' fc_bo_i : ', fc_bo_i(ji)
-               WRITE(numout,*) ' fbif_1d : ', fbif_1d(ji)
-               WRITE(numout,*) ' qlbbq_1d: ', qlbbq_1d(ji)
-               WRITE(numout,*) ' s_i_new : ', s_i_new(ji)
-               WRITE(numout,*) ' sss_m   : ', sss_m(zji,zjj)
+               WRITE(numout,*) ' ht_i_b       : ', ht_i_b(ji)
+               WRITE(numout,*) ' z_f_surf     : ', z_f_surf(ji)
+               WRITE(numout,*) ' zdq_i        : ', zdq_i(ji)
+               WRITE(numout,*) ' ht_i_b       : ', ht_i_b(ji)
+               WRITE(numout,*) ' fc_bo_i      : ', fc_bo_i(ji)
+               WRITE(numout,*) ' fbif_1d      : ', fbif_1d(ji)
+               WRITE(numout,*) ' qlbbq_1d     : ', qlbbq_1d(ji)
+               WRITE(numout,*) ' s_i_new      : ', s_i_new(ji)
+               WRITE(numout,*) ' sss_m        : ', sss_m(zji,zjj)
             ENDIF
          END DO
@@ -440,19 +447,16 @@
       ! 4.2 Basal melt
       !----------------
-      meance_dh = 0.0
+      meance_dh = 0._wp
       numce_dh  = 0
-      innermelt(:) = 0
+      zinnermelt(:) = 0._wp
 
       DO ji = kideb, kiut
          ! heat convergence at the surface > 0
-         IF(  ( fc_bo_i(ji) + fbif_1d(ji) + qlbbq_1d(ji) ) >= 0.e0  ) THEN
-
+         IF(  ( fc_bo_i(ji) + fbif_1d(ji) + qlbbq_1d(ji) ) >= 0._wp  ) THEN
             s_i_new(ji)   =  s_i_b(ji,nlay_i)
             zqfont_bo(ji) =  rdt_ice * ( fc_bo_i(ji) + fbif_1d(ji) + qlbbq_1d(ji) )
-
-            zfbase(ji)    =  zqfont_bo(ji) / rdt_ice ! heat conservation test
-            zdq_i(ji)     =  0.e0
-
-            dh_i_bott(ji) =  0.e0
+            zfbase(ji)    =  zqfont_bo(ji) / rdt_ice     ! heat conservation test
+            zdq_i(ji)     =  0._wp
+            dh_i_bott(ji) =  0._wp
          ENDIF
       END DO
@@ -461,9 +465,9 @@
          DO ji = kideb, kiut
             IF (  ( fc_bo_i(ji) + fbif_1d(ji) + qlbbq_1d(ji) ) .GE. 0.0  ) THEN
-               ztmelts             =   - tmut * s_i_b(ji,jk) + rtt 
-               IF ( t_i_b(ji,jk) .GE. ztmelts ) THEN
+               ztmelts            =   - tmut * s_i_b(ji,jk) + rtt 
+               IF( t_i_b(ji,jk) >= ztmelts ) THEN
                   zdeltah(ji,jk)  = - zh_i(ji)
                   dh_i_bott(ji)   = dh_i_bott(ji) + zdeltah(ji,jk)
-                  innermelt(ji)   = 1
+                  zinnermelt(ji)   = 1._wp
                ELSE  ! normal ablation
                   zdeltah(ji,jk)  = - zqfont_bo(ji) / q_i_b(ji,jk)
@@ -492,17 +496,16 @@
                ENDIF
                IF ( zfbase(ji) + zdq_i(ji) .GE. 1.0e-3  ) THEN
-                  WRITE(numout,*) ' ALERTE heat loss for basal  melt '
-                  WRITE(numout,*) ' zji, zjj, jl :', zji, zjj, jl
-                  WRITE(numout,*) ' ht_i_b  : ', ht_i_b(ji)
-                  WRITE(numout,*) ' zfbase  : ', zfbase(ji)
-                  WRITE(numout,*) ' zdq_i   : ', zdq_i(ji)
-                  WRITE(numout,*) ' ht_i_b  : ', ht_i_b(ji)
-                  WRITE(numout,*) ' fc_bo_i : ', fc_bo_i(ji)
-                  WRITE(numout,*) ' fbif_1d : ', fbif_1d(ji)
-                  WRITE(numout,*) ' qlbbq_1d: ', qlbbq_1d(ji)
-                  WRITE(numout,*) ' s_i_new : ', s_i_new(ji)
-                  WRITE(numout,*) ' sss_m   : ', sss_m(zji,zjj)
+                  WRITE(numout,*) ' ALERTE heat loss for basal melt : zji, zjj, jl :', zji, zjj, jl
+                  WRITE(numout,*) ' ht_i_b    : ', ht_i_b(ji)
+                  WRITE(numout,*) ' zfbase    : ', zfbase(ji)
+                  WRITE(numout,*) ' zdq_i     : ', zdq_i(ji)
+                  WRITE(numout,*) ' ht_i_b    : ', ht_i_b(ji)
+                  WRITE(numout,*) ' fc_bo_i   : ', fc_bo_i(ji)
+                  WRITE(numout,*) ' fbif_1d   : ', fbif_1d(ji)
+                  WRITE(numout,*) ' qlbbq_1d  : ', qlbbq_1d(ji)
+                  WRITE(numout,*) ' s_i_new   : ', s_i_new(ji)
+                  WRITE(numout,*) ' sss_m     : ', sss_m(zji,zjj)
                   WRITE(numout,*) ' dh_i_bott : ', dh_i_bott(ji)
-                  WRITE(numout,*) ' innermelt : ', innermelt(ji)
+                  WRITE(numout,*) ' innermelt : ', INT( zinnermelt(ji) )
                ENDIF
             ENDIF
@@ -687,5 +690,5 @@
 
          ! Total ablation ! new lines added to debug
-         IF( ht_i_b(ji) <= 0.e0 )   a_i_b(ji) = 0.0
+         IF( ht_i_b(ji) <= 0._wp )   a_i_b(ji) = 0._wp
 
          ! diagnostic ( snow ice growth )
@@ -695,5 +698,8 @@
          !
       END DO !ji
-
+      !
+      IF( wrk_not_released(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21) )   &
+          CALL ctl_stop('lim_thd_dh : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_thd_dh
    
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dif.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dif.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_dif.F90	(revision 2715)
@@ -5,4 +5,9 @@
    !!                   computation of surface and inner T  
    !!======================================================================
+   !! History :  LIM  ! 02-2003 (M. Vancoppenolle) original 1D code
+   !!                 ! 06-2005 (M. Vancoppenolle) 3d version
+   !!                 ! 11-2006 (X Fettweis) Vectorization by Xavier
+   !!                 ! 04-2007 (M. Vancoppenolle) Energy conservation
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -12,9 +17,9 @@
    USE par_oce          ! ocean parameters
    USE phycst           ! physical constants (ocean directory) 
-   USE thd_ice
-   USE in_out_manager
-   USE ice
-   USE par_ice
-   USE lib_mpp 
+   USE ice              ! LIM-3 variables
+   USE par_ice          ! LIM-3 parameters
+   USE thd_ice          ! LIM-3: thermodynamics
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -23,12 +28,9 @@
    PUBLIC   lim_thd_dif   ! called by lim_thd
 
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1e-20   ,  &
-      epsi13 = 1e-13   ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0
+   REAL(wp) ::   epsi20 = 1e-20     ! constant values
+   REAL(wp) ::   epsi13 = 1e-13     ! constant values
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -95,10 +97,9 @@
       !! * Local variables
       INTEGER ::   ji,       &   ! spatial loop index
-         zji, zjj, &   ! temporary dummy loop index
+         ii, ij, &   ! temporary dummy loop index
          numeq,    &   ! current reference number of equation
          layer,    &   ! vertical dummy loop index 
          nconv,    &   ! number of iterations in iterative procedure
-         minnumeqmin, & !
-         maxnumeqmax
+         minnumeqmin, maxnumeqmax
 
       INTEGER , DIMENSION(kiut) :: &
@@ -137,11 +138,9 @@
          zdiagbis
 
-      REAL(wp) , DIMENSION(kiut,jkmax+2,3) ::  &
-         ztrid          ! tridiagonal system terms
+      REAL(wp) , DIMENSION(kiut,jkmax+2,3) ::   ztrid   ! tridiagonal system terms
 
       REAL(wp), DIMENSION(kiut) ::  &
          ztfs     ,   & ! ice melting point
-         ztsuold  ,   & ! old surface temperature (before the iterative
-                                !          procedure )
+         ztsuold  ,   & ! old surface temperature (before the iterative procedure )
          ztsuoldit,   & ! surface temperature at previous iteration
          zh_i     ,   & !ice layer thickness
@@ -152,22 +151,19 @@
 
       REAL(wp)  ::           &  ! constant values
-         zeps      =  1.0e-10,   & !
-         zg1s      =  2.0,       & !: for the tridiagonal system
-         zg1       =  2.0,       &
-         zgamma    =  18009.0,   & !: for specific heat
-         zbeta     =  0.117,     & !: for thermal conductivity (could be 0.13)
-         zraext_s  =  1.0e08,    & !: extinction coefficient of radiation in the snow
-         zkimin    =  0.10 ,     & !: minimum ice thermal conductivity
-         zht_smin  =  1.0e-4       !: minimum snow depth
-
-      REAL(wp)  ::          &  ! local variables 
-         ztmelt_i,           &  ! ice melting temperature
-         zerritmax              ! current maximal error on temperature 
-
-      REAL(wp), DIMENSION(kiut)  :: &
-         zerrit,             &  ! current error on temperature 
-         zdifcase,           &  ! case of the equation resolution (1->4)
-         zftrice,            &  ! solar radiation transmitted through the ice
-         zihic, zhsu
+         zeps      =  1.e-10_wp,   & !
+         zg1s      =  2._wp,       & !: for the tridiagonal system
+         zg1       =  2._wp,       &
+         zgamma    =  18009._wp,   & !: for specific heat
+         zbeta     =  0.117_wp,    & !: for thermal conductivity (could be 0.13)
+         zraext_s  =  1.e+8_wp,    & !: extinction coefficient of radiation in the snow
+         zkimin    =  0.10_wp ,    & !: minimum ice thermal conductivity
+         zht_smin  =  1.e-4_wp       !: minimum snow depth
+
+      REAL(wp) ::   ztmelt_i    ! ice melting temperature
+      REAL(wp) ::   zerritmax   ! current maximal error on temperature 
+      REAL(wp), DIMENSION(kiut) ::   zerrit       ! current error on temperature 
+      REAL(wp), DIMENSION(kiut) ::   zdifcase     ! case of the equation resolution (1->4)
+      REAL(wp), DIMENSION(kiut) ::   zftrice      ! solar radiation transmitted through the ice
+      REAL(wp), DIMENSION(kiut) ::   zihic, zhsu
       !!------------------------------------------------------------------
       !
@@ -178,10 +174,11 @@
       DO ji = kideb , kiut
          ! is there snow or not
-         isnow(ji)= INT ( 1.0 - MAX( 0.0 , SIGN (1.0, - ht_s_b(ji) ) ) )
+         isnow(ji)= INT(  1._wp - MAX( 0._wp , SIGN(1._wp, - ht_s_b(ji) ) )  )
          ! surface temperature of fusion
+!!gm ???  ztfs(ji) = rtt !!!????
          ztfs(ji) = isnow(ji) * rtt + (1.0-isnow(ji)) * rtt
          ! layer thickness
-         zh_i(ji)              = ht_i_b(ji) / nlay_i
-         zh_s(ji)              = ht_s_b(ji) / nlay_s
+         zh_i(ji) = ht_i_b(ji) / nlay_i
+         zh_s(ji) = ht_s_b(ji) / nlay_s
       END DO
 
@@ -190,18 +187,16 @@
       !--------------------
 
-      z_s(:,0)      = 0.0 ! vert. coord. of the up. lim. of the 1st snow layer
-      z_i(:,0)      = 0.0 ! vert. coord. of the up. lim. of the 1st ice layer
-
-      DO layer = 1, nlay_s
-         DO ji = kideb , kiut
-            ! vert. coord of the up. lim. of the layer-th snow layer
-            z_s(ji,layer)      = z_s(ji,layer-1) + ht_s_b(ji) / nlay_s
-         END DO
-      END DO
-
-      DO layer = 1, nlay_i
-         DO ji = kideb , kiut
-            ! vert. coord of the up. lim. of the layer-th ice layer
-            z_i(ji,layer)      = z_i(ji,layer-1) + ht_i_b(ji) / nlay_i
+      z_s(:,0) = 0._wp   ! vert. coord. of the up. lim. of the 1st snow layer
+      z_i(:,0) = 0._wp   ! vert. coord. of the up. lim. of the 1st ice layer
+
+      DO layer = 1, nlay_s            ! vert. coord of the up. lim. of the layer-th snow layer
+         DO ji = kideb , kiut
+            z_s(ji,layer) = z_s(ji,layer-1) + ht_s_b(ji) / nlay_s
+         END DO
+      END DO
+
+      DO layer = 1, nlay_i            ! vert. coord of the up. lim. of the layer-th ice layer
+         DO ji = kideb , kiut
+            z_i(ji,layer) = z_i(ji,layer-1) + ht_i_b(ji) / nlay_i
          END DO
       END DO
@@ -224,11 +219,10 @@
       DO ji = kideb , kiut
          ! switches
-         isnow(ji)  = INT ( 1.0 - MAX ( 0.0 , SIGN ( 1.0 , - ht_s_b(ji) ) ) ) 
+         isnow(ji) = INT(  1._wp - MAX( 0._wp , SIGN( 1._wp , - ht_s_b(ji) ) )  ) 
          ! hs > 0, isnow = 1
-         zhsu(ji)   = hnzst  !threshold for the computation of i0
-         zihic(ji)  = MAX( zzero , 1.0 - ( ht_i_b(ji) / zhsu(ji) ) )     
-
-         i0(ji)     = ( 1.0 - isnow(ji) ) * &
-            ( fr1_i0_1d(ji) + zihic(ji) * fr2_i0_1d(ji) )
+         zhsu (ji) = hnzst  ! threshold for the computation of i0
+         zihic(ji) = MAX( 0._wp , 1._wp - ( ht_i_b(ji) / zhsu(ji) ) )     
+
+         i0(ji)    = ( 1._wp - isnow(ji) ) * ( fr1_i0_1d(ji) + zihic(ji) * fr2_i0_1d(ji) )
          !fr1_i0_1d = i0 for a thin ice surface
          !fr1_i0_2d = i0 for a thick ice surface
@@ -244,14 +238,7 @@
       !-------------------------------------------------------
       DO ji = kideb , kiut
-
-         ! Shortwave radiation absorbed at surface
-         zfsw(ji)   =  qsr_ice_1d(ji) * ( 1 - i0(ji) )
-
-         ! Solar radiation transmitted below the surface layer
-         zftrice(ji)=  qsr_ice_1d(ji) * i0(ji)
-
-         ! derivative of incoming nonsolar flux 
-         dzf(ji)   =    dqns_ice_1d(ji)  
-
+         zfsw   (ji) =  qsr_ice_1d(ji) * ( 1 - i0(ji) )   ! Shortwave radiation absorbed at surface
+         zftrice(ji) =  qsr_ice_1d(ji) *       i0(ji)     ! Solar radiation transmitted below the surface layer
+         dzf    (ji) = dqns_ice_1d(ji)                    ! derivative of incoming nonsolar flux 
       END DO
 
@@ -260,54 +247,45 @@
       !---------------------------------------------------------
 
-      DO ji = kideb , kiut
-         ! Initialization
-         zradtr_s(ji,0) = zftrice(ji) ! radiation penetrating through snow
-      END DO
-
-      ! Radiation through snow
-      DO layer = 1, nlay_s
-         DO ji = kideb , kiut
-            ! radiation transmitted below the layer-th snow layer
-            zradtr_s(ji,layer) = zradtr_s(ji,0) * EXP ( - zraext_s * ( MAX ( 0.0 , &
-               z_s(ji,layer) ) ) )
-            ! radiation absorbed by the layer-th snow layer
+      DO ji = kideb, kiut           ! snow initialization
+         zradtr_s(ji,0) = zftrice(ji)     ! radiation penetrating through snow
+      END DO
+
+      DO layer = 1, nlay_s          ! Radiation through snow
+         DO ji = kideb, kiut
+            !                             ! radiation transmitted below the layer-th snow layer
+            zradtr_s(ji,layer) = zradtr_s(ji,0) * EXP( - zraext_s * ( MAX ( 0._wp , z_s(ji,layer) ) ) )
+            !                             ! radiation absorbed by the layer-th snow layer
             zradab_s(ji,layer) = zradtr_s(ji,layer-1) - zradtr_s(ji,layer)
          END DO
       END DO
 
-      ! Radiation through ice
-      DO ji = kideb , kiut
-         zradtr_i(ji,0)        = zradtr_s(ji,nlay_s) * isnow(ji) + & 
-            zftrice(ji) * ( 1 - isnow(ji) )
-      END DO
-
-      DO layer = 1, nlay_i
-         DO ji = kideb , kiut
-            ! radiation transmitted below the layer-th ice layer
-            zradtr_i(ji,layer) = zradtr_i(ji,0) * EXP ( - kappa_i * ( MAX ( 0.0 , &
-               z_i(ji,layer) ) ) )
-            ! radiation absorbed by the layer-th ice layer
+      DO ji = kideb, kiut           ! ice initialization
+         zradtr_i(ji,0) = zradtr_s(ji,nlay_s) * isnow(ji) + zftrice(ji) * ( 1._wp - isnow(ji) )
+      END DO
+
+      DO layer = 1, nlay_i          ! Radiation through ice
+         DO ji = kideb, kiut
+            !                             ! radiation transmitted below the layer-th ice layer
+            zradtr_i(ji,layer) = zradtr_i(ji,0) * EXP( - kappa_i * ( MAX ( 0._wp , z_i(ji,layer) ) ) )
+            !                             ! radiation absorbed by the layer-th ice layer
             zradab_i(ji,layer) = zradtr_i(ji,layer-1) - zradtr_i(ji,layer)
          END DO
       END DO
 
-      ! Radiation transmitted below the ice
-      DO ji = kideb , kiut
-         fstbif_1d(ji)  =  fstbif_1d(ji) + &
-            zradtr_i(ji,nlay_i) * a_i_b(ji) / at_i_b(ji)
+      DO ji = kideb, kiut           ! Radiation transmitted below the ice
+         fstbif_1d(ji) = fstbif_1d(ji) + zradtr_i(ji,nlay_i) * a_i_b(ji) / at_i_b(ji)
       END DO
 
       ! +++++
       ! just to check energy conservation
-      DO ji = kideb , kiut
-         zji                 = MOD( npb(ji) - 1, jpi ) + 1
-         zjj                 = ( npb(ji) - 1 ) / jpi + 1
-         fstroc(zji,zjj,jl)  = &
-            zradtr_i(ji,nlay_i)
+      DO ji = kideb, kiut
+         ii                = MOD( npb(ji) - 1, jpi ) + 1
+         ij                = ( npb(ji) - 1 ) / jpi + 1
+         fstroc(ii,ij,jl) = zradtr_i(ji,nlay_i)
       END DO
       ! +++++
 
       DO layer = 1, nlay_i
-         DO ji = kideb , kiut
+         DO ji = kideb, kiut
             radab(ji,layer) = zradab_i(ji,layer)
          END DO
@@ -320,34 +298,29 @@
       !------------------------------------------------------------------------------|
       !
-      ! Old surface temperature
-      DO ji = kideb, kiut
-         ztsuold(ji)          =  t_su_b(ji) ! temperature at the beg of iter pr.
-         ztsuoldit(ji)        =  t_su_b(ji) ! temperature at the previous iter
-         t_su_b(ji)           =  MIN(t_su_b(ji),ztfs(ji)-0.00001) !necessary
-         zerrit(ji)           =  1000.0     ! initial value of error
-      END DO
-      !RB Min global ??
-
-      ! Old snow temperature
-      DO layer = 1, nlay_s
-         DO ji = kideb , kiut
-            ztsold(ji,layer)     =  t_s_b(ji,layer)
-         END DO
-      END DO
-
-      ! Old ice temperature
-      DO layer = 1, nlay_i
-         DO ji = kideb , kiut
-            ztiold(ji,layer)     =  t_i_b(ji,layer)
-         END DO
-      END DO
-
-      nconv     =  0         ! number of iterations
-      zerritmax =  1000.0    ! maximal value of error on all points
-
-      DO WHILE ((zerritmax > maxer_i_thd).AND.(nconv < nconv_i_thd))
-
-         nconv   =  nconv+1
-
+      DO ji = kideb, kiut        ! Old surface temperature
+         ztsuold  (ji) =  t_su_b(ji)                              ! temperature at the beg of iter pr.
+         ztsuoldit(ji) =  t_su_b(ji)                              ! temperature at the previous iter
+         t_su_b   (ji) =  MIN( t_su_b(ji), ztfs(ji)-0.00001 )     ! necessary
+         zerrit   (ji) =  1000._wp                                ! initial value of error
+      END DO
+
+      DO layer = 1, nlay_s       ! Old snow temperature
+         DO ji = kideb , kiut
+            ztsold(ji,layer) =  t_s_b(ji,layer)
+         END DO
+      END DO
+
+      DO layer = 1, nlay_i       ! Old ice temperature
+         DO ji = kideb , kiut
+            ztiold(ji,layer) =  t_i_b(ji,layer)
+         END DO
+      END DO
+
+      nconv     =  0           ! number of iterations
+      zerritmax =  1000._wp    ! maximal value of error on all points
+
+      DO WHILE ( zerritmax > maxer_i_thd .AND. nconv < nconv_i_thd )
+         !
+         nconv = nconv + 1
          !
          !------------------------------------------------------------------------------|
@@ -355,6 +328,5 @@
          !------------------------------------------------------------------------------|
          !
-         IF ( thcon_i_swi .EQ. 0 ) THEN
-            ! Untersteiner (1964) formula
+         IF( thcon_i_swi == 0 ) THEN      ! Untersteiner (1964) formula
             DO ji = kideb , kiut
                ztcond_i(ji,0)        = rcdic + zbeta*s_i_b(ji,1) / &
@@ -362,18 +334,4 @@
                ztcond_i(ji,0)        = MAX(ztcond_i(ji,0),zkimin)
             END DO
-         ENDIF
-
-         IF ( thcon_i_swi .EQ. 1 ) THEN
-            ! Pringle et al formula included,
-            ! 2.11 + 0.09 S/T - 0.011.T
-            DO ji = kideb , kiut
-               ztcond_i(ji,0)        = rcdic + 0.09*s_i_b(ji,1) / &
-                  MIN(-zeps,t_i_b(ji,1)-rtt) - &
-                  0.011* ( t_i_b(ji,1) - rtt )  
-               ztcond_i(ji,0)        = MAX(ztcond_i(ji,0),zkimin)
-            END DO
-         ENDIF
-
-         IF ( thcon_i_swi .EQ. 0 ) THEN ! Untersteiner
             DO layer = 1, nlay_i-1
                DO ji = kideb , kiut
@@ -406,10 +364,22 @@
          ENDIF
 
-         IF ( thcon_i_swi .EQ. 1 ) THEN ! Pringle
-            DO ji = kideb , kiut
-               ztcond_i(ji,nlay_i)   = rcdic + 0.09*s_i_b(ji,nlay_i) / &
-                  MIN(-zeps,t_bo_b(ji)-rtt) - &
-                  0.011* ( t_bo_b(ji) - rtt )  
-               ztcond_i(ji,nlay_i)   = MAX(ztcond_i(ji,nlay_i),zkimin)
+         IF( thcon_i_swi == 1 ) THEN      ! Pringle et al formula included: 2.11 + 0.09 S/T - 0.011.T
+            DO ji = kideb , kiut
+               ztcond_i(ji,0) = rcdic + 0.090_wp * s_i_b(ji,1) / MIN( -zeps, t_i_b(ji,1)-rtt )   &
+                  &                   - 0.011_wp * ( t_i_b(ji,1) - rtt )  
+               ztcond_i(ji,0) = MAX( ztcond_i(ji,0), zkimin )
+            END DO
+            DO layer = 1, nlay_i-1
+               DO ji = kideb , kiut
+                  ztcond_i(ji,layer) = rcdic + 0.090_wp * ( s_i_b(ji,layer) + s_i_b(ji,layer+1) )   &
+                     &                                  / MIN(-2.0*zeps, t_i_b(ji,layer)+t_i_b(ji,layer+1)-2.0*rtt)   &
+                     &                       - 0.0055_wp* ( t_i_b(ji,layer) + t_i_b(ji,layer+1) - 2.0*rtt )  
+                  ztcond_i(ji,layer) = MAX( ztcond_i(ji,layer), zkimin )
+               END DO
+            END DO
+            DO ji = kideb , kiut
+               ztcond_i(ji,nlay_i) = rcdic + 0.090_wp * s_i_b(ji,nlay_i) / MIN(-zeps,t_bo_b(ji)-rtt)   &
+                  &                        - 0.011_wp * ( t_bo_b(ji) - rtt )  
+               ztcond_i(ji,nlay_i) = MAX( ztcond_i(ji,nlay_i), zkimin )
             END DO
          ENDIF
@@ -732,11 +702,9 @@
 
             ! surface temperature
-            isnow(ji)            = INT(1.0-max(0.0,sign(1.0,-ht_s_b(ji))))
-            ztsuoldit(ji)        = t_su_b(ji)
+            isnow(ji)     = INT(1.0-max(0.0,sign(1.0,-ht_s_b(ji))))
+            ztsuoldit(ji) = t_su_b(ji)
             IF (t_su_b(ji) .LT. ztfs(ji)) &
-               t_su_b(ji)           = ( zindtbis(ji,numeqmin(ji)) - ztrid(ji,numeqmin(ji),3)* &
-               ( isnow(ji)*t_s_b(ji,1) + &
-               (1.0-isnow(ji))*t_i_b(ji,1) ) ) / &
-               zdiagbis(ji,numeqmin(ji))  
+               t_su_b(ji) = ( zindtbis(ji,numeqmin(ji)) - ztrid(ji,numeqmin(ji),3)* ( isnow(ji)*t_s_b(ji,1)   &
+               &          + (1.0-isnow(ji))*t_i_b(ji,1) ) ) / zdiagbis(ji,numeqmin(ji))  
          END DO
          !
@@ -748,15 +716,14 @@
          ! zerrit(ji) is a measure of error, it has to be under maxer_i_thd
          DO ji = kideb , kiut
-            t_su_b(ji)          =  MAX(MIN(t_su_b(ji),ztfs(ji)),190.0)
-            zerrit(ji)          =  ABS(t_su_b(ji)-ztsuoldit(ji))     
+            t_su_b(ji) =  MAX(  MIN( t_su_b(ji) , ztfs(ji) ) , 190._wp  )
+            zerrit(ji) =  ABS( t_su_b(ji) - ztsuoldit(ji) )     
          END DO
 
          DO layer  =  1, nlay_s
             DO ji = kideb , kiut
-               zji                 = MOD( npb(ji) - 1, jpi ) + 1
-               zjj                 = ( npb(ji) - 1 ) / jpi + 1
-               t_s_b(ji,layer)  =  MAX(MIN(t_s_b(ji,layer),rtt),190.0)
-               zerrit(ji)       =  MAX(zerrit(ji),ABS(t_s_b(ji,layer) &
-                  -  ztstemp(ji,layer)))
+               ii = MOD( npb(ji) - 1, jpi ) + 1
+               ij = ( npb(ji) - 1 ) / jpi + 1
+               t_s_b(ji,layer) = MAX(  MIN( t_s_b(ji,layer), rtt ), 190._wp  )
+               zerrit(ji)      = MAX(zerrit(ji),ABS(t_s_b(ji,layer) - ztstemp(ji,layer)))
             END DO
          END DO
@@ -764,18 +731,17 @@
          DO layer  =  1, nlay_i
             DO ji = kideb , kiut
-               ztmelt_i         = -tmut*s_i_b(ji,layer) +rtt 
-               t_i_b(ji,layer)  =  MAX(MIN(t_i_b(ji,layer),ztmelt_i),190.0)
-               zerrit(ji)       =  MAX(zerrit(ji),ABS(t_i_b(ji,layer) - ztitemp(ji,layer)))
+               ztmelt_i        = -tmut * s_i_b(ji,layer) + rtt 
+               t_i_b(ji,layer) =  MAX(MIN(t_i_b(ji,layer),ztmelt_i),190.0)
+               zerrit(ji)      =  MAX(zerrit(ji),ABS(t_i_b(ji,layer) - ztitemp(ji,layer)))
             END DO
          END DO
 
          ! Compute spatial maximum over all errors
-         ! note that this could be optimized substantially by iterating only
-         ! the non-converging points
-         zerritmax = 0.0
-         DO ji = kideb , kiut
-            zerritmax           =  MAX(zerritmax,zerrit(ji))   
-         END DO
-         IF( lk_mpp ) CALL mpp_max(zerritmax, kcom=ncomm_ice)
+         ! note that this could be optimized substantially by iterating only the non-converging points
+         zerritmax = 0._wp
+         DO ji = kideb, kiut
+            zerritmax = MAX( zerritmax, zerrit(ji) )   
+         END DO
+         IF( lk_mpp ) CALL mpp_max( zerritmax, kcom=ncomm_ice )
 
       END DO  ! End of the do while iterative procedure
@@ -787,24 +753,16 @@
 
       !
-      !--------------------------------------------------------------------------
-      !   11) Fluxes at the interfaces                                          |
-      !--------------------------------------------------------------------------
-      !
+      !-------------------------------------------------------------------------!
+      !   11) Fluxes at the interfaces                                          !
+      !-------------------------------------------------------------------------!
       DO ji = kideb, kiut
-         ! update of latent heat fluxes
-         qla_ice_1d (ji) = qla_ice_1d (ji) + &
-            dqla_ice_1d(ji) * ( t_su_b(ji) - ztsuold(ji) )
-
-         ! surface ice conduction flux
-         isnow(ji)       = int(1.0-max(0.0,sign(1.0,-ht_s_b(ji))))
-         fc_su(ji)       =  - isnow(ji)*zkappa_s(ji,0)*zg1s*(t_s_b(ji,1) - &
-            t_su_b(ji)) &
-            - (1.0-isnow(ji))*zkappa_i(ji,0)*zg1* &
-            (t_i_b(ji,1) - t_su_b(ji))
-
-         ! bottom ice conduction flux
-         fc_bo_i(ji)     =  - zkappa_i(ji,nlay_i)* &
-            ( zg1*(t_bo_b(ji) - t_i_b(ji,nlay_i)) )
-
+         !                                ! update of latent heat fluxes
+         qla_ice_1d (ji) = qla_ice_1d (ji) + dqla_ice_1d(ji) * ( t_su_b(ji) - ztsuold(ji) )
+         !                                ! surface ice conduction flux
+         isnow(ji)       = INT(  1._wp - MAX( 0._wp, SIGN( 1._wp, -ht_s_b(ji) ) )  )
+         fc_su(ji)       =  -           isnow(ji)   * zkappa_s(ji,0) * zg1s * (t_s_b(ji,1) - t_su_b(ji))   &
+            &               - ( 1._wp - isnow(ji) ) * zkappa_i(ji,0) * zg1  * (t_i_b(ji,1) - t_su_b(ji))
+         !                                ! bottom ice conduction flux
+         fc_bo_i(ji)     =  - zkappa_i(ji,nlay_i) * ( zg1*(t_bo_b(ji) - t_i_b(ji,nlay_i)) )
       END DO
 
@@ -812,19 +770,12 @@
       ! Heat conservation       !
       !-------------------------!
-      IF ( con_i ) THEN
-
+      IF( con_i ) THEN
          DO ji = kideb, kiut
             ! Upper snow value
-            fc_s(ji,0) = - isnow(ji)* &
-               zkappa_s(ji,0) * zg1s * ( t_s_b(ji,1) - &
-               t_su_b(ji) ) 
+            fc_s(ji,0) = - isnow(ji) * zkappa_s(ji,0) * zg1s * ( t_s_b(ji,1) - t_su_b(ji) ) 
             ! Bott. snow value
-            fc_s(ji,1) = - isnow(ji)* &
-               zkappa_s(ji,1) * ( t_i_b(ji,1) - &
-               t_s_b(ji,1) ) 
-         END DO
-
-         ! Upper ice layer
-         DO ji = kideb, kiut
+            fc_s(ji,1) = - isnow(ji)* zkappa_s(ji,1) * ( t_i_b(ji,1) - t_s_b(ji,1) ) 
+         END DO
+         DO ji = kideb, kiut         ! Upper ice layer
             fc_i(ji,0) = - isnow(ji) * &  ! interface flux if there is snow
                ( zkappa_i(ji,0)  * ( t_i_b(ji,1) - t_s_b(ji,nlay_s ) ) ) &
@@ -832,30 +783,22 @@
                zg1 * ( t_i_b(ji,1) - t_su_b(ji) ) ) ! upper flux if not
          END DO
-
-         ! Internal ice layers
-         DO layer = 1, nlay_i - 1
+         DO layer = 1, nlay_i - 1         ! Internal ice layers
             DO ji = kideb, kiut
-               fc_i(ji,layer) = - zkappa_i(ji,layer) * ( t_i_b(ji,layer+1) - &
-                  t_i_b(ji,layer) )
-               zji                 = MOD( npb(ji) - 1, jpi ) + 1
-               zjj                 = ( npb(ji) - 1 ) / jpi + 1
-            END DO
-         END DO
-
-         ! Bottom ice layers
-         DO ji = kideb, kiut
-            fc_i(ji,nlay_i) = - zkappa_i(ji,nlay_i)* &
-               ( zg1*(t_bo_b(ji) - t_i_b(ji,nlay_i)) )
-         END DO
-
+               fc_i(ji,layer) = - zkappa_i(ji,layer) * ( t_i_b(ji,layer+1) - t_i_b(ji,layer) )
+               ii = MOD( npb(ji) - 1, jpi ) + 1
+               ij = ( npb(ji) - 1 ) / jpi + 1
+            END DO
+         END DO
+         DO ji = kideb, kiut         ! Bottom ice layers
+            fc_i(ji,nlay_i) = - zkappa_i(ji,nlay_i) * ( zg1*(t_bo_b(ji) - t_i_b(ji,nlay_i)) )
+         END DO
       ENDIF
-
+      !
    END SUBROUTINE lim_thd_dif
 
 #else
-   !!======================================================================
-   !!                       ***  MODULE limthd_dif   ***
-   !!                              no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
+   !!                   Dummy Module                 No LIM-3 sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_thd_dif          ! Empty routine
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90	(revision 2715)
@@ -6,4 +6,10 @@
    !!                       after vertical growth/decay
    !!======================================================================
+   !! History :  LIM  ! 2003-05 (M. Vancoppenolle) Original code in 1D
+   !!                 ! 2005-07 (M. Vancoppenolle) 3D version 
+   !!                 ! 2006-11 (X. Fettweis) Vectorized 
+   !!            3.0  ! 2008-03 (M. Vancoppenolle) Energy conservation and clean code
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
@@ -13,13 +19,14 @@
    !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
-   USE dom_oce
-   USE domain
-   USE in_out_manager
-   USE phycst
-   USE thd_ice
-   USE ice
-   USE limvar
-   USE par_ice
-   USE lib_mpp 
+   USE dom_oce          ! domain variables
+   USE domain           !
+   USE phycst           ! physical constants
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE thd_ice          ! LIM thermodynamics
+   USE limvar           ! LIM variables
+   USE in_out_manager   ! I/O manager
+   USE wrk_nemo         ! workspace manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -28,12 +35,13 @@
    PUBLIC   lim_thd_ent     ! called by lim_thd
 
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1.e-20  ,  &
-      epsi13 = 1.e-13  ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0    ,  &
-      epsi10 = 1.0e-10
+   REAL(wp) ::   epsi20 = 1e-20_wp   ! constant values
+   REAL(wp) ::   epsi13 = 1e-13_wp   !
+   REAL(wp) ::   epsi10 = 1e-10_wp   !
+   REAL(wp) ::   epsi06 = 1e-06_wp   !
+   REAL(wp) ::   zzero  = 0._wp      !
+   REAL(wp) ::   zone   = 1._wp      !
+
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -41,5 +49,5 @@
 CONTAINS
 
-   SUBROUTINE lim_thd_ent(kideb,kiut,jl)
+   SUBROUTINE lim_thd_ent( kideb, kiut, jl )
       !!-------------------------------------------------------------------
       !!               ***   ROUTINE lim_thd_ent  ***
@@ -60,26 +68,11 @@
       !!            5) Ice salinity, recover temperature
       !!
-      !! ** Arguments
-      !!
-      !! ** Inputs / Outputs
-      !!
-      !! ** External
-      !!
-      !! ** References : Bitz & Lipscomb, JGR 99; Vancoppenolle et al., GRL, 2005
-      !!
-      !! ** History  : (05-2003) Martin V. UCL-Astr
-      !!               (07-2005) Martin for 3d adapatation
-      !!               (11-2006) Vectorized by Xavier Fettweis (ASTR)
-      !!               (03-2008) Energy conservation and clean code
-      !! * Arguments
-
-      INTEGER , INTENT(IN)::  &
-         kideb          ,   &  ! start point on which the the computation is applied
-         kiut           ,   &  ! end point on which the the computation is applied
-         jl                    ! thickness category number
-
-      INTEGER ::            &
-         ji,jk          ,   &  !  dummy loop indices
-         zji, zjj       ,   &  !  dummy indices
+      !! References : Bitz & Lipscomb, JGR 99; Vancoppenolle et al., GRL, 2005
+      !!-------------------------------------------------------------------
+      INTEGER , INTENT(in) ::   kideb, kiut   ! Start/End point on which the  the computation is applied
+      INTEGER , INTENT(in) ::   jl            ! Thickness cateogry number
+
+      INTEGER ::   ji,jk   !  dummy loop indices
+      INTEGER ::   zji, zjj       ,   &  !  dummy indices
          ntop0          ,   &  !  old layer top index
          nbot1          ,   &  !  new layer bottom index
@@ -90,17 +83,6 @@
          layer0, layer1        !  old/new layer indexes
 
-      INTEGER, DIMENSION(jpij) :: &
-         snswi          ,   &  !  snow switch
-         nbot0          ,   &  !  old layer bottom index
-         icsuind        ,   &  !  ice surface index
-         icsuswi        ,   &  !  ice surface switch
-         icboind        ,   &  !  ice bottom index
-         icboswi        ,   &  !  ice bottom switch
-         snicind        ,   &  !  snow ice index
-         snicswi        ,   &  !  snow ice switch
-         snind                 !  snow index
 
       REAL(wp) :: &
-         zeps, zeps6    ,   &  ! numerical constant very small
          ztmelts        ,   &  ! ice melting point
          zqsnic         ,   &  ! enthalpy of snow ice layer
@@ -115,39 +97,49 @@
          zdiscrim              !: dummy factor
 
-      REAL(wp), DIMENSION(jpij) :: &  
-         zh_i           ,   &  ! thickness of an ice layer
-         zh_s           ,   &  ! thickness of a snow layer
-         zqsnow         ,   &  ! enthalpy of the snow put in snow ice 	
-         zdeltah               ! temporary variable
-
-      REAL(wp), DIMENSION(jpij,0:jkmax+3) :: &
-         zm0            ,   &  !  old layer-system vertical cotes
-         qm0            ,   &  !  old layer-system heat content
-         z_s            ,   &  !  new snow system vertical cotes
-         z_i            ,   &  !  new ice system vertical cotes
-         zthick0               !  old ice thickness
-
-      REAL(wp), DIMENSION(jpij,0:jkmax+3) :: &
-         zhl0                  ! old and new layer thicknesses
-
-      REAL(wp), DIMENSION(0:jkmax+3,0:jkmax+3) :: &
-         zrl01
-
-      ! Energy conservation
-      REAL(wp), DIMENSION(jpij) :: &
-         zqti_in, zqts_in,         &
-         zqti_fin, zqts_fin
-
-      !------------------------------------------------------------------------------|
-
-      zeps   = 1.0d-20
-      zeps6  = 1.0d-06
-      zthick0(:,:) = 0.0
-      zm0(:,:)     = 0.0
-      qm0(:,:)     = 0.0
-      zrl01(:,:)   = 0.0
-      zhl0(:,:)    = 0.0
-      z_i(:,:)     = 0.0
-      z_s(:,:)     = 0.0
+      INTEGER, DIMENSION(jpij) :: &
+         snswi          ,   &  !  snow switch
+         nbot0          ,   &  !  old layer bottom index
+         icsuind        ,   &  !  ice surface index
+         icsuswi        ,   &  !  ice surface switch
+         icboind        ,   &  !  ice bottom index
+         icboswi        ,   &  !  ice bottom switch
+         snicind        ,   &  !  snow ice index
+         snicswi        ,   &  !  snow ice switch
+         snind                 !  snow index
+      !
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   zm0       !  old layer-system vertical cotes
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   qm0       !  old layer-system heat content
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   z_s       !  new snow system vertical cotes
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   z_i       !  new ice system vertical cotes
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   zthick0   !  old ice thickness
+      REAL(wp), DIMENSION(jpij,0:jkmax+3) ::   zhl0      ! old and new layer thicknesses
+      !
+      REAL(wp), DIMENSION(0:jkmax+3,0:jkmax+3) ::   zrl01
+      !
+      REAL(wp), POINTER, DIMENSION(:) ::   zh_i, zqsnow , zqti_in, zqti_fin
+      REAL(wp), POINTER, DIMENSION(:) ::   zh_s, zdeltah, zqts_in, zqts_fin
+      !!-------------------------------------------------------------------
+
+      IF( wrk_in_use(1, 1,2,3,4,5,6,7,8) ) THEN
+         CALL ctl_stop('lim_thd_dh : requestead workspace arrays unavailable')   ;   RETURN
+      END IF
+
+      ! Set-up pointers to sub-arrays of workspace arrays
+      zh_i      =>  wrk_1d_1 (1:jpij)   ! thickness of an ice layer
+      zh_s      =>  wrk_1d_2 (1:jpij)   ! thickness of a snow layer
+      zqsnow    =>  wrk_1d_3 (1:jpij)   ! enthalpy of the snow put in snow ice
+      zdeltah   =>  wrk_1d_4 (1:jpij)   ! temporary variable
+      zqti_in   =>  wrk_1d_5 (1:jpij)   ! Energy conservation
+      zqts_in   =>  wrk_1d_6 (1:jpij)   !    -         -
+      zqti_fin  =>  wrk_1d_7 (1:jpij)   !    -         -
+      zqts_fin  =>  wrk_1d_8 (1:jpij)   !    -         -
+
+      zthick0(:,:) = 0._wp
+      zm0    (:,:) = 0._wp
+      qm0    (:,:) = 0._wp
+      zrl01  (:,:) = 0._wp
+      zhl0   (:,:) = 0._wp
+      z_i    (:,:) = 0._wp
+      z_s    (:,:) = 0._wp
 
       !
@@ -155,12 +147,11 @@
       !  1) Grid                                                                     |
       !------------------------------------------------------------------------------|
-      !
-      nlays0        = nlay_s
-      nlayi0        = nlay_i
-
-      DO ji = kideb, kiut
-         zh_i(ji)   = old_ht_i_b(ji) / nlay_i 
-         zh_s(ji)   = old_ht_s_b(ji) / nlay_s
-      ENDDO
+      nlays0 = nlay_s
+      nlayi0 = nlay_i
+
+      DO ji = kideb, kiut
+         zh_i(ji) = old_ht_i_b(ji) / nlay_i 
+         zh_s(ji) = old_ht_s_b(ji) / nlay_s
+      END DO
 
       !
@@ -168,5 +159,4 @@
       !  2) Switches                                                                 |
       !------------------------------------------------------------------------------|
-      !
       ! 2.1 snind(ji), snswi(ji)
       ! snow surface behaviour : computation of snind(ji)-snswi(ji)
@@ -176,21 +166,21 @@
       ! 	 2 if 2nd layer is melting ...
       DO ji = kideb, kiut
-         snind(ji)     = 0
-         zdeltah(ji)   = 0.0
+         snind  (ji) = 0
+         zdeltah(ji) = 0._wp
       ENDDO !ji
 
       DO jk = 1, nlays0
          DO ji = kideb, kiut
-            snind(ji)  = jk        *      INT(MAX(0.0,SIGN(1.0,-dh_s_tot(ji)-zdeltah(ji)-zeps))) &
-               + snind(ji) * (1 - INT(MAX(0.0,SIGN(1.0,-dh_s_tot(ji)-zdeltah(ji)-zeps))))
+            snind(ji)  = jk        *      INT(MAX(0.0,SIGN(1.0,-dh_s_tot(ji)-zdeltah(ji)-epsi20))) &
+               + snind(ji) * (1 - INT(MAX(0.0,SIGN(1.0,-dh_s_tot(ji)-zdeltah(ji)-epsi20))))
             zdeltah(ji)= zdeltah(ji) + zh_s(ji)
          END DO ! ji
-      ENDDO ! jk
+      END DO ! jk
 
       ! snswi(ji) : switch which value equals 1 if snow melts
       !				   0 if not
       DO ji = kideb, kiut
-         snswi(ji)     = MAX(0,INT(-dh_s_tot(ji)/MAX(zeps,ABS(dh_s_tot(ji)))))
-      ENDDO ! ji
+         snswi(ji)     = MAX(0,INT(-dh_s_tot(ji)/MAX(epsi20,ABS(dh_s_tot(ji)))))
+      END DO ! ji
 
       ! 2.2 icsuind(ji), icsuswi(ji)
@@ -201,11 +191,11 @@
       !	   2 if 2nd layer is reached by melt ...
       DO ji = kideb, kiut
-         icsuind(ji)   = 0
-         zdeltah(ji)   = 0.0
-      ENDDO !ji
+         icsuind(ji) = 0
+         zdeltah(ji) = 0._wp
+      END DO !ji
       DO jk = 1, nlayi0
          DO ji = kideb, kiut
-            icsuind(ji) = jk          *      INT(MAX(0.0,SIGN(1.0,-dh_i_surf(ji)-zdeltah(ji)-zeps))) &
-               + icsuind(ji) * (1 - INT(MAX(0.0,SIGN(1.0,-dh_i_surf(ji)-zdeltah(ji)-zeps))))
+            icsuind(ji) = jk          *      INT(MAX(0.0,SIGN(1.0,-dh_i_surf(ji)-zdeltah(ji)-epsi20))) &
+               + icsuind(ji) * (1 - INT(MAX(0.0,SIGN(1.0,-dh_i_surf(ji)-zdeltah(ji)-epsi20))))
             zdeltah(ji) = zdeltah(ji) + zh_i(ji)
          END DO ! ji
@@ -216,5 +206,5 @@
       ! 	   0 if not
       DO ji = kideb, kiut
-         icsuswi(ji)  = MAX(0,INT(-dh_i_surf(ji)/MAX(zeps , ABS(dh_i_surf(ji)) ) ) )
+         icsuswi(ji)  = MAX(0,INT(-dh_i_surf(ji)/MAX(epsi20 , ABS(dh_i_surf(ji)) ) ) )
       ENDDO
 
@@ -227,21 +217,19 @@
       !            N+1 if all layers melt and that snow transforms into ice
       DO ji = kideb, kiut 
-         icboind(ji)   = 0
-         zdeltah(ji)   = 0.0
-      ENDDO
+         icboind(ji) = 0
+         zdeltah(ji) = 0._wp
+      END DO
       DO jk = nlayi0, 1, -1
          DO ji = kideb, kiut
-            icboind(ji) = (nlayi0+1-jk) &
-               *      INT(MAX(0.0,SIGN(1.0,-dh_i_bott(ji)-zdeltah(ji)-zeps))) &
-               + icboind(ji) &
-               * (1 - INT(MAX(0.0,SIGN(1.0,-dh_i_bott(ji)-zdeltah(ji)-zeps)))) 
+            icboind(ji) = (nlayi0+1-jk) *      INT(MAX(0.0,SIGN(1.0,-dh_i_bott(ji)-zdeltah(ji)-epsi20))) &
+               &          + icboind(ji) * (1 - INT(MAX(0.0,SIGN(1.0,-dh_i_bott(ji)-zdeltah(ji)-epsi20)))) 
             zdeltah(ji) = zdeltah(ji) + zh_i(ji)
          END DO
-      ENDDO
+      END DO
 
       DO ji = kideb, kiut
          ! case of total ablation with remaining snow
-         IF ( ( ht_i_b(ji) .GT. zeps ) .AND. &
-            ( ht_i_b(ji) - dh_snowice(ji) .LT. zeps ) ) icboind(ji) = nlay_i + 1
+         IF ( ( ht_i_b(ji) .GT. epsi20 ) .AND. &
+            ( ht_i_b(ji) - dh_snowice(ji) .LT. epsi20 ) ) icboind(ji) = nlay_i + 1
       END DO
 
@@ -250,6 +238,6 @@
       ! 	   0 if ablation is on the way
       DO ji = kideb, kiut 
-         icboswi(ji)     = MAX(0,INT(dh_i_bott(ji) / MAX(zeps,ABS(dh_i_bott(ji)))))
-      ENDDO
+         icboswi(ji) = MAX(0,INT(dh_i_bott(ji) / MAX(epsi20,ABS(dh_i_bott(ji)))))
+      END DO
 
       ! 2.4 snicind(ji), snicswi(ji)
@@ -260,16 +248,15 @@
       ! 	   2 if penultiem layer ...
       DO ji = kideb, kiut
-         snicind(ji)   = 0
-         zdeltah(ji)   = 0.0
-      ENDDO
+         snicind(ji) = 0
+         zdeltah(ji) = 0._wp
+      END DO
       DO jk = nlays0, 1, -1
          DO ji = kideb, kiut
             snicind(ji) = (nlays0+1-jk) &
-               *      INT(MAX(0.0,SIGN(1.0,dh_snowice(ji)-zdeltah(ji)-zeps))) &
-               + snicind(ji) &
-               * (1 - INT(MAX(0.0,SIGN(1.0,dh_snowice(ji)-zdeltah(ji)-zeps))))
+               *      INT(MAX(0.0,SIGN(1.0,dh_snowice(ji)-zdeltah(ji)-epsi20))) + snicind(ji)   &
+               * (1 - INT(MAX(0.0,SIGN(1.0,dh_snowice(ji)-zdeltah(ji)-epsi20))))
             zdeltah(ji) = zdeltah(ji) + zh_s(ji)
          END DO
-      ENDDO
+      END DO
 
       ! snicswi(ji) : switch which equals 
@@ -277,5 +264,5 @@
       ! 	   0 if not
       DO ji = kideb, kiut
-         snicswi(ji)   = MAX(0,INT(dh_snowice(ji)/MAX(zeps,ABS(dh_snowice(ji)))))
+         snicswi(ji)   = MAX(0,INT(dh_snowice(ji)/MAX(epsi20,ABS(dh_snowice(ji)))))
       ENDDO
 
@@ -294,61 +281,53 @@
       ! indexes of the vectors
       !------------------------
-      ntop0                =  1
-      maxnbot0             =  0
-
-      DO ji = kideb, kiut
-         nbot0(ji)          =  nlays0  + 1 - snind(ji) + ( 1. - snicind(ji) ) * &
-            snicswi(ji)
+      ntop0    =  1
+      maxnbot0 =  0
+
+      DO ji = kideb, kiut
+         nbot0(ji) =  nlays0  + 1 - snind(ji) + ( 1. - snicind(ji) ) * snicswi(ji)
          ! cotes of the top of the layers
-         zm0(ji,0)          =  0.0
-         maxnbot0           =  MAX ( maxnbot0 , nbot0(ji) )
-      ENDDO
-      IF( lk_mpp ) CALL mpp_max( maxnbot0, kcom=ncomm_ice )
+         zm0(ji,0) =  0._wp
+         maxnbot0 =  MAX ( maxnbot0 , nbot0(ji) )
+      END DO
+      IF( lk_mpp )   CALL mpp_max( maxnbot0, kcom=ncomm_ice )
 
       DO jk = 1, maxnbot0
          DO ji = kideb, kiut
             !change
-            limsum      = ( 1 - snswi(ji) ) * ( jk - 1 ) +                      &
-               snswi(ji) * ( jk + snind(ji) - 1 )
+            limsum = ( 1 - snswi(ji) ) * ( jk - 1 ) + snswi(ji) * ( jk + snind(ji) - 1 )
+            limsum = MIN( limsum , nlay_s )
+            zm0(ji,jk) =  dh_s_tot(ji) + zh_s(ji) * limsum
+         END DO
+      END DO
+
+      DO ji = kideb, kiut
+         zm0(ji,nbot0(ji)) =  dh_s_tot(ji) - snicswi(ji) * dh_snowice(ji) + zh_s(ji) * nlays0
+         zm0(ji,1)         =  dh_s_tot(ji) * (1 -snswi(ji) ) + snswi(ji) * zm0(ji,1)
+      END DO
+
+      DO jk = ntop0, maxnbot0
+         DO ji = kideb, kiut
+            zthick0(ji,jk)  =  zm0(ji,jk) - zm0(ji,jk-1)            ! layer thickness
+         END DO
+      END DO
+
+      zqts_in(:) = 0._wp
+
+      DO ji = kideb, kiut         ! layer heat content
+         qm0    (ji,1) =  rhosn * (  cpic * ( rtt - ( 1. - snswi(ji) ) * tatm_ice_1d(ji)        &
+            &                                            - snswi(ji)   * t_s_b      (ji,1)  )   &
+            &                      + lfus  ) * zthick0(ji,1)
+         zqts_in(ji)   =  zqts_in(ji) + qm0(ji,1) 
+      END DO
+
+      DO jk = 2, maxnbot0
+         DO ji = kideb, kiut
+            limsum      = ( 1 - snswi(ji) ) * ( jk - 1 ) + snswi(ji) * ( jk + snind(ji) - 1 )
             limsum      = MIN( limsum , nlay_s )
-            zm0(ji,jk)  =  dh_s_tot(ji) + zh_s(ji) * limsum
-         END DO
-      ENDDO
-
-      DO ji = kideb, kiut
-         zm0(ji,nbot0(ji)) =  dh_s_tot(ji) - snicswi(ji) * dh_snowice(ji) + &
-            zh_s(ji) * nlays0
-         zm0(ji,1)         =  dh_s_tot(ji) * (1 -snswi(ji) ) +              &
-            snswi(ji) * zm0(ji,1)
-      ENDDO
-
-      DO jk = ntop0, maxnbot0
-         DO ji = kideb, kiut
-            ! layer thickness
-            zthick0(ji,jk)  =  zm0(ji,jk) - zm0(ji,jk-1)
-         END DO
-      ENDDO
-
-      zqts_in(:) = 0.0
-
-      DO ji = kideb, kiut
-         ! layer heat content
-         qm0(ji,1)   =  rhosn * ( cpic * ( rtt - ( 1. - snswi(ji) ) * ( tatm_ice_1d(ji) ) &
-            - snswi(ji) * t_s_b(ji,1) )         &
-            + lfus ) * zthick0(ji,1)
-         zqts_in(ji) =  zqts_in(ji) + qm0(ji,1) 
-      ENDDO
-
-      DO jk = 2, maxnbot0
-         DO ji = kideb, kiut
-            limsum      = ( 1 - snswi(ji) ) * ( jk - 1 ) +                      &
-               snswi(ji) * ( jk + snind(ji) - 1 )
-            limsum      = MIN( limsum , nlay_s )
-            qm0(ji,jk)  = rhosn * ( cpic * ( rtt - t_s_b(ji,limsum) ) + lfus )  &
-               * zthick0(ji,jk)
-            zswitch = 1.0 - MAX (0.0, SIGN ( 1.0, zeps - ht_s_b(ji) ) )
+            qm0(ji,jk)  = rhosn * ( cpic * ( rtt - t_s_b(ji,limsum) ) + lfus ) * zthick0(ji,jk)
+            zswitch = 1.0 - MAX (0.0, SIGN ( 1.0, epsi20 - ht_s_b(ji) ) )
             zqts_in(ji) = zqts_in(ji) + ( 1. - snswi(ji) ) * qm0(ji,jk) * zswitch
          END DO ! jk
-      ENDDO ! ji
+      END DO ! ji
 
       !------------------------------------------------
@@ -357,16 +336,15 @@
       ! zqsnow, enthalpy of the flooded snow
       DO ji = kideb, kiut
-         zqsnow(ji)     =  rhosn*lfus
-         zdeltah(ji)    =  0.0
-      ENDDO
+         zqsnow (ji) =  rhosn * lfus
+         zdeltah(ji) =  0._wp
+      END DO
 
       DO jk =  nlays0, 1, -1
          DO ji = kideb, kiut
-            zhsnow      =  MAX(0.0,dh_snowice(ji)-zdeltah(ji))
-            zqsnow(ji)  =  zqsnow(ji) + &
-               rhosn*cpic*(rtt-t_s_b(ji,jk))
+            zhsnow =  MAX( 0._wp , dh_snowice(ji)-zdeltah(ji) )
+            zqsnow (ji) =  zqsnow (ji) + rhosn*cpic*(rtt-t_s_b(ji,jk))
             zdeltah(ji) =  zdeltah(ji) + zh_s(ji)
          END DO
-      ENDDO
+      END DO
 
       DO ji = kideb, kiut
@@ -381,6 +359,6 @@
       ! Vector index   
       !--------------
-      ntop1    =  1
-      nbot1    =  nlay_s
+      ntop1 =  1
+      nbot1 =  nlay_s
 
       !-------------------
@@ -389,5 +367,5 @@
       DO ji = kideb, kiut
          zh_s(ji)  = ht_s_b(ji) / nlay_s
-         z_s(ji,0) =  0.0
+         z_s(ji,0) =  0._wp
       ENDDO
 
@@ -396,5 +374,5 @@
             z_s(ji,jk) =  zh_s(ji) * jk
          END DO
-      ENDDO
+      END DO
 
       !-----------------
@@ -405,11 +383,11 @@
             zhl0(ji,layer0) = zm0(ji,layer0) - zm0(ji,layer0-1)
          END DO
-      ENDDO
+      END DO
 
       DO layer1 = ntop1, nbot1
          DO ji = kideb, kiut
-            q_s_b(ji,layer1)= 0.0
-         END DO
-      ENDDO
+            q_s_b(ji,layer1) = 0._wp
+         END DO
+      END DO
 
       !----------------
@@ -419,14 +397,14 @@
          DO layer1 = ntop1, nbot1
             DO ji = kideb, kiut
-               zrl01(layer1,layer0) = MAX(0.0,( MIN(zm0(ji,layer0),z_s(ji,layer1)) &
-                  - MAX(zm0(ji,layer0-1), z_s(ji,layer1-1)))/MAX(zhl0(ji,layer0),epsi10)) 
-               q_s_b(ji,layer1) = q_s_b(ji,layer1) + zrl01(layer1,layer0)*qm0(ji,layer0) &
-                  * MAX(0.0,SIGN(1.0,nbot0(ji)-layer0+zeps))
+               zrl01(layer1,layer0) = MAX(0.0,( MIN(zm0(ji,layer0),z_s(ji,layer1))   &
+                  &                 - MAX(zm0(ji,layer0-1), z_s(ji,layer1-1))) / MAX(zhl0(ji,layer0),epsi10)) 
+               q_s_b(ji,layer1) = q_s_b(ji,layer1) + zrl01(layer1,layer0)*qm0(ji,layer0)   &
+                  &                                * MAX(0.0,SIGN(1.0,nbot0(ji)-layer0+epsi20))
             END DO
          END DO
-      ENDDO
+      END DO
 
       ! Heat conservation
-      zqts_fin(:) = 0.0
+      zqts_fin(:) = 0._wp
       DO jk = 1, nlay_s
          DO ji = kideb, kiut
@@ -458,7 +436,7 @@
       DO jk = 1, nlay_s
          DO ji = kideb, kiut
-            q_s_b(ji,jk) = q_s_b(ji,jk) / MAX( zh_s(ji) , zeps )
+            q_s_b(ji,jk) = q_s_b(ji,jk) / MAX( zh_s(ji) , epsi20 )
          END DO !ji
-      ENDDO !jk  
+      END DO !jk  
 
       !---------------------
@@ -469,10 +447,8 @@
       DO jk = 1, nlay_s
          DO ji = kideb, kiut
-            zswitch = MAX ( 0.0 , SIGN ( 1.0, zeps - ht_s_b(ji) ) )
-            t_s_b(ji,jk) = rtt                                                  &
-               + ( 1.0 - zswitch ) *                                  &
-               ( - zfac1 * q_s_b(ji,jk) + zfac2 )
-         END DO
-      ENDDO
+            zswitch = MAX ( 0.0 , SIGN ( 1.0, epsi20 - ht_s_b(ji) ) )
+            t_s_b(ji,jk) = rtt + ( 1.0 - zswitch ) * ( - zfac1 * q_s_b(ji,jk) + zfac2 )
+         END DO
+      END DO
       !
       !------------------------------------------------------------------------------|
@@ -487,20 +463,19 @@
       ! Vector indexes
       !----------------
-      ntop0          =  1
-      maxnbot0       =  0
+      ntop0    =  1
+      maxnbot0 =  0
 
       DO ji = kideb, kiut
          ! reference number of the bottommost layer
-         nbot0(ji)    =  MAX( 1 ,  MIN( nlayi0 + ( 1 - icboind(ji) ) +        &
-            ( 1 - icsuind(ji) ) * icsuswi(ji) + snicswi(ji) ,    &
-            nlay_i + 2 ) )
+         nbot0(ji) =  MAX( 1 ,  MIN( nlayi0 + ( 1 - icboind(ji) ) +        &
+            &                           ( 1 - icsuind(ji) ) * icsuswi(ji) + snicswi(ji) , nlay_i + 2 ) )
          ! maximum reference number of the bottommost layer over all domain
-         maxnbot0     =  MAX( maxnbot0 , nbot0(ji) )
-      ENDDO
+         maxnbot0 =  MAX( maxnbot0 , nbot0(ji) )
+      END DO
 
       !-------------------------
       ! Cotes of old ice layers
       !-------------------------
-      zm0(:,0)    =  0.0
+      zm0(:,0) =  0.-wp
 
       DO jk = 1, maxnbot0
@@ -514,5 +489,5 @@
                +  limsum * zh_i(ji)
          END DO
-      ENDDO
+      END DO
 
       DO ji = kideb, kiut
@@ -520,5 +495,5 @@
             +  zh_i(ji) * nlayi0
          zm0(ji,1)         =  snicswi(ji)*dh_snowice(ji) + (1-snicswi(ji))*zm0(ji,1)
-      ENDDO
+      END DO
 
       !-----------------------------
@@ -529,5 +504,5 @@
             zthick0(ji,jk) =  zm0(ji,jk) - zm0(ji,jk-1)
          END DO
-      ENDDO
+      END DO
 
       !---------------------------
@@ -543,8 +518,8 @@
             ztmelts = -tmut * s_i_b(ji,limsum) + rtt
             qm0(ji,jk) = rhoic * ( cpic * (ztmelts-t_i_b(ji,limsum)) + lfus * ( 1.0-(ztmelts-rtt)/ &
-               MIN((t_i_b(ji,limsum)-rtt),-zeps) ) - rcp*(ztmelts-rtt) ) &
+               MIN((t_i_b(ji,limsum)-rtt),-epsi20) ) - rcp*(ztmelts-rtt) ) &
                * zthick0(ji,jk)
          END DO
-      ENDDO
+      END DO
 
       !----------------------------
@@ -552,19 +527,16 @@
       !----------------------------
       DO ji = kideb, kiut        
-         ztmelts    = ( 1.0 - icboswi(ji) ) * (-tmut * s_i_b(ji,nlayi0)) &   ! case of melting ice
-            +      icboswi(ji)      * (-tmut * s_i_new(ji))      &   ! case of forming ice
-            + rtt                        ! this temperature is in Celsius
+         ztmelts    = ( 1.0 - icboswi(ji) ) * (-tmut * s_i_b  (ji,nlayi0) )   &   ! case of melting ice
+            &       +         icboswi(ji)   * (-tmut * s_i_new(ji)        )   &   ! case of forming ice
+            &       + rtt                                                         ! in Kelvin
 
          ! bottom formation temperature
          ztform = t_i_b(ji,nlay_i)
          IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) ztform = t_bo_b(ji)
-         qm0(ji,nbot0(ji)) = ( 1.0 - icboswi(ji) )*qm0(ji,nbot0(ji)) &   ! case of melting ice
-            + icboswi(ji) *                                  &   ! case of forming ice
-            rhoic*( cpic*(ztmelts-ztform)                  &
-            + lfus *( 1.0-(ztmelts-rtt)/             &
-            MIN ( (ztform-rtt) , - epsi10 ) )      & 
-            - rcp*(ztmelts-rtt) )                    &
-            *zthick0(ji,nbot0(ji))
-      ENDDO
+         qm0(ji,nbot0(ji)) = ( 1.0 - icboswi(ji) )*qm0(ji,nbot0(ji))             &   ! case of melting ice
+            &              + icboswi(ji) * rhoic * ( cpic*(ztmelts-ztform)       &   ! case of forming ice
+            + lfus *( 1.0-(ztmelts-rtt) / MIN ( (ztform-rtt) , - epsi10 ) )      & 
+            - rcp*(ztmelts-rtt) ) * zthick0(ji,nbot0(ji)  )
+      END DO
 
       !-----------------------------
@@ -585,14 +557,13 @@
          qm0(ji,1)      =  snicswi(ji) * zqsnic + ( 1 - snicswi(ji) ) * qm0(ji,1)
 
-      ENDDO ! ji
+      END DO ! ji
 
       DO jk = ntop0, maxnbot0
          DO ji = kideb, kiut
             ! Heat conservation
-            zqti_in(ji) = zqti_in(ji) + qm0(ji,jk) &
-               * MAX( 0.0 , SIGN(1.0,ht_i_b(ji)-zeps6+zeps) ) &
-               * MAX( 0.0 , SIGN( 1. , nbot0(ji) - jk + zeps ) )
-         END DO
-      ENDDO
+            zqti_in(ji) = zqti_in(ji) + qm0(ji,jk) * MAX( 0.0 , SIGN(1.0,ht_i_b(ji)-epsi06+epsi20) ) &
+               &                                   * MAX( 0.0 , SIGN( 1. , nbot0(ji) - jk + epsi20 ) )
+         END DO
+      END DO
 
       !-------------
@@ -603,7 +574,6 @@
       ! Vectors index
       !---------------
-
-      ntop1    =  1 
-      nbot1    =  nlay_i
+      ntop1 =  1 
+      nbot1 =  nlay_i
 
       !------------------
@@ -611,5 +581,5 @@
       !------------------
       DO ji = kideb, kiut
-         zh_i(ji)      = ht_i_b(ji) / nlay_i
+         zh_i(ji) = ht_i_b(ji) / nlay_i
       ENDDO
 
@@ -617,23 +587,22 @@
       ! Layer cotes      
       !-------------
-      z_i(:,0) =  0.0
+      z_i(:,0) =  0._wp
       DO jk = 1, nlay_i
          DO ji = kideb, kiut
             z_i(ji,jk) =  zh_i(ji) * jk
          END DO
-      ENDDO
+      END DO
 
       !--thicknesses of the layers
       DO layer0 = ntop0, maxnbot0
          DO ji = kideb, kiut
-            zhl0(ji,layer0)   =  zm0(ji,layer0) - zm0(ji,layer0-1) !thicknesses of the layers
-         END DO
-      ENDDO
+            zhl0(ji,layer0) = zm0(ji,layer0) - zm0(ji,layer0-1)   ! thicknesses of the layers
+         END DO
+      END DO
 
       !------------------------
       ! Weights for relayering
       !------------------------
-
-      q_i_b(:,:) = 0.0
+      q_i_b(:,:) = 0._wp
       DO layer0 = ntop0, maxnbot0
          DO layer1 = ntop1, nbot1
@@ -643,14 +612,14 @@
                q_i_b(ji,layer1) = q_i_b(ji,layer1) & 
                   + zrl01(layer1,layer0)*qm0(ji,layer0) &
-                  * MAX(0.0,SIGN(1.0,ht_i_b(ji)-zeps6+zeps)) &
-                  * MAX(0.0,SIGN(1.0,nbot0(ji)-layer0+zeps))
+                  * MAX(0.0,SIGN(1.0,ht_i_b(ji)-epsi06+epsi20)) &
+                  * MAX(0.0,SIGN(1.0,nbot0(ji)-layer0+epsi20))
             END DO
          END DO
-      ENDDO
+      END DO
 
       !-------------------------
       ! Heat conservation check
       !-------------------------
-      zqti_fin(:) = 0.0
+      zqti_fin(:) = 0._wp
       DO jk = 1, nlay_i
          DO ji = kideb, kiut
@@ -663,6 +632,5 @@
             zji                 = MOD( npb(ji) - 1, jpi ) + 1
             zjj                 = ( npb(ji) - 1 ) / jpi + 1
-            WRITE(numout,*) ' violation of heat conservation : ',             &
-               ABS ( zqti_in(ji) - zqti_fin(ji) ) / rdt_ice
+            WRITE(numout,*) ' violation of heat conservation : ', ABS ( zqti_in(ji) - zqti_fin(ji) ) / rdt_ice
             WRITE(numout,*) ' ji, jj   : ', zji, zjj
             WRITE(numout,*) ' ht_i_b   : ', ht_i_b(ji)
@@ -683,7 +651,7 @@
       DO jk = 1, nlay_i
          DO ji = kideb, kiut
-            q_i_b(ji,jk) = q_i_b(ji,jk) / MAX( zh_i(ji) , zeps )
+            q_i_b(ji,jk) = q_i_b(ji,jk) / MAX( zh_i(ji) , epsi20 )
          END DO !ji
-      ENDDO !jk  
+      END DO !jk  
 
       ! Heat conservation
@@ -702,36 +670,34 @@
       ! Update salinity (basal entrapment, snow ice formation)
       DO ji = kideb, kiut
-         sm_i_b(ji) = sm_i_b(ji)                                &
-            + dsm_i_se_1d(ji) + dsm_i_si_1d(ji)
+         sm_i_b(ji) = sm_i_b(ji) + dsm_i_se_1d(ji) + dsm_i_si_1d(ji)
       END DO !ji
 
       ! Recover temperature
       DO jk = 1, nlay_i
-
-         DO ji = kideb, kiut
-
+         DO ji = kideb, kiut
             ztmelts    =  -tmut*s_i_b(ji,jk) + rtt
             !Conversion q(S,T) -> T (second order equation)
             zaaa         =  cpic
-            zbbb         =  ( rcp - cpic ) * ( ztmelts - rtt ) + &
-               q_i_b(ji,jk) / rhoic - lfus
+            zbbb         =  ( rcp - cpic ) * ( ztmelts - rtt ) + q_i_b(ji,jk) / rhoic - lfus
             zccc         =  lfus * ( ztmelts - rtt )
             zdiscrim     =  SQRT( MAX(zbbb*zbbb - 4.0*zaaa*zccc,0.0) )
-            t_i_b(ji,jk) =  rtt - ( zbbb + zdiscrim ) / & 
-               ( 2.0 *zaaa )
+            t_i_b(ji,jk) =  rtt - ( zbbb + zdiscrim ) / ( 2.0 *zaaa )
          END DO !ji
 
       END DO !jk
-
+      !
+      IF( wrk_not_released(1, 1,2,3,4,5,6,7,8) )   CALL ctl_stop( 'lim_thd_ent : failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_thd_ent
 
 #else
-   !!======================================================================
-   !!                       ***  MODULE limthd_ent   ***
-   !!                             no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
+   !!   Default option                               NO  LIM3 sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_thd_ent          ! Empty routine
    END SUBROUTINE lim_thd_ent
 #endif
+
+   !!======================================================================
 END MODULE limthd_ent
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_lac.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_lac.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_lac.F90	(revision 2715)
@@ -4,4 +4,9 @@
    !!                lateral thermodynamic growth of the ice 
    !!======================================================================
+   !! History :  LIM  ! 2005-12 (M. Vancoppenolle)  Original code
+   !!             -   ! 2006-01 (M. Vancoppenolle)  add ITD
+   !!            3.0  ! 2007-07 (M. Vancoppenolle)  Mass and energy conservation tested
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
@@ -11,39 +16,37 @@
    !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
-   USE dom_oce
-   USE in_out_manager
-   USE phycst
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbc_ice         ! Surface boundary condition: ice fields
-   USE thd_ice
-   USE dom_ice
-   USE par_ice
-   USE ice
-   USE limtab
-   USE limcons
+   USE dom_oce          ! domain variables
+   USE phycst           ! physical constants
+   USE sbc_oce          ! Surface boundary condition: ocean fields
+   USE sbc_ice          ! Surface boundary condition: ice fields
+   USE thd_ice          ! LIM thermodynamics
+   USE dom_ice          ! LIM domain
+   USE par_ice          ! LIM parameters
+   USE ice              ! LIM variables
+   USE limtab           ! LIM 2D <==> 1D
+   USE limcons          ! LIM conservation
+   USE wrk_nemo         ! workspace manager
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
    PUBLIC lim_thd_lac     ! called by lim_thd
 
-   !! * Module variables
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1.e-20  ,  &
-      epsi13 = 1.e-13  ,  &
-      epsi11 = 1.e-13  ,  &
-      epsi03 = 1.e-03  ,  &
-      epsi06 = 1.e-06  ,  &
-      zeps   = 1.e-10  ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0
+   REAL(wp) ::   epsi20 = 1e-20_wp   ! constant values
+   REAL(wp) ::   epsi13 = 1e-13_wp   !
+   REAL(wp) ::   epsi11 = 1e-11_wp   !
+   REAL(wp) ::   epsi10 = 1e-10_wp   !
+   REAL(wp) ::   epsi06 = 1e-06_wp   !
+   REAL(wp) ::   epsi03 = 1e-03_wp   !
+   REAL(wp) ::   zzero  = 0._wp      !
+   REAL(wp) ::   zone   = 1._wp      !
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -73,122 +76,65 @@
       !!             - Computation of frldb after lateral accretion and 
       !!               update ht_s_b, ht_i_b and tbif_1d(:,:)      
-      !! 
-      !! ** References : Not available yet
-      !!
-      !! History :
-      !!   3.0  !  12-05 (M. Vancoppenolle)  Thorough rewrite of the routine
-      !!                                     Salinity variations in sea ice, 
-      !!                                     Multi-layer code
-      !!   3.1  !  01-06 (M. Vancoppenolle)  ITD
-      !!   3.2  !  04-07 (M. Vancoppenolle)  Mass and energy conservation tested
       !!------------------------------------------------------------------------
-      !! * Arguments
-      !! * Local variables
-      INTEGER ::             &
-         ji,jj,jk,jl,jm  ,   &  !: dummy loop indices
-         layer           ,   &  !: layer index
-         nbpac                  !: nb of pts for lateral accretion 
-
-      INTEGER ::             &
-         zji             ,   &  !: ji of dummy test point 
-         zjj             ,   &  !: jj of dummy test point
-         iter                   !: iteration for frazil ice computation
-
-      INTEGER, DIMENSION(jpij) :: &
-         zcatac          ,   &  !:  indexes of categories where new ice grows
-         zswinew                !: switch for new ice or not
-
-      REAL(wp), DIMENSION(jpij) :: &
-         zv_newice       ,   &  !: volume of accreted ice
-         za_newice       ,   &  !: fractional area of accreted ice
-         zh_newice       ,   &  !: thickness of accreted ice
-         ze_newice       ,   &  !: heat content of accreted ice
-         zs_newice       ,   &  !: salinity of accreted ice
-         zo_newice       ,   &  !: age of accreted ice
-         zdv_res         ,   &  !: residual volume in case of excessive heat budget
-         zda_res         ,   &  !: residual area in case of excessive heat budget
-         zat_i_ac        ,   &  !: total ice fraction    
-         zat_i_lev       ,   &  !: total ice fraction for level ice only (type 1)   
-         zdh_frazb       ,   &  !: accretion of frazil ice at the ice bottom
-         zvrel_ac               !: relative ice / frazil velocity (1D vector)
-
-      REAL(wp), DIMENSION(jpij,jpl) :: &
-         zhice_old       ,   &  !: previous ice thickness
-         zdummy          ,   &  !: dummy thickness of new ice 
-         zdhicbot        ,   &  !: thickness of new ice which is accreted vertically
-         zv_old          ,   &  !: old volume of ice in category jl
-         za_old          ,   &  !: old area of ice in category jl
-         za_i_ac         ,   &  !: 1-D version of a_i
-         zv_i_ac         ,   &  !: 1-D version of v_i
-         zoa_i_ac        ,   &  !: 1-D version of oa_i
-         zsmv_i_ac              !: 1-D version of smv_i
-
-      REAL(wp), DIMENSION(jpij,jkmax,jpl) :: &
-         ze_i_ac                !: 1-D version of e_i
-
-      REAL(wp), DIMENSION(jpij) :: &
-         zqbgow          ,   &  !: heat budget of the open water (negative)
-         zdhex                  !: excessively thick accreted sea ice (hlead-hice)
-
-      REAL(wp)  ::           &
-         ztmelts         ,   &  !: melting point of an ice layer
-         zdv             ,   &  !: increase in ice volume in each category
-         zfrazb                 !: fraction of frazil ice accreted at the ice bottom
-
-      ! Redistribution of energy after bottom accretion
-      REAL(wp)  ::           &  !: Energy redistribution
-         zqold           ,   &  !: old ice enthalpy
-         zweight         ,   &  !: weight of redistribution
-         zeps6           ,   &  !: epsilon value
-         zalphai         ,   &  !: factor describing how old and new layers overlap each other [m]
-         zindb            
-
-      REAL(wp), DIMENSION(jpij,jkmax+1,jpl) :: &
-         zqm0            ,   &  !: old layer-system heat content
-         zthick0                !: old ice thickness
-
-      ! Frazil ice collection thickness
-      LOGICAL :: &              !: iterate frazil ice collection thickness
-         iterate_frazil
-
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         zvrel                  !: relative ice / frazil velocity
-
-      REAL(wp) ::            &
-         zgamafr          ,  &  !: mult. coeff. between frazil vel. and wind speed
-         ztenagm          ,  &  !: square root of wind stress
-         zvfrx            ,  &  !: x-component of frazil velocity
-         zvfry            ,  &  !: y-component of frazil velocity
-         zvgx             ,  &  !: x-component of ice velocity
-         zvgy             ,  &  !: y-component of ice velocity
-         ztaux            ,  &  !: x-component of wind stress
-         ztauy            ,  &  !: y-component of wind stress
-         ztwogp           ,  &  !: dummy factor including reduced gravity
-         zvrel2           ,  &  !: square of the relative ice-frazil velocity
-         zf               ,  &  !: F for Newton-Raphson procedure
-         zfp              ,  &  !: dF for Newton-Raphson procedure
-         zhicol_new       ,  &  !: updated collection thickness
-         zsqcd            ,  &  !: 1 / square root of ( airdensity * drag )
-         zhicrit                !: minimum thickness of frazil ice
-
-      ! Variables for energy conservation
-      REAL (wp), DIMENSION(jpi,jpj) :: &  ! 
-         vt_i_init, vt_i_final,   &  !  ice volume summed over categories
-         vt_s_init, vt_s_final,   &  !  snow volume summed over categories
-         et_i_init, et_i_final,   &  !  ice energy summed over categories
-         et_s_init                   !  snow energy summed over categories
-
-      REAL(wp) ::            &
-         zde                         ! :increment of energy in category jl
-
+      USE wrk_nemo, ONLY :   vt_i_init => wrk_2d_1 , vt_i_final => wrk_2d_4 , et_i_init => wrk_2d_7
+      USE wrk_nemo, ONLY :   vt_s_init => wrk_2d_2 , vt_s_final => wrk_2d_5 , et_s_init => wrk_2d_8
+      USE wrk_nemo, ONLY :   zvrel     => wrk_2d_3 , et_i_final => wrk_2d_6 
+      !
+      INTEGER ::   ji,jj,jk,jl,jm   ! dummy loop indices
+      INTEGER ::   layer, nbpac     ! local integers 
+      INTEGER ::   zji, zjj, iter   !   -       -
+      REAL(wp)  ::   ztmelts, zdv, zqold, zfrazb, zweight, zalphai, zindb, zde  ! local scalars
+      REAL(wp) ::   zgamafr, zvfrx, zvgx, ztaux, ztwogp, zf , zhicol_new        !   -      -
+      REAL(wp) ::   ztenagm, zvfry, zvgy, ztauy, zvrel2, zfp, zsqcd , zhicrit   !   -      -
+      LOGICAL  ::   iterate_frazil   ! iterate frazil ice collection thickness
       CHARACTER (len = 15) :: fieldid
-
+      !
+      INTEGER, DIMENSION(jpij) ::   zcatac    !  indexes of categories where new ice grows
+
+      REAL(wp), DIMENSION(jpij,jpl) ::   zhice_old   ! previous ice thickness
+      REAL(wp), DIMENSION(jpij,jpl) ::   zdummy      ! dummy thickness of new ice 
+      REAL(wp), DIMENSION(jpij,jpl) ::   zdhicbot    ! thickness of new ice which is accreted vertically
+      REAL(wp), DIMENSION(jpij,jpl) ::   zv_old      ! old volume of ice in category jl
+      REAL(wp), DIMENSION(jpij,jpl) ::   za_old      ! old area of ice in category jl
+      REAL(wp), DIMENSION(jpij,jpl) ::   za_i_ac     ! 1-D version of a_i
+      REAL(wp), DIMENSION(jpij,jpl) ::   zv_i_ac     ! 1-D version of v_i
+      REAL(wp), DIMENSION(jpij,jpl) ::   zoa_i_ac    ! 1-D version of oa_i
+      REAL(wp), DIMENSION(jpij,jpl) ::   zsmv_i_ac   ! 1-D version of smv_i
+
+      REAL(wp), DIMENSION(jpij,jkmax  ,jpl) ::   ze_i_ac   !: 1-D version of e_i
+      REAL(wp), DIMENSION(jpij,jkmax+1,jpl) ::   zqm0      ! old layer-system heat content
+      REAL(wp), DIMENSION(jpij,jkmax+1,jpl) ::   zthick0   ! old ice thickness
+
+      REAL(wp), POINTER, DIMENSION(:) ::   zv_newice, zh_newice, zs_newice, zdv_res, zat_i_ac , zdh_frazb, zqbgow
+      REAL(wp), POINTER, DIMENSION(:) ::   za_newice, ze_newice, zo_newice, zda_res, zat_i_lev, zvrel_ac , zdhex
+      REAL(wp), POINTER, DIMENSION(:) ::   zswinew
       !!-----------------------------------------------------------------------!
 
-      et_i_init(:,:) = 0.0
-      et_s_init(:,:) = 0.0
-      vt_i_init(:,:) = 0.0
-      vt_s_init(:,:) = 0.0
-      zeps6   = 1.0e-6
+      IF(  wrk_in_use(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14) .OR.   &
+         & wrk_in_use(2, 1,2,3,4,5,6,7,8)                        ) THEN
+         CALL ctl_stop('lim_thd_dh : requestead workspace arrays unavailable.')   ;   RETURN
+      END IF
+      ! Set-up pointers to sub-arrays of workspace arrays
+      zv_newice =>  wrk_1d_1 (1:jpij)   ! volume of accreted ice
+      za_newice =>  wrk_1d_2 (1:jpij)   ! fractional area of accreted ice
+      zh_newice =>  wrk_1d_3 (1:jpij)   ! thickness of accreted ice
+      ze_newice =>  wrk_1d_4 (1:jpij)   ! heat content of accreted ice
+      zs_newice =>  wrk_1d_5 (1:jpij)   ! salinity of accreted ice
+      zo_newice =>  wrk_1d_6 (1:jpij)   ! age of accreted ice
+      zdv_res   =>  wrk_1d_7 (1:jpij)   ! residual volume in case of excessive heat budget
+      zda_res   =>  wrk_1d_8 (1:jpij)   ! residual area in case of excessive heat budget
+      zat_i_ac  =>  wrk_1d_9 (1:jpij)   ! total ice fraction
+      zat_i_lev =>  wrk_1d_10(1:jpij)   ! total ice fraction for level ice only (type 1)   
+      zdh_frazb =>  wrk_1d_11(1:jpij)   ! accretion of frazil ice at the ice bottom
+      zvrel_ac  =>  wrk_1d_12(1:jpij)   ! relative ice / frazil velocity (1D vector)
+      zqbgow    =>  wrk_1d_13(1:jpij)   ! heat budget of the open water (negative)
+      zdhex     =>  wrk_1d_14(1:jpij)   ! excessively thick accreted sea ice (hlead-hice)
+
+
+
+      et_i_init(:,:) = 0._wp
+      et_s_init(:,:) = 0._wp
+      vt_i_init(:,:) = 0._wp
+      vt_s_init(:,:) = 0._wp
 
       !------------------------------------------------------------------------------!
@@ -211,5 +157,5 @@
                   !Energy of melting q(S,T) [J.m-3]
                   e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) / &
-                     MAX( area(ji,jj) * v_i(ji,jj,jl) ,  zeps ) * &
+                     MAX( area(ji,jj) * v_i(ji,jj,jl) ,  epsi10 ) * &
                      nlay_i
                   zindb      = 1.0-MAX(0.0,SIGN(1.0,-v_i(ji,jj,jl))) !0 if no ice and 1 if yes
@@ -273,6 +219,6 @@
                   ! Frazil ice velocity
                   !---------------------
-                  zvfrx         = zgamafr * zsqcd * ztaux / MAX(ztenagm,zeps)
-                  zvfry         = zgamafr * zsqcd * ztauy / MAX(ztenagm,zeps)
+                  zvfrx         = zgamafr * zsqcd * ztaux / MAX(ztenagm,epsi10)
+                  zvfry         = zgamafr * zsqcd * ztauy / MAX(ztenagm,epsi10)
 
                   !-------------------
@@ -546,15 +492,13 @@
          ! Laterally redistribute new ice volume and area
          !------------------------------------------------
-         zat_i_ac(:) = 0.0
-
+         zat_i_ac(:) = 0._wp
          DO jl = 1, jpl
             DO ji = 1, nbpac
-               ! vectorize
-               IF (       ( hi_max(jl-1)  .LT. zh_newice(ji) ) &
-                  .AND. ( zh_newice(ji) .LE. hi_max(jl)    ) ) THEN
-                  za_i_ac(ji,jl) = za_i_ac(ji,jl) + za_newice(ji)
-                  zv_i_ac(ji,jl) = zv_i_ac(ji,jl) + zv_newice(ji)
-                  zat_i_ac(ji)   = zat_i_ac(ji) + za_i_ac(ji,jl)
-                  zcatac(ji)     = jl
+               IF(  hi_max   (jl-1)  <  zh_newice(ji)   .AND.   &
+                  & zh_newice(ji)    <= hi_max   (jl)         ) THEN
+                  za_i_ac (ji,jl) = za_i_ac (ji,jl) + za_newice(ji)
+                  zv_i_ac (ji,jl) = zv_i_ac (ji,jl) + zv_newice(ji)
+                  zat_i_ac(ji)    = zat_i_ac(ji)    + za_i_ac  (ji,jl)
+                  zcatac  (ji)    = jl
                ENDIF
             END DO ! ji
@@ -565,14 +509,9 @@
          !----------------------------------
          DO ji = 1, nbpac
-            jl = zcatac(ji) ! categroy in which new ice is put
-            ! zindb = 0 if no ice and 1 if yes
-            zindb            = 1.0 - MAX ( 0.0 , SIGN ( 1.0 , -za_old(ji,jl) ) ) 
-            ! old ice thickness
-            zhice_old(ji,jl)  = zv_old(ji,jl)                                  &
-               / MAX ( za_old(ji,jl) , zeps ) * zindb
-            ! difference in thickness
-            zdhex(ji)      = MAX( 0.0, zh_newice(ji) - zhice_old(ji,jl) ) 
-            ! is ice totally new in category jl ?
-            zswinew(ji)    = MAX( 0.0, SIGN( 1.0 , - za_old(ji,jl) + epsi11 ) )
+            jl = zcatac(ji)                                                           ! categroy in which new ice is put
+            zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp , -za_old(ji,jl) ) )             ! zindb=1 if ice =0 otherwise
+            zhice_old(ji,jl) = zv_old(ji,jl) / MAX( za_old(ji,jl) , epsi10 ) * zindb  ! old ice thickness
+            zdhex    (ji) = MAX( 0._wp , zh_newice(ji) - zhice_old(ji,jl) )           ! difference in thickness
+            zswinew  (ji) = MAX( 0._wp , SIGN( 1._wp , - za_old(ji,jl) + epsi11 ) )   ! ice totally new in jl category
          END DO
 
@@ -580,19 +519,13 @@
             DO ji = 1, nbpac
                jl = zcatac(ji)
-               zqold              = ze_i_ac(ji,jk,jl) ! [ J.m-3 ]
-               zalphai            = MIN( zhice_old(ji,jl) * jk  / nlay_i ,     &
-                  zh_newice(ji) )                       &
-                  - MIN( zhice_old(ji,jl) * ( jk - 1 )         &
-                  / nlay_i , zh_newice(ji) )
-               ze_i_ac(ji,jk,jl) =                                             &
-                  zswinew(ji)           * ze_newice(ji)                           &
-                  + ( 1.0 - zswinew(ji) ) *                                         &
-                  ( za_old(ji,jl)  * zqold * zhice_old(ji,jl) / nlay_i            &
-                  + za_newice(ji)  * ze_newice(ji) * zalphai                      &
-                  + za_newice(ji)  * ze_newice(ji) * zdhex(ji) / nlay_i ) /       &
-                  ( ( zv_i_ac(ji,jl) ) / nlay_i )
-
-            END DO !ji
-         END DO !jl
+               zqold   = ze_i_ac(ji,jk,jl) ! [ J.m-3 ]
+               zalphai = MIN( zhice_old(ji,jl) *   jk       / nlay_i , zh_newice(ji) )   &
+                  &    - MIN( zhice_old(ji,jl) * ( jk - 1 ) / nlay_i , zh_newice(ji) )
+               ze_i_ac(ji,jk,jl) = zswinew(ji) * ze_newice(ji)                                     &
+                  + ( 1.0 - zswinew(ji) ) * ( za_old(ji,jl)  * zqold * zhice_old(ji,jl) / nlay_i   &
+                  + za_newice(ji)  * ze_newice(ji) * zalphai                                       &
+                  + za_newice(ji)  * ze_newice(ji) * zdhex(ji) / nlay_i ) / ( ( zv_i_ac(ji,jl) ) / nlay_i )
+            END DO
+         END DO
 
          !-----------------------------------------------
@@ -605,5 +538,5 @@
          ! Fraction of level ice
          jm = 1
-         zat_i_lev(:) = 0.0
+         zat_i_lev(:) = 0._wp
 
          DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2)
@@ -616,11 +549,9 @@
          DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2)
             DO ji = 1, nbpac
-               zindb      =  MAX( 0.0, SIGN( 1.0, zdv_res(ji) ) )
-               zv_i_ac(ji,jl) = zv_i_ac(ji,jl) +                               &
-                  zindb * zdv_res(ji) * za_i_ac(ji,jl) /         &
-                  MAX( zat_i_lev(ji) , epsi06 )
-            END DO ! ji
-         END DO ! jl
-         IF( ln_nicep ) WRITE(numout,*) ' zv_i_ac : ', zv_i_ac(jiindx, 1:jpl)
+               zindb = MAX( 0._wp, SIGN( 1._wp , zdv_res(ji) ) )
+               zv_i_ac(ji,jl) = zv_i_ac(ji,jl) + zindb * zdv_res(ji) * za_i_ac(ji,jl) / MAX( zat_i_lev(ji) , epsi06 )
+            END DO
+         END DO
+         IF( ln_nicep )   WRITE(numout,*) ' zv_i_ac : ', zv_i_ac(jiindx, 1:jpl)
 
          !---------------------------------
@@ -630,17 +561,11 @@
          DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2)
             DO ji = 1, nbpac
-               ! zindb = 0 if no ice and 1 if yes
-               zindb            =  1.0 -  MAX( 0.0 , SIGN( 1.0                 & 
-                  , - za_i_ac(ji,jl ) ) ) 
-               zhice_old(ji,jl) =  zv_i_ac(ji,jl) /                            &
-                  MAX( za_i_ac(ji,jl) , zeps ) * zindb
-               zdhicbot(ji,jl)  =  zdv_res(ji) / MAX( za_i_ac(ji,jl) , zeps )  & 
-                  *  zindb &
-                  +  zindb * zdh_frazb(ji) ! frazil ice 
-               ! may coalesce
-               ! thickness of residual ice
-               zdummy(ji,jl)    = zv_i_ac(ji,jl)/MAX(za_i_ac(ji,jl),zeps)*zindb
-            END DO !ji
-         END DO !jl
+               zindb =  1._wp - MAX( 0._wp , SIGN( 1._wp , - za_i_ac(ji,jl ) ) )       ! zindb=1 if ice =0 otherwise
+               zhice_old(ji,jl) = zv_i_ac(ji,jl) / MAX( za_i_ac(ji,jl) , epsi10 ) * zindb
+               zdhicbot (ji,jl) = zdv_res(ji)    / MAX( za_i_ac(ji,jl) , epsi10 ) * zindb    &
+                  &             +  zindb * zdh_frazb(ji)                               ! frazil ice may coalesce
+               zdummy(ji,jl)    = zv_i_ac(ji,jl)/MAX(za_i_ac(ji,jl),epsi10)*zindb      ! thickness of residual ice
+            END DO
+         END DO
 
          ! old layers thicknesses and enthalpies
@@ -648,33 +573,29 @@
             DO jk = 1, nlay_i
                DO ji = 1, nbpac
-                  zthick0(ji,jk,jl)=  zhice_old(ji,jl) / nlay_i
-                  zqm0   (ji,jk,jl)=  ze_i_ac(ji,jk,jl) * zthick0(ji,jk,jl)
-               END DO !ji
-            END DO !jk
-         END DO !jl
-
+                  zthick0(ji,jk,jl) =  zhice_old(ji,jl) / nlay_i
+                  zqm0   (ji,jk,jl) =  ze_i_ac(ji,jk,jl) * zthick0(ji,jk,jl)
+               END DO
+            END DO
+         END DO
+!!gm ???  why the previous do loop  if ocerwriten by the following one ?
          DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2)
             DO ji = 1, nbpac
                zthick0(ji,nlay_i+1,jl) =  zdhicbot(ji,jl)
-               zqm0   (ji,nlay_i+1,jl) =  ze_newice(ji)*zdhicbot(ji,jl)
+               zqm0   (ji,nlay_i+1,jl) =  ze_newice(ji) * zdhicbot(ji,jl)
             END DO ! ji
          END DO ! jl
 
          ! Redistributing energy on the new grid
-         ze_i_ac(:,:,:) = 0.0
+         ze_i_ac(:,:,:) = 0._wp
          DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2)
             DO jk = 1, nlay_i
                DO layer = 1, nlay_i + 1
                   DO ji = 1, nbpac
-                     zindb            =  1.0 -  MAX( 0.0 , SIGN( 1.0 ,         & 
-                        - za_i_ac(ji,jl ) ) ) 
+                     zindb =  1._wp -  MAX( 0._wp , SIGN( 1._wp , - za_i_ac(ji,jl) ) ) 
                      ! Redistributing energy on the new grid
-                     zweight         =  MAX (  &
-                        MIN( zhice_old(ji,jl) * layer , zdummy(ji,jl) * jk ) -    &
-                        MAX( zhice_old(ji,jl) * ( layer - 1 ) , zdummy(ji,jl) *   &
-                        ( jk - 1 ) ) , 0.0 )                                  &
-                        /  ( MAX(nlay_i * zthick0(ji,layer,jl),zeps) ) * zindb
-                     ze_i_ac(ji,jk,jl) =  ze_i_ac(ji,jk,jl) +                  &
-                        zweight * zqm0(ji,layer,jl)  
+                     zweight = MAX (  MIN( zhice_old(ji,jl) * layer , zdummy(ji,jl) * jk )   &
+                        &    - MAX( zhice_old(ji,jl) * ( layer - 1 ) , zdummy(ji,jl) * ( jk - 1 ) ) , 0._wp )   &
+                        &    /( MAX(nlay_i * zthick0(ji,layer,jl),epsi10) ) * zindb
+                     ze_i_ac(ji,jk,jl) =  ze_i_ac(ji,jk,jl) + zweight * zqm0(ji,layer,jl)  
                   END DO ! ji
                END DO ! layer
@@ -685,9 +606,7 @@
             DO jk = 1, nlay_i
                DO ji = 1, nbpac
-                  zindb                =  1.0 - MAX( 0.0 , SIGN( 1.0           &
-                     , - zv_i_ac(ji,jl) ) ) !0 if no ice 
-                  ze_i_ac(ji,jk,jl)    = ze_i_ac(ji,jk,jl) /                   &
-                     MAX( zv_i_ac(ji,jl) , zeps)           &
-                     * za_i_ac(ji,jl) * nlay_i * zindb
+                  zindb =  1._wp -  MAX( 0._wp , SIGN( 1._wp , - zv_i_ac(ji,jl) ) ) 
+                  ze_i_ac(ji,jk,jl) = ze_i_ac(ji,jk,jl)   &
+                     &              / MAX( zv_i_ac(ji,jl) , epsi10) * za_i_ac(ji,jl) * nlay_i * zindb
                END DO
             END DO
@@ -699,53 +618,37 @@
          DO jl = 1, jpl
             DO ji = 1, nbpac
-               !--ice age
-               zindb            = 1.0 - MAX( 0.0 , SIGN( 1.0 , -               &
-                  za_i_ac(ji,jl) ) )  ! 0 if no ice and 1 if yes
-               zoa_i_ac(ji,jl)  = za_old(ji,jl) * zoa_i_ac(ji,jl) /            &
-                  MAX( za_i_ac(ji,jl) , zeps ) * zindb   
-            END DO ! ji
-         END DO ! jl   
+               zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp , - za_i_ac(ji,jl) ) )  ! 0 if no ice and 1 if yes
+               zoa_i_ac(ji,jl)  = za_old(ji,jl) * zoa_i_ac(ji,jl) / MAX( za_i_ac(ji,jl) , epsi10 ) * zindb   
+            END DO 
+         END DO   
 
          !-----------------
          ! Update salinity
          !-----------------
-         IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) THEN
-
+         IF(  num_sal == 2  .OR.  num_sal == 4  ) THEN
             DO jl = 1, jpl
                DO ji = 1, nbpac
-                  !zindb = 0 if no ice and 1 if yes
-                  zindb            = 1.0 - MAX( 0.0 , SIGN( 1.0 , -               &
-                     zv_i_ac(ji,jl) ) )  ! 0 if no ice and 1 if yes
-                  zdv              = zv_i_ac(ji,jl) - zv_old(ji,jl)
-                  zsmv_i_ac(ji,jl) = ( zsmv_i_ac(ji,jl) + zdv * zs_newice(ji) ) * &
-                     zindb
-               END DO ! ji
-            END DO ! jl   
-
-         ENDIF ! num_sal
-
+                  zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp , - zv_i_ac(ji,jl) ) )  ! 0 if no ice and 1 if yes
+                  zdv   = zv_i_ac(ji,jl) - zv_old(ji,jl)
+                  zsmv_i_ac(ji,jl) = ( zsmv_i_ac(ji,jl) + zdv * zs_newice(ji) ) * zindb
+               END DO
+            END DO   
+         ENDIF
 
          !------------------------------------------------------------------------------!
          ! 8) Change 2D vectors to 1D vectors 
          !------------------------------------------------------------------------------!
-
          DO jl = 1, jpl
-            CALL tab_1d_2d( nbpac, a_i(:,:,jl) , npac(1:nbpac) ,               &
-               za_i_ac(1:nbpac,jl) , jpi, jpj )
-            CALL tab_1d_2d( nbpac, v_i(:,:,jl) , npac(1:nbpac) ,               &
-               zv_i_ac(1:nbpac,jl) , jpi, jpj )
-            CALL tab_1d_2d( nbpac, oa_i(:,:,jl), npac(1:nbpac) ,               &
-               zoa_i_ac(1:nbpac,jl), jpi, jpj )
-            IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) &
-               CALL tab_1d_2d( nbpac, smv_i(:,:,jl) , npac(1:nbpac) ,             &
-               zsmv_i_ac(1:nbpac,jl) , jpi, jpj )
+            CALL tab_1d_2d( nbpac, a_i (:,:,jl), npac(1:nbpac), za_i_ac (1:nbpac,jl), jpi, jpj )
+            CALL tab_1d_2d( nbpac, v_i (:,:,jl), npac(1:nbpac), zv_i_ac (1:nbpac,jl), jpi, jpj )
+            CALL tab_1d_2d( nbpac, oa_i(:,:,jl), npac(1:nbpac), zoa_i_ac(1:nbpac,jl), jpi, jpj )
+            IF (  num_sal == 2  .OR.  num_sal == 4  )   &
+               CALL tab_1d_2d( nbpac, smv_i (:,:,jl), npac(1:nbpac), zsmv_i_ac(1:nbpac,jl) , jpi, jpj )
             DO jk = 1, nlay_i
-               CALL tab_1d_2d( nbpac, e_i(:,:,jk,jl) , npac(1:nbpac),          &
-                  ze_i_ac(1:nbpac,jk,jl), jpi, jpj )
-            END DO ! jk
-         END DO !jl
-         CALL tab_1d_2d( nbpac, fseqv , npac(1:nbpac), fseqv_1d  (1:nbpac) ,   &
-            jpi, jpj )
-
+               CALL tab_1d_2d( nbpac, e_i(:,:,jk,jl), npac(1:nbpac), ze_i_ac(1:nbpac,jk,jl), jpi, jpj )
+            END DO
+         END DO
+         CALL tab_1d_2d( nbpac, fseqv , npac(1:nbpac), fseqv_1d  (1:nbpac) , jpi, jpj )
+         !
       ENDIF ! nbpac > 0
 
@@ -753,19 +656,7 @@
       ! 9) Change units for e_i
       !------------------------------------------------------------------------------!    
-
       DO jl = 1, jpl
-         DO jk = 1, nlay_i
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  ! Correct dimensions to avoid big values
-                  e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) / unit_fac
-
-                  ! Mutliply by ice volume, and divide by number 
-                  ! of layers to get heat content in 10^9 Joules
-                  e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * &
-                     area(ji,jj) * v_i(ji,jj,jl) / &
-                     nlay_i
-               END DO
-            END DO
+         DO jk = 1, nlay_i          ! heat content in 10^9 Joules
+            e_i(:,:,jk,jl) = e_i(:,:,jk,jl) * area(:,:) * v_i(:,:,jl) / nlay_i  / unit_fac 
          END DO
       END DO
@@ -774,22 +665,20 @@
       ! 10) Conservation check and changes in each ice category
       !------------------------------------------------------------------------------|
-
-      IF ( con_i ) THEN 
+      IF( con_i ) THEN 
          CALL lim_column_sum (jpl,   v_i, vt_i_final)
          fieldid = 'v_i, limthd_lac'
          CALL lim_cons_check (vt_i_init, vt_i_final, 1.0e-6, fieldid) 
-
+         !
          CALL lim_column_sum_energy(jpl, nlay_i, e_i, et_i_final)
          fieldid = 'e_i, limthd_lac'
          CALL lim_cons_check (et_i_final, et_i_final, 1.0e-3, fieldid) 
-
+         !
          CALL lim_column_sum (jpl,   v_s, vt_s_final)
          fieldid = 'v_s, limthd_lac'
          CALL lim_cons_check (vt_s_init, vt_s_final, 1.0e-6, fieldid) 
-
+         !
          !     CALL lim_column_sum (jpl,   e_s(:,:,1,:) , et_s_init)
          !     fieldid = 'e_s, limthd_lac'
          !     CALL lim_cons_check (et_s_init, et_s_final, 1.0e-3, fieldid) 
-
          IF( ln_nicep ) THEN
             WRITE(numout,*) ' vt_i_init : ', vt_i_init(jiindx,jjindx)
@@ -798,17 +687,22 @@
             WRITE(numout,*) ' et_i_final: ', et_i_final(jiindx,jjindx)
          ENDIF
-
+         !
       ENDIF
-
+      !
+      IF( wrk_not_released(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14) .OR.     &
+          wrk_not_released(2, 1,2,3,4,5,6,7,8)                       )   &
+          CALL ctl_stop( 'lim_thd_lac : failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_thd_lac
 
 #else
-   !!======================================================================
-   !!                       ***  MODULE limthd_lac   ***
-   !!                           no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
+   !!   Default option                               NO  LIM3 sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_thd_lac           ! Empty routine
    END SUBROUTINE lim_thd_lac
 #endif
+
+   !!======================================================================
 END MODULE limthd_lac
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90	(revision 2715)
@@ -6,4 +6,5 @@
    !! History :   -   ! 2003-05 (M. Vancoppenolle) UCL-ASTR first coding for LIM3-1D
    !!            3.0  ! 2005-12 (M. Vancoppenolle) adapted to the 3-D version
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
    !!---------------------------------------------------------------------
 #if defined key_lim3
@@ -16,9 +17,11 @@
    USE phycst           ! physical constants (ocean directory)
    USE sbc_oce          ! Surface boundary condition: ocean fields
-   USE ice              ! LIM: sea-ice variables
-   USE par_ice          ! LIM: sea-ice parameters
-   USE thd_ice          ! LIM: sea-ice thermodynamics
-   USE limvar           ! LIM: sea-ice variables
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE thd_ice          ! LIM thermodynamics
+   USE limvar           ! LIM variables
+   USE wrk_nemo         ! workspace manager
    USE in_out_manager   ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -29,5 +32,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -51,16 +54,24 @@
       INTEGER  ::   ji, jk     ! dummy loop indices 
       INTEGER  ::   zji, zjj   ! local integers
-      REAL(wp) ::   zsold, zeps, iflush, iaccrbo, igravdr, isnowic, i_ice_switch,  ztmelts   ! local scalars
+      REAL(wp) ::   zsold, iflush, iaccrbo, igravdr, isnowic, i_ice_switch,  ztmelts   ! local scalars
       REAL(wp) ::   zaaa, zbbb, zccc, zdiscrim   ! local scalars
-      REAL(wp), DIMENSION(jpij) ::   ze_init, zhiold, zsiold   ! 1D workspace
+      !
+      REAL(wp), POINTER, DIMENSION(:) ::   ze_init, zhiold, zsiold
       !!---------------------------------------------------------------------
 
-      zeps=1.0e-06_wp
+      IF(  wrk_in_use(1, 1,2,3)  ) THEN
+         CALL ctl_stop('lim_thd_dh : requestead workspace arrays unavailable.')   ;   RETURN
+      END IF
+      ! Set-up pointers to sub-arrays of workspace arrays
+      ze_init =>  wrk_1d_1 (1:jpij)
+      zhiold  =>  wrk_1d_2 (1:jpij)
+      zsiold  =>  wrk_1d_3 (1:jpij)
 
       !------------------------------------------------------------------------------|
       ! 1) Constant salinity, constant in time                                       |
       !------------------------------------------------------------------------------|
-
+!!gm comment: if num_sal = 1 s_i_b and sm_i_b can be set to bulk_sal one for all in the initialisation phase !!
       IF( num_sal == 1 ) THEN
+         !
          DO jk = 1, nlay_i
             DO ji = kideb, kiut
@@ -79,11 +90,5 @@
       !------------------------------------------------------------------------------|
 
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) THEN
-
-         !         WRITE(numout,*)
-         !         WRITE(numout,*) 'lim_thd_sal : Ice salinity computation module ', &
-         !         num_sal
-         !         WRITE(numout,*) '~~~~~~~~~~~'
-         !         WRITE(numout,*)
+      IF(  num_sal == 2  .OR.  num_sal == 4  ) THEN
 
          !---------------------------------
@@ -91,58 +96,46 @@
          !---------------------------------
          DO ji = kideb, kiut
-            zhiold(ji)   =  ht_i_b(ji) - dh_i_bott(ji) - dh_snowice(ji) -     &
-               dh_i_surf(ji)
-         END DO ! ji
+            zhiold(ji) = ht_i_b(ji) - dh_i_bott(ji) - dh_snowice(ji) - dh_i_surf(ji)
+         END DO
 
          !---------------------
          ! Global heat content
          !---------------------
-
-         ze_init(:)  =  0.0
+         ze_init(:)  =  0._wp
          DO jk = 1, nlay_i
             DO ji = kideb, kiut
                ze_init(ji) = ze_init(ji) + q_i_b(ji,jk) * ht_i_b(ji) / nlay_i
-            END DO ! ji
-         END DO ! jk
-
-         DO ji = kideb, kiut
-
-            !----------
+            END DO
+         END DO
+
+         DO ji = kideb, kiut
+            !
             ! Switches 
             !----------
-
-            ! iflush  : 1 if summer 
-            iflush       =  MAX( 0.0 , SIGN ( 1.0 , t_su_b(ji) - rtt ) ) 
-            ! igravdr : 1 if t_su lt t_bo
-            igravdr      =  MAX( 0.0 , SIGN ( 1.0 , t_bo_b(ji) - t_su_b(ji) ) )
-            ! iaccrbo : 1 if bottom accretion
-            iaccrbo      =  MAX( 0.0 , SIGN ( 1.0 , dh_i_bott(ji) ) )
-            ! isnowic : 1 if snow ice formation
-            i_ice_switch = 1.0 - MAX ( 0.0 , SIGN ( 1.0 , - ht_i_b(ji) + 1.0e-2 ) )
-            isnowic      = 1.0 - MAX ( 0.0 , SIGN ( 1.0 , - dh_snowice(ji) ) ) * i_ice_switch
+            iflush       =         MAX( 0._wp , SIGN( 1.0 , t_su_b(ji) - rtt )        )    ! =1 if summer 
+            igravdr      =         MAX( 0._wp , SIGN( 1.0 , t_bo_b(ji) - t_su_b(ji) ) )    ! =1 if t_su < t_bo
+            iaccrbo      =         MAX( 0._wp , SIGN( 1.0 , dh_i_bott(ji) )           )    ! =1 if bottom accretion
+            i_ice_switch = 1._wp - MAX ( 0._wp , SIGN( 1._wp , - ht_i_b(ji) + 1.e-2 ) )
+            isnowic      = 1._wp - MAX ( 0._wp , SIGN( 1._wp , - dh_snowice(ji) ) ) * i_ice_switch   ! =1 if snow ice formation
 
             !---------------------
             ! Salinity tendencies
             !---------------------
-
-            ! drainage by gravity drainage
+            !                                   ! drainage by gravity drainage
             dsm_i_gd_1d(ji) = - igravdr * MAX( sm_i_b(ji) - sal_G , 0._wp ) / time_G * rdt_ice 
-
-            ! drainage by flushing  
-            dsm_i_fl_1d(ji)  = - iflush * MAX( sm_i_b(ji) - sal_F , 0._wp ) / time_F * rdt_ice
+            !                                   ! drainage by flushing  
+            dsm_i_fl_1d(ji) = - iflush * MAX( sm_i_b(ji) - sal_F , 0._wp ) / time_F * rdt_ice
 
             !-----------------
             ! Update salinity   
             !-----------------
-
             ! only drainage terms ( gravity drainage and flushing )
-            ! snow ice / bottom sources are added in lim_thd_ent
-            ! to conserve energy
+            ! snow ice / bottom sources are added in lim_thd_ent to conserve energy
             zsiold(ji) = sm_i_b(ji)
             sm_i_b(ji) = sm_i_b(ji) + dsm_i_fl_1d(ji) + dsm_i_gd_1d(ji)
 
-            ! if no ice, salinity eq 0.1
+            ! if no ice, salinity = 0.1
             i_ice_switch = 1._wp - MAX ( 0._wp, SIGN( 1._wp , - ht_i_b(ji) ) )
-            sm_i_b(ji)   = i_ice_switch*sm_i_b(ji) + s_i_min * ( 1._wp - i_ice_switch )
+            sm_i_b(ji)   = i_ice_switch * sm_i_b(ji) + s_i_min * ( 1._wp - i_ice_switch )
          END DO ! ji
 
@@ -155,4 +148,5 @@
 
          DO ji = kideb, kiut
+!!gm useless
             ! iflush  : 1 if summer 
             iflush  =  MAX( 0._wp , SIGN ( 1._wp , t_su_b(ji) - rtt ) ) 
@@ -161,4 +155,5 @@
             ! iaccrbo : 1 if bottom accretion
             iaccrbo =  MAX( 0._wp , SIGN ( 1._wp , dh_i_bott(ji) ) )
+!!gm end useless
             !
             fhbri_1d(ji) = 0._wp
@@ -186,8 +181,8 @@
                zbbb         =  ( rcp - cpic ) * ( ztmelts - rtt ) + q_i_b(ji,jk) / rhoic - lfus
                zccc         =  lfus * ( ztmelts - rtt )
-               zdiscrim     =  SQRT( MAX(zbbb*zbbb - 4.0*zaaa*zccc,0.0) )
+               zdiscrim     =  SQRT(  MAX( zbbb*zbbb - 4.0*zaaa*zccc, 0._wp )  )
                t_i_b(ji,jk) =  rtt - ( zbbb + zdiscrim ) / ( 2.0 *zaaa )
-            END DO !ji
-         END DO !jk
+            END DO
+         END DO
          !
       ENDIF ! num_sal .EQ. 2
@@ -197,14 +192,5 @@
       !------------------------------------------------------------------------------|
 
-      IF( num_sal .EQ. 3 ) THEN
-
-         WRITE(numout,*)
-         WRITE(numout,*) 'lim_thd_sal : Ice salinity computation module ', &
-            num_sal
-         WRITE(numout,*) '~~~~~~~~~~~~'
-
-         CALL lim_var_salprof1d(kideb,kiut)
-
-      ENDIF ! num_sal .EQ. 3
+      IF( num_sal == 3 )   CALL lim_var_salprof1d( kideb, kiut )
 
       !------------------------------------------------------------------------------|
@@ -212,33 +198,22 @@
       !------------------------------------------------------------------------------|
 
-      ! Cox and Weeks, 1974
-      IF (num_sal.eq.5) THEN
-
-         WRITE(numout,*)
-         WRITE(numout,*) 'lim_thd_sal : Ice salinity computation module ', &
-            num_sal
-         WRITE(numout,*) '~~~~~~~~~~~~'
-
-         DO ji = kideb, kiut
-
+      IF( num_sal == 5 ) THEN      ! Cox and Weeks, 1974
+         !
+         DO ji = kideb, kiut
             zsold = sm_i_b(ji)
-
-            IF (ht_i_b(ji).lt.0.4) THEN
-               sm_i_b(ji)    = 14.24 - 19.39*ht_i_b(ji) 
+            IF( ht_i_b(ji) < 0.4 ) THEN
+               sm_i_b(ji) = 14.24 - 19.39 * ht_i_b(ji) 
             ELSE
-               sm_i_b(ji)    =  7.88 - 1.59*ht_i_b(ji)
-               sm_i_b(ji)    = MIN(sm_i_b(ji),zsold)  
+               sm_i_b(ji) =  7.88 - 1.59 * ht_i_b(ji)
+               sm_i_b(ji) = MIN( sm_i_b(ji) , zsold )  
             ENDIF
-
-            IF ( ht_i_b(ji) .GT. 3.06918239 ) THEN 
-               sm_i_b(ji)     = 3.0
+            IF( ht_i_b(ji) > 3.06918239 ) THEN 
+               sm_i_b(ji) = 3._wp
             ENDIF
-
             DO jk = 1, nlay_i
                s_i_b(ji,jk)   = sm_i_b(ji)
             END DO
-
-         END DO ! ji
-
+         END DO
+         !
       ENDIF ! num_sal
 
@@ -247,8 +222,8 @@
       !------------------------------------------------------------------------------|
 
-      IF ( num_sal .EQ. 4 ) THEN
-         DO ji = kideb, kiut
-            zji                 = MOD( npb(ji) - 1, jpi ) + 1
-            zjj                 = ( npb(ji) - 1 ) / jpi + 1
+      IF ( num_sal == 4 ) THEN
+         DO ji = kideb, kiut
+            zji = MOD( npb(ji) - 1 , jpi ) + 1
+            zjj =    ( npb(ji) - 1 ) / jpi + 1
             fseqv_1d(ji) = fseqv_1d(ji) + ( sss_m(zji,zjj) - bulk_sal    )               &
                &                        * rhoic * a_i_b(ji) * MAX( dh_i_bott(ji) , 0.0 ) / rdt_ice
@@ -256,10 +231,12 @@
       ELSE
          DO ji = kideb, kiut
-            zji                 = MOD( npb(ji) - 1, jpi ) + 1
-            zjj                 = ( npb(ji) - 1 ) / jpi + 1
+            zji = MOD( npb(ji) - 1 , jpi ) + 1
+            zjj =    ( npb(ji) - 1 ) / jpi + 1
             fseqv_1d(ji) = fseqv_1d(ji) + ( sss_m(zji,zjj) - s_i_new(ji) )               &
                &                        * rhoic * a_i_b(ji) * MAX( dh_i_bott(ji) , 0.0 ) / rdt_ice
-         END DO ! ji
+         END DO
       ENDIF
+      !
+      IF( wrk_not_released(1, 1,2,3) )   CALL ctl_stop( 'lim_thd_lac : failed to release workspace arrays' )
       !
    END SUBROUTINE lim_thd_sal
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtrp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtrp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limtrp.F90	(revision 2715)
@@ -4,4 +4,8 @@
    !! LIM transport ice model : sea-ice advection/diffusion
    !!======================================================================
+   !! History : LIM-2 ! 2000-01 (M.A. Morales Maqueda, H. Goosse, and T. Fichefet)  Original code
+   !!            3.0  ! 2005-11 (M. Vancoppenolle)   Multi-layer sea ice, salinity variations
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
@@ -9,17 +13,16 @@
    !!----------------------------------------------------------------------
    !!   lim_trp      : advection/diffusion process of sea ice
-   !!   lim_trp_init : initialization and namelist read
-   !!----------------------------------------------------------------------
-   USE phycst
-   USE dom_oce
+   !!----------------------------------------------------------------------
+   USE phycst          ! physical constant
+   USE dom_oce         ! ocean domain
+   USE sbc_oce         ! ocean surface boundary condition
+   USE par_ice         ! LIM-3 parameter
+   USE dom_ice         ! LIM-3 domain
+   USE ice             ! LIM-3 variables
+   USE limadv          ! LIM-3 advection
+   USE limhdf          ! LIM-3 horizontal diffusion
    USE in_out_manager  ! I/O manager
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE dom_ice
-   USE ice
-   USE limadv
-   USE limhdf
-   USE lbclnk
-   USE lib_mpp
-   USE par_ice
+   USE lbclnk          ! lateral boundary conditions -- MPP exchanges
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 
@@ -27,28 +30,22 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_trp       ! called by ice_step
-
-   !! * Shared module variables
-   REAL(wp), PUBLIC  ::   &  !:
-      bound  = 0.e0           !: boundary condit. (0.0 no-slip, 1.0 free-slip)
-
-   !! * Module variables
-   REAL(wp)  ::           &  ! constant values
-      epsi06 = 1.e-06  ,  &
-      epsi03 = 1.e-03  ,  &
-      epsi16 = 1.e-16  ,  &
-      rzero  = 0.e0    ,  &
-      rone   = 1.e0    ,  &
-      zeps10 = 1.e-10
+   PUBLIC   lim_trp    ! called by ice_step
+
+   REAL(wp), PUBLIC ::   bound  = 0._wp   !: boundary condit. (0.0 no-slip, 1.0 free-slip)
+
+   REAL(wp)  ::   epsi06 = 1.e-06_wp   ! constant values
+   REAL(wp)  ::   epsi03 = 1.e-03_wp  
+   REAL(wp)  ::   zeps10 = 1.e-10_wp  
+   REAL(wp)  ::   epsi16 = 1.e-16_wp
+   REAL(wp)  ::   rzero  = 0._wp   
+   REAL(wp)  ::   rone   = 1._wp
 
    !! * Substitution
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -64,202 +61,119 @@
       !!
       !! ** action :
-      !!
-      !! History :
-      !!   1.0  !  00-01 (M.A. Morales Maqueda, H. Goosse, and T. Fichefet)  Original code
-      !!        !  01-05 (G. Madec, R. Hordoir) opa norm
-      !!   2.0  !  04-01 (G. Madec, C. Ethe)  F90, mpp
-      !!   3.0  !  05-11 (M. Vancoppenolle)   Multi-layer sea ice, salinity variations
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt     ! number of iteration
-      !! * Local Variables
-      INTEGER  ::   ji, jj, jk, jl, layer, &  ! dummy loop indices
-         initad           ! number of sub-timestep for the advection
-      INTEGER  ::   ji_maxu, ji_maxv, jj_maxu, jj_maxv
-
-      REAL(wp) ::  &                              
-         zindb  ,  &
-         zindsn ,  &
-         zindic ,  &
-         zusvosn,  &
-         zusvoic,  &
-         zvbord ,  &
-         zcfl   ,  &
-         zusnit ,  &
-         zrtt, zsal, zage, &
-         zbigval, ze, &
-         zmaxu, zmaxv
-
-      REAL(wp), DIMENSION(jpi,jpj)  ::   &  ! temporary workspace
-         zui_u , zvi_v , zsm   ,         &
-         zs0at, zs0ow
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl):: &  ! temporary workspace
-         zs0ice, zs0sn, zs0a   ,         &
-         zs0c0 ,                         &
-         zs0sm , zs0oi
-
-      ! MHE Multilayer heat content
-      REAL(wp), DIMENSION(jpi,jpj,jkmax,jpl)  ::   &  ! temporary workspace
-         zs0e
-
-      !---------------------------------------------------------------------
-
-      IF( numit == nstart  )   CALL lim_trp_init      ! Initialization (first time-step only)
-
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zs0at => wrk_2d_1 , zsm => wrk_2d_2 , zs0ow  => wrk_2d_3      ! 2D workspace
+      USE wrk_nemo, ONLY:   wrk_3d_1, wrk_3d_2, wrk_3d_3, wrk_3d_4, wrk_3d_5, wrk_3d_6    ! 3D workspace
+      USE wrk_nemo, ONLY:   wrk_4d_1                                                      ! 4D workspace
+      !
+      INTEGER, INTENT(in) ::   kt   ! number of iteration
+      !
+      INTEGER  ::   ji, jj, jk, jl, layer   ! dummy loop indices
+      INTEGER  ::   initad                  ! number of sub-timestep for the advection
+      REAL(wp) ::   zindb  , zindsn , zindic      ! local scalar
+      REAL(wp) ::   zusvosn, zusvoic, zbigval     !   -      -
+      REAL(wp) ::   zcfl , zusnit , zrtt          !   -      -
+      REAL(wp) ::   ze   , zsal   , zage          !   -      -
+      !
+      REAL(wp), POINTER, DIMENSION(:,:,:)   ::   zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi   ! 3D pointer
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zs0e                                         ! 4D pointer
+      !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5) ) THEN
+         CALL ctl_stop( 'lim_trp : requested workspace arrays unavailable' )   ;   RETURN
+      END IF
+
+      zs0ice => wrk_3d_1(:,:,1:jpl)   ;   zs0a  => wrk_3d_3   ;   zs0sm => wrk_3d_3
+      zs0sn  => wrk_3d_2(:,:,1:jpl)   ;   zs0c0 => wrk_3d_3   ;   zs0oi => wrk_3d_3
+      zs0e   => wrk_4d_1(:,:,1:jkmax,1:jpl)
+
+
+      IF( numit == nstart .AND. lwp ) THEN
+         WRITE(numout,*)
+         IF( ln_limdyn ) THEN   ;   WRITE(numout,*) 'lim_trp : Ice transport '
+         ELSE                   ;   WRITE(numout,*) 'lim_trp : No ice advection as ln_limdyn = ', ln_limdyn
+         ENDIF
+         WRITE(numout,*) '~~~~~~~~~~~~'
+      ENDIF
+      
       zsm(:,:) = area(:,:)
 
-      IF( ln_limdyn ) THEN
-         IF( kt == nit000 .AND. lwp ) THEN
-            WRITE(numout,*) ' lim_trp : Ice Advection'
-            WRITE(numout,*) ' ~~~~~~~'
-         ENDIF
-
-         !-----------------------------------------------------------------------------!
-         ! 1) CFL Test                                                             
-         !-----------------------------------------------------------------------------!
-
-         !------------------------------------------
-         ! ice velocities at ocean U- and V-points 
-         !------------------------------------------
-
-         ! zvbord factor between 1 and 2 to take into account slip or no-slip boundary conditions.        
-         zvbord = 1.0 + ( 1.0 - bound )
-         DO jj = 1, jpjm1
-            DO ji = 1, fs_jpim1
-               zui_u(ji,jj) = u_ice(ji,jj)
-               zvi_v(ji,jj) = v_ice(ji,jj)
-            END DO
-         END DO
-
-         ! Lateral boundary conditions
-         CALL lbc_lnk( zui_u, 'U', -1. )
-         CALL lbc_lnk( zvi_v, 'V', -1. )
+      !                             !-------------------------------------!
+      IF( ln_limdyn ) THEN          !   Advection of sea ice properties   !
+         !                          !-------------------------------------!
+         !
 
          !-------------------------
+         ! transported fields                                        
+         !-------------------------
+         ! Snow vol, ice vol, salt and age contents, area
+         zs0ow(:,:) = ato_i(:,:) * area(:,:)               ! Open water area 
+         DO jl = 1, jpl
+            zs0sn (:,:,jl)   = v_s  (:,:,jl) * area(:,:)    ! Snow volume
+            zs0ice(:,:,jl)   = v_i  (:,:,jl) * area(:,:)    ! Ice  volume
+            zs0a  (:,:,jl)   = a_i  (:,:,jl) * area(:,:)    ! Ice area
+            zs0sm (:,:,jl)   = smv_i(:,:,jl) * area(:,:)    ! Salt content
+            zs0oi (:,:,jl)   = oa_i (:,:,jl) * area(:,:)    ! Age content
+            zs0c0 (:,:,jl)   = e_s  (:,:,1,jl)              ! Snow heat content
+            zs0e  (:,:,:,jl) = e_i  (:,:,:,jl)              ! Ice  heat content
+         END DO
+
+         !--------------------------
+         ! Advection of Ice fields  (Prather scheme)                                            
+         !--------------------------
+         ! If ice drift field is too fast, use an appropriate time step for advection.         
          ! CFL test for stability
-         !-------------------------
-
-         zcfl  = 0.e0
-         zcfl  = MAX( zcfl, MAXVAL( ABS( zui_u(1:jpim1, :     ) ) * rdt_ice / e1u(1:jpim1, :     ) ) )
-         zcfl  = MAX( zcfl, MAXVAL( ABS( zvi_v( :     ,1:jpjm1) ) * rdt_ice / e2v( :     ,1:jpjm1) ) )
-
-         zmaxu = 0.0
-         zmaxv = 0.0
-         DO ji = 1, jpim1
-            DO jj = 1, jpjm1
-               IF ( (ABS(zui_u(ji,jj)) .GT. zmaxu) ) THEN 
-                  zmaxu = MAX(zui_u(ji,jj), zmaxu )
-                  ji_maxu = ji
-                  jj_maxu = jj
-               ENDIF
-               IF ( (ABS(zvi_v(ji,jj)) .GT. zmaxv) ) THEN 
-                  zmaxv = MAX(zvi_v(ji,jj), zmaxv )
-                  ji_maxv = ji
-                  jj_maxv = jj
-               ENDIF
-            END DO
-         END DO
-
-         IF (lk_mpp ) CALL mpp_max(zcfl)
-
-         IF ( zcfl > 0.5 .AND. lwp ) &
-            WRITE(numout,*) 'lim_trp : violation of cfl criterion the ',nday,'th day, cfl = ',zcfl
-
-         !-----------------------------------------------------------------------------!
-         ! 2) Computation of transported fields                                        
-         !-----------------------------------------------------------------------------!
-
-         !------------------------------------------------------
-         ! 1.1) Snow vol, ice vol, salt and age contents, area
-         !------------------------------------------------------
-
-         zs0ow (:,:) =  ato_i(:,:)    * area(:,:)           ! Open water area 
-         DO jl = 1, jpl  !sum over thickness categories
-            ! area -> is the unmasked and masked area of T-grid cell
-            zs0sn (:,:,jl) =  v_s(:,:,jl)    * area(:,:)    ! Snow volume.
-            zs0ice(:,:,jl) =  v_i(:,:,jl)    * area(:,:)    ! Ice volume.
-            zs0a  (:,:,jl) =  a_i(:,:,jl)    * area(:,:)    ! Ice area
-            zs0sm (:,:,jl) =  smv_i(:,:,jl)  * area(:,:)    ! Salt content
-            zs0oi (:,:,jl) =  oa_i (:,:,jl)  * area(:,:)    ! Age content
-
-            !----------------------------------
-            ! 1.2) Ice and snow heat contents
-            !----------------------------------
-
-            zs0c0 (:,:,jl)     = e_s(:,:,1,jl)              ! Snow heat cont.
-            DO jk = 1, nlay_i
-               zs0e(:,:,jk,jl) = e_i(:,:,jk,jl)             ! Ice heat content
-            END DO
-         END DO
-
-         !-----------------------------------------------------------------------------!
-         ! 3) Advection of Ice fields                                              
-         !-----------------------------------------------------------------------------!
-
-         ! If ice drift field is too fast, use an appropriate time step for advection.         
+         zcfl  =            MAXVAL( ABS( u_ice(:,:) ) * rdt_ice / e1u(:,:) )
+         zcfl  = MAX( zcfl, MAXVAL( ABS( v_ice(:,:) ) * rdt_ice / e2v(:,:) ) )
+         IF(lk_mpp )   CALL mpp_max( zcfl )
+!!gm more readability:
+!         IF( zcfl > 0.5 ) THEN   ;   initad = 2   ;   zusnit = 0.5_wp
+!         ELSE                    ;   initad = 1   ;   zusnit = 1.0_wp
+!         ENDIF
+!!gm end
          initad = 1 + INT( MAX( rzero, SIGN( rone, zcfl-0.5 ) ) )
          zusnit = 1.0 / REAL( initad ) 
-
-         IF( MOD( ( kt - 1) / nn_fsbc , 2 ) == 0) THEN        !==  odd ice time step:  adv_x then adv_y  ==!
+         IF( zcfl > 0.5 .AND. lwp )   &
+            WRITE(numout,*) 'lim_trp_2 : CFL violation at day ', nday, ', cfl = ', zcfl,   &
+               &                        ': the ice time stepping is split in two'
+
+         IF( MOD( ( kt - 1) / nn_fsbc , 2 ) == 0 ) THEN       !==  odd ice time step:  adv_x then adv_y  ==!
             DO jk = 1,initad
-               !--- ice open water area
-               CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0ow(:,:) , sxopw(:,:) , & 
-                  sxxopw(:,:), syopw(:,:) , & 
-                  syyopw(:,:), sxyopw(:,:) )
-               CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0ow(:,:) , sxopw (:,:) , &
-                  sxxopw(:,:), syopw (:,:) , & 
-                  syyopw(:,:), sxyopw(:,:) )
+               CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0ow (:,:), sxopw(:,:),   &             !--- ice open water area
+                  &                                       sxxopw(:,:), syopw(:,:), syyopw(:,:), sxyopw(:,:)  )
+               CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0ow (:,:), sxopw(:,:),   &
+                  &                                       sxxopw(:,:), syopw(:,:), syyopw(:,:), sxyopw(:,:)  )
                DO jl = 1, jpl
-                  !--- ice volume  ---
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0ice(:,:,jl) , sxice (:,:,jl) , & 
-                     sxxice(:,:,jl) , syice (:,:,jl) , & 
-                     syyice(:,:,jl) , sxyice(:,:,jl) )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0ice(:,:,jl) , sxice (:,:,jl) , &
-                     sxxice(:,:,jl) , syice (:,:,jl) , & 
-                     syyice(:,:,jl) , sxyice(:,:,jl) )
-                  !--- snow volume  ---
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0sn (:,:,jl) , sxsn  (:,:,jl) , &
-                     sxxsn (:,:,jl) , sysn  (:,:,jl) , &
-                     syysn (:,:,jl) , sxysn (:,:,jl) )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0sn (:,:,jl) , sxsn  (:,:,jl) , &
-                     sxxsn (:,:,jl) , sysn  (:,:,jl) , &
-                     syysn (:,:,jl) , sxysn (:,:,jl) )
-                  !--- ice salinity ---
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0sm (:,:,jl) , sxsal (:,:,jl) , &
-                     sxxsal(:,:,jl) , sysal (:,:,jl) , &
-                     syysal(:,:,jl) , sxysal(:,:,jl)  )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0sm (:,:,jl) , sxsal (:,:,jl) , &
-                     sxxsal(:,:,jl) , sysal (:,:,jl) , &
-                     syysal(:,:,jl) , sxysal(:,:,jl)  )
-                  !--- ice age      ---     
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0oi (:,:,jl) , sxage (:,:,jl) , &
-                     sxxage(:,:,jl) , syage (:,:,jl) , &
-                     syyage(:,:,jl) , sxyage(:,:,jl)  )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0oi (:,:,jl) , sxage (:,:,jl) , &
-                     sxxage(:,:,jl) , syage (:,:,jl) , &
-                     syyage(:,:,jl) , sxyage(:,:,jl)  )
-                  !--- ice concentrations ---
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0a  (:,:,jl) , sxa   (:,:,jl) , &
-                     sxxa  (:,:,jl) , sya   (:,:,jl) , & 
-                     syya  (:,:,jl) , sxya  (:,:,jl)  )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0a  (:,:,jl) , sxa   (:,:,jl) , & 
-                     sxxa  (:,:,jl) , sya   (:,:,jl) , & 
-                     syya  (:,:,jl) , sxya  (:,:,jl)  )
-                  !--- ice / snow thermal energetic contents ---
-                  CALL lim_adv_x( zusnit, zui_u, rone , zsm, zs0c0 (:,:,jl) , sxc0  (:,:,jl) , & 
-                     sxxc0 (:,:,jl) , syc0  (:,:,jl) , &
-                     syyc0 (:,:,jl) , sxyc0 (:,:,jl)  )
-                  CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, zs0c0 (:,:,jl) , sxc0  (:,:,jl) , &
-                     sxxc0 (:,:,jl) , syc0  (:,:,jl) , &
-                     syyc0 (:,:,jl) , sxyc0 (:,:,jl)  )
-                  DO layer = 1, nlay_i
-                     CALL lim_adv_x( zusnit, zui_u, rone , zsm, &
-                        zs0e(:,:,layer,jl) , sxe (:,:,layer,jl) , & 
-                        sxxe(:,:,layer,jl) , sye (:,:,layer,jl) , &
-                        syye(:,:,layer,jl) , sxye(:,:,layer,jl) )
-                     CALL lim_adv_y( zusnit, zvi_v, rzero, zsm, & 
-                        zs0e(:,:,layer,jl) , sxe (:,:,layer,jl) , & 
-                        sxxe(:,:,layer,jl) , sye (:,:,layer,jl) , &
-                        syye(:,:,layer,jl) , sxye(:,:,layer,jl) )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0ice(:,:,jl), sxice(:,:,jl),   &    !--- ice volume  ---
+                     &                                       sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0ice(:,:,jl), sxice(:,:,jl),   &
+                     &                                       sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0sn (:,:,jl), sxsn (:,:,jl),   &    !--- snow volume  ---
+                     &                                       sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0sn (:,:,jl), sxsn (:,:,jl),   &
+                     &                                       sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0sm (:,:,jl), sxsal(:,:,jl),   &    !--- ice salinity ---
+                     &                                       sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0sm (:,:,jl), sxsal(:,:,jl),   &
+                     &                                       sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0oi (:,:,jl), sxage(:,:,jl),   &   !--- ice age      ---     
+                     &                                       sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0oi (:,:,jl), sxage(:,:,jl),   &
+                     &                                       sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0a  (:,:,jl), sxa  (:,:,jl),   &   !--- ice concentrations ---
+                     &                                       sxxa  (:,:,jl), sya  (:,:,jl), syya  (:,:,jl), sxya  (:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0a  (:,:,jl), sxa  (:,:,jl),   & 
+                     &                                       sxxa  (:,:,jl), sya  (:,:,jl), syya  (:,:,jl), sxya  (:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl),   &  !--- snow heat contents ---
+                     &                                       sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl),   &
+                     &                                       sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl)  )
+                  DO layer = 1, nlay_i                                                           !--- ice heat contents ---
+                     CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0e(:,:,layer,jl), sxe (:,:,layer,jl),   & 
+                        &                                       sxxe(:,:,layer,jl), sye (:,:,layer,jl),   &
+                        &                                       syye(:,:,layer,jl), sxye(:,:,layer,jl) )
+                     CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0e(:,:,layer,jl), sxe (:,:,layer,jl),   & 
+                        &                                       sxxe(:,:,layer,jl), sye (:,:,layer,jl),   &
+                        &                                       syye(:,:,layer,jl), sxye(:,:,layer,jl) )
                   END DO
                END DO
@@ -267,63 +181,42 @@
          ELSE
             DO jk = 1, initad
-               !--- ice volume  ---
-               CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0ow (:,:) , sxopw (:,:) , &
-                  sxxopw(:,:) , syopw (:,:) , & 
-                  syyopw(:,:) , sxyopw(:,:) )
-               CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0ow (:,:) , sxopw (:,:) , & 
-                  sxxopw(:,:) , syopw (:,:) , &
-                  syyopw(:,:) , sxyopw(:,:) )
+               CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0ow (:,:), sxopw(:,:),   &             !--- ice open water area
+                  &                                       sxxopw(:,:), syopw(:,:), syyopw(:,:), sxyopw(:,:)  )
+               CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0ow (:,:), sxopw(:,:),   &
+                  &                                       sxxopw(:,:), syopw(:,:), syyopw(:,:), sxyopw(:,:)  )
                DO jl = 1, jpl
-                  !--- ice volume  ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0ice(:,:,jl) , sxice (:,:,jl) , &
-                     sxxice(:,:,jl) , syice (:,:,jl) , & 
-                     syyice(:,:,jl) , sxyice(:,:,jl) )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0ice(:,:,jl) , sxice (:,:,jl) , & 
-                     sxxice(:,:,jl) , syice (:,:,jl) , &
-                     syyice(:,:,jl) , sxyice(:,:,jl) )
-                  !--- snow volume  ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0sn (:,:,jl) , sxsn  (:,:,jl) , & 
-                     sxxsn (:,:,jl) , sysn  (:,:,jl) , & 
-                     syysn (:,:,jl) , sxysn (:,:,jl) )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0sn (:,:,jl) , sxsn  (:,:,jl) , & 
-                     sxxsn (:,:,jl) , sysn  (:,:,jl) , & 
-                     syysn (:,:,jl) , sxysn (:,:,jl) )
-                  !--- ice salinity ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0sm (:,:,jl) , sxsal (:,:,jl) , &
-                     sxxsal(:,:,jl) , sysal (:,:,jl) , &
-                     syysal(:,:,jl) , sxysal(:,:,jl) )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0sm (:,:,jl) , sxsal (:,:,jl) , &
-                     sxxsal(:,:,jl) , sysal (:,:,jl) , &
-                     syysal(:,:,jl) , sxysal(:,:,jl) )
-                  !--- ice age      ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0oi (:,:,jl) , sxage (:,:,jl) , &
-                     sxxage(:,:,jl) , syage (:,:,jl) , & 
-                     syyage(:,:,jl) , sxyage(:,:,jl)  )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0oi (:,:,jl) , sxage (:,:,jl) , &
-                     sxxage(:,:,jl) , syage (:,:,jl) , &
-                     syyage(:,:,jl) , sxyage(:,:,jl)   )
-                  !--- ice concentration ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0a  (:,:,jl) , sxa   (:,:,jl) , & 
-                     sxxa  (:,:,jl) , sya   (:,:,jl) , & 
-                     syya  (:,:,jl) , sxya  (:,:,jl)  )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0a  (:,:,jl) , sxa   (:,:,jl) , & 
-                     sxxa  (:,:,jl) , sya   (:,:,jl) , & 
-                     syya  (:,:,jl) , sxya  (:,:,jl)  )
-                  !--- ice / snow thermal energetic contents ---
-                  CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0c0 (:,:,jl) , sxc0  (:,:,jl) , & 
-                     sxxc0 (:,:,jl) , syc0  (:,:,jl) , &
-                     syyc0 (:,:,jl) , sxyc0 (:,:,jl)  )
-                  CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0c0 (:,:,jl) , sxc0  (:,:,jl) , &
-                     sxxc0 (:,:,jl) , syc0  (:,:,jl) , &
-                     syyc0 (:,:,jl) , sxyc0 (:,:,jl)  )
-                  DO layer = 1, nlay_i
-                     CALL lim_adv_y( zusnit, zvi_v, rone , zsm, zs0e(:,:,layer,jl) , &
-                        sxe (:,:,layer,jl) , sxxe (:,:,layer,jl) , sye (:,:,layer,jl) , &
-                        syye (:,:,layer,jl), sxye (:,:,layer,jl) )
-                     CALL lim_adv_x( zusnit, zui_u, rzero, zsm, zs0e(:,:,layer,jl) , &
-                        sxe (:,:,layer,jl) , sxxe (:,:,layer,jl) , sye (:,:,layer,jl) , &
-                        syye (:,:,layer,jl), sxye (:,:,layer,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0ice(:,:,jl), sxice(:,:,jl),   &    !--- ice volume  ---
+                     &                                       sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0ice(:,:,jl), sxice(:,:,jl),   &
+                     &                                       sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0sn (:,:,jl), sxsn (:,:,jl),   &    !--- snow volume  ---
+                     &                                       sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0sn (:,:,jl), sxsn (:,:,jl),   &
+                     &                                       sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0sm (:,:,jl), sxsal(:,:,jl),   &    !--- ice salinity ---
+                     &                                       sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0sm (:,:,jl), sxsal(:,:,jl),   &
+                     &                                       sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl)  )
+
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0oi (:,:,jl), sxage(:,:,jl),   &   !--- ice age      ---
+                     &                                       sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0oi (:,:,jl), sxage(:,:,jl),   &
+                     &                                       sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0a  (:,:,jl), sxa  (:,:,jl),   &   !--- ice concentrations ---
+                     &                                       sxxa  (:,:,jl), sya  (:,:,jl), syya  (:,:,jl), sxya  (:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0a  (:,:,jl), sxa  (:,:,jl),   &
+                     &                                       sxxa  (:,:,jl), sya  (:,:,jl), syya  (:,:,jl), sxya  (:,:,jl)  )
+                  CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl),   &  !--- snow heat contents ---
+                     &                                       sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl)  )
+                  CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl),   &
+                     &                                       sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl)  )
+                  DO layer = 1, nlay_i                                                           !--- ice heat contents ---
+                     CALL lim_adv_y( zusnit, v_ice, rzero, zsm, zs0e(:,:,layer,jl), sxe (:,:,layer,jl),   & 
+                        &                                       sxxe(:,:,layer,jl), sye (:,:,layer,jl),   &
+                        &                                       syye(:,:,layer,jl), sxye(:,:,layer,jl) )
+                     CALL lim_adv_x( zusnit, u_ice, rone , zsm, zs0e(:,:,layer,jl), sxe (:,:,layer,jl),   & 
+                        &                                       sxxe(:,:,layer,jl), sye (:,:,layer,jl),   &
+                        &                                       syye(:,:,layer,jl), sxye(:,:,layer,jl) )
                   END DO
-
                END DO
             END DO
@@ -333,6 +226,5 @@
          ! Recover the properties from their contents
          !-------------------------------------------
-
-         zs0ow (:,:)       = zs0ow(:,:) / area(:,:)
+         zs0ow(:,:) = zs0ow(:,:) / area(:,:)
          DO jl = 1, jpl
             zs0ice(:,:,jl) = zs0ice(:,:,jl) / area(:,:)
@@ -351,45 +243,37 @@
          !------------------------------------------------------------------------------!
 
+         !--------------------------------
+         !  diffusion of open water area
+         !--------------------------------
+         zs0at(:,:) = zs0a(:,:,1)      ! total ice fraction
+         DO jl = 2, jpl
+            zs0at(:,:) = zs0at(:,:) + zs0a(:,:,jl)
+         END DO
+         !
+         !                             ! Masked eddy diffusivity coefficient at ocean U- and V-points
+         DO jj = 1, jpjm1                    ! NB: has not to be defined on jpj line and jpi row
+            DO ji = 1 , fs_jpim1   ! vector opt.
+               pahu(ji,jj) = ( 1._wp - MAX( rzero, SIGN( rone, -zs0at(ji  ,jj) ) ) )   &
+                  &        * ( 1._wp - MAX( rzero, SIGN( rone, -zs0at(ji+1,jj) ) ) ) * ahiu(ji,jj)
+               pahv(ji,jj) = ( 1._wp - MAX( rzero, SIGN( rone, -zs0at(ji,jj  ) ) ) )   &
+                  &        * ( 1._wp - MAX( rzero, SIGN( rone,- zs0at(ji,jj+1) ) ) ) * ahiv(ji,jj)
+            END DO
+         END DO
+         !
+         CALL lim_hdf( zs0ow (:,:) )   ! Diffusion
+
          !------------------------------------
-         ! 4.1) diffusion of open water area
+         !  Diffusion of other ice variables
          !------------------------------------
-
-         ! Compute total ice fraction
-         zs0at(:,:) = 0.0
-         DO jl = 1, jpl
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zs0at (ji,jj) = zs0at(ji,jj) + zs0a(ji,jj,jl) !
-               END DO
-            END DO
-         END DO
-
-         ! Masked eddy diffusivity coefficient at ocean U- and V-points
-         DO jj = 1, jpjm1          ! NB: has not to be defined on jpj line and jpi row
-            DO ji = 1 , fs_jpim1   ! vector opt.
-               pahu(ji,jj) = ( 1.0 - MAX( rzero, SIGN( rone, -zs0at(ji  ,jj) ) ) )   &
-                  &        * ( 1.0 - MAX( rzero, SIGN( rone, -zs0at(ji+1,jj) ) ) ) * ahiu(ji,jj)
-               pahv(ji,jj) = ( 1.0 - MAX( rzero, SIGN( rone, -zs0at(ji,jj  ) ) ) )   &
-                  &        * ( 1.0 - MAX( rzero, SIGN( rone,- zs0at(ji,jj+1) ) ) ) * ahiv(ji,jj)
-            END DO !jj
-         END DO ! ji
-
-         ! Diffusion
-         CALL lim_hdf( zs0ow (:,:) )
-
-         !----------------------------------------
-         ! 4.2) Diffusion of other ice variables
-         !----------------------------------------
-         DO jl = 1, jpl
-
-            ! Masked eddy diffusivity coefficient at ocean U- and V-points
-            DO jj = 1, jpjm1          ! NB: has not to be defined on jpj line and jpi row
+         DO jl = 1, jpl
+         !                             ! Masked eddy diffusivity coefficient at ocean U- and V-points
+            DO jj = 1, jpjm1                 ! NB: has not to be defined on jpj line and jpi row
                DO ji = 1 , fs_jpim1   ! vector opt.
-                  pahu(ji,jj) = ( 1.0 - MAX( rzero, SIGN( rone, -zs0a(ji  ,jj,jl) ) ) )   &
-                     &        * ( 1.0 - MAX( rzero, SIGN( rone, -zs0a(ji+1,jj,jl) ) ) ) * ahiu(ji,jj)
-                  pahv(ji,jj) = ( 1.0 - MAX( rzero, SIGN( rone, -zs0a(ji,jj,jl  ) ) ) )   &
-                     &        * ( 1.0 - MAX( rzero, SIGN( rone,- zs0a(ji,jj+1,jl) ) ) ) * ahiv(ji,jj)
-               END DO !jj
-            END DO ! ji
+                  pahu(ji,jj) = ( 1._wp - MAX( rzero, SIGN( rone, -zs0a(ji  ,jj,jl) ) ) )   &
+                     &        * ( 1._wp - MAX( rzero, SIGN( rone, -zs0a(ji+1,jj,jl) ) ) ) * ahiu(ji,jj)
+                  pahv(ji,jj) = ( 1._wp - MAX( rzero, SIGN( rone, -zs0a(ji,jj  ,jl) ) ) )   &
+                     &        * ( 1._wp - MAX( rzero, SIGN( rone,- zs0a(ji,jj+1,jl) ) ) ) * ahiv(ji,jj)
+               END DO
+            END DO
 
             CALL lim_hdf( zs0ice (:,:,jl) )
@@ -401,11 +285,11 @@
             DO jk = 1, nlay_i
                CALL lim_hdf( zs0e (:,:,jk,jl) )
-            END DO ! jk
-         END DO !jl
+            END DO
+         END DO
 
          !-----------------------------------------
-         ! 4.3) Remultiply everything by ice area
+         !  Remultiply everything by ice area
          !-----------------------------------------
-         zs0ow(:,:) = MAX(rzero, zs0ow(:,:) * area(:,:) )
+         zs0ow(:,:) = MAX( rzero, zs0ow(:,:) * area(:,:) )
          DO jl = 1, jpl
             zs0ice(:,:,jl) = MAX( rzero, zs0ice(:,:,jl) * area(:,:) )    !!bug:  est-ce utile
@@ -432,6 +316,5 @@
                DO jj = 1, jpj
                   DO ji = 1, jpi
-                     zs0e (ji,jj,jk,jl) =  &
-                        MAX( rzero, zs0e (ji,jj,jk,jl) / area(ji,jj) )
+                     zs0e(ji,jj,jk,jl) = MAX( rzero, zs0e(ji,jj,jk,jl) / area(ji,jj) )
                   END DO
                END DO
@@ -441,9 +324,9 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zs0ow (ji,jj) = MAX( rzero, zs0ow (ji,jj) / area(ji,jj) )
-            END DO
-         END DO
-
-         zs0at(:,:) = 0.0
+               zs0ow(ji,jj) = MAX( rzero, zs0ow (ji,jj) / area(ji,jj) )
+            END DO
+         END DO
+
+         zs0at(:,:) = 0._wp
          DO jl = 1, jpl
             DO jj = 1, jpj
@@ -463,30 +346,28 @@
          ! 5.2) Snow thickness, Ice thickness, Ice concentrations
          !---------------------------------------------------------
-
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zindb         = MAX( 0.0 , SIGN( 1.0, zs0at(ji,jj) - zeps10) )
-               zs0ow(ji,jj)  = (1.0 - zindb) + zindb*MAX( zs0ow(ji,jj), 0.00 )
-               ato_i(ji,jj)  = zs0ow(ji,jj)
-            END DO
-         END DO
-
-         ! Remove very small areas 
-         DO jl = 1, jpl
+               zindb        = MAX( 0._wp , SIGN( 1.0, zs0at(ji,jj) - zeps10) )
+               zs0ow(ji,jj) = ( 1._wp - zindb ) + zindb * MAX( zs0ow(ji,jj), 0._wp )
+               ato_i(ji,jj) = zs0ow(ji,jj)
+            END DO
+         END DO
+
+         DO jl = 1, jpl         ! Remove very small areas 
             DO jj = 1, jpj
                DO ji = 1, jpi
                   zindb         = MAX( 0.0 , SIGN( 1.0, zs0a(ji,jj,jl) - zeps10) )
-
-                  zs0a(ji,jj,jl)  = zindb * MIN( zs0a(ji,jj,jl), 0.99 )
-                  v_s(ji,jj,jl)   = zindb * zs0sn (ji,jj,jl) 
-                  v_i(ji,jj,jl)   = zindb * zs0ice(ji,jj,jl)
-
-                  zindsn          = MAX( rzero, SIGN( rone, v_s(ji,jj,jl) - zeps10 ) )
-                  zindic          = MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - zeps10 ) )
-                  zindb           = MAX( zindsn, zindic )
-                  zs0a (ji,jj,jl) = zindb  * zs0a(ji,jj,jl) !ice concentration
-                  a_i  (ji,jj,jl) = zs0a(ji,jj,jl)
-                  v_s  (ji,jj,jl) = zindsn * v_s(ji,jj,jl)
-                  v_i  (ji,jj,jl) = zindic * v_i(ji,jj,jl)
+                  !
+                  zs0a(ji,jj,jl) = zindb * MIN( zs0a(ji,jj,jl), 0.99 )
+                  v_s(ji,jj,jl)  = zindb * zs0sn (ji,jj,jl) 
+                  v_i(ji,jj,jl)  = zindb * zs0ice(ji,jj,jl)
+                  !
+                  zindsn         = MAX( rzero, SIGN( rone, v_s(ji,jj,jl) - zeps10 ) )
+                  zindic         = MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - zeps10 ) )
+                  zindb          = MAX( zindsn, zindic )
+                  zs0a(ji,jj,jl) = zindb  * zs0a(ji,jj,jl) !ice concentration
+                  a_i (ji,jj,jl) = zs0a(ji,jj,jl)
+                  v_s (ji,jj,jl) = zindsn * v_s(ji,jj,jl)
+                  v_i (ji,jj,jl) = zindic * v_i(ji,jj,jl)
                END DO
             END DO
@@ -495,5 +376,5 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               zs0at(ji,jj)       = SUM( zs0a(ji,jj,1:jpl) )
+               zs0at(ji,jj) = SUM( zs0a(ji,jj,1:jpl) )
             END DO
          END DO
@@ -503,5 +384,5 @@
          !----------------------
 
-         zbigval         =  1.0d+13
+         zbigval = 1.d+13
 
          DO jl = 1, jpl
@@ -518,13 +399,11 @@
 
                   ! Ice salinity and age
-                  zsal            = MAX( MIN( (rhoic-rhosn)/rhoic*sss_m(ji,jj)  , &
-                     zusvoic * zs0sm(ji,jj,jl) ), s_i_min ) * &
-                     v_i(ji,jj,jl)
+                  zsal = MAX( MIN( (rhoic-rhosn)/rhoic*sss_m(ji,jj)  , &
+                     zusvoic * zs0sm(ji,jj,jl) ), s_i_min ) * v_i(ji,jj,jl)
                   IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) & 
                      smv_i(ji,jj,jl) = zindic*zsal + (1.0-zindic)*0.0
 
-                  zage            = MAX( MIN( zbigval, zs0oi(ji,jj,jl) / & 
-                     MAX( a_i(ji,jj,jl), epsi16 )  ), 0.0 ) * &
-                     a_i(ji,jj,jl)
+                  zage = MAX( MIN( zbigval, zs0oi(ji,jj,jl) / & 
+                     MAX( a_i(ji,jj,jl), epsi16 )  ), 0.0 ) * a_i(ji,jj,jl)
                   oa_i (ji,jj,jl)  = zindic*zage 
 
@@ -583,37 +462,8 @@
          END DO
       ENDIF
-
+      !
+      IF( wrk_not_released(2, 1,2,3,4,5) )   CALL ctl_stop('lim_trp_2 : failed to release workspace arrays')
+      !
    END SUBROUTINE lim_trp
-
-
-   SUBROUTINE lim_trp_init
-      !!-------------------------------------------------------------------
-      !!                  ***  ROUTINE lim_trp_init  ***
-      !!
-      !! ** Purpose :   initialization of ice advection parameters
-      !!
-      !! ** Method  : Read the namicetrp namelist and check the parameter 
-      !!       values called at the first timestep (nit000)
-      !!
-      !! ** input   :   Namelist namicetrp
-      !!
-      !! history :
-      !!   2.0  !  03-08 (C. Ethe)  Original code
-      !!-------------------------------------------------------------------
-      NAMELIST/namicetrp/ bound
-      !!-------------------------------------------------------------------
-
-      ! Read Namelist namicetrp
-      REWIND ( numnam_ice )
-      READ   ( numnam_ice  , namicetrp )
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'lim_trp_init : Ice parameters for advection '
-         WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) ' boundary conditions (0.0 no-slip, 1.0 free-slip) bound  = ', bound
-         WRITE(numout,*) 
-      ENDIF
-
-   END SUBROUTINE lim_trp_init
 
 #else
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limupdate.F90	(revision 2715)
@@ -2,11 +2,8 @@
    !!======================================================================
    !!                     ***  MODULE  limupdate  ***
-   !!    Update of sea-ice global variables
-   !!    at the end of the time step
-   !!    
-   !!    Ice speed from ice dynamics
-   !!    Ice thickness, Snow thickness, Temperatures, Lead fraction
-   !!      from advection and ice thermodynamics 
+   !!   LIM-3 : Update of sea-ice global variables at the end of the time step
    !!======================================================================
+   !! History :  3.0  !  2006-04  (M. Vancoppenolle) Original code
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
@@ -16,5 +13,4 @@
    !!----------------------------------------------------------------------
    USE limrhg          ! ice rheology
-   USE lbclnk
 
    USE dom_oce
@@ -24,7 +20,6 @@
    USE sbc_ice         ! Surface boundary condition: ice fields
    USE dom_ice
-   USE phycst          ! Define parameters for the routines
+   USE phycst          ! physical constants
    USE ice
-   USE lbclnk
    USE limdyn
    USE limtrp
@@ -38,22 +33,28 @@
    USE limitd_th
    USE limvar
-   USE prtctl          ! Print control
-
+   USE prtctl           ! Print control
+   USE lbclnk           ! lateral boundary condition - MPP exchanges
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC lim_update ! routine called by ice_step
-
+   PUBLIC   lim_update   ! routine called by ice_step
+
+      REAL(wp)  ::   epsi06 = 1.e-06_wp   ! module constants
+      REAL(wp)  ::   epsi04 = 1.e-04_wp   !    -       -
+      REAL(wp)  ::   epsi03 = 1.e-03_wp   !    -       -
+      REAL(wp)  ::   epsi10 = 1.e-10_wp   !    -       -
+      REAL(wp)  ::   epsi16 = 1.e-16_wp   !    -       -
+      REAL(wp)  ::   epsi20 = 1.e-20_wp   !    -       -
+      REAL(wp)  ::   rzero  = 0._wp       !    -       -
+      REAL(wp)  ::   rone   = 1._wp       !    -       -
+         
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
-
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -67,52 +68,23 @@
       !!               This place is very important
       !!                
-      !! ** Method  :  Mathematical
+      !! ** Method  :  
+      !!    Ice speed from ice dynamics
+      !!    Ice thickness, Snow thickness, Temperatures, Lead fraction
+      !!      from advection and ice thermodynamics 
       !!
       !! ** Action  : - 
-      !!
-      !! History : This routine was new for LIM 3.0 
-      !!   3.0  !  04-06  (M. Vancoppenolle) Tendencies
       !!---------------------------------------------------------------------
-      !! * Local variables
-      INTEGER ::      &
-         ji, jj,     & ! geographical indices
-         jk, jl, jm    ! layer, category and type indices
-      INTEGER ::      &
-         jbnd1, jbnd2
-      INTEGER ::      &
-         i_ice_switch
-
-      REAL(wp)  ::           &  ! constant values
-         epsi06 = 1.e-06  ,  &
-         epsi03 = 1.e-03  ,  &
-         epsi16 = 1.e-16  ,  &
-         epsi20 = 1.e-20  ,  &
-         epsi04 = 1.e-04  ,  &
-         epsi10 = 1.e-10  ,  &
-         rzero  = 0.e0    ,  &
-         rone   = 1.e0    ,  &
-         zhimax                   ! maximum thickness tolerated for advection of
-      ! in an ice-free cell
-      REAL(wp) ::            &  ! dummy switches and arguments
-         zindb, zindsn, zindic, zacrith,  &
-         zrtt, zindg, zh, zdvres, zviold,                       &
-         zbigvalue, zvsold, z_da_ex, zamax,                     &
-         z_prescr_hi, zat_i_old,                                &
-         ztmelts, ze_s
-
-      REAL(wp), DIMENSION(jpl) :: z_da_i, z_dv_i
-
-      LOGICAL, DIMENSION(jpi,jpj,jpl) ::  &
-         internal_melt
-
-      INTEGER ::      &
-         ind_im, layer      ! indices for internal melt
-      REAL(wp), DIMENSION(jkmax) :: &
-         zthick0, zqm0      ! thickness of the layers and heat contents for
-      ! internal melt
-      REAL(wp) ::                   &
-         zweight, zesum
-
-
+      INTEGER ::   ji, jj, jk, jl, jm    ! dummy loop indices
+      INTEGER ::   jbnd1, jbnd2
+      INTEGER ::   i_ice_switch
+      INTEGER ::   ind_im, layer      ! indices for internal melt
+      REAL(wp) ::   zweight, zesum, zhimax, z_da_i, z_dv_i
+      REAL(wp) ::   zindb, zindsn, zindic, zacrith
+      REAL(wp) ::   zrtt, zindg, zh, zdvres, zviold
+      REAL(wp) ::   zbigvalue, zvsold, z_da_ex, zamax
+      REAL(wp) ::   z_prescr_hi, zat_i_old, ztmelts, ze_s
+
+      LOGICAL , DIMENSION(jpi,jpj,jpl) ::  internal_melt
+      REAL(wp), DIMENSION(jkmax) ::   zthick0, zqm0      ! thickness of the layers and heat contents for
       !!-------------------------------------------------------------------
 
@@ -139,5 +111,4 @@
       ! Ice dynamics  
       !---------------------
-
       u_ice(:,:) = u_ice(:,:) + d_u_ice_dyn(:,:)
       v_ice(:,:) = v_ice(:,:) + d_v_ice_dyn(:,:)
@@ -146,15 +117,7 @@
       ! Update ice and snow volumes  
       !-----------------------------
-
-      DO jl = 1, jpl
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-
-               v_i(ji,jj,jl)  = v_i(ji,jj,jl) + d_v_i_trp(ji,jj,jl)  &
-                  + d_v_i_thd(ji,jj,jl) 
-               v_s(ji,jj,jl)  = v_s(ji,jj,jl) + d_v_s_trp(ji,jj,jl)  &
-                  + d_v_s_thd(ji,jj,jl)
-            END DO
-         END DO
+      DO jl = 1, jpl
+         v_i(:,:,jl)  = v_i(:,:,jl) + d_v_i_trp(:,:,jl) + d_v_i_thd(:,:,jl) 
+         v_s(:,:,jl)  = v_s(:,:,jl) + d_v_s_trp(:,:,jl) + d_v_s_thd(:,:,jl)
       END DO
 
@@ -168,10 +131,10 @@
       ! with negative advection, very pathological )
       ! (5) v_i (old) = 0; d_v_i_trp > 0 (advection of ice in a free-cell)
-
+      !
       DO jl = 1, jpl
          DO jj = 1, jpj
             DO ji = 1, jpi
                patho_case(ji,jj,jl) = 1
-               IF ( v_i(ji,jj,jl) .GE. 0.0 ) THEN
+               IF( v_i(ji,jj,jl) .GE. 0.0 ) THEN
                   IF ( old_v_i(ji,jj,jl) + d_v_i_thd(ji,jj,jl) .LT. epsi10 ) THEN 
                      patho_case(ji,jj,jl) = 2
@@ -179,10 +142,10 @@
                ELSE
                   patho_case(ji,jj,jl) = 3
-                  IF ( old_v_i(ji,jj,jl) + d_v_i_thd(ji,jj,jl) .LT. epsi10 ) THEN 
+                  IF( old_v_i(ji,jj,jl) + d_v_i_thd(ji,jj,jl) .LT. epsi10 ) THEN 
                      patho_case(ji,jj,jl) = 4
                   ENDIF
                ENDIF
-               IF ( ( old_v_i(ji,jj,jl) .LE. epsi10 ) .AND. &
-                  ( d_v_i_trp(ji,jj,jl) .GT. epsi06 ) ) THEN
+               IF( ( old_v_i(ji,jj,jl) .LE. epsi10 ) .AND. &
+                   ( d_v_i_trp(ji,jj,jl) .GT. epsi06 ) ) THEN
                   patho_case(ji,jj,jl) = 5 ! advection of ice in an ice-free
                   ! cell
@@ -229,6 +192,5 @@
                   v_i(ji,jj,jl) = zindic*v_i(ji,jj,jl)    !ice volume cannot be negative
                   !correct thermodynamic ablation
-                  d_v_i_thd(ji,jj,jl)  = zindic  *  d_v_i_thd(ji,jj,jl) + & 
-                     (1.0-zindic) * (-zviold - d_v_i_trp(ji,jj,jl)) 
+                  d_v_i_thd(ji,jj,jl)  = zindic  *  d_v_i_thd(ji,jj,jl) + (1.0-zindic) * (-zviold - d_v_i_trp(ji,jj,jl)) 
                   ! THIS IS NEW
                   d_a_i_thd(ji,jj,jl)  = zindic  *  d_a_i_thd(ji,jj,jl) + & 
@@ -252,6 +214,5 @@
 
                   !residual salt flux if snow is over-molten
-                  fsalt_res(ji,jj)  = fsalt_res(ji,jj) + sss_m(ji,jj) * & 
-                     ( rhosn * zdvres / rdt_ice )
+                  fsalt_res(ji,jj)  = fsalt_res(ji,jj) + sss_m(ji,jj) * ( rhosn * zdvres / rdt_ice )
                   !this flux will be positive if snow was over-molten
                   !             fheat_res(ji,jj)  = fheat_res(ji,jj) + rhosn * lfus * zdvres / rdt_ice
@@ -288,7 +249,6 @@
       !---------------------------------------------
 
-      a_i (:,:,:) = a_i (:,:,:)   + d_a_i_trp(:,:,:)     &
-         + d_a_i_thd(:,:,:)
-      CALL lim_var_glo2eqv ! useless, just for debug
+      a_i (:,:,:) = a_i (:,:,:) + d_a_i_trp(:,:,:) + d_a_i_thd(:,:,:)
+      CALL lim_var_glo2eqv    ! useless, just for debug
       IF( ln_nicep ) THEN 
          DO jk = 1, nlay_i
@@ -297,7 +257,7 @@
       ENDIF
       e_i(:,:,:,:) = e_i(:,:,:,:) + d_e_i_trp(:,:,:,:)  
-      CALL lim_var_glo2eqv ! useless, just for debug
+      CALL lim_var_glo2eqv    ! useless, just for debug
       IF( ln_nicep) THEN
-      WRITE(numout,*) ' After transport update '
+         WRITE(numout,*) ' After transport update '
          DO jk = 1, nlay_i
             WRITE(numout,*) ' t_i : ', t_i(jiindx, jjindx, jk, 1:jpl)
@@ -313,5 +273,5 @@
       ENDIF
 
-      at_i(:,:) = 0.0
+      at_i(:,:) = 0._wp
       DO jl = 1, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
@@ -335,12 +295,6 @@
       ! Snow temperature and ice age
       !------------------------------
-
-      e_s(:,:,:,:) = e_s(:,:,:,:)        + &
-         d_e_s_trp(:,:,:,:)  + &
-         d_e_s_thd(:,:,:,:)
-
-      oa_i(:,:,:)  = oa_i(:,:,:)         + &
-         d_oa_i_trp(:,:,:)   + &
-         d_oa_i_thd(:,:,:)
+      e_s (:,:,:,:) = e_s (:,:,:,:) + d_e_s_trp (:,:,:,:) + d_e_s_thd (:,:,:,:)
+      oa_i(:,:,:)   = oa_i(:,:,:)   + d_oa_i_trp(:,:,:)   + d_oa_i_thd(:,:,:)
 
       !--------------
@@ -348,6 +302,6 @@
       !--------------
 
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) THEN ! general case
-
+      IF(  num_sal == 2  .OR.  num_sal == 4  ) THEN      ! general case
+         !
          IF( ln_nicep ) THEN  
             WRITE(numout,*) ' Before everything '
@@ -360,8 +314,6 @@
          ENDIF
 
-         smv_i(:,:,:) = smv_i(:,:,:)       + &
-            d_smv_i_thd(:,:,:) + &
-            d_smv_i_trp(:,:,:)
-
+         smv_i(:,:,:) = smv_i(:,:,:) + d_smv_i_thd(:,:,:) + d_smv_i_trp(:,:,:)
+         !
          IF( ln_nicep ) THEN  
             WRITE(numout,*) ' After advection   '
@@ -369,6 +321,6 @@
             WRITE(numout,*) ' v_s : ', v_s(jiindx, jjindx, 1:jpl)
          ENDIF
-
-      ENDIF ! num_sal .EQ. 2
+         !
+      ENDIF
 
       CALL lim_var_glo2eqv
@@ -377,7 +329,6 @@
       ! 2. Review of all pathological cases
       !--------------------------------------
-
-      zrtt          = 173.15 * rone
-      zacrith       = 1.0e-6
+      zrtt    = 173.15_wp * rone
+      zacrith = 1.e-6_wp
 
       !-------------------------------------------
@@ -386,5 +337,5 @@
       ! should be removed since it is treated after dynamics now
 
-      zhimax = 5.0
+      zhimax = 5._wp
       ! first category
       DO jj = 1, jpj
@@ -416,7 +367,7 @@
 
       !change this 14h44
-      zhimax = 20.0 ! line added up
+      zhimax = 20.0     ! line added up
       ! change this also 17 aug
-      zhimax = 30.0 ! line added up
+      zhimax = 30.0     ! line added up
 
       DO jl = 2, jpl
@@ -435,7 +386,6 @@
                   .AND.(v_i(ji,jj,jl)/MAX(a_i(ji,jj,jl),epsi10)*zindb).GT.zhimax ) THEN
                   z_prescr_hi  =  ( hi_max_typ(jl-ice_cat_bounds(jm,1)  ,jm) + &
-                     hi_max_typ(jl-ice_cat_bounds(jm,1)+1,jm) ) / &
-                     2.0
-                  a_i(ji,jj,jl) = v_i(ji,jj,jl) / z_prescr_hi
+                     hi_max_typ(jl-ice_cat_bounds(jm,1)+1,jm) ) / 2.0
+                  a_i (ji,jj,jl) = v_i(ji,jj,jl) / z_prescr_hi
                   ht_i(ji,jj,jl) = v_i(ji,jj,jl) / a_i(ji,jj,jl)
                ENDIF
@@ -458,5 +408,5 @@
       ENDIF
 
-      at_i(:,:) = 0.0
+      at_i(:,:) = 0._wp
       DO jl = 1, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
@@ -481,5 +431,5 @@
          jbnd1 = ice_cat_bounds(jm,1)
          jbnd2 = ice_cat_bounds(jm,2)
-         IF (ice_ncat_types(jm) .GT. 1 ) CALL lim_itd_th_reb(jbnd1, jbnd2, jm)
+         IF (ice_ncat_types(jm) .GT. 1 )   CALL lim_itd_th_reb(jbnd1, jbnd2, jm)
       END DO
 
@@ -498,5 +448,5 @@
       ENDIF
 
-      at_i(:,:) = 0.0
+      at_i(:,:) = 0._wp
       DO jl = 1, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
@@ -531,5 +481,5 @@
          DO jj = 1, jpj 
             DO ji = 1, jpi
-               IF ( internal_melt(ji,jj,jl) ) THEN
+               IF( internal_melt(ji,jj,jl) ) THEN
                   ! initial ice thickness
                   !-----------------------
@@ -852,6 +802,6 @@
       ! 2.13.2) Total ice concentration cannot exceed zamax
       !----------------------------------------------------
-      at_i(:,:) = 0.0
-      DO jl = 1, jpl
+      at_i(:,:) = a_i(:,:,1)
+      DO jl = 2, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
       END DO
@@ -867,9 +817,8 @@
                zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) - epsi03 ) ) 
                zindb   =  MAX( rzero, SIGN( rone, v_i(ji,jj,jl) ) ) 
-               z_da_i(jl) = a_i(ji,jj,jl)*zindb*z_da_ex/MAX(at_i(ji,jj),epsi06)
-               z_dv_i(jl) = v_i(ji,jj,jl)*z_da_i(jl)/MAX(at_i(ji,jj),epsi06)
-               a_i(ji,jj,jl) = a_i(ji,jj,jl) - z_da_i(jl)
-               v_i(ji,jj,jl) = v_i(ji,jj,jl) + z_dv_i(jl)
-
+               z_da_i = a_i(ji,jj,jl) * z_da_ex / MAX( at_i(ji,jj), epsi06 ) * zindb
+               z_dv_i = v_i(ji,jj,jl) * z_da_i  / MAX( at_i(ji,jj), epsi06 )
+               a_i(ji,jj,jl) = a_i(ji,jj,jl) - z_da_i
+               v_i(ji,jj,jl) = v_i(ji,jj,jl) + z_dv_i
             END DO
 
@@ -879,13 +828,11 @@
       IF( ln_nicep ) THEN  
          WRITE(numout,*) ' 2.13 '
-         WRITE(numout,*) ' a_i : ', a_i(jiindx, jjindx, 1:jpl)
-         WRITE(numout,*) ' at_i    ', at_i(jiindx,jjindx)
-         WRITE(numout,*) ' v_i : ', v_i(jiindx, jjindx, 1:jpl)
-         WRITE(numout,*) ' v_s : ', v_s(jiindx, jjindx, 1:jpl)
-         WRITE(numout,*) ' smv_i: ', smv_i(jiindx, jjindx, 1:jpl)
-      ENDIF
-
-      at_i(:,:) = 0.0
-      DO jl = 1, jpl
+         WRITE(numout,*) ' a_i : ', a_i(jiindx, jjindx, 1:jpl), ' at_i    ', at_i(jiindx,jjindx)
+         WRITE(numout,*) ' v_i : ', v_i(jiindx, jjindx, 1:jpl), ' v_s : ', v_s(jiindx, jjindx, 1:jpl)
+         WRITE(numout,*) ' smv_i: ', smv_i(jiindx, jjindx, 1:jpl)
+      ENDIF
+
+      at_i(:,:) = a_i(:,:,1)
+      DO jl = 2, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
       END DO
@@ -941,6 +888,6 @@
       ENDIF
 
-      at_i(:,:) = 0.0
-      DO jl = 1, jpl
+      at_i(:,:) = a_i(:,:,1)
+      DO jl = 2, jpl
          at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
       END DO
@@ -951,5 +898,4 @@
       ! Ice drift
       !------------
-
       DO jj = 2, jpjm1
          DO ji = fs_2, fs_jpim1
@@ -976,9 +922,4 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               DO jl = 1, jpl
-                  !                IF ((v_i(ji,jj,jl).NE.0.0).AND.(a_i(ji,jj,jl).EQ.0.0)) THEN
-                  !                   WRITE(numout,*) ' lim_update : incompatible volume and concentration '
-               END DO ! jl
-
                DO jl = 1, jpl
                   IF ( (a_i(ji,jj,jl).GT.1.0).OR.(at_i(ji,jj).GT.1.0) ) THEN
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90	(revision 2715)
@@ -1,6 +1,3 @@
 MODULE limvar
-   !!----------------------------------------------------------------------
-   !!   'key_lim3'                                      LIM3 sea-ice model
-   !!----------------------------------------------------------------------
    !!======================================================================
    !!                       ***  MODULE limvar ***
@@ -32,119 +29,92 @@
    !!                        - ot_i(jpi,jpj)  !average ice age
    !!======================================================================
+   !! History :   -   ! 2006-01 (M. Vancoppenolle) Original code
+   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
+   !!----------------------------------------------------------------------
 #if defined key_lim3
    !!----------------------------------------------------------------------
-   !! * Modules used
-   USE dom_ice
+   !!   'key_lim3'                                      LIM3 sea-ice model
+   !!----------------------------------------------------------------------
+   !!   lim_var_agg       : 
+   !!   lim_var_glo2eqv   :
+   !!   lim_var_eqv2glo   :
+   !!   lim_var_salprof   : 
+   !!   lim_var_salprof1d :
+   !!   lim_var_bv        :
+   !!----------------------------------------------------------------------
    USE par_oce          ! ocean parameters
    USE phycst           ! physical constants (ocean directory) 
    USE sbc_oce          ! Surface boundary condition: ocean fields
-   USE thd_ice
-   USE in_out_manager
-   USE ice
-   USE par_ice
+   USE ice              ! LIM variables
+   USE par_ice          ! LIM parameters
+   USE dom_ice          ! LIM domain
+   USE thd_ice          ! LIM thermodynamics
+   USE wrk_nemo         ! workspace manager
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC lim_var_agg
-   PUBLIC lim_var_glo2eqv
-   PUBLIC lim_var_eqv2glo
-   PUBLIC lim_var_salprof
-   PUBLIC lim_var_bv
-   PUBLIC lim_var_salprof1d
-
-   !! * Module variables
-   REAL(wp)  ::           &  ! constant values
-      epsi20 = 1e-20   ,  &
-      epsi13 = 1e-13   ,  &
-      zzero  = 0.e0    ,  &
-      zone   = 1.e0
-
-   !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   PUBLIC   lim_var_agg          !
+   PUBLIC   lim_var_glo2eqv      !
+   PUBLIC   lim_var_eqv2glo      !
+   PUBLIC   lim_var_salprof      !
+   PUBLIC   lim_var_bv           !
+   PUBLIC   lim_var_salprof1d    !
+
+   REAL(wp) ::   eps20 = 1.e-20_wp   ! module constants
+   REAL(wp) ::   eps16 = 1.e-16_wp   !    -       -
+   REAL(wp) ::   eps13 = 1.e-13_wp   !    -       -
+   REAL(wp) ::   eps10 = 1.e-10_wp   !    -       -
+   REAL(wp) ::   eps06 = 1.e-06_wp   !    -       -
+   REAL(wp) ::   zzero = 0.e0        !    -       -
+   REAL(wp) ::   zone  = 1.e0        !    -       -
+
+   !!----------------------------------------------------------------------
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE lim_var_agg(n)
+   SUBROUTINE lim_var_agg( kn )
       !!------------------------------------------------------------------
       !!                ***  ROUTINE lim_var_agg  ***
-      !! ** Purpose :
-      !!        This routine aggregates ice-thickness-category variables to  
-      !!                                all-ice variables
-      !!        i.e. it turns VGLO into VAGG
+      !!
+      !! ** Purpose :   aggregates ice-thickness-category variables to all-ice variables
+      !!              i.e. it turns VGLO into VAGG
       !! ** Method  :
       !!
-      !! ** Arguments :
-      !!           kideb , kiut : Starting and ending points on which the 
-      !!                         the computation is applied
-      !!
-      !! ** Inputs / Ouputs : (global commons)
       !! ** Arguments : n = 1, at_i vt_i only
       !!                n = 2 everything
       !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !!           (01-2006) Martin Vancoppenolle, UCL-ASTR
-      !!
       !! note : you could add an argument when you need only at_i, vt_i
       !!        and when you need everything
       !!------------------------------------------------------------------
-      !! * Arguments
-
-      !! * Local variables
-      INTEGER ::   ji,       &   ! spatial dummy loop index
-         jj,       &   ! spatial dummy loop index
-         jk,       &   ! vertical layering dummy loop index
-         jl            ! ice category dummy loop index
-
-      REAL ::      zeps, epsi16, zinda, epsi06
-
-      INTEGER, INTENT( in ) ::   n     ! describes what is needed
-
-      !!-- End of declarations
-      !!----------------------------------------------------------------------------------------------
-      zeps = 1.0e-13
-      epsi16 = 1.0e-16
-      epsi06 = 1.0e-6
-
-      !------------------
-      ! Zero everything
-      !------------------
-
-      vt_i(:,:)  = 0.0
-      vt_s(:,:)  = 0.0
-      at_i(:,:)  = 0.0 
-      ato_i(:,:) = 1.0 
-
-      IF ( n .GT. 1 ) THEN
-         et_s(:,:)  = 0.0
-         ot_i(:,:)  = 0.0
-         smt_i(:,:) = 0.0
-         et_i(:,:)  = 0.0
-      ENDIF
+      INTEGER, INTENT( in ) ::   kn     ! =1 at_i & vt only ; = what is needed
+      !
+      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
+      REAL(wp) ::   zinda
+      !!------------------------------------------------------------------
 
       !--------------------
       ! Compute variables
       !--------------------
-
+      vt_i (:,:) = 0._wp
+      vt_s (:,:) = 0._wp
+      at_i (:,:) = 0._wp
+      ato_i(:,:) = 1._wp
+      !
       DO jl = 1, jpl
          DO jj = 1, jpj
             DO ji = 1, jpi
-
+               !
                vt_i(ji,jj) = vt_i(ji,jj) + v_i(ji,jj,jl) ! ice volume
                vt_s(ji,jj) = vt_s(ji,jj) + v_s(ji,jj,jl) ! snow volume
                at_i(ji,jj) = at_i(ji,jj) + a_i(ji,jj,jl) ! ice concentration
-
+               !
                zinda = MAX( zzero , SIGN( zone , at_i(ji,jj) - 0.10 ) ) 
-               icethi(ji,jj) = vt_i(ji,jj) / MAX(at_i(ji,jj),epsi16)*zinda  
-               ! ice thickness
+               icethi(ji,jj) = vt_i(ji,jj) / MAX( at_i(ji,jj) , eps16 ) * zinda  ! ice thickness
             END DO
          END DO
@@ -153,120 +123,75 @@
       DO jj = 1, jpj
          DO ji = 1, jpi
-            ato_i(ji,jj) = MAX(1.0 - at_i(ji,jj), 0.0)   ! open water fraction
-         END DO
-      END DO
-
-      IF ( n .GT. 1 ) THEN
-
+            ato_i(ji,jj) = MAX( 1._wp - at_i(ji,jj), 0._wp )   ! open water fraction
+         END DO
+      END DO
+
+      IF( kn > 1 ) THEN
+         et_s (:,:) = 0._wp
+         ot_i (:,:) = 0._wp
+         smt_i(:,:) = 0._wp
+         et_i (:,:) = 0._wp
+         !
          DO jl = 1, jpl
             DO jj = 1, jpj
                DO ji = 1, jpi
-                  et_s(ji,jj)  = et_s(ji,jj)  +     &       ! snow heat content
-                     e_s(ji,jj,1,jl)
+                  et_s(ji,jj)  = et_s(ji,jj)  + e_s(ji,jj,1,jl)                                       ! snow heat content
                   zinda = MAX( zzero , SIGN( zone , vt_i(ji,jj) - 0.10 ) ) 
-                  smt_i(ji,jj) = smt_i(ji,jj) +     &       ! ice salinity
-                     smv_i(ji,jj,jl) / MAX( vt_i(ji,jj) , zeps ) * &
-                     zinda
+                  smt_i(ji,jj) = smt_i(ji,jj) + smv_i(ji,jj,jl) / MAX( vt_i(ji,jj) , eps13 ) * zinda   ! ice salinity
                   zinda = MAX( zzero , SIGN( zone , at_i(ji,jj) - 0.10 ) ) 
-                  ot_i(ji,jj)  = ot_i(ji,jj)  +     &       ! ice age
-                     oa_i(ji,jj,jl)  / MAX( at_i(ji,jj) , zeps ) * &
-                     zinda
-               END DO
-            END DO
-         END DO
-
+                  ot_i(ji,jj)  = ot_i(ji,jj)  + oa_i(ji,jj,jl)  / MAX( at_i(ji,jj) , eps13 ) * zinda   ! ice age
+               END DO
+            END DO
+         END DO
+         !
          DO jl = 1, jpl
             DO jk = 1, nlay_i
-               DO jj = 1, jpj
-                  DO ji = 1, jpi
-                     et_i(ji,jj) = et_i(ji,jj) + e_i(ji,jj,jk,jl) ! ice heat
-                     ! content
-                  END DO
-               END DO
-            END DO
-         END DO
-
-      ENDIF ! n .GT. 1
-
+               et_i(:,:) = et_i(:,:) + e_i(:,:,jk,jl)       ! ice heat content
+            END DO
+         END DO
+         !
+      ENDIF
+      !
    END SUBROUTINE lim_var_agg
 
-   !==============================================================================
 
    SUBROUTINE lim_var_glo2eqv
       !!------------------------------------------------------------------
-      !!                ***  ROUTINE lim_var_glo2eqv ***'
-      !! ** Purpose :
-      !!        This routine computes equivalent variables as function of    
-      !!                              global variables 
-      !!        i.e. it turns VGLO into VEQV
-      !! ** Method  :
-      !!
-      !! ** Arguments :
-      !!           kideb , kiut : Starting and ending points on which the 
-      !!                         the computation is applied
-      !!
-      !! ** Inputs / Ouputs : 
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !!           (01-2006) Martin Vancoppenolle, UCL-ASTR
-      !!
-      !!------------------------------------------------------------------
-
-      !! * Local variables
-      INTEGER ::   ji,       &   ! spatial dummy loop index
-         jj,       &   ! spatial dummy loop index
-         jk,       &   ! vertical layering dummy loop index
-         jl            ! ice category dummy loop index
-
-      REAL :: zq_i, zaaa, zbbb, zccc, zdiscrim, &
-         ztmelts, zindb, zq_s, zfac1, zfac2
-
-      REAL :: zeps, epsi06
-
-      zeps    = 1.0e-10
-      epsi06  = 1.0e-06
-
-      !!-- End of declarations
-      !!------------------------------------------------------------------------------
+      !!                ***  ROUTINE lim_var_glo2eqv ***
+      !!
+      !! ** Purpose :   computes equivalent variables as function of global variables 
+      !!              i.e. it turns VGLO into VEQV
+      !!------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
+      REAL(wp) ::   zq_i, zaaa, zbbb, zccc, zdiscrim     ! local scalars
+      REAL(wp) ::   ztmelts, zindb, zq_s, zfac1, zfac2   !   -      -
+      !!------------------------------------------------------------------
 
       !-------------------------------------------------------
       ! Ice thickness, snow thickness, ice salinity, ice age
       !-------------------------------------------------------
-!CDIR NOVERRCHK
       DO jl = 1, jpl
-!CDIR NOVERRCHK
          DO jj = 1, jpj
-!CDIR NOVERRCHK
             DO ji = 1, jpi
-               zindb          = 1.0-MAX(0.0,SIGN(1.0,- a_i(ji,jj,jl))) !0 if no ice and 1 if yes
-               ht_i(ji,jj,jl) = v_i(ji,jj,jl)   / MAX( a_i(ji,jj,jl) , zeps ) * zindb
-               ht_s(ji,jj,jl) = v_s(ji,jj,jl)   / MAX( a_i(ji,jj,jl) , zeps ) * zindb
-               o_i(ji,jj,jl)  = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , zeps ) * zindb
-            END DO
-         END DO
-      END DO
-
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) )THEN
-
-!CDIR NOVERRCHK
+               zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp,- a_i(ji,jj,jl) ) )   !0 if no ice and 1 if yes
+               ht_i(ji,jj,jl) = v_i (ji,jj,jl) / MAX( a_i(ji,jj,jl) , eps10 ) * zindb
+               ht_s(ji,jj,jl) = v_s (ji,jj,jl) / MAX( a_i(ji,jj,jl) , eps10 ) * zindb
+               o_i(ji,jj,jl)  = oa_i(ji,jj,jl) / MAX( a_i(ji,jj,jl) , eps10 ) * zindb
+            END DO
+         END DO
+      END DO
+
+      IF(  num_sal == 2  .OR.  num_sal == 4  )THEN
          DO jl = 1, jpl
-!CDIR NOVERRCHK
-            DO jj = 1, jpj
-!CDIR NOVERRCHK
-               DO ji = 1, jpi
-                  zindb          = 1.0-MAX(0.0,SIGN(1.0,-a_i(ji,jj,jl))) !0 if no ice and 1 if yes
-                  sm_i(ji,jj,jl) = smv_i(ji,jj,jl) / MAX(v_i(ji,jj,jl),zeps) * zindb
-               END DO
-            END DO
-         END DO
-
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp,- a_i(ji,jj,jl) ) )   !0 if no ice and 1 if yes
+                  sm_i(ji,jj,jl) = smv_i(ji,jj,jl) / MAX( v_i(ji,jj,jl) , eps10 ) * zindb
+               END DO
+            END DO
+         END DO
       ENDIF
 
-      ! salinity profile
-      CALL lim_var_salprof
+      CALL lim_var_salprof      ! salinity profile
 
       !-------------------
@@ -281,22 +206,16 @@
 !CDIR NOVERRCHK
                DO ji = 1, jpi
-                  !Energy of melting q(S,T) [J.m-3]
-                  zq_i       = e_i(ji,jj,jk,jl) / area(ji,jj) / &
-                     MAX( v_i(ji,jj,jl) , epsi06 ) * nlay_i 
-                  ! zindb = 0 if no ice and 1 if yes
-                  zindb      = 1.0 - MAX( 0.0 , SIGN( 1.0 , - v_i(ji,jj,jl) ) )
-                  !convert units ! very important that this line is here
-                  zq_i       = zq_i * unit_fac * zindb
-                  !Ice layer melt temperature
-                  ztmelts    =  -tmut*s_i(ji,jj,jk,jl) + rtt
-                  !Conversion q(S,T) -> T (second order equation)
-                  zaaa       =  cpic
-                  zbbb       =  ( rcp - cpic ) * ( ztmelts - rtt ) + &
-                     zq_i / rhoic - lfus
+                  !                                                              ! Energy of melting q(S,T) [J.m-3]
+                  zq_i    = e_i(ji,jj,jk,jl) / area(ji,jj) / MAX( v_i(ji,jj,jl) , eps06 ) * REAL(nlay_i,wp) 
+                  zindb   = 1.0 - MAX( 0.0 , SIGN( 1.0 , - v_i(ji,jj,jl) ) )     ! zindb = 0 if no ice and 1 if yes
+                  zq_i    = zq_i * unit_fac * zindb                              !convert units
+                  ztmelts = -tmut * s_i(ji,jj,jk,jl) + rtt                       ! Ice layer melt temperature
+                  !
+                  zaaa       =  cpic                  ! Conversion q(S,T) -> T (second order equation)
+                  zbbb       =  ( rcp - cpic ) * ( ztmelts - rtt ) + zq_i / rhoic - lfus
                   zccc       =  lfus * (ztmelts-rtt)
-                  zdiscrim   =  SQRT( MAX(zbbb*zbbb - 4.0*zaaa*zccc,0.0) )
-                  t_i(ji,jj,jk,jl) = rtt + zindb *( - zbbb - zdiscrim ) / & 
-                     ( 2.0 *zaaa )
-                  t_i(ji,jj,jk,jl) = MIN( rtt, MAX(173.15, t_i(ji,jj,jk,jl) ) )
+                  zdiscrim   =  SQRT( MAX(zbbb*zbbb - 4._wp*zaaa*zccc , 0._wp) )
+                  t_i(ji,jj,jk,jl) = rtt + zindb *( - zbbb - zdiscrim ) / ( 2.0 *zaaa )
+                  t_i(ji,jj,jk,jl) = MIN( rtt, MAX( 173.15_wp, t_i(ji,jj,jk,jl) ) )       ! 100-rtt < t_i < rtt
                END DO
             END DO
@@ -307,24 +226,17 @@
       ! Snow temperatures
       !--------------------
-      zfac1 = 1. / ( rhosn * cpic )
+      zfac1 = 1._wp / ( rhosn * cpic )
       zfac2 = lfus / cpic  
-!CDIR NOVERRCHK
       DO jl = 1, jpl
-!CDIR NOVERRCHK
          DO jk = 1, nlay_s
-!CDIR NOVERRCHK
-            DO jj = 1, jpj
-!CDIR NOVERRCHK
+            DO jj = 1, jpj
                DO ji = 1, jpi
                   !Energy of melting q(S,T) [J.m-3]
-                  zq_s       = e_s(ji,jj,jk,jl) / area(ji,jj) / &
-                     MAX( v_s(ji,jj,jl) , epsi06 ) * nlay_s 
-                  ! zindb = 0 if no ice and 1 if yes
-                  zindb      = 1.0 - MAX( 0.0 , SIGN( 1.0 , - v_s(ji,jj,jl) ) )
-                  !convert units ! very important that this line is here
-                  zq_s       = zq_s * unit_fac * zindb
+                  zq_s  = e_s(ji,jj,jk,jl) / ( area(ji,jj) * MAX( v_s(ji,jj,jl) , eps06 ) ) * REAL(nlay_s,wp)
+                  zindb = 1._wp - MAX( 0._wp , SIGN( 1._wp , - v_s(ji,jj,jl) ) )     ! zindb = 0 if no ice and 1 if yes
+                  zq_s  = zq_s * unit_fac * zindb                                    ! convert units
+                  !
                   t_s(ji,jj,jk,jl) = rtt + zindb * ( - zfac1 * zq_s + zfac2 )
-                  t_s(ji,jj,jk,jl) = MIN( rtt, MAX(173.15, t_s(ji,jj,jk,jl) ) )
-
+                  t_s(ji,jj,jk,jl) = MIN( rtt, MAX( 173.15, t_s(ji,jj,jk,jl) ) )     ! 100-rtt < t_i < rtt
                END DO
             END DO
@@ -335,66 +247,45 @@
       ! Mean temperature
       !-------------------
-      tm_i(:,:) = 0.0
-!CDIR NOVERRCHK
+      tm_i(:,:) = 0._wp
       DO jl = 1, jpl
-!CDIR NOVERRCHK
          DO jk = 1, nlay_i
-!CDIR NOVERRCHK
-            DO jj = 1, jpj
-!CDIR NOVERRCHK
-               DO ji = 1, jpi
-                  zindb          = 1.0-MAX(0.0,SIGN(1.0,-a_i(ji,jj,jl)))
-                  zindb          = zindb*1.0-MAX(0.0,SIGN(1.0,-v_i(ji,jj,jl)))
-                  tm_i(ji,jj) = tm_i(ji,jj) + t_i(ji,jj,jk,jl)*v_i(ji,jj,jl) / &
-                     REAL(nlay_i) / MAX( vt_i(ji,jj) , zeps )
-               END DO
-            END DO
-         END DO
-      END DO
-
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zindb = (  1._wp - MAX( 0._wp , SIGN( 1._wp , -a_i(ji,jj,jl) ) )  )   &
+                     &  * (  1._wp - MAX( 0._wp , SIGN( 1._wp , -v_i(ji,jj,jl) ) )  )
+                  tm_i(ji,jj) = tm_i(ji,jj) + t_i(ji,jj,jk,jl) * v_i(ji,jj,jl)   &
+                     &                      / (  REAL(nlay_i,wp) * MAX( vt_i(ji,jj) , eps10 )  )
+               END DO
+            END DO
+         END DO
+      END DO
+      !
    END SUBROUTINE lim_var_glo2eqv
 
-   !===============================================================================
 
    SUBROUTINE lim_var_eqv2glo
       !!------------------------------------------------------------------
-      !!                ***  ROUTINE lim_var_eqv2glo ***'
-      !! ** Purpose :
-      !!        This routine computes global     variables as function of    
-      !!                              equivalent variables
-      !!        i.e. it turns VEQV into VGLO
+      !!                ***  ROUTINE lim_var_eqv2glo ***
+      !!
+      !! ** Purpose :   computes global variables as function of equivalent variables
+      !!                i.e. it turns VEQV into VGLO
       !! ** Method  :
       !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References :
-      !!
-      !! ** History :
-      !!           (01-2006) Martin Vancoppenolle, UCL-ASTR
-      !!                     Take it easy man
-      !!                     Life is just a simple game, between 
-      !!                     ups / and downs \ :@)
-      !!
-      !!------------------------------------------------------------------
-
+      !! ** History :  (01-2006) Martin Vancoppenolle, UCL-ASTR
+      !!------------------------------------------------------------------
+      !
       v_i(:,:,:)   = ht_i(:,:,:) * a_i(:,:,:)
       v_s(:,:,:)   = ht_s(:,:,:) * a_i(:,:,:)
       smv_i(:,:,:) = sm_i(:,:,:) * v_i(:,:,:)
       oa_i (:,:,:) = o_i (:,:,:) * a_i(:,:,:)
-
+      !
    END SUBROUTINE lim_var_eqv2glo
 
-   !===============================================================================
 
    SUBROUTINE lim_var_salprof
       !!------------------------------------------------------------------
-      !!                ***  ROUTINE lim_var_salprof ***'
-      !! ** Purpose :
-      !!        This routine computes salinity profile in function of
-      !!        bulk salinity     
+      !!                ***  ROUTINE lim_var_salprof ***
+      !!
+      !! ** Purpose :   computes salinity profile in function of bulk salinity     
       !!
       !! ** Method  : If bulk salinity greater than s_i_1, 
@@ -406,50 +297,23 @@
       !!
       !! ** References : Vancoppenolle et al., 2007 (in preparation)
-      !!
-      !! ** History :
-      !!           (08-2006) Martin Vancoppenolle, UCL-ASTR
-      !!                     Take it easy man
-      !!                     Life is just a simple game, between ups 
-      !!                     / and downs \ :@)
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-
-      !! * Local variables
-      INTEGER ::             &
-         ji            ,     & !: spatial dummy loop index
-         jj            ,     & !: spatial dummy loop index
-         jk            ,     & !: vertical layering dummy loop index
-         jl                    !: ice category dummy loop index
-
-      REAL(wp) ::            &
-         dummy_fac0    ,     & !: dummy factor used in computations
-         dummy_fac1    ,     & !: dummy factor used in computations
-         dummy_fac     ,     & !: dummy factor used in computations
-         zind0         ,     & !: switch, = 1 if sm_i lt s_i_0
-         zind01        ,     & !: switch, = 1 if sm_i between s_i_0 and s_i_1
-         zindbal       ,     & !: switch, = 1, if 2*sm_i gt sss_m
-         zargtemp              !: dummy factor
-
-      REAL(wp), DIMENSION(nlay_i) ::      &
-         zs_zero               !: linear salinity profile for salinities under
-      !: s_i_0
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl) :: &
-         z_slope_s     ,     & !: slope of the salinity profile
-         zalpha                !: weight factor for s between s_i_0 and s_i_1
-
-      !!-- End of declarations
-      !!------------------------------------------------------------------------------
+      !!------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk, jl   ! dummy loop index
+      REAL(wp) ::   dummy_fac0, dummy_fac1, dummy_fac, zsal      ! local scalar
+      REAL(wp) ::   zind0, zind01, zindbal, zargtemp , zs_zero   !   -      -
+      !
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   z_slope_s, zalpha   ! 3D pointer
+      !!------------------------------------------------------------------
+
+      IF( wrk_in_use( 2, 1,2 ) ) THEN
+         CALL ctl_stop( 'lim_var_salprof: requested workspace arrays unavailable' )   ;   RETURN
+      END IF
+
+      z_slope_s => wrk_3d_1(:,:,1:jpl)   ! slope of the salinity profile
+      zalpha    => wrk_3d_2(:,:,1:jpl)   ! weight factor for s between s_i_0 and s_i_1
 
       !---------------------------------------
       ! Vertically constant, constant in time
       !---------------------------------------
-
-      IF ( num_sal .EQ. 1 ) THEN
-
-         s_i(:,:,:,:) = bulk_sal
-
-      ENDIF
+      IF( num_sal == 1 )   s_i(:,:,:,:) = bulk_sal
 
       !-----------------------------------
@@ -457,45 +321,32 @@
       !-----------------------------------
 
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) )THEN
-
+      IF(   num_sal == 2  .OR.   num_sal == 4   ) THEN
+         !
          DO jk = 1, nlay_i
             s_i(:,:,jk,:)  = sm_i(:,:,:)
-         END DO ! jk
-
-         ! Slope of the linear profile zs_zero
-         !-------------------------------------
+         END DO
+         !
+         DO jl = 1, jpl                               ! Slope of the linear profile 
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  z_slope_s(ji,jj,jl) = 2._wp * sm_i(ji,jj,jl) / MAX( 0.01 , ht_i(ji,jj,jl) )
+               END DO
+            END DO
+         END DO
+         !
+         dummy_fac0 = 1._wp / ( s_i_0 - s_i_1 )       ! Weighting factor between zs_zero and zs_inf
+         dummy_fac1 = s_i_1 / ( s_i_1 - s_i_0 )
+
+         zalpha(:,:,:) = 0._wp
          DO jl = 1, jpl
             DO jj = 1, jpj
-               DO ji = 1, jpi
-                  z_slope_s(ji,jj,jl) = 2.0 * sm_i(ji,jj,jl) / MAX( 0.01      &
-                     , ht_i(ji,jj,jl) )
-               END DO ! ji
-            END DO ! jj
-         END DO ! jl
-
-         ! Weighting factor between zs_zero and zs_inf
-         !---------------------------------------------
-         dummy_fac0 = 1. / ( ( s_i_0 - s_i_1 ) )
-         dummy_fac1 = s_i_1 / ( s_i_1 - s_i_0 )
-
-         zalpha(:,:,:) = 0.0
-
-!CDIR NOVERRCHK
-         DO jl = 1, jpl
-!CDIR NOVERRCHK
-            DO jj = 1, jpj
-!CDIR NOVERRCHK
                DO ji = 1, jpi
                   ! zind0 = 1 if sm_i le s_i_0 and 0 otherwise
                   zind0  = MAX( 0.0   , SIGN( 1.0  , s_i_0 - sm_i(ji,jj,jl) ) ) 
                   ! zind01 = 1 if sm_i is between s_i_0 and s_i_1 and 0 othws 
-                  zind01 = ( 1.0 - zind0 ) *                                  &
-                     MAX( 0.0   , SIGN( 1.0  , s_i_1 - sm_i(ji,jj,jl) ) ) 
+                  zind01 = ( 1.0 - zind0 ) * MAX( 0.0   , SIGN( 1.0  , s_i_1 - sm_i(ji,jj,jl) ) ) 
                   ! If 2.sm_i GE sss_m then zindbal = 1
-                  zindbal = MAX( 0.0 , SIGN( 1.0 , 2. * sm_i(ji,jj,jl) -      &
-                     sss_m(ji,jj) ) )
-                  zalpha(ji,jj,jl) = zind0  * 1.0                             &
-                     + zind01 * ( sm_i(ji,jj,jl) * dummy_fac0 + &
-                     dummy_fac1 )
+                  zindbal = MAX( 0.0 , SIGN( 1.0 , 2. * sm_i(ji,jj,jl) - sss_m(ji,jj) ) )
+                  zalpha(ji,jj,jl) = zind0  * 1.0 + zind01 * ( sm_i(ji,jj,jl) * dummy_fac0 + dummy_fac1 )
                   zalpha(ji,jj,jl) = zalpha(ji,jj,jl) * ( 1.0 - zindbal )
                END DO
@@ -503,18 +354,13 @@
          END DO
 
-         ! Computation of the profile
-         !----------------------------
-         dummy_fac = 1. / nlay_i
-
+         dummy_fac = 1._wp / nlay_i                   ! Computation of the profile
          DO jl = 1, jpl
             DO jk = 1, nlay_i
                DO jj = 1, jpj
                   DO ji = 1, jpi
-                     ! linear profile with 0 at the surface
-                     zs_zero(jk)      = z_slope_s(ji,jj,jl) * ( jk - 1./2. ) * &
-                        ht_i(ji,jj,jl) * dummy_fac
-                     ! weighting the profile
-                     s_i(ji,jj,jk,jl) = zalpha(ji,jj,jl) * zs_zero(jk) +       &
-                        ( 1.0 - zalpha(ji,jj,jl) ) * sm_i(ji,jj,jl)
+                     !                                      ! linear profile with 0 at the surface
+                     zs_zero = z_slope_s(ji,jj,jl) * ( REAL(jk,wp) - 0.5_wp ) * ht_i(ji,jj,jl) * dummy_fac
+                     !                                      ! weighting the profile
+                     s_i(ji,jj,jk,jl) = zalpha(ji,jj,jl) * zs_zero + ( 1._wp - zalpha(ji,jj,jl) ) * sm_i(ji,jj,jl)
                   END DO ! ji
                END DO ! jj
@@ -527,137 +373,83 @@
       ! Vertically varying salinity profile, constant in time
       !-------------------------------------------------------
-      ! Schwarzacher (1959) multiyear salinity profile (mean = 2.30)
-
-      IF ( num_sal .EQ. 3 ) THEN
-
-         sm_i(:,:,:) = 2.30
-
-!CDIR NOVERRCHK
+
+      IF( num_sal == 3 ) THEN      ! Schwarzacher (1959) multiyear salinity profile (mean = 2.30)
+         !
+         sm_i(:,:,:) = 2.30_wp
+         !
          DO jl = 1, jpl
 !CDIR NOVERRCHK
             DO jk = 1, nlay_i
-!CDIR NOVERRCHK
-               DO jj = 1, jpj
-!CDIR NOVERRCHK
-                  DO ji = 1, jpi
-                     zargtemp  = ( jk - 0.5 ) / nlay_i
-                     s_i(ji,jj,jk,jl) =  1.6 - 1.6 * COS( 3.14169265 * &
-                        ( zargtemp**(0.407/           &
-                        ( 0.573 + zargtemp ) ) ) )
-                  END DO ! ji
-               END DO ! jj
-            END DO ! jk
-         END DO ! jl
+               zargtemp  = ( REAL(jk,wp) - 0.5_wp ) / REAL(nlay_i,wp)
+               zsal =  1.6_wp * (  1._wp - COS( rpi * zargtemp**(0.407_wp/(0.573_wp+zargtemp)) )  )
+               s_i(:,:,jk,jl) =  zsal
+            END DO
+         END DO
 
       ENDIF ! num_sal
-
+      !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('lim_var_salprof: failed to release workspace arrays.')
+      !
    END SUBROUTINE lim_var_salprof
 
-   !===============================================================================
 
    SUBROUTINE lim_var_bv
       !!------------------------------------------------------------------
-      !!                ***  ROUTINE lim_var_bv ***'
-      !! ** Purpose :
-      !!        This routine computes mean brine volume (%) in sea ice
+      !!                ***  ROUTINE lim_var_bv ***
+      !!
+      !! ** Purpose :   computes mean brine volume (%) in sea ice
       !!
       !! ** Method  : e = - 0.054 * S (ppt) / T (C)
       !!
-      !! ** Arguments :
-      !!
-      !! ** Inputs / Ouputs : (global commons)
-      !!
-      !! ** External : 
-      !!
-      !! ** References : Vancoppenolle et al., JGR, 2007
-      !!
-      !! ** History :
-      !!           (08-2006) Martin Vancoppenolle, UCL-ASTR
-      !!
-      !!------------------------------------------------------------------
-      !! * Arguments
-
-      !! * Local variables
-      INTEGER ::   ji,       &   ! spatial dummy loop index
-         jj,       &   ! spatial dummy loop index
-         jk,       &   ! vertical layering dummy loop index
-         jl            ! ice category dummy loop index
-
-      REAL :: zbvi,          &   ! brine volume for a single ice category
-         zeps,          &   ! very small value
-         zindb              ! is there ice or not
-
-      !!-- End of declarations
-      !!------------------------------------------------------------------------------
-
-      zeps = 1.0e-13
-      bv_i(:,:) = 0.0
-!CDIR NOVERRCHK
+      !! References : Vancoppenolle et al., JGR, 2007
+      !!------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
+      REAL(wp) ::   zbvi, zindb      ! local scalars
+      !!------------------------------------------------------------------
+      !
+      bv_i(:,:) = 0._wp
       DO jl = 1, jpl
-!CDIR NOVERRCHK
          DO jk = 1, nlay_i
-!CDIR NOVERRCHK
-            DO jj = 1, jpj
-!CDIR NOVERRCHK
-               DO ji = 1, jpi
-                  zindb          = 1.0-MAX(0.0,SIGN(1.0,-a_i(ji,jj,jl))) !0 if no ice and 1 if yes
-                  zbvi = - zindb * tmut *s_i(ji,jj,jk,jl) /             & 
-                     MIN( t_i(ji,jj,jk,jl) - 273.15 , zeps )         &
-                     * v_i(ji,jj,jl) / REAL(nlay_i)
-                  bv_i(ji,jj) = bv_i(ji,jj) + zbvi  &
-                     / MAX( vt_i(ji,jj) , zeps )
-               END DO
-            END DO
-         END DO
-      END DO
-
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  zindb = 1.0-MAX(0.0,SIGN(1.0,-a_i(ji,jj,jl))) !0 if no ice and 1 if yes
+                  zbvi  = - zindb * tmut * s_i(ji,jj,jk,jl) / MIN( t_i(ji,jj,jk,jl) - 273.15 , eps13 )   &
+                     &                   * v_i(ji,jj,jl)    / REAL(nlay_i,wp)
+                  bv_i(ji,jj) = bv_i(ji,jj) + zbvi  / MAX( vt_i(ji,jj) , eps13 )
+               END DO
+            END DO
+         END DO
+      END DO
+      !
    END SUBROUTINE lim_var_bv
 
-   !===============================================================================
-
-   SUBROUTINE lim_var_salprof1d(kideb,kiut)
+
+   SUBROUTINE lim_var_salprof1d( kideb, kiut )
       !!-------------------------------------------------------------------
       !!                  ***  ROUTINE lim_thd_salprof1d  ***
       !!
       !! ** Purpose :   1d computation of the sea ice salinity profile
-      !!                Works with 1d vectors and is used by thermodynamic
-      !!                modules
-      !!
-      !! history :
-      !!   3.0  !  May  2007 M. Vancoppenolle  Original code
+      !!                Works with 1d vectors and is used by thermodynamic modules
       !!-------------------------------------------------------------------
-      INTEGER, INTENT(in) :: &
-         kideb, kiut             ! thickness category index
-
-      INTEGER ::             &
-         ji, jk,             &   ! geographic and layer index 
-         zji, zjj
-
-      REAL(wp) ::            &
-         dummy_fac0,         &   ! dummy factors
-         dummy_fac1,         &
-         dummy_fac2,         &
-         zalpha    ,         &   ! weighting factor
-         zind0     ,         &   ! switches as in limvar
-         zind01    ,         &   ! switch
-         zindbal   ,         &   ! switch if in freshwater area
-         zargtemp
-
-      REAL(wp), DIMENSION(jpij) ::            &
-         z_slope_s
-
-      REAL(wp), DIMENSION(jpij,jkmax) ::      &
-         zs_zero
-      !!-------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kideb, kiut   ! thickness category index
+      !
+      INTEGER  ::   ji, jk    ! dummy loop indices
+      INTEGER  ::   zji, zjj  ! local integers
+      REAL(wp) ::   dummy_fac0, dummy_fac1, dummy_fac2, zargtemp, zsal   ! local scalars
+      REAL(wp) ::   zalpha, zind0, zind01, zindbal, zs_zero              !   -      -
+      !
+      REAL(wp), POINTER, DIMENSION(:) ::   z_slope_s
+      !!---------------------------------------------------------------------
+
+      IF(  wrk_in_use(1, 1)  ) THEN
+         CALL ctl_stop('lim_var_salprof1d : requestead workspace arrays unavailable.')   ;   RETURN
+      END IF
+      ! Set-up pointers to sub-arrays of workspace arrays
+      z_slope_s  =>  wrk_1d_1 (1:jpij)
 
       !---------------------------------------
       ! Vertically constant, constant in time
       !---------------------------------------
-
-      IF ( num_sal .EQ. 1 ) THEN
-
-         s_i_b(:,:) = bulk_sal
-
-      ENDIF
+      IF( num_sal == 1 )   s_i_b(:,:) = bulk_sal
 
       !------------------------------------------------------
@@ -665,19 +457,15 @@
       !------------------------------------------------------
 
-      IF ( ( num_sal .EQ. 2 ) .OR. ( num_sal .EQ. 4 ) ) THEN
-
-         ! Slope of the linear profile zs_zero
-         !-------------------------------------
-!CDIR NOVERRCHK
-         DO ji = kideb, kiut 
-            z_slope_s(ji) = 2.0 * sm_i_b(ji) / MAX( 0.01      &
-               , ht_i_b(ji) )
-         END DO ! ji
+      IF(  num_sal == 2  .OR.  num_sal == 4  ) THEN
+         !
+         DO ji = kideb, kiut          ! Slope of the linear profile zs_zero
+            z_slope_s(ji) = 2._wp * sm_i_b(ji) / MAX( 0.01 , ht_i_b(ji) )
+         END DO
 
          ! Weighting factor between zs_zero and zs_inf
          !---------------------------------------------
-         dummy_fac0 = 1. / ( ( s_i_0 - s_i_1 ) )
+         dummy_fac0 = 1._wp / ( s_i_0 - s_i_1 )
          dummy_fac1 = s_i_1 / ( s_i_1 - s_i_0 )
-         dummy_fac2 = 1. / nlay_i
+         dummy_fac2 = 1._wp / REAL(nlay_i,wp)
 
 !CDIR NOVERRCHK
@@ -685,26 +473,18 @@
 !CDIR NOVERRCHK
             DO ji = kideb, kiut
-               zji    =  MOD( npb(ji) - 1, jpi ) + 1
-               zjj    =  ( npb(ji) - 1 ) / jpi + 1
-               zalpha = 0.0
+               zji =  MOD( npb(ji) - 1 , jpi ) + 1
+               zjj =     ( npb(ji) - 1 ) / jpi + 1
                ! zind0 = 1 if sm_i le s_i_0 and 0 otherwise
-               zind0  = MAX( 0.0   , SIGN( 1.0  , s_i_0 - sm_i_b(ji) ) ) 
+               zind0  = MAX( 0._wp , SIGN( 1._wp  , s_i_0 - sm_i_b(ji) ) ) 
                ! zind01 = 1 if sm_i is between s_i_0 and s_i_1 and 0 othws 
-               zind01 = ( 1.0 - zind0 ) *                                  &
-                  MAX( 0.0   , SIGN( 1.0  , s_i_1 - sm_i_b(ji) ) ) 
+               zind01 = ( 1._wp - zind0 ) * MAX( 0._wp , SIGN( 1._wp , s_i_1 - sm_i_b(ji) ) ) 
                ! if 2.sm_i GE sss_m then zindbal = 1
-               zindbal = MAX( 0.0 , SIGN( 1.0 , 2. * sm_i_b(ji) -      &
-                  sss_m(zji,zjj) ) )
-
-               zalpha = zind0  * 1.0                                       &
-                  + zind01 * ( sm_i_b(ji) * dummy_fac0 +           &
-                  dummy_fac1 )
-               zalpha = zalpha * ( 1.0 - zindbal )
-
-               zs_zero(ji,jk) = z_slope_s(ji) * ( jk - 1./2. ) * &
-                  ht_i_b(ji) * dummy_fac2
+               zindbal = MAX( 0._wp , SIGN( 1._wp , 2._wp * sm_i_b(ji) - sss_m(zji,zjj) ) )
+               !
+               zalpha = (  zind0 + zind01 * ( sm_i_b(ji) * dummy_fac0 + dummy_fac1 )  ) * ( 1.0 - zindbal )
+               !
+               zs_zero = z_slope_s(ji) * ( REAL(jk,wp) - 0.5_wp ) * ht_i_b(ji) * dummy_fac2
                ! weighting the profile
-               s_i_b(ji,jk) = zalpha * zs_zero(ji,jk) +       &
-                  ( 1.0 - zalpha ) * sm_i_b(ji)
+               s_i_b(ji,jk) = zalpha * zs_zero + ( 1._wp - zalpha ) * sm_i_b(ji)
             END DO ! ji
          END DO ! jk
@@ -715,31 +495,28 @@
       ! Vertically varying salinity profile, constant in time
       !-------------------------------------------------------
-      ! Schwarzacher (1959) multiyear salinity profile (mean = 2.30)
-
-      IF ( num_sal .EQ. 3 ) THEN
-
-         sm_i_b(:) = 2.30
-
-!CDIR NOVERRCHK
-         DO ji = kideb, kiut
-!CDIR NOVERRCHK
-            DO jk = 1, nlay_i
-               zargtemp  = ( jk - 0.5 ) / nlay_i
-               s_i_b(ji,jk)  =  1.6 - 1.6*cos(3.14169265*(zargtemp**(0.407/ &
-                  (0.573+zargtemp))))
-            END DO ! jk
-         END DO ! ji
-
-      ENDIF ! num_sal
-
+
+      IF( num_sal == 3 ) THEN      ! Schwarzacher (1959) multiyear salinity profile (mean = 2.30)
+         !
+         sm_i_b(:) = 2.30_wp
+         !
+!CDIR NOVERRCHK
+         DO jk = 1, nlay_i
+            zargtemp  = ( REAL(jk,wp) - 0.5_wp ) / REAL(nlay_i,wp)
+            zsal =  1.6_wp * (  1._wp - COS( rpi * zargtemp**(0.407_wp/(0.573_wp+zargtemp)) )  )
+            DO ji = kideb, kiut
+               s_i_b(ji,jk) = zsal
+            END DO
+         END DO
+         !
+      ENDIF
+      !
+      IF( wrk_not_released(1, 1) )   CALL ctl_stop( 'lim_var_salprof1d : failed to release workspace arrays' )
+      !
    END SUBROUTINE lim_var_salprof1d
 
-   !===============================================================================
-
 #else
-   !!======================================================================
-   !!                       ***  MODULE limvar  ***
-   !!                          no sea ice model
-   !!======================================================================
+   !!----------------------------------------------------------------------
+   !!   Default option         Dummy module          NO  LIM3 sea-ice model
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE lim_var_agg          ! Empty routines
@@ -755,5 +532,6 @@
    SUBROUTINE lim_var_salprof1d    ! Emtpy routines
    END SUBROUTINE lim_var_salprof1d
-
 #endif
+
+   !!======================================================================
 END MODULE limvar
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90	(revision 2715)
@@ -15,51 +15,43 @@
    USE phycst
    USE dom_oce
-   USE in_out_manager
    USE sbc_oce         ! Surface boundary condition: ocean fields
    USE sbc_ice         ! Surface boundary condition: ice fields
    USE dom_ice
    USE ice
+   USE limvar
+   USE in_out_manager
    USE lbclnk
+   USE lib_mpp         ! MPP library
    USE par_ice
-   USE limvar
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
    PUBLIC lim_wri        ! routine called by lim_step.F90
 
-   !! * Module variables
-   INTEGER, PARAMETER ::   &  !:
-      jpnoumax = 40             !: maximum number of variable for ice output
-   INTEGER  ::                                &
-      noumef          ,                       &  ! number of fields
-      noumefa         ,                       &  ! number of additional fields
-      add_diag_swi    ,                       &  ! additional diagnostics
-      nz                                         ! dimension for the itd field
-
-   REAL(wp)           , DIMENSION(jpnoumax) ::  &
-      cmulti          ,                       &  ! multiplicative constant
-      cadd            ,                       &  ! additive constant
-      cmultia         ,                       &  ! multiplicative constant
-      cadda                                      ! additive constant
-   CHARACTER(len = 35), DIMENSION(jpnoumax) ::  &
-      titn, titna                                ! title of the field
-   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::  &
-      nam, nama                                  ! name of the field
-   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::  &
-      uni, unia                                  ! unit of the field
-   INTEGER            , DIMENSION(jpnoumax) ::  &
-      nc, nca                                    ! switch for saving field ( = 1 ) or not ( = 0 )
-
-   REAL(wp)  ::            &  ! constant values
-      epsi16 = 1e-16   ,  &
-      zzero  = 0.e0     ,  &
-      zone   = 1.e0
+   INTEGER, PARAMETER ::   jpnoumax = 40   !: maximum number of variable for ice output
+   
+   INTEGER  ::   noumef             ! number of fields
+   INTEGER  ::   noumefa            ! number of additional fields
+   INTEGER  ::   add_diag_swi       ! additional diagnostics
+   INTEGER  ::   nz                                         ! dimension for the itd field
+
+   REAL(wp) , DIMENSION(jpnoumax) ::   cmulti         ! multiplicative constant
+   REAL(wp) , DIMENSION(jpnoumax) ::   cadd           ! additive constant
+   REAL(wp) , DIMENSION(jpnoumax) ::   cmultia        ! multiplicative constant
+   REAL(wp) , DIMENSION(jpnoumax) ::   cadda          ! additive constant
+   CHARACTER(len = 35), DIMENSION(jpnoumax) ::   titn, titna   ! title of the field
+   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   nam , nama    ! name of the field
+   CHARACTER(len = 8 ), DIMENSION(jpnoumax) ::   uni , unia    ! unit of the field
+   INTEGER            , DIMENSION(jpnoumax) ::   nc  , nca     ! switch for saving field ( = 1 ) or not ( = 0 )
+
+   REAL(wp)  ::   epsi16 = 1e-16_wp
+   REAL(wp)  ::   zzero  = 0._wp
+   REAL(wp)  ::   zone   = 1._wp
       
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -79,42 +71,40 @@
       !!  modif : 03/06/98
       !!-------------------------------------------------------------------
-      INTEGER, INTENT(in) :: &
-         kindic                 ! if kindic < 0 there has been an error somewhere
-
-      !! * Local variables
+      USE wrk_nemo, ONLY:   wrk_not_released, wrk_in_use
+      USE wrk_nemo, ONLY:   zfield => wrk_2d_1             ! 2D workspace
+      USE wrk_nemo, ONLY:   wrk_3d_1, wrk_3D_2, wrk_3d_3   ! 3D workspace
+      !
+      INTEGER, INTENT(in) ::   kindic   ! if kindic < 0 there has been an error somewhere
+      !
+      INTEGER ::  ji, jj, jk, jl, jf, ipl ! dummy loop indices
+      INTEGER ::  ierr
       REAL(wp),DIMENSION(1) ::   zdept
-
-      REAL(wp) :: &
-         zsto, zjulian,zout, &
-         zindh,zinda,zindb
-      REAL(wp), DIMENSION(jpi,jpj,jpnoumax) :: &
-         zcmo,               &
-         zcmoa                   ! additional fields
-
-      REAL(wp), DIMENSION(jpi,jpj) ::  &
-         zfield
-
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::  &
-         zmaskitd, zoi, zei
-
-      INTEGER ::  ji, jj, jk, jl, jf, ipl ! dummy loop indices
-
-      CHARACTER(len = 40)  :: &
-         clhstnam, clop, &
-         clhstnama
-
-      INTEGER , SAVE ::      &
-         nice, nhorid, ndim, niter, ndepid
-      INTEGER , SAVE ::      &
-         nicea, nhorida, ndimitd
-      INTEGER , DIMENSION( jpij ) , SAVE ::  &
-         ndex51
-      INTEGER , DIMENSION( jpij*jpl ) , SAVE ::  &
-         ndexitd
+      REAL(wp) ::  zsto, zjulian, zout, zindh, zinda, zindb
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zcmo, zcmoa   ! additional fields
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zmaskitd, zoi, zei
+
+      CHARACTER(len = 40) ::   clhstnam, clop, clhstnama
+
+      INTEGER , SAVE ::   nice, nhorid, ndim, niter, ndepid
+      INTEGER , SAVE ::   nicea, nhorida, ndimitd
+      INTEGER , ALLOCATABLE, DIMENSION(:), SAVE ::   ndex51
+      INTEGER , ALLOCATABLE, DIMENSION(:), SAVE ::   ndexitd
       !!-------------------------------------------------------------------
 
       ipl = jpl
 
-      IF ( numit == nstart ) THEN 
+      zcmo     => wrk_3d_1(:,:,1:jpnoumax)
+      zcmoa    => wrk_3d_2(:,:,1:jpnoumax)
+      zmaskitd => wrk_3d_2(:,:,1:jpl)
+      zoi      => wrk_3d_2(:,:,1:jpl)
+      zei      => wrk_3d_2(:,:,1:jpl)
+
+
+      IF( numit == nstart ) THEN 
+
+         ALLOCATE( ndex51(jpij) , ndexitd(jpij*jpl) , STAT=ierr )
+         IF( ierr /= 0 ) THEN
+            CALL ctl_stop( 'lim_wri : unable to allocate standard arrays' )   ;   RETURN
+         ENDIF
 
          CALL lim_wri_init 
@@ -209,6 +199,6 @@
 
       !-- calculs des valeurs instantanees
-      zcmo( 1:jpi, 1:jpj, 1:jpnoumax ) = 0.0 
-      zcmoa( 1:jpi, 1:jpj, 1:jpnoumax ) = 0.0 
+      zcmo ( 1:jpi, 1:jpj, 1:jpnoumax ) = 0._wp
+      zcmoa( 1:jpi, 1:jpj, 1:jpnoumax ) = 0._wp
 
       DO jl = 1, jpl
@@ -233,23 +223,15 @@
 
             zcmo(ji,jj,1)  = at_i(ji,jj)
-            zcmo(ji,jj,2)  = vt_i(ji,jj)/MAX(at_i(ji,jj),epsi16)*zinda
-            zcmo(ji,jj,3)  = vt_s(ji,jj)/MAX(at_i(ji,jj),epsi16)*zinda
-            zcmo(ji,jj,4)  = diag_bot_gr(ji,jj) * &
-               86400.0 * zinda !Bottom thermodynamic ice production
-            zcmo(ji,jj,5)  = diag_dyn_gr(ji,jj) * &
-               86400.0 * zinda !Dynamic ice production (rid/raft)
-            zcmo(ji,jj,22) = diag_lat_gr(ji,jj) * &
-               86400.0 * zinda !Lateral thermodynamic ice production
-            zcmo(ji,jj,23) = diag_sni_gr(ji,jj) * &
-               86400.0 * zinda !Snow ice production ice production
+            zcmo(ji,jj,2)  = vt_i(ji,jj) / MAX( at_i(ji,jj), epsi16 ) * zinda
+            zcmo(ji,jj,3)  = vt_s(ji,jj) / MAX( at_i(ji,jj), epsi16 ) * zinda
+            zcmo(ji,jj,4)  = diag_bot_gr(ji,jj) * 86400.0 * zinda    ! Bottom thermodynamic ice production
+            zcmo(ji,jj,5)  = diag_dyn_gr(ji,jj) * 86400.0 * zinda    ! Dynamic ice production (rid/raft)
+            zcmo(ji,jj,22) = diag_lat_gr(ji,jj) * 86400.0 * zinda    ! Lateral thermodynamic ice production
+            zcmo(ji,jj,23) = diag_sni_gr(ji,jj) * 86400.0 * zinda    ! Snow ice production ice production
             zcmo(ji,jj,24) = tm_i(ji,jj) - rtt
 
             zcmo(ji,jj,6)  = fbif  (ji,jj)
-            zcmo(ji,jj,7)  = zindb * (  u_ice(ji,jj  ) * tmu(ji,jj)        &
-               &                                + u_ice(ji-1,jj) * tmu(ji-1,jj) )    &
-               &                     / 2.0 
-            zcmo(ji,jj,8)  = zindb * (  v_ice(ji,jj  ) * tmv(ji,jj)        &
-               &                                + v_ice(ji,jj-1) * tmv(ji,jj-1) )    &
-               &                     / 2.0
+            zcmo(ji,jj,7)  = zindb * (  u_ice(ji,jj) * tmu(ji,jj) + u_ice(ji-1,jj) * tmu(ji-1,jj) ) * 0.5_wp
+            zcmo(ji,jj,8)  = zindb * (  v_ice(ji,jj) * tmv(ji,jj) + v_ice(ji,jj-1) * tmv(ji,jj-1) ) * 0.5_wp
             zcmo(ji,jj,9)  = sst_m(ji,jj)
             zcmo(ji,jj,10) = sss_m(ji,jj)
@@ -261,6 +243,6 @@
             zcmo(ji,jj,15) = utau_ice(ji,jj)
             zcmo(ji,jj,16) = vtau_ice(ji,jj)
-            zcmo(ji,jj,17) = zcmo(ji,jj,17) + (1.0-at_i(ji,jj))*qsr(ji,jj)
-            zcmo(ji,jj,18) = zcmo(ji,jj,18) + (1.0-at_i(ji,jj))*qns(ji,jj)
+            zcmo(ji,jj,17) = zcmo(ji,jj,17) + ( 1._wp - at_i(ji,jj) ) * qsr(ji,jj)
+            zcmo(ji,jj,18) = zcmo(ji,jj,18) + ( 1._wp - at_i(ji,jj) ) * qns(ji,jj)
             zcmo(ji,jj,19) = sprecip(ji,jj)
             zcmo(ji,jj,20) = smt_i(ji,jj)
@@ -274,10 +256,7 @@
             zcmo(ji,jj,31) = hicol(ji,jj)
             zcmo(ji,jj,32) = strength(ji,jj)
-            zcmo(ji,jj,33) = SQRT( zcmo(ji,jj,7)*zcmo(ji,jj,7) + &
-               zcmo(ji,jj,8)*zcmo(ji,jj,8) )
-            zcmo(ji,jj,34) = diag_sur_me(ji,jj) * &
-               86400.0 * zinda ! Surface melt
-            zcmo(ji,jj,35) = diag_bot_me(ji,jj) * &
-               86400.0 * zinda ! Bottom melt
+            zcmo(ji,jj,33) = SQRT(  zcmo(ji,jj,7)*zcmo(ji,jj,7) + zcmo(ji,jj,8)*zcmo(ji,jj,8)  )
+            zcmo(ji,jj,34) = diag_sur_me(ji,jj) * 86400.0 * zinda    ! Surface melt
+            zcmo(ji,jj,35) = diag_bot_me(ji,jj) * 86400.0 * zinda    ! Bottom melt
             zcmo(ji,jj,36) = divu_i(ji,jj)
             zcmo(ji,jj,37) = shear_i(ji,jj)
@@ -290,16 +269,11 @@
       niter = niter + 1
       DO jf = 1 , noumef
-         DO jj = 1 , jpj
-            DO ji = 1 , jpi
-               zfield(ji,jj) = zcmo(ji,jj,jf) * cmulti(jf) + cadd(jf)
-            END DO
-         END DO
-
-         IF ( jf == 7  .OR. jf == 8  .OR. jf == 15 .OR. jf == 16 ) THEN 
-            CALL lbc_lnk( zfield, 'T', -1. )
-         ELSE 
-            CALL lbc_lnk( zfield, 'T',  1. )
+         !
+         zfield(:,:) = zcmo(:,:,jf) * cmulti(jf) + cadd(jf)
+         !
+         IF( jf == 7  .OR. jf == 8  .OR. jf == 15 .OR. jf == 16 ) THEN   ;   CALL lbc_lnk( zfield, 'T', -1. )
+         ELSE                                                            ;   CALL lbc_lnk( zfield, 'T',  1. )
          ENDIF
-
+         !
          IF( ln_nicep ) THEN 
             WRITE(numout,*)
@@ -307,9 +281,9 @@
             WRITE(numout,*) nc(jf), nice, nam(jf), niter, ndim
          ENDIF
-         IF ( nc(jf) == 1 ) CALL histwrite( nice, nam(jf), niter, zfield, ndim, ndex51 )
-
+         IF( nc(jf) == 1 ) CALL histwrite( nice, nam(jf), niter, zfield, ndim, ndex51 )
+         !
       END DO
 
-      IF ( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
+      IF( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
          IF( lwp) WRITE(numout,*) ' Closing the icemod file '
          CALL histclo( nice )
@@ -319,5 +293,5 @@
       ! Thickness distribution file
       !-----------------------------
-      IF ( add_diag_swi .EQ. 1 ) THEN
+      IF( add_diag_swi == 1 ) THEN
 
          DO jl = 1, jpl 
@@ -334,6 +308,5 @@
                DO ji = 1, jpi
                   zinda = MAX( zzero , SIGN( zone , a_i(ji,jj,jl) - 1.0e-6 ) )
-                  zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , 1.0e-6 ) * &
-                     zinda
+                  zoi(ji,jj,jl) = oa_i(ji,jj,jl)  / MAX( a_i(ji,jj,jl) , 1.0e-6 ) * zinda
                END DO
             END DO
@@ -341,5 +314,5 @@
 
          ! Compute brine volume
-         zei(:,:,:) = 0.0
+         zei(:,:,:) = 0._wp
          DO jl = 1, jpl 
             DO jk = 1, nlay_i
@@ -370,9 +343,9 @@
          !     not yet implemented
 
-         IF ( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
+         IF( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
             IF(lwp) WRITE(numout,*) ' Closing the icemod file '
             CALL histclo( nicea ) 
          ENDIF
-
+         !
       ENDIF
 
@@ -390,9 +363,5 @@
       !!
       !! ** input   :   Namelist namicewri
-      !!
-      !! history :
-      !!  8.5  ! 03-08 (C. Ethe) original code
-      !!-------------------------------------------------------------------
-      !! * Local declarations
+      !!-------------------------------------------------------------------
       INTEGER ::   nf      ! ???
 
@@ -416,5 +385,5 @@
 
       TYPE(FIELD) , DIMENSION(jpnoumax) :: zfield
-
+      !
       NAMELIST/namiceout/ noumef, &
          field_1 , field_2 , field_3 , field_4 , field_5 , field_6 ,   &
@@ -427,7 +396,6 @@
       !!-------------------------------------------------------------------
 
-      ! Read Namelist namicewri
-      REWIND ( numnam_ice )
-      READ   ( numnam_ice  , namiceout )
+      REWIND( numnam_ice )                ! Read Namelist namicewri
+      READ  ( numnam_ice  , namiceout )
 
       zfield(1)  = field_1
@@ -478,5 +446,5 @@
       END DO
 
-      IF(lwp) THEN
+      IF(lwp) THEN                        ! control print
          WRITE(numout,*)
          WRITE(numout,*) 'lim_wri_init : Ice parameters for outputs'
@@ -486,10 +454,10 @@
             &            '    multiplicative constant       additive constant '
          DO nf = 1 , noumef         
-            WRITE(numout,*) '   ', titn(nf), '   ', nam(nf),'      ', uni(nf),'  ', nc(nf),'        ', cmulti(nf),   &
-               '        ', cadd(nf)
+            WRITE(numout,*) '   ', titn(nf), '   '    , nam   (nf), '      '  , uni (nf),   &
+               &            '  ' , nc  (nf),'        ', cmulti(nf), '        ', cadd(nf)
          END DO
          WRITE(numout,*) ' add_diag_swi ', add_diag_swi
       ENDIF
-
+      !
    END SUBROUTINE lim_wri_init
 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri_dimg.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri_dimg.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/limwri_dimg.h90	(revision 2715)
@@ -14,18 +14,13 @@
    !!  modif : 03/06/98
    !!-------------------------------------------------------------------
-   !! * Local variables
    USE  diawri, ONLY : dia_wri_dimg
    REAL(wp),DIMENSION(1) ::   zdept
 
-   REAL(wp) :: &
-      zsto, zsec, zjulian,zout, &
-      zindh,zinda,zindb,  &
-      ztmu
-   REAL(wp), DIMENSION(jpi,jpj,jpnoumax) :: &
-      zcmo
-   REAL(wp), DIMENSION(jpi,jpj) ::  &
-      zfield
-   INTEGER, SAVE :: nmoyice, &  !: counter for averaging
-      &             nwf         !: number of fields to write on disk
+   REAL(wp) ::   zsto, zsec, zjulian,zout, &
+   REAL(wp) ::   zindh,zinda,zindb, ztmu
+   REAL(wp), DIMENSION(jpi,jpj,jpnoumax) ::   zcmo
+   REAL(wp), DIMENSION(jpi,jpj) ::   zfield
+   INTEGER, SAVE ::   nmoyice   !: counter for averaging
+   INTEGER, SAVE ::   nwf       !: number of fields to write on disk
    INTEGER, SAVE,DIMENSION (:), ALLOCATABLE  :: nsubindex   !: subindex to be saved
    ! according to namelist
@@ -43,8 +38,6 @@
 
 
-   INTEGER , SAVE ::      &
-      nice, nhorid, ndim, niter, ndepid
-   INTEGER , DIMENSION( jpij ) , SAVE ::  &
-      ndex51  
+   INTEGER , SAVE ::   nice, nhorid, ndim, niter, ndepid
+   INTEGER , DIMENSION( jpij ) , SAVE ::   ndex51  
    !!-------------------------------------------------------------------
    IF ( numit == nstart ) THEN 
Index: /trunk/NEMOGCM/NEMO/LIM_SRC_3/thd_ice.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/LIM_SRC_3/thd_ice.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/LIM_SRC_3/thd_ice.F90	(revision 2715)
@@ -4,43 +4,39 @@
    !! LIM sea-ice :   Ice thermodynamics in 1D
    !!=====================================================================
-   !! History :
-   !!   2.0  !  02-11  (C. Ethe)  F90: Free form and module
+   !! History :  3.0  !  2002-11  (C. Ethe)  F90: Free form and module
    !!----------------------------------------------------------------------
-   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-   !! * Modules used
-   USE par_ice
+   USE par_ice        ! LIM-3 parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC thd_ice_alloc ! Routine called by nemogcm.F90
 
    !!---------------------------
    !! * Share Module variables
    !!---------------------------
-   REAL(wp) , PUBLIC ::   & !!! ** ice-thermo namelist (namicethd) **
-      hmelt   = -0.15  ,  &  !: maximum melting at the bottom; active only for
-                                !: one category
-      hicmin  = 0.2    ,  &  !: (REMOVE)
-      hiclim  = 0.05   ,  &  !: minimum ice thickness
-      amax    = 0.999  ,  &  !: maximum lead fraction
-      sbeta   = 1.0    ,  &  !: numerical scheme for diffusion in ice  (REMOVE)
-      parlat  = 0.0    ,  &  !: (REMOVE)
-      hakspl  = 0.5    ,  &  !: (REMOVE)
-      hibspl  = 0.5    ,  &  !: (REMOVE)
-      exld    = 2.0    ,  &  !: (REMOVE)
-      hakdif  = 1.0    ,  &  !: (REMOVE)
-      thth    = 0.2    ,  &  !: (REMOVE)
-      hnzst   = 0.1    ,  &  !: thick. of the surf. layer in temp. comp.
-      parsub  = 1.0    ,  &  !: switch for snow sublimation or not
-      alphs   = 1.0    ,  &  !: coef. for snow density when snow-ice formation
-      fraz_swi= 1.0    ,  &  !: use of frazil ice collection in function of wind (1.0) or not (0.0)
-      maxfrazb= 0.7    ,  &  !: maximum portion of frazil ice collecting at the ice bottom
-      vfrazb  = 0.41667,  &  !: threshold drift speed for collection of bottom frazil ice
-      Cfrazb  = 5.0          !: squeezing coefficient for collection of bottom frazil ice
-
-   REAL(wp), PUBLIC, DIMENSION(2)  ::  &  !:   
-      hiccrit = (/0.3,0.3/)  !: ice th. for lateral accretion in the NH (SH) (m)
+   !                                         !!! ** ice-thermo namelist (namicethd) **
+   REAL(wp), PUBLIC ::   hmelt   = -0.15     !: maximum melting at the bottom; active only for one category
+   REAL(wp), PUBLIC ::   hicmin  = 0.2       !: (REMOVE)
+   REAL(wp), PUBLIC ::   hiclim  = 0.05      !: minimum ice thickness
+   REAL(wp), PUBLIC ::   amax    = 0.999     !: maximum lead fraction
+   REAL(wp), PUBLIC ::   sbeta   = 1.0       !: numerical scheme for diffusion in ice  (REMOVE)
+   REAL(wp), PUBLIC ::   parlat  = 0.0       !: (REMOVE)
+   REAL(wp), PUBLIC ::   hakspl  = 0.5       !: (REMOVE)
+   REAL(wp), PUBLIC ::   hibspl  = 0.5       !: (REMOVE)
+   REAL(wp), PUBLIC ::   exld    = 2.0       !: (REMOVE)
+   REAL(wp), PUBLIC ::   hakdif  = 1.0       !: (REMOVE)
+   REAL(wp), PUBLIC ::   thth    = 0.2       !: (REMOVE)
+   REAL(wp), PUBLIC ::   hnzst   = 0.1       !: thick. of the surf. layer in temp. comp.
+   REAL(wp), PUBLIC ::   parsub  = 1.0       !: switch for snow sublimation or not
+   REAL(wp), PUBLIC ::   alphs   = 1.0       !: coef. for snow density when snow-ice formation
+   REAL(wp), PUBLIC ::   fraz_swi= 1.0       !: use of frazil ice collection in function of wind (1.0) or not (0.0)
+   REAL(wp), PUBLIC ::   maxfrazb= 0.7       !: maximum portion of frazil ice collecting at the ice bottom
+   REAL(wp), PUBLIC ::   vfrazb  = 0.41667   !: threshold drift speed for collection of bottom frazil ice
+   REAL(wp), PUBLIC ::   Cfrazb  = 5.0       !: squeezing coefficient for collection of bottom frazil ice
+
+   REAL(wp), PUBLIC, DIMENSION(2) ::   hiccrit = (/0.3,0.3/)  !: ice th. for lateral accretion in the NH (SH) (m)
 
    !!-----------------------------
@@ -51,113 +47,157 @@
    !: are the variables corresponding to 2d vectors
 
-   INTEGER , PUBLIC, DIMENSION(jpij) ::   &  !:
-      npb     ,   &   !: number of points where computations has to be done
-      npac            !: correspondance between the points (lateral accretion)
-
-   REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !: 
-      qldif_1d    ,     &  !: corresponding to the 2D var  qldif
-      qcmif_1d    ,     &  !: corresponding to the 2D var  qcmif
-      fstbif_1d   ,     &  !:    "                  "      fstric
-      fltbif_1d   ,     &  !:    "                  "      ffltbif
-      fscbq_1d    ,     &  !:    "                  "      fscmcbq
-      qsr_ice_1d  ,     &  !:    "                  "      qsr_ice
-      fr1_i0_1d   ,     &  !:    "                  "      fr1_i0
-      fr2_i0_1d   ,     &  !:    "                  "      fr2_i0
-      qnsr_ice_1d ,     &  !:    "                  "      qns_ice
-      qfvbq_1d    ,     &  !:    "                  "      qfvbq
-      t_bo_b               !:    "                  "      t_bo
-
-   REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !: 
-      sprecip_1d  ,     &  !:    "                  "      sprecip
-      frld_1d     ,     &  !:    "                  "      frld
-      at_i_b      ,     &  !:    "                  "      frld
-      fbif_1d     ,     &  !:    "                  "      fbif
-      rdmicif_1d  ,     &  !:    "                  "      rdmicif
-      rdmsnif_1d  ,     &  !:    "                  "      rdmsnif
-      qlbbq_1d    ,     &  !:    "                  "      qlbsbq
-      dmgwi_1d    ,     &  !:    "                  "      dmgwi
-      dvsbq_1d    ,     &  !:    "                  "      rdvosif
-      dvbbq_1d    ,     &  !:    "                  "      rdvobif
-      dvlbq_1d    ,     &  !:    "                  "      rdvolif
-      dvnbq_1d    ,     &  !:    "                  "      rdvolif
-      dqns_ice_1d ,     &  !:    "                  "      dqns_ice
-      qla_ice_1d  ,     &  !:    "                  "      qla_ice
-      dqla_ice_1d ,     &  !:    "                  "      dqla_ice
-                                ! to reintegrate longwave flux inside the ice thermodynamics
-!!sm: not used      qtur_ice_1d ,     &  !:    "                  "      qtur_ice
-!!sm: not used      dqtu_ice_1d ,     &  !:    "                  "      dqtu_ice
-!!sm: not used      catm_ice_1d ,     &  !:    "                  "      catm_ice
-      tatm_ice_1d ,     &  !:    "                  "      tatm_ice
-!!sm: not used      evsq_ice_1d ,     &  !:    "                  "      evsq_ice
-!!sm: not used      sbud_ice_1d ,     &  !:    "                  "      sbud_ice
-      fsup        ,     &  !:    Energy flux sent from bottom to lateral ablation if |dhb|> 0.15 m
-      focea       ,     &  !:    Remaining energy in case of total ablation
-      i0          ,     &  !:    fraction of radiation transmitted to the ice interior
-      old_ht_i_b  ,     &  !:    Ice thickness at the beginnning of the time step [m]
-      old_ht_s_b  ,     &  !:    Snow thickness at the beginning of the time step [m]
-      fsbri_1d    ,     &  !:    Salt flux due to brine drainage
-      fhbri_1d    ,     &  !:    Heat flux due to brine drainage
-      fseqv_1d    ,     &  !:    Equivalent Salt flux due to ice growth/decay
-      dsm_i_fl_1d ,     &  !:    Ice salinity variations due to flushing
-      dsm_i_gd_1d ,     &  !:    Ice salinity variations due to gravity drainage
-      dsm_i_se_1d ,     &  !:    Ice salinity variations due to basal salt entrapment
-!!sm: not used      dsm_i_la_1d ,     &  !:    Ice salinity variations due to lateral accretion    
-      dsm_i_si_1d ,     &  !:    Ice salinity variations due to lateral accretion    
-      hicol_b              !:    Ice collection thickness accumulated in fleads
-
-   REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !:
-      t_su_b      ,     &  !:    "                  "      t_su
-      a_i_b       ,     &  !:                              a_i
-      ht_i_b      ,     &  !:    "                  "      ht_s
-      ht_s_b      ,     &  !:    "                  "      ht_i
-      fc_su       ,     &  !:    Surface Conduction flux 
-      fc_bo_i     ,     &  !:    Bottom  Conduction flux 
-      dh_s_tot    ,     &  !:    Snow accretion/ablation        [m]
-      dh_i_surf   ,     &  !:    Ice surface accretion/ablation [m]
-      dh_i_bott   ,     &  !:    Ice bottom accretion/ablation  [m]
-      dh_snowice  ,     &  !:    Snow ice formation             [m of ice]
-      sm_i_b      ,     &  !:    Ice bulk salinity [ppt]
-      s_i_new     ,     &  !:    Salinity of new ice at the bottom
-      s_snowice   ,     &  !:    Salinity of new snow ice on top of the ice
-      o_i_b                !:    Ice age                        [days]
-
-   REAL(wp), PUBLIC, DIMENSION(jpij,nlay_s) ::   &  !:
-      t_s_b              !: corresponding to the 2D var  t_s
-   REAL(wp), PUBLIC, DIMENSION(jpij,jkmax) ::   &  !:
-      t_i_b,            &  !: corresponding to the 2D var  t_i
-      s_i_b,            &  !: profiled ice salinity
-      q_i_b,            &  !:    Ice  enthalpy per unit volume
-      q_s_b                !:    Snow enthalpy per unit volume
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   npb    !: number of points where computations has to be done
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   npac   !: correspondance between points (lateral accretion)
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qldif_1d      !: <==> the 2D  qldif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qcmif_1d      !: <==> the 2D  qcmif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fstbif_1d     !: <==> the 2D  fstric
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fltbif_1d     !: <==> the 2D  ffltbif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fscbq_1d      !: <==> the 2D  fscmcbq
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qsr_ice_1d    !: <==> the 2D  qsr_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fr1_i0_1d     !: <==> the 2D  fr1_i0
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fr2_i0_1d     !: <==> the 2D  fr2_i0
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qnsr_ice_1d   !: <==> the 2D  qns_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qfvbq_1d      !: <==> the 2D  qfvbq
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   t_bo_b        !: <==> the 2D  t_bo
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   sprecip_1d    !: <==> the 2D  sprecip
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   frld_1d       !: <==> the 2D  frld
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   at_i_b        !: <==> the 2D  frld
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fbif_1d       !: <==> the 2D  fbif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   rdmicif_1d    !: <==> the 2D  rdmicif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   rdmsnif_1d    !: <==> the 2D  rdmsnif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qlbbq_1d      !: <==> the 2D  qlbsbq
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dmgwi_1d      !: <==> the 2D  dmgwi
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dvsbq_1d      !: <==> the 2D  rdvosif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dvbbq_1d      !: <==> the 2D  rdvobif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dvlbq_1d      !: <==> the 2D  rdvolif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dvnbq_1d      !: <==> the 2D  rdvolif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dqns_ice_1d   !: <==> the 2D  dqns_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   qla_ice_1d    !: <==> the 2D  qla_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dqla_ice_1d   !: <==> the 2D  dqla_ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   tatm_ice_1d   !: <==> the 2D  tatm_ice
+   !                                                     ! to reintegrate longwave flux inside the ice thermodynamics
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fsup          !: Energy flux sent from bottom to lateral ablation if |dhb|> 0.15 m
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   focea         !: Remaining energy in case of total ablation
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   i0            !: fraction of radiation transmitted to the ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   old_ht_i_b    !: Ice thickness at the beginnning of the time step [m]
+    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::  old_ht_s_b    !: Snow thickness at the beginning of the time step [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fsbri_1d      !: Salt flux due to brine drainage
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fhbri_1d      !: Heat flux due to brine drainage
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fseqv_1d      !: Equivalent Salt flux due to ice growth/decay
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dsm_i_fl_1d   !: Ice salinity variations due to flushing
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dsm_i_gd_1d   !: Ice salinity variations due to gravity drainage
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dsm_i_se_1d   !: Ice salinity variations due to basal salt entrapment
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dsm_i_si_1d   !: Ice salinity variations due to lateral accretion    
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   hicol_b       !: Ice collection thickness accumulated in fleads
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   t_su_b      !: <==> the 2D  t_su
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   a_i_b       !: <==> the 2D  a_i
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ht_i_b      !: <==> the 2D  ht_s
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ht_s_b      !: <==> the 2D  ht_i
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fc_su       !: Surface Conduction flux 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   fc_bo_i     !: Bottom  Conduction flux 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dh_s_tot    !: Snow accretion/ablation        [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dh_i_surf   !: Ice surface accretion/ablation [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dh_i_bott   !: Ice bottom accretion/ablation  [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   dh_snowice  !: Snow ice formation             [m of ice]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   sm_i_b      !: Ice bulk salinity [ppt]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   s_i_new     !: Salinity of new ice at the bottom
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   s_snowice   !: Salinity of new snow ice on top of the ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   o_i_b       !: Ice age                        [days]
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   t_s_b   !: corresponding to the 2D var  t_s
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   t_i_b   !: corresponding to the 2D var  t_i
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   s_i_b   !: profiled ice salinity
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   q_i_b   !:    Ice  enthalpy per unit volume
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   q_s_b   !:    Snow enthalpy per unit volume
 
    ! Clean the following ...
    ! These variables are coded for conservation checks
-   REAL(wp), PUBLIC, DIMENSION(jpij,jpl)    ::   &  !
-      qt_i_in   ,           &  !: ice energy summed over categories (initial)
-      qt_i_fin  ,           &  !: ice energy summed over categories (final)
-      qt_s_in, qt_s_fin  ,  &  !: snow energy summed over categories
-      dq_i, sum_fluxq    ,  &  !: increment of energy, sum of fluxes
-      fatm, foce,           &  !: atmospheric, oceanic, heat flux
-      cons_error, surf_error   !: conservation, surface error
-
-   REAL(wp), PUBLIC, DIMENSION(jpij,jkmax)::   &  !:  goes to trash
-      q_i_layer_in,         &
-      q_i_layer_fin,        &
-      dq_i_layer, radab
-
-   REAL(wp), PUBLIC, DIMENSION(jpij) ::   &  !:
-      ftotal_in  ,          &  !: initial total heat flux
-      ftotal_fin               !: final total heat flux
-
-   REAL(wp), PUBLIC, DIMENSION(jpij,0:nlay_s) ::   &  !:
-      fc_s
-   REAL(wp), PUBLIC, DIMENSION(jpij,0:jkmax)  ::   &  !:
-      fc_i
-   REAL(wp), PUBLIC, DIMENSION(jpij,nlay_s) ::   &  !:
-      de_s_lay
-   REAL(wp), PUBLIC, DIMENSION(jpij,jkmax)  ::   &  !:
-      de_i_lay
-   INTEGER , PUBLIC ::                           &
-      jiindex_1d   ! 1D index of debugging point
-
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qt_i_in                  !: ice energy summed over categories (initial)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qt_i_fin                 !: ice energy summed over categories (final)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qt_s_in, qt_s_fin        !: snow energy summed over categories
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dq_i, sum_fluxq          !: increment of energy, sum of fluxes
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fatm, foce               !: atmospheric, oceanic, heat flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   cons_error, surf_error   !: conservation, surface error
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   q_i_layer_in        !: goes to trash
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   q_i_layer_fin       !: goes to trash
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   dq_i_layer, radab   !: goes to trash
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ftotal_in    !: initial total heat flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ftotal_fin   !: final total heat flux
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fc_s
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fc_i
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   de_s_lay
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   de_i_lay
+   
+   INTEGER , PUBLIC ::   jiindex_1d   ! 1D index of debugging point
+
+   !!----------------------------------------------------------------------
+   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   FUNCTION thd_ice_alloc()
+      !!---------------------------------------------------------------------!
+      !!                ***  ROUTINE thd_ice_alloc ***
+      !!---------------------------------------------------------------------!
+      INTEGER ::   thd_ice_alloc   ! return value
+      INTEGER ::   ierr(4)
+      !!---------------------------------------------------------------------!
+
+      ALLOCATE( npb      (jpij) , npac     (jpij),                          &
+         !                                                                  !
+         &      qldif_1d (jpij) , qcmif_1d (jpij) , fstbif_1d  (jpij) ,     &
+         &      fltbif_1d(jpij) , fscbq_1d (jpij) , qsr_ice_1d (jpij) ,     &
+         &      fr1_i0_1d(jpij) , fr2_i0_1d(jpij) , qnsr_ice_1d(jpij) ,     &
+         &      qfvbq_1d (jpij) , t_bo_b   (jpij)                     , STAT=ierr(1) )
+      !
+      ALLOCATE( sprecip_1d (jpij) , frld_1d    (jpij) , at_i_b     (jpij) ,     &
+         &      fbif_1d    (jpij) , rdmicif_1d (jpij) , rdmsnif_1d (jpij) ,     &
+         &      qlbbq_1d   (jpij) , dmgwi_1d   (jpij) , dvsbq_1d   (jpij) ,     &
+         &      dvbbq_1d   (jpij) , dvlbq_1d   (jpij) , dvnbq_1d   (jpij) ,     &
+         &      dqns_ice_1d(jpij) , qla_ice_1d (jpij) , dqla_ice_1d(jpij) ,     &
+         &      tatm_ice_1d(jpij) , fsup       (jpij) , focea      (jpij) ,     &   
+         &      i0         (jpij) , old_ht_i_b (jpij) , old_ht_s_b (jpij) ,     &  
+         &      fsbri_1d   (jpij) , fhbri_1d   (jpij) , fseqv_1d   (jpij) ,     &
+         &      dsm_i_fl_1d(jpij) , dsm_i_gd_1d(jpij) , dsm_i_se_1d(jpij) ,     &     
+         &      dsm_i_si_1d(jpij) , hicol_b    (jpij)                     , STAT=ierr(2) )
+      !
+      ALLOCATE( t_su_b    (jpij) , a_i_b    (jpij) , ht_i_b   (jpij) ,    &   
+         &      ht_s_b    (jpij) , fc_su    (jpij) , fc_bo_i  (jpij) ,    &    
+         &      dh_s_tot  (jpij) , dh_i_surf(jpij) , dh_i_bott(jpij) ,    &    
+         &      dh_snowice(jpij) , sm_i_b   (jpij) , s_i_new  (jpij) ,    &    
+         &      s_snowice (jpij) , o_i_b    (jpij)                   ,    &
+         !                                                                !
+         &      t_s_b(jpij,nlay_s),                                       &
+         !                                                                !
+         &      t_i_b(jpij,jkmax), s_i_b(jpij,jkmax)                ,     &            
+         &      q_i_b(jpij,jkmax), q_s_b(jpij,jkmax)                , STAT=ierr(3))
+      !
+      ALLOCATE( qt_i_in   (jpij,jpl) , qt_i_fin(jpij,jpl) , qt_s_in   (jpij,jpl) ,     &
+         &      qt_s_fin  (jpij,jpl) , dq_i    (jpij,jpl) , sum_fluxq (jpij,jpl) ,     &
+         &      fatm      (jpij,jpl) , foce    (jpij,jpl) , cons_error(jpij,jpl) ,     &
+         &      surf_error(jpij,jpl)                                             ,     &
+         !                                                                             !
+         &      q_i_layer_in(jpij,jkmax) , q_i_layer_fin(jpij,jkmax)             ,     &
+         &      dq_i_layer  (jpij,jkmax) , radab        (jpij,jkmax)             ,     &
+         !                                                                             !
+         &      ftotal_in(jpij), ftotal_fin(jpij)                                ,     &
+         !                                                                             !
+         &      fc_s(jpij,0:nlay_s) , de_s_lay(jpij,nlay_s)                      ,     &
+         &      fc_i(jpij,0:jkmax)  , de_i_lay(jpij,jkmax)                       , STAT=ierr(4) )
+
+      thd_ice_alloc = MAXVAL( ierr )
+
+      IF( thd_ice_alloc /= 0 )   CALL ctl_warn( 'thd_ice_alloc: failed to allocate arrays.' )
+      !
+   END FUNCTION thd_ice_alloc
+   
    !!======================================================================
 END MODULE thd_ice
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_oce.F90	(revision 2715)
@@ -14,11 +14,13 @@
    
    IMPLICIT NONE
-   PUBLIC 
+   PRIVATE 
+
+   PUBLIC agrif_oce_alloc ! routine called by nemo_init in nemogcm.F90
 
    !                                              !!* Namelist namagrif: AGRIF parameters
    LOGICAL , PUBLIC ::   ln_spc_dyn    = .FALSE.   !:
    INTEGER , PUBLIC ::   nn_cln_update = 3         !: update frequency 
-   REAL(wp), PUBLIC ::   rn_sponge_tra = rdt       !: sponge coeff. for tracers
-   REAL(wp), PUBLIC ::   rn_sponge_dyn = rdt       !: sponge coeff. for dynamics
+   REAL(wp), PUBLIC ::   rn_sponge_tra = 2800.     !: sponge coeff. for tracers
+   REAL(wp), PUBLIC ::   rn_sponge_dyn = 2800.     !: sponge coeff. for dynamics
 
    !                                              !!! OLD namelist names
@@ -29,11 +31,29 @@
    LOGICAL , PUBLIC :: spongedoneT = .FALSE.   !: tracer   sponge layer indicator
    LOGICAL , PUBLIC :: spongedoneU = .FALSE.   !: dynamics sponge layer indicator
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   spe1ur, spe2vr ,spbtr2, spe1ur2, spe2vr2, spbtr3   !: ???
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,  DIMENSION(:,:) ::   spe1ur , spe2vr , spbtr2   !: ???
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE,  DIMENSION(:,:) ::   spe1ur2, spe2vr2, spbtr3   !: ???
+   
+   INTEGER :: tn_id, sn_id, tb_id, sb_id, ta_id, sa_id
+   INTEGER :: un_id, vn_id, ua_id, va_id
+   INTEGER :: e1u_id, e2v_id, sshn_id, gcb_id
+   INTEGER :: trn_id, trb_id, tra_id
+
+   !!----------------------------------------------------------------------
+   !! NEMO/NST 3.3.1 , NEMO Consortium (2011)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS 
+
+   INTEGER FUNCTION agrif_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION agrif_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( spe1ur (jpi,jpj) , spe2vr (jpi,jpj) , spbtr2(jpi,jpj) ,      &
+         &      spe1ur2(jpi,jpj) , spe2vr2(jpi,jpj) , spbtr3(jpi,jpj) , STAT = agrif_oce_alloc ) 
+   END FUNCTION agrif_oce_alloc
 
 #endif
-   !!----------------------------------------------------------------------
-   !! NEMO/NST 3.3 , NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE agrif_oce
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_interp.F90	(revision 2715)
@@ -25,4 +25,6 @@
    USE phycst
    USE in_out_manager
+   USE agrif_opa_sponge
+   USE lib_mpp
 
    IMPLICIT NONE
@@ -45,11 +47,20 @@
       !!                  ***  ROUTINE Agrif_Tra  ***
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2
+      !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zrhox , alpha1, alpha2, alpha3
       REAL(wp) ::   alpha4, alpha5, alpha6, alpha7
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zta, zsa   ! 3D workspace
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zta, zsa
       !!----------------------------------------------------------------------
       !
       IF( Agrif_Root() )   RETURN
+
+      zta => wrk_3d_1 ; zsa => wrk_3d_2
+      IF( wrk_in_use(3, 1,2) )THEN
+         CALL ctl_stop('agrif_tra: requested workspace arrays unavailable.')
+         RETURN
+      END IF
 
       Agrif_SpecialValue    = 0.e0
@@ -58,6 +69,6 @@
       zsa(:,:,:) = 0.e0
 
-      CALL Agrif_Bc_variable( zta, tn )
-      CALL Agrif_Bc_variable( zsa, sn )
+      CALL Agrif_Bc_variable( zta, tn_id, procname = interptn )
+      CALL Agrif_Bc_variable( zsa, sn_id, procname = interpsn )
       Agrif_UseSpecialValue = .FALSE.
 
@@ -162,4 +173,8 @@
       ENDIF
       !
+      IF( wrk_not_released(3, 1,2) ) THEN
+         CALL ctl_stop('agrif_tra: failed to release workspace arrays.')
+      ENDIF
+      !
    END SUBROUTINE Agrif_tra
 
@@ -169,4 +184,9 @@
       !!                  ***  ROUTINE Agrif_DYN  ***
       !!----------------------------------------------------------------------  
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_2d_4, wrk_2d_5
+      USE wrk_nemo, ONLY: wrk_2d_6, wrk_2d_7
+      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2
+      !! 
       INTEGER, INTENT(in) ::   kt
       !!
@@ -175,10 +195,17 @@
       REAL(wp) :: z2dt, znugdt
       REAL(wp) :: zrhox, rhoy
-      REAL(wp), DIMENSION(jpi,jpj) :: zua2d, zva2d
-      REAL(wp), DIMENSION(jpi,jpj) :: spgu1,spgv1
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zua, zva
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: zua, zva
+      REAL(wp), POINTER, DIMENSION(:,:) :: spgv1, spgu1, zua2d, zva2d
       !!----------------------------------------------------------------------  
 
       IF( Agrif_Root() )   RETURN
+
+      spgu1  => wrk_2d_4 ; spgv1 => wrk_2d_5
+      zua2d  => wrk_2d_6 ; zva2d => wrk_2d_7
+      zua  => wrk_3d_1 ; zva => wrk_3d_2
+      IF( wrk_in_use(2, 4,5,6,7) .OR. wrk_in_use(3, 1,2) )THEN
+         CALL ctl_stop('agrif_dyn: requested workspace arrays unavailable.')
+         RETURN
+      END IF
 
       zrhox = Agrif_Rhox()
@@ -199,6 +226,6 @@
       zua = 0.
       zva = 0.
-      CALL Agrif_Bc_variable(zua,un,procname=interpu)
-      CALL Agrif_Bc_variable(zva,vn,procname=interpv)
+      CALL Agrif_Bc_variable(zua,un_id,procname=interpu)
+      CALL Agrif_Bc_variable(zva,vn_id,procname=interpv)
       zua2d = 0.
       zva2d = 0.
@@ -206,6 +233,6 @@
       Agrif_SpecialValue=0.
       Agrif_UseSpecialValue = ln_spc_dyn
-      CALL Agrif_Bc_variable(zua2d,e1u,calledweight=1.,procname=interpu2d)
-      CALL Agrif_Bc_variable(zva2d,e2v,calledweight=1.,procname=interpv2d)
+      CALL Agrif_Bc_variable(zua2d,e1u_id,calledweight=1.,procname=interpu2d)
+      CALL Agrif_Bc_variable(zva2d,e2v_id,calledweight=1.,procname=interpv2d)
       Agrif_UseSpecialValue = .FALSE.
 
@@ -492,5 +519,9 @@
 
       ENDIF
-
+      !
+      IF( wrk_not_released(3, 1,2) .OR. wrk_not_released(2, 4,5,6,7)) THEN
+         CALL ctl_stop('agrif_dyn: failed to release workspace arrays.')
+      ENDIF
+      !
    END SUBROUTINE Agrif_dyn
 
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90	(revision 2715)
@@ -27,15 +27,26 @@
       !!---------------------------------------------
 #include "domzgr_substitute.h90"
-
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_2d_1
+      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2
+      USE wrk_nemo, ONLY: wrk_3d_3, wrk_3d_4
+      USE wrk_nemo, ONLY: wrk_3d_7, wrk_3d_6
+      USE wrk_nemo, ONLY: wrk_3d_8
+      !!
       INTEGER :: ji,jj,jk
       INTEGER :: spongearea
       REAL(wp) :: timecoeff
       REAL(wp) :: zta, zsa, zabe1, zabe2, zbtr
-      REAL(wp), DIMENSION(jpi,jpj) :: localviscsponge
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: tbdiff, sbdiff
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztu ,ztv, zsu ,zsv
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  ztab
+      REAL(wp), POINTER, DIMENSION(:,:) :: localviscsponge
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: tbdiff, sbdiff
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztu, zsu, ztv, zsv
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztab
 
 #if defined SPONGE
+      localviscsponge => wrk_2d_1
+      tbdiff => wrk_3d_1 ;sbdiff => wrk_3d_2
+      ztu => wrk_3d_3 ; zsu => wrk_3d_4
+      ztv => wrk_3d_7 ; zsv => wrk_3d_6
+      ztab => wrk_3d_8
 
       timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot()
@@ -44,5 +55,5 @@
       Agrif_UseSpecialValue = .TRUE.
       ztab = 0.e0
-      CALL Agrif_Bc_Variable(ztab, ta,calledweight=timecoeff,procname=interptn)
+      CALL Agrif_Bc_Variable(ztab, ta_id,calledweight=timecoeff,procname=interptn)
       Agrif_UseSpecialValue = .FALSE.
 
@@ -52,9 +63,8 @@
       Agrif_SpecialValue=0.
       Agrif_UseSpecialValue = .TRUE.
-      CALL Agrif_Bc_Variable(ztab, sa,calledweight=timecoeff,procname=interpsn)
+      CALL Agrif_Bc_Variable(ztab, sa_id,calledweight=timecoeff,procname=interpsn)
       Agrif_UseSpecialValue = .FALSE.
 
       sbdiff(:,:,:) = sb(:,:,:) - ztab(:,:,:)
-
 
       spongearea = 2 + 2 * Agrif_irhox()
@@ -164,13 +174,24 @@
       !!---------------------------------------------
 #include "domzgr_substitute.h90"
-
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_2d_1
+      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2
+      USE wrk_nemo, ONLY: wrk_3d_3, wrk_3d_4
+      USE wrk_nemo, ONLY: wrk_3d_5
+      !!
       INTEGER :: ji,jj,jk
       INTEGER :: spongearea
       REAL(wp) :: timecoeff
       REAL(wp) :: ze2u, ze1v, zua, zva, zbtr
-      REAL(wp), DIMENSION(jpi,jpj) :: localviscsponge
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztab, ubdiff, vbdiff,rotdiff,hdivdiff
+      REAL(wp), POINTER, DIMENSION(:,:) :: localviscsponge
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ubdiff, vbdiff
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: rotdiff, hdivdiff
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztab
 
 #if defined SPONGE
+      localviscsponge => wrk_2d_1
+      ubdiff => wrk_3d_1 ; vbdiff => wrk_3d_2
+      rotdiff => wrk_3d_3 ; hdivdiff => wrk_3d_4
+      ztab => wrk_3d_5
 
       timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot()
@@ -179,5 +200,5 @@
       Agrif_UseSpecialValue = ln_spc_dyn
       ztab = 0.e0
-      CALL Agrif_Bc_Variable(ztab, ua,calledweight=timecoeff,procname=interpun)
+      CALL Agrif_Bc_Variable(ztab, ua_id,calledweight=timecoeff,procname=interpun)
       Agrif_UseSpecialValue = .FALSE.
 
@@ -187,5 +208,5 @@
       Agrif_SpecialValue=0.
       Agrif_UseSpecialValue = ln_spc_dyn
-      CALL Agrif_Bc_Variable(ztab, va,calledweight=timecoeff,procname=interpvn)
+      CALL Agrif_Bc_Variable(ztab, va_id,calledweight=timecoeff,procname=interpvn)
       Agrif_UseSpecialValue = .FALSE.
 
@@ -250,5 +271,5 @@
          spongedoneU = .TRUE.
 	 
-	 spbtr3(:,:) = 1./( e1f(:,:) * e2f(:,:))
+	  spbtr3(:,:) = 1./( e1f(:,:) * e2f(:,:))
       ENDIF
       
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_opa_update.F90	(revision 2715)
@@ -7,4 +7,6 @@
    USE dom_oce
    USE agrif_oce
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp
 
    IMPLICIT NONE
@@ -27,22 +29,35 @@
       !!   *** ROUTINE Agrif_Update_Tra ***
       !!---------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_3d_1
+      !!
       INTEGER, INTENT(in) :: kt
-
-      REAL :: ztab(jpi,jpj,jpk)
-
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztab
+
+       
       IF((Agrif_NbStepint() .NE. (Agrif_irhot()-1)).AND.(kt /= 0)) RETURN
 #if defined TWO_WAY
+      ztab => wrk_3d_1
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('agrif_update_tra: ERROR: requested workspace arrays unavailable')
+         RETURN
+      END IF
+
       Agrif_UseSpecialValueInUpdate = .TRUE.
       Agrif_SpecialValueFineGrid = 0.
 
       IF (MOD(nbcline,nbclineupdate) == 0) THEN
-         CALL Agrif_Update_Variable(ztab,tn, procname=updateT)
-         CALL Agrif_Update_Variable(ztab,sn, procname=updateS)
-      ELSE
-         CALL Agrif_Update_Variable(ztab,tn,locupdate=(/0,2/), procname=updateT)
-         CALL Agrif_Update_Variable(ztab,sn,locupdate=(/0,2/), procname=updateS)
+         CALL Agrif_Update_Variable(ztab,tn_id, procname=updateT)
+         CALL Agrif_Update_Variable(ztab,sn_id, procname=updateS)
+      ELSE
+         CALL Agrif_Update_Variable(ztab,tn_id,locupdate=(/0,2/), procname=updateT)
+         CALL Agrif_Update_Variable(ztab,sn_id,locupdate=(/0,2/), procname=updateS)
       ENDIF
 
       Agrif_UseSpecialValueInUpdate = .FALSE.
+
+      IF( wrk_not_released(3, 1) ) THEN
+         CALL ctl_stop('Agrif_Update_Tra: ERROR: failed to release workspace arrays')
+      END IF
 #endif
 
@@ -53,22 +68,31 @@
       !!   *** ROUTINE Agrif_Update_Dyn ***
       !!---------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_2d_1
+      USE wrk_nemo, ONLY: wrk_3d_1
+      !!
       INTEGER, INTENT(in) :: kt
-
-      REAL(wp), DIMENSION(jpi,jpj) :: ztab2d
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztab
+      REAL(wp), POINTER, DIMENSION(:,:) :: ztab2d
+      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztab
+
 
       IF ((Agrif_NbStepint() .NE. (Agrif_irhot()-1)).AND.(kt /= 0)) Return
 #if defined TWO_WAY
+      ztab => wrk_3d_1 ; ztab2d => wrk_2d_1
+      IF( ( wrk_in_use(2, 1)) .OR.  wrk_in_use(3, 1) )THEN
+         CALL ctl_stop('agrif_update_dyn: ERROR: requested workspace arrays unavailable')
+         RETURN
+      END IF
 
       IF (mod(nbcline,nbclineupdate) == 0) THEN
-         CALL Agrif_Update_Variable(ztab,un,procname = updateU)
-         CALL Agrif_Update_Variable(ztab,vn,procname = updateV)
-      ELSE
-         CALL Agrif_Update_Variable(ztab,un,locupdate=(/0,1/),procname = updateU)
-         CALL Agrif_Update_Variable(ztab,vn,locupdate=(/0,1/),procname = updateV)         
-      ENDIF
-
-      CALL Agrif_Update_Variable(ztab2d,e1u,procname = updateU2d)
-      CALL Agrif_Update_Variable(ztab2d,e2v,procname = updateV2d)  
+         CALL Agrif_Update_Variable(ztab,un_id,procname = updateU)
+         CALL Agrif_Update_Variable(ztab,vn_id,procname = updateV)
+      ELSE
+         CALL Agrif_Update_Variable(ztab,un_id,locupdate=(/0,1/),procname = updateU)
+         CALL Agrif_Update_Variable(ztab,vn_id,locupdate=(/0,1/),procname = updateV)         
+      ENDIF
+
+      CALL Agrif_Update_Variable(ztab2d,e1u_id,procname = updateU2d)
+      CALL Agrif_Update_Variable(ztab2d,e2v_id,procname = updateV2d)  
 
       nbcline = nbcline + 1
@@ -76,7 +100,10 @@
       Agrif_UseSpecialValueInUpdate = ln_spc_dyn
       Agrif_SpecialValueFineGrid = 0.
-      CALL Agrif_Update_Variable(ztab2d,sshn,procname = updateSSH)
+      CALL Agrif_Update_Variable(ztab2d,sshn_id,procname = updateSSH)
       Agrif_UseSpecialValueInUpdate = .FALSE.
 
+      IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) )THEN
+         CALL ctl_stop('agrif_update_dyn: ERROR: failed to release workspace arrays')
+      END IF
 
 !Done in step
@@ -184,4 +211,5 @@
                DO ji=i1,i2
                   tabres(ji,jj,jk) = e2u(ji,jj) * un(ji,jj,jk)
+                  tabres(ji,jj,jk) = tabres(ji,jj,jk) * fse3u(ji,jj,jk)
                END DO
             END DO
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_interp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_interp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_interp.F90	(revision 2715)
@@ -6,5 +6,7 @@
    USE sol_oce
    USE agrif_oce
+   USE agrif_top_sponge
    USE trc
+   USE lib_mpp
 
    IMPLICIT NONE
@@ -13,5 +15,7 @@
    PUBLIC Agrif_trc
 
-   !!----------------------------------------------------------------------
+#  include "domzgr_substitute.h90"  
+#  include "vectopt_loop_substitute.h90"
+  !!----------------------------------------------------------------------
    !! NEMO/NST 3.3 , NEMO Consortium (2010)
    !! $Id$
@@ -25,6 +29,6 @@
       !!   *** ROUTINE Agrif_trc ***
       !!---------------------------------------------
-#  include "domzgr_substitute.h90"  
-#  include "vectopt_loop_substitute.h90"
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_4d_1
       
       INTEGER :: ji,jj,jk,jn
@@ -32,7 +36,13 @@
       REAL(wp) :: alpha1, alpha2, alpha3, alpha4
       REAL(wp) :: alpha5, alpha6, alpha7
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztra
-      
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztra
+           
       IF (Agrif_Root()) RETURN
+
+      IF( wrk_in_use(4, 1) ) THEN
+         CALL ctl_stop('Agrif_trc : requested workspace arrays unavailable')
+         RETURN
+      ENDIF
+      ztra =>  wrk_4d_1(:,:,:,jptra)
 
       Agrif_SpecialValue=0.
@@ -40,5 +50,5 @@
       ztra = 0.e0
 
-      CALL Agrif_Bc_variable(ztra,trn)
+      CALL Agrif_Bc_variable(ztra,trn_id, procname = interptrn )
       Agrif_UseSpecialValue = .FALSE.
 
@@ -131,4 +141,9 @@
       ENDIF
 
+      IF( wrk_not_released(4, 1) ) THEN
+         CALL ctl_stop('Agrif_trc : failed to release workspace arrays.')
+         RETURN
+      ENDIF
+
    END SUBROUTINE Agrif_trc
 
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_sponge.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_sponge.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_sponge.F90	(revision 2715)
@@ -9,4 +9,5 @@
    USE agrif_oce
    USE trc
+   USE lib_mpp
 
    IMPLICIT NONE
@@ -28,15 +29,25 @@
       !!---------------------------------------------
 #include "domzgr_substitute.h90"
-
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_2d_1
+      USE wrk_nemo, ONLY: wrk_4d_1, wrk_4d_2, wrk_4d_3, wrk_4d_4
+      !! 
       INTEGER :: ji,jj,jk,jl
       INTEGER :: spongearea
       REAL(wp) :: timecoeff
       REAL(wp) :: ztra, zabe1, zabe2, zbtr
-      REAL(wp), DIMENSION(jpi,jpj) :: localviscsponge
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: trbdiff
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztru ,ztrv
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::  ztab
+      REAL(wp), POINTER, DIMENSION(:,:) :: localviscsponge
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: trbdiff, ztru, ztrv, ztab
 
 #if defined SPONGE_TOP
+      IF( wrk_in_use(4, 1,2,3,4) .OR. wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('Agrif_Sponge_trc : requested workspace arrays unavailable')
+         RETURN
+      ENDIF
+      localviscsponge => wrk_2d_1
+      trbdiff(:,:,:,:) => wrk_4d_1(:,:,:,1:jptra)
+      ztru   (:,:,:,:) => wrk_4d_2(:,:,:,1:jptra)
+      ztrv   (:,:,:,:) => wrk_4d_3(:,:,:,1:jptra)
+      ztab   (:,:,:,:) => wrk_4d_4(:,:,:,1:jptra)
 
       timecoeff = REAL(Agrif_NbStepint(),wp)/Agrif_rhot()
@@ -45,5 +56,5 @@
       Agrif_UseSpecialValue = .TRUE.
       ztab = 0.e0
-      CALL Agrif_Bc_Variable(ztab, tra,calledweight=timecoeff,procname=interptrn)
+      CALL Agrif_Bc_Variable(ztab, tra_id,calledweight=timecoeff,procname=interptrn)
       Agrif_UseSpecialValue = .FALSE.
 
@@ -143,4 +154,9 @@
       ENDDO
       ENDDO
+ 
+      IF( wrk_not_released(4, 1,2,3,4) .OR. wrk_not_released(2, 1) ) THEN
+         CALL ctl_stop('Agrif_Sponge_trc : failed to release workspace arrays.')
+         RETURN
+      ENDIF
 
 #endif
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_update.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_update.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_top_update.F90	(revision 2715)
@@ -29,22 +29,36 @@
       !!   *** ROUTINE Agrif_Update_Trc ***
       !!---------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_4d_1
+      !!
       INTEGER, INTENT(in) :: kt
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztra
+
   
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztra
-
       IF ((Agrif_NbStepint() .NE. (Agrif_irhot()-1)).AND.(kt /= 0)) RETURN
 
 #if defined TWO_WAY
+      IF( wrk_in_use(4, 1) ) THEN
+         CALL ctl_stop('Agrif_Update_trc : requested workspace arrays unavailable')
+         RETURN
+      ENDIF
+      ztra =>  wrk_4d_1(:,:,:,jptra)
+
       Agrif_UseSpecialValueInUpdate = .TRUE.
       Agrif_SpecialValueFineGrid = 0.
  
      IF (MOD(nbcline_trc,nbclineupdate) == 0) THEN
-         CALL Agrif_Update_Variable(ztra,trn, procname=updateTRC)
+         CALL Agrif_Update_Variable(ztra,trn_id, procname=updateTRC)
       ELSE
-         CALL Agrif_Update_Variable(ztra,trn,locupdate=(/0,2/), procname=updateTRC)
+         CALL Agrif_Update_Variable(ztra,trn_id,locupdate=(/0,2/), procname=updateTRC)
       ENDIF
 
       Agrif_UseSpecialValueInUpdate = .FALSE.
       nbcline_trc = nbcline_trc + 1
+
+      IF( wrk_not_released(4, 1) ) THEN
+         CALL ctl_stop('Agrif_Update_trc : failed to release workspace arrays.')
+         RETURN
+      ENDIF
 #endif
 
Index: /trunk/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/NST_SRC/agrif_user.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/NST_SRC/agrif_user.F90	(revision 2715)
@@ -5,4 +5,6 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
+   SUBROUTINE agrif_before_regridding
+   END SUBROUTINE
 
    SUBROUTINE Agrif_InitWorkspace
@@ -13,32 +15,18 @@
       USE dom_oce
       USE Agrif_Util
-      !!
-      IMPLICIT NONE
-      !!
-#if defined key_mpp_dyndist
-      CHARACTER(len=20) :: namelistname
-      INTEGER nummpp
-      NAMELIST/nammpp_dyndist/ jpni, jpnj, jpnij
-#endif
-      !!----------------------------------------------------------------------
-
-#if defined key_mpp_dyndist
-      ! MPP dynamical distribution : read the processor cutting in the namelist
-      IF( Agrif_Nbstepint() == 0 ) THEN
-        nummpp = Agrif_Get_Unit()
-        namelistname='namelist'
-        IF(.NOT. Agrif_Root() )   namelistname=TRIM(Agrif_CFixed())//'_namelist'
-        !
-        OPEN (nummpp,file=namelistname,status='OLD',form='formatted')
-        READ (nummpp,nammpp_dyndist)
-        CLOSE(nummpp)
-      ENDIF
-#endif
-
+      USE nemogcm
+      !
+      IMPLICIT NONE
+      !!----------------------------------------------------------------------
+      !
       IF( .NOT. Agrif_Root() ) THEN
+         jpni = Agrif_Parent(jpni)
+         jpnj = Agrif_Parent(jpnj)
+         jpnij = Agrif_Parent(jpnij)
          jpiglo  = nbcellsx + 2 + 2*nbghostcells
          jpjglo  = nbcellsy + 2 + 2*nbghostcells
          jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci
          jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj
+         jpk     = jpkdta
          jpim1   = jpi-1
          jpjm1   = jpj-1
@@ -55,5 +43,4 @@
    END SUBROUTINE Agrif_InitWorkspace
 
-#if ! defined key_offline
 
    SUBROUTINE Agrif_InitValues
@@ -67,7 +54,4 @@
       USE dom_oce
       USE nemogcm
-#if defined key_top
-      USE trc
-#endif
 #if defined key_tradmp   ||   defined key_esopa
       USE tradmp
@@ -76,20 +60,5 @@
       USE obc_par
 #endif
-      USE sol_oce
-      USE in_out_manager
-      USE agrif_opa_update
-      USE agrif_opa_interp
-      USE agrif_opa_sponge
-      USE agrif_top_update
-      USE agrif_top_interp
-      USE agrif_top_sponge
-      !!
-      IMPLICIT NONE
-      !!
-      REAL(wp) :: tabtemp(jpi,jpj,jpk)
-#if defined key_top
-      REAL(wp) :: tabtrtemp(jpi,jpj,jpk,jptra)
-#endif 
-      LOGICAL check_namelist
+      IMPLICIT NONE
       !!----------------------------------------------------------------------
 
@@ -111,153 +80,63 @@
 #endif
 
-      Call nemo_init  ! Initializations of each fine grid
-      Call agrif_nemo_init
-
+      CALL nemo_init  ! Initializations of each fine grid
+      CALL agrif_nemo_init
+# if ! defined key_offline
+      CALL Agrif_InitValues_cont
+# endif       
+# if defined key_top
+      CALL Agrif_InitValues_cont_top
+# endif      
+   END SUBROUTINE Agrif_initvalues
+
+# if ! defined key_offline
+
+   SUBROUTINE Agrif_InitValues_cont
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE Agrif_InitValues_cont ***
+      !!
+      !! ** Purpose ::   Declaration of variables to be interpolated
+      !!----------------------------------------------------------------------
+      USE Agrif_Util
+      USE oce 
+      USE dom_oce
+      USE nemogcm
+      USE sol_oce
+      USE in_out_manager
+      USE agrif_opa_update
+      USE agrif_opa_interp
+      USE agrif_opa_sponge
+      !
+      IMPLICIT NONE
+      !
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tabtemp
+      LOGICAL :: check_namelist
+      !!----------------------------------------------------------------------
+
+      ALLOCATE( tabtemp(jpi,jpj,jpk) )
+      
+      
       ! 1. Declaration of the type of variable which have to be interpolated
       !---------------------------------------------------------------------
-      Call Agrif_Set_type(un,(/1,2,0/),(/2,3,0/))
-      Call Agrif_Set_type(vn,(/2,1,0/),(/3,2,0/))
-
-      Call Agrif_Set_type(ua,(/1,2,0/),(/2,3,0/))
-      Call Agrif_Set_type(va,(/2,1,0/),(/3,2,0/))
-
-      Call Agrif_Set_type(e1u,(/1,2/),(/2,3/))
-      Call Agrif_Set_type(e2v,(/2,1/),(/3,2/))
-
-      Call Agrif_Set_type(tn,(/2,2,0/),(/3,3,0/))
-      Call Agrif_Set_type(sn,(/2,2,0/),(/3,3,0/)) 
-
-      Call Agrif_Set_type(tb,(/2,2,0/),(/3,3,0/))
-      Call Agrif_Set_type(sb,(/2,2,0/),(/3,3,0/)) 
-
-      Call Agrif_Set_type(ta,(/2,2,0/),(/3,3,0/))
-      Call Agrif_Set_type(sa,(/2,2,0/),(/3,3,0/))       
-
-      Call Agrif_Set_type(sshn,(/2,2/),(/3,3/))
-      Call Agrif_Set_type(gcb,(/2,2/),(/3,3/))
-
-#if defined key_top
-      Call Agrif_Set_type(trb,(/2,2,0,0/),(/3,3,0,0/))
-      Call Agrif_Set_type(trn,(/2,2,0,0/),(/3,3,0,0/))
-      Call Agrif_Set_type(tra,(/2,2,0,0/),(/3,3,0,0/))
-#endif
-      
-      ! 2. Space directions for each variables
-      !---------------------------------------
-      Call Agrif_Set_raf(un,(/'x','y','N'/))
-      Call Agrif_Set_raf(vn,(/'x','y','N'/))
-
-      Call Agrif_Set_raf(ua,(/'x','y','N'/))
-      Call Agrif_Set_raf(va,(/'x','y','N'/))
-
-      Call Agrif_Set_raf(e1u,(/'x','y'/))
-      Call Agrif_Set_raf(e2v,(/'x','y'/))
-
-      Call Agrif_Set_raf(tn,(/'x','y','N'/))
-      Call Agrif_Set_raf(sn,(/'x','y','N'/))
-
-      Call Agrif_Set_raf(tb,(/'x','y','N'/))
-      Call Agrif_Set_raf(sb,(/'x','y','N'/))
-
-      Call Agrif_Set_raf(ta,(/'x','y','N'/))
-      Call Agrif_Set_raf(sa,(/'x','y','N'/))      
-
-      Call Agrif_Set_raf(sshn,(/'x','y'/))
-      Call Agrif_Set_raf(gcb,(/'x','y'/))
-
-#if defined key_top
-      Call Agrif_Set_raf(trn,(/'x','y','N','N'/))
-      Call Agrif_Set_raf(trb,(/'x','y','N','N'/))
-      Call Agrif_Set_raf(tra,(/'x','y','N','N'/))
-#endif
-
-      ! 3. Type of interpolation
-      !------------------------- 
-      Call Agrif_Set_bcinterp(tn,interp=AGRIF_linear)
-      Call Agrif_Set_bcinterp(sn,interp=AGRIF_linear)
-
-      Call Agrif_Set_bcinterp(ta,interp=AGRIF_linear)
-      Call Agrif_Set_bcinterp(sa,interp=AGRIF_linear)
-
-      Call Agrif_Set_bcinterp(un,interp1=Agrif_linear,interp2=AGRIF_ppm)
-      Call Agrif_Set_bcinterp(vn,interp1=AGRIF_ppm,interp2=Agrif_linear)
-
-      Call Agrif_Set_bcinterp(ua,interp1=Agrif_linear,interp2=AGRIF_ppm)
-      Call Agrif_Set_bcinterp(va,interp1=AGRIF_ppm,interp2=Agrif_linear)
-
-      Call Agrif_Set_bcinterp(e1u,interp1=Agrif_linear,interp2=AGRIF_ppm)
-      Call Agrif_Set_bcinterp(e2v,interp1=AGRIF_ppm,interp2=Agrif_linear)
-
-#if defined key_top
-      Call Agrif_Set_bcinterp(trn,interp=AGRIF_linear)
-      Call Agrif_Set_bcinterp(tra,interp=AGRIF_linear)
-#endif
-
-      ! 4. Location of interpolation
-      !-----------------------------
-      Call Agrif_Set_bc(un,(/0,1/))
-      Call Agrif_Set_bc(vn,(/0,1/))
-
-      Call Agrif_Set_bc(e1u,(/0,0/))
-      Call Agrif_Set_bc(e2v,(/0,0/))
-
-      Call Agrif_Set_bc(tn,(/0,1/))
-      Call Agrif_Set_bc(sn,(/0,1/))
-
-      Call Agrif_Set_bc(ta,(/-3*Agrif_irhox(),0/))
-      Call Agrif_Set_bc(sa,(/-3*Agrif_irhox(),0/))
-
-      Call Agrif_Set_bc(ua,(/-2*Agrif_irhox(),0/))
-      Call Agrif_Set_bc(va,(/-2*Agrif_irhox(),0/))
-
-#if defined key_top
-      Call Agrif_Set_bc(trn,(/0,1/))
-      Call Agrif_Set_bc(tra,(/-3*Agrif_irhox(),0/))
-#endif
-
-      ! 5. Update type
-      !--------------- 
-      Call Agrif_Set_Updatetype(tn, update = AGRIF_Update_Average)
-      Call Agrif_Set_Updatetype(sn, update = AGRIF_Update_Average)
-
-      Call Agrif_Set_Updatetype(tb, update = AGRIF_Update_Average)
-      Call Agrif_Set_Updatetype(sb, update = AGRIF_Update_Average)
-
-      Call Agrif_Set_Updatetype(sshn, update = AGRIF_Update_Average)
-      Call Agrif_Set_Updatetype(gcb,update = AGRIF_Update_Average)
-
-#if defined key_top
-      Call Agrif_Set_Updatetype(trn, update = AGRIF_Update_Average)
-      Call Agrif_Set_Updatetype(trb, update = AGRIF_Update_Average)
-#endif
-
-      Call Agrif_Set_Updatetype(un,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average)
-      Call Agrif_Set_Updatetype(vn,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy)
-
-      Call Agrif_Set_Updatetype(e1u,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average)
-      Call Agrif_Set_Updatetype(e2v,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy)
-
-      ! 6. First interpolations of potentially non zero fields
+      CALL agrif_declare_var
+
+      ! 2. First interpolations of potentially non zero fields
       !-------------------------------------------------------
       Agrif_SpecialValue=0.
       Agrif_UseSpecialValue = .TRUE.
-      Call Agrif_Bc_variable(tabtemp,tn,calledweight=1.)
-      Call Agrif_Bc_variable(tabtemp,sn,calledweight=1.)
-      Call Agrif_Bc_variable(tabtemp,un,calledweight=1.,procname=interpu)
-      Call Agrif_Bc_variable(tabtemp,vn,calledweight=1.,procname=interpv)
-
-      Call Agrif_Bc_variable(tabtemp,ta,calledweight=1.,procname=interptn)
-      Call Agrif_Bc_variable(tabtemp,sa,calledweight=1.,procname=interpsn)
-
-      Call Agrif_Bc_variable(tabtemp,ua,calledweight=1.,procname=interpun)
-      Call Agrif_Bc_variable(tabtemp,va,calledweight=1.,procname=interpvn)
-
-#if defined key_top
-      Call Agrif_Bc_variable(tabtrtemp,trn,calledweight=1.)
-      Call Agrif_Bc_variable(tabtrtemp,tra,calledweight=1.,procname=interptrn)
-#endif
+      Call Agrif_Bc_variable(tabtemp,tn_id,calledweight=1.,procname=interptn)
+    
+      Call Agrif_Bc_variable(tabtemp,sn_id,calledweight=1.,procname=interpsn)
+      Call Agrif_Bc_variable(tabtemp,un_id,calledweight=1.,procname=interpu)
+      Call Agrif_Bc_variable(tabtemp,vn_id,calledweight=1.,procname=interpv)
+
+      Call Agrif_Bc_variable(tabtemp,ta_id,calledweight=1.,procname=interptn)
+      Call Agrif_Bc_variable(tabtemp,sa_id,calledweight=1.,procname=interpsn)
+
+      Call Agrif_Bc_variable(tabtemp,ua_id,calledweight=1.,procname=interpun)
+      Call Agrif_Bc_variable(tabtemp,va_id,calledweight=1.,procname=interpvn)
       Agrif_UseSpecialValue = .FALSE.
 
-      ! 7. Some controls
+      ! 3. Some controls
       !-----------------
       check_namelist = .true.
@@ -265,4 +144,180 @@
       IF( check_namelist ) THEN
      
+         ! Check time steps           
+         IF( NINT(Agrif_Rhot()) * nint(rdt) /= Agrif_Parent(rdt) ) THEN
+            WRITE(*,*) 'incompatible time step between grids'
+            WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt)
+            WRITE(*,*) 'child  grid value : ',nint(rdt)
+            WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot()
+            STOP
+         ENDIF
+         
+         ! Check run length
+         IF( Agrif_IRhot() * (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1) /= (nitend-nit000+1) ) THEN
+            WRITE(*,*) 'incompatible run length between grids'
+            WRITE(*,*) 'parent grid value : ', (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1),' time step'
+            WRITE(*,*) 'child  grid value : ', (nitend-nit000+1),' time step'
+            WRITE(*,*) 'value on child grid should be: ', Agrif_IRhot() * (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1)
+            STOP
+         ENDIF
+         
+         ! Check coordinates
+         IF( ln_zps ) THEN
+            ! check parameters for partial steps 
+            IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN
+               WRITE(*,*) 'incompatible e3zps_min between grids'
+               WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min)
+               WRITE(*,*) 'child grid  :',e3zps_min
+               WRITE(*,*) 'those values should be identical'
+               STOP
+            ENDIF          
+            IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN
+               WRITE(*,*) 'incompatible e3zps_rat between grids'
+               WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat)
+               WRITE(*,*) 'child grid  :',e3zps_rat
+               WRITE(*,*) 'those values should be identical'                  
+               STOP
+            ENDIF
+         ENDIF
+      ENDIF
+       
+      CALL Agrif_Update_tra(0)
+      CALL Agrif_Update_dyn(0)
+
+      nbcline = 0
+      !
+      DEALLOCATE(tabtemp)
+      !
+   END SUBROUTINE Agrif_InitValues_cont
+
+
+   SUBROUTINE agrif_declare_var
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE agrif_declarE_var ***
+      !!
+      !! ** Purpose :: Declaration of variables to be interpolated
+      !!----------------------------------------------------------------------
+      USE agrif_util
+      USE oce
+      IMPLICIT NONE
+      !!----------------------------------------------------------------------
+   
+      ! 1. Declaration of the type of variable which have to be interpolated
+      !---------------------------------------------------------------------
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),tn_id)
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),sn_id)
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),tb_id)
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),sb_id)
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),ta_id)
+      CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),sa_id)
+         
+      CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),un_id)
+      CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),vn_id)
+      CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),ua_id)
+      CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),va_id)
+   
+      CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id)
+      CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id)
+
+      CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),sshn_id)
+      CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),gcb_id)
+       
+      ! 2. Type of interpolation
+      !-------------------------
+      CALL Agrif_Set_bcinterp(tn_id,interp=AGRIF_linear)
+      CALL Agrif_Set_bcinterp(sn_id,interp=AGRIF_linear)
+      CALL Agrif_Set_bcinterp(ta_id,interp=AGRIF_linear)
+      CALL Agrif_Set_bcinterp(sa_id,interp=AGRIF_linear)
+   
+      Call Agrif_Set_bcinterp(un_id,interp1=Agrif_linear,interp2=AGRIF_ppm)
+      Call Agrif_Set_bcinterp(vn_id,interp1=AGRIF_ppm,interp2=Agrif_linear)
+
+      Call Agrif_Set_bcinterp(ua_id,interp1=Agrif_linear,interp2=AGRIF_ppm)
+      Call Agrif_Set_bcinterp(va_id,interp1=AGRIF_ppm,interp2=Agrif_linear)
+
+      Call Agrif_Set_bcinterp(e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm)
+      Call Agrif_Set_bcinterp(e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear)
+
+      ! 3. Location of interpolation
+      !-----------------------------
+      Call Agrif_Set_bc(un_id,(/0,1/))
+      Call Agrif_Set_bc(vn_id,(/0,1/))
+
+      Call Agrif_Set_bc(e1u_id,(/0,0/))
+      Call Agrif_Set_bc(e2v_id,(/0,0/))
+
+      Call Agrif_Set_bc(tn_id,(/0,1/))
+      Call Agrif_Set_bc(sn_id,(/0,1/))
+
+      Call Agrif_Set_bc(ta_id,(/-3*Agrif_irhox(),0/))
+      Call Agrif_Set_bc(sa_id,(/-3*Agrif_irhox(),0/))
+
+      Call Agrif_Set_bc(ua_id,(/-2*Agrif_irhox(),0/))
+      Call Agrif_Set_bc(va_id,(/-2*Agrif_irhox(),0/))
+
+      ! 5. Update type
+      !--------------- 
+      Call Agrif_Set_Updatetype(tn_id, update = AGRIF_Update_Average)
+      Call Agrif_Set_Updatetype(sn_id, update = AGRIF_Update_Average)
+
+      Call Agrif_Set_Updatetype(tb_id, update = AGRIF_Update_Average)
+      Call Agrif_Set_Updatetype(sb_id, update = AGRIF_Update_Average)
+
+      Call Agrif_Set_Updatetype(sshn_id, update = AGRIF_Update_Average)
+      Call Agrif_Set_Updatetype(gcb_id,update = AGRIF_Update_Average)
+
+      Call Agrif_Set_Updatetype(un_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average)
+      Call Agrif_Set_Updatetype(vn_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy)
+
+      Call Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average)
+      Call Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy)
+
+   END SUBROUTINE agrif_declare_var
+# endif
+   
+# if defined key_top
+   SUBROUTINE Agrif_InitValues_cont_top
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE Agrif_InitValues_cont_top ***
+      !!
+      !! ** Purpose :: Declaration of variables to be interpolated
+      !!----------------------------------------------------------------------
+      USE Agrif_Util
+      USE oce 
+      USE dom_oce
+      USE nemogcm
+      USE trc
+      USE in_out_manager
+      USE agrif_top_update
+      USE agrif_top_interp
+      USE agrif_top_sponge
+      !
+      IMPLICIT NONE
+      !
+      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tabtrtemp
+      LOGICAL :: check_namelist
+      !!----------------------------------------------------------------------
+
+      ALLOCATE( tabtrtemp(jpi,jpj,jpk,jptra) )
+      
+      
+      ! 1. Declaration of the type of variable which have to be interpolated
+      !---------------------------------------------------------------------
+      CALL agrif_declare_var_top
+
+      ! 2. First interpolations of potentially non zero fields
+      !-------------------------------------------------------
+      Agrif_SpecialValue=0.
+      Agrif_UseSpecialValue = .TRUE.
+      Call Agrif_Bc_variable(tabtrtemp,trn_id,calledweight=1.)
+      Call Agrif_Bc_variable(tabtrtemp,tra_id,calledweight=1.,procname=interptrn)
+      Agrif_UseSpecialValue = .FALSE.
+
+      ! 3. Some controls
+      !-----------------
+      check_namelist = .true.
+            
+      IF( check_namelist ) THEN
+#  if defined offline     
          ! Check time steps           
          IF( nint(Agrif_Rhot()) * nint(rdt) .ne. Agrif_Parent(rdt) ) THEN
@@ -275,14 +330,9 @@
          
          ! Check run length
-         IF( Agrif_IRhot() * (Agrif_Parent(nitend)- &
-            Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN
+         IF( Agrif_IRhot() * (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN
             WRITE(*,*) 'incompatible run length between grids'
-            WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- &
-               Agrif_Parent(nit000)+1),' time step'
-            WRITE(*,*) 'child  grid value : ', &
-               (nitend-nit000+1),' time step'
-            WRITE(*,*) 'value on child grid should be : ', &
-               Agrif_IRhot() * (Agrif_Parent(nitend)- &
-               Agrif_Parent(nit000)+1)
+            WRITE(*,*) 'parent grid value : ', (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1),' time step'
+            WRITE(*,*) 'child  grid value : ', (nitend-nit000+1),' time step'
+            WRITE(*,*) 'value on child grid should be : ', Agrif_IRhot() * (Agrif_Parent(nitend)-Agrif_Parent(nit000)+1)
             STOP
          ENDIF
@@ -306,164 +356,85 @@
             ENDIF
          ENDIF
-#if defined key_top
+#  endif         
         ! Check passive tracer cell
         IF( nn_dttrc .ne. 1 ) THEN
            WRITE(*,*) 'nn_dttrc should be equal to 1'
         ENDIF
-#endif
-
       ENDIF
-
-#if defined key_top
+       
       CALL Agrif_Update_trc(0)
-#endif
-      CALL Agrif_Update_tra(0)
-      CALL Agrif_Update_dyn(0)
-
-#if defined key_top
       nbcline_trc = 0
-#endif
-      nbcline = 0
-      !
-   END SUBROUTINE Agrif_InitValues
-
-#else
-
-   SUBROUTINE Agrif_InitValues
-      !!----------------------------------------------------------------------
-      !!                 *** ROUTINE Agrif_InitValues ***
+      !
+      DEALLOCATE(tabtrtemp)
+      !
+   END SUBROUTINE Agrif_InitValues_cont_top
+
+
+   SUBROUTINE agrif_declare_var_top
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE agrif_declare_var_top ***
       !!
-      !! ** Purpose :: Declaration of variables to be interpolated
-      !!----------------------------------------------------------------------
-      USE Agrif_Util
-      USE oce 
+      !! ** Purpose :: Declaration of TOP variables to be interpolated
+      !!----------------------------------------------------------------------
+      USE agrif_util
       USE dom_oce
-      USE nemogcm
       USE trc
-      USE in_out_manager
-      USE agrif_top_update
-      USE agrif_top_interp
-      USE agrif_top_sponge
-      !!
-      IMPLICIT NONE
-      !!
-      REAL(wp) :: tabtrtemp(jpi,jpj,jpk,jptra)
-      LOGICAL check_namelist
-      !!----------------------------------------------------------------------
-
-      ! 0. Initializations
-      !-------------------
-#if defined key_orca_r025 || defined key_orca_r05 || defined key_orca_r2 || defined key_orca_r4
-      jp_cfg = -1    ! set special value for jp_cfg on fine grids
-      cp_cfg = "default"
-#endif
-
-      Call nemo_init  ! Initializations of each fine grid
-      Call agrif_nemo_init
-
+      
+      IMPLICIT NONE
+   
       ! 1. Declaration of the type of variable which have to be interpolated
       !---------------------------------------------------------------------
-      Call Agrif_Set_type(trb,(/2,2,0,0/),(/3,3,0,0/))
-      Call Agrif_Set_type(trn,(/2,2,0,0/),(/3,3,0,0/))
-      Call Agrif_Set_type(tra,(/2,2,0,0/),(/3,3,0,0/))
-      
-      ! 2. Space directions for each variables
-      !---------------------------------------
-      Call Agrif_Set_raf(trn,(/'x','y','N','N'/))
-      Call Agrif_Set_raf(trb,(/'x','y','N','N'/))
-      Call Agrif_Set_raf(tra,(/'x','y','N','N'/))
-
-      ! 3. Type of interpolation
-      !------------------------- 
-      Call Agrif_Set_bcinterp(trn,interp=AGRIF_linear)
-      Call Agrif_Set_bcinterp(tra,interp=AGRIF_linear)
-
-      ! 4. Location of interpolation
+      CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),  &
+      &                           (/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trn_id)
+      CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),  &
+      &                           (/1,1,1,1/),(/jpi,jpj,jpk,jptra/),trb_id)
+      CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0,jptra/),(/'x','y','N','N'/),  &
+      &                           (/1,1,1,1/),(/jpi,jpj,jpk/),tra_id)
+            
+#  if defined key_offline
+      CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e1u_id)
+      CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),e2v_id)
+#  endif
+       
+      ! 2. Type of interpolation
+      !-------------------------
+      CALL Agrif_Set_bcinterp(trn_id,interp=AGRIF_linear)
+      CALL Agrif_Set_bcinterp(tra_id,interp=AGRIF_linear)
+   
+#  if defined key_offline
+      Call Agrif_Set_bcinterp(e1u_id,interp1=Agrif_linear,interp2=AGRIF_ppm)
+      Call Agrif_Set_bcinterp(e2v_id,interp1=AGRIF_ppm,interp2=Agrif_linear)
+#  endif
+
+      ! 3. Location of interpolation
       !-----------------------------
-      Call Agrif_Set_bc(trn,(/0,1/))
-      Call Agrif_Set_bc(tra,(/-3*Agrif_irhox(),0/))
+#  if defined key_offline
+      Call Agrif_Set_bc(e1u_id,(/0,0/))
+      Call Agrif_Set_bc(e2v_id,(/0,0/))
+#  endif
+      Call Agrif_Set_bc(trn_id,(/0,1/))
+      Call Agrif_Set_bc(tra_id,(/-3*Agrif_irhox(),0/))
 
       ! 5. Update type
       !--------------- 
-      Call Agrif_Set_Updatetype(trn, update = AGRIF_Update_Average)
-      Call Agrif_Set_Updatetype(trb, update = AGRIF_Update_Average)
-
-      ! 6. First interpolations of potentially non zero fields
-      !-------------------------------------------------------
-      Agrif_SpecialValue=0.
-      Agrif_UseSpecialValue = .TRUE.
-      Call Agrif_Bc_variable(tabtrtemp,trn,calledweight=1.)
-      Call Agrif_Bc_variable(tabtrtemp,tra,calledweight=1.,procname=interptrn)
-      Agrif_UseSpecialValue = .FALSE.
-
-      ! 7. Some controls
-      !-----------------
-      check_namelist = .true.
-            
-      IF( check_namelist ) THEN
-     
-         ! Check time steps           
-         IF( nint(Agrif_Rhot()) * nint(rdt) .ne. Agrif_Parent(rdt) ) THEN
-            WRITE(*,*) 'incompatible time step between grids'
-            WRITE(*,*) 'parent grid value : ',Agrif_Parent(rdt)
-            WRITE(*,*) 'child  grid value : ',nint(rdt)
-            WRITE(*,*) 'value on parent grid should be : ',rdt*Agrif_Rhot()
-            STOP
-         ENDIF
-         
-         ! Check run length
-         IF( Agrif_IRhot() * (Agrif_Parent(nitend)- &
-            Agrif_Parent(nit000)+1) .ne. (nitend-nit000+1) ) THEN
-            WRITE(*,*) 'incompatible run length between grids'
-            WRITE(*,*) 'parent grid value : ',(Agrif_Parent(nitend)- &
-               Agrif_Parent(nit000)+1),' time step'
-            WRITE(*,*) 'child  grid value : ', &
-               (nitend-nit000+1),' time step'
-            WRITE(*,*) 'value on child grid should be : ', &
-               Agrif_IRhot() * (Agrif_Parent(nitend)- &
-               Agrif_Parent(nit000)+1)
-            STOP
-         ENDIF
-         
-         ! Check coordinates
-         IF( ln_zps ) THEN
-            ! check parameters for partial steps 
-            IF( Agrif_Parent(e3zps_min) .ne. e3zps_min ) THEN
-               WRITE(*,*) 'incompatible e3zps_min between grids'
-               WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min)
-               WRITE(*,*) 'child grid  :',e3zps_min
-               WRITE(*,*) 'those values should be identical'
-               STOP
-            ENDIF          
-            IF( Agrif_Parent(e3zps_rat) .ne. e3zps_rat ) THEN
-               WRITE(*,*) 'incompatible e3zps_rat between grids'
-               WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat)
-               WRITE(*,*) 'child grid  :',e3zps_rat
-               WRITE(*,*) 'those values should be identical'                  
-               STOP
-            ENDIF
-         ENDIF
-        ! Check passive tracer cell
-        IF( nn_dttrc .ne. 1 ) THEN
-           WRITE(*,*) 'nn_dttrc should be equal to 1'
-        ENDIF
-
-      ENDIF
-
-      CALL Agrif_Update_trc(0)
-      nbcline_trc = 0
-      !
-   END SUBROUTINE Agrif_InitValues
-
-#endif
-   
-   SUBROUTINE Agrif_detect( g, sizex )
+      Call Agrif_Set_Updatetype(trn_id, update = AGRIF_Update_Average)
+      Call Agrif_Set_Updatetype(trb_id, update = AGRIF_Update_Average)
+
+#  if defined key_offline
+      Call Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average)
+      Call Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy)
+#  endif
+
+   END SUBROUTINE agrif_declare_var_top
+# endif
+   
+   SUBROUTINE Agrif_detect( kg, ksizex )
       !!----------------------------------------------------------------------
       !!   *** ROUTINE Agrif_detect ***
       !!----------------------------------------------------------------------
       USE Agrif_Types
-      !! 
-      INTEGER, DIMENSION(2) :: sizex
-      INTEGER, DIMENSION(sizex(1),sizex(2)) :: g 
+      !
+      INTEGER, DIMENSION(2) :: ksizex
+      INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg 
       !!----------------------------------------------------------------------
       !
@@ -479,7 +450,7 @@
       USE agrif_oce 
       USE in_out_manager
-      !!
-      IMPLICIT NONE
-      !!
+      USE lib_mpp
+      IMPLICIT NONE
+      !
       NAMELIST/namagrif/ nn_cln_update, rn_sponge_tra, rn_sponge_dyn, ln_spc_dyn
       !!----------------------------------------------------------------------
@@ -505,4 +476,6 @@
       visc_dyn      = rn_sponge_dyn
       !
+      IF( agrif_oce_alloc()  > 0 )   CALL ctl_warn('agrif sol_oce_alloc: allocation of arrays failed')
+      !
     END SUBROUTINE agrif_nemo_init
 
@@ -514,8 +487,7 @@
       !!----------------------------------------------------------------------
       USE dom_oce
-      !!
-      IMPLICIT NONE
-      !!
-      INTEGER :: indglob,indloc,nprocloc,i
+      IMPLICIT NONE
+      !
+      INTEGER :: indglob, indloc, nprocloc, i
       !!----------------------------------------------------------------------
       !
@@ -534,5 +506,5 @@
    SUBROUTINE Subcalledbyagrif
       !!----------------------------------------------------------------------
-      !!   *** ROUTINE Subcalledbyagrif ***
+      !!                   *** ROUTINE Subcalledbyagrif ***
       !!----------------------------------------------------------------------
       WRITE(*,*) 'Impossible to be here'
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/dommsk.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/dommsk.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/dommsk.F90	(revision 2715)
@@ -12,4 +12,5 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
+   USE lib_mpp         ! MPP library
    USE in_out_manager  ! I/O manager
 
@@ -19,10 +20,5 @@
    PUBLIC   dom_msk    ! routine called by inidom.F90
 
-#if defined key_degrad
-   !! ------------------------------------------------
-   !! Degradation method
-   !! --------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) ::   facvol  !! volume for degraded regions
-#endif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   facvol   !: volume for degraded regions
 
    !! * Substitutions
@@ -34,5 +30,5 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   
+
    SUBROUTINE dom_msk
       !!---------------------------------------------------------------------
@@ -49,9 +45,19 @@
       !!               tpol     : ???
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY:   imsk => iwrk_2d_1
+      !
       INTEGER  ::   ji, jk                   ! dummy loop indices
       INTEGER  ::   iif, iil, ijf, ijl       ! local integers
-      INTEGER, DIMENSION(jpi,jpj) ::  imsk   ! 2D workspace
       !!---------------------------------------------------------------------
       !
+      IF( iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('dom_msk: requested workspace arrays unavailable')   ;   RETURN
+      END IF
+      !
+#if defined key_degrad
+      IF( dom_msk_alloc() /= 0 )   CALL ctl_stop('STOP','dom_msk: unable to allocate arrays')
+#endif
+
       ! Interior domain mask (used for global sum)
       ! --------------------
@@ -95,5 +101,17 @@
       ENDIF
       !
+      IF( iwrk_not_released(2, 1) )   CALL ctl_stop('dom_msk: failed to release workspace arrays')
+      !
    END SUBROUTINE dom_msk
+
+
+   INTEGER FUNCTION dom_msk_alloc()
+      !!---------------------------------------------------------------------
+      !!                 ***  FUNCTION dom_msk_alloc  ***
+      !!---------------------------------------------------------------------
+      ALLOCATE( facvol(jpi,jpj,jpk) , STAT=dom_msk_alloc )
+      IF( dom_msk_alloc /= 0 )   CALL ctl_warn('dom_msk_alloc : failed to allocate facvol array')
+      !
+   END FUNCTION dom_msk_alloc
 
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/domrea.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/domrea.F90	(revision 2715)
@@ -16,5 +16,7 @@
    USE dommsk          ! domain: masks
    USE lbclnk          ! lateral boundary condition - MPP exchanges
-   USE in_out_manager  ! I/O manager
+   USE lib_mpp 
+   USE in_out_manager
+   USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
 
    IMPLICIT NONE
@@ -53,9 +55,9 @@
       !!----------------------------------------------------------------------
       USE iom
+      USE wrk_nemo, ONLY: zmbk => wrk_2d_1, zprt => wrk_2d_2, zprw => wrk_2d_3
       !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       INTEGER  ::   ik, inum0 , inum1 , inum2 , inum3 , inum4   ! local integers
       REAL(wp) ::   zrefdep         ! local real
-      REAL(wp), DIMENSION(jpi,jpj) ::   zmbk, zprt, zprw   ! 2D workspace
       !!----------------------------------------------------------------------
 
@@ -63,4 +65,8 @@
       IF(lwp) WRITE(numout,*) 'dom_rea : read NetCDF mesh and mask information file(s)'
       IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      IF( wrk_in_use(2, 1,2,3)  ) THEN
+         CALL ctl_stop('dom_rea: ERROR: requested workspace arrays unavailable.') ; RETURN
+      END IF
 
       zmbk(:,:) = 0._wp
@@ -141,4 +147,6 @@
          CALL iom_get( inum3, jpdom_data, 'e2u', e2u )
          CALL iom_get( inum3, jpdom_data, 'e2v', e2v )
+
+         e1e2t(:,:) = e1t(:,:) * e2t(:,:)                              ! surface at T-points
 
          CALL iom_get( inum3, jpdom_data, 'ff', ff )
@@ -314,4 +322,6 @@
       END SELECT
       !
+      IF( wrk_not_released(2, 1,2,3)  ) CALL ctl_stop('dom_rea:failed to release workspace arrays.')
+      !
    END SUBROUTINE dom_rea
 
@@ -327,11 +337,17 @@
       !! ** Action  : - update mbathy: level bathymetry (in level index)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: zmbk => wrk_2d_4
+      !
       INTEGER ::   ji, jj   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj) ::   zmbk   ! 2D workspace 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
       !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) '    zgr_bot_level : ocean bottom k-index of T-, U-, V- and W-levels '
       IF(lwp) WRITE(numout,*) '    ~~~~~~~~~~~~~'
+      !
+      IF( wrk_in_use(2, 4) ) THEN
+         CALL ctl_stop('dom_rea: ERROR: requested workspace arrays unavailable.')  ;  RETURN
+      END IF
       !
       mbkt(:,:) = MAX( mbathy(:,:) , 1 )    ! bottom k-index of T-level (=1 over land)
@@ -347,4 +363,6 @@
       zmbk(:,:) = REAL( mbkv(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv  (:,:) = MAX( INT( zmbk(:,:) ), 1 )
       !
+      IF( wrk_not_released(2, 4) ) CALL ctl_stop('dom_rea:failed to release workspace arrays.')
+      !
    END SUBROUTINE zgr_bot_level
 
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 2715)
@@ -63,32 +63,32 @@
    INTEGER ::   numfl_t, numfl_u, numfl_v, numfl_w
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: tdta       ! temperature at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: sdta       ! salinity at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: udta       ! zonal velocity at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: vdta       ! meridional velocity at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: wdta       ! vertical velocity at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: avtdta     ! vertical diffusivity coefficient
-
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: hmlddta    ! mixed layer depth at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: wspddta    ! wind speed at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: frlddta    ! sea-ice fraction at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: empdta     ! E-P at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: qsrdta     ! short wave heat flux at two consecutive times
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: bblxdta    ! frequency of bbl in the x direction at 2 consecutive times 
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: bblydta    ! frequency of bbl in the y direction at 2 consecutive times 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tdta       ! temperature at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: sdta       ! salinity at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: udta       ! zonal velocity at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: vdta       ! meridional velocity at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wdta       ! vertical velocity at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: avtdta     ! vertical diffusivity coefficient
+
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: hmlddta    ! mixed layer depth at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: wspddta    ! wind speed at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: frlddta    ! sea-ice fraction at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: empdta     ! E-P at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: qsrdta     ! short wave heat flux at two consecutive times
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: bblxdta    ! frequency of bbl in the x direction at 2 consecutive times 
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: bblydta    ! frequency of bbl in the y direction at 2 consecutive times 
    LOGICAL :: l_offbbl
 #if defined key_ldfslp
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: uslpdta    ! zonal isopycnal slopes
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: vslpdta    ! meridional isopycnal slopes
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: wslpidta   ! zonal diapycnal slopes
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: wslpjdta   ! meridional diapycnal slopes
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: uslpdta    ! zonal isopycnal slopes
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: vslpdta    ! meridional isopycnal slopes
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wslpidta   ! zonal diapycnal slopes
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wslpjdta   ! meridional diapycnal slopes
 #endif
 #if ! defined key_degrad &&  defined key_traldf_c2d && defined key_traldf_eiv 
-   REAL(wp), DIMENSION(jpi,jpj    ,2) :: aeiwdta    ! G&M coefficient
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:,:) :: aeiwdta    ! G&M coefficient
 #endif
 #if defined key_degrad
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: ahtudta, ahtvdta, ahtwdta   ! Lateral diffusivity
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: ahtudta, ahtvdta, ahtwdta   ! Lateral diffusivity
 # if defined key_traldf_eiv
-   REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: aeiudta, aeivdta, aeiwdta   ! G&M coefficient
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: aeiudta, aeivdta, aeiwdta   ! G&M coefficient
 # endif
 #endif
@@ -297,4 +297,36 @@
 
 
+   INTEGER FUNCTION dta_dyn_alloc()
+      !!---------------------------------------------------------------------
+      !!                 ***  ROUTINE dta_dyn_alloc  ***
+      !!---------------------------------------------------------------------
+
+      ALLOCATE( tdta    (jpi,jpj,jpk,2), sdta    (jpi,jpj,jpk,2),    &
+         &      udta    (jpi,jpj,jpk,2), vdta    (jpi,jpj,jpk,2),    &
+         &      wdta    (jpi,jpj,jpk,2), avtdta  (jpi,jpj,jpk,2),    &
+#if defined key_ldfslp 
+         &      uslpdta (jpi,jpj,jpk,2), vslpdta (jpi,jpj,jpk,2),    &
+         &      wslpidta(jpi,jpj,jpk,2), wslpjdta(jpi,jpj,jpk,2),    &
+#endif
+#if defined key_degrad
+         &      ahtudta (jpi,jpj,jpk,2), ahtvdta (jpi,jpj,jpk,2),    &
+         &      ahtwdta (jpi,jpj,jpk,2),                             &
+# if defined key_traldf_eiv
+         &      aeiudta (jpi,jpj,jpk,2), aeivdta (jpi,jpj,jpk,2),    &
+         &      aeiwdta (jpi,jpj,jpk,2),                             &
+# endif
+#endif
+#if ! defined key_degrad &&  defined key_traldf_c2d && defined key_traldf_eiv
+         &      aeiwdta (jpi,jpj,    2),                             &
+#endif
+         &      hmlddta (jpi,jpj,    2), wspddta (jpi,jpj,    2),    &
+         &      frlddta (jpi,jpj,    2), qsrdta  (jpi,jpj,    2),    &
+         &      empdta  (jpi,jpj,    2),                         STAT=dta_dyn_alloc ) 
+         !
+      IF( dta_dyn_alloc /= 0 )   CALL ctl_warn('dta_dyn_alloc: failed to allocate facvol array')
+      !
+   END FUNCTION dta_dyn_alloc
+
+
    SUBROUTINE dynrea( kt, kenr )
       !!----------------------------------------------------------------------
@@ -305,23 +337,26 @@
       !! ** Method : READ the kenr records of DATA and store in udta(...,2), ....  
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zu    => wrk_3d_1 , zv    => wrk_3d_2 , zw    => wrk_3d_3
+      USE wrk_nemo, ONLY: zt    => wrk_3d_4 , zs    => wrk_3d_5
+      USE wrk_nemo, ONLY: zavt  => wrk_3d_6 , zhdiv => wrk_3d_7
+      USE wrk_nemo, ONLY: zahtu => wrk_3d_8 , zahtv => wrk_3d_9 , zahtw => wrk_3d_10
+      USE wrk_nemo, ONLY: zaeiu => wrk_3d_11, zaeiv => wrk_3d_12, zaeiw => wrk_3d_13
+      !
+      USE wrk_nemo, ONLY: zemp  => wrk_2d_1 , zqsr  => wrk_2d_2 , zmld  => wrk_2d_3
+      USE wrk_nemo, ONLY: zice  => wrk_2d_4 , zwspd => wrk_2d_5 
+      USE wrk_nemo, ONLY: ztaux => wrk_2d_6 , ztauy => wrk_2d_7
+      USE wrk_nemo, ONLY: zbblx => wrk_2d_8 , zbbly => wrk_2d_9
+      USE wrk_nemo, ONLY: zaeiw2d => wrk_2d_10
+      !
       INTEGER, INTENT(in) ::   kt, kenr   ! time index
       !!
       INTEGER ::  jkenr
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zu, zv, zw, zt, zs, zavt , zhdiv              ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::  zemp, zqsr, zmld, zice, zwspd, ztaux, ztauy   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::  zbblx, zbbly
-
-#if ! defined key_degrad && defined key_traldf_c2d && defined key_traldf_eiv
-      REAL(wp), DIMENSION(jpi,jpj) :: zaeiw 
-#endif
-#if defined key_degrad
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zahtu, zahtv, zahtw  !  Lateral diffusivity
-# if defined key_traldf_eiv
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zaeiu, zaeiv, zaeiw  ! G&M coefficient
-# endif
-#endif
-      !!----------------------------------------------------------------------
-
-      ! 0. Initialization
+      !!----------------------------------------------------------------------
+      ! 
+      IF( wrk_in_use(3, 1,2,3,4,5,6,7,8,9,10,11,12,13) .OR. &
+          wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10)               ) THEN
+         CALL ctl_stop('domrea/dta_dyn: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
       
       ! cas d'un fichier non periodique : on utilise deux fois le premier et
@@ -390,5 +425,5 @@
 
 #if ! defined key_degrad && defined key_traldf_c2d && defined key_traldf_eiv 
-      CALL iom_get( numfl_w, jpdom_data, 'soleaeiw', zaeiw (:,: ), jkenr )
+      CALL iom_get( numfl_w, jpdom_data, 'soleaeiw', zaeiw2d(:,: ), jkenr )
 #endif
 
@@ -413,5 +448,5 @@
 
 #if ! defined key_degrad && defined key_traldf_c2d && defined key_traldf_eiv
-      aeiwdta(:,:,2)  = zaeiw(:,:) * tmask(:,:,1)
+      aeiwdta(:,:,2)  = zaeiw2d(:,:) * tmask(:,:,1)
 #endif
 
@@ -451,4 +486,9 @@
       ENDIF
       !      
+      IF( wrk_not_released(3, 1,2,3,4,5,6,7,8,9,10,11,12,13) .OR. &
+          wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10)               ) THEN
+         CALL ctl_stop('domrea/dta_dyn: failed to release workspace arrays')
+      END IF
+      !
    END SUBROUTINE dynrea
 
@@ -462,16 +502,15 @@
       !! ** Method :
       !!----------------------------------------------------------------------
-      REAL(wp) ::   znspyr   !: number of time step per year
-      !!
+      REAL(wp) :: znspyr   !: number of time step per year
+      !
       NAMELIST/namdyn/ ndtadyn, ndtatot, nsptint, lperdyn,  &
-      &                cfile_grid_T, cfile_grid_U, cfile_grid_V, cfile_grid_W
-      !!----------------------------------------------------------------------
-
-      !  Define the dynamical input parameters
-      ! ======================================
-
+         &             cfile_grid_T, cfile_grid_U, cfile_grid_V, cfile_grid_W
+      !!----------------------------------------------------------------------
+      !
+      IF( dta_dyn_alloc() /= 0 )  CALL ctl_stop( 'STOP', 'dta_dyn_alloc: unable to allocate standard ocean arrays' )
+      !
       REWIND( numnam )              ! Read Namelist namdyn : Lateral physics on tracers
       READ  ( numnam, namdyn )
-
+      !
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
@@ -493,5 +532,5 @@
       !
       znspyr   = nyear_len(1) * rday / rdt  
-      rnspdta  = znspyr / FLOAT( ndtadyn )
+      rnspdta  = znspyr / REAL( ndtadyn, wp )
       rnspdta2 = rnspdta * 0.5 
       !
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2715)
@@ -5,4 +5,5 @@
    !!======================================================================
    !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line
+   !!            4.0  ! 2011-01  (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 
@@ -26,4 +27,5 @@
    USE trabbl          ! bottom boundary layer          (tra_bbl_init routine)
    USE zdfini          ! vertical physics: initialization
+   USE sbcmod          ! surface boundary condition       (sbc_init     routine)
    USE phycst          ! physical constant                  (par_cst routine)
    USE dtadyn          ! Lecture and Interpolation of the dynamical fields
@@ -39,6 +41,7 @@
    USE lib_mpp         ! distributed memory computing
 #if defined key_iomput
-   USE  mod_ioclient
+   USE mod_ioclient
 #endif 
+   USE prtctl           ! Print control                    (prt_ctl_init routine)
 
    IMPLICIT NONE
@@ -122,5 +125,5 @@
       INTEGER ::   ji            ! dummy loop indices
       INTEGER ::   ilocal_comm   ! local integer
-      CHARACTER(len=80), DIMENSION(10) ::   cltxt = ''
+      CHARACTER(len=80), DIMENSION(16) ::   cltxt = ''
       !!
       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
@@ -137,12 +140,38 @@
       !                             !--------------------------------------------!
 #if defined key_iomput
-      CALL init_ioclient( ilocal_comm )       ! nemo local communicator (used or not) given by the io_server
-      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection
+      CALL  init_ioclient( ilocal_comm )                 ! exchange io_server nemo local communicator with the io_server
+      narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection
 #else
-      narea = mynode( cltxt )                 ! Nodes selection (control print return in cltxt)
+      ilocal_comm = 0
+      narea = mynode( cltxt, numnam, nstop )                 ! Nodes selection (control print return in cltxt)
 #endif
+
       narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 )
 
       lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print
+
+      ! If dimensions of processor grid weren't specified in the namelist file 
+      ! then we calculate them here now that we have our communicator size
+      IF( (jpni < 1) .OR. (jpnj < 1) )THEN
+#if   defined key_mpp_mpi   ||   defined key_mpp_shmem
+         CALL nemo_partition(mppsize)
+#else
+         jpni = 1
+         jpnj = 1
+         jpnij = jpni*jpnj
+#endif
+      END IF
+
+      ! Calculate domain dimensions given calculated jpni and jpnj
+      ! This used to be done in par_oce.F90 when they were parameters rather
+      ! than variables
+      jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim.
+      jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim.
+      jpk = jpkdta                                             ! third dim
+      jpim1 = jpi-1                                            ! inner domain indices
+      jpjm1 = jpj-1                                            !   "           "
+      jpkm1 = jpk-1                                            !   "           "
+      jpij  = jpi*jpj                                          !  jpi x j
+
 
       IF(lwp) THEN                            ! open listing units
@@ -163,4 +192,9 @@
          !
       ENDIF
+
+      ! Now we know the dimensions of the grid and numout has been set we can 
+      ! allocate arrays
+      CALL nemo_alloc()
+
       !                             !--------------------------------!
       !                             !  Model general initialization  !
@@ -181,5 +215,9 @@
                             CALL  istate_init   ! ocean initial state (Dynamics and tracers)
 
+
+      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control
+
       !                                     ! Ocean physics
+                            CALL     sbc_init   ! Forcings : surface module
 #if ! defined key_degrad
                             CALL ldf_tra_init   ! Lateral ocean tracer physics
@@ -307,4 +345,154 @@
    END SUBROUTINE nemo_closefile
 
+
+   SUBROUTINE nemo_alloc
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_alloc  ***
+      !!
+      !! ** Purpose :   Allocate all the dynamic arrays of the OPA modules
+      !!
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      USE diawri,       ONLY: dia_wri_alloc
+      USE dom_oce,      ONLY: dom_oce_alloc
+      USE zdf_oce,      ONLY: zdf_oce_alloc
+      USE zdfmxl,       ONLY: zdf_mxl_alloc
+      USE ldftra_oce,   ONLY: ldftra_oce_alloc
+      USE trc_oce,      ONLY: trc_oce_alloc
+      USE wrk_nemo,    ONLY: wrk_alloc
+      !
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
+      !
+      ierr =        oce_alloc       ()          ! ocean 
+      ierr = ierr + dia_wri_alloc   ()
+      ierr = ierr + dom_oce_alloc   ()          ! ocean domain
+      ierr = ierr + ldftra_oce_alloc()          ! ocean lateral  physics : tracers
+      ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics
+      ierr = ierr + zdf_mxl_alloc   ()          ! ocean vertical physics
+      !
+      ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges
+      ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays
+      ierr = ierr + wrk_alloc(numout, lwp)
+      !
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' )
+      !
+   END SUBROUTINE nemo_alloc
+
+
+   SUBROUTINE nemo_partition( num_pes )
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE nemo_partition  ***
+      !!
+      !! ** Purpose :   
+      !!
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have
+      !
+      INTEGER, PARAMETER :: nfactmax = 20
+      INTEGER :: nfact ! The no. of factors returned
+      INTEGER :: ierr  ! Error flag
+      INTEGER :: ji
+      INTEGER :: idiff, mindiff, imin ! For choosing pair of factors that are closest in value
+      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors
+      !!----------------------------------------------------------------------
+
+      ierr = 0
+
+      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr )
+
+      IF( nfact <= 1 ) THEN
+         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed'
+         WRITE (numout, *) '       : using grid of ',num_pes,' x 1'
+         jpnj = 1
+         jpni = num_pes
+      ELSE
+         ! Search through factors for the pair that are closest in value
+         mindiff = 1000000
+         imin    = 1
+         DO ji = 1, nfact-1, 2
+            idiff = ABS( ifact(ji) - ifact(ji+1) )
+            IF( idiff < mindiff ) THEN
+               mindiff = idiff
+               imin = ji
+            ENDIF
+         END DO
+         jpnj = ifact(imin)
+         jpni = ifact(imin + 1)
+      ENDIF
+      !
+      jpnij = jpni*jpnj
+      !
+   END SUBROUTINE nemo_partition
+
+
+   SUBROUTINE factorise( kfax, kmaxfax, knfax, kn, kerr )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE factorise  ***
+      !!
+      !! ** Purpose :   return the prime factors of n.
+      !!                knfax factors are returned in array kfax which is of 
+      !!                maximum dimension kmaxfax.
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      INTEGER                    , INTENT(in   ) ::   kn, kmaxfax
+      INTEGER                    , INTENT(  out) ::   kerr, knfax
+      INTEGER, DIMENSION(kmaxfax), INTENT(  out) ::   kfax
+      !
+      INTEGER :: ifac, jl, inu
+      INTEGER, PARAMETER :: ntest = 14
+      INTEGER :: ilfax(ntest)
+      !
+      ! lfax contains the set of allowed factors.
+      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  &
+         &                            128,   64,   32,   16,    8,   4,   2  /
+      !!----------------------------------------------------------------------
+
+      ! Clear the error flag and initialise output vars
+      kerr = 0
+      kfax = 1
+      knfax = 0
+
+      ! Find the factors of n.
+      IF( kn == 1 )   GOTO 20
+
+      ! nu holds the unfactorised part of the number.
+      ! knfax holds the number of factors found.
+      ! l points to the allowed factor list.
+      ! ifac holds the current factor.
+
+      inu   = kn
+      knfax = 0
+
+      DO jl = ntest, 1, -1
+         !
+         ifac = ilfax(jl)
+         IF( ifac > inu )   CYCLE
+
+         ! Test whether the factor will divide.
+
+         IF( MOD(inu,ifac) == 0 ) THEN
+            !
+            knfax = knfax + 1            ! Add the factor to the list
+            IF( knfax > kmaxfax ) THEN
+               kerr = 6
+               write (*,*) 'FACTOR: insufficient space in factor array ', knfax
+               return
+            ENDIF
+            kfax(knfax) = ifac
+            ! Store the other factor that goes with this one
+            knfax = knfax + 1
+            kfax(knfax) = inu / ifac
+            !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax)
+         ENDIF
+         !
+      END DO
+
+   20 CONTINUE      ! Label 20 is the exit point from the factor search loop.
+      !
+   END SUBROUTINE factorise
+
    !!======================================================================
 END MODULE nemogcm
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/zdfmxl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/zdfmxl.F90	(revision 2715)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/zdfmxl.F90	(revision 2715)
@@ -0,0 +1,119 @@
+MODULE zdfmxl
+   !!======================================================================
+   !!                       ***  MODULE  zdfmxl  ***
+   !! Ocean physics: mixed layer depth 
+   !!======================================================================
+   !! History :  1.0  ! 2003-08  (G. Madec)  original code
+   !!            3.2  ! 2009-07  (S. Masson, G. Madec)  IOM + merge of DO-loop
+   !!----------------------------------------------------------------------
+   !!   zdf_mxl      : Compute the turbocline and mixed layer depths.
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers variables
+   USE dom_oce         ! ocean space and time domain variables
+   USE zdf_oce         ! ocean vertical physics
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+   USE iom             ! I/O library
+   USE lib_mpp         ! MPP library
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   zdf_mxl       ! called by step.F90
+   PUBLIC   zdf_mxl_alloc ! called by nemogcm.F90
+
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   nmln    !: number of level in the mixed layer (used by TOP)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmld    !: mixing layer depth (turbocline)      [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlp    !: mixed layer depth  (rho=rho0+zdcrit) [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlpt   !: mixed layer depth at t-points        [m]
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id: zdfmxl.F90 2636 2011-03-01 19:04:06Z gm $ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION zdf_mxl_alloc()
+      !!----------------------------------------------------------------------
+      !!               ***  FUNCTION zdf_mxl_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), STAT=zdf_mxl_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_mxl_alloc )
+      IF( zdf_mxl_alloc /= 0 )   CALL ctl_warn('zdf_mxl_alloc: failed to allocate arrays')
+   END FUNCTION zdf_mxl_alloc
+
+
+   SUBROUTINE zdf_mxl( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE zdfmxl  ***
+      !!                   
+      !! ** Purpose :   Compute the turbocline depth and the mixed layer depth
+      !!              with density criteria.
+      !!
+      !! ** Method  :   The mixed layer depth is the shallowest W depth with 
+      !!      the density of the corresponding T point (just bellow) bellow a
+      !!      given value defined locally as rho(10m) + zrho_c
+      !!               The turbocline depth is the depth at which the vertical
+      !!      eddy diffusivity coefficient (resulting from the vertical physics
+      !!      alone, not the isopycnal part, see trazdf.F) fall below a given
+      !!      value defined locally (avt_c here taken equal to 5 cm/s2)
+      !!
+      !! ** Action  :   nmln, hmld, hmlp, hmlpt
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY:   imld => iwrk_2d_1    ! 2D integer workspace
+      !!
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !!
+      INTEGER  ::   ji, jj, jk          ! dummy loop indices
+      INTEGER  ::   iikn, iiki          ! temporary integer within a do loop
+      REAL(wp) ::   zrho_c = 0.01_wp    ! density criterion for mixed layer depth
+      REAL(wp) ::   zavt_c = 5.e-4_wp   ! Kz criterion for the turbocline depth
+      !!----------------------------------------------------------------------
+
+      IF( iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('zdf_mxl : requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth'
+         IF(lwp) WRITE(numout,*) '~~~~~~~ '
+      ENDIF
+
+      ! w-level of the mixing and mixed layers
+      nmln(:,:) = mbkt(:,:) + 1        ! Initialization to the number of w ocean point
+      imld(:,:) = mbkt(:,:) + 1
+      DO jk = jpkm1, nlb10, -1         ! from the bottom to nlb10
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               IF( rhop(ji,jj,jk) > rhop(ji,jj,nla10) + zrho_c )   nmln(ji,jj) = jk      ! Mixed layer
+               IF( avt (ji,jj,jk) < zavt_c                     )   imld(ji,jj) = jk      ! Turbocline 
+            END DO
+         END DO
+      END DO
+      ! depth of the mixing and mixed layers
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            iiki = imld(ji,jj)
+            iikn = nmln(ji,jj)
+            hmld (ji,jj) = fsdepw(ji,jj,iiki  ) * tmask(ji,jj,1)    ! Turbocline depth 
+            hmlp (ji,jj) = fsdepw(ji,jj,iikn  ) * tmask(ji,jj,1)    ! Mixed layer depth
+            hmlpt(ji,jj) = fsdept(ji,jj,iikn-1)                     ! depth of the last T-point inside the mixed layer
+         END DO
+      END DO
+      CALL iom_put( "mldr10_1", hmlp )   ! mixed layer depth
+      CALL iom_put( "mldkz5"  , hmld )   ! turbocline depth
+      
+      IF(ln_ctl)   CALL prt_ctl( tab2d_1=REAL(nmln,wp), clinfo1=' nmln : ', tab2d_2=hmlp, clinfo2=' hmlp : ', ovlap=1 )
+      !
+      IF( iwrk_not_released(2, 1) )   CALL ctl_stop('zdf_mxl: failed to release workspace array')
+      !
+   END SUBROUTINE zdf_mxl
+
+   !!======================================================================
+END MODULE zdfmxl
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 2715)
@@ -21,5 +21,4 @@
    !!   ssh_asm_inc  : Apply the SSH increment
    !!----------------------------------------------------------------------
-   USE in_out_manager   ! I/O manager
    USE par_oce          ! Ocean space and time domain variables
    USE dom_oce          ! Ocean space and time domain
@@ -31,4 +30,6 @@
    USE asmpar           ! Parameters for the assmilation interface
    USE c1d              ! 1D initialization
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp           ! MPP library
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90	(revision 2715)
@@ -14,4 +14,5 @@
    USE par_oce         ! ocean parameters
    USE bdy_par         ! Unstructured boundary parameters
+   USE lib_mpp         ! distributed memory computing
 
    IMPLICIT NONE
@@ -32,7 +33,6 @@
    LOGICAL ::   ln_vol  = .false.     !: =T volume correction             
    LOGICAL ::   ln_mask = .false.     !: =T read bdymask from file
-   LOGICAL ::   ln_clim = .false.     !: if true, we assume that bdy data files contain 
-   !                                    !  1 time dump  (-->bdy forcing will be constant) 
-   !                                    !  or 12 months (-->bdy forcing will be cyclic) 
+   LOGICAL ::   ln_clim = .false.     !: =T bdy data files contain  1 time dump  (-->bdy forcing will be constant) 
+   !                                  !                         or 12 months     (-->bdy forcing will be cyclic) 
    LOGICAL ::   ln_dyn_fla  = .false. !: =T Flather boundary conditions on barotropic velocities
    LOGICAL ::   ln_dyn_frs  = .false. !: =T FRS boundary conditions on velocities
@@ -40,15 +40,15 @@
    LOGICAL ::   ln_ice_frs  = .false. !: =T FRS boundary conditions on seaice (leads fraction, ice depth, snow depth)
    !
-   INTEGER ::   nn_rimwidth = 7         !: boundary rim width
-   INTEGER ::   nn_dtactl   = 1	        !: = 0 use the initial state as bdy dta or = 1 read it in a NetCDF file
-   INTEGER ::   nn_volctl   = 1         !: = 0 the total volume will have the variability of the surface Flux E-P 
-   !                                    !  = 1 the volume will be constant during all the integration.
+   INTEGER ::   nn_rimwidth = 7       !: boundary rim width
+   INTEGER ::   nn_dtactl   = 1	     !: = 0 use the initial state as bdy dta ; = 1 read it in a NetCDF file
+   INTEGER ::   nn_volctl   = 1       !: = 0 the total volume will have the variability of the surface Flux E-P 
+   !                                  !  = 1 the volume will be constant during all the integration.
 
    !!----------------------------------------------------------------------
    !! Global variables
    !!----------------------------------------------------------------------
-   REAL(wp), DIMENSION(jpi,jpj) ::   bdytmask   !: Mask defining computational domain at T-points
-   REAL(wp), DIMENSION(jpi,jpj) ::   bdyumask   !: Mask defining computational domain at U-points
-   REAL(wp), DIMENSION(jpi,jpj) ::   bdyvmask   !: Mask defining computational domain at V-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdytmask   !: Mask defining computational domain at T-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyumask   !: Mask defining computational domain at U-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyvmask   !: Mask defining computational domain at V-points
 
    !!----------------------------------------------------------------------
@@ -63,5 +63,5 @@
    INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbmap           !: Indices of data in file for data in memory 
     
-   REAL(wp) ::   bdysurftot	                          !: Lateral surface of unstructured open boundary
+   REAL(wp) ::   bdysurftot	                            !: Lateral surface of unstructured open boundary
 
    REAL(wp), DIMENSION(jpbdim)        ::   flagu, flagv   !: Flag for normal velocity compnt for velocity components
@@ -70,13 +70,36 @@
    REAL(wp), DIMENSION(jpbdim)     ::   sshbdy            !: Now clim of bdy sea surface height (Flather)
    REAL(wp), DIMENSION(jpbdim)     ::   ubtbdy, vbtbdy    !: Now clim of bdy barotropic velocity components
-   REAL(wp), DIMENSION(jpbdim,jpk) ::   tbdy  , sbdy      !: Now clim of bdy temperature and salinity  
-   REAL(wp), DIMENSION(jpbdim,jpk) ::   ubdy  , vbdy	  !: Now clim of bdy velocity components
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tbdy  , sbdy      !: Now clim of bdy temperature and salinity  
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ubdy  , vbdy	  !: Now clim of bdy velocity components
    REAL(wp), DIMENSION(jpbdim) ::   sshtide               !: Tidal boundary array : SSH
    REAL(wp), DIMENSION(jpbdim) ::   utide, vtide          !: Tidal boundary array : U and V
 #if defined key_lim2
-   REAL(wp), DIMENSION(jpbdim) ::  &
-      frld_bdy, hicif_bdy,  & !: Now clim of ice leads fraction, ice  
-      hsnif_bdy               !: thickness and snow thickness
+   REAL(wp), DIMENSION(jpbdim) ::   frld_bdy    !: now ice leads fraction climatology   
+   REAL(wp), DIMENSION(jpbdim) ::   hicif_bdy   !: Now ice  thickness climatology
+   REAL(wp), DIMENSION(jpbdim) ::   hsnif_bdy   !: now snow thickness
 #endif
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   FUNCTION bdy_oce_alloc()
+      !!----------------------------------------------------------------------
+      USE lib_mpp, ONLY: ctl_warn, mpp_sum
+      !
+      INTEGER :: bdy_oce_alloc
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( bdytmask(jpi,jpj) , tbdy(jpbdim,jpk) , sbdy(jpbdim,jpk) ,     &
+         &      bdyumask(jpi,jpj) , ubdy(jpbdim,jpk) ,                        &
+         &      bdyvmask(jpi,jpj) , vbdy(jpbdim,jpk) ,                    STAT=bdy_oce_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( bdy_oce_alloc )
+      IF( bdy_oce_alloc /= 0 )   CALL ctl_warn('bdy_oce_alloc: failed to allocate arrays.')
+      !
+   END FUNCTION bdy_oce_alloc
 
 #else
@@ -87,8 +110,4 @@
 #endif
 
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE bdy_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 2715)
@@ -35,4 +35,5 @@
    PUBLIC   bdy_dta_frs      ! routines called by step.F90
    PUBLIC   bdy_dta_fla 
+   PUBLIC   bdy_dta_alloc    ! routine called by bdy_init.F90
 
    INTEGER ::   numbdyt, numbdyu, numbdyv                      ! logical units for T-, U-, & V-points data file, resp.
@@ -47,6 +48,6 @@
    REAL(wp) ::  zoffset                                        ! time offset between time origin in file & start time of model run
 
-   REAL(wp), DIMENSION(jpbdim,jpk,2) ::   tbdydta, sbdydta     ! time interpolated values of T and S bdy data   
-   REAL(wp), DIMENSION(jpbdim,jpk,2) ::   ubdydta, vbdydta     ! time interpolated values of U and V bdy data 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tbdydta, sbdydta   ! time interpolated values of T and S bdy data   
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ubdydta, vbdydta   ! time interpolated values of U and V bdy data 
    REAL(wp), DIMENSION(jpbdim,2)     ::   ubtbdydta, vbtbdydta ! Arrays used for time interpolation of bdy data   
    REAL(wp), DIMENSION(jpbdim,2)     ::   sshbdydta            ! bdy data of ssh
@@ -64,4 +65,20 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+  FUNCTION bdy_dta_alloc()
+     !!----------------------------------------------------------------------
+     USE lib_mpp, ONLY: ctl_warn, mpp_sum
+     !
+     INTEGER :: bdy_dta_alloc
+     !!----------------------------------------------------------------------
+     !
+     ALLOCATE(tbdydta(jpbdim,jpk,2), sbdydta(jpbdim,jpk,2), &
+              ubdydta(jpbdim,jpk,2), vbdydta(jpbdim,jpk,2), Stat=bdy_dta_alloc)
+
+     IF( lk_mpp           ) CALL mpp_sum ( bdy_dta_alloc )
+     IF(bdy_dta_alloc /= 0) CALL ctl_warn('bdy_dta_alloc: failed to allocate arrays')
+
+   END FUNCTION bdy_dta_alloc
+
 
    SUBROUTINE bdy_dta_frs( kt )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice.F90	(revision 2715)
@@ -19,4 +19,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  ! write to numout file
+   USE lib_mpp         ! distributed memory computing
    
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 2715)
@@ -21,4 +21,5 @@
    USE obc_par         ! ocean open boundary conditions
    USE bdy_oce         ! unstructured open boundary conditions
+   USE bdydta, ONLY: bdy_dta_alloc ! open boundary data
    USE bdytides        ! tides at open boundaries initialization (tide_init routine)
    USE in_out_manager  ! I/O units
@@ -33,7 +34,7 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -44,30 +45,27 @@
       !!         
       !! ** Purpose :   Initialization of the dynamics and tracer fields with 
-      !!      unstructured open boundaries.
+      !!              unstructured open boundaries.
       !!
-      !! ** Method  :  Read initialization arrays (mask, indices) to identify 
-      !!               an unstructured open boundary
+      !! ** Method  :   Read initialization arrays (mask, indices) to identify 
+      !!              an unstructured open boundary
       !!
       !! ** Input   :  bdy_init.nc, input file for unstructured open boundaries
       !!----------------------------------------------------------------------      
-      INTEGER ::   ii, ij, ik, igrd, ib, ir   ! dummy loop indices
-      INTEGER ::   icount, icountr
-      INTEGER ::   ib_len, ibr_max
-      INTEGER ::   iw, ie, is, in 
-      INTEGER ::   inum                 ! local logical unit
-      INTEGER ::   id_dummy             ! local integers
-      INTEGER ::   igrd_start, igrd_end ! start and end of loops on igrd
+      INTEGER  ::   ii, ij, ik, igrd, ib, ir   ! dummy loop indices
+      INTEGER  ::   icount, icountr, ib_len, ibr_max   ! local integers
+      INTEGER  ::   iw, ie, is, in, inum, id_dummy     !   -       -
+      INTEGER  ::   igrd_start, igrd_end               !   -       -
+      REAL(wp) ::   zefl, zwfl, znfl, zsfl              ! local scalars
       INTEGER, DIMENSION (2)             ::   kdimsz
       INTEGER, DIMENSION(jpbdta, jpbgrd) ::   nbidta, nbjdta   ! Index arrays: i and j indices of bdy dta
       INTEGER, DIMENSION(jpbdta, jpbgrd) ::   nbrdta           ! Discrete distance from rim points
-      REAL(wp) :: zefl, zwfl, znfl, zsfl                       ! temporary scalars
-      REAL(wp) , DIMENSION(jpidta,jpjdta) ::   zmask           ! global domain mask
-      REAL(wp) , DIMENSION(jpbdta,1)      ::   zdta            ! temporary array 
-      CHARACTER(LEN=80),DIMENSION(6)      ::   clfile
+      REAL(wp), DIMENSION(jpidta,jpjdta) ::   zmask            ! global domain mask
+      REAL(wp), DIMENSION(jpbdta,1)      ::   zdta             ! temporary array 
+      CHARACTER(LEN=80),DIMENSION(6)     ::   clfile
       !!
-      NAMELIST/nambdy/cn_mask, cn_dta_frs_T, cn_dta_frs_U, cn_dta_frs_V,          &
-         &            cn_dta_fla_T, cn_dta_fla_U, cn_dta_fla_V,              &
-         &            ln_tides, ln_clim, ln_vol, ln_mask,                &
-         &            ln_dyn_fla, ln_dyn_frs, ln_tra_frs,ln_ice_frs,     &
+      NAMELIST/nambdy/cn_mask, cn_dta_frs_T, cn_dta_frs_U, cn_dta_frs_V,   &
+         &            cn_dta_fla_T, cn_dta_fla_U, cn_dta_fla_V,            &
+         &            ln_tides, ln_clim, ln_vol, ln_mask,                  &
+         &            ln_dyn_fla, ln_dyn_frs, ln_tra_frs,ln_ice_frs,       &
          &            nn_dtactl, nn_rimwidth, nn_volctl
       !!----------------------------------------------------------------------
@@ -77,4 +75,8 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~~'
       !
+      !                                      ! allocate bdy_oce arrays
+      IF( bdy_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'bdy_init : unable to allocate oce arrays' )
+      IF( bdy_dta_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'bdy_init : unable to allocate dta arrays' )
+
       IF( jperio /= 0 )   CALL ctl_stop( 'Cyclic or symmetric,',   &
          &                               ' and unstructured open boundary condition are not compatible' )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 2715)
@@ -7,5 +7,5 @@
    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA
    !!----------------------------------------------------------------------
-#if defined key_diaar5
+#if defined key_diaar5   || defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_diaar5'  :                           activate ar5 diagnotics
@@ -25,4 +25,5 @@
    PUBLIC   dia_ar5        ! routine called in step.F90 module
    PUBLIC   dia_ar5_init   ! routine called in opa.F90 module
+   PUBLIC   dia_ar5_alloc  ! routine called in nemogcm.F90 module
 
    LOGICAL, PUBLIC, PARAMETER :: lk_diaar5 = .TRUE.   ! coupled flag
@@ -30,7 +31,7 @@
    REAL(wp)                         ::   vol0         ! ocean volume (interior domain)
    REAL(wp)                         ::   area_tot     ! total ocean surface (interior domain)
-   REAL(wp), DIMENSION(jpi,jpj    ) ::   area         ! cell surface (interior domain)
-   REAL(wp), DIMENSION(jpi,jpj    ) ::   thick0       ! ocean thickness (interior domain)
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   sn0          ! initial salinity
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   area         ! cell surface (interior domain)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:  ) ::   thick0       ! ocean thickness (interior domain)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sn0          ! initial salinity
       
    !! * Substitutions
@@ -43,4 +44,19 @@
 CONTAINS
 
+   FUNCTION dia_ar5_alloc()
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE dia_ar5_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER :: dia_ar5_alloc
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( area(jpi,jpj), thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( dia_ar5_alloc )
+      IF( dia_ar5_alloc /= 0 )   CALL ctl_warn('dia_ar5_alloc: failed to allocate arrays')
+      !
+   END FUNCTION dia_ar5_alloc
+
+
    SUBROUTINE dia_ar5( kt )
       !!----------------------------------------------------------------------
@@ -48,14 +64,21 @@
       !!
       !! ** Purpose :   compute and output some AR5 diagnostics
-      !!
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zarea_ssh => wrk_2d_1 , zbotpres => wrk_2d_2   ! 2D workspace
+      USE wrk_nemo, ONLY:   zrhd      => wrk_3d_1 , zrhop    => wrk_3d_2   ! 3D      -
+      USE wrk_nemo, ONLY:   ztsn      => wrk_4d_1                          ! 4D      -
+      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk                      ! dummy loop arguments
       REAL(wp) ::   zvolssh, zvol, zssh_steric, zztmp, zarho, ztemp, zsal, zmass
-      REAL(wp), DIMENSION(jpi,jpj    ) ::   zarea_ssh, zbotpres
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zrhd, zrhop
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts) ::   ztsn
       !!--------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) .OR.   &
+          wrk_in_use(3, 1,2) .OR.   &
+          wrk_in_use(4, 1)   ) THEN
+         CALL ctl_stop('dia_ar5: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       CALL iom_put( 'cellthc', fse3t(:,:,:) )
@@ -137,4 +160,8 @@
       CALL iom_put( 'saltot' , zsal  )
       !
+      IF( wrk_not_released(2, 1,2) .OR.   &
+          wrk_not_released(3, 1,2) .OR.   &
+          wrk_not_released(4, 1)   )   CALL ctl_stop('dia_ar5: failed to release workspace arrays')
+      !
    END SUBROUTINE dia_ar5
 
@@ -146,11 +173,22 @@
       !! ** Purpose :   initialization for AR5 diagnostic computation
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_4d_1      ! 4D workspace
+      !
       INTEGER  ::   inum
       INTEGER  ::   ik
       INTEGER  ::   ji, jj, jk  ! dummy loop indices
       REAL(wp) ::   zztmp  
-      REAL(wp), DIMENSION(jpi,jpj,jpk, 2) ::   zsaldta   ! Jan/Dec levitus salinity
-      !!----------------------------------------------------------------------
-      !
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   zsaldta   ! Jan/Dec levitus salinity
+      !!----------------------------------------------------------------------
+      !
+      IF(wrk_in_use(4, 1) ) THEN
+         CALL ctl_stop('dia_ar5_init: requested workspace array unavailable.')   ;   RETURN
+      ENDIF
+      zsaldta => wrk_4d_1(:,:,:,1:2)
+
+      !                                      ! allocate dia_ar5 arrays
+      IF( dia_ar5_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' )
+
       area(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:)
 
@@ -183,4 +221,6 @@
       ENDIF
       !
+      IF( wrk_not_released(4, 1) )   CALL ctl_stop('dia_ar5_init: failed to release workspace array')
+      !
    END SUBROUTINE dia_ar5_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diadimg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diadimg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diadimg.F90	(revision 2715)
@@ -6,5 +6,4 @@
 # if defined key_dimgout
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers 
    USE dom_oce         ! ocean space and time domain
@@ -15,10 +14,15 @@
    PRIVATE
 
-   !! * Accessibility
    PUBLIC dia_wri_dimg            ! called by trd_mld (eg)
+   PUBLIC dia_wri_dimg_alloc      ! called by nemo_alloc in nemogcm.F90
+
+
+   !! These workspace arrays are inside the module so that we can make them
+   !! allocatable in a clean way. Not done in wrk_nemo because these are of KIND(sp).
+   REAL(sp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: z42d    ! 2d temporary workspace (sp)
+   REAL(sp), ALLOCATABLE, SAVE, DIMENSION(:)   :: z4dep   ! vertical level (sp)
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
-
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
@@ -26,24 +30,36 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
-  SUBROUTINE dia_wri_dimg(cd_name, cd_text, ptab, klev, cd_type , ksubi )
+   FUNCTION dia_wri_dimg_alloc()
+      !!---------------------------------------------------------------------
+      !!        *** ROUTINE dia_wri_dimg_alloc ***
+      !!
+      !!---------------------------------------------------------------------
+      INTEGER :: dia_wri_dimg_alloc   ! return value
+      !!---------------------------------------------------------------------
+      !
+      ALLOCATE( z42d(jpi,jpj), z4dep(jpk), STAT=dia_wri_dimg_alloc )
+      !
+      IF( lk_mpp                  )   CALL mpp_sum ( dia_wri_dimg_alloc )
+      IF( dia_wri_dimg_alloc /= 0 )   CALL ctl_warn('dia_wri_dimg_alloc: allocation of array failed.')
+      !
+  END FUNCTION dia_wri_dimg_alloc
+
+
+  SUBROUTINE dia_wri_dimg( cd_name, cd_text, ptab, klev, cd_type , ksubi )
     !!-------------------------------------------------------------------------
     !!        *** ROUTINE dia_wri_dimg ***
     !!
-    !! ** Purpose : write ptab in the dimg file cd_name, with comment cd_text.
-    !!       ptab has klev x 2D fields
+    !! ** Purpose :   write ptab in the dimg file cd_name, with comment cd_text.
+    !!              ptab has klev x 2D fields
     !!
-    !! ** Action :
-    !!       Define header variables from the config parameters
-    !!       Open the dimg file on unit inum = 14 ( IEEE I4R4 file )
-    !!       Write header on record 1
-    !!       Write ptab on the following klev records
+    !! ** Action :   Define header variables from the config parameters
+    !!               Open the dimg file on unit inum = 14 ( IEEE I4R4 file )
+    !!               Write header on record 1
+    !!               Write ptab on the following klev records
     !!
-    !! History :
-    !!   03-12 (J.M. Molines ) : Original. Replace ctl_opn, writn2d
+    !! History :  2003-12 (J.M. Molines ) : Original. Replace ctl_opn, writn2d
     !!---------------------------------------------------------------------------
-    !! * Arguments
     CHARACTER(len=*),INTENT(in) ::   &
          &                            cd_name,  &  ! dimg file name
@@ -63,10 +79,11 @@
     REAL(sp)                    :: zdx,zdy,zspval,zwest,ztimm
     REAL(sp)                    :: zsouth
-    REAL(sp),DIMENSION(jpi,jpj) :: z42d        ! 2d temporary workspace (sp)
-    REAL(sp),DIMENSION(jpk)     :: z4dep       ! vertical level (sp)
 
     CHARACTER(LEN=80) :: clname                ! name of file in case of dimgnnn
     CHARACTER(LEN=4) :: clver='@!01'           ! dimg string identifier
     !!---------------------------------------------------------------------------
+
+    !                                      ! allocate dia_wri_dimg array
+    IF( dia_wri_dimg_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dia_wri_dimg : unable to allocate arrays' )
 
     !! * Initialisations
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 2715)
@@ -21,4 +21,5 @@
    USE phycst          ! physical constants
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE iom             ! I/O library
 
@@ -26,21 +27,35 @@
    PRIVATE
 
-   PUBLIC   dia_hth    ! routine called by step.F90
-
-   LOGICAL , PUBLIC, PARAMETER          ::   lk_diahth = .TRUE.   !: thermocline-20d depths flag
+   PUBLIC   dia_hth       ! routine called by step.F90
+   PUBLIC   dia_hth_alloc ! routine called by nemogcm.F90
+
+   LOGICAL , PUBLIC, PARAMETER          ::   lk_diahth = .TRUE.    !: thermocline-20d depths flag
    ! note: following variables should move to local variables once iom_put is always used 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hth                  !: depth of the max vertical temperature gradient [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hd20                 !: depth of 20 C isotherm                         [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hd28                 !: depth of 28 C isotherm                         [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   htc3                 !: heat content of first 300 m                    [W]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hth    !: depth of the max vertical temperature gradient [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hd20   !: depth of 20 C isotherm                         [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hd28   !: depth of 28 C isotherm                         [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   htc3   !: heat content of first 300 m                    [W]
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   FUNCTION dia_hth_alloc()
+      !!---------------------------------------------------------------------
+      INTEGER :: dia_hth_alloc
+      !!---------------------------------------------------------------------
+      !
+      ALLOCATE(hth(jpi,jpj), hd20(jpi,jpj), hd28(jpi,jpj), htc3(jpi,jpj), STAT=dia_hth_alloc)
+      !
+      IF( lk_mpp           )   CALL mpp_sum ( dia_hth_alloc )
+      IF(dia_hth_alloc /= 0)   CALL ctl_warn('dia_hth_alloc: failed to allocate arrays.')
+      !
+   END FUNCTION dia_hth_alloc
+
 
    SUBROUTINE dia_hth( kt )
@@ -68,5 +83,5 @@
       INTEGER                          ::   ji, jj, jk            ! dummy loop arguments
       INTEGER                          ::   iid, ilevel           ! temporary integers
-      INTEGER, DIMENSION(jpi,jpj)      ::   ik20, ik28            ! levels
+      INTEGER, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ik20, ik28  ! levels
       REAL(wp)                         ::   zavt5 = 5.e-4_wp      ! Kz criterion for the turbocline depth
       REAL(wp)                         ::   zrho3 = 0.03_wp       ! density     criterion for mixed layer depth
@@ -76,18 +91,38 @@
       REAL(wp)                         ::   zztmp, zzdep          ! temporary scalars inside do loop
       REAL(wp)                         ::   zu, zv, zw, zut, zvt  ! temporary workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zabs2                 ! MLD: abs( tn - tn(10m) ) = ztem2 
-      REAL(wp), DIMENSION(jpi,jpj)     ::   ztm2                  ! Top of thermocline: tn = tn(10m) - ztem2     
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zrho10_3              ! MLD: rho = rho10m + zrho3      
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zpycn                 ! pycnocline: rho = rho10m + (dr/dT)(T,S,10m)*(-0.2 degC)
-      REAL(wp), DIMENSION(jpi,jpj)     ::   ztinv                 ! max of temperature inversion
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdepinv               ! depth of temperature inversion
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zrho0_3               ! MLD rho = rho(surf) = 0.03
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zrho0_1               ! MLD rho = rho(surf) = 0.01
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zmaxdzT               ! max of dT/dz
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zthick                ! vertical integration thickness 
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdelr                 ! delta rho equivalent to deltaT = 0.2
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zabs2      ! MLD: abs( tn - tn(10m) ) = ztem2 
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ztm2       ! Top of thermocline: tn = tn(10m) - ztem2     
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zrho10_3   ! MLD: rho = rho10m + zrho3      
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zpycn      ! pycnocline: rho = rho10m + (dr/dT)(T,S,10m)*(-0.2 degC)
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ztinv      ! max of temperature inversion
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zdepinv    ! depth of temperature inversion
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zrho0_3    ! MLD rho = rho(surf) = 0.03
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zrho0_1    ! MLD rho = rho(surf) = 0.01
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zmaxdzT    ! max of dT/dz
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zthick     ! vertical integration thickness 
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zdelr      ! delta rho equivalent to deltaT = 0.2
       !!----------------------------------------------------------------------
 
       IF( kt == nit000 ) THEN
+         !                                      ! allocate dia_hth array
+         IF( dia_hth_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_init : unable to allocate standard arrays' )
+
+         IF(.not. ALLOCATED(ik20))THEN
+            ALLOCATE(ik20(jpi,jpj), ik28(jpi,jpj), &
+               &      zabs2(jpi,jpj),   &
+               &      ztm2(jpi,jpj),    &
+               &      zrho10_3(jpi,jpj),&
+               &      zpycn(jpi,jpj),   &
+               &      ztinv(jpi,jpj),   &
+               &      zdepinv(jpi,jpj), &
+               &      zrho0_3(jpi,jpj), &
+               &      zrho0_1(jpi,jpj), &
+               &      zmaxdzT(jpi,jpj), &
+               &      zthick(jpi,jpj),  &
+               &      zdelr(jpi,jpj), STAT=ji)
+            IF( lk_mpp  )   CALL mpp_sum(ji)
+            IF( ji /= 0 )   CALL ctl_stop( 'STOP', 'dia_hth : unable to allocate standard ocean arrays' )
+         END IF
+
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'dia_hth : diagnostics of the thermocline depth'
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 2715)
@@ -50,16 +50,15 @@
    INTEGER , PUBLIC ::   nn_fwri    = 15        !: frequency of ptr outputs      [time step]
 
-   REAL(wp), PUBLIC, DIMENSION(:), ALLOCATABLE ::   htr_adv, htr_ldf, htr_ove   !: Heat TRansports (adv, diff, overturn.)
-   REAL(wp), PUBLIC, DIMENSION(:), ALLOCATABLE ::   str_adv, str_ldf, str_ove   !: Salt TRansports (adv, diff, overturn.)
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:) ::   htr_adv, htr_ldf, htr_ove   !: Heat TRansports (adv, diff, overturn.)
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:) ::   str_adv, str_ldf, str_ove   !: Salt TRansports (adv, diff, overturn.)
    
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   btmsk                  ! T-point basin interior masks
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   btm30                  ! mask out Southern Ocean (=0 south of 30°S)
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   htr  , str             ! adv heat and salt transports (approx)
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   tn_jk, sn_jk , v_msf   ! i-mean T and S, j-Stream-Function
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   sjk  , r1_sjk          ! i-mean i-k-surface and its inverse        
-#if defined key_diaeiv
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   htr_eiv, str_eiv   ! bolus adv heat ans salt transports    ('key_diaeiv')
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   v_msf_eiv          ! bolus j-streamfuction                 ('key_diaeiv')
-#endif
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   btmsk                  ! T-point basin interior masks
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   btm30                  ! mask out Southern Ocean (=0 south of 30°S)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htr  , str             ! adv heat and salt transports (approx)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_jk, sn_jk , v_msf   ! i-mean T and S, j-Stream-Function
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sjk  , r1_sjk          ! i-mean i-k-surface and its inverse        
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htr_eiv, str_eiv       ! bolus adv heat ans salt transports ('key_diaeiv')
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   v_msf_eiv              ! bolus j-streamfuction              ('key_diaeiv')
+
 
    INTEGER ::   niter       !
@@ -71,4 +70,13 @@
    REAL(wp) ::   rc_pwatt = 1.e-15_wp  ! conversion from W    to PW (further x rau0 x Cp)
    REAL(wp) ::   rc_ggram = 1.e-6_wp   ! conversion from g    to Pg
+
+   REAL(wp), TARGET, DIMENSION(:),   ALLOCATABLE, SAVE :: p_fval1d
+   REAL(wp), TARGET, DIMENSION(:,:), ALLOCATABLE, SAVE :: p_fval2d
+
+   !! Integer, 1D workspace arrays. Not common enough to be implemented in 
+   !! wrk_nemo module.
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: ndex  , ndex_atl     , ndex_pac     , ndex_ind     , ndex_ipc
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) ::         ndex_atl_30  , ndex_pac_30  , ndex_ind_30  , ndex_ipc_30
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: ndex_h, ndex_h_atl_30, ndex_h_pac_30, ndex_h_ind_30, ndex_h_ipc_30
 
    !! * Substitutions
@@ -82,4 +90,41 @@
 CONTAINS
 
+   FUNCTION dia_ptr_alloc()
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE dia_ptr_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER               ::   dia_ptr_alloc   ! return value
+      INTEGER, DIMENSION(5) ::   ierr
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( btmsk(jpi,jpj,nptr) ,           &
+         &      htr_adv(jpj) , str_adv(jpj) ,   &
+         &      htr_ldf(jpj) , str_ldf(jpj) ,   &
+         &      htr_ove(jpj) , str_ove(jpj),    &
+         &      htr(jpj,nptr) , str(jpj,nptr) , &
+         &      tn_jk(jpj,jpk,nptr) , sn_jk (jpj,jpk,nptr) , v_msf(jpj,jpk,nptr) , &
+         &      sjk  (jpj,jpk,nptr) , r1_sjk(jpj,jpk,nptr) , STAT=ierr(1)  )
+         !
+#if defined key_diaeiv
+      ALLOCATE( htr_eiv(jpj,nptr) , str_eiv(jpj,nptr) , &
+         &      v_msf_eiv(jpj,jpk,nptr) , STAT=ierr(2) )
+#endif
+      ALLOCATE( p_fval1d(jpj), p_fval2d(jpj,jpk), Stat=ierr(3))
+      !
+      ALLOCATE(ndex(jpj*jpk),        ndex_atl(jpj*jpk), ndex_pac(jpj*jpk), &
+         &     ndex_ind(jpj*jpk),    ndex_ipc(jpj*jpk),                    &
+         &     ndex_atl_30(jpj*jpk), ndex_pac_30(jpj*jpk), Stat=ierr(4))
+
+      ALLOCATE(ndex_ind_30(jpj*jpk), ndex_ipc_30(jpj*jpk),                   &
+         &     ndex_h(jpj),          ndex_h_atl_30(jpj), ndex_h_pac_30(jpj), &
+         &     ndex_h_ind_30(jpj),   ndex_h_ipc_30(jpj), Stat=ierr(5) )
+         !
+      dia_ptr_alloc = MAXVAL( ierr )
+      IF(lk_mpp)   CALL mpp_sum( dia_ptr_alloc )
+      !
+   END FUNCTION dia_ptr_alloc
+
+
    FUNCTION ptr_vj_3d( pva )   RESULT ( p_fval )
       !!----------------------------------------------------------------------
@@ -97,7 +142,9 @@
       INTEGER                  ::   ji, jj, jk   ! dummy loop arguments
       INTEGER                  ::   ijpj         ! ???
-      REAL(wp), DIMENSION(jpj) ::   p_fval       ! function value
+      REAL(wp), POINTER, DIMENSION(:) :: p_fval  ! function value
       !!--------------------------------------------------------------------
       !
+      p_fval => p_fval1d
+
       ijpj = jpj
       p_fval(:) = 0._wp
@@ -109,7 +156,6 @@
          END DO
       END DO
-      !
-#if defined key_mpp_mpi
-      CALL mpp_sum( p_fval, ijpj, ncomm_znl)
+#if defined key_mpp_mpi
+      IF(lk_mpp)   CALL mpp_sum( p_fval, ijpj, ncomm_znl)
 #endif
       !
@@ -128,11 +174,14 @@
       !! ** Action  : - p_fval: i-k-mean poleward flux of pva
       !!----------------------------------------------------------------------
+      IMPLICIT none
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pva   ! mask flux array at V-point
       !!
-      INTEGER                  ::   ji,jj    ! dummy loop arguments
-      INTEGER                  ::   ijpj     ! ???
-      REAL(wp), DIMENSION(jpj) ::   p_fval   ! function value
+      INTEGER                  ::   ji,jj       ! dummy loop arguments
+      INTEGER                  ::   ijpj        ! ???
+      REAL(wp), POINTER, DIMENSION(:) :: p_fval ! function value
       !!--------------------------------------------------------------------
       ! 
+      p_fval => p_fval1d
+
       ijpj = jpj
       p_fval(:) = 0._wp
@@ -142,5 +191,4 @@
          END DO
       END DO
-      !
 #if defined key_mpp_mpi
       CALL mpp_sum( p_fval, ijpj, ncomm_znl )
@@ -161,16 +209,30 @@
       !! ** Action  : - p_fval: i-mean poleward flux of pva
       !!----------------------------------------------------------------------
+#if defined key_mpp_mpi
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwork => wrk_1d_1
+#endif
+      !!
+      IMPLICIT none
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva    ! mask flux array at V-point
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)    , OPTIONAL ::   pmsk   ! Optional 2D basin mask
       !!
-      INTEGER                      ::   ji, jj, jk   ! dummy loop arguments
-      REAL(wp), DIMENSION(jpj,jpk) ::   p_fval       ! return function value
+      INTEGER                           :: ji, jj, jk ! dummy loop arguments
+      REAL(wp), POINTER, DIMENSION(:,:) :: p_fval     ! return function value
 #if defined key_mpp_mpi
       INTEGER, DIMENSION(1) ::   ish
       INTEGER, DIMENSION(2) ::   ish2
-      REAL(wp), DIMENSION(jpj*jpk) ::   zwork   ! 1D workspace
+      INTEGER               ::   ijpjjpk
 #endif
       !!--------------------------------------------------------------------
       !
+#if defined key_mpp_mpi
+      IF( wrk_in_use(1, 1) ) THEN
+         CALL ctl_stop('ptr_vjk: ERROR - requested workspace array is unavailable')   ;   RETURN
+      END IF
+#endif
+
+      p_fval => p_fval2d
+
       p_fval(:,:) = 0._wp
       !
@@ -195,10 +257,15 @@
       !
 #if defined key_mpp_mpi
-      ish(1) = jpj*jpk   ;   ish2(1) = jpj   ;   ish2(2) = jpk
-      zwork(:) = RESHAPE( p_fval, ish )
-      CALL mpp_sum( zwork, jpj*jpk, ncomm_znl )
+      ijpjjpk = jpj*jpk
+      ish(1) = ijpjjpk  ;   ish2(1) = jpj   ;   ish2(2) = jpk
+      zwork(1:ijpjjpk) = RESHAPE( p_fval, ish )
+      CALL mpp_sum( zwork, ijpjjpk, ncomm_znl )
       p_fval(:,:) = RESHAPE( zwork, ish2 )
 #endif
       !
+#if defined key_mpp_mpi
+      IF( wrk_not_released(1, 1) )   CALL ctl_stop('ptr_vjk: ERROR - failed to release workspace array')
+#endif
+      !
    END FUNCTION ptr_vjk
 
@@ -214,16 +281,29 @@
       !! ** Action  : - p_fval: i-sum of e1t*e3t*pta
       !!----------------------------------------------------------------------
+#if defined key_mpp_mpi
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwork => wrk_1d_1
+#endif
+      !!
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer flux array at T-point
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)     ::   pmsk   ! Optional 2D basin mask
       !!
-      INTEGER                     ::   ji, jj, jk   ! dummy loop arguments
-      REAL(wp),DIMENSION(jpj,jpk) ::   p_fval       ! return function value
+      INTEGER                           :: ji, jj, jk   ! dummy loop arguments
+      REAL(wp), POINTER, DIMENSION(:,:) :: p_fval       ! return function value
 #if defined key_mpp_mpi
       INTEGER, DIMENSION(1) ::   ish
       INTEGER, DIMENSION(2) ::   ish2
-      REAL(wp),DIMENSION(jpj*jpk) ::   zwork   ! 1D workspace
+      INTEGER               ::   ijpjjpk
 #endif
       !!-------------------------------------------------------------------- 
       !
+#if defined key_mpp_mpi
+      IF( wrk_in_use(1, 1) ) THEN
+         CALL ctl_stop('ptr_tjk: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+#endif
+
+      p_fval => p_fval2d
+
       p_fval(:,:) = 0._wp
       DO jk = 1, jpkm1
@@ -235,10 +315,15 @@
       END DO
 #if defined key_mpp_mpi
+      ijpjjpk = jpj*jpk
       ish(1) = jpj*jpk   ;   ish2(1) = jpj   ;   ish2(2) = jpk
-      zwork(:)= RESHAPE( p_fval, ish )
-      CALL mpp_sum( zwork, jpj*jpk, ncomm_znl )
+      zwork(1:ijpjjpk)= RESHAPE( p_fval, ish )
+      CALL mpp_sum( zwork, ijpjjpk, ncomm_znl )
       p_fval(:,:)= RESHAPE( zwork, ish2 )
 #endif
       !
+#if defined key_mpp_mpi
+      IF( wrk_not_released(1, 1) )   CALL ctl_stop('ptr_tjk: failed to release workspace array')
+#endif
+      !    
    END FUNCTION ptr_tjk
 
@@ -250,4 +335,5 @@
       USE oce,     vt  =>   ua   ! use ua as workspace
       USE oce,     vs  =>   ua   ! use ua as workspace
+      IMPLICIT none
       !!
       INTEGER, INTENT(in) ::   kt   ! ocean time step index
@@ -364,4 +450,7 @@
       !!----------------------------------------------------------------------
 
+      !                                      ! allocate dia_ptr arrays
+      IF( dia_ptr_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'lim_sbc_init : unable to allocate arrays' )
+
       REWIND( numnam )                 ! Read Namelist namptr : poleward transport parameters
       READ  ( numnam, namptr )
@@ -388,25 +477,7 @@
       IF( .NOT. ln_diaptr ) THEN       ! diaptr not used
         RETURN
-      ELSE                             ! Allocate the diaptr arrays
-         ALLOCATE( btmsk(jpi,jpj,nptr) ,                                                                      &
-            &      htr_adv(jpj) , str_adv(jpj) , htr_ldf(jpj) , str_ldf(jpj) , htr_ove(jpj) , str_ove(jpj),   &
-            &      htr(jpj,nptr) , str(jpj,nptr) ,                                                              &
-            &      tn_jk(jpj,jpk,nptr) , sn_jk (jpj,jpk,nptr) , v_msf(jpj,jpk,nptr) ,                         &
-            &      sjk  (jpj,jpk,nptr) , r1_sjk(jpj,jpk,nptr)                       , STAT=ierr  )
-         !
-         IF( ierr > 0 ) THEN
-            CALL ctl_stop( 'dia_ptr_init : unable to allocate standard arrays' )   ;   RETURN
-         ENDIF
-#if defined key_diaeiv
-!!       IF( lk_diaeiv )   &              ! eddy induced velocity arrays
-            ALLOCATE( htr_eiv(jpj,nptr) , str_eiv(jpj,nptr) , v_msf_eiv(jpj,jpk,nptr) , STAT=ierr )
-         !
-         IF( ierr > 0 ) THEN
-            CALL ctl_stop( 'dia_ptr_init : unable to allocate eiv arrays' )   ;   RETURN
-         ENDIF
-#endif
       ENDIF
       
-      IF( lk_mpp )   CALL mpp_ini_znl     ! Define MPI communicator for zonal sum
+      IF( lk_mpp )   CALL mpp_ini_znl( numout )     ! Define MPI communicator for zonal sum
 
       IF( ln_subbas ) THEN                ! load sub-basin mask
@@ -460,23 +531,26 @@
       !! ** Method  :   NetCDF file
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zphi => wrk_1d_1, zfoo => wrk_1d_2    ! 1D workspace
+      USE wrk_nemo, ONLY:   z_1  => wrk_2d_1                      ! 2D      -
+      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !!
       INTEGER, SAVE ::   nhoridz, ndepidzt, ndepidzw
-      INTEGER, SAVE :: ndim  , ndim_atl     , ndim_pac     , ndim_ind     , ndim_ipc
-      INTEGER, SAVE ::         ndim_atl_30  , ndim_pac_30  , ndim_ind_30  , ndim_ipc_30
-      INTEGER, SAVE :: ndim_h, ndim_h_atl_30, ndim_h_pac_30, ndim_h_ind_30, ndim_h_ipc_30
-      INTEGER, SAVE, DIMENSION (jpj*jpk) :: ndex  , ndex_atl     , ndex_pac     , ndex_ind     , ndex_ipc
-      INTEGER, SAVE, DIMENSION (jpj*jpk) ::         ndex_atl_30  , ndex_pac_30  , ndex_ind_30  , ndex_ipc_30
-      INTEGER, SAVE, DIMENSION (jpj)     :: ndex_h, ndex_h_atl_30, ndex_h_pac_30, ndex_h_ind_30, ndex_h_ipc_30
-      !!
-      CHARACTER (len=40)       ::   clhstnam, clop, clop_once, cl_comment   ! temporary names
-      INTEGER                  ::   iline, it, itmod, ji, jj, jk            !
+      INTEGER, SAVE ::   ndim  , ndim_atl     , ndim_pac     , ndim_ind     , ndim_ipc
+      INTEGER, SAVE ::           ndim_atl_30  , ndim_pac_30  , ndim_ind_30  , ndim_ipc_30
+      INTEGER, SAVE ::   ndim_h, ndim_h_atl_30, ndim_h_pac_30, ndim_h_ind_30, ndim_h_ipc_30
+      !!
+      CHARACTER (len=40) ::   clhstnam, clop, clop_once, cl_comment   ! temporary names
+      INTEGER            ::   iline, it, itmod, ji, jj, jk            !
 #if defined key_iomput
-      INTEGER                  ::   inum                                    ! temporary logical unit
-#endif
-      REAL(wp)                 ::   zsto, zout, zdt, zjulian                ! temporary scalars
-      REAL(wp), DIMENSION(jpj) ::   zphi, zfoo
-      REAL(wp), DIMENSION(jpj,jpk) :: z_1
-      !!----------------------------------------------------------------------
+      INTEGER            ::   inum                                    ! temporary logical unit
+#endif
+      REAL(wp)           ::   zsto, zout, zdt, zjulian                ! temporary scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(1, 1,2) .OR. wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('dia_ptr_wri: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! define time axis
@@ -507,7 +581,7 @@
             IF( jp_cfg == 2   )   iline =  48   ! i-line that passes near the North Pole
             IF( jp_cfg == 4   )   iline =  24   ! i-line that passes near the North Pole
-            zphi(:) = 0._wp
+            zphi(1:jpj) = 0._wp
             DO ji = mi0(iline), mi1(iline) 
-               zphi(:) = gphiv(ji,:)         ! if iline is in the local domain
+               zphi(1:jpj) = gphiv(ji,:)         ! if iline is in the local domain
                ! Correct highest latitude for some configurations - will work if domain is parallelized in J ?
                IF( jp_cfg == 05 ) THEN
@@ -533,5 +607,5 @@
          ELSE                                        !   OTHER configurations 
             !                                        ! =======================
-            zphi(:) = gphiv(1,:)             ! assume lat/lon coordinate, select the first i-line
+            zphi(1:jpj) = gphiv(1,:)             ! assume lat/lon coordinate, select the first i-line
             !
          ENDIF
@@ -555,10 +629,8 @@
 
             zout = nn_fwri * zdt
-            zfoo(:) = 0._wp
-
-            ! Compute julian date from starting date of the run
-
-            CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )
-            zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
+            zfoo(1:jpj) = 0._wp
+
+            CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )  ! Compute julian date from starting date of the run
+            zjulian = zjulian - adatrj                         ! set calendar origin to the beginning of the experiment
 
 #if defined key_iomput
@@ -583,5 +655,4 @@
             CALL histvert( numptr, "depthw", "Vertical W levels",   &
                &                   "m", jpk, gdepw_0, ndepidzw, "down" )
-
             !
             CALL wheneq ( jpj*jpk, MIN(sjk(:,:,1), 1._wp), 1, 1., ndex  , ndim  )      ! Lat-Depth
@@ -617,7 +688,5 @@
             cl_comment = '                      '
 #endif
-            !  Zonal mean T and S
-
-            IF( ln_diaznl ) THEN 
+            IF( ln_diaznl ) THEN             !  Zonal mean T and S
                CALL histdef( numptr, "zotemglo", "Zonal Mean Temperature","C" ,   &
                   1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop, zsto, zout )
@@ -627,5 +696,5 @@
                CALL histdef( numptr, "zosrfglo", "Zonal Mean Surface","m^2"   ,   &
                   1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop_once, zsto, zout )
-
+               !
                IF (ln_subbas) THEN 
                   CALL histdef( numptr, "zotematl", "Zonal Mean Temperature: Atlantic","C" ,   &
@@ -657,9 +726,7 @@
                      1, jpj, nhoridz, jpk, 1, jpk, ndepidzt, 32, clop_once, zsto, zout )
                ENDIF
-
             ENDIF
-
+            !
             !  Meridional Stream-Function (Eulerian and Bolus)
-
             CALL histdef( numptr, "zomsfglo", "Meridional Stream-Function: Global"//TRIM(cl_comment),"Sv" ,   &
                1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout )
@@ -674,7 +741,6 @@
                   1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout )
             ENDIF
-
+            !
             !  Heat transport 
-
             CALL histdef( numptr, "sophtadv", "Advective Heat Transport"      ,   &
                "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
@@ -695,8 +761,6 @@
                   "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
             ENDIF
-
-
+            !
             !  Salt transport 
-
             CALL histdef( numptr, "sopstadv", "Advective Salt Transport"      ,   &
                "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
@@ -726,7 +790,7 @@
                   "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout )
             ENDIF
-
+            !
             CALL histend( numptr )
-
+            !
          END IF
 #if defined key_mpp_mpi
@@ -802,5 +866,8 @@
       ENDIF
       !
-   END SUBROUTINE dia_ptr_wri
+      IF( wrk_not_released(1, 1,2) .OR.    &
+          wrk_not_released(2, 1)    )   CALL ctl_stop('dia_ptr_wri: failed to release workspace arrays')
+      !
+  END SUBROUTINE dia_ptr_wri
 
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 2715)
@@ -48,4 +48,5 @@
    USE dtatem
    USE dtasal
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -54,4 +55,5 @@
    PUBLIC   dia_wri                 ! routines called by step.F90
    PUBLIC   dia_wri_state
+   PUBLIC   dia_wri_alloc           ! Called by nemogcm module
 
    INTEGER ::   nid_T, nz_T, nh_T, ndim_T, ndim_hT   ! grid_T file
@@ -60,6 +62,6 @@
    INTEGER ::   nid_W, nz_W, nh_W                    ! grid_W file
    INTEGER ::   ndex(1)                              ! ???
-   INTEGER, DIMENSION(jpi*jpj)     ::   ndex_hT, ndex_hU, ndex_hV
-   INTEGER, DIMENSION(jpi*jpj*jpk) ::   ndex_T, ndex_U, ndex_V
+   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV
+   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_T, ndex_U, ndex_V
 
    !! * Substitutions
@@ -74,4 +76,20 @@
 CONTAINS
 
+   INTEGER FUNCTION dia_wri_alloc()
+      !!----------------------------------------------------------------------
+      INTEGER, DIMENSION(2) :: ierr
+      !!----------------------------------------------------------------------
+      !
+      ierr = 0
+      !
+      ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) ,     &
+         &      ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) ,     &
+         &      ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) )
+         !
+      dia_wri_alloc = MAXVAL(ierr)
+      IF( lk_mpp )   CALL mpp_sum( dia_wri_alloc )
+      !
+  END FUNCTION dia_wri_alloc
+
 #if defined key_dimgout
    !!----------------------------------------------------------------------
@@ -88,4 +106,5 @@
    !!   'key_iomput'                                        use IOM library
    !!----------------------------------------------------------------------
+
    SUBROUTINE dia_wri( kt )
       !!---------------------------------------------------------------------
@@ -98,4 +117,6 @@
       !!----------------------------------------------------------------------
       USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: z2d => wrk_2d_1
       !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
@@ -103,7 +124,11 @@
       INTEGER                      ::   ji, jj, jk              ! dummy loop indices
       REAL(wp)                     ::   zztmp, zztmpx, zztmpy   ! 
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d                     ! 
       !!----------------------------------------------------------------------
       ! 
+      IF( wrk_in_use(2, 1))THEN
+         CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.')
+         RETURN
+      END IF
+      !
       ! Output the initial state and forcings
       IF( ninist == 1 ) THEN                       
@@ -175,4 +200,9 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1))THEN
+         CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.')
+         RETURN
+      END IF
+      !
    END SUBROUTINE dia_wri
 
@@ -194,4 +224,7 @@
       !!      Each nwrite time step, output the instantaneous or mean fields
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zw2d => wrk_2d_1
+      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
       !!
@@ -201,6 +234,10 @@
       INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers
       REAL(wp) ::   zsto, zout, zmax, zjulian, zdt           ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zw2d                 ! 2D workspace
       !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(2, 1))THEN
+         CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.')
+         RETURN
+      END IF
       !
       ! Output the initial state and forcings
@@ -502,5 +539,5 @@
       CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
       CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-      zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
+      IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
       CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
 #endif
@@ -508,5 +545,5 @@
       CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
       CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-         zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
+         IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
       CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
 #endif
@@ -570,4 +607,9 @@
          CALL histclo( nid_W )
       ENDIF
+      !
+      IF( wrk_not_released(2, 1))THEN
+         CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.')
+         RETURN
+      END IF
       !
    END SUBROUTINE dia_wri
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri_dimg.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri_dimg.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri_dimg.h90	(revision 2715)
@@ -69,8 +69,4 @@
     INTEGER ,INTENT(in) :: kt
     !!
-    INTEGER :: inbsel, jk
-    INTEGER :: iyear,imon,iday
-    INTEGER, SAVE :: nmoyct 
-
 #if defined key_diainstant
     LOGICAL, PARAMETER :: ll_dia_inst=.TRUE.  !: for instantaneous output
@@ -78,12 +74,13 @@
     LOGICAL, PARAMETER :: ll_dia_inst=.FALSE. !: for average output
 #endif
-
-    REAL(wp), SAVE, DIMENSION (jpi,jpj,jpk) ::  um , vm   ! used to compute mean u, v fields
-    REAL(wp), SAVE, DIMENSION (jpi,jpj,jpk) ::  wm        ! used to compute mean w fields
-    REAL(wp), SAVE, DIMENSION (jpi,jpj,jpk) ::  avtm      ! used to compute mean kz fields
-    REAL(wp), SAVE, DIMENSION (jpi,jpj,jpk) ::  tm , sm   ! used to compute mean t, s fields
-    REAL(wp), SAVE, DIMENSION (jpi,jpj,jpk) ::  fsel      ! used to compute mean 2d fields
+    INTEGER              , SAVE                    ::  nmoyct 
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  um , vm, wm   ! mean u, v, w fields
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  avtm          ! mean kz fields
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  tm , sm       ! mean t, s fields
+    REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  fsel          ! mean 2d fields
+    
+    INTEGER :: inbsel, jk
+    INTEGER :: iyear,imon,iday
     REAL(wp) :: zdtj
-    !
     CHARACTER(LEN=80) :: clname
     CHARACTER(LEN=80) :: cltext
@@ -95,4 +92,17 @@
     !  ---------------
     !
+    IF(.not.ALLOCATED(um))THEN
+       ALLOCATE(um(jpi,jpj,jpk), vm(jpi,jpj,jpk), &
+                wm(jpi,jpj,jpk),                  &
+                avtm(jpi,jpj,jpk),                &
+                tm(jpi,jpj,jpk), sm(jpi,jpj,jpk), &
+                fsel(jpi,jpj,jpk),                &
+                Stat=jk)
+       IF(jk /= 0)THEN
+          WRITE(*,*) 'ERROR: allocate failed in dia_wri (diawri_dimg.h90)'
+          CALL mppabort()
+       END IF
+    END IF
+
     inbsel = 17
 
@@ -247,9 +257,6 @@
        cltext=TRIM(cexper)//' U(m/s) '//TRIM(clmode)
        !
-       IF( ll_dia_inst) THEN 
-          CALL dia_wri_dimg(clname, cltext, un, jpk, 'T')
-
-       ELSE 
-          CALL dia_wri_dimg(clname, cltext, um, jpk, 'T')
+       IF( ll_dia_inst) THEN   ;   CALL dia_wri_dimg(clname, cltext, un, jpk, 'T')
+       ELSE                    ;   CALL dia_wri_dimg(clname, cltext, um, jpk, 'T')
        ENDIF
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 2715)
@@ -46,7 +46,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -181,5 +180,4 @@
       REAL(wp)                    ::   zze2
       REAL(wp), DIMENSION (jpncs) ::   zfwf 
- 
       !!----------------------------------------------------------------------
       !
@@ -366,5 +364,5 @@
          DO jj = ncsj1(jc), ncsj2(jc)
             DO ji = ncsi1(jc), ncsi2(jc)
-               pbat(ji,jj) = 0.e0   
+               pbat(ji,jj) = 0._wp   
                kbat(ji,jj) = 0   
             END DO 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 2715)
@@ -46,7 +46,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -68,6 +67,6 @@
       !!              - nmonth_len, nyear_len, nmonth_half, nmonth_end through day_mth
       !!----------------------------------------------------------------------
-      INTEGER :: inbday, idweek
-      REAL(wp) :: zjul
+      INTEGER  ::   inbday, idweek
+      REAL(wp) ::   zjul
       !!----------------------------------------------------------------------
 
@@ -129,5 +128,4 @@
       CALL day( nit000 )
 
-      
    END SUBROUTINE day_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 2715)
@@ -7,10 +7,19 @@
    !! History :  1.0  ! 2005-10  (A. Beckmann, G. Madec)  reactivate s-coordinate 
    !!            3.3  ! 2010-11  (G. Madec) add mbk. arrays associated to the deepest ocean level
-   !!----------------------------------------------------------------------
-   USE par_oce      ! ocean parameters
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   Agrif_Root    : dummy function used when lk_agrif=F
+   !!   Agrif_CFixed  : dummy function used when lk_agrif=F
+   !!   dom_oce_alloc : dynamical allocation of dom_oce arrays
+   !!----------------------------------------------------------------------
+   USE par_oce        ! ocean parameters
 
    IMPLICIT NONE
-   PUBLIC           ! allows the acces to par_oce when dom_oce is used
-   !                ! exception to coding rules... to be suppressed ???
+   PUBLIC             ! allows the acces to par_oce when dom_oce is used
+   !                  ! exception to coding rules... to be suppressed ???
+
+   PUBLIC dom_oce_alloc  ! Called from nemogcm.F90
 
    !!----------------------------------------------------------------------
@@ -45,9 +54,9 @@
    INTEGER , PUBLIC ::   nclosea         !: =0 suppress closed sea/lake from the ORCA domain or not (=1)
 
-
    !                                                  !!! associated variables
    INTEGER , PUBLIC                 ::   neuler  = 0   !: restart euler forward option (0=Euler)
    REAL(wp), PUBLIC                 ::   atfp1         !: asselin time filter coeff. (atfp1= 1-2*atfp)
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   rdttra        !: vertical profile of tracer time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   rdttra  !: vertical profile of tracer time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dtra  !: = 2*rdttra except at nit000 (=rdttra) if neuler=0
 
    !                                         !!* Namelist namcla : cross land advection
@@ -83,28 +92,29 @@
    INTEGER, PUBLIC ::   nidom             !: ???
 
-   INTEGER, PUBLIC, DIMENSION(jpi)    ::   mig        !: local  ==> global domain i-index
-   INTEGER, PUBLIC, DIMENSION(jpj)    ::   mjg        !: local  ==> global domain j-index
-   INTEGER, PUBLIC, DIMENSION(jpidta) ::   mi0, mi1   !: global ==> local  domain i-index    !!bug ==> other solution?
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig        !: local  ==> global domain i-index
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mjg        !: local  ==> global domain j-index
+   INTEGER, PUBLIC,               DIMENSION(jpidta) ::   mi0, mi1   !: global ==> local  domain i-index    !!bug ==> other solution?
    !                                                  ! (mi0=1 and mi1=0 if the global index is not in the local domain)
-   INTEGER, PUBLIC, DIMENSION(jpjdta) ::   mj0, mj1   !: global ==> local  domain j-index     !!bug ==> other solution?
+   INTEGER, PUBLIC,               DIMENSION(jpjdta) ::   mj0, mj1   !: global ==> local  domain j-index     !!bug ==> other solution?
    !                                                  ! (mi0=1 and mi1=0 if the global index is not in the local domain)
-   INTEGER, PUBLIC, DIMENSION(jpnij)  ::   nimppt, njmppt   !: i-, j-indexes for each processor
-   INTEGER, PUBLIC, DIMENSION(jpnij)  ::   ibonit, ibonjt   !: i-, j- processor neighbour existence
-   INTEGER, PUBLIC, DIMENSION(jpnij)  ::   nlcit , nlcjt    !: dimensions of every subdomain
-   INTEGER, PUBLIC, DIMENSION(jpnij)  ::   nldit , nldjt    !: first, last indoor index for each i-domain
-   INTEGER, PUBLIC, DIMENSION(jpnij)  ::   nleit , nlejt    !: first, last indoor index for each j-domain
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nimppt, njmppt   !: i-, j-indexes for each processor
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   ibonit, ibonjt   !: i-, j- processor neighbour existence
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nlcit , nlcjt    !: dimensions of every subdomain
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nldit , nldjt    !: first, last indoor index for each i-domain
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   nleit , nlejt    !: first, last indoor index for each j-domain
 
    !!----------------------------------------------------------------------
    !! horizontal curvilinear coordinate and scale factors
    !! ---------------------------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   glamt, glamu   !: longitude of t-, u-, v- and f-points (degre)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   glamv, glamf   !:
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   gphit, gphiu   !: latitude  of t-, u-, v- and f-points (degre)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   gphiv, gphif   !:
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   e1t, e2t       !: horizontal scale factors at t-point (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   e1u, e2u       !: horizontal scale factors at u-point (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   e1v, e2v       !: horizontal scale factors at v-point (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   e1f, e2f       !: horizontal scale factors at f-point (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ff             !: coriolis factor (2.*omega*sin(yphi) ) (s-1)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  glamt, glamu   !: longitude of t-, u-, v- and f-points (degre)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  glamv, glamf   !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  gphit, gphiu   !: latitude  of t-, u-, v- and f-points (degre)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  gphiv, gphif   !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  e1t, e2t       !: horizontal scale factors at t-point (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  e1u, e2u       !: horizontal scale factors at u-point (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  e1v, e2v       !: horizontal scale factors at v-point (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  e1f, e2f       !: horizontal scale factors at f-point (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  e1e2t          !: surface at t-point (m2)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ff             !: coriolis factor (2.*omega*sin(yphi) ) (s-1)
 
    !!----------------------------------------------------------------------
@@ -118,10 +128,10 @@
    !! All coordinates
    !! ---------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   gdep3w          !: depth of T-points (sum of e3w) (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   gdept , gdepw   !: analytical depth at T-W  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3v   , e3f     !: analytical vertical scale factors at  V--F
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3t   , e3u     !:                                       T--U  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3vw            !: analytical vertical scale factors at  VW--
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3w   , e3uw    !:                                        W--UW  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gdep3w          !: depth of T-points (sum of e3w) (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gdept , gdepw   !: analytical depth at T-W  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3v   , e3f     !: analytical vertical scale factors at  V--F
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3t   , e3u     !:                                       T--U  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3vw            !: analytical vertical scale factors at  VW--
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3w   , e3uw    !:                                        W--UW  points (m)
 #if defined key_vvl
    LOGICAL, PUBLIC, PARAMETER ::   lk_vvl = .TRUE.    !: variable grid flag
@@ -129,18 +139,18 @@
    !! All coordinates
    !! ---------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   gdep3w_1           !: depth of T-points (sum of e3w) (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   gdept_1, gdepw_1   !: analytical depth at T-W  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3v_1  , e3f_1     !: analytical vertical scale factors at  V--F
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3t_1  , e3u_1     !:                                       T--U  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3vw_1             !: analytical vertical scale factors at  VW--
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3w_1  , e3uw_1    !:                                       W--UW  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3t_b              !: before         -      -      -    -   T      points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e3u_b  , e3v_b     !:   -            -      -      -    -   U--V   points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gdep3w_1           !: depth of T-points (sum of e3w) (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gdept_1, gdepw_1   !: analytical depth at T-W  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3v_1  , e3f_1     !: analytical vertical scale factors at  V--F
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3t_1  , e3u_1     !:                                       T--U  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3vw_1             !: analytical vertical scale factors at  VW--
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3w_1  , e3uw_1    !:                                       W--UW  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3t_b              !: before         -      -      -    -   T      points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e3u_b  , e3v_b     !:   -            -      -      -    -   U--V   points (m)
 #else
    LOGICAL, PUBLIC, PARAMETER ::   lk_vvl = .FALSE.   !: fixed grid flag
 #endif
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hur  , hvr    !: inverse of u and v-points ocean depth (1/m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hu   , hv     !: depth at u- and v-points (meters)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hu_0 , hv_0   !: refernce depth at u- and v-points (meters)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur  , hvr    !: inverse of u and v-points ocean depth (1/m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu   , hv     !: depth at u- and v-points (meters)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu_0 , hv_0   !: refernce depth at u- and v-points (meters)
 
    INTEGER, PUBLIC ::   nla10              !: deepest    W level Above  ~10m (nlb10 - 1)
@@ -149,38 +159,38 @@
    !! z-coordinate with full steps (also used in the other cases as reference z-coordinate)
    !! =-----------------====------
-   REAL(wp), PUBLIC, DIMENSION(jpk)     ::   gdept_0, gdepw_0   !: reference depth of t- and w-points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpk)     ::   e3t_0  , e3w_0     !: reference vertical scale factors at T- and W-pts (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   e3tp   , e3wp      !: ocean bottom level thickness at T and W points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   :: gdept_0, gdepw_0 !: reference depth of t- and w-points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   :: e3t_0  , e3w_0   !: reference vertical scale factors at T- and W-pts (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: e3tp   , e3wp    !: ocean bottom level thickness at T and W points
 
    !! s-coordinate and hybrid z-s-coordinate
    !! =----------------======---------------
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   gsigt, gsigw   !: model level depth coefficient at t-, w-levels (analytic)
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   gsi3w          !: model level depth coefficient at w-level (sum of gsigw)
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   esigt, esigw   !: vertical scale factor coef. at t-, w-levels
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hbatv , hbatf    !: ocean depth at the vertical of  V--F
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hbatt , hbatu    !:                                 T--U  points (m)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   scosrf, scobot   !: ocean surface and bottom topographies 
-   !                                                          !  (if deviating from coordinate surfaces in HYBRID)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hifv  , hiff     !: interface depth between stretching at  V--F
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hift  , hifu     !: and quasi-uniform spacing              T--U  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   gsigt, gsigw   !: model level depth coefficient at t-, w-levels (analytic)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   gsi3w          !: model level depth coefficient at w-level (sum of gsigw)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   esigt, esigw   !: vertical scale factor coef. at t-, w-levels
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hbatv , hbatf    !: ocean depth at the vertical of  V--F
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hbatt , hbatu    !:                                 T--U  points (m)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   scosrf, scobot   !: ocean surface and bottom topographies 
+   !                                        !  (if deviating from coordinate surfaces in HYBRID)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hifv  , hiff     !: interface depth between stretching at  V--F
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hift  , hifu     !: and quasi-uniform spacing              T--U  points (m)
 
    !!----------------------------------------------------------------------
    !! masks, bathymetry
    !! ---------------------------------------------------------------------
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj) ::   mbathy       !: number of ocean level (=0, 1, ... , jpk-1)
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj) ::   mbkt         !: vertical index of the bottom last T- ocean level
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj) ::   mbku, mbkv   !: vertical index of the bottom last U- and W- ocean level
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   bathy        !: ocean depth (meters)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tmask_i      !: interior domain T-point mask
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   bmask        !: land/ocean mask of barotropic stream function
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   tmask, umask, vmask, fmask   !: land/ocean mask at T-, U-, V- and F-pts
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mbathy       !: number of ocean level (=0, 1, ... , jpk-1)
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mbkt         !: vertical index of the bottom last T- ocean level
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mbku, mbkv   !: vertical index of the bottom last U- and W- ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bathy        !: ocean depth (meters)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmask_i      !: interior domain T-point mask
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bmask        !: land/ocean mask of barotropic stream function
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tmask, umask, vmask, fmask   !: land/ocean mask at T-, U-, V- and F-pts
 
    REAL(wp), PUBLIC, DIMENSION(jpiglo) ::   tpol, fpol          !: north fold mask (jperio= 3 or 4)
 
 #if defined key_noslip_accurate
-   INTEGER, PUBLIC, DIMENSION            (4,jpk) ::   npcoa          !: ???
-   INTEGER, PUBLIC, DIMENSION(2*(jpi+jpj),4,jpk) ::   nicoa, njcoa   !: ???
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:  ) :: npcoa        !: ???
+   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nicoa, njcoa !: ???
 #endif
 
@@ -215,4 +225,5 @@
    LOGICAL, PUBLIC, PARAMETER ::   lk_mpp_rep = .FALSE.   !: agrif flag
 #endif
+
    !!----------------------------------------------------------------------
    !! agrif domain
@@ -222,6 +233,17 @@
 #else
    LOGICAL, PUBLIC, PARAMETER ::   lk_agrif = .FALSE.   !: agrif flag
-
+#endif
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+#if ! defined key_agrif
+   !!----------------------------------------------------------------------
+   !! NOT 'key_agrif'      dummy function                     No AGRIF zoom
+   !!----------------------------------------------------------------------
    LOGICAL FUNCTION Agrif_Root()
       Agrif_Root = .TRUE.
@@ -229,11 +251,65 @@
 
    CHARACTER(len=3) FUNCTION Agrif_CFixed()
-     Agrif_CFixed = '0' 
+      Agrif_CFixed = '0' 
    END FUNCTION Agrif_CFixed
 #endif
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+
+   INTEGER FUNCTION dom_oce_alloc()
+      !!----------------------------------------------------------------------
+      INTEGER, DIMENSION(11) :: ierr
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( rdttra(jpk), r2dtra(jpk), mig(jpi), mjg(jpj), STAT=ierr(1) )
+         !
+      ALLOCATE( nimppt(jpnij) , ibonit(jpnij) , nlcit(jpnij) , nlcjt(jpnij) ,     &
+         &      njmppt(jpnij) , ibonjt(jpnij) , nldit(jpnij) , nldjt(jpnij) ,     &
+         &                                      nleit(jpnij) , nlejt(jpnij) , STAT=ierr(2) )
+         !
+      ALLOCATE( glamt(jpi,jpj) , gphit(jpi,jpj) , e1t(jpi,jpj) , e2t(jpi,jpj) ,                      & 
+         &      glamu(jpi,jpj) , gphiu(jpi,jpj) , e1u(jpi,jpj) , e2u(jpi,jpj) ,                      &  
+         &      glamv(jpi,jpj) , gphiv(jpi,jpj) , e1v(jpi,jpj) , e2v(jpi,jpj) , e1e2t(jpi,jpj) ,     &  
+         &      glamf(jpi,jpj) , gphif(jpi,jpj) , e1f(jpi,jpj) , e2f(jpi,jpj) , ff   (jpi,jpj) , STAT=ierr(3) )     
+         !
+      ALLOCATE( gdep3w(jpi,jpj,jpk) , e3v(jpi,jpj,jpk) , e3f (jpi,jpj,jpk) ,                         &
+         &      gdept (jpi,jpj,jpk) , e3t(jpi,jpj,jpk) , e3u (jpi,jpj,jpk) ,                         &
+         &      gdepw (jpi,jpj,jpk) , e3w(jpi,jpj,jpk) , e3vw(jpi,jpj,jpk) , e3uw(jpi,jpj,jpk) , STAT=ierr(4) )
+         !
+#if defined key_vvl
+      ALLOCATE( gdep3w_1(jpi,jpj,jpk) , e3v_1(jpi,jpj,jpk) , e3f_1 (jpi,jpj,jpk) ,                           &
+         &      gdept_1 (jpi,jpj,jpk) , e3t_1(jpi,jpj,jpk) , e3u_1 (jpi,jpj,jpk) ,                           &
+         &      gdepw_1 (jpi,jpj,jpk) , e3w_1(jpi,jpj,jpk) , e3vw_1(jpi,jpj,jpk) , e3uw_1(jpi,jpj,jpk) ,     &
+         &      e3t_b   (jpi,jpj,jpk) , e3u_b(jpi,jpj,jpk) , e3v_b (jpi,jpj,jpk)                       , STAT=ierr(5) )
+#endif
+         !
+      ALLOCATE( hu(jpi,jpj) , hur(jpi,jpj) , hu_0(jpi,jpj) ,     &
+         &      hv(jpi,jpj) , hvr(jpi,jpj) , hv_0(jpi,jpj) , STAT=ierr(6) )
+         !
+      ALLOCATE( gdept_0(jpk) , gdepw_0(jpk) ,                                     &
+         &      e3t_0  (jpk) , e3w_0  (jpk) , e3tp (jpi,jpj), e3wp(jpi,jpj) ,     &
+         &      gsigt  (jpk) , gsigw  (jpk) , gsi3w(jpk)    ,                     &
+         &      esigt  (jpk) , esigw  (jpk)                                 , STAT=ierr(7) )
+         !
+      ALLOCATE( hbatv (jpi,jpj) , hbatf (jpi,jpj) ,     &
+         &      hbatt (jpi,jpj) , hbatu (jpi,jpj) ,     &
+         &      scosrf(jpi,jpj) , scobot(jpi,jpj) ,     &
+         &      hifv  (jpi,jpj) , hiff  (jpi,jpj) ,     &
+         &      hift  (jpi,jpj) , hifu  (jpi,jpj) , STAT=ierr(8) )
+
+      ALLOCATE( mbathy(jpi,jpj) , bathy(jpi,jpj) ,                     &
+         &     tmask_i(jpi,jpj) , bmask(jpi,jpj) ,                     &
+         &     mbkt   (jpi,jpj) , mbku (jpi,jpj) , mbkv(jpi,jpj) , STAT=ierr(9) )
+
+      ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk),     & 
+         &      vmask(jpi,jpj,jpk) , fmask(jpi,jpj,jpk), STAT=ierr(10) )
+
+#if defined key_noslip_accurate
+      ALLOCATE( npcoa(4,jpk), nicoa(2*(jpi+jpj),4,jpk), njcoa(2*(jpi+jpj),4,jpk), STAT=ierr(11) )
+#endif
+      !
+      dom_oce_alloc = MAXVAL(ierr)
+      !
+   END FUNCTION dom_oce_alloc
+
    !!======================================================================
 END MODULE dom_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 2715)
@@ -24,7 +24,6 @@
    !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90	(revision 2715)
@@ -14,4 +14,5 @@
    !!                            use of parameters in par_CONFIG-Rxx.h90, not in namelist
    !!             -   ! 2004-05  (A. Koch-Larrouy) Add Gyre configuration 
+   !!            4.0  ! 2011-02  (G. Madec) add cell surface (e1e2t)
    !!----------------------------------------------------------------------
 
@@ -33,5 +34,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -448,4 +449,8 @@
 
       END SELECT
+      
+      ! T-cell surface
+      ! --------------
+      e1e2t(:,:) = e1t(:,:) * e2t(:,:)
 
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 2715)
@@ -34,9 +34,12 @@
    PRIVATE
 
-   PUBLIC   dom_msk    ! routine called by inidom.F90
+   PUBLIC   dom_msk         ! routine called by inidom.F90
+   PUBLIC   dom_msk_alloc   ! routine called by nemogcm.F90
 
    !                            !!* Namelist namlbc : lateral boundary condition *
    REAL(wp) ::   rn_shlat = 2.   ! type of lateral boundary condition on velocity
-   
+
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  icoord ! Workspace for dom_msk_nsa()
+
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
@@ -48,4 +51,17 @@
 CONTAINS
    
+   INTEGER FUNCTION dom_msk_alloc()
+      !!---------------------------------------------------------------------
+      !!                 ***  FUNCTION dom_msk_alloc  ***
+      !!---------------------------------------------------------------------
+      dom_msk_alloc = 0
+#if defined key_noslip_accurate
+      ALLOCATE(icoord(jpi*jpj*jpk,3), STAT=dom_msk_alloc)
+#endif
+      IF( dom_msk_alloc /= 0 )   CALL ctl_warn('dom_msk_alloc: failed to allocate icoord array')
+      !
+   END FUNCTION dom_msk_alloc
+
+
    SUBROUTINE dom_msk
       !!---------------------------------------------------------------------
@@ -109,13 +125,19 @@
       !!               tmask_i  : interior ocean mask
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY:   zwf  =>  wrk_2d_1      ! 2D real    workspace
+      USE wrk_nemo, ONLY:   imsk => iwrk_2d_1      ! 2D integer workspace
+      !
       INTEGER  ::   ji, jj, jk      ! dummy loop indices
-      INTEGER  ::   iif, iil, ii0, ii1, ii
-      INTEGER  ::   ijf, ijl, ij0, ij1
-      INTEGER , DIMENSION(jpi,jpj) ::  imsk
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwf
+      INTEGER  ::   iif, iil, ii0, ii1, ii   ! local integers
+      INTEGER  ::   ijf, ijl, ij0, ij1       !   -       -
       !!
       NAMELIST/namlbc/ rn_shlat
       !!---------------------------------------------------------------------
       
+      IF( wrk_in_use(2, 1) .OR. iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('dom_msk: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       REWIND( numnam )              ! Namelist namlbc : lateral momentum boundary condition
       READ  ( numnam, namlbc )
@@ -414,4 +436,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1)  .OR.   &
+         iwrk_not_released(2, 1)  )   CALL ctl_stop('dom_msk: failed to release workspace arrays')
+      !
    END SUBROUTINE dom_msk
 
@@ -431,15 +456,13 @@
       !! ** Action :
       !!----------------------------------------------------------------------
-      INTEGER  :: ji, jj, jk, jl      ! dummy loop indices
+      INTEGER  ::   ji, jj, jk, jl      ! dummy loop indices
       INTEGER  ::   ine, inw, ins, inn, itest, ierror, iind, ijnd
       REAL(wp) ::   zaa
-      INTEGER, DIMENSION(jpi*jpj*jpk,3) ::  icoord
       !!---------------------------------------------------------------------
-      
-
-      IF(lwp)WRITE(numout,*)
-      IF(lwp)WRITE(numout,*) 'dom_msk_nsa : noslip accurate boundary condition'
-      IF(lwp)WRITE(numout,*) '~~~~~~~~~~~   using Schchepetkin and O Brian scheme'
-      IF( lk_mpp ) CALL ctl_stop( ' mpp version is not yet implemented' )
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'dom_msk_nsa : noslip accurate boundary condition'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   using Schchepetkin and O Brian scheme'
+      IF( lk_mpp )   CALL ctl_stop( ' mpp version is not yet implemented' )
 
       ! mask for second order calculation of vorticity
@@ -596,5 +619,5 @@
          CALL ctl_stop( 'We stop...' )
       ENDIF
-
+      !
    END SUBROUTINE dom_msk_nsa
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domngb.F90	(revision 2715)
@@ -8,20 +8,19 @@
 
    !!----------------------------------------------------------------------
-   !!   dom_ngb       : find the closest grid point from a given on/lat position
+   !!   dom_ngb       : find the closest grid point from a given lon/lat position
    !!----------------------------------------------------------------------
-   USE dom_oce         ! ocean space and time domain
-   USE lib_mpp         ! for mppsum
+   USE dom_oce        ! ocean space and time domain
+   USE lib_mpp        ! for mppsum
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   dom_ngb    ! routine called in iom.F90 module
+   PUBLIC   dom_ngb   ! routine called in iom.F90 module
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -30,21 +29,23 @@
       !!                    ***  ROUTINE dom_ngb  ***
       !!
-      !! ** Purpose :   find the closest grid point from a given on/lat position
+      !! ** Purpose :   find the closest grid point from a given lon/lat position
       !!
       !! ** Method  :   look for minimum distance in cylindrical projection 
       !!                -> not good if located at too high latitude...
-      !!
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zglam => wrk_2d_2 , zgphi => wrk_2d_3 , zmask => wrk_2d_4 , zdist => wrk_2d_5
+      !
       REAL(wp)        , INTENT(in   ) ::   plon, plat   ! longitude,latitude of the point
       INTEGER         , INTENT(  out) ::   kii, kjj     ! i-,j-index of the closes grid point
       CHARACTER(len=1), INTENT(in   ) ::   cdgrid       ! grid name 'T', 'U', 'V', 'W'
-      !!
-      INTEGER , DIMENSION(2)        ::   iloc
-      REAL(wp), DIMENSION(jpi,jpj)  ::   zglam, zgphi, zmask, zdist
-      REAL(wp)                      ::   zlon
-      REAL(wp)                      ::   zmini
+      !
+      INTEGER , DIMENSION(2) ::   iloc
+      REAL(wp)               ::   zlon, zmini
       !!--------------------------------------------------------------------
-      
-      zmask(:,:) = 0.
+      !
+      IF( wrk_in_use(2, 2,3,4,5) )   CALL ctl_stop('dom_ngb: Requested workspaces already in use')
+      !
+      zmask(:,:) = 0._wp
       SELECT CASE( cdgrid )
       CASE( 'U' )  ; zglam(:,:) = glamu(:,:) ; zgphi(:,:) = gphiu(:,:) ; zmask(nldi:nlei,nldj:nlej) = umask(nldi:nlei,nldj:nlej,1)
@@ -70,5 +71,7 @@
          kjj = iloc(2) + njmpp - 1
       ENDIF
-
+      !
+      IF( wrk_not_released(2, 2,3,4,5) )   CALL ctl_stop('dom_ngb: error releasing workspaces')
+      !
    END SUBROUTINE dom_ngb
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90	(revision 2715)
@@ -8,19 +8,17 @@
    !!   dom_stp        : ocean time domain initialization
    !!----------------------------------------------------------------------
-   !! History :
-   !!        !  90-10  (O. Marti)  Original code
-   !!        !  96-01  (G. Madec)  terrain following coordinates
-   !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
+   !! History :  OPA  ! 1990-10  (O. Marti)  Original code
+   !!                 ! 1996-01  (G. Madec)  terrain following coordinates
+   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and module
    !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE in_out_manager  ! I/O manager
+   USE oce            ! ocean dynamics and tracers
+   USE dom_oce        ! ocean space and time domain
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * routine accessibility
-   PUBLIC dom_stp        ! routine called by inidom.F90
+   PUBLIC   dom_stp   ! routine called by inidom.F90
 
    !! * Substitutions
@@ -29,7 +27,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -59,6 +56,5 @@
       !!              - atfp1    : = 1 - 2*atfp
       !!
-      !! References :
-      !!      Bryan, K., 1984, J. Phys. Oceanogr., 14, 666-673.
+      !! References :   Bryan, K., 1984, J. Phys. Oceanogr., 14, 666-673.
       !!----------------------------------------------------------------------
       INTEGER ::   jk              ! dummy loop indice
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 2715)
@@ -24,11 +24,12 @@
    PRIVATE
 
-   PUBLIC   dom_vvl    ! called by domain.F90
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ee_t, ee_u, ee_v, ee_f   !: ???
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mut, muu, muv, muf       !: ??? 
-
-   REAL(wp), DIMENSION(jpk) ::   r2dt   ! vertical profile time-step, = 2 rdttra 
-      !                                 ! except at nit000 (=rdttra) if neuler=0
+   PUBLIC   dom_vvl       ! called by domain.F90
+   PUBLIC   dom_vvl_alloc ! called by nemogcm.F90
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ee_t, ee_u, ee_v, ee_f   !: ???
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   mut , muu , muv , muf    !: ??? 
+
+   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:)     ::   r2dt   ! vertical profile time-step, = 2 rdttra 
+      !                                                              ! except at nit000 (=rdttra) if neuler=0
 
    !! * Substitutions
@@ -36,10 +37,24 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS       
+
+   INTEGER FUNCTION dom_vvl_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE dom_vvl_alloc  ***
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( mut (jpi,jpj,jpk) , muu (jpi,jpj,jpk) , muv (jpi,jpj,jpk) , muf (jpi,jpj,jpk) ,     &
+         &      ee_t(jpi,jpj)     , ee_u(jpi,jpj)     , ee_v(jpi,jpj)     , ee_f(jpi,jpj)     ,     &
+         &      r2dt        (jpk)                                                             , STAT=dom_vvl_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( dom_vvl_alloc )
+      IF( dom_vvl_alloc /= 0 )   CALL ctl_warn('dom_vvl_alloc: failed to allocate arrays')
+      !
+   END FUNCTION dom_vvl_alloc
+
 
    SUBROUTINE dom_vvl
@@ -50,16 +65,23 @@
       !!               ssh over the whole water column (scale factors)
       !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   zcoefu , zcoefv   , zcoeff                   ! temporary scalars
-      REAL(wp) ::   zv_t_ij, zv_t_ip1j, zv_t_ijp1, zv_t_ip1jp1   !     -        -
-      REAL(wp), DIMENSION(jpi,jpj) ::  zs_t, zs_u_1, zs_v_1      !     -     2D workspace
-      !!----------------------------------------------------------------------
-
-      IF(lwp)   THEN
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zs_t   => wrk_2d_1 , zs_u_1 => wrk_2d_2 , zs_v_1 => wrk_2d_3     ! 2D workspace
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zcoefu , zcoefv   , zcoeff                   ! local scalars
+      REAL(wp) ::   zv_t_ij, zv_t_ip1j, zv_t_ijp1, zv_t_ip1jp1   !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) ) THEN
+         CALL ctl_stop('dom_vvl: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'dom_vvl : Variable volume activated'
+         WRITE(numout,*) 'dom_vvl : Variable volume initialization'
          WRITE(numout,*) '~~~~~~~~  compute coef. used to spread ssh over each layers'
       ENDIF
-
+      
+      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl : unable to allocate arrays' )
 
       fsdept(:,:,:) = gdept (:,:,:)
@@ -167,4 +189,6 @@
       fse3v_b(:,:,:) = fse3v_b(:,:,:) + fse3v_0(:,:,:)
       !
+      IF( wrk_not_released(2, 1,2,3) )   CALL ctl_stop('dom_vvl: failed to release workspace arrays')
+      !
    END SUBROUTINE dom_vvl
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90	(revision 2715)
@@ -2,16 +2,16 @@
    !!======================================================================
    !!                       ***  MODULE domwri  ***
-   !! Ocean initialization : write the ocean domain mesh ask file(s)
+   !! Ocean initialization : write the ocean domain mesh file(s)
    !!======================================================================
    !! History :  OPA  ! 1997-02  (G. Madec)  Original code
    !!            8.1  ! 1999-11  (M. Imbard)  NetCDF FORMAT with IOIPSL
    !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90 and several file
+   !!            3.0  ! 2008-01  (S. Masson) add dom_uniq 
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
    !!   dom_wri        : create and write mesh and mask file(s)
-   !!                    nmsh = 1  :   mesh_mask file
-   !!                         = 2  :   mesh and mask file
-   !!                         = 3  :   mesh_hgr, mesh_zgr and mask
+   !!   dom_uniq       :
    !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
@@ -63,4 +63,8 @@
       !!                                   masks, depth and vertical scale factors
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zprt  => wrk_2d_1 , zprw  => wrk_2d_2    ! 2D workspace
+      USE wrk_nemo, ONLY:   zdepu => wrk_3d_1 , zdepv => wrk_3d_2    ! 3D     -
+      !!
       INTEGER           ::   inum0    ! temprary units for 'mesh_mask.nc' file
       INTEGER           ::   inum1    ! temprary units for 'mesh.nc'      file
@@ -74,7 +78,9 @@
       CHARACTER(len=21) ::   clnam4   ! filename (vertical   mesh informations)
       INTEGER           ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zprt , zprw    ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdepu, zdepv   ! 3D workspace
-     !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) .OR. wrk_in_use(3, 1,2) )THEN
+         CALL ctl_stop('dom_wri: requested workspace arrays unavailable')   ;   RETURN
+      END IF
 
       IF(lwp) WRITE(numout,*)
@@ -122,12 +128,15 @@
       CALL iom_rstput( 0, 0, inum2, 'fmask', fmask, ktype = jp_i1 )
       
-      
-      zprt = tmask(:,:,1) * dom_uniq('T')                               !    ! unique point mask
+      CALL dom_uniq( zprw, 'T' )
+      zprt = tmask(:,:,1) * zprw                               !    ! unique point mask
       CALL iom_rstput( 0, 0, inum2, 'tmaskutil', zprt, ktype = jp_i1 )  
-      zprt = umask(:,:,1) * dom_uniq('U')
+      CALL dom_uniq( zprw, 'U' )
+      zprt = umask(:,:,1) * zprw
       CALL iom_rstput( 0, 0, inum2, 'umaskutil', zprt, ktype = jp_i1 )  
-      zprt = vmask(:,:,1) * dom_uniq('V')
+      CALL dom_uniq( zprw, 'V' )
+      zprt = vmask(:,:,1) * zprw
       CALL iom_rstput( 0, 0, inum2, 'vmaskutil', zprt, ktype = jp_i1 )  
-      zprt = fmask(:,:,1) * dom_uniq('F')
+      CALL dom_uniq( zprw, 'F' )
+      zprt = fmask(:,:,1) * zprw
       CALL iom_rstput( 0, 0, inum2, 'fmaskutil', zprt, ktype = jp_i1 )  
 
@@ -251,8 +260,11 @@
       END SELECT
       !
+      IF( wrk_not_released(2, 1,2)  .OR.   &
+          wrk_not_released(3, 1,2)  )   CALL ctl_stop('dom_wri: failed to release workspace arrays')
+      !
    END SUBROUTINE dom_wri
 
 
-   FUNCTION dom_uniq( cdgrd )   RESULT( puniq )
+   SUBROUTINE dom_uniq( puniq, cdgrd )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dom_uniq  ***
@@ -263,13 +275,19 @@
       !!                2) check which elements have been changed
       !!----------------------------------------------------------------------
-      CHARACTER(len=1)            , INTENT(in   ) ::  cdgrd   ! 
-      REAL(wp), DIMENSION(jpi,jpj)                ::  puniq   ! 
-      !
-      REAL(wp), DIMENSION(jpi,jpj  ) ::  ztstref   ! array with different values for each element 
-      REAL(wp)                       ::  zshift    ! shift value link to the process number
-      LOGICAL , DIMENSION(jpi,jpj,1) ::  lldbl     ! is the point unique or not?
-      INTEGER                        ::  ji        ! dummy loop indices
-      !!----------------------------------------------------------------------
-      !
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztstref => wrk_2d_3      ! array with different values for each element
+      !
+      CHARACTER(len=1)        , INTENT(in   ) ::   cdgrd   ! 
+      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   puniq   ! 
+      !
+      REAL(wp) ::  zshift   ! shift value link to the process number
+      INTEGER  ::  ji       ! dummy loop indices
+      LOGICAL, DIMENSION(SIZE(puniq,1),SIZE(puniq,2),1) ::  lldbl  ! store whether each point is unique or not
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 3) ) THEN
+         CALL ctl_stop('dom_uniq: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
       ! build an array with different values for each element 
       ! in mpp: make sure that these values are different even between process
@@ -286,5 +304,7 @@
       puniq(nldi:nlei,nldj:nlej) = REAL( COUNT( lldbl(nldi:nlei,nldj:nlej,:), dim = 3 ) , wp )
       !
-   END FUNCTION dom_uniq
+      IF( wrk_not_released(2, 3) )   CALL ctl_stop('dom_uniq: failed to release workspace array')
+      !
+   END SUBROUTINE dom_uniq
 
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 2715)
@@ -42,5 +42,5 @@
    PRIVATE
 
-   PUBLIC   dom_zgr      ! called by dom_init.F90
+   PUBLIC   dom_zgr        ! called by dom_init.F90
 
    !                                       !!* Namelist namzgr_sco *
@@ -54,10 +54,10 @@
    !                                        ! ( rn_bb=0; top only, rn_bb =1; top and bottom)
    REAL(wp) ::   rn_hc       =  150._wp     ! Critical depth for s-sigma coordinates
- 
-   !! * Substitutions
+
+  !! * Substitutions
 #  include "domzgr_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 3.3.1 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -121,4 +121,5 @@
       !
       !
+
       IF( nprint == 1 .AND. lwp )   THEN
          WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) )
@@ -588,8 +589,14 @@
       !!              - update bathy : meter bathymetry (in meters)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zbathy => wrk_2d_1
+      !!
       INTEGER ::   ji, jj, jl                    ! dummy loop indices
       INTEGER ::   icompt, ibtest, ikmax         ! temporary integers
-      REAL(wp), DIMENSION(jpi,jpj) ::   zbathy   ! temporary workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('zgr_bat_ctl: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
@@ -695,4 +702,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('zgr_bat_ctl: failed to release workspace array')
+      !
    END SUBROUTINE zgr_bat_ctl
 
@@ -710,7 +719,13 @@
       !!                                     (min value = 1 over land)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zmbk => wrk_2d_1
+      !!
       INTEGER ::   ji, jj   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj) ::   zmbk   ! 2D workspace 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('zgr_bot_level: requested 2D workspace unavailable')   ;   RETURN
+      ENDIF
       !
       IF(lwp) WRITE(numout,*)
@@ -729,4 +744,6 @@
       zmbk(:,:) = REAL( mbku(:,:), wp )   ;   CALL lbc_lnk(zmbk,'U',1.)   ;   mbku  (:,:) = MAX( INT( zmbk(:,:) ), 1 )
       zmbk(:,:) = REAL( mbkv(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv  (:,:) = MAX( INT( zmbk(:,:) ), 1 )
+      !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('zgr_bot_level: failed to release workspace array')
       !
    END SUBROUTINE zgr_bot_level
@@ -805,4 +822,7 @@
       !!  Reference :   Pacanowsky & Gnanadesikan 1997, Mon. Wea. Rev., 126, 3248-3270.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zprt => wrk_3d_1
+      !!
       INTEGER  ::   ji, jj, jk       ! dummy loop indices
       INTEGER  ::   ik, it           ! temporary integers
@@ -813,6 +833,9 @@
       REAL(wp) ::   zdiff            ! temporary scalar
       REAL(wp) ::   zrefdep          ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zprt   ! 3D workspace
       !!---------------------------------------------------------------------
+      ! 
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('zgr_zps: requested workspace unavailable.')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
@@ -822,5 +845,4 @@
 
       ll_print = .FALSE.                   ! Local variable for debugging
-!!    ll_print = .TRUE.
       
       IF(lwp .AND. ll_print) THEN          ! control print of the ocean depth
@@ -1006,4 +1028,6 @@
       ENDIF  
       !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('zgr_zps: failed to release workspace')
+      !
    END SUBROUTINE zgr_zps
 
@@ -1092,28 +1116,34 @@
       !! Reference : Madec, Lott, Delecluse and Crepon, 1996. JPO, 26, 1393-1408.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zenv => wrk_2d_1 , ztmp => wrk_2d_2 , zmsk  => wrk_2d_3
+      USE wrk_nemo, ONLY:   zri  => wrk_2d_4 , zrj  => wrk_2d_5 , zhbat => wrk_2d_6
+      USE wrk_nemo, ONLY:   gsigw3  => wrk_3d_1
+      USE wrk_nemo, ONLY:   gsigt3  => wrk_3d_2
+      USE wrk_nemo, ONLY:   gsi3w3  => wrk_3d_3
+      USE wrk_nemo, ONLY:   esigt3  => wrk_3d_4
+      USE wrk_nemo, ONLY:   esigw3  => wrk_3d_5
+      USE wrk_nemo, ONLY:   esigtu3 => wrk_3d_6
+      USE wrk_nemo, ONLY:   esigtv3 => wrk_3d_7
+      USE wrk_nemo, ONLY:   esigtf3 => wrk_3d_8
+      USE wrk_nemo, ONLY:   esigwu3 => wrk_3d_9
+      USE wrk_nemo, ONLY:   esigwv3 => wrk_3d_10
+      !
       INTEGER  ::   ji, jj, jk, jl           ! dummy loop argument
       INTEGER  ::   iip1, ijp1, iim1, ijm1   ! temporary integers
       REAL(wp) ::   zcoeft, zcoefw, zrmax, ztaper   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zenv, ztmp, zmsk    ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zri , zrj , zhbat   !  -     -
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   gsigw3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   gsigt3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   gsi3w3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigt3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigw3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigtu3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigtv3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigtf3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigwu3
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   esigwv3
-      !!
+      !
+
       NAMELIST/namzgr_sco/ rn_sbot_max, rn_sbot_min, rn_theta, rn_thetb, rn_rmax, ln_s_sigma, rn_bb, rn_hc
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )                        ! Read Namelist namzgr_sco : sigma-stretching parameters
+      IF( wrk_in_use(2, 1,2,3,4,5,6) .OR. wrk_in_use(3, 1,2,3,4,5,6,7,8,9,10) ) THEN
+         CALL ctl_stop('zgr_sco: ERROR - requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      REWIND( numnam )                       ! Read Namelist namzgr_sco : sigma-stretching parameters
       READ  ( numnam, namzgr_sco )
 
-      IF(lwp) THEN                            ! control print
+      IF(lwp) THEN                           ! control print
          WRITE(numout,*)
          WRITE(numout,*) 'dom:zgr_sco : s-coordinate or hybrid z-s-coordinate'
@@ -1146,7 +1176,5 @@
       DO jj = 1, jpj
          DO ji = 1, jpi
-           IF( bathy(ji,jj) > 0._wp ) THEN
-              bathy(ji,jj) = MAX( rn_sbot_min, bathy(ji,jj) )
-           ENDIF
+           IF( bathy(ji,jj) > 0._wp )   bathy(ji,jj) = MAX( rn_sbot_min, bathy(ji,jj) )
          END DO
       END DO
@@ -1372,6 +1400,6 @@
          END DO    ! for all ji's
 
-         DO ji = 1, jpi
-            DO jj = 1, jpj
+         DO ji = 1, jpim1
+            DO jj = 1, jpjm1
                DO jk = 1, jpk
                   esigtu3(ji,jj,jk) = ( hbatt(ji,jj)*esigt3(ji,jj,jk)+hbatt(ji+1,jj)*esigt3(ji+1,jj,jk) )   &
@@ -1398,4 +1426,13 @@
             END DO
          END DO
+
+         CALL lbc_lnk( e3t , 'T', 1._wp )
+         CALL lbc_lnk( e3u , 'U', 1._wp )
+         CALL lbc_lnk( e3v , 'V', 1._wp )
+         CALL lbc_lnk( e3f , 'F', 1._wp )
+         CALL lbc_lnk( e3w , 'W', 1._wp )
+         CALL lbc_lnk( e3uw, 'U', 1._wp )
+         CALL lbc_lnk( e3vw, 'V', 1._wp )
+
          !
       ELSE   ! not ln_s_sigma
@@ -1553,6 +1590,8 @@
 !!gm bug    #endif
       !
+      IF( wrk_not_released(2, 1,2,3,4,5,6) .OR. wrk_not_released(3, 1,2,3,4,5,6,7,8,9,10) )  &
+        &  CALL ctl_stop('dom:zgr_sco: failed to release workspace arrays')
+      !
    END SUBROUTINE zgr_sco
-
 
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 2715)
@@ -43,5 +43,6 @@
    USE dynspg_ts       ! pressure gradient schemes
    USE traswp          ! Swap arrays                      (tra_swp routine)
-   
+   USE lib_mpp         ! MPP library
+
    IMPLICIT NONE
    PRIVATE
@@ -55,7 +56,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -446,4 +446,7 @@
       !!                 p=integral [ rau*g dz ]
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zprn => wrk_3d_1    ! 3D workspace
+
       USE dynspg          ! surface pressure gradient             (dyn_spg routine)
       USE divcur          ! hor. divergence & rel. vorticity      (div_cur routine)
@@ -453,6 +456,9 @@
       INTEGER ::   indic             ! ???
       REAL(wp) ::   zmsv, zphv, zmsu, zphu, zalfg     ! temporary scalars
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zprn     ! workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF(wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('istage_uvg: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*) 
@@ -551,4 +557,8 @@
       rotb (:,:,:) = rotn (:,:,:)       ! set the before to the now value
       !
+      IF( wrk_not_released(3, 1) ) THEN
+         CALL ctl_stop('istage_uvg: failed to release workspace array')
+      ENDIF
+      !
    END SUBROUTINE istate_uvg
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtasal.F90	(revision 2715)
@@ -18,22 +18,23 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
    USE fldread         ! read input fields
    USE in_out_manager  ! I/O manager
-   USE phycst          ! physical constants
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   dta_sal   ! called by step.F90 and inidta.F90
-   
-   LOGICAL , PUBLIC, PARAMETER ::   lk_dtasal = .TRUE.    !: salinity data flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   s_dta    !: salinity data at given time-step
-
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sal       ! structure of input SST (file informations, fields read)
+   PUBLIC   dta_sal    ! called by step.F90 and inidta.F90
+
+   LOGICAL , PUBLIC, PARAMETER                     ::   lk_dtasal = .TRUE. !: salinity data flag
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   s_dta              !: salinity data at given time-step
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sal   ! structure of input SST (file informations, fields read)
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -52,10 +53,10 @@
       !!                between two monthly values.
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt             ! ocean time step
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
       !
-      INTEGER ::   ji, jj, jk, jl, jkk            ! dummy loop indicies
-      INTEGER ::   ik, ierror                     ! temporary integers
+      INTEGER ::   ji, jj, jk, jl, jkk       ! local loop indicies
+      INTEGER ::   ik, ierr, ierr0, ierr1, ierr2   ! local integers
 #if defined key_tradmp
-      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! temporary integers
+      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! local integers
 #endif
       REAL(wp)::   zl
@@ -88,10 +89,14 @@
             WRITE(numout,*) '~~~~~~~ '
          ENDIF
-         ALLOCATE( sf_sal(1), STAT=ierror )
-         IF( ierror > 0 ) THEN
-             CALL ctl_stop( 'dta_sal: unable to allocate sf_sal structure' )   ;   RETURN
-         ENDIF
-                                ALLOCATE( sf_sal(1)%fnow(jpi,jpj,jpk)   )
-         IF( sn_sal%ln_tint )   ALLOCATE( sf_sal(1)%fdta(jpi,jpj,jpk,2) )
+
+                                   ! Allocate salinity data array 
+                                ALLOCATE( s_dta(jpi,jpj,jpk)           , STAT=ierr  )
+         IF( ierr > 0              )   CALL ctl_stop( 'STOP', 'dta_sal: unable to allocate s_dta array' )
+                                   ! Allocate sf_tem structure
+                                ierr2 = 0
+                                ALLOCATE( sf_sal(1)                    , STAT=ierr0 )
+                                ALLOCATE( sf_sal(1)%fnow(jpi,jpj,jpk)  , STAT=ierr1 )
+         IF( sn_sal%ln_tint )   ALLOCATE( sf_sal(1)%fdta(jpi,jpj,jpk,2), STAT=ierr2 )
+         IF( ierr0+ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'dta_sal: unable to allocate sf_sal structure' )
          !                         ! fill sf_sal with sn_sal and control print
          CALL fld_fill( sf_sal, (/ sn_sal /), cn_dir, 'dta_sal', 'Salinity data', 'namdta_sal' )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DTA/dtatem.F90	(revision 2715)
@@ -18,7 +18,8 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
    USE fldread         ! read input fields
    USE in_out_manager  ! I/O manager
-   USE phycst          ! physical constants
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -27,6 +28,6 @@
    PUBLIC   dta_tem    ! called by step.F90 and inidta.F90
 
-   LOGICAL , PUBLIC, PARAMETER ::   lk_dtatem = .TRUE.   !: temperature data flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::  t_dta    !: temperature data at given time-step
+   LOGICAL , PUBLIC, PARAMETER                     ::   lk_dtatem = .TRUE. !: temperature data flag
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   t_dta              !: temperature data at given time-step
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tem      ! structure of input SST (file informations, fields read)
@@ -35,5 +36,5 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -58,10 +59,10 @@
       !! ** Action  :   define t_dta array at time-step kt
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt     ! ocean time-step
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step
       !
-      INTEGER ::   ji, jj, jk, jl, jkk            ! dummy loop indicies
-      INTEGER ::   ik, ierror                     ! temporary integers
+      INTEGER ::   ji, jj, jk, jl, jkk       ! dummy loop indicies
+      INTEGER ::   ik, ierr, ierr0, ierr1, ierr2   ! local integers
 #if defined key_tradmp
-      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! temporary integers
+      INTEGER ::   il0, il1, ii0, ii1, ij0, ij1   ! local integers
 #endif
       REAL(wp)::   zl
@@ -95,10 +96,14 @@
             WRITE(numout,*) '~~~~~~~ '
          ENDIF
-         ALLOCATE( sf_tem(1), STAT=ierror )
-         IF( ierror > 0 ) THEN
-             CALL ctl_stop( 'dta_tem: unable to allocate sf_tem structure' )   ;   RETURN
-         ENDIF
-                                ALLOCATE( sf_tem(1)%fnow(jpi,jpj,jpk)   )
-         IF( sn_tem%ln_tint )   ALLOCATE( sf_tem(1)%fdta(jpi,jpj,jpk,2) )
+
+                                   ! Allocate temperature data array 
+                                ALLOCATE( t_dta(jpi,jpj,jpk)           , STAT=ierr  )
+         IF( ierr > 0              )   CALL ctl_stop( 'STOP', 'dta_tem: unable to allocate t_dta array' )
+                                   ! Allocate sf_tem structure
+                                ierr2 = 0
+                                ALLOCATE( sf_tem(1)                    , STAT=ierr0 )
+                                ALLOCATE( sf_tem(1)%fnow(jpi,jpj,jpk)  , STAT=ierr1 )
+         IF( sn_tem%ln_tint )   ALLOCATE( sf_tem(1)%fdta(jpi,jpj,jpk,2), STAT=ierr2 )
+         IF( ierr0+ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'dta_tem: unable to allocate sf_tem structure' )
          !                         ! fill sf_tem with sn_tem and control print
          CALL fld_fill( sf_tem, (/ sn_tem /), cn_dir, 'dta_tem', 'Temperature data', 'namdta_tem' )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90	(revision 2715)
@@ -31,4 +31,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -49,6 +50,5 @@
 #if defined key_noslip_accurate
    !!----------------------------------------------------------------------
-   !!   'key_noslip_accurate'                     2nd order centered scheme
-   !!                                                4th order at the coast
+   !!   'key_noslip_accurate'   2nd order interior + 4th order at the coast
    !!----------------------------------------------------------------------
 
@@ -58,5 +58,5 @@
       !!
       !! ** Purpose :   compute the horizontal divergence and the relative
-      !!      vorticity at before and now time-step
+      !!              vorticity at before and now time-step
       !!
       !! ** Method  : I.  divergence :
@@ -82,12 +82,12 @@
       !!              - update rotb , rotn , the before & now rel. vorticity
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      !
-      INTEGER ::   ji, jj, jk     ! dummy loop indices
-      INTEGER ::   ii, ij, jl     ! temporary integer
-      INTEGER ::   ijt, iju       ! temporary integer
-      REAL(wp) ::  zraur, zdep
-      REAL(wp), DIMENSION(   jpi  ,1:jpj+2) ::   zwu   ! workspace
-      REAL(wp), DIMENSION(-1:jpi+2,  jpj  ) ::   zwv   ! workspace
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zwu   ! specific 2D workspace
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zwv   ! specific 2D workspace
+      !
+      INTEGER ::   ji, jj, jk, jl           ! dummy loop indices
+      INTEGER ::   ii, ij, ijt, iju, ierr   ! local integer
+      REAL(wp) ::  zraur, zdep              ! local scalar
       !!----------------------------------------------------------------------
 
@@ -96,4 +96,8 @@
          IF(lwp) WRITE(numout,*) 'div_cur : horizontal velocity divergence and relative vorticity'
          IF(lwp) WRITE(numout,*) '~~~~~~~   NOT optimal for auto-tasking case'
+         !
+         ALLOCATE( zwu( jpi, 1:jpj+2) , zwv(-1:jpi+2, jpj) , STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'div_cur : unable to allocate arrays' )
       ENDIF
 
@@ -269,8 +273,8 @@
       !!              - update rotb , rotn , the before & now rel. vorticity
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt     ! ocean time-step index
-      !
-      INTEGER  ::   ji, jj, jk          ! dummy loop indices
-      REAL(wp) ::  zraur, zdep
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jk    ! dummy loop indices
+      REAL(wp) ::   zraur, zdep   ! local scalars
       !!----------------------------------------------------------------------
 
@@ -333,7 +337,5 @@
       IF( ln_rnf      )   CALL sbc_rnf_div( hdivn )          ! runoffs (update hdivn field)
       IF( nn_cla == 1 )   CALL cla_div    ( kt )             ! Cross Land Advection (update hdivn field)
-
-      ! 4. Lateral boundary conditions on hdivn and rotn
-      ! ---------------------------------=======---======
+      !
       CALL lbc_lnk( hdivn, 'T', 1. )   ;   CALL lbc_lnk( rotn , 'F', 1. )     ! lateral boundary cond. (no sign change)
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 2715)
@@ -13,10 +13,10 @@
    !!----------------------------------------------------------------------
    USE dom_oce         ! ocean space and time domain
-   USE in_out_manager  ! I/O manager
-
    USE dynadv_cen2     ! centred flux form advection      (dyn_adv_cen2 routine)
    USE dynadv_ubs      ! UBS flux form advection          (dyn_adv_ubs  routine)
    USE dynkeg          ! kinetic energy gradient          (dyn_keg      routine)
    USE dynzad          ! vertical advection               (dyn_zad      routine)
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -38,7 +38,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -58,5 +57,5 @@
       !!----------------------------------------------------------------------
       !
-      SELECT CASE ( nadv )                     ! compute advection trend and add it to general trend
+      SELECT CASE ( nadv )                  ! compute advection trend and add it to general trend
       CASE ( 0 )     
                       CALL dyn_keg     ( kt )    ! vector form : horizontal gradient of kinetic energy
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 2715)
@@ -18,4 +18,5 @@
    USE trdmod         ! ocean dynamics trends
    USE in_out_manager ! I/O manager
+   USE lib_mpp        ! MPP library
    USE prtctl         ! Print control
 
@@ -29,9 +30,8 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -47,20 +47,25 @@
       !! ** Action  :   (ua,va) updated with the now vorticity term trend
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   zfu => ta   ! use ta as 3D workspace
-      USE oce, ONLY:   zfv => sa   ! use sa as 3D workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zfu   => ta       , zfv   => sa       ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zfu_t => wrk_3d_1 , zfv_t => wrk_3d_4 , zfu_uw =>wrk_3d_6   ! 3D workspaces
+      USE wrk_nemo, ONLY:   zfu_f => wrk_3d_2 , zfv_f => wrk_3d_5 , zfv_vw =>wrk_3d_7
+      USE wrk_nemo, ONLY:   zfw   => wrk_3d_3 
+      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zbu, zbv     ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfu_t, zfu_f, zfu_uw   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfv_t, zfv_f, zfv_vw   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zfw                    !  -      -
+      REAL(wp) ::   zbu, zbv     ! local scalars
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_adv_cen2 : 2nd order flux form momentum advection'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_adv_cen2 : 2nd order flux form momentum advection'
+         WRITE(numout,*) '~~~~~~~~~~~~'
+      ENDIF
+
+      ! Check that global workspace arrays aren't already in use
+      IF( wrk_in_use(3, 1,2,3,4,5,6,7) ) THEN
+         CALL ctl_stop('dyn_adv_cen2 : requested workspace array unavailable')   ;   RETURN
       ENDIF
 
@@ -157,4 +162,6 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(3, 1,2,3,4,5,6,7) )   CALL ctl_stop('dyn_adv_cen2: failed to release workspace array')
+      !
    END SUBROUTINE dyn_adv_cen2
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 2715)
@@ -16,9 +16,10 @@
    USE oce            ! ocean dynamics and tracers
    USE dom_oce        ! ocean space and time domain
-   USE in_out_manager ! I/O manager
-   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE trdmod         ! ocean dynamics trends
    USE trdmod_oce     ! ocean variables trends
+   USE in_out_manager ! I/O manager
    USE prtctl         ! Print control
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
@@ -34,9 +35,8 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -68,17 +68,17 @@
       !! Reference : Shchepetkin & McWilliams, 2005, Ocean Modelling. 
       !!----------------------------------------------------------------------
-      USE oce, ONLY:   zfu => ta   ! use ta as 3D workspace
-      USE oce, ONLY:   zfv => sa   ! use sa as 3D workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zfu    => ta       , zfv    => sa      ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zfu_t  => wrk_3d_1 , zfv_t  =>wrk_3d_4 , zfu_uw =>wrk_3d_6   ! 3D workspace
+      USE wrk_nemo, ONLY:   zfu_f  => wrk_3d_2 , zfv_f  =>wrk_3d_5 , zfv_vw =>wrk_3d_7
+      USE wrk_nemo, ONLY:   zfw    => wrk_3d_3
+      USE wrk_nemo, ONLY:   zlu_uu => wrk_4d_1 , zlv_vv=>wrk_4d_3   ! 4D workspace
+      USE wrk_nemo, ONLY:   zlu_uv => wrk_4d_2 , zlv_vu=>wrk_4d_4
+      !
       INTEGER, INTENT(in) ::   kt     ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk            ! dummy loop indices
       REAL(wp) ::   zbu, zbv    ! temporary scalars
       REAL(wp) ::   zui, zvj, zfuj, zfvi, zl_u, zl_v   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::   zfu_t, zfu_f     ! temporary workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::   zfv_t, zfv_f     !    "           "
-      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::   zfw, zfu_uw, zfv_vw
-      REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   zlu_uu, zlu_uv   ! temporary workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk,2) ::   zlv_vv, zlv_vu   ! temporary workspace
       !!----------------------------------------------------------------------
 
@@ -88,13 +88,19 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
       ENDIF
-      zfu_t(:,:,:) = 0.e0
-      zfv_t(:,:,:) = 0.e0
-      zfu_f(:,:,:) = 0.e0
-      zfv_f(:,:,:) = 0.e0
-      !
-      zlu_uu(:,:,:,:) = 0.e0 
-      zlv_vv(:,:,:,:) = 0.e0 
-      zlu_uv(:,:,:,:) = 0.e0 
-      zlv_vu(:,:,:,:) = 0.e0 
+
+      ! Check that required workspace arrays are not already in use
+      IF( wrk_in_use(3, 1,2,3,4,5,6,7) .OR. wrk_in_use(4, 1,2,3,4) ) THEN
+         CALL ctl_stop('dyn_adv_ubs: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
+      zfu_t(:,:,:) = 0._wp
+      zfv_t(:,:,:) = 0._wp
+      zfu_f(:,:,:) = 0._wp
+      zfv_f(:,:,:) = 0._wp
+      !
+      zlu_uu(:,:,:,:) = 0._wp
+      zlv_vv(:,:,:,:) = 0._wp 
+      zlu_uv(:,:,:,:) = 0._wp 
+      zlv_vu(:,:,:,:) = 0._wp 
 
       IF( l_trddyn ) THEN           ! Save ua and va trends
@@ -116,5 +122,5 @@
                zlu_uv(ji,jj,jk,1) = ( ub (ji,jj+1,jk)-2.*ub (ji,jj,jk)+ub (ji,jj-1,jk) ) * umask(ji,jj,jk)
                zlv_vu(ji,jj,jk,1) = ( vb (ji+1,jj,jk)-2.*vb (ji,jj,jk)+vb (ji-1,jj,jk) ) * vmask(ji,jj,jk)
-               
+               !
                zlu_uu(ji,jj,jk,2) = ( zfu(ji+1,jj,jk)-2.*zfu(ji,jj,jk)+zfu(ji-1,jj,jk) ) * umask(ji,jj,jk)
                zlv_vv(ji,jj,jk,2) = ( zfv(ji,jj+1,jk)-2.*zfv(ji,jj,jk)+zfv(ji,jj-1,jk) ) * vmask(ji,jj,jk)
@@ -125,9 +131,9 @@
       END DO
 !!gm BUG !!!  just below this should be +1 in all the communications
-      CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', -1.)
-      CALL lbc_lnk( zlu_uu(:,:,:,2), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,2), 'U', -1.)
-      CALL lbc_lnk( zlv_vv(:,:,:,1), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,1), 'V', -1.)
-      CALL lbc_lnk( zlv_vv(:,:,:,2), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,2), 'V', -1.) 
-
+!      CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', -1.)
+!      CALL lbc_lnk( zlu_uu(:,:,:,2), 'U', -1.)   ;   CALL lbc_lnk( zlu_uv(:,:,:,2), 'U', -1.)
+!      CALL lbc_lnk( zlv_vv(:,:,:,1), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,1), 'V', -1.)
+!      CALL lbc_lnk( zlv_vv(:,:,:,2), 'V', -1.)   ;   CALL lbc_lnk( zlv_vu(:,:,:,2), 'V', -1.)
+!
 !!gm corrected:
       CALL lbc_lnk( zlu_uu(:,:,:,1), 'U', 1. )   ;   CALL lbc_lnk( zlu_uv(:,:,:,1), 'U', 1. )
@@ -248,4 +254,7 @@
          &                       tab3d_2=va, clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(3, 1,2,3,4,5,6,7) .OR.   &
+          wrk_not_released(4, 1,2,3,4)       )   CALL ctl_stop('dyn_adv_ubs: failed to release workspace array')
+      !
    END SUBROUTINE dyn_adv_ubs
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90	(revision 2715)
@@ -13,5 +13,4 @@
    USE dom_oce         ! ocean space and time domain variables 
    USE zdf_oce         ! ocean vertical physics variables
-
    USE trdmod          ! ocean active dynamics and tracers trends 
    USE trdmod_oce      ! ocean variables trends
@@ -43,5 +42,5 @@
       !! ** Action  :   (ua,va)   momentum trend increased by bottom friction trend
       !!---------------------------------------------------------------------
-      USE oce, ONLY :   ztrduv => tsa   ! use tsa as 4D workspace
+      USE oce, ONLY:   ztrduv => tsa   ! tsa used as 4D workspace
       !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 2715)
@@ -31,9 +31,10 @@
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
-   USE in_out_manager  ! I/O manager
    USE trdmod          ! ocean dynamics trends 
    USE trdmod_oce      ! ocean variables trends
+   USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
    USE lbclnk          ! lateral boundary condition 
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -76,8 +77,13 @@
       !!             - Save the trend (l_trddyn=T)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrdu => wrk_3d_1 , ztrdv => wrk_3d_2   ! 3D workspace
+      !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D temporary workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('dyn_hpg: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
       !
       IF( l_trddyn ) THEN                    ! Temporary saving of ua and va trends (l_trddyn)
@@ -104,4 +110,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg  - Ua: ', mask1=umask,   &
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+      !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('dyn_hpg: failed to release workspace arrays')
       !
    END SUBROUTINE dyn_hpg
@@ -144,5 +152,5 @@
       !
       IF( lk_vvl .AND. .NOT. ln_hpg_sco )   &
-         &   CALL ctl_stop( 'dyn_hpg_init : variable volume key_vvl require the standard jacobian formulation hpg_sco')
+         &   CALL ctl_stop('dyn_hpg_init : variable volume key_vvl require the standard jacobian formulation hpg_sco')
       !
       !                               ! Set nhpg from ln_hpg_... flags
@@ -164,5 +172,5 @@
       IF( ln_hpg_djc )   ioptio = ioptio + 1
       IF( ln_hpg_rot )   ioptio = ioptio + 1
-      IF ( ioptio /= 1 )   CALL ctl_stop( ' NO or several hydrostatic pressure gradient options used' )
+      IF( ioptio /= 1 )   CALL ctl_stop( 'NO or several hydrostatic pressure gradient options used' )
       !
    END SUBROUTINE dyn_hpg_init
@@ -185,6 +193,5 @@
       !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE oce, ONLY:   zhpi => ta , zhpj => sa   ! (ta,sa) used as 3D workspace
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -200,6 +207,5 @@
       ENDIF
       
-      ! Local constant initialization 
-      zcoef0 = - grav * 0.5_wp
+      zcoef0 = - grav * 0.5_wp      ! Local constant initialization 
 
       ! Surface value
@@ -247,6 +253,5 @@
       !! ** Action  : - Update (ua,va) with the now hydrastatic pressure trend
       !!---------------------------------------------------------------------- 
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE oce, ONLY:   zhpi => ta , zhpj => sa   ! (ta,sa) used as 3D workspace
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -349,6 +354,5 @@
       !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE oce, ONLY:   zhpi => ta , zhpj => sa   ! (ta,sa) used as 3D workspace
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -435,6 +439,5 @@
       !!             - Save the trend (l_trddyn=T)
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE oce, ONLY:   zhpi => ta , zhpj => sa   ! (ta,sa) used as 3D workspace
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -512,6 +515,5 @@
       !! Reference : Song, Mon. Wea. Rev., 126, 3213-3230, 1998.
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE oce, ONLY:   zhpi => ta , zhpj => sa   ! (ta,sa) used as 3D workspace
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -592,6 +594,13 @@
       !! Reference: Shchepetkin and McWilliams, J. Geophys. Res., 108(C3), 3090, 2003
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zhpi  => ta        , zhpj => sa       ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   drhox => wrk_3d_1  , dzx  => wrk_3d_2
+      USE wrk_nemo, ONLY:   drhou => wrk_3d_3  , dzu  => wrk_3d_4 , rho_i => wrk_3d_5
+      USE wrk_nemo, ONLY:   drhoy => wrk_3d_6  , dzy  => wrk_3d_7
+      USE wrk_nemo, ONLY:   drhov => wrk_3d_8  , dzv  => wrk_3d_9 , rho_j => wrk_3d_10
+      USE wrk_nemo, ONLY:   drhoz => wrk_3d_11 , dzz  => wrk_3d_12 
+      USE wrk_nemo, ONLY:   drhow => wrk_3d_13 , dzw  => wrk_3d_14
+      USE wrk_nemo, ONLY:   rho_k => wrk_3d_15
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -601,8 +610,9 @@
       REAL(wp) ::   z1_10, cffu, cffx   !    "         "
       REAL(wp) ::   z1_12, cffv, cffy   !    "         "
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   drhox, dzx, drhou, dzu, rho_i   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   drhoy, dzy, drhov, dzv, rho_j   !  "      "
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   drhoz, dzz, drhow, dzw, rho_k   !  "      "
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ) THEN
+         CALL ctl_stop('dyn:hpg_djc: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -611,5 +621,4 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate case, density Jacobian with cubic polynomial scheme'
       ENDIF
-
 
       ! Local constant initialization
@@ -802,4 +811,7 @@
       END DO
       !
+      IF( wrk_not_released(3, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) )   &
+         CALL ctl_stop('dyn:hpg_djc: failed to release workspace arrays')
+      !
    END SUBROUTINE hpg_djc
 
@@ -813,6 +825,11 @@
       !! Reference: Thiem & Berntsen, Ocean Modelling, In press, 2005.
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   zhpi => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   zhpj => sa   ! use sa as 3D workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zhpi    => ta       , zhpj    => sa       ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zdistr  => wrk_2d_1 , zsina   => wrk_2d_2 , zcosa  => wrk_2d_3
+      USE wrk_nemo, ONLY:   zhpiorg => wrk_3d_1 , zhpirot => wrk_3d_2
+      USE wrk_nemo, ONLY:   zhpitra => wrk_3d_3 , zhpine  => wrk_3d_4
+      USE wrk_nemo, ONLY:   zhpjorg => wrk_3d_5 , zhpjrot => wrk_3d_6
+      USE wrk_nemo, ONLY:   zhpjtra => wrk_3d_7 , zhpjne  => wrk_3d_8
       !!
       INTEGER, INTENT(in) ::   kt    ! ocean time-step index
@@ -821,8 +838,10 @@
       REAL(wp) ::   zforg, zcoef0, zuap, zmskd1, zmskd1m   ! temporary scalar
       REAL(wp) ::   zfrot        , zvap, zmskd2, zmskd2m   !    "         "
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdistr, zsina, zcosa                ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zhpiorg, zhpirot, zhpitra, zhpine   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zhpjorg, zhpjrot, zhpjtra, zhpjne   !  "      "
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3)             .OR.   &
+          wrk_in_use(3, 1,2,3,4,5,6,7,8) ) THEN
+         CALL ctl_stop('dyn:hpg_rot: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -981,4 +1000,7 @@
       END DO
       !
+      IF( wrk_not_released(2, 1,2,3)           .OR.   &
+          wrk_not_released(3, 1,2,3,4,5,6,7,8) )   CALL ctl_stop('dyn:hpg_rot: failed to release workspace arrays')
+      !
    END SUBROUTINE hpg_rot
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90	(revision 2715)
@@ -14,7 +14,8 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
-   USE in_out_manager  ! I/O manager
    USE trdmod          ! ocean dynamics trends 
    USE trdmod_oce      ! ocean variables trends
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 
@@ -29,7 +30,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -52,6 +52,7 @@
       !!             - save this trends (l_trddyn=T) for post-processing
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   ztrdu => ta   ! use ta as 3D workspace   
-      USE oce, ONLY :   ztrdv => sa   ! use sa as 3D workspace   
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   ztrdu => ta       , ztrdv => sa   ! (ta,sa) used as 3D workspace   
+      USE wrk_nemo, ONLY:   zhke  => wrk_3d_1                 ! 3D workspace
       !!
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
@@ -59,6 +60,9 @@
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zu, zv       ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zhke   ! temporary 3D workspace
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3,1) ) THEN
+         CALL ctl_stop('dyn_key: requested workspace array is unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -83,4 +87,11 @@
                   &         + vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk)  )
                zhke(ji,jj,jk) = zv + zu
+!!gm simplier coding  ==>>   ~ faster
+!    don't forget to suppress local zu zv scalars
+!               zhke(ji,jj,jk) = 0.25 * (   un(ji-1,jj  ,jk) * un(ji-1,jj  ,jk)   &
+!                  &                      + un(ji  ,jj  ,jk) * un(ji  ,jj  ,jk)   &
+!                  &                      + vn(ji  ,jj-1,jk) * vn(ji  ,jj-1,jk)   &
+!                  &                      + vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk)   )
+!!gm end <<==
             END DO  
          END DO  
@@ -91,4 +102,25 @@
             END DO 
          END DO
+!!gm idea to be tested  ==>>   is it faster on scalar computers ?
+!         DO jj = 2, jpjm1       ! add the gradient of kinetic energy to the general momentum trends
+!            DO ji = fs_2, fs_jpim1   ! vector opt.
+!               ua(ji,jj,jk) = ua(ji,jj,jk) - 0.25 * ( + un(ji+1,jj  ,jk) * un(ji+1,jj  ,jk)   &
+!                  &                                   + vn(ji+1,jj-1,jk) * vn(ji+1,jj-1,jk)   &
+!                  &                                   + vn(ji+1,jj  ,jk) * vn(ji+1,jj  ,jk)   &
+!                  !
+!                  &                                   - un(ji-1,jj  ,jk) * un(ji-1,jj  ,jk)   &
+!                  &                                   - vn(ji  ,jj-1,jk) * vn(ji  ,jj-1,jk)   &
+!                  &                                   - vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk)   ) / e1u(ji,jj)
+!                  !
+!               va(ji,jj,jk) = va(ji,jj,jk) - 0.25 * (   un(ji-1,jj+1,jk) * un(ji-1,jj+1,jk)   &
+!                  &                                   + un(ji  ,jj+1,jk) * un(ji  ,jj+1,jk)   &
+!                  &                                   + vn(ji  ,jj+1,jk) * vn(ji  ,jj+1,jk)   &
+!                  !
+!                  &                                   - un(ji-1,jj  ,jk) * un(ji-1,jj  ,jk)   &
+!                  &                                   - un(ji  ,jj  ,jk) * un(ji  ,jj  ,jk)   &
+!                  &                                   - vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk)   ) / e2v(ji,jj)
+!            END DO 
+!         END DO
+!!gm en idea            <<==
          !                                             ! ===============
       END DO                                           !   End of slab
@@ -104,4 +136,6 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('dyn_key: failed to release workspace array')
+      !
    END SUBROUTINE dyn_keg
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 2715)
@@ -41,7 +41,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -52,9 +51,14 @@
       !! ** Purpose :   compute the lateral ocean dynamics physics.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrdu => wrk_3d_1 , ztrdv => wrk_3d_2
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('dyn_ldf: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      !
       IF( l_trddyn )   THEN                      ! temporary save of ta and sa trends
          ztrdu(:,:,:) = ua(:,:,:) 
@@ -106,4 +110,6 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('dyn_ldf: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_ldf
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilap.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilap.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilap.F90	(revision 2715)
@@ -4,4 +4,11 @@
    !! Ocean dynamics:  lateral viscosity trend
    !!======================================================================
+   !! History :  OPA  ! 1990-09  (G. Madec)  Original code
+   !!            4.0  ! 1993-03  (M. Guyon)  symetrical conditions (M. Guyon)
+   !!            6.0  ! 1996-01  (G. Madec)  statement function for e3
+   !!            8.0  ! 1997-07  (G. Madec)  lbc calls
+   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and module
+   !!            2.0  ! 2004-08  (C. Talandier) New trends organization
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
@@ -9,5 +16,4 @@
    !!                   using an iso-level bilaplacian operator
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
@@ -21,6 +27,5 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC dyn_ldf_bilap  ! called by step.F90
+   PUBLIC   dyn_ldf_bilap   ! called by step.F90
 
    !! * Substitutions
@@ -31,7 +36,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -69,32 +73,24 @@
       !! ** Action : - Update (ua,va) with the before iso-level biharmonic
       !!               mixing trend.
-      !!
-      !! History :
-      !!        !  90-09  (G. Madec)  Original code
-      !!        !  91-11  (G. Madec)
-      !!        !  93-03  (M. Guyon)  symetrical conditions (M. Guyon)
-      !!        !  96-01  (G. Madec)  statement function for e3
-      !!        !  97-07  (G. Madec)  lbc calls
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
-      !!   9.0  !  04-08  (C. Talandier) New trends organization
       !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt           ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zua, zva, zbt, ze2u, ze2v ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         zcu, zcv                             ! temporary workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-         zuf, zut, zlu, zlv                   ! temporary workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zcu => wrk_2d_1 , zcv => wrk_2d_2   ! 3D workspace
+      USE wrk_nemo, ONLY:   zuf => wrk_3d_3 , zut => wrk_3d_4   ! 3D workspace
+      USE wrk_nemo, ONLY:   zlu => wrk_3d_5 , zlv => wrk_3d_6
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jk                  ! dummy loop indices
+      REAL(wp) ::   zua, zva, zbt, ze2u, ze2v   ! temporary scalar
       !!----------------------------------------------------------------------
-      !!  OPA 8.5, LODYC-IPSL (2002)
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_ldf_bilap : iso-level bilaplacian operator'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
+
+      IF( wrk_in_use(2, 1,2) .OR. wrk_in_use(3, 3,4,5,6) ) THEN
+         CALL ctl_stop('dyn_ldf_bilap : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_ldf_bilap : iso-level bilaplacian operator'
+         WRITE(numout,*) '~~~~~~~~~~~~~'
       ENDIF
 
@@ -104,8 +100,8 @@
 !!$      zlu(:,:,jpk) = 0.e0
 !!$      zlv(:,:,jpk) = 0.e0
-      zuf(:,:,:) = 0.e0
-      zut(:,:,:) = 0.e0
-      zlu(:,:,:) = 0.e0
-      zlv(:,:,:) = 0.e0
+      zuf(:,:,:) = 0._wp
+      zut(:,:,:) = 0._wp
+      zlu(:,:,:) = 0._wp
+      zlv(:,:,:) = 0._wp
 
       !                                                ! ===============
@@ -137,10 +133,7 @@
             END DO  
          ENDIF
-      ENDDO
-
-      ! Boundary conditions on the laplacian  (zlu,zlv)
-      CALL lbc_lnk( zlu, 'U', -1. )
-      CALL lbc_lnk( zlv, 'V', -1. )
-         
+      END DO
+      CALL lbc_lnk( zlu, 'U', -1. )   ;   CALL lbc_lnk( zlv, 'V', -1. )   ! Boundary conditions
+
          
       DO jk = 1, jpkm1
@@ -214,5 +207,7 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-
+      IF( wrk_not_released(2, 1,2)     .OR.   &
+          wrk_not_released(3, 3,4,5,6) )   CALL ctl_stop('dyn_ldf_bilap: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_ldf_bilap
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90	(revision 2715)
@@ -4,4 +4,8 @@
    !! Ocean dynamics:  lateral viscosity trend
    !!======================================================================
+   !! History :  OPA  !  1997-07  (G. Madec)  Original code
+   !!  NEMO      1.0  !  2002-08  (G. Madec)  F90: Free form and module
+   !!            2.0  !  2004-08  (C. Talandier) New trends organization
+   !!----------------------------------------------------------------------
 #if defined key_ldfslp   ||   defined key_esopa
    !!----------------------------------------------------------------------
@@ -12,13 +16,13 @@
    !!   ldfguv         : 
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
    USE ldfdyn_oce      ! ocean dynamics lateral physics
    USE zdf_oce         ! ocean vertical physics
-   USE in_out_manager  ! I/O manager
    USE trdmod          ! ocean dynamics trends 
    USE trdmod_oce      ! ocean variables trends
    USE ldfslp          ! iso-neutral slopes available
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
@@ -27,6 +31,8 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC dyn_ldf_bilapg ! called by step.F90
+   PUBLIC   dyn_ldf_bilapg       ! called by step.F90
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  zfuw, zfvw , zdiu, zdiv   ! 2D workspace (ldfguv)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  zdju, zdj1u, zdjv, zdj1v  ! 2D workspace (ldfguv)
 
    !! * Substitutions
@@ -36,8 +42,18 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION dyn_ldf_bilapg_alloc()
+      !!----------------------------------------------------------------------
+      !!               ***  ROUTINE dyn_ldf_bilapg_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( zfuw(jpi,jpk) , zfvw (jpi,jpk) , zdiu(jpi,jpk) , zdiv (jpi,jpk) ,     &
+         &      zdju(jpi,jpk) , zdj1u(jpi,jpk) , zdjv(jpi,jpk) , zdj1v(jpi,jpk) , STAT=dyn_ldf_bilapg_alloc )
+         !
+      IF( dyn_ldf_bilapg_alloc /= 0 )   CALL ctl_warn('dyn_ldf_bilapg_alloc: failed to allocate arrays')
+   END FUNCTION dyn_ldf_bilapg_alloc
+
 
    SUBROUTINE dyn_ldf_bilapg( kt )
@@ -67,23 +83,17 @@
       !!                biharmonic mixing trend.
       !!              - save the trend in (zwk3,zwk4) ('key_trddyn')
-      !!
-      !! History :
-      !!   8.0  !  97-07  (G. Madec)  Original code
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
-      !!   9.0  !  04-08  (C. Talandier) New trends organization
-      !!----------------------------------------------------------------------
-      !! * Modules used     
-      USE oce, ONLY :    zwk3 => ta,   & ! use ta as 3D workspace   
-                         zwk4 => sa      ! use sa as 3D workspace   
-
-      !! * Arguments
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwk1 => wrk_3d_3 , zwk2 => wrk_3d_4   ! 3D workspace
+      USE oce     , ONLY:   zwk3 => ta       , zwk4 => sa         ! ta, sa used as 3D workspace   
+      !
       INTEGER, INTENT( in ) ::   kt           ! ocean time-step index
-
-      !! * Local declarations
+      !
       INTEGER ::   ji, jj, jk                 ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &
-         zwk1, zwk2                ! work array used for rotated biharmonic
-         !                         ! operator on tracers and/or momentum
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 3,4) ) THEN
+         CALL ctl_stop('dyn_ldf_bilapg: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -93,42 +103,32 @@
          zwk1(:,:,:) = 0.e0   ;   zwk3(:,:,:) = 0.e0
          zwk2(:,:,:) = 0.e0   ;   zwk4(:,:,:) = 0.e0
+         !                                      ! allocate dyn_ldf_bilapg arrays
+         IF( dyn_ldf_bilapg_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_ldf_bilapg: failed to allocate arrays')
       ENDIF
 
       ! Laplacian of (ub,vb) multiplied by ahm
       ! --------------------------------------  
-      ! rotated harmonic operator applied to (ub,vb)
-      !     and multiply by ahmu, ahmv (output in (zwk1,zwk2) )
-
-      CALL ldfguv ( ub, vb, zwk1, zwk2, 1 )
-
-
-      ! Lateral boundary conditions on (zwk1,zwk2)
-      CALL lbc_lnk( zwk1, 'U', -1. )
-      CALL lbc_lnk( zwk2, 'V', -1. )
-
+      CALL ldfguv( ub, vb, zwk1, zwk2, 1 )      ! rotated harmonic operator applied to (ub,vb)
+      !                                         ! and multiply by ahmu, ahmv (output in (zwk1,zwk2) )
+      CALL lbc_lnk( zwk1, 'U', -1. )   ;   CALL lbc_lnk( zwk2, 'V', -1. )     ! Lateral boundary conditions
 
       ! Bilaplacian of (ub,vb)
       ! ---------------------- 
-      ! rotated harmonic operator applied to (zwk1,zwk2) (output in (zwk3,zwk4) )
-
-      CALL ldfguv ( zwk1, zwk2, zwk3, zwk4, 2 )
-
-
-      ! Update the momentum trends			   (j-slab :   2, jpj-1)
+      CALL ldfguv( zwk1, zwk2, zwk3, zwk4, 2 )  ! rotated harmonic operator applied to (zwk1,zwk2) 
+      !                                         ! (output in (zwk3,zwk4) )
+
+      ! Update the momentum trends
       ! --------------------------
-      !                                                ! ===============
-      DO jj = 2, jpjm1                                 !  Vertical slab
-         !                                             ! ===============
+      DO jj = 2, jpjm1               ! add the diffusive trend to the general momentum trends
          DO jk = 1, jpkm1
             DO ji = 2, jpim1
-               ! add the diffusive trend to the general momentum trends
                ua(ji,jj,jk) = ua(ji,jj,jk) + zwk3(ji,jj,jk)
                va(ji,jj,jk) = va(ji,jj,jk) + zwk4(ji,jj,jk)
             END DO
          END DO
-         !                                             ! ===============
-      END DO                                           !   End of slab
-      !                                                ! ===============
-
+      END DO
+      !
+      IF( wrk_not_released(3, 3,4) )   CALL ctl_stop('dyn_ldf_bilapg: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_ldf_bilapg
 
@@ -174,37 +174,27 @@
       !!                          second order vertical derivative term)
       !!      'key_trddyn' defined: the trend is saved for diagnostics.
-      !!
-      !! History :
-      !!   8.0  !  97-07  (G. Madec)  Original code
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::   &
-         pu, pv     ! momentum fields (before u and v for the 1st call, and
-      !             ! laplacian of these fields multiplied by ahm for the 2nd
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out ) ::   &
-         plu, plv   ! partial harmonic operator applied to
-      !             ! pu and pv (all the components except
-      !             ! second order vertical derivative term)
-      INTEGER, INTENT( in ) ::   &
-         kahm       ! =1 the laplacian is multiplied by the eddy diffusivity coef.
-      !             ! =2 no multiplication
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk       ! dummy loop indices
-      REAL(wp) ::   &
-         zabe1, zabe2, zcof1, zcof2,    &  ! temporary scalars
-         zcoef0, zcoef3, zcoef4
-      REAL(wp) ::   &
-         zbur, zbvr, zmkt, zmkf, zuav, zvav,    &
-         zuwslpi, zuwslpj, zvwslpi, zvwslpj
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         ziut, zjuf , zjvt, zivf,       &  ! workspace
-         zdku, zdk1u, zdkv, zdk1v
-      REAL(wp), DIMENSION(jpi,jpk) ::   &
-         zfuw, zfvw, zdiu, zdiv,        &  ! workspace
-         zdju, zdj1u, zdjv, zdj1v 
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ziut => wrk_2d_1 , zjuf  => wrk_2d_2 , zjvt  => wrk_2d_3
+      USE wrk_nemo, ONLY:   zivf => wrk_2d_4 , zdku  => wrk_2d_5 , zdk1u => wrk_2d_6
+      USE wrk_nemo, ONLY:   zdkv => wrk_2d_7 , zdk1v => wrk_2d_8
+      !!
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pu , pv    ! 1st call: before horizontal velocity 
+      !                                                               ! 2nd call: ahm x these fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   plu, plv   ! partial harmonic operator applied to
+      !                                                               ! pu and pv (all the components except
+      !                                                               ! second order vertical derivative term)
+      INTEGER                         , INTENT(in   ) ::   kahm       ! =1 1st call ; =2 2nd call
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zabe1 , zabe2 , zcof1 , zcof2        ! local scalar
+      REAL(wp) ::   zcoef0, zcoef3, zcoef4               !   -      -
+      REAL(wp) ::   zbur, zbvr, zmkt, zmkf, zuav, zvav   !   -      -
+      REAL(wp) ::   zuwslpi, zuwslpj, zvwslpi, zvwslpj   !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8) ) THEN
+         CALL ctl_stop('dyn:ldfguv: requested workspace arrays unavailable')   ;   RETURN
+      END IF
       !                               ! ********** !   ! ===============
       DO jk = 1, jpkm1                ! First step !   ! Horizontal slab
@@ -461,4 +451,7 @@
       END DO                                           !   End of slab
       !                                                ! ===============
+
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8) )   CALL ctl_stop('dyn:ldfguv: failed to release workspace arrays')
+      !
    END SUBROUTINE ldfguv
 
@@ -469,4 +462,5 @@
 CONTAINS
    SUBROUTINE dyn_ldf_bilapg( kt )               ! Dummy routine
+      INTEGER, INTENT(in) :: kt
       WRITE(*,*) 'dyn_ldf_bilapg: You should not have seen this print! error?', kt
    END SUBROUTINE dyn_ldf_bilapg
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90	(revision 2715)
@@ -4,4 +4,9 @@
    !! Ocean dynamics:  lateral viscosity trend
    !!======================================================================
+   !! History :  OPA  !  97-07  (G. Madec)  Original code
+   !!  NEMO      1.0  !  2002-08  (G. Madec)  F90: Free form and module
+   !!             -   !  2004-08  (C. Talandier) New trends organization
+   !!            2.0  !  2005-11  (G. Madec)  s-coordinate: horizontal diffusion
+   !!----------------------------------------------------------------------
 #if defined key_ldfslp   ||   defined key_esopa
    !!----------------------------------------------------------------------
@@ -12,5 +17,4 @@
    !!                  tal s-coordinate laplacian operator.
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
@@ -23,4 +27,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 
@@ -28,6 +33,9 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC dyn_ldf_iso           ! called by step.F90
+   PUBLIC   dyn_ldf_iso           ! called by step.F90
+   PUBLIC   dyn_ldf_iso_alloc     ! called by nemogcm.F90
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: zfuw, zdiu, zdju, zdj1u   ! 2D workspace (dyn_ldf_iso) 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: zfvw, zdiv, zdjv, zdj1v   !  -      -
 
    !! * Substitutions
@@ -36,10 +44,20 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 3.3 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION dyn_ldf_iso_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE dyn_ldf_iso_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( zfuw(jpi,jpk) , zdiu(jpi,jpk) , zdju(jpi,jpk) , zdj1u(jpi,jpk) ,     & 
+         &      zfvw(jpi,jpk) , zdiv(jpi,jpk) , zdjv(jpi,jpk) , zdj1v(jpi,jpk) , STAT=dyn_ldf_iso_alloc )
+         !
+      IF( dyn_ldf_iso_alloc /= 0 )   CALL ctl_warn('dyn_ldf_iso_alloc: array allocate failed.')
+   END FUNCTION dyn_ldf_iso_alloc
+
 
    SUBROUTINE dyn_ldf_iso( kt )
@@ -86,32 +104,22 @@
       !!        Update (avmu,avmv) to accompt for the diagonal vertical component
       !!      of the rotated operator in dynzdf module
-      !!
-      !! History :
-      !!   8.0  !  97-07  (G. Madec)  Original code
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
-      !!   9.0  !  04-08  (C. Talandier) New trends organization
-      !!        !  05-11  (G. Madec)  s-coordinate: horizontal diffusion
       !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk            ! dummy loop indices
-      REAL(wp) ::   &
-         zabe1, zabe2, zcof1, zcof2,   &  ! temporary scalars
-         zmskt, zmskf, zbu, zbv,       &
-         zuah, zvah
-      REAL(wp), DIMENSION(jpi,jpj) ::   &
-         ziut, zjuf, zjvt, zivf,        & ! temporary workspace
-         zdku, zdk1u, zdkv, zdk1v
-
-      REAL(wp) ::   &
-         zcoef0, zcoef3, zcoef4, zmkt, zmkf,   &
-         zuav, zvav, zuwslpi, zuwslpj, zvwslpi, zvwslpj
-      REAL(wp), DIMENSION(jpi,jpk) ::        &
-         zfuw, zdiu, zdju, zdj1u,            & !    "        "
-         zfvw, zdiv, zdjv, zdj1v
-
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ziut  => wrk_2d_1 , zjuf  => wrk_2d_2 , zjvt => wrk_2d_3    ! 2D workspace
+      USE wrk_nemo, ONLY:   zivf  => wrk_2d_4 , zdku  => wrk_2d_5 , zdkv => wrk_2d_6    ! 2D workspace
+      USE wrk_nemo, ONLY:   zdk1u => wrk_2d_7 , zdk1v => wrk_2d_8
+      !
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zabe1, zabe2, zcof1, zcof2                       ! local scalars
+      REAL(wp) ::   zmskt, zmskf, zbu, zbv, zuah, zvah               !   -      -
+      REAL(wp) ::   zcoef0, zcoef3, zcoef4, zmkt, zmkf               !   -      -
+      REAL(wp) ::   zuav, zvav, zuwslpi, zuwslpj, zvwslpi, zvwslpj   !   -      -
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8) ) THEN
+         CALL ctl_stop('dyn_ldf_iso: requested workspace arrays unavailable')   ;   RETURN
+      END IF
 
       IF( kt == nit000 ) THEN
@@ -119,11 +127,12 @@
          IF(lwp) WRITE(numout,*) 'dyn_ldf_iso : iso-neutral laplacian diffusive operator or '
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   s-coordinate horizontal diffusive operator'
+         !                                      ! allocate dyn_ldf_bilap arrays
+         IF( dyn_ldf_iso_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_ldf_iso: failed to allocate arrays')
       ENDIF
 
-!     ! s-coordinate: Iso-level diffusion on momentum but not on tracer
+      ! s-coordinate: Iso-level diffusion on momentum but not on tracer
       IF( ln_dynldf_hor .AND. ln_traldf_iso ) THEN
- 
-         ! set the slopes of iso-level
-         DO jk = 1, jpk
+         !
+         DO jk = 1, jpk         ! set the slopes of iso-level
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -135,5 +144,4 @@
             END DO
          END DO
- 
          ! Lateral boundary conditions on the slopes
          CALL lbc_lnk( uslp , 'U', -1. )      ;      CALL lbc_lnk( vslp , 'V', -1. )
@@ -141,7 +149,7 @@
  
 !!bug
-         if( kt == nit000 ) then
-            IF(lwp) WRITE(numout,*) ' max slop: u',SQRT( MAXVAL(uslp*uslp)), ' v ', SQRT(MAXVAL(vslp)),  &
-               &                             ' wi', sqrt(MAXVAL(wslpi)), ' wj', sqrt(MAXVAL(wslpj))
+         IF( kt == nit000 ) then
+            IF(lwp) WRITE(numout,*) ' max slop: u', SQRT( MAXVAL(uslp*uslp)), ' v ', SQRT(MAXVAL(vslp)),  &
+               &                             ' wi', sqrt(MAXVAL(wslpi))     , ' wj', sqrt(MAXVAL(wslpj))
          endif
 !!end
@@ -420,4 +428,6 @@
       !                                                ! ===============
 
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8) )   CALL ctl_stop('dyn_ldf_iso: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_ldf_iso
 
@@ -428,4 +438,5 @@
 CONTAINS
    SUBROUTINE dyn_ldf_iso( kt )               ! Empty routine
+      INTEGER, INTENT(in) :: kt
       WRITE(*,*) 'dyn_ldf_iso: You should not have seen this print! error?', kt
    END SUBROUTINE dyn_ldf_iso
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90	(revision 2715)
@@ -4,4 +4,10 @@
    !! Ocean dynamics:  lateral viscosity trend
    !!======================================================================
+   !! History :  OPA  ! 1990-09 (G. Madec) Original code
+   !!            4.0  ! 1991-11 (G. Madec)
+   !!            6.0  ! 1996-01 (G. Madec) statement function for e3 and ahm
+   !!   NEMO     1.0  ! 2002-06 (G. Madec)  F90: Free form and module
+   !!             -   ! 2004-08 (C. Talandier) New trends organization
+   !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
@@ -9,5 +15,4 @@
    !!                  using an iso-level harmonic operator
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
@@ -22,5 +27,4 @@
    PRIVATE
 
-   !! * Routine accessibility
    PUBLIC dyn_ldf_lap  ! called by step.F90
 
@@ -32,7 +36,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -58,21 +61,11 @@
       !! ** Action : - Update (ua,va) with the before iso-level harmonic 
       !!               mixing trend.
-      !!
-      !! History :
-      !!        !  90-09 (G. Madec) Original code
-      !!        !  91-11 (G. Madec)
-      !!        !  96-01 (G. Madec) statement function for e3 and ahm
-      !!   8.5  !  02-06 (G. Madec)  F90: Free form and module
-      !!   9.0  !  04-08 (C. Talandier) New trends organization
       !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
-
-      !! * Local declarations
-      INTEGER  ::   ji, jj, jk            ! dummy loop indices
-      REAL(wp) ::   &
-         zua, zva, ze2u, ze1v             ! temporary scalars
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jk             ! dummy loop indices
+      REAL(wp) ::   zua, zva, ze2u, ze1v   ! local scalars
       !!----------------------------------------------------------------------
-
+      !
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -80,5 +73,4 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~ '
       ENDIF
-
       !                                                ! ===============
       DO jk = 1, jpkm1                                 ! Horizontal slab
@@ -86,6 +78,6 @@
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
-               ze2u = rotb (ji,jj,jk)*fsahmf(ji,jj,jk)*fse3f(ji,jj,jk)
-               ze1v = hdivb(ji,jj,jk)*fsahmt(ji,jj,jk)
+               ze2u = rotb (ji,jj,jk) * fsahmf(ji,jj,jk) * fse3f(ji,jj,jk)
+               ze1v = hdivb(ji,jj,jk) * fsahmt(ji,jj,jk)
                ! horizontal diffusive trends
                zua = - ( ze2u - rotb (ji,jj-1,jk)*fsahmf(ji,jj-1,jk)*fse3f(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   &
@@ -103,5 +95,4 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-
    END SUBROUTINE dyn_ldf_lap
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 2715)
@@ -37,4 +37,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! lateral boundary condition (or mpp link)
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 #if defined key_agrif
@@ -49,10 +50,9 @@
    !! * Substitutions
 #  include "domzgr_substitute.h90"
-   !!-------------------------------------------------------------------------
+   !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!-------------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -91,20 +91,22 @@
       !!               un,vn   now horizontal velocity of next time-step
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   ze3u_f => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   ze3v_f => sa   ! use sa as 3D workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   ze3u_f => ta       , ze3v_f => sa       ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zs_t   => wrk_2d_1 , zs_u_1 => wrk_2d_2 , zs_v_1 => wrk_2d_3
+      !
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
 #if ! defined key_dynspg_flt
       REAL(wp) ::   z2dt         ! temporary scalar
 #endif
-      REAL(wp) ::   zue3a , zue3n , zue3b    ! temporary scalar
-      REAL(wp) ::   zve3a , zve3n , zve3b    !    -         -
-      REAL(wp) ::   zuf   , zvf              !    -         - 
-      REAL(wp) ::   zec                      !    -         - 
-      REAL(wp) ::   zv_t_ij  , zv_t_ip1j     !     -        -
-      REAL(wp) ::   zv_t_ijp1                !     -        -
-      REAL(wp), DIMENSION(jpi,jpj) ::  zs_t, zs_u_1, zs_v_1      ! temporary 2D workspace
+      REAL(wp) ::   zue3a, zue3n, zue3b, zuf    ! local scalars
+      REAL(wp) ::   zve3a, zve3n, zve3b, zvf    !   -      -
+      REAL(wp) ::   zec, zv_t_ij, zv_t_ip1j, zv_t_ijp1
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) ) THEN
+         CALL ctl_stop('dyn_nxt: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -156,8 +158,8 @@
       CALL obc_dyn( kt )
       !
-      IF ( lk_dynspg_exp .OR. lk_dynspg_ts ) THEN
+      IF( .NOT. lk_dynspg_flt ) THEN
          ! Flather boundary condition : - Update sea surface height on each open boundary
-         !                                       sshn   (= after ssh   ) for explicit case
-         !                                       sshn_b (= after ssha_b) for time-splitting case
+         !                                       sshn   (= after ssh   ) for explicit case (lk_dynspg_exp=T)
+         !                                       sshn_b (= after ssha_b) for time-splitting case (lk_dynspg_ts=T)
          !                              - Correct the barotropic velocities
          CALL obc_dyn_bt( kt )
@@ -173,7 +175,5 @@
 # elif defined key_bdy 
       !                                !* BDY open boundaries
-      IF( lk_dynspg_exp .OR. lk_dynspg_ts ) THEN       ! except for filtered option
-         CALL bdy_dyn_frs( kt )
-      ENDIF
+      IF( .NOT. lk_dynspg_flt )   CALL bdy_dyn_frs( kt )
 # endif
       !
@@ -318,4 +318,6 @@
          &                       tab3d_2=vn, clinfo2=' Vn: '       , mask2=vmask )
       ! 
+      IF( wrk_not_released(2, 1,2,3) )   CALL ctl_stop('dyn_nxt: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_nxt
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90	(revision 2715)
@@ -14,4 +14,5 @@
    USE oce            ! ocean dynamics and tracers variables
    USE dom_oce        ! ocean space and time domain variables
+   USE phycst         ! physical constants
    USE obc_oce        ! ocean open boundary conditions
    USE sbc_oce        ! surface boundary condition: ocean
@@ -26,5 +27,6 @@
    USE prtctl         ! Print control                     (prt_ctl routine)
    USE in_out_manager ! I/O manager
-   USE phycst         ! physical constants
+   USE lib_mpp        ! MPP library
+   USE solver          ! solver initialization
 
    IMPLICIT NONE
@@ -42,7 +44,6 @@
    !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -73,17 +74,21 @@
       !!        of the physical meaning of the results. 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrdu => wrk_3d_4 , ztrdv => wrk_3d_5    ! 3D workspace
+      !
       INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index
       INTEGER, INTENT(  out) ::   kindic   ! solver flag
-      !!
+      !
       INTEGER  ::   ji, jj, jk                             ! dummy loop indices
       REAL(wp) ::   z2dt, zg_2                             ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 4,5) ) THEN
+         CALL ctl_stop('dyn_spg: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
 !!gm NOTA BENE : the dynspg_exp and dynspg_ts should be modified so that 
 !!gm             they return the after velocity, not the trends (as in trazdf_imp...)
 !!gm             In this case, change/simplify dynnxt
-
 
 
@@ -149,4 +154,6 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(3, 4,5) )   CALL ctl_stop('dyn_spg: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_spg
 
@@ -171,4 +178,10 @@
       ENDIF
 
+      !                        ! allocate dyn_spg arrays
+      IF( lk_dynspg_ts ) THEN
+         IF( dynspg_oce_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_oce arrays')
+         IF( dyn_spg_ts_alloc() /= 0 )   CALL ctl_stop('STOP', 'dyn_spg_init: failed to allocate dynspg_ts  arrays')
+      ENDIF
+
       !                        ! Control of surface pressure gradient scheme options
       ioptio = 0
@@ -195,4 +208,8 @@
       ENDIF
 
+#if defined key_dynspg_flt || defined key_esopa
+      CALL solver_init( nit000 )   ! Elliptic solver initialisation
+#endif
+
       !                        ! Control of timestep choice
       IF( lk_dynspg_ts .OR. lk_dynspg_exp ) THEN
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 2715)
@@ -40,7 +40,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -62,7 +61,7 @@
       !!                         the surf. pressure gradient trend
       !!---------------------------------------------------------------------
-      INTEGER, INTENT( in )  ::   kt         ! ocean time-step index
+      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
       !!
-      INTEGER  ::   ji, jj, jk               ! dummy loop indices
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
       !!----------------------------------------------------------------------
 
@@ -72,5 +71,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
          !
-         spgu(:,:) = 0.e0   ;   spgv(:,:) = 0.e0
+         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
          !
          IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg'
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 2715)
@@ -31,5 +31,4 @@
    USE dynadv          ! advection 
    USE solmat          ! matrix construction for elliptic solvers
-   USE solver          ! solver initialization
    USE solpcg          ! preconditionned conjugate gradient solver
    USE solsor          ! Successive Over-relaxation solver
@@ -63,7 +62,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -105,14 +103,11 @@
       !! References : Roullet and Madec 1999, JGR.
       !!---------------------------------------------------------------------
-      USE oce, ONLY :   zub   => ta   ! ta used as workspace
-      USE oce, ONLY :   zvb   => sa   ! ta used as workspace
+      USE oce, ONLY:   zub   => ta , zvb   => sa   ! (ta,sa) used as workspace
       !!
       INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index
       INTEGER, INTENT(  out) ::   kindic   ! solver convergence flag (<0 if not converge)
       !!                                   
-      INTEGER  ::   ji, jj, jk           ! dummy loop indices
-      REAL(wp) ::   z2dt, z2dtg          ! temporary scalars
-      REAL(wp) ::   zgcb, zbtd   !   -          -
-      REAL(wp) ::   ztdgu, ztdgv         !   -          -
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   z2dt, z2dtg, zgcb, zbtd, ztdgu, ztdgv   ! local scalars
       !!----------------------------------------------------------------------
       !
@@ -123,7 +118,6 @@
        
          ! set to zero free surface specific arrays
-         spgu(:,:) = 0.e0                     ! surface pressure gradient (i-direction)
-         spgv(:,:) = 0.e0                     ! surface pressure gradient (j-direction)
-         CALL solver_init( nit000 )           ! Elliptic solver initialisation
+         spgu(:,:) = 0._wp                     ! surface pressure gradient (i-direction)
+         spgv(:,:) = 0._wp                     ! surface pressure gradient (j-direction)
 
          ! read filtered free surface arrays in restart file
@@ -205,6 +199,6 @@
       DO jj = 2, jpjm1
          DO ji = fs_2, fs_jpim1   ! vector opt.
-            spgu(ji,jj) = 0.e0
-            spgv(ji,jj) = 0.e0
+            spgu(ji,jj) = 0._wp
+            spgv(ji,jj) = 0._wp
          END DO
       END DO
@@ -282,7 +276,7 @@
       ncut = 0
       ! if rnorme is 0, the solution is 0, the solver is not called
-      IF( rnorme == 0.e0 ) THEN
-         gcx(:,:) = 0.e0
-         res   = 0.e0
+      IF( rnorme == 0._wp ) THEN
+         gcx(:,:) = 0._wp
+         res   = 0._wp
          niter = 0
          ncut  = 999
@@ -356,31 +350,31 @@
 
    SUBROUTINE flt_rst( kt, cdrw )
-     !!---------------------------------------------------------------------
-     !!                   ***  ROUTINE ts_rst  ***
-     !!
-     !! ** Purpose : Read or write filtered free surface arrays in restart file
-     !!----------------------------------------------------------------------
-     INTEGER         , INTENT(in) ::   kt         ! ocean time-step
-     CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
-     !!----------------------------------------------------------------------
-
-     IF( TRIM(cdrw) == 'READ' ) THEN
-        IF( iom_varid( numror, 'gcx', ldstop = .FALSE. ) > 0 ) THEN
+      !!---------------------------------------------------------------------
+      !!                   ***  ROUTINE ts_rst  ***
+      !!
+      !! ** Purpose : Read or write filtered free surface arrays in restart file
+      !!----------------------------------------------------------------------
+      INTEGER         , INTENT(in) ::   kt         ! ocean time-step
+      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
+      !!----------------------------------------------------------------------
+      !
+      IF( TRIM(cdrw) == 'READ' ) THEN
+         IF( iom_varid( numror, 'gcx', ldstop = .FALSE. ) > 0 ) THEN
 ! Caution : extra-hallow
 ! gcx and gcxb are defined as: DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)
-           CALL iom_get( numror, jpdom_autoglo, 'gcx' , gcx (1:jpi,1:jpj) )
-           CALL iom_get( numror, jpdom_autoglo, 'gcxb', gcxb(1:jpi,1:jpj) )
-           IF( neuler == 0 )   gcxb(:,:) = gcx (:,:)
-        ELSE
-           gcx (:,:) = 0.e0
-           gcxb(:,:) = 0.e0
-        ENDIF
-     ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
+            CALL iom_get( numror, jpdom_autoglo, 'gcx' , gcx (1:jpi,1:jpj) )
+            CALL iom_get( numror, jpdom_autoglo, 'gcxb', gcxb(1:jpi,1:jpj) )
+            IF( neuler == 0 )   gcxb(:,:) = gcx (:,:)
+         ELSE
+            gcx (:,:) = 0.e0
+            gcxb(:,:) = 0.e0
+         ENDIF
+      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
 ! Caution : extra-hallow
 ! gcx and gcxb are defined as: DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)
-        CALL iom_rstput( kt, nitrst, numrow, 'gcx' , gcx (1:jpi,1:jpj) )
-        CALL iom_rstput( kt, nitrst, numrow, 'gcxb', gcxb(1:jpi,1:jpj) )
-     ENDIF
-     !
+         CALL iom_rstput( kt, nitrst, numrow, 'gcx' , gcx (1:jpi,1:jpj) )
+         CALL iom_rstput( kt, nitrst, numrow, 'gcxb', gcxb(1:jpi,1:jpj) )
+      ENDIF
+      !
    END SUBROUTINE flt_rst
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_oce.F90	(revision 2715)
@@ -3,14 +3,17 @@
    !!                       ***  MODULE dynspg_oce  ***
    !!       
-   !! Ocean dynamics: Define in memory surface pressure gradient variables
+   !! Ocean dynamics: Define in memory some surface pressure gradient variables
    !!======================================================================
-   !! History :  1.0  !  05-12  (C. Talandier, G. Madec)  Original code
+   !! History :  1.0  ! 2005-12  (C. Talandier, G. Madec)  Original code
    !!            3.2  ! 2009-07  (R. Benshila) Suppression of rigid-lid option
    !!----------------------------------------------------------------------
    USE par_oce        ! ocean parameters
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
    PUBLIC           
 
+   PUBLIC   dynspg_oce_alloc   ! called in dynspg.F90
+   
    !                                                       !!! Surface pressure gradient logicals
 #if   defined key_dynspg_exp  ||  defined key_esopa
@@ -30,19 +33,31 @@
 #endif
 
-!!gm BUG : always required in _ts, only  some of them in vvl
-!    #if   defined key_dynspg_ts   ||   defined key_esopa
-!!gm end
-#if   defined key_dynspg_ts   ||   defined key_vvl   ||   defined key_esopa
-  !                                                                !!! Time splitting scheme (sub-time step variables)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: ua_e  , va_e             ! barotropic velocities (after)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: sshn_e, ssha_e, sshn_b   ! sea surface heigth (now, after, average)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hu_e  , hv_e             ! now ocean depth ( = Ho+sshn_e )
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: hur_e , hvr_e            ! inverse of the now depth ( = 1/(Ho+sshn_e) )
-#endif
+  !                                                                         !!! Time splitting scheme (key_dynspg_ts) 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_e, ssha_e   ! sea surface heigth (now, after, average)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ua_e  , va_e     ! barotropic velocities (after)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hu_e  , hv_e     ! now ocean depth ( = Ho+sshn_e )
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hur_e , hvr_e    ! inverse of hu_e and hv_e
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshn_b       ! before field without time-filter
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.2 , LODYC-IPSL  (2009)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION dynspg_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  routine dynspg_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( sshn_e(jpi,jpj) , ua_e(jpi,jpj) , hu_e(jpi,jpj) , hur_e(jpi,jpj) ,      &
+         &      ssha_e(jpi,jpj) , va_e(jpi,jpj) , hv_e(jpi,jpj) , hvr_e(jpi,jpj) ,      &
+         &      sshn_b(jpi,jpj)                                                  , STAT = dynspg_oce_alloc )
+         !
+      IF( lk_mpp                )   CALL mpp_sum ( dynspg_oce_alloc )
+      IF( dynspg_oce_alloc /= 0 )   CALL ctl_warn('dynspg_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION dynspg_oce_alloc
+
    !!======================================================================
 END MODULE dynspg_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 2715)
@@ -38,5 +38,5 @@
    USE prtctl          ! Print control
    USE in_out_manager  ! I/O manager
-   USE iom
+   USE iom             ! IOM library
    USE restart         ! only for lrst_oce
    USE zdf_oce
@@ -45,25 +45,37 @@
    PRIVATE
 
-   PUBLIC dyn_spg_ts  ! routine called by step.F90
-   PUBLIC ts_rst      ! routine called by istate.F90
-
-
-   REAL(wp), DIMENSION(jpi,jpj) ::  ftnw, ftne   ! triad of coriolis parameter
-   REAL(wp), DIMENSION(jpi,jpj) ::  ftsw, ftse   ! (only used with een vorticity scheme)
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   un_b, vn_b   ! now    averaged velocity
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ub_b, vb_b   ! before averaged velocity
-
+   PUBLIC dyn_spg_ts        ! routine called by step.F90
+   PUBLIC ts_rst            ! routine called by istate.F90
+   PUBLIC dyn_spg_ts_alloc  ! routine called by dynspg.F90
+
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftnw, ftne   ! triad of coriolis parameter
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  ftsw, ftse   ! (only used with een vorticity scheme)
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   un_b, vn_b   ! now    averaged velocity
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ub_b, vb_b   ! before averaged velocity
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
-   !!-------------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!-------------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION dyn_spg_ts_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  routine dyn_spg_ts_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( ftnw  (jpi,jpj) , ftne(jpi,jpj) , un_b(jpi,jpj) , vn_b(jpi,jpj) ,     &
+         &      ftsw  (jpi,jpj) , ftse(jpi,jpj) , ub_b(jpi,jpj) , vb_b(jpi,jpj) , STAT= dyn_spg_ts_alloc )
+         !
+      IF( lk_mpp                )   CALL mpp_sum( dyn_spg_ts_alloc )
+      IF( dyn_spg_ts_alloc /= 0 )   CALL ctl_warn('dynspg_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION dyn_spg_ts_alloc
+
 
    SUBROUTINE dyn_spg_ts( kt )
@@ -94,27 +106,27 @@
       !! References : Griffies et al., (2003): A technical guide to MOM4. NOAA/GFDL
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zsshun_e => wrk_2d_1 , zsshb_e  => wrk_2d_2  , zhdiv => wrk_2d_3
+      USE wrk_nemo, ONLY:   zsshvn_e => wrk_2d_4 , zssh_sum => wrk_2d_5
+      USE wrk_nemo, ONLY:   zcu => wrk_2d_6  , zwx   => wrk_2d_7  , zua   => wrk_2d_8  , zbfru  => wrk_2d_9
+      USE wrk_nemo, ONLY:   zcv => wrk_2d_10 , zwy   => wrk_2d_11 , zva   => wrk_2d_12 , zbfrv  => wrk_2d_13
+      USE wrk_nemo, ONLY:   zun => wrk_2d_14 , zun_e => wrk_2d_15 , zub_e => wrk_2d_16 , zu_sum => wrk_2d_17
+      USE wrk_nemo, ONLY:   zvn => wrk_2d_18 , zvn_e => wrk_2d_19 , zvb_e => wrk_2d_20 , zv_sum => wrk_2d_21
+      !
       INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      INTEGER  ::   icycle           ! temporary scalar
-
-      REAL(wp) ::   zraur, zcoef, z2dt_e, z2dt_b     ! temporary scalars
-      REAL(wp) ::   z1_8, zx1, zy1                   !    -         -
-      REAL(wp) ::   z1_4, zx2, zy2                   !     -         -
-      REAL(wp) ::   zu_spg, zu_cor, zu_sld, zu_asp   !     -         -
-      REAL(wp) ::   zv_spg, zv_cor, zv_sld, zv_asp   !     -         -
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zhdiv, zsshb_e
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zbfru  , zbfrv     ! 2D workspace
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zsshun_e, zsshvn_e   ! 2D workspace
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zcu, zwx, zua, zun   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zcv, zwy, zva, zvn   !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zun_e, zub_e, zu_sum      ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zvn_e, zvb_e, zv_sum      !  -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zssh_sum                  !  -      -
+      INTEGER  ::   icycle           ! local scalar
+      REAL(wp) ::   zraur, zcoef, z2dt_e, z2dt_b     ! local scalars
+      REAL(wp) ::   z1_8, zx1, zy1                   !   -      -
+      REAL(wp) ::   z1_4, zx2, zy2                   !   -      -
+      REAL(wp) ::   zu_spg, zu_cor, zu_sld, zu_asp   !   -      -
+      REAL(wp) ::   zv_spg, zv_cor, zv_sld, zv_asp   !   -      -
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2,  1, 2, 3, 4, 5, 6, 7, 8, 9,10,     &
+         &              11,12,13,14,15,16,17,18,19,20,21 ) ) THEN
+         CALL ctl_stop( 'dyn_spg_ts: requested workspace arrays unavailable' )   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN             !* initialisation
@@ -465,5 +477,5 @@
          !                                                      !         - Correct the velocity
 
-         IF( lk_obc               )   CALL obc_fla_ts
+         IF( lk_obc               )   CALL obc_fla_ts ( ua_e, va_e, sshn_e, ssha_e )
          IF( lk_bdy .OR. ln_tides )   CALL bdy_dyn_fla( sshn_e ) 
          !
@@ -550,4 +562,8 @@
       !
       !
+      IF( wrk_not_released(2,  1, 2, 3, 4, 5, 6, 7, 8, 9,10,         &
+         &                    11,12,13,14,15,16,17,18,19,20,21) )    &
+         CALL ctl_stop('dyn_spg_ts: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_spg_ts
 
@@ -623,7 +639,7 @@
 
          IF( iom_varid( numror, 'sshn_b', ldstop = .FALSE. ) > 0 ) THEN
-            CALL iom_get( numror, jpdom_autoglo, 'sshn_b' , sshn_b (:,:) )   ! filtered extrenal ssh
+            CALL iom_get( numror, jpdom_autoglo, 'sshn_b' , sshn_b (:,:) )   ! filtered ssh
          ELSE
-            sshn_b(:,:)=sshb(:,:)   ! if not in restart set previous time mean to current baroclinic before value   
+            sshn_b(:,:) = sshb(:,:)   ! if not in restart set previous time mean to current baroclinic before value   
          ENDIF 
       ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
@@ -640,8 +656,12 @@
    !!----------------------------------------------------------------------
 CONTAINS
-   SUBROUTINE dyn_spg_ts( kt )       ! Empty routine
+   INTEGER FUNCTION dyn_spg_ts_alloc()    ! Dummy function
+      dyn_spg_ts_alloc = 0
+   END FUNCTION dyn_spg_ts_alloc
+   SUBROUTINE dyn_spg_ts( kt )            ! Empty routine
+      INTEGER, INTENT(in) :: kt
       WRITE(*,*) 'dyn_spg_ts: You should not have seen this print! error?', kt
    END SUBROUTINE dyn_spg_ts
-   SUBROUTINE ts_rst( kt, cdrw )     ! Empty routine
+   SUBROUTINE ts_rst( kt, cdrw )          ! Empty routine
       INTEGER         , INTENT(in) ::   kt         ! ocean time-step
       CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 2715)
@@ -5,14 +5,14 @@
    !!                 planetary vorticity trends
    !!======================================================================
-   !! History :  OPA  !  1989-12  (P. Andrich)  vor_ens: Original code
-   !!            5.0  !  1991-11  (G. Madec) vor_ene, vor_mix: Original code
-   !!            6.0  !  1996-01  (G. Madec)  s-coord, suppress work arrays
-   !!            8.5  !  2002-08  (G. Madec)  F90: Free form and module
-   !!   NEMO     1.0  !  2004-02  (G. Madec)  vor_een: Original code
-   !!             -   !  2003-08  (G. Madec)  add vor_ctl
-   !!             -   !  2005-11  (G. Madec)  add dyn_vor (new step architecture)
-   !!            2.0  !  2006-11  (G. Madec)  flux form advection: add metric term
-   !!            3.2  !  2009-04  (R. Benshila)  vvl: correction of een scheme
-   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
+   !! History :  OPA  ! 1989-12  (P. Andrich)  vor_ens: Original code
+   !!            5.0  ! 1991-11  (G. Madec) vor_ene, vor_mix: Original code
+   !!            6.0  ! 1996-01  (G. Madec)  s-coord, suppress work arrays
+   !!   NEMO     0.5  ! 2002-08  (G. Madec)  F90: Free form and module
+   !!            1.0  ! 2004-02  (G. Madec)  vor_een: Original code
+   !!             -   ! 2003-08  (G. Madec)  add vor_ctl
+   !!             -   ! 2005-11  (G. Madec)  add dyn_vor (new step architecture)
+   !!            2.0  ! 2006-11  (G. Madec)  flux form advection: add metric term
+   !!            3.2  ! 2009-04  (R. Benshila)  vvl: correction of een scheme
+   !!            3.3  ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
    !!----------------------------------------------------------------------
 
@@ -33,4 +33,5 @@
    USE prtctl         ! Print control
    USE in_out_manager ! I/O manager
+   USE lib_mpp
 
    IMPLICIT NONE
@@ -57,7 +58,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -71,10 +71,9 @@
       !!               and planetary vorticity trends) ('key_trddyn')
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   ztrdu => ta   ! use ta as 3D workspace
-      USE oce, ONLY :   ztrdv => sa   ! use sa as 3D workspace
-      !!
+      USE oce, ONLY:   ztrdu => ta , ztrdv => sa   ! (ta,sa) used as 3D workspace
+      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !!----------------------------------------------------------------------
-
+      !
       !                                          ! vorticity term 
       SELECT CASE ( nvor )                       ! compute the vorticity trend and add it to the general trend
@@ -171,7 +170,7 @@
          !
       END SELECT
-
+      !
       !                       ! print sum trends (used for debugging)
-      IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' vor  - Ua: ', mask1=umask, &
+      IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' vor  - Ua: ', mask1=umask,               &
          &                     tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
@@ -205,4 +204,7 @@
       !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx => wrk_2d_1 , zwy => wrk_2d_2 , zwz => wrk_2d_3     ! 2D workspace
+      !
       INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
       INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ;
@@ -210,10 +212,12 @@
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
-      !!
-      INTEGER  ::   ji, jj, jk         ! dummy loop indices
-      REAL(wp) ::   zx1, zy1, zfact2   ! temporary scalars
-      REAL(wp) ::   zx2, zy2           !    "         "
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz   ! temporary 2D workspace
-      !!----------------------------------------------------------------------
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zx1, zy1, zfact2, zx2, zy2   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) ) THEN
+         CALL ctl_stop('dyn:vor_ene: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -280,4 +284,6 @@
       END DO                                           !   End of slab
       !                                                ! ===============
+      IF( wrk_not_released(2, 1,2,3) )   CALL ctl_stop('dyn:vor_ene: failed to release workspace arrays')
+      !
    END SUBROUTINE vor_ene
 
@@ -314,11 +320,17 @@
       !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx => wrk_2d_4 , zwy => wrk_2d_5 , zwz => wrk_2d_6 , zww => wrk_2d_7   ! 2D workspace
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean timestep index
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zfact1, zua, zcua, zx1, zy1   ! temporary scalars
-      REAL(wp) ::   zfact2, zva, zcva, zx2, zy2   !    "         "
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz, zww   ! temporary 3D workspace
-      !!----------------------------------------------------------------------
+      REAL(wp) ::   zfact1, zua, zcua, zx1, zy1   ! local scalars
+      REAL(wp) ::   zfact2, zva, zcva, zx2, zy2   !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 4,5,6,7) ) THEN
+         CALL ctl_stop('dyn:vor_mix: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -392,4 +404,6 @@
       END DO                                           !   End of slab
       !                                                ! ===============
+      IF( wrk_not_released(2, 4,5,6,7) )   CALL ctl_stop('dyn:vor_mix: failed to release workspace arrays')
+      !
    END SUBROUTINE vor_mix
 
@@ -421,4 +435,7 @@
       !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx => wrk_2d_4, zwy => wrk_2d_5, zwz => wrk_2d_6    ! 2D workspace
+      !
       INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
       INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ;
@@ -426,10 +443,13 @@
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
-      !!
+      !
       INTEGER  ::   ji, jj, jk           ! dummy loop indices
       REAL(wp) ::   zfact1, zuav, zvau   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz   ! temporary 3D workspace
       !!----------------------------------------------------------------------
       
+      IF( wrk_in_use(2, 4,5,6) ) THEN
+         CALL ctl_stop('dyn:vor_ens: requested workspace arrays unavailable')   ;   RETURN
+      END IF
+
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -503,4 +523,6 @@
       END DO                                           !   End of slab
       !                                                ! ===============
+      IF( wrk_not_released(2, 4,5,6) )   CALL ctl_stop('dyn:vor_ens: failed to release workspace arrays')
+      !
    END SUBROUTINE vor_ens
 
@@ -525,4 +547,12 @@
       !! References : Arakawa and Lamb 1980, Mon. Wea. Rev., 109, 18-36
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx  => wrk_2d_1 , zwy  => wrk_2d_2 ,  zwz => wrk_2d_3     ! 2D workspace
+      USE wrk_nemo, ONLY:   ztnw => wrk_2d_4 , ztne => wrk_2d_5 
+      USE wrk_nemo, ONLY:   ztsw => wrk_2d_6 , ztse => wrk_2d_7
+#if defined key_vvl
+      USE wrk_nemo, ONLY:   ze3f => wrk_3d_1                                           ! 3D workspace (lk_vvl=T)
+#endif
+      !
       INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
       INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ;
@@ -532,13 +562,14 @@
       !!
       INTEGER  ::   ji, jj, jk         ! dummy loop indices
-      REAL(wp) ::   zfac12, zua, zva   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwx, zwy, zwz            ! temporary 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztnw, ztne, ztsw, ztse   ! temporary 3D workspace
-#if defined key_vvl
-      REAL(wp), DIMENSION(jpi,jpj,jpk)       ::   ze3f
-#else
-      REAL(wp), DIMENSION(jpi,jpj,jpk), SAVE ::   ze3f
+      INTEGER  ::   ierr               ! local integer
+      REAL(wp) ::   zfac12, zua, zva   ! local scalars
+#if ! defined key_vvl
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE ::   ze3f     ! lk_vvl=F, ze3f=1/e3f saved one for all
 #endif
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7) .OR. wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('dyn:vor_een: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -546,4 +577,9 @@
          IF(lwp) WRITE(numout,*) 'dyn:vor_een : vorticity term: energy and enstrophy conserving scheme'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+         IF( .NOT.lk_vvl ) THEN
+            ALLOCATE( ze3f(jpi,jpj,jpk) , STAT=ierr )
+            IF( lk_mpp    )   CALL mpp_sum ( ierr )
+            IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'dyn:vor_een : unable to allocate arrays' )
+         ENDIF
       ENDIF
 
@@ -554,5 +590,5 @@
                   ze3f(ji,jj,jk) = ( fse3t(ji,jj+1,jk)*tmask(ji,jj+1,jk) + fse3t(ji+1,jj+1,jk)*tmask(ji+1,jj+1,jk)   &
                      &             + fse3t(ji,jj  ,jk)*tmask(ji,jj  ,jk) + fse3t(ji+1,jj  ,jk)*tmask(ji+1,jj  ,jk) ) * 0.25
-                  IF( ze3f(ji,jj,jk) /= 0.e0 )   ze3f(ji,jj,jk) = 1.e0 / ze3f(ji,jj,jk)
+                  IF( ze3f(ji,jj,jk) /= 0._wp )   ze3f(ji,jj,jk) = 1._wp / ze3f(ji,jj,jk)
                END DO
             END DO
@@ -561,5 +597,5 @@
       ENDIF
 
-      zfac12 = 1.e0 / 12.e0      ! Local constant initialization
+      zfac12 = 1._wp / 12._wp    ! Local constant initialization
 
       
@@ -634,4 +670,7 @@
       END DO                                           !   End of slab
       !                                                ! ===============
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7) .OR.   &
+          wrk_not_released(3, 1)             )   CALL ctl_stop('dyn:vor_een: failed to release workspace arrays')
+      !
    END SUBROUTINE vor_een
 
@@ -644,5 +683,6 @@
       !!              tracer advection schemes
       !!----------------------------------------------------------------------
-      INTEGER ::   ioptio          ! temporary integer
+      INTEGER ::   ioptio          ! local integer
+      !!
       NAMELIST/namdyn_vor/ ln_dynvor_ens, ln_dynvor_ene, ln_dynvor_mix, ln_dynvor_een
       !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90	(revision 2715)
@@ -4,9 +4,8 @@
    !! Ocean dynamics : vertical advection trend
    !!======================================================================
-   !! History :  6.0  !  91-01  (G. Madec) Original code
-   !!            7.0  !  91-11  (G. Madec)
-   !!            7.5  !  96-01  (G. Madec) statement function for e3
-   !!            8.5  !  02-07  (G. Madec) j-k-i case: Original code
-   !!            8.5  !  02-07  (G. Madec) Free form, F90
+   !! History :  OPA  ! 1991-01  (G. Madec) Original code
+   !!            7.0  ! 1991-11  (G. Madec)
+   !!            7.5  ! 1996-01  (G. Madec) statement function for e3
+   !!   NEMO     0.5  ! 2002-07  (G. Madec) Free form, F90
    !!----------------------------------------------------------------------
    
@@ -20,4 +19,5 @@
    USE trdmod         ! ocean dynamics trends 
    USE in_out_manager ! I/O manager
+   USE lib_mpp         ! MPP library
    USE prtctl         ! Print control
 
@@ -33,7 +33,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -54,15 +53,19 @@
       !!              - Save the trends in (ztrdu,ztrdv) ('key_trddyn')
      !!----------------------------------------------------------------------
-      USE oce, ONLY:   zwuw => ta   ! use ta as 3D workspace
-      USE oce, ONLY:   zwvw => sa   ! use sa as 3D workspace
-      !!
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zww   => wrk_2d_1                        ! 2D workspace
+      USE oce     , ONLY:   zwuw  => ta       , zwvw  => sa          ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   ztrdu => wrk_3d_1 , ztrdv => wrk_3d_2    ! 3D workspace
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step inedx
-      !!
+      !
       INTEGER  ::   ji, jj, jk      ! dummy loop indices
       REAL(wp) ::   zua, zva        ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zww            ! 2D  workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
       !!----------------------------------------------------------------------
       
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('dyn_zad: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       IF( kt == nit000 ) THEN
          IF(lwp)WRITE(numout,*)
@@ -119,4 +122,7 @@
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       !
+      IF( wrk_not_released(2, 1)   .OR.   &
+          wrk_not_released(3, 1,2) )   CALL ctl_stop('dyn_zad: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_zad
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90	(revision 2715)
@@ -23,4 +23,5 @@
    USE trdmod_oce      ! ocean variables trends
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 
@@ -52,9 +53,13 @@
       !! ** Purpose :   compute the vertical ocean dynamics physics.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrdu => wrk_3d_1 , ztrdv => wrk_3d_2    ! 3D workspace
+      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
       !!---------------------------------------------------------------------
 
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('dyn_zdf: requested workspace arrays unavailable')   ;   RETURN
+      END IF
       !                                          ! set time step
       IF( neuler == 0 .AND. kt == nit000     ) THEN   ;   r2dt =      rdt   ! = rdtra (restart with Euler time stepping)
@@ -72,11 +77,11 @@
       CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme
       !
-      CASE ( -1 )                                      ! esopa: test all possibility with control print
+      CASE ( -1 )                                        ! esopa: test all possibility with control print
                        CALL dyn_zdf_exp( kt, r2dt )
                        CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf0 - Ua: ', mask1=umask,               &
-            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+                          &          tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
                        CALL dyn_zdf_imp( kt, r2dt )
                        CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask,               &
-            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+                          &          tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
       END SELECT
 
@@ -89,4 +94,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf  - Ua: ', mask1=umask,               &
             &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+      !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('dyn_zdf: failed to release workspace arrays')
       !
    END SUBROUTINE dyn_zdf
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90	(revision 2715)
@@ -6,5 +6,5 @@
    !! History :  OPA  !  1990-10  (B. Blanke)  Original code
    !!            8.0  !  1997-05  (G. Madec)  vertical component of isopycnal
-   !!   NEMO     1.0  !  1002-08  (G. Madec)  F90: Free form and module
+   !!   NEMO     0.5  !  2002-08  (G. Madec)  F90: Free form and module
    !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps
    !!----------------------------------------------------------------------
@@ -19,5 +19,7 @@
    USE zdf_oce         ! ocean vertical physics
    USE sbc_oce         ! surface boundary condition: ocean
+   USE lib_mpp         ! MPP library
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -25,5 +27,5 @@
 
    PUBLIC   dyn_zdf_exp   ! called by step.F90
-
+   
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -32,7 +34,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -53,59 +54,72 @@
       !! ** Action : - Update (ua,va) with the vertical diffusive trend
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx => ta       , zwy => sa         ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zwz => wrk_3d_1 , zww => wrk_3d_2   ! 3D workspace
+      !
       INTEGER , INTENT(in) ::   kt     ! ocean time-step index
       REAL(wp), INTENT(in) ::   p2dt   ! time-step 
-      !!
-      INTEGER ::   ji, jj, jk, jl                            ! dummy loop indices
-      REAL(wp) ::   zrau0r, zlavmr, zua, zva                 ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpk) ::   zwx, zwy, zwz, zww   ! 2D workspace
+      !
+      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
+      REAL(wp) ::   zrau0r, zlavmr, zua, zva   ! local scalars
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_zdf_exp : vertical momentum diffusion - explicit operator'
-         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('dyn_zdf_exp: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
 
-      zrau0r = 1. / rau0                              ! Local constant initialization
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dyn_zdf_exp : vertical momentum diffusion - explicit operator'
+         WRITE(numout,*) '~~~~~~~~~~~ '
+      ENDIF
+
+      zrau0r = 1. / rau0               ! Local constant initialization
       zlavmr = 1. / REAL( nn_zdfexp )
 
-      !                                               ! ===============
-      DO jj = 2, jpjm1                                !  Vertical slab
-         !                                            ! ===============
-         DO ji = 2, jpim1         ! Surface boundary condition
-            zwy(ji,1) = ( utau_b(ji,jj) + utau(ji,jj) ) * zrau0r
-            zww(ji,1) = ( vtau_b(ji,jj) + vtau(ji,jj) ) * zrau0r
+
+      DO jj = 2, jpjm1                 ! Surface boundary condition
+         DO ji = 2, jpim1
+            zwy(ji,jj,1) = ( utau_b(ji,jj) + utau(ji,jj) ) * zrau0r
+            zww(ji,jj,1) = ( vtau_b(ji,jj) + vtau(ji,jj) ) * zrau0r
          END DO  
-         DO jk = 1, jpk         ! Initialization of x, z and contingently trends array
+      END DO  
+      DO jk = 1, jpk                   ! Initialization of x, z and contingently trends array
+         DO jj = 2, jpjm1 
             DO ji = 2, jpim1
-               zwx(ji,jk) = ub(ji,jj,jk)
-               zwz(ji,jk) = vb(ji,jj,jk)
+               zwx(ji,jj,jk) = ub(ji,jj,jk)
+               zwz(ji,jj,jk) = vb(ji,jj,jk)
+            END DO  
+         END DO  
+      END DO  
+      !
+      DO jl = 1, nn_zdfexp             ! Time splitting loop
+         !
+         DO jk = 2, jpk                      ! First vertical derivative
+            DO jj = 2, jpjm1 
+               DO ji = 2, jpim1
+                  zwy(ji,jj,jk) = avmu(ji,jj,jk) * ( zwx(ji,jj,jk-1) - zwx(ji,jj,jk) ) / fse3uw(ji,jj,jk) 
+                  zww(ji,jj,jk) = avmv(ji,jj,jk) * ( zwz(ji,jj,jk-1) - zwz(ji,jj,jk) ) / fse3vw(ji,jj,jk)
+               END DO  
+            END DO  
+         END DO  
+         DO jk = 1, jpkm1                    ! Second vertical derivative and trend estimation at kt+l*rdt/nn_zdfexp
+            DO jj = 2, jpjm1 
+               DO ji = 2, jpim1
+                  zua = zlavmr * ( zwy(ji,jj,jk) - zwy(ji,jj,jk+1) ) / fse3u(ji,jj,jk)
+                  zva = zlavmr * ( zww(ji,jj,jk) - zww(ji,jj,jk+1) ) / fse3v(ji,jj,jk)
+                  ua(ji,jj,jk) = ua(ji,jj,jk) + zua
+                  va(ji,jj,jk) = va(ji,jj,jk) + zva
+                  !
+                  zwx(ji,jj,jk) = zwx(ji,jj,jk) + p2dt * zua * umask(ji,jj,jk)
+                  zwz(ji,jj,jk) = zwz(ji,jj,jk) + p2dt * zva * vmask(ji,jj,jk)
+               END DO  
             END DO  
          END DO  
          !
-         DO jl = 1, nn_zdfexp     ! Time splitting loop
-            !
-            DO jk = 2, jpk            ! First vertical derivative
-               DO ji = 2, jpim1
-                  zwy(ji,jk) = avmu(ji,jj,jk) * ( zwx(ji,jk-1) - zwx(ji,jk) ) / fse3uw(ji,jj,jk) 
-                  zww(ji,jk) = avmv(ji,jj,jk) * ( zwz(ji,jk-1) - zwz(ji,jk) ) / fse3vw(ji,jj,jk)
-               END DO  
-            END DO  
-            DO jk = 1, jpkm1          ! Second vertical derivative and trend estimation at kt+l*rdt/nn_zdfexp
-               DO ji = 2, jpim1
-                  zua = zlavmr * ( zwy(ji,jk) - zwy(ji,jk+1) ) / fse3u(ji,jj,jk)
-                  zva = zlavmr * ( zww(ji,jk) - zww(ji,jk+1) ) / fse3v(ji,jj,jk)
-                  ua(ji,jj,jk) = ua(ji,jj,jk) + zua
-                  va(ji,jj,jk) = va(ji,jj,jk) + zva
-                  !
-                  zwx(ji,jk) = zwx(ji,jk) + p2dt * zua * umask(ji,jj,jk)
-                  zwz(ji,jk) = zwz(ji,jk) + p2dt * zva * vmask(ji,jj,jk)
-               END DO  
-            END DO  
-            !
-         END DO  
-         !                                            ! ===============
-      END DO                                          !   End of slab
-      !                                               ! ===============
+      END DO                           ! End of time splitting
+      !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('dyn_zdf_exp: failed to release workspace arrays')
+      !
    END SUBROUTINE dyn_zdf_exp
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 2715)
@@ -1,16 +1,15 @@
 MODULE dynzdf_imp
-   !!==============================================================================
+   !!======================================================================
    !!                    ***  MODULE  dynzdf_imp  ***
    !! Ocean dynamics:  vertical component(s) of the momentum mixing trend
-   !!==============================================================================
+   !!======================================================================
    !! History :  OPA  !  1990-10  (B. Blanke)  Original code
    !!            8.0  !  1997-05  (G. Madec)  vertical component of isopycnal
-   !!   NEMO     1.0  !  2002-08  (G. Madec)  F90: Free form and module
+   !!   NEMO     0.5  !  2002-08  (G. Madec)  F90: Free form and module
    !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps
    !!----------------------------------------------------------------------
 
    !!----------------------------------------------------------------------
-   !!   dyn_zdf_imp  : update the momentum trend with the vertical diffu-
-   !!                  sion using a implicit time-stepping.
+   !!   dyn_zdf_imp  : update the momentum trend with the vertical diffusion using a implicit time-stepping
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
@@ -20,4 +19,5 @@
    USE phycst          ! physical constants
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -54,15 +54,18 @@
       !! ** Action : - Update (ua,va) arrays with the after vertical diffusive mixing trend.
       !!---------------------------------------------------------------------
-      USE oce, ONLY :  zwd   => ta      ! use ta as workspace
-      USE oce, ONLY :  zws   => sa      ! use sa as workspace
-      !!
-      INTEGER , INTENT( in ) ::   kt    ! ocean time-step index
-      REAL(wp), INTENT( in ) ::  p2dt   ! vertical profile of tracer time-step
-      !!
-      INTEGER  ::   ji, jj, jk             ! dummy loop indices
-      REAL(wp) ::   z1_p2dt, zcoef         ! temporary scalars
-      REAL(wp) ::   zzwi, zzws, zrhs       ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwi        ! 3D workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:  zwd  => ta       , zws   => sa   ! (ta,sa) used as 3D workspace
+      USE wrk_nemo, ONLY:   zwi => wrk_3d_3                 ! 3D workspace
+      !!
+      INTEGER , INTENT(in) ::   kt    ! ocean time-step index
+      REAL(wp), INTENT(in) ::  p2dt   ! vertical profile of tracer time-step
+      !!
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   z1_p2dt, zcoef, zzwi, zzws, zrhs   ! local scalars
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 3) ) THEN
+         CALL ctl_stop('dyn_zdf_imp: requested workspace array unavailable')   ;   RETURN
+      END IF
 
       IF( kt == nit000 ) THEN
@@ -253,4 +256,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 3) )   CALL ctl_stop('dyn_zdf_imp: failed to release workspace array')
+      !
    END SUBROUTINE dyn_zdf_imp
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 2715)
@@ -25,10 +25,11 @@
    USE phycst
    USE lbclnk          ! ocean lateral boundary condition (or mpp link)
+   USE lib_mpp         ! MPP library
    USE obc_par         ! open boundary cond. parameter
    USE obc_oce
    USE bdy_oce
-   USE diaar5, ONLY :   lk_diaar5
+   USE diaar5, ONLY:   lk_diaar5
    USE iom
-   USE sbcrnf, ONLY  : h_rnf, nk_rnf  ! River runoff 
+   USE sbcrnf, ONLY: h_rnf, nk_rnf   ! River runoff 
 #if defined key_agrif
    USE agrif_opa_update
@@ -51,7 +52,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -75,14 +75,17 @@
       !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling.
       !!----------------------------------------------------------------------
-      USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   z3d   => ta                           ! ta used as 3D workspace
+      USE wrk_nemo, ONLY:   zhdiv => wrk_2d_1 , z2d => wrk_2d_2   ! 2D workspace
+      !
       INTEGER, INTENT(in) ::   kt   ! time step
-      !!
-      INTEGER  ::   ji, jj, jk      ! dummy loop indices
-      REAL(wp) ::   zcoefu, zcoefv, zcoeff      ! temporary scalars
-      REAL(wp) ::   z2dt, z1_2dt, z1_rau0       ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zhdiv       ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d         ! 2D workspace
-      !!----------------------------------------------------------------------
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zcoefu, zcoefv, zcoeff, z2dt, z1_2dt, z1_rau0   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('ssh_wzv: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -92,5 +95,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~ '
          !
-         wn(:,:,jpk) = 0.e0                   ! bottom boundary condition: w=0 (set once for all)
+         wn(:,:,jpk) = 0._wp                  ! bottom boundary condition: w=0 (set once for all)
          !
          IF( lk_vvl ) THEN                    ! before and now Sea SSH at u-, v-, f-points (vvl case only)
@@ -145,6 +148,6 @@
          hv(:,:) = hv_0(:,:) + sshv_n(:,:)
          !                                            ! now masked inverse of the ocean depth (at u- and v-points)
-         hur(:,:) = umask(:,:,1) / ( hu(:,:) + 1.e0 - umask(:,:,1) )
-         hvr(:,:) = vmask(:,:,1) / ( hv(:,:) + 1.e0 - vmask(:,:,1) )
+         hur(:,:) = umask(:,:,1) / ( hu(:,:) + 1._wp - umask(:,:,1) )
+         hvr(:,:) = vmask(:,:,1) / ( hv(:,:) + 1._wp - vmask(:,:,1) )
          ! 
       ENDIF
@@ -152,11 +155,11 @@
       CALL div_cur( kt )                              ! Horizontal divergence & Relative vorticity
       !
-      z2dt = 2. * rdt                                 ! set time step size (Euler/Leapfrog)
-      IF( neuler == 0 .AND. kt == nit000 )   z2dt =rdt
+      z2dt = 2._wp * rdt                              ! set time step size (Euler/Leapfrog)
+      IF( neuler == 0 .AND. kt == nit000 )   z2dt = rdt
 
       !                                           !------------------------------!
       !                                           !   After Sea Surface Height   !
       !                                           !------------------------------!
-      zhdiv(:,:) = 0.e0
+      zhdiv(:,:) = 0._wp
       DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports
         zhdiv(:,:) = zhdiv(:,:) + fse3t(:,:,jk) * hdivn(:,:,jk)
@@ -166,14 +169,13 @@
       ! because emp_b field is initialized with the vlaues of emp field. Hence, 0.5 * ( emp + emp_b ) = emp
       z1_rau0 = 0.5 / rau0
-      ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) &
-      &                      * tmask(:,:,1)
+      ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1)
 
 #if defined key_agrif
-      CALL agrif_ssh(kt)
+      CALL agrif_ssh( kt )
 #endif
 #if defined key_obc
       IF( Agrif_Root() ) THEN 
          ssha(:,:) = ssha(:,:) * obctmsk(:,:)
-         CALL lbc_lnk( ssha, 'T', 1. )                ! absolutly compulsory !! (jmm)
+         CALL lbc_lnk( ssha, 'T', 1. )                 ! absolutly compulsory !! (jmm)
       ENDIF
 #endif
@@ -195,11 +197,10 @@
             END DO
          END DO
-         ! Boundaries conditions
-         CALL lbc_lnk( sshu_a, 'U', 1. )
-         CALL lbc_lnk( sshv_a, 'V', 1. )
-      ENDIF
-! Include the IAU weighted SSH increment
+         CALL lbc_lnk( sshu_a, 'U', 1. )   ;   CALL lbc_lnk( sshv_a, 'V', 1. )      ! Boundaries conditions
+      ENDIF
+      
 #if defined key_asminc
-      IF( ( lk_asminc ).AND.( ln_sshinc ).AND.( ln_asmiau ) ) THEN
+      !                                                ! Include the IAU weighted SSH increment
+      IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN
          CALL ssh_asm_inc( kt )
          ssha(:,:) = ssha(:,:) + z2dt * ssh_iau(:,:)
@@ -213,6 +214,6 @@
       DO jk = jpkm1, 1, -1                             ! integrate from the bottom the hor. divergence
          ! - ML - need 3 lines here because replacement of fse3t by its expression yields too long lines otherwise
-         wn(:,:,jk) = wn(:,:,jk+1) -    fse3t_n(:,:,jk) * hdivn(:,:,jk)        &
-            &                      - (  fse3t_a(:,:,jk) - fse3t_b(:,:,jk) )    &
+         wn(:,:,jk) = wn(:,:,jk+1) -   fse3t_n(:,:,jk) * hdivn(:,:,jk)        &
+            &                      - ( fse3t_a(:,:,jk) - fse3t_b(:,:,jk) )    &
             &                         * tmask(:,:,jk) * z1_2dt
 #if defined key_bdy
@@ -239,4 +240,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab2d_1=ssha, clinfo1=' ssha  - : ', mask1=tmask, ovlap=1 )
       !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('ssh_wzv: failed to release workspace arrays')
+      !
    END SUBROUTINE ssh_wzv
 
@@ -274,35 +277,12 @@
 
       !                       !--------------------------!
-      IF( lk_vvl ) THEN       !  Variable volume levels  !
+      IF( lk_vvl ) THEN       !  Variable volume levels  !     (ssh at t-, u-, v, f-points)
          !                    !--------------------------!
          !
-         ! ssh at t-, u-, v, f-points
-         !===========================
-         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter
-            sshn  (:,:) = ssha  (:,:)                        ! now <-- after  (before already = now)
+         IF( neuler == 0 .AND. kt == nit000 ) THEN    !** Euler time-stepping at first time-step : no filter
+            sshn  (:,:) = ssha  (:,:)                       ! now <-- after  (before already = now)
             sshu_n(:,:) = sshu_a(:,:)
             sshv_n(:,:) = sshv_a(:,:)
-            DO jj = 1, jpjm1
-               DO ji = 1, jpim1      ! NO Vector Opt.
-                  sshf_n(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                   &
-                     &               / ( e1f(ji,jj  ) * e2f(ji,jj  ) )                     &
-                     &               * ( e1u(ji,jj  ) * e2u(ji,jj  ) * sshu_n(ji,jj  )     &
-                     &                 + e1u(ji,jj+1) * e2u(ji,jj+1) * sshu_n(ji,jj+1) )
-               END DO
-            END DO
-            ! Boundaries conditions
-            CALL lbc_lnk( sshf_n, 'F', 1. )
-         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap
-            zec = atfp * rdt / rau0
-            DO jj = 1, jpj
-               DO ji = 1, jpi                                ! before <-- now filtered
-                  sshb  (ji,jj) = sshn  (ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )   &
-                     &                          - zec  * ( emp_b(ji,jj) - emp(ji,jj) ) * tmask(ji,jj,1)
-                  sshn  (ji,jj) = ssha  (ji,jj)              ! now <-- after
-                  sshu_n(ji,jj) = sshu_a(ji,jj)
-                  sshv_n(ji,jj) = sshv_a(ji,jj)
-               END DO
-            END DO
-            DO jj = 1, jpjm1
+            DO jj = 1, jpjm1                                ! ssh now at f-point
                DO ji = 1, jpim1      ! NO Vector Opt.
                   sshf_n(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                 &
@@ -312,7 +292,28 @@
                END DO
             END DO
-            ! Boundaries conditions
-            CALL lbc_lnk( sshf_n, 'F', 1. )
-            DO jj = 1, jpjm1
+            CALL lbc_lnk( sshf_n, 'F', 1. )                 ! Boundaries conditions
+            !
+         ELSE                                         !** Leap-Frog time-stepping: Asselin filter + swap
+            zec = atfp * rdt / rau0
+            DO jj = 1, jpj
+               DO ji = 1, jpi                               ! before <-- now filtered
+                  sshb  (ji,jj) = sshn  (ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )   &
+                     &                          - zec  * ( emp_b(ji,jj) - emp(ji,jj) ) * tmask(ji,jj,1)
+                  sshn  (ji,jj) = ssha  (ji,jj)             ! now <-- after
+                  sshu_n(ji,jj) = sshu_a(ji,jj)
+                  sshv_n(ji,jj) = sshv_a(ji,jj)
+               END DO
+            END DO
+            DO jj = 1, jpjm1                                ! ssh now at f-point
+               DO ji = 1, jpim1      ! NO Vector Opt.
+                  sshf_n(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                 &
+                     &               / ( e1f(ji,jj  ) * e2f(ji,jj  ) )                     &
+                     &               * ( e1u(ji,jj  ) * e2u(ji,jj  ) * sshu_n(ji,jj  )     &
+                     &                 + e1u(ji,jj+1) * e2u(ji,jj+1) * sshu_n(ji,jj+1) )
+               END DO
+            END DO
+            CALL lbc_lnk( sshf_n, 'F', 1. )                 ! Boundaries conditions
+            !
+            DO jj = 1, jpjm1                                ! ssh before at u- & v-points
                DO ji = 1, jpim1      ! NO Vector Opt.
                   sshu_b(ji,jj) = 0.5  * umask(ji,jj,1) / ( e1u(ji  ,jj) * e2u(ji  ,jj) )                   &
@@ -324,22 +325,20 @@
                END DO
             END DO
-            ! Boundaries conditions
             CALL lbc_lnk( sshu_b, 'U', 1. )
-            CALL lbc_lnk( sshv_b, 'V', 1. )
+            CALL lbc_lnk( sshv_b, 'V', 1. )            !  Boundaries conditions
+            !
          ENDIF
          !                    !--------------------------!
-      ELSE                    !        fixed levels      !
+      ELSE                    !        fixed levels      !     (ssh at t-point only)
          !                    !--------------------------!
          !
-         ! ssh at t-point only
-         !====================
-         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter
-            sshn(:,:) = ssha(:,:)                            ! now <-- after  (before already = now)
-            !
-         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap
+         IF( neuler == 0 .AND. kt == nit000 ) THEN    !** Euler time-stepping at first time-step : no filter
+            sshn(:,:) = ssha(:,:)                           ! now <-- after  (before already = now)
+            !
+         ELSE                                               ! Leap-Frog time-stepping: Asselin filter + swap
             DO jj = 1, jpj
-               DO ji = 1, jpi                                ! before <-- now filtered
+               DO ji = 1, jpi                               ! before <-- now filtered
                   sshb(ji,jj) = sshn(ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )
-                  sshn(ji,jj) = ssha(ji,jj)                  ! now <-- after
+                  sshn(ji,jj) = ssha(ji,jj)                 ! now <-- after
                END DO
             END DO
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flo_oce.F90	(revision 2715)
@@ -12,7 +12,11 @@
    !!----------------------------------------------------------------------
    USE par_oce         ! ocean parameters
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PUBLIC
+
+   PUBLIC   flo_oce_alloc   ! Routine called in floats.F90
 
    LOGICAL, PUBLIC, PARAMETER ::   lk_floats = .TRUE.    !: float flag
@@ -32,5 +36,5 @@
    REAL(wp), PUBLIC, DIMENSION(jpnfl) ::   tpifl, tpjfl, tpkfl   !: (i,j,k) indices of float position
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   wb              !: vertical velocity at previous time step (m s-1).
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wb   !: vertical velocity at previous time step (m s-1).
    
    !                                            !!! * namelist namflo : langrangian floats *
@@ -41,4 +45,21 @@
    INTEGER, PUBLIC  ::   nn_stockfl = 450        !: frequency of float restart file
 
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION flo_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION flo_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( wb(jpi,jpj,jpk)   , STAT=flo_oce_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( flo_oce_alloc )
+      IF( flo_oce_alloc /= 0 )   CALL ctl_warn('flo_oce_alloc: failed to allocate arrays')
+   END FUNCTION flo_oce_alloc
+
 #else
    !!----------------------------------------------------------------------
@@ -48,8 +69,4 @@
 #endif
 
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE flo_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 2715)
@@ -50,14 +50,4 @@
       !!----------------------------------------------------------------------
       !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
-
-         CALL flo_dom            ! compute/read initial position of floats
-
-         wb(:,:,:) = wn(:,:,:)   ! set wb for computation of floats trajectories at the first time step
-      ENDIF
-      !
       IF( ln_flork4 ) THEN   ;   CALL flo_4rk( kt )        ! Trajectories using a 4th order Runge Kutta scheme
       ELSE                   ;   CALL flo_blk( kt )        ! Trajectories using Blanke' algorithme
@@ -83,4 +73,8 @@
       !!---------------------------------------------------------------------
       !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'flo_stp : call floats routine '
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
       REWIND( numnam )              ! Namelist namflo : floats
       READ  ( numnam, namflo )
@@ -95,4 +89,14 @@
          WRITE(numout,*) '            Computation of T trajectories    ln_flork4  = ', ln_flork4
       ENDIF
+      !
+      !                             ! allocate floats arrays
+      IF( flo_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_init : unable to allocate arrays' )
+      !
+      !                             ! allocate flowri arrays
+      IF( flo_wri_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'flo_wri : unable to allocate arrays' )
+      !
+      CALL flo_dom                  ! compute/read initial position of floats
+
+      wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step
       !
    END SUBROUTINE flo_init
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/floblk.F90	(revision 2715)
@@ -14,4 +14,5 @@
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
+   USE obc_par         ! open boundary condition parameters
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! distribued memory computing library
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/FLO/flowri.F90	(revision 2715)
@@ -23,17 +23,34 @@
    PRIVATE
 
-   PUBLIC   flo_wri    ! routine called by floats.F90
+   PUBLIC   flo_wri         ! routine called by floats.F90
+   PUBLIC   flo_wri_alloc   ! routine called by floats.F90
 
    INTEGER ::   jfl      ! number of floats
    INTEGER ::   numflo   ! logical unit for drifting floats
 
+   ! Following are only workspace arrays but shape is not (jpi,jpj) and
+   ! therefore make them module arrays rather than replacing with wrk_nemo
+   ! member arrays.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ztemp, zsal   ! 2D workspace
+
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION flo_wri_alloc
+      !!-------------------------------------------------------------------
+      !!                ***  FUNCTION flo_wri_alloc  ***
+      !!-------------------------------------------------------------------
+      ALLOCATE( ztemp(jpk,jpnfl) , zsal(jpk,jpnfl) , STAT=flo_wri_alloc)
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( flo_wri_alloc )
+      IF( flo_wri_alloc /= 0 )   CALL ctl_warn('flo_wri_alloc: failed to allocate arrays.')
+   END FUNCTION flo_wri_alloc
+
 
    SUBROUTINE flo_wri( kt )
@@ -54,10 +71,9 @@
       INTEGER  ::    ic, jc , jpn
       INTEGER, DIMENSION ( jpnij )  ::   iproc
-      REAL(wp) ::   zafl,zbfl,zcfl,zdtj
+      REAL(wp) ::   zafl, zbfl, zcfl, zdtj
       REAL(wp) ::   zxxu, zxxu_01,zxxu_10, zxxu_11
-      REAL(wp), DIMENSION (jpk,jpnfl) ::   ztemp, zsal   ! 2D workspace
       !!---------------------------------------------------------------------
       
-      IF( kt == nit000 .OR. MOD( kt,nn_writefl)== 0 ) THEN 
+      IF( kt == nit000 .OR. MOD( kt,nn_writefl) == 0 ) THEN 
 
          ! header of output floats file
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 2715)
@@ -12,8 +12,4 @@
    !!----------------------------------------------------------------------
 
-   !!----------------------------------------------------------------------
-   !!   ctl_stop   : update momentum and tracer Kz from a tke scheme
-   !!   ctl_warn   : initialization, namelist read, and parameters control
-   !!   getunit    : give the index of an unused logical unit
    !!----------------------------------------------------------------------
    USE par_oce       ! ocean parameter
@@ -134,166 +130,4 @@
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE ctl_stop( cd1, cd2, cd3, cd4, cd5,   &
-      &                 cd6, cd7, cd8, cd9, cd10 )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE  stop_opa  ***
-      !!
-      !! ** Purpose :   print in ocean.outpput file a error message and 
-      !!                increment the error number (nstop) by one.
-      !!----------------------------------------------------------------------
-      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
-      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
-      !!----------------------------------------------------------------------
-      !
-      nstop = nstop + 1 
-      IF(lwp) THEN
-         WRITE(numout,cform_err)
-         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
-         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
-         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
-         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
-         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
-         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
-         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
-         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
-         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
-         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
-      ENDIF
-                               CALL FLUSH(numout    )
-      IF( numstp     /= -1 )   CALL FLUSH(numstp    )
-      IF( numsol     /= -1 )   CALL FLUSH(numsol    )
-      IF( numevo_ice /= -1 )   CALL FLUSH(numevo_ice)
-      !
-   END SUBROUTINE ctl_stop
-
-
-   SUBROUTINE ctl_warn( cd1, cd2, cd3, cd4, cd5,   &
-      &                 cd6, cd7, cd8, cd9, cd10 )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE  stop_warn  ***
-      !!
-      !! ** Purpose :   print in ocean.outpput file a error message and 
-      !!                increment the warning number (nwarn) by one.
-      !!----------------------------------------------------------------------
-      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
-      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
-      !!----------------------------------------------------------------------
-      ! 
-      nwarn = nwarn + 1 
-      IF(lwp) THEN
-         WRITE(numout,cform_war)
-         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
-         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
-         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
-         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
-         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
-         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
-         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
-         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
-         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
-         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
-      ENDIF
-      CALL FLUSH(numout)
-      !
-   END SUBROUTINE ctl_warn
-
-
-   SUBROUTINE ctl_opn( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE ctl_opn  ***
-      !!
-      !! ** Purpose :   Open file and check if required file is available.
-      !!
-      !! ** Method  :   Fortan open
-      !!----------------------------------------------------------------------
-      INTEGER          , INTENT(  out) ::   knum      ! logical unit to open
-      CHARACTER(len=*) , INTENT(in   ) ::   cdfile    ! file name to open
-      CHARACTER(len=*) , INTENT(in   ) ::   cdstat    ! disposition specifier
-      CHARACTER(len=*) , INTENT(in   ) ::   cdform    ! formatting specifier
-      CHARACTER(len=*) , INTENT(in   ) ::   cdacce    ! access specifier
-      INTEGER          , INTENT(in   ) ::   klengh    ! record length
-      INTEGER          , INTENT(in   ) ::   kout      ! number of logical units for write
-      LOGICAL          , INTENT(in   ) ::   ldwp      ! boolean term for print
-      INTEGER, OPTIONAL, INTENT(in   ) ::   karea     ! proc number
-      !!
-      CHARACTER(len=80) ::   clfile
-      INTEGER           ::   iost
-      !!----------------------------------------------------------------------
-
-      ! adapt filename
-      ! ----------------
-      clfile = TRIM(cdfile)
-      IF( PRESENT( karea ) ) THEN
-         IF( karea > 1 )   WRITE(clfile, "(a,'_',i4.4)") TRIM(clfile), karea-1
-      ENDIF
-#if defined key_agrif
-      IF( .NOT. Agrif_Root() )   clfile = TRIM(Agrif_CFixed())//'_'//TRIM(clfile)
-      knum=Agrif_Get_Unit()
-#else
-      knum=getunit()
-#endif
-
-      iost=0
-      IF( cdacce(1:6) == 'DIRECT' )  THEN
-         OPEN( UNIT=knum, FILE=clfile, FORM=cdform, ACCESS=cdacce, STATUS=cdstat, RECL=klengh, ERR=100, IOSTAT=iost )
-      ELSE
-         OPEN( UNIT=knum, FILE=clfile, FORM=cdform, ACCESS=cdacce, STATUS=cdstat             , ERR=100, IOSTAT=iost )
-      ENDIF
-      IF( iost == 0 ) THEN
-         IF(ldwp) THEN
-            WRITE(kout,*) '     file   : ', clfile,' open ok'
-            WRITE(kout,*) '     unit   = ', knum
-            WRITE(kout,*) '     status = ', cdstat
-            WRITE(kout,*) '     form   = ', cdform
-            WRITE(kout,*) '     access = ', cdacce
-            WRITE(kout,*)
-         ENDIF
-      ENDIF
-100   CONTINUE
-      IF( iost /= 0 ) THEN
-         IF(ldwp) THEN
-            WRITE(kout,*)
-            WRITE(kout,*) ' ===>>>> : bad opening file: ', clfile
-            WRITE(kout,*) ' =======   ===  '
-            WRITE(kout,*) '           unit   = ', knum
-            WRITE(kout,*) '           status = ', cdstat
-            WRITE(kout,*) '           form   = ', cdform
-            WRITE(kout,*) '           access = ', cdacce
-            WRITE(kout,*) '           iostat = ', iost
-            WRITE(kout,*) '           we stop. verify the file '
-            WRITE(kout,*)
-         ENDIF
-         STOP 'ctl_opn bad opening'
-      ENDIF
-      
-   END SUBROUTINE ctl_opn
-
-
-   FUNCTION getunit()
-      !!----------------------------------------------------------------------
-      !!                  ***  FUNCTION  getunit  ***
-      !!
-      !! ** Purpose :   return the index of an unused logical unit
-      !!----------------------------------------------------------------------
-      INTEGER :: getunit
-      LOGICAL :: llopn 
-      !!----------------------------------------------------------------------
-      !
-      getunit = 15   ! choose a unit that is big enough then it is not already used in NEMO
-      llopn = .TRUE.
-      DO WHILE( (getunit < 998) .AND. llopn )
-         getunit = getunit + 1
-         INQUIRE( unit = getunit, opened = llopn )
-      END DO
-      IF( (getunit == 999) .AND. llopn ) THEN
-         CALL ctl_stop( 'getunit: All logical units until 999 are used...' )
-         getunit = -1
-      ENDIF
-      !
-   END FUNCTION getunit
-
    !!=====================================================================
 END MODULE in_out_manager
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 2715)
@@ -18,5 +18,4 @@
    !!   iom_rstput     : write a field in a restart file (interfaced to several routines)
    !!--------------------------------------------------------------------
-   USE in_out_manager  ! I/O manager
    USE dom_oce         ! ocean space and time domain
    USE lbclnk          ! lateal boundary condition / mpp exchanges
@@ -25,5 +24,6 @@
    USE iom_nf90        ! NetCDF format with native NetCDF library
    USE iom_rstdimg     ! restarts access direct format "dimg" style...
-
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp           ! MPP library
 #if defined key_iomput
    USE sbc_oce, ONLY :   nn_fsbc         ! ocean space and time domain
@@ -887,5 +887,5 @@
       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
-      REAL(wp)        , INTENT(in), DIMENSION(        jpk) ::   pvar     ! written field
+      REAL(wp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
       INTEGER :: ivid   ! variable id
@@ -909,5 +909,5 @@
       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
-      REAL(wp)        , INTENT(in), DIMENSION(jpi,jpj    ) ::   pvar     ! written field
+      REAL(wp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
       INTEGER :: ivid   ! variable id
@@ -931,5 +931,5 @@
       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
       CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name
-      REAL(wp)        , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pvar     ! written field
+      REAL(wp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field
       INTEGER         , INTENT(in), OPTIONAL               ::   ktype    ! variable external type
       INTEGER :: ivid   ! variable id
@@ -964,5 +964,5 @@
    SUBROUTINE iom_p2d( cdname, pfield2d )
       CHARACTER(LEN=*)            , INTENT(in) ::   cdname
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pfield2d
+      REAL(wp),     DIMENSION(:,:), INTENT(in) ::   pfield2d
 #if defined key_iomput
       CALL event__write_field2D( cdname, pfield2d(nldi:nlei, nldj:nlej) )
@@ -974,5 +974,5 @@
    SUBROUTINE iom_p3d( cdname, pfield3d )
       CHARACTER(LEN=*)                , INTENT(in) ::   cdname
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   pfield3d
+      REAL(wp),       DIMENSION(:,:,:), INTENT(in) ::   pfield3d
 #if defined key_iomput
       CALL event__write_field3D( cdname, pfield3d(nldi:nlei, nldj:nlej, :) )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_ioipsl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_ioipsl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_ioipsl.F90	(revision 2715)
@@ -18,8 +18,9 @@
    !!   iom_rstput     : write a field in a restart file (interfaced to several routines)
    !!--------------------------------------------------------------------
-   USE in_out_manager  ! I/O manager
    USE dom_oce         ! ocean space and time domain
    USE iom_def         ! iom variables definitions
    USE ioipsl          ! IOIPSL library
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90	(revision 2715)
@@ -18,9 +18,10 @@
    !!   iom_rstput     : write a field in a restart file (interfaced to several routines)
    !!--------------------------------------------------------------------
-   USE in_out_manager  ! I/O manager
    USE dom_oce         ! ocean space and time domain
    USE lbclnk          ! lateal boundary condition / mpp exchanges
    USE iom_def         ! iom variables definitions
    USE netcdf          ! NetCDF library
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_rstdimg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_rstdimg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_rstdimg.F90	(revision 2715)
@@ -16,4 +16,5 @@
    !!--------------------------------------------------------------------
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE dom_oce         ! ocean space and time domain
    USE lbclnk          ! lateal boundary condition / mpp exchanges
@@ -82,5 +83,5 @@
       llclobber = ldwrt .AND. ln_clobber
       ! get a free unit
-      idrst = getunit()  ! get a free logical unit for the restart file
+      idrst = get_unit()  ! get a free logical unit for the restart file
 !!$#if defined key_agrif 
 !!$      idrst = Agrif_Get_Unit()      
@@ -418,7 +419,7 @@
       CHARACTER(len=*)                , INTENT(in)           ::   cdvar    ! time axis name
       INTEGER                         , INTENT(in)           ::   kvid     ! variable id
-      REAL(wp), DIMENSION(        jpk), INTENT(in), OPTIONAL ::   pv_r1d   ! written 1d field
-      REAL(wp), DIMENSION(jpi,jpj    ), INTENT(in), OPTIONAL ::   pv_r2d   ! written 2d field
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::   pv_r3d   ! written 3d field
+      REAL(wp), DIMENSION(          :), INTENT(in), OPTIONAL ::   pv_r1d   ! written 1d field
+      REAL(wp), DIMENSION(:  ,:      ), INTENT(in), OPTIONAL ::   pv_r2d   ! written 2d field
+      REAL(wp), DIMENSION(:  ,:  ,:  ), INTENT(in), OPTIONAL ::   pv_r3d   ! written 3d field
       !
       CHARACTER(LEN=100)    ::   clinfo               ! info character
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/IOM/prtctl.F90	(revision 2715)
@@ -1,7 +1,9 @@
 MODULE prtctl
-   !!==============================================================================
+   !!======================================================================
    !!                       ***  MODULE prtctl   ***
-   !! Ocean system   : print all SUM trends for each processor domain
-   !!==============================================================================
+   !! Ocean system : print all SUM trends for each processor domain
+   !!======================================================================
+   !! History :  9.0  !  05-07  (C. Talandier) original code
+   !!----------------------------------------------------------------------
    USE dom_oce          ! ocean space and time domain variables
    USE in_out_manager   ! I/O manager
@@ -11,33 +13,29 @@
    PRIVATE
 
-   !! * Module declaration
-   INTEGER, DIMENSION(:), ALLOCATABLE :: numid
-   INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   &  !:
-      nlditl , nldjtl ,   &  !: first, last indoor index for each i-domain
-      nleitl , nlejtl ,   &  !: first, last indoor index for each j-domain
-      nimpptl, njmpptl,   &  !: i-, j-indexes for each processor
-      nlcitl , nlcjtl ,   &  !: dimensions of every subdomain
-      ibonitl, ibonjtl
-
-   REAL(wp), DIMENSION(:), ALLOCATABLE ::   &  !:
-      t_ctll , s_ctll ,   &  !: previous trend values
-      u_ctll , v_ctll
-
-   INTEGER ::   ktime        !: time step
-
-   !! * Routine accessibility
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   numid
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nlditl , nldjtl    ! first, last indoor index for each i-domain
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nleitl , nlejtl    ! first, last indoor index for each j-domain
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nimpptl, njmpptl   ! i-, j-indexes for each processor
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   nlcitl , nlcjtl    ! dimensions of every subdomain
+   INTEGER , DIMENSION(:), ALLOCATABLE, SAVE ::   ibonitl, ibonjtl   !
+
+   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE ::   t_ctll , s_ctll    ! previous tracer trend values
+   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE ::   u_ctll , v_ctll    ! previous velocity trend values
+
+   INTEGER ::   ktime   ! time step
+
    PUBLIC prt_ctl         ! called by all subroutines
    PUBLIC prt_ctl_info    ! called by all subroutines
    PUBLIC prt_ctl_init    ! called by opa.F90
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
-
 CONTAINS
 
-   SUBROUTINE prt_ctl (tab2d_1, tab3d_1, mask1, clinfo1, tab2d_2, tab3d_2, mask2, clinfo2, ovlap, kdim, clinfo3)
+   SUBROUTINE prt_ctl (tab2d_1, tab3d_1, mask1, clinfo1, tab2d_2, tab3d_2,   &
+      &                                  mask2, clinfo2, ovlap, kdim, clinfo3 )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE prt_ctl  ***
@@ -74,28 +72,30 @@
       !!                    kdim    : k- direction for 3D arrays 
       !!                    clinfo3 : additional information 
-      !!
-      !! History :
-      !!   9.0  !  05-07  (C. Talandier) original code
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), DIMENSION(:,:)  , INTENT(in), OPTIONAL :: tab2d_1
-      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL :: tab3d_1
-      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL :: mask1
-      CHARACTER (len=*)         , INTENT(in), OPTIONAL :: clinfo1
-      REAL(wp), DIMENSION(:,:)  , INTENT(in), OPTIONAL :: tab2d_2
-      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL :: tab3d_2
-      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL :: mask2
-      CHARACTER (len=*)         , INTENT(in), OPTIONAL :: clinfo2
-      INTEGER                   , INTENT(in), OPTIONAL :: ovlap
-      INTEGER                   , INTENT(in), OPTIONAL :: kdim
-      CHARACTER (len=*)         , INTENT(in), OPTIONAL :: clinfo3
-
-      !! * Local declarations
-      INTEGER :: overlap, jn, sind, eind, kdir,j_id
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztab2d_1 => wrk_2d_30 , ztab2d_2 => wrk_2d_31
+      USE wrk_nemo, ONLY:   zmask1   => wrk_3d_11 , zmask2   => wrk_3d_12 
+      USE wrk_nemo, ONLY:   ztab3d_1 => wrk_3d_13 , ztab3d_2 => wrk_3d_14
+      !
+      REAL(wp), DIMENSION(:,:)  , INTENT(in), OPTIONAL ::   tab2d_1
+      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL ::   tab3d_1
+      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL ::   mask1
+      CHARACTER (len=*)         , INTENT(in), OPTIONAL ::   clinfo1
+      REAL(wp), DIMENSION(:,:)  , INTENT(in), OPTIONAL ::   tab2d_2
+      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL ::   tab3d_2
+      REAL(wp), DIMENSION(:,:,:), INTENT(in), OPTIONAL ::   mask2
+      CHARACTER (len=*)         , INTENT(in), OPTIONAL ::   clinfo2
+      INTEGER                   , INTENT(in), OPTIONAL ::   ovlap
+      INTEGER                   , INTENT(in), OPTIONAL ::   kdim
+      CHARACTER (len=*)         , INTENT(in), OPTIONAL ::   clinfo3
+      !
       CHARACTER (len=15) :: cl2
+      INTEGER ::   overlap, jn, sind, eind, kdir,j_id
       REAL(wp) :: zsum1, zsum2, zvctl1, zvctl2
-      REAL(wp), DIMENSION(jpi,jpj) :: ztab2d_1, ztab2d_2
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zmask1, zmask2, ztab3d_1, ztab3d_2
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 30,31) .OR. wrk_in_use(3, 11,12,13,14) ) THEN
+         CALL ctl_stop('prt_ctl : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! Arrays, scalars initialization 
@@ -115,20 +115,18 @@
 
       ! Control of optional arguments
-      IF( PRESENT(clinfo2) )  cl2            = clinfo2
-      IF( PRESENT(ovlap)   )  overlap        = ovlap
-      IF( PRESENT(kdim)    )  kdir           = kdim
-      IF( PRESENT(tab2d_1) )  ztab2d_1(:,:)  = tab2d_1(:,:)
-      IF( PRESENT(tab2d_2) )  ztab2d_2(:,:)  = tab2d_2(:,:)
-      IF( PRESENT(tab3d_1) )  ztab3d_1(:,:,1:kdir)= tab3d_1(:,:,:)
-      IF( PRESENT(tab3d_2) )  ztab3d_2(:,:,1:kdir)= tab3d_2(:,:,:)
-      IF( PRESENT(mask1)   )  zmask1  (:,:,:)= mask1  (:,:,:)
-      IF( PRESENT(mask2)   )  zmask2  (:,:,:)= mask2  (:,:,:)
-
-      IF( lk_mpp )   THEN
-         ! processor number
+      IF( PRESENT(clinfo2) )   cl2                  = clinfo2
+      IF( PRESENT(ovlap)   )   overlap              = ovlap
+      IF( PRESENT(kdim)    )   kdir                 = kdim
+      IF( PRESENT(tab2d_1) )   ztab2d_1(:,:)        = tab2d_1(:,:)
+      IF( PRESENT(tab2d_2) )   ztab2d_2(:,:)        = tab2d_2(:,:)
+      IF( PRESENT(tab3d_1) )   ztab3d_1(:,:,1:kdir) = tab3d_1(:,:,:)
+      IF( PRESENT(tab3d_2) )   ztab3d_2(:,:,1:kdir) = tab3d_2(:,:,:)
+      IF( PRESENT(mask1)   )   zmask1  (:,:,:)      = mask1  (:,:,:)
+      IF( PRESENT(mask2)   )   zmask2  (:,:,:)      = mask2  (:,:,:)
+
+      IF( lk_mpp ) THEN       ! processor number
          sind = narea
          eind = narea
-      ELSE
-         ! processors total number
+      ELSE                    ! processors total number
          sind = 1
          eind = ijsplt
@@ -206,4 +204,7 @@
       ENDDO
 
+      IF( wrk_not_released(2, 30,31)     .OR.   &
+          wrk_not_released(3, 11,12,13,14) )   CALL ctl_stop('prt_ctl: failed to release workspace arrays')
+      !
    END SUBROUTINE prt_ctl
 
@@ -220,25 +221,18 @@
       !!                    clinfo2 : information about the ivar2
       !!                    ivar2   : value to print
-      !!
-      !! History :
-      !!   9.0  !  05-07  (C. Talandier) original code
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      CHARACTER (len=*), INTENT(in) ::   clinfo1
+      !!----------------------------------------------------------------------
+      CHARACTER (len=*), INTENT(in)           ::   clinfo1
       INTEGER          , INTENT(in), OPTIONAL ::   ivar1
       CHARACTER (len=*), INTENT(in), OPTIONAL ::   clinfo2
       INTEGER          , INTENT(in), OPTIONAL ::   ivar2
       INTEGER          , INTENT(in), OPTIONAL ::   itime
-
-      !! * Local declarations
+      !
       INTEGER :: jn, sind, eind, iltime, j_id
       !!----------------------------------------------------------------------
 
-      IF( lk_mpp )   THEN
-         ! processor number
+      IF( lk_mpp ) THEN       ! processor number
          sind = narea
          eind = narea
-      ELSE
-         ! total number of processors
+      ELSE                    ! total number of processors
          sind = 1
          eind = ijsplt
@@ -257,8 +251,7 @@
       ! Loop over each sub-domain, i.e. number of processors ijsplt
       DO jn = sind, eind
-         
-         ! Set logical unit
-         j_id = numid(jn - narea + 1)
-
+         !
+         j_id = numid(jn - narea + 1)         ! Set logical unit
+         !
          IF( PRESENT(ivar1) .AND. PRESENT(clinfo2) .AND. PRESENT(ivar2) )   THEN
             WRITE(j_id,*)clinfo1, ivar1, clinfo2, ivar2
@@ -272,9 +265,9 @@
             WRITE(j_id,*)clinfo1
          ENDIF
-
-      ENDDO
-
-
-      END SUBROUTINE prt_ctl_info
+         !
+      END DO
+      !
+   END SUBROUTINE prt_ctl_info
+
 
    SUBROUTINE prt_ctl_init
@@ -283,9 +276,5 @@
       !!
       !! ** Purpose :   open ASCII files & compute indices
-      !!
-      !! History :
-      !!   9.0  !  05-07  (C. Talandier) original code
-      !!----------------------------------------------------------------------
-      !! * Local declarations
+      !!----------------------------------------------------------------------
       INTEGER ::   jn, sind, eind, j_id
       CHARACTER (len=28) :: clfile_out
@@ -295,24 +284,14 @@
 
       ! Allocate arrays
-      ALLOCATE(nlditl (ijsplt))
-      ALLOCATE(nldjtl (ijsplt))
-      ALLOCATE(nleitl (ijsplt))
-      ALLOCATE(nlejtl (ijsplt))
-      ALLOCATE(nimpptl(ijsplt))
-      ALLOCATE(njmpptl(ijsplt))
-      ALLOCATE(nlcitl (ijsplt))
-      ALLOCATE(nlcjtl (ijsplt))
-      ALLOCATE(t_ctll (ijsplt))
-      ALLOCATE(s_ctll (ijsplt))
-      ALLOCATE(u_ctll (ijsplt))
-      ALLOCATE(v_ctll (ijsplt))
-      ALLOCATE(ibonitl(ijsplt))
-      ALLOCATE(ibonjtl(ijsplt))
+      ALLOCATE( nlditl(ijsplt) , nleitl(ijsplt) , nimpptl(ijsplt) , ibonitl(ijsplt) ,   &
+         &      nldjtl(ijsplt) , nlejtl(ijsplt) , njmpptl(ijsplt) , ibonjtl(ijsplt) ,   &
+         &      nlcitl(ijsplt) , t_ctll(ijsplt) , u_ctll (ijsplt) ,                     &
+         &      nlcjtl(ijsplt) , s_ctll(ijsplt) , v_ctll (ijsplt)                       )
 
       ! Initialization 
-      t_ctll(:)=0.e0
-      s_ctll(:)=0.e0
-      u_ctll(:)=0.e0
-      v_ctll(:)=0.e0
+      t_ctll(:) = 0.e0
+      s_ctll(:) = 0.e0
+      u_ctll(:) = 0.e0
+      v_ctll(:) = 0.e0
       ktime = 1
 
@@ -345,5 +324,5 @@
       ENDIF
 
-      ALLOCATE(numid(eind-sind+1))
+      ALLOCATE( numid(eind-sind+1) )
 
       DO jn = sind, eind
@@ -392,6 +371,6 @@
 9003     FORMAT(a20,i4.4,a17,i4.4)
 9004     FORMAT(a11,i4.4,a26,i4.4,a14)
-      ENDDO
-
+      END DO
+      !
    END SUBROUTINE prt_ctl_init
 
@@ -434,5 +413,4 @@
       !!   8.5  !  02-08  (G. Madec)  F90 : free form
       !!----------------------------------------------------------------------
-      !! * Local variables
       INTEGER ::   ji, jj, jn               ! dummy loop indices
       INTEGER ::   &
@@ -443,6 +421,5 @@
          nrecil, nrecjl, nldil, nleil, nldjl, nlejl
 
-      INTEGER, DIMENSION(:,:), ALLOCATABLE ::   &
-         iimpptl, ijmpptl, ilcitl, ilcjtl       ! temporary workspace
+      INTEGER, DIMENSION(:,:), ALLOCATABLE ::   iimpptl, ijmpptl, ilcitl, ilcjtl   ! workspace
       REAL(wp) ::   zidom, zjdom            ! temporary scalars
       !!----------------------------------------------------------------------
@@ -564,11 +541,9 @@
          nlejtl(jn) = nlejl
       END DO
-
-      DEALLOCATE(iimpptl)
-      DEALLOCATE(ijmpptl)
-      DEALLOCATE(ilcitl)
-      DEALLOCATE(ilcjtl)
-
+      !
+      DEALLOCATE( iimpptl, ijmpptl, ilcitl, ilcjtl )
+      !
    END SUBROUTINE sub_dom
 
+   !!======================================================================
 END MODULE prtctl
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90	(revision 2715)
@@ -31,4 +31,5 @@
    USE lib_mpp        ! distributed memory computing library
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
@@ -43,14 +44,14 @@
    !                                ! for Bab-el-Mandeb, Gibraltar, and Hormuz straits
    
-   !                                                              !!! profile of hdiv for some straits
-   REAL(wp), DIMENSION (jpk) ::   hdiv_139_101, hdiv_139_101_kt    ! Gibraltar     strait, fixed & time evolving part (i,j)=(172,101)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_139_102                     ! Gibraltar     strait, fixed part only            (i,j)=(139,102)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_141_102, hdiv_141_102_kt    ! Gibraltar     strait, fixed & time evolving part (i,j)=(141,102)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_161_88 , hdiv_161_88_kt     ! Bab-el-Mandeb strait, fixed & time evolving part (i,j)=(161,88)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_161_87                      ! Bab-el-Mandeb strait, fixed part only            (i,j)=(161,87)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_160_89 , hdiv_160_89_kt     ! Bab-el-Mandeb strait, fixed & time evolving part (i,j)=(160,89)
-   REAL(wp), DIMENSION (jpk) ::   hdiv_172_94                      ! Hormuz        strait, fixed part only            (i,j)=(172, 94)
-
-   REAL(wp), DIMENSION (jpk) ::   t_171_94_hor, s_171_94_hor       ! Temperature, salinity in the Hormuz strait
+   !                                           !   fixed part  !  time evolving    !!! profile of hdiv for some straits
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_139_101, hdiv_139_101_kt    ! Gibraltar     (i,j)=(172,101)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_139_102                     ! Gibraltar     (i,j)=(139,102)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_141_102, hdiv_141_102_kt    ! Gibraltar     (i,j)=(141,102)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_161_88 , hdiv_161_88_kt     ! Bab-el-Mandeb (i,j)=(161,88)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_161_87                      ! Bab-el-Mandeb (i,j)=(161,87)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_160_89 , hdiv_160_89_kt     ! Bab-el-Mandeb (i,j)=(160,89)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_172_94                      ! Hormuz        (i,j)=(172, 94)
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   t_171_94_hor, s_171_94_hor       ! Temperature, salinity in Hormuz strait
    
    !! * Substitutions
@@ -177,5 +178,6 @@
       !! ** Action  :   nbab, ngib, nhor   strait inside the local domain or not
       !!---------------------------------------------------------------------
-      REAL(wp) ::   ztemp
+      REAL(wp) ::   ztemp   ! local scalar
+      INTEGER  ::   ierr    ! local integer
       !!---------------------------------------------------------------------
       !
@@ -184,9 +186,21 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~~~'
       !
+      !                           ! Allocate arrays for this module
+      ALLOCATE( hdiv_139_101(jpk) , hdiv_139_101_kt(jpk) ,     &    ! Gibraltar
+         &      hdiv_139_102(jpk) ,                            &
+         &      hdiv_141_102(jpk) , hdiv_141_102_kt(jpk) ,     &
+         &      hdiv_161_88 (jpk) , hdiv_161_88_kt (jpk) ,     &    ! Bab-el-Mandeb
+         &      hdiv_161_87 (jpk) ,                            &                     
+         &      hdiv_160_89 (jpk) , hdiv_160_89_kt (jpk) ,     &     ! Hormuz
+         &      hdiv_172_94 (jpk) ,                            &
+         &      t_171_94_hor(jpk) , s_171_94_hor   (jpk) , STAT=ierr )
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'cla_init: unable to allocate arrays' )
+      !
       IF( .NOT.lk_dynspg_flt )   CALL ctl_stop( 'cla_init: Cross Land Advection works only with lk_dynspg_flt=T ' )
       !
-      IF( lk_vvl    )   CALL ctl_stop( 'cla_init: Cross Land Advection does not work with lk_vvl=T option' )
-      !
-      IF( jpk /= 31 )   CALL ctl_stop( 'cla_init: Cross Land Advection hard coded for ORCA_R2_L31' )
+      IF( lk_vvl             )   CALL ctl_stop( 'cla_init: Cross Land Advection does not work with lk_vvl=T option' )
+      !
+      IF( jpk /= 31          )   CALL ctl_stop( 'cla_init: Cross Land Advection hard coded for ORCA_R2_L31' )
       !
       !                                        _|_______|_______|_
@@ -723,5 +737,5 @@
    !!   Default key                                            Dummy module
    !!----------------------------------------------------------------------
-   USE in_out_manager ! I/O manager
+   USE lib_mpp, ONLY:   ctl_stop
 CONTAINS
    SUBROUTINE cla_init
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbcnfd.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbcnfd.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lbcnfd.F90	(revision 2715)
@@ -12,5 +12,4 @@
    !!   lbc_nfd_2d    : lateral boundary condition: North fold treatment for a 2D arrays   (lbc_nfd)
    !!----------------------------------------------------------------------
-   USE oce            ! ocean dynamics and tracers   
    USE dom_oce        ! ocean space and time domain 
    USE in_out_manager ! I/O manager
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 2715)
@@ -18,4 +18,12 @@
    !!            3.2  !  2009  (R. Benshila) SHMEM suppression, north fold in lbc_nfd
    !!            3.2  !  2009  (O. Marti)    add mpp_ini_znl 
+   !!            4.0  !  2011  (G. Madec)  move ctl_ routines from in_out_manager
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   ctl_stop   : update momentum and tracer Kz from a tke scheme
+   !!   ctl_warn   : initialization, namelist read, and parameters control
+   !!   ctl_opn    : Open file and check if required file is available.
+   !!   get_unit    : give the index of an unused logical unit
    !!----------------------------------------------------------------------
 #if   defined key_mpp_mpi  
@@ -23,41 +31,33 @@
    !!   'key_mpp_mpi'             MPI massively parallel processing library
    !!----------------------------------------------------------------------
-   !!   mynode      : indentify the processor unit
-   !!   mpp_lnk     : interface (defined in lbclnk) for message passing of 2d or 3d arrays (mpp_lnk_2d, mpp_lnk_3d)
+   !!   lib_mpp_alloc : allocate mpp arrays
+   !!   mynode        : indentify the processor unit
+   !!   mpp_lnk       : interface (defined in lbclnk) for message passing of 2d or 3d arrays (mpp_lnk_2d, mpp_lnk_3d)
    !!   mpp_lnk_3d_gather :  Message passing manadgement for two 3D arrays
-   !!   mpp_lnk_e   : interface (defined in lbclnk) for message passing of 2d array with extra halo (mpp_lnk_2d_e)
-   !!   mpprecv     :
-   !!   mppsend     :   SUBROUTINE mpp_ini_znl
-   !!   mppscatter  :
-   !!   mppgather   :
-   !!   mpp_min     : generic interface for mppmin_int , mppmin_a_int , mppmin_real, mppmin_a_real
-   !!   mpp_max     : generic interface for mppmax_int , mppmax_a_int , mppmax_real, mppmax_a_real
-   !!   mpp_sum     : generic interface for mppsum_int , mppsum_a_int , mppsum_real, mppsum_a_real
-   !!   mpp_minloc  :
-   !!   mpp_maxloc  :
-   !!   mppsync     :
-   !!   mppstop     :
-   !!   mppobc      : variant of mpp_lnk for open boundary condition
+   !!   mpp_lnk_e     : interface (defined in lbclnk) for message passing of 2d array with extra halo (mpp_lnk_2d_e)
+   !!   mpprecv         :
+   !!   mppsend       :   SUBROUTINE mpp_ini_znl
+   !!   mppscatter    :
+   !!   mppgather     :
+   !!   mpp_min       : generic interface for mppmin_int , mppmin_a_int , mppmin_real, mppmin_a_real
+   !!   mpp_max       : generic interface for mppmax_int , mppmax_a_int , mppmax_real, mppmax_a_real
+   !!   mpp_sum       : generic interface for mppsum_int , mppsum_a_int , mppsum_real, mppsum_a_real
+   !!   mpp_minloc    :
+   !!   mpp_maxloc    :
+   !!   mppsync       :
+   !!   mppstop       :
+   !!   mppobc        : variant of mpp_lnk for open boundary condition
    !!   mpp_ini_north : initialisation of north fold
    !!   mpp_lbc_north : north fold processors gathering
    !!   mpp_lbc_north_e : variant of mpp_lbc_north for extra outer halo
    !!----------------------------------------------------------------------
-   !! History :
-   !!        !  94 (M. Guyon, J. Escobar, M. Imbard)  Original code
-   !!        !  97  (A.M. Treguier)  SHMEM additions
-   !!        !  98  (M. Imbard, J. Escobar, L. Colombet ) SHMEM and MPI
-   !!   9.0  !  03  (J.-M. Molines, G. Madec)  F90, free form
-   !!        !  04  (R. Bourdalle Badie)  isend option in mpi
-   !!        !  05  (G. Madec, S. Masson)  npolj=5,6 F-point & ice cases
-   !!        !  05  (R. Redler) Replacement of MPI_COMM_WORLD except for MPI_Abort
-   !!        !  09  (R. Benshila) SHMEM suppression, north fold in lbc_nfd
-   !!----------------------------------------------------------------------
-   USE dom_oce                    ! ocean space and time domain 
-   USE in_out_manager             ! I/O manager
-   USE lbcnfd                     ! north fold treatment
+   USE dom_oce        ! ocean space and time domain 
+   USE lbcnfd         ! north fold treatment
+   USE in_out_manager ! I/O manager
 
    IMPLICIT NONE
    PRIVATE
    
+   PUBLIC   ctl_stop, ctl_warn, get_unit, ctl_opn
    PUBLIC   mynode, mppstop, mppsync, mpp_comm_free
    PUBLIC   mpp_ini_north, mpp_lbc_north, mpp_lbc_north_e
@@ -65,4 +65,6 @@
    PUBLIC   mpp_lnk_3d, mpp_lnk_3d_gather, mpp_lnk_2d, mpp_lnk_2d_e
    PUBLIC   mppobc, mpp_ini_ice, mpp_ini_znl
+   PUBLIC   mppsize
+   PUBLIC   lib_mpp_alloc   ! Called in nemogcm.F90
 
    !! * Interfaces
@@ -120,5 +122,5 @@
    INTEGER ::   ndim_rank_ice   !  number of 'ice' processors
    INTEGER ::   n_ice_root      !  number (in the comm_ice) of proc 0 in the ice comm
-   INTEGER, DIMENSION(:), ALLOCATABLE ::   nrank_ice     ! dimension ndim_rank_ice
+   INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   nrank_ice     ! dimension ndim_rank_ice
 
    ! variables used for zonal integration
@@ -127,5 +129,5 @@
    INTEGER ::   ngrp_znl        ! group ID for the znl processors
    INTEGER ::   ndim_rank_znl   ! number of processors on the same zonal average
-   INTEGER, DIMENSION(:), ALLOCATABLE ::   nrank_znl  ! dimension ndim_rank_znl, number of the procs into the same znl domain
+   INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   nrank_znl  ! dimension ndim_rank_znl, number of the procs into the same znl domain
    
    ! North fold condition in mpp_mpi with jpni > 1
@@ -137,5 +139,5 @@
    INTEGER ::   njmppmax          ! value of njmpp for the processors of the northern line
    INTEGER ::   north_root        ! number (in the comm_opa) of proc 0 in the northern comm
-   INTEGER, DIMENSION(:), ALLOCATABLE ::   nrank_north   ! dimension ndim_rank_north
+   INTEGER, DIMENSION(:), ALLOCATABLE, SAVE ::   nrank_north   ! dimension ndim_rank_north
 
    ! Type of send : standard, buffered, immediate
@@ -144,39 +146,91 @@
    INTEGER          ::   nn_buffer = 0       ! size of the buffer in case of mpi_bsend 
       
-   REAL(wp), ALLOCATABLE, DIMENSION(:) :: tampon  ! buffer in case of bsend
+   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tampon  ! buffer in case of bsend
 
    ! message passing arrays
-   REAL(wp), DIMENSION(jpi,jprecj,jpk,2,2) ::   t4ns, t4sn   ! 2 x 3d for north-south & south-north
-   REAL(wp), DIMENSION(jpj,jpreci,jpk,2,2) ::   t4ew, t4we   ! 2 x 3d for east-west & west-east
-   REAL(wp), DIMENSION(jpi,jprecj,jpk,2,2) ::   t4p1, t4p2   ! 2 x 3d for north fold
-   REAL(wp), DIMENSION(jpi,jprecj,jpk,2)   ::   t3ns, t3sn   ! 3d for north-south & south-north
-   REAL(wp), DIMENSION(jpj,jpreci,jpk,2)   ::   t3ew, t3we   ! 3d for east-west & west-east
-   REAL(wp), DIMENSION(jpi,jprecj,jpk,2)   ::   t3p1, t3p2   ! 3d for north fold
-   REAL(wp), DIMENSION(jpi,jprecj,2)       ::   t2ns, t2sn   ! 2d for north-south & south-north
-   REAL(wp), DIMENSION(jpj,jpreci,2)       ::   t2ew, t2we   ! 2d for east-west & west-east
-   REAL(wp), DIMENSION(jpi,jprecj,2)       ::   t2p1, t2p2   ! 2d for north fold
-   REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,jprecj+jpr2dj,2) ::   tr2ns, tr2sn  ! 2d for north-south & south-north + extra outer halo
-   REAL(wp), DIMENSION(1-jpr2dj:jpj+jpr2dj,jpreci+jpr2di,2) ::   tr2ew, tr2we  ! 2d for east-west   & west-east   + extra outer halo
+   REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4ns, t4sn   ! 2 x 3d for north-south & south-north
+   REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4ew, t4we   ! 2 x 3d for east-west & west-east
+   REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE ::   t4p1, t4p2   ! 2 x 3d for north fold
+   REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3ns, t3sn   ! 3d for north-south & south-north
+   REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3ew, t3we   ! 3d for east-west & west-east
+   REAL(wp), DIMENSION(:,:,:,:)  , ALLOCATABLE, SAVE ::   t3p1, t3p2   ! 3d for north fold
+   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2ns, t2sn   ! 2d for north-south & south-north
+   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2ew, t2we   ! 2d for east-west & west-east
+   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   t2p1, t2p2   ! 2d for north fold
+   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   tr2ns, tr2sn ! 2d for north-south & south-north + extra outer halo
+   REAL(wp), DIMENSION(:,:,:)    , ALLOCATABLE, SAVE ::   tr2ew, tr2we ! 2d for east-west   & west-east   + extra outer halo
+
+   ! Arrays used in mpp_lbc_north_3d()
+   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   ztab, znorthloc
+   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   znorthgloio
+
+   ! Arrays used in mpp_lbc_north_2d()
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_2d, znorthloc_2d
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_2d
+
+   ! Arrays used in mpp_lbc_north_e()
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_e, znorthloc_e
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_e
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
-   FUNCTION mynode(ldtxt, localComm)
+   INTEGER FUNCTION lib_mpp_alloc( kumout )
+      !!----------------------------------------------------------------------
+      !!              ***  routine lib_mpp_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kumout   ! ocean.output logical unit
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( t4ns(jpi,jprecj,jpk,2,2) , t4sn(jpi,jprecj,jpk,2,2) ,                                            &
+         &      t4ew(jpj,jpreci,jpk,2,2) , t4we(jpj,jpreci,jpk,2,2) ,                                            &
+         &      t4p1(jpi,jprecj,jpk,2,2) , t4p2(jpi,jprecj,jpk,2,2) ,                                            &
+         &      t3ns(jpi,jprecj,jpk,2)   , t3sn(jpi,jprecj,jpk,2)   ,                                            &
+         &      t3ew(jpj,jpreci,jpk,2)   , t3we(jpj,jpreci,jpk,2)   ,                                            &
+         &      t3p1(jpi,jprecj,jpk,2)   , t3p2(jpi,jprecj,jpk,2)   ,                                            &
+         &      t2ns(jpi,jprecj    ,2)   , t2sn(jpi,jprecj    ,2)   ,                                            &
+         &      t2ew(jpj,jpreci    ,2)   , t2we(jpj,jpreci    ,2)   ,                                            &
+         &      t2p1(jpi,jprecj    ,2)   , t2p2(jpi,jprecj    ,2)   ,                                            &
+         !
+         &      tr2ns(1-jpr2di:jpi+jpr2di,jprecj+jpr2dj,2) ,                                                     &
+         &      tr2sn(1-jpr2di:jpi+jpr2di,jprecj+jpr2dj,2) ,                                                     &
+         &      tr2ew(1-jpr2dj:jpj+jpr2dj,jpreci+jpr2di,2) ,                                                     &
+         &      tr2we(1-jpr2dj:jpj+jpr2dj,jpreci+jpr2di,2) ,                                                     &
+         !
+         &      ztab(jpiglo,4,jpk) , znorthloc(jpi,4,jpk) , znorthgloio(jpi,4,jpk,jpni) ,                        &
+         !
+         &      ztab_2d(jpiglo,4)  , znorthloc_2d(jpi,4)  , znorthgloio_2d(jpi,4,jpni)  ,                        &
+         !
+         &      ztab_e(jpiglo,4+2*jpr2dj) , znorthloc_e(jpi,4+2*jpr2dj) , znorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   &
+         !
+         &      STAT=lib_mpp_alloc )
+         !
+      IF( lib_mpp_alloc /= 0 ) THEN
+         WRITE(kumout,cform_war)
+         WRITE(kumout,*) 'lib_mpp_alloc : failed to allocate arrays'
+      ENDIF
+      !
+   END FUNCTION lib_mpp_alloc
+
+
+   FUNCTION mynode( ldtxt, kumnam, kstop, localComm )
       !!----------------------------------------------------------------------
       !!                  ***  routine mynode  ***
       !!                    
       !! ** Purpose :   Find processor unit
-      !!
       !!----------------------------------------------------------------------
       CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt 
+      INTEGER                      , INTENT(in   ) ::   kumnam       ! namelist logical unit 
+      INTEGER                      , INTENT(inout) ::   kstop        ! stop indicator 
       INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm
+      !
       INTEGER ::   mynode, ierr, code, ji, ii
       LOGICAL ::   mpi_was_called
-      
-      NAMELIST/nammpp/ cn_mpi_send, nn_buffer
+      !
+      NAMELIST/nammpp/ cn_mpi_send, nn_buffer, jpni, jpnj, jpnij
       !!----------------------------------------------------------------------
       !
@@ -186,10 +240,25 @@
       WRITE(ldtxt(ii),*) '~~~~~~ '                                                                ;   ii = ii + 1
       !
-      REWIND( numnam )               ! Namelist namrun : parameters of the run
-      READ  ( numnam, nammpp )
+      jpni = -1; jpnj = -1; jpnij = -1
+      REWIND( kumnam )               ! Namelist namrun : parameters of the run
+      READ  ( kumnam, nammpp )
       !                              ! control print
       WRITE(ldtxt(ii),*) '   Namelist nammpp'                                                     ;   ii = ii + 1
       WRITE(ldtxt(ii),*) '      mpi send type                      cn_mpi_send = ', cn_mpi_send   ;   ii = ii + 1
       WRITE(ldtxt(ii),*) '      size in bytes of exported buffer   nn_buffer   = ', nn_buffer     ;   ii = ii + 1
+
+      IF(jpnij < 1)THEN
+         ! If jpnij is not specified in namelist then we calculate it - this
+         ! means there will be no land cutting out.
+         jpnij = jpni * jpnj
+      END IF
+
+      IF( (jpni < 1) .OR. (jpnj < 1) )THEN
+         WRITE(ldtxt(ii),*) '      jpni, jpnj and jpnij will be calculated automatically'; ii = ii + 1
+      ELSE
+         WRITE(ldtxt(ii),*) '      processor grid extent in i         jpni = ',jpni; ii = ii + 1
+         WRITE(ldtxt(ii),*) '      processor grid extent in j         jpnj = ',jpnj; ii = ii + 1
+         WRITE(ldtxt(ii),*) '      number of local domains           jpnij = ',jpnij; ii = ii +1
+      END IF
 
       CALL mpi_initialized ( mpi_was_called, code )
@@ -217,10 +286,10 @@
             WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1
             WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1
-            nstop = nstop + 1
+            kstop = kstop + 1
          END SELECT
       ELSE IF ( PRESENT(localComm) .and. .not. mpi_was_called ) THEN
          WRITE(ldtxt(ii),*) ' lib_mpp: You cannot provide a local communicator '                  ;   ii = ii + 1
          WRITE(ldtxt(ii),*) '          without calling MPI_Init before ! '                        ;   ii = ii + 1
-         nstop = nstop + 1
+         kstop = kstop + 1
       ELSE
          SELECT CASE ( cn_mpi_send )
@@ -238,5 +307,5 @@
             WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1
             WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1
-            nstop = nstop + 1
+            kstop = kstop + 1
          END SELECT
          !
@@ -1650,5 +1719,5 @@
 
 
-   SUBROUTINE mppobc( ptab, kd1, kd2, kl, kk, ktype, kij )
+   SUBROUTINE mppobc( ptab, kd1, kd2, kl, kk, ktype, kij , kumout)
       !!----------------------------------------------------------------------
       !!                  ***  routine mppobc  ***
@@ -1670,4 +1739,7 @@
       !!
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztab => wrk_2d_1
+      !
       INTEGER , INTENT(in   )                     ::   kd1, kd2   ! starting and ending indices
       INTEGER , INTENT(in   )                     ::   kl         ! index of open boundary
@@ -1676,14 +1748,20 @@
       !                                                           !  = 1  north/south  ;  = 2  east/west
       INTEGER , INTENT(in   )                     ::   kij        ! horizontal dimension
+      INTEGER , INTENT(in   )                     ::   kumout     ! ocean.output logical unit
       REAL(wp), INTENT(inout), DIMENSION(kij,kk)  ::   ptab       ! variable array
-      !! 
-      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
-      INTEGER  ::   iipt0, iipt1, ilpt1   ! temporary integers
-      INTEGER  ::   ijpt0, ijpt1          !    -          -
-      INTEGER  ::   imigr, iihom, ijhom   !    -          -
+      !
+      INTEGER ::   ji, jj, jk, jl        ! dummy loop indices
+      INTEGER ::   iipt0, iipt1, ilpt1   ! local integers
+      INTEGER ::   ijpt0, ijpt1          !   -       -
+      INTEGER ::   imigr, iihom, ijhom   !   -       -
       INTEGER ::   ml_req1, ml_req2, ml_err    ! for key_mpi_isend
       INTEGER ::   ml_stat(MPI_STATUS_SIZE)    ! for key_mpi_isend
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztab   ! temporary workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         WRITE(kumout, cform_err)
+         WRITE(kumout,*) 'mppobc : requested workspace array unavailable'
+         CALL mppstop
+      ENDIF
 
       ! boundary condition initialization
@@ -1704,5 +1782,7 @@
          ilpt1 = MAX( 1, MIN(kd2 - njmpp+1, nlcj     ) )
       ELSE
-         CALL ctl_stop( 'mppobc: bad ktype' )
+         WRITE(kumout, cform_err)
+         WRITE(kumout,*) 'mppobc : bad ktype'
+         CALL mppstop
       ENDIF
       
@@ -1834,4 +1914,10 @@
       END DO
       !
+      IF( wrk_not_released(2, 1) ) THEN
+         WRITE(kumout, cform_err)
+         WRITE(kumout,*) 'mppobc : failed to release workspace array'
+         CALL mppstop
+      ENDIF
+      !
    END SUBROUTINE mppobc
    
@@ -1850,5 +1936,5 @@
 
 
-   SUBROUTINE mpp_ini_ice( pindic )
+   SUBROUTINE mpp_ini_ice( pindic, kumout )
       !!----------------------------------------------------------------------
       !!               ***  routine mpp_ini_ice  ***
@@ -1872,13 +1958,22 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) :: pindic
-      !!
-      INTEGER :: ierr
+      INTEGER, INTENT(in) ::   pindic
+      INTEGER, INTENT(in) ::   kumout   ! ocean.output logical unit
+      !!
       INTEGER :: jjproc
-      INTEGER :: ii
-      INTEGER, DIMENSION(jpnij) :: kice
-      INTEGER, DIMENSION(jpnij) :: zwork
-      !!----------------------------------------------------------------------
-      !
+      INTEGER :: ii, ierr
+      INTEGER, ALLOCATABLE, DIMENSION(:) ::   kice
+      INTEGER, ALLOCATABLE, DIMENSION(:) ::   zwork
+      !!----------------------------------------------------------------------
+      !
+      ! Since this is just an init routine and these arrays are of length jpnij
+      ! then don't use wrk_nemo module - just allocate and deallocate.
+      ALLOCATE( kice(jpnij), zwork(jpnij), STAT=ierr )
+      IF( ierr /= 0 ) THEN
+         WRITE(kumout, cform_err)
+         WRITE(kumout,*) 'mpp_ini_ice : failed to allocate 2, 1D arrays (jpnij in length)'
+         CALL mppstop
+      ENDIF
+
       ! Look for how many procs with sea-ice
       !
@@ -1893,9 +1988,5 @@
 
       ! Allocate the right size to nrank_north
-#if ! defined key_agrif
       IF( ALLOCATED ( nrank_ice ) )   DEALLOCATE( nrank_ice )
-#else
-      IF( ASSOCIATED( nrank_ice ) )   DEALLOCATE( nrank_ice )
-#endif
       ALLOCATE( nrank_ice(ndim_rank_ice) )
       !
@@ -1922,8 +2013,10 @@
       ! CALL MPI_GROUP_TRANSLATE_RANKS(ngrp_ice,1,0,ngrp_world,n_ice_root,ierr)
       !
+      DEALLOCATE(kice, zwork)
+      !
    END SUBROUTINE mpp_ini_ice
 
 
-   SUBROUTINE mpp_ini_znl
+   SUBROUTINE mpp_ini_znl( kumout )
       !!----------------------------------------------------------------------
       !!               ***  routine mpp_ini_znl  ***
@@ -1944,14 +2037,22 @@
       !!
       !!----------------------------------------------------------------------
-      INTEGER :: ierr
-      INTEGER :: jproc
-      INTEGER :: ii
-      INTEGER, DIMENSION(jpnij) :: kwork
-      !
+      INTEGER, INTENT(in) ::   kumout   ! ocean.output logical units
+      !
+      INTEGER :: jproc      ! dummy loop integer
+      INTEGER :: ierr, ii   ! local integer
+      INTEGER, ALLOCATABLE, DIMENSION(:) ::   kwork
+      !!----------------------------------------------------------------------
       !-$$     WRITE (numout,*) 'mpp_ini_znl ', nproc, ' - ngrp_world     : ', ngrp_world
       !-$$     WRITE (numout,*) 'mpp_ini_znl ', nproc, ' - mpi_comm_world : ', mpi_comm_world
       !-$$     WRITE (numout,*) 'mpp_ini_znl ', nproc, ' - mpi_comm_opa   : ', mpi_comm_opa
       !
-      IF ( jpnj == 1 ) THEN
+      ALLOCATE( kwork(jpnij), STAT=ierr )
+      IF( ierr /= 0 ) THEN
+         WRITE(kumout, cform_err)
+         WRITE(kumout,*) 'mpp_ini_znl : failed to allocate 1D array of length jpnij'
+         CALL mppstop
+      ENDIF
+
+      IF( jpnj == 1 ) THEN
          ngrp_znl  = ngrp_world
          ncomm_znl = mpi_comm_opa
@@ -1972,9 +2073,5 @@
          !-$$        CALL flush(numout)
          ! Allocate the right size to nrank_znl
-#if ! defined key_agrif
          IF (ALLOCATED (nrank_znl)) DEALLOCATE(nrank_znl)
-#else
-         IF (ASSOCIATED(nrank_znl)) DEALLOCATE(nrank_znl)
-#endif
          ALLOCATE(nrank_znl(ndim_rank_znl))
          ii = 0     
@@ -2016,4 +2113,6 @@
       END IF
 
+      DEALLOCATE(kwork)
+
    END SUBROUTINE mpp_ini_znl
 
@@ -2055,9 +2154,5 @@
       !
       ! Allocate the right size to nrank_north
-#if ! defined key_agrif
       IF (ALLOCATED (nrank_north)) DEALLOCATE(nrank_north)
-#else
-      IF (ASSOCIATED(nrank_north)) DEALLOCATE(nrank_north)
-#endif
       ALLOCATE( nrank_north(ndim_rank_north) )
 
@@ -2106,7 +2201,4 @@
       INTEGER ::   ierr, itaille, ildi, ilei, iilb
       INTEGER ::   ijpj, ijpjm1, ij, iproc
-      REAL(wp), DIMENSION(jpiglo,4,jpk)      ::   ztab
-      REAL(wp), DIMENSION(jpi   ,4,jpk)      ::   znorthloc
-      REAL(wp), DIMENSION(jpi   ,4,jpk,jpni) ::   znorthgloio
       !!----------------------------------------------------------------------
       !   
@@ -2172,22 +2264,19 @@
       INTEGER ::   ierr, itaille, ildi, ilei, iilb
       INTEGER ::   ijpj, ijpjm1, ij, iproc
-      REAL(wp), DIMENSION(jpiglo,4)      ::   ztab
-      REAL(wp), DIMENSION(jpi   ,4)      ::   znorthloc
-      REAL(wp), DIMENSION(jpi   ,4,jpni) ::   znorthgloio
       !!----------------------------------------------------------------------
       !
       ijpj   = 4
       ijpjm1 = 3
-      ztab(:,:) = 0.e0
-      !
-      DO jj = nlcj-ijpj+1, nlcj             ! put in znorthloc the last 4 jlines of pt2d
+      ztab_2d(:,:) = 0.e0
+      !
+      DO jj = nlcj-ijpj+1, nlcj             ! put in znorthloc_2d the last 4 jlines of pt2d
          ij = jj - nlcj + ijpj
-         znorthloc(:,ij) = pt2d(:,jj)
+         znorthloc_2d(:,ij) = pt2d(:,jj)
       END DO
 
-      !                                     ! Build in procs of ncomm_north the znorthgloio
+      !                                     ! Build in procs of ncomm_north the znorthgloio_2d
       itaille = jpi * ijpj
-      CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,        &
-         &                znorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
+      CALL MPI_ALLGATHER( znorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        &
+         &                znorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
       !
       DO jr = 1, ndim_rank_north            ! recover the global north array
@@ -2198,10 +2287,10 @@
          DO jj = 1, 4
             DO ji = ildi, ilei
-               ztab(ji+iilb-1,jj) = znorthgloio(ji,jj,jr)
+               ztab_2d(ji+iilb-1,jj) = znorthgloio_2d(ji,jj,jr)
             END DO
          END DO
       END DO
       !
-      CALL lbc_nfd( ztab, cd_type, psgn )   ! North fold boundary condition
+      CALL lbc_nfd( ztab_2d, cd_type, psgn )   ! North fold boundary condition
       !
       !
@@ -2209,5 +2298,5 @@
          ij = jj - nlcj + ijpj
          DO ji = 1, nlci
-            pt2d(ji,jj) = ztab(ji+nimpp-1,ij)
+            pt2d(ji,jj) = ztab_2d(ji+nimpp-1,ij)
          END DO
       END DO
@@ -2239,24 +2328,21 @@
       INTEGER ::   ierr, itaille, ildi, ilei, iilb
       INTEGER ::   ijpj, ij, iproc
-      REAL(wp), DIMENSION(jpiglo,4+2*jpr2dj)      ::   ztab
-      REAL(wp), DIMENSION(jpi   ,4+2*jpr2dj)      ::   znorthloc
-      REAL(wp), DIMENSION(jpi   ,4+2*jpr2dj,jpni) ::   znorthgloio
       !!----------------------------------------------------------------------
       !
       ijpj=4
-      ztab(:,:) = 0.e0
+      ztab_e(:,:) = 0.e0
 
       ij=0
-      ! put in znorthloc the last 4 jlines of pt2d
+      ! put in znorthloc_e the last 4 jlines of pt2d
       DO jj = nlcj - ijpj + 1 - jpr2dj, nlcj +jpr2dj
          ij = ij + 1
          DO ji = 1, jpi
-            znorthloc(ji,ij)=pt2d(ji,jj)
+            znorthloc_e(ji,ij)=pt2d(ji,jj)
          END DO
       END DO
       !
       itaille = jpi * ( ijpj + 2 * jpr2dj )
-      CALL MPI_ALLGATHER( znorthloc(1,1)    , itaille, MPI_DOUBLE_PRECISION,    &
-         &                znorthgloio(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
+      CALL MPI_ALLGATHER( znorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    &
+         &                znorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
       !
       DO jr = 1, ndim_rank_north            ! recover the global north array
@@ -2267,5 +2353,5 @@
          DO jj = 1, ijpj+2*jpr2dj
             DO ji = ildi, ilei
-               ztab(ji+iilb-1,jj) = znorthgloio(ji,jj,jr)
+               ztab_e(ji+iilb-1,jj) = znorthgloio_e(ji,jj,jr)
             END DO
          END DO
@@ -2275,5 +2361,5 @@
       ! 2. North-Fold boundary conditions
       ! ----------------------------------
-      CALL lbc_nfd( ztab(:,:), cd_type, psgn, pr2dj = jpr2dj )
+      CALL lbc_nfd( ztab_e(:,:), cd_type, psgn, pr2dj = jpr2dj )
 
       ij = jpr2dj
@@ -2282,5 +2368,5 @@
       ij  = ij +1 
          DO ji= 1, nlci
-            pt2d(ji,jj) = ztab(ji+nimpp-1,ij)
+            pt2d(ji,jj) = ztab_e(ji+nimpp-1,ij)
          END DO
       END DO
@@ -2335,5 +2421,5 @@
          ! Buffer allocation and attachment
          ALLOCATE( tampon(nn_buffer), stat = ierr )
-         IF (ierr /= 0) THEN 
+         IF( ierr /= 0 ) THEN 
             DO ji = 1, SIZE(ldtxt) 
                IF( TRIM(ldtxt(ji)) /= '' )   WRITE(*,*) ldtxt(ji)      ! control print of mynode
@@ -2383,4 +2469,5 @@
    !!   Default case:            Dummy module        share memory computing
    !!----------------------------------------------------------------------
+   USE in_out_manager
 
    INTERFACE mpp_sum
@@ -2403,13 +2490,18 @@
    END INTERFACE
 
-
    LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .FALSE.      !: mpp flag
    INTEGER :: ncomm_ice
-
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   FUNCTION mynode( ldtxt, localComm ) RESULT (function_value)
-      CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt 
+   INTEGER FUNCTION lib_mpp_alloc(kumout)          ! Dummy function
+      INTEGER, INTENT(in) ::   kumout
+      lib_mpp_alloc = 0
+   END FUNCTION lib_mpp_alloc
+
+   FUNCTION mynode( ldtxt, kumnam, kstop, localComm ) RESULT (function_value)
       INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm
+      CHARACTER(len=*),DIMENSION(:) ::   ldtxt 
+      INTEGER ::   kumnam, kstop
       IF( PRESENT( localComm ) .OR. .NOT.PRESENT( localComm ) )   function_value = 0
       IF( .FALSE. )   ldtxt(:) = 'never done'
@@ -2504,26 +2596,26 @@
    END SUBROUTINE mppmin_int
 
-   SUBROUTINE mppobc_1d( parr, kd1, kd2, kl, kk, ktype, kij )
-      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij
+   SUBROUTINE mppobc_1d( parr, kd1, kd2, kl, kk, ktype, kij, knum )
+      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum
       REAL, DIMENSION(:) ::   parr           ! variable array
-      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1), kd1, kd2, kl, kk, ktype, kij
+      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1), kd1, kd2, kl, kk, ktype, kij, knum
    END SUBROUTINE mppobc_1d
 
-   SUBROUTINE mppobc_2d( parr, kd1, kd2, kl, kk, ktype, kij )
-      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij
+   SUBROUTINE mppobc_2d( parr, kd1, kd2, kl, kk, ktype, kij, knum )
+      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum
       REAL, DIMENSION(:,:) ::   parr           ! variable array
-      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1), kd1, kd2, kl, kk, ktype, kij
+      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1), kd1, kd2, kl, kk, ktype, kij, knum
    END SUBROUTINE mppobc_2d
 
-   SUBROUTINE mppobc_3d( parr, kd1, kd2, kl, kk, ktype, kij )
-      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij
+   SUBROUTINE mppobc_3d( parr, kd1, kd2, kl, kk, ktype, kij, knum )
+      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum
       REAL, DIMENSION(:,:,:) ::   parr           ! variable array
-      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1), kd1, kd2, kl, kk, ktype, kij
+      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1), kd1, kd2, kl, kk, ktype, kij, knum
    END SUBROUTINE mppobc_3d
 
-   SUBROUTINE mppobc_4d( parr, kd1, kd2, kl, kk, ktype, kij )
-      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij
+   SUBROUTINE mppobc_4d( parr, kd1, kd2, kl, kk, ktype, kij, knum )
+      INTEGER  ::   kd1, kd2, kl , kk, ktype, kij, knum
       REAL, DIMENSION(:,:,:,:) ::   parr           ! variable array
-      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1,1), kd1, kd2, kl, kk, ktype, kij
+      WRITE(*,*) 'mppobc: You should not have seen this print! error?', parr(1,1,1,1), kd1, kd2, kl, kk, ktype, kij, knum
    END SUBROUTINE mppobc_4d
 
@@ -2560,11 +2652,12 @@
    END SUBROUTINE mppstop
 
-   SUBROUTINE mpp_ini_ice( kcom )
-      INTEGER :: kcom
-      WRITE(*,*) 'mpp_ini_ice: You should not have seen this print! error?', kcom
+   SUBROUTINE mpp_ini_ice( kcom, knum )
+      INTEGER :: kcom, knum
+      WRITE(*,*) 'mpp_ini_ice: You should not have seen this print! error?', kcom, knum
    END SUBROUTINE mpp_ini_ice
 
-   SUBROUTINE mpp_ini_znl
-      WRITE(*,*) 'mpp_ini_znl: You should not have seen this print! error?'
+   SUBROUTINE mpp_ini_znl( knum )
+      INTEGER :: knum
+      WRITE(*,*) 'mpp_ini_znl: You should not have seen this print! error?', knum
    END SUBROUTINE mpp_ini_znl
 
@@ -2574,4 +2667,172 @@
    END SUBROUTINE mpp_comm_free
 #endif
+
+   !!----------------------------------------------------------------------
+   !!   All cases:         ctl_stop, ctl_warn, get_unit, ctl_opn   routines
+   !!----------------------------------------------------------------------
+
+   SUBROUTINE ctl_stop( cd1, cd2, cd3, cd4, cd5 ,   &
+      &                 cd6, cd7, cd8, cd9, cd10 )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE  stop_opa  ***
+      !!
+      !! ** Purpose :   print in ocean.outpput file a error message and 
+      !!                increment the error number (nstop) by one.
+      !!----------------------------------------------------------------------
+      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
+      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
+      !!----------------------------------------------------------------------
+      !
+      nstop = nstop + 1 
+      IF(lwp) THEN
+         WRITE(numout,cform_err)
+         IF( PRESENT(cd1 ) )   WRITE(numout,*) cd1
+         IF( PRESENT(cd2 ) )   WRITE(numout,*) cd2
+         IF( PRESENT(cd3 ) )   WRITE(numout,*) cd3
+         IF( PRESENT(cd4 ) )   WRITE(numout,*) cd4
+         IF( PRESENT(cd5 ) )   WRITE(numout,*) cd5
+         IF( PRESENT(cd6 ) )   WRITE(numout,*) cd6
+         IF( PRESENT(cd7 ) )   WRITE(numout,*) cd7
+         IF( PRESENT(cd8 ) )   WRITE(numout,*) cd8
+         IF( PRESENT(cd9 ) )   WRITE(numout,*) cd9
+         IF( PRESENT(cd10) )   WRITE(numout,*) cd10
+      ENDIF
+                               CALL FLUSH(numout    )
+      IF( numstp     /= -1 )   CALL FLUSH(numstp    )
+      IF( numsol     /= -1 )   CALL FLUSH(numsol    )
+      IF( numevo_ice /= -1 )   CALL FLUSH(numevo_ice)
+      !
+      IF( cd1 == 'STOP' ) THEN
+         IF(lwp) WRITE(numout,*)  'huge E-R-R-O-R : immediate stop'
+         CALL mppstop()
+      ENDIF
+      !
+   END SUBROUTINE ctl_stop
+
+
+   SUBROUTINE ctl_warn( cd1, cd2, cd3, cd4, cd5,   &
+      &                 cd6, cd7, cd8, cd9, cd10 )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE  stop_warn  ***
+      !!
+      !! ** Purpose :   print in ocean.outpput file a error message and 
+      !!                increment the warning number (nwarn) by one.
+      !!----------------------------------------------------------------------
+      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd1, cd2, cd3, cd4, cd5
+      CHARACTER(len=*), INTENT(in), OPTIONAL ::  cd6, cd7, cd8, cd9, cd10
+      !!----------------------------------------------------------------------
+      ! 
+      nwarn = nwarn + 1 
+      IF(lwp) THEN
+         WRITE(numout,cform_war)
+         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
+         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
+         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
+         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
+         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
+         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
+         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
+         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
+         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
+         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
+      ENDIF
+      CALL FLUSH(numout)
+      !
+   END SUBROUTINE ctl_warn
+
+
+   SUBROUTINE ctl_opn( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE ctl_opn  ***
+      !!
+      !! ** Purpose :   Open file and check if required file is available.
+      !!
+      !! ** Method  :   Fortan open
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(  out) ::   knum      ! logical unit to open
+      CHARACTER(len=*) , INTENT(in   ) ::   cdfile    ! file name to open
+      CHARACTER(len=*) , INTENT(in   ) ::   cdstat    ! disposition specifier
+      CHARACTER(len=*) , INTENT(in   ) ::   cdform    ! formatting specifier
+      CHARACTER(len=*) , INTENT(in   ) ::   cdacce    ! access specifier
+      INTEGER          , INTENT(in   ) ::   klengh    ! record length
+      INTEGER          , INTENT(in   ) ::   kout      ! number of logical units for write
+      LOGICAL          , INTENT(in   ) ::   ldwp      ! boolean term for print
+      INTEGER, OPTIONAL, INTENT(in   ) ::   karea     ! proc number
+      !!
+      CHARACTER(len=80) ::   clfile
+      INTEGER           ::   iost
+      !!----------------------------------------------------------------------
+
+      ! adapt filename
+      ! ----------------
+      clfile = TRIM(cdfile)
+      IF( PRESENT( karea ) ) THEN
+         IF( karea > 1 )   WRITE(clfile, "(a,'_',i4.4)") TRIM(clfile), karea-1
+      ENDIF
+#if defined key_agrif
+      IF( .NOT. Agrif_Root() )   clfile = TRIM(Agrif_CFixed())//'_'//TRIM(clfile)
+      knum=Agrif_Get_Unit()
+#else
+      knum=get_unit()
+#endif
+
+      iost=0
+      IF( cdacce(1:6) == 'DIRECT' )  THEN
+         OPEN( UNIT=knum, FILE=clfile, FORM=cdform, ACCESS=cdacce, STATUS=cdstat, RECL=klengh, ERR=100, IOSTAT=iost )
+      ELSE
+         OPEN( UNIT=knum, FILE=clfile, FORM=cdform, ACCESS=cdacce, STATUS=cdstat             , ERR=100, IOSTAT=iost )
+      ENDIF
+      IF( iost == 0 ) THEN
+         IF(ldwp) THEN
+            WRITE(kout,*) '     file   : ', clfile,' open ok'
+            WRITE(kout,*) '     unit   = ', knum
+            WRITE(kout,*) '     status = ', cdstat
+            WRITE(kout,*) '     form   = ', cdform
+            WRITE(kout,*) '     access = ', cdacce
+            WRITE(kout,*)
+         ENDIF
+      ENDIF
+100   CONTINUE
+      IF( iost /= 0 ) THEN
+         IF(ldwp) THEN
+            WRITE(kout,*)
+            WRITE(kout,*) ' ===>>>> : bad opening file: ', clfile
+            WRITE(kout,*) ' =======   ===  '
+            WRITE(kout,*) '           unit   = ', knum
+            WRITE(kout,*) '           status = ', cdstat
+            WRITE(kout,*) '           form   = ', cdform
+            WRITE(kout,*) '           access = ', cdacce
+            WRITE(kout,*) '           iostat = ', iost
+            WRITE(kout,*) '           we stop. verify the file '
+            WRITE(kout,*)
+         ENDIF
+         STOP 'ctl_opn bad opening'
+      ENDIF
+      
+   END SUBROUTINE ctl_opn
+
+
+   INTEGER FUNCTION get_unit()
+      !!----------------------------------------------------------------------
+      !!                  ***  FUNCTION  get_unit  ***
+      !!
+      !! ** Purpose :   return the index of an unused logical unit
+      !!----------------------------------------------------------------------
+      LOGICAL :: llopn 
+      !!----------------------------------------------------------------------
+      !
+      get_unit = 15   ! choose a unit that is big enough then it is not already used in NEMO
+      llopn = .TRUE.
+      DO WHILE( (get_unit < 998) .AND. llopn )
+         get_unit = get_unit + 1
+         INQUIRE( unit = get_unit, opened = llopn )
+      END DO
+      IF( (get_unit == 999) .AND. llopn ) THEN
+         CALL ctl_stop( 'get_unit: All logical units until 999 are used...' )
+         get_unit = -1
+      ENDIF
+      !
+   END FUNCTION get_unit
+
    !!----------------------------------------------------------------------
 END MODULE lib_mpp
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LBC/mppini.F90	(revision 2715)
@@ -20,5 +20,4 @@
    PRIVATE
 
-   !! * Routine accessibility
    PUBLIC mpp_init       ! called by opa.F90
    PUBLIC mpp_init2      ! called by opa.F90
@@ -29,7 +28,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -128,14 +126,9 @@
       !!   8.5  !  02-08  (G. Madec)  F90 : free form
       !!----------------------------------------------------------------------
-      !! * Local variables
-      INTEGER ::   ji, jj, jn               ! dummy loop indices
-      INTEGER ::   &
-         ii, ij, ifreq, il1, il2,        &  ! temporary integers
-         iresti, irestj, ijm1, imil,     &  !    "          "
-         inum                               ! temporary logical unit
-
-      INTEGER, DIMENSION(jpni,jpnj) ::   &
-         iimppt, ijmppt, ilcit, ilcjt       ! temporary workspace
-      REAL(wp) ::   zidom, zjdom            ! temporary scalars
+      INTEGER  ::   ji, jj, jn   ! dummy loop indices
+      INTEGER  ::   ii, ij, ifreq, il1, il2            ! local integers
+      INTEGER  ::   iresti, irestj, ijm1, imil, inum   !   -      -
+      REAL(wp) ::   zidom, zjdom                       ! local scalars
+      INTEGER, DIMENSION(jpni,jpnj) ::   iimppt, ijmppt, ilcit, ilcjt   ! local workspace
       !!----------------------------------------------------------------------
 
@@ -451,8 +444,5 @@
       !!   " "  !  08-12  (A. Coward)  addition in case of jpni*jpnj < jpnij
       !!----------------------------------------------------------------------
-      !! Local declarations
-
-      INTEGER, DIMENSION(2) ::   &
-         iglo, iloc, iabsf, iabsl, ihals, ihale, idid
+      INTEGER, DIMENSION(2) ::   iglo, iloc, iabsf, iabsl, ihals, ihale, idid
       !!----------------------------------------------------------------------
 
@@ -482,7 +472,7 @@
           WRITE(numout,*) '                    ihale = ', ihale(1), ihale(2)
       ENDIF
-
+      !
       CALL flio_dom_set ( jpnij, nproc, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom)
-
+      !
    END SUBROUTINE mpp_init_ioipsl  
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 2715)
@@ -38,7 +38,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -63,5 +62,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio         ! ???
-      LOGICAL :: ll_print = .FALSE.    ! Logical flag for printing viscosity coef.
+      LOGICAL ::   ll_print = .FALSE.    ! Logical flag for printing viscosity coef.
       !! 
       NAMELIST/namdyn_ldf/ ln_dynldf_lap  , ln_dynldf_bilap,                  &
@@ -207,6 +206,6 @@
       REAL(wp), INTENT(in   )                         ::   pwam       ! width of inflection
       REAL(wp), INTENT(in   )                         ::   pbot       ! bottom value (0<pbot<= 1)
-      REAL(wp), INTENT(in   ), DIMENSION        (jpk) ::   pdep       ! depth of the gridpoint (T, U, V, F)
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pah        ! adimensional vertical profile
+      REAL(wp), INTENT(in   ), DIMENSION          (:) ::   pdep       ! depth of the gridpoint (T, U, V, F)
+      REAL(wp), INTENT(inout), DIMENSION      (:,:,:) ::   pah        ! adimensional vertical profile
       !!
       INTEGER  ::   jk           ! dummy loop indices
@@ -249,6 +248,6 @@
       REAL(wp), INTENT(in   )                         ::   pwam       ! width of inflection
       REAL(wp), INTENT(in   )                         ::   pbot       ! bottom value (0<pbot<= 1)
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   pdep       ! dep of the gridpoint (T, U, V, F)
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pah        ! adimensional vertical profile
+      REAL(wp), INTENT(in   ), DIMENSION      (:,:,:) ::   pdep       ! dep of the gridpoint (T, U, V, F)
+      REAL(wp), INTENT(inout), DIMENSION      (:,:,:) ::   pah        ! adimensional vertical profile
       !!
       INTEGER  ::   jk           ! dummy loop indices
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c1d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c1d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c1d.h90	(revision 2715)
@@ -24,8 +24,6 @@
       !!
       !!----------------------------------------------------------------------
-      !! * Arguments
-      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
-
-      !! * Local variables
+      LOGICAL, INTENT(in) :: ld_print   ! If true, output arrays on numout
+      !
       INTEGER  ::   jk   ! dummy loop indice
       REAL(wp) ::   zdam,  zwam,  zm00,  zm01,  zmhf,  zmhs
@@ -37,5 +35,4 @@
       IF(lwp) WRITE(numout,*) 'inildf: 1D eddy viscosity coefficient'
       IF(lwp) WRITE(numout,*) '~~~~~~  --'
-      IF(lwp) WRITE(numout,*)
 
       ! Set ahm1 for laplacian     (always at t-level)
@@ -124,4 +121,4 @@
       ENDIF
  9120 FORMAT('  jk      ahm       ','  depth w-level ' )
-
+      !
    END SUBROUTINE ldf_dyn_c1d
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c2d.h90	(revision 2715)
@@ -32,9 +32,7 @@
       !!
       !!----------------------------------------------------------------------
-      !! * Arguments
       LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
-
-      !! * Local variables
-      INTEGER :: ji, jj
+      !
+      INTEGER  ::   ji, jj
       REAL(wp) ::   za00, zd_max, zetmax, zeumax, zefmax, zevmax
       !!----------------------------------------------------------------------
@@ -43,5 +41,4 @@
       IF(lwp) WRITE(numout,*) 'ldf_dyn_c2d : 2d lateral eddy viscosity coefficient'
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-      IF(lwp) WRITE(numout,*)
 
       ! harmonic operator (ahm1, ahm2) : ( T- and F- points) (used for laplacian operators
@@ -123,6 +120,5 @@
          ENDIF
       ENDIF
-
-
+      !
    END SUBROUTINE ldf_dyn_c2d
 
@@ -143,29 +139,26 @@
       !!
       !!----------------------------------------------------------------------
-      !! * Modules used
-      USE ldftra_oce, ONLY : aht0
-
-      !! * Arguments
+      USE ldftra_oce, ONLY:   aht0
+      USE wrk_nemo  , ONLY:   iwrk_in_use, iwrk_not_released
+      USE wrk_nemo  , ONLY:   icof => iwrk_2d_1
+      !
       LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
-
-      !! * Local variables
-      INTEGER ::   ji, jj, jn      ! dummy loop indices
-      INTEGER ::   inum            ! temporary logical unit
-      INTEGER ::   iim, ijm
-      INTEGER ::   ifreq, il1, il2, ij, ii
+      !
+      INTEGER  ::   ji, jj, jn   ! dummy loop indices
+      INTEGER  ::   inum, iim, ijm            ! local integers
+      INTEGER  ::   ifreq, il1, il2, ij, ii
+      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk
+      CHARACTER (len=15) ::   clexp
       INTEGER, DIMENSION(jpidta,jpidta) ::   idata
-      INTEGER, DIMENSION(jpi   ,jpj   ) ::   icof
-
-      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk
-
-      CHARACTER (len=15) ::   clexp
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( iwrk_in_use(2, 1) )THEN
+         CALL ctl_stop('ldf_dyn_c2d_orca: requested workspace array is unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
       IF(lwp) WRITE(numout,*) '~~~~~~  --'
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '        orca ocean model'
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '        orca ocean configuration'
 
 #if defined key_antarctic
@@ -288,5 +281,8 @@
       ENDIF
 
+      IF( iwrk_not_released(2, 1) )   CALL ctl_stop('ldf_dyn_c2d_orca: failed to release workspace array')
+      !
    END SUBROUTINE ldf_dyn_c2d_orca
+
 
    SUBROUTINE ldf_dyn_c2d_orca_R1( ld_print )
@@ -305,29 +301,27 @@
       !!
       !!----------------------------------------------------------------------
-      !! * Modules used
-      USE ldftra_oce, ONLY : aht0
-
-      !! * Arguments
+      USE ldftra_oce, ONLY:   aht0
+      USE wrk_nemo  , ONLY:   iwrk_in_use, iwrk_not_released
+      USE wrk_nemo  , ONLY:   icof => iwrk_2d_1
+      !
       LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
-
-      !! * Local variables
+      !
       INTEGER ::   ji, jj, jn      ! dummy loop indices
       INTEGER ::   inum            ! temporary logical unit
       INTEGER ::   iim, ijm
       INTEGER ::   ifreq, il1, il2, ij, ii
+      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk, zam20s
+      CHARACTER (len=15) ::   clexp
       INTEGER, DIMENSION(jpidta,jpidta) ::   idata
-      INTEGER, DIMENSION(jpi   ,jpj   ) ::   icof
-
-      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk, zam20s
-
-      CHARACTER (len=15) ::   clexp
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('ldf_dyn_c2d_orca_R1: requested workspace array is unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
       IF(lwp) WRITE(numout,*) '~~~~~~  --'
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '        orca_r1 ocean model'
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '        orca_r1 configuration'
 
 #if defined key_antarctic
@@ -457,3 +451,5 @@
       ENDIF
 
+      IF( iwrk_not_released(2, 1) )   CALL ctl_stop('ldf_dyn_c2d_orca_R1: failed to release workspace array')
+      !
    END SUBROUTINE ldf_dyn_c2d_orca_R1
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c3d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c3d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c3d.h90	(revision 2715)
@@ -26,20 +26,20 @@
       !!       ??? explanation of the default is missing
       !!----------------------------------------------------------------------
-      USE ldftra_oce, ONLY : aht0
-      !!
-      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
-      !!
-      INTEGER  ::   ji, jj, jk      ! dummy loop indices
-      REAL(wp) ::   &
-         zr = 0.2 ,   &  ! maximum of the reduction factor at the bottom ocean
-         !               ! ( 0 < zr < 1 )
-         zh = 500.,   &  ! depth of at which start the reduction ( > dept(1) )
-         zd_max   ,   &  ! maximum grid spacing over the global domain
-         za00, zc, zd    ! temporary scalars
-      REAL(wp) ::        &
-         zetmax, zefmax, &
-         zeumax, zevmax   
-      REAL(wp), DIMENSION(jpk) ::   zcoef   ! temporary workspace
-      !!----------------------------------------------------------------------
+      USE ldftra_oce, ONLY :   aht0
+      USE wrk_nemo  , ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo  , ONLY:   zcoef => wrk_1d_2
+      !!
+      LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
+      !!
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zr = 0.2     ! maximum of the reduction factor at the bottom ocean ( 0 < zr < 1 )
+      REAL(wp) ::   zh = 500.    ! depth of at which start the reduction ( > dept(1) )
+      REAL(wp) ::   zd_max       ! maximum grid spacing over the global domain
+      REAL(wp) ::   za00, zc, zd, zetmax, zefmax, zeumax, zevmax   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(1,2) ) THEN
+         CALL ctl_stop('ldf_dyn_c3d: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
@@ -181,5 +181,7 @@
          ENDIF
       ENDIF
-
+      !
+      IF( wrk_not_released(1,2) )   CALL ctl_stop('ldf_dyn_c3d: failed to release workspace array')
+      !
    END SUBROUTINE ldf_dyn_c3d
 
@@ -193,32 +195,31 @@
       !! ** Method  :   blah blah blah ....
       !!----------------------------------------------------------------------
-      USE ldftra_oce, ONLY : aht0
-      !!
-      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
+      USE ldftra_oce, ONLY:   aht0
+      USE wrk_nemo  , ONLY:   wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE wrk_nemo  , ONLY:   icof  => iwrk_2d_1
+      USE wrk_nemo  , ONLY:   zahm0 =>  wrk_2d_1
+      USE wrk_nemo  , ONLY:   zcoef =>  wrk_1d_1
+      !!
+      LOGICAL, INTENT(in) ::   ld_print   ! If true, output arrays on numout
       !!
       INTEGER ::   ji, jj, jk, jn      ! dummy loop indices
-      INTEGER ::   ii0, ii1, ij0, ij1  ! temporary integers
-      INTEGER ::   inum                ! temporary logical unit
-      INTEGER ::   iim, ijm
+      INTEGER ::   ii0, ii1, ij0, ij1  ! local integers
+      INTEGER ::   inum, iim, ijm      ! 
       INTEGER ::   ifreq, il1, il2, ij, ii
       INTEGER, DIMENSION(jpidta, jpjdta) ::   idata
-      INTEGER, DIMENSION(jpi   , jpj   ) ::   icof
-
-      REAL(wp) ::   &
-         zahmeq, zcoff, zcoft, zmsk,   & ! ???
-         zemax, zemin, zeref, zahmm
-      REAL(wp), DIMENSION(jpi,jpj) ::   zahm0
-      REAL(wp), DIMENSION(jpk) ::   zcoef
-
+
+      REAL(wp) ::   zahmeq, zcoff, zcoft, zmsk   ! local scalars
+      REAL(wp) ::   zemax , zemin, zeref, zahmm
       CHARACTER (len=15) ::   clexp
       !!----------------------------------------------------------------------
+
+      IF( iwrk_in_use(2,1) .OR. wrk_in_use(2,1) .OR. wrk_in_use(1,1) ) THEN
+         CALL ctl_stop('ldf_dyn_c3d_orca: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'ldfdyn_c3d_orca : 3D eddy viscosity coefficient'
       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~'
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '        orca R1, R2 or R4 ocean model'
-      IF(lwp) WRITE(numout,*) '  reduced in the surface Eq. strip '
-      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) '        orca R1, R2 or R4 configuration: reduced in the surface Eq. strip '
 
       ! Read 2d integer array to specify western boundary increase in the
@@ -457,3 +458,7 @@
       ENDIF
 
+      IF( iwrk_not_released(2,1) .OR.   &
+           wrk_not_released(2,1) .OR.   &
+           wrk_not_released(1,1)   ) CALL ctl_stop('ldf_dyn_c3d_orca: failed to release workspace arrays')
+      !
    END SUBROUTINE ldf_dyn_c3d_orca
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_oce.F90	(revision 2715)
@@ -6,5 +6,7 @@
    !! History :  1.0  ! 2002-11  (G. Madec)  F90: Free form and module
    !!----------------------------------------------------------------------
-   USE par_oce      ! ocean parameters
+   USE par_oce        ! ocean parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -20,20 +22,40 @@
    REAL(wp), PUBLIC ::   rn_ahmb_0       =     0._wp   !: lateral laplacian background eddy viscosity (m2/s)
    REAL(wp), PUBLIC ::   rn_ahm_0_blp    =     0._wp   !: lateral bilaplacian eddy viscosity (m4/s)
-   REAL(wp), PUBLIC ::   ahm0, ahmb0, ahm0_blp         ! OLD namelist names
+   REAL(wp), PUBLIC ::   ahm0, ahmb0, ahm0_blp         !: OLD namelist names
 
+   !                                                                                  !!! eddy coeff. at U-,V-,W-pts [m2/s]
 #if defined key_dynldf_c3d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   ahm1, ahm2, ahm3, ahm4  ! ** 3D coefficients **
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahm1, ahm2, ahm3, ahm4   !: ** 3D coefficients **
 #elif defined key_dynldf_c2d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ahm1, ahm2, ahm3, ahm4  ! ** 2D coefficients **
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ahm1, ahm2, ahm3, ahm4   !: ** 2D coefficients **
 #elif defined key_dynldf_c1d
-   REAL(wp), PUBLIC, DIMENSION(jpk)         ::   ahm1, ahm2, ahm3, ahm4  ! ** 2D coefficients **
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   ahm1, ahm2, ahm3, ahm4   !: ** 2D coefficients **
 #else
-   REAL(wp), PUBLIC                         ::   ahm1, ahm2, ahm3, ahm4  ! ** 0D coefficients **
+   REAL(wp), PUBLIC                                      ::   ahm1, ahm2, ahm3, ahm4   !: ** 0D coefficients **
 #endif
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION ldfdyn_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION ldfdyn_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      ldfdyn_oce_alloc = 0
+#if defined key_dynldf_c3d
+      ALLOCATE( ahm1(jpi,jpj,jpk) , ahm2(jpi,jpj,jpk) , ahm3(jpi,jpj,jpk) , ahm4(jpi,jpj,jpk) , STAT=ldfdyn_oce_alloc )
+#elif defined key_dynldf_c2d
+      ALLOCATE( ahm1(jpi,jpj    ) , ahm2(jpi,jpj    ) , ahm3(jpi,jpj    ) , ahm4(jpi,jpj    ) , STAT=ldfdyn_oce_alloc )
+#elif defined key_dynldf_c1d
+      ALLOCATE( ahm1(        jpk) , ahm2(        jpk) , ahm3(        jpk) , ahm4(        jpk) , STAT=ldfdyn_oce_alloc )
+#endif
+      IF( ldfdyn_oce_alloc /= 0 )   CALL ctl_warn('ldfdyn_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION ldfdyn_oce_alloc
+
    !!======================================================================
 END MODULE ldfdyn_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90	(revision 2715)
@@ -53,11 +53,18 @@
       !!             - wslpi, wslpj : i- and j-slopes of neutral surfaces at w-points. 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zn  => wrk_2d_1 , zah   => wrk_2d_2   ! 2D workspace
+      USE wrk_nemo, ONLY:   zhw => wrk_2d_3 , zross => wrk_2d_4
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step inedx
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zfw, ze3w, zn2, zf20, zaht, zaht_min      ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zn, zah, zhw, zross   ! 2D workspace
       !!----------------------------------------------------------------------
       
+      IF( wrk_in_use(2, 1,2,3,4) ) THEN
+         CALL ctl_stop('ldf_eiv: requested workspace arrays are unavailable.')   ;   RETURN
+      ENDIF
+
       IF( kt == nit000 ) THEN
          IF(lwp) WRITE(numout,*)
@@ -235,4 +242,6 @@
       CALL iom_put( "aht2d"    , ahtw )   ! lateral eddy diffusivity
       CALL iom_put( "aht2d_eiv", aeiw )   ! EIV lateral eddy diffusivity
+      !  
+      IF( wrk_not_released(2, 1,2,3,4) )   CALL ctl_stop('ldf_eiv: failed to release workspace arrays')
       !
    END SUBROUTINE ldf_eiv
@@ -244,4 +253,5 @@
 CONTAINS
    SUBROUTINE ldf_eiv( kt )       ! Empty routine
+      INTEGER :: kt
       WRITE(*,*) 'ldf_eiv: You should not have seen this print! error?', kt
    END SUBROUTINE ldf_eiv
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 2715)
@@ -41,17 +41,25 @@
    LOGICAL , PUBLIC, PARAMETER ::   lk_ldfslp = .TRUE.     !: slopes flag
    !                                                                             !! Madec operator
-   REAL(wp), PUBLIC, DIMENSION(:,:,:)    , ALLOCATABLE ::   uslp, wslpi          !: i_slope at U- and W-points
-   REAL(wp), PUBLIC, DIMENSION(:,:,:)    , ALLOCATABLE ::   vslp, wslpj          !: j-slope at V- and W-points
-   !                                                                             !! Griffies operator
-   REAL(wp), PUBLIC, DIMENSION(:,:,:)    , ALLOCATABLE ::   wslp2                !: wslp**2 from Griffies quarter cells
-   REAL(wp), PUBLIC, DIMENSION(:,:,:,:,:), ALLOCATABLE ::   triadi_g, triadj_g   !: skew flux  slopes relative to geopotentials 
-   REAL(wp), PUBLIC, DIMENSION(:,:,:,:,:), ALLOCATABLE ::   triadi  , triadj     !: isoneutral slopes relative to model-coordinate
+   !  Arrays allocated in ldf_slp_init() routine once we know whether we're using the Griffies or Madec operator
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)     ::   uslp, wslpi          !: i_slope at U- and W-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)     ::   vslp, wslpj          !: j-slope at V- and W-points
+   !                                                                !! Griffies operator
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)     ::   wslp2                !: wslp**2 from Griffies quarter cells
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) ::   triadi_g, triadj_g   !: skew flux  slopes relative to geopotentials 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) ::   triadi  , triadj     !: isoneutral slopes relative to model-coordinate
 
    !                                                              !! Madec operator
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   omlmask           ! mask of the surface mixed layer at T-pt
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   uslpml, wslpiml   ! i_slope at U- and W-points just below the mixed layer
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   vslpml, wslpjml   ! j_slope at V- and W-points just below the mixed layer
+   !  Arrays allocated in ldf_slp_init() routine once we know whether we're using the Griffies or Madec operator
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   omlmask           ! mask of the surface mixed layer at T-pt
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   uslpml, wslpiml   ! i_slope at U- and W-points just below the mixed layer
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   vslpml, wslpjml   ! j_slope at V- and W-points just below the mixed layer
 
    REAL(wp) ::   repsln = 1.e-25_wp       ! tiny value used as minium of di(rho), dj(rho) and dk(rho)
+
+   ! Workspace arrays for ldf_slp_grif. These could be replaced by several 3D and 2D workspace
+   ! arrays from the wrk_nemo module with a bit of code re-writing. The 4D workspace 
+   ! arrays can't be used here because of the zero-indexing of some of the ranks. ARPDBG.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   zdzrho , zdyrho, zdxrho     ! Horizontal and vertical density gradients
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   zti_mlb, ztj_mlb            ! for Griffies operator only
 
    !! * Substitutions
@@ -61,9 +69,24 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION ldf_slp_alloc()
+      !!----------------------------------------------------------------------
+      !!              ***  FUNCTION ldf_slp_alloc  ***
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( zdxrho (jpi,jpj,jpk,0:1) , zti_mlb(jpi,jpj,0:1,0:1) ,     &
+         &      zdyrho (jpi,jpj,jpk,0:1) , ztj_mlb(jpi,jpj,0:1,0:1) ,     &
+         &      zdzrho (jpi,jpj,jpk,0:1)                            , STAT=ldf_slp_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( ldf_slp_alloc )
+      IF( ldf_slp_alloc /= 0 )   CALL ctl_warn('ldf_slp_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION ldf_slp_alloc
+
 
    SUBROUTINE ldf_slp( kt, prd, pn2 )
@@ -92,12 +115,12 @@
       !!               of now neutral surfaces at u-, w- and v- w-points, resp.
       !!----------------------------------------------------------------------
-      USE oce , zgru  => ua   ! use ua as workspace
-      USE oce , zgrv  => va   ! use va as workspace
-      USE oce , zww   => ta   ! use ta as workspace
-      USE oce , zwz   => sa   ! use sa as workspace
-      !!
-      INTEGER , INTENT(in)                         ::   kt    ! ocean time-step index
-      REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) ::   prd   ! in situ density
-      REAL(wp), INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pn2   ! Brunt-Vaisala frequency (locally ref.)
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zgru => ua       , zww => va   ! (ua,va) used as workspace
+      USE oce     , ONLY:   zgrv => ta       , zwz => sa   ! (ta,sa) used as workspace
+      USE wrk_nemo, ONLY:   zdzr => wrk_3d_1               ! 3D workspace
+      !!
+      INTEGER , INTENT(in)                   ::   kt    ! ocean time-step index
+      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   prd   ! in situ density
+      REAL(wp), INTENT(in), DIMENSION(:,:,:) ::   pn2   ! Brunt-Vaisala frequency (locally ref.)
       !!
       INTEGER  ::   ji , jj , jk    ! dummy loop indices
@@ -108,7 +131,10 @@
       REAL(wp) ::   zcj, zfj, zav, zbv, zaj, zbj   !   -      -
       REAL(wp) ::   zck, zfk,      zbw             !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdzr   ! 3D workspace
-      !!----------------------------------------------------------------------
-      
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('ldf_slp: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
+
       zeps   =  1.e-20_wp        !==   Local constant initialization   ==!
       z1_16  =  1.0_wp / 16._wp
@@ -342,5 +368,4 @@
       ENDIF
 
-      
       ! IV. Lateral boundary conditions 
       ! ===============================
@@ -354,4 +379,6 @@
       ENDIF
       !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('ldf_slp: failed to release workspace arrays')
+      !
    END SUBROUTINE ldf_slp
    
@@ -371,24 +398,25 @@
       !!             - wslp2              squared slope of neutral surfaces at w-points.
       !!----------------------------------------------------------------------
-      USE oce,   zdit  => ua   ! use ua as workspace
-      USE oce,   zdis  => va   ! use va as workspace
-      USE oce,   zdjt  => ta   ! use ta as workspace
-      USE oce,   zdjs  => sa   ! use sa as workspace
-      !!
-      INTEGER, INTENT( in ) ::   kt         ! ocean time-step index
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zdit    => ua       , zdis   => va         ! (ua,va) used as workspace
+      USE oce     , ONLY:   zdjt    => ta       , zdjs   => sa         ! (ta,sa) used as workspace
+      USE wrk_nemo, ONLY:   zdkt    => wrk_3d_2 , zdks   => wrk_3d_3   ! 3D workspace
+      USE wrk_nemo, ONLY:   zalpha  => wrk_3d_4 , zbeta => wrk_3d_5    ! alpha, beta at T points, at depth fsgdept
+      USE wrk_nemo, ONLY:   z1_mlbw => wrk_2d_1
+      !
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
       INTEGER  ::   ji, jj, jk, jl, ip, jp, kp  ! dummy loop indices
-      INTEGER  ::   iku, ikv                ! temporary integer
+      INTEGER  ::   iku, ikv                                  ! local integer
       REAL(wp) ::   zfacti, zfactj, zatempw,zatempu,zatempv   ! local scalars
-      REAL(wp) ::   zbu, zbv, zbti, zbtj
+      REAL(wp) ::   zbu, zbv, zbti, zbtj                      !   -      -
       REAL(wp) ::   zdxrho_raw, zti_coord, zti_raw, zti_lim, zti_lim2, zti_g_raw, zti_g_lim
       REAL(wp) ::   zdyrho_raw, ztj_coord, ztj_raw, ztj_lim, ztj_lim2, ztj_g_raw, ztj_g_lim
       REAL(wp) ::   zdzrho_raw
-      REAL(wp), DIMENSION(jpi,jpj,jpk,0:1) ::   zdzrho, zdyrho, zdxrho     ! Horizontal and vertical density gradients
-      REAL(wp), DIMENSION(jpi,jpj,0:1,0:1) ::   zti_mlb, ztj_mlb
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     ::   zdkt, zdks
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     ::   zalpha, zbeta       ! alpha, beta at T points, at depth fsgdept
-      REAL(wp), DIMENSION(jpi,jpj)         ::   z1_mlbw
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 2,3,4,5) .OR. wrk_in_use(2, 1) )THEN
+         CALL ctl_stop('ldf_slp_grif: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
 
       !--------------------------------!
@@ -572,4 +600,7 @@
       CALL lbc_lnk( wslp2, 'W', 1. )      ! lateral boundary confition on wslp2 only   ==>>> gm : necessary ? to be checked
       !
+      IF( wrk_not_released(3, 2,3,4,5) .OR.   &
+          wrk_not_released(2, 1)       )   CALL ctl_stop('ldf_slp_grif: failed to release workspace arrays')
+      !
    END SUBROUTINE ldf_slp_grif
 
@@ -591,8 +622,8 @@
       !!                omlmask         :  mixed layer mask
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   prd            ! in situ density
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   pn2            ! Brunt-Vaisala frequency (locally ref.)
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   p_gru, p_grv   ! i- & j-gradient of density (u- & v-pts)
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   p_dzr          ! z-gradient of density      (T-point)
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   prd            ! in situ density
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   pn2            ! Brunt-Vaisala frequency (locally ref.)
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   p_gru, p_grv   ! i- & j-gradient of density (u- & v-pts)
+      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   p_dzr          ! z-gradient of density      (T-point)
       !!
       INTEGER  ::   ji , jj , jk         ! dummy loop indices
@@ -704,5 +735,5 @@
       !!
       !! ** Method  :   read the nammbf namelist and check the parameter 
-      !!      values called by tra_dmp at the first timestep (nit000)
+      !!              values called by tra_dmp at the first timestep (nit000)
       !!----------------------------------------------------------------------
       INTEGER ::   ji, jj, jk   ! dummy loop indices
@@ -719,20 +750,16 @@
          ALLOCATE( triadi_g(jpi,jpj,jpk,0:1,0:1) , triadj_g(jpi,jpj,jpk,0:1,0:1) , wslp2(jpi,jpj,jpk) , STAT=ierr )
          ALLOCATE( triadi  (jpi,jpj,jpk,0:1,0:1) , triadj  (jpi,jpj,jpk,0:1,0:1)                      , STAT=ierr )
-         IF( ierr > 0 ) THEN
-            CALL ctl_stop( 'ldf_slp_init : unable to allocate Griffies operator slope ' )   ;   RETURN
-         ENDIF
+         IF( ierr > 0             )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate Griffies operator slope' )
+         IF( ldf_slp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate workspace arrays' )
          !
          IF( ln_dynldf_iso )   CALL ctl_stop( 'ldf_slp_init: Griffies operator on momentum not supported' )
          !
-         IF( ( ln_traldf_hor .AND. ln_dynldf_hor ) .AND. ln_sco )   &
-            &     CALL ctl_stop( 'ldf_slp_init: horizontal Griffies operator ',   &
-            &                                              'in s-coordinate not supported' )
+         IF( ( ln_traldf_hor .OR. ln_dynldf_hor ) .AND. ln_sco )   &
+            CALL ctl_stop( 'ldf_slp_init: horizontal Griffies operator in s-coordinate not supported' )
          !
       ELSE                             ! Madec operator : slopes at u-, v-, and w-points
          ALLOCATE( uslp(jpi,jpj,jpk) , vslp(jpi,jpj,jpk) , wslpi(jpi,jpj,jpk) , wslpj(jpi,jpj,jpk) ,                &
             &   omlmask(jpi,jpj,jpk) , uslpml(jpi,jpj)   , vslpml(jpi,jpj)    , wslpiml(jpi,jpj)   , wslpjml(jpi,jpj) , STAT=ierr )
-         IF( ierr > 0 ) THEN
-            CALL ctl_stop( 'ldf_slp_init : unable to allocate Madec operator slope ' )   ;   RETURN
-         ENDIF
+         IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'ldf_slp_init : unable to allocate Madec operator slope ' )
 
          ! Direction of lateral diffusion (tracers and/or momentum)
@@ -745,7 +772,5 @@
 !!gm I no longer understand this.....
          IF( (ln_traldf_hor .OR. ln_dynldf_hor) .AND. .NOT. (lk_vvl .AND. ln_rstart) ) THEN
-            IF(lwp) THEN
-               WRITE(numout,*) '          Horizontal mixing in s-coordinate: slope = slope of s-surfaces'
-            ENDIF
+            IF(lwp)   WRITE(numout,*) '          Horizontal mixing in s-coordinate: slope = slope of s-surfaces'
 
             ! geopotential diffusion in s-coordinates on tracers and/or momentum
@@ -765,9 +790,9 @@
                END DO
             END DO
-            ! Lateral boundary conditions on the slopes
-            CALL lbc_lnk( uslp , 'U', -1. )      ;      CALL lbc_lnk( vslp , 'V', -1. )
-            CALL lbc_lnk( wslpi, 'W', -1. )      ;      CALL lbc_lnk( wslpj, 'W', -1. )
+            CALL lbc_lnk( uslp , 'U', -1. )   ;   CALL lbc_lnk( vslp , 'V', -1. )      ! Lateral boundary conditions
+            CALL lbc_lnk( wslpi, 'W', -1. )   ;   CALL lbc_lnk( wslpj, 'W', -1. )
          ENDIF
-      ENDIF      !
+      ENDIF
+      !
    END SUBROUTINE ldf_slp_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 2715)
@@ -36,7 +36,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c1d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c1d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c1d.h90	(revision 2715)
@@ -6,5 +6,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -28,14 +28,10 @@
       !!         always harmonic      : aeiu = aeiv defined at T-level
       !!				  aeiw defined at w-level
-      !!
       !!----------------------------------------------------------------------
-      !! * Arguments
-      LOGICAL, INTENT (in) :: ld_print   ! If true, print arrays in numout
-
-      !! * Local variables
-      INTEGER ::   jk                  ! dummy loop indices
-      REAL(wp) ::   &
-         zkah, zahr, za00 , za01,   &  ! temporary scalars
-         zahf, zahs, zahtf, zahts
+      LOGICAL, INTENT (in) ::   ld_print   ! If true, print arrays in numout
+      !
+      INTEGER  ::   jk   ! dummy loop indices
+      REAL(wp) ::   zkah, zahr, za00 , za01    ! local scalars
+      REAL(wp) ::   zahf, zahs, zahtf, zahts   !   -      -
       !!----------------------------------------------------------------------
 
@@ -130,4 +126,4 @@
       ENDIF
 #endif
-
+      !
    END SUBROUTINE ldf_tra_c1d
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c2d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c2d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c2d.h90	(revision 2715)
@@ -25,16 +25,12 @@
       !!       eddy induced velocity
       !!           always harmonic   : aeiu, aeiv, aeiw defined at u-, v-, w-pts
-      !!
       !!----------------------------------------------------------------------
-      !! * Arguments
-      LOGICAL, INTENT (in) :: ld_print   ! If true, print arrays in numout
-
-      !! * Local variables
-      INTEGER ::   ji, jj                  ! dummy loop indices
+      LOGICAL, INTENT (in) ::   ld_print   ! If true, print arrays in numout
+      !
+      INTEGER ::   ji, jj   ! dummy loop indices
 # if defined key_orca_r4
       INTEGER :: i1, i2, j1, j2
 # endif
       REAL(wp) ::   za00, zd_max, zeumax, zevmax, zetmax
-      
       !!----------------------------------------------------------------------
 
@@ -43,10 +39,8 @@
          IF(lwp) WRITE(numout,*) ' ldf_tra_c2d : 2D eddy diffusivity and eddy'
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~   --  induced velocity coefficients'
-         IF(lwp) WRITE(numout,*)
       ELSE
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) ' ldf_tra2d : 2D eddy diffusivity coefficient'
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~   --'
-         IF(lwp) WRITE(numout,*)
       ENDIF
 
@@ -57,7 +51,7 @@
       ! ==================
       IF( ln_traldf_lap ) THEN
-  
+         !
          za00 = aht0 / zd_max
-  
+         !
          DO jj = 1, jpj 
             DO ji = 1, jpi 
@@ -167,6 +161,5 @@
          CALL prihre(aeiw,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
       ENDIF
-
 # endif
-
+      !
    END SUBROUTINE ldf_tra_c2d
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c3d.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c3d.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_c3d.h90	(revision 2715)
@@ -6,5 +6,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -29,12 +29,8 @@
       !!       eddy induced velocity
       !!         always harmonic   : aeiu, aeiv, aeiw defined at u-, v-, w-pts
-      !!
       !!----------------------------------------------------------------------
-      !! * Modules used
       USE ioipsl
-
-      !! * Arguments
-      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
-
+      !
+      LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
       !!----------------------------------------------------------------------
 
@@ -44,5 +40,4 @@
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~   --  '
          IF(lwp) WRITE(numout,*) '               Coefficients set to constant'
-         IF(lwp) WRITE(numout,*)
       ELSE
          IF(lwp) WRITE(numout,*)
@@ -50,5 +45,4 @@
          IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~   -- '
          IF(lwp) WRITE(numout,*) '               Coefficients set to constant'
-         IF(lwp) WRITE(numout,*)
       ENDIF
 
@@ -127,4 +121,4 @@
          CALL prihre(aeiw(:,:,1),jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
       ENDIF
-
-END SUBROUTINE ldf_tra_c3d
+      !
+   END SUBROUTINE ldf_tra_c3d
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra_oce.F90	(revision 2715)
@@ -4,10 +4,14 @@
    !! Ocean physics :  lateral tracer mixing coefficient defined in memory 
    !!=====================================================================
-   !! History :  9.0  !  02-11  (G. Madec)  Original code
+   !! History :  9.0  !  2002-11  (G. Madec)  Original code
    !!----------------------------------------------------------------------
-   USE par_oce         ! ocean parameters
+   USE par_oce        ! ocean parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC ldftra_oce_alloc ! called by nemo_init->nemo_alloc, nemogcm.F90
 
    !!----------------------------------------------------------------------
@@ -32,13 +36,12 @@
 
 #if defined key_traldf_c3d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-, U-, V-, W-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ahtt, ahtu, ahtv, ahtw   !: ** 3D coefficients ** at T-,U-,V-,W-points
 #elif defined key_traldf_c2d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-, U-, V-, W-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ahtt, ahtu, ahtv, ahtw   !: ** 2D coefficients ** at T-,U-,V-,W-points
 #elif defined key_traldf_c1d
-   REAL(wp), PUBLIC, DIMENSION(jpk)         ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-, U-, V-, W-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   ahtt, ahtu, ahtv, ahtw   !: ** 1D coefficients ** at T-,U-,V-,W-points
 #else
-   REAL(wp), PUBLIC                         ::   ahtt, ahtu, ahtv, ahtw   !: ** 0D coefficients ** at T-, U-, V-, W-points
+   REAL(wp), PUBLIC                                      ::   ahtt, ahtu, ahtv, ahtw   !: ** 0D coefficients ** at T-,U-,V-,W-points
 #endif
-
 
 #if defined key_traldf_eiv
@@ -47,16 +50,17 @@
    !!----------------------------------------------------------------------
    LOGICAL, PUBLIC, PARAMETER               ::   lk_traldf_eiv   = .TRUE.   !: eddy induced velocity flag
-      
+   
+   !                                                                              !!! eddy coefficients at U-, V-, W-points  [m2/s]
 # if defined key_traldf_c3d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   aeiu, aeiv, aeiw  !: ** 3D coefficients ** at U-, V-, W-points  [m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aeiu , aeiv , aeiw   !: ** 3D coefficients **
 # elif defined key_traldf_c2d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   aeiu, aeiv, aeiw  !: ** 2D coefficients ** at U-, V-, W-points  [m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   aeiu , aeiv , aeiw   !: ** 2D coefficients **
 # elif defined key_traldf_c1d
-   REAL(wp), PUBLIC, DIMENSION(jpk)         ::   aeiu, aeiv, aeiw  !: ** 1D coefficients ** at U-, V-, W-points  [m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   aeiu , aeiv , aeiw   !: ** 1D coefficients **
 # else
-   REAL(wp), PUBLIC                         ::   aeiu, aeiv, aeiw  !: ** 0D coefficients ** at U-, V-, W-points  [m2/s]
+   REAL(wp), PUBLIC                                      ::   aeiu , aeiv , aeiw   !: ** 0D coefficients **
 # endif
 # if defined key_diaeiv
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   u_eiv, v_eiv, w_eiv   !: eddy induced velocity [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   u_eiv, v_eiv, w_eiv   !: eddy induced velocity [m/s]
 # endif
 
@@ -73,4 +77,40 @@
    !! $Id$ 
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION ldftra_oce_alloc()
+     !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION ldftra_oce_alloc  ***
+     !!----------------------------------------------------------------------
+     INTEGER, DIMENSION(3) :: ierr
+     !!----------------------------------------------------------------------
+     ierr(:) = 0
+
+#if defined key_traldf_c3d
+      ALLOCATE( ahtt(jpi,jpj,jpk) , ahtu(jpi,jpj,jpk) , ahtv(jpi,jpj,jpk) , ahtw(jpi,jpj,jpk) , STAT=ierr(1) )
+#elif defined key_traldf_c2d
+      ALLOCATE( ahtt(jpi,jpj    ) , ahtu(jpi,jpj    ) , ahtv(jpi,jpj    ) , ahtw(jpi,jpj    ) , STAT=ierr(1) )
+#elif defined key_traldf_c1d
+      ALLOCATE( ahtt(        jpk) , ahtu(        jpk) , ahtv(        jpk) , ahtw(        jpk) , STAT=ierr(1) )
+#endif
+      !
+#if defined key_traldf_eiv
+# if defined key_traldf_c3d
+      ALLOCATE( aeiu(jpi,jpj,jpk) , aeiv(jpi,jpj,jpk) , aeiw(jpi,jpj,jpk) , STAT=ierr(2) )
+# elif defined key_traldf_c2d
+      ALLOCATE( aeiu(jpi,jpj    ) , aeiv(jpi,jpj    ) , aeiw(jpi,jpj    ) , STAT=ierr(2) )
+# elif defined key_traldf_c1d
+      ALLOCATE( aeiu(        jpk) , aeiv(        jpk) , aeiw(        jpk) , STAT=ierr(2) )
+# endif
+# if defined key_diaeiv
+      ALLOCATE( u_eiv(jpi,jpj,jpk), v_eiv(jpi,jpj,jpk), w_eiv(jpi,jpj,jpk), STAT=ierr(3))
+# endif
+#endif
+      ldftra_oce_alloc = MAXVAL( ierr )
+      IF( ldftra_oce_alloc /= 0 )   CALL ctl_warn('ldftra_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION ldftra_oce_alloc
+
    !!=====================================================================
 END MODULE ldftra_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_oce.F90	(revision 2715)
@@ -4,21 +4,18 @@
    !! Open Boundary Cond. :   define related variables
    !!==============================================================================
+   !! history :  OPA  ! 1991-01 (CLIPPER)  Original code 
+   !!   NEMO     1.0  ! 2002-02 (C. Talandier)  modules, F90
+   !!----------------------------------------------------------------------
+#if defined key_obc
    !!----------------------------------------------------------------------
    !!   'key_obc' :                                 Open Boundary Condition
    !!----------------------------------------------------------------------
-   !! history :
-   !!  8.0   01/91   (CLIPPER)  Original code 
-   !!  8.5   06/02   (C. Talandier)  modules
-   !!        06/04   (F. Durand) ORCA2_ZIND config
-   !!                 
-   !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_oce         ! ocean parameters
    USE obc_par         ! open boundary condition parameters
 
-#if defined key_obc
-
    IMPLICIT NONE
    PUBLIC
+   
+   PUBLIC   obc_oce_alloc   ! called by obcini.F90 module
 
    !!----------------------------------------------------------------------
@@ -26,5 +23,5 @@
    !!----------------------------------------------------------------------
    !
-   !                                  !!* Namelist namobc: open boundary condition *
+   !                                            !!* Namelist namobc: open boundary condition *
    INTEGER           ::   nn_obcdta   = 0        !:  = 0 use the initial state as obc data
    !                                             !   = 1 read obc data in obcxxx.dta files
@@ -63,13 +60,12 @@
    !!General variables for open boundaries:
    !!--------------------------------------
-   LOGICAL ::              &  !:
-      lfbceast, lfbcwest,  &  !: logical flag for a fixed East and West open boundaries       
-      lfbcnorth, lfbcsouth    !: logical flag for a fixed North and South open boundaries       
-      !                       !  These logical flags are set to 'true' if damping time 
-      !                       !  scale are set to 0 in the namelist, for both inflow and outflow).
+   LOGICAL ::   lfbceast, lfbcwest      !: logical flag for a fixed East and West open boundaries       
+   LOGICAL ::   lfbcnorth, lfbcsouth    !: logical flag for a fixed North and South open boundaries       
+   !                                    !  These logical flags are set to 'true' if damping time 
+   !                                    !  scale are set to 0 in the namelist, for both inflow and outflow).
 
    REAL(wp), PUBLIC ::   obcsurftot       !: Total lateral surface of open boundaries
    
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: &  !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: &  !:
       obctmsk,            &  !: mask array identical to tmask, execpt along OBC where it is set to 0
       !                      !  it used to calculate the cumulate flux E-P in the obcvol.F90 routine
@@ -87,9 +83,9 @@
    INTEGER ::   nje1m2, nje0m1    !: do loop index in mpp case for jpjefm1-1,jpjed
 
-   REAL(wp), DIMENSION(jpj) ::   &  !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   &  !:
       sshfoe,           & !: now climatology of the east boundary sea surface height
       ubtfoe,vbtfoe       !: now climatology of the east boundary barotropic transport
      
-   REAL(wp), DIMENSION(jpj,jpk) ::   &  !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &  !:
       ufoe, vfoe,       & !: now climatology of the east boundary velocities 
       tfoe, sfoe,       & !: now climatology of the east boundary temperature and salinity
@@ -97,5 +93,5 @@
       !                   ! in the obcdyn.F90 routine
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   sshfoe_b      !: east boundary ssh correction averaged over the barotropic loop
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshfoe_b   !: east boundary ssh correction averaged over the barotropic loop
       !                                            !  (if Flather's algoritm applied at open boundary)
 
@@ -103,12 +99,12 @@
    !! Arrays for radiative East OBC: 
    !!-------------------------------
-   REAL(wp), DIMENSION(jpj,jpk,3,3) ::   uebnd, vebnd      !: baroclinic u & v component of the velocity over 3 rows 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   uebnd, vebnd      !: baroclinic u & v component of the velocity over 3 rows 
       !                                                    !  and 3 time step (now, before, and before before)
-   REAL(wp), DIMENSION(jpj,jpk,2,2) ::   tebnd, sebnd      !: East boundary temperature and salinity over 2 rows 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tebnd, sebnd      !: East boundary temperature and salinity over 2 rows 
       !                                                    !  and 2 time step (now and before)
-   REAL(wp), DIMENSION(jpj,jpk) ::   u_cxebnd, v_cxebnd    !: Zonal component of the phase speed ratio computed with 
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   u_cxebnd, v_cxebnd    !: Zonal component of the phase speed ratio computed with 
       !                                                    !  radiation of u and v velocity (respectively) at the 
       !                                                    !  east open boundary (u_cxebnd = cx rdt )
-   REAL(wp), DIMENSION(jpj,jpk) ::   uemsk, vemsk, temsk   !: 2D mask for the East OB
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   uemsk, vemsk, temsk   !: 2D mask for the East OB
 
    ! Note that those arrays are optimized for mpp case 
@@ -124,9 +120,9 @@
    INTEGER ::   njw1m2, njw0m1     !: do loop index in mpp case for jpjwfm2,jpjwd
 
-   REAL(wp), DIMENSION(jpj) ::   &  !:
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:) ::   &  !:
       sshfow,           & !: now climatology of the west boundary sea surface height
       ubtfow,vbtfow       !: now climatology of the west boundary barotropic transport
 
-   REAL(wp), DIMENSION(jpj,jpk) ::   &  !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &  !:
       ufow, vfow,       & !: now climatology of the west velocities 
       tfow, sfow,       & !: now climatology of the west temperature and salinity
@@ -134,5 +130,5 @@
       !                   !  in the obcdyn.F90 routine
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   sshfow_b    !: west boundary ssh correction averaged over the barotropic loop
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshfow_b    !: west boundary ssh correction averaged over the barotropic loop
       !                                          !  (if Flather's algoritm applied at open boundary)
 
@@ -140,12 +136,12 @@
    !! Arrays for radiative West OBC
    !!-------------------------------
-   REAL(wp), DIMENSION(jpj,jpk,3,3) ::   uwbnd, vwbnd     !: baroclinic u & v components of the velocity over 3 rows 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   uwbnd, vwbnd     !: baroclinic u & v components of the velocity over 3 rows 
       !                                                   !  and 3 time step (now, before, and before before)
-   REAL(wp), DIMENSION(jpj,jpk,2,2) ::   twbnd, swbnd     !: west boundary temperature and salinity over 2 rows and 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   twbnd, swbnd     !: west boundary temperature and salinity over 2 rows and 
       !                                                   !  2 time step (now and before)
-   REAL(wp), DIMENSION(jpj,jpk) ::   u_cxwbnd, v_cxwbnd   !: Zonal component of the phase speed ratio computed with 
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   u_cxwbnd, v_cxwbnd   !: Zonal component of the phase speed ratio computed with 
       !                                                   !  radiation of zonal and meridional velocity (respectively) 
       !                                                   !  at the west open boundary (u_cxwbnd = cx rdt )
-   REAL(wp), DIMENSION(jpj,jpk) ::   uwmsk, vwmsk, twmsk  !: 2D mask for the West OB
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   uwmsk, vwmsk, twmsk  !: 2D mask for the West OB
 
    ! Note that those arrays are optimized for mpp case 
@@ -162,9 +158,9 @@
    INTEGER ::   njn0m1, njn1m1     !: do loop index in mpp case for jpnob-1
 
-   REAL(wp), DIMENSION(jpi) ::   &  !:
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:) ::   &  !:
       sshfon,           & !: now climatology of the north boundary sea surface height
       ubtfon,vbtfon       !: now climatology of the north boundary barotropic transport
 
-   REAL(wp), DIMENSION(jpi,jpk) ::   &    !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &    !:
       ufon, vfon,       & !: now climatology of the north boundary velocities
       tfon, sfon,       & !: now climatology of the north boundary temperature and salinity
@@ -172,5 +168,5 @@
       !                   !  in yhe obcdyn.F90 routine
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   sshfon_b      !: north boundary ssh correction averaged over the barotropic loop
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshfon_b      !: north boundary ssh correction averaged over the barotropic loop
       !                                            !  (if Flather's algoritm applied at open boundary)
 
@@ -178,12 +174,12 @@
    !! Arrays for radiative North OBC
    !!--------------------------------
-   REAL(wp), DIMENSION(jpi,jpk,3,3) ::   unbnd, vnbnd      !: baroclinic u & v components of the velocity over 3
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   unbnd, vnbnd      !: baroclinic u & v components of the velocity over 3
       !                                                    !  rows and 3 time step (now, before, and before before)
-   REAL(wp), DIMENSION(jpi,jpk,2,2) ::   tnbnd, snbnd      !: north boundary temperature and salinity over
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tnbnd, snbnd      !: north boundary temperature and salinity over
       !                                                    !  2 rows and 2 time step (now and before)
-   REAL(wp), DIMENSION(jpi,jpk) ::   u_cynbnd, v_cynbnd    !: Meridional component of the phase speed ratio compu-
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   u_cynbnd, v_cynbnd    !: Meridional component of the phase speed ratio compu-
       !                                                    !  ted with radiation of zonal and meridional velocity 
       !                                                    !  (respectively) at the north OB (u_cynbnd = cx rdt )
-   REAL(wp), DIMENSION(jpi,jpk) ::   unmsk, vnmsk, tnmsk   !: 2D mask for the North OB
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   unmsk, vnmsk, tnmsk   !: 2D mask for the North OB
 
    ! Note that those arrays are optimized for mpp case 
@@ -199,9 +195,9 @@
    INTEGER ::   njs0p1, njs1p1     !: do loop index in mpp case for jpsob+1
 
-   REAL(wp), DIMENSION(jpi) ::    &   !:
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:) ::    &   !:
       sshfos,           & !: now climatology of the south boundary sea surface height
       ubtfos,vbtfos       !: now climatology of the south boundary barotropic transport
 
-   REAL(wp), DIMENSION(jpi,jpk) ::    &   !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::    &   !:
       ufos, vfos,       & !: now climatology of the south boundary velocities 
       tfos, sfos,       & !: now climatology of the south boundary temperature and salinity
@@ -209,5 +205,5 @@
       !                   !  in the obcdyn.F90 routine
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   sshfos_b     !: south boundary ssh correction averaged over the barotropic loop
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshfos_b     !: south boundary ssh correction averaged over the barotropic loop
       !                                           !  (if Flather's algoritm applied at open boundary)
 
@@ -215,18 +211,12 @@
    !! Arrays for radiative South OBC   (computed by the forward time step in dynspg)
    !!--------------------------------
-   REAL(wp), DIMENSION(jpi,jpk,3,3) ::   usbnd, vsbnd     !: baroclinic u & v components of the velocity over 3 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   usbnd, vsbnd     !: baroclinic u & v components of the velocity over 3 
       !                                                   !  rows and 3 time step (now, before, and before before)
-   REAL(wp), DIMENSION(jpi,jpk,2,2) ::   tsbnd, ssbnd     !: south boundary temperature and salinity over
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tsbnd, ssbnd     !: south boundary temperature and salinity over
       !                                                   !  2 rows and 2 time step (now and before)
-   REAL(wp), DIMENSION(jpi,jpk) ::   u_cysbnd, v_cysbnd   !: Meridional component of the phase speed ratio
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   u_cysbnd, v_cysbnd   !: Meridional component of the phase speed ratio
       !                                                   !  computed with radiation of zonal and meridional velocity 
       !                                                   !  (repsectively) at the south OB (u_cynbnd = cx rdt )
-   REAL(wp), DIMENSION(jpi,jpk) ::   usmsk, vsmsk, tsmsk  !: 2D mask for the South OB
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option :                                       Empty module
-   !!----------------------------------------------------------------------
-#endif
+   REAL(wp), ALLOCATABLE, SAVE,     DIMENSION(:,:) ::   usmsk, vsmsk, tsmsk  !: 2D mask for the South OB
 
    !!----------------------------------------------------------------------
@@ -234,4 +224,62 @@
    !! $Id$ 
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION obc_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!               ***  FUNCTION obc_oce_alloc  ***
+      !!----------------------------------------------------------------------
+
+      ALLOCATE(                                                               &
+              !! East open boundary
+              obctmsk(jpi,jpj), obcumask(jpi,jpj), obcvmask(jpi,jpj),        &
+              sshfoe(jpjed:jpjef), ubtfoe(jpjed:jpjef), vbtfoe(jpjed:jpjef), &
+              ufoe(jpj,jpk), vfoe(jpj,jpk), tfoe(jpj,jpk), sfoe(jpj,jpk),    &
+              uclie(jpj,jpk), sshfoe_b(jpjed:jpjef,jpj),                     &
+              !! Arrays for radiative East OBC
+              uebnd(jpj,jpk,3,3), vebnd(jpj,jpk,3,3) ,                       &
+              tebnd(jpj,jpk,2,2), sebnd(jpj,jpk,2,2),                        &
+              u_cxebnd(jpj,jpk), v_cxebnd(jpj,jpk),                          &
+              uemsk(jpj,jpk), vemsk(jpj,jpk), temsk(jpj,jpk),                &
+              !! West open boundary
+              sshfow(jpjwd:jpjwf), ubtfow(jpjwd:jpjwf), vbtfow(jpjwd:jpjwf), &
+              ufow(jpj,jpk), vfow(jpj,jpk), tfow(jpj,jpk),                   &
+              sfow(jpj,jpk), ucliw(jpj,jpk), sshfow_b(jpjwd:jpjwf,jpj),      &
+              !! Arrays for radiative West OBC
+              uwbnd(jpj,jpk,3,3), vwbnd(jpj,jpk,3,3),                        &
+              twbnd(jpj,jpk,2,2), swbnd(jpj,jpk,2,2),                        &
+              u_cxwbnd(jpj,jpk), v_cxwbnd(jpj,jpk),                          &
+              uwmsk(jpj,jpk), vwmsk(jpj,jpk), twmsk(jpj,jpk),                &
+              !! North open boundary
+              sshfon(jpind:jpinf), ubtfon(jpind:jpinf), vbtfon(jpind:jpinf), &
+              ufon(jpi,jpk), vfon(jpi,jpk), tfon(jpi,jpk),                   &
+              sfon(jpi,jpk), vclin(jpi,jpk), sshfon_b(jpind:jpinf,jpj),      &
+              !! Arrays for radiative North OBC
+              unbnd(jpi,jpk,3,3), vnbnd(jpi,jpk,3,3),                        &
+              tnbnd(jpi,jpk,2,2), snbnd(jpi,jpk,2,2),                        &
+              u_cynbnd(jpi,jpk), v_cynbnd(jpi,jpk),                          &
+              unmsk(jpi,jpk), vnmsk(jpi,jpk), tnmsk (jpi,jpk),               &
+              !! South open boundary
+              sshfos(jpisd:jpisf), ubtfos(jpisd:jpisf), vbtfos(jpisd:jpisf), &
+              ufos(jpi,jpk), vfos(jpi,jpk), tfos(jpi,jpk),                   &
+              sfos(jpi,jpk), vclis(jpi,jpk),                                 &
+              sshfos_b(jpisd:jpisf,jpj),                                     &
+              !! Arrays for radiative South OBC 
+              usbnd(jpi,jpk,3,3), vsbnd(jpi,jpk,3,3),                        &
+              tsbnd(jpi,jpk,2,2), ssbnd(jpi,jpk,2,2),                        &
+              u_cysbnd(jpi,jpk), v_cysbnd(jpi,jpk),                          &
+              usmsk(jpi,jpk), vsmsk(jpi,jpk), tsmsk(jpi,jpk),                &
+              !!
+              STAT=obc_oce_alloc )
+      !
+   END FUNCTION obc_oce_alloc
+   
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option         Empty module                          No OBC
+   !!----------------------------------------------------------------------
+#endif
+
    !!======================================================================
 END MODULE obc_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_par.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_par.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obc_par.F90	(revision 2715)
@@ -4,25 +4,17 @@
    !! Open Boundary Cond. :   define related parameters
    !!==============================================================================
+   !! history :  OPA  ! 1991-01 (CLIPPER)  Original code 
+   !!   NEMO     1.0  ! 2002-04   (C. Talandier)  modules
+   !!             -   ! 2004/06   (F. Durand) jptobc is defined as a parameter
+   !!----------------------------------------------------------------------
 #if defined key_obc
    !!----------------------------------------------------------------------
    !!   'key_obc' :                                 Open Boundary Condition
    !!----------------------------------------------------------------------
-   !! history :
-   !!  8.0   01/91   (CLIPPER)  Original code 
-   !!  9.0   06/02   (C. Talandier)  modules
-   !!        06/04   (F. Durand) ORCA_R2_ZIND config
-   !!        06/04   (F. Durand) jptobc is defined as a parameter, 
-   !!	     	     in order to allow time-dependent OBCs fields on input
-   !!----------------------------------------------------------------------
-   !! * Modules used
    USE par_oce         ! ocean parameters
 
    IMPLICIT NONE
    PUBLIC
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
+
 #if ! defined key_agrif
    LOGICAL, PUBLIC, PARAMETER ::   lk_obc = .TRUE.     !: Ocean Boundary Condition flag
@@ -47,10 +39,9 @@
    !! open boundary parameter
    !!---------------------------------------------------------------------
-   INTEGER, PARAMETER ::     &  !: time dimension of the BCS fields on input
-      jptobc  =	      2 
+   INTEGER, PARAMETER ::   jptobc      =  2        !: time dimension of the BCS fields on input
+   
    !! * EAST open boundary
-   LOGICAL, PARAMETER ::     &  !:
-      lp_obc_east = .FALSE.     !: to active or not the East open boundary
-     INTEGER   &
+   LOGICAL, PARAMETER ::   lp_obc_east = .FALSE.   !: to active or not the East open boundary
+   INTEGER   &
 #if !defined key_agrif
      , PARAMETER   & 
@@ -64,7 +55,6 @@
 
    !! * WEST open boundary
-   LOGICAL, PARAMETER ::     &  !:
-      lp_obc_west = .FALSE.     !: to active or not the West open boundary
-     INTEGER   &
+   LOGICAL, PARAMETER ::   lp_obc_west = .FALSE.   !: to active or not the West open boundary
+   INTEGER   &
 #if !defined key_agrif
      , PARAMETER   & 
@@ -78,6 +68,5 @@
 
    !! * NORTH open boundary
-   LOGICAL, PARAMETER ::     &  !:
-      lp_obc_north = .FALSE.    !: to active or not the North open boundary
+   LOGICAL, PARAMETER ::   lp_obc_north = .FALSE.   !: to active or not the North open boundary
      INTEGER   &
 #if !defined key_agrif
@@ -92,6 +81,5 @@
 
    !! * SOUTH open boundary
-   LOGICAL, PARAMETER ::     &  !:
-      lp_obc_south = .FALSE.    !: to active or not the South open boundary
+   LOGICAL, PARAMETER ::   lp_obc_south = .FALSE.   !: to active or not the South open boundary
      INTEGER   &
 #if !defined key_agrif
@@ -105,6 +93,5 @@
       jpisfm1 =  jpisf-1        !: last  ocean point         "                 "
    
-   INTEGER, PARAMETER ::     &  !:
-      jpnic = 2700              !: maximum number of isolated coastlines points 
+   INTEGER, PARAMETER ::   jpnic = 2700   !: maximum number of isolated coastlines points 
 
 # endif
@@ -117,4 +104,8 @@
 #endif
 
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE obc_par
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdta.F90	(revision 2715)
@@ -4,4 +4,9 @@
    !! Open boundary data : read the data for the open boundaries.
    !!==============================================================================
+   !! History :  OPA  ! 1998-05 (J.M. Molines) Original code
+   !!            8.5  ! 2002-10 (C. Talandier, A-M. Treguier) Free surface, F90
+   !!   NEMO     1.0  ! 2004-06 (F. Durand, A-M. Treguier) Netcdf BC files on input
+   !!            3.0  ! 2007-2008 (C. Langlais, P. Mathiot, J.M. Molines) high frequency boundaries data
+   !!------------------------------------------------------------------------------
 #if defined key_obc
    !!------------------------------------------------------------------------------
@@ -10,5 +15,4 @@
    !!   obc_dta           : read u, v, t, s data along each open boundary
    !!------------------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers 
    USE dom_oce         ! ocean space and time domain
@@ -19,5 +23,5 @@
    USE in_out_manager  ! I/O logical units
    USE lib_mpp         ! distributed memory computing
-   USE dynspg_oce
+   USE dynspg_oce      ! ocean: surface pressure gradient
    USE ioipsl          ! now only for  ymds2ju function 
    USE iom             ! 
@@ -26,11 +30,10 @@
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC obc_dta      ! routines called by step.F90
-   PUBLIC obc_dta_bt   ! routines called by dynspg_ts.F90
-
-   !! * Shared module variables
-   REAL(wp),  DIMENSION(2)              ::  zjcnes_obc   ! 
-   REAL(wp),  DIMENSION(:), ALLOCATABLE :: ztcobc
+   PUBLIC   obc_dta         ! routine  called by step.F90
+   PUBLIC   obc_dta_bt      ! routine  called by dynspg_ts.F90
+   PUBLIC   obc_dta_alloc   ! function called by obcini.F90
+
+   REAL(wp),  DIMENSION(2)              ::   zjcnes_obc   ! 
+   REAL(wp),  DIMENSION(:), ALLOCATABLE ::   ztcobc
    REAL(wp) :: rdt_obc
    REAL(wp) :: zjcnes
@@ -39,43 +42,30 @@
    INTEGER ::  itobce, itobcw, itobcs, itobcn, itobc_b  ! number of time steps in OBC files
 
-   INTEGER ::   &
-      ntobc      , &     !:  where we are in the obc file
-      ntobc_b    , &     !:  first record used
-      ntobc_a            !:  second record used
-
-   CHARACTER (len=40) :: &    ! name of data files
-      cl_obc_eTS   , cl_obc_eU,  &
-      cl_obc_wTS   , cl_obc_wU,  &
-      cl_obc_nTS   , cl_obc_nV,  &
-      cl_obc_sTS   , cl_obc_sV
-
-# if defined key_dynspg_ts
+   INTEGER ::   ntobc        ! where we are in the obc file
+   INTEGER ::   ntobc_b      ! first record used
+   INTEGER ::   ntobc_a      ! second record used
+
+   CHARACTER (len=40) ::   cl_obc_eTS, cl_obc_eU   ! name of data files
+   CHARACTER (len=40) ::   cl_obc_wTS, cl_obc_wU   !   -       -
+   CHARACTER (len=40) ::   cl_obc_nTS, cl_obc_nV   !   -       -
+   CHARACTER (len=40) ::   cl_obc_sTS, cl_obc_sV   !   -       -
+
    ! bt arrays for interpolating time dependent data on the boundaries
-   INTEGER :: nt_m=0, ntobc_m
-   REAL(wp), DIMENSION(jpj,0:jptobc) :: ubtedta, vbtedta, sshedta  ! East
-   REAL(wp), DIMENSION(jpj,0:jptobc) :: ubtwdta, vbtwdta, sshwdta	! West
-   REAL(wp), DIMENSION(jpi,0:jptobc) :: ubtndta, vbtndta, sshndta	! North
-   REAL(wp), DIMENSION(jpi,0:jptobc) :: ubtsdta, vbtsdta, sshsdta	! South
+   INTEGER ::   nt_m=0, ntobc_m
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ubtedta, vbtedta, sshedta    ! East
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ubtwdta, vbtwdta, sshwdta	   ! West
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ubtndta, vbtndta, sshndta	   ! North
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ubtsdta, vbtsdta, sshsdta	   ! South
    ! arrays used for interpolating time dependent data on the boundaries
-   REAL(wp), DIMENSION(jpj,jpk,0:jptobc) :: uedta, vedta, tedta, sedta    ! East
-   REAL(wp), DIMENSION(jpj,jpk,0:jptobc) :: uwdta, vwdta, twdta, swdta    ! West
-   REAL(wp), DIMENSION(jpi,jpk,0:jptobc) :: undta, vndta, tndta, sndta    ! North
-   REAL(wp), DIMENSION(jpi,jpk,0:jptobc) :: usdta, vsdta, tsdta, ssdta    ! South
-# else
-   ! bt arrays for interpolating time dependent data on the boundaries
-   REAL(wp), DIMENSION(jpj,jptobc) :: ubtedta, vbtedta, sshedta  ! East
-   REAL(wp), DIMENSION(jpj,jptobc) :: ubtwdta, vbtwdta, sshwdta        ! West
-   REAL(wp), DIMENSION(jpi,jptobc) :: ubtndta, vbtndta, sshndta        ! North
-   REAL(wp), DIMENSION(jpi,jptobc) :: ubtsdta, vbtsdta, sshsdta        ! South
-   ! arrays used for interpolating time dependent data on the boundaries
-   REAL(wp), DIMENSION(jpj,jpk,jptobc) :: uedta, vedta, tedta, sedta    ! East
-   REAL(wp), DIMENSION(jpj,jpk,jptobc) :: uwdta, vwdta, twdta, swdta    ! West
-   REAL(wp), DIMENSION(jpi,jpk,jptobc) :: undta, vndta, tndta, sndta    ! North
-   REAL(wp), DIMENSION(jpi,jpk,jptobc) :: usdta, vsdta, tsdta, ssdta    ! South
-# endif
-   LOGICAL, DIMENSION (jpj,jpk ) :: ltemsk=.TRUE., luemsk=.TRUE., lvemsk=.TRUE.  ! boolean msks
-   LOGICAL, DIMENSION (jpj,jpk ) :: ltwmsk=.TRUE., luwmsk=.TRUE., lvwmsk=.TRUE.  ! used for outliers
-   LOGICAL, DIMENSION (jpi,jpk ) :: ltnmsk=.TRUE., lunmsk=.TRUE., lvnmsk=.TRUE.  ! checks
-   LOGICAL, DIMENSION (jpi,jpk ) :: ltsmsk=.TRUE., lusmsk=.TRUE., lvsmsk=.TRUE.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uedta, vedta, tedta, sedta    ! East
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uwdta, vwdta, twdta, swdta    ! West
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: undta, vndta, tndta, sndta    ! North
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: usdta, vsdta, tsdta, ssdta    ! South
+
+   ! Masks set to .TRUE. after successful allocation below
+   LOGICAL , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ltemsk, luemsk, lvemsk  ! boolean msks
+   LOGICAL , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ltwmsk, luwmsk, lvwmsk  ! used for outliers
+   LOGICAL , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ltnmsk, lunmsk, lvnmsk  ! checks
+   LOGICAL , ALLOCATABLE, SAVE, DIMENSION(:,:)   :: ltsmsk, lusmsk, lvsmsk
 
    !! * Substitutions
@@ -85,8 +75,65 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION obc_dta_alloc()
+      !!-------------------------------------------------------------------
+      !!                     ***  ROUTINE obc_dta_alloc  ***
+      !!-------------------------------------------------------------------
+      INTEGER :: ierr(2)
+      !!-------------------------------------------------------------------
+# if defined key_dynspg_ts
+      ALLOCATE(   &     ! time-splitting : 0:jptobc
+         ! bt arrays for interpolating time dependent data on the boundaries
+         &      ubtedta  (jpj,0:jptobc) , vbtedta  (jpj,0:jptobc) , sshedta  (jpj,0:jptobc) ,    &
+         &      ubtwdta  (jpj,0:jptobc) , vbtwdta  (jpj,0:jptobc) , sshwdta  (jpj,0:jptobc) ,    &
+         &      ubtndta  (jpi,0:jptobc) , vbtndta  (jpi,0:jptobc) , sshndta  (jpi,0:jptobc) ,    &
+         &      ubtsdta  (jpi,0:jptobc) , vbtsdta  (jpi,0:jptobc) , sshsdta  (jpi,0:jptobc) ,    &
+         ! arrays used for interpolating time dependent data on the boundaries
+         &      uedta(jpj,jpk,0:jptobc) , vedta(jpj,jpk,0:jptobc)                           ,     &
+         &      tedta(jpj,jpk,0:jptobc) , sedta(jpj,jpk,0:jptobc)                           ,     &
+         &      uwdta(jpj,jpk,0:jptobc) , vwdta(jpj,jpk,0:jptobc)                           ,     &
+         &      twdta(jpj,jpk,0:jptobc) , swdta(jpj,jpk,0:jptobc)                           ,     &
+         &      undta(jpi,jpk,0:jptobc) , vndta(jpi,jpk,0:jptobc)                           ,     &
+         &      tndta(jpi,jpk,0:jptobc) , sndta(jpi,jpk,0:jptobc)                           ,     &
+         &      usdta(jpi,jpk,0:jptobc) , vsdta(jpi,jpk,0:jptobc)                           ,     &
+         &      tsdta(jpi,jpk,0:jptobc) , ssdta(jpi,jpk,0:jptobc)                           , STAT=ierr(1) )
+# else
+      ALLOCATE(   &     ! no time splitting : 1:jptobc
+         ! bt arrays for interpolating time dependent data on the boundaries
+         &      ubtedta  (jpj,jptobc) , vbtedta  (jpj,jptobc) , sshedta  (jpj,jptobc)  ,     &
+         &      ubtwdta  (jpj,jptobc) , vbtwdta  (jpj,jptobc) , sshwdta  (jpj,jptobc)  ,     &
+         &      ubtndta  (jpi,jptobc) , vbtndta  (jpi,jptobc) , sshndta  (jpi,jptobc)  ,     &
+         &      ubtsdta  (jpi,jptobc) , vbtsdta  (jpi,jptobc) , sshsdta  (jpi,jptobc)  ,     &
+         ! arrays used for interpolating time dependent data on the boundaries
+         &      uedta(jpj,jpk,jptobc) , vedta(jpj,jpk,jptobc)                          ,     &
+         &      tedta(jpj,jpk,jptobc) , sedta(jpj,jpk,jptobc)                          ,     &
+         &      uwdta(jpj,jpk,jptobc) , vwdta(jpj,jpk,jptobc)                          ,     &
+         &      twdta(jpj,jpk,jptobc) , swdta(jpj,jpk,jptobc)                          ,     &
+         &      undta(jpi,jpk,jptobc) , vndta(jpi,jpk,jptobc)                          ,     &
+         &      tndta(jpi,jpk,jptobc) , sndta(jpi,jpk,jptobc)                          ,     &
+         &      usdta(jpi,jpk,jptobc) , vsdta(jpi,jpk,jptobc)                          ,     &
+         &      tsdta(jpi,jpk,jptobc) , ssdta(jpi,jpk,jptobc)                          , STAT=ierr(1) )
+# endif
+
+      ALLOCATE( ltemsk(jpj,jpk) , luemsk(jpj,jpk) , lvemsk(jpj,jpk) ,     &
+         &      ltwmsk(jpj,jpk) , luwmsk(jpj,jpk) , lvwmsk(jpj,jpk) ,     &
+         &      ltnmsk(jpj,jpk) , lunmsk(jpj,jpk) , lvnmsk(jpj,jpk) ,     &
+         &      ltsmsk(jpj,jpk) , lusmsk(jpj,jpk) , lvsmsk(jpj,jpk) , STAT=ierr(2) )
+
+      obc_dta_alloc = MAXVAL( ierr )
+      IF( lk_mpp )   CALL mpp_sum( obc_dta_alloc )
+
+      IF( obc_dta_alloc == 0 )  THEN         ! Initialise mask values following successful allocation
+         !      east            !          west            !          north           !          south           !
+         ltemsk(:,:) = .TRUE.   ;   ltwmsk(:,:) = .TRUE.   ;   ltnmsk(:,:) = .TRUE.   ;   ltsmsk(:,:) = .TRUE.
+         luemsk(:,:) = .TRUE.   ;   luwmsk(:,:) = .TRUE.   ;   lunmsk(:,:) = .TRUE.   ;   lusmsk(:,:) = .TRUE.
+         lvemsk(:,:) = .TRUE.   ;   lvwmsk(:,:) = .TRUE.   ;   lvnmsk(:,:) = .TRUE.   ;   lvsmsk(:,:) = .TRUE.
+      END IF
+      !
+   END FUNCTION obc_dta_alloc
+
 
    SUBROUTINE obc_dta( kt )
@@ -106,20 +153,10 @@
       !!                 attribute of variable time_counter).
       !!
-      !!
-      !! History :
-      !!        !  98-05 (J.M. Molines) Original code
-      !!   8.5  !  02-10 (C. Talandier, A-M. Treguier) Free surface, F90
-      !!
-      !!   9.0  !  04-06 (F. Durand, A-M. Treguier) Netcdf BC files on input
-      !!        !  2007-2008 (C. Langlais, P. Mathiot, J.M. Molines) high frequency boundaries data
       !!---------------------------------------------------------------------------
-      !! * Arguments
       INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
-
-      !! * Local declarations
+      !
       INTEGER, SAVE :: immfile, iyyfile                     !
       INTEGER :: nt              !  record indices (incrementation)
       REAL(wp) ::   zsec, zxy, znum, zden ! time interpolation weight
-
       !!---------------------------------------------------------------------------
 
@@ -227,20 +264,12 @@
 
 
-   SUBROUTINE obc_dta_ini (kt)
+   SUBROUTINE obc_dta_ini( kt )
       !!-----------------------------------------------------------------------------
       !!                       ***  SUBROUTINE obc_dta_ini  ***
       !!
-      !! ** Purpose :
-      !!      When obc_dta first call, realize some data initialization
-      !!
-      !! ** Method :
-      !!
-      !! History :
-      !!   9.0  ! 07-10 (J.M. Molines )
+      !! ** Purpose :   When obc_dta first call, realize some data initialization
       !!----------------------------------------------------------------------------
-      !! * Argument
       INTEGER, INTENT(in)  :: kt      ! ocean time-step index
-
-      !! * Local declarations
+      !
       INTEGER ::   ji, jj   ! dummy loop indices
       INTEGER, SAVE :: immfile, iyyfile                     !
@@ -521,12 +550,9 @@
       !!                Data at the boundary must be in m2/s 
       !!
-      !! History :
-      !!   9.0  !  05-11 (V. garnier) Original code
+      !! History :  9.0  !  05-11 (V. garnier) Original code
       !!---------------------------------------------------------------------------
-      !! * Arguments
       INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
       INTEGER, INTENT( in ) ::   kbt         ! barotropic ocean time-step index
-
-      !! * Local declarations
+      !
       INTEGER ::   ji, jj  ! dummy loop indices
       INTEGER ::   i15
@@ -534,5 +560,4 @@
       REAL(wp) ::  zxy
       INTEGER ::   isrel           ! number of seconds since 1/1/1992
-
       !!---------------------------------------------------------------------------
 
@@ -1096,4 +1121,5 @@
    END SUBROUTINE obc_read
 
+
    INTEGER FUNCTION nrecbef()
       !!-----------------------------------------------------------------------
@@ -1127,5 +1153,5 @@
       END FUNCTION nrecbef
 
-      !!==============================================================================
+
       SUBROUTINE obc_depth_average(nt_x)
          !!-----------------------------------------------------------------------
@@ -1212,3 +1238,4 @@
       END SUBROUTINE obc_dta
 #endif
+   !!==============================================================================
    END MODULE obcdta
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn_bt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn_bt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn_bt.F90	(revision 2715)
@@ -1,11 +1,15 @@
 MODULE obcdyn_bt
+   !!======================================================================
+   !!                       ***  MODULE  obcdyn_bt  ***
+   !! Ocean dynamics:   Radiation/prescription of sea surface heights on each open boundary
+   !!======================================================================
+   !! History :  1.0  ! 2005-12  (V. Garnier) original code
+   !!----------------------------------------------------------------------
 #if ( defined key_dynspg_ts || defined key_dynspg_exp ) && defined key_obc
-   !!=================================================================================
-   !!                       ***  MODULE  obcdyn_bt  ***
-   !! Ocean dynamics:   Radiation/prescription of sea surface heights
-   !!                   on each open boundary
-   !!=================================================================================
-
-   !!---------------------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   'key_dynspg_ts'     OR                   time spliting free surface
+   !!   'key_dynspg_exp'    AND                       explicit free surface
+   !!   'key_obc'                                   Open Boundary Condition
+   !!----------------------------------------------------------------------
    !!   obc_dyn_bt        : call the subroutine for each open boundary
    !!   obc_dyn_bt_east   : Flather's algorithm at the east open boundary
@@ -13,8 +17,5 @@
    !!   obc_dyn_bt_north  : Flather's algorithm at the north open boundary
    !!   obc_dyn_bt_south  : Flather's algorithm at the south open boundary
-   !!----------------------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------------------
-   !! * Modules used
+   !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers 
    USE dom_oce         ! ocean space and time domain
@@ -30,22 +31,19 @@
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC obc_dyn_bt  ! routine called in dynnxt (explicit free surface case)
-
-   !!---------------------------------------------------------------------------------
+   PUBLIC   obc_dyn_bt  ! routine called in dynnxt (explicit free surface case)
+
+   !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE obc_dyn_bt ( kt )
-      !!------------------------------------------------------------------------------
-      !!                      SUBROUTINE obc_dyn_bt
-      !!                     ***********************
-      !! ** Purpose :
-      !!      Apply Flather's algorithm at open boundaries for the explicit
-      !!      free surface case and free surface case with time-splitting
+   SUBROUTINE obc_dyn_bt( kt )
+      !!----------------------------------------------------------------------
+      !!                 ***  SUBROUTINE obc_dyn_bt  ***
+      !!
+      !! ** Purpose :   Apply Flather's algorithm at open boundaries for the explicit
+      !!              free surface case and free surface case with time-splitting
       !!
       !!      This routine is called in dynnxt.F routine and updates ua, va and sshn. 
@@ -55,13 +53,7 @@
       !!      open one (must be done in the param_obc.h90 file).
       !!
-      !! ** Reference : 
-      !!         Flather, R. A., 1976, Mem. Soc. R. Sci. Liege, Ser. 6, 10, 141-164
-      !!
-      !! History :
-      !!   9.0  !  05-12  (V. Garnier) original 
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      INTEGER, INTENT( in ) ::   kt
-
+      !! Reference :   Flather, R. A., 1976, Mem. Soc. R. Sci. Liege, Ser. 6, 10, 141-164
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt
       !!----------------------------------------------------------------------
 
@@ -85,6 +77,7 @@
 
 # if defined key_dynspg_exp
+
    SUBROUTINE obc_dyn_bt_east 
-      !!------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------
       !!                  ***  SUBROUTINE obc_dyn_bt_east  ***
       !!              
@@ -93,11 +86,9 @@
       !!      Fix sea surface height (sshn) on east open boundary
       !!      The logical lfbceast must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
 
       DO ji = nie0, nie1
@@ -120,5 +111,5 @@
 
    SUBROUTINE obc_dyn_bt_west 
-      !!------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------
       !!                  ***  SUBROUTINE obc_dyn_bt_west  ***
       !!                  
@@ -127,12 +118,8 @@
       !!      Fix sea surface height (sshn) on west open boundary
       !!      The logical lfbcwest must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO ji = niw0, niw1
          DO jk = 1, jpkm1
@@ -147,6 +134,7 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_west
+
 
    SUBROUTINE obc_dyn_bt_north 
@@ -158,12 +146,8 @@
       !!      Fix sea surface height (sshn) on north open boundary
       !!      The logical lfbcnorth must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO jj = njn0, njn1
          DO jk = 1, jpkm1
@@ -180,9 +164,10 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_north
 
+
    SUBROUTINE obc_dyn_bt_south 
-      !!------------------------------------------------------------------------------
+      !!----------------------------------------------------------------------
       !!                ***  SUBROUTINE obc_dyn_bt_south  ***
       !!                    
@@ -191,13 +176,8 @@
       !!      Fix sea surface height (sshn) on south open boundary
       !!      The logical lfbcsouth must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO jj = njs0, njs1
          DO jk = 1, jpkm1
@@ -212,5 +192,5 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_south
 
@@ -225,12 +205,8 @@
       !!      Fix sea surface height (sshn) on east open boundary
       !!      The logical lfbceast must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO ji = nie0, nie1
          DO jk = 1, jpkm1
@@ -245,24 +221,19 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_east
 
+
    SUBROUTINE obc_dyn_bt_west 
-      !!------------------------------------------------------------------------------
+      !!---------------------------------------------------------------------
       !!                  ***  SUBROUTINE obc_dyn_bt_west  ***
       !!
-      !! ** Purpose :
-      !! ** Purpose :
-      !!      Apply Flather algorithm on west OBC velocities ua, va
+      !! ** Purpose :   Apply Flather algorithm on west OBC velocities ua, va
       !!      Fix sea surface height (sshn) on west open boundary
       !!      The logical lfbcwest must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO ji = niw0, niw1
          DO jk = 1, jpkm1
@@ -275,23 +246,20 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_west
+
 
    SUBROUTINE obc_dyn_bt_north 
       !!------------------------------------------------------------------------------
-      !!                     SUBROUTINE obc_dyn_bt_north
-      !!                    *************************
+      !!                ***  SUBROUTINE obc_dyn_bt_north  ***
+      !!                
       !! ** Purpose :
       !!      Apply Flather algorithm on north OBC velocities ua, va
       !!      Fix sea surface height (sshn) on north open boundary
       !!      The logical lfbcnorth must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO jj = njn0, njn1
          DO jk = 1, jpkm1
@@ -306,24 +274,20 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_north
+
 
    SUBROUTINE obc_dyn_bt_south 
       !!------------------------------------------------------------------------------
-      !!                     SUBROUTINE obc_dyn_bt_south
-      !!                    *************************
+      !!                ***  SUBROUTINE obc_dyn_bt_south  ***
+      !!                  
       !! ** Purpose :
       !!      Apply Flather algorithm on south OBC velocities ua, va
       !!      Fix sea surface height (sshn) on south open boundary
       !!      The logical lfbcsouth must be .TRUE.
-      !!
-      !!  History :
-      !!   9.0  !  05-12  (V. Garnier) original
-      !!------------------------------------------------------------------------------
-      !! * Local declaration
-      INTEGER ::   ji, jj, jk ! dummy loop indices
-
-      !!------------------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+      !
       DO jj = njs0, njs1
          DO jk = 1, jpkm1
@@ -336,19 +300,18 @@
          END DO
       END DO
-
+      !
    END SUBROUTINE obc_dyn_bt_south
 
 # endif
+
 #else
-   !!=================================================================================
-   !!                       ***  MODULE  obcdyn_bt  ***
-   !! Ocean dynamics:   Radiation of velocities on each open boundary
-   !!=================================================================================
+   !!----------------------------------------------------------------------
+   !!   Default option       No Open Boundaries or not explicit fre surface
+   !!----------------------------------------------------------------------
 CONTAINS
-
-   SUBROUTINE obc_dyn_bt
-                              ! No open boundaries ==> empty routine
+   SUBROUTINE obc_dyn_bt      ! Dummy routine
    END SUBROUTINE obc_dyn_bt
 #endif
 
+   !!======================================================================
 END MODULE obcdyn_bt
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcfla.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcfla.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcfla.F90	(revision 2715)
@@ -5,7 +5,8 @@
    !!======================================================================
    !! History :  2.0  ! 2005-12  (V. Garnier) original code
-   !!            3.3  ! 2010-11  (G. Madec)
+   !!            3.3  ! 2010-11  (G. Madec) 
+   !!            4.0  ! 2011-02  (G. Madec) velocity & ssh passed in argument
    !!----------------------------------------------------------------------
-#if defined key_obc && defined key_dynspg_ts
+#if defined key_obc   &&   defined key_dynspg_ts
    !!----------------------------------------------------------------------
    !!   'key_obc'          and                      Open Boundary Condition
@@ -31,5 +32,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -37,5 +38,5 @@
 CONTAINS
 
-   SUBROUTINE obc_fla_ts
+   SUBROUTINE obc_fla_ts( pua, pva, p_sshn, p_ssha )
       !!----------------------------------------------------------------------
       !!                      SUBROUTINE obc_fla_ts
@@ -52,35 +53,41 @@
       !! ** Reference : Flather, R. A., 1976, Mem. Soc. R. Sci. Liege, Ser. 6, 10, 141-164
       !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pua   , pva      ! after barotropic velocities
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_sshn, p_ssha   ! before, now, after sea surface height
+      !!----------------------------------------------------------------------
       !
-      IF( lp_obc_east  )   CALL obc_fla_ts_east 
-      IF( lp_obc_west  )   CALL obc_fla_ts_west 
-      IF( lp_obc_north )   CALL obc_fla_ts_north
-      IF( lp_obc_south )   CALL obc_fla_ts_south
+      IF( lp_obc_east  )   CALL obc_fla_ts_east ( pua, pva, p_sshn, p_ssha ) 
+      IF( lp_obc_west  )   CALL obc_fla_ts_west ( pua, pva, p_sshn, p_ssha )
+      IF( lp_obc_north )   CALL obc_fla_ts_north( pua, pva, p_sshn, p_ssha )
+      IF( lp_obc_south )   CALL obc_fla_ts_south( pua, pva, p_sshn, p_ssha ) 
       !
    END SUBROUTINE obc_fla_ts
 
 
-   SUBROUTINE obc_fla_ts_east
+   SUBROUTINE obc_fla_ts_east( pua, pva, p_sshn, p_ssha ) 
       !!----------------------------------------------------------------------
       !!                  ***  SUBROUTINE obc_fla_ts_east  ***
       !!
       !! ** Purpose :   Apply Flather's algorithm on east OBC velocities ua, va
-      !!              Fix sea surface height (sshn_e) on east open boundary
+      !!              Fix sea surface height (p_sshn) on east open boundary
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pua   , pva      ! after barotropic velocities
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_sshn, p_ssha   ! before, now, after sea surface height
+      !
+      INTEGER ::   ji, jj   ! dummy loop indices
       !!----------------------------------------------------------------------
       !
       DO ji = nie0, nie1
          DO jj = 1, jpj
-            ua_e    (ji,jj) = (  ubtfoe(jj) * hur(ji,jj) + SQRT( grav*hur(ji,jj) )          &
-               &            * ( ( sshn_e(ji,jj) + sshn_e(ji+1,jj) ) * 0.5 - sshfoe(jj) )  ) * uemsk(jj,1)
+            pua     (ji,jj) = (  ubtfoe(jj) * hur(ji,jj) + SQRT( grav*hur(ji,jj) )          &
+               &            * ( ( p_sshn(ji,jj) + p_sshn(ji+1,jj) ) * 0.5 - sshfoe(jj) )  ) * uemsk(jj,1)
             sshfoe_b(ji,jj) =    sshfoe_b(ji,jj)         + SQRT( grav*hur(ji,jj) )          &
-               &            * ( ( sshn_e(ji,jj) + sshn_e(ji+1,jj) ) * 0.5 - sshfoe(jj) )    * uemsk(jj,1)
+               &            * ( ( p_sshn(ji,jj) + p_sshn(ji+1,jj) ) * 0.5 - sshfoe(jj) )    * uemsk(jj,1)
          END DO
       END DO
       DO ji = nie0p1, nie1p1
          DO jj = 1, jpj
-            ssha_e(ji,jj) = ssha_e(ji,jj) * ( 1. - temsk(jj,1) ) + temsk(jj,1) * sshfoe(jj)
-            va_e  (ji,jj) = vbtfoe(jj) * hvr(ji,jj) * uemsk(jj,1)
+            p_ssha(ji,jj) = p_ssha(ji,jj) * ( 1. - temsk(jj,1) ) + temsk(jj,1) * sshfoe(jj)
+            pva   (ji,jj) = vbtfoe(jj) * hvr(ji,jj) * uemsk(jj,1)
          END DO
       END DO
@@ -89,22 +96,25 @@
 
 
-   SUBROUTINE obc_fla_ts_west
+   SUBROUTINE obc_fla_ts_west( pua, pva, p_sshn, p_ssha )
       !!----------------------------------------------------------------------
       !!                  ***  SUBROUTINE obc_fla_ts_west  ***
       !! 
       !! ** Purpose :   Apply Flather's algorithm on west OBC velocities ua, va
-      !!              Fix sea surface height (sshn_e) on west open boundary
+      !!              Fix sea surface height (p_sshn) on west open boundary
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pua   , pva      ! after barotropic velocities
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_sshn, p_ssha   ! before, now, after sea surface height
+      !
+      INTEGER ::   ji, jj   ! dummy loop indices
       !!----------------------------------------------------------------------
       !
       DO ji = niw0, niw1
          DO jj = 1, jpj
-            ua_e    (ji,jj) = ( ubtfow(jj) * hur(ji,jj) - sqrt( grav * hur(ji,jj) )            &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji+1,jj) ) * 0.5 - sshfow(jj) ) ) * uwmsk(jj,1)
-            va_e    (ji,jj) =   vbtfow(jj) * hvr(ji,jj) * uwmsk(jj,1)
+            pua     (ji,jj) = ( ubtfow(jj) * hur(ji,jj) - sqrt( grav * hur(ji,jj) )            &
+               &            * ( ( p_sshn(ji,jj) + p_sshn(ji+1,jj) ) * 0.5 - sshfow(jj) ) ) * uwmsk(jj,1)
+            pva     (ji,jj) =   vbtfow(jj) * hvr(ji,jj) * uwmsk(jj,1)
             sshfow_b(ji,jj) =   sshfow_b(ji,jj) - SQRT( grav * hur(ji,jj) )                    &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji+1,jj) ) * 0.5 - sshfow(jj) )   * uwmsk(jj,1)
-            ssha_e  (ji,jj) = ssha_e(ji,jj) * ( 1. - twmsk(jj,1) ) + twmsk(jj,1)*sshfow(jj)
+               &            * ( ( p_sshn(ji,jj) + p_sshn(ji+1,jj) ) * 0.5 - sshfow(jj) )   * uwmsk(jj,1)
+            p_ssha  (ji,jj) = p_ssha(ji,jj) * ( 1. - twmsk(jj,1) ) + twmsk(jj,1)*sshfow(jj)
          END DO
       END DO
@@ -113,26 +123,29 @@
 
 
-   SUBROUTINE obc_fla_ts_north
+   SUBROUTINE obc_fla_ts_north( pua, pva, p_sshn, p_ssha )
       !!----------------------------------------------------------------------
       !!                     SUBROUTINE obc_fla_ts_north
       !!
       !! ** Purpose :   Apply Flather's algorithm on north OBC velocities ua, va
-      !!              Fix sea surface height (sshn_e) on north open boundary
+      !!              Fix sea surface height (p_sshn) on north open boundary
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pua   , pva      ! after barotropic velocities
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_sshn, p_ssha   ! before, now, after sea surface height
+      !
+      INTEGER ::   ji, jj   ! dummy loop indices
       !!----------------------------------------------------------------------
       !
       DO jj = njn0, njn1
          DO ji = 1, jpi
-            va_e    (ji,jj) = ( vbtfon(ji) * hvr(ji,jj) + sqrt( grav * hvr(ji,jj) )            &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji,jj+1) ) * 0.5 - sshfon(ji) ) ) * vnmsk(ji,1)
+            pva     (ji,jj) = ( vbtfon(ji) * hvr(ji,jj) + sqrt( grav * hvr(ji,jj) )            &
+               &                * ( ( p_sshn(ji,jj) + p_sshn(ji,jj+1) ) * 0.5 - sshfon(ji) ) ) * vnmsk(ji,1)
             sshfon_b(ji,jj) =   sshfon_b(ji,jj) + sqrt( grav * hvr(ji,jj) )                    &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji,jj+1) ) * 0.5 - sshfon(ji) )   * vnmsk(ji,1)
+               &                * ( ( p_sshn(ji,jj) + p_sshn(ji,jj+1) ) * 0.5 - sshfon(ji) )   * vnmsk(ji,1)
          END DO
       END DO
       DO jj = njn0p1, njn1p1
          DO ji = 1, jpi
-            ssha_e(ji,jj) = ssha_e(ji,jj) * ( 1. - tnmsk(ji,1) ) + sshfon(ji) * tnmsk(ji,1)
-            ua_e  (ji,jj) = ubtfon(ji) * hur(ji,jj) * vnmsk(ji,1)
+            p_ssha(ji,jj) = p_ssha(ji,jj) * ( 1. - tnmsk(ji,1) ) + sshfon(ji) * tnmsk(ji,1)
+            pua   (ji,jj) = ubtfon(ji) * hur(ji,jj) * vnmsk(ji,1)
          END DO
       END DO
@@ -141,22 +154,25 @@
 
 
-   SUBROUTINE obc_fla_ts_south
+   SUBROUTINE obc_fla_ts_south( pua, pva, p_sshn, p_ssha )
       !!----------------------------------------------------------------------
       !!                     SUBROUTINE obc_fla_ts_south
       !!
       !! ** Purpose :   Apply Flather's algorithm on south OBC velocities ua, va
-      !!              Fix sea surface height (sshn_e) on south open boundary
+      !!              Fix sea surface height (p_sshn) on south open boundary
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pua   , pva      ! after barotropic velocities
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_sshn, p_ssha   ! before, now, after sea surface height
+      !
+      INTEGER ::   ji, jj   ! dummy loop indices
       !!----------------------------------------------------------------------
       !
       DO jj = njs0, njs1
          DO ji = 1, jpi
-            va_e    (ji,jj) = ( vbtfos(ji) * hvr(ji,jj) - sqrt( grav * hvr(ji,jj) )            &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji,jj+1) ) * 0.5 - sshfos(ji) ) ) * vsmsk(ji,1)
-            ua_e    (ji,jj) =   ubtfos(ji) * hur(ji,jj) * vsmsk(ji,1)
+            pva     (ji,jj) = ( vbtfos(ji) * hvr(ji,jj) - sqrt( grav * hvr(ji,jj) )            &
+               &                * ( ( p_sshn(ji,jj) + p_sshn(ji,jj+1) ) * 0.5 - sshfos(ji) ) ) * vsmsk(ji,1)
+            pua     (ji,jj) =   ubtfos(ji) * hur(ji,jj) * vsmsk(ji,1)
             sshfos_b(ji,jj) =   sshfos_b(ji,jj) - sqrt( grav * hvr(ji,jj) )                    &
-               &                * ( ( sshn_e(ji,jj) + sshn_e(ji,jj+1) ) * 0.5 - sshfos(ji) )   * vsmsk(ji,1)
-            ssha_e  (ji,jj) = ssha_e(ji,jj) * (1. - tsmsk(ji,1) ) + tsmsk(ji,1) * sshfos(ji)
+               &                * ( ( p_sshn(ji,jj) + p_sshn(ji,jj+1) ) * 0.5 - sshfos(ji) )   * vsmsk(ji,1)
+            p_ssha  (ji,jj) = p_ssha(ji,jj) * (1. - tsmsk(ji,1) ) + tsmsk(ji,1) * sshfos(ji)
          END DO
       END DO
@@ -169,7 +185,7 @@
    !!----------------------------------------------------------------------
 CONTAINS
-
-   SUBROUTINE obc_fla_ts
-      WRITE(*,*) 'obc_fla_ts: You should not have seen this print! error?'
+   SUBROUTINE obc_fla_ts( pua, pva, p_sshn, p_ssha )
+      REAL, DIMENSION(:,:)::   pua, pva, p_sshn, p_ssha
+      WRITE(*,*) 'obc_fla_ts: You should not have seen this print! error?', pua(1,1), pva(1,1), p_sshn(1,1), p_ssha(1,1)
    END SUBROUTINE obc_fla_ts
 #endif
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 2715)
@@ -18,7 +18,8 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE phycst          ! physical constants
-   USE obc_oce         ! ocean open boundary conditions
-   USE lib_mpp         ! for mpp_sum
+   USE obc_oce         ! open boundary condition: ocean
+   USE obcdta          ! open boundary condition: data
    USE in_out_manager  ! I/O units
+   USE lib_mpp         ! MPP library
    USE dynspg_oce      ! flag lk_dynspg_flt
 
@@ -33,7 +34,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
    
@@ -81,6 +81,8 @@
       rdpnob   = rn_dpnob
       volemp   = rn_volemp
-      
-
+
+      !                              ! allocate obc arrays
+      IF( obc_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'obc_init : unable to allocate obc_oce arrays' )
+      IF( obc_dta_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'obc_init : unable to allocate obc_dta arrays' )
 
       ! By security we set rdpxin and rdpxob respectively to 1. and 15. if the corresponding OBC is not activated
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrad.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrad.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrad.F90	(revision 2715)
@@ -12,5 +12,4 @@
    !!   obc_rad_south  : compute the south phase velocities
    !!---------------------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain variables
@@ -24,8 +23,6 @@
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC obc_rad        ! routine called by step.F90
-
-   !! * Module variables
+   PUBLIC   obc_rad    ! routine called by step.F90
+
    INTEGER ::   ji, jj, jk     ! dummy loop indices
 
@@ -69,5 +66,4 @@
       !!                                                 J. Molines and G. Madec version
       !!------------------------------------------------------------------------------
-      !! * Arguments
       INTEGER, INTENT( in ) ::   kt
       !!----------------------------------------------------------------------
@@ -143,5 +139,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(uebnd,jpjed,jpjef,jpieob,jpk*3*3,2,jpj)
+         IF( lk_mpp )   CALL mppobc(uebnd,jpjed,jpjef,jpieob,jpk*3*3,2,jpj, numout )
 
          ! ... extremeties nie0, nie1
@@ -185,5 +181,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(vebnd,jpjed,jpjef,jpieob+1,jpk*3*3,2,jpj)
+         IF( lk_mpp )   CALL mppobc(vebnd,jpjed,jpjef,jpieob+1,jpk*3*3,2,jpj, numout )
 
          !... extremeties nie0, nie1
@@ -226,6 +222,6 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(tebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj)
-         IF( lk_mpp )   CALL mppobc(sebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj)
+         IF( lk_mpp )   CALL mppobc(tebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj, numout )
+         IF( lk_mpp )   CALL mppobc(sebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj, numout )
 
          ! ... extremeties nie0, nie1
@@ -327,5 +323,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(v_cxebnd,jpjed,jpjef,jpieob+1,jpk,2,jpj)
+         IF( lk_mpp )   CALL mppobc(v_cxebnd,jpjed,jpjef,jpieob+1,jpk,2,jpj, numout )
 
          ! ... extremeties nie0, nie1
@@ -409,5 +405,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(uwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj)
+         IF( lk_mpp )   CALL mppobc(uwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj, numout )
 
          ! ... extremeties niw0, niw1
@@ -451,5 +447,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(vwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj)
+         IF( lk_mpp )   CALL mppobc(vwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj, numout )
 
          ! ... extremeties niw0, niw1 
@@ -492,6 +488,6 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(twbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj)
-         IF( lk_mpp )   CALL mppobc(swbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj)
+         IF( lk_mpp )   CALL mppobc(twbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj, numout )
+         IF( lk_mpp )   CALL mppobc(swbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj, numout )
 
          ! ... extremeties niw0, niw1
@@ -596,5 +592,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(v_cxwbnd,jpjwd,jpjwf,jpiwob,jpk,2,jpj)
+         IF( lk_mpp )   CALL mppobc(v_cxwbnd,jpjwd,jpjwf,jpiwob,jpk,2,jpj, numout )
 
          ! ... extremeties niw0, niw1
@@ -673,5 +669,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(unbnd,jpind,jpinf,jpjnob+1,jpk*3*3,1,jpi)
+         IF( lk_mpp )   CALL mppobc(unbnd,jpind,jpinf,jpjnob+1,jpk*3*3,1,jpi, numout )
 
          ! ... extremeties njn0,njn1 
@@ -720,5 +716,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(vnbnd,jpind,jpinf,jpjnob,jpk*3*3,1,jpi)
+         IF( lk_mpp )   CALL mppobc(vnbnd,jpind,jpinf,jpjnob,jpk*3*3,1,jpi, numout )
 
          ! ... extremeties njn0,njn1
@@ -761,6 +757,6 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(tnbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi)
-         IF( lk_mpp )   CALL mppobc(snbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi)
+         IF( lk_mpp )   CALL mppobc(tnbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi, numout )
+         IF( lk_mpp )   CALL mppobc(snbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi, numout )
 
          ! ... extremeties  njn0,njn1
@@ -828,5 +824,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(u_cynbnd,jpind,jpinf,jpjnob+1,jpk,1,jpi)
+         IF( lk_mpp )   CALL mppobc(u_cynbnd,jpind,jpinf,jpjnob+1,jpk,1,jpi, numout )
 
          ! ... extremeties  njn0,njn1
@@ -947,5 +943,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(usbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi)
+         IF( lk_mpp )   CALL mppobc(usbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi, numout )
 
          ! ... extremeties njs0,njs1
@@ -992,5 +988,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(vsbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi)
+         IF( lk_mpp )   CALL mppobc(vsbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi, numout )
 
          ! ... extremeties njs0,njs1
@@ -1033,6 +1029,6 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(tsbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi)
-         IF( lk_mpp )   CALL mppobc(ssbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi)
+         IF( lk_mpp )   CALL mppobc(tsbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi, numout )
+         IF( lk_mpp )   CALL mppobc(ssbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi, numout )
 
          ! ... extremeties  njs0,njs1
@@ -1100,5 +1096,5 @@
             END DO
          END DO
-         IF( lk_mpp )   CALL mppobc(u_cysbnd,jpisd,jpisf,jpjsob,jpk,1,jpi)
+         IF( lk_mpp )   CALL mppobc(u_cysbnd,jpisd,jpisf,jpjsob,jpk,1,jpi, numout )
 
          ! ... extremeties  njs0,njs1
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrst.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrst.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBC/obcrst.F90	(revision 2715)
@@ -7,5 +7,4 @@
 
    !!---------------------------------------------------------------------------------
-   !! * Modules used
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain variables
@@ -19,13 +18,12 @@
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC obc_rst_read       ! routine called by obc_ini
-   PUBLIC obc_rst_write      ! routine called by step
-
-   !!---------------------------------------------------------------------------------
+   PUBLIC   obc_rst_read    ! routine called by obc_ini
+   PUBLIC   obc_rst_write   ! routine called by step
+
+   !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!---------------------------------------------------------------------------------
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 
 CONTAINS
@@ -565,26 +563,26 @@
       IF( lk_mpp ) THEN
          IF( lp_obc_east ) THEN
-            CALL mppobc(uebnd,jpjed,jpjef,jpieob,jpk*3*3,2,jpj)
-            CALL mppobc(vebnd,jpjed,jpjef,jpieob+1,jpk*3*3,2,jpj)
-            CALL mppobc(tebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj)
-            CALL mppobc(sebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj)
+            CALL mppobc(uebnd,jpjed,jpjef,jpieob  ,jpk*3*3,2,jpj, numout )
+            CALL mppobc(vebnd,jpjed,jpjef,jpieob+1,jpk*3*3,2,jpj, numout )
+            CALL mppobc(tebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj, numout )
+            CALL mppobc(sebnd,jpjed,jpjef,jpieob+1,jpk*2*2,2,jpj, numout )
          ENDIF
          IF( lp_obc_west ) THEN
-            CALL mppobc(uwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj)
-            CALL mppobc(vwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj)
-            CALL mppobc(twbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj)
-            CALL mppobc(swbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj)
+            CALL mppobc(uwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj, numout )
+            CALL mppobc(vwbnd,jpjwd,jpjwf,jpiwob,jpk*3*3,2,jpj, numout )
+            CALL mppobc(twbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj, numout )
+            CALL mppobc(swbnd,jpjwd,jpjwf,jpiwob,jpk*2*2,2,jpj, numout )
          ENDIF
          IF( lp_obc_north ) THEN 
-            CALL mppobc(unbnd,jpind,jpinf,jpjnob+1,jpk*3*3,1,jpi)
-            CALL mppobc(vnbnd,jpind,jpinf,jpjnob  ,jpk*3*3,1,jpi)
-            CALL mppobc(tnbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi)
-            CALL mppobc(snbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi)
+            CALL mppobc(unbnd,jpind,jpinf,jpjnob+1,jpk*3*3,1,jpi, numout )
+            CALL mppobc(vnbnd,jpind,jpinf,jpjnob  ,jpk*3*3,1,jpi, numout )
+            CALL mppobc(tnbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi, numout )
+            CALL mppobc(snbnd,jpind,jpinf,jpjnob+1,jpk*2*2,1,jpi, numout )
          ENDIF
          IF( lp_obc_south ) THEN
-            CALL mppobc(usbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi)
-            CALL mppobc(vsbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi)
-            CALL mppobc(tsbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi)
-            CALL mppobc(ssbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi)
+            CALL mppobc(usbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi, numout )
+            CALL mppobc(vsbnd,jpisd,jpisf,jpjsob,jpk*3*3,1,jpi, numout )
+            CALL mppobc(tsbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi, numout )
+            CALL mppobc(ssbnd,jpisd,jpisf,jpjsob,jpk*2*2,1,jpi, numout )
          ENDIF
       ENDIF
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 2715)
@@ -39,4 +39,5 @@
    USE obs_types                ! Definitions for observation types
    USE mpp_map                  ! MPP mapping
+   USE lib_mpp                  ! For ctl_warn/stop
 
    IMPLICIT NONE
@@ -1026,5 +1027,8 @@
          & frld
 #endif
-
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+#if ! defined key_ice_lim
+      USE wrk_nemo, ONLY: frld => wrk_2d_1
+#endif
       IMPLICIT NONE
 
@@ -1032,7 +1036,4 @@
       INTEGER, INTENT(IN) :: kstp                         ! Current timestep
       !! * Local declarations
-#if ! defined key_ice_lim
-      REAL(wp), DIMENSION(jpi,jpj) :: frld
-#endif
       INTEGER :: idaystp                ! Number of timesteps per day
       INTEGER :: jprofset               ! Profile data set loop variable
@@ -1044,4 +1045,11 @@
       CHARACTER(LEN=20) :: datestr=" ",timestr=" "
  
+#if ! defined key_ice_lim
+      IF(wrk_in_use(2, 1))THEN
+         CALL ctl_stop('dia_obs : requested workspace array unavailable.')
+         RETURN
+      END IF
+#endif
+
       IF(lwp) THEN
          WRITE(numout,*)
@@ -1121,4 +1129,10 @@
       ENDIF
 
+#if ! defined key_ice_lim
+      IF(wrk_not_released(2, 1))THEN
+         CALL ctl_stop('dia_obs : failed to release workspace array.')
+      END IF
+#endif
+
    END SUBROUTINE dia_obs
   
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/julian.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/julian.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/julian.F90	(revision 2715)
@@ -13,6 +13,8 @@
       & wp, &
       & dp  
-   USE in_out_manager           ! I/O manager
-  
+   !USE in_out_manager           ! I/O manager
+   USE lib_mpp,  ONLY : &
+      & ctl_warn, ctl_stop
+
    IMPLICIT NONE
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90	(revision 2715)
@@ -33,5 +33,7 @@
    USE obs_const, ONLY :      &
       & obfillflt                  ! Fillvalue   
-   
+   USE lib_mpp, ONLY :   &
+      & ctl_warn, ctl_stop
+
    IMPLICIT NONE
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_h2d.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_h2d.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_h2d.F90	(revision 2715)
@@ -28,5 +28,7 @@
       & obfillflt		! Fillvalue
    USE obs_utils           ! Utility functions
-   
+      USE lib_mpp,ONLY : &
+      & ctl_warn, ctl_stop
+
    IMPLICIT NONE
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_inter_sup.F90	(revision 2715)
@@ -105,4 +105,7 @@
       !!        !  08-02  (K. Mogensen)  Original code
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: wrk_3d_1
+      !!
       !! * Arguments
       INTEGER, INTENT(IN) :: kptsi        ! Number of i horizontal points per stencil
@@ -119,9 +122,16 @@
          & pgval            ! Stencil at each point
       !! * Local declarations
-      REAL(KIND=wp), DIMENSION(jpi,jpj,1) :: &
+      REAL(KIND=wp), POINTER, DIMENSION(:,:,:) :: &
          & zval
       REAL(KIND=wp), DIMENSION(kptsi,kptsj,1,kobs) ::&
          & zgval 
 
+      ! Check workspace array and set-up pointer
+      IF(wrk_in_use(3, 1))THEN
+         CALL ctl_stop('obs_int_comm_2d : requested workspace array unavailable.')
+         RETURN
+      END IF
+      zval => wrk_3d_1(:,:,1:1)
+
       ! Set up local "3D" buffer
 
@@ -144,4 +154,9 @@
 
       pgval(:,:,:) = zgval(:,:,1,:)
+
+      ! 'Release' workspace array back to pool
+      IF(wrk_not_released(3, 1))THEN
+         CALL ctl_stop('obs_int_comm_2d : failed to release workspace array.')
+      END IF
 
    END SUBROUTINE obs_int_comm_2d
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90	(revision 2715)
@@ -38,4 +38,6 @@
       & glamt, glamu, glamv, &
       & gphit, gphiu, gphiv
+   USE lib_mpp,       ONLY : &
+      & ctl_warn, ctl_stop
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90	(revision 2715)
@@ -27,4 +27,6 @@
    USE obs_inter_sup      ! Interpolation support
    USE obs_oper           ! Observation operators
+   USE lib_mpp, ONLY : &
+      & ctl_warn, ctl_stop
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_profiles_def.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_profiles_def.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_profiles_def.F90	(revision 2715)
@@ -29,4 +29,6 @@
       obs_mpp_sum_integers
    USE obs_fbm            ! Obs feedback format
+   USE lib_mpp, ONLY : &
+      & ctl_warn, ctl_stop
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_altbias.F90	(revision 2715)
@@ -67,5 +67,7 @@
       !! * Modules used
       USE iom
-
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: z_altbias => wrk_2d_1   ! Array to store the alt bias values
+      !
       !! * Arguments
       INTEGER, INTENT(IN) :: kslano      ! Number of SLA Products
@@ -90,6 +92,4 @@
       INTEGER :: i_var_id
 
-      REAL(wp), DIMENSION(jpi,jpj) :: & 
-         & z_altbias           ! Array to store the alt bias values
       REAL(wp), DIMENSION(1) :: &
          & zext, &
@@ -109,4 +109,9 @@
       INTEGER :: numaltbias
 
+      IF(wrk_in_use(2, 1))THEN
+         CALL ctl_stop('obs_rea_altbias : requested workspace array unavailable.')
+         RETURN
+      END IF
+
       IF(lwp)WRITE(numout,*) 
       IF(lwp)WRITE(numout,*) ' obs_rea_altbias : '
@@ -206,4 +211,8 @@
       END DO
 
+      IF(wrk_not_released(2, 1))THEN
+         CALL ctl_stop('obs_rea_altbias : failed to release workspace array.')
+      END IF
+
    END SUBROUTINE obs_rea_altbias
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_prof.F90	(revision 2715)
@@ -26,4 +26,5 @@
    USE obs_oper                 ! Observation operators
    USE obs_prof_io              ! Profile files I/O (non-FB files)
+   USE lib_mpp                  ! For ctl_warn/stop
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_vel.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_vel.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_vel.F90	(revision 2715)
@@ -26,4 +26,5 @@
    USE obs_oper                 ! Observation operators
    USE obs_vel_io               ! Velocity profile files I/O (non-FB files)
+   USE lib_mpp                  ! For ctl_warn/stop
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_readmdt.F90	(revision 2715)
@@ -4,60 +4,42 @@
    !! Observation diagnostics: Read the MDT for SLA data (skeleton for now)
    !!======================================================================
-
-   !!----------------------------------------------------------------------
-   !!   obs_rea_mdt : Driver for reading MDT
-   !!----------------------------------------------------------------------
-
-   !! * Modules used   
-   USE par_kind, ONLY : &       ! Precision variables
-      & wp, &
-      & dp, &
-      & sp
-   USE par_oce, ONLY : &        ! Domain parameters
-      & jpi, &
-      & jpj, &
-      & jpim1
-   USE in_out_manager, ONLY : & ! I/O manager
-      & lwp,    &
-      & numout 
-   USE obs_surf_def             ! Surface observation definitions
-   USE dom_oce, ONLY : &        ! Domain variables
-      & tmask, &
-      & tmask_i, &
-      & e1t,   &
-      & e2t,   &
-      & gphit, &
-      & glamt
-   USE obs_const, ONLY : &
-      & obfillflt              ! Fillvalue
-   USE oce, ONLY : &           ! Model variables
-      & sshn
-   USE obs_inter_sup           ! Interpolation support routines
-   USE obs_inter_h2d           ! 2D interpolation
-   USE obs_utils               ! Various observation tools
-   USE lib_mpp, only: &        ! MPP routines
-      & lk_mpp, &
-      & mpp_sum
-   USE iom_nf90   
-   USE netcdf                   ! NetCDF library
+   !! History :      ! 2007-03 (K. Mogensen) Initial skeleton version
+   !!                ! 2007-04 (E. Remy) migration and improvement from OPAVAR
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   obs_rea_mdt    : Driver for reading MDT
+   !!   obs_offset_mdt : Remove the offset between the model MDT and the used one
+   !!----------------------------------------------------------------------
+   USE par_kind         ! Precision variables
+   USE par_oce          ! Domain parameters
+   USE in_out_manager   ! I/O manager
+   USE obs_surf_def     ! Surface observation definitions
+   USE obs_inter_sup    ! Interpolation support routines
+   USE obs_inter_h2d    ! 2D interpolation
+   USE obs_utils        ! Various observation tools
+   USE iom_nf90         ! IOM NetCDF
+   USE netcdf           ! NetCDF library
+   USE lib_mpp          ! MPP library
+   USE dom_oce, ONLY : &                  ! Domain variables
+      &                    tmask, tmask_i, e1t, e2t, gphit, glamt
+   USE obs_const, ONLY :   obfillflt      ! Fillvalue
+   USE oce      , ONLY :   sshn           ! Model variables
 
    IMPLICIT NONE
-
-   !! * Routine accessibility
    PRIVATE
-
-   INTEGER, PUBLIC :: nmsshc = 1        ! MDT correction scheme
-   REAL(wp), PUBLIC :: mdtcorr = 1.61   ! User specified MDT correction
-   REAL(wp), PUBLIC :: mdtcutoff = 65.0  ! MDT cutoff for computed correction
-   PUBLIC obs_rea_mdt     ! Read the MDT
-   PUBLIC obs_offset_mdt  ! Remove the offset between the model MDT and the 
-                          ! used one
+   
+   PUBLIC   obs_rea_mdt     ! called by ?
+   PUBLIC   obs_offset_mdt  ! called by ?
+
+   INTEGER , PUBLIC ::   nmsshc    = 1         ! MDT correction scheme
+   REAL(wp), PUBLIC ::   mdtcorr   = 1.61_wp   ! User specified MDT correction
+   REAL(wp), PUBLIC ::   mdtcutoff = 65.0_wp   ! MDT cutoff for computed correction
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -72,79 +54,45 @@
       !!
       !! ** Action  : 
-      !!
-      !! References :
-      !!
-      !! History :  
-      !!      ! :  2007-03 (K. Mogensen) Initial skeleton version
-      !!      ! :  2007-04 (E. Remy) migration and improvement from OPAVAR
-      !!----------------------------------------------------------------------
-      !! * Modules used
+      !!----------------------------------------------------------------------
       USE iom
-
-      !! * Arguments
-      INTEGER, INTENT(IN) :: kslano          ! Number of SLA Products
-      TYPE(obs_surf), DIMENSION(kslano), INTENT(INOUT) :: &
-         & sladata       ! SLA data
-      INTEGER, INTENT(IN) :: k2dint
-
-      !! * Local declarations
-
-      CHARACTER(LEN=12), PARAMETER :: &
-         & cpname = 'obs_rea_mdt'
-      CHARACTER(LEN=20), PARAMETER :: &
-         & mdtname = 'slaReferenceLevel.nc'
-
-      INTEGER :: jslano      ! Data set loop variable
-      INTEGER :: jobs        ! Obs loop variable
-      INTEGER :: jpimdt      ! Number of grid point in latitude for the MDT
-      INTEGER :: jpjmdt      ! Number of grid point in longitude for the MDT
-      INTEGER :: iico        ! Grid point indicies
-      INTEGER :: ijco 
-      INTEGER :: i_nx_id     ! Index to read the NetCDF file
-      INTEGER :: i_ny_id     ! 
-      INTEGER :: i_file_id   ! 
-      INTEGER :: i_var_id
-      INTEGER :: i_stat
-
-      REAL(wp), DIMENSION(jpi,jpj) :: & 
-         & z_mdt,       &  ! Array to store the MDT values
-         & mdtmask         ! Array to store the mask for the MDT
-      REAL(wp), DIMENSION(1) :: &
-         & zext, &
-         & zobsmask
-      REAL(wp), DIMENSION(2,2,1) :: &
-         & zweig
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: &
-         & zmask, &
-         & zmdtl, &
-         & zglam, &
-         & zgphi
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   z_mdt   => wrk_2d_1   ! Array to store the MDT values
+      USE wrk_nemo, ONLY:   mdtmask => wrk_2d_2   ! Array to store the mask for the MDT
+      !
+      INTEGER                          , INTENT(IN)    ::   kslano    ! Number of SLA Products
+      TYPE(obs_surf), DIMENSION(kslano), INTENT(inout) ::   sladata   ! SLA data
+      INTEGER                          , INTENT(in)    ::   k2dint    ! ?
+      !
+      CHARACTER(LEN=12), PARAMETER ::   cpname  = 'obs_rea_mdt'
+      CHARACTER(LEN=20), PARAMETER ::   mdtname = 'slaReferenceLevel.nc'
+
+      INTEGER ::   jslano              ! Data set loop variable
+      INTEGER ::   jobs                ! Obs loop variable
+      INTEGER ::   jpimdt, jpjmdt      ! Number of grid point in lat/lon for the MDT
+      INTEGER ::   iico, ijco          ! Grid point indicies
+      INTEGER ::   i_nx_id, i_ny_id, i_file_id, i_var_id, i_stat
+      INTEGER ::   nummdt
+      !
+      REAL(wp), DIMENSION(1)     ::   zext, zobsmask
+      REAL(wp), DIMENSION(2,2,1) ::   zweig
+      !
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   zmask, zmdtl, zglam, zgphi
+      INTEGER , DIMENSION(:,:,:), ALLOCATABLE ::   igrdi, igrdj
          
-      REAL(wp) :: zlam
-      REAL(wp) :: zphi
-      REAL(wp) :: zfill
-      REAL(sp) :: zinfill
-      INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: &
-         & igrdi, &
-         & igrdj
-      INTEGER :: nummdt
+      REAL(wp) :: zlam, zphi, zfill, zinfill    ! local scalar
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('obs_rea_mdt : requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp)WRITE(numout,*) 
-      IF(lwp)WRITE(numout,*) ' obs_rea_mdt : '
+      IF(lwp)WRITE(numout,*) ' obs_rea_mdt : Read MDT for referencing altimeter anomalies'
       IF(lwp)WRITE(numout,*) ' ------------- '
-      IF(lwp)WRITE(numout,*) '   Read MDT for referencing altimeter', &
-         &                   '   anomalies'
-
-      ! Open the file
-      
-      CALL iom_open( mdtname, nummdt )
-      
-      ! Get the MDT data
-
-      CALL iom_get( nummdt, jpdom_data, 'sossheig', z_mdt(:,:), 1 )
-
-      ! Close the file
-
-      CALL iom_close(nummdt)     
+
+      CALL iom_open( mdtname, nummdt )       ! Open the file
+      !                                      ! Get the MDT data
+      CALL iom_get ( nummdt, jpdom_data, 'sossheig', z_mdt(:,:), 1 )
+      CALL iom_close(nummdt)                 ! Close the file
       
       ! Read in the fill value
@@ -156,21 +104,16 @@
       i_stat = nf90_close( nummdt )
 
-! setup mask based on tmask and MDT mask
-! set mask to 0 where the MDT is set to fillvalue
-
-      WHERE(z_mdt(:,:) /= zfill)
-         mdtmask(:,:)=tmask(:,:,1)
-      ELSEWHERE
-         mdtmask(:,:)=0
+      ! setup mask based on tmask and MDT mask
+      ! set mask to 0 where the MDT is set to fillvalue
+      WHERE(z_mdt(:,:) /= zfill)   ;   mdtmask(:,:) = tmask(:,:,1)
+      ELSE WHERE                   ;   mdtmask(:,:) = 0
       END WHERE
 
       ! Remove the offset between the MDT used with the sla and the model MDT
-
-      IF ( nmsshc == 1 .OR. nmsshc == 2 ) CALL obs_offset_mdt( z_mdt, zfill )
+      IF( nmsshc == 1 .OR. nmsshc == 2 )   CALL obs_offset_mdt( z_mdt, zfill )
 
       ! Intepolate the MDT already on the model grid at the observation point
   
       DO jslano = 1, kslano
-
          ALLOCATE( &
             & igrdi(2,2,sladata(jslano)%nsurf), &
@@ -195,12 +138,8 @@
          END DO
 
-         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, &
-            &                  igrdi, igrdj, glamt, zglam )
-         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, &
-            &                  igrdi, igrdj, gphit, zgphi )
-         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, &
-            &                  igrdi, igrdj, mdtmask, zmask )
-         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, &
-            &                  igrdi, igrdj, z_mdt, zmdtl )
+         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, igrdi, igrdj, glamt  , zglam )
+         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, igrdi, igrdj, gphit  , zgphi )
+         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, igrdi, igrdj, mdtmask, zmask )
+         CALL obs_int_comm_2d( 2, 2, sladata(jslano)%nsurf, igrdi, igrdj, z_mdt  , zmdtl )
 
          DO jobs = 1, sladata(jslano)%nsurf
@@ -213,11 +152,10 @@
                &                   zmask(:,:,jobs), zweig, zobsmask )
             
-            CALL obs_int_h2d( 1, 1,      &
-                   &              zweig, zmdtl(:,:,jobs),  zext )
+            CALL obs_int_h2d( 1, 1, zweig, zmdtl(:,:,jobs),  zext )
  
             sladata(jslano)%rext(jobs,2) = zext(1)
 
 ! mark any masked data with a QC flag
-            IF ( zobsmask(1) == 0 ) sladata(jslano)%nqc(jobs) = 11
+            IF( zobsmask(1) == 0 )   sladata(jslano)%nqc(jobs) = 11
 
          END DO
@@ -234,8 +172,10 @@
       END DO
 
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('obs_rea_mdt: failed to release workspace arrays')
+      !
    END SUBROUTINE obs_rea_mdt
 
+
    SUBROUTINE obs_offset_mdt( mdt, zfill )
-
       !!---------------------------------------------------------------------
       !!
@@ -249,31 +189,20 @@
       !!
       !! ** Action  : 
-      !!
-      !! References :
-      !!
-      !! History :  
-      !!      ! :  2007-04 (E. Remy) migration from OPAVAR
-      !!----------------------------------------------------------------------
-      !! * Modules used
-
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(INOUT) :: &
-         & mdt           ! MDT used on the model grid
-      REAL(wp), INTENT(IN) :: zfill 
-
-      !! * Local declarations 
-      REAL(wp) :: zdxdy
-      REAL(wp) :: zarea
-      REAL(wp) :: zeta1
-      REAL(wp) :: zeta2
-      REAL(wp) :: zcorr_mdt  
-      REAL(wp) :: zcorr_bcketa
-      REAL(wp) :: zcorr
-      REAL(wp), DIMENSION(jpi,jpj) :: zpromsk
-      INTEGER :: jj
-      INTEGER :: ji
-      CHARACTER(LEN=14), PARAMETER :: &
-         & cpname = 'obs_offset_mdt'
-   
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zpromsk => wrk_2d_3
+      !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   mdt     ! MDT used on the model grid
+      REAL(wp)                    , INTENT(in   ) ::   zfill 
+      ! 
+      INTEGER  :: ji, jj
+      REAL(wp) :: zdxdy, zarea, zeta1, zeta2, zcorr_mdt, zcorr_bcketa, zcorr     ! local scalar
+      CHARACTER(LEN=14), PARAMETER ::   cpname = 'obs_offset_mdt'
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 3) ) THEN
+         CALL ctl_stop('obs_offset_mdt: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
       !  Initialize the local mask, for domain projection 
       !  Also exclude mdt points which are set to missing data
@@ -304,10 +233,10 @@
       END DO
 
-      IF( lk_mpp) CALL mpp_sum( zeta1 )
-      IF( lk_mpp) CALL mpp_sum( zeta2 )
-      IF( lk_mpp) CALL mpp_sum( zarea )
+      IF( lk_mpp)   CALL mpp_sum( zeta1 )
+      IF( lk_mpp)   CALL mpp_sum( zeta2 )
+      IF( lk_mpp)   CALL mpp_sum( zarea )
       
-      zcorr_mdt = zeta1 / zarea
-      zcorr_bcketa  = zeta2 / zarea
+      zcorr_mdt    = zeta1 / zarea
+      zcorr_bcketa = zeta2 / zarea
 
       !  Define correction term
@@ -317,9 +246,9 @@
       !  Correct spatial mean of the MSSH
 
-      IF ( nmsshc == 1 ) mdt(:,:) = mdt(:,:) - zcorr  
+      IF( nmsshc == 1 )   mdt(:,:) = mdt(:,:) - zcorr  
 
       ! User defined value : 1.6 m for the Rio MDT compared to ORCA2 MDT
 
-      IF ( nmsshc == 2 ) mdt(:,:) = mdt(:,:) - mdtcorr
+      IF( nmsshc == 2 )   mdt(:,:) = mdt(:,:) - mdtcorr
 
       IF(lwp) THEN
@@ -330,16 +259,14 @@
          WRITE(numout,*) '               zcorr         = ', zcorr
          WRITE(numout,*) '               nmsshc        = ', nmsshc
-         WRITE(numout,*) 
       ENDIF
 
-      IF ( nmsshc == 0 ) WRITE(numout,*) &
-         &                 '           MSSH correction is not applied'
-      IF ( nmsshc == 1 ) WRITE(numout,*) &
-         &                 '           MSSH correction is applied'
-      IF ( nmsshc == 2 ) WRITE(numout,*) &
-         &                 '           User defined MSSH correction' 
-
-
+      IF ( nmsshc == 0 ) WRITE(numout,*) '           MSSH correction is not applied'
+      IF ( nmsshc == 1 ) WRITE(numout,*) '           MSSH correction is applied'
+      IF ( nmsshc == 2 ) WRITE(numout,*) '           User defined MSSH correction' 
+
+      IF( wrk_not_released(2, 3) )   CALL ctl_stop('obs_offset_mdt: failed to release workspace array')
+      !
    END SUBROUTINE obs_offset_mdt
  
+   !!======================================================================
 END MODULE obs_readmdt
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_rot_vel.F90	(revision 2715)
@@ -55,5 +55,7 @@
       !!----------------------------------------------------------------------
       !! * Modules used
-   
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released   
+      USE wrk_nemo, ONLY: zsingu => wrk_2d_1, zcosgu => wrk_2d_2, &
+                          zsingv => wrk_2d_3, zcosgv => wrk_2d_4
       !! * Arguments
       TYPE(obs_prof), INTENT(INOUT) :: profdata    ! Profile data to be read
@@ -63,9 +65,4 @@
          & pv
       !! * Local declarations
-      REAL(wp), DIMENSION(jpi,jpj) :: &
-         & zsingu, &
-         & zcosgu, &
-         & zsingv, &
-         & zcosgv
       REAL(wp), DIMENSION(2,2,1) :: zweig
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: &
@@ -96,4 +93,9 @@
       INTEGER :: jk
 
+      IF(wrk_in_use(2, 1,2,3,4))THEN
+         CALL ctl_stop('obs_rotvel : requested workspace arrays unavailable.')
+         RETURN
+      END IF
+
       !-----------------------------------------------------------------------
       ! Allocate data for message parsing and interpolation
@@ -227,4 +229,8 @@
          & )
 
+      IF(wrk_not_released(2, 1,2,3,4))THEN
+         CALL ctl_stop('obs_rotvel : failed to release workspace arrays.')
+      END IF
+
    END SUBROUTINE obs_rotvel
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_utils.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_utils.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/OBS/obs_utils.F90	(revision 2715)
@@ -19,5 +19,6 @@
       & i8  
    USE in_out_manager           ! I/O manager
-  
+   USE lib_mpp                  ! For ctl_warn/stop
+
    IMPLICIT NONE
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 2715)
@@ -18,4 +18,5 @@
    USE phycst          ! physical constants
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -47,7 +48,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -65,4 +65,7 @@
       !! References :   Shine and Hendersson-Sellers 1985, JGR, 90(D1), 2243-2250.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_3d_6 , wrk_3d_7    ! 3D workspace
+      !!
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pt_ice      !  ice surface temperature (Kelvin)
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   ph_ice      !  sea-ice thickness
@@ -82,10 +85,16 @@
       REAL(wp) ::   zihsc2        ! = 1 hsn >= c2 ; = 0 hsn < c2
       !!
-      LOGICAL , DIMENSION(jpi,jpj,SIZE(pt_ice,3)) ::   llmask
-      REAL(wp), DIMENSION(jpi,jpj,SIZE(pt_ice,3)) ::   zalbfz    ! = rn_alphdi for freezing ice ; = rn_albice for melting ice
-      REAL(wp), DIMENSION(jpi,jpj,SIZE(pt_ice,3)) ::   zficeth   !  function of ice thickness
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zalbfz    ! = rn_alphdi for freezing ice ; = rn_albice for melting ice
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   zficeth   !  function of ice thickness
       !!---------------------------------------------------------------------
       
       ijpl = SIZE( pt_ice, 3 )                     ! number of ice categories
+
+      IF( wrk_in_use(3, 6,7) ) THEN
+         CALL ctl_stop('albedo_ice: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
+      ! Associate pointers with sub-arrays of workspace arrays
+      zalbfz  =>   wrk_3d_6(:,:,1:ijpl)
+      zficeth =>   wrk_3d_7(:,:,1:ijpl)
 
       IF( albd_init == 0 )   CALL albedo_init      ! initialization 
@@ -94,27 +103,36 @@
       !  Computation of  zficeth
       !---------------------------
-      llmask = ( ph_snw == 0.e0 ) .AND. ( pt_ice >= rt0_ice )
       ! ice free of snow and melts
-      WHERE( llmask )   ;   zalbfz = rn_albice
-      ELSEWHERE         ;   zalbfz = rn_alphdi
+      WHERE     ( ph_snw == 0._wp .AND. pt_ice >= rt0_ice )   ;   zalbfz(:,:,:) = rn_albice
+      ELSE WHERE                                              ;   zalbfz(:,:,:) = rn_alphdi
+      END  WHERE
+
+      WHERE     ( 1.5  < ph_ice                     )  ;  zficeth = zalbfz
+      ELSE WHERE( 1.0  < ph_ice .AND. ph_ice <= 1.5 )  ;  zficeth = 0.472  + 2.0 * ( zalbfz - 0.472 ) * ( ph_ice - 1.0 )
+      ELSE WHERE( 0.05 < ph_ice .AND. ph_ice <= 1.0 )  ;  zficeth = 0.2467 + 0.7049 * ph_ice              &
+         &                                                                 - 0.8608 * ph_ice * ph_ice     &
+         &                                                                 + 0.3812 * ph_ice * ph_ice * ph_ice
+      ELSE WHERE                                       ;  zficeth = 0.1    + 3.6    * ph_ice
       END WHERE
 
-      DO jl = 1, ijpl
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               IF( ph_ice(ji,jj,jl) > 1.5 ) THEN
-                  zficeth(ji,jj,jl) = zalbfz(ji,jj,jl)
-               ELSEIF( ph_ice(ji,jj,jl) > 1.0  .AND. ph_ice(ji,jj,jl) <= 1.5 ) THEN
-                  zficeth(ji,jj,jl) = 0.472 + 2.0 * ( zalbfz(ji,jj,jl) - 0.472 ) * ( ph_ice(ji,jj,jl) - 1.0 )
-               ELSEIF( ph_ice(ji,jj,jl) > 0.05 .AND. ph_ice(ji,jj,jl) <= 1.0 ) THEN
-                  zficeth(ji,jj,jl) = 0.2467 + 0.7049 * ph_ice(ji,jj,jl)                               &
-                     &                    - 0.8608 * ph_ice(ji,jj,jl) * ph_ice(ji,jj,jl)                 &
-                     &                    + 0.3812 * ph_ice(ji,jj,jl) * ph_ice(ji,jj,jl) * ph_ice (ji,jj,jl)
-               ELSE
-                  zficeth(ji,jj,jl) = 0.1 + 3.6 * ph_ice(ji,jj,jl) 
-               ENDIF
-            END DO
-         END DO
-      END DO
+!!gm old code
+!      DO jl = 1, ijpl
+!         DO jj = 1, jpj
+!            DO ji = 1, jpi
+!               IF( ph_ice(ji,jj,jl) > 1.5 ) THEN
+!                  zficeth(ji,jj,jl) = zalbfz(ji,jj,jl)
+!               ELSEIF( ph_ice(ji,jj,jl) > 1.0  .AND. ph_ice(ji,jj,jl) <= 1.5 ) THEN
+!                  zficeth(ji,jj,jl) = 0.472 + 2.0 * ( zalbfz(ji,jj,jl) - 0.472 ) * ( ph_ice(ji,jj,jl) - 1.0 )
+!               ELSEIF( ph_ice(ji,jj,jl) > 0.05 .AND. ph_ice(ji,jj,jl) <= 1.0 ) THEN
+!                  zficeth(ji,jj,jl) = 0.2467 + 0.7049 * ph_ice(ji,jj,jl)                               &
+!                     &                    - 0.8608 * ph_ice(ji,jj,jl) * ph_ice(ji,jj,jl)                 &
+!                     &                    + 0.3812 * ph_ice(ji,jj,jl) * ph_ice(ji,jj,jl) * ph_ice (ji,jj,jl)
+!               ELSE
+!                  zficeth(ji,jj,jl) = 0.1 + 3.6 * ph_ice(ji,jj,jl) 
+!               ENDIF
+!            END DO
+!         END DO
+!      END DO
+!!gm end old code
       
       !----------------------------------------------- 
@@ -155,4 +173,6 @@
       pa_ice_os(:,:,:) = pa_ice_cs(:,:,:) + rn_cloud       ! Oberhuber correction
       !
+      IF( wrk_not_released(3, 6,7) )   CALL ctl_stop('albedo_ice: failed to release workspace arrays')
+      !
    END SUBROUTINE albedo_ice
 
@@ -163,11 +183,9 @@
       !! 
       !! ** Purpose :   Computation of the albedo of the ocean
-      !!
-      !! ** Method  :   ....
-      !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) ::   pa_oce_os   !  albedo of ocean under overcast sky
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) ::   pa_oce_cs   !  albedo of ocean under clear sky
-      !!
-      REAL(wp) ::   zcoef   ! temporary scalar
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pa_oce_os   !  albedo of ocean under overcast sky
+      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pa_oce_cs   !  albedo of ocean under clear sky
+      !!
+      REAL(wp) ::   zcoef   ! local scalar
       !!----------------------------------------------------------------------
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 2715)
@@ -6,6 +6,6 @@
    !!=====================================================================
    !! History :   
-   !!   9.0  !  04-06  (R. Redler, NEC Laboratories Europe, St Augustin, Germany) Original code
-   !!   " "  !  04-11  (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Kiel, Germany) revision
+   !!   9.0  !  04-06  (R. Redler, NEC Laboratories Europe, Germany) Original code
+   !!   " "  !  04-11  (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Germany) revision
    !!   " "  !  04-11  (V. Gayler, MPI M&D) Grid writing
    !!   " "  !  05-08  (R. Redler, W. Park) frld initialization, paral(2) revision
@@ -17,5 +17,4 @@
    !!----------------------------------------------------------------------
    !!   'key_oasis3'                    coupled Ocean/Atmosphere via OASIS3
-   !!----------------------------------------------------------------------
    !!----------------------------------------------------------------------
    !!   cpl_prism_init     : initialization of coupled mode communication
@@ -33,17 +32,25 @@
    USE dom_oce                      ! ocean space and time domain
    USE in_out_manager               ! I/O manager
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lbclnk                       ! ocean lateral boundary conditions (or mpp link)
+
    IMPLICIT NONE
    PRIVATE
-!
-   LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .TRUE.   ! coupled flag
-   INTEGER, PUBLIC            :: OASIS_Rcv  = 1    ! return code if received field
-   INTEGER, PUBLIC            :: OASIS_idle = 0    ! return code if nothing done by oasis
-   INTEGER                    :: ncomp_id          ! id returned by prism_init_comp
-   INTEGER                    :: nerror            ! return error code
-
-   INTEGER, PARAMETER :: nmaxfld=40    ! Maximum number of coupling fields
+
+   PUBLIC   cpl_prism_init
+   PUBLIC   cpl_prism_define
+   PUBLIC   cpl_prism_snd
+   PUBLIC   cpl_prism_rcv
+   PUBLIC   cpl_prism_freq
+   PUBLIC   cpl_prism_finalize
+
+   LOGICAL, PUBLIC, PARAMETER ::   lk_cpl = .TRUE.   !: coupled flag
+   INTEGER, PUBLIC            ::   OASIS_Rcv  = 1    !: return code if received field
+   INTEGER, PUBLIC            ::   OASIS_idle = 0    !: return code if nothing done by oasis
+   INTEGER                    ::   ncomp_id          ! id returned by prism_init_comp
+   INTEGER                    ::   nerror            ! return error code
+
+   INTEGER, PARAMETER ::   nmaxfld=40    ! Maximum number of coupling fields
    
-   TYPE, PUBLIC ::   FLD_CPL            ! Type for coupling field information
+   TYPE, PUBLIC ::   FLD_CPL            !: Type for coupling field information
       LOGICAL            ::   laction   ! To be coupled or not
       CHARACTER(len = 8) ::   clname    ! Name of the coupling field   
@@ -53,26 +60,16 @@
    END TYPE FLD_CPL
 
-   TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC :: srcv, ssnd   ! Coupling fields
-
-   REAL(wp), DIMENSION(:,:), ALLOCATABLE :: exfld  ! Temporary buffer for receiving
-
-   !! Routine accessibility
-   PUBLIC cpl_prism_init
-   PUBLIC cpl_prism_define
-   PUBLIC cpl_prism_snd
-   PUBLIC cpl_prism_rcv
-   PUBLIC cpl_prism_freq
-   PUBLIC cpl_prism_finalize
+   TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC ::   srcv, ssnd   !: Coupling fields
+
+   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld   ! Temporary buffer for receiving
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE cpl_prism_init (kl_comm) 
-
+   SUBROUTINE cpl_prism_init( kl_comm )
       !!-------------------------------------------------------------------
       !!             ***  ROUTINE cpl_prism_init  ***
@@ -83,5 +80,5 @@
       !! ** Method  :   OASIS3 MPI communication 
       !!--------------------------------------------------------------------
-      INTEGER, INTENT(   OUT )   :: kl_comm       ! local communicator of the model
+      INTEGER, INTENT(out) ::   kl_comm   ! local communicator of the model
       !!--------------------------------------------------------------------
 
@@ -103,10 +100,9 @@
       IF ( nerror /= PRISM_Ok ) &
          CALL prism_abort_proto (ncomp_id, 'cpl_prism_init','Failure in prism_get_localcomm_proto' )
-
+      !
    END SUBROUTINE cpl_prism_init
 
 
-   SUBROUTINE cpl_prism_define (krcv, ksnd)
-
+   SUBROUTINE cpl_prism_define( krcv, ksnd )
       !!-------------------------------------------------------------------
       !!             ***  ROUTINE cpl_prism_define  ***
@@ -117,11 +113,10 @@
       !! ** Method  :   OASIS3 MPI communication 
       !!--------------------------------------------------------------------
-      INTEGER, INTENT( IN    )   :: krcv, ksnd     ! Number of received and sent coupling fields
-      !
-      INTEGER                    :: id_part
-      INTEGER                    :: paral(5)       ! OASIS3 box partition
-      INTEGER                    :: ishape(2,2)    ! shape of arrays passed to PSMILe
-      INTEGER                    :: ji             ! local loop indicees
-      !!
+      INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields
+      !
+      INTEGER :: id_part
+      INTEGER :: paral(5)       ! OASIS3 box partition
+      INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe
+      INTEGER :: ji             ! local loop indicees
       !!--------------------------------------------------------------------
 
@@ -142,7 +137,6 @@
       !
       ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror)
-      IF (nerror > 0) THEN
-         CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in allocating exfld')
-         RETURN
+      IF( nerror > 0 ) THEN
+         CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in allocating exfld')   ;   RETURN
       ENDIF
       !
@@ -197,11 +191,10 @@
       
       CALL prism_enddef_proto(nerror)
-      IF ( nerror /= PRISM_Ok )   CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef')
-      
+      IF( nerror /= PRISM_Ok )   CALL prism_abort_proto ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef')
+      !
    END SUBROUTINE cpl_prism_define
    
    
    SUBROUTINE cpl_prism_snd( kid, kstep, pdata, kinfo )
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_snd  ***
@@ -210,12 +203,8 @@
       !!      like sst or ice cover to the coupler or remote application.
       !!----------------------------------------------------------------------
-      !! * Arguments
-      !!
-      INTEGER,                      INTENT( IN    )   :: kid       ! variable index in the array
-      INTEGER,                      INTENT(   OUT )   :: kinfo     ! OASIS3 info argument
-      INTEGER,                      INTENT( IN    )   :: kstep     ! ocean time-step in seconds
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( IN    )   :: pdata
-      !!
-      !!
+      INTEGER                 , INTENT(in   ) ::   kid       ! variable index in the array
+      INTEGER                 , INTENT(  out) ::   kinfo     ! OASIS3 info argument
+      INTEGER                 , INTENT(in   ) ::   kstep     ! ocean time-step in seconds
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   pdata
       !!--------------------------------------------------------------------
       !
@@ -236,11 +225,11 @@
             WRITE(numout,*) '     -     Sum value is ', SUM(pdata)
             WRITE(numout,*) '****************'
-        ENDIF
-     ENDIF
+         ENDIF
+      ENDIF
+      !
     END SUBROUTINE cpl_prism_snd
 
 
    SUBROUTINE cpl_prism_rcv( kid, kstep, pdata, kinfo )
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_rcv  ***
@@ -249,10 +238,10 @@
       !!      like stresses and fluxes from the coupler or remote application.
       !!----------------------------------------------------------------------
-      INTEGER,                      INTENT( IN    )   :: kid       ! variable index in the array
-      INTEGER,                      INTENT( IN    )   :: kstep     ! ocean time-step in seconds
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( INOUT )   :: pdata     ! IN to keep the value if nothing is done
-      INTEGER,                      INTENT(   OUT )   :: kinfo     ! OASIS3 info argument
-      !!
-      LOGICAL                :: llaction
+      INTEGER                 , INTENT(in   ) ::   kid       ! variable index in the array
+      INTEGER                 , INTENT(in   ) ::   kstep     ! ocean time-step in seconds
+      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pdata     ! IN to keep the value if nothing is done
+      INTEGER                 , INTENT(  out) ::   kinfo     ! OASIS3 info argument
+      !!
+      LOGICAL ::   llaction
       !!--------------------------------------------------------------------
       !
@@ -291,10 +280,9 @@
          kinfo = OASIS_idle     
       ENDIF
-
+      !
    END SUBROUTINE cpl_prism_rcv
 
 
-   FUNCTION cpl_prism_freq( kid )  
-
+   INTEGER FUNCTION cpl_prism_freq( kid )  
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_freq  ***
@@ -302,13 +290,12 @@
       !! ** Purpose : - send back the coupling frequency for a particular field
       !!----------------------------------------------------------------------
-      INTEGER,INTENT( IN )   :: kid              ! variable index 
-      INTEGER                :: cpl_prism_freq   ! coupling frequency
+      INTEGER,INTENT(in) ::   kid   ! variable index 
+      !!----------------------------------------------------------------------
       cpl_prism_freq = ig_def_freq( kid )
-
+      !
    END FUNCTION cpl_prism_freq
 
 
    SUBROUTINE cpl_prism_finalize
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_finalize  ***
@@ -318,16 +305,13 @@
       !!      MPI communication.
       !!----------------------------------------------------------------------
-
-      DEALLOCATE(exfld)
-      CALL prism_terminate_proto ( nerror )         
-
+      !
+      DEALLOCATE( exfld )
+      CALL prism_terminate_proto( nerror )         
+      !
    END SUBROUTINE cpl_prism_finalize
 
 #else
-
-   !!----------------------------------------------------------------------
-   !!   Default case                                Forced Ocean/Atmosphere
-   !!----------------------------------------------------------------------
-   !!   Empty module
+   !!----------------------------------------------------------------------
+   !!   Default case          Dummy module          Forced Ocean/Atmosphere
    !!----------------------------------------------------------------------
    USE in_out_manager               ! I/O manager
@@ -335,18 +319,15 @@
    PUBLIC cpl_prism_init
    PUBLIC cpl_prism_finalize
-
 CONTAINS
-
    SUBROUTINE cpl_prism_init (kl_comm) 
-      INTEGER, INTENT(   OUT )   :: kl_comm       ! local communicator of the model
+      INTEGER, INTENT(out)   :: kl_comm       ! local communicator of the model
       kl_comm = -1
       WRITE(numout,*) 'cpl_prism_init: Error you sould not be there...'
    END SUBROUTINE cpl_prism_init
-
    SUBROUTINE cpl_prism_finalize
       WRITE(numout,*) 'cpl_prism_finalize: Error you sould not be there...'
    END SUBROUTINE cpl_prism_finalize
-
 #endif
 
+   !!=====================================================================
 END MODULE cpl_oasis3
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis4.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis4.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis4.F90	(revision 2715)
@@ -5,35 +5,42 @@
    !!=====================================================================
    !! History :   
-   !!   9.0  !  04-06  (R. Redler, NEC Laboratories Europe, St Augustin, Germany) Original code
-   !!   " "  !  04-11  (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Kiel, Germany) revision
-   !!   " "  !  04-11  (V. Gayler, MPI M&D) Grid writing
-   !!   " "  !  05-08  (R. Redler, W. Park) frld initialization, paral(2) revision
-   !!   " "  !  05-09  (R. Redler) extended to allow for communication over root only
-   !!   " "  !  06-01  (W. Park) modification of physical part
-   !!   " "  !  06-02  (R. Redler, W. Park) buffer array fix for root exchange
-   !!   " "  !  2010   (E. Maisonnave and S. Masson) complete rewrite
+   !!   9.0  !  2004-06  (R. Redler, NEC Laboratories Europe, St Augustin, Germany) Original code
+   !!    -   !  2004-11  (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Kiel, Germany) revision
+   !!    -   !  2004-11  (V. Gayler, MPI M&D) Grid writing
+   !!    -   !  2005-08  (R. Redler, W. Park) frld initialization, paral(2) revision
+   !!    -   !  2005-09  (R. Redler) extended to allow for communication over root only
+   !!    -   !  2006-01  (W. Park) modification of physical part
+   !!    -   !  2006-02  (R. Redler, W. Park) buffer array fix for root exchange
+   !!    -   !  2010-10  (E. Maisonnave and S. Masson) complete rewrite
    !!----------------------------------------------------------------------
 #if defined key_oasis4
    !!----------------------------------------------------------------------
    !!   'key_oasis4'                    coupled Ocean/Atmosphere via OASIS4
-   !!----------------------------------------------------------------------
    !!----------------------------------------------------------------------
    !!   cpl_prism_init     : initialization of coupled mode communication
    !!   cpl_prism_define   : definition of grid and fields
-   !!   cpl_prism_snd     : snd out fields in coupled mode
-   !!   cpl_prism_rcv     : receive fields in coupled mode
-   !!   cpl_prism_update_time   : update date sent to Oasis
+   !!   cpl_prism_snd      : snd out fields in coupled mode
+   !!   cpl_prism_rcv      : receive fields in coupled mode
+   !!   cpl_prism_update_time : update date sent to Oasis
    !!   cpl_prism_finalize : finalize the coupled mode communication
    !!----------------------------------------------------------------------
-   USE prism              ! OASIS4 prism module
-   USE par_oce                      ! ocean parameters
-   USE dom_oce                      ! ocean space and time domain
-   USE domwri                       ! ocean space and time domain
-   USE in_out_manager               ! I/O manager
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE prism            ! OASIS4 prism module
+   USE par_oce          ! ocean parameters
+   USE dom_oce          ! ocean space and time domain
+   USE domwri           ! ocean space and time domain
+   USE in_out_manager   ! I/O manager
+   USE lbclnk           ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
-!
+
+   PUBLIC cpl_prism_init
+   PUBLIC cpl_prism_define
+   PUBLIC cpl_prism_snd
+   PUBLIC cpl_prism_rcv
+   PUBLIC cpl_prism_update_time
+   PUBLIC cpl_prism_finalize
+   
 !   LOGICAL, PUBLIC, PARAMETER :: lk_cpl = .TRUE.    ! coupled flag
    INTEGER                    :: ncomp_id           ! id returned by prism_init_comp
@@ -59,23 +66,12 @@
    TYPE(PRISM_Time_struct), PUBLIC    :: date_bound(2)   ! date info for send operation
 
-
-   !! Routine accessibility
-   PUBLIC cpl_prism_init
-   PUBLIC cpl_prism_define
-   PUBLIC cpl_prism_snd
-   PUBLIC cpl_prism_rcv
-   PUBLIC cpl_prism_update_time
-   PUBLIC cpl_prism_finalize
-
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
-   !! $Header$ 
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE cpl_prism_init (kl_comm) 
-
+   SUBROUTINE cpl_prism_init( kl_comm ) 
       !!-------------------------------------------------------------------
       !!             ***  ROUTINE cpl_prism_init  ***
@@ -86,6 +82,6 @@
       !! ** Method  :   OASIS4 MPI communication 
       !!--------------------------------------------------------------------
-      INTEGER, INTENT(   OUT )   :: kl_comm       ! local communicator of the model
-      !
+      INTEGER, INTENT(out) ::   kl_comm   ! local communicator of the model
+      !!--------------------------------------------------------------------
       
       CALL prism_init( 'nemo', nerror )
@@ -102,11 +98,9 @@
       CALL prism_get_localcomm( ncomp_id, kl_comm, nerror )
       IF( nerror /= PRISM_Success )   CALL prism_abort( ncomp_id, 'cpl_prism_init', 'Failure in prism_get_localcomm' )
-
-
+      !
    END SUBROUTINE cpl_prism_init
 
 
-   SUBROUTINE cpl_prism_define (krcv, ksnd)
-
+   SUBROUTINE cpl_prism_define( krcv, ksnd )
       !!-------------------------------------------------------------------
       !!             ***  ROUTINE cpl_prism_define  ***
@@ -117,30 +111,31 @@
       !! ** Method  :   OASIS4 MPI communication 
       !!--------------------------------------------------------------------
-      INTEGER, INTENT( IN    )   :: krcv, ksnd     ! Number of received and sent coupling fields
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zclo => wrk_3d_1, zcla => wrk_3d_2
+      USE wrk_nemo, ONLY: zlon => wrk_2d_1, zlat => wrk_2d_2
+      !
+      INTEGER, INTENT(in) :: krcv, ksnd     ! Number of received and sent coupling fields
       !
       INTEGER, DIMENSION(4)      :: igrid     ! ids returned by prism_def_grid
       INTEGER, DIMENSION(4)      :: iptid     ! ids returned by prism_set_points
-
-      INTEGER, DIMENSION(4)      :: imskid  ! ids returned by prism_set_mask
-      INTEGER, DIMENSION(4)      :: iishift     ! 
-      INTEGER, DIMENSION(4)      :: ijshift    ! 
+      INTEGER, DIMENSION(4)      :: imskid    ! ids returned by prism_set_mask
+      INTEGER, DIMENSION(4)      :: iishift   ! 
+      INTEGER, DIMENSION(4)      :: ijshift   ! 
       INTEGER, DIMENSION(4)      :: iioff     ! 
-      INTEGER, DIMENSION(4)      :: ijoff    ! 
-      INTEGER, DIMENSION(4)      :: itmp    ! 
-      INTEGER, DIMENSION(1,3)    :: iextent    ! 
-      INTEGER, DIMENSION(1,3)    :: ioffset    ! 
-
-
-      INTEGER                    :: ishape(2,3)     ! shape of arrays passed to PSMILe
+      INTEGER, DIMENSION(4)      :: ijoff     ! 
+      INTEGER, DIMENSION(4)      :: itmp      ! 
+      INTEGER, DIMENSION(1,3)    :: iextent   ! 
+      INTEGER, DIMENSION(1,3)    :: ioffset   ! 
+
+      INTEGER                    :: ishape(2,3)    ! shape of arrays passed to PSMILe
       INTEGER                    :: data_type      ! data type of transients
-
 
       LOGICAL                    :: new_points
       LOGICAL                    :: new_mask
-      LOGICAL                    :: llmask(jpi,jpj,1)
-
-      INTEGER                    :: ji, jj, jg, jc     ! local loop indicees
-      INTEGER                    :: ii,ij     ! index
-      INTEGER, DIMENSION(1)      :: ind     ! index
+      LOGICAL, ALLOCATABLE, SAVE :: llmask(:,:,:) ! jpi,jpj,1
+
+      INTEGER                    :: ji, jj, jg, jc   ! local loop indicees
+      INTEGER                    :: ii, ij           ! index
+      INTEGER, DIMENSION(1)      :: ind              ! index
 
       CHARACTER(len=32)          :: clpt_name     ! name of the grid points
@@ -148,11 +143,11 @@
       CHARACTER(len=1), DIMENSION(4) :: clgrd = (/ 'T','U','V','F' /)     ! name of the grid points
 
-      REAL(kind=wp), DIMENSION(jpi,jpj,4)  :: zclo, zcla
-      REAL(kind=wp), DIMENSION(jpi,jpj  )  :: zlon, zlat
-
       TYPE(PRISM_Time_struct)    :: tmpdate
       INTEGER                    :: idate_incr      ! date increment
-      !!
-      !!--------------------------------------------------------------------
+      !!--------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) .OR. wrk_in_use(2, 1,2) )THEN
+         CALL ctl_stop('cpl_prism_define: ERROR: requested workspace arrays are unavailable.')   ;   RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
@@ -170,4 +165,11 @@
       ENDIF
 
+      IF(.not. ALLOCATED(mask))THEN
+         ALLOCATE(llmask(jpi,jpj,1), Stat=ji)
+         IF(ji /= 0)THEN
+            CALL prism_abort( ncomp_id, 'cpl_prism_define', 'Failure in allocating llmask' )
+            RETURN
+         END IF
+      END IF
 
       ! -----------------------------------------------------------------
@@ -320,9 +322,11 @@
       IF ( nerror /= PRISM_Success )   CALL prism_abort ( ncomp_id, 'cpl_prism_define', 'Failure in prism_enddef')
       
+      IF( wrk_not_released(3, 1,2) .OR.   &
+          wrk_not_released(2, 1,2)   )   CALL ctl_stop('cpl_prism_define: failed to release workspace arrays')
+      !
    END SUBROUTINE cpl_prism_define
    
    
    SUBROUTINE cpl_prism_snd( kid, kstep, pdata, kinfo )
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_snd  ***
@@ -331,12 +335,8 @@
       !!      like sst or ice cover to the coupler or remote application.
       !!----------------------------------------------------------------------
-      !! * Arguments
-      !!
-      INTEGER,                      INTENT( IN    )   :: kid       ! variable intex in the array
-      INTEGER,                      INTENT(   OUT )   :: kinfo     ! OASIS4 info argument
-      INTEGER,                      INTENT( IN    )   :: kstep     ! ocean time-step in seconds
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( IN    )   :: pdata
-      !!
-      !!
+      INTEGER                 , INTENT(in   ) ::   kid     ! variable intex in the array
+      INTEGER                 , INTENT(  out) ::   kinfo   ! OASIS4 info argument
+      INTEGER                 , INTENT(in   ) ::   kstep   ! ocean time-step in seconds
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   pdata
       !!--------------------------------------------------------------------
       !
@@ -348,5 +348,5 @@
          &                                               'Failure in prism_put for '//TRIM(ssnd(kid)%clname) )
 
-      IF ( ln_ctl ) THEN        
+      IF( ln_ctl ) THEN        
          IF ( kinfo >= PRISM_Cpl     .OR. kinfo == PRISM_Rst .OR.   &
             & kinfo == PRISM_RstTimeop ) THEN
@@ -360,11 +360,11 @@
             WRITE(numout,*) '     -     Sum value is ', SUM(pdata)
             WRITE(numout,*) '****************'
-        ENDIF
-     ENDIF
-    END SUBROUTINE cpl_prism_snd
+         ENDIF
+      ENDIF
+      !
+   END SUBROUTINE cpl_prism_snd
 
 
    SUBROUTINE cpl_prism_rcv( kid, kstep, pdata, kinfo )
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_rcv  ***
@@ -373,9 +373,9 @@
       !!      like stresses and fluxes from the coupler or remote application.
       !!----------------------------------------------------------------------
-      INTEGER,                      INTENT( IN    )   :: kid       ! variable intex in the array
-      INTEGER,                      INTENT( IN    )   :: kstep     ! ocean time-step in seconds
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( INOUT )   :: pdata     ! IN to keep the value if nothing is done
-      INTEGER,                      INTENT(   OUT )   :: kinfo     ! OASIS4 info argument
-      !!
+      INTEGER                 , INTENT(in   ) ::   kid     ! variable intex in the array
+      INTEGER                 , INTENT(in   ) ::   kstep   ! ocean time-step in seconds
+      REAL(wp), DIMENSION(:,:), INTENT(inout) ::   pdata   ! IN to keep the value if nothing is done
+      INTEGER                 , INTENT(  out) ::   kinfo   ! OASIS4 info argument
+      !
       LOGICAL                :: llaction
       !!--------------------------------------------------------------------
@@ -418,11 +418,9 @@
          kinfo = OASIS_idle     
       ENDIF
-
-
+      !
    END SUBROUTINE cpl_prism_rcv
 
 
    SUBROUTINE cpl_prism_finalize
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_finalize  ***
@@ -432,33 +430,30 @@
       !!      MPI communication.
       !!----------------------------------------------------------------------
-
+      !
       DEALLOCATE(exfld)
       CALL prism_terminate ( nerror )         
-
+      !
    END SUBROUTINE cpl_prism_finalize
 
+
    SUBROUTINE cpl_prism_update_time(kt)
-
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_prism_update_time  ***
       !!
       !! ** Purpose : - Increment date with model timestep
-      !!      called explicitly at the end of each timestep
+      !!                called explicitly at the end of each timestep
       !!----------------------------------------------------------------------
-
-      INTEGER, INTENT(in) ::   kt       ! ocean model time step index
-
-      TYPE(PRISM_Time_struct)    :: tmpdate
-      INTEGER                    :: idate_incr     ! date increment
-
-
-      IF( kt == nit000 ) THEN
-      !
-      ! Define the actual date 
-      !
-      ! date is determined by adding days since beginning of the run to the corresponding initial date.
-      ! Note that OPA internal info about the start date of the experiment is bypassed.
-      ! Instead we rely sololy on the info provided by the SCC.xml file.
-      !
+      INTEGER, INTENT(in) ::   kt   ! ocean model time step index
+
+      TYPE(PRISM_Time_struct) ::   tmpdate
+      INTEGER                 ::   idate_incr   ! date increment
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN      ! Define the actual date 
+         !
+         ! date is determined by adding days since beginning of the run to the corresponding initial date.
+         ! Note that OPA internal info about the start date of the experiment is bypassed.
+         ! Instead we rely sololy on the info provided by the SCC.xml file.
+         !
          date = PRISM_Jobstart_date
          !
@@ -469,9 +464,7 @@
          tmpdate = date   ;   CALL PRISM_calc_newdate ( tmpdate, -idate_incr, nerror )   ;   date_bound(1) = tmpdate
          tmpdate = date   ;   CALL PRISM_calc_newdate ( tmpdate,  idate_incr, nerror )   ;   date_bound(2) = tmpdate
-
-      ELSE
-      !
-      ! Date update
-      !
+         !
+      ELSE      ! Date update
+         !
          idate_incr  = rdttra(1)
          CALL PRISM_calc_newdate( date, idate_incr, nerror )
@@ -480,10 +473,11 @@
          CALL PRISM_calc_newdate( tmpdate, idate_incr, nerror )
          date_bound(2) = tmpdate
-
+         !
       END IF
-
+      !
    END SUBROUTINE cpl_prism_update_time
 
 #endif
 
+   !!=====================================================================
 END MODULE cpl_oasis4
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 2715)
@@ -4,7 +4,7 @@
    !! Ocean forcing:  read input field for surface boundary condition
    !!=====================================================================
-   !! History :  9.0  !  06-06  (G. Madec) Original code
-   !!                 !  05-08  (S. Alderson) Modified for Interpolation in memory
-   !!                 !         from input grid to model grid
+   !! History :  2.0  !  06-2006  (S. Masson, G. Madec) Original code
+   !!                 !  05-2008  (S. Alderson) Modified for Interpolation in memory
+   !!                 !                         from input grid to model grid
    !!----------------------------------------------------------------------
 
@@ -15,9 +15,10 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
-   USE ioipsl, ONLY :   ymds2ju, ju2ymds   ! for calendar
    USE phycst          ! ???
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O manager library
    USE geo2ocean       ! for vector rotation on to model grid
+   USE lib_mpp         ! MPP library
+   USE ioipsl, ONLY :   ymds2ju, ju2ymds   ! for calendar
 
    IMPLICIT NONE
@@ -33,6 +34,6 @@
       CHARACTER(len = 34)  ::   wname       ! generic name of a NetCDF weights file to be used, blank if not
       CHARACTER(len = 34)  ::   vcomp       ! symbolic component name if a vector that needs rotation
-                                            ! a string starting with "U" or "V" for each component   
-                                            ! chars 2 onwards identify which components go together  
+      !                                     ! a string starting with "U" or "V" for each component   
+      !                                     ! chars 2 onwards identify which components go together  
    END TYPE FLD_N
 
@@ -51,5 +52,5 @@
       REAL(wp) , ALLOCATABLE, DIMENSION(:,:,:,:) ::   fdta       ! 2 consecutive record of input fields
       CHARACTER(len = 256)            ::   wgtname      ! current name of the NetCDF weight file acting as a key
-                                                        ! into the WGTLIST structure
+      !                                                 ! into the WGTLIST structure
       CHARACTER(len = 34)             ::   vcomp        ! symbolic name for a vector component that needs rotation
       LOGICAL                         ::   rotn         ! flag to indicate whether field has been rotated
@@ -65,5 +66,5 @@
       INTEGER , DIMENSION(2)                  ::   ddims        ! shape of input grid
       INTEGER , DIMENSION(2)                  ::   botleft      ! top left corner of box in input grid containing 
-                                                                ! current processor grid
+      !                                                         ! current processor grid
       INTEGER , DIMENSION(2)                  ::   topright     ! top right corner of box 
       INTEGER                                 ::   jpiwgt       ! width of box on input grid
@@ -72,6 +73,6 @@
       INTEGER                                 ::   nestid       ! for agrif, keep track of nest we're in
       INTEGER                                 ::   overlap      ! =0 when cyclic grid has no overlapping EW columns
-                                                                ! =>1 when they have one or more overlapping columns      
-                                                                ! =-1 not cyclic
+      !                                                         ! =>1 when they have one or more overlapping columns      
+      !                                                         ! =-1 not cyclic
       LOGICAL                                 ::   cyclic       ! east-west cyclic or not
       INTEGER,  DIMENSION(:,:,:), POINTER     ::   data_jpi     ! array of source integers
@@ -93,7 +94,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -259,6 +259,4 @@
       !! ** Purpose :  - if time interpolation, read before data 
       !!               - open current year file
-      !!
-      !! ** Method  :   
       !!----------------------------------------------------------------------
       INTEGER  , INTENT(in   ) ::   kn_fsbc   ! sbc computation period (in time step) 
@@ -394,5 +392,5 @@
          CALL fld_clopn( sdjf, iyear, imonth, iday )
       ENDIF 
-
+      !
    END SUBROUTINE fld_init
 
@@ -408,6 +406,4 @@
       !!                  nrec_a(1): record number
       !!                  nrec_b(2) and nrec_a(2): time of the beginning and end of the record (for print only)
-      !!
-      !! ** Method  :   
       !!----------------------------------------------------------------------
       INTEGER  , INTENT(in   )           ::   kn_fsbc   ! sbc computation period (in time step) 
@@ -555,11 +551,9 @@
       !!
       !! ** Purpose :   read the data
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      TYPE(FLD), INTENT(inout)   ::   sdjf   ! input field related variables
-      !!
-      INTEGER                    ::   ipk    ! number of vertical levels of sdjf%fdta ( 2D: ipk=1 ; 3D: ipk=jpk )
-      INTEGER                    ::   iw     ! index into wgts array
+      !!----------------------------------------------------------------------
+      TYPE(FLD), INTENT(inout) ::   sdjf   ! input field related variables
+      !!
+      INTEGER                  ::   ipk    ! number of vertical levels of sdjf%fdta ( 2D: ipk=1 ; 3D: ipk=jpk )
+      INTEGER                  ::   iw     ! index into wgts array
       !!---------------------------------------------------------------------
             
@@ -593,7 +587,8 @@
       !!
       !! ** Purpose :   Vector fields may need to be rotated onto the local grid direction
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: utmp => wrk_2d_4, vtmp => wrk_2d_5      ! 2D workspace
+      !!
       INTEGER  , INTENT(in   )               ::   kt        ! ocean time step
       TYPE(FLD), INTENT(inout), DIMENSION(:) ::   sd        ! input field related variables
@@ -603,7 +598,11 @@
       INTEGER                      ::   ill          ! character length
       INTEGER                      ::   iv           ! indice of V component
-      REAL(wp), DIMENSION(jpi,jpj) ::   utmp, vtmp   ! temporary arrays for vector rotation
       CHARACTER (LEN=100)          ::   clcomp       ! dummy weight name
       !!---------------------------------------------------------------------
+
+      IF(wrk_in_use(2, 4,5) ) THEN
+         CALL ctl_stop('fld_rot: ERROR: requested workspace arrays are unavailable.')   ;   RETURN
+      END IF
+
       !! (sga: following code should be modified so that pairs arent searched for each time
       !
@@ -638,4 +637,7 @@
           ENDIF
        END DO
+      !
+      IF(wrk_not_released(2, 4,5) )    CALL ctl_stop('fld_rot: ERROR: failed to release workspace arrays.')
+      !
    END SUBROUTINE fld_rot
 
@@ -646,12 +648,11 @@
       !!
       !! ** Purpose :   update the file name and open the file
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      TYPE(FLD), INTENT(inout)           ::   sdjf                  ! input field related variables
-      INTEGER  , INTENT(in   )           ::   kyear                 ! year value
-      INTEGER  , INTENT(in   )           ::   kmonth                ! month value
-      INTEGER  , INTENT(in   )           ::   kday                  ! day value
-      LOGICAL  , INTENT(in   ), OPTIONAL ::   ldstop                ! stop if open to read a non-existing file (default = .TRUE.)
+      !!----------------------------------------------------------------------
+      TYPE(FLD)        , INTENT(inout) ::   sdjf     ! input field related variables
+      INTEGER          , INTENT(in   ) ::   kyear    ! year value
+      INTEGER          , INTENT(in   ) ::   kmonth   ! month value
+      INTEGER          , INTENT(in   ) ::   kday     ! day value
+      LOGICAL, OPTIONAL, INTENT(in   ) ::   ldstop   ! stop if open to read a non-existing file (default = .TRUE.)
+      !!----------------------------------------------------------------------
 
       IF( sdjf%num /= 0 )   CALL iom_close( sdjf%num )   ! close file if already open
@@ -680,6 +681,4 @@
       !!
       !! ** Purpose :   fill sdf with sdf_n and control print
-      !!
-      !! ** Method  :   
       !!----------------------------------------------------------------------
       TYPE(FLD)  , DIMENSION(:), INTENT(inout) ::   sdf        ! structure of input fields (file informations, fields read)
@@ -735,13 +734,10 @@
       !!                if it is a new entry, the weights data is read in and
       !!                restructured (fld_weight)
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      TYPE( FLD ),      INTENT(in)    ::   sd        ! field with name of weights file
-      INTEGER,      INTENT(inout)     ::   kwgt      ! index of weights
-      !!
-      INTEGER                         ::   kw
-      INTEGER                         ::   nestid
-      LOGICAL                         ::   found
+      !!----------------------------------------------------------------------
+      TYPE( FLD ), INTENT(in   ) ::   sd        ! field with name of weights file
+      INTEGER    , INTENT(inout) ::   kwgt      ! index of weights
+      !!
+      INTEGER ::   kw, nestid   ! local integer
+      LOGICAL ::   found        ! local logical
       !!----------------------------------------------------------------------
       !
@@ -769,7 +765,8 @@
          CALL fld_weight( sd )
       ENDIF
-
+      !
    END SUBROUTINE wgt_list
 
+
    SUBROUTINE wgt_print( )
       !!---------------------------------------------------------------------
@@ -777,12 +774,8 @@
       !!
       !! ** Purpose :   print the list of known weights
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      !!
-      INTEGER                         ::   kw
-      !!----------------------------------------------------------------------
-      !
-
+      !!----------------------------------------------------------------------
+      INTEGER ::   kw   !
+      !!----------------------------------------------------------------------
+      !
       DO kw = 1, nxt_wgt-1
          WRITE(numout,*) 'weight file:  ',TRIM(ref_wgts(kw)%wgtname)
@@ -801,6 +794,7 @@
          IF( ASSOCIATED(ref_wgts(kw)%data_wgt) )  WRITE(numout,*) '       allocated'
       END DO
-
+      !
    END SUBROUTINE wgt_print
+
 
    SUBROUTINE fld_weight( sd )
@@ -810,20 +804,24 @@
       !! ** Purpose :   create a new WGT structure and fill in data from  
       !!                file, restructuring as required
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      TYPE( FLD ),      INTENT(in)            ::   sd            ! field with name of weights file
-      !!
-      INTEGER                                 ::   jn            ! dummy loop indices
-      INTEGER                                 ::   inum          ! temporary logical unit
-      INTEGER                                 ::   id            ! temporary variable id
-      INTEGER                                 ::   ipk           ! temporary vertical dimension
-      CHARACTER (len=5)                       ::   aname
-      INTEGER , DIMENSION(3)                  ::   ddims
-      INTEGER , DIMENSION(jpi, jpj)           ::   data_src
-      REAL(wp), DIMENSION(jpi, jpj)           ::   data_tmp
-      LOGICAL                                 ::   cyclical
-      INTEGER                                 ::   zwrap         ! temporary integer
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY:   data_tmp =>  wrk_2d_1     ! 2D real    workspace
+      USE wrk_nemo, ONLY:   data_src => iwrk_2d_1     ! 2D integer workspace
+      !!
+      TYPE( FLD ), INTENT(in) ::   sd   ! field with name of weights file
+      !!
+      INTEGER                ::   jn            ! dummy loop indices
+      INTEGER                ::   inum          ! temporary logical unit
+      INTEGER                ::   id            ! temporary variable id
+      INTEGER                ::   ipk           ! temporary vertical dimension
+      CHARACTER (len=5)      ::   aname
+      INTEGER , DIMENSION(3) ::   ddims
+      LOGICAL                ::   cyclical
+      INTEGER                ::   zwrap      ! local integer
+      !!----------------------------------------------------------------------
+      !
+      IF(  wrk_in_use(2, 1)  .OR.  iwrk_in_use(2,1) ) THEN
+         CALL ctl_stop('fld_weights: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
       !
       IF( nxt_wgt > tot_wgts ) THEN
@@ -937,7 +935,11 @@
       ENDIF
 
+      IF(  wrk_not_released(2, 1) .OR.    &
+          iwrk_not_released(2, 1)  )   CALL ctl_stop('fld_weights: failed to release workspace arrays')
+      !
    END SUBROUTINE fld_weight
 
-   SUBROUTINE fld_interp(num, clvar, kw, kk, dta, nrec)
+
+   SUBROUTINE fld_interp( num, clvar, kw, kk, dta, nrec )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE fld_interp  ***
@@ -945,23 +947,20 @@
       !! ** Purpose :   apply weights to input gridded data to create data
       !!                on model grid
-      !!
-      !! ** Method  :   
-      !!----------------------------------------------------------------------
-      INTEGER,          INTENT(in)                        ::   num                 ! stream number
-      CHARACTER(LEN=*), INTENT(in)                        ::   clvar               ! variable name
-      INTEGER,          INTENT(in)                        ::   kw                  ! weights number
-      INTEGER,          INTENT(in)                        ::   kk                  ! vertical dimension of kk
-      REAL(wp),         INTENT(inout), DIMENSION(jpi,jpj,kk) ::   dta              ! output field on model grid
-      INTEGER,          INTENT(in)                        ::   nrec                ! record number to read (ie time slice)
+      !!----------------------------------------------------------------------
+      INTEGER                   , INTENT(in   ) ::   num     ! stream number
+      CHARACTER(LEN=*)          , INTENT(in   ) ::   clvar   ! variable name
+      INTEGER                   , INTENT(in   ) ::   kw      ! weights number
+      INTEGER                   , INTENT(in   ) ::   kk      ! vertical dimension of kk
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   dta     ! output field on model grid
+      INTEGER                   , INTENT(in   ) ::   nrec    ! record number to read (ie time slice)
       !! 
-      INTEGER, DIMENSION(3)                               ::   rec1,recn           ! temporary arrays for start and length
-      INTEGER                                             ::  jk, jn, jm           ! loop counters
-      INTEGER                                             ::  ni, nj               ! lengths
-      INTEGER                                             ::  jpimin,jpiwid        ! temporary indices
-      INTEGER                                             ::  jpjmin,jpjwid        ! temporary indices
-      INTEGER                                             ::  jpi1,jpi2,jpj1,jpj2  ! temporary indices
-      !!----------------------------------------------------------------------
-      !
-
+      INTEGER, DIMENSION(3) ::   rec1,recn   ! temporary arrays for start and length
+      INTEGER ::  jk, jn, jm           ! loop counters
+      INTEGER ::  ni, nj               ! lengths
+      INTEGER ::  jpimin,jpiwid        ! temporary indices
+      INTEGER ::  jpjmin,jpjwid        ! temporary indices
+      INTEGER ::  jpi1,jpi2,jpj1,jpj2  ! temporary indices
+      !!----------------------------------------------------------------------
+      !
       !! for weighted interpolation we have weights at four corners of a box surrounding 
       !! a model grid point, each weight is multiplied by a grid value (bilinear case)
@@ -1083,19 +1082,19 @@
         END DO
 
-        ! gradient in the ij direction
-        DO jk = 1,4
-          DO jn = 1, jpj
-            DO jm = 1,jpi
-              ni = ref_wgts(kw)%data_jpi(jm,jn,jk)
-              nj = ref_wgts(kw)%data_jpj(jm,jn,jk)
-              dta(jm,jn,:) = dta(jm,jn,:) + ref_wgts(kw)%data_wgt(jm,jn,jk+12) * 0.25 * ( &
+         ! gradient in the ij direction
+         DO jk = 1,4
+            DO jn = 1, jpj
+               DO jm = 1,jpi
+                  ni = ref_wgts(kw)%data_jpi(jm,jn,jk)
+                  nj = ref_wgts(kw)%data_jpj(jm,jn,jk)
+                  dta(jm,jn,:) = dta(jm,jn,:) + ref_wgts(kw)%data_wgt(jm,jn,jk+12) * 0.25 * ( &
                                (ref_wgts(kw)%fly_dta(ni+2,nj+2,:) - ref_wgts(kw)%fly_dta(ni  ,nj+2,:)) -   &
                                (ref_wgts(kw)%fly_dta(ni+2,nj  ,:) - ref_wgts(kw)%fly_dta(ni  ,nj  ,:)))
+               END DO
             END DO
-          END DO
-        END DO
-
+         END DO
+         !
       END IF
-
+      !
    END SUBROUTINE fld_interp
 
@@ -1106,6 +1105,4 @@
       !!
       !! ** Purpose :  
-      !!
-      !! ** Method  :
       !!---------------------------------------------------------------------
       CHARACTER(len=*), INTENT(in)   ::   cdday   !3 first letters of the first day of the weekly file
@@ -1119,5 +1116,5 @@
       DO ijul = 1, 7
          IF( cl_week(ijul) == TRIM(cdday) ) EXIT
-      ENDDO
+      END DO
       IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%cltype(6:8): '//TRIM(cdday) )
       !
@@ -1129,4 +1126,4 @@
    END FUNCTION ksec_week
 
-
+   !!======================================================================
 END MODULE fldread
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 2715)
@@ -19,4 +19,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -29,9 +30,12 @@
    PUBLIC   obs_rot
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   &
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &
       gsint, gcost,   &  ! cos/sin between model grid lines and NP direction at T point
       gsinu, gcosu,   &  ! cos/sin between model grid lines and NP direction at U point
       gsinv, gcosv,   &  ! cos/sin between model grid lines and NP direction at V point
       gsinf, gcosf       ! cos/sin between model grid lines and NP direction at F point
+
+   LOGICAL ,              SAVE, DIMENSION(4)     ::   linit = .FALSE.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gsinlon, gcoslon, gsinlat, gcoslat
 
    LOGICAL ::   lmust_init = .TRUE.        !: used to initialize the cos/sin variables (se above)
@@ -42,7 +46,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -93,5 +96,4 @@
       !!                                                           ! 'ij->n' model i-j componantes to east componante
       REAL(wp), DIMENSION(jpi,jpj), INTENT(out) ::   prot      
-
       !!----------------------------------------------------------------------
 
@@ -103,8 +105,7 @@
          IF(lwp) WRITE(numout,*) ' rot_rep : geographic <--> stretched'
          IF(lwp) WRITE(numout,*) ' ~~~~~    coordinate transformation'
-
+         !
          CALL angle       ! initialization of the transformation
          lmust_init = .FALSE.
-
       ENDIF
       
@@ -166,6 +167,6 @@
       !!   9.2  !  07-04  (S. Masson)  Add T, F points and bugfix in cos lateral boundary
       !!----------------------------------------------------------------------
-      INTEGER ::   ji, jj      ! dummy loop indices
-      !!
+      INTEGER ::   ji, jj   ! dummy loop indices
+      INTEGER ::   ierr     ! local integer
       REAL(wp) ::   &
          zlam, zphi,            &  ! temporary scalars
@@ -181,4 +182,11 @@
       !!----------------------------------------------------------------------
 
+      ALLOCATE( gsint(jpi,jpj), gcost(jpi,jpj),   & 
+         &      gsinu(jpi,jpj), gcosu(jpi,jpj),   & 
+         &      gsinv(jpi,jpj), gcosv(jpi,jpj),   &  
+         &      gsinf(jpi,jpj), gcosf(jpi,jpj), STAT=ierr )
+      IF(lk_mpp)   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+
       ! ============================= !
       ! Compute the cosinus and sinus !
@@ -343,11 +351,16 @@
       REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::  pte, ptn
       !!
-      REAL(wp), PARAMETER :: rpi = 3.141592653E0
+      REAL(wp), PARAMETER :: rpi = 3.141592653e0
       REAL(wp), PARAMETER :: rad = rpi / 180.e0
       INTEGER ::   ig     !
-      !! * Local save
-      REAL(wp), SAVE, DIMENSION(jpi,jpj,4) ::   zsinlon, zcoslon, zsinlat, zcoslat
-      LOGICAL , SAVE, DIMENSION(4)         ::   linit = .FALSE.
-      !!----------------------------------------------------------------------
+      INTEGER ::   ierr   ! local integer
+      !!----------------------------------------------------------------------
+
+      IF( .NOT. ALLOCATED( gsinlon ) ) THEN
+         ALLOCATE( gsinlon(jpi,jpj,4) , gcoslon(jpi,jpj,4) ,   &
+            &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+      ENDIF
 
       SELECT CASE( cgrid)
@@ -355,8 +368,8 @@
             ig = 1
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamt(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamt(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphit(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphit(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamt(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamt(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphit(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphit(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -364,8 +377,8 @@
             ig = 2
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamu(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamu(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphiu(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphiu(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamu(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamu(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphiu(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphiu(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -373,8 +386,8 @@
             ig = 3
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamv(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamv(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphiv(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphiv(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamv(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamv(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphiv(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphiv(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -382,8 +395,8 @@
             ig = 4
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamf(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamf(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphif(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphif(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamf(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamf(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphif(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphif(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -393,11 +406,11 @@
       END SELECT
       
-      pte = - zsinlon(:,:,ig) * pxx + zcoslon(:,:,ig) * pyy
-      ptn = - zcoslon(:,:,ig) * zsinlat(:,:,ig) * pxx    &
-            - zsinlon(:,:,ig) * zsinlat(:,:,ig) * pyy    &
-            + zcoslat(:,:,ig) * pzz
-!!$   ptv =   zcoslon(:,:,ig) * zcoslat(:,:,ig) * pxx    &
-!!$         + zsinlon(:,:,ig) * zcoslat(:,:,ig) * pyy    &
-!!$         + zsinlat(:,:,ig) * pzz
+      pte = - gsinlon(:,:,ig) * pxx + gcoslon(:,:,ig) * pyy
+      ptn = - gcoslon(:,:,ig) * gsinlat(:,:,ig) * pxx    &
+            - gsinlon(:,:,ig) * gsinlat(:,:,ig) * pyy    &
+            + gcoslat(:,:,ig) * pzz
+!!$   ptv =   gcoslon(:,:,ig) * gcoslat(:,:,ig) * pxx    &
+!!$         + gsinlon(:,:,ig) * gcoslat(:,:,ig) * pyy    &
+!!$         + gsinlat(:,:,ig) * pzz
       !
    END SUBROUTINE geo2oce
@@ -422,8 +435,13 @@
       REAL(wp), PARAMETER :: rad = rpi / 180.e0
       INTEGER ::   ig     !
-      !! * Local save
-      REAL(wp), SAVE, DIMENSION(jpi,jpj,4) ::   zsinlon, zcoslon, zsinlat, zcoslat
-      LOGICAL , SAVE, DIMENSION(4)         ::   linit = .FALSE.
-      !!----------------------------------------------------------------------
+      INTEGER ::   ierr   ! local integer
+      !!----------------------------------------------------------------------
+
+      IF( ALLOCATED( gsinlon ) ) THEN
+         ALLOCATE( gsinlon(jpi,jpj,4) , gcoslon(jpi,jpj,4) ,   &
+            &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+      ENDIF
 
       SELECT CASE( cgrid)
@@ -431,8 +449,8 @@
             ig = 1
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamt(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamt(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphit(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphit(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamt(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamt(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphit(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphit(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -440,8 +458,8 @@
             ig = 2
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamu(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamu(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphiu(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphiu(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamu(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamu(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphiu(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphiu(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -449,8 +467,8 @@
             ig = 3
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamv(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamv(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphiv(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphiv(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamv(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamv(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphiv(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphiv(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -458,8 +476,8 @@
             ig = 4
             IF( .NOT. linit(ig) ) THEN 
-               zsinlon(:,:,ig) = SIN( rad * glamf(:,:) )
-               zcoslon(:,:,ig) = COS( rad * glamf(:,:) )
-               zsinlat(:,:,ig) = SIN( rad * gphif(:,:) )
-               zcoslat(:,:,ig) = COS( rad * gphif(:,:) )
+               gsinlon(:,:,ig) = SIN( rad * glamf(:,:) )
+               gcoslon(:,:,ig) = COS( rad * glamf(:,:) )
+               gsinlat(:,:,ig) = SIN( rad * gphif(:,:) )
+               gcoslat(:,:,ig) = COS( rad * gphif(:,:) )
                linit(ig) = .TRUE.
             ENDIF
@@ -469,7 +487,7 @@
       END SELECT
 
-       pxx = - zsinlon(:,:,ig) * pte - zcoslon(:,:,ig) * zsinlat(:,:,ig) * ptn 
-       pyy =   zcoslon(:,:,ig) * pte - zsinlon(:,:,ig) * zsinlat(:,:,ig) * ptn
-       pzz =   zcoslat(:,:,ig) * ptn
+       pxx = - gsinlon(:,:,ig) * pte - gcoslon(:,:,ig) * gsinlat(:,:,ig) * ptn 
+       pyy =   gcoslon(:,:,ig) * pte - gsinlon(:,:,ig) * gsinlat(:,:,ig) * ptn
+       pzz =   gcoslat(:,:,ig) * ptn
 
       
@@ -495,14 +513,10 @@
       !!   8.5  !  02-08  (G. Madec)  F90: Free form
       !!----------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), INTENT( IN   ), DIMENSION(jpi,jpj) ::   &
-         px1, py1          ! two horizontal components to be rotated
-      REAL(wp), INTENT( OUT  ), DIMENSION(jpi,jpj) ::   &
-         px2, py2          ! the two horizontal components in the model repere
-      INTEGER, INTENT( IN ) ::   &
-         kchoix   ! type of transformation
-                  ! = 1 change from geographic to model grid.
-                  ! =-1 change from model to geographic grid
-      CHARACTER(len=1), INTENT( IN ), OPTIONAL ::   cd_type      ! define the nature of pt2d array grid-points
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   px1, py1   ! two horizontal components to be rotated
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   px2, py2   ! the two horizontal components in the model repere
+      INTEGER , INTENT(in   )                     ::   kchoix     ! type of transformation
+      !                                                           ! = 1 change from geographic to model grid.
+      !                                                           ! =-1 change from model to geographic grid
+      CHARACTER(len=1), INTENT(in   ), OPTIONAL   ::   cd_type    ! define the nature of pt2d array grid-points
       !
       CHARACTER(len=1) ::   cl_type      ! define the nature of pt2d array grid-points (T point by default)
@@ -536,7 +550,5 @@
       !!   9.2  !  09-02  (K. Mogensen)
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT( OUT )::   &
-         & psinu, pcosu, psinv, pcosv! copy of data
-
+      REAL(wp), DIMENSION(jpi,jpj), INTENT( OUT )::   psinu, pcosu, psinv, pcosv   ! copy of data
       !!----------------------------------------------------------------------
 
@@ -561,5 +573,4 @@
    END SUBROUTINE obs_rot
 
-
   !!======================================================================
 END MODULE geo2ocean
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/oasis4_date.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/oasis4_date.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/oasis4_date.F90	(revision 2715)
@@ -1,33 +1,41 @@
 MODULE oasis4_date
-   !!---------------------------------------------------------------------
-   !!                     ***  oasis_date.h90  ***  
+   !!======================================================================
+   !!                     ***  MODULE oasis_date  ***  
    !!   Date and related information required to couple NEMO via OASIS4
    !!   Made separate from cpl_oasis4 module to allow wider use.
-   !!=====================================================================
-   !! History :   
-   !!   9.0  !  05-12  (R. Hill, Met. Office) Original code
+   !!======================================================================
+   !! History :  2.0  ! 2005-12  (R. Hill, Met. Office) Original code
    !!----------------------------------------------------------------------
 #if defined key_oasis4
+   !!----------------------------------------------------------------------
+   !!   'key_oasis4'                                   coupled with OASIS-4
+   !!----------------------------------------------------------------------
+   !##################### WARNING coupled mode ###############################
+   !##################### WARNING coupled mode ###############################
+   !   Following line must be enabled if coupling with OASIS
+   !   USE PRISM
+   !##################### WARNING coupled mode ###############################
+   !##################### WARNING coupled mode ###############################
+
+   PRIVATE
+   IMPLICIT NONE
+
+   INTEGER, PUBLIC :: date_err, date_info   !: 
+
+   TYPE(PRISM_Time_struct), PUBLIC ::   dates            !: date info for send operation
+   TYPE(PRISM_Time_struct), PUBLIC ::   dates_bound(2)   !: date info for send operation
+   TYPE(PRISM_Time_struct), PUBLIC ::   dater            !: date info for receive operation
+   TYPE(PRISM_Time_struct), PUBLIC ::   dater_bound(2)   !: date info for receive operation
+   TYPE(PRISM_Time_struct), PUBLIC ::   tmpdate          !:
+   
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option            Dummy module                   NO OASIS-4
+   !!----------------------------------------------------------------------
+#endif
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-!##################### WARNING coupled mode ###############################
-!##################### WARNING coupled mode ###############################
-!   Following line must be enabled if coupling with OASIS
-!   USE PRISM
-!##################### WARNING coupled mode ###############################
-!##################### WARNING coupled mode ###############################
-
-   IMPLICIT NONE
-
-   INTEGER :: date_err, date_info
-   !!---------------------------------------------------------------------
-   TYPE(PRISM_Time_struct), PUBLIC    :: dates          ! date info for send operation
-   TYPE(PRISM_Time_struct), PUBLIC    :: dates_bound(2) ! date info for send operation
-   TYPE(PRISM_Time_struct), PUBLIC    :: dater          ! date info for receive operation
-   TYPE(PRISM_Time_struct), PUBLIC    :: dater_bound(2) ! date info for receive operation
-   TYPE(PRISM_Time_struct), PUBLIC    :: tmpdate
-#endif
+   !!======================================================================
 END MODULE oasis4_date
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90	(revision 2715)
@@ -2,8 +2,9 @@
    !!======================================================================
    !!                 ***  MODULE  sbc_ice  ***
-   !!        parameter and  variables defined in memory in forced mode
+   !! Surface module - LIM-3: parameters & variables defined in memory
    !!======================================================================
-   !! History :  3.0  !  2006-08  (G. Madec)  Surface module
-   !!            3.2  !  2009-06  (S. Masson) merge with ice_oce
+   !! History :  3.0  ! 2006-08  (G. Madec)  Surface module
+   !!            3.2  ! 2009-06  (S. Masson) merge with ice_oce
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3 || defined key_lim2
@@ -13,12 +14,16 @@
    USE par_oce          ! ocean parameters
 # if defined key_lim3
-   USE par_ice          ! ice parameters
+   USE par_ice          ! LIM-3 parameters
 # endif
 # if defined key_lim2
-   USE par_ice_2        ! ice parameters
+   USE par_ice_2        ! LIM-2 parameters
 # endif
+   USE lib_mpp          ! MPP library
+   USE in_out_manager   ! I/O manager
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC sbc_ice_alloc ! called in iceini(_2).F90
 
 # if defined  key_lim2
@@ -37,21 +42,44 @@
 # endif
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   qns_ice   !: non solar heat flux over ice                         [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   qsr_ice   !: solar heat flux over ice                             [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   qla_ice   !: latent flux over ice                                 [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   dqla_ice  !: latent sensibility over ice                          [W/m2/K]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   dqns_ice  !: non solar heat flux sensibility over ice (LW+SEN+LA) [W/m2/K]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   tn_ice    !: ice surface temperature                              [K]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpl) ::   alb_ice   !: albedo of ice
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qns_ice   !: non solar heat flux over ice                  [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice   !: solar heat flux over ice                      [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qla_ice   !: latent flux over ice                          [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dqla_ice  !: latent sensibility over ice                 [W/m2/K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dqns_ice  !: non solar heat flux over ice (LW+SEN+LA)    [W/m2/K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice    !: ice surface temperature                          [K]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   alb_ice   !: albedo of ice
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   utau_ice    !: u-stress over ice (I-pt for VP or U,V-pts for EVP)   [N/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   vtau_ice    !: v-stress over ice (I-pt for VP or U,V-pts for EVP)   [N/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fr1_i0      !: 1st fraction of Qsr which penetrates inside the ice cover
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fr2_i0      !: 2nd fraction of Qsr which penetrates inside the ice cover
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emp_ice     !: solid freshwater budget over ice: sublivation - snow
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   utau_ice  !: atmos-ice u-stress. VP: I-pt ; EVP: U,V-pts   [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   vtau_ice  !: atmos-ice v-stress. VP: I-pt ; EVP: U,V-pts   [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr1_i0    !: 1st Qsr fraction penetrating inside ice cover    [-]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fr2_i0    !: 2nd Qsr fraction penetrating inside ice cover    [-]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   emp_ice   !: sublimation-snow budget over ice             [kg/m2]
 
 # if defined key_lim3
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tatm_ice    !: air temperature
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tatm_ice    !: air temperature
 # endif
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION sbc_ice_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  FUNCTION sbc_ice_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( qns_ice (jpi,jpj,jpl) , qsr_ice (jpi,jpj,jpl) ,     &
+         &      qla_ice (jpi,jpj,jpl) , dqla_ice(jpi,jpj,jpl) ,     &
+         &      dqns_ice(jpi,jpj,jpl) , tn_ice  (jpi,jpj,jpl) ,     &
+         &      alb_ice (jpi,jpj,jpl) ,                             &
+         &      utau_ice(jpi,jpj)     , vtau_ice(jpi,jpj)     ,     &
+         &      fr1_i0  (jpi,jpj)     , fr2_i0  (jpi,jpj)     ,     &
+         &      emp_ice(jpi,jpj)                              , STAT= sbc_ice_alloc )
+         !
+      IF( lk_mpp            )   CALL mpp_sum ( sbc_ice_alloc )
+      IF( sbc_ice_alloc > 0 )   CALL ctl_warn('sbc_ice_alloc: allocation of arrays failed')
+   END FUNCTION sbc_ice_alloc
 
 #else
@@ -64,8 +92,4 @@
 #endif
 
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE sbc_ice
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 2715)
@@ -10,13 +10,23 @@
    !!            3.3  ! 2010-10  (J. Chanut, C. Bricaud)  add the surface pressure forcing
    !!----------------------------------------------------------------------
-   USE par_oce          ! ocean parameters
+
+   !!----------------------------------------------------------------------
+   !!   sbc_oce_alloc : allocation of sbc arrays
+   !!   sbc_tau2wnd   : wind speed estimated from wind stress
+   !!----------------------------------------------------------------------
+   USE par_oce        ! ocean parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC   sbc_oce_alloc   ! routine called in sbcmod.F90
+   PUBLIC   sbc_tau2wnd     ! routine called in several sbc modules
    
    !!----------------------------------------------------------------------
    !!           Namelist for the Ocean Surface Boundary Condition
    !!----------------------------------------------------------------------
-   !                                             !! * namsbc namelist *
+   !                                            !!* namsbc namelist *
    LOGICAL , PUBLIC ::   ln_ana      = .FALSE.   !: analytical boundary condition flag
    LOGICAL , PUBLIC ::   ln_flx      = .FALSE.   !: flux      formulation
@@ -39,26 +49,26 @@
    LOGICAL , PUBLIC ::   lhftau = .FALSE.        !: HF tau used in TKE: mean(stress module) - module(mean stress)
    !!                                   !!   now    ! before   !!
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   taum              !: module of sea surface stress (at T-point)    [N/m2] 
-   !! wndm is used only in PISCES to compute surface gases exchanges in ice-free ocean or leads
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qsr               !: sea heat flux:     solar                     [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qsr_tot           !: total     solar heat flux (over sea and ice) [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qns_tot           !: total non solar heat flux (over sea and ice) [W/m2]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emp    , emp_b    !: freshwater budget: volume flux               [Kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emps   , emps_b   !: freshwater budget: concentration/dillution   [Kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rnf    , rnf_b    !: river runoff   [Kg/m2/s]  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   vtau   , vtau_b   !: sea surface j-stress (ocean referential)     [N/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   taum              !: module of sea surface stress (at T-point)    [N/m2] 
+   !! wndm is used onmpute surface gases exchanges in ice-free ocean or leads
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                     [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tot           !: total     solar heat flux (over sea and ice) [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns_tot           !: total non solar heat flux (over sea and ice) [W/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp    , emp_b    !: freshwater budget: volume flux               [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emps   , emps_b   !: freshwater budget: concentration/dillution   [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff   [Kg/m2/s]  
    !!
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpts) ::  sbc_tsc, sbc_tsc_b  !: sbc content trend                      [K.m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   qsr_hc , qsr_hc_b   !: heat content trend due to qsr flux     [K.m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  sbc_tsc, sbc_tsc_b  !: sbc content trend                      [K.m/s] jpi,jpj,jpts
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  qsr_hc , qsr_hc_b   !: heat content trend due to qsr flux     [K.m/s] jpi,jpj,jpk
    !!
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tprecip           !: total precipitation                          [Kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sprecip           !: solid precipitation                          [Kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fr_i              !: ice fraction = 1 - lead fraction      (between 0 to 1)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tprecip           !: total precipitation                          [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sprecip           !: solid precipitation                          [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fr_i              !: ice fraction = 1 - lead fraction      (between 0 to 1)
 #if defined key_cpl_carbon_cycle
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   atm_co2           !: atmospheric pCO2                             [ppm]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   atm_co2           !: atmospheric pCO2                             [ppm]
 #endif
 
@@ -67,14 +77,82 @@
    !!----------------------------------------------------------------------
    INTEGER , PUBLIC                     ::   nn_fsbc   !: frequency of sbc computation (as well as sea-ice model)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ssu_m     !: mean (nn_fsbc time-step) surface sea i-current (U-point) [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ssv_m     !: mean (nn_fsbc time-step) surface sea j-current (V-point) [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sst_m     !: mean (nn_fsbc time-step) surface sea temperature     [Celsius]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sss_m     !: mean (nn_fsbc time-step) surface sea salinity            [psu]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ssh_m     !: mean (nn_fsbc time-step) sea surface height                [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssu_m     !: mean (nn_fsbc time-step) surface sea i-current (U-point) [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssv_m     !: mean (nn_fsbc time-step) surface sea j-current (V-point) [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sst_m     !: mean (nn_fsbc time-step) surface sea temperature     [Celsius]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sss_m     !: mean (nn_fsbc time-step) surface sea salinity            [psu]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssh_m     !: mean (nn_fsbc time-step) sea surface height                [m]
 
+   !! * Substitutions
+#  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION sbc_oce_alloc()
+      !!---------------------------------------------------------------------
+      !!                  ***  FUNCTION sbc_oce_alloc  ***
+      !!---------------------------------------------------------------------
+      INTEGER :: ierr(4)
+      !!---------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( utau(jpi,jpj) , utau_b(jpi,jpj) , taum(jpi,jpj) ,     &
+         &      vtau(jpi,jpj) , vtau_b(jpi,jpj) , wndm(jpi,jpj) , STAT=ierr(1) ) 
+         !
+      ALLOCATE( qns_tot(jpi,jpj) , qns   (jpi,jpj) , qns_b(jpi,jpj),        &
+         &      qsr_tot(jpi,jpj) , qsr   (jpi,jpj) ,                        &
+         &      emp    (jpi,jpj) , emp_b (jpi,jpj) ,                        &
+         &      emps   (jpi,jpj) , emps_b(jpi,jpj) , emp_tot(jpi,jpj) , STAT=ierr(2) )
+         !
+      ALLOCATE( rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,     &
+         &      rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) , STAT=ierr(3) )
+         !
+      ALLOCATE( tprecip(jpi,jpj) , sprecip(jpi,jpj) , fr_i(jpi,jpj) ,     &
+#if defined key_cpl_carbon_cycle
+         &      atm_co2(jpi,jpj) ,                                        &
+#endif
+         &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) ,                       &
+         &      ssv_m  (jpi,jpj) , sss_m  (jpi,jpj), ssh_m(jpi,jpj) , STAT=ierr(4) )
+         !
+      sbc_oce_alloc = MAXVAL( ierr )
+      IF( lk_mpp            )   CALL mpp_sum ( sbc_oce_alloc )
+      IF( sbc_oce_alloc > 0 )   CALL ctl_warn('sbc_oce_alloc: allocation of arrays failed')
+      !
+   END FUNCTION sbc_oce_alloc
+
+
+   SUBROUTINE sbc_tau2wnd
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_tau2wnd  ***
+      !!                   
+      !! ** Purpose : Estimation of wind speed as a function of wind stress   
+      !!
+      !! ** Method  : |tau|=rhoa*Cd*|U|^2
+      !!---------------------------------------------------------------------
+      USE dom_oce         ! ocean space and time domain
+      USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+      REAL(wp) ::   zrhoa  = 1.22         ! Air density kg/m3
+      REAL(wp) ::   zcdrag = 1.5e-3       ! drag coefficient
+      REAL(wp) ::   ztx, zty, ztau, zcoef ! temporary variables
+      INTEGER  ::   ji, jj                ! dummy indices
+      !!---------------------------------------------------------------------
+      zcoef = 0.5 / ( zrhoa * zcdrag ) 
+!CDIR NOVERRCHK
+      DO jj = 2, jpjm1
+!CDIR NOVERRCHK
+         DO ji = fs_2, fs_jpim1   ! vect. opt.
+            ztx = utau(ji-1,jj  ) + utau(ji,jj) 
+            zty = vtau(ji  ,jj-1) + vtau(ji,jj) 
+            ztau = SQRT( ztx * ztx + zty * zty )
+            wndm(ji,jj) = SQRT ( ztau * zcoef ) * tmask(ji,jj,1)
+         END DO
+      END DO
+      CALL lbc_lnk( wndm(:,:) , 'T', 1. )
+      !
+   END SUBROUTINE sbc_tau2wnd
+
    !!======================================================================
 END MODULE sbc_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 2715)
@@ -27,12 +27,12 @@
    PUBLIC   sbc_gyre   ! routine called in sbcmod module
 
-   !                               !!* Namelist namsbc_ana *
-   INTEGER  ::   nn_tau000 = 1      ! nb of time-step during which the surface stress
-   !                                ! increase from 0 to its nominal value 
-   REAL(wp) ::   rn_utau0  = 0.e0   ! constant wind stress value in i-direction
-   REAL(wp) ::   rn_vtau0  = 0.e0   ! constant wind stress value in j-direction
-   REAL(wp) ::   rn_qns0   = 0.e0   ! non solar heat flux
-   REAL(wp) ::   rn_qsr0   = 0.e0   !     solar heat flux
-   REAL(wp) ::   rn_emp0   = 0.e0   ! net freshwater flux
+   !                                !!* Namelist namsbc_ana *
+   INTEGER  ::   nn_tau000 = 1       ! nb of time-step during which the surface stress
+   !                                 ! increase from 0 to its nominal value 
+   REAL(wp) ::   rn_utau0  = 0._wp   ! constant wind stress value in i-direction
+   REAL(wp) ::   rn_vtau0  = 0._wp   ! constant wind stress value in j-direction
+   REAL(wp) ::   rn_qns0   = 0._wp   ! non solar heat flux
+   REAL(wp) ::   rn_qsr0   = 0._wp   !     solar heat flux
+   REAL(wp) ::   rn_emp0   = 0._wp   ! net freshwater flux
    
    !! * Substitutions
@@ -42,7 +42,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -64,9 +63,9 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt       ! ocean time step
-      !!
-      REAL(wp)            ::   zfacto                ! local scalar
-      REAL(wp)            ::   zrhoa  = 1.22         ! Air density kg/m3
-      REAL(wp)            ::   zcdrag = 1.5e-3       ! drag coefficient
-      REAL(wp)            ::   ztx, zty, zmod, zcoef ! temporary variables
+      !
+      REAL(wp) ::   zfacto                ! local scalar
+      REAL(wp) ::   zrhoa  = 1.22_wp      ! Air density kg/m3
+      REAL(wp) ::   zcdrag = 1.5e-3_wp    ! drag coefficient
+      REAL(wp) ::   ztx, zty, zmod, zcoef ! temporary variables
       !!
       NAMELIST/namsbc_ana/ nn_tau000, rn_utau0, rn_vtau0, rn_qns0, rn_qsr0, rn_emp0
@@ -75,6 +74,6 @@
       IF( kt == nit000 ) THEN
          !
-         REWIND ( numnam )                   ! Read Namelist namsbc : surface fluxes
-         READ   ( numnam, namsbc_ana )
+         REWIND( numnam )                    ! Read Namelist namsbc : surface fluxes
+         READ  ( numnam, namsbc_ana )
          !
          IF(lwp) WRITE(numout,*)' '
@@ -88,12 +87,12 @@
          IF(lwp) WRITE(numout,*)'              net heat flux          rn_emp0   = ', rn_emp0  , ' Kg/m2/s'
          !
-         nn_tau000 = MAX( nn_tau000, 1 )   ! must be >= 1
+         nn_tau000 = MAX( nn_tau000, 1 )     ! must be >= 1
          !
       ENDIF
 
-      qns   (:,:) = rn_qns0
-      qsr   (:,:) = rn_qsr0
-      emp   (:,:) = rn_emp0
-      emps  (:,:) = rn_emp0
+      qns (:,:) = rn_qns0
+      qsr (:,:) = rn_qsr0
+      emp (:,:) = rn_emp0
+      emps(:,:) = rn_emp0
    
       ! Increase the surface stress to its nominal value during the first nn_tau000 time-steps
@@ -305,5 +304,4 @@
          WRITE(numout,*)'           ndastp     = ', ndastp
          WRITE(numout,*)'           adatrj     = ', adatrj
-
       ENDIF
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90	(revision 2715)
@@ -19,6 +19,7 @@
    USE in_out_manager  ! I/O manager
    USE lib_fortran     ! distribued memory computing library
-   USE iom
-   USE restart
+   USE iom             ! IOM library
+   USE lib_mpp         ! MPP library
+   USE restart         ! ocean restart
 
    IMPLICIT NONE
@@ -32,21 +33,20 @@
    LOGICAL, PUBLIC ::   ln_ref_apr = .FALSE.  !: ref. pressure: global mean Patm (F) or a constant (F)
 
-   REAL(wp), ALLOCATABLE, PUBLIC, DIMENSION(:,:) ::   ssh_ib    ! Inverse barometer now    sea surface height     [m]
-   REAL(wp), ALLOCATABLE, PUBLIC, DIMENSION(:,:) ::   ssh_ibb   ! Inverse barometer before sea surface height     [m]
-   REAL(wp), ALLOCATABLE, PUBLIC, DIMENSION(:,:) ::   apr       ! atmospheric pressure at kt                   [N/m2]
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   ssh_ib    ! Inverse barometer now    sea surface height   [m]
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   ssh_ibb   ! Inverse barometer before sea surface height   [m]
+   REAL(wp), ALLOCATABLE, SAVE, PUBLIC, DIMENSION(:,:) ::   apr       ! atmospheric pressure at kt                 [N/m2]
    
    REAL(wp) ::   rpref = 101000._wp   ! reference atmospheric pressure          [N/m2]
    REAL(wp) ::   tarea                ! whole domain mean masked ocean surface
    REAL(wp) ::   r1_grau              ! = 1.e0 / (grav * rau0)
-
    
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:)   ::   sf_apr   ! structure of input fields (file informations, fields read)
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_apr   ! structure of input fields (file informations, fields read)
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
-   !! $Id $
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
+   !! $Id: $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -91,7 +91,6 @@
          !
          ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_apr: unable to allocate sf_apr structure' )   ;   RETURN
-         ENDIF
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_apr: unable to allocate sf_apr structure' )
+         !
          CALL fld_fill( sf_apr, (/ sn_apr /), cn_dir, 'sbc_apr', 'Atmospheric pressure ', 'namsbc_apr' )
                                 ALLOCATE( sf_apr(1)%fnow(jpi,jpj,1)   )
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 2715)
@@ -52,5 +52,6 @@
    INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin)
    INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
+
+   TYPE(FLD),ALLOCATABLE,DIMENSION(:) :: sf  ! structure of input fields (file informations, fields read)
 
    INTEGER, PARAMETER  ::   jpintsr = 24          ! number of time step between sunrise and sunset
@@ -73,14 +74,13 @@
       &         6.6, 6.1, 5.6, 5.5, 5.8, 5.8, 5.6, 5.6, 5.6, 5.6 /
    !!
-   REAL(wp), DIMENSION(jpi,jpj) ::   sbudyko      ! cloudiness effect on LW radiation
-   REAL(wp), DIMENSION(jpi,jpj) ::   stauc        ! cloud optical depth 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sbudyko      ! cloudiness effect on LW radiation
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   stauc        ! cloud optical depth 
    
-   REAL(wp)  ::   zeps    = 1.e-20                ! constant values
-   REAL(wp)  ::   zeps0   = 1.e-13  
+   REAL(wp) ::   eps20  = 1.e-20   ! constant values
    
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -116,8 +116,8 @@
       !!              - emp, emps   evaporation minus precipitation
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
-      !!
-      INTEGER  ::   ifpr, jfpr         ! dummy indices
-      INTEGER  ::   ierror             ! return error code
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   ifpr, jfpr   ! dummy indices
+      INTEGER  ::   ierr0, ierr1, ierr2, ierr3   ! return error code
       !!
       CHARACTER(len=100) ::  cn_dir                            !   Root directory for location of CLIO files
@@ -156,14 +156,17 @@
          
          ! set sf structure
-         ALLOCATE( sf(jpfld), STAT=ierror )
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_blk_clio: unable to allocate sf structure' )   ;   RETURN
-         ENDIF
+         ALLOCATE( sf(jpfld), STAT=ierr0 )
+         IF( ierr0 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf structure' )
          DO ifpr= 1, jpfld
-            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
-            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
-         END DO
+            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) , STAT=ierr1)
+            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) , STAT=ierr2 )
+         END DO
+         IF( ierr1+ierr2 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf array structure' )
          ! fill sf with slf_i and control print
          CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_clio', 'flux formulation for ocean surface boundary condition', 'namsbc_clio' )
+         
+         ! allocate sbcblk clio arrays
+         ALLOCATE( sbudyko(jpi,jpj) , stauc(jpi,jpj), STAT=ierr3 )
+         IF( ierr3 > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate arrays' )
          !
       ENDIF
@@ -208,4 +211,9 @@
       !!  ** Nota    :   sf has to be a dummy argument for AGRIF on NEC
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zqlw => wrk_2d_1  ! long-wave heat flux over ocean
+      USE wrk_nemo, ONLY: zqla => wrk_2d_2  ! latent heat flux over ocean
+      USE wrk_nemo, ONLY: zqsb => wrk_2d_3  ! sensible heat flux over ocean
+      !!
       TYPE(fld), INTENT(in), DIMENSION(:)       ::   sf    ! input data
       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius]
@@ -223,11 +231,11 @@
       REAL(wp) ::   zrhoa, zev, zes, zeso, zqatm, zevsqr        !    -         -
       REAL(wp) ::   ztx2, zty2                                  !    -         -
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw        ! long-wave heat flux over ocean
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqla        ! latent heat flux over ocean
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqsb        ! sensible heat flux over ocean
       !!---------------------------------------------------------------------
 
-      zpatm = 101000.      ! atmospheric pressure  (assumed constant here)
+      IF( wrk_in_use(3, 1,2,3) ) THEN
+         CALL ctl_stop('blk_oce_clio: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
+
+      zpatm = 101000._wp      ! atmospheric pressure  (assumed constant here)
 
       !------------------------------------!
@@ -309,5 +317,5 @@
             zdeltaq = zqatm - zqsato
             ztvmoy  = ztatm * ( 1. + 2.2e-3 * ztatm * zqatm )
-            zdenum  = MAX( sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) * ztvmoy, zeps )
+            zdenum  = MAX( sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) * ztvmoy, eps20 )
             zdtetar = zdteta / zdenum
             ztvmoyr = ztvmoy * ztvmoy * zdeltaq / zdenum
@@ -331,5 +339,5 @@
             zpsil   = zpsih
             
-            zvatmg         = MAX( 0.032 * 1.5e-3 * sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) / grav, zeps )
+            zvatmg         = MAX( 0.032 * 1.5e-3 * sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) / grav, eps20 )
             zcmn           = vkarmn / LOG ( 10. / zvatmg )
             zchn           = 0.0327 * zcmn
@@ -378,4 +386,6 @@
       ENDIF
 
+      IF( wrk_not_released(3, 1,2,3) )   CALL ctl_stop('blk_oce_clio: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_oce_clio
 
@@ -408,4 +418,11 @@
       !!
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztatm  => wrk_2d_1   ! Tair in Kelvin
+      USE wrk_nemo, ONLY:   zqatm  => wrk_2d_2   ! specific humidity
+      USE wrk_nemo, ONLY:   zevsqr => wrk_2d_3   ! vapour pressure square-root
+      USE wrk_nemo, ONLY:   zrhoa  => wrk_2d_4   ! air density
+      USE wrk_nemo, ONLY:   wrk_3d_1 , wrk_3d_2
+      !!
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   pst      ! ice surface temperature                   [Kelvin]
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:)   ::   palb_cs  ! ice albedo (clear    sky) (alb_ice_cs)         [%]
@@ -435,10 +452,15 @@
       REAL(wp) ::   ztice3, zticemb, zticemb2, zdqlw, zdqsb     !    -         -
       !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztatm   ! Tair in Kelvin
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqatm   ! specific humidity
-      REAL(wp), DIMENSION(jpi,jpj) ::   zevsqr  ! vapour pressure square-root
-      REAL(wp), DIMENSION(jpi,jpj) ::   zrhoa   ! air density
-      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qlw, z_qsb
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qlw, z_qsb
       !!---------------------------------------------------------------------
+
+      IF(  wrk_in_use(2, 1,2,3,4)  .OR.  wrk_in_use(3, 1,2)  ) THEN
+         CALL ctl_stop('blk_ice_clio: requested workspace arrays are unavailable')   ;   RETURN
+      ELSE IF(pdim > jpk)THEN
+         CALL ctl_stop('blk_ice_clio: too many ice levels to use wrk_nemo 3D workspaces.')
+         RETURN
+      END IF
+      z_qlw => wrk_3d_1(:,:,1:pdim)
+      z_qsb => wrk_3d_2(:,:,1:pdim)
 
       ijpl  = pdim                           ! number of ice categories
@@ -612,5 +634,7 @@
       ENDIF
 
-
+      IF( wrk_not_released(2, 1,2,3,4)  .OR.   &
+          wrk_not_released(3, 1,2)      )   CALL ctl_stop('blk_ice_clio: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_ice_clio
 
@@ -626,4 +650,9 @@
       !!               - also initialise sbudyko and stauc once for all 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zev   => wrk_2d_1                  ! vapour pressure
+      USE wrk_nemo, ONLY:   zdlha => wrk_2d_2 , zlsrise => wrk_2d_3 , zlsset => wrk_2d_4 
+      USE wrk_nemo, ONLY:   zps   => wrk_2d_5 , zpc     => wrk_2d_6   ! sin/cos of latitude per sin/cos of solar declination 
+      !!
       REAL(wp), INTENT(  out), DIMENSION(jpi,jpj)     ::   pqsr_oce    ! shortwave radiation  over the ocean
       !!
@@ -644,11 +673,9 @@
       REAL(wp) ::   zxday, zdist, zcoef, zcoef1      !
       REAL(wp) ::   zes
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zev          ! vapour pressure
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdlha, zlsrise, zlsset     ! 2D workspace
-
-      REAL(wp), DIMENSION(jpi,jpj) ::   zps, zpc   ! sine (cosine) of latitude per sine (cosine) of solar declination 
       !!---------------------------------------------------------------------
 
+      IF( wrk_in_use(2, 1,2,3,4,5,6) ) THEN
+         CALL ctl_stop('blk_clio_qsr_oce: requested workspace arrays unavailable')   ;   RETURN
+      END IF
 
       IF( lbulk_init ) THEN             !   Initilization at first time step only
@@ -764,4 +791,6 @@
       END DO
 
+      IF( wrk_not_released(2, 1,2,3,4,5,6) )   CALL ctl_stop('blk_clio_qsr_oce: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_clio_qsr_oce
 
@@ -777,4 +806,11 @@
       !!               - also initialise sbudyko and stauc once for all 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zev     => wrk_2d_1     ! vapour pressure
+      USE wrk_nemo, ONLY:   zdlha   => wrk_2d_2     ! 2D workspace
+      USE wrk_nemo, ONLY:   zlsrise => wrk_2d_3     ! 2D workspace
+      USE wrk_nemo, ONLY:   zlsset  => wrk_2d_4     ! 2D workspace
+      USE wrk_nemo, ONLY:   zps     => wrk_2d_5 , zpc => wrk_2d_6   ! sin/cos of latitude per sin/cos of solar declination 
+      !!
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pa_ice_cs   ! albedo of ice under clear sky
       REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pa_ice_os   ! albedo of ice under overcast sky
@@ -794,9 +830,9 @@
       REAL(wp) ::   zxday, zdist, zcoef, zcoef1   !    -         -
       REAL(wp) ::   zqsr_ice_cs, zqsr_ice_os      !    -         -
-      !!
-      REAL(wp), DIMENSION(jpi,jpj) ::   zev                      ! vapour pressure
-      REAL(wp), DIMENSION(jpi,jpj) ::   zdlha, zlsrise, zlsset   ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zps, zpc   ! sine (cosine) of latitude per sine (cosine) of solar declination 
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6) ) THEN
+         CALL ctl_stop('blk_clio_qsr_ice: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ijpl = SIZE(pqsr_ice, 3 )      ! number of ice categories
@@ -901,4 +937,6 @@
       END DO
       !
+      IF( wrk_not_released(2, 1,2,3,4,5,6) )   CALL ctl_stop('blk_clio_qsr_ice: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_clio_qsr_ice
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 2715)
@@ -11,4 +11,5 @@
    !!                           -  Implement reading of 6-hourly fields   
    !!            3.0  !  2006-06  (G. Madec) sbc rewritting   
+   !!             -   !  2006-12  (L. Brodeau) Original code for TURB_CORE_2Z
    !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put
    !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle
@@ -40,7 +41,7 @@
    PRIVATE
 
-   PUBLIC   sbc_blk_core       ! routine called in sbcmod module
-   PUBLIC   blk_ice_core       ! routine called in sbc_ice_lim module
-      
+   PUBLIC   sbc_blk_core         ! routine called in sbcmod module
+   PUBLIC   blk_ice_core         ! routine called in sbc_ice_lim module
+
    INTEGER , PARAMETER ::   jpfld   = 9           ! maximum number of files to read 
    INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
@@ -53,4 +54,5 @@
    INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
    INTEGER , PARAMETER ::   jp_tdif = 9           ! index of tau diff associated to HF tau   (N/m2)   at T-point
+   
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
          
@@ -110,5 +112,5 @@
       !!              - emp, emps   evaporation minus precipitation
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
       !!
       INTEGER  ::   ierror   ! return error code
@@ -166,10 +168,8 @@
          !
          ALLOCATE( sf(jfld), STAT=ierror )         ! set sf structure
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' )   ;   RETURN
-         ENDIF
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_blk_core: unable to allocate sf structure' )
          DO ifpr= 1, jfld
             ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
-            IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
+            IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
          END DO
          !                                         ! fill sf with slf_i and control print
@@ -210,24 +210,29 @@
       !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC
       !!---------------------------------------------------------------------
-      TYPE(fld), INTENT(in), DIMENSION(:)       ::   sf    ! input data
-      REAL(wp),  INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius]
-      REAL(wp),  INTENT(in), DIMENSION(jpi,jpj) ::   pu    ! surface current at U-point (i-component) [m/s]
-      REAL(wp),  INTENT(in), DIMENSION(jpi,jpj) ::   pv    ! surface current at V-point (j-component) [m/s]
-
-      INTEGER  ::   ji, jj     ! dummy loop indices
-      REAL(wp) ::   zcoef_qsatw
-      REAL(wp) ::   zztmp                                 ! temporary variable
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqsatw            ! specific humidity at pst
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw, zqsb        ! long wave and sensible heat fluxes
-      REAL(wp), DIMENSION(jpi,jpj) ::   zqla, zevap       ! latent heat fluxes and evaporation
-      REAL(wp), DIMENSION(jpi,jpj) ::   Cd                ! transfer coefficient for momentum      (tau)
-      REAL(wp), DIMENSION(jpi,jpj) ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
-      REAL(wp), DIMENSION(jpi,jpj) ::   Ce                ! tansfert coefficient for evaporation   (Q_lat)
-      REAL(wp), DIMENSION(jpi,jpj) ::   zst               ! surface temperature in Kelvin
-      REAL(wp), DIMENSION(jpi,jpj) ::   zt_zu             ! air temperature at wind speed height
-      REAL(wp), DIMENSION(jpi,jpj) ::   zq_zu             ! air spec. hum.  at wind speed height
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwnd_i => wrk_2d_1  , zwnd_j => wrk_2d_2      ! wind speed components at T-point
+      USE wrk_nemo, ONLY:   zqsatw => wrk_2d_3           ! specific humidity at pst
+      USE wrk_nemo, ONLY:   zqlw   => wrk_2d_4  , zqsb   => wrk_2d_5      ! long wave and sensible heat fluxes
+      USE wrk_nemo, ONLY:   zqla   => wrk_2d_6  , zevap  => wrk_2d_7      ! latent heat fluxes and evaporation
+      USE wrk_nemo, ONLY:   Cd     => wrk_2d_8           ! transfer coefficient for momentum      (tau)
+      USE wrk_nemo, ONLY:   Ch     => wrk_2d_9           ! transfer coefficient for sensible heat (Q_sens)
+      USE wrk_nemo, ONLY:   Ce     => wrk_2d_10          ! transfer coefficient for evaporation   (Q_lat)
+      USE wrk_nemo, ONLY:   zst    => wrk_2d_11          ! surface temperature in Kelvin
+      USE wrk_nemo, ONLY:   zt_zu  => wrk_2d_12          ! air temperature at wind speed height
+      USE wrk_nemo, ONLY:   zq_zu  => wrk_2d_13          ! air spec. hum.  at wind speed height
+      !
+      TYPE(fld), INTENT(in), DIMENSION(:)   ::   sf    ! input data
+      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pst   ! surface temperature                      [Celcius]
+      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s]
+      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s]
+      !
+      INTEGER  ::   ji, jj               ! dummy loop indices
+      REAL(wp) ::   zcoef_qsatw, zztmp   ! local variable
       !!---------------------------------------------------------------------
 
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10,11,12,13) ) THEN
+         CALL ctl_stop('blk_oce_core: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      !
       ! local scalars ( place there for vector optimisation purposes)
       zcoef_qsatw = 0.98 * 640380. / rhoa
@@ -293,6 +298,8 @@
 !            &                    Cd    (:,:),             Ch  (:,:), Ce  (:,:)  )
 !gm bug
-         CALL TURB_CORE_1Z( 10., zst   , sf(jp_tair)%fnow,         &
-            &                    zqsatw, sf(jp_humi)%fnow, wndm,   &
+! ARPDBG - this won't compile with gfortran. Fix but check performance
+! as per comment above.
+         CALL TURB_CORE_1Z( 10., zst   , sf(jp_tair)%fnow(:,:,1),       &
+            &                    zqsatw, sf(jp_humi)%fnow(:,:,1), wndm, &
             &                    Cd    , Ch              , Ce    )
       ENDIF
@@ -376,4 +383,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10,11,12,13) )   &
+          CALL ctl_stop('blk_oce_core: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_oce_core
    
@@ -396,21 +406,25 @@
       !! caution : the net upward water flux has with mm/day unit
       !!---------------------------------------------------------------------
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   pst      ! ice surface temperature (>0, =rt0 over land) [Kelvin]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   pui      ! ice surface velocity (i- and i- components      [m/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   pvi      !    at I-point (B-grid) or U & V-point (C-grid)
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(in   ) ::   palb     ! ice albedo (clear sky) (alb_ice_cs)               [%]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_taui   ! i- & j-components of surface ice stress        [N/m2]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_tauj   !   at I-point (B-grid) or U & V-point (C-grid)
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2]
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2]
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2]
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2]
-      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_tpr    ! total precipitation          (T-point)      [Kg/m2/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_spr    ! solid precipitation          (T-point)      [Kg/m2/s]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_fr1    ! 1sr fraction of qsr penetration in ice (T-point)  [%]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   p_fr2    ! 2nd fraction of qsr penetration in ice (T-point)  [%]
-      CHARACTER(len=1)            , INTENT(in   ) ::   cd_grid  ! ice grid ( C or B-grid)
-      INTEGER                     , INTENT(in   ) ::   pdim     ! number of ice categories
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   z_wnds_t => wrk_2d_1                ! wind speed ( = | U10m - U_ice | ) at T-point
+      USE wrk_nemo, ONLY:   wrk_3d_4 , wrk_3d_5 , wrk_3d_6 , wrk_3d_7
+      !!
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pst      ! ice surface temperature (>0, =rt0 over land) [Kelvin]
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pui      ! ice surface velocity (i- and i- components      [m/s]
+      REAL(wp), DIMENSION(:,:)  , INTENT(in   ) ::   pvi      !    at I-point (B-grid) or U & V-point (C-grid)
+      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb     ! ice albedo (clear sky) (alb_ice_cs)               [%]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_taui   ! i- & j-components of surface ice stress        [N/m2]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_tauj   !   at I-point (B-grid) or U & V-point (C-grid)
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2]
+      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_tpr    ! total precipitation          (T-point)      [Kg/m2/s]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_spr    ! solid precipitation          (T-point)      [Kg/m2/s]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_fr1    ! 1sr fraction of qsr penetration in ice (T-point)  [%]
+      REAL(wp), DIMENSION(:,:)  , INTENT(  out) ::   p_fr2    ! 2nd fraction of qsr penetration in ice (T-point)  [%]
+      CHARACTER(len=1)          , INTENT(in   ) ::   cd_grid  ! ice grid ( C or B-grid)
+      INTEGER                   , INTENT(in   ) ::   pdim     ! number of ice categories
       !!
       INTEGER  ::   ji, jj, jl    ! dummy loop indices
@@ -422,12 +436,25 @@
       REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f                  ! relative wind module and components at F-point
       REAL(wp) ::             zwndi_t , zwndj_t                  ! relative wind components at T-point
-      REAL(wp), DIMENSION(jpi,jpj) ::   z_wnds_t                 ! wind speed ( = | U10m - U_ice | ) at T-point
-      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qlw               ! long wave heat flux over ice
-      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_qsb               ! sensible  heat flux over ice
-      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqlw              ! long wave heat sensitivity over ice
-      REAL(wp), DIMENSION(jpi,jpj,pdim) ::   z_dqsb              ! sensible  heat sensitivity over ice
+      !!
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qlw             ! long wave heat flux over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_qsb             ! sensible  heat flux over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqlw            ! long wave heat sensitivity over ice
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   z_dqsb            ! sensible  heat sensitivity over ice
       !!---------------------------------------------------------------------
 
       ijpl  = pdim                            ! number of ice categories
+
+      ! Set-up access to workspace arrays
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 4,5,6,7) ) THEN
+         CALL ctl_stop('blk_ice_core: requested workspace arrays unavailable')   ;   RETURN
+      ELSE IF(ijpl > jpk) THEN
+         CALL ctl_stop('blk_ice_core: no. of ice categories > jpk so wrk_nemo 3D workspaces cannot be used.')
+         RETURN
+      END IF
+      ! Set-up pointers to sub-arrays of workspaces
+      z_qlw  => wrk_3d_4(:,:,1:ijpl)
+      z_qsb  => wrk_3d_5(:,:,1:ijpl)
+      z_dqlw => wrk_3d_6(:,:,1:ijpl)
+      z_dqsb => wrk_3d_7(:,:,1:ijpl)
 
       ! local scalars ( place there for vector optimisation purposes)
@@ -579,9 +606,12 @@
       ENDIF
 
+      IF( wrk_not_released(2, 1)       .OR.   &
+          wrk_not_released(3, 4,5,6,7) )   CALL ctl_stop('blk_ice_core: failed to release workspace arrays')
+      !
    END SUBROUTINE blk_ice_core
   
 
    SUBROUTINE TURB_CORE_1Z(zu, sst, T_a, q_sat, q_a,   &
-      &                        dU, Cd, Ch, Ce   )
+      &                        dU , Cd , Ch   , Ce   )
       !!----------------------------------------------------------------------
       !!                      ***  ROUTINE  turb_core  ***
@@ -596,50 +626,49 @@
       !!      are provided at the same height 'zzu'!
       !!
-      !! References :
-      !!      Large & Yeager, 2004 : ???
-      !! History :
-      !!        !  XX-XX  (???     )  Original code
-      !!   9.0  !  05-08  (L. Brodeau) Rewriting and optimization
+      !! References :   Large & Yeager, 2004 : ???
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in) :: zu                 ! altitude of wind measurement       [m]
-      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::  &
-         sst,       &       ! sea surface temperature         [Kelvin]
-         T_a,       &       ! potential air temperature       [Kelvin]
-         q_sat,     &       ! sea surface specific humidity   [kg/kg]
-         q_a,       &       ! specific air humidity           [kg/kg]
-         dU                 ! wind module |U(zu)-U(0)|        [m/s]
-      REAL(wp), intent(out), DIMENSION(jpi,jpj)  :: &
-         Cd,    &                ! transfert coefficient for momentum       (tau)
-         Ch,    &                ! transfert coefficient for temperature (Q_sens)
-         Ce                      ! transfert coefficient for evaporation  (Q_lat)
-
-      !! * Local declarations
-      REAL(wp), DIMENSION(jpi,jpj)  ::   &
-         dU10,        &       ! dU                                   [m/s]
-         dT,          &       ! air/sea temperature differeence      [K]
-         dq,          &       ! air/sea humidity difference          [K]
-         Cd_n10,      &       ! 10m neutral drag coefficient
-         Ce_n10,      &       ! 10m neutral latent coefficient
-         Ch_n10,      &       ! 10m neutral sensible coefficient
-         sqrt_Cd_n10, &       ! root square of Cd_n10
-         sqrt_Cd,     &       ! root square of Cd
-         T_vpot,      &       ! virtual potential temperature        [K]
-         T_star,      &       ! turbulent scale of tem. fluct.
-         q_star,      &       ! turbulent humidity of temp. fluct.
-         U_star,      &       ! turb. scale of velocity fluct.
-         L,           &       ! Monin-Obukov length                  [m]
-         zeta,        &       ! stability parameter at height zu
-         U_n10,       &       ! neutral wind velocity at 10m         [m]   
-         xlogt, xct, zpsi_h, zpsi_m
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY: dU10 => wrk_2d_14        ! dU                             [m/s]
+      USE wrk_nemo, ONLY: dT => wrk_2d_15          ! air/sea temperature difference   [K]
+      USE wrk_nemo, ONLY: dq => wrk_2d_16          ! air/sea humidity difference      [K]
+      USE wrk_nemo, ONLY: Cd_n10 => wrk_2d_17      ! 10m neutral drag coefficient
+      USE wrk_nemo, ONLY: Ce_n10 => wrk_2d_18      ! 10m neutral latent coefficient
+      USE wrk_nemo, ONLY: Ch_n10 => wrk_2d_19      ! 10m neutral sensible coefficient
+      USE wrk_nemo, ONLY: sqrt_Cd_n10 => wrk_2d_20 ! root square of Cd_n10
+      USE wrk_nemo, ONLY: sqrt_Cd => wrk_2d_21     ! root square of Cd
+      USE wrk_nemo, ONLY: T_vpot => wrk_2d_22      ! virtual potential temperature    [K]
+      USE wrk_nemo, ONLY: T_star => wrk_2d_23      ! turbulent scale of tem. fluct.
+      USE wrk_nemo, ONLY: q_star => wrk_2d_24      ! turbulent humidity of temp. fluct.
+      USE wrk_nemo, ONLY: U_star => wrk_2d_25      ! turb. scale of velocity fluct.
+      USE wrk_nemo, ONLY: L => wrk_2d_26           ! Monin-Obukov length              [m]
+      USE wrk_nemo, ONLY: zeta => wrk_2d_27        ! stability parameter at height zu
+      USE wrk_nemo, ONLY: U_n10 => wrk_2d_28       ! neutral wind velocity at 10m     [m]
+      USE wrk_nemo, ONLY: xlogt  => wrk_2d_29,    xct => wrk_2d_30,   &
+                          zpsi_h => wrk_2d_31, zpsi_m => wrk_2d_32
+      USE wrk_nemo, ONLY: stab => iwrk_2d_1      ! 1st guess stability test integer
+      !
+      REAL(wp)                , INTENT(in   ) ::   zu      ! altitude of wind measurement       [m]
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   sst     ! sea surface temperature         [Kelvin]
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   T_a     ! potential air temperature       [Kelvin]
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   q_sat   ! sea surface specific humidity   [kg/kg]
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   q_a     ! specific air humidity           [kg/kg]
+      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::   dU      ! wind module |U(zu)-U(0)|        [m/s]
+      REAL(wp), DIMENSION(:,:), INTENT(  out) ::   Cd      ! transfert coefficient for momentum       (tau)
+      REAL(wp), DIMENSION(:,:), INTENT(  out) ::   Ch      ! transfert coefficient for temperature (Q_sens)
+      REAL(wp), DIMENSION(:,:), INTENT(  out) ::   Ce      ! transfert coefficient for evaporation  (Q_lat)
       !!
       INTEGER :: j_itt
-      INTEGER, PARAMETER :: nb_itt = 3
-      INTEGER, DIMENSION(jpi,jpj)  ::   &
-         stab         ! 1st guess stability test integer
-
-      REAL(wp), PARAMETER ::                        &
-         grav   = 9.8,          &  ! gravity                       
-         kappa  = 0.4              ! von Karman s constant
+      INTEGER , PARAMETER ::   nb_itt = 3
+      REAL(wp), PARAMETER ::   grav   = 9.8   ! gravity                       
+      REAL(wp), PARAMETER ::   kappa  = 0.4   ! von Karman s constant
       !!----------------------------------------------------------------------
+
+      IF(  wrk_in_use(2,             14,15,16,17,18,19,        &
+                         20,21,22,23,24,25,26,27,28,29,        &
+                         30,31,32)                      .OR.   &
+          iwrk_in_use(2, 1)                               ) THEN
+         CALL ctl_stop('TURB_CORE_1Z: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       !! * Start
       !! Air/sea differences
@@ -672,7 +701,7 @@
 
          !! Stability parameters :
-         zeta = zu/L ;  zeta   = sign( min(abs(zeta),10.0), zeta )
-         zpsi_h = psi_h(zeta)
-         zpsi_m = psi_m(zeta)
+         zeta  = zu/L ;  zeta   = sign( min(abs(zeta),10.0), zeta )
+         zpsi_h  = psi_h(zeta)
+         zpsi_m  = psi_m(zeta)
 
          !! Shifting the wind speed to 10m and neutral stability :
@@ -701,4 +730,10 @@
       END DO
       !!
+      IF( wrk_not_released(2,             14,15,16,17,18,19,          &
+         &                    20,21,22,23,24,25,26,27,28,29,          &
+         &                    30,31,32                      )   .OR.  &      
+         iwrk_not_released(2, 1)                                  )   &
+         CALL ctl_stop('TURB_CORE_1Z: failed to release workspace arrays')
+      !
     END SUBROUTINE TURB_CORE_1Z
 
@@ -717,9 +752,26 @@
       !!      whereas wind (dU) is at 10m.
       !!
-      !! References :
-      !!      Large & Yeager, 2004 : ???
-      !! History :
-      !!   9.0  !  06-12  (L. Brodeau) Original code for 2Z
+      !! References :   Large & Yeager, 2004 : ???
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY: dU10 => wrk_2d_1        ! dU                             [m/s]
+      USE wrk_nemo, ONLY: dT => wrk_2d_2          ! air/sea temperature difference   [K]
+      USE wrk_nemo, ONLY: dq => wrk_2d_3          ! air/sea humidity difference      [K]
+      USE wrk_nemo, ONLY: Cd_n10 => wrk_2d_4      ! 10m neutral drag coefficient
+      USE wrk_nemo, ONLY: Ce_n10 => wrk_2d_5      ! 10m neutral latent coefficient
+      USE wrk_nemo, ONLY: Ch_n10 => wrk_2d_6      ! 10m neutral sensible coefficient
+      USE wrk_nemo, ONLY: sqrt_Cd_n10 => wrk_2d_7 ! root square of Cd_n10
+      USE wrk_nemo, ONLY: sqrt_Cd => wrk_2d_8     ! root square of Cd
+      USE wrk_nemo, ONLY: T_vpot => wrk_2d_9      ! virtual potential temperature    [K]
+      USE wrk_nemo, ONLY: T_star => wrk_2d_10     ! turbulent scale of tem. fluct.
+      USE wrk_nemo, ONLY: q_star => wrk_2d_11     ! turbulent humidity of temp. fluct.
+      USE wrk_nemo, ONLY: U_star => wrk_2d_12     ! turb. scale of velocity fluct.
+      USE wrk_nemo, ONLY: L => wrk_2d_13          ! Monin-Obukov length              [m]
+      USE wrk_nemo, ONLY: zeta_u => wrk_2d_14     ! stability parameter at height zu
+      USE wrk_nemo, ONLY: zeta_t => wrk_2d_15     ! stability parameter at height zt
+      USE wrk_nemo, ONLY: U_n10 => wrk_2d_16      ! neutral wind velocity at 10m     [m]
+      USE wrk_nemo, ONLY: xlogt => wrk_2d_17, xct => wrk_2d_18, zpsi_hu => wrk_2d_19, zpsi_ht => wrk_2d_20, zpsi_m => wrk_2d_21
+      USE wrk_nemo, ONLY: stab => iwrk_2d_1      ! 1st guess stability test integer
+      !!
       REAL(wp), INTENT(in)   :: &
          zt,      &     ! height for T_zt and q_zt                   [m]
@@ -738,28 +790,6 @@
          q_zu            ! spec. hum.  shifted at zu               [kg/kg]
 
-      !! * Local declarations
-      REAL(wp), DIMENSION(jpi,jpj) ::  &
-         dU10,        &     ! dU                                [m/s]
-         dT,          &     ! air/sea temperature differeence   [K]
-         dq,          &     ! air/sea humidity difference       [K]
-         Cd_n10,      &     ! 10m neutral drag coefficient
-         Ce_n10,      &     ! 10m neutral latent coefficient
-         Ch_n10,      &     ! 10m neutral sensible coefficient
-         sqrt_Cd_n10, &     ! root square of Cd_n10
-         sqrt_Cd,     &     ! root square of Cd
-         T_vpot_u,    &     ! virtual potential temperature        [K]
-         T_star,      &     ! turbulent scale of tem. fluct.
-         q_star,      &     ! turbulent humidity of temp. fluct.
-         U_star,      &     ! turb. scale of velocity fluct.
-         L,           &     ! Monin-Obukov length                  [m]
-         zeta_u,      &     ! stability parameter at height zu
-         zeta_t,      &     ! stability parameter at height zt
-         U_n10,       &     ! neutral wind velocity at 10m        [m]
-         xlogt, xct, zpsi_hu, zpsi_ht, zpsi_m
-
       INTEGER :: j_itt
       INTEGER, PARAMETER :: nb_itt = 3   ! number of itterations
-      INTEGER, DIMENSION(jpi,jpj) :: &
-           &     stab                ! 1st stability test integer
       REAL(wp), PARAMETER ::                        &
          grav   = 9.8,      &  ! gravity                       
@@ -767,4 +797,9 @@
       !!----------------------------------------------------------------------
       !!  * Start
+
+      IF(  wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21) .OR. &
+          iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('TURB_CORE_2Z: requested workspace arrays unavailable')   ;   RETURN
+      END IF
 
       !! Initial air/sea differences
@@ -789,5 +824,5 @@
       DO j_itt=1, nb_itt
          dT = T_zu - sst ;  dq = q_zu - q_sat ! Updating air/sea differences
-         T_vpot_u = T_zu*(1. + 0.608*q_zu)    ! Updating virtual potential temperature at zu
+         T_vpot = T_zu*(1. + 0.608*q_zu)    ! Updating virtual potential temperature at zu
          U_star = sqrt_Cd*dU10                ! Updating turbulent scales :   (L & Y eq. (7))
          T_star  = Ch/sqrt_Cd*dT              !
@@ -795,5 +830,5 @@
          !!
          L = (U_star*U_star) &                ! Estimate the Monin-Obukov length at height zu
-              & / (kappa*grav/T_vpot_u*(T_star*(1.+0.608*q_zu) + 0.608*T_zu*q_star))
+              & / (kappa*grav/T_vpot*(T_star*(1.+0.608*q_zu) + 0.608*T_zu*q_star))
          !! Stability parameters :
          zeta_u  = zu/L  ;  zeta_u = sign( min(abs(zeta_u),10.0), zeta_u )
@@ -841,28 +876,60 @@
       END DO
       !!
+      IF(  wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21) .OR.   &
+          iwrk_not_released(2, 1)    )   CALL ctl_stop('TURB_CORE_2Z: requested workspace arrays unavailable')
+      !
     END SUBROUTINE TURB_CORE_2Z
 
 
     FUNCTION psi_m(zta)   !! Psis, L & Y eq. (8c), (8d), (8e)
+      !-------------------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:     X2 => wrk_2d_33
+      USE wrk_nemo, ONLY:     X  => wrk_2d_34
+      USE wrk_nemo, ONLY: stabit => wrk_2d_35
+      !!
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta
 
       REAL(wp), PARAMETER :: pi = 3.141592653589793_wp
       REAL(wp), DIMENSION(jpi,jpj)             :: psi_m
-      REAL(wp), DIMENSION(jpi,jpj)             :: X2, X, stabit
+      !-------------------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 33,34,35) ) THEN
+         CALL ctl_stop('psi_m: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       X2 = sqrt(abs(1. - 16.*zta))  ;  X2 = max(X2 , 1.0) ;  X  = sqrt(X2)
       stabit    = 0.5 + sign(0.5,zta)
-      psi_m = -5.*zta*stabit  &                                                  ! Stable
-           & + (1. - stabit)*(2*log((1. + X)/2) + log((1. + X2)/2) - 2*atan(X) + pi/2)  ! Unstable 
+      psi_m = -5.*zta*stabit  &                                                          ! Stable
+         &    + (1. - stabit)*(2*log((1. + X)/2) + log((1. + X2)/2) - 2*atan(X) + pi/2)  ! Unstable 
+
+      IF( wrk_not_released(2, 33,34,35) )   CALL ctl_stop('psi_m: failed to release workspace arrays')
+      !
     END FUNCTION psi_m
 
-    FUNCTION psi_h(zta)    !! Psis, L & Y eq. (8c), (8d), (8e)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: zta
-
-      REAL(wp), DIMENSION(jpi,jpj)             :: psi_h
-      REAL(wp), DIMENSION(jpi,jpj)             :: X2, X, stabit
+
+    FUNCTION psi_h( zta )    !! Psis, L & Y eq. (8c), (8d), (8e)
+      !-------------------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:     X2 => wrk_2d_33
+      USE wrk_nemo, ONLY:     X  => wrk_2d_34
+      USE wrk_nemo, ONLY: stabit => wrk_2d_35
+      !
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   zta
+      !
+      REAL(wp), DIMENSION(jpi,jpj)             ::   psi_h
+      !-------------------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 33,34,35) ) THEN
+         CALL ctl_stop('psi_h: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       X2 = sqrt(abs(1. - 16.*zta))  ;  X2 = max(X2 , 1.) ;  X  = sqrt(X2)
       stabit    = 0.5 + sign(0.5,zta)
       psi_h = -5.*zta*stabit  &                                       ! Stable
-           & + (1. - stabit)*(2.*log( (1. + X2)/2. ))                 ! Unstable
+         &    + (1. - stabit)*(2.*log( (1. + X2)/2. ))                 ! Unstable
+
+      IF( wrk_not_released(2, 33,34,35) )   CALL ctl_stop('psi_h: failed to release workspace arrays')
+      !
     END FUNCTION psi_h
   
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 2715)
@@ -54,9 +54,9 @@
    PRIVATE
 
-   PUBLIC   sbc_cpl_rcv       ! routine called by sbc_ice_lim(_2).F90
-   PUBLIC   sbc_cpl_snd       ! routine called by step.F90
-   PUBLIC   sbc_cpl_ice_tau   ! routine called by sbc_ice_lim(_2).F90
-   PUBLIC   sbc_cpl_ice_flx   ! routine called by sbc_ice_lim(_2).F90
-   
+   PUBLIC   sbc_cpl_rcv        ! routine called by sbc_ice_lim(_2).F90
+   PUBLIC   sbc_cpl_snd        ! routine called by step.F90
+   PUBLIC   sbc_cpl_ice_tau    ! routine called by sbc_ice_lim(_2).F90
+   PUBLIC   sbc_cpl_ice_flx    ! routine called by sbc_ice_lim(_2).F90
+
    INTEGER, PARAMETER ::   jpr_otx1   =  1            ! 3 atmosphere-ocean stress components on grid 1
    INTEGER, PARAMETER ::   jpr_oty1   =  2            ! 
@@ -149,15 +149,15 @@
    CHARACTER(len=100), DIMENSION(4) ::   cn_rcv_tau           ! array combining cn_rcv_tau_*
 
-   REAL(wp), DIMENSION(jpi,jpj)       ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky)
-
-   REAL(wp), DIMENSION(jpi,jpj,jprcv) ::   frcv               ! all fields recieved from the atmosphere
-   INTEGER , DIMENSION(        jprcv) ::   nrcvinfo           ! OASIS info argument
-
-#if ! defined key_lim2 && ! defined key_lim3
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   albedo_oce_mix     ! ocean albedo sent to atmosphere (mix clear/overcast sky)
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   frcv               ! all fields recieved from the atmosphere
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(    :) ::   nrcvinfo           ! OASIS info argument
+
+#if ! defined key_lim2   &&   ! defined key_lim3
    ! quick patch to be able to run the coupled model without sea-ice...
-   INTEGER, PARAMETER               ::   jpl = 1 
-   REAL(wp), DIMENSION(jpi,jpj    ) ::   hicif, hsnif, u_ice, v_ice,fr1_i0,fr2_i0
-   REAL(wp), DIMENSION(jpi,jpj,jpl) ::   tn_ice, alb_ice
-   REAL(wp)                         ::  lfus
+   INTEGER, PARAMETER ::   jpl = 1 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hicif, hsnif, u_ice, v_ice,fr1_i0,fr2_i0 ! jpi, jpj
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tn_ice, alb_ice ! (jpi,jpj,jpl)
+   REAL(wp) ::  lfus
 #endif
 
@@ -167,9 +167,31 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
 CONTAINS
   
+   INTEGER FUNCTION sbc_cpl_alloc()
+      !!----------------------------------------------------------------------
+      !!             ***  FUNCTION sbc_cpl_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER :: ierr(2)
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( albedo_oce_mix(jpi,jpj), frcv(jpi,jpj,jprcv), nrcvinfo(jprcv),  STAT=ierr(1) )
+      !
+#if ! defined key_lim2 && ! defined key_lim3
+      ! quick patch to be able to run the coupled model without sea-ice...
+      ALLOCATE( hicif(jpi,jpj) , u_ice(jpi,jpj) , fr1_i0(jpi,jpj) , tn_ice (jpi,jpj,jpl) ,     &
+                hsnif(jpi,jpj) , v_ice(jpi,jpj) , fr2_i0(jpi,jpj) , alb_ice(jpi,jpj,jpl) , STAT=ierr(2) )
+#endif
+      sbc_cpl_alloc = MAXVAL( ierr )
+      IF( lk_mpp            )   CALL mpp_sum ( sbc_cpl_alloc )
+      IF( sbc_cpl_alloc > 0 )   CALL ctl_warn('sbc_cpl_alloc: allocation of arrays failed')
+      !
+   END FUNCTION sbc_cpl_alloc
+
+
    SUBROUTINE sbc_cpl_init( k_ice )     
       !!----------------------------------------------------------------------
@@ -184,8 +206,10 @@
       !!              * initialise the OASIS coupler
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zacs => wrk_2d_3 , zaos => wrk_2d_4   ! clear & overcast sky albedos
+      !!
       INTEGER, INTENT(in) ::   k_ice    ! ice management in the sbc (=0/1/2/3)
       !!
-      INTEGER                      ::   jn           ! dummy loop index
-      REAL(wp), DIMENSION(jpi,jpj) ::   zacs, zaos   ! 2D workspace (clear & overcast sky albedos)
+      INTEGER ::   jn   ! dummy loop index
       !!
       NAMELIST/namsbc_cpl/  cn_snd_temperature, cn_snd_albedo    , cn_snd_thickness,                 &          
@@ -198,4 +222,8 @@
 #endif
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 3,4) ) THEN
+         CALL ctl_stop('sbc_cpl_init: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! ================================ !
@@ -234,5 +262,5 @@
 
 #if defined key_cpl_carbon_cycle 
-      REWIND( numnam )                    ! ... read namlist namsbc_cpl_co2
+      REWIND( numnam )                    ! read namlist namsbc_cpl_co2
       READ  ( numnam, namsbc_cpl_co2 )
       IF(lwp) THEN                        ! control print
@@ -252,4 +280,7 @@
       cn_rcv_tau(1) = TRIM( cn_rcv_tau_nature )   ;   cn_rcv_tau(2) = TRIM( cn_rcv_tau_refere )
       cn_rcv_tau(3) = TRIM( cn_rcv_tau_orient )   ;   cn_rcv_tau(4) = TRIM( cn_rcv_tau_grid   )
+
+      !                                   ! allocate zdfric arrays
+      IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
      
       ! ================================ !
@@ -532,4 +563,6 @@
          &   CALL ctl_stop( 'sbc_cpl_init: diurnal cycle reconstruction (ln_dm2dc) needs daily couping for solar radiation' )
 
+      IF( wrk_not_released(2, 3,4) )   CALL ctl_stop('sbc_cpl_init: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_cpl_init
 
@@ -577,4 +610,7 @@
       !!                        emp = emps   evap. - precip. (- runoffs) (- calving) ('ocean only case)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztx => wrk_2d_1 , zty => wrk_2d_2
+      !!
       INTEGER, INTENT(in) ::   kt       ! ocean model time step index
       INTEGER, INTENT(in) ::   k_fsbc   ! frequency of sbc (-> ice model) computation 
@@ -589,6 +625,9 @@
       REAL(wp) ::   zcdrag = 1.5e-3        ! drag coefficient
       REAL(wp) ::   zzx, zzy               ! temporary variables
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty   ! 2D workspace 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('sbc_cpl_rcv: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )   CALL sbc_cpl_init( k_ice )          ! initialisation
@@ -778,4 +817,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('sbc_cpl_rcv: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_cpl_rcv
    
@@ -814,11 +855,17 @@
       !! ** Action  :   return ptau_i, ptau_j, the stress over the ice at cp_ice_msh point
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   p_taui   ! i- & j-components of atmos-ice stress [N/m2]
-      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   p_tauj   ! at I-point (B-grid) or U & V-point (C-grid)
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztx => wrk_2d_1 , zty => wrk_2d_2
+      !!
+      REAL(wp), INTENT(out), DIMENSION(:,:) ::   p_taui   ! i- & j-components of atmos-ice stress [N/m2]
+      REAL(wp), INTENT(out), DIMENSION(:,:) ::   p_tauj   ! at I-point (B-grid) or U & V-point (C-grid)
       !!
       INTEGER ::   ji, jj                          ! dummy loop indices
       INTEGER ::   itx                             ! index of taux over ice
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty   ! 2D workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('sbc_cpl_ice_tau: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( srcv(jpr_itx1)%laction ) THEN   ;   itx =  jpr_itx1   
@@ -988,4 +1035,6 @@
       ENDIF
       !   
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('sbc_cpl_ice_tau: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_cpl_ice_tau
    
@@ -1036,26 +1085,33 @@
       !!                   sprecip             solid precipitation over the ocean  
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl) ::   p_frld     ! lead fraction                [0 to 1]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pqns_tot   ! total non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zcptn  => wrk_2d_1   ! rcp * tn(:,:,1)
+      USE wrk_nemo, ONLY:   ztmp   => wrk_2d_2   ! temporary array
+      USE wrk_nemo, ONLY:   zsnow  => wrk_2d_3   ! snow precipitation 
+      USE wrk_nemo, ONLY:   zicefr => wrk_3d_4   ! ice fraction 
+      !!
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   p_frld     ! lead fraction                [0 to 1]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqns_tot   ! total non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
       ! optional arguments, used only in 'mixed oce-ice' case
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl), OPTIONAL ::   palbi   ! ice albedo 
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj    ), OPTIONAL ::   psst    ! sea surface temperature     [Celcius]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl), OPTIONAL ::   pist    ! ice surface temperature     [Kelvin]
-     !!
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   palbi   ! ice albedo 
+      REAL(wp), INTENT(in   ), DIMENSION(:,:  ), OPTIONAL ::   psst    ! sea surface temperature     [Celcius]
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:), OPTIONAL ::   pist    ! ice surface temperature     [Kelvin]
+      !!
       INTEGER ::   ji, jj           ! dummy loop indices
       INTEGER ::   isec, info       ! temporary integer
       REAL(wp)::   zcoef, ztsurf    ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj    )::   zcptn    ! rcp * tn(:,:,1)
-      REAL(wp), DIMENSION(jpi,jpj    )::   ztmp     ! temporary array
-      REAL(wp), DIMENSION(jpi,jpj    )::   zsnow    ! snow precipitation 
-      REAL(wp), DIMENSION(jpi,jpj,jpl)::   zicefr   ! ice fraction 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) .OR. wrk_in_use(3, 4) ) THEN
+         CALL ctl_stop('sbc_cpl_ice_flx: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
       zicefr(:,:,1) = 1.- p_frld(:,:,1)
       IF( lk_diaar5 )   zcptn(:,:) = rcp * tn(:,:,1)
@@ -1175,4 +1231,7 @@
       END SELECT
 
+      IF( wrk_not_released(2, 1,2,3)  .OR.   &
+          wrk_not_released(3, 4)      )   CALL ctl_stop('sbc_cpl_ice_flx: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_cpl_ice_flx
    
@@ -1187,12 +1246,19 @@
       !!              all the needed fields (as defined in sbc_cpl_init)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zfr_l => wrk_2d_1   ! 1. - fr_i(:,:)
+      USE wrk_nemo, ONLY:   ztmp1 => wrk_2d_2 , ztmp2 => wrk_2d_3
+      USE wrk_nemo, ONLY:   zotx1 => wrk_2d_4 , zoty1 => wrk_2d_5 , zotz1 => wrk_2d_6
+      USE wrk_nemo, ONLY:   zitx1 => wrk_2d_7 , zity1 => wrk_2d_8 , zitz1 => wrk_2d_9
+      !
       INTEGER, INTENT(in) ::   kt
-      !!
-      INTEGER ::   ji, jj          ! dummy loop indices
-      INTEGER ::   isec, info      ! temporary integer
-      REAL(wp), DIMENSION(jpi,jpj) ::   zfr_l   ! 1. - fr_i(:,:)
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztmp1, ztmp2
-      REAL(wp), DIMENSION(jpi,jpj) ::   zotx1 , zoty1 , zotz1, zitx1, zity1, zitz1
-      !!----------------------------------------------------------------------
+      !
+      INTEGER ::   ji, jj       ! dummy loop indices
+      INTEGER ::   isec, info   ! local integer
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9) ) THEN
+         CALL ctl_stop('sbc_cpl_snd: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
 
       isec = ( kt - nit000 ) * NINT(rdttra(1))        ! date of exchanges
@@ -1367,5 +1433,7 @@
          ! 
       ENDIF
-   !
+      !
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9) )   CALL ctl_stop('sbc_cpl_snd: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_cpl_snd
    
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcdcy.F90	(revision 2715)
@@ -10,6 +10,5 @@
 
    !!----------------------------------------------------------------------
-   !!  sbc_dcy : compute solar flux at kt from daily mean, taking 
-   !!            diurnal cycle into account
+   !!  sbc_dcy : solar flux at kt from daily mean, taking diurnal cycle into account
    !!----------------------------------------------------------------------
    USE oce              ! ocean dynamics and tracers
@@ -18,21 +17,36 @@
    USE sbc_oce          ! Surface boundary condition: ocean fields
    USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
-   INTEGER, PUBLIC              ::   nday_qsr                    ! day when parameters were computed
-   REAL(wp), DIMENSION(jpi,jpj) ::   raa , rbb  , rcc  , rab     ! parameters used to compute the diurnal cycle
-   REAL(wp), DIMENSION(jpi,jpj) ::   rtmd, rdawn, rdusk, rscal   !     -       -         -           -      -
+   
+   INTEGER, PUBLIC ::   nday_qsr   !: day when parameters were computed
+   
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   raa , rbb  , rcc  , rab     ! diurnal cycle parameters
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rtmd, rdawn, rdusk, rscal   !    -      -       -
   
-   PUBLIC   sbc_dcy     ! routine called by sbc
+   PUBLIC   sbc_dcy        ! routine called by sbc
 
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO-consortium (2010) 
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
 
-      FUNCTION sbc_dcy( pqsrin ) RESULT( zqsrout )
+      INTEGER FUNCTION sbc_dcy_alloc()
+         !!----------------------------------------------------------------------
+         !!                ***  FUNCTION sbc_dcy_alloc  ***
+         !!----------------------------------------------------------------------
+         ALLOCATE( raa (jpi,jpj) , rbb  (jpi,jpj) , rcc  (jpi,jpj) , rab  (jpi,jpj) ,     &
+            &      rtmd(jpi,jpj) , rdawn(jpi,jpj) , rdusk(jpi,jpj) , rscal(jpi,jpj) , STAT=sbc_dcy_alloc )
+            !
+         IF( lk_mpp             )   CALL mpp_sum ( sbc_dcy_alloc )
+         IF( sbc_dcy_alloc /= 0 )   CALL ctl_warn('sbc_dcy_alloc: failed to allocate arrays')
+      END FUNCTION sbc_dcy_alloc
+
+
+   FUNCTION sbc_dcy( pqsrin ) RESULT( zqsrout )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE sbc_dcy  ***
@@ -65,12 +79,11 @@
       ! Initialization
       ! --------------
-      ztwopi    = 2. * rpi
-      zinvtwopi = 1. / ztwopi
-      zconvrad  = ztwopi / 360.
+      ztwopi    = 2._wp * rpi
+      zinvtwopi = 1._wp / ztwopi
+      zconvrad  = ztwopi / 360._wp
 
       ! When are we during the day (from 0 to 1)
-      zlo = ( REAL(nsec_day, wp) - 0.5   * rdttra(1) ) / rday
-      zup = zlo + ( REAL(nn_fsbc, wp) * rdttra(1) ) / rday
-
+      zlo = ( REAL(nsec_day, wp) - 0.5_wp * rdttra(1) ) / rday
+      zup = zlo + ( REAL(nn_fsbc, wp)     * rdttra(1) ) / rday
       !                                          
       IF( nday_qsr == -1 ) THEN       ! first time step only               
@@ -81,4 +94,6 @@
             WRITE(numout,*)
          ENDIF
+         ! allocate sbcdcy arrays
+         IF( sbc_dcy_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_dcy_alloc : unable to allocate arrays' )
          ! Compute rcc needed to compute the time integral of the diurnal cycle
          rcc(:,:) = zconvrad * glamt(:,:) - rpi
@@ -136,6 +151,6 @@
              END DO  
          END DO  
-         rdawn(:,:) = MOD((rdawn(:,:) + 1.), 1.)
-         rdusk(:,:) = MOD((rdusk(:,:) + 1.), 1.)
+         rdawn(:,:) = MOD( (rdawn(:,:) + 1._wp), 1._wp )
+         rdusk(:,:) = MOD( (rdusk(:,:) + 1._wp), 1._wp )
 
          !     2.2 Compute the scalling function:
@@ -165,5 +180,5 @@
          ztmp = rday / ( rdttra(1) * REAL(nn_fsbc, wp) )
          rscal(:,:) = rscal(:,:) * ztmp
-
+         !
       ENDIF 
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 2715)
@@ -42,5 +42,5 @@
    !! NEMO/OPA 3.3 , NEMO-consortium (2010) 
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 2715)
@@ -28,12 +28,10 @@
    PRIVATE
 
-   PUBLIC   sbc_fwb      ! routine called by step
-
-   REAL(wp) ::   a_fwb_b            ! annual domain averaged freshwater budget
-   REAL(wp) ::   a_fwb              ! for 2 year before (_b) and before year.
-   REAL(wp) ::   fwfold             ! fwfold to be suppressed
-   REAL(wp) ::   area               ! global mean ocean surface (interior domain)
-
-   REAL(wp), DIMENSION(jpi,jpj) ::   e1e2    ! area of the interior domain (e1t*e2t)
+   PUBLIC   sbc_fwb    ! routine called by step
+
+   REAL(wp) ::   a_fwb_b   ! annual domain averaged freshwater budget
+   REAL(wp) ::   a_fwb     ! for 2 year before (_b) and before year.
+   REAL(wp) ::   fwfold    ! fwfold to be suppressed
+   REAL(wp) ::   area      ! global mean ocean surface (interior domain)
 
    !! * Substitutions
@@ -60,15 +58,21 @@
       !!                   & spread out over erp area depending its sign
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztmsk_neg      => wrk_2d_1 , ztmsk_pos => wrk_2d_2
+      USE wrk_nemo, ONLY:   ztmsk_tospread => wrk_2d_3
+      USE wrk_nemo, ONLY:   z_wgt          => wrk_2d_4 , zerp_cor  => wrk_2d_5
+      !
       INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
       INTEGER, INTENT( in ) ::   kn_fsbc  ! 
       INTEGER, INTENT( in ) ::   kn_fwb   ! ocean time-step index
-      !!
-      INTEGER  ::   inum                  ! temporary logical unit
-      INTEGER  ::   ikty, iyear           ! 
-      REAL(wp) ::   z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp       ! temporary scalars
-      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_pos, ztmsk_tospread
-      REAL(wp), DIMENSION(jpi,jpj) ::   z_wgt, zerp_cor
+      !
+      INTEGER  ::   inum, ikty, iyear   ! local integers
+      REAL(wp) ::   z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp   ! local scalars
+      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread    !   -      -
       !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(2, 1,2,3,4,5) ) THEN
+         CALL ctl_stop('sbc_fwb: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
       !
       IF( kt == nit000 ) THEN
@@ -84,6 +88,5 @@
          IF( kn_fwb == 3 .AND. nn_sssr /= 2 )   CALL ctl_stop( 'sbc_fwb: nn_fwb = 3 requires nn_sssr = 2, we stop ' )
          !
-         e1e2(:,:) = e1t(:,:) * e2t(:,:) 
-         area = glob_sum( e1e2(:,:) )           ! interior global domain surface
+         area = glob_sum( e1e2t(:,:) )           ! interior global domain surface
       ENDIF
       
@@ -94,5 +97,5 @@
          !
          IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN
-            z_fwf = glob_sum( e1e2(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area   ! sum over the global domain
+            z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area   ! sum over the global domain
             emp (:,:) = emp (:,:) - z_fwf 
             emps(:,:) = emps(:,:) - z_fwf 
@@ -117,5 +120,5 @@
          IF( MOD( kt, ikty ) == 0 ) THEN
             a_fwb_b = a_fwb
-            a_fwb   = glob_sum( e1e2(:,:) * sshn(:,:) )   ! sum over the global domain
+            a_fwb   = glob_sum( e1e2t(:,:) * sshn(:,:) )   ! sum over the global domain
             a_fwb   = a_fwb * 1.e+3 / ( area * 86400. * 365. )     ! convert in Kg/m3/s = mm/s
 !!gm        !                                                      !!bug 365d year 
@@ -142,8 +145,8 @@
             ztmsk_neg(:,:) = tmask_i(:,:) - ztmsk_pos(:,:)
             !
-            zsurf_neg = glob_sum( e1e2(:,:)*ztmsk_neg(:,:) )   ! Area filled by <0 and >0 erp 
-            zsurf_pos = glob_sum( e1e2(:,:)*ztmsk_pos(:,:) )
+            zsurf_neg = glob_sum( e1e2t(:,:)*ztmsk_neg(:,:) )   ! Area filled by <0 and >0 erp 
+            zsurf_pos = glob_sum( e1e2t(:,:)*ztmsk_pos(:,:) )
             !                                                  ! fwf global mean 
-            z_fwf = glob_sum( e1e2(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area
+            z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area
             !            
             IF( z_fwf < 0._wp ) THEN         ! spread out over >0 erp area to increase evaporation
@@ -155,9 +158,9 @@
             ENDIF
             !
-            zsum_fwf   = glob_sum( e1e2(:,:) * z_fwf )         ! fwf global mean over <0 or >0 erp area
+            zsum_fwf   = glob_sum( e1e2t(:,:) * z_fwf )         ! fwf global mean over <0 or >0 erp area
 !!gm :  zsum_fwf   = z_fwf * area   ???  it is right?  I think so....
             z_fwf_nsrf =  zsum_fwf / ( zsurf_tospread + rsmall )
             !                                                  ! weight to respect erp field 2D structure 
-            zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2(:,:) )
+            zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2t(:,:) )
             z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( zsum_erp + rsmall )
             !                                                  ! final correction term to apply
@@ -174,10 +177,10 @@
                IF( z_fwf < 0._wp ) THEN
                   WRITE(numout,*)'   z_fwf < 0'
-                  WRITE(numout,*)'   SUM(erp+)     = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2(:,:) )*1.e-9,' Sv'
+                  WRITE(numout,*)'   SUM(erp+)     = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2t(:,:) )*1.e-9,' Sv'
                ELSE
                   WRITE(numout,*)'   z_fwf >= 0'
-                  WRITE(numout,*)'   SUM(erp-)     = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2(:,:) )*1.e-9,' Sv'
+                  WRITE(numout,*)'   SUM(erp-)     = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2t(:,:) )*1.e-9,' Sv'
                ENDIF
-               WRITE(numout,*)'   SUM(empG)     = ', SUM( z_fwf*e1e2(:,:) )*1.e-9,' Sv'
+               WRITE(numout,*)'   SUM(empG)     = ', SUM( z_fwf*e1e2t(:,:) )*1.e-9,' Sv'
                WRITE(numout,*)'   z_fwf         = ', z_fwf      ,' Kg/m2/s'
                WRITE(numout,*)'   z_fwf_nsrf    = ', z_fwf_nsrf ,' Kg/m2/s'
@@ -192,4 +195,6 @@
       END SELECT
       !
+      IF( wrk_not_released(2, 1,2,3,4,5) )   CALL ctl_stop('sbc_fwb: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_fwb
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 2715)
@@ -19,4 +19,5 @@
    USE iom             ! I/O manager library
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -32,7 +33,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -53,5 +53,5 @@
       !!                fr_i       : update the ice fraction
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in)          ::   kt         ! ocean time step
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
       !
       INTEGER  ::   ji, jj     ! dummy loop indices
@@ -78,10 +78,7 @@
 
          ALLOCATE( sf_ice(1), STAT=ierror )
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_ice_if: unable to allocate sf_ice structure' )   ;   RETURN
-         ENDIF
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_if: unable to allocate sf_ice structure' )
          ALLOCATE( sf_ice(1)%fnow(jpi,jpj,1) )
-         IF( sn_ice%ln_tint ) ALLOCATE( sf_ice(1)%fdta(jpi,jpj,1,2) )
-
+         IF( sn_ice%ln_tint )   ALLOCATE( sf_ice(1)%fdta(jpi,jpj,1,2) )
 
          ! fill sf_ice with sn_ice and control print
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 2715)
@@ -4,5 +4,5 @@
    !! Surface module :  update the ocean surface boundary condition over ice
    !!       &           covered area using LIM sea-ice model
-   !! Sea-Ice model  :  LIM 3.0 Sea ice model time-stepping
+   !! Sea-Ice model  :  LIM-3 Sea ice model time-stepping
    !!=====================================================================
    !! History :  2.0  ! 2006-12  (M. Vancoppenolle) Original code
@@ -10,4 +10,5 @@
    !!             -   ! 2008-04  (G. Madec)  sltyle and lim_ctl routine
    !!            3.3  ! 2010-11  (G. Madec) ice-ocean stress always computed at each ocean time-step
+   !!            4.0  ! 2011-01  (A Porter)  dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_lim3
@@ -21,5 +22,4 @@
    USE oce             ! ocean dynamics and tracers
    USE dom_oce         ! ocean space and time domain
-   USE lib_mpp         ! MPP library
    USE par_ice         ! sea-ice parameters
    USE ice             ! LIM-3: ice variables
@@ -49,4 +49,5 @@
    USE c1d             ! 1D vertical configuration
    USE lbclnk          ! lateral boundary condition - MPP link
+   USE lib_mpp         ! MPP library
    USE iom             ! I/O manager library
    USE in_out_manager  ! I/O manager
@@ -62,5 +63,5 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , UCL NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -88,12 +89,18 @@
       !!                utau, vtau, taum, wndm, qns , qsr, emp , emps
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zalb_ice_os => wrk_3d_1 ! albedo of the ice under overcast sky
+      USE wrk_nemo, ONLY:   zalb_ice_cs => wrk_3d_2 ! albedo of ice under clear sky
+      !!
       INTEGER, INTENT(in) ::   kt      ! ocean time step
       INTEGER, INTENT(in) ::   kblk    ! type of bulk (=3 CLIO, =4 CORE)
       !!
-      INTEGER  ::   jl                 ! loop index
-      REAL(wp) ::   zcoef              ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_os   ! albedo of the ice under overcast sky
-      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_cs   ! albedo of ice under clear sky
+      INTEGER  ::   jl      ! dummy loop index
+      REAL(wp) ::   zcoef   ! local scalar
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop( 'sbc_ice_lim: requested workspace arrays are unavailable' )   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -121,5 +128,5 @@
          t_bo(:,:) = tfreez( sss_m ) +  rt0          ! masked sea surface freezing temperature [Kelvin]
          !                                           ! (set to rt0 over land)
-         CALL albedo_ice( t_su, ht_i, ht_s, alb_ice_cs, alb_ice_os )  ! ... ice albedo
+         CALL albedo_ice( t_su, ht_i, ht_s, zalb_ice_cs, zalb_ice_os )  ! ... ice albedo
 
          DO jl = 1, jpl
@@ -136,15 +143,15 @@
          SELECT CASE( kblk )
          CASE( 3 )                                       ! CLIO bulk formulation
-            CALL blk_ice_clio( t_su , alb_ice_cs, alb_ice_os,                           &
-               &                      utau_ice  , vtau_ice  , qns_ice   , qsr_ice   ,   &
-               &                      qla_ice   , dqns_ice  , dqla_ice  ,               &
-               &                      tprecip   , sprecip   ,                           &
-               &                      fr1_i0    , fr2_i0    , cp_ice_msh, jpl  )
+            CALL blk_ice_clio( t_su , zalb_ice_cs, zalb_ice_os,                           &
+               &                      utau_ice   , vtau_ice   , qns_ice   , qsr_ice   ,   &
+               &                      qla_ice    , dqns_ice   , dqla_ice  ,               &
+               &                      tprecip    , sprecip    ,                           &
+               &                      fr1_i0     , fr2_i0     , cp_ice_msh, jpl  )
             !         
          CASE( 4 )                                       ! CORE bulk formulation
-            CALL blk_ice_core( t_su , u_ice     , v_ice     , alb_ice_cs,               &
-               &                      utau_ice  , vtau_ice  , qns_ice   , qsr_ice   ,   &
-               &                      qla_ice   , dqns_ice  , dqla_ice  ,               &
-               &                      tprecip   , sprecip   ,                           &
+            CALL blk_ice_core( t_su , u_ice     , v_ice     , zalb_ice_cs,               &
+               &                      utau_ice  , vtau_ice  , qns_ice    , qsr_ice   ,   &
+               &                      qla_ice   , dqns_ice  , dqla_ice   ,               &
+               &                      tprecip   , sprecip   ,                            &
                &                      fr1_i0    , fr2_i0    , cp_ice_msh, jpl  )
          END SELECT
@@ -245,4 +252,6 @@
 !!gm   remark, the ocean-ice stress is not saved in ice diag call above .....  find a solution!!!
       !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop( 'sbc_ice_lim: failed to release workspace arrays' )
+      !
    END SUBROUTINE sbc_ice_lim
 
@@ -263,5 +272,5 @@
 
       inb_altests = 10
-      inb_alp(:) = 0
+      inb_alp(:)  = 0
 
       ! Alert if incompatible volume and concentration
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 2715)
@@ -83,12 +83,24 @@
       !!                utau, vtau, taum, wndm, qns , qsr, emp , emps
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_3d_1 , wrk_3d_2 , wrk_3d_3   ! 3D workspace
+      !!
       INTEGER, INTENT(in) ::   kt      ! ocean time step
       INTEGER, INTENT(in) ::   ksbc    ! type of sbc ( =3 CLIO bulk ; =4 CORE bulk ; =5 coupled )
       !!
       INTEGER  ::   ji, jj   ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalb_ice_os   ! albedo of the ice under overcast sky
-      REAL(wp), DIMENSION(jpi,jpj,1) ::   zalb_ice_cs   ! albedo of ice under clear sky
-      REAL(wp), DIMENSION(jpi,jpj,1) ::   zsist        ! surface ice temperature (K)
+      ! Pointers into workspaces contained in the wrk_nemo module
+      REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_os   ! albedo of the ice under overcast sky
+      REAL(wp), DIMENSION(:,:,:), POINTER :: zalb_ice_cs   ! albedo of ice under clear sky
+      REAL(wp), DIMENSION(:,:,:), POINTER :: zsist         ! surface ice temperature (K)
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3) ) THEN
+         CALL ctl_stop('sbc_ice_lim_2: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
+      ! Use pointers to access only sub-arrays of workspaces
+      zalb_ice_os => wrk_3d_1(:,:,1:1)
+      zalb_ice_cs => wrk_3d_2(:,:,1:1)
+      zsist       => wrk_3d_3(:,:,1:1)
 
       IF( kt == nit000 ) THEN
@@ -129,5 +141,7 @@
 
          ! ... ice albedo (clear sky and overcast sky)
-         CALL albedo_ice( zsist, reshape( hicif, (/jpi,jpj,1/) ), reshape( hsnif, (/jpi,jpj,1/) ), zalb_ice_cs, zalb_ice_os )
+         CALL albedo_ice( zsist, reshape( hicif, (/jpi,jpj,1/) ), &
+                                 reshape( hsnif, (/jpi,jpj,1/) ), &
+                          zalb_ice_cs, zalb_ice_os )
 
          ! ... Sea-ice surface boundary conditions output from bulk formulae :
@@ -189,8 +203,8 @@
          !                                             ! Ice surface fluxes in coupled mode 
          IF( ksbc == 5 )   CALL sbc_cpl_ice_flx( reshape( frld, (/jpi,jpj,1/) ),                 &
-      &                                                   qns_tot, qns_ice, qsr_tot , qsr_ice,   &
-      &                                                   emp_tot, emp_ice, dqns_ice, sprecip,   &
-      !                                      optional arguments, used only in 'mixed oce-ice' case
-      &                                                   palbi = zalb_ice_cs, psst = sst_m, pist = sist )
+            &                                             qns_tot, qns_ice, qsr_tot , qsr_ice,   &
+            &                                             emp_tot, emp_ice, dqns_ice, sprecip,   &
+            !                                optional arguments, used only in 'mixed oce-ice' case
+            &                                             palbi = zalb_ice_cs, psst = sst_m, pist = zsist )
 #endif
                            CALL lim_thd_2      ( kt )      ! Ice thermodynamics 
@@ -214,4 +228,6 @@
       IF( ln_limdyn    )   CALL lim_sbc_tau_2( kt, ub(:,:,1), vb(:,:,1) )  ! using before instantaneous surf. currents
       !
+      IF( wrk_not_released(3, 1,2,3) )   CALL ctl_stop('sbc_ice_lim_2: failed to release workspace arrays')
+      !
    END SUBROUTINE sbc_ice_lim_2
 
@@ -222,4 +238,5 @@
 CONTAINS
    SUBROUTINE sbc_ice_lim_2 ( kt, ksbc )     ! Dummy routine
+      INTEGER, INTENT(in) ::   kt, ksbc    
       WRITE(*,*) 'sbc_ice_lim_2: You should not have seen this print! error?', kt, ksbc
    END SUBROUTINE sbc_ice_lim_2
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 2715)
@@ -38,6 +38,6 @@
    USE sbcfwb           ! surface boundary condition: freshwater budget
    USE closea           ! closed sea
-   USE bdy_par         ! unstructured open boundary data variables
-   USE bdyice          ! unstructured open boundary data  (bdy_ice_frs routine)
+   USE bdy_par          ! unstructured open boundary data variables
+   USE bdyice           ! unstructured open boundary data  (bdy_ice_frs routine)
 
    USE prtctl           ! Print control                    (prt_ctl routine)
@@ -45,4 +45,5 @@
    USE iom              ! IOM library
    USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
@@ -57,7 +58,7 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO-consortium (2010) 
+   !! NEMO/OPA 4.0 , NEMO-consortium (2011) 
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -74,8 +75,8 @@
       !!              - nsbc: type of sbc
       !!----------------------------------------------------------------------
-      INTEGER ::   icpt      ! temporary integer
-      !!
-      NAMELIST/namsbc/ nn_fsbc, ln_ana  , ln_flx, ln_blk_clio, ln_blk_core, ln_cpl    ,   &
-         &             ln_apr_dyn, nn_ice , ln_dm2dc, ln_rnf, ln_ssr     , nn_fwb
+      INTEGER ::   icpt   ! local integer
+      !!
+      NAMELIST/namsbc/ nn_fsbc   , ln_ana , ln_flx  , ln_blk_clio, ln_blk_core, ln_cpl,   &
+         &             ln_apr_dyn, nn_ice , ln_dm2dc, ln_rnf     , ln_ssr     , nn_fwb
       !!----------------------------------------------------------------------
 
@@ -118,7 +119,11 @@
       ENDIF
 
+      !                              ! allocate sbc arrays
+      IF( sbc_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_oce arrays' )
+
       !                          ! Checks:
       IF( .NOT. ln_rnf ) THEN                      ! no specific treatment in vicinity of river mouths 
          ln_rnf_mouth  = .false.                      
+         IF( sbc_rnf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_rnf arrays' )
          nkrnf         = 0
          rnf     (:,:) = 0.e0
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 2715)
@@ -19,9 +19,10 @@
    USE phycst          ! physical constants
    USE sbc_oce         ! surface boundary condition variables
+   USE closea          ! closed seas
    USE fldread         ! read input field at current time step
+   USE restart         ! restart
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O module
-   USE restart         ! restart
-   USE closea          ! closed seas
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -30,6 +31,7 @@
    PUBLIC   sbc_rnf       ! routine call in sbcmod module
    PUBLIC   sbc_rnf_div   ! routine called in sshwzv module
-
-   !                                                      !!* namsbc_rnf namelist *
+   PUBLIC   sbc_rnf_alloc ! routine call in sbcmod module
+
+   !                                                     !!* namsbc_rnf namelist *
    CHARACTER(len=100), PUBLIC ::   cn_dir       = './'    !: Root directory for location of ssr files
    LOGICAL           , PUBLIC ::   ln_rnf_depth = .false. !: depth       river runoffs attribute specified in a file
@@ -47,10 +49,10 @@
    REAL(wp)          , PUBLIC ::   rn_rfact     = 1._wp   !: multiplicative factor for runoff
 
-   INTEGER , PUBLIC                          ::   nkrnf = 0         !: nb of levels over which Kz is increased at river mouths
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)      ::   rnfmsk            !: river mouth mask (hori.)
-   REAL(wp), PUBLIC, DIMENSION(jpk)          ::   rnfmsk_z          !: river mouth mask (vert.)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)      ::   h_rnf             !: depth of runoff in m
-   INTEGER,  PUBLIC, DIMENSION(jpi,jpj)      ::   nk_rnf            !: depth of runoff in model levels
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpts) :: rnf_tsc_b, rnf_tsc  !: before and now T & S contents of runoffs  [K.m/s & PSU.m/s]
+   INTEGER , PUBLIC  ::   nkrnf = 0         !: nb of levels over which Kz is increased at river mouths
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rnfmsk              !: river mouth mask (hori.)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   rnfmsk_z            !: river mouth mask (vert.)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   h_rnf               !: depth of runoff in m
+   INTEGER,  PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nk_rnf              !: depth of runoff in model levels
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rnf_tsc_b, rnf_tsc  !: before and now T & S runoff contents   [K.m/s & PSU.m/s]
    
    REAL(wp) ::   r1_rau0   ! = 1 / rau0 
@@ -68,4 +70,16 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION sbc_rnf_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE sbc_rnf_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( rnfmsk(jpi,jpj)         , rnfmsk_z(jpk)          ,     &
+         &      h_rnf (jpi,jpj)         , nk_rnf  (jpi,jpj)      ,     &
+         &      rnf_tsc_b(jpi,jpj,jpts) , rnf_tsc (jpi,jpj,jpts) , STAT=sbc_rnf_alloc )
+         !
+      IF( lk_mpp            )   CALL mpp_sum ( sbc_rnf_alloc )
+      IF( sbc_rnf_alloc > 0 )   CALL ctl_warn('sbc_rnf_alloc: allocation of arrays failed')
+   END FUNCTION sbc_rnf_alloc
 
    SUBROUTINE sbc_rnf( kt )
@@ -182,5 +196,5 @@
       !! ** Action  :   phdivn   decreased by the runoff inflow
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phdivn   ! horizontal divergence
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence
       !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -276,4 +290,6 @@
       !                                   !   Type of runoff
       !                                   ! ==================
+      !                                         !==  allocate runoff arrays
+      IF( sbc_rnf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_rnf_alloc : unable to allocate arrays' )
       !
       IF( ln_rnf_emp ) THEN                     !==  runoffs directly provided in the precipitations  ==!
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 2715)
@@ -4,5 +4,5 @@
    !! Surface module :  provide time-mean ocean surface variables
    !!======================================================================
-   !! History :  9.0   !  06-07  (G. Madec)  Original code
+   !! History :  9.0  ! 2006-07  (G. Madec)  Original code
    !!            3.3  ! 2010-10  (C. Bricaud, G. Madec)  add the Patm forcing for sea-ice
    !!----------------------------------------------------------------------
@@ -32,7 +32,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -50,8 +49,7 @@
       !!      is add to ssh_m when ln_apr_dyn = T. Required for sea-ice dynamics.
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt        ! ocean time step
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
       !
-      REAL(wp) ::   zcoef       ! temporary scalar
-      REAL(wp) ::   zf_sbc      ! read sbc frequency 
+      REAL(wp) ::   zcoef, zf_sbc       ! local scalar
       !!---------------------------------------------------------------------
       !                                                   ! ---------------------------------------- !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 2715)
@@ -26,8 +26,7 @@
 
    PUBLIC   sbc_ssr    ! routine called in sbcmod
-   
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   erp      !: evaporation damping   [kg/m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qrp      !: heat flux damping        [w/m2]
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   erp   !: evaporation damping   [kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qrp   !: heat flux damping        [w/m2]
 
    !                                           !!* Namelist namsbc_ssr *
@@ -46,9 +45,8 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -109,28 +107,34 @@
          ENDIF
 
-         IF( nn_sstr == 1 ) THEN      !* set sf_sst structure
+         ! Allocate erp and qrp array
+         ALLOCATE( qrp(jpi,jpj), erp(jpi,jpj), STAT=ierror )
+         IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate erp and qrp array' )
+
+         IF( nn_sstr == 1 ) THEN      !* set sf_sst structure & allocate arrays
             !
             ALLOCATE( sf_sst(1), STAT=ierror )
-            IF( ierror > 0 ) THEN
-               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sst structure' )   ;   RETURN
-            ENDIF
-            ALLOCATE( sf_sst(1)%fnow(jpi,jpj,1) )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst structure' )
+            ALLOCATE( sf_sst(1)%fnow(jpi,jpj,1), STAT=ierror )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst now array' )
             !
             ! fill sf_sst with sn_sst and control print
             CALL fld_fill( sf_sst, (/ sn_sst /), cn_dir, 'sbc_ssr', 'SST restoring term toward SST data', 'namsbc_ssr' )
-            IF( sf_sst(1)%ln_tint ) ALLOCATE( sf_sst(1)%fdta(jpi,jpj,1,2) )
-         ENDIF
-         !
-         IF( nn_sssr >= 1 ) THEN      ! set sf_sss structure
+            IF( sf_sst(1)%ln_tint )   ALLOCATE( sf_sst(1)%fdta(jpi,jpj,1,2), STAT=ierror )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sst data array' )
+            !
+         ENDIF
+         !
+         IF( nn_sssr >= 1 ) THEN      ! set sf_sss structure & allocate arrays
             !
             ALLOCATE( sf_sss(1), STAT=ierror )
-            IF( ierror > 0 ) THEN
-               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sss structure' )   ;   RETURN
-            ENDIF
-            ALLOCATE( sf_sss(1)%fnow(jpi,jpj,1) )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss structure' )
+            ALLOCATE( sf_sss(1)%fnow(jpi,jpj,1), STAT=ierror )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss now array' )
             !
             ! fill sf_sss with sn_sss and control print
             CALL fld_fill( sf_sss, (/ sn_sss /), cn_dir, 'sbc_ssr', 'SSS restoring term toward SSS data', 'namsbc_ssr' )
-            IF( sf_sss(1)%ln_tint )ALLOCATE( sf_sss(1)%fdta(jpi,jpj,1,2) )
+            IF( sf_sss(1)%ln_tint )   ALLOCATE( sf_sss(1)%fdta(jpi,jpj,1,2), STAT=ierror )
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate sf_sss data array' )
+            !
          ENDIF
          !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/sol_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/sol_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/sol_oce.F90	(revision 2715)
@@ -4,10 +4,19 @@
    !! Ocean solver :  elliptic solver variables defined in memory 
    !!======================================================================
-   !! History :  1.0  !  02-11  (G. Madec)  F90: Free form and module
+   !! History :  1.0  ! 2002-11  (G. Madec)  F90: Free form and module
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
-   USE par_oce         ! ocean parameters
+
+   !!----------------------------------------------------------------------
+   !!   sol_oce_alloc : allocate the solver arrays
+   !!----------------------------------------------------------------------
+   USE par_oce        ! ocean parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! distributed memory computing
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC   sol_oce_alloc   ! routine called in solver.F90
 
    !                                             !!* Namelist namsol : elliptic solver *
@@ -35,16 +44,16 @@
    REAL(wp), PUBLIC ::   rr          !: coefficient  =(rn,rn)
 
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) ::   gcp     !: matrix extra-diagonal elements
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcx     !: now    solution of the elliptic eq.
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcxb    !: before solution of the elliptic eq.
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcdprc  !: inverse diagonal preconditioning matrix
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcdmat  !: diagonal preconditioning matrix
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcb     !: second member of the elliptic eq.
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcr     !: residu =b-a.x
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gcdes   !: vector descente
-   REAL(wp), PUBLIC, DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ::   gccd    !: gccd= gcdprc^-1.a.d 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gcp     !: matrix extra-diagonal elements
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcx     !: now    solution of the elliptic eq.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcxb    !: before solution of the elliptic eq.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcdprc  !: inverse diagonal preconditioning matrix
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcdmat  !: diagonal preconditioning matrix
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcb     !: second member of the elliptic eq.
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcr     !: residu =b-a.x
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gcdes   !: vector descente
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gccd    !: gccd= gcdprc^-1.a.d 
 
 #if defined key_agrif
-      REAL(wp), DIMENSION(jpi,jpj) :: laplacu, laplacv
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: laplacu, laplacv
 #endif
 
@@ -52,5 +61,39 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence    (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION sol_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION sol_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER  :: ierr(3)
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      ALLOCATE( gcp (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) ,     &
+         &      gcx (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   ,     &
+         &      gcxb(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj)   , STAT=ierr(1) )
+
+      ALLOCATE( gcdprc(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) ,     & 
+         &      gcdmat(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) ,     & 
+         &      gcb   (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) , STAT=ierr(2) )
+
+      ALLOCATE( gcr  (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) ,   & 
+         &      gcdes(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) ,   & 
+         &      gccd (1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj) ,   &
+#if defined key_agrif
+         &      laplacu(jpi,jpj), laplacv(jpi,jpj),             &
+#endif
+         &      STAT=ierr(3) )
+         !
+      sol_oce_alloc = MAXVAL(ierr)
+      !
+      IF( lk_mpp            )   CALL mpp_sum ( sol_oce_alloc )
+      IF( sol_oce_alloc > 0 )   CALL ctl_warn('sol_oce_alloc: allocation of arrays failed')
+      !
+   END FUNCTION sol_oce_alloc
+
+   !!======================================================================
 END MODULE sol_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 2715)
@@ -40,7 +40,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -320,8 +319,14 @@
       !!
       INTEGER  ::   ji, jk   ! dummy loop indices
-      INTEGER  ::   iloc     ! temporary integers
-      REAL(wp), DIMENSION(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4) ::   ztab   ! 2D workspace
-      !!----------------------------------------------------------------------
-
+      INTEGER  ::   iloc     ! local integers
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ztab   ! workspace allocated one for all
+      !!----------------------------------------------------------------------
+
+      IF( .NOT. ALLOCATED( ztab ) ) THEN
+         ALLOCATE( ztab(1-jpr2di:jpi+jpr2di,1-jpr2dj:jpj+jpr2dj,4), STAT=iloc )
+         IF( lk_mpp    )   CALL mpp_sum ( iloc )
+         IF( iloc /= 0 )   CALL ctl_stop('STOP', 'sol_exd: failed to allocate array')
+      ENDIF
+      
       ztab = pt3d
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90	(revision 2715)
@@ -26,5 +26,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -83,19 +83,24 @@
       !!        !  08-01  (R. Benshila) mpp optimization
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( inout ) ::   kindic   ! solver indicator, < 0 if the conver-
-      !                                      ! gence is not reached: the model is
-      !                                      ! stopped in step
-      !                                      ! set to zero before the call of solpcg
-      !!
-      INTEGER ::   ji, jj, jn                ! dummy loop indices
-      REAL(wp) ::  zgcad                     ! temporary scalars
-      REAL(wp), DIMENSION(2) :: zsum
-      REAL(wp), DIMENSION(jpi,jpj) :: zgcr
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zgcr => wrk_2d_1
+      !!
+      INTEGER, INTENT(inout) ::   kindic   ! solver indicator, < 0 if the conver-
+      !                                    ! gence is not reached: the model is stopped in step
+      !                                    ! set to zero before the call of solpcg
+      !!
+      INTEGER  ::   ji, jj, jn   ! dummy loop indices
+      REAL(wp) ::   zgcad        ! temporary scalars
+      REAL(wp), DIMENSION(2) ::   zsum
       !!----------------------------------------------------------------------
+      
+      IF( wrk_in_use(2, 1) )THEN
+         CALL ctl_stop('sol_pcg: requested workspace array is unavailable')   ;   RETURN
+      ENDIF
 
       ! Initialization of the algorithm with standard PCG
       ! -------------------------------------------------
-      zgcr = 0.e0 
-      gcr  = 0.e0 
+      zgcr = 0._wp
+      gcr  = 0._wp
 
       CALL lbc_lnk( gcx, c_solver_pt, 1. )   ! lateral boundary condition
@@ -200,13 +205,10 @@
       END DO                                           !    End Loop
       !                                                !================
-     
 999   CONTINUE
-     
-     
-      ! Output in gcx with lateral b.c. applied
-      ! ---------------------------------------
-     
-      CALL lbc_lnk( gcx, c_solver_pt, 1. )
-     
+          
+      CALL lbc_lnk( gcx, c_solver_pt, 1. )      ! Output in gcx with lateral b.c. applied
+      ! 
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('sol_pcg: failed to release workspace array')
+      !
    END SUBROUTINE sol_pcg
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solsor.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solsor.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solsor.F90	(revision 2715)
@@ -32,7 +32,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
       
@@ -58,14 +57,19 @@
       !!                Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztab => wrk_2d_1    ! 2D workspace
+      !!
       INTEGER, INTENT(inout) ::   kindic   ! solver indicator, < 0 if the convergence is not reached:
       !                                    ! the model is stopped in step (set to zero before the call of solsor)
       !!
-      INTEGER  ::   ji, jj, jn               ! dummy loop indices
-      INTEGER  ::   ishift, icount
-      INTEGER  ::   ijmppodd, ijmppeven, ijpr2d
-      REAL(wp) ::   ztmp, zres, zres2
-      REAL(wp), DIMENSION(jpi,jpj) ::ztab
+      INTEGER  ::   ji, jj, jn       ! dummy loop indices
+      INTEGER  ::   ishift, icount, ijmppodd, ijmppeven, ijpr2d   ! local integers
+      REAL(wp) ::   ztmp, zres, zres2                             ! local scalars
       !!----------------------------------------------------------------------
       
+      IF( wrk_in_use(2, 1) )THEN
+         CALL ctl_stop('sol_sor: requested workspace array is unavailable')   ;   RETURN
+      ENDIF
+
       ijmppeven = MOD( nimpp+njmpp+jpr2di+jpr2dj   , 2 )
       ijmppodd  = MOD( nimpp+njmpp+jpr2di+jpr2dj+1 , 2 )
@@ -163,4 +167,6 @@
       !  -------------
       CALL lbc_lnk_e( gcx, c_solver_pt, 1. )    ! boundary conditions
+      ! 
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('sol_sor: failed to release workspace array')
       !
    END SUBROUTINE sol_sor
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90	(revision 2715)
@@ -26,5 +26,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE lib_mpp
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -33,7 +33,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -80,4 +79,7 @@
       eps = rn_eps
 
+      !                              ! allocate solver arrays
+      IF( sol_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'solver_init : unable to allocate sol_oce arrays' )
+
       SELECT CASE( nn_solv )          !* parameter check
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 2715)
@@ -33,6 +33,7 @@
    USE dom_oce         ! ocean space and time domain
    USE phycst          ! physical constants
+   USE zdfddm          ! vertical physics: double diffusion
    USE in_out_manager  ! I/O manager
-   USE zdfddm          ! vertical physics: double diffusion
+   USE lib_mpp         ! MPP library
    USE prtctl          ! Print control
 
@@ -107,17 +108,23 @@
       !! References :   Jackett and McDougall, J. Atmos. Ocean. Tech., 1994
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
-      !                                                               ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   prd   ! in situ density 
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zws => wrk_3d_1   ! 3D workspace
+      !!
+      REAL(wp), DIMENSION(:,:,:,:), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
+      !                                                      ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(:,:,:)  , INTENT(  out) ::   prd   ! in situ density            [-]
       !!
       INTEGER  ::   ji, jj, jk           ! dummy loop indices
-      REAL(wp) ::   zt , zs , zh , zsr   ! temporary scalars
-      REAL(wp) ::   zr1, zr2, zr3, zr4   !    -         -
-      REAL(wp) ::   zrhop, ze, zbw, zb   !    -         -
-      REAL(wp) ::   zd , zc , zaw, za    !    -         -
-      REAL(wp) ::   zb1, za1, zkw, zk0   !    -         -
-      REAL(wp) ::   zrau0r               !    -         -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zws   ! temporary workspace
-      !!----------------------------------------------------------------------
+      REAL(wp) ::   zt , zs , zh , zsr   ! local scalars
+      REAL(wp) ::   zr1, zr2, zr3, zr4   !   -      -
+      REAL(wp) ::   zrhop, ze, zbw, zb   !   -      -
+      REAL(wp) ::   zd , zc , zaw, za    !   -      -
+      REAL(wp) ::   zb1, za1, zkw, zk0   !   -      -
+      REAL(wp) ::   zrau0r               !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('eos_insitu: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       SELECT CASE( nn_eos )
@@ -183,4 +190,6 @@
       !
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos  : ', ovlap=1, kdim=jpk )
+      !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('eos_insitu: failed to release workspace array')
       !
    END SUBROUTINE eos_insitu
@@ -233,14 +242,20 @@
       !!                Brown and Campana, Mon. Weather Rev., 1978
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
-      !                                                               ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd    ! in situ density 
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zws => wrk_3d_1 ! 3D workspace
+      !!
+      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts    ! 1 : potential temperature  [Celcius]
+      !                                                                ! 2 : salinity               [psu]
+      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prd    ! in situ density            [-]
       REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   prhop  ! potential density (surface referenced)
-
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zt, zs, zh, zsr, zr1, zr2, zr3, zr4, zrhop, ze, zbw   ! temporary scalars
-      REAL(wp) ::   zb, zd, zc, zaw, za, zb1, za1, zkw, zk0, zrau0r       !    -         -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zws   ! 3D workspace
-      !!----------------------------------------------------------------------
+      REAL(wp) ::   zt, zs, zh, zsr, zr1, zr2, zr3, zr4, zrhop, ze, zbw   ! local scalars
+      REAL(wp) ::   zb, zd, zc, zaw, za, zb1, za1, zkw, zk0, zrau0r       !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('eos_insitu_pot: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       SELECT CASE ( nn_eos )
@@ -311,4 +326,6 @@
       !
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-p: ', tab3d_2=prhop, clinfo2=' pot : ', ovlap=1, kdim=jpk )
+      !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('eos_insitu_pot: failed to release workspace array')
       !
    END SUBROUTINE eos_insitu_pot
@@ -351,4 +368,7 @@
       !! References :   Jackett and McDougall, J. Atmos. Ocean. Tech., 1994
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zws => wrk_2d_5 ! 2D workspace
+      !!
       REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
       !                                                           ! 2 : salinity               [psu]
@@ -359,8 +379,11 @@
       REAL(wp) ::   zt, zs, zh, zsr, zr1, zr2, zr3, zr4, zrhop, ze, zbw   ! temporary scalars
       REAL(wp) ::   zb, zd, zc, zaw, za, zb1, za1, zkw, zk0, zmask        !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zws   ! 2D workspace
-      !!----------------------------------------------------------------------
-
-      prd(:,:) = 0.e0
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 5) ) THEN
+         CALL ctl_stop('eos_insitu_2d: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
+      prd(:,:) = 0._wp
 
       SELECT CASE( nn_eos )
@@ -434,4 +457,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab2d_1=prd, clinfo1=' eos2d: ' )
       !
+      IF( wrk_not_released(2, 5) )   CALL ctl_stop('eos_insitu_2d: failed to release workspace array')
+      !
    END SUBROUTINE eos_insitu_2d
 
@@ -469,10 +494,10 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
       !                                                               ! 2 : salinity               [psu]
-      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pn2    ! Brunt-Vaisala frequency [s-1]
+      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pn2   ! Brunt-Vaisala frequency    [s-1]
       !!
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zgde3w, zt, zs, zh, zalbet, zbeta   ! temporary scalars 
+      REAL(wp) ::   zgde3w, zt, zs, zh, zalbet, zbeta   ! local scalars 
 #if defined key_zdfddm
-      REAL(wp) ::   zds   ! temporary scalars
+      REAL(wp) ::   zds   ! local scalars
 #endif
       !!----------------------------------------------------------------------
@@ -488,7 +513,7 @@
                DO ji = 1, jpi
                   zgde3w = grav / fse3w(ji,jj,jk)
-                  zt = 0.5 * ( pts(ji,jj,jk,jp_tem) + pts(ji,jj,jk-1,jp_tem) )          ! potential temperature at w-point
-                  zs = 0.5 * ( pts(ji,jj,jk,jp_sal) + pts(ji,jj,jk-1,jp_sal) ) - 35.0   ! salinity anomaly (s-35) at w-point
-                  zh = fsdepw(ji,jj,jk)                                     ! depth in meters  at w-point
+                  zt = 0.5 * ( pts(ji,jj,jk,jp_tem) + pts(ji,jj,jk-1,jp_tem) )         ! potential temperature at w-pt
+                  zs = 0.5 * ( pts(ji,jj,jk,jp_sal) + pts(ji,jj,jk-1,jp_sal) ) - 35.0  ! salinity anomaly (s-35) at w-pt
+                  zh = fsdepw(ji,jj,jk)                                                ! depth in meters  at w-point
                   !
                   zalbet = ( ( ( - 0.255019e-07_wp * zt + 0.298357e-05_wp ) * zt   &   ! ratio alpha/beta
@@ -586,5 +611,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts            ! pot. temperature & salinity
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   palph, pbeta   ! thermal & haline expansion coeff.
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zt, zs, zh   ! local scalars 
@@ -661,4 +686,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   psal   ! salinity             [psu]
+      ! Leave result array automatic rather than making explicitly allocated
       REAL(wp), DIMENSION(jpi,jpj)                ::   ptf    ! freezing temperature [Celcius]
       !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 2715)
@@ -24,6 +24,7 @@
    USE ldftra_oce      ! lateral diffusion coefficient on tracers
    USE in_out_manager  ! I/O manager
+   USE iom             ! I/O module
    USE prtctl          ! Print control
-   USE iom
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -32,5 +33,5 @@
    PUBLIC   tra_adv        ! routine called by step module
    PUBLIC   tra_adv_init   ! routine called by opa module
- 
+
    !                                        !!* Namelist namtra_adv *
    LOGICAL ::   ln_traadv_cen2   = .TRUE.    ! 2nd order centered scheme flag
@@ -43,6 +44,4 @@
    INTEGER ::   nadv   ! choice of the type of advection scheme
 
-   REAL(wp), DIMENSION(jpk) ::   r2dt   ! vertical profile time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0
-
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -63,14 +62,20 @@
       !! ** Method  : - Update (ua,va) with the advection term following nadv
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zun => wrk_3d_1 , zvn => wrk_3d_2 , zwn => wrk_3d_3   ! 3D workspace
+      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !
       INTEGER ::   jk   ! dummy loop index
-      REAL(wp), DIMENSION(jpi,jpj,jpk)   ::  zun, zvn, zwn   ! 3D workspace: effective transport
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(3, 1,2,3) ) THEN
+         CALL ctl_stop('tra_adv: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
       !                                          ! set time step
       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
-         r2dt(:) =  rdttra(:)                          ! = rdtra (restarting with Euler time stepping)
+         r2dtra(:) =  rdttra(:)                          ! = rdtra (restarting with Euler time stepping)
       ELSEIF( kt <= nit000 + 1) THEN                ! at nit000 or nit000+1
-         r2dt(:) = 2. * rdttra(:)                      ! = 2 rdttra (leapfrog)
+         r2dtra(:) = 2._wp * rdttra(:)                   ! = 2 rdttra (leapfrog)
       ENDIF
       !
@@ -95,28 +100,28 @@
 
       SELECT CASE ( nadv )                            !==  compute advection trend and add it to general trend  ==!
-      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, 'TRA',       zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  2nd order centered
-      CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  TVD 
-      CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb,      tsa, jpts )   !  MUSCL 
-      CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  MUSCL2 
-      CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  UBS 
-      CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  QUICKEST 
+      CASE ( 1 )   ;    CALL tra_adv_cen2  ( kt, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  2nd order centered
+      CASE ( 2 )   ;    CALL tra_adv_tvd   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  TVD 
+      CASE ( 3 )   ;    CALL tra_adv_muscl ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )   !  MUSCL 
+      CASE ( 4 )   ;    CALL tra_adv_muscl2( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  MUSCL2 
+      CASE ( 5 )   ;    CALL tra_adv_ubs   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  UBS 
+      CASE ( 6 )   ;    CALL tra_adv_qck   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )   !  QUICKEST 
       !
       CASE (-1 )                                      !==  esopa: test all possibility with control print  ==!
-         CALL tra_adv_cen2  ( kt, 'TRA',       zun, zvn, zwn, tsb, tsn, tsa, jpts )          
+         CALL tra_adv_cen2  ( kt, 'TRA',         zun, zvn, zwn, tsb, tsn, tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv0 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_adv_tvd   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
+         CALL tra_adv_tvd   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv1 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_adv_muscl ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb,      tsa, jpts )          
+         CALL tra_adv_muscl ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb,      tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv3 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_adv_muscl2( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
+         CALL tra_adv_muscl2( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv4 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_adv_ubs   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
+         CALL tra_adv_ubs   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv5 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_adv_qck   ( kt, 'TRA', r2dt, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
+         CALL tra_adv_qck   ( kt, 'TRA', r2dtra, zun, zvn, zwn, tsb, tsn, tsa, jpts )          
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv6 - Ta: ', mask1=tmask,               &
             &          tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
@@ -126,4 +131,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' adv  - Ta: ', mask1=tmask,               &
          &                       tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
+      !
+      IF( wrk_not_released(3,1,2,3) )   CALL ctl_stop('tra_adv: failed to release workspace arrays')
       !
    END SUBROUTINE tra_adv
@@ -144,6 +151,6 @@
       !!----------------------------------------------------------------------
 
-      REWIND ( numnam )               ! Read Namelist namtra_adv : tracer advection scheme
-      READ   ( numnam, namtra_adv )
+      REWIND( numnam )                ! Read Namelist namtra_adv : tracer advection scheme
+      READ  ( numnam, namtra_adv )
 
       IF(lwp) THEN                    ! Namelist print
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2715)
@@ -31,15 +31,16 @@
    USE restart         ! ocean restart
    USE trc_oce         ! share passive tracers/Ocean variables
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   tra_adv_cen2    ! routine called by step.F90
-   PUBLIC   ups_orca_set    ! routine used by traadv_cen2_jki.F90
+   PUBLIC   tra_adv_cen2       ! routine called by step.F90
+   PUBLIC   ups_orca_set       ! routine used by traadv_cen2_jki.F90
 
    LOGICAL  :: l_trd       ! flag to compute trends
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: upsmsk    !: mixed upstream/centered scheme near some straits 
-   !                                                   !  and in closed seas (orca 2 and 4 configurations)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: upsmsk !: mixed upstream/centered scheme near some straits 
+   !                                                             !  and in closed seas (orca 2 and 4 configurations)
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -109,7 +110,9 @@
       !!              - save trends if needed
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      USE oce         , zwy => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx => ua       , zwy  => va         ! (ua,va) used as 3D workspace
+      USE wrk_nemo, ONLY:   zwz => wrk_3d_1 , zind => wrk_3d_2   ! 3D workspace
+      USE wrk_nemo, ONLY:   ztfreez => wrk_2d_1                  ! 2D     -
+      !
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
@@ -118,18 +121,17 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
-      INTEGER  ::   ji, jj, jk, jn                   ! dummy loop indices
-      REAL(wp) ::   zbtr, ztra                       ! temporary scalars
-      REAL(wp) ::   zfp_ui, zfp_vj, zfp_w            !    -         -
-      REAL(wp) ::   zfm_ui, zfm_vj, zfm_w            !    -         -
-      REAL(wp) ::   zcofi , zcofj , zcofk            !    -         -
-      REAL(wp) ::   zupsut, zcenut                   !    -         -
-      REAL(wp) ::   zupsvt, zcenvt                   !    -         -
-      REAL(wp) ::   zupst , zcent                    !    -         -
-      REAL(wp) ::   zice                             !    -         -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   ztfreez            ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwz, zind   ! 3D workspace 
-      !!----------------------------------------------------------------------
-
+      !
+      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
+      INTEGER  ::   ierr             ! local integer
+      REAL(wp) ::   zbtr, ztra                            ! local scalars
+      REAL(wp) ::   zfp_ui, zfp_vj, zfp_w, zcofi          !   -      -
+      REAL(wp) ::   zfm_ui, zfm_vj, zfm_w, zcofj, zcofk   !   -      -
+      REAL(wp) ::   zupsut, zcenut, zupst                 !   -      -
+      REAL(wp) ::   zupsvt, zcenvt, zcent, zice           !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('tra_adv_cen2: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -139,5 +141,8 @@
          IF(lwp) WRITE(numout,*)
          !
-         upsmsk(:,:) = 0.e0                              ! not upstream by default
+         ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
+         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'tra_adv_cen2: unable to allocate array')
+         !
+         upsmsk(:,:) = 0._wp                             ! not upstream by default
          ! 
          IF( cp_cfg == "orca" )   CALL ups_orca_set      ! set mixed Upstream/centered scheme near some straits
@@ -151,5 +156,5 @@
          !
          l_trd = .FALSE.
-         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) ) l_trd = .TRUE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE.
       ENDIF
       !
@@ -269,4 +274,7 @@
          CALL iom_rstput( kt, nitrst, numrow, 'avtb', avtb )
       ENDIF
+      !
+      IF( wrk_not_released(2, 1)   .OR.   &
+          wrk_not_released(3, 1,2) )   CALL ctl_stop('tra_adv_cen2: failed to release workspace arrays')
       !
    END SUBROUTINE tra_adv_cen2
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_eiv.F90	(revision 2715)
@@ -25,5 +25,5 @@
    USE phycst          ! physical constants
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE diaar5, ONLY :   lk_diaar5
+   USE diaar5, ONLY:   lk_diaar5
 # endif  
 
@@ -41,7 +41,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -64,4 +63,9 @@
       !! ** Action  : - add to p.n the eiv component
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zu_eiv => wrk_2d_1 , zv_eiv => wrk_2d_2 , zw_eiv => wrk_2d_3   ! 2D workspace
+# if defined key_diaeiv 
+      USE wrk_nemo, ONLY:   z2d => wrk_2d_4   ! 2D workspace
+#endif
       INTEGER                         , INTENT(in   ) ::   kt       ! ocean time-step index
       CHARACTER(len=3)                , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
@@ -73,10 +77,16 @@
       REAL(wp) ::   zuwk, zuwk1, zuwi, zuwi1   ! local scalars
       REAL(wp) ::   zvwk, zvwk1, zvwj, zvwj1   !   -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zu_eiv, zv_eiv, zw_eiv     ! 2D workspace
 # if defined key_diaeiv 
       REAL(wp) ::   zztmp                      ! local scalar
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2d    ! 2D workspace
 # endif  
       !!----------------------------------------------------------------------
+
+# if defined key_diaeiv 
+      IF( wrk_in_use(2, 1,2,3,4) ) THEN
+# else
+      IF( wrk_in_use(2, 1,2,3)   ) THEN
+# endif
+         CALL ctl_stop('tra_adv_eiv: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -180,4 +190,10 @@
 # endif  
       ! 
+# if defined key_diaeiv 
+      IF( wrk_not_released(2, 1,2,3,4) )   CALL ctl_stop('tra_adv_eiv: failed to release workspace arrays')
+# else
+      IF( wrk_not_released(2, 1,2,3)   )   CALL ctl_stop('tra_adv_eiv: failed to release workspace arrays')
+# endif
+      !
     END SUBROUTINE tra_adv_eiv
 
@@ -191,6 +207,5 @@
       CHARACTER(len=3) ::   cdtype
       REAL, DIMENSION(:,:,:) ::   pun, pvn, pwn
-      WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', kt, cdtype
-      WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', pun(1,1,1), pvn(1,1,1), pwn(1,1,1)
+      WRITE(*,*) 'tra_adv_eiv: You should not have seen this print! error?', kt, cdtype, pun(1,1,1), pvn(1,1,1), pwn(1,1,1)
    END SUBROUTINE tra_adv_eiv
 #endif
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2715)
@@ -61,7 +61,8 @@
       !!              IPSL, Sept. 2000 (http://www.lodyc.jussieu.fr/opa)
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      USE oce         , zwy => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx   => ua       , zwy   => va          ! (ua,va) used as workspace
+      USE wrk_nemo, ONLY:   zslpx => wrk_3d_1 , zslpy => wrk_3d_2    ! 3D workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
@@ -71,12 +72,14 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb             ! before tracer field
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp) ::   zu, z0u, zzwx    ! local scalar
-      REAL(wp) ::   zv, z0v, zzwy    !   -      -
-      REAL(wp) ::   zw, z0w          !   -      -
-      REAL(wp) ::   ztra, zbtr, zdt, zalpha
-      REAL(wp), DIMENSION (jpi,jpj,jpk) :: zslpx, zslpy   ! 3D workspace
+      REAL(wp) ::   zu, z0u, zzwx, zw         ! local scalars
+      REAL(wp) ::   zv, z0v, zzwy, z0w        !   -      -
+      REAL(wp) ::   ztra, zbtr, zdt, zalpha   !   -      -
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('tra_adv_muscl: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -249,4 +252,6 @@
       ENDDO
       !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('tra_adv_muscl: requested workspace arrays unavailable')
+      !
    END SUBROUTINE tra_adv_muscl
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2715)
@@ -1,7 +1,7 @@
 MODULE traadv_muscl2
-   !!==============================================================================
+   !!======================================================================
    !!                       ***  MODULE  traadv_muscl2  ***
    !! Ocean  tracers:  horizontal & vertical advective trend
-   !!==============================================================================
+   !!======================================================================
    !! History :  1.0  !  2002-06  (G. Madec) from traadv_muscl
    !!            3.2  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA + switch from velocity to transport
@@ -59,6 +59,7 @@
       !!              IPSL, Sept. 2000 (http://www.lodyc.jussieu.fr/opa)
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      USE oce         , zwy => va   ! use va as workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx   => ua       , zwy   => va         ! (ua,va) used as 3D workspace
+      USE wrk_nemo, ONLY:   zslpx => wrk_3d_1 , zslpy => wrk_3d_2   ! 3D workspace
       !!
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
@@ -71,10 +72,12 @@
       !!
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp) ::   zu, z0u, zzwx    ! local scalar
-      REAL(wp) ::   zv, z0v, zzwy    !   -      -
-      REAL(wp) ::   zw, z0w          !   -      -
-      REAL(wp) ::   ztra, zbtr, zdt, zalpha
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::  zslpx, zslpy   ! 3D workspace
+      REAL(wp) ::   zu, z0u, zzwx, zw         ! local scalars
+      REAL(wp) ::   zv, z0v, zzwy, z0w        !   -      -
+      REAL(wp) ::   ztra, zbtr, zdt, zalpha   !   -      -
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('tra_adv_muscl2: requested workspace arrays are unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -84,5 +87,5 @@
          !
          l_trd = .FALSE.
-         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) ) l_trd = .TRUE.
+         IF( ( cdtype == 'TRA' .AND. l_trdtra ) .OR. ( cdtype == 'TRC' .AND. l_trdtrc ) )   l_trd = .TRUE.
       ENDIF
 
@@ -282,4 +285,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('tra_adv_muscl2: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_adv_muscl2
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2715)
@@ -115,20 +115,23 @@
       !!
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      !!
-      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
-      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
-      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun             ! i-velocity components
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
-      INTEGER  :: ji, jj, jk, jn           ! dummy loop indices
-      REAL(wp) :: ztra, zbtr               ! local scalars
-      REAL(wp) :: zdir, zdx, zdt, zmsk     ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd   ! 3D wokspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx => ua       ! ua used as workspace
+      USE wrk_nemo, ONLY:   zfu => wrk_3d_1 , zfc => wrk_3d_2, zfd => wrk_3d_3   ! 3D workspace
+      !
+      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
+      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
+      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pun        ! i-velocity components
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn   ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend 
+      !!
+      INTEGER  :: ji, jj, jk, jn   ! dummy loop indices
+      REAL(wp) :: ztra, zbtr, zdir, zdx, zdt, zmsk   ! local scalars
       !----------------------------------------------------------------------
-
+      !
+      IF( wrk_in_use(3, 1,2,3) ) THEN
+         CALL ctl_stop('tra_adv_qck_i: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -188,5 +191,5 @@
                DO ji = fs_2, fs_jpim1   ! vector opt.               
                   zfu(ji,jj,jk) = tmask(ji-1,jj,jk) + tmask(ji,jj,jk) + tmask(ji+1,jj,jk) - 2.
-               ENDDO
+               END DO
             END DO
          END DO
@@ -225,4 +228,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 1,2,3) )   CALL ctl_stop('tra_adv_qck_i: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_adv_qck_i
 
@@ -233,20 +238,24 @@
       !!
       !!----------------------------------------------------------------------
-      USE oce         , zwy => ua   ! use ua as workspace
-      !!
-      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
-      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
-      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pvn             ! j-velocity components
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
-      INTEGER  :: ji, jj, jk, jn           ! dummy loop indices
-      REAL(wp) :: ztra, zbtr               ! local scalars
-      REAL(wp) :: zdir, zdx, zdt, zmsk     ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu, zfc, zfd   ! 3D wokspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwy => ua       ! ua used as workspace
+      USE wrk_nemo, ONLY:   zfu => wrk_3d_1 , zfc => wrk_3d_2, zfd => wrk_3d_3   ! 3D workspace
+      !
+      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
+      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
+      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers
+      REAL(wp), DIMENSION(        jpk     ), INTENT(in   ) ::   p2dt       ! vertical profile of tracer time-step
+      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pvn        ! j-velocity components
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn   ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend 
+      !!
+      INTEGER  :: ji, jj, jk, jn   ! dummy loop indices
+      REAL(wp) :: ztra, zbtr, zdir, zdx, zdt, zmsk   ! local scalars
       !----------------------------------------------------------------------
-
+      !
+      IF(wrk_in_use(3, 1,2,3))THEN
+         CALL ctl_stop('tra_adv_qck_j: ERROR: requested workspace arrays unavailable')
+         RETURN
+      END IF
       !                                                          ! ===========
       DO jn = 1, kjpt                                            ! tracer loop
@@ -350,4 +359,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 1,2,3) )   CALL ctl_stop('tra_adv_qck_j: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_adv_qck_j
 
@@ -358,15 +369,15 @@
       !!
       !!----------------------------------------------------------------------
-      USE oce         , zwz => ua   ! use ua as workspace
-      !!
-      INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
-      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
-      INTEGER                              , INTENT(in   ) ::   kjpt            ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pwn             ! vertical velocity 
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptn             ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
+      USE oce, ONLY:   zwz => ua   ! ua used as workspace
+      !
+      INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index
+      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
+      INTEGER                              , INTENT(in   ) ::   kjpt     ! number of tracers
+      REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ) ::   pwn      ! vertical velocity 
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptn      ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! tracer trend 
+      !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
-      REAL(wp) ::   zbtr , ztra      ! temporary scalars
+      REAL(wp) ::   zbtr , ztra      ! local scalars
       !!----------------------------------------------------------------------
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2715)
@@ -25,8 +25,8 @@
    USE dom_oce         ! ocean space and time domain
    USE trdmod_oce      ! tracers trends
-   USE trdtra      ! tracers trends
+   USE trdtra          ! tracers trends
    USE in_out_manager  ! I/O manager
    USE dynspg_oce      ! choice/control of key cpp for surface pressure gradient
-   USE lib_mpp
+   USE lib_mpp         ! MPP library
    USE lbclnk          ! ocean lateral boundary condition (or mpp link) 
    USE diaptr          ! poleward transport diagnostics
@@ -39,5 +39,5 @@
    PUBLIC   tra_adv_tvd    ! routine called by step.F90
 
-   LOGICAL  :: l_trd       ! flag to compute trends
+   LOGICAL ::   l_trd   ! flag to compute trends
 
    !! * Substitutions
@@ -66,7 +66,8 @@
       !!             - save the trends 
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      USE oce         , zwy => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx => ua        , zwy => va          ! (ua,va) used as workspace
+      USE wrk_nemo, ONLY:   zwi => wrk_3d_12 , zwz => wrk_3d_13   ! 3D workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
@@ -76,12 +77,15 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices  
       REAL(wp) ::   z2dtt, zbtr, ztra        ! local scalar
       REAL(wp) ::   zfp_ui, zfp_vj, zfp_wk   !   -      -
       REAL(wp) ::   zfm_ui, zfm_vj, zfm_wk   !   -      -
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zwi, zwz   ! 3D workspace
       REAL(wp), DIMENSION (:,:,:), ALLOCATABLE ::   ztrdx, ztrdy, ztrdz
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 12,13) ) THEN
+         CALL ctl_stop('tra_adv_tvd: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -235,9 +239,11 @@
          ENDIF
          !
-      ENDDO
+      END DO
       !
       IF( l_trd )  THEN
         DEALLOCATE( ztrdx )     ;     DEALLOCATE( ztrdy )     ;      DEALLOCATE( ztrdz )  
       END IF
+      !
+      IF( wrk_not_released(3, 12,13) )   CALL ctl_stop('tra_adv_tvd: failed to release workspace arrays')
       !
    END SUBROUTINE tra_adv_tvd
@@ -257,20 +263,25 @@
       !!       in-space based differencing for fluid
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zbetup => wrk_3d_8  , zbetdo => wrk_3d_9    ! 3D workspace
+      USE wrk_nemo, ONLY:   zbup   => wrk_3d_10 , zbdo   => wrk_3d_11   !  -     -
+      !
       REAL(wp), DIMENSION(jpk)         , INTENT(in   ) ::   p2dt            ! vertical profile of tracer time-step
       REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(in   ) ::   pbef, paft      ! before & after field
       REAL(wp), DIMENSION (jpi,jpj,jpk), INTENT(inout) ::   paa, pbb, pcc   ! monotonic fluxes in the 3 directions
-      !!
-      INTEGER ::   ji, jj, jk               ! dummy loop indices
-      INTEGER ::   ikm1
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zbetup, zbetdo
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zbup, zbdo
-      REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt
-      REAL(wp) ::   zau, zbu, zcu, zav, zbv, zcv
-      REAL(wp) ::   zup, zdo
-      !!----------------------------------------------------------------------
-
-      zbig = 1.e+40
-      zrtrn = 1.e-15
-      zbetup(:,:,jpk) = 0.e0   ;   zbetdo(:,:,jpk) = 0.e0
+      !
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      INTEGER ::   ikm1         ! local integer
+      REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt   ! local scalars
+      REAL(wp) ::   zau, zbu, zcu, zav, zbv, zcv, zup, zdo            !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 8,9,10,11) ) THEN
+         CALL ctl_stop('nonosc: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
+      zbig  = 1.e+40_wp
+      zrtrn = 1.e-15_wp
+      zbetup(:,:,jpk) = 0._wp   ;   zbetdo(:,:,jpk) = 0._wp
 
 
@@ -348,4 +359,6 @@
       CALL lbc_lnk( paa, 'U', -1. )   ;   CALL lbc_lnk( pbb, 'V', -1. )   ! lateral boundary condition (changed sign)
       !
+      IF( wrk_not_released(3, 8,9,10,11) )   CALL ctl_stop('nonosc: failed to release workspace arrays')
+      !
    END SUBROUTINE nonosc
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2715)
@@ -73,7 +73,10 @@
       !!             Farrow, D.E., Stevens, D.P., 1995, J. Phys. Ocean. 25, 1731Ð1741. 
       !!----------------------------------------------------------------------
-      USE oce         , zwx => ua   ! use ua as workspace
-      USE oce         , zwy => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwx  => ua       , zwy  => va         ! (ua,va) used as workspace
+      USE wrk_nemo, ONLY:   ztu  => wrk_3d_1 , ztv  => wrk_3d_2   ! 3D workspace
+      USE wrk_nemo, ONLY:   zltu => wrk_3d_3 , zltv => wrk_3d_4   !  -      -
+      USE wrk_nemo, ONLY:   zti  => wrk_3d_5 , ztw  => wrk_3d_6   !  -      -
+      !
       INTEGER                              , INTENT(in   ) ::   kt              ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype          ! =TRA or TRC (tracer indicator)
@@ -83,15 +86,14 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb, ptn        ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta             ! tracer trend 
-      !!
-      INTEGER  ::   ji, jj, jk, jn          ! dummy loop indices
-      REAL(wp) ::   ztra, zbtr, zcoef       ! local scalars
-      REAL(wp) ::   zfp_ui, zfm_ui, zcenut  !   -      -
-      REAL(wp) ::   zfp_vj, zfm_vj, zcenvt  !   -      -
-      REAL(wp) ::   z2dtt                   !   -      -
-      REAL(wp) ::   ztak, zfp_wk, zfm_wk    !   -      -
-      REAL(wp) ::   zeeu, zeev, z_hdivn     !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztu, ztv, zltu , zltv   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zti, ztw                !  -      -
-      !!----------------------------------------------------------------------
+      !
+      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
+      REAL(wp) ::   ztra, zbtr, zcoef, z2dtt                       ! local scalars
+      REAL(wp) ::   zfp_ui, zfm_ui, zcenut, ztak, zfp_wk, zfm_wk   !   -      -
+      REAL(wp) ::   zfp_vj, zfm_vj, zcenvt, zeeu, zeev, z_hdivn    !   -      -
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3,4,5,6) )THEN
+         CALL ctl_stop('tra_adv_ubs: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -266,4 +268,6 @@
       ENDDO
       !
+      IF( wrk_not_released(3, 1,2,3,4,5,6) )   CALL ctl_stop('tra_adv_ubs: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_adv_ubs
 
@@ -282,18 +286,24 @@
       !!       in-space based differencing for fluid
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zbetup => wrk_3d_1, zbetdo => wrk_3d_2   ! 3D workspace
+      !
       REAL(wp), INTENT(in   ), DIMENSION(jpk)          ::   p2dt   ! vertical profile of tracer time-step
       REAL(wp),                DIMENSION (jpi,jpj,jpk) ::   pbef   ! before field
       REAL(wp), INTENT(inout), DIMENSION (jpi,jpj,jpk) ::   paft   ! after field
       REAL(wp), INTENT(inout), DIMENSION (jpi,jpj,jpk) ::   pcc    ! monotonic flux in the k direction
-      !!
-      INTEGER  ::   ji, jj, jk               ! dummy loop indices
-      INTEGER  ::   ikm1
-      REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt
-      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   zbetup, zbetdo
-      !!----------------------------------------------------------------------
-
-      zbig = 1.e+40
-      zrtrn = 1.e-15
-      zbetup(:,:,:) = 0.e0   ;   zbetdo(:,:,:) = 0.e0
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      INTEGER  ::   ikm1         ! local integer
+      REAL(wp) ::   zpos, zneg, zbt, za, zb, zc, zbig, zrtrn, z2dtt   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2) ) THEN
+         CALL ctl_stop('nonosc_z: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      zbig  = 1.e+40_wp
+      zrtrn = 1.e-15_wp
+      zbetup(:,:,:) = 0._wp   ;   zbetdo(:,:,:) = 0._wp
 
       ! Search local extrema
@@ -363,4 +373,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 1,2) )   CALL ctl_stop('nonosc_z: failed to release workspace arrays')
+      !
    END SUBROUTINE nonosc_z
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 2715)
@@ -67,9 +67,9 @@
       !!              Emile-Geay and Madec, 2009, Ocean Science.
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       !!
       INTEGER  ::   ji, jj, ik    ! dummy loop indices
       REAL(wp) ::   zqgh_trd      ! geothermal heat flux trend
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt
       !!----------------------------------------------------------------------
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 2715)
@@ -17,4 +17,5 @@
    !!   'key_trabbl'   or                             bottom boundary layer
    !!----------------------------------------------------------------------
+   !!   tra_bbl_alloc : allocate trabbl arrays
    !!   tra_bbl       : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
    !!   tra_bbl_dif   : generic routine to compute bbl diffusive trend
@@ -53,13 +54,14 @@
    REAL(wp), PUBLIC ::   rn_gambbl  = 10.0_wp   !: lateral coeff. for bottom boundary layer scheme [s]
 
-   REAL(wp), DIMENSION(jpi,jpj), PUBLIC ::   utr_bbl  , vtr_bbl   ! u- (v-) transport in the bottom boundary layer
-   REAL(wp), DIMENSION(jpi,jpj), PUBLIC ::   ahu_bbl  , ahv_bbl   ! masked diffusive bbl coefficients at u and v-points
-
-   INTEGER , DIMENSION(jpi,jpj) ::   mbku_d   , mbkv_d      ! vertical index of the "lower" bottom ocean U/V-level
-   INTEGER , DIMENSION(jpi,jpj) ::   mgrhu    , mgrhv       ! = +/-1, sign of grad(H) in u-(v-)direction
-   REAL(wp), DIMENSION(jpi,jpj) ::   ahu_bbl_0, ahv_bbl_0   ! diffusive bbl flux coefficients at u and v-points
-   REAL(wp), DIMENSION(jpi,jpj) ::   e3u_bbl_0, e3v_bbl_0   ! thichness of the bbl (e3) at u and v-points
-   REAL(wp), DIMENSION(jpi,jpj) ::   e1e2t_r   ! thichness of the bbl (e3) at u and v-points
-   LOGICAL, PUBLIC              ::   l_bbl                    !: flag to compute bbl diffu. flux coef and transport
+   LOGICAL , PUBLIC ::   l_bbl                  !: flag to compute bbl diffu. flux coef and transport
+   
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC ::   utr_bbl  , vtr_bbl   ! u- (v-) transport in the bottom boundary layer
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), PUBLIC ::   ahu_bbl  , ahv_bbl   ! masked diffusive bbl coeff. at u & v-pts
+
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mbku_d   , mbkv_d      ! vertical index of the "lower" bottom ocean U/V-level
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mgrhu    , mgrhv       ! = +/-1, sign of grad(H) in u-(v-)direction
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ahu_bbl_0, ahv_bbl_0   ! diffusive bbl flux coefficients at u and v-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   e3u_bbl_0, e3v_bbl_0   ! thichness of the bbl (e3) at u and v-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   r1_e1e2t               ! inverse of the cell surface at t-point      [1/m2]
 
    !! * Substitutions
@@ -72,4 +74,18 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION tra_bbl_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION tra_bbl_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( utr_bbl  (jpi,jpj) , ahu_bbl  (jpi,jpj) , mbku_d  (jpi,jpj) , mgrhu(jpi,jpj) ,     &
+         &      vtr_bbl  (jpi,jpj) , ahv_bbl  (jpi,jpj) , mbkv_d  (jpi,jpj) , mgrhv(jpi,jpj) ,     &
+         &      ahu_bbl_0(jpi,jpj) , ahv_bbl_0(jpi,jpj) ,                                          &
+         &      e3u_bbl_0(jpi,jpj) , e3v_bbl_0(jpi,jpj) , r1_e1e2t(jpi,jpj)                  , STAT= tra_bbl_alloc )
+         !
+      IF( lk_mpp            )   CALL mpp_sum ( tra_bbl_alloc )
+      IF( tra_bbl_alloc > 0 )   CALL ctl_warn('tra_bbl_alloc: allocation of arrays failed.')
+   END FUNCTION tra_bbl_alloc
+
 
    SUBROUTINE tra_bbl( kt )
@@ -153,13 +169,19 @@
       !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430.
       !!----------------------------------------------------------------------  
-      INTEGER                              , INTENT(in   ) ::   kjpt    ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb   ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta   ! tracer trend 
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zptb => wrk_2d_1
+      !
+      INTEGER                              , INTENT(in   ) ::   kjpt   ! number of tracers
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb    ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta    ! tracer trend 
+      !
       INTEGER  ::   ji, jj, jn   ! dummy loop indices
       INTEGER  ::   ik           ! local integers
       REAL(wp) ::   zbtr         ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zptb   ! tracer trend 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(2,1) ) THEN
+         CALL ctl_stop('tra_bbl_dif: ERROR: requested workspace array unavailable')   ;   RETURN
+      ENDIF
       !
       DO jn = 1, kjpt                                     ! tracer loop
@@ -185,5 +207,5 @@
 #  endif
                ik = mbkt(ji,jj)                            ! bottom T-level index
-               zbtr = e1e2t_r(ji,jj)  / fse3t(ji,jj,ik)
+               zbtr = r1_e1e2t(ji,jj)  / fse3t(ji,jj,ik)
                pta(ji,jj,ik,jn) = pta(ji,jj,ik,jn)                                                         &
                   &               + (   ahu_bbl(ji  ,jj  ) * ( zptb(ji+1,jj  ) - zptb(ji  ,jj  ) )   &
@@ -196,4 +218,6 @@
       END DO                                                ! end tracer
       !                                                     ! ===========
+      IF( wrk_not_released(2,1) )   CALL ctl_stop('tra_bbl_dif: failed to release workspace array')
+      !
    END SUBROUTINE tra_bbl_dif
    
@@ -214,8 +238,8 @@
       !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430.
       !!----------------------------------------------------------------------  
-      INTEGER                              , INTENT(in   ) ::   kjpt    ! number of tracers
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb   ! before and now tracer fields
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta   ! tracer trend 
-      !!
+      INTEGER                              , INTENT(in   ) ::   kjpt   ! number of tracers
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb    ! before and now tracer fields
+      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta    ! tracer trend 
+      !
       INTEGER  ::   ji, jj, jk, jn           ! dummy loop indices
       INTEGER  ::   iis , iid , ijs , ijd    ! local integers
@@ -242,15 +266,15 @@
                   !
                   !                                               ! up  -slope T-point (shelf bottom point)
-                  zbtr = e1e2t_r(iis,jj) / fse3t(iis,jj,ikus)
+                  zbtr = r1_e1e2t(iis,jj) / fse3t(iis,jj,ikus)
                   ztra = zu_bbl * ( ptb(iid,jj,ikus,jn) - ptb(iis,jj,ikus,jn) ) * zbtr
                   pta(iis,jj,ikus,jn) = pta(iis,jj,ikus,jn) + ztra
                   !                   
                   DO jk = ikus, ikud-1                            ! down-slope upper to down T-point (deep column)
-                     zbtr = e1e2t_r(iid,jj) / fse3t(iid,jj,jk)
+                     zbtr = r1_e1e2t(iid,jj) / fse3t(iid,jj,jk)
                      ztra = zu_bbl * ( ptb(iid,jj,jk+1,jn) - ptb(iid,jj,jk,jn) ) * zbtr
                      pta(iid,jj,jk,jn) = pta(iid,jj,jk,jn) + ztra
                   END DO
                   ! 
-                  zbtr = e1e2t_r(iid,jj) / fse3t(iid,jj,ikud)
+                  zbtr = r1_e1e2t(iid,jj) / fse3t(iid,jj,ikud)
                   ztra = zu_bbl * ( ptb(iis,jj,ikus,jn) - ptb(iid,jj,ikud,jn) ) * zbtr
                   pta(iid,jj,ikud,jn) = pta(iid,jj,ikud,jn) + ztra
@@ -264,15 +288,15 @@
                   ! 
                   ! up  -slope T-point (shelf bottom point)
-                  zbtr = e1e2t_r(ji,ijs) / fse3t(ji,ijs,ikvs)
+                  zbtr = r1_e1e2t(ji,ijs) / fse3t(ji,ijs,ikvs)
                   ztra = zv_bbl * ( ptb(ji,ijd,ikvs,jn) - ptb(ji,ijs,ikvs,jn) ) * zbtr
                   pta(ji,ijs,ikvs,jn) = pta(ji,ijs,ikvs,jn) + ztra
                   !                   
                   DO jk = ikvs, ikvd-1                            ! down-slope upper to down T-point (deep column)
-                     zbtr = e1e2t_r(ji,ijd) / fse3t(ji,ijd,jk)
+                     zbtr = r1_e1e2t(ji,ijd) / fse3t(ji,ijd,jk)
                      ztra = zv_bbl * ( ptb(ji,ijd,jk+1,jn) - ptb(ji,ijd,jk,jn) ) * zbtr
                      pta(ji,ijd,jk,jn) = pta(ji,ijd,jk,jn)  + ztra
                   END DO
                   !                                               ! down-slope T-point (deep bottom point)
-                  zbtr = e1e2t_r(ji,ijd) / fse3t(ji,ijd,ikvd)
+                  zbtr = r1_e1e2t(ji,ijd) / fse3t(ji,ijd,ikvd)
                   ztra = zv_bbl * ( ptb(ji,ijs,ikvs,jn) - ptb(ji,ijd,ikvd,jn) ) * zbtr
                   pta(ji,ijd,ikvd,jn) = pta(ji,ijd,ikvd,jn) + ztra
@@ -314,4 +338,8 @@
       !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430.
       !!----------------------------------------------------------------------  
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zub => wrk_2d_1 , ztb => wrk_2d_2                      ! 2D workspace
+      USE wrk_nemo, ONLY:   zvb => wrk_2d_3 , zsb => wrk_2d_4 , zdep => wrk_2d_5
+      !
       INTEGER         , INTENT(in   ) ::   kt       ! ocean time-step index
       CHARACTER(len=3), INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
@@ -323,5 +351,4 @@
       REAL(wp) ::   zsign, zsigna, zgbbl      ! local scalars
       REAL(wp) ::   zgdrho, zt, zs, zh        !   -      -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zub, zvb, ztb, zsb, zdep  !  2D workspace
       !!
       REAL(wp) ::   fsalbt, fsbeta, pft, pfs, pfh   ! statement function
@@ -357,5 +384,9 @@
                                           - 0.121555e-07 ) * pfh
       !!----------------------------------------------------------------------
-      
+
+      IF( wrk_in_use(2, 1,2,3,4,5) ) THEN
+         CALL ctl_stop('bbl: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+     
       IF( kt == nit000 )  THEN
          IF(lwp)  WRITE(numout,*)
@@ -494,4 +525,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4,5) )   CALL ctl_stop('bbl: failed to release workspace arrays')
+      !
    END SUBROUTINE bbl
 
@@ -504,12 +537,17 @@
       !!
       !! ** Method  :   Read the nambbl namelist and check the parameters
-      !!              called by tra_bbl at the first timestep (nit000)
-      !!----------------------------------------------------------------------
+      !!              called by nemo_init at the first timestep (nit000)
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zmbk => wrk_2d_1       ! 2D workspace
       INTEGER ::   ji, jj               ! dummy loop indices
       INTEGER ::   ii0, ii1, ij0, ij1   ! temporary integer
-      REAL(wp), DIMENSION(jpi,jpj) ::   zmbk   ! 2D workspace 
       !!
       NAMELIST/nambbl/ nn_bbl_ldf, nn_bbl_adv, rn_ahtbbl, rn_gambbl
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2,1) ) THEN
+         CALL ctl_stop('tra_bbl_init: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       REWIND ( numnam )              !* Read Namelist nambbl : bottom boundary layer scheme
@@ -528,5 +566,8 @@
          WRITE(numout,*) '          advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
       ENDIF
-      
+
+      !                              ! allocate trabbl arrays
+      IF( tra_bbl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_bbl_init : unable to allocate arrays' )
+     
       IF( nn_bbl_adv == 1 )    WRITE(numout,*) '       * Advective BBL using upper velocity'
       IF( nn_bbl_adv == 2 )    WRITE(numout,*) '       * Advective BBL using velocity = F( delta rho)'
@@ -536,5 +577,5 @@
 
       !                             !* inverse of surface of T-cells
-      e1e2t_r(:,:) = 1.0 / ( e1t(:,:) * e2t(:,:) )
+      r1_e1e2t(:,:) = 1._wp / ( e1t(:,:) * e2t(:,:) )
       
       !                             !* vertical index of  "deep" bottom u- and v-points
@@ -594,4 +635,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2,1) )   CALL ctl_stop('tra_bbl_init: failed to release workspace array')
+      !
    END SUBROUTINE tra_bbl_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 2715)
@@ -19,4 +19,5 @@
    !!   'key_tradmp'                                       internal damping
    !!----------------------------------------------------------------------
+   !!   tra_dmp_alloc : allocate tradmp arrays
    !!   tra_dmp       : update the tracer trend with the internal damping
    !!   tra_dmp_init  : initialization, namlist read, parameters control
@@ -51,7 +52,7 @@
    LOGICAL, PUBLIC            ::   lk_tradmp = .TRUE.     !: internal damping flag
 #endif
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   strdmp   !: damping salinity trend (psu/s)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   ttrdmp   !: damping temperature trend (Celcius/s)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   resto    !: restoring coeff. on T and S (s-1)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   strdmp   !: damping salinity trend (psu/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ttrdmp   !: damping temperature trend (Celcius/s)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   resto    !: restoring coeff. on T and S (s-1)
    
    !                                !!* Namelist namtra_dmp : T & S newtonian damping *
@@ -72,4 +73,15 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION tra_dmp_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION tra_bbl_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( strdmp(jpi,jpj,jpk) , ttrdmp(jpi,jpj,jpk) , resto(jpi,jpj,jpk), STAT= tra_dmp_alloc )
+      !
+      IF( lk_mpp            )   CALL mpp_sum ( tra_dmp_alloc )
+      IF( tra_dmp_alloc > 0 )   CALL ctl_warn('tra_dmp_alloc: allocation of arrays failed')
+   END FUNCTION tra_dmp_alloc
+
 
    SUBROUTINE tra_dmp( kt )
@@ -193,4 +205,7 @@
       ENDIF
 
+      !                              ! allocate tradmp arrays
+      IF( tra_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_dmp_init: unable to allocate arrays' )
+
       SELECT CASE ( nn_hdmp )
       CASE (  -1  )   ;   IF(lwp) WRITE(numout,*) '   tracer damping in the Med & Red seas only'
@@ -312,4 +327,6 @@
       USE iom
       USE ioipsl
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zhfac => wrk_1d_1, zmrs => wrk_2d_1 , zdct  => wrk_3d_1   ! 1D, 2D, 3D workspace
       !!
       INTEGER                         , INTENT(in   )  ::  kn_hdmp    ! damping option
@@ -327,10 +344,12 @@
       REAL(wp) ::   zlat, zlat0, zlat1, zlat2   !   -      -
       REAL(wp) ::   zsdmp, zbdmp                !   -      -
-      REAL(wp), DIMENSION(jpk)         ::   zhfac
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zmrs
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdct
       CHARACTER(len=20)                ::   cfile
       !!----------------------------------------------------------------------
 
+      IF( wrk_in_use(1, 1) .OR.   &
+          wrk_in_use(2, 1) .OR.   &
+          wrk_in_use(3, 1)   ) THEN
+          CALL ctl_stop('dtacof: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
       !                                   ! ====================
       !                                   !  ORCA configuration : global domain
@@ -525,4 +544,8 @@
       ENDIF
       !
+      IF( wrk_not_released(1, 1) .OR.   &
+          wrk_not_released(2, 1) .OR.   &
+          wrk_not_released(3, 1) )   CALL ctl_stop('dtacof: failed to release workspace arrays')
+      !
    END SUBROUTINE dtacof
 
@@ -549,17 +572,26 @@
       !!----------------------------------------------------------------------
       USE ioipsl      ! IOipsl librairy
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zxt => wrk_2d_1 , zyt => wrk_2d_2 , zzt => wrk_2d_3, zmask => wrk_2d_4
       !!
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( out ) ::   pdct   ! distance to the coastline
       !!
-      INTEGER ::   ji, jj, jk, jl      ! dummy loop indices
-      INTEGER ::   iju, ijt            ! temporary integers
-      INTEGER ::   icoast, itime
-      INTEGER ::   icot         ! logical unit for file distance to the coast
-      LOGICAL, DIMENSION(jpi,jpj) ::   llcotu, llcotv, llcotf   ! ???
-      CHARACTER (len=32) ::   clname
-      REAL(wp) ::   zdate0
-      REAL(wp), DIMENSION(jpi,jpj)   ::   zxt, zyt, zzt, zmask   ! cartesian coordinates for T-points
-      REAL(wp), DIMENSION(3*jpi*jpj) ::   zxc, zyc, zzc, zdis    ! temporary workspace
-      !!----------------------------------------------------------------------
+      INTEGER ::   ji, jj, jk, jl   ! dummy loop indices
+      INTEGER ::   iju, ijt, icoast, itime, ierr, icot   ! local integers
+      CHARACTER (len=32) ::   clname                     ! local name
+      REAL(wp) ::   zdate0                               ! local scalar
+      LOGICAL , ALLOCATABLE, DIMENSION(:,:) ::   llcotu, llcotv, llcotf   ! 2D logical workspace
+      REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   zxc, zyc, zzc, zdis    ! temporary workspace
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4) .OR.  &
+          wrk_in_use(1, 1,2,3,4)  ) THEN
+          CALL ctl_stop('cofdis: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      ALLOCATE( llcotu(jpi,jpj) , llcotv(jpi,jpj) , llcotf(jpi,jpj) ,                        &
+         &      zxc (3*jpi*jpj) , zyc (3*jpi*jpj) , zzc (3*jpi*jpj) , zdis (3*jpi*jpj) , STAT=ierr )
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'cofdis: requested local arrays unavailable')
 
       ! 0. Initialization
@@ -713,4 +745,9 @@
       CALL restclo( icot )
       !
+      IF( wrk_not_released(2, 1,2,3,4) .OR. & 
+          wrk_not_released(1, 1,2,3,4)  )   CALL ctl_stop('cofdis: failed to release workspace arrays')
+      DEALLOCATE( llcotu , llcotv , llcotf ,      &
+         &        zxc    , zyc    , zzc    , zdis )
+      !
    END SUBROUTINE cofdis
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 2715)
@@ -37,7 +37,7 @@
    !
    INTEGER ::   nldf = 0   ! type of lateral diffusion used defined from ln_traldf_... namlist logicals)
-#if defined key_traldf_ano
-   REAL, DIMENSION(jpi,jpj,jpk) ::   t0_ldf, s0_ldf   ! lateral diffusion trends of T & S for a constant profile
-#endif
+
+   REAL, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   t0_ldf, s0_ldf   !: lateral diffusion trends of T & S for a cst profile
+   !                                                               !  (key_traldf_ano only)
 
    !! * Substitutions
@@ -130,5 +130,4 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio, ierr         ! temporary integers 
-!      
       !!----------------------------------------------------------------------
 
@@ -238,14 +237,21 @@
       !! ** Purpose :   initializations of 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zt_ref => wrk_3d_1, ztb => wrk_3d_2, zavt => wrk_3d_3   ! 3D workspaces
+      USE wrk_nemo, ONLY:   zs_ref => wrk_3d_4, zsb => wrk_3d_5                     ! 3D workspaces
+      !
       USE zdf_oce         ! vertical mixing
       USE trazdf          ! vertical mixing: double diffusion
       USE zdfddm          ! vertical mixing: double diffusion
-      !!
+      !
       INTEGER  ::   jk              ! Dummy loop indice
-      LOGICAL  ::   llsave          !
-      REAL(wp) ::   zt0, zs0, z12   ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zt_ref, ztb, zavt   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zs_ref, zsb         ! 3D workspace
-      !!----------------------------------------------------------------------
+      INTEGER  ::   ierr            ! local integer
+      LOGICAL  ::   llsave          ! local logical
+      REAL(wp) ::   zt0, zs0, z12   ! local scalar
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3,4,5) ) THEN
+         CALL ctl_stop('ldf_ano : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF(lwp) THEN
@@ -254,4 +260,9 @@
          WRITE(numout,*) '~~~~~~~~~~~'
       ENDIF
+
+      !                              ! allocate trabbl arrays
+      ALLOCATE( t0_ldf(jpi,jpj,jpk) , s0_ldf(jpi,jpj,jpk) , STAT=ierr )
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'ldf_ano: unable to allocate arrays' )
 
       ! defined the T & S reference profiles
@@ -309,4 +320,6 @@
       avt(:,:,:)        = zavt(:,:,:)
       !
+      IF( wrk_not_released(3, 1,2,3,4,5) )   CALL ctl_stop('ldf_ano: failed to release workspace arrays')
+      !
    END SUBROUTINE ldf_ano
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2715)
@@ -28,4 +28,5 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -73,6 +74,7 @@
       !!               biharmonic mixing trend.
       !!----------------------------------------------------------------------
-      USE oce         , ztu => ua   ! use ua as workspace
-      USE oce         , ztv => va   ! use va as workspace
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   ztu  => ua       , ztv  => va                           ! (ua,va) used as workspace
+      USE wrk_nemo, ONLY:   zeeu => wrk_2d_1 , zeev => wrk_2d_2 , zlt => wrk_2d_3   ! 2D workspace
       !!
       INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
@@ -85,6 +87,9 @@
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::  zbtr, ztra       ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zeeu, zeev, zlt   ! 2D workspace
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) ) THEN
+         CALL ctl_stop('tra_ldf_bilap: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -160,4 +165,6 @@
       END DO                                              ! tracer loop
       !                                                   ! ===========
+      IF( wrk_not_released(2, 1,2,3) )   CALL ctl_stop('tra_ldf_bilap: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_ldf_bilap
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2715)
@@ -24,4 +24,5 @@
    USE diaptr          ! poleward transport diagnostics 
    USE trc_oce         ! share passive tracers/Ocean variables
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -65,4 +66,7 @@
       !!               biharmonic mixing trend.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wk1 => wrk_4d_1 , wk2 => wrk_4d_2     ! 4D workspace
+      !
       INTEGER         , INTENT(in   )                      ::   kt       ! ocean time-step index
       CHARACTER(len=3), INTENT(in   )                      ::   cdtype   ! =TRA or TRC (tracer indicator)
@@ -70,8 +74,11 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb      ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! tracer trend 
-      !!
-      INTEGER ::   ji, jj, jk, jn                 ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt) ::   wk1, wk2   ! 4D workspace
-      !!----------------------------------------------------------------------
+      !
+      INTEGER ::   ji, jj, jk, jn   ! dummy loop indices
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(4, 1,2) ) THEN
+         CALL ctl_stop('tra_ldf_bilapg: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -107,4 +114,6 @@
          END DO
       END DO
+      !
+      IF( wrk_not_released(4, 1,2) )   CALL ctl_stop('tra_ldf_bilapg : failed to release workspace arrays.')
       !
    END SUBROUTINE tra_ldf_bilapg
@@ -149,6 +158,10 @@
       !!
       !!----------------------------------------------------------------------
-      USE oce         , zftv => ua     ! use ua as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released, wrk_in_use_xz, wrk_not_released_xz
+      USE oce     , ONLY:   zftv => ua       ! ua used as workspace
+      USE wrk_nemo, ONLY:   zftu => wrk_2d_1 , zdkt  => wrk_2d_2 , zdk1t => wrk_2d_3
+      USE wrk_nemo, ONLY:   zftw => wrk_xz_1 , zdit  => wrk_xz_2 
+      USE wrk_nemo, ONLY:   zdjt => wrk_xz_3 , zdj1t => wrk_xz_4
+      !
       INTEGER         , INTENT(in )                              ::  kt      ! ocean time-step index
       CHARACTER(len=3), INTENT(in )                              ::  cdtype  ! =TRA or TRC (tracer indicator) 
@@ -166,8 +179,9 @@
       REAL(wp) ::  zbtr, ztah, ztav
       REAL(wp) ::  zcof0, zcof1, zcof2, zcof3, zcof4
-      REAL(wp), DIMENSION(jpi,jpj) ::  zftu,  zdkt, zdk1t       ! workspace
-      REAL(wp), DIMENSION(jpi,jpk) ::  zftw, zdit, zdjt, zdj1t  ! 
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) .OR. wrk_in_use_xz(1,2,3,4) )THEN
+         CALL ctl_stop('ldfght : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
       !
       DO jn = 1, kjpt
@@ -321,4 +335,7 @@
       END DO
       !
+      IF( wrk_not_released(2, 1,2,3)   .OR.   &
+          wrk_not_released_xz(1,2,3,4) )   CALL ctl_stop('ldfght : failed to release workspace arrays.')
+      !
    END SUBROUTINE ldfght
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2715)
@@ -90,7 +90,9 @@
       !! ** Action :   Update pta arrays with the before rotated diffusion
       !!----------------------------------------------------------------------
-      USE oce         , zftu => ua   ! use ua as workspace
-      USE oce         , zftv => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zftu => ua       , zftv  => va         ! (ua,va) used as workspace
+      USE wrk_nemo, ONLY:   zdkt => wrk_2d_1 , zdk1t => wrk_2d_2 , z2d  => wrk_2d_3   ! 2D workspace
+      USE wrk_nemo, ONLY:   zdit => wrk_3d_6 , zdjt  => wrk_3d_7 , ztfw => wrk_3d_8   ! 3D workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
@@ -100,16 +102,17 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend 
       REAL(wp)                             , INTENT(in   ) ::   pahtb0     ! background diffusion coef
-      !!
+      !
       INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
       REAL(wp) ::  zmsku, zabe1, zcof1, zcoef3   ! local scalars
       REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !   -      -
       REAL(wp) ::  zcoef0, zbtr, ztra            !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdkt, zdk1t         ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, ztfw    ! 3D workspace
 #if defined key_diaar5
-      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d                 ! 2D workspace
       REAL(wp)                         ::   zztmp               ! local scalar
 #endif
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 6,7,8) .OR. wrk_in_use(2, 1,2,3) ) THEN
+          CALL ctl_stop('tra_ldf_iso : requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -288,4 +291,7 @@
       END DO
       !
+      IF( wrk_not_released(3, 6,7,8) .OR.   &
+          wrk_not_released(2, 1,2,3) )   CALL ctl_stop('tra_ldf_iso: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_ldf_iso
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2715)
@@ -16,4 +16,5 @@
    USE oce             ! ocean dynamics and active tracers
    USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
    USE trc_oce         ! share passive tracers/Ocean variables
    USE zdf_oce         ! ocean vertical physics
@@ -23,17 +24,15 @@
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O library
-#if defined key_diaar5
-   USE phycst          ! physical constants
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-#endif
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC tra_ldf_iso_grif   ! routine called by traldf.F90
-
-   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   psix_eiv
-   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   psiy_eiv
-   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   ah_wslp2
+   PUBLIC   tra_ldf_iso_grif   ! routine called by traldf.F90
+
+   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   psix_eiv, psiy_eiv   !: eiv stream function (diag only)
+   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   ah_wslp2             !: aeiv*w-slope^2
+   REAL(wp),         DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   zdkt                 !  atypic workspace
 
    !! * Substitutions
@@ -90,7 +89,9 @@
       !! ** Action :   Update pta arrays with the before rotated diffusion
       !!----------------------------------------------------------------------
-      USE oce,   zftu => ua   ! use ua as workspace
-      USE oce,   zftv => va   ! use va as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zftu => ua       , zftv => va            ! (ua,va) used as 3D workspace
+      USE wrk_nemo, ONLY:   zdit => wrk_3d_6 , zdjt => wrk_3d_7 , ztfw => wrk_3d_8   ! 3D workspace
+      USE wrk_nemo, ONLY:   z2d  => wrk_2d_1                                         ! 2D workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
@@ -100,5 +101,5 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend 
       REAL(wp)                             , INTENT(in   ) ::   pahtb0     ! background diffusion coef
-      !!
+      !
       INTEGER  ::  ji, jj, jk,jn   ! dummy loop indices
       INTEGER  ::  ip,jp,kp        ! dummy loop indices
@@ -107,6 +108,5 @@
       REAL(wp) ::  zmskv, zabe2, zcof2, zcoef4   !   -      -
       REAL(wp) ::  zcoef0, zbtr                  !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,0:1) ::   zdkt               ! 2D+1 workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdit, zdjt, ztfw   ! 3D workspace
+      !REAL(wp), POINTER, DIMENSION(:,:,:) ::   zdkt           ! 2D+1 workspace
       !
       REAL(wp) ::   zslope_skew, zslope_iso, zslope2, zbu, zbv
@@ -114,8 +114,16 @@
       REAL(wp) ::   zah, zah_slp, zaei_slp
 #if defined key_diaar5
-      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d                ! 2D workspace
-      REAL(wp)                         ::   zztmp              ! local scalar
+      REAL(wp) ::   zztmp              ! local scalar
 #endif
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 6,7,8) .OR. wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('tra_ldf_iso_grif: requested workspace arrays unavailable.')   ;   RETURN
+      ENDIF
+      ! ARP - line below uses 'bounds re-mapping' which is only defined in
+      ! Fortran 2003 and up. We would be OK if code was written to use
+      ! zdkt(:,:,1:2) instead as then wouldn't need to re-map bounds.
+      ! As it is, we make zdkt a module array and allocate it in _alloc().
+      !zdkt(1:jpi,1:jpj,0:1) => wrk_3d_9(:,:,1:2)
 
       IF( kt == nit000 )  THEN
@@ -124,13 +132,11 @@
          IF(lwp) WRITE(numout,*) '                   WARNING: STILL UNDER TEST, NOT RECOMMENDED. USE AT YOUR OWN PERIL'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-         ALLOCATE( ah_wslp2(jpi,jpj,jpk) , STAT=ierr )
-         IF( ierr > 0 ) THEN
-            CALL ctl_stop( 'tra_ldf_iso_grif : unable to allocate Griffies operator ah_wslp2 ' )   ;   RETURN
-         ENDIF
+         ALLOCATE( ah_wslp2(jpi,jpj,jpk) , zdkt(jpi,jpj,0:1), STAT=ierr )
+         IF( lk_mpp   )   CALL mpp_sum ( ierr )
+         IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate arrays')
          IF( ln_traldf_gdia ) THEN
             ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr )
-            IF( ierr > 0 ) THEN
-               CALL ctl_stop( 'tra_ldf_iso_grif : unable to allocate Griffies operator diagnostics ' )   ;   RETURN
-            ENDIF
+            IF( lk_mpp   )   CALL mpp_sum ( ierr )
+            IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate diagnostics')
          ENDIF
       ENDIF
@@ -342,4 +348,7 @@
       END DO
       !
+      IF( wrk_not_released(3, 6,7,8) .OR.   &
+          wrk_not_released(2, 1)       )   CALL ctl_stop('tra_ldf_iso_grif: failed to release workspace arrays')
+      !
   END SUBROUTINE tra_ldf_iso_grif
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90	(revision 2715)
@@ -24,4 +24,5 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -30,5 +31,5 @@
    PUBLIC   tra_ldf_lap   ! routine called by step.F90
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   e1ur, e2vr   ! scale factor coefficients
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) ::   e1ur, e2vr   ! scale factor coefficients
 
    !! * Substitutions
@@ -62,7 +63,6 @@
       !!                harmonic mixing trend.
       !!----------------------------------------------------------------------
-      USE oce         , ztu => ua   ! use ua as workspace
-      USE oce         , ztv => va   ! use va as workspace
-      !!
+      USE oce, ONLY:   ztu => ua , ztv => va  ! (ua,va) used as workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator)
@@ -71,7 +71,7 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend 
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jn       ! dummy loop indices
-      INTEGER  ::   iku, ikv             ! local integers
+      INTEGER  ::   iku, ikv, ierr       ! local integers
       REAL(wp) ::   zabe1, zabe2, zbtr   ! local scalars
       !!----------------------------------------------------------------------
@@ -81,4 +81,9 @@
          IF(lwp) WRITE(numout,*) 'tra_ldf_lap : iso-level laplacian diffusion on ', cdtype
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+         !
+         ALLOCATE( e1ur(jpi,jpj), e2vr(jpi,jpj), STAT=ierr )
+         IF( lk_mpp    )   CALL mpp_sum( ierr )
+         IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'tra_ldf_lap : unable to allocate arrays' )
+         !
          e1ur(:,:) = e2u(:,:) / e1u(:,:)
          e2vr(:,:) = e1v(:,:) / e2v(:,:)
@@ -123,5 +128,5 @@
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
-                  zbtr = 1.0 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) )
+                  zbtr = 1._wp / ( e1t(ji,jj) *e2t(ji,jj) * fse3t(ji,jj,jk) )
                   ! horizontal diffusive trends added to the general tracer trends
                   pta(ji,jj,jk,jn) = pta(ji,jj,jk,jn) + zbtr * (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk)   &
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90	(revision 2715)
@@ -18,13 +18,14 @@
    USE zdf_oce         ! ocean vertical physics
    USE trdmod_oce      ! ocean active tracer trends
-   USE trdtra      ! ocean active tracer trends
+   USE trdtra          ! ocean active tracer trends
    USE eosbn2          ! equation of state (eos routine) 
    USE lbclnk          ! lateral boundary conditions (or mpp link)
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   tra_npc    ! routine called by step.F90
+   PUBLIC   tra_npc       ! routine called by step.F90
 
    !! * Substitutions
@@ -55,6 +56,10 @@
       !! References : Madec, et al., 1991, JPO, 21, 9, 1349-1371.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released, wrk_in_use_xz, wrk_not_released_xz
+      USE wrk_nemo, ONLY:   ztrdt => wrk_3d_1 , ztrds => wrk_3d_2 , zrhop => wrk_3d_3
+      USE wrk_nemo, ONLY:   zwx   => wrk_xz_1 , zwy   => wrk_xz_2 , zwz   => wrk_xz_3
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       INTEGER  ::   inpcc        ! number of statically instable water column
@@ -63,8 +68,11 @@
       INTEGER  ::   ikbot, ik, ikup, ikdown   ! ???
       REAL(wp) ::   ze3tot, zta, zsa, zraua, ze3dwn
-      REAL(wp), DIMENSION(jpi,jpk)     ::   zwx, zwy, zwz   ! 2D arrays
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zrhop           ! 3D arrays
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds
       !!----------------------------------------------------------------------
+
+      ! Strictly 1 and 2 3D workspaces only needed if(l_trdtra) but it doesn't 
+      ! cost us anything and makes code simpler.
+      IF( wrk_in_use(3, 1,2,3) .OR. wrk_in_use_xz(1,2,3) ) THEN
+         CALL ctl_stop('tra_npc: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( MOD( kt, nn_npc ) == 0 ) THEN
@@ -76,6 +84,6 @@
 
          IF( l_trdtra )   THEN                    !* Save ta and sa trends
-            ALLOCATE( ztrdt(jpi,jpj,jpk) )  ;    ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
-            ALLOCATE( ztrds(jpi,jpj,jpk) )  ;    ztrds(:,:,:) = tsa(:,:,:,jp_sal)
+            ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
+            ztrds(:,:,:) = tsa(:,:,:,jp_sal)
          ENDIF
 
@@ -192,11 +200,9 @@
             CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_npc, ztrdt )
             CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_npc, ztrds )
-            DEALLOCATE( ztrdt )      ;     DEALLOCATE( ztrds ) 
          ENDIF
       
          ! Lateral boundary conditions on ( ta, sa )   ( Unchanged sign)
          ! ------------------------------============
-         CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. )
-         CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. )
+         CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. )   ;   CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. )
       
 
@@ -210,4 +216,7 @@
       ENDIF
       !
+      IF( wrk_not_released(3, 1,2,3) .OR.   &
+          wrk_not_released_xz(1,2,3) )   CALL ctl_stop('tra_npc: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_npc
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2715)
@@ -56,6 +56,5 @@
    PUBLIC   tra_nxt_vvl   ! to be used in trcnxt
 
-   REAL(wp)                 ::   rbcp            ! Brown & Campana parameters for semi-implicit hpg
-   REAL(wp), DIMENSION(jpk) ::   r2dt   ! vertical profile time step, =2*rdttra (leapfrog) or =rdttra (Euler)
+   REAL(wp) ::   rbcp   ! Brown & Campana parameters for semi-implicit hpg
 
    !! * Substitutions
@@ -63,6 +62,6 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO-Consortium (2010) 
-   !! $Id $
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -104,5 +103,5 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~'
          !
-         rbcp    = 0.25 * (1. + atfp) * (1. + atfp) * ( 1. - atfp)       ! Brown & Campana parameter for semi-implicit hpg
+         rbcp = 0.25 * (1. + atfp) * (1. + atfp) * ( 1. - atfp)      ! Brown & Campana parameter for semi-implicit hpg
       ENDIF
 
@@ -131,6 +130,6 @@
  
       ! set time step size (Euler/Leapfrog)
-      IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt(:) =     rdttra(:)      ! at nit000             (Euler)
-      ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dt(:) = 2.* rdttra(:)      ! at nit000 or nit000+1 (Leapfrog)
+      IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dtra(:) =     rdttra(:)      ! at nit000             (Euler)
+      ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dtra(:) = 2.* rdttra(:)      ! at nit000 or nit000+1 (Leapfrog)
       ENDIF
 
@@ -153,5 +152,5 @@
          ENDIF
       ENDIF 
-
+      !
 #if defined key_agrif
       ! Update tracer at AGRIF zoom boundaries
@@ -160,9 +159,9 @@
       CALL tra_swap
 #endif      
-
+      !
       ! trends computation
       IF( l_trdtra ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt     
          DO jk = 1, jpkm1
-            zfact = 1.e0 / r2dt(jk)             
+            zfact = 1.e0 / r2dtra(jk)             
             ztrdt(:,:,jk) = ( tsb(:,:,jk,jp_tem) - ztrdt(:,:,jk) ) * zfact
             ztrds(:,:,jk) = ( tsb(:,:,jk,jp_sal) - ztrds(:,:,jk) ) * zfact
@@ -172,5 +171,5 @@
          DEALLOCATE( ztrdt )      ;     DEALLOCATE( ztrds ) 
       END IF
-
+      !
       !                        ! control print
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsn(:,:,:,jp_tem), clinfo1=' nxt  - Tn: ', mask1=tmask,   &
@@ -203,11 +202,11 @@
       !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T)
       !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in   )                               ::  kt       ! ocean time-step index
-      CHARACTER(len=3), INTENT(in   )                               ::  cdtype   ! =TRA or TRC (tracer indicator)
-      INTEGER         , INTENT(in   )                               ::  kjpt     ! number of tracers
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptb      ! before tracer fields
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptn      ! now tracer fields
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  pta      ! tracer trend
-      !!
+      INTEGER         , INTENT(in   )                               ::   kt       ! ocean time-step index
+      CHARACTER(len=3), INTENT(in   )                               ::   cdtype   ! =TRA or TRC (tracer indicator)
+      INTEGER         , INTENT(in   )                               ::   kjpt     ! number of tracers
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb      ! before tracer fields
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptn      ! now tracer fields
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta      ! tracer trend
+      !
       INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices
       LOGICAL  ::   ll_tra_hpg       ! local logical
@@ -270,18 +269,15 @@
       !!              - (ta,sa) time averaged (t,s)   (ln_dynhpg_imp = T)
       !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in   )                               ::  kt       ! ocean time-step index
-      CHARACTER(len=3), INTENT(in   )                               ::  cdtype   ! =TRA or TRC (tracer indicator)
-      INTEGER         , INTENT(in   )                               ::  kjpt     ! number of tracers
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptb      ! before tracer fields
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  ptn      ! now tracer fields
-      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::  pta      ! tracer trend
+      INTEGER         , INTENT(in   )                               ::   kt       ! ocean time-step index
+      CHARACTER(len=3), INTENT(in   )                               ::   cdtype   ! =TRA or TRC (tracer indicator)
+      INTEGER         , INTENT(in   )                               ::   kjpt     ! number of tracers
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptb      ! before tracer fields
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   ptn      ! now tracer fields
+      REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)  ::   pta      ! tracer trend
       !!     
       LOGICAL  ::   ll_tra, ll_tra_hpg, ll_traqsr   ! local logical
       INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
-      REAL(wp) ::   ztc_a , ztc_n , ztc_b       ! local scalar
-      REAL(wp) ::   ztc_f , ztc_d               !   -      -
-      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a      !   -      -
-      REAL(wp) ::   ze3t_f, ze3t_d              !   -      -
-      REAL(wp) ::   zfact1, zfact2              !   -      -
+      REAL(wp) ::   zfact1, ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
+      REAL(wp) ::   zfact2, ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      -
       !!----------------------------------------------------------------------
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 2715)
@@ -28,4 +28,5 @@
    USE fldread         ! read input fields
    USE restart         ! ocean restart
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -58,7 +59,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -90,17 +90,22 @@
       !!              Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516.
       !!----------------------------------------------------------------------
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zekb => wrk_2d_1 , zekg => wrk_2d_2 , zekr => wrk_2d_3
+      USE wrk_nemo, ONLY:   ze0  => wrk_3d_1 , ze1  => wrk_3d_2 , ze2  => wrk_3d_3
+      USE wrk_nemo, ONLY:   ze3  => wrk_3d_4 , zea  => wrk_3d_5
+      !
       INTEGER, INTENT(in) ::   kt     ! ocean time-step
-      !!
+      !
       INTEGER  ::   ji, jj, jk           ! dummy loop indices
-      INTEGER  ::   irgb                 ! temporary integers
-      REAL(wp) ::   zchl, zcoef          ! temporary scalars
+      INTEGER  ::   irgb                 ! local integers
+      REAL(wp) ::   zchl, zcoef, zfact   ! local scalars
       REAL(wp) ::   zc0, zc1, zc2, zc3   !    -         -
-      REAL(wp) ::   zz0, zz1             !    -         -
-      REAL(wp) ::   z1_e3t, zfact        !    -         -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zekb, zekg, zekr            ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze0, ze1 , ze2, ze3, zea    ! 3D workspace
+      REAL(wp) ::   zz0, zz1, z1_e3t     !    -         -
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3,4,5) .OR. wrk_in_use(2, 1,2,3) )THEN
+         CALL ctl_stop('tra_qsr: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -283,4 +288,7 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' qsr  - Ta: ', mask1=tmask, clinfo3='tra-ta' )
       !
+      IF( wrk_not_released(3, 1,2,3,4,5) .OR.   &
+          wrk_not_released(2, 1,2,3)     )   CALL ctl_stop('tra_qsr: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_qsr
 
@@ -303,18 +311,24 @@
       !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp.
       !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj, jk            ! dummy loop indices
-      INTEGER  ::   irgb, ierror          ! temporary integer
-      INTEGER  ::   ioptio, nqsr          ! temporary integer
-      REAL(wp) ::   zc0  , zc1, zcoef     ! temporary scalars
-      REAL(wp) ::   zc2  , zc3  , zchl    !    -         -
-      REAL(wp) ::   zz0  , zz1            !    -         -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zekb, zekg, zekr              ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze0 , ze1 , ze2 , ze3 , zea   ! 3D workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zekb => wrk_2d_1 , zekg => wrk_2d_2 , zekr => wrk_2d_3
+      USE wrk_nemo, ONLY:   ze0  => wrk_3d_1 , ze1  => wrk_3d_2 , ze2 => wrk_3d_3
+      USE wrk_nemo, ONLY:   ze3  => wrk_3d_4 , zea  => wrk_3d_5
+      !
+      INTEGER  ::   ji, jj, jk     ! dummy loop indices
+      INTEGER  ::   irgb, ierror, ioptio, nqsr   ! local integer
+      REAL(wp) ::   zz0, zc0  , zc1, zcoef       ! local scalars
+      REAL(wp) ::   zz1, zc2  , zc3, zchl        !   -      -
+      !
       CHARACTER(len=100) ::   cn_dir   ! Root directory for location of ssr files
       TYPE(FLD_N)        ::   sn_chl   ! informations about the chlorofyl field to be read
+      !!
       NAMELIST/namtra_qsr/  sn_chl, cn_dir, ln_traqsr, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio,   &
          &                  nn_chldta, rn_abs, rn_si0, rn_si1
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3) .OR. wrk_in_use(3, 1,2,3,4,5) )THEN
+         CALL ctl_stop('tra_qsr_init: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       cn_dir = './'       ! directory in which the model is executed
@@ -490,4 +504,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3)     .OR.   &
+          wrk_not_released(3, 1,2,3,4,5) )   CALL ctl_stop('tra_qsr_init: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_qsr_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 2715)
@@ -40,7 +40,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -210,5 +209,5 @@
                zdep = 1. / h_rnf(ji,jj)
                zdep = zfact * zdep  
-               IF ( rnf(ji,jj) .ne. 0.0 ) THEN
+               IF ( rnf(ji,jj) /= 0._wp ) THEN
                   DO jk = 1, nk_rnf(ji,jj)
                                         tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)   &
@@ -216,8 +215,8 @@
                      IF( ln_rnf_sal )   tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)   &
                                           &               +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep 
-                  ENDDO
+                  END DO
                ENDIF
-            ENDDO  
-         ENDDO  
+            END DO  
+         END DO  
       ENDIF  
 !!gm  It should be useless
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traswp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traswp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/traswp.F90	(revision 2715)
@@ -16,7 +16,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 2715)
@@ -14,4 +14,6 @@
    USE oce             ! ocean dynamics and tracers variables
    USE dom_oce         ! ocean space and time domain variables 
+   USE domvvl          ! variable volume
+   USE phycst          ! physical constant
    USE zdf_oce         ! ocean vertical physics variables
    USE sbc_oce         ! surface boundary condition: ocean
@@ -26,19 +28,15 @@
    USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
-   USE phycst
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE domvvl          ! variable volume
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC tra_zdf      !  routine called by step.F90
-   PUBLIC tra_zdf_init !  routine called by opa.F90
+   PUBLIC   tra_zdf        ! routine called by step.F90
+   PUBLIC   tra_zdf_init   ! routine called by nemogcm.F90
 
-   INTEGER ::   nzdf = 0               ! type vertical diffusion algorithm used
-      !                                ! defined from ln_zdf...  namlist logicals)
-   REAL(wp), DIMENSION(jpk) ::   r2dt  ! vertical profile time-step, = 2 rdttra
-      !                                ! except at nit000 (=rdttra) if neuler=0
+   INTEGER ::   nzdf = 0   ! type vertical diffusion algorithm used (defined from ln_zdf...  namlist logicals)
 
    !! * Substitutions
@@ -49,9 +47,8 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
+CONTAINS
 
-CONTAINS
-   
    SUBROUTINE tra_zdf( kt )
       !!----------------------------------------------------------------------
@@ -68,7 +65,7 @@
       !                                          ! set time step
       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
-         r2dt(:) =  rdttra(:)                          ! = rdtra (restarting with Euler time stepping)
+         r2dtra(:) =  rdttra(:)                          ! = rdtra (restarting with Euler time stepping)
       ELSEIF( kt <= nit000 + 1) THEN                ! at nit000 or nit000+1
-         r2dt(:) = 2. * rdttra(:)                      ! = 2 rdttra (leapfrog)
+         r2dtra(:) = 2. * rdttra(:)                      ! = 2 rdttra (leapfrog)
       ENDIF
 
@@ -79,11 +76,11 @@
 
       SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend
-      CASE ( 0 )    ;    CALL tra_zdf_exp( kt, 'TRA', r2dt, nn_zdfexp, tsb, tsa, jpts )  !   explicit scheme 
-      CASE ( 1 )    ;    CALL tra_zdf_imp( kt, 'TRA', r2dt,            tsb, tsa, jpts )  !   implicit scheme 
+      CASE ( 0 )    ;    CALL tra_zdf_exp( kt, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts )  !   explicit scheme 
+      CASE ( 1 )    ;    CALL tra_zdf_imp( kt, 'TRA', r2dtra,            tsb, tsa, jpts )  !   implicit scheme 
       CASE ( -1 )                                       ! esopa: test all possibility with control print
-         CALL tra_zdf_exp( kt, 'TRA', r2dt, nn_zdfexp, tsb, tsa, jpts )
+         CALL tra_zdf_exp( kt, 'TRA', r2dtra, nn_zdfexp, tsb, tsa, jpts )
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf0 - Ta: ', mask1=tmask,               &
          &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-         CALL tra_zdf_imp( kt, 'TRA', r2dt,            tsb, tsa, jpts ) 
+         CALL tra_zdf_imp( kt, 'TRA', r2dtra,            tsb, tsa, jpts ) 
          CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf1 - Ta: ', mask1=tmask,               &
          &             tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
@@ -92,6 +89,6 @@
       IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics
          DO jk = 1, jpkm1
-            ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / r2dt(jk) ) - ztrdt(:,:,jk)
-            ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dt(jk) ) - ztrds(:,:,jk)
+            ztrdt(:,:,jk) = ( ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / r2dtra(jk) ) - ztrdt(:,:,jk)
+            ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dtra(jk) ) - ztrds(:,:,jk)
          END DO
          CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_zdf, ztrdt )
@@ -103,5 +100,5 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' zdf  - Ta: ', mask1=tmask,               &
          &                       tab3d_2=tsa(:,:,:,jp_sal), clinfo2=       ' Sa: ', mask2=tmask, clinfo3='tra' )
-
+      !
    END SUBROUTINE tra_zdf
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 2715)
@@ -28,6 +28,7 @@
    USE zdf_oce         ! ocean vertical physics
    USE zdfddm          ! ocean vertical physics: double diffusion
+   USE trc_oce         ! share passive tracers/Ocean variables
    USE in_out_manager  ! I/O manager
-   USE trc_oce         ! share passive tracers/Ocean variables
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -43,7 +44,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -73,4 +73,7 @@
       !! ** Action : - after tracer fields pta
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx => wrk_3d_6, zwy => wrk_3d_7     ! 3D workspace
+      !
       INTEGER                              , INTENT(in   ) ::   kt          ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype      ! =TRA or TRC (tracer indicator)
@@ -80,10 +83,13 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb         ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta         ! tracer trend 
-      !! 
+      !
       INTEGER  ::  ji, jj, jk, jn, jl        ! dummy loop indices
       REAL(wp) ::  zlavmr, zave3r, ze3tr     ! local scalars
       REAL(wp) ::  ztra, ze3tb               !   -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwx, zwy   ! 3D workspace
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 6,7) ) THEN
+         CALL ctl_stop('tra_zdf_exp: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -158,4 +164,6 @@
       END DO
       !
+      IF( wrk_not_released(3, 6,7) )   CALL ctl_stop('tra_zdf_exp: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_zdf_exp
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 2715)
@@ -34,4 +34,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -73,7 +74,8 @@
       !! ** Action  : - pta  becomes the after tracer
       !!---------------------------------------------------------------------
-      USE oce    , ONLY :   zwd   => ua   ! ua used as workspace
-      USE oce    , ONLY :   zws   => va   ! va  -          -
-      !! 
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   zwd => ua       , zws => va         ! (ua,va) used as 3D workspace
+      USE wrk_nemo, ONLY:   zwi => wrk_3d_6 , zwt => wrk_3d_7   ! 3D workspace 
+      !
       INTEGER                              , INTENT(in   ) ::   kt       ! ocean time-step index
       CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype   ! =TRA or TRC (tracer indicator)
@@ -82,10 +84,12 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb      ! before and now tracer fields
       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta      ! tracer trend 
-      !!
-      INTEGER  ::  ji, jj, jk, jn        ! dummy loop indices
-      REAL(wp) ::  zrhs                  ! local scalars
-      REAL(wp) ::  ze3tb, ze3tn, ze3ta   ! variable vertical scale factors
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwi, zwt   ! workspace arrays
+      !
+      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices
+      REAL(wp) ::  zrhs, ze3tb, ze3tn, ze3ta   ! local scalars
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 6,7) ) THEN
+         CALL ctl_stop('tra_zdf_imp : requested workspace arrays unavailable.')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )  THEN
@@ -107,5 +111,5 @@
          ! Build matrix if temperature or salinity (only in double diffusion case) or first passive tracer
          !
-         IF(  ( cdtype == 'TRA' .AND. ( ( jn == jp_tem ) .OR. ( jn == jp_sal .AND. lk_zdfddm ) ) ) .OR. &
+         IF(  ( cdtype == 'TRA' .AND. ( jn == jp_tem .OR. ( jn == jp_sal .AND. lk_zdfddm ) ) ) .OR.   &
             & ( cdtype == 'TRC' .AND. jn == 1 )  )  THEN
             !
@@ -224,4 +228,6 @@
       !                                               ! ================= !
       !
+      IF( wrk_not_released(3, 6,7) )   CALL ctl_stop('tra_zdf_imp: failed to release workspace arrays')
+      !
    END SUBROUTINE tra_zdf_imp
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRA/zpshde.F90	(revision 2715)
@@ -20,4 +20,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -80,4 +81,8 @@
       !!              - pgru, pgrv: horizontal gradient of rho (if present) at u- & v-points 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zri => wrk_2d_1 , zrj => wrk_2d_2   ! interpolated value of rd
+      USE wrk_nemo, ONLY:   zhi => wrk_2d_3 , zhj => wrk_2d_4   ! depth of interpolation for eos2d
+      !
       INTEGER                              , INTENT(in   )           ::  kt          ! ocean time-step index
       INTEGER                              , INTENT(in   )           ::  kjpt        ! number of tracers
@@ -86,12 +91,18 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(in   ), OPTIONAL ::  prd         ! 3D density anomaly fields
       REAL(wp), DIMENSION(jpi,jpj         ), INTENT(  out), OPTIONAL ::  pgru, pgrv  ! hor. grad. of prd at u- & v-pts 
-      !!
+      !
       INTEGER  ::   ji, jj, jn      ! Dummy loop indices
       INTEGER  ::   iku, ikv, ikum1, ikvm1   ! partial step level (ocean bottom level) at u- and v-points
-      REAL(wp), DIMENSION(jpi,jpj,kjpt) ::   zti, ztj     ! interpolated value of tracer
-      REAL(wp), DIMENSION(jpi,jpj)      ::   zri, zrj     ! interpolated value of rd
-      REAL(wp), DIMENSION(jpi,jpj)      ::   zhi, zhj     ! depth of interpolation for eos2d
       REAL(wp) ::  ze3wu, ze3wv, zmaxu, zmaxv  ! temporary scalars
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zti, ztj    ! interpolated value of tracer
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4) ) THEN
+         CALL ctl_stop('zps_hde: requested workspace arrays unavailable')  ;  RETURN
+      END IF
+
+      ! Allocate workspaces whose dimension is > jpk
+      ALLOCATE( zti(jpi,jpj,kjpt) )
+      ALLOCATE( ztj(jpi,jpj,kjpt) )
 
       DO jn = 1, kjpt      !==   Interpolation of tracers at the last ocean level   ==!
@@ -200,4 +211,9 @@
       END IF
       !
+      IF( wrk_not_released(2, 1,2,3,4) )   CALL ctl_stop('zps_hde: failed to release workspace arrays')
+      !
+      DEALLOCATE( zti )
+      DEALLOCATE( ztj )
+      !
    END SUBROUTINE zps_hde
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdicp.F90	(revision 2715)
@@ -45,7 +45,6 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -57,33 +56,25 @@
       !!              momentum equations at every time step frequency nn_trd.
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptrd2dx             ! Temperature or U trend 
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptrd2dy             ! Salinity    or V trend
-      INTEGER                     , INTENT(in   ) ::   ktrd                ! tracer trend index
-      CHARACTER(len=3)            , INTENT(in   ) ::   ctype               ! momentum ('DYN') or tracers ('TRA') trends
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptrd2dx   ! Temperature or U trend 
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   ptrd2dy   ! Salinity    or V trend
+      INTEGER                     , INTENT(in   ) ::   ktrd      ! tracer trend index
+      CHARACTER(len=3)            , INTENT(in   ) ::   ctype     ! momentum ('DYN') or tracers ('TRA') trends
       !!
-      INTEGER  ::   ji, jj                                                 ! loop indices
-      REAL(wp) ::   zmsku, zbtu, zbt                                       ! temporary scalars
-      REAL(wp) ::   zmskv, zbtv                                            !    "         "
-      !!----------------------------------------------------------------------
-
-
-      ! 1. Mask trends
-      ! --------------
-
-      SELECT CASE( ctype )
-      !
-      CASE( 'DYN' )              ! Momentum
+      INTEGER ::   ji, jj   ! loop indices
+      !!----------------------------------------------------------------------
+
+      SELECT CASE( ctype )    !==  Mask trends  ==!
+      !
+      CASE( 'DYN' )                    ! Momentum
          DO jj = 1, jpjm1
             DO ji = 1, jpim1
-               zmsku = tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,1)
-               zmskv = tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,1)
-               ptrd2dx(ji,jj) = ptrd2dx(ji,jj) * zmsku
-               ptrd2dy(ji,jj) = ptrd2dy(ji,jj) * zmskv
+               ptrd2dx(ji,jj) = ptrd2dx(ji,jj) * tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,1)
+               ptrd2dy(ji,jj) = ptrd2dy(ji,jj) * tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,1)
             END DO
          END DO
-         ptrd2dx(jpi, : ) = 0.e0      ;      ptrd2dy(jpi, : ) = 0.e0
-         ptrd2dx( : ,jpj) = 0.e0      ;      ptrd2dy( : ,jpj) = 0.e0
-         !
-      CASE( 'TRA' )              ! Tracers
+         ptrd2dx(jpi, : ) = 0._wp      ;      ptrd2dy(jpi, : ) = 0._wp
+         ptrd2dx( : ,jpj) = 0._wp      ;      ptrd2dy( : ,jpj) = 0._wp
+         !
+      CASE( 'TRA' )                    ! Tracers
          ptrd2dx(:,:) = ptrd2dx(:,:) * tmask_i(:,:)
          ptrd2dy(:,:) = ptrd2dy(:,:) * tmask_i(:,:)
@@ -91,66 +82,30 @@
       END SELECT
       
-      ! 2. Basin averaged tracer/momentum trends
-      ! ----------------------------------------
-
-      SELECT CASE( ctype )
-      !
-      CASE( 'DYN' )              ! Momentum
-         umo(ktrd) = 0.e0
-         vmo(ktrd) = 0.e0
+      SELECT CASE( ctype )    !==  Basin averaged tracer/momentum trends  ==!
+      !
+      CASE( 'DYN' )                    ! Momentum
+         umo(ktrd) = 0._wp
+         vmo(ktrd) = 0._wp
          !
          SELECT CASE( ktrd )
-         !
          CASE( jpdyn_trd_swf )         ! surface forcing
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  umo(ktrd) = umo(ktrd) + ptrd2dx(ji,jj) * e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,1)
-                  vmo(ktrd) = vmo(ktrd) + ptrd2dy(ji,jj) * e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,1)
-               END DO
-            END DO
-            !
+            umo(ktrd) = SUM( ptrd2dx(:,:) * e1u(:,:) * e2u(:,:) * fse3u(:,:,1) )
+            vmo(ktrd) = SUM( ptrd2dy(:,:) * e1v(:,:) * e2v(:,:) * fse3v(:,:,1) )
          END SELECT
          !
       CASE( 'TRA' )              ! Tracers
-         tmo(ktrd) = 0.e0
-         smo(ktrd) = 0.e0
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zbt = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,1)
-               tmo(ktrd) =  tmo(ktrd) + ptrd2dx(ji,jj) * zbt
-               smo(ktrd) =  smo(ktrd) + ptrd2dy(ji,jj) * zbt
-            END DO
-         END DO
-         !
+         tmo(ktrd) = SUM( ptrd2dx(:,:) * e1e2t(:,:) * fse3t(:,:,1) )
+         smo(ktrd) = SUM( ptrd2dy(:,:) * e1e2t(:,:) * fse3t(:,:,1) )
       END SELECT
       
-      ! 3. Basin averaged tracer/momentum square trends
-      ! ----------------------------------------------
-      ! c a u t i o n: field now
-      
-      SELECT CASE( ctype )
+      SELECT CASE( ctype )    !==  Basin averaged tracer/momentum square trends  ==!   (now field)
       !
       CASE( 'DYN' )              ! Momentum
-         hke(ktrd) = 0.e0
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zbtu = e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,1)
-               zbtv = e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,1)
-               hke(ktrd) = hke(ktrd)   &
-               &   + un(ji,jj,1) * ptrd2dx(ji,jj) * zbtu &
-               &   + vn(ji,jj,1) * ptrd2dy(ji,jj) * zbtv
-            END DO
-         END DO
+         hke(ktrd) = SUM(   un(:,:,1) * ptrd2dx(:,:) * e1u(:,:) * e2u(:,:) * fse3u(:,:,1)   &
+            &             + vn(:,:,1) * ptrd2dy(:,:) * e1v(:,:) * e2v(:,:) * fse3v(:,:,1)   )
          !
       CASE( 'TRA' )              ! Tracers
-         t2(ktrd) = 0.e0
-         s2(ktrd) = 0.e0
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               zbt = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,1)
-               t2(ktrd) = t2(ktrd) + ptrd2dx(ji,jj) * zbt * tn(ji,jj,1)
-               s2(ktrd) = s2(ktrd) + ptrd2dy(ji,jj) * zbt * sn(ji,jj,1)
-            END DO
-         END DO
+         t2(ktrd) = SUM( ptrd2dx(:,:) * e1e2t(:,:) * fse3t(:,:,1) * tn(:,:,1) )
+         s2(ktrd) = SUM( ptrd2dy(:,:) * e1e2t(:,:) * fse3t(:,:,1) * sn(:,:,1) )
          !      
       END SELECT
@@ -166,34 +121,28 @@
       !!              momentum equations at every time step frequency nn_trd.
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptrd3dx            ! Temperature or U trend 
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptrd3dy            ! Salinity    or V trend
-      INTEGER,                          INTENT(in   ) ::   ktrd               ! momentum or tracer trend index
-      CHARACTER(len=3),                 INTENT(in   ) ::   ctype              ! momentum ('DYN') or tracers ('TRA') trends
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptrd3dx   ! Temperature or U trend 
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   ptrd3dy   ! Salinity    or V trend
+      INTEGER,                          INTENT(in   ) ::   ktrd      ! momentum or tracer trend index
+      CHARACTER(len=3),                 INTENT(in   ) ::   ctype     ! momentum ('DYN') or tracers ('TRA') trends
       !!
-      INTEGER ::   ji, jj, jk
-      REAL(wp) ::   zbt, zbtu, zbtv, zmsku, zmskv                             ! temporary scalars
-      !!----------------------------------------------------------------------
-
-      ! 1. Mask the trends
-      ! ------------------
-
-      SELECT CASE( ctype )
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      !!----------------------------------------------------------------------
+
+      SELECT CASE( ctype )    !==  Mask the trends  ==!
       !
       CASE( 'DYN' )              ! Momentum        
-         DO jk = 1, jpk
+         DO jk = 1, jpkm1
             DO jj = 1, jpjm1
                DO ji = 1, jpim1
-                  zmsku = tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,jk)
-                  zmskv = tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk)
-                  ptrd3dx(ji,jj,jk) = ptrd3dx(ji,jj,jk) * zmsku
-                  ptrd3dy(ji,jj,jk) = ptrd3dy(ji,jj,jk) * zmskv
+                  ptrd3dx(ji,jj,jk) = ptrd3dx(ji,jj,jk) * tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,jk)
+                  ptrd3dy(ji,jj,jk) = ptrd3dy(ji,jj,jk) * tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk)
                END DO
             END DO
          END DO
-         ptrd3dx(jpi, : ,:) = 0.e0      ;      ptrd3dy(jpi, : ,:) = 0.e0
-         ptrd3dx( : ,jpj,:) = 0.e0      ;      ptrd3dy( : ,jpj,:) = 0.e0
+         ptrd3dx(jpi, : ,:) = 0._wp      ;      ptrd3dy(jpi, : ,:) = 0._wp
+         ptrd3dx( : ,jpj,:) = 0._wp      ;      ptrd3dy( : ,jpj,:) = 0._wp
          !
       CASE( 'TRA' )              ! Tracers
-         DO jk = 1, jpk
+         DO jk = 1, jpkm1
             ptrd3dx(:,:,jk) = ptrd3dx(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
             ptrd3dy(:,:,jk) = ptrd3dy(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:)
@@ -202,69 +151,39 @@
       END SELECT   
 
-      ! 2. Basin averaged tracer/momentum trends
-      ! ----------------------------------------
-      
-      SELECT CASE( ctype )
+      SELECT CASE( ctype )    !==  Basin averaged tracer/momentum trends  ==!
       !
       CASE( 'DYN' )              ! Momentum
-         umo(ktrd) = 0.e0
-         vmo(ktrd) = 0.e0
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zbtu = e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk)
-                  zbtv = e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk)
-                  umo(ktrd) = umo(ktrd) + ptrd3dx(ji,jj,jk) * zbtu
-                  vmo(ktrd) = vmo(ktrd) + ptrd3dy(ji,jj,jk) * zbtv
-               END DO
-            END DO
+         umo(ktrd) = 0._wp
+         vmo(ktrd) = 0._wp
+         DO jk = 1, jpkm1
+            umo(ktrd) = umo(ktrd) + SUM( ptrd3dx(:,:,jk) * e1u(:,:) * e2u(:,:) * fse3u(:,:,jk) )
+            vmo(ktrd) = vmo(ktrd) + SUM( ptrd3dy(:,:,jk) * e1v(:,:) * e2v(:,:) * fse3v(:,:,jk) )
          END DO
          !
       CASE( 'TRA' )              ! Tracers
-         tmo(ktrd) = 0.e0
-         smo(ktrd) = 0.e0
-         DO jk = 1, jpkm1
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zbt = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) 
-                  tmo(ktrd) =  tmo(ktrd) + ptrd3dx(ji,jj,jk) * zbt
-                  smo(ktrd) =  smo(ktrd) + ptrd3dy(ji,jj,jk) * zbt
-               END DO
-            END DO
+         tmo(ktrd) = 0._wp
+         smo(ktrd) = 0._wp
+         DO jk = 1, jpkm1
+            tmo(ktrd) = tmo(ktrd) + SUM( ptrd3dx(:,:,jk) * e1e2t(:,:) * fse3t(:,:,jk) )
+            smo(ktrd) = smo(ktrd) + SUM( ptrd3dy(:,:,jk) * e1e2t(:,:) * fse3t(:,:,jk) )
          END DO
          !
       END SELECT
 
-      ! 3. Basin averaged tracer/momentum square trends
-      ! -----------------------------------------------
-      ! c a u t i o n: field now
-      
-      SELECT CASE( ctype )
+      SELECT CASE( ctype )    !==  Basin averaged tracer/momentum square trends  ==!   (now field)
       !
       CASE( 'DYN' )              ! Momentum
-         hke(ktrd) = 0.e0
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zbtu = e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk)
-                  zbtv = e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk)
-                  hke(ktrd) = hke(ktrd)   &
-                  &   + un(ji,jj,jk) * ptrd3dx(ji,jj,jk) * zbtu &
-                  &   + vn(ji,jj,jk) * ptrd3dy(ji,jj,jk) * zbtv
-               END DO
-            END DO
+         hke(ktrd) = 0._wp
+         DO jk = 1, jpkm1
+            hke(ktrd) = hke(ktrd) + SUM(   un(:,:,jk) * ptrd3dx(:,:,jk) * e1u(:,:) * e2u(:,:) * fse3u(:,:,jk)   &
+               &                         + vn(:,:,jk) * ptrd3dy(:,:,jk) * e1v(:,:) * e2v(:,:) * fse3v(:,:,jk)   )
          END DO
          !
       CASE( 'TRA' )              ! Tracers
-         t2(ktrd) = 0.e0
-         s2(ktrd) = 0.e0
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  zbt = e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk)
-                  t2(ktrd) = t2(ktrd) + ptrd3dx(ji,jj,jk) * zbt * tn(ji,jj,jk)
-                  s2(ktrd) = s2(ktrd) + ptrd3dy(ji,jj,jk) * zbt * sn(ji,jj,jk)
-               END DO
-            END DO
+         t2(ktrd) = 0._wp
+         s2(ktrd) = 0._wp
+         DO jk = 1, jpkm1
+            t2(ktrd) = t2(ktrd) + SUM( ptrd3dx(ji,jj,jk) * tn(ji,jj,jk) * e1e2t(:,:) * fse3t(:,:,jk) )
+            s2(ktrd) = s2(ktrd) + SUM( ptrd3dy(ji,jj,jk) * sn(ji,jj,jk) * e1e2t(:,:) * fse3t(:,:,jk) )
          END DO
          !
@@ -272,5 +191,4 @@
       !
    END SUBROUTINE trd_3d
-
 
 
@@ -281,9 +199,5 @@
       !! ** Purpose :   Read the namtrd namelist
       !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   zmskt
-#if  defined key_trddyn
-      REAL(wp) ::   zmsku, zmskv
-#endif
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
       !!----------------------------------------------------------------------
 
@@ -295,12 +209,7 @@
 
       ! Total volume at t-points:
-      tvolt = 0.e0
+      tvolt = 0._wp
       DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = fs_2, fs_jpim1   ! vector opt.
-               zmskt = tmask(ji,jj,jk) * tmask_i(ji,jj)
-               tvolt = tvolt + zmskt * e1t(ji,jj) *e2t(ji,jj) * fse3t(ji,jj,jk)
-            END DO
-         END DO
+         tvolt = SUM( e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) )
       END DO
       IF( lk_mpp )   CALL mpp_sum( tvolt )   ! sum over the global domain
@@ -310,17 +219,15 @@
 #if  defined key_trddyn
       ! Initialization of potential to kinetic energy conversion
-      rpktrd = 0.e0
+      rpktrd = 0._wp
 
       ! Total volume at u-, v- points:
-      tvolu = 0.e0
-      tvolv = 0.e0
+      tvolu = 0._wp
+      tvolv = 0._wp
 
       DO jk = 1, jpk
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
-               zmsku = tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,jk)
-               zmskv = tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk)
-               tvolu = tvolu + zmsku * e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk)
-               tvolv = tvolv + zmskv * e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk)
+               tvolu = tvolu + e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) * tmask_i(ji+1,jj  ) * tmask_i(ji,jj) * umask(ji,jj,jk)
+               tvolv = tvolv + e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) * tmask_i(ji  ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk)
             END DO
          END DO
@@ -344,10 +251,17 @@
       !! ** Purpose :  write dynamic trends in ocean.output 
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt                                  ! ocean time-step index
-      !!
-      INTEGER  ::   ji, jj, jk
-      REAL(wp) ::   ze1e2w, zcof, zbe1ru, zbe2rv, zbtr, ztz, zth   !    "      scalars
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zkepe, zkx, zky, zkz   ! temporary arrays
-      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zkepe => wrk_3d_1 , zkx => wrk_3d_2   ! 3D workspace
+      USE wrk_nemo, ONLY:   zky   => wrk_3d_3 , zkz => wrk_3d_4   !  -      -
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zcof         ! local scalar
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1,2,3,4) ) THEN
+         CALL ctl_stop('trd_dwr: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! I. Momentum trends
@@ -359,63 +273,45 @@
          ! --------------------------------------------------
          ! c a u t i o n here, trends are computed at kt+1 (now , but after the swap)
-
-         zkx(:,:,:)   = 0.e0
-         zky(:,:,:)   = 0.e0
-         zkz(:,:,:)   = 0.e0
-         zkepe(:,:,:) = 0.e0
+         zkx  (:,:,:) = 0._wp
+         zky  (:,:,:) = 0._wp
+         zkz  (:,:,:) = 0._wp
+         zkepe(:,:,:) = 0._wp
    
          CALL eos( tsn, rhd, rhop )       ! now potential and in situ densities
 
-         ! Density flux at w-point
+         zcof = 0.5_wp / rau0             ! Density flux at w-point
+         zkz(:,:,1) = 0._wp
          DO jk = 2, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  ze1e2w = 0.5 * e1t(ji,jj) * e2t(ji,jj) * wn(ji,jj,jk) * tmask_i(ji,jj)
-                  zkz(ji,jj,jk) = ze1e2w / rau0 * ( rhop(ji,jj,jk) + rhop(ji,jj,jk-1) )
+            zkz(:,:,jk) = e1e2t(:,:) * wn(:,:,jk) * ( rhop(:,:,jk) + rhop(:,:,jk-1) ) * tmask_i(:,:)
+         END DO
+         
+         zcof   = 0.5_wp / rau0           ! Density flux at u and v-points
+         DO jk = 1, jpkm1
+            DO jj = 1, jpjm1
+               DO ji = 1, jpim1
+                  zkx(ji,jj,jk) = zcof * e2u(ji,jj) * fse3u(ji,jj,jk) * un(ji,jj,jk) * ( rhop(ji,jj,jk) + rhop(ji+1,jj,jk) )
+                  zky(ji,jj,jk) = zcof * e1v(ji,jj) * fse3v(ji,jj,jk) * vn(ji,jj,jk) * ( rhop(ji,jj,jk) + rhop(ji,jj+1,jk) )
                END DO
             END DO
          END DO
-         zkz(:,:,1) = 0.e0
          
-         ! Density flux at u and v-points
-         DO jk = 1, jpk
-            DO jj = 1, jpjm1
-               DO ji = 1, jpim1
-                  zcof   = 0.5 / rau0
-                  zbe1ru = zcof * e2u(ji,jj) * fse3u(ji,jj,jk) * un(ji,jj,jk)
-                  zbe2rv = zcof * e1v(ji,jj) * fse3v(ji,jj,jk) * vn(ji,jj,jk)
-                  zkx(ji,jj,jk) = zbe1ru * ( rhop(ji,jj,jk) + rhop(ji+1,jj,jk) )
-                  zky(ji,jj,jk) = zbe2rv * ( rhop(ji,jj,jk) + rhop(ji,jj+1,jk) )
+         DO jk = 1, jpkm1                 ! Density flux divergence at t-point
+            DO jj = 2, jpjm1
+               DO ji = 2, jpim1
+                  zkepe(ji,jj,jk) = - (  zkz(ji,jj,jk) - zkz(ji  ,jj  ,jk+1)               &
+                     &                 + zkx(ji,jj,jk) - zkx(ji-1,jj  ,jk  )               &
+                     &                 + zky(ji,jj,jk) - zky(ji  ,jj-1,jk  )   )           &
+                     &              / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) * tmask(ji,jj,jk) * tmask_i(ji,jj)
                END DO
             END DO
          END DO
-         
-         ! Density flux divergence at t-point
-         DO jk = 1, jpkm1
-            DO jj = 2, jpjm1
-               DO ji = 2, jpim1
-                  zbtr = 1. / ( e1t(ji,jj)*e2t(ji,jj)*fse3t(ji,jj,jk) )
-                  ztz = - zbtr * (    zkz(ji,jj,jk) - zkz(ji,jj,jk+1) )
-                  zth = - zbtr * (  ( zkx(ji,jj,jk) - zkx(ji-1,jj,jk) )   &
-                    &             + ( zky(ji,jj,jk) - zky(ji,jj-1,jk) )  )
-                  zkepe(ji,jj,jk) = (zth + ztz) * tmask(ji,jj,jk) * tmask_i(ji,jj)
-               END DO
-            END DO
-         END DO
-         zkepe( : , : ,jpk) = 0.e0
-         zkepe( : ,jpj, : ) = 0.e0
-         zkepe(jpi, : , : ) = 0.e0
 
          ! I.2 Basin averaged kinetic energy trend
          ! ----------------------------------------
-         peke = 0.e0
-         DO jk = 1,jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  peke = peke + zkepe(ji,jj,jk) * grav * fsdept(ji,jj,jk)   &
-                     &                     * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk)
-               END DO
-            END DO
-         END DO
+         peke = 0._wp
+         DO jk = 1, jpkm1
+            peke = peke + SUM( zkepe(:,:,jk) * fsdept(:,:,jk) * e1e2t(:,:) * fse3t(:,:,jk) )
+         END DO
+         peke = grav * peke
 
          ! I.3 Sums over the global domain
@@ -542,4 +438,6 @@
          !
       ENDIF
+      !
+      IF( wrk_not_released(3, 1,2,3,4) )   CALL ctl_stop('trd_dwr: failed to release workspace arrays')
       !
    END SUBROUTINE trd_dwr
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 2715)
@@ -15,5 +15,4 @@
    !!   'key_trdmld'                          mixed layer trend diagnostics
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
    !!   trd_mld          : T and S cumulated trends averaged over the mixed layer
    !!   trd_mld_zint     : T and S trends vertical integration
@@ -23,4 +22,5 @@
    USE dom_oce         ! ocean space and time domain variables
    USE trdmod_oce      ! ocean variables trends
+   USE trdmld_oce      ! ocean variables trends
    USE ldftra_oce      ! ocean active tracers lateral physics
    USE zdf_oce         ! ocean vertical physics
@@ -37,4 +37,5 @@
    USE prtctl          ! Print control
    USE restart         ! for lrst_oce
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -47,5 +48,6 @@
    CHARACTER (LEN=40) ::  clhstnam         ! name of the trends NetCDF file
    INTEGER ::   nh_t, nmoymltrd
-   INTEGER ::   nidtrd, ndextrd1(jpi*jpj)
+   INTEGER ::   nidtrd
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) ::   ndextrd1
    INTEGER ::   ndimtrd1                        
    INTEGER ::   ionce, icount                   
@@ -58,8 +60,18 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION trd_mld_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trd_mld_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( ndextrd1(jpi*jpj) , STAT=trd_mld_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( trd_mld_alloc )
+      IF( trd_mld_alloc /= 0 )   CALL ctl_warn('trd_mld_alloc: failed to allocate array ndextrd1')
+   END FUNCTION trd_mld_alloc
+
 
    SUBROUTINE trd_mld_zint( pttrdmld, pstrdmld, ktrd, ctype )
@@ -81,12 +93,18 @@
       !!            surface and the control surface is called "mixed-layer"
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   ktrd                             ! ocean trend index
-      CHARACTER(len=2), INTENT( in ) :: ctype                     ! surface/bottom (2D arrays) or
-      !                                                           ! interior (3D arrays) physics
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::  pttrdmld ! temperature trend 
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::  pstrdmld ! salinity trend 
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zvlmsk => wrk_2d_10     ! 2D workspace
+      !
+      INTEGER                         , INTENT( in ) ::   ktrd       ! ocean trend index
+      CHARACTER(len=2)                , INTENT( in ) ::   ctype      ! 2D surface/bottom or 3D interior physics
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::   pttrdmld   ! temperature trend 
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::   pstrdmld   ! salinity trend 
+      !
       INTEGER ::   ji, jj, jk, isum
-      REAL(wp), DIMENSION(jpi,jpj) ::  zvlmsk
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 10) ) THEN
+         CALL ctl_stop('trd_mld_zint : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! I. Definition of control surface and associated fields
@@ -176,4 +194,6 @@
          smltrd(:,:,ktrd) = smltrd(:,:,ktrd) + pstrdmld(:,:,1) * wkx(:,:,1)            
       END SELECT
+      !
+      IF( wrk_not_released(2, 10) )   CALL ctl_stop('trd_mld_zint: failed to release workspace arrays')
       !
    END SUBROUTINE trd_mld_zint
@@ -227,18 +247,19 @@
       !!       - See NEMO documentation (in preparation)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztmltot => wrk_2d_1,  zsmltot => wrk_2d_2 ! dT/dt over the anlysis window (including Asselin)
+      USE wrk_nemo, ONLY: ztmlres => wrk_2d_3,  zsmlres => wrk_2d_4 ! residual = dh/dt entrainment term
+      USE wrk_nemo, ONLY: ztmlatf => wrk_2d_5,  zsmlatf => wrk_2d_6 ! needed for storage only
+      USE wrk_nemo, ONLY: ztmltot2 => wrk_2d_7, ztmlres2 => wrk_2d_8, ztmltrdm2 => wrk_2d_9    ! \  working arrays to diagnose the trends
+      USE wrk_nemo, ONLY: zsmltot2 => wrk_2d_10, zsmlres2 => wrk_2d_11, zsmltrdm2 => wrk_2d_12 !  > associated with the time meaned ML T & S
+      USE wrk_nemo, ONLY: ztmlatf2 => wrk_2d_13, zsmlatf2 => wrk_2d_14    
+      USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2                     ! /
+      !
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER :: ji, jj, jk, jl, ik, it, itmod
       LOGICAL :: lldebug = .TRUE.
       REAL(wp) :: zavt, zfn, zfn2
-      REAL(wp) ,DIMENSION(jpi,jpj) ::     &
-           ztmltot,  zsmltot,             & ! dT/dt over the anlysis window (including Asselin)
-           ztmlres,  zsmlres,             & ! residual = dh/dt entrainment term
-           ztmlatf,  zsmlatf,             & ! needed for storage only
-           ztmltot2, ztmlres2, ztmltrdm2, & ! \  working arrays to diagnose the trends
-           zsmltot2, zsmlres2, zsmltrdm2, & !  > associated with the time meaned ML T & S
-           ztmlatf2, zsmlatf2               ! /
-      REAL(wp), DIMENSION(jpi,jpj,jpltrd) ::  &
-           ztmltrd2, zsmltrd2               ! only needed for mean diagnostics
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztmltrd2, zsmltrd2   ! only needed for mean diagnostics
 #if defined key_dimgout
       INTEGER ::  iyear,imon,iday
@@ -247,4 +268,16 @@
       !!----------------------------------------------------------------------
       
+      ! Check that the workspace arrays are all OK to be used
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10,11,12,13,14)  .OR. &
+          wrk_in_use(3, 1,2)                                 ) THEN
+         CALL ctl_stop('trd_mld : requested workspace arrays unavailable')   ;   RETURN
+      ELSE IF(jpltrd > jpk) THEN
+         ! ARPDBG, is this reasonable or will this cause trouble in the future?
+         CALL ctl_stop('trd_mld : no. of mixed-layer trends (jpltrd) exceeds no. of model levels so cannot use 3D workspaces.')
+         RETURN         
+      END IF
+      ! Set-up pointers into sub-arrays of 3d-workspaces
+      ztmltrd2 => wrk_3d_1(1:,:,1:jpltrd)
+      zsmltrd2 => wrk_3d_2(1:,:,1:jpltrd)
 
       ! ======================================================================
@@ -707,4 +740,8 @@
       IF( lrst_oce )   CALL trd_mld_rst_write( kt ) 
 
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10,11,12,13,14)  .OR. &
+          wrk_not_released(3, 1,2)                                )   &
+          CALL ctl_stop('trd_mld : failed to release workspace arrays.')
+      !
    END SUBROUTINE trd_mld
 
@@ -716,15 +753,10 @@
       !! ** Purpose :   computation of vertically integrated T and S budgets
       !!      from ocean surface down to control surface (NetCDF output)
-      !!
-      !!----------------------------------------------------------------------
-      !! * Local declarations
+      !!----------------------------------------------------------------------
       INTEGER :: jl
       INTEGER :: inum   ! logical unit
-
       REAL(wp) ::   zjulian, zsto, zout
-
       CHARACTER (LEN=40) ::   clop
       CHARACTER (LEN=12) ::   clmxl, cltu, clsu
-
       !!----------------------------------------------------------------------
 
@@ -763,4 +795,8 @@
          nwarn = nwarn + 1
       END IF
+
+      !                                   ! allocate trdmld arrays
+      IF( trd_mld_alloc()    /= 0 )   CALL ctl_stop( 'STOP', 'trd_mld_init : unable to allocate trdmld     arrays' )
+      IF( trdmld_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_mld_init : unable to allocate trdmld_oce arrays' )
 
       ! I.2 Initialize arrays to zero or read a restart file
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_oce.F90	(revision 2715)
@@ -4,10 +4,12 @@
    !! Ocean trends :   set tracer and momentum trend variables
    !!======================================================================
-   !! History :  9.0  !  04-08  (C. Talandier)  New trends organization
+   !! History :  1.0  ! 2004-08  (C. Talandier)  New trends organization
    !!----------------------------------------------------------------------
-   USE par_oce         ! ocean parameters
+   USE par_oce        ! ocean parameters
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC   trdmld_oce_alloc    ! Called in trdmld.F90
 
 #if defined key_trdmld
@@ -17,10 +19,6 @@
 #endif
    !!* mixed layer trends indices
-   INTEGER, PARAMETER, PUBLIC ::   jpltrd = 11    !: number of mixed-layer trends arrays
-   INTEGER, PUBLIC   & 
-#if !defined key_agrif
-      , PARAMETER  &
-#endif
-::   jpktrd = jpk   !: max level for mixed-layer trends diag.
+   INTEGER, PARAMETER, PUBLIC ::   jpltrd = 11      !: number of mixed-layer trends arrays
+   INTEGER, PUBLIC            ::   jpktrd           !: max level for mixed-layer trends diag.
    !
    INTEGER, PUBLIC, PARAMETER ::   jpmld_xad =  1   !:  zonal      
@@ -46,10 +44,10 @@
    CHARACTER(LEN=80) , PUBLIC :: clname, ctrd(jpltrd+1,2)
 
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj)     ::   nmld   !: mixed layer depth indexes 
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj)     ::   nbol   !: mixed-layer depth indexes when read from file
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nmld   !: mixed layer depth indexes 
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nbol   !: mixed-layer depth indexes when read from file
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   wkx    !:
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wkx    !:
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  &
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::  &
       rmld   ,                      & !: mld depth (m) corresponding to nmld
       tml    , sml  ,               & !: \ "now" mixed layer temperature/salinity
@@ -66,5 +64,5 @@
       rmld_sum, rmldbn                !: needed to compute the leap-frog time mean of the ML depth
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  &
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::  &
       tmlatfb, tmlatfn ,            & !: "before" Asselin contribution at begining of the averaging
       smlatfb, smlatfn,             & !: period (i.e. last contrib. from previous such period) and 
@@ -72,5 +70,5 @@
       tmlatfm, smlatfm                !: accumulator for Asselin trends (needed for storage only)
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpltrd) ::  &
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::  &
       tmltrd,                       & !: \ physical contributions to the total trend (for T/S),
       smltrd,                       & !: / cumulated over the current analysis window
@@ -83,7 +81,56 @@
 #endif
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+  INTEGER FUNCTION trdmld_oce_alloc()
+     !!----------------------------------------------------------------------
+     !!                 ***  FUNCTION trdmld_oce_alloc   ***
+     !!----------------------------------------------------------------------
+     USE lib_mpp
+     INTEGER :: ierr(5)
+     !!----------------------------------------------------------------------
+
+     ! Initialise jpktrd here as can no longer do it in MODULE body since
+     ! jpk is now a variable.
+     jpktrd = jpk   !: max level for mixed-layer trends diag.
+
+     ierr(:) = 0
+
+#if   defined  key_trdmld   ||   defined key_esopa
+     ALLOCATE( nmld(jpi,jpj), nbol(jpi,jpj),       &
+        &      wkx(jpi,jpj,jpk), rmld(jpi,jpj),    & 
+        &      tml(jpi,jpj)    , sml(jpi,jpj),     & 
+        &      tmlb(jpi,jpj)   , smlb(jpi,jpj) ,   &
+        &      tmlbb(jpi,jpj)  , smlbb(jpi,jpj), STAT = ierr(1) )
+
+     ALLOCATE( tmlbn(jpi,jpj)  , smlbn(jpi,jpj),   &
+        &      tmltrdm(jpi,jpj), smltrdm(jpi,jpj), &
+        &      tml_sum(jpi,jpj), tml_sumb(jpi,jpj),&
+        &      tmltrd_atf_sumb(jpi,jpj)           , STAT=ierr(2) )
+
+     ALLOCATE( sml_sum(jpi,jpj), sml_sumb(jpi,jpj), &
+        &      smltrd_atf_sumb(jpi,jpj),            &
+        &      rmld_sum(jpi,jpj), rmldbn(jpi,jpj),  &
+        &      tmlatfb(jpi,jpj), tmlatfn(jpi,jpj), STAT = ierr(3) )
+
+     ALLOCATE( smlatfb(jpi,jpj), smlatfn(jpi,jpj), & 
+        &      tmlatfm(jpi,jpj), smlatfm(jpi,jpj), &
+        &      tmltrd(jpi,jpj,jpltrd),   smltrd(jpi,jpj,jpltrd), STAT=ierr(4))
+
+     ALLOCATE( tmltrd_sum(jpi,jpj,jpltrd),tmltrd_csum_ln(jpi,jpj,jpltrd),      &
+        &      tmltrd_csum_ub(jpi,jpj,jpltrd), smltrd_sum(jpi,jpj,jpltrd),     &
+        &      smltrd_csum_ln(jpi,jpj,jpltrd), smltrd_csum_ub(jpi,jpj,jpltrd), STAT=ierr(5) )
+#endif
+      !
+      trdmld_oce_alloc = MAXVAL( ierr )
+      IF( lk_mpp                )   CALL mpp_sum ( trdmld_oce_alloc )
+      IF( trdmld_oce_alloc /= 0 )   CALL ctl_warn('trdmld_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION trdmld_oce_alloc
+
    !!======================================================================
 END MODULE trdmld_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 2715)
@@ -24,4 +24,5 @@
    USE trdmld                  ! ocean active mixed layer tracers trends 
    USE in_out_manager          ! I/O manager
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -39,5 +40,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -51,20 +52,29 @@
       !!              integral constraints
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt                                ! time step
-      INTEGER, INTENT( in ) ::   ktrd                              ! tracer trend index
-      CHARACTER(len=3), INTENT( in ) ::   ctype                    ! momentum or tracers trends type 'DYN'/'TRA'
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   ptrdx ! Temperature or U trend 
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) ::   ptrdy ! Salinity    or V trend
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztswu => wrk_2d_1,  &
+                          ztswv => wrk_2d_2,  &
+                          ztbfu => wrk_2d_3,  &
+                          ztbfv => wrk_2d_4,  &
+                          z2dx  => wrk_2d_5,  &
+                          z2dy  => wrk_2d_6
+      !
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend 
+      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend
+      CHARACTER(len=3)          , INTENT(in   ) ::   ctype   ! momentum or tracers trends type 'DYN'/'TRA'
+      INTEGER                   , INTENT(in   ) ::   kt      ! time step
+      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index
       !!
-      INTEGER ::   ji, jj
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztswu, ztswv               ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztbfu, ztbfv               ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   z2dx, z2dy                 ! workspace arrays
-      !!----------------------------------------------------------------------
-
-      z2dx(:,:)   = 0.e0   ;   z2dy(:,:)   = 0.e0                  ! initialization of workspace arrays
-
-      IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt      ! = rdtra (restarting with Euler time stepping)
-      ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt      ! = 2 rdttra (leapfrog)
+      INTEGER ::   ji, jj   ! dummy loop indices
+      !!----------------------------------------------------------------------
+
+      IF(wrk_in_use(2, 1,2,3,4,5,6))THEN
+         CALL ctl_warn('trd_mod: Requested workspace arrays already in use.')   ;   RETURN
+      END IF
+
+      z2dx(:,:) = 0._wp   ;   z2dy(:,:) = 0._wp                            ! initialization of workspace arrays
+
+      IF( neuler == 0 .AND. kt == nit000    ) THEN   ;   r2dt =      rdt   ! = rdtra (restart with Euler time stepping)
+      ELSEIF(               kt <= nit000 + 1) THEN   ;   r2dt = 2. * rdt   ! = 2 rdttra (leapfrog)
       ENDIF
 
@@ -84,15 +94,15 @@
             CASE ( jptra_trd_dmp )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpt_dmp, ctype )   ! damping
             CASE ( jptra_trd_qsr )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpt_qsr, ctype )   ! penetrative solar radiat.
-            CASE ( jptra_trd_nsr )   
-               z2dx(:,:) = ptrdx(:,:,1)   ;   z2dy(:,:) = ptrdy(:,:,1)
-               CALL trd_icp( z2dx, z2dy, jpicpt_nsr, ctype )                               ! non solar radiation
+            CASE ( jptra_trd_nsr )   ;   z2dx(:,:) = ptrdx(:,:,1)   
+                                         z2dy(:,:) = ptrdy(:,:,1)
+                                         CALL trd_icp( z2dx , z2dy , jpicpt_nsr, ctype )   ! non solar radiation
             CASE ( jptra_trd_xad )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpt_xad, ctype )   ! x- horiz adv
             CASE ( jptra_trd_yad )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpt_yad, ctype )   ! y- horiz adv
-            CASE ( jptra_trd_zad )                                                         ! z- vertical adv 
-               CALL trd_icp( ptrdx, ptrdy, jpicpt_zad, ctype )   
-               ! compute the surface flux condition wn(:,:,1)*tn(:,:,1)
-               z2dx(:,:) = wn(:,:,1)*tn(:,:,1)/fse3t(:,:,1)
-               z2dy(:,:) = wn(:,:,1)*sn(:,:,1)/fse3t(:,:,1)
-               CALL trd_icp( z2dx , z2dy , jpicpt_zl1, ctype )                             ! 1st z- vertical adv 
+            CASE ( jptra_trd_zad )   ;   CALL trd_icp( ptrdx, ptrdy, jpicpt_zad, ctype )   ! z- vertical adv 
+                                         CALL trd_icp( ptrdx, ptrdy, jpicpt_zad, ctype )   
+                                         ! compute the surface flux condition wn(:,:,1)*tn(:,:,1)
+                                         z2dx(:,:) = wn(:,:,1)*tn(:,:,1)/fse3t(:,:,1)
+                                         z2dy(:,:) = wn(:,:,1)*sn(:,:,1)/fse3t(:,:,1)
+                                         CALL trd_icp( z2dx , z2dy , jpicpt_zl1, ctype )   ! 1st z- vertical adv 
             END SELECT
          END IF
@@ -113,6 +123,6 @@
                ! subtract surface forcing/bottom friction trends 
                ! from vertical diffusive momentum trends
-               ztswu(:,:) = 0.e0   ;   ztswv(:,:) = 0.e0
-               ztbfu(:,:) = 0.e0   ;   ztbfv(:,:) = 0.e0  
+               ztswu(:,:) = 0._wp   ;   ztswv(:,:) = 0._wp
+               ztbfu(:,:) = 0._wp   ;   ztbfv(:,:) = 0._wp 
                DO jj = 2, jpjm1   
                   DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -121,7 +131,6 @@
                      ztswv(ji,jj) = vtau(ji,jj) / ( fse3v(ji,jj,1)*rau0 )
                      ! bottom friction contribution now handled explicitly
-                     !
-                     ptrdx(ji,jj,1     ) = ptrdx(ji,jj,1     ) - ztswu(ji,jj)
-                     ptrdy(ji,jj,1     ) = ptrdy(ji,jj,1     ) - ztswv(ji,jj)
+                     ptrdx(ji,jj,1) = ptrdx(ji,jj,1) - ztswu(ji,jj)
+                     ptrdy(ji,jj,1) = ptrdy(ji,jj,1) - ztswv(ji,jj)
                   END DO
                END DO
@@ -218,4 +227,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4,5,6) )   CALL ctl_warn('trd_mod: Failed to release workspace arrays.')
+      !
    END SUBROUTINE trd_mod
 
@@ -228,9 +239,9 @@
    USE trdicp          ! ocean bassin integral constraints properties
    USE trdmld          ! ocean active mixed layer tracers trends 
-
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE trd_mod(ptrd3dx, ptrd3dy, ktrd , ctype, kt )   ! Empty routine
-      REAL    ::   ptrd3dx(:,:,:), ptrd3dy(:,:,:)
-      INTEGER ::   ktrd, kt                            
+      REAL(wp) ::   ptrd3dx(:,:,:), ptrd3dy(:,:,:)
+      INTEGER  ::   ktrd, kt                            
       CHARACTER(len=3) ::  ctype                  
       WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd3dx(1,1,1), ptrd3dy(1,1,1)
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_oce.F90	(revision 2715)
@@ -75,5 +75,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE trdmod_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod_trc.F90	(revision 2715)
@@ -4,9 +4,4 @@
    !!  Dummy module
    !!======================================================================
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
    !!----------------------------------------------------------------------
    !!   Dummy module                                             NO TOP use
@@ -21,4 +16,8 @@
    END SUBROUTINE trd_mod_trc
 
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE trdmod_trc
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 2715)
@@ -4,7 +4,7 @@
    !! Ocean diagnostics:  ocean tracers trends
    !!=====================================================================
-   !! History :  9.0  !  2004-08  (C. Talandier) Original code
-   !!                 !  2005-04  (C. Deltel)    Add Asselin trend in the ML budget
-   !!      NEMO  3.3  !  2010-06  (C. Ethe) merge TRA-TRC 
+   !! History :  1.0  !  2004-08  (C. Talandier) Original code
+   !!            2.0  !  2005-04  (C. Deltel)    Add Asselin trend in the ML budget
+   !!            3.3  !  2010-06  (C. Ethe) merge TRA-TRC 
    !!----------------------------------------------------------------------
 #if  defined key_trdtra || defined key_trdmld || defined key_trdmld_trc 
@@ -12,16 +12,17 @@
    !!   trd_tra      : Call the trend to be computed
    !!----------------------------------------------------------------------
-   USE dom_oce            ! ocean domain 
-   USE trdmod_oce         ! ocean active mixed layer tracers trends 
-   USE trdmod             ! ocean active mixed layer tracers trends 
-   USE trdmod_trc         ! ocean passive mixed layer tracers trends 
+   USE dom_oce          ! ocean domain 
+   USE trdmod_oce       ! ocean active mixed layer tracers trends 
+   USE trdmod           ! ocean active mixed layer tracers trends 
+   USE trdmod_trc       ! ocean passive mixed layer tracers trends 
+   USE in_out_manager   ! I/O manager
+   USE lib_mpp          ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC trd_tra          ! called by all  traXX modules
+   PUBLIC   trd_tra          ! called by all  traXX modules
  
-   !! * Module declaration
-   REAL(wp), DIMENSION(jpi,jpj,jpk), SAVE :: trdtx, trdty, trdt  !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: trdtx, trdty, trdt  !:
 
    !! * Substitutions
@@ -29,10 +30,20 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION trd_tra_alloc()
+      !!----------------------------------------------------------------------------
+      !!                  ***  FUNCTION trd_tra_alloc  ***
+      !!----------------------------------------------------------------------------
+      ALLOCATE( trdtx(jpi,jpj,jpk) , trdty(jpi,jpj,jpk) , trdt(jpi,jpj,jpk) , STAT= trd_tra_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( trd_tra_alloc )
+      IF( trd_tra_alloc /= 0 )   CALL ctl_warn('trd_tra_alloc: failed to allocate arrays')
+   END FUNCTION trd_tra_alloc
+
 
    SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pun, ptra )
@@ -50,4 +61,7 @@
       !!        nn_ctls > 1  : use fixed level surface jk = nn_ctls
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrds => wrk_3d_10   ! 3D workspace
+      !
       INTEGER                         , INTENT(in)           ::  kt      ! time step
       CHARACTER(len=3)                , INTENT(in)           ::  ctype   ! tracers trends type 'TRA'/'TRC'
@@ -57,8 +71,14 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::  pun     ! velocity 
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::  ptra    ! Tracer variable 
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  ztrds    !  
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 10) ) THEN
+         CALL ctl_stop('trd_tra: requested workspace array unavailable')   ;   RETURN
+      ENDIF
+
+      IF( .NOT. ALLOCATED( trdtx ) ) THEN       ! allocate trdtra arrays
+         IF( trd_tra_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra : unable to allocate arrays' )
+      ENDIF
+      
       ! Control of optional arguments
       IF( ctype == 'TRA' .AND. ktra == jp_tem ) THEN 
@@ -118,5 +138,8 @@
       ENDIF
       !
+      IF( wrk_not_released(3, 10) )   CALL ctl_stop('trd_tra: failed to release workspace array')
+      !
    END SUBROUTINE trd_tra
+
 
    SUBROUTINE trd_tra_adv( pf, pun, ptn, cdir, ptrd )
@@ -130,13 +153,13 @@
       !!                k-advective trends = -un. di+1[T] = -( dk+1[fi] - tn dk+1[un] )
       !!----------------------------------------------------------------------
-      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk)           ::   pf      ! advective flux in one direction
-      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk)           ::   pun     ! now velocity  in one direction
-      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk)           ::   ptn     ! now or before tracer 
-      CHARACTER(len=1), INTENT(in )                                   ::   cdir    ! X/Y/Z direction
-      REAL(wp)        , INTENT(out), DIMENSION(jpi,jpj,jpk)           ::   ptrd    ! advective trend in one direction
-      !!
-      INTEGER                          ::   ji, jj, jk   ! dummy loop indices
-      INTEGER                          ::   ii, ij, ik   ! index shift function of the direction
-      REAL(wp)                         ::   zbtr         ! temporary scalar
+      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk) ::   pf      ! advective flux in one direction
+      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk) ::   pun     ! now velocity  in one direction
+      REAL(wp)        , INTENT(in ), DIMENSION(jpi,jpj,jpk) ::   ptn     ! now or before tracer 
+      CHARACTER(len=1), INTENT(in )                         ::   cdir    ! X/Y/Z direction
+      REAL(wp)        , INTENT(out), DIMENSION(jpi,jpj,jpk) ::   ptrd    ! advective trend in one direction
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      INTEGER  ::   ii, ij, ik   ! index shift function of the direction
+      REAL(wp) ::   zbtr         ! local scalar
       !!----------------------------------------------------------------------
 
@@ -167,10 +190,8 @@
 #   else
    !!----------------------------------------------------------------------
-   !!   Default case :                                         Empty module
+   !!   Default case :          Dummy module           No trend diagnostics
    !!----------------------------------------------------------------------
    USE par_oce      ! ocean variables trends
-
 CONTAINS
-
    SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pu, ptra )
       !!----------------------------------------------------------------------
@@ -182,11 +203,6 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::  pu      ! velocity 
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL ::  ptra    ! Tracer variable 
-      WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd(1,1,1)
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', ptra(1,1,1)
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', pu(1,1,1)
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', ktrd
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', ktra
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', ctype
-      WRITE(*,*) ' "   ": You should not have seen this print! error ?', kt
+      WRITE(*,*) 'trd_3d: You should not have seen this print! error ?', ptrd(1,1,1), ptra(1,1,1), pu(1,1,1),   &
+         &                                                               ktrd, ktra, ctype, kt
    END SUBROUTINE trd_tra
 #   endif
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 2715)
@@ -4,6 +4,6 @@
    !! Ocean diagnostics:  momentum trends
    !!=====================================================================
-   !! History :  9.0  !  04-06  (L. Brunier, A-M. Treguier) Original code 
-   !!                 !  04-08  (C. Talandier) New trends organization
+   !! History :  1.0  !  04-2006  (L. Brunier, A-M. Treguier) Original code 
+   !!            2.0  !  04-2008  (C. Talandier) New trends organization
    !!----------------------------------------------------------------------
 #if defined key_trdvor   ||   defined key_esopa
@@ -26,4 +26,5 @@
    USE ioipsl          ! NetCDF library
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -37,17 +38,18 @@
    PUBLIC   trd_vor_zint   ! routine called by dynamics routines
    PUBLIC   trd_vor_init   ! routine called by opa.F90
-
-   INTEGER ::   nh_t, nmoydpvor, nidvor, nhoridvor, ndexvor1(jpi*jpj), ndimvor1, icount   ! needs for IOIPSL output
+   PUBLIC   trd_vor_alloc  ! routine called by nemogcm.F90
+
+   INTEGER ::   nh_t, nmoydpvor, nidvor, nhoridvor, ndimvor1, icount   ! needs for IOIPSL output
+   INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) ::   ndexvor1   ! needed for IOIPSL output
    INTEGER ::   ndebug     ! (0/1) set it to 1 in case of problem to have more print
 
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avr      ! average
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avrb     ! before vorticity (kt-1)
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avrbb    ! vorticity at begining of the nwrite-1 timestep averaging period
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avrbn    ! after vorticity at time step after the
-   REAL(wp), DIMENSION(jpi,jpj) ::   rotot        ! begining of the NWRITE-1 timesteps
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avrtot   !
-   REAL(wp), DIMENSION(jpi,jpj) ::   vor_avrres   !
-
-   REAL(wp), DIMENSION(jpi,jpj,jpltot_vor) ::   vortrd  ! curl of trends
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avr      ! average
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrb     ! before vorticity (kt-1)
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbb    ! vorticity at begining of the nwrite-1 timestep averaging period
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbn    ! after vorticity at time step after the
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   rotot        ! begining of the NWRITE-1 timesteps
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrtot   !
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrres   !
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   vortrd       ! curl of trends
          
    CHARACTER(len=12) ::   cvort
@@ -63,4 +65,18 @@
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION trd_vor_alloc()
+      !!----------------------------------------------------------------------------
+      !!                  ***  ROUTINE trd_vor_alloc  ***
+      !!----------------------------------------------------------------------------
+      ALLOCATE( vor_avr   (jpi,jpj) , vor_avrb(jpi,jpj) , vor_avrbb (jpi,jpj) ,   &
+         &      vor_avrbn (jpi,jpj) , rotot   (jpi,jpj) , vor_avrtot(jpi,jpj) ,   &
+         &      vor_avrres(jpi,jpj) , vortrd  (jpi,jpj,jpltot_vor) ,              &
+         &      ndexvor1  (jpi*jpj)                                ,   STAT= trd_vor_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( trd_vor_alloc )
+      IF( trd_vor_alloc /= 0 )   CALL ctl_warn('trd_vor_alloc: failed to allocate arrays')
+   END FUNCTION trd_vor_alloc
+
 
    SUBROUTINE trd_vor_zint_2d( putrdvor, pvtrdvor, ktrd )
@@ -91,19 +107,23 @@
       !!      trends output in netCDF format using ioipsl
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zudpvor => wrk_2d_1 , zvdpvor => wrk_2d_2   ! total cmulative trends
+      !
       INTEGER                     , INTENT(in   ) ::   ktrd       ! ocean trend index
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   putrdvor   ! u vorticity trend 
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   pvtrdvor   ! v vorticity trend
-      !!
+      !
       INTEGER ::   ji, jj       ! dummy loop indices
       INTEGER ::   ikbu, ikbv   ! local integers
-      REAL(wp), DIMENSION(jpi,jpj) ::   zudpvor, zvdpvor   ! total cmulative trends
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('trd_vor_zint_2d: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! Initialization
-      zudpvor(:,:) = 0._wp
-      zvdpvor(:,:) = 0._wp
-      !
-      CALL lbc_lnk( putrdvor,  'U' , -1. )         ! lateral boundary condition on input momentum trends
-      CALL lbc_lnk( pvtrdvor,  'V' , -1. )
+      zudpvor(:,:) = 0._wp                 ;   zvdpvor(:,:) = 0._wp
+      CALL lbc_lnk( putrdvor, 'U', -1. )   ;   CALL lbc_lnk( pvtrdvor, 'V', -1. )      ! lateral boundary condition
+      
 
       !  =====================================
@@ -147,4 +167,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('trd_vor_zint_2d : failed to release workspace arrays.')
+      !
    END SUBROUTINE trd_vor_zint_2d
 
@@ -177,13 +199,19 @@
       !!      trends output in netCDF format using ioipsl
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zubet   => wrk_2d_1,   zvbet => wrk_2d_2   ! Beta.V 
+      USE wrk_nemo, ONLY:   zudpvor => wrk_2d_3, zvdpvor => wrk_2d_4   ! total cmulative trends
+      !
       INTEGER                         , INTENT(in   ) ::   ktrd       ! ocean trend index
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   putrdvor   ! u vorticity trend 
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   pvtrdvor   ! v vorticity trend
-      !!
-      INTEGER ::   ji, jj, jk
-      REAL(wp), DIMENSION(jpi,jpj) ::   zubet  , zvbet     ! Beta.V 
-      REAL(wp), DIMENSION(jpi,jpj) ::   zudpvor, zvdpvor   ! total cmulative trends
+      !
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
       !!----------------------------------------------------------------------
      
+      IF( wrk_in_use(2, 1,2,3,4) ) THEN
+         CALL ctl_stop('trd_vor_zint_3d: requested workspace arrays unavailable.')   ;   RETURN
+      ENDIF
+
       ! Initialization
       zubet  (:,:) = 0._wp
@@ -192,6 +220,6 @@
       zvdpvor(:,:) = 0._wp
       !
-      CALL lbc_lnk( putrdvor, 'U' , -1. )         ! lateral boundary condition on input momentum trends
-      CALL lbc_lnk( pvtrdvor, 'V' , -1. )
+      CALL lbc_lnk( putrdvor, 'U', -1. )         ! lateral boundary condition on input momentum trends
+      CALL lbc_lnk( pvtrdvor, 'V', -1. )
 
       !  =====================================
@@ -248,4 +276,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4) )   CALL ctl_stop('trd_vor_zint_3d: failed to release workspace arrays')
+      !
    END SUBROUTINE trd_vor_zint_3d
 
@@ -258,11 +288,17 @@
       !!               and make outputs (NetCDF or DIMG format)
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zun => wrk_2d_1 , zvn => wrk_2d_2 ! 2D workspace
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      !!
+      !
       INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
       INTEGER  ::   it, itmod        ! local integers
       REAL(wp) ::   zmean            ! local scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zun, zvn   ! 2D workspace
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('trd_vor: requested workspace arrays unavailable.')   ;   RETURN
+      ENDIF
 
       !  =================
@@ -431,4 +467,6 @@
       IF( kt == nitend )   CALL histclo( nidvor )
       !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('trd_vor: failed to release workspace arrays')
+      !
    END SUBROUTINE trd_vor
 
@@ -466,4 +504,7 @@
          WRITE(numout,*) ' '
       ENDIF
+
+      IF( trd_vor_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_vor_init : unable to allocate trdvor arrays' )
+
 
       ! cumulated trends array init
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90	(revision 2715)
@@ -4,5 +4,5 @@
    !! Ocean trends :   set vorticity trend variables
    !!======================================================================
-   !! History :  9.0  ! ???
+   !! History :  9.0  !  04-2006  (L. Brunier, A-M. Treguier) Original code 
    !!----------------------------------------------------------------------
 
@@ -14,9 +14,9 @@
 
 #if defined key_trdvor
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .TRUE.     !: momentum trend flag
+   LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .TRUE.    !: momentum trend flag
 #else
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .FALSE.    !: momentum trend flag
+   LOGICAL, PUBLIC, PARAMETER ::   lk_trdvor = .FALSE.   !: momentum trend flag
 #endif
-   !!* vorticity trends index
+   !                                               !!* vorticity trends index
    INTEGER, PUBLIC, PARAMETER ::   jpltot_vor = 11  !: Number of vorticity trend terms
    !
@@ -36,5 +36,5 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE trdvor_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90	(revision 2715)
@@ -7,8 +7,12 @@
    !!            3.2  !  2009-07  (G.Madec) addition of avm
    !!----------------------------------------------------------------------
-   USE par_oce         ! ocean parameters
+   USE par_oce        ! ocean parameters
+   USE in_out_manager ! I/O manager
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
    PRIVATE
+
+   PUBLIC  zdf_oce_alloc    ! Called in nemogcm.F90
 
 #if defined key_zdfcst   ||   defined key_esopa
@@ -33,14 +37,31 @@
 
 
-   REAL(wp), PUBLIC, DIMENSION        (jpk) ::   avmb , avtb    !: background profile of avm and avt
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   avtb_2d        !: set in tke_init, for other modif than ice
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   bfrua, bfrva   !: Bottom friction coefficients set in zdfbfr
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   avmu , avmv    !: vertical viscosity coef at uw- & vw-pts        [m2/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   avm  , avt     !: vertical viscosity & diffusivity coef at w-pt  [m2/s]
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:)     ::   avmb , avtb    !: background profile of avm and avt
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   avtb_2d        !: horizontal shape of background Kz profile
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   bfrua, bfrva   !: Bottom friction coefficients set in zdfbfr
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avmu , avmv    !: vertical viscosity coef at uw- & vw-pts       [m2/s]
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avm  , avt     !: vertical viscosity & diffusivity coef at w-pt [m2/s]
  
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION zdf_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!            *** FUNCTION zdf_oce_alloc ***
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE(avmb(jpk) , bfrua(jpi,jpj) ,                         &
+         &     avtb(jpk) , bfrva(jpi,jpj) , avtb_2d(jpi,jpj) ,      &
+         &     avmu(jpi,jpj,jpk), avm(jpi,jpj,jpk)           ,      &
+         &     avmv(jpi,jpj,jpk), avt(jpi,jpj,jpk)           , STAT = zdf_oce_alloc )
+         !
+      IF( zdf_oce_alloc /= 0 )   CALL ctl_warn('zdf_oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION zdf_oce_alloc
+
    !!======================================================================
 END MODULE zdf_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 2715)
@@ -28,5 +28,5 @@
    PUBLIC   zdf_bfr         ! called by step.F90
    PUBLIC   zdf_bfr_init    ! called by opa.F90
-   
+
    !                                    !!* Namelist nambfr: bottom friction namelist *
    INTEGER  ::   nn_bfr    = 0           ! = 0/1/2/3 type of bottom friction 
@@ -37,5 +37,5 @@
    LOGICAL  ::   ln_bfr2d  = .false.     ! logical switch for 2D enhancement
    
-   REAL(wp), DIMENSION(jpi,jpj) ::   bfrcoef2d = 1.e-3_wp   ! 2D bottom drag coefficient
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  bfrcoef2d   ! 2D bottom drag coefficient
 
    !! * Substitutions
@@ -43,9 +43,20 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_bfr_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION zdf_bfr_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( bfrcoef2d(jpi,jpj), STAT=zdf_bfr_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_bfr_alloc )
+      IF( zdf_bfr_alloc /= 0 )   CALL ctl_warn('zdf_bfr_alloc: failed to allocate arrays.')
+   END FUNCTION zdf_bfr_alloc
+
 
    SUBROUTINE zdf_bfr( kt )
@@ -143,6 +154,9 @@
       IF(lwp) WRITE(numout,*) '   Namelist nam_bfr : set bottom friction parameters'
 
+      !                              ! allocate zdfbfr arrays
+      IF( zdf_bfr_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_bfr_init : unable to allocate arrays' )
+
       SELECT CASE (nn_bfr)
-
+      !
       CASE( 0 )
          IF(lwp) WRITE(numout,*) '      free-slip '
@@ -165,5 +179,5 @@
             CALL iom_get (inum, jpdom_data, 'bfr_coef',bfrcoef2d,1) ! bfrcoef2d is used as tmp array
             CALL iom_close(inum)
-            bfrcoef2d(:,:)= rn_bfri1 * ( 1 + rn_bfrien * bfrcoef2d(:,:) )
+            bfrcoef2d(:,:) = rn_bfri1 * ( 1 + rn_bfrien * bfrcoef2d(:,:) )
          ENDIF
          bfrua(:,:) = - bfrcoef2d(:,:)
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 2715)
@@ -21,4 +21,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
+   USE lib_mpp            ! MPP library
 
    IMPLICIT NONE
@@ -27,9 +28,10 @@
    PUBLIC   zdf_ddm       ! called by step.F90
    PUBLIC   zdf_ddm_init  ! called by opa.F90
+   PUBLIC   zdf_ddm_alloc ! called by nemogcm.F90
 
    LOGICAL , PUBLIC, PARAMETER ::   lk_zdfddm = .TRUE.  !: double diffusive mixing flag
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   avs    !: salinity vertical diffusivity coeff. at w-point
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rrau   !: heat/salt buoyancy flux ratio
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avs    !: salinity vertical diffusivity coeff. at w-point
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   rrau   !: heat/salt buoyancy flux ratio
 
    !                                  !!* Namelist namzdf_ddm : double diffusive mixing *
@@ -40,10 +42,20 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_ddm_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE zdf_ddm_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( avs(jpi,jpj,jpk), rrau(jpi,jpj,jpk), STAT= zdf_ddm_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_ddm_alloc )
+      IF( zdf_ddm_alloc /= 0 )   CALL ctl_warn('zdf_ddm_alloc: failed to allocate arrays')
+   END FUNCTION zdf_ddm_alloc
+
 
    SUBROUTINE zdf_ddm( kt )
@@ -79,12 +91,19 @@
       !! References :   Merryfield et al., JPO, 29, 1124-1142, 1999.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zmsks  => wrk_2d_1 , zmskf  => wrk_2d_2 , zmskd1 => wrk_2d_3   ! 2D workspace
+      USE wrk_nemo, ONLY:   zmskd2 => wrk_2d_4 , zmskd3 => wrk_2d_5                        !  -      -
+      !
       INTEGER, INTENT(in) ::   kt   ! ocean time-step indexocean time step
-      !!
+      !
       INTEGER  ::   ji, jj , jk     ! dummy loop indices
       REAL(wp) ::   zinr, zrr       ! temporary scalars
       REAL(wp) ::   zavft, zavfs    !    -         -
       REAL(wp) ::   zavdt, zavds    !    -         -
-      REAL(wp), DIMENSION(jpi,jpj) ::   zmsks, zmskf, zmskd1, zmskd2, zmskd3   ! 2D workspace 
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5) ) THEN
+         CALL ctl_stop('zdf_ddm: Requested workspace arrays already in use')   ;   RETURN
+      ENDIF
 
       !                                                ! ===============
@@ -98,23 +117,23 @@
             DO ji = 1, jpi
                ! stability indicator: msks=1 if rn2>0; 0 elsewhere
-               IF( rn2(ji,jj,jk) + 1.e-12  <= 0. ) THEN   ;   zmsks(ji,jj) = 0.e0
-               ELSE                                       ;   zmsks(ji,jj) = 1.e0
+               IF( rn2(ji,jj,jk) + 1.e-12  <= 0. ) THEN   ;   zmsks(ji,jj) = 0._wp
+               ELSE                                       ;   zmsks(ji,jj) = 1._wp
                ENDIF
                ! salt fingering indicator: msksf=1 if rrau>1; 0 elsewhere            
-               IF( rrau(ji,jj,jk) <= 1.          ) THEN   ;   zmskf(ji,jj) = 0.e0
-               ELSE                                       ;   zmskf(ji,jj) = 1.e0
+               IF( rrau(ji,jj,jk) <= 1.          ) THEN   ;   zmskf(ji,jj) = 0._wp
+               ELSE                                       ;   zmskf(ji,jj) = 1._wp
                ENDIF
                ! diffusive layering indicators: 
                !     ! mskdl1=1 if 0<rrau<1; 0 elsewhere
-               IF( rrau(ji,jj,jk) >= 1.          ) THEN   ;   zmskd1(ji,jj) = 0.e0
-               ELSE                                       ;   zmskd1(ji,jj) = 1.e0
+               IF( rrau(ji,jj,jk) >= 1.          ) THEN   ;   zmskd1(ji,jj) = 0._wp
+               ELSE                                       ;   zmskd1(ji,jj) = 1._wp
                ENDIF
                !     ! mskdl2=1 if 0<rrau<0.5; 0 elsewhere
-               IF( rrau(ji,jj,jk) >= 0.5         ) THEN   ;   zmskd2(ji,jj) = 0.e0
-               ELSE                                       ;   zmskd2(ji,jj) = 1.e0
+               IF( rrau(ji,jj,jk) >= 0.5         ) THEN   ;   zmskd2(ji,jj) = 0._wp
+               ELSE                                       ;   zmskd2(ji,jj) = 1._wp
                ENDIF
                !   mskdl3=1 if 0.5<rrau<1; 0 elsewhere
-               IF( rrau(ji,jj,jk) <= 0.5 .OR. rrau(ji,jj,jk) >= 1. ) THEN   ;   zmskd3(ji,jj) = 0.e0
-               ELSE                                                         ;   zmskd3(ji,jj) = 1.e0
+               IF( rrau(ji,jj,jk) <= 0.5 .OR. rrau(ji,jj,jk) >= 1. ) THEN   ;   zmskd3(ji,jj) = 0._wp
+               ELSE                                                         ;   zmskd3(ji,jj) = 1._wp
                ENDIF
             END DO
@@ -166,9 +185,9 @@
       !                                                   ! ===============
       !
-      CALL lbc_lnk( avt , 'W', 1. )        ! Lateral boundary conditions   (unchanged sign)
-      CALL lbc_lnk( avs , 'W', 1. )
-      CALL lbc_lnk( avm , 'W', 1. )
-      CALL lbc_lnk( avmu, 'U', 1. ) 
-      CALL lbc_lnk( avmv, 'V', 1. )
+      CALL lbc_lnk( avt , 'W', 1._wp )     ! Lateral boundary conditions   (unchanged sign)
+      CALL lbc_lnk( avs , 'W', 1._wp )
+      CALL lbc_lnk( avm , 'W', 1._wp )
+      CALL lbc_lnk( avmu, 'U', 1._wp ) 
+      CALL lbc_lnk( avmv, 'V', 1._wp )
 
       IF(ln_ctl) THEN
@@ -178,4 +197,6 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3,4,5) )   CALL ctl_stop('zdf_ddm: Release of workspace arrays failed')
+      !
    END SUBROUTINE zdf_ddm
    
@@ -193,6 +214,6 @@
       !!----------------------------------------------------------------------
       !
-      REWIND ( numnam )               ! Read Namelist namzdf_ddm : double diffusion mixing scheme
-      READ   ( numnam, namzdf_ddm )
+      REWIND( numnam )                ! Read Namelist namzdf_ddm : double diffusion mixing scheme
+      READ  ( numnam, namzdf_ddm )
       !
       IF(lwp) THEN                    ! Parameter print
@@ -203,6 +224,8 @@
          WRITE(numout,*) '      maximum avs for dd mixing      rn_avts   = ', rn_avts
          WRITE(numout,*) '      heat/salt buoyancy flux ratio  rn_hsbfr  = ', rn_hsbfr
-         WRITE(numout,*)
       ENDIF
+      !
+      !                              ! allocate zdfddm arrays
+      IF( zdf_ddm_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_ddm_init : unable to allocate arrays' )
       !
    END SUBROUTINE zdf_ddm_init
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm_substitute.h90	(revision 2715)
@@ -4,9 +4,4 @@
    !! ** purpose :   substitute fsaht. the eddy diffusivity coeff.
    !!      with a constant or 1D or 2D or 3D array, using CPP macro.
-   !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 #if defined key_zdfddm
@@ -17,2 +12,7 @@
 #   define   fsavs(i,j,k)   avt(i,j,k)
 #endif
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 2715)
@@ -31,9 +31,8 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -53,10 +52,9 @@
       !! References :   Lazar, A., these de l'universite Paris VI, France, 1997
       !!----------------------------------------------------------------------
-      USE oce,   zavt_evd  =>   ua          ! use ua as workspace
-      USE oce,   zavm_evd  =>   va          ! use va as workspace
-      !!
-      INTEGER, INTENT( in ) ::   kt         ! ocean time-step indexocean time step
-      !!
-      INTEGER ::   ji, jj, jk               ! dummy loop indices
+      USE oce,   zavt_evd => ua , zavm_evd => va  ! (ua,va) used ua workspace
+      !
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step indexocean time step
+      !
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
       !!----------------------------------------------------------------------
 
@@ -71,7 +69,7 @@
 
       SELECT CASE ( nn_evdm )
- 
+      !
       CASE ( 1 )           ! enhance vertical eddy viscosity and diffusivity (if rn2<-1.e-12)
-
+         !
          zavm_evd(:,:,:) = avm(:,:,:)           ! set avm prior to evd application
          !
@@ -86,7 +84,7 @@
 #if defined key_zdfkpp
                   ! no evd mixing in the boundary layer with KPP
-                  IF( ( MIN( rn2(ji,jj,jk),  rn2b(ji,jj,jk) ) <= -1.e-12 ) .AND. ( fsdepw(ji,jj,jk) > hkpp(ji,jj) ) ) THEN
+                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12  .AND.  fsdepw(ji,jj,jk) > hkpp(ji,jj)  ) THEN
 #else
-                  IF(   MIN( rn2(ji,jj,jk),  rn2b(ji,jj,jk) ) <= -1.e-12 ) THEN
+                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) THEN
 #endif
                      avt (ji  ,jj  ,jk) = rn_avevd * tmask(ji  ,jj  ,jk)
@@ -100,5 +98,5 @@
             END DO
          END DO 
-         CALL lbc_lnk( avt , 'W', 1. )   ;   CALL lbc_lnk( avm , 'W', 1. )   ! Lateral boundary conditions   (unchanged sign)
+         CALL lbc_lnk( avt , 'W', 1. )   ;   CALL lbc_lnk( avm , 'W', 1. )   ! Lateral boundary conditions
          CALL lbc_lnk( avmu, 'U', 1. )   ;   CALL lbc_lnk( avmv, 'V', 1. )
          !
@@ -118,7 +116,7 @@
 #if defined key_zdfkpp
                   ! no evd mixing in the boundary layer with KPP
-                  IF( ( MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) .AND. ( fsdepw(ji,jj,jk) > hkpp(ji,jj) ) ) &          
+                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12  .AND.  fsdepw(ji,jj,jk) > hkpp(ji,jj)  )   &          
 #else
-                  IF(   MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) &
+                  IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 )   &
 #endif
                      avt(ji,jj,jk) = rn_avevd * tmask(ji,jj,jk)
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 2715)
@@ -25,4 +25,5 @@
    USE restart        ! only for lrst_oce
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp        ! MPP manager
    USE prtctl         ! Print control
    USE in_out_manager ! I/O manager
@@ -36,10 +37,11 @@
    PUBLIC   gls_rst        ! routine called in step module
 
-   LOGICAL , PUBLIC, PARAMETER              ::   lk_zdfgls = .TRUE.  !: TKE vertical mixing flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   en                  !: now turbulent kinetic energy
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mxln                !: now mixing length
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   zwall               !: wall function
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ustars2             !: Squared surface velocity scale at T-points
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ustarb2             !: Squared bottom  velocity scale at T-points
+   LOGICAL , PUBLIC, PARAMETER ::   lk_zdfgls = .TRUE.   !: TKE vertical mixing flag
+   !
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   en      !: now turbulent kinetic energy
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   mxln    !: now mixing length
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zwall   !: wall function
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustars2 !: Squared surface velocity scale at T-points
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustarb2 !: Squared bottom  velocity scale at T-points
 
    !                                         !!! ** Namelist  namzdf_gls  **
@@ -105,8 +107,20 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id $
+   !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_gls_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION zdf_gls_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( en(jpi,jpj,jpk),  mxln(jpi,jpj,jpk), zwall(jpi,jpj,jpk) ,     &
+         &      ustars2(jpi,jpj), ustarb2(jpi,jpj)                      , STAT= zdf_gls_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_gls_alloc )
+      IF( zdf_gls_alloc /= 0 )   CALL ctl_warn('zdf_gls_alloc: failed to allocate arrays')
+   END FUNCTION zdf_gls_alloc
+
 
    SUBROUTINE zdf_gls( kt )
@@ -121,4 +135,13 @@
       USE oce,     z_elem_c  =>   ta   ! use ta as workspace
       USE oce,     psi       =>   sa   ! use sa as workspace
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zdep  => wrk_2d_1
+      USE wrk_nemo, ONLY: zflxs => wrk_2d_2     ! Turbulence fluxed induced by internal waves 
+      USE wrk_nemo, ONLY: zhsro => wrk_2d_3     ! Surface roughness (surface waves)
+      USE wrk_nemo, ONLY: eb        => wrk_3d_1   ! tke at time before
+      USE wrk_nemo, ONLY: mxlb      => wrk_3d_2   ! mixing length at time before
+      USE wrk_nemo, ONLY: shear     => wrk_3d_3   ! vertical shear
+      USE wrk_nemo, ONLY: eps       => wrk_3d_4   ! dissipation rate
+      USE wrk_nemo, ONLY: zwall_psi => wrk_3d_5   ! Wall function use in the wb case (ln_sigpsi.AND.ln_crban=T)
       !
       INTEGER, INTENT(in) ::   kt ! ocean time step
@@ -129,13 +152,9 @@
       REAL(wp) ::   prod, buoy, diss, zdiss, sm         !   -      -
       REAL(wp) ::   gh, gm, shr, dif, zsqen, zav        !   -      -
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdep        !
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zflxs       ! Turbulence fluxed induced by internal waves 
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zhsro       ! Surface roughness (surface waves)
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   eb          ! tke at time before
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   mxlb        ! mixing length at time before
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   shear       ! vertical shear
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   eps         ! dissipation rate
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwall_psi   ! Wall function use in the wb case (ln_sigpsi.AND.ln_crban=T)
       !!--------------------------------------------------------------------
+
+      IF(  wrk_in_use(2, 1,2,3)  .OR.  wrk_in_use(3, 1,2,3,4,5)  ) THEN
+         CALL ctl_stop('zdf_gls: requested workspace arrays unavailable.')   ;   RETURN
+      END IF
 
       ! Preliminary computing
@@ -864,4 +883,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2,3)     .OR. &
+          wrk_not_released(3, 1,2,3,4,5)  )   CALL ctl_stop('zdf_gls: failed to release workspace arrays')
+      !
    END SUBROUTINE zdf_gls
 
@@ -896,6 +918,6 @@
       !!----------------------------------------------------------
 
-      REWIND ( numnam )                !* Read Namelist namzdf_gls
-      READ   ( numnam, namzdf_gls )
+      REWIND( numnam )                 !* Read Namelist namzdf_gls
+      READ  ( numnam, namzdf_gls )
 
       IF(lwp) THEN                     !* Control print
@@ -923,4 +945,7 @@
       ENDIF
 
+      !                                !* allocate gls arrays
+      IF( zdf_gls_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_gls_init : unable to allocate arrays' )
+
       !                                !* Check of some namelist values
       IF( nn_tkebc_surf < 0 .OR. nn_tkebc_surf > 1 ) CALL ctl_stop( 'bad flag: nn_tkebc_surf is 0 or 1' )
@@ -931,10 +956,7 @@
       IF( nn_clos       < 0 .OR. nn_clos       > 3 ) CALL ctl_stop( 'bad flag: nn_clos is 0, 1, 2 or 3' )
 
-      ! Initialisation of the parameters for the choosen closure
-      ! --------------------------------------------------------
-      !
-      SELECT CASE ( nn_clos )
-      !
-      CASE( 0 )               ! k-kl  (Mellor-Yamada)
+      SELECT CASE ( nn_clos )          !* set the parameters for the chosen closure
+      !
+      CASE( 0 )                              ! k-kl  (Mellor-Yamada)
          !
          IF(lwp) WRITE(numout,*) 'The choosen closure is k-kl closed to the classical Mellor-Yamada'
@@ -954,5 +976,5 @@
          END SELECT
          !
-      CASE( 1 )               ! k-eps
+      CASE( 1 )                              ! k-eps
          !
          IF(lwp) WRITE(numout,*) 'The choosen closure is k-eps'
@@ -972,5 +994,5 @@
          END SELECT
          !
-      CASE( 2 )               ! k-omega
+      CASE( 2 )                              ! k-omega
          !
          IF(lwp) WRITE(numout,*) 'The choosen closure is k-omega'
@@ -990,5 +1012,5 @@
          END SELECT
          !
-      CASE( 3 )               ! generic
+      CASE( 3 )                              ! generic
          !
          IF(lwp) WRITE(numout,*) 'The choosen closure is generic'
@@ -1010,10 +1032,8 @@
       END SELECT
 
-      ! Initialisation of the parameters of the stability functions
-      ! -----------------------------------------------------------
-      !
-      SELECT CASE ( nn_stab_func )
-      !
-      CASE ( 0 )             ! Galperin stability functions
+      !
+      SELECT CASE ( nn_stab_func )     !* set the parameters of the stability functions
+      !
+      CASE ( 0 )                             ! Galperin stability functions
          !
          IF(lwp) WRITE(numout,*) 'Stability functions from Galperin'
@@ -1027,5 +1047,5 @@
          rghcri  =  0.02_wp
          !
-      CASE ( 1 )             ! Kantha-Clayson stability functions
+      CASE ( 1 )                             ! Kantha-Clayson stability functions
          !
          IF(lwp) WRITE(numout,*) 'Stability functions from Kantha-Clayson'
@@ -1039,5 +1059,5 @@
          rghcri  =  0.02_wp
          !
-      CASE ( 2 )             ! Canuto A stability functions
+      CASE ( 2 )                             ! Canuto A stability functions
          !
          IF(lwp) WRITE(numout,*) 'Stability functions from Canuto A'
@@ -1063,5 +1083,5 @@
          rghcri  =  0.03_wp
          !
-      CASE ( 3 )             ! Canuto B stability functions
+      CASE ( 3 )                             ! Canuto B stability functions
          !
          IF(lwp) WRITE(numout,*) 'Stability functions from Canuto B'
@@ -1088,7 +1108,7 @@
       END SELECT
     
-      ! Set Schmidt number for psi diffusion in the wave breaking case
-      ! See equation 13 of Carniel et al, Ocean modelling, 30, 225-239, 2009
-      ! or equation (17) of Burchard, JPO, 31, 3133-3145, 2001
+      !                                !* Set Schmidt number for psi diffusion in the wave breaking case
+      !                                     ! See Eq. (13) of Carniel et al, OM, 30, 225-239, 2009
+      !                                     !  or Eq. (17) of Burchard, JPO, 31, 3133-3145, 2001
       IF( ln_sigpsi .AND. ln_crban ) THEN
          zcr = SQRT( 1.5_wp*rsc_tke ) * rcm_sf / vkarmn
@@ -1100,5 +1120,5 @@
       ENDIF
  
-      ! Shear free turbulence parameters:
+      !                                !* Shear free turbulence parameters
       !
       ra_sf  = -4._wp * rnn * SQRT( rsc_tke ) / ( (1._wp+4._wp*rmm) * SQRT( rsc_tke )   &
@@ -1111,5 +1131,5 @@
 
       !
-      IF(lwp) THEN      ! Control print
+      IF(lwp) THEN                     !* Control print
          WRITE(numout,*)
          WRITE(numout,*) 'Limit values'
@@ -1134,5 +1154,5 @@
       ENDIF
 
-      ! Constants initialization
+      !                                !* Constants initialization
       rc02  = rc0  * rc0   ;   rc02r = 1. / rc02
       rc03  = rc02 * rc0
@@ -1161,6 +1181,6 @@
          avmv(:,:,jk) = avmb(jk) * vmask(:,:,jk)
       END DO
-      !                                !* read or initialize all required files 
-      CALL gls_rst( nit000, 'READ' )
+      !                              
+      CALL gls_rst( nit000, 'READ' )   !* read or initialize all required files
       !
    END SUBROUTINE zdf_gls_init
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 2715)
@@ -37,9 +37,8 @@
    
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-   
 CONTAINS
 
@@ -110,5 +109,5 @@
          ioptio = ioptio+1
       ENDIF
-      IF( ioptio == 0 .OR. ioptio > 1 .AND. .NOT. lk_esopa ) &
+      IF( ioptio == 0 .OR. ioptio > 1 .AND. .NOT. lk_esopa )   &
          &   CALL ctl_stop( ' one and only one vertical diffusion option has to be defined ' )
       !
@@ -139,8 +138,7 @@
       ENDIF
       IF ( ioptio > 1 .AND. .NOT. lk_esopa )   CALL ctl_stop( ' chose between ln_zdfnpc and ln_zdfevd' )
-      IF( ioptio == 0 .AND. .NOT.( lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp ) ) &
-         CALL ctl_stop( ' except for TKE, GLS or KPP physics, a convection scheme is', &
+      IF( ioptio == 0 .AND. .NOT.( lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp ) )           &
+         CALL ctl_stop( ' except for TKE, GLS or KPP physics, a convection scheme is',   &
          &              ' required: ln_zdfevd or ln_zdfnpc logicals' )
-
 
       !                               !* Background eddy viscosity and diffusivity profil
@@ -150,6 +148,6 @@
       ELSE                                  ! Background profile of avt (fit a theoretical/observational profile (Krauss 1990)
          avmb(:) = rn_avm0
-         avtb(:) = rn_avt0 + ( 3.0e-4 - 2 * rn_avt0 ) * 1.0e-4 * gdepw_0(:)   ! m2/s
-         IF(ln_sco .AND. lwp)   CALL ctl_warn( '          avtb profile not valid in sco' )
+         avtb(:) = rn_avt0 + ( 3.e-4_wp - 2._wp * rn_avt0 ) * 1.e-4_wp * gdepw_0(:)   ! m2/s
+         IF(ln_sco .AND. lwp)   CALL ctl_warn( 'avtb profile not valid in sco' )
       ENDIF
       !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 2715)
@@ -9,5 +9,5 @@
    !!            8.2  ! 2003-10 (Chanut J.) re-writting
    !!   NEMO     1.0  ! 2005-01 (C. Ethe, G. Madec) Free form, F90 + creation of tra_kpp routine
-   !!            3.3  ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA
+   !!            3.3  ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA
    !!----------------------------------------------------------------------
 #if defined key_zdfkpp   ||   defined key_esopa
@@ -28,4 +28,5 @@
    USE zdfddm          ! double diffusion mixing
    USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! MPP library
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE prtctl          ! Print control
@@ -39,14 +40,12 @@
    PUBLIC   zdf_kpp_init  ! routine called by opa.F90
    PUBLIC   tra_kpp       ! routine called by step.F90
-#if defined key_top
    PUBLIC   trc_kpp       ! routine called by trcstp.F90
-#endif
 
    LOGICAL , PUBLIC, PARAMETER ::   lk_zdfkpp = .TRUE.    !: KPP vertical mixing flag
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   ghats    !: non-local scalar mixing term (gamma/<ws>o)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   wt0      !: surface temperature flux for non local flux
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ws0      !: surface salinity flux for non local flux
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   hkpp     !: boundary layer depht
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ghats    !: non-local scalar mixing term (gamma/<ws>o)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   wt0      !: surface temperature flux for non local flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ws0      !: surface salinity flux for non local flux
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   hkpp     !: boundary layer depth
 
    !                                        !!* Namelist namzdf_kpp *
@@ -99,5 +98,5 @@
 
 #if ! defined key_kppcustom
-   REAL(wp), DIMENSION(jpk,jpk) ::   del     ! array for reference mean values of vertical integration 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   del     ! array for reference mean values of vertical integration 
 #endif
 
@@ -119,5 +118,5 @@
    REAL(wp) ::   deustar                 ! delta ustar in lookup table
 #endif
-   REAL(wp), DIMENSION(jpk) ::   ratt   ! attenuation coef  (already defines in module traqsr, 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   ratt   ! attenuation coef  (already defines in module traqsr, 
    !                                    ! but only if the solar radiation penetration is considered)
    
@@ -128,13 +127,12 @@
       !                           ! (default values: water type Ib) 
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   etmean, eumean, evmean   ! coeff. used for hor. smoothing at t-, u- & v-points
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   etmean, eumean, evmean   ! coeff. used for hor. smoothing at t-, u- & v-points
         
- 
 #if defined key_c1d
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rig    !: gradient Richardson number
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rib    !: bulk Richardson number
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   buof   !: buoyancy forcing
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   mols   !: moning-Obukhov length scale 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   ekdp   !: Ekman depth
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rig    !: gradient Richardson number
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rib    !: bulk Richardson number
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   buof   !: buoyancy forcing
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   mols   !: moning-Obukhov length scale 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ekdp   !: Ekman depth
 #endif
 
@@ -146,10 +144,30 @@
 #  include  "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION zdf_kpp_alloc()
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION zdf_kpp_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( ghats(jpi,jpj,jpk), wt0(jpi,jpj), ws0(jpi,jpj), hkpp(jpi,jpj), &
+#if ! defined key_kpplktb
+         &      del(jpk,jpk),                                                  &
+#endif
+         &      ratt(jpk),                                                     &
+         &      etmean(jpi,jpj,jpk), eumean(jpi,jpj,jpk), evmean(jpi,jpj,jpk), &
+#if defined key_c1d
+         &      rig (jpi,jpj,jpk), rib(jpi,jpj,jpk), buof(jpi,jpj,jpk),        &
+         &      mols(jpi,jpj,jpk), ekdp(jpi,jpj),                              &
+#endif
+         &      STAT= zdf_kpp_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_kpp_alloc )
+      IF( zdf_kpp_alloc /= 0 )   CALL ctl_warn('zdf_kpp_alloc: failed to allocate arrays')
+   END FUNCTION zdf_kpp_alloc
+
 
    SUBROUTINE zdf_kpp( kt )
@@ -196,4 +214,21 @@
       USE oce     , zdiffut => ta   ! temp. array for diffusivities use sa as workspace
 #endif
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released, wrk_in_use_xz, wrk_not_released_xz
+      USE wrk_nemo, ONLY: zBo    => wrk_2d_1, &  ! Surface buoyancy forcing,
+                          zBosol => wrk_2d_2, &  ! friction velocity
+                          zustar => wrk_2d_3
+      USE wrk_nemo, ONLY: zmask  => wrk_2d_4
+!gm      USE wrk_nemo, ONLY: wrk_2d_5, wrk_2d_6, wrk_2d_7, wrk_2d_8, wrk_2d_9, &
+      USE wrk_nemo, ONLY:           wrk_2d_6, wrk_2d_7, wrk_2d_8, wrk_2d_9, &
+                          wrk_2d_10,wrk_2d_11
+      USE wrk_nemo, ONLY: wrk_1d_1,  wrk_1d_2,  wrk_1d_3,  wrk_1d_4,  &
+                          wrk_1d_5,  wrk_1d_6,  wrk_1d_7,  wrk_1d_8,  &
+                          wrk_1d_9,  wrk_1d_10, wrk_1d_11, wrk_1d_12, &
+                          wrk_1d_13, wrk_1d_14
+      USE wrk_nemo, ONLY: zblcm => wrk_xz_1, &   ! Boundary layer 
+                          zblct => wrk_xz_2      !  diffusivities/viscosities
+#if defined key_zdfddm
+      USE wrk_nemo, ONLY: zblcs => wrk_xz_3
+#endif
       !!
       INTEGER, INTENT( in  ) ::   kt   ! ocean time step
@@ -202,5 +237,4 @@
       INTEGER ::   ikbot, jkmax, jkm1, jkp2   !
 
-      REAL(wp), DIMENSION(jpi,jpj) ::   zBo, zBosol, zustar         ! Surface buoyancy forcing, friction velocity
       REAL(wp) ::   ztx, zty, zflageos, zstabl, zbuofdep,zucube     !
       REAL(wp) ::   zrhos, zalbet, zbeta, zthermal, zhalin, zatt1   !
@@ -221,25 +255,54 @@
       REAL(wp) ::   zflag, ztemp, zrn2, zdep21, zdep32, zdep43
       REAL(wp) ::   zdku2, zdkv2, ze3sqr, zsh2, zri, zfri          ! Interior richardson mixing
-      REAL(wp), DIMENSION(jpi,0:2) ::   zmoek                      ! Moning-Obukov limitation
-      REAL(wp), DIMENSION(jpi)     ::   zmoa, zekman                
-      REAL(wp)                     ::   zmob, zek
-      REAL(wp), DIMENSION(jpi,4)   ::   zdepw, zdift, zvisc   ! The pipe 
-      REAL(wp), DIMENSION(jpi,3)   ::   zdept
-      REAL(wp), DIMENSION(jpi,2)   ::   zriblk
-      REAL(wp), DIMENSION(jpi,jpk) ::   zmask                          
-      REAL(wp), DIMENSION(jpi)     ::   zhmax, zria, zhbl 
+!gm      REAL(wp), POINTER, DIMENSION(:,:) ::   zmoek                 ! Moning-Obukov limitation
+      REAL(wp), DIMENSION(jpi,0:2) ::   zmoek                 ! Moning-Obukov limitation
+      REAL(wp), POINTER, DIMENSION(:)   ::   zmoa, zekman                
+      REAL(wp)                          ::   zmob, zek
+      REAL(wp), POINTER, DIMENSION(:,:) ::   zdepw, zdift, zvisc   ! The pipe 
+      REAL(wp), POINTER, DIMENSION(:,:) ::   zdept
+      REAL(wp), POINTER, DIMENSION(:,:) ::   zriblk
+      REAL(wp), POINTER, DIMENSION(:)   ::   zhmax, zria, zhbl 
       REAL(wp) ::   zflagri, zflagek, zflagmo, zflagh, zflagkb   !
-      REAL(wp), DIMENSION(jpi)     ::   za2m, za3m, zkmpm, za2t, za3t, zkmpt   ! Shape function (G)
+      REAL(wp), POINTER, DIMENSION(:)   ::   za2m, za3m, zkmpm, za2t, za3t, zkmpt   ! Shape function (G)
       REAL(wp) ::   zdelta, zdelta2, zdzup, zdzdn, zdzh, zvath, zgat1, zdat1, zkm1m, zkm1t
-      REAL(wp), DIMENSION(jpi,jpk) ::   zblcm, zblct   ! Boundary layer diffusivities/viscosities
 #if defined key_zdfddm
       REAL(wp) ::   zrrau, zds, zavdds, zavddt,zinr   ! double diffusion mixing
-      REAL(wp), DIMENSION(jpi,4) ::     zdifs
-      REAL(wp), DIMENSION(jpi)     ::   za2s, za3s, zkmps
+      REAL(wp), POINTER, DIMENSION(:,:) ::     zdifs
+      REAL(wp), POINTER, DIMENSION(:)   ::   za2s, za3s, zkmps
       REAL(wp) ::                       zkm1s
-      REAL(wp), DIMENSION(jpi,jpk) ::   zblcs                     
 #endif
       !!--------------------------------------------------------------------
      
+      IF( wrk_in_use(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14) .OR.   &
+          wrk_in_use(2, 1,2,3,4,5,6,7,8,9,10,11)          .OR.   &
+          wrk_in_use_xz(1,2,3)                              ) THEN
+         CALL ctl_stop('zdf_kpp : requested workspace arrays unavailable.')   ;   RETURN
+      ENDIF
+      ! Set-up pointers to 2D spaces
+!gm      zmoek(1:jpi,0:2) => wrk_2d_5(1:jpi,1:3)
+      zdepw => wrk_2d_6(:,1:4)
+      zdift => wrk_2d_7(:,1:4)
+      zvisc => wrk_2d_8(:,1:4)
+      zdept => wrk_2d_9(:,1:3)
+      zriblk => wrk_2d_10(:,1:2)
+      ! 1D spaces
+      zmoa   => wrk_1d_1(1:jpi)
+      zekman => wrk_1d_2(1:jpi)
+      zhmax  => wrk_1d_3(1:jpi)
+      zria   => wrk_1d_4(1:jpi)
+      zhbl   => wrk_1d_5(1:jpi)
+      za2m   => wrk_1d_6(1:jpi)
+      za3m   => wrk_1d_7(1:jpi)
+      zkmpm  => wrk_1d_8(1:jpi)
+      za2t   => wrk_1d_9(1:jpi)
+      za3t   => wrk_1d_10(1:jpi)
+      zkmpt  => wrk_1d_11(1:jpi)
+#if defined key_zdfddm
+      zdifs => wrk_2d_11(:,1:4)
+      za2s  => wrk_1d_12(1:jpi)
+      za3s  => wrk_1d_13(1:jpi)
+      zkmps => wrk_1d_14(1:jpi)
+#endif
+
       zviscos(:,:,:) = 0.
       zblcm  (:,:  ) = 0. 
@@ -1171,4 +1234,9 @@
          ENDIF
 
+      IF( wrk_not_released(1, 1,2,3,4,5,6,7,8,9,10,11,12,13,14) .OR.   &
+          wrk_not_released(2, 1,2,3,4,5,6,7,8,9,10,11)          .OR.   &
+          wrk_not_released_xz(1,2,3)                               )   &
+          CALL ctl_stop('zdf_kpp : failed to release workspace arrays')
+      !
    END SUBROUTINE zdf_kpp
 
@@ -1248,7 +1316,7 @@
       USE trc
       USE prtctl_trc          ! Print control
-      !! * Arguments
-      INTEGER ,                         INTENT( in    )  :: kt     ! ocean time-step index
-      !! * Local declarations
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
       INTEGER  ::   ji, jj, jk, jn      ! Dummy loop indices
       REAL(wp) ::   ztra, zflx
@@ -1293,4 +1361,13 @@
       !
    END SUBROUTINE trc_kpp
+
+#else
+   !!----------------------------------------------------------------------
+   !!   NO 'key_top'           DUMMY routine                  No TOP models
+   !!----------------------------------------------------------------------
+   SUBROUTINE trc_kpp( kt )         ! Dummy routine
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      WRITE(*,*) 'tra_kpp: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_kpp
 #endif
 
@@ -1340,4 +1417,7 @@
       ENDIF
 
+      !                              ! allocate zdfkpp arrays
+      IF( zdf_kpp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_kpp_init : unable to allocate arrays' )
+
       ll_kppcustom = .FALSE.
       ll_kpplktb   = .FALSE.
@@ -1362,5 +1442,4 @@
       ENDIF
       
-         
 
       !set constants not in namelist
@@ -1516,4 +1595,5 @@
       END DO
 #endif
+      !
    END SUBROUTINE zdf_kpp_init
 
@@ -1533,10 +1613,8 @@
       WRITE(*,*) 'tra_kpp: You should not have seen this print! error?', kt
    END SUBROUTINE tra_kpp
-#if defined key_top
    SUBROUTINE trc_kpp( kt )          ! Dummy routine
       WRITE(*,*) 'trc_kpp: You should not have seen this print! error?', kt
    END SUBROUTINE trc_kpp
 #endif
-#endif
 
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90	(revision 2715)
@@ -14,25 +14,36 @@
    USE in_out_manager  ! I/O manager
    USE prtctl          ! Print control
-   USE iom
+   USE iom             ! I/O library
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   zdf_mxl    ! called by step.F90
+   PUBLIC   zdf_mxl       ! called by step.F90
 
-   INTEGER , PUBLIC, DIMENSION(jpi,jpj) ::   nmln    !: number of level in the mixed layer (used by TOP)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hmld    !: mixing layer depth (turbocline)      [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hmlp    !: mixed layer depth  (rho=rho0+zdcrit) [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   hmlpt   !: mixed layer depth at t-points        [m]
+   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   nmln    !: number of level in the mixed layer (used by TOP)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmld    !: mixing layer depth (turbocline)      [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlp    !: mixed layer depth  (rho=rho0+zdcrit) [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmlpt   !: mixed layer depth at t-points        [m]
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
+CONTAINS
 
-CONTAINS
+   INTEGER FUNCTION zdf_mxl_alloc()
+      !!----------------------------------------------------------------------
+      !!               ***  FUNCTION zdf_mxl_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), STAT= zdf_mxl_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_mxl_alloc )
+      IF( zdf_mxl_alloc /= 0 )   CALL ctl_warn('zdf_mxl_alloc: failed to allocate arrays.')
+   END FUNCTION zdf_mxl_alloc
+
 
    SUBROUTINE zdf_mxl( kt )
@@ -53,12 +64,18 @@
       !! ** Action  :   nmln, hmld, hmlp, hmlpt
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      USE wrk_nemo, ONLY:   iwrk_in_use, iwrk_not_released
+      USE wrk_nemo, ONLY:   imld => iwrk_2d_1    ! 2D integer workspace
       !!
-      INTEGER                     ::   ji, jj, jk          ! dummy loop indices
-      INTEGER                     ::   iikn, iiki          ! temporary integer within a do loop
-      INTEGER, DIMENSION(jpi,jpj) ::   imld                ! temporary workspace
-      REAL(wp)                    ::   zrho_c = 0.01_wp    ! density criterion for mixed layer depth
-      REAL(wp)                    ::   zavt_c = 5.e-4_wp   ! Kz criterion for the turbocline depth
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !!
+      INTEGER  ::   ji, jj, jk          ! dummy loop indices
+      INTEGER  ::   iikn, iiki          ! temporary integer within a do loop
+      REAL(wp) ::   zrho_c = 0.01_wp    ! density criterion for mixed layer depth
+      REAL(wp) ::   zavt_c = 5.e-4_wp   ! Kz criterion for the turbocline depth
       !!----------------------------------------------------------------------
+
+      IF( iwrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('zdf_mxl : requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 ) THEN
@@ -66,4 +83,6 @@
          IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth'
          IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         !                             ! allocate zdfmxl arrays
+         IF( zdf_mxl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl : unable to allocate arrays' )
       ENDIF
 
@@ -94,4 +113,6 @@
       IF(ln_ctl)   CALL prt_ctl( tab2d_1=REAL(nmln,wp), clinfo1=' nmln : ', tab2d_2=hmlp, clinfo2=' hmlp : ', ovlap=1 )
       !
+      IF( iwrk_not_released(2, 1) )   CALL ctl_stop('zdf_mxl: failed to release workspace array')
+      !
    END SUBROUTINE zdf_mxl
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 2715)
@@ -25,4 +25,5 @@
    USE in_out_manager  ! I/O manager
    USE lbclnk          ! ocean lateral boundary condition (or mpp link)
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -39,14 +40,25 @@
    REAL(wp) ::   rn_alp   =   5._wp      ! coefficient of the parameterization
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   tmric                    ! coef. for the horizontal mean at t-point
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tmric   !: coef. for the horizontal mean at t-point
 
    !! * Substitutions
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_ric_alloc()
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION zdf_ric_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( tmric(jpi,jpj,jpk)   , STAT= zdf_ric_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_ric_alloc )
+      IF( zdf_ric_alloc /= 0 )   CALL ctl_warn('zdf_ric_alloc: failed to allocate arrays')
+   END FUNCTION zdf_ric_alloc
+
 
    SUBROUTINE zdf_ric( kt )
@@ -77,11 +89,16 @@
       !! References : Pacanowski & Philander 1981, JPO, 1441-1451.
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zwx => wrk_2d_1     ! 2D workspace
+      !!
       INTEGER, INTENT( in ) ::   kt         ! ocean time-step indexocean time step
       !!
       INTEGER  ::   ji, jj, jk               ! dummy loop indices
       REAL(wp) ::   zcoef, zdku, zdkv, zri, z05alp     ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zwx ! temporary workspace
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('zdf_ric : requested workspace array unavailable')   ;   RETURN
+      ENDIF
       !                                                ! ===============
       DO jk = 2, jpkm1                                 ! Horizontal slab
@@ -104,21 +121,18 @@
          CALL lbc_lnk( zwx, 'W', 1. )                       ! Boundary condition   (sign unchanged)
 
-
          ! Vertical eddy viscosity and diffusivity coefficients
          ! -------------------------------------------------------
-         z05alp = 0.5 * rn_alp
+         z05alp = 0.5_wp * rn_alp
          DO jj = 1, jpjm1                                   ! Eddy viscosity coefficients (avm)
             DO ji = 1, jpim1
-               avmu(ji,jj,jk) = umask(ji,jj,jk)   &
-                  &           * rn_avmri / ( 1. + z05alp*( zwx(ji+1,jj)+zwx(ji,jj) ) )**nn_ric
-               avmv(ji,jj,jk) = vmask(ji,jj,jk)   &
-                  &           * rn_avmri / ( 1. + z05alp*( zwx(ji,jj+1)+zwx(ji,jj) ) )**nn_ric
+               avmu(ji,jj,jk) = umask(ji,jj,jk) * rn_avmri / ( 1. + z05alp*( zwx(ji+1,jj)+zwx(ji,jj) ) )**nn_ric
+               avmv(ji,jj,jk) = vmask(ji,jj,jk) * rn_avmri / ( 1. + z05alp*( zwx(ji,jj+1)+zwx(ji,jj) ) )**nn_ric
             END DO
          END DO
          DO jj = 2, jpjm1                                   ! Eddy diffusivity coefficients (avt)
             DO ji = 2, jpim1
-               avt(ji,jj,jk) = tmric(ji,jj,jk) / ( 1. + rn_alp * zwx(ji,jj) )   &
-                  &          * (  avmu(ji,jj,jk) + avmu(ji-1, jj ,jk)        &
-                  &             + avmv(ji,jj,jk) + avmv( ji ,jj-1,jk)  )     &
+               avt(ji,jj,jk) = tmric(ji,jj,jk) / ( 1._wp + rn_alp * zwx(ji,jj) )           &
+                  &                            * (  avmu(ji,jj,jk) + avmu(ji-1,jj,jk)      &
+                  &                               + avmv(ji,jj,jk) + avmv(ji,jj-1,jk)  )   &
                   &          + avtb(jk) * tmask(ji,jj,jk)
                !                                            ! Add the background coefficient on eddy viscosity
@@ -134,4 +148,6 @@
       CALL lbc_lnk( avmu, 'U', 1. )   ;   CALL lbc_lnk( avmv, 'V', 1. )
       !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('zdf_ric: failed to release workspace array')
+      !
    END SUBROUTINE zdf_ric
 
@@ -150,5 +166,5 @@
       !! ** Action  :   increase by 1 the nstop flag is setting problem encounter
       !!----------------------------------------------------------------------
-      INTEGER :: ji, jj, jk        ! dummy loop indices
+      INTEGER :: ji, jj, jk   ! dummy loop indices
       !!
       NAMELIST/namzdf_ric/ rn_avmri, rn_alp, nn_ric
@@ -168,6 +184,9 @@
       ENDIF
       !
-      DO jk = 1, jpk                 ! weighting mean array tmric for 4 T-points which accounts for coastal boundary conditions.
-         DO jj = 2, jpj              
+      !                              ! allocate zdfric arrays
+      IF( zdf_ric_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_ric_init : unable to allocate arrays' )
+      !
+      DO jk = 1, jpk                 ! weighting mean array tmric for 4 T-points
+         DO jj = 2, jpj              ! which accounts for coastal boundary conditions            
             DO ji = 2, jpi
                tmric(ji,jj,jk) =  tmask(ji,jj,jk)                                  &
@@ -177,5 +196,5 @@
          END DO
       END DO
-      tmric(:,1,:) = 0.e0
+      tmric(:,1,:) = 0._wp
       !
       DO jk = 1, jpk                 ! Initialization of vertical eddy coef. to the background value
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 2715)
@@ -49,4 +49,5 @@
    USE in_out_manager ! I/O manager
    USE iom            ! I/O manager library
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
@@ -57,11 +58,5 @@
    PUBLIC   tke_rst        ! routine called in step module
 
-   LOGICAL , PUBLIC, PARAMETER              ::   lk_zdftke = .TRUE.  !: TKE vertical mixing flag
-
-#if defined key_c1d
-   !                                                           !!** 1D cfg only  **   ('key_c1d')
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e_dis, e_mix   !: dissipation and mixing turbulent lengh scales
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   e_pdl, e_ric   !: prandl and local Richardson numbers
-#endif
+   LOGICAL , PUBLIC, PARAMETER ::   lk_zdftke = .TRUE.  !: TKE vertical mixing flag
 
    !                                      !!** Namelist  namzdf_tke  **
@@ -87,8 +82,12 @@
    REAL(wp) ::   rhftau_scl = 1.0_wp       ! scale factor applied to HF part of taum  (nn_etau=3)
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk), PUBLIC ::   en   ! now turbulent kinetic energy   [m2/s2]
-   
-   REAL(wp), DIMENSION(jpi,jpj)     ::   htau    ! depth of tke penetration (nn_htau)
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   dissl   ! now mixing lenght of dissipation
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   en             !: now turbulent kinetic energy   [m2/s2]
+   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htau           ! depth of tke penetration (nn_htau)
+   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dissl          ! now mixing lenght of dissipation
+#if defined key_c1d
+   !                                                                        !!** 1D cfg only  **   ('key_c1d')
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e_dis, e_mix   !: dissipation and mixing turbulent lengh scales
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e_pdl, e_ric   !: prandl and local Richardson numbers
+#endif
 
    !! * Substitutions
@@ -96,9 +95,26 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_tke_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION zdf_tke_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE(                                                                    &
+#if defined key_c1d
+         &      e_dis(jpi,jpj,jpk) , e_mix(jpi,jpj,jpk) ,                          &
+         &      e_pdl(jpi,jpj,jpk) , e_ric(jpi,jpj,jpk) ,                          &
+#endif
+         &      en   (jpi,jpj,jpk) , htau (jpi,jpj)     , dissl(jpi,jpj,jpk) , STAT= zdf_tke_alloc )
+         !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_tke_alloc )
+      IF( zdf_tke_alloc /= 0 )   CALL ctl_warn('zdf_tke_alloc: failed to allocate arrays')
+      !
+   END FUNCTION zdf_tke_alloc
+
 
    SUBROUTINE zdf_tke( kt )
@@ -174,8 +190,10 @@
       !!                (= Kz dz[Ub] * dz[Un] )
       !! ---------------------------------------------------------------------
-      USE oce,   zdiag  =>   ua   ! use ua as workspace
-      USE oce,   zd_up  =>   va   ! use va as workspace
-      USE oce,   zd_lw  =>   ta   ! use ta as workspace
-      !!
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released, iwrk_in_use, iwrk_not_released
+      USE oce     , ONLY:   zdiag => ua , zd_up => va , zd_lw => ta   ! (ua,va,ta) used as workspace
+      USE wrk_nemo, ONLY:   imlc  => iwrk_2d_1   ! 2D INTEGER workspace
+      USE wrk_nemo, ONLY:   zhlc  =>  wrk_2d_1   ! 2D REAL workspace
+      USE wrk_nemo, ONLY:   zpelc =>  wrk_3d_1   ! 3D REAL workspace
+      !
       INTEGER  ::   ji, jj, jk                      ! dummy loop arguments
 !!bfr      INTEGER  ::   ikbu, ikbv, ikbum1, ikbvm1      ! temporary scalar
@@ -190,9 +208,12 @@
       REAL(wp) ::   zzd_up, zzd_lw                  !    -         -
 !!bfr      REAL(wp) ::   zebot                           !    -         -
-      INTEGER , DIMENSION(jpi,jpj)     ::   imlc    ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zhlc    !  -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpelc   ! 3D workspace
       !!--------------------------------------------------------------------
       !
+      IF( iwrk_in_use(2, 1) .OR.   &
+           wrk_in_use(2, 1) .OR.   &
+           wrk_in_use(3, 1)   ) THEN
+         CALL ctl_stop('tke_tke: requested workspace arrays unavailable')   ;   RETURN
+      END IF
+
       zbbrau = rn_ebb / rau0       ! Local constant initialisation
       zfact1 = -.5_wp * rdt 
@@ -406,6 +427,9 @@
          END DO
       ENDIF
-      !
       CALL lbc_lnk( en, 'W', 1. )      ! Lateral boundary conditions (sign unchanged)
+      !
+      IF( iwrk_not_released(2 ,1) .OR.   &
+           wrk_not_released(2, 1) .OR.   &
+           wrk_not_released(3, 1)  )   CALL ctl_stop( 'tke_tke: failed to release workspace arrays' )
       !
    END SUBROUTINE tke_tke
@@ -447,15 +471,10 @@
       !!              - avmu, avmv : now vertical eddy viscosity at uw- and vw-points
       !!----------------------------------------------------------------------
-      USE oce,     zmpdl  =>   ua   ! use ua as workspace
-      USE oce,     zmxlm  =>   va   ! use va as workspace
-      USE oce,     zmxld  =>   ta   ! use ta as workspace
-      !!
-      INTEGER  ::   ji, jj, jk            ! dummy loop arguments
-      REAL(wp) ::   zrn2, zraug           ! temporary scalars
-      REAL(wp) ::   zdku                  !    -         -
-      REAL(wp) ::   zdkv                  !    -         -
-      REAL(wp) ::   zcoef, zav            !    -         -
-      REAL(wp) ::   zpdlr, zri, zsqen     !    -         -
-      REAL(wp) ::   zemxl, zemlm, zemlp   !    -         -
+      USE oce, ONLY:   zmpdl => ua , zmxlm => va , zmxld => ta   ! (ua,va,ta) used as workspace
+      !!
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zrn2, zraug, zcoef, zav     ! local scalars
+      REAL(wp) ::   zdku, zpdlr, zri, zsqen     !   -      -
+      REAL(wp) ::   zdkv, zemxl, zemlm, zemlp   !   -      -
       !!--------------------------------------------------------------------
 
@@ -485,5 +504,4 @@
          END DO
       END DO
-      !
       !
       !                     !* Physical limits for the mixing length
@@ -656,11 +674,11 @@
          &                 nn_etau , nn_htau  , rn_efr   
       !!----------------------------------------------------------------------
-
+      !
       REWIND ( numnam )               !* Read Namelist namzdf_tke : Turbulente Kinetic Energy
       READ   ( numnam, namzdf_tke )
-      
+      !
       ri_cri   = 2._wp    / ( 2._wp + rn_ediss / rn_ediff )   ! resulting critical Richardson number
       rmxl_min = 1.e-6_wp / ( rn_ediff * SQRT( rn_emin ) )    ! resulting minimum length to recover molecular viscosity
-
+      !
       IF(lwp) THEN                    !* Control print
          WRITE(numout,*)
@@ -686,5 +704,8 @@
          WRITE(numout,*) '      critical Richardson nb with your parameters  ri_cri = ', ri_cri
       ENDIF
-
+      !
+      !                              ! allocate tke arrays
+      IF( zdf_tke_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tke_init : unable to allocate arrays' )
+      !
       !                               !* Check of some namelist values
       IF( nn_mxl  < 0  .OR.  nn_mxl  > 3 )   CALL ctl_stop( 'bad flag: nn_mxl is  0, 1 or 2 ' )
@@ -711,5 +732,4 @@
          END SELECT
       ENDIF
-
       !                               !* set vertical eddy coef. to the background value
       DO jk = 1, jpk
@@ -720,6 +740,6 @@
       END DO
       dissl(:,:,:) = 1.e-12_wp
-      !                               !* read or initialize all required files 
-      CALL tke_rst( nit000, 'READ' )
+      !                              
+      CALL tke_rst( nit000, 'READ' )  !* read or initialize all required files
       !
    END SUBROUTINE zdf_tke_init
@@ -736,9 +756,9 @@
      !!                set to rn_emin or recomputed 
      !!----------------------------------------------------------------------
-     INTEGER         , INTENT(in) ::   kt         ! ocean time-step
-     CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
+     INTEGER         , INTENT(in) ::   kt     ! ocean time-step
+     CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag
      !
      INTEGER ::   jit, jk   ! dummy loop indices
-     INTEGER ::   id1, id2, id3, id4, id5, id6
+     INTEGER ::   id1, id2, id3, id4, id5, id6   ! local integers
      !!----------------------------------------------------------------------
      !
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 2715)
@@ -8,5 +8,5 @@
    !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
    !!----------------------------------------------------------------------
-#if defined key_zdftmx
+#if defined key_zdftmx   ||   defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_zdftmx'                                  Tidal vertical mixing
@@ -24,4 +24,6 @@
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O Manager
+   USE lib_mpp         ! MPP library
+   USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
 
    IMPLICIT NONE
@@ -30,4 +32,5 @@
    PUBLIC   zdf_tmx         ! called in step module 
    PUBLIC   zdf_tmx_init    ! called in opa module 
+   PUBLIC   zdf_tmx_alloc   ! called in nemogcm module
 
    LOGICAL, PUBLIC, PARAMETER ::   lk_zdftmx = .TRUE.    !: tidal mixing flag
@@ -41,7 +44,7 @@
    REAL(wp) ::  rn_tfe_itf = 1.        ! ITF tidal dissipation efficiency (St Laurent et al. 2002)
 
-   REAL(wp), DIMENSION(jpi,jpj)     ::   en_tmx     ! energy available for tidal mixing (W/m2)
-   REAL(wp), DIMENSION(jpi,jpj)     ::   mask_itf   ! mask to use over Indonesian area
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   az_tmx     ! coefficient used to evaluate the tidal induced Kz
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   en_tmx     ! energy available for tidal mixing (W/m2)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   mask_itf   ! mask to use over Indonesian area
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   az_tmx     ! coefficient used to evaluate the tidal induced Kz
 
    !! * Substitutions
@@ -49,10 +52,20 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION zdf_tmx_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  FUNCTION zdf_tmx_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE(en_tmx(jpi,jpj), mask_itf(jpi,jpj), az_tmx(jpi,jpj,jpk), STAT=zdf_tmx_alloc )
+      !
+      IF( lk_mpp             )   CALL mpp_sum ( zdf_tmx_alloc )
+      IF( zdf_tmx_alloc /= 0 )   CALL ctl_warn('zdf_tmx_alloc: failed to allocate arrays')
+   END FUNCTION zdf_tmx_alloc
+
 
    SUBROUTINE zdf_tmx( kt )
@@ -91,4 +104,5 @@
       !!----------------------------------------------------------------------
       USE oce, zav_tide  =>   ua    ! use ua as workspace
+      USE wrk_nemo, ONLY: zkz => wrk_2d_1
       !!
       INTEGER, INTENT(in) ::   kt   ! ocean time-step 
@@ -96,7 +110,9 @@
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   ztpc         ! scalar workspace
-      REAL(wp), DIMENSION(jpi,jpj) ::   zkz   ! temporary 2D workspace
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+
+      IF(wrk_in_use(2, 1))THEN
+         CALL ctl_stop('zdf_tmx : requested workspace array unavailable.')   ;   RETURN
+      END IF
       !                          ! ----------------------- !
       !                          !  Standard tidal mixing  !  (compute zav_tide)
@@ -160,4 +176,8 @@
       IF(ln_ctl)   CALL prt_ctl(tab3d_1=zav_tide , clinfo1=' tmx - av_tide: ', tab3d_2=avt, clinfo2=' avt: ', ovlap=1, kdim=jpk)
       !
+      IF(wrk_not_released(2, 1))THEN
+         CALL ctl_stop('zdf_tmx : failed to release workspace array.')
+      END IF
+      !
    END SUBROUTINE zdf_tmx
 
@@ -183,4 +203,10 @@
       !! References :  Koch-Larrouy et al. 2007, GRL 
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: zkz => wrk_2d_5
+      USE wrk_nemo, ONLY: zsum1 => wrk_2d_2, zsum2 => wrk_2d_3, zsum => wrk_2d_4
+      USE wrk_nemo, ONLY: zempba_3d_1 => wrk_3d_1, zempba_3d_2 => wrk_3d_2
+      USE wrk_nemo, ONLY: zempba_3d   => wrk_3d_3, zdn2dz      => wrk_3d_4
+      USE wrk_nemo, ONLY: zavt_itf    => wrk_3d_5
+      !!
       INTEGER , INTENT(in   )                         ::   kt   ! ocean time-step
       REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pav  ! Tidal mixing coef.
@@ -188,11 +214,10 @@
       INTEGER  ::   ji, jj, jk    ! dummy loop indices
       REAL(wp) ::   zcoef, ztpc   ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zkz                        ! 2D workspace
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zsum1 , zsum2 , zsum       !  -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zempba_3d_1, zempba_3d_2   ! 3D workspace
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zempba_3d  , zdn2dz        !  -      -
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zavt_itf                   !  -      -
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(2, 2,3,4,5) .OR. wrk_in_use(3, 1,2,3,4,5) )THEN
+         CALL ctl_stop('tmx_itf : requested workspace arrays unavailable.')
+         RETURN
+      END IF
       !                             ! compute the form function using N2 at each time step
       zempba_3d_1(:,:,jpk) = 0.e0
@@ -279,4 +304,9 @@
       END DO
       !
+      IF( wrk_not_released(2, 2,3,4,5) .OR. &
+          wrk_not_released(3, 1,2,3,4,5) )THEN
+         CALL ctl_stop('tmx_itf : failed to release workspace arrays.')
+      END IF
+      !
    END SUBROUTINE tmx_itf
 
@@ -317,17 +347,22 @@
       !!              Koch-Larrouy et al. 2007, GRL.
       !!----------------------------------------------------------------------
-      USE oce,   zav_tide  =>   ua   ! use ua as workspace
-      !!
-      INTEGER ::   ji, jj, jk    ! dummy loop indices
-      INTEGER ::   inum          ! temporary logical unit
-      REAL(wp) ::   ztpc, ze_z   ! total power consumption
-      REAL(wp), DIMENSION(jpi,jpj) ::  zem2, zek1   ! read M2 and K1 tidal energy
-      REAL(wp), DIMENSION(jpi,jpj) ::  zkz          ! total M2, K1 and S2 tidal energy
-      REAL(wp), DIMENSION(jpi,jpj) ::  zfact        ! used for vertical structure function
-      REAL(wp), DIMENSION(jpi,jpj) ::  zhdep        ! Ocean depth 
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zpc      ! power consumption
+      USE oce     ,         zav_tide =>  ua         ! ua used as workspace
+      USE wrk_nemo, ONLY:   zem2     =>  wrk_2d_1   ! read M2 and 
+      USE wrk_nemo, ONLY:   zek1     =>  wrk_2d_2   ! K1 tidal energy
+      USE wrk_nemo, ONLY:   zkz      =>  wrk_2d_3   ! total M2, K1 and S2 tidal energy
+      USE wrk_nemo, ONLY:   zfact    =>  wrk_2d_4   ! used for vertical structure function
+      USE wrk_nemo, ONLY:   zhdep    =>  wrk_2d_5   ! Ocean depth 
+      USE wrk_nemo, ONLY:   zpc      =>  wrk_3d_1   ! power consumption
+      !!
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      INTEGER  ::   inum         ! local integer
+      REAL(wp) ::   ztpc, ze_z   ! local scalars
       !!
       NAMELIST/namzdf_tmx/ rn_htmx, rn_n2min, rn_tfe, rn_me, ln_tmx_itf, rn_tfe_itf
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5)  .OR.  wrk_in_use(3, 1)  ) THEN
+         CALL ctl_stop('zdf_tmx_init : requested workspace arrays unavailable.')   ;   RETURN
+      END IF
 
       REWIND( numnam )               ! Read Namelist namtmx : Tidal Mixing
@@ -347,4 +382,7 @@
       ENDIF
 
+      !                              ! allocate tmx arrays
+      IF( zdf_tmx_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' )
+
       IF( ln_tmx_itf ) THEN          ! read the Indonesian Through Flow mask
          CALL iom_open('mask_itf',inum)
@@ -488,4 +526,7 @@
       ENDIF
       !
+      IF(wrk_not_released(2, 1,2,3,4,5) .OR.   &
+         wrk_not_released(3, 1)          )   CALL ctl_stop( 'zdf_tmx_init : failed to release workspace arrays' )
+      !
    END SUBROUTINE zdf_tmx_init
 
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/lib_print.f90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/lib_print.f90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/lib_print.f90	(revision 2715)
@@ -10,5 +10,4 @@
    !!   prizre       : print an real 2D vertical field
    !!----------------------------------------------------------------------
-   !! * Mules used
    USE par_kind      ! kind parameters
 
@@ -16,7 +15,6 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC prihin, prihre, prizre
-   !!----------------------------------------------------------------------
+   PUBLIC   prihin, prihre, prizre
+
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
@@ -40,5 +38,4 @@
       !!        !  03-07 (G. Madec)  F90, free form
       !!----------------------------------------------------------------------
-      !! * Arguments
       INTEGER, INTENT( in ) ::   &
          ki, kj,                 &  ! array dimensions
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 2715)
@@ -27,4 +27,5 @@
    !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 
    !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
+   !!            4.0  ! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 
@@ -34,4 +35,7 @@
    !!   nemo_ctl       : initialisation of the contol print 
    !!   nemo_closefile : close remaining open files
+   !!   nemo_alloc     : dynamical allocation
+   !!   nemo_partition : calculate MPP domain decomposition
+   !!   factorise      : calculate the factors of the no. of MPI processes
    !!----------------------------------------------------------------------
    USE step_oce        ! module used in the ocean time stepping module
@@ -70,4 +74,5 @@
 #endif
 
+   IMPLICIT NONE
    PRIVATE
 
@@ -78,5 +83,5 @@
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -95,5 +100,5 @@
       !!              - finalize the run by closing files and communications
       !!
-      !! References : Madec, Delecluse,Imbard, and Levy, 1997:  internal report, IPSL.
+      !! References : Madec, Delecluse, Imbard, and Levy, 1997:  internal report, IPSL.
       !!              Madec, 2008, internal report, IPSL.
       !!----------------------------------------------------------------------
@@ -108,5 +113,10 @@
       CALL nemo_init               !==  Initialisations  ==!
       !                            !-----------------------!
-
+#if defined key_agrif
+      CALL Agrif_Declare_Var       ! AGRIF: set the meshes
+# if defined key_top
+      CALL Agrif_Declare_Var_Top   ! AGRIF: set the meshes
+# endif
+#endif
       ! check that all process are still there... If some process have an error,
       ! they will never enter in step and other processes will wait until the end of the cpu time!
@@ -177,7 +187,7 @@
       !! ** Purpose :   initialization of the NEMO GCM
       !!----------------------------------------------------------------------
-      INTEGER ::   ji          ! dummy loop indices
-      INTEGER :: ilocal_comm   ! local integer
-      CHARACTER(len=80), DIMENSION(10) ::   cltxt
+      INTEGER ::   ji            ! dummy loop indices
+      INTEGER ::   ilocal_comm   ! local integer
+      CHARACTER(len=80), DIMENSION(16) ::   cltxt
       !!
       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
@@ -198,23 +208,48 @@
       IF( Agrif_Root() ) THEN
 # if defined key_oasis3 || defined key_oasis4
-         CALL cpl_prism_init( ilocal_comm )   ! nemo local communicator given by oasis
+         CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis
 # endif
-         CALL  init_ioclient( ilocal_comm )   ! exchange io_server nemo local communicator with the io_server
-      ENDIF
-      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection
+         CALL  init_ioclient( ilocal_comm )                 ! exchange io_server nemo local communicator with the io_server
+      ENDIF
+      narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection
 #else
 # if defined key_oasis3 || defined key_oasis4
       IF( Agrif_Root() ) THEN
-         CALL cpl_prism_init( ilocal_comm )   ! nemo local communicator given by oasis
-      ENDIF
-      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection (control print return in cltxt)
+         CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis
+      ENDIF
+      narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt)
 # else
       ilocal_comm = 0
-      narea = mynode( cltxt )                 ! Nodes selection (control print return in cltxt)
+      narea = mynode( cltxt, numnam, nstop )                 ! Nodes selection (control print return in cltxt)
 # endif
 #endif
-      narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 )
-
-      lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print
+      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 )
+
+      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print
+
+      ! If dimensions of processor grid weren't specified in the namelist file 
+      ! then we calculate them here now that we have our communicator size
+      IF( (jpni < 1) .OR. (jpnj < 1) )THEN
+#if   defined key_mpp_mpi
+         IF( Agrif_Root() ) CALL nemo_partition(mppsize)
+#else
+         jpni  = 1
+         jpnj  = 1
+         jpnij = jpni*jpnj
+#endif
+      END IF
+
+      ! Calculate domain dimensions given calculated jpni and jpnj
+      ! This used to be done in par_oce.F90 when they were parameters rather
+      ! than variables
+      IF( Agrif_Root() ) THEN
+         jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim.
+         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim.
+         jpk = jpkdta                                             ! third dim
+         jpim1 = jpi-1                                            ! inner domain indices
+         jpjm1 = jpj-1                                            !   "           "
+         jpkm1 = jpk-1                                            !   "           "
+         jpij  = jpi*jpj                                          !  jpi x j
+      ENDIF
 
       IF(lwp) THEN                            ! open listing units
@@ -235,4 +270,9 @@
          !
       ENDIF
+
+      ! Now we know the dimensions of the grid and numout has been set we can 
+      ! allocate arrays
+      CALL nemo_alloc()
+
       !                             !-------------------------------!
       !                             !  NEMO general initialization  !
@@ -427,4 +467,154 @@
    END SUBROUTINE nemo_closefile
 
+
+   SUBROUTINE nemo_alloc
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_alloc  ***
+      !!
+      !! ** Purpose :   Allocate all the dynamic arrays of the OPA modules
+      !!
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      USE diawri    , ONLY: dia_wri_alloc
+      USE dom_oce   , ONLY: dom_oce_alloc
+      USE ldfdyn_oce, ONLY: ldfdyn_oce_alloc
+      USE ldftra_oce, ONLY: ldftra_oce_alloc
+      USE trc_oce   , ONLY: trc_oce_alloc
+      USE wrk_nemo  , ONLY: wrk_alloc
+      !
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
+      !
+      ierr =        oce_alloc       ()          ! ocean 
+      ierr = ierr + dia_wri_alloc   ()
+      ierr = ierr + dom_oce_alloc   ()          ! ocean domain
+      ierr = ierr + ldfdyn_oce_alloc()          ! ocean lateral  physics : dynamics
+      ierr = ierr + ldftra_oce_alloc()          ! ocean lateral  physics : tracers
+      ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics
+      !
+      ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges
+      ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays
+      !
+      ierr = ierr + wrk_alloc(numout, lwp)      ! workspace
+      !
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc : unable to allocate standard ocean arrays' )
+      !
+   END SUBROUTINE nemo_alloc
+
+
+   SUBROUTINE nemo_partition( num_pes )
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE nemo_partition  ***
+      !!
+      !! ** Purpose :   
+      !!
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have
+      !
+      INTEGER, PARAMETER :: nfactmax = 20
+      INTEGER :: nfact ! The no. of factors returned
+      INTEGER :: ierr  ! Error flag
+      INTEGER :: ji
+      INTEGER :: idiff, mindiff, imin ! For choosing pair of factors that are closest in value
+      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors
+      !!----------------------------------------------------------------------
+
+      ierr = 0
+
+      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr )
+
+      IF( nfact <= 1 ) THEN
+         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed'
+         WRITE (numout, *) '       : using grid of ',num_pes,' x 1'
+         jpnj = 1
+         jpni = num_pes
+      ELSE
+         ! Search through factors for the pair that are closest in value
+         mindiff = 1000000
+         imin    = 1
+         DO ji = 1, nfact-1, 2
+            idiff = ABS( ifact(ji) - ifact(ji+1) )
+            IF( idiff < mindiff ) THEN
+               mindiff = idiff
+               imin = ji
+            ENDIF
+         END DO
+         jpnj = ifact(imin)
+         jpni = ifact(imin + 1)
+      ENDIF
+      !
+      jpnij = jpni*jpnj
+      !
+   END SUBROUTINE nemo_partition
+
+
+   SUBROUTINE factorise( kfax, kmaxfax, knfax, kn, kerr )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE factorise  ***
+      !!
+      !! ** Purpose :   return the prime factors of n.
+      !!                knfax factors are returned in array kfax which is of 
+      !!                maximum dimension kmaxfax.
+      !! ** Method  :
+      !!----------------------------------------------------------------------
+      INTEGER                    , INTENT(in   ) ::   kn, kmaxfax
+      INTEGER                    , INTENT(  out) ::   kerr, knfax
+      INTEGER, DIMENSION(kmaxfax), INTENT(  out) ::   kfax
+      !
+      INTEGER :: ifac, jl, inu
+      INTEGER, PARAMETER :: ntest = 14
+      INTEGER :: ilfax(ntest)
+
+      ! lfax contains the set of allowed factors.
+      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  &
+         &                            128,   64,   32,   16,    8,   4,   2  /
+      !!----------------------------------------------------------------------
+
+      ! Clear the error flag and initialise output vars
+      kerr = 0
+      kfax = 1
+      knfax = 0
+
+      ! Find the factors of n.
+      IF( kn == 1 )   GOTO 20
+
+      ! nu holds the unfactorised part of the number.
+      ! knfax holds the number of factors found.
+      ! l points to the allowed factor list.
+      ! ifac holds the current factor.
+
+      inu   = kn
+      knfax = 0
+
+      DO jl = ntest, 1, -1
+         !
+         ifac = ilfax(jl)
+         IF( ifac > inu )   CYCLE
+
+         ! Test whether the factor will divide.
+
+         IF( MOD(inu,ifac) == 0 ) THEN
+            !
+            knfax = knfax + 1            ! Add the factor to the list
+            IF( knfax > kmaxfax ) THEN
+               kerr = 6
+               write (*,*) 'FACTOR: insufficient space in factor array ', knfax
+               return
+            ENDIF
+            kfax(knfax) = ifac
+            ! Store the other factor that goes with this one
+            knfax = knfax + 1
+            kfax(knfax) = inu / ifac
+            !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax)
+         ENDIF
+         !
+      END DO
+
+   20 CONTINUE      ! Label 20 is the exit point from the factor search loop.
+      !
+   END SUBROUTINE factorise
+
    !!======================================================================
 END MODULE nemogcm
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/oce.F90	(revision 2715)
@@ -8,44 +8,82 @@
    !!            3.3  !  2010-09  (C. Ethe) TRA-TRC merge: add ts, gtsu, gtsv 4D arrays
    !!----------------------------------------------------------------------
-   USE par_oce      ! ocean parameters
+   USE par_oce        ! ocean parameters
+   USE lib_mpp        ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   LOGICAL         , PUBLIC ::   l_traldf_rot = .FALSE.  !: rotated laplacian operator for lateral diffusion
+   PUBLIC oce_alloc ! routine called by nemo_init in nemogcm.F90
 
-   !! dynamics and tracer fields                  ! before ! now    ! after   ! the after trends becomes the fields
-   !! --------------------------                  ! fields ! fields ! trends  ! only after tra_zdf and dyn_spg
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   ub   ,  un    , ua      !: i-horizontal velocity        [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   vb   ,  vn    , va      !: j-horizontal velocity        [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::           wn              !: vertical velocity            [m/s]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   rotb ,  rotn            !: relative vorticity           [s-1]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   hdivb,  hdivn           !: horizontal divergence        [s-1]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   tb   ,  tn    , ta      !: potential temperature    [Celcius]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   sb   ,  sn    , sa      !: salinity                     [psu]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jpts) ::   tsb  ,  tsn   , tsa     !: 4D T-S fields        [Celcius,psu] 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)      ::   rn2b ,  rn2             !: brunt-vaisala frequency**2   [s-2]
+   LOGICAL, PUBLIC ::   l_traldf_rot = .FALSE.  !: rotated laplacian operator for lateral diffusion
+
+   !! dynamics and tracer fields                            ! before ! now    ! after  ! the after trends becomes the fields
+   !! --------------------------                            ! fields ! fields ! trends ! only after tra_zdf and dyn_spg
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   ub   ,  un    , ua     !: i-horizontal velocity        [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   vb   ,  vn    , va     !: j-horizontal velocity        [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::           wn             !: vertical velocity            [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   rotb ,  rotn           !: relative vorticity           [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hdivb,  hdivn          !: horizontal divergence        [s-1]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   tb   ,  tn    , ta     !: potential temperature    [Celcius]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   sb   ,  sn    , sa     !: salinity                     [psu]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tsb  ,  tsn   , tsa    !: 4D T-S fields        [Celcius,psu] 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   rn2b ,  rn2            !: brunt-vaisala frequency**2   [s-2]
    !
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rhd    !: in situ density anomalie rhd=(rho-rau0)/rau0  [no units]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   rhop   !: potential volumic mass                           [kg/m3]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rhd    !: in situ density anomalie rhd=(rho-rau0)/rau0  [no units]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   rhop   !: potential volumic mass                           [kg/m3]
 
-   !! free surface                       !  before  !  now     !  after   !
-   !! ------------                       !  fields  !  fields  !  trends  !
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sshb   ,  sshn    ,  ssha    !: sea surface height at t-point [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sshu_b ,  sshu_n  ,  sshu_a  !: sea surface height at u-point [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sshv_b ,  sshv_n  ,  sshv_a  !: sea surface height at u-point [m]
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::             sshf_n             !: sea surface height at f-point [m]
+   !! free surface                                      !  before  ! now    ! after  !
+   !! ------------                                      !  fields  ! fields ! trends !
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshb   , sshn   , ssha   !: sea surface height at t-point [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshu_b , sshu_n , sshu_a !: sea surface height at u-point [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sshv_b , sshv_n , sshv_a !: sea surface height at u-point [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::            sshf_n          !: sea surface height at f-point [m]
    !
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   spgu, spgv                   !: horizontal surface pressure gradient
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   spgu, spgv               !: horizontal surface pressure gradient
 
    !! interpolated gradient (only used in zps case)
    !! ---------------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpts) ::   gtsu, gtsv   !: horizontal gradient of T, S bottom u-point
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)      ::   gru , grv    !: horizontal gradient of rd at bottom u-point
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   gtsu, gtsv   !: horizontal gradient of T, S bottom u-point 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   gru , grv    !: horizontal gradient of rd at bottom u-point
 
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                   ***  FUNCTION oce_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER :: ierr(2)
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE( ub   (jpi,jpj,jpk)      , un   (jpi,jpj,jpk)      , ua(jpi,jpj,jpk)       ,     &
+         &      vb   (jpi,jpj,jpk)      , vn   (jpi,jpj,jpk)      , va(jpi,jpj,jpk)       ,     &      
+         &      wn   (jpi,jpj,jpk)      ,                                                       &
+         &      rotb (jpi,jpj,jpk)      , rotn (jpi,jpj,jpk)      ,                             &   
+         &      hdivb(jpi,jpj,jpk)      , hdivn(jpi,jpj,jpk)      ,                             &
+         &      tb   (jpi,jpj,jpk)      , tn   (jpi,jpj,jpk)      , ta(jpi,jpj,jpk)       ,     &
+         &      sb   (jpi,jpj,jpk)      , sn   (jpi,jpj,jpk)      , sa (jpi,jpj,jpk)      ,     &      
+         &      tsb  (jpi,jpj,jpk,jpts) , tsn  (jpi,jpj,jpk,jpts) , tsa(jpi,jpj,jpk,jpts) ,     &
+         &      rn2b (jpi,jpj,jpk)      , rn2  (jpi,jpj,jpk)                              , STAT=ierr(1) )
+         !
+      ALLOCATE(rhd (jpi,jpj,jpk) ,                                         &
+         &     rhop(jpi,jpj,jpk) ,                                         &
+         &     sshb  (jpi,jpj)   , sshn  (jpi,jpj) , ssha  (jpi,jpj) ,     &
+         &     sshu_b(jpi,jpj)   , sshu_n(jpi,jpj) , sshu_a(jpi,jpj) ,     &
+         &     sshv_b(jpi,jpj)   , sshv_n(jpi,jpj) , sshv_a(jpi,jpj) ,     &
+         &                         sshf_n(jpi,jpj) ,                       &
+         &     spgu  (jpi,jpj)   , spgv(jpi,jpj)   ,                       &
+         &     gtsu(jpi,jpj,jpts), gtsv(jpi,jpj,jpts),                     &
+         &     gru(jpi,jpj)      , grv(jpi,jpj)                      , STAT=ierr(2) )
+         !
+      oce_alloc = MAXVAL( ierr )
+      IF( oce_alloc /= 0 )   CALL ctl_warn('oce_alloc: failed to allocate arrays')
+      !
+   END FUNCTION oce_alloc
+
    !!======================================================================
 END MODULE oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R2.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R2.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R2.h90	(revision 2715)
@@ -29,5 +29,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R5.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R5.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R5.h90	(revision 2715)
@@ -29,5 +29,4 @@
       jpiglo  = jpidta,      &  !: first  dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: second dimension of global domain --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R6.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R6.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_EEL_R6.h90	(revision 2715)
@@ -29,5 +29,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_GYRE.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_GYRE.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_GYRE.h90	(revision 2715)
@@ -29,5 +29,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R025.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R025.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R025.h90	(revision 2715)
@@ -32,5 +32,4 @@
       jpiglo  = jpidta,      &  !: first  dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: second dimension of global domain --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R05.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R05.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R05.h90	(revision 2715)
@@ -36,5 +36,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = 187   ,      &  !: 2nd     "                 "    --> j 
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
@@ -53,5 +52,4 @@
       jpiglo  = 562,         &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta-301+1,&  !: 2nd     "                 "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position
       jpizoom =  81   ,      &  !: left bottom (i,j) indices of the zoom
@@ -69,5 +67,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: 2nd     "                 "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position    
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R1.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R1.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R1.h90	(revision 2715)
@@ -35,5 +35,4 @@
       jpiglo  = jpidta,      &  !: first  dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: second dimension of global domain --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R2.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R2.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R2.h90	(revision 2715)
@@ -36,5 +36,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = 50,          &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
@@ -52,5 +51,4 @@
       jpiglo  = 142   ,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta-97+1, &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! zoom starting position 
       jpizoom =  21   ,      &  !: left bottom (i,j) indices of the zoom
@@ -68,5 +66,4 @@
       jpiglo  = 3     ,      &  !: 1st dimension of global domain --> i
       jpjglo  = 3     ,      &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom 
       ! jpizoom =   61   ,    &  !: left bottom (i,j) indices of the zoom
@@ -97,5 +94,4 @@
       jpiglo  = jpidta,      &  !: 1st dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: 2nd    "                  "    --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom 
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R4.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R4.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_ORCA_R4.h90	(revision 2715)
@@ -28,5 +28,4 @@
       jpiglo  = jpidta,      &  !: first  dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: second dimension of global domain --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_POMME_R025.h90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_POMME_R025.h90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_POMME_R025.h90	(revision 2715)
@@ -36,5 +36,4 @@
       jpiglo  = jpidta,      &  !: first  dimension of global domain --> i
       jpjglo  = jpjdta,      &  !: second dimension of global domain --> j
-      jpk     = jpkdta,      &  !: number of vertical levels
       ! starting position of the zoom
       jpizoom =   1   ,      &  !: left bottom (i,j) indices of the zoom
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/par_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/par_oce.F90	(revision 2715)
@@ -17,27 +17,7 @@
    !!----------------------------------------------------------------------
    !! if we dont use massively parallel computer (parameters jpni=jpnj=1) so jpiglo=jpi and jpjglo=jpj
-#if ! defined key_mpp_dyndist 
-   INTEGER, PUBLIC, PARAMETER ::    &  !:
-# if ! defined key_nproci
-      jpni   = 1,                   &  !: number of processors following i
-      jpnj   = 1,                   &  !: number of processors following j
-      jpnij  = 1                       !: nb of local domain = nb of processors 
-      !                                !  ( <= jpni x jpnj )
-# else
-      jpni   = key_nproci,          &  !: number of processors following i
-      jpnj   = key_nprocj,          &  !: number of processors following j
-#  if ! defined key_nprocij
-      jpnij  = key_nproci * key_nprocj !: nb of local domain = nb of processors 
-      !                                !  ( <= jpni x jpnj )
-#  else
-      jpnij  = key_nprocij             !: nb of local domain = nb of processors 
-      !                                !  ( <= jpni x jpnj )
-#  endif
-# endif
-#else
    INTEGER, PUBLIC            ::   jpni         !: number of processors following i 
    INTEGER, PUBLIC            ::   jpnj         !: number of processors following j
    INTEGER, PUBLIC            ::   jpnij        !: nb of local domain = nb of processors ( <= jpni x jpnj )
-#endif
    INTEGER, PUBLIC, PARAMETER ::   jpr2di = 0   !: number of columns for extra outer halo 
    INTEGER, PUBLIC, PARAMETER ::   jpr2dj = 0   !: number of rows    for extra outer halo 
@@ -116,5 +96,5 @@
    INTEGER, PUBLIC, PARAMETER ::   jpiglo  = jpidta   !: 1st dimension of global domain --> i
    INTEGER, PUBLIC, PARAMETER ::   jpjglo  = jpjdta   !: 2nd    -                  -    --> j
-   INTEGER, PUBLIC, PARAMETER ::   jpk     = jpkdta   !: number of vertical levels
+   INTEGER, PUBLIC            ::   jpk     = jpkdta   !: number of vertical levels
    ! zoom starting position 
    INTEGER, PUBLIC, PARAMETER ::   jpizoom =   1      !: left bottom (i,j) indices of the zoom
@@ -188,18 +168,12 @@
    INTEGER, PUBLIC            ::   nbcellsy     = jpjglo - 2 - 2*nbghostcells   !: number of cells in j-direction
    !
-   INTEGER, PUBLIC            ::   jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   !: first  dimension
-   INTEGER, PUBLIC            ::   jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   !: second dimension
-   INTEGER, PUBLIC            ::   jpim1 = jpi-1                                            !: inner domain indices
-   INTEGER, PUBLIC            ::   jpjm1 = jpj-1                                            !:   -     -      -
-   INTEGER, PUBLIC            ::   jpkm1 = jpk-1                                            !:   -     -      -
-   INTEGER, PUBLIC            ::   jpij  = jpi*jpj                                          !:  jpi x jpj
-#else
-   INTEGER, PUBLIC, PARAMETER ::   jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   !: first  dimension
-   INTEGER, PUBLIC, PARAMETER ::   jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   !: second dimension
-   INTEGER, PUBLIC, PARAMETER ::   jpim1 = jpi-1                                            !: inner domain indices
-   INTEGER, PUBLIC, PARAMETER ::   jpjm1 = jpj-1                                            !:   -     -      -
-   INTEGER, PUBLIC, PARAMETER ::   jpkm1 = jpk-1                                            !:   -     -      -
-   INTEGER, PUBLIC, PARAMETER ::   jpij  = jpi*jpj                                          !:  jpi x jpj
 #endif
+   INTEGER, PUBLIC  ::   jpi   ! = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   !: first  dimension
+   INTEGER, PUBLIC  ::   jpj   ! = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   !: second dimension
+   INTEGER, PUBLIC  ::   jpk   ! = jpkdta                                             !: third dimension
+   INTEGER, PUBLIC  ::   jpim1 ! = jpi-1                                            !: inner domain indices
+   INTEGER, PUBLIC  ::   jpjm1 ! = jpj-1                                            !:   -     -      -
+   INTEGER, PUBLIC  ::   jpkm1 ! = jpk-1                                            !:   -     -      -
+   INTEGER, PUBLIC  ::   jpij  ! = jpi*jpj                                          !:  jpi x jpj
 
    !!---------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 2715)
@@ -81,4 +81,6 @@
 #if defined key_agrif
       kstp = nit000 + Agrif_Nb_Step()
+!      IF ( Agrif_Root() .and. lwp) Write(*,*) '---'
+!      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp
 # if defined key_iomput
       IF( Agrif_Nbstepint() == 0 )   CALL iom_swap
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90	(revision 2715)
@@ -13,4 +13,5 @@
    USE in_out_manager  ! I/O manager
    USE dom_oce         ! ocean space and time domain
+   USE lib_mpp         ! MPP library
 
    IMPLICIT NONE
@@ -20,7 +21,8 @@
    PUBLIC   trc_oce_rgb_read   ! routine called by traqsr.F90
    PUBLIC   trc_oce_ext_lev    ! function called by traqsr.F90 at least
- 
-   REAL(wp), PUBLIC                          ::   r_si2   !: largest depth of extinction (blue & 0.01 mg.m-3)  (RGB)
-   REAL(wp), PUBLIC , DIMENSION(jpi,jpj,jpk) ::   etot3   !: light absortion coefficient
+   PUBLIC   trc_oce_alloc      ! function called by nemogcm.F90
+
+   REAL(wp), PUBLIC                                      ::   r_si2   !: largest depth of extinction (blue & 0.01 mg.m-3)  (RGB)
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   etot3   !: light absortion coefficient
 
 #if defined key_top && defined key_pisces
@@ -53,8 +55,17 @@
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION trc_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  trc_oce_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( etot3(jpi,jpj,jpk)   , STAT= trc_oce_alloc )
+      !
+      IF( trc_oce_alloc /= 0 )   CALL ctl_warn('trc_oce_alloc: failed to allocate etot3 array')
+   END FUNCTION trc_oce_alloc
+
 
    SUBROUTINE trc_oce_rgb( prgb )
@@ -239,6 +250,6 @@
       !
       ! It is not necessary to compute anything bellow the following depth
-      zhext = prldex * ( LOG(10.e0) * zprec + LOG(pqsr_frc) )
-     
+      zhext = prldex * ( LOG(10._wp) * zprec + LOG(pqsr_frc) )
+      !
       ! Level of light extinction
       pjl = jpkm1
@@ -250,5 +261,4 @@
    END FUNCTION trc_oce_ext_lev
 
-
    !!======================================================================
 END MODULE trc_oce
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/wrk_nemo.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/wrk_nemo.F90	(revision 2715)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/wrk_nemo.F90	(revision 2715)
@@ -0,0 +1,869 @@
+MODULE wrk_nemo
+   !!======================================================================
+   !!                       ***  MODULE  wrk_nemo  ***
+   !! NEMO work space:  define and allocate work-space arrays used in 
+   !! all components of NEMO
+   !!======================================================================
+   !! History :  4.0  !  2011-01  (A Porter)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   wrk_alloc         : define in memory the work space arrays
+   !!   wrk_in_use, iwrk_in_use, wrk_in_use_xz : check the availability of a workspace 
+   !!   wrk_not_released, iwrk_not_released, wrk_not_released_xz : release the workspace
+   !!   print_in_use_list : print out the table holding which workspace arrays are currently marked as in use
+   !!   get_next_arg      : get the next argument
+   !!   wrk_stop          : act as local alternative to ctl_stop
+   !!----------------------------------------------------------------------
+   USE par_oce        ! ocean parameters
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   wrk_alloc   ! function called in nemogcm module (nemo_init routine)
+   PUBLIC   wrk_in_use, iwrk_in_use, wrk_in_use_xz                     ! function called almost everywhere
+   PUBLIC   wrk_not_released, iwrk_not_released, wrk_not_released_xz   ! function called almost everywhere
+
+   INTEGER, PARAMETER :: num_1d_wrkspaces  = 27   ! No. of 1D workspace arrays ( MAX(jpi*jpj,jpi*jpk,jpj*jpk) )
+   INTEGER, PARAMETER :: num_2d_wrkspaces  = 35   ! No. of 2D workspace arrays (jpi,jpj)
+   INTEGER, PARAMETER :: num_3d_wrkspaces  = 15   ! No. of 3D workspace arrays (jpi,jpj,jpk)
+   INTEGER, PARAMETER :: num_4d_wrkspaces  = 4    ! No. of 4D workspace arrays (jpi,jpj,jpk,jpts)
+
+   INTEGER, PARAMETER :: num_xz_wrkspaces  = 4   ! No. of 2D, xz workspace arrays (jpi,jpk)
+
+   INTEGER, PARAMETER :: num_1d_lwrkspaces = 0   ! No. of 1D logical workspace arrays
+   INTEGER, PARAMETER :: num_2d_lwrkspaces = 3   ! No. of 2D logical workspace arrays
+   INTEGER, PARAMETER :: num_3d_lwrkspaces = 1   ! No. of 3D logical workspace arrays
+   INTEGER, PARAMETER :: num_4d_lwrkspaces = 0   ! No. of 4D logical workspace arrays
+
+   INTEGER, PARAMETER :: num_1d_iwrkspaces = 0   ! No. of 1D integer workspace arrays
+   INTEGER, PARAMETER :: num_2d_iwrkspaces = 1   ! No. of 2D integer workspace arrays
+   INTEGER, PARAMETER :: num_3d_iwrkspaces = 0   ! No. of 3D integer workspace arrays
+   INTEGER, PARAMETER :: num_4d_iwrkspaces = 0   ! No. of 4D integer workspace arrays
+   ! Maximum no. of workspaces of any one dimensionality that can be
+   ! requested - MAX(num_1d_wrkspaces, num_2d_wrkspaces, num_3d_wrkspaces, num_4d_wrkspaces) 
+   INTEGER :: max_num_wrkspaces = 35
+
+   ! If adding more arrays here, remember to increment the appropriate 
+   ! num_Xd_wrkspaces parameter above and to allocate them in wrk_alloc()
+
+   !                                                               !!**  1D, REAL(wp) workspaces  **
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_1 , wrk_1d_2 , wrk_1d_3 , wrk_1d_4 , wrk_1d_5
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_6 , wrk_1d_7 , wrk_1d_8 , wrk_1d_9 , wrk_1d_10
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_11, wrk_1d_12, wrk_1d_13, wrk_1d_14, wrk_1d_15
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_16, wrk_1d_17, wrk_1d_18, wrk_1d_19, wrk_1d_20
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_21, wrk_1d_22, wrk_1d_23, wrk_1d_24, wrk_1d_25
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)      , TARGET, PUBLIC ::   wrk_1d_26, wrk_1d_27
+
+   !                                                               !!**  2D, x-y, REAL(wp) workspaces  **
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_1 , wrk_2d_2 , wrk_2d_3 , wrk_2d_4 , wrk_2d_5
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_6 , wrk_2d_7 , wrk_2d_8 , wrk_2d_9 , wrk_2d_10
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_11, wrk_2d_12, wrk_2d_13, wrk_2d_14, wrk_2d_15
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_16, wrk_2d_17, wrk_2d_18, wrk_2d_19, wrk_2d_20
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_21, wrk_2d_22, wrk_2d_23, wrk_2d_24, wrk_2d_25
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_26, wrk_2d_27, wrk_2d_28, wrk_2d_29, wrk_2d_30
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)    , TARGET, PUBLIC ::   wrk_2d_31, wrk_2d_32, wrk_2d_33, wrk_2d_34, wrk_2d_35
+
+   !                                                               !!**  2D, x-z, REAL(wp) workspaces  **
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)            , PUBLIC ::   wrk_xz_1, wrk_xz_2, wrk_xz_3, wrk_xz_4 
+   
+   !                                                               !!**  3D, x-y-z, REAL(wp) workspaces  **
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  , TARGET, PUBLIC ::   wrk_3d_1 , wrk_3d_2 , wrk_3d_3 , wrk_3d_4 , wrk_3d_5
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  , TARGET, PUBLIC ::   wrk_3d_6 , wrk_3d_7 , wrk_3d_8 , wrk_3d_9 , wrk_3d_10
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  , TARGET, PUBLIC ::   wrk_3d_11, wrk_3d_12, wrk_3d_13, wrk_3d_14, wrk_3d_15
+
+   !                                                               !!**  4D, x-y-z-tra, REAL(wp) workspaces  **
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:), TARGET, PUBLIC ::   wrk_4d_1, wrk_4d_2, wrk_4d_3, wrk_4d_4 
+   
+   !                                                               !!** 2D integer workspace  **
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:)            , PUBLIC ::   iwrk_2d_1
+
+   LOGICAL, DIMENSION(num_1d_wrkspaces)  ::   in_use_1d     !: Flags to track which 1D workspace arrays are in use  
+   LOGICAL, DIMENSION(num_2d_wrkspaces)  ::   in_use_2d     !: Flags to track which 2D workspace arrays are in use
+   LOGICAL, DIMENSION(num_3d_wrkspaces)  ::   in_use_3d     !: Flags to track which 3D workspace arrays are in use
+   LOGICAL, DIMENSION(num_4d_wrkspaces)  ::   in_use_4d     !: Flags to track which 4D workspace arrays are in use
+   LOGICAL, DIMENSION(num_xz_wrkspaces)  ::   in_use_xz     !: Flags to track which 2D, xz workspace arrays are in use
+   LOGICAL, DIMENSION(num_2d_lwrkspaces) ::   in_use_2dll   !: Flags to track which 2D, logical workspace arrays are in use
+   LOGICAL, DIMENSION(num_3d_lwrkspaces) ::   in_use_3dll   !: Flags to track which 3D, logical workspace arrays are in use
+   LOGICAL, DIMENSION(num_2d_iwrkspaces) ::   in_use_2di    !: Flags to track which 2D, integer workspace arrays are in use
+
+   ! Labels for specifying workspace type in call to print_in_use_list()
+   INTEGER, PARAMETER ::   INTEGER_TYPE = 0
+   INTEGER, PARAMETER ::   LOGICAL_TYPE = 1
+   INTEGER, PARAMETER ::   REAL_TYPE    = 2
+
+   INTEGER :: kumout  ! Local copy of numout unit number for error/warning messages
+   LOGICAL :: llwp    ! Local copy of lwp - whether we are master PE or not
+
+   CHARACTER(LEN=*), PARAMETER ::   cform_err2 = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !:
+   CHARACTER(LEN=*), PARAMETER ::   cform_war2 = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !:
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
+   !! $Id:$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+  FUNCTION wrk_alloc(iunit, lwp_arg)
+      !!----------------------------------------------------------------------
+      !!                   ***  FUNCTION wrk_alloc  ***
+      !!
+      !! ** Purpose :   Define in memory once for all the NEMO 2D, 3D and 4d 
+      !!                work space arrays
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   iunit         ! Unit no. to use for error/warning messages in this module
+      LOGICAL, INTENT(in) ::   lwp_arg       ! Value of lwp
+      !
+      INTEGER ::   wrk_alloc   ! Return value
+      INTEGER ::   extent_1d   ! Extent to allocate for 1D arrays
+      INTEGER ::   ierror(6)   ! local integer
+      !!----------------------------------------------------------------------
+      !
+      ! Save the unit number to use for err/warning messages
+      kumout = iunit
+      ! Save whether we are master PE or not (for output messages)
+      llwp = lwp_arg
+      !
+      ! Extent to use for 1D work arrays - find the maximum product of 
+      ! jpi*jpj, jpi*jpk and jpj*jpk and use that
+      IF    ( jpi < jpj .AND. jpi < jpk ) THEN   ;   extent_1d = jpj*jpk
+      ELSEIF( jpj < jpi .AND. jpj < jpk ) THEN   ;   extent_1d = jpi*jpk
+      ELSE                                       ;   extent_1d = jpi*jpj
+      ENDIF
+      !
+      ! Initialise the 'in use' flags for each work-space array
+      in_use_1d  (:) = .FALSE.
+      in_use_2d  (:) = .FALSE.
+      in_use_3d  (:) = .FALSE.
+      in_use_4d  (:) = .FALSE.
+      in_use_xz  (:) = .FALSE.
+      in_use_2dll(:) = .FALSE.
+      in_use_3dll(:) = .FALSE.
+      in_use_2di (:) = .FALSE.
+      !
+      ierror(:) = 0
+      !
+      ALLOCATE( wrk_1d_1 (extent_1d) , wrk_1d_2 (extent_1d) , wrk_1d_3 (extent_1d) , wrk_1d_4 (extent_1d) ,     &
+         &      wrk_1d_5 (extent_1d) , wrk_1d_6 (extent_1d) , wrk_1d_7 (extent_1d) , wrk_1d_8 (extent_1d) ,     &
+         &      wrk_1d_9 (extent_1d) , wrk_1d_10(extent_1d)                                               ,     &
+         &      wrk_1d_11(extent_1d) , wrk_1d_12(extent_1d) , wrk_1d_13(extent_1d) , wrk_1d_14(extent_1d) ,     &
+         &      wrk_1d_15(extent_1d) , wrk_1d_16(extent_1d) , wrk_1d_17(extent_1d) , wrk_1d_18(extent_1d) ,     &
+         &      wrk_1d_19(extent_1d) , wrk_1d_20(extent_1d)                                               ,     &
+         &      wrk_1d_21(extent_1d) , wrk_1d_22(extent_1d) , wrk_1d_23(extent_1d) , wrk_1d_24(extent_1d) ,     &
+         &      wrk_1d_25(extent_1d) , wrk_1d_26(extent_1d) , wrk_1d_27(extent_1d)                        , STAT=ierror(1) )
+         !
+      ALLOCATE( wrk_2d_1 (jpi,jpj) , wrk_2d_2 (jpi,jpj) , wrk_2d_3 (jpi,jpj) , wrk_2d_4 (jpi,jpj) ,     & 
+         &      wrk_2d_5 (jpi,jpj) , wrk_2d_6 (jpi,jpj) , wrk_2d_7 (jpi,jpj) , wrk_2d_8 (jpi,jpj) ,     &
+         &      wrk_2d_9 (jpi,jpj) , wrk_2d_10(jpi,jpj)                                           ,     &
+         &      wrk_2d_11(jpi,jpj) , wrk_2d_12(jpi,jpj) , wrk_2d_13(jpi,jpj) , wrk_2d_14(jpi,jpj) ,     &
+         &      wrk_2d_15(jpi,jpj) , wrk_2d_16(jpi,jpj) , wrk_2d_17(jpi,jpj) , wrk_2d_18(jpi,jpj) ,     &
+         &      wrk_2d_19(jpi,jpj) , wrk_2d_20(jpi,jpj)                                           ,     &
+         &      wrk_2d_21(jpi,jpj) , wrk_2d_22(jpi,jpj) , wrk_2d_23(jpi,jpj) , wrk_2d_24(jpi,jpj) ,     &
+         &      wrk_2d_25(jpi,jpj) , wrk_2d_26(jpi,jpj) , wrk_2d_27(jpi,jpj) , wrk_2d_28(jpi,jpj) ,     &
+         &      wrk_2d_29(jpi,jpj) , wrk_2d_30(jpi,jpj)                                           ,     &
+         &      wrk_2d_31(jpi,jpj) , wrk_2d_32(jpi,jpj) , wrk_2d_33(jpi,jpj) , wrk_2d_34(jpi,jpj) ,     &
+         &      wrk_2d_35(jpi,jpj)                                                                , STAT=ierror(2) )
+         !
+      ALLOCATE( wrk_3d_1 (jpi,jpj,jpk) , wrk_3d_2 (jpi,jpj,jpk) , wrk_3d_3 (jpi,jpj,jpk) , wrk_3d_4 (jpi,jpj,jpk) ,     &
+         &      wrk_3d_5 (jpi,jpj,jpk) , wrk_3d_6 (jpi,jpj,jpk) , wrk_3d_7 (jpi,jpj,jpk) , wrk_3d_8 (jpi,jpj,jpk) ,     &
+         &      wrk_3d_9 (jpi,jpj,jpk) , wrk_3d_10(jpi,jpj,jpk)                                                   ,     & 
+         &      wrk_3d_11(jpi,jpj,jpk) , wrk_3d_12(jpi,jpj,jpk) , wrk_3d_13(jpi,jpj,jpk) , wrk_3d_14(jpi,jpj,jpk) ,     & 
+         &      wrk_3d_15(jpi,jpj,jpk)                                                                            , STAT=ierror(3) )
+         !
+      ALLOCATE( wrk_4d_1(jpi,jpj,jpk,jpts) , wrk_4d_2(jpi,jpj,jpk,jpts),     &
+         &      wrk_4d_3(jpi,jpj,jpk,jpts) , wrk_4d_4(jpi,jpj,jpk,jpts), STAT=ierror(4) )
+         !
+      ALLOCATE( wrk_xz_1(jpi,jpk) , wrk_xz_2(jpi,jpk) , wrk_xz_3(jpi,jpk) , wrk_xz_4(jpi,jpk) , STAT=ierror(5) )
+         !
+      ALLOCATE( iwrk_2d_1(jpi,jpj)      , STAT=ierror(6) )
+      !
+      wrk_alloc = MAXVAL( ierror )
+      !
+      ! Calling routine, nemo_alloc(), checks for errors and takes 
+      ! appropriate action - we just print a warning message
+      IF( wrk_alloc /= 0 ) THEN
+         WRITE(kumout,cform_war2)
+         WRITE(kumout,*) 'wrk_alloc: allocation of workspace arrays failed'
+      ENDIF
+      !
+   END FUNCTION wrk_alloc
+
+
+   FUNCTION wrk_in_use( kdim,    index1,  index2,  index3,  index4,    &
+      &                 index5,  index6,  index7,  index8,  index9,    &
+      &                 index10, index11, index12, index13, index14,   &
+      &                 index15, index16, index17, index18, index19,   &
+      &                 index20, index21, index22, index23, index24,   &
+      &                 index25, index26, index27)
+      !!----------------------------------------------------------------------
+      !!                   ***  FUNCTION wrk_in_use  ***
+      !!
+      !! ** Purpose :   Request a set of KIND(wp) workspaces to use. Returns 
+      !!                .TRUE. if any of those requested are already in use, 
+      !!                .FALSE. otherwise. 
+      !!
+      !! ** Method  :   Sets internal flags to signal that requested workspaces are in use.
+      !!                key_no_workspace_check defined ==> always return FALSE
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   kdim        ! Dimensionality of requested workspace(s)
+      INTEGER          , INTENT(in) ::   index1      ! Index of first requested workspace
+      INTEGER, OPTIONAL, INTENT(in) ::             index2 , index3 , index4 , index5 , index6 , index7 , index8 , index9, index10
+      INTEGER, OPTIONAL, INTENT(in) ::   index11, index12, index13, index14, index15, index16, index17, index18, index19, index20
+      INTEGER, OPTIONAL, INTENT(in) ::   index21, index22, index23, index24, index25, index26, index27
+      !
+      LOGICAL ::   wrk_in_use      ! Return value
+      INTEGER ::   iarg, iptr   ! local integer
+      !!----------------------------------------------------------------------
+      !
+      wrk_in_use = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr    = index1
+      iarg    = 1
+      !
+      DO WHILE( .NOT. wrk_in_use .AND. iarg <= max_num_wrkspaces )
+         !
+         IF( kdim == 1 ) THEN
+            IF( iptr > num_1d_wrkspaces ) THEN
+               CALL wrk_stop('wrk_in_use - more 1D workspace arrays requested than defined in wrk_nemo module')
+               wrk_in_use = .TRUE.
+               EXIT
+            ELSEIF( in_use_1d(iptr) ) THEN
+               wrk_in_use = .TRUE.
+               CALL print_in_use_list(1, REAL_TYPE, in_use_1d)
+            ENDIF
+            in_use_1d(iptr) = .TRUE.
+            !
+         ELSEIF( kdim == 2 ) THEN
+            IF( iptr > num_2d_wrkspaces ) THEN
+               CALL wrk_stop('wrk_in_use - more 2D workspace arrays requested than defined in wrk_nemo module')
+               wrk_in_use = .TRUE.
+               EXIT
+            ELSEIF( in_use_2d(iptr) ) THEN
+               wrk_in_use = .TRUE.
+               CALL print_in_use_list(2, REAL_TYPE, in_use_2d)
+            ENDIF
+            in_use_2d(iptr) = .TRUE.
+            !
+         ELSEIF( kdim == 3 ) THEN
+            IF( iptr > num_3d_wrkspaces ) THEN
+               CALL wrk_stop( 'wrk_in_use - more 3D workspace arrays requested than defined in wrk_nemo module' )
+               wrk_in_use = .TRUE.
+               EXIT
+            ELSEIF( in_use_3d(iptr) ) THEN
+               wrk_in_use = .TRUE.
+               CALL print_in_use_list(3, REAL_TYPE, in_use_3d)
+            ENDIF
+            in_use_3d(iptr) = .TRUE.
+            !
+         ELSEIF( kdim == 4 ) THEN
+            IF(iptr > num_4d_wrkspaces)THEN
+               CALL wrk_stop( 'wrk_in_use - more 4D workspace arrays requested than defined in wrk_nemo module' )
+               wrk_in_use = .TRUE.
+               EXIT
+            ELSEIF( in_use_4d(iptr) ) THEN
+               wrk_in_use = .TRUE.
+               CALL print_in_use_list( 4, REAL_TYPE, in_use_4d )
+            ENDIF
+            !
+            in_use_4d(iptr) = .TRUE.
+            !
+         ELSE 
+            IF(llwp) WRITE(kumout,*) 'wrk_in_use: unsupported value of kdim = ',kdim
+            CALL wrk_stop( 'wrk_in_use: unrecognised value for number of dimensions' )
+         ENDIF
+
+         CALL get_next_arg( iarg  ,  iptr  ,  index2,  index3,  index4,    &
+            &               index5,  index6,  index7,  index8,  index9,    &
+            &               index10, index11, index12, index13, index14,   &
+            &               index15, index16, index17, index18, index19,   &
+            &               index20, index21, index22, index23, index24,   &
+            &               index25, index26, index27)
+
+         IF( iarg == -1 ) THEN      ! We've checked all of the arguments and are done
+            EXIT
+         ELSEIF( iarg == -99 ) THEN
+            CALL wrk_stop( 'wrk_in_use : caught unexpected argument count - BUG' )
+            EXIT
+         ENDIF
+         !
+      END DO ! end of DO WHILE()
+#endif
+      !
+   END FUNCTION wrk_in_use
+
+
+   FUNCTION iwrk_in_use( kdim, index1, index2, index3, index4,   &
+      &                        index5, index6, index7 )
+      !!----------------------------------------------------------------------
+      !!                   ***  FUNCTION iwrk_in_use  ***
+      !!
+      !! ** Purpose :   Request a set of INTEGER workspaces to use. Returns 
+      !!                .TRUE. if any of those requested are already in use, 
+      !!                .FALSE. otherwise. 
+      !!
+      !! ** Method  :   Sets internal flags to signal that requested workspaces
+      !!                are in use.
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   kdim        ! Dimensionality of requested workspace(s)
+      INTEGER          , INTENT(in) ::   index1      ! Index of first requested workspace
+      INTEGER, OPTIONAL, INTENT(in) ::   index2, index3, index4, index5, index6, index7
+      !
+      LOGICAL ::   iwrk_in_use    ! Return value
+      INTEGER ::   iarg, iptr
+      !!----------------------------------------------------------------------
+      !
+      iwrk_in_use = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr     = index1
+      iarg     = 1
+      !
+      DO WHILE( .NOT.iwrk_in_use .AND. iarg <= max_num_wrkspaces )
+         !
+         IF( kdim == 2 ) THEN
+            IF( iptr > num_2d_wrkspaces ) THEN
+               CALL wrk_stop( 'wrk_in_use - more 2D workspace arrays requested than defined in wrk_nemo module' )
+               iwrk_in_use = .TRUE.
+            ELSEIF( in_use_2di(iptr) ) THEN
+               iwrk_in_use = .TRUE.
+               CALL print_in_use_list( 2, INTEGER_TYPE, in_use_2di )
+            ENDIF
+            in_use_2di(iptr) = .TRUE.
+            !
+         ELSE
+            IF(llwp) WRITE(kumout,*) 'iwrk_in_use: unsupported value of kdim = ',kdim
+            CALL wrk_stop('iwrk_in_use: unsupported value for number of dimensions')
+         ENDIF
+         !
+         SELECT CASE (iarg)         ! Move on to next optional argument
+         CASE ( 1 )
+            IF( .NOT. PRESENT(index2) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 2   ;   iptr = index2
+            ENDIF
+         CASE ( 2 )
+            IF( .NOT. PRESENT(index3) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 3   ;   iptr = index3
+            ENDIF
+         CASE ( 3 )
+            IF( .NOT. PRESENT(index4) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 4   ;   iptr = index4
+            ENDIF
+         CASE ( 4 )
+            IF( .NOT. PRESENT(index5) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 5   ;   iptr = index5
+            ENDIF
+         CASE ( 5 )
+            IF( .NOT. PRESENT(index6) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 6   ;   iptr = index6
+            ENDIF
+         CASE ( 6 )
+            IF( .NOT. PRESENT(index7) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 7   ;   iptr = index7
+            ENDIF
+         CASE ( 7 )
+            EXIT
+         CASE DEFAULT
+            CALL wrk_stop( 'iwrk_in_use : caught unexpected argument count - BUG' )
+            EXIT
+         END SELECT
+         !
+      END DO ! end of DO WHILE()
+#endif
+      !
+   END FUNCTION iwrk_in_use
+
+
+   FUNCTION wrk_in_use_xz( index1, index2, index3, index4,   &
+      &                    index5, index6, index7, index8, index9 )
+      !!----------------------------------------------------------------------
+      !!                   ***  FUNCTION wrk_in_use_xz  ***
+      !!
+      !! ** Purpose :   Request a set of 2D, xz (jpi,jpk) workspaces to use. 
+      !!                Returns .TRUE. if any of those requested are already in
+      !!                use, .FALSE. otherwise. 
+      !!
+      !! ** Method  :   Sets internal flags to signal that requested workspaces
+      !!                are in use.
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   index1      ! Index of first requested workspace
+      INTEGER, OPTIONAL, INTENT(in) ::   index2, index3, index4, index5
+      INTEGER, OPTIONAL, INTENT(in) ::   index6, index7, index8, index9
+      !
+      LOGICAL ::   wrk_in_use_xz   ! Return value
+      INTEGER ::   iarg, iptr      ! local integer
+      !!----------------------------------------------------------------------
+      !
+      wrk_in_use_xz = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr = index1
+      iarg = 1
+      !
+      DO WHILE( .NOT. wrk_in_use_xz .AND. iarg <= max_num_wrkspaces )
+         !
+         IF( iptr > num_xz_wrkspaces ) THEN
+            CALL wrk_stop('wrk_in_use_xz - more 2D xz workspace arrays requested than defined in wrk_nemo module')
+            wrk_in_use_xz = .TRUE.
+            EXIT
+         ELSE IF( in_use_xz(iptr) ) THEN
+            wrk_in_use_xz = .TRUE.
+            CALL print_in_use_list(2, REAL_TYPE, in_use_xz) !ARPDBG - bug
+         ENDIF
+         !
+         in_use_xz(iptr) = .TRUE.
+         !
+         CALL get_next_arg( iarg  , iptr  , index2, index3, index4,   &
+            &               index5, index6, index7, index8, index9 )
+         !
+         IF( iarg == -1 ) THEN      ! We've checked all of the arguments and are done
+            EXIT
+         ELSEIF( iarg == -99 ) THEN
+            CALL wrk_stop( 'wrk_in_use_xz : caught unexpected argument count - BUG' )   ;   EXIT
+         ENDIF
+         !
+      END DO ! while( (.NOT. wrk_in_use_xz) .AND. iarg <= max_num_wrkspaces)
+#endif
+      !
+   END FUNCTION wrk_in_use_xz
+
+
+   FUNCTION wrk_not_released( kdim,    index1,  index2,  index3,  index4,  &
+      &                       index5,  index6,  index7,  index8,  index9,  &
+      &                       index10, index11, index12, index13, index14, &
+      &                       index15, index16, index17, index18, index19, &
+      &                       index20, index21, index22, index23, index24, &
+      &                       index25, index26, index27)
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION wrk_not_released  ***
+      !!
+      !! ** Purpose :   Flag that the specified workspace arrays are no-longer
+      !!                in use.
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   kdim             ! Dimensionality of workspace(s)
+      INTEGER          , INTENT(in) ::   index1           ! Index of 1st workspace to release
+      INTEGER, OPTIONAL, INTENT(in) ::            index2 , index3 , index4 , index5 , index6 , index7 , index8 , index9 , index10
+      INTEGER, OPTIONAL, INTENT(in) ::   index11, index12, index13, index14, index15, index16, index17, index18, index19, index20
+      INTEGER, OPTIONAL, INTENT(in) ::   index21, index22, index23, index24, index25, index26, index27
+      !
+      LOGICAL ::   wrk_not_released   ! Return value
+      INTEGER ::   iarg, iptr
+      !!----------------------------------------------------------------------
+      !
+      wrk_not_released = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr = index1
+      iarg = 1
+      !
+      DO WHILE( iarg <= max_num_wrkspaces )
+         !
+         IF( kdim == 1 ) THEN
+            IF( iptr > num_1d_wrkspaces ) THEN
+               CALL wrk_stop( 'wrk_not_released : attempt to release a non-existent 1D workspace array' )
+               wrk_not_released = .TRUE.
+            ELSE
+               in_use_1d(iptr) = .FALSE.
+            ENDIF
+            !
+         ELSE IF(kdim == 2) THEN
+            IF( iptr > num_2d_wrkspaces ) THEN
+               CALL wrk_stop( 'wrk_not_released : attempt to release a non-existent 2D workspace array' )
+               wrk_not_released = .TRUE.
+            ENDIF
+            in_use_2d(iptr) = .FALSE.
+            !
+         ELSEIF( kdim == 3 ) THEN
+            IF( iptr > num_3d_wrkspaces ) THEN
+               CALL wrk_stop('wrk_not_released : attempt to release a non-existent 3D workspace array')
+               wrk_not_released = .TRUE.
+            ENDIF
+            in_use_3d(iptr) = .FALSE.
+            !
+          ELSEIF( kdim == 4 ) THEN
+            IF( iptr > num_4d_wrkspaces ) THEN
+               CALL wrk_stop('wrk_not_released : attempt to release a non-existent 4D workspace array')
+               wrk_not_released = .TRUE.
+            ENDIF
+            in_use_4d(iptr) = .FALSE.
+            !
+         ELSE 
+            IF(llwp) WRITE(kumout,*) 'wrk_not_released: unsupported value of kdim = ',kdim
+            CALL wrk_stop('wrk_not_released: unrecognised value for number of dimensions')
+         ENDIF
+         !
+         ! Move on to next optional argument
+         CALL get_next_arg( iarg  ,  iptr  ,  index2,  index3,  index4,   &
+            &               index5,  index6,  index7,  index8,  index9,   &
+            &               index10, index11, index12, index13,           &
+            &               index14, index15, index16, index17,           &
+            &               index18, index19, index20, index21,           &
+            &               index22, index23, index24, index25,           &
+            &               index26, index27 )
+
+         IF( iarg == -1 ) THEN      ! We've checked all of the arguments and are done
+            EXIT
+         ELSEIF( iarg == -99 ) THEN
+             CALL wrk_stop('wrk_not_released - caught unexpected argument count - BUG')   ;   EXIT
+         ENDIF
+         !
+      END DO ! end of DO WHILE()
+#endif
+      !
+   END FUNCTION wrk_not_released
+
+
+   FUNCTION iwrk_not_released( kdim, index1, index2, index3, index4,   &
+      &                              index5, index6, index7 )
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION iwrk_not_released  ***
+      !!
+      !! ** Purpose :   Flag that the specified INTEGER workspace arrays are
+      !!                no-longer in use.
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   kdim             ! Dimensionality of workspace(s)
+      INTEGER          , INTENT(in) ::   index1           ! Index of 1st workspace to release
+      INTEGER, OPTIONAL, INTENT(in) ::   index2, index3, index4, index5, index6, index7
+      !
+      LOGICAL :: iwrk_not_released   ! Return value
+      INTEGER :: iarg, iptr          ! local integer
+      !!----------------------------------------------------------------------
+      !
+      iwrk_not_released = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr = index1
+      iarg = 1
+      !
+      DO WHILE(iarg <= max_num_wrkspaces)
+         !
+         IF( kdim == 2 ) THEN
+            IF( iptr > num_2d_iwrkspaces ) THEN
+               CALL wrk_stop('iwrk_not_released : attempt to release a non-existant 2D workspace array')
+               iwrk_not_released = .TRUE.
+            ENDIF
+            in_use_2di(iptr) = .FALSE.
+         ELSE 
+            IF(llwp) WRITE(kumout,*) 'iwrk_not_released: unsupported value of kdim = ',kdim
+            CALL wrk_stop('iwrk_not_released: unsupported value for number of dimensions')
+         ENDIF
+         !
+         ! Move on to next optional argument
+         SELECT CASE (iarg)
+         CASE ( 1 )
+            IF( .NOT. PRESENT(index2) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 2   ;   iptr = index2
+            ENDIF
+         CASE ( 2 )
+            IF( .NOT. PRESENT(index3) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 3   ;   iptr = index3
+            ENDIF
+         CASE ( 3 )
+            IF( .NOT. PRESENT(index4) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 4   ;   iptr = index4
+            ENDIF
+         CASE ( 4 )
+            IF( .NOT. PRESENT(index5) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 5   ;   iptr = index5
+            ENDIF
+         CASE ( 5 )
+            IF( .NOT. PRESENT(index6) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 6   ;   iptr = index6
+            ENDIF
+         CASE ( 6 )
+            IF( .NOT. PRESENT(index7) ) THEN   ;   EXIT
+            ELSE                               ;   iarg = 7   ;   iptr = index7
+            ENDIF
+         CASE ( 7 )
+            EXIT
+         CASE DEFAULT
+            CALL wrk_stop( 'iwrk_not_released : caught unexpected argument count - BUG' )
+            EXIT
+         END SELECT
+         !
+      END DO ! end of DO WHILE()
+#endif
+      !
+   END FUNCTION iwrk_not_released
+
+
+   FUNCTION wrk_not_released_xz( index1, index2, index3, index4, index5,   &
+      &                          index6, index7, index8, index9 )
+      !!----------------------------------------------------------------------
+      !!                 ***  FUNCTION wrk_not_released_xz  ***
+      !!
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(in) ::   index1   ! Index of 1st workspace to release
+      INTEGER, OPTIONAL, INTENT(in) ::   index2, index3, index4, index5, index6, index7, index8, index9
+      !
+      LOGICAL ::   wrk_not_released_xz   ! Return value
+      INTEGER ::   iarg, iptr            ! local integer
+      !!----------------------------------------------------------------------
+      !
+      wrk_not_released_xz = .FALSE.
+      !
+#if ! defined   key_no_workspace_check   ||   ! defined   key_agrif
+      ! NB: check not available with AGRIF
+      !
+      iptr           = index1
+      iarg           = 1
+      !
+      DO WHILE( iarg <= max_num_wrkspaces )
+         !
+         IF( iptr > num_xz_wrkspaces ) THEN
+            CALL wrk_stop('wrk_not_released_xz : attempt to release a non-existant 2D xz workspace array')
+            wrk_not_released_xz = .TRUE.
+            EXIT
+         ENDIF
+         in_use_xz(iptr) = .FALSE.
+         !
+         ! Move on to next optional argument
+         CALL get_next_arg( iarg, iptr, index2, index3, index4,   &
+            &                           index5, index6, index7, index8, index9)
+         !
+         IF(  iarg == -1 ) THEN     ! We've checked all of the arguments and are done
+            EXIT
+         ELSEIF( iarg == -99 ) THEN
+            CALL wrk_stop('wrk_not_released_xz : caught unexpected argument count - BUG')
+            EXIT
+         ENDIF
+         !
+      END DO ! while (iarg <= max_num_wrkspaces)
+#endif
+      !
+   END FUNCTION wrk_not_released_xz
+
+
+   SUBROUTINE print_in_use_list( kdim, itype, in_use_list )
+      !!----------------------------------------------------------------------
+      !!                 *** ROUTINE print_in_use_list ***
+      !!
+      !! ** Purpose:   to print out the table holding which workspace arrays
+      !!             are currently marked as in use.
+      !!----------------------------------------------------------------------
+      INTEGER,               INTENT(in) :: kdim
+      INTEGER,               INTENT(in) :: itype
+      LOGICAL, DIMENSION(:), INTENT(in) :: in_use_list
+      !
+      INTEGER          ::   ji, icount
+      CHARACTER(LEN=7) ::   type_string
+      !!----------------------------------------------------------------------
+      !
+      IF(.NOT. llwp)   RETURN
+      !
+      SELECT CASE ( kdim )
+      !
+      CASE (1)
+         SELECT CASE (itype)
+         CASE (INTEGER_TYPE)   ;   icount = num_1d_iwrkspaces
+         CASE (LOGICAL_TYPE)   ;   icount = num_1d_lwrkspaces
+         CASE (REAL_TYPE   )   ;   icount = num_1d_wrkspaces
+         END SELECT
+         !
+      CASE (2)
+         SELECT CASE (itype)
+         CASE (INTEGER_TYPE)   ;   icount = num_2d_iwrkspaces
+         CASE (LOGICAL_TYPE)   ;   icount = num_2d_lwrkspaces
+         CASE (REAL_TYPE   )   ;   icount = num_2d_wrkspaces
+         END SELECT
+         !
+      CASE (3)
+         SELECT CASE (itype)
+         CASE (INTEGER_TYPE)   ;   icount = num_3d_iwrkspaces
+         CASE (LOGICAL_TYPE)   ;   icount = num_3d_lwrkspaces
+         CASE (REAL_TYPE   )   ;   icount = num_3d_wrkspaces
+         END SELECT
+         !
+      CASE (4)
+         SELECT CASE (itype)
+         CASE (INTEGER_TYPE)   ;   icount = num_4d_iwrkspaces
+         CASE (LOGICAL_TYPE)   ;   icount = num_4d_lwrkspaces
+         CASE (REAL_TYPE   )   ;   icount = num_4d_wrkspaces
+         END SELECT
+         !
+      CASE DEFAULT   ;   RETURN
+      !
+      END SELECT
+      !
+      ! Set character string with type of workspace
+      SELECT CASE (itype)
+      CASE (INTEGER_TYPE)   ;   type_string = "INTEGER" 
+      CASE (LOGICAL_TYPE)   ;   type_string = "LOGICAL"
+      CASE (REAL_TYPE   )   ;   type_string = "REAL" 
+      END SELECT
+      !
+      WRITE(kumout,*)
+      WRITE(kumout,"('------------------------------------------')")
+      WRITE(kumout,"('Table of ',I1,'D ',(A),' workspaces currently in use:')") kdim, TRIM(type_string)
+      WRITE(kumout,"('Workspace   In use')")
+      DO ji = 1, icount, 1
+         WRITE(kumout,"(4x,I2,8x,L1)") ji, in_use_list(ji)
+      END DO
+      WRITE(kumout,"('------------------------------------------')")
+      WRITE(kumout,*)
+      !
+   END SUBROUTINE print_in_use_list
+
+
+   SUBROUTINE get_next_arg( iargidx, iargval, index2,  index3,  index4,  &
+      &                     index5 , index6,  index7,  index8,  index9,  &
+      &                     index10, index11, index12, index13, index14, &
+      &                     index15, index16, index17, index18, index19, &
+      &                     index20, index21, index22, index23, index24, &
+      &                     index25, index26, index27 )
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(inout) ::   iargidx   ! Index of current arg
+      INTEGER          , INTENT(inout) ::   iargval   ! Value of current arg
+      INTEGER, OPTIONAL, INTENT(in   ) ::            index2 , index3 , index4 , index5 , index6 , index7 , index8 , index9 , index10
+      INTEGER, OPTIONAL, INTENT(in   ) ::   index11, index12, index13, index14, index15, index16, index17, index18, index19, index20
+      INTEGER, OPTIONAL, INTENT(in   ) ::   index21, index22, index23, index24, index25, index26, index27
+      !!----------------------------------------------------------------------
+      !
+      SELECT CASE (iargidx)       ! Move on to next optional argument
+      CASE ( 1 )
+         IF( .NOT. PRESENT(index2 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  2   ;   iargval = index2
+         ENDIF
+      CASE ( 2 )
+         IF( .NOT. PRESENT(index3 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  3   ;   iargval = index3
+         ENDIF
+      CASE ( 3 )
+         IF( .NOT. PRESENT(index4 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  4   ;   iargval = index4
+         ENDIF
+      CASE ( 4 )
+         IF( .NOT. PRESENT(index5 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  5   ;   iargval = index5
+         ENDIF
+      CASE ( 5 )
+         IF( .NOT. PRESENT(index6 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  6   ;   iargval = index6
+         ENDIF
+      CASE ( 6 )
+         IF( .NOT. PRESENT(index7 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  7   ;   iargval = index7
+         ENDIF
+      CASE ( 7 )
+         IF( .NOT. PRESENT(index8 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  8   ;   iargval = index8
+         ENDIF
+      CASE ( 8 )
+         IF( .NOT. PRESENT(index9 ) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  9   ;   iargval = index9
+         ENDIF
+      CASE ( 9 )
+         IF( .NOT. PRESENT(index10) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 10   ;   iargval = index10
+         ENDIF
+      CASE ( 10 )
+         IF( .NOT. PRESENT(index11) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 11   ;   iargval = index11
+         ENDIF
+      CASE ( 11 )
+         IF( .NOT. PRESENT(index12) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 12   ;   iargval = index12
+         ENDIF
+      CASE ( 12 )
+         IF( .NOT. PRESENT(index13) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx =  13   ;   iargval = index13
+         ENDIF
+      CASE ( 13 )
+         IF( .NOT. PRESENT(index14) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 14   ;   iargval = index14
+         ENDIF
+      CASE ( 14 )
+         IF( .NOT. PRESENT(index15) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 15   ;   iargval = index15
+         ENDIF
+      CASE ( 15 )
+         IF( .NOT. PRESENT(index16) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 16   ;   iargval = index16
+         ENDIF
+      CASE ( 16 )
+         IF( .NOT. PRESENT(index17) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 17   ;   iargval = index17
+         ENDIF
+      CASE ( 17 )
+         IF( .NOT. PRESENT(index18) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 18   ;   iargval = index18
+         ENDIF
+      CASE ( 18 )
+         IF( .NOT. PRESENT(index19) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 19   ;   iargval = index19
+         ENDIF
+      CASE ( 19 )
+         IF( .NOT. PRESENT(index20) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 20   ;   iargval = index20
+         ENDIF
+      CASE ( 20 )
+         IF( .NOT. PRESENT(index21) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 21   ;   iargval = index21
+         ENDIF
+      CASE ( 21 )
+         IF( .NOT. PRESENT(index22) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 22   ;   iargval = index22
+         ENDIF
+      CASE ( 22 )
+         IF( .NOT. PRESENT(index23) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 23   ;   iargval = index23
+         ENDIF
+      CASE ( 23 )
+         IF( .NOT. PRESENT(index24) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 24   ;   iargval = index24
+         ENDIF
+      CASE ( 24 )
+         IF( .NOT. PRESENT(index25) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 25   ;   iargval = index25
+         ENDIF
+      CASE ( 25 )
+         IF( .NOT. PRESENT(index26) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 26   ;   iargval = index26
+         ENDIF
+      CASE ( 26 )
+         IF( .NOT. PRESENT(index27) ) THEN   ;   iargidx = -1
+         ELSE                                ;   iargidx = 27   ;   iargval = index27
+         ENDIF
+      CASE ( 27 )
+         iargidx = -1
+      CASE DEFAULT
+         ! BUG - iargidx shouldn't take any other values!
+         ! Flag error for calling routine
+         iargidx = -99
+      END SELECT
+      !
+   END SUBROUTINE get_next_arg
+
+
+   SUBROUTINE wrk_stop(cmsg)
+      !!----------------------------------------------------------------------
+      !!               ***  ROUTINE wrk_stop  ***
+      !! ** Purpose :   to act as local alternative to ctl_stop. 
+      !!                Avoids dependency on in_out_manager module.
+      !!----------------------------------------------------------------------
+      CHARACTER(LEN=*), INTENT(in) :: cmsg
+      !!----------------------------------------------------------------------
+      !
+      WRITE(kumout, cform_err2)
+      WRITE(kumout,*) TRIM(cmsg)
+      ! ARPDBG - would like to call mppstop here to force a stop but that
+      ! introduces a dependency on lib_mpp. Could call mpi_abort() directly
+      ! but that's fairly brutal. Better to rely on calling routine to
+      ! deal with the error passed back from the wrk_X routine?
+      !CALL mppstop
+      !
+   END SUBROUTINE wrk_stop
+
+   !!=====================================================================
+END MODULE wrk_nemo
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/par_c14b.F90	(revision 2715)
@@ -5,8 +5,4 @@
    !!======================================================================
    !! History :   2.0  !  2008-12  (C. Ethe, G. Madec)  revised architecture
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
    USE par_lobster, ONLY : jp_lobster      !: number of tracers in LOBSTER
@@ -55,6 +51,6 @@
 
    ! Starting/ending C14 do-loop indices (N.B. no C14 : jp_c14b0 > jp_c14b1 the do-loop are never done)
-   INTEGER, PUBLIC, PARAMETER ::   jp_c14b0     = jp_lb + 1                !: First index of C14 tracer
-   INTEGER, PUBLIC, PARAMETER ::   jp_c14b1     = jp_lb + jp_c14b          !: Last  index of C14 tracer
+   INTEGER, PUBLIC, PARAMETER ::   jp_c14b0     = jp_lb     + 1            !: First index of C14 tracer
+   INTEGER, PUBLIC, PARAMETER ::   jp_c14b1     = jp_lb     + jp_c14b      !: Last  index of C14 tracer
    INTEGER, PUBLIC, PARAMETER ::   jp_c14b0_2d  = jp_lb_2d  + 1            !: First index of C14 tracer
    INTEGER, PUBLIC, PARAMETER ::   jp_c14b1_2d  = jp_lb_2d  + jp_c14b_2d   !: Last  index of C14 tracer
@@ -64,4 +60,8 @@
    INTEGER, PUBLIC, PARAMETER ::   jp_c14b1_trd = jp_lb_trd + jp_c14b_trd  !: Last  index of C14 tracer
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE par_c14b
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90	(revision 2715)
@@ -4,6 +4,6 @@
    !! TOP :   initialisation of the C14 bomb tracer
    !!======================================================================
-   !! History : Original ! 2005-10  (Z. Lachkar) 
-   !!               2.0  ! 2007-12  (C. Ethe ) 
+   !! History :  1.0  ! 2005-10  (Z. Lachkar) Original code
+   !!            2.0  ! 2007-12  (C. Ethe) 
    !!----------------------------------------------------------------------
 #if defined key_c14b
@@ -17,5 +17,4 @@
    USE trc             ! TOP variables
    USE trcsms_c14b     ! C14 sms trends
-   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
@@ -24,26 +23,21 @@
    PUBLIC   trc_ini_c14b   ! called by trcini.F90 module
 
-   INTEGER  ::   &     ! With respect to data file !!
-     jpybeg = 1765 , & !: starting year for C14
-     jpyend = 2002     !: ending year for C14
-
-   INTEGER  ::   &   
-      nrec   ,  & ! number of year in CO2 Concentrations file
-      nmaxrec 
-
-   INTEGER  ::   inum1, inum2               ! unit number
-
-   REAL(wp) ::     &
-     ys40 = -40. ,    &             ! 40 degrees south
-     ys20 = -20. ,    &             ! 20 degrees south
-     yn20 =  20. ,    &             ! 20 degrees north
-     yn40 =  40.                    ! 40 degrees north
-
-   !!---------------------------------------------------------------------
+   !                             ! With respect to data file !!
+   INTEGER  ::   jpybeg = 1765   ! starting year for C14
+   INTEGER  ::   jpyend = 2002   ! ending year for C14
+   INTEGER  ::   nrec            ! number of year in CO2 Concentrations file
+   INTEGER  ::   nmaxrec 
+   INTEGER  ::   inum1, inum2    ! unit number
+
+   REAL(wp) ::   ys40 = -40.     ! 40 degrees south
+   REAL(wp) ::   ys20 = -20.     ! 20 degrees south
+   REAL(wp) ::   yn20 =  20.     ! 20 degrees north
+   REAL(wp) ::   yn40 =  40.     ! 40 degrees north
+
+   !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -59,6 +53,8 @@
       !!----------------------------------------------------------------------
 
-      !  Control consitency
-      CALL trc_ctl_c14b
+      !                     ! Allocate C14b arrays
+      IF( trc_sms_c14b_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_ini_c14b : unable to allocate C14b arrays' )
+
+      CALL trc_ctl_c14b     !  Control consitency
 
       IF(lwp) WRITE(numout,*) ''
@@ -69,5 +65,5 @@
       ! Initialization of boundaries conditions
       ! --------------------------------------- 
-      qtr_c14(:,:) = 0.e0
+      qtr_c14(:,:) = 0._wp
       
       ! Initialization of qint in case of  no restart 
@@ -78,6 +74,6 @@
             WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero '
          ENDIF
-         trn     (:,:,:,jpc14) = 0.e0
-         qint_c14(:,:        ) = 0.e0
+         trn     (:,:,:,jpc14) = 0._wp
+         qint_c14(:,:        ) = 0._wp
       ENDIF
 
@@ -156,13 +152,13 @@
                  fareaz(ji,jj,3) = 0.
             ENDIF
-          END DO
-        END DO
-
+         END DO
+      END DO
       !
       IF(lwp) WRITE(numout,*) 'Initialization of C14 bomb tracer done'
       IF(lwp) WRITE(numout,*) ' '
-
+      !
    END SUBROUTINE trc_ini_c14b
-   
+
+
    SUBROUTINE trc_ctl_c14b
       !!----------------------------------------------------------------------
@@ -179,11 +175,11 @@
       ! Check number of tracers
       ! -----------------------   
-      IF( jp_c14b > 1) CALL ctl_stop( ' Change jp_c14b to be equal 1 in par_c14b.F90' )
+      IF( jp_c14b > 1)   CALL ctl_stop( ' Change jp_c14b to be equal 1 in par_c14b.F90' )
 
       ! Check tracer names
       ! ------------------
-      IF ( ctrcnm(jpc14) /= 'C14B' ) THEN
-           ctrcnm(jpc14)  = 'C14B'
-           ctrcnl(jpc14)  = 'Bomb C14 concentration'
+      IF( ctrcnm(jpc14) /= 'C14B' ) THEN
+          ctrcnm(jpc14)  = 'C14B'
+          ctrcnl(jpc14)  = 'Bomb C14 concentration'
       ENDIF
 
@@ -197,5 +193,5 @@
       ! ------------------
       IF( ctrcun(jpc14) /= 'ration' ) THEN
-          ctrcun(jpc14) = 'ration'
+          ctrcun(jpc14)  = 'ration'
           IF(lwp) THEN
              CALL ctl_warn( ' we force tracer unit' )
@@ -206,4 +202,5 @@
       !
    END SUBROUTINE trc_ctl_c14b
+   
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90	(revision 2715)
@@ -16,5 +16,4 @@
    USE trc             ! TOP variables
    USE trcsms_c14b     ! C14b specific variable
-   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcrst_c14b.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcrst_c14b.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcrst_c14b.F90	(revision 2715)
@@ -17,5 +17,4 @@
    USE trc             ! TOP variables
    USE trcsms_c14b          ! c14b sms trends
-   USE in_out_manager  ! I/O manager
    USE iom
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 2715)
@@ -4,7 +4,8 @@
    !! TOP : Bomb C14 main module
    !!======================================================================
-   !! History     -   ! 1994-05 ( J. Orr ) origial code
+   !! History     -   ! 1994-05 ( J. Orr ) original code
    !!            1.0  ! 2006-02 ( J.M. Molines )  Free form + modularity
    !!            2.0  ! 2008-12 ( C. Ethe ) reorganisation
+   !!            4.0  ! 2011-02 ( A.R. Porter, STFC Daresbury ) Dynamic memory
    !!----------------------------------------------------------------------
 #if defined key_c14b
@@ -12,20 +13,19 @@
    !!   'key_c14b'                                         Bomb C14 tracer
    !!----------------------------------------------------------------------
-   !!   trc_sms_c14b  :  compute and add C14 suface forcing to C14 trends
-   !!----------------------------------------------------------------------
-   USE oce_trc      ! Ocean variables
-   USE par_trc      ! TOP parameters
-   USE trc          ! TOP variables
+   !!   trc_sms_c14b :  compute and add C14 suface forcing to C14 trends
+   !!----------------------------------------------------------------------
+   USE oce_trc       ! Ocean variables
+   USE par_trc       ! TOP parameters
+   USE trc           ! TOP variables
    USE trdmod_oce
    USE trdmod_trc
-   USE iom
+   USE iom           ! I/O library
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC   trc_sms_c14b       ! called in ???    
-
-   !! * Module variables
+   PUBLIC   trc_sms_c14b       ! called in trcsms.F90
+   PUBLIC   trc_sms_c14b_alloc ! called in trcini_c14b.F90
+
    INTEGER , PUBLIC, PARAMETER ::   jpmaxrec  = 240           ! temporal parameter 
    INTEGER , PUBLIC, PARAMETER ::   jpmaxrec2 = 2 * jpmaxrec  ! 
@@ -37,104 +37,91 @@
    INTEGER , PUBLIC    ::   nyear_beg        ! initial year (aa) 
 
-   REAL(wp), PUBLIC, DIMENSION(jpmaxrec,jpzon) ::  bomb   !: C14 atm data (3 zones)
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj ,jpzon) ::  fareaz !: Spatial Interpolation Factors
-   REAL(wp), PUBLIC, DIMENSION(jpmaxrec2)      ::  spco2  !: Atmospheric CO2
+   REAL(wp), PUBLIC,                    DIMENSION(jpmaxrec,jpzon) ::   bomb       !: C14 atm data (3 zones)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)          ::   fareaz     !: Spatial Interpolation Factors
+   REAL(wp), PUBLIC,                    DIMENSION(jpmaxrec2)      ::   spco2      !: Atmospheric CO2
   
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   qtr_c14      !: flux at surface
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)     ::   qint_c14     !: cumulative flux
-
-   REAL(wp) :: xlambda, xdecay, xaccum       ! C14 decay coef.  
-
-   REAL(wp) ::   xconv1 = 1.0          ! conversion from to 
-   REAL(wp) ::   xconv2 = 0.01/3600.   ! conversion from cm/h to m/s: 
-   REAL(wp) ::   xconv3 = 1.0e+3       ! conversion from mol/l/atm to mol/m3/atm
-
-  !! * Substitutions
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)            ::   qtr_c14    !: flux at surface
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)            ::   qint_c14   !: cumulative flux
+
+   REAL(wp) ::   xlambda, xdecay, xaccum       ! C14 decay coef.  
+   REAL(wp) ::   xconv1 = 1._wp                ! conversion from to 
+   REAL(wp) ::   xconv2 = 0.01_wp / 3600._wp   ! conversion from cm/h to m/s: 
+   REAL(wp) ::   xconv3 = 1.e+3_wp             ! conversion from mol/l/atm to mol/m3/atm
+
+   !! * Substitutions
 #  include "top_substitute.h90"
 
-  !!----------------------------------------------------------------------
-  !!  TOP 1.0 , LOCEAN-IPSL (2005) 
-  !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/trcc14bomb.F90,v 1.2 2005/11/14 16:42:43 opalod Exp $ 
-  !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
-  !!----------------------------------------------------------------------
-
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/SMS/trcc14bomb.F90,v 1.2 2005/11/14 16:42:43 opalod Exp $ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
-  SUBROUTINE trc_sms_c14b( kt )
-     !!----------------------------------------------------------------------
-     !!                  ***  ROUTINE trc_sms_c14b  ***
-     !!
-     !! ** Purpose :   Compute the surface boundary contition on C14bomb
-     !!      passive tracer associated with air-mer fluxes and add it to 
-     !!      the general trend of tracers equations.
-     !!
-     !! ** Original comments from J. Orr :
-     !!
-     !!      Calculates the input of Bomb C-14 to the surface layer of OPA
-     !!
-     !!      James Orr, LMCE, 28 October 1992
-     !!
-     !!      Initial approach mimics that of Toggweiler, Dixon, & Bryan (1989)
-     !!      (hereafter referred to as TDB) with constant gas exchange,
-     !!      although in this case, a perturbation approach is used for
-     !!      bomb-C14 so that both the ocean and atmosphere begin at zero.
-     !!      This saves tremendous amounts of computer time since no
-     !!      equilibrum run is first required (i.e., for natural C-14).
-     !!      Note: Many sensitivity tests can be run with this approach and
-     !!            one never has to make a run for natural C-14; otherwise,
-     !!            a run for natural C-14 must be run each time that one
-     !!            changes a model parameter!
-     !!
-     !!
-     !!      19 August 1993: Modified to consider Atmospheric C-14 fom IPCC.
-     !!      That is, the IPCC has provided a C-14 atmospheric record (courtesy
-     !!      of Martin Heimann) for model calibration.  This model spans from
-     !!      preindustrial times to present, in a format different than that
-     !!      given by TDB.  It must be converted to the ORR C-14 units used
-     !!      here, although in this case, the perturbation includes not only
-     !!      bomb C-14 but changes due to the Suess effect.
-     !!
-     !!----------------------------------------------------------------------
-     !! * Arguments
-     INTEGER, INTENT( in ) ::   kt    ! ocean time-step index
-
-     !! * Local declarations
-     INTEGER ::  &
-       ji, jj, jk, jz
-
-     INTEGER ::   &
-       iyear_beg,              &
-       iyear_beg1, iyear_end1, &
-       imonth1, im1, im2,      &
-       iyear_beg2, iyear_end2, &
-       imonth2, in1, in2
-         
-     REAL(wp), DIMENSION(jpi,jpj) ::  & 
-       zatmbc14
-
-     REAL(wp), DIMENSION(jpzon)   ::  &
-       zonbc14              !: time interp atm C14
-
-     REAL(wp) ::     &
-       zpco2at              !: time interp atm C02
-
-     REAL(wp) ::     &      !: dummy variables
-       zt, ztp, zsk, &
-       zsol ,        &      !: solubility
-       zsch ,        &      !: schmidt number
-       zv2  ,        &      !: wind speed ( square)
-       zpv  ,        &      !: piston velocity 
-       zdemi, ztra
-#if defined key_diatrc  && defined key_iomput
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d
-#endif
-      !!----------------------------------------------------------------------
-
-      IF( kt == nit000 )  THEN
-         ! Computation of decay coeffcient
-         zdemi   = 5730.
+   SUBROUTINE trc_sms_c14b( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_sms_c14b  ***
+      !!
+      !! ** Purpose :   Compute the surface boundary contition on C14bomb
+      !!      passive tracer associated with air-mer fluxes and add it to 
+      !!      the general trend of tracers equations.
+      !!
+      !! ** Original comments from J. Orr :
+      !!
+      !!      Calculates the input of Bomb C-14 to the surface layer of OPA
+      !!
+      !!      James Orr, LMCE, 28 October 1992
+      !!
+      !!      Initial approach mimics that of Toggweiler, Dixon, & Bryan (1989)
+      !!      (hereafter referred to as TDB) with constant gas exchange,
+      !!      although in this case, a perturbation approach is used for
+      !!      bomb-C14 so that both the ocean and atmosphere begin at zero.
+      !!      This saves tremendous amounts of computer time since no
+      !!      equilibrum run is first required (i.e., for natural C-14).
+      !!      Note: Many sensitivity tests can be run with this approach and
+      !!            one never has to make a run for natural C-14; otherwise,
+      !!            a run for natural C-14 must be run each time that one
+      !!            changes a model parameter!
+      !!
+      !!
+      !!      19 August 1993: Modified to consider Atmospheric C-14 fom IPCC.
+      !!      That is, the IPCC has provided a C-14 atmospheric record (courtesy
+      !!      of Martin Heimann) for model calibration.  This model spans from
+      !!      preindustrial times to present, in a format different than that
+      !!      given by TDB.  It must be converted to the ORR C-14 units used
+      !!      here, although in this case, the perturbation includes not only
+      !!      bomb C-14 but changes due to the Suess effect.
+      !!
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zatmbc14 => wrk_2d_1
+      USE wrk_nemo, ONLY:   zw3d     => wrk_3d_1
+      !
+      INTEGER, INTENT(in) ::   kt    ! ocean time-step index
+      !
+      INTEGER :: ji, jj, jk, jz     ! dummy loop indices 
+      INTEGER :: iyear_beg , iyear_beg1, iyear_end1 
+      INTEGER :: iyear_beg2, iyear_end2 
+      INTEGER :: imonth1, im1, in1 
+      INTEGER :: imonth2, im2, in2 
+      REAL(wp), DIMENSION(jpzon) :: zonbc14       !: time interp atm C14 
+      REAL(wp)                   :: zpco2at       !: time interp atm C02 
+      REAL(wp) :: zt, ztp, zsk      ! dummy variables
+      REAL(wp) :: zsol              ! solubility
+      REAL(wp) :: zsch              ! schmidt number
+      REAL(wp) :: zv2               ! wind speed ( square)
+      REAL(wp) :: zpv               ! piston velocity 
+      REAL(wp) :: zdemi, ztra
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('trc_sms_c14b : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      IF( kt == nit000 )  THEN         ! Computation of decay coeffcient
+         zdemi   = 5730._wp
          xlambda = LOG(2.) / zdemi / ( nyear_len(1) * rday )
          xdecay  = EXP( - xlambda * rdt )
-         xaccum  = 1.0 -  xdecay
+         xaccum  = 1._wp -  xdecay
       ENDIF
 
@@ -206,11 +193,7 @@
       !  (zonmean), computes area-weighted mean to give the atmospheric C-14
       !  ----------------------------------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            zatmbc14(ji,jj) =   zonbc14(1) * fareaz(ji,jj,1)  &
-                 &           +  zonbc14(2) * fareaz(ji,jj,2)  &
-                 &           +  zonbc14(3) * fareaz(ji,jj,3)
-         END DO
-      END DO
+      zatmbc14(:,:) = zonbc14(1) * fareaz(:,:,1)   &
+         &          + zonbc14(2) * fareaz(:,:,2)   &
+         &          + zonbc14(3) * fareaz(:,:,3)
       
       ! time interpolation of CO2 concentrations to it time step  
@@ -218,5 +201,5 @@
            &     + spco2(iyear_end2) * FLOAT( in2 ) ) / 6.
 
-      IF (lwp) THEN
+      IF(lwp) THEN
           WRITE(numout, *) 'time : ', kt, ' CO2 year begin/end :',iyear_beg2,'/',iyear_end2,   &
           &                ' CO2 concen : ',zpco2at 
@@ -238,7 +221,7 @@
                zsol = EXP( -60.2409 + 93.4517 / ztp  + 23.3585 * LOG( ztp ) + zsk * tsn(ji,jj,1,jp_sal) )
                ! convert solubilities [mol/(l * atm)] -> [mol/(m^3 * ppm)]
-               zsol = zsol * 1.0e-03
+               zsol = zsol * 1.e-03
             ELSE
-               zsol = 0.
+               zsol = 0._wp
             ENDIF
 
@@ -307,18 +290,32 @@
       CALL iom_put( "fdecay" , zw3d )
 #endif
-      IF( l_trdtrc ) THEN
-         CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt )   ! save trends
-      END IF
-
-    END SUBROUTINE trc_sms_c14b
+      IF( l_trdtrc )   CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt )   ! save trends
+
+      IF( wrk_not_released(2, 1) .OR.   &
+          wrk_not_released(3, 1) )   CALL ctl_stop('trc_sms_c14b : failed to release workspace arrays')
+      !
+   END SUBROUTINE trc_sms_c14b
+
+
+   INTEGER FUNCTION trc_sms_c14b_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_sms_c14b_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( fareaz  (jpi,jpj ,jpzon) ,     &
+         &      qtr_c14 (jpi,jpj)        ,     &
+         &      qint_c14(jpi,jpj)        , STAT=trc_sms_c14b_alloc )
+         !
+      IF( trc_sms_c14b_alloc /= 0 )   CALL ctl_warn('trc_sms_c14b_alloc: failed to allocate arrays')
+      !
+   END FUNCTION trc_sms_c14b_alloc
 
 #else
-    !!----------------------------------------------------------------------
-    !!   Default option                                         Dummy module
-    !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   Default option                                         Dummy module
+   !!----------------------------------------------------------------------
 CONTAINS
-  SUBROUTINE trc_sms_c14b( kt )       ! Empty routine
-    WRITE(*,*) 'trc_freons: You should not have seen this print! error?', kt
-  END SUBROUTINE trc_sms_c14b
+   SUBROUTINE trc_sms_c14b( kt )       ! Empty routine
+      WRITE(*,*) 'trc_freons: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_sms_c14b
 #endif
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90	(revision 2715)
@@ -15,6 +15,5 @@
    USE par_trc         ! TOP parameters
    USE trc             ! TOP variables
-   USE trcsms_cfc          ! CFC sms trends
-   USE in_out_manager  ! I/O manager
+   USE trcsms_cfc      ! CFC sms trends
 
    IMPLICIT NONE
@@ -34,5 +33,4 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -45,6 +43,6 @@
       !! ** Method  : - Read the namcfc namelist and check the parameter values
       !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj, jn, jl, jm, js
-      REAL(wp) ::   zyy  ,  zyd
+      INTEGER  ::  ji, jj, jn, jl, jm, js
+      REAL(wp) ::  zyy, zyd
       !!----------------------------------------------------------------------
 
@@ -53,13 +51,16 @@
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
 
+      !                                ! Allocate CFC arrays
+      IF( trc_sms_cfc_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' )
+
 
       ! Initialization of boundaries conditions
       ! --------------------------------------- 
-      xphem (:,:)    = 0.e0
-      p_cfc(:,:,:)   = 0.e0
+      xphem (:,:)    = 0._wp
+      p_cfc(:,:,:)   = 0._wp
       
       ! Initialization of qint in case of  no restart 
       !----------------------------------------------
-      qtr_cfc(:,:,:) = 0.e0
+      qtr_cfc(:,:,:) = 0._wp
       IF( .NOT. ln_rsttr ) THEN    
          IF(lwp) THEN
@@ -67,8 +68,8 @@
             WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero '
          ENDIF
-         qint_cfc(:,:,:) = 0.e0
+         qint_cfc(:,:,:) = 0._wp
          DO jl = 1, jp_cfc
             jn = jp_cfc0 + jl - 1
-            trn     (:,:,:,jn) = 0.e0
+            trn(:,:,:,jn) = 0._wp
          END DO
       ENDIF
@@ -116,6 +117,5 @@
          WRITE(numout,*) ' Year   p11HN    p11HS    p12HN    p12HS '
          DO jn = 30, 100
-            WRITE(numout, '( 1I4, 4F9.2)')   &
-               &         jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2)
+            WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2)
          END DO
       ENDIF
@@ -135,8 +135,7 @@
       END DO
       !
-
       IF(lwp) WRITE(numout,*) 'Initialization of CFC tracers done'
       IF(lwp) WRITE(numout,*) ' '
-
+      !
    END SUBROUTINE trc_ini_cfc
    
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 2715)
@@ -16,5 +16,4 @@
    USE trc             ! TOP variables
    USE trcsms_cfc      ! CFC specific variable
-   USE in_out_manager  ! I/O manager
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcrst_cfc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcrst_cfc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcrst_cfc.F90	(revision 2715)
@@ -17,5 +17,4 @@
    USE trc             ! TOP variables
    USE trcsms_cfc          ! CFC sms trends
-   USE in_out_manager  ! I/O manager
    USE iom
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 2715)
@@ -4,7 +4,7 @@
    !! TOP : CFC main model
    !!======================================================================
-   !! History :    -   !  1999-10  (JC. Dutay)  original code
-   !!             1.0  !  2004-03 (C. Ethe) free form + modularity
-   !!             2.0  !  2007-12  (C. Ethe, G. Madec)  reorganisation
+   !! History :  OPA  !  1999-10  (JC. Dutay)  original code
+   !!  NEMO      1.0  !  2004-03  (C. Ethe) free form + modularity
+   !!            2.0  !  2007-12  (C. Ethe, G. Madec)  reorganisation
    !!----------------------------------------------------------------------
 #if defined key_cfc
@@ -12,18 +12,19 @@
    !!   'key_cfc'                                               CFC tracers
    !!----------------------------------------------------------------------
-   !!   trc_sms_cfc     :  compute and add CFC suface forcing to CFC trends
-   !!   trc_cfc_cst :  sets constants for CFC surface forcing computation
-   !!----------------------------------------------------------------------
-   USE oce_trc      ! Ocean variables
-   USE par_trc      ! TOP parameters
-   USE trc          ! TOP variables
+   !!   trc_sms_cfc  :  compute and add CFC suface forcing to CFC trends
+   !!   trc_cfc_cst  :  sets constants for CFC surface forcing computation
+   !!----------------------------------------------------------------------
+   USE oce_trc       ! Ocean variables
+   USE par_trc       ! TOP parameters
+   USE trc           ! TOP variables
    USE trdmod_oce
    USE trdmod_trc
-   USE iom
+   USE iom           ! I/O library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   trc_sms_cfc       ! called in ???    
+   PUBLIC   trc_sms_cfc         ! called in ???    
+   PUBLIC   trc_sms_cfc_alloc   ! called in trcini_cfc.F90
 
    INTEGER , PUBLIC, PARAMETER ::   jpyear = 150   ! temporal parameter 
@@ -34,8 +35,8 @@
    INTEGER , PUBLIC    ::   npyear         ! Number of years read in CFC1112 file
    
-   REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2    ) ::   p_cfc    ! partial hemispheric pressure for CFC          
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj)              ::   xphem    ! spatial interpolation factor for patm
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj     ,jp_cfc) ::   qtr_cfc  ! flux at surface
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj     ,jp_cfc) ::   qint_cfc ! cumulative flux 
+   REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2    )      ::   p_cfc    ! partial hemispheric pressure for CFC
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   xphem    ! spatial interpolation factor for patm
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_cfc  ! flux at surface
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qint_cfc ! cumulative flux 
 
    REAL(wp), DIMENSION(4,2) ::   soa   ! coefficient for solubility of CFC [mol/l/atm]
@@ -54,7 +55,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -75,10 +75,12 @@
       !!                CFC concentration in pico-mol/m3
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt    ! ocean time-step index
-      !!
-      INTEGER ::   ji, jj, jn, jl, jm, js
-      INTEGER ::   iyear_beg, iyear_end
-      INTEGER ::   im1, im2
-
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrcfc => wrk_3d_1        ! use for CFC sms trend
+      !
+      INTEGER, INTENT(in) ::   kt    ! ocean time-step index
+      !
+      INTEGER  ::   ji, jj, jn, jl, jm, js
+      INTEGER  ::   iyear_beg, iyear_end
+      INTEGER  ::   im1, im2
       REAL(wp) ::   ztap, zdtap        
       REAL(wp) ::   zt1, zt2, zt3, zv2
@@ -88,8 +90,10 @@
       REAL(wp) ::   zca_cfc   ! concentration at equilibrium
       REAL(wp) ::   zak_cfc   ! transfert coefficients
-
-      REAL(wp), DIMENSION(jphem,jp_cfc)   ::   zpatm       ! atmospheric function
-      REAL(wp), DIMENSION(jpi,jpj,jpk)    ::   ztrcfc      ! use for CFC sms trend
-      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jphem,jp_cfc) ::   zpatm   ! atmospheric function
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('trc_sms_cfc: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )   CALL trc_cfc_cst
@@ -175,10 +179,10 @@
 #if defined key_diatrc 
       ! Save diagnostics , just for CFC11
-# if ! defined key_iomput
+# if  defined key_iomput
+      CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) )
+      CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) )
+# else
       trc2d(:,:,jp_cfc0_2d    ) = qtr_cfc (:,:,1)
       trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1)
-# else
-      CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) )
-      CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) )
 # endif
 #endif
@@ -190,6 +194,9 @@
           END DO
       END IF
-
+      !
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('trc_sms_cfc: failed to release workspace array')
+      !
    END SUBROUTINE trc_sms_cfc
+
 
    SUBROUTINE trc_cfc_cst
@@ -200,45 +207,57 @@
       !!---------------------------------------------------------------------
 
-
-        ! coefficient for CFC11 
-        !----------------------
-
-        ! Solubility
-        soa(1,1) = -229.9261 
-        soa(2,1) =  319.6552
-        soa(3,1) =  119.4471
-        soa(4,1) =  -1.39165
-
-        sob(1,1) =  -0.142382
-        sob(2,1) =   0.091459
-        sob(3,1) =  -0.0157274
-
-        ! Schmidt number 
-        sca(1,1) = 3501.8
-        sca(2,1) = -210.31
-        sca(3,1) =  6.1851
-        sca(4,1) = -0.07513
-
-        ! coefficient for CFC12 
-        !----------------------
-
-        ! Solubility
-        soa(1,2) = -218.0971
-        soa(2,2) =  298.9702
-        soa(3,2) =  113.8049
-        soa(4,2) =  -1.39165
-
-        sob(1,2) =  -0.143566
-        sob(2,2) =   0.091015
-        sob(3,2) =  -0.0153924
-
-        ! schmidt number 
-        sca(1,2) =  3845.4 
-        sca(2,2) =  -228.95
-        sca(3,2) =  6.1908 
-        sca(4,2) =  -0.067430
+      ! coefficient for CFC11 
+      !----------------------
+
+      ! Solubility
+      soa(1,1) = -229.9261 
+      soa(2,1) =  319.6552
+      soa(3,1) =  119.4471
+      soa(4,1) =  -1.39165
+
+      sob(1,1) =  -0.142382
+      sob(2,1) =   0.091459
+      sob(3,1) =  -0.0157274
+
+      ! Schmidt number 
+      sca(1,1) = 3501.8
+      sca(2,1) = -210.31
+      sca(3,1) =  6.1851
+      sca(4,1) = -0.07513
+
+      ! coefficient for CFC12 
+      !----------------------
+
+      ! Solubility
+      soa(1,2) = -218.0971
+      soa(2,2) =  298.9702
+      soa(3,2) =  113.8049
+      soa(4,2) =  -1.39165
+
+      sob(1,2) =  -0.143566
+      sob(2,2) =   0.091015
+      sob(3,2) =  -0.0153924
+
+      ! schmidt number 
+      sca(1,2) =  3845.4 
+      sca(2,2) =  -228.95
+      sca(3,2) =  6.1908 
+      sca(4,2) =  -0.067430
 
    END SUBROUTINE trc_cfc_cst
-   
+
+
+   INTEGER FUNCTION trc_sms_cfc_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_sms_cfc_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( xphem   (jpi,jpj)        ,     &
+         &      qtr_cfc (jpi,jpj,jp_cfc) ,     &
+         &      qint_cfc(jpi,jpj,jp_cfc) , STAT=trc_sms_cfc_alloc )
+         !
+      IF( trc_sms_cfc_alloc /= 0 ) CALL ctl_warn('trc_sms_cfc_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION trc_sms_cfc_alloc
+
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/sms_lobster.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/sms_lobster.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/sms_lobster.F90	(revision 2715)
@@ -4,27 +4,23 @@
    !! TOP :   LOBSTER 1 Source Minus Sink variables
    !!----------------------------------------------------------------------
-   !! History :    -   !  1999-09 (M. Levy)  original code
-   !!              -   !  2000-12 (O. Aumont, E. Kestenare) add sediment 
-   !!             1.0  !  2005-10 (C. Ethe) F90
-   !!             1.0  !  2005-03  (A-S Kremeur) add fphylab, fzoolab, fdetlab, fdbod
-   !!              -   !  2005-06  (A-S Kremeur) add sedpocb, sedpocn, sedpoca
-   !!             2.0  !  2007-04  (C. Deltel, G. Madec) Free form and modules
+   !! History :  OPA  !  1999-09  (M. Levy)  original code
+   !!             -   !  2000-12  (O. Aumont, E. Kestenare) add sediment 
+   !!   NEMO     1.0  !  2005-10  (C. Ethe) F90
+   !!             -   !  2005-03  (A-S Kremeur) add fphylab, fzoolab, fdetlab, fdbod
+   !!             -   !  2005-06  (A-S Kremeur) add sedpocb, sedpocn, sedpoca
+   !!            2.0  !  2007-04  (C. Deltel, G. Madec) Free form and modules
    !!----------------------------------------------------------------------
-
 #if defined key_lobster
    !!----------------------------------------------------------------------
    !!   'key_lobster'                                         LOBSTER model
    !!----------------------------------------------------------------------
-   USE par_oce
-   USE par_trc
+   USE par_oce    ! ocean parameters
+   USE par_trc    ! passive tracer parameters
+   USE lib_mpp    ! MPP library
 
    IMPLICIT NONE
    PUBLIC
 
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
+   PUBLIC   sms_lobster_alloc   ! called in trcini_lobster.F90
 
    !!  biological parameters
@@ -76,19 +72,19 @@
    REAL(wp) ::   fdbod    !: zooplankton mortality fraction that goes to detritus
 
-   REAL(wp), DIMENSION(jpk,jp_lobster) ::   remdmp   !: depth dependant damping coefficient of passive tracers 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   remdmp   !: depth dependant damping coefficient of passive tracers 
    
    !! Optical parameters                                
    !! ------------------                                
-   REAL(wp) ::   xkr0       !: water coefficient absorption in red      (NAMELIST)
-   REAL(wp) ::   xkg0       !: water coefficient absorption in green    (NAMELIST)
-   REAL(wp) ::   xkrp       !: pigment coefficient absorption in red    (NAMELIST)
-   REAL(wp) ::   xkgp       !: pigment coefficient absorption in green  (NAMELIST)
-   REAL(wp) ::   xlr        !: exposant for pigment absorption in red   (NAMELIST)
-   REAL(wp) ::   xlg        !: exposant for pigment absorption in green (NAMELIST)
-   REAL(wp) ::   rpig       !: chla/chla+phea ratio                     (NAMELIST)
+   REAL(wp) ::   xkr0     !: water coefficient absorption in red      (NAMELIST)
+   REAL(wp) ::   xkg0     !: water coefficient absorption in green    (NAMELIST)
+   REAL(wp) ::   xkrp     !: pigment coefficient absorption in red    (NAMELIST)
+   REAL(wp) ::   xkgp     !: pigment coefficient absorption in green  (NAMELIST)
+   REAL(wp) ::   xlr      !: exposant for pigment absorption in red   (NAMELIST)
+   REAL(wp) ::   xlg      !: exposant for pigment absorption in green (NAMELIST)
+   REAL(wp) ::   rpig     !: chla/chla+phea ratio                     (NAMELIST)
                                                         
-   INTEGER , DIMENSION(jpi,jpj)     ::   neln    !: number of levels in the euphotic layer
-   REAL(wp), DIMENSION(jpi,jpj)     ::   xze     !: euphotic layer depth
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xpar    !: par (photosynthetic available radiation)
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   neln   !: number of levels in the euphotic layer
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   xze    !: euphotic layer depth
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xpar   !: par (photosynthetic available radiation)
 
    !! Sediment parameters                               
@@ -98,13 +94,40 @@
    REAL(wp) ::   areacot      !: ???
                                                         
-   REAL(wp), DIMENSION(jpi,jpj)     ::   dminl   !: fraction of sinking POC released in sediments
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   dmin3   !: fraction of sinking POC released at each level
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   dminl     !: fraction of sinking POC released in sediments
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dmin3     !: fraction of sinking POC released at each level
                                                         
-   REAL(wp), DIMENSION(jpi,jpj) ::   sedpocb     !: mass of POC in sediments
-   REAL(wp), DIMENSION(jpi,jpj) ::   sedpocn     !: mass of POC in sediments
-   REAL(wp), DIMENSION(jpi,jpj) ::   sedpoca     !: mass of POC in sediments
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sedpocb   !: mass of POC in sediments
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sedpocn   !: mass of POC in sediments
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sedpoca   !: mass of POC in sediments
                                                         
-   REAL(wp), DIMENSION(jpi,jpj) ::   fbod        !: rapid sinking particles
-   REAL(wp), DIMENSION(jpi,jpj) ::   cmask       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   fbod      !: rapid sinking particles
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   cmask     !: ???
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION sms_lobster_alloc()
+      !!----------------------------------------------------------------------
+      !!        *** ROUTINE sms_lobster_alloc ***
+      !!----------------------------------------------------------------------
+      !
+      ALLOCATE(                                                                   &
+         !*  Biological parameters
+         &      remdmp(jpk,jp_lobster)                                      ,     &
+         !*  Optical parameters
+         &      neln   (jpi,jpj) , xze    (jpi,jpj)     , xpar(jpi,jpj,jpk) ,     &
+         !*  Sediment parameters
+         &      dminl  (jpi,jpj) , dmin3  (jpi,jpj,jpk)                     ,     &
+         &      sedpocb(jpi,jpj) , sedpocn(jpi,jpj)     , sedpoca(jpi,jpj)  ,     &
+         &      fbod   (jpi,jpj) , cmask  (jpi,jpj)                         , STAT=sms_lobster_alloc ) 
+         !
+      IF( lk_mpp                 )   CALL mpp_sum ( sms_lobster_alloc )
+      IF( sms_lobster_alloc /= 0 )   CALL ctl_warn('sms_lobster_alloc: failed to allocate arrays')
+      !
+   END FUNCTION sms_lobster_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 2715)
@@ -60,4 +60,7 @@
       !!              for passive tracers are saved for futher diagnostics.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use,  wrk_not_released
+      USE wrk_nemo, ONLY: wrk_3d_2, wrk_4d_1
+      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       !!
@@ -75,10 +78,20 @@
 #endif
 #if defined key_diatrc && defined key_iomput
-      REAL(wp), DIMENSION(jpi,jpj,17)     :: zw2d
-      REAL(wp), DIMENSION(jpi,jpj,jpk,3) :: zw3d
+      REAL(wp), POINTER,   DIMENSION(:,:,:) :: zw2d
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zw3d
 #endif
       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   ztrbio
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
+
+#if defined key_diatrc && defined key_iomput
+      IF( ( wrk_in_use(3, 2) ) .OR. ( wrk_in_use(4, 1) ) ) THEN
+         CALL ctl_stop('trc_bio : requested workspace arrays unavailable.')
+         RETURN
+      END IF
+      ! Set-up pointers into sub-arrays of workspaces
+      zw2d => wrk_3d_2(:,:,1:17)
+      zw3d => wrk_4d_1(:,:,:,1:3)
+#endif
 
       IF( kt == nit000 ) THEN
@@ -90,11 +103,12 @@
       fbod(:,:) = 0.e0
 #if defined key_diatrc && ! defined key_iomput
+#  if defined key_iomput
+      zw2d  (:,:,:) = 0.e0
+      zw3d(:,:,:,:) = 0.e0
+#  else
       DO jl = jp_lob0_2d, jp_lob1_2d
          trc2d(:,:,jl) = 0.e0
       END DO 
-#endif
-#if defined key_diatrc && defined key_iomput
-      zw2d(:,:,:) = 0.e0
-      zw3d(:,:,:,:) = 0.e0
+#  endif
 #endif
 
@@ -485,5 +499,10 @@
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
       ENDIF
-
+      !
+#if defined key_diatrc && defined key_iomput
+      IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(4, 1) ) )  &
+        &   CALL ctl_stop('trc_bio : failed to release workspace arrays.')
+#endif
+      !
    END SUBROUTINE trc_bio
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90	(revision 2715)
@@ -101,5 +101,5 @@
             sedpoca(ji,jj) = ( zwork + dminl(ji,jj) * fbod(ji,jj)   &
                &           - sedlam * sedpocn(ji,jj) - sedlostpoc * sedpocn(ji,jj) ) * rdt
-            zgeolpoc = zgeolpoc + sedlostpoc * sedpocn(ji,jj) * e1t(ji,jj) * e2t(ji,jj)
+            zgeolpoc = zgeolpoc + sedlostpoc * sedpocn(ji,jj) * e1e2t(ji,jj)
          END DO
       END DO
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcini_lobster.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcini_lobster.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcini_lobster.F90	(revision 2715)
@@ -4,7 +4,7 @@
    !! TOP :   initialisation of the LOBSTER biological model
    !!======================================================================
-   !! History :    -   !  1999-09  (M. Levy) Original code
+   !! History :   OPA  !  1999-09  (M. Levy) Original code
    !!              -   !  2000-12  (0. Aumont, E. Kestenare) add sediment 
-   !!             1.0  !  2004-03  (C. Ethe) Modularity
+   !!   NEMO      1.0  !  2004-03  (C. Ethe) Modularity
    !!              -   !  2005-03  (O. Aumont, A. El Moussaoui) F90
    !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) from trcini.lobster1.h90
@@ -21,6 +21,4 @@
    USE trc
    USE lbclnk 
-   USE lib_mpp 
-   USE lib_fortran 
 
    IMPLICIT NONE
@@ -33,7 +31,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -43,13 +40,14 @@
       !! ** purpose :   specific initialisation for LOBSTER bio-model
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zrro => wrk_2d_1 , zdm0 => wrk_3d_1
+      !!
       INTEGER  ::   ji, jj, jk, jn
       REAL(wp) ::   ztest, zfluo, zfluu
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zrro
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdm0
       !!----------------------------------------------------------------------
-
-      !  Control consitency
-      CALL trc_ctl_lobster
-
+      !
+      IF(  wrk_in_use(2, 1)  .OR.  wrk_in_use(3, 1)  )  THEN
+         CALL ctl_stop('trc_ini_lobster: requested workspace arrays unavailable')   ;  RETURN
+      ENDIF
 
       IF(lwp) WRITE(numout,*)
@@ -57,8 +55,13 @@
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~'
 
+      !                                ! Allocate LOBSTER arrays
+      IF( sms_lobster_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_ini_lobster: unable to allocate LOBSTER arrays' )
+
+
+
       ! initialization of fields for optical model
       ! --------------------------------------------
-      xze (:,:)   = 5.e0
-      xpar(:,:,:) = 0.e0
+      xze (:,:)   = 5._wp
+      xpar(:,:,:) = 0._wp
 
       ! initialization for passive tracer remineralisation-damping  array
@@ -70,7 +73,6 @@
 
       IF(lwp) THEN
-         WRITE(numout,*) ' '
-         WRITE(numout,*) ' trcini: compute remineralisation-damping  '
-         WRITE(numout,*) '         arrays for tracers'
+         WRITE(numout,*)
+         WRITE(numout,*) ' trcini: compute remineralisation-damping arrays for tracers'
       ENDIF
 
@@ -82,19 +84,19 @@
       ! ------------------------------------------------------------
 
-      zdm0   = 0.e0
-      zrro = 1.e0
-      DO jk = jpkb,jpkm1
-         DO jj =1, jpj
-            DO ji =1, jpi
+      zdm0 = 0._wp
+      zrro = 1._wp
+      DO jk = jpkb, jpkm1
+         DO jj = 1, jpj
+            DO ji = 1, jpi
                zfluo = ( fsdepw(ji,jj,jk  ) / fsdepw(ji,jj,jpkb) )**xhr 
                zfluu = ( fsdepw(ji,jj,jk+1) / fsdepw(ji,jj,jpkb) )**xhr
-               IF( zfluo.GT.1. )   zfluo = 1.e0
+               IF( zfluo.GT.1. )   zfluo = 1._wp
                zdm0(ji,jj,jk) = zfluo - zfluu
-               IF( jk <= jpkb-1 )   zdm0(ji,jj,jk) = 0.e0
+               IF( jk <= jpkb-1 )   zdm0(ji,jj,jk) = 0._wp
                zrro(ji,jj) = zrro(ji,jj) - zdm0(ji,jj,jk)
             END DO
          END DO
       END DO
-
+      !
       zdm0(:,:,jpk) = zrro(:,:)
 
@@ -103,12 +105,12 @@
       ! contains total fraction, which has passed to the upper layers)
       ! ----------------------------------------------------------------------
-      dminl = 0.
-      dmin3 = zdm0
+      dminl(:,:)   = 0._wp
+      dmin3(:,:,:) = zdm0
       DO jk = 1, jpk
          DO jj = 1, jpj
             DO ji = 1, jpi
-               IF( tmask(ji,jj,jk) == 0. ) THEN
+               IF( tmask(ji,jj,jk) == 0._wp ) THEN
                   dminl(ji,jj) = dminl(ji,jj) + dmin3(ji,jj,jk)
-                  dmin3(ji,jj,jk) = 0.e0
+                  dmin3(ji,jj,jk) = 0._wp
                ENDIF
             END DO
@@ -118,5 +120,5 @@
       DO jj = 1, jpj
          DO ji = 1, jpi
-            IF( tmask(ji,jj,1) == 0 )   dmin3(ji,jj,1) = 0.e0
+            IF( tmask(ji,jj,1) == 0 )   dmin3(ji,jj,1) = 0._wp
          END DO
       END DO
@@ -124,11 +126,11 @@
       ! Coastal mask 
       ! ------------   
-      cmask(:,:) = 0.e0
+      cmask(:,:) = 0._wp
       DO ji = 2, jpi-1
          DO jj = 2, jpj-1
-            if (tmask(ji,jj,1) == 1) then
+            IF( tmask(ji,jj,1) == 1._wp ) THEN
                ztest=tmask(ji+1,jj,1)*tmask(ji-1,jj,1)*tmask(ji,jj+1,1)*tmask(ji,jj-1,1)
-               IF (ztest == 0) cmask(ji,jj) = 1.
-            endif
+               IF( ztest == 0 )   cmask(ji,jj) = 1._wp
+            ENDIF
          END DO
       END DO
@@ -138,5 +140,5 @@
       ! Coastal surface
       ! ---------------
-      areacot = glob_sum( e1t(:,:) * e2t(:,:) * cmask(:,:) )
+      areacot = glob_sum( e1e2t(:,:) * cmask(:,:) )
 
       ! Initialization of tracer concentration in case of  no restart 
@@ -220,5 +222,6 @@
          trn(:,:,30,jp_lob_no3) = 20.01 * tmask(:,:,30)
 
-# elif defined key_gyre
+
+# elif defined key_gyre || defined key_orca_r2
          ! LOBSTER initialisation for GYRE
          ! ----------------------
@@ -245,76 +248,14 @@
 
       !  initialize the POC in sediments
-      sedpocb(:,:) = 0.e0
-      sedpocn(:,:) = 0.e0
-      sedpoca(:,:) = 0.e0
-
-
+      sedpocb(:,:) = 0._wp
+      sedpocn(:,:) = 0._wp
+      sedpoca(:,:) = 0._wp
+      !
       IF(lwp) WRITE(numout,*) 'Initialization of LOBSTER tracers done'
-      IF(lwp) WRITE(numout,*) ' '
-
-
+      !
+      IF(  wrk_not_released(2, 1)  .OR.   &
+           wrk_not_released(3, 1)   )   CALL ctl_stop('trc_ini_lobster: failed to release workspace arrays')
+      !
    END SUBROUTINE trc_ini_lobster
-
-   SUBROUTINE trc_ctl_lobster
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_ctl_lobster  ***
-      !!
-      !! ** Purpose :   control the cpp options, namelist and files 
-      !!----------------------------------------------------------------------
-      INTEGER :: jl, jn
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) ' use LOBSTER biological model '
-
-      ! Check number of tracers
-      ! -----------------------
-      IF( jp_lobster /= 6 ) CALL ctl_stop( ' LOBSTER has 6 passive tracers. Change jp_lobster in par_lobster.F90' )
-
-      ! Check tracer names
-      ! ------------------
-      IF(   ctrcnm(jp_lob_det) /= 'DET' .OR. ctrcnm(jp_lob_zoo) /= 'ZOO' .OR.   &
-         &  ctrcnm(jp_lob_phy) /= 'PHY' .OR. ctrcnm(jp_lob_no3) /= 'NO3' .OR.   &
-         &  ctrcnm(jp_lob_nh4) /= 'NH4' .OR. ctrcnm(jp_lob_dom) /= 'DOM' .OR.   &
-         &  ctrcnl(jp_lob_det) /= 'Detritus'                        .OR.   &
-         &  ctrcnl(jp_lob_zoo) /= 'Zooplankton concentration'       .OR.   &
-         &  ctrcnl(jp_lob_phy) /= 'Phytoplankton concentration'     .OR.   &
-         &  ctrcnl(jp_lob_no3) /= 'Nitrate concentration'           .OR.   &
-         &  ctrcnl(jp_lob_nh4) /= 'Ammonium concentration'          .OR.   &
-         &  ctrcnl(jp_lob_dom) /= 'Dissolved organic matter' ) THEN
-         ctrcnm(jp_lob_det)='DET'
-         ctrcnl(jp_lob_det)='Detritus'
-         ctrcnm(jp_lob_zoo)='ZOO'
-         ctrcnl(jp_lob_zoo)='Zooplankton concentration'
-         ctrcnm(jp_lob_phy)='PHY'
-         ctrcnl(jp_lob_phy)='Phytoplankton concentration'
-         ctrcnm(jp_lob_no3)='NO3'
-         ctrcnl(jp_lob_no3)='Nitrate concentration'
-         ctrcnm(jp_lob_nh4)='NH4'
-         ctrcnl(jp_lob_nh4)='Ammonium concentration'
-         ctrcnm(jp_lob_dom)='DOM'
-         ctrcnl(jp_lob_dom)='Dissolved organic matter'
-         IF(lwp) THEN
-            CALL ctl_warn( ' We force tracer names ' )
-            DO jl = 1, jp_lobster
-               jn = jp_lob0 + jl - 1
-               WRITE(numout,*) ' tracer nb: ',jn,' name = ',ctrcnm(jn), ctrcnl(jn)
-            END DO
-            WRITE(numout,*) ' '
-         ENDIF
-      ENDIF
-
-      ! Check tracer units
-      DO jl = 1, jp_lobster
-         jn = jp_lob0 + jl - 1
-         IF( ctrcun(jn) /= 'mmole-N/m3') THEN
-            ctrcun(jn) = 'mmole-N/m3'
-            IF(lwp) THEN
-               CALL ctl_warn( ' We force tracer units ' )
-               WRITE(numout,*) ' tracer  ',ctrcnm(jn), 'UNIT= ',ctrcun(jn)
-            ENDIF
-         ENDIF
-      END DO
-
-   END SUBROUTINE trc_ctl_lobster
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcnam_lobster.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcnam_lobster.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcnam_lobster.F90	(revision 2715)
@@ -10,11 +10,10 @@
    !!   'key_lobster'   :                                 LOBSTER bio-model
    !!----------------------------------------------------------------------
-   !! trc_nam_lobster      : LOBSTER model namelist read
-   !!----------------------------------------------------------------------
-   USE oce_trc         ! Ocean variables
-   USE par_trc         ! TOP parameters
-   USE trc             ! TOP variables
-   USE sms_lobster     ! sms trends
-   USE in_out_manager  ! I/O manager
+   !! trc_nam_lobster   : LOBSTER model namelist read
+   !!----------------------------------------------------------------------
+   USE oce_trc          ! Ocean variables
+   USE par_trc          ! TOP parameters
+   USE trc              ! TOP variables
+   USE sms_lobster      ! sms trends
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90	(revision 2715)
@@ -52,4 +52,10 @@
       !!                xze    ???
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zpar100 => wrk_2d_1, & ! irradiance at euphotic layer depth
+                          zpar0m  => wrk_2d_2    ! irradiance just below the surface
+      USE wrk_nemo, ONLY: zparr => wrk_3d_2, &   ! red and green compound of par
+                          zparg => wrk_3d_3
+      !!
       INTEGER, INTENT( in ) ::   kt   ! index of the time stepping
       !!
@@ -59,9 +65,10 @@
       REAL(wp) ::   zkr, zkg            ! total absorption coefficient in red and green
       REAL(wp) ::   zcoef               ! temporary scalar
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zpar100         ! irradiance at euphotic layer depth
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zpar0m          ! irradiance just below the surface
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zparr, zparg    ! red and green compound of par
 
       !!---------------------------------------------------------------------
+
+      IF( ( wrk_in_use(2, 1,2)) .OR. ( wrk_in_use(3, 2,3)) )THEN
+         CALL ctl_stop('trc_opt : requested workspace arrays unavailable')   ;   RETURN
+      END IF
 
       IF( kt == nit000 ) THEN
@@ -130,4 +137,7 @@
       ENDIF
       !
+      IF( wrk_not_released(2, 1,2)  .OR.  wrk_not_released(3, 2,3)  )   &
+          CALL ctl_stop('trc_opt : failed to release workspace arrays')
+      !
    END SUBROUTINE trc_opt
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcrst_lobster.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcrst_lobster.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcrst_lobster.F90	(revision 2715)
@@ -18,5 +18,4 @@
    USE trcsms_lobster          ! lobster sms trends
    USE sms_lobster          ! lobster sms trends
-   USE in_out_manager  ! I/O manager
    USE iom
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 2715)
@@ -56,15 +56,21 @@
       !!              trend of passive tracers is saved for futher diagnostics.
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zwork => wrk_3d_2
+      USE wrk_nemo, ONLY: zw2d  => wrk_2d_1 ! only used (if defined 
+                                            ! key_diatrc && defined key_iomput)
+      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       !!
       INTEGER  ::   ji, jj, jk, jl
       REAL(wp) ::   ztra
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwork
-#if defined key_diatrc && defined key_iomput
-      REAL(wp), DIMENSION(jpi,jpj) ::  zw2d
-#endif
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrbio
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
+
+      IF( ( wrk_in_use(3,2)) .OR. ( wrk_in_use(2,1)) ) THEN
+         CALL ctl_stop('trc_sed : requested workspace arrays unavailable.')
+         RETURN
+      END IF
 
       IF( kt == nit000 ) THEN
@@ -144,4 +150,7 @@
       ENDIF
 
+      IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(2, 1) ) )  &
+       &         CALL ctl_stop('trc_sed : failed to release workspace arrays.')
+
    END SUBROUTINE trc_sed
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90	(revision 2715)
@@ -13,5 +13,5 @@
    !!   trcsms_lobster        :  Time loop of passive tracers sms
    !!----------------------------------------------------------------------
-   USE oce_trc         !
+   USE oce_trc          !
    USE trc
    USE trcbio
@@ -32,7 +32,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -45,9 +44,15 @@
       !!
       !! ** Method  : - ???
-      !! -------------------------------------------------------------------------------------
+      !! --------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztrlob => wrk_3d_1   ! used for lobster sms trends
+      !!
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       INTEGER :: jn
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrlob   ! used for lobster sms trends
-      !!
+      !! --------------------------------------------------------------------
+
+      IF( wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('trc_sms_lobster : requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       CALL trc_opt( kt )      ! optical model
@@ -65,4 +70,6 @@
       IF( lk_trdmld_trc )  CALL trd_mld_bio( kt )   ! trends: Mixed-layer
 
+      IF( wrk_not_released(3, 1) )   CALL ctl_stop('trc_sms_lobster : failed to release workspace array.')
+      !
    END SUBROUTINE trc_sms_lobster
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcini_my_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcini_my_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcini_my_trc.F90	(revision 2715)
@@ -24,7 +24,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -38,6 +37,8 @@
       !!----------------------------------------------------------------------
 
-      !  Control consitency
-      CALL trc_ctl_my_trc
+      !                       ! Allocate MY_TRC arrays
+      IF( sms_lobster_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_ini_my_trc: unable to allocate MY_TRC arrays' )
+
+      CALL trc_ctl_my_trc     ! Control consitency
 
       IF(lwp) WRITE(numout,*)
@@ -46,8 +47,8 @@
       
       IF( .NOT. ln_rsttr ) trn(:,:,:,jp_myt0:jp_myt1) = 0.
-
       !
    END SUBROUTINE trc_ini_my_trc
-   
+
+
    SUBROUTINE trc_ctl_my_trc
       !!----------------------------------------------------------------------
@@ -56,18 +57,17 @@
       !! ** Purpose :   control the cpp options, namelist and files 
       !!----------------------------------------------------------------------
-
       INTEGER :: jl, jn
-
+      !!----------------------------------------------------------------------
+      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) ' use COLOR tracer '
-
+      !
       DO jl = 1, jp_my_trc
          jn = jp_myt0 + jl - 1
-         WRITE(ctrcnm(jn),'(a,i2.2)') 'CLR',jn
+         WRITE( ctrcnm(jn),'(a,i2.2)' ) 'CLR', jn
          ctrcnl(jn)='Color concentration'
          ctrcun(jn)='N/A'
       END DO
-
-
+      !
    END SUBROUTINE trc_ctl_my_trc
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90	(revision 2715)
@@ -10,5 +10,6 @@
    !!   'key_my_trc'                                               CFC tracers
    !!----------------------------------------------------------------------
-   !! trc_sms_my_trc   : MY_TRC model main routine 
+   !! trc_sms_my_trc       : MY_TRC model main routine 
+   !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms
    !!----------------------------------------------------------------------
    USE par_trc         ! TOP parameters
@@ -21,12 +22,14 @@
    PRIVATE
 
-   PUBLIC   trc_sms_my_trc   ! called by trcsms.F90 module
+   PUBLIC   trc_sms_my_trc       ! called by trcsms.F90 module
+   PUBLIC   trc_sms_my_trc_alloc ! called by trcini_my_trc.F90 module
 
+   ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc
+   
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -39,8 +42,10 @@
       !! ** Method  : - 
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) :: kt   ! ocean time-step index
-      REAL(wp), DIMENSION(jpi,jpj,jpk)    ::   ztrmyt 
-      INTEGER :: jn
-
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztrmyt => wrk_3d_1   ! used for lobster sms trends
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      INTEGER ::   jn   ! dummy loop index
+      !!----------------------------------------------------------------------
 
       IF(lwp) WRITE(numout,*)
@@ -49,17 +54,16 @@
 
       WHERE( (glamt <= 170) .AND. (glamt >= 160) .AND. (gphit <= -74) .AND. (gphit >=-75.6) )
-        trn(:,:,1,jpmyt1) = 1.
-        trb(:,:,1,jpmyt1) = 1.
-        tra(:,:,1,jpmyt1) = 0.
+        trn(:,:,1,jpmyt1) = 1._wp
+        trb(:,:,1,jpmyt1) = 1._wp
+        tra(:,:,1,jpmyt1) = 0._wp
       END WHERE
 
       WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80)) 
-        trn(:,:,1,jpmyt2) = 1.
-        trb(:,:,1,jpmyt2) = 1.
-        tra(:,:,1,jpmyt2) = 0.
+        trn(:,:,1,jpmyt2) = 1._wp
+        trb(:,:,1,jpmyt2) = 1._wp
+        tra(:,:,1,jpmyt2) = 0._wp
       END WHERE
 
-      ! Save the trends in the ixed layer
-      IF( l_trdtrc ) THEN
+      IF( l_trdtrc ) THEN      ! Save the trends in the ixed layer
           DO jn = jp_myt0, jp_myt1
             ztrmyt(:,:,:) = tra(:,:,:,jn)
@@ -69,5 +73,20 @@
       !
    END SUBROUTINE trc_sms_my_trc
-   
+
+
+   INTEGER FUNCTION trc_sms_my_trc_alloc()
+      !!----------------------------------------------------------------------
+      !!              ***  ROUTINE trc_sms_my_trc_alloc  ***
+      !!----------------------------------------------------------------------
+      !
+      ! ALLOCATE here the arrays specific to MY_TRC
+      ! ALLOCATE( tab(...) , STAT=trc_sms_my_trc_alloc )
+      trc_sms_my_trc_alloc = 0      ! set to zero if no array to be allocated
+      !
+      IF( trc_sms_my_trc_alloc /= 0 ) CALL ctl_warn('trc_sms_my_trc_alloc : failed to allocate arrays')
+      !
+   END FUNCTION trc_sms_my_trc_alloc
+
+
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90	(revision 2715)
@@ -32,9 +32,4 @@
 
    PUBLIC  p4z_bio    
-
-   !! * Shared module variables
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &  !:
-      xnegtr            ! Array used to indicate negative tracer values
-
 
    !!* Substitution
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90	(revision 2715)
@@ -4,8 +4,8 @@
    !! TOP :   PISCES Sea water chemistry computed following OCMIP protocol
    !!======================================================================
-   !! History :    -   !  1988     (E. Maier-Reimer)  Original code
+   !! History :   OPA  !  1988     (E. Maier-Reimer)  Original code
    !!              -   !  1998     (O. Aumont)  addition
    !!              -   !  1999     (C. Le Quere)  modification
-   !!             1.0  !  2004     (O. Aumont)  modification
+   !!   NEMO      1.0  !  2004     (O. Aumont)  modification
    !!              -   !  2006     (R. Gangsto)  modification
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
@@ -15,61 +15,52 @@
    !!   'key_pisces'                                       PISCES bio-model
    !!----------------------------------------------------------------------
-   !!   p4z_che        :  Sea water chemistry computed following OCMIP protocol
-   !!----------------------------------------------------------------------
-   USE oce_trc         !
-   USE trc         !
-   USE sms_pisces      ! 
+   !!   p4z_che      :  Sea water chemistry computed following OCMIP protocol
+   !!----------------------------------------------------------------------
+   USE oce_trc       !
+   USE trc           !
+   USE sms_pisces    ! 
+   USE lib_mpp       ! MPP library
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   p4z_che  
-
-   !! * Shared module variables
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &   !:
-      sio3eq, fekeq           !: chemistry of Fe and Si
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2)   ::   &   !:
-      chemc                   !: Solubilities of O2 and CO2
-
-   !! * Module variables
-
-   REAL(wp) :: &
-      salchl = 1./1.80655 ! conversion factor for salinity --> chlorinity (Wooster et al. 1969)
-
-   REAL(wp) :: &            ! coeff. for apparent solubility equilibrium 
-      akcc1 = -171.9065 , &    ! Millero et al. 1995 from Mucci 1983
-      akcc2 = -0.077993 , &  
-      akcc3 = 2839.319  , &  
-      akcc4 = 71.595    , &  
-      akcc5 = -0.77712  , &  
-      akcc6 = 0.0028426 , &  
-      akcc7 = 178.34    , &  
-      akcc8 = -0.07711  , &  
-      akcc9 = 0.0041249
-
-   REAL(wp) :: &             ! universal gas constants
-      rgas = 83.143, &
-      oxyco = 1./22.4144
-
-   REAL(wp) :: &             ! borat constants
-      bor1 = 0.00023, &
-      bor2 = 1./10.82
-
-   REAL(wp) :: &              !
-      ca0 = -162.8301  , &
-      ca1 = 218.2968   , &
-      ca2 = 90.9241    , &
-      ca3 = -1.47696   , &
-      ca4 = 0.025695   , &
-      ca5 = -0.025225  , &
-      ca6 = 0.0049867
-
-   REAL(wp) :: &              ! coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970)   
-      c10 = -3670.7   , &
-      c11 = 62.008    , &
-      c12 = -9.7944   , &
-      c13 = 0.0118    , &
-      c14 = -0.000116
+   PUBLIC   p4z_che         !
+   PUBLIC   p4z_che_alloc   !
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sio3eq   ! chemistry of Si
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   fekeq    ! chemistry of Fe
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   chemc    ! Solubilities of O2 and CO2
+
+   REAL(wp) ::   salchl = 1._wp / 1.80655_wp ! conversion factor for salinity --> chlorinity (Wooster et al. 1969)
+
+   REAL(wp) ::   akcc1 = -171.9065_wp      ! coeff. for apparent solubility equilibrium
+   REAL(wp) ::   akcc2 =   -0.077993_wp    ! Millero et al. 1995 from Mucci 1983
+   REAL(wp) ::   akcc3 = 2839.319_wp       !
+   REAL(wp) ::   akcc4 =   71.595_wp       !
+   REAL(wp) ::   akcc5 =   -0.77712_wp     !
+   REAL(wp) ::   akcc6 =    0.0028426_wp   !
+   REAL(wp) ::   akcc7 =  178.34_wp        !
+   REAL(wp) ::   akcc8 =   -0.07711_wp     !
+   REAL(wp) ::   akcc9 =    0.0041249_wp   !
+
+   REAL(wp) ::   rgas  = 83.143_wp         ! universal gas constants
+   REAL(wp) ::   oxyco = 1._wp / 22.4144_wp
+
+   REAL(wp) ::   bor1 = 0.00023_wp         ! borat constants
+   REAL(wp) ::   bor2 = 1._wp / 10.82_wp
+
+   REAL(wp) ::   ca0 = -162.8301_wp
+   REAL(wp) ::   ca1 =  218.2968_wp
+   REAL(wp) ::   ca2 =   90.9241_wp
+   REAL(wp) ::   ca3 =   -1.47696_wp
+   REAL(wp) ::   ca4 =    0.025695_wp
+   REAL(wp) ::   ca5 =   -0.025225_wp
+   REAL(wp) ::   ca6 =    0.0049867_wp
+
+   REAL(wp) ::   c10 = -3670.7_wp        ! coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970)   
+   REAL(wp) ::   c11 =    62.008_wp     
+   REAL(wp) ::   c12 =    -9.7944_wp    
+   REAL(wp) ::   c13 =     0.0118_wp     
+   REAL(wp) ::   c14 =    -0.000116_wp
 
    REAL(wp) :: &              ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995)   
@@ -133,5 +124,5 @@
       ox2 = 23.8439    , &
       ox3 = -0.034892  , &
-      ox4 = 0.015568   , &
+      ox4 =  0.015568  , &
       ox5 = -0.0019387 
 
@@ -151,7 +142,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -179,5 +169,4 @@
 !CDIR NOVERRCHK
          DO ji = 1, jpi
-
             !                             ! SET ABSOLUTE TEMPERATURE
             ztkel = tsn(ji,jj,1,jp_tem) + 273.16
@@ -324,4 +313,15 @@
    END SUBROUTINE p4z_che
 
+
+   INTEGER FUNCTION p4z_che_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_che_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( sio3eq(jpi,jpj,jpk) , fekeq(jpi,jpj,jpk) , chemc (jpi,jpj,2), STAT=p4z_che_alloc )
+      !
+      IF( p4z_che_alloc /= 0 )   CALL ctl_warn('p4z_che_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION p4z_che_alloc
+
 #else
    !!======================================================================
@@ -330,5 +330,5 @@
 CONTAINS
    SUBROUTINE p4z_che( kt )                   ! Empty routine
-      INTEGER, INTENT( in ) ::   kt
+      INTEGER, INTENT(in) ::   kt
       WRITE(*,*) 'p4z_che: You should not have seen this print! error?', kt
    END SUBROUTINE p4z_che
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90	(revision 2715)
@@ -27,6 +27,4 @@
    USE sbc_oce , ONLY :  atm_co2
 #endif
-   USE lib_mpp
-   USE lib_fortran
 
    IMPLICIT NONE
@@ -35,13 +33,15 @@
    PUBLIC   p4z_flx  
    PUBLIC   p4z_flx_init  
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  oce_co2            !: ocean carbon flux 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::  satmco2            !: atmospheric pco2
-   REAL(wp)                             ::  t_oce_co2_flx      !: Total ocean carbon flux 
-   REAL(wp)                             ::  t_atm_co2_flx      !: global mean of atmospheric pco2
-   REAL(wp)                             ::  area               !: ocean surface
-   REAL(wp)                             ::  atcco2 = 278.      !: pre-industrial atmospheric [co2] (ppm) 	
-   REAL(wp)                             ::  atcox  = 0.20946   !:
-   REAL(wp)                             ::  xconv  = 0.01/3600 !: coefficients for conversion 
+   PUBLIC   p4z_flx_alloc  
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: oce_co2   !: ocean carbon flux 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: satmco2   !: atmospheric pco2 
+
+   REAL(wp) ::  t_oce_co2_flx               !: Total ocean carbon flux 
+   REAL(wp) ::  t_atm_co2_flx               !: global mean of atmospheric pco2
+   REAL(wp) ::  area                        !: ocean surface
+   REAL(wp) ::  atcco2 = 278._wp            !: pre-industrial atmospheric [co2] (ppm) 	
+   REAL(wp) ::  atcox  = 0.20946_wp         !:
+   REAL(wp) ::  xconv  = 0.01_wp / 3600._wp !: coefficients for conversion 
 
    !!* Substitution
@@ -50,7 +50,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -63,16 +62,21 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in) :: kt
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zkgco2 => wrk_2d_1 , zkgo2 => wrk_2d_2 , zh2co3 => wrk_2d_3 
+      USE wrk_nemo, ONLY:   zoflx  => wrk_2d_4 , zkg   => wrk_2d_5
+      USE wrk_nemo, ONLY:   zdpco2 => wrk_2d_6 , zdpo2 => wrk_2d_7
+      !
+      INTEGER, INTENT(in) ::   kt   !
+      !
       INTEGER  ::   ji, jj, jrorr
       REAL(wp) ::   ztc, ztc2, ztc3, zws, zkgwan
       REAL(wp) ::   zfld, zflu, zfld16, zflu16, zfact
       REAL(wp) ::   zph, zah2, zbot, zdic, zalk, zsch_o2, zalka, zsch_co2
-      REAL(wp), DIMENSION(jpi,jpj) ::   zkgco2, zkgo2, zh2co3
-#if defined key_diatrc && defined key_iomput
-      REAL(wp), DIMENSION(jpi,jpj) ::  zoflx, zkg, zdpco2, zdpo2
-#endif
       CHARACTER (len=25) :: charout
-
       !!---------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2,3,4,5,6,7) ) THEN
+         CALL ctl_stop('p4z_flx: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       ! SURFACE CHEMISTRY (PCO2 AND [H+] IN
@@ -149,6 +153,5 @@
             zfld = satmco2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)
             zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj)
-            oce_co2(ji,jj) = ( zfld - zflu ) * rfact &
-               &             * e1t(ji,jj) * e2t(ji,jj) * tmask(ji,jj,1) * 1000.
+            oce_co2(ji,jj) = ( zfld - zflu ) * rfact * e1e2t(ji,jj) * tmask(ji,jj,1) * 1000.
             ! compute the trend
             tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + ( zfld - zflu ) / fse3t(ji,jj,1)
@@ -162,5 +165,5 @@
             ! Save diagnostics
 #  if ! defined key_iomput
-            zfact = 1. / ( e1t(ji,jj) * e2t(ji,jj) ) / rfact
+            zfact = 1. / e1e2t(ji,jj) / rfact
             trc2d(ji,jj,jp_pcs0_2d    ) = oce_co2(ji,jj) * zfact
             trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1)
@@ -180,5 +183,5 @@
       t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )                     ! Cumulative Total Flux of Carbon
       IF( kt == nitend ) THEN
-         t_atm_co2_flx = glob_sum( satmco2(:,:) * e1t(:,:) * e2t(:,:) )            ! Total atmospheric pCO2
+         t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) )            ! Total atmospheric pCO2
          !
          t_oce_co2_flx = (-1.) * t_oce_co2_flx  * 12. / 1.e15                      ! Conversion in PgC ; negative for out of the ocean
@@ -203,5 +206,5 @@
 
 # if defined key_diatrc && defined key_iomput
-      CALL iom_put( "Cflx" , oce_co2(:,:) / ( e1t(:,:) * e2t(:,:) ) / rfact  )
+      CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 
       CALL iom_put( "Oflx" , zoflx  )
       CALL iom_put( "Kg"   , zkg    )
@@ -209,9 +212,11 @@
       CALL iom_put( "Dpo2" , zdpo2  )
 #endif
-
+      !
+      IF( wrk_not_released(2, 1,2,3,4,5,6,7) )   CALL ctl_stop('p4z_flx: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_flx
 
+
    SUBROUTINE p4z_flx_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_flx_init  ***
@@ -222,12 +227,11 @@
       !!      called at the first timestep (nit000)
       !! ** input   :   Namelist nampisext
-      !!
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
       NAMELIST/nampisext/ atcco2
-
+      !!----------------------------------------------------------------------
+      !
       REWIND( numnat )                     ! read numnat
       READ  ( numnat, nampisext )
-
+      !
       IF(lwp) THEN                         ! control print
          WRITE(numout,*) ' '
@@ -236,16 +240,25 @@
          WRITE(numout,*) '    Atmospheric pCO2      atcco2      =', atcco2
       ENDIF
-
-      ! interior global domain surface
-      area = glob_sum( e1t(:,:) * e2t(:,:) )  
-
-      ! Initialization of Flux of Carbon
-      oce_co2(:,:)  = 0._wp
+      !
+      area = glob_sum( e1e2t(:,:) )        ! interior global domain surface
+      !
+      oce_co2(:,:)  = 0._wp                ! Initialization of Flux of Carbon
       t_atm_co2_flx = 0._wp
-      ! Initialisation of atmospheric pco2
-      satmco2(:,:)  = atcco2
+      !
+      satmco2(:,:)  = atcco2      ! Initialisation of atmospheric pco2
       t_oce_co2_flx = 0._wp
-
+      !
    END SUBROUTINE p4z_flx_init
+
+
+   INTEGER FUNCTION p4z_flx_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_flx_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), STAT=p4z_flx_alloc )
+      !
+      IF( p4z_flx_alloc /= 0 )   CALL ctl_warn('p4z_flx_alloc : failed to allocate arrays')
+      !
+   END FUNCTION p4z_flx_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90	(revision 2715)
@@ -21,20 +21,16 @@
 
    PUBLIC   p4z_int  
+   PUBLIC   p4z_int_alloc
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &   !:
-      tgfunc,            &  !:  Temp. dependancy of various biological rates
-      tgfunc2               !:  Temp. dependancy of mesozooplankton rates 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc    !: Temp. dependancy of various biological rates
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   tgfunc2   !: Temp. dependancy of mesozooplankton rates
 
-   !! * Module variables
-   REAL(wp) :: &
-      xksilim = 16.5E-6        ! Half-saturation constant for the computation of the Si half-saturation constant
-
+   REAL(wp) ::   xksilim = 16.5e-6_wp   ! Half-saturation constant for the Si half-saturation constant computation
 
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -47,5 +43,4 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      !!
       INTEGER  ::   ji, jj
       REAL(wp) ::   zdum
@@ -54,5 +49,4 @@
       ! Computation of phyto and zoo metabolic rate
       ! -------------------------------------------
-
       tgfunc (:,:,:) = EXP( 0.063913 * tsn(:,:,:,jp_tem) )
       tgfunc2(:,:,:) = EXP( 0.07608  * tsn(:,:,:,jp_tem) )
@@ -61,5 +55,4 @@
       ! constant for silica uptake
       ! ---------------------------------------------------
-
       DO ji = 1, jpi
          DO jj = 1, jpj
@@ -68,11 +61,22 @@
          END DO
       END DO
-
+      !
       IF( nday_year == nyear_len(1) ) THEN
          xksi    = xksimax
-         xksimax = 0.e0
+         xksimax = 0._wp
       ENDIF
       !
    END SUBROUTINE p4z_int
+
+
+   INTEGER FUNCTION p4z_int_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_int_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( tgfunc(jpi,jpj,jpk), tgfunc2(jpi,jpj,jpk), STAT=p4z_int_alloc )
+      !
+      IF( p4z_int_alloc /= 0 )   CALL ctl_warn('p4z_int_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION p4z_int_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90	(revision 2715)
@@ -31,14 +31,11 @@
 
    !! * Shared module variables
-   REAL(wp), PUBLIC ::   &
-     kdca = 0.327e3_wp   ,  &  !:
-     nca  = 1.0_wp             !:
+   REAL(wp), PUBLIC :: kdca = 0.327e3_wp  !: diss. rate constant calcite
+   REAL(wp), PUBLIC :: nca  = 1.0_wp      !: order of reaction for calcite dissolution
 
    !! * Module variables
-   REAL(wp) :: &
-      calcon = 1.03E-2        ! mean calcite concentration [Ca2+] in sea water [mole/kg solution]
-
-   INTEGER ::               &
-     rmtss                    !: number of seconds per month
+   REAL(wp) :: calcon = 1.03E-2           !: mean calcite concentration [Ca2+] in sea water [mole/kg solution]
+ 
+   INTEGER  :: rmtss                      !: number of seconds per month 
 
    !!----------------------------------------------------------------------
@@ -60,4 +57,7 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zco3 => wrk_3d_2, zcaldiss => wrk_3d_3 
+      !
       INTEGER, INTENT(in) ::   kt ! ocean time step
       INTEGER  ::   ji, jj, jk, jn
@@ -65,14 +65,15 @@
       REAL(wp) ::   zdispot, zfact, zalka
       REAL(wp) ::   zomegaca, zexcess, zexcess0
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zco3
 #if defined key_diatrc && defined key_iomput
       REAL(wp) ::   zrfact2
-      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zcaldiss
 #endif
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
+      IF(  wrk_in_use(3, 2,3) ) THEN
+         CALL ctl_stop('p4z_lys: requested workspace arrays unavailable')  ;  RETURN
+      END IF
+
       zco3(:,:,:) = 0.
-
 # if defined key_diatrc && defined key_iomput
       zcaldiss(:,:,:) = 0.
@@ -186,4 +187,6 @@
        ENDIF
 
+      IF( wrk_not_released(3, 2,3) ) CALL ctl_stop('p4z_lys: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_lys
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90	(revision 2715)
@@ -6,5 +6,5 @@
    !! History :   1.0  !  2004     (O. Aumont) Original code
    !!             2.0  !  2007-12  (C. Ethe, G. Madec)  F90
-   !!             3.2  !  2009-04  (C. Ethe, G. Madec)  optimisaion
+   !!             3.2  !  2009-04  (C. Ethe, G. Madec)  optimisation
    !!----------------------------------------------------------------------
 #if defined  key_pisces
@@ -24,12 +24,13 @@
    PUBLIC   p4z_opt        ! called in p4zbio.F90 module
    PUBLIC   p4z_opt_init   ! called in trcsms_pisces.F90 module
-
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   etot, enano, ediat   !: PAR for phyto, nano and diat 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   emoy                 !: averaged PAR in the mixed layer
-
-   INTEGER  ::  nksrp   ! levels below which the light cannot penetrate ( depth larger than 391 m)
-   REAL(wp) ::  parlux = 0.43 / 3.e0
-
-   REAL(wp), DIMENSION(3,61), PUBLIC ::   xkrgb  !: tabulated attenuation coefficients for RGB absorption
+   PUBLIC   p4z_opt_alloc
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot, enano, ediat   !: PAR for phyto, nano and diat 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: emoy                 !: averaged PAR in the mixed layer
+
+   INTEGER  ::   nksrp   ! levels below which the light cannot penetrate ( depth larger than 391 m)
+   REAL(wp) ::   parlux = 0.43_wp / 3._wp
+
+   REAL(wp), DIMENSION(3,61), PUBLIC ::   xkrgb   !: tabulated attenuation coefficients for RGB absorption
    
    !!* Substitution
@@ -38,7 +39,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -52,20 +52,27 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt, jnt ! ocean time step
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zdepmoy => wrk_2d_1 , zetmp => wrk_2d_2
+      USE wrk_nemo, ONLY:   zekg    => wrk_3d_2 , zekr  => wrk_3d_3 , zekb => wrk_3d_4
+      USE wrk_nemo, ONLY:   ze0     => wrk_3d_5 , ze1   => wrk_3d_6
+      USE wrk_nemo, ONLY:   ze2     => wrk_3d_7 , ze3   => wrk_3d_8
+      !
+      INTEGER, INTENT(in) ::   kt, jnt   ! ocean time step
+      !
       INTEGER  ::   ji, jj, jk
       INTEGER  ::   irgb
       REAL(wp) ::   zchl, zxsi0r
       REAL(wp) ::   zc0 , zc1 , zc2, zc3
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zdepmoy, zetmp
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zekg, zekr, zekb
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ze1 , ze2 , ze3, ze0
       !!---------------------------------------------------------------------
 
+      IF(  wrk_in_use(2, 1,2)   .OR.   wrk_in_use(3, 2,3,4,5,6,7,8)   ) THEN
+         CALL ctl_stop('p4z_opt: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       !     Initialisation of variables used to compute PAR
       !     -----------------------------------------------
-      ze1 (:,:,jpk) = 0.e0
-      ze2 (:,:,jpk) = 0.e0
-      ze3 (:,:,jpk) = 0.e0
+      ze1 (:,:,jpk) = 0._wp
+      ze2 (:,:,jpk) = 0._wp
+      ze3 (:,:,jpk) = 0._wp
 
       !                                        !* attenuation coef. function of Chlorophyll and wavelength (Red-Green-Blue)
@@ -203,6 +210,5 @@
 !CDIR NOVERRCHK
             DO ji = 1, jpi
-               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) &
-       &           emoy(ji,jj,jk) = zetmp(ji,jj) / ( zdepmoy(ji,jj) + rtrn )
+               IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) )   emoy(ji,jj,jk) = zetmp(ji,jj) / ( zdepmoy(ji,jj) + rtrn )
             END DO
          END DO
@@ -223,5 +229,9 @@
 #endif
       !
+      IF(  wrk_not_released(2, 1,2)           .OR.   &
+           wrk_not_released(3, 2,3,4,5,6,7,8)   )   CALL ctl_stop('p4z_opt: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_opt
+
 
    SUBROUTINE p4z_opt_init
@@ -230,19 +240,30 @@
       !!
       !! ** Purpose :   Initialization of tabulated attenuation coef
-      !!
-      !!
-      !!----------------------------------------------------------------------
-
+      !!----------------------------------------------------------------------
+      !
       CALL trc_oce_rgb( xkrgb )                  ! tabulated attenuation coefficients
-!!      CALL trc_oce_rgb_read( xkrgb )               ! tabulated attenuation coefficients
       nksrp = trc_oce_ext_lev( r_si2, 0.33e2 )     ! max level of light extinction (Blue Chl=0.01)
+      !
       IF(lwp) WRITE(numout,*) '        level of light extinction = ', nksrp, ' ref depth = ', gdepw_0(nksrp+1), ' m'
       !
-                         etot (:,:,:) = 0.e0
-                         enano(:,:,:) = 0.e0
-                         ediat(:,:,:) = 0.e0
-      IF( ln_qsr_bio )   etot3(:,:,:) = 0.e0
+                         etot (:,:,:) = 0._wp
+                         enano(:,:,:) = 0._wp
+                         ediat(:,:,:) = 0._wp
+      IF( ln_qsr_bio )   etot3(:,:,:) = 0._wp
       ! 
    END SUBROUTINE p4z_opt_init
+
+
+   INTEGER FUNCTION p4z_opt_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_opt_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( etot (jpi,jpj,jpk) , enano(jpi,jpj,jpk) ,     &
+         &      ediat(jpi,jpj,jpk) , emoy (jpi,jpj,jpk) , STAT=p4z_opt_alloc )
+         !
+      IF( p4z_opt_alloc /= 0 ) CALL ctl_warn('p4z_opt_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION p4z_opt_alloc
+
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90	(revision 2715)
@@ -22,7 +22,4 @@
    USE iom
 
-   USE lib_mpp
-   USE lib_fortran
-
    IMPLICIT NONE
    PRIVATE
@@ -30,6 +27,6 @@
    PUBLIC   p4z_prod         ! called in p4zbio.F90
    PUBLIC   p4z_prod_init    ! called in trcsms_pisces.F90
-
-   !! * Shared module variables
+   PUBLIC   p4z_prod_alloc
+
    REAL(wp), PUBLIC ::   &
      pislope   = 3.0_wp          ,  &  !:
@@ -43,5 +40,5 @@
      grosip    = 0.151_wp
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk)  ::  prmax 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prmax   !:
    
    REAL(wp) ::   &
@@ -56,7 +53,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -70,5 +66,15 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zmixnano   => wrk_2d_1  , zmixdiat    => wrk_2d_2  , zstrn  => wrk_2d_3
+      USE wrk_nemo, ONLY:   zpislopead => wrk_3d_2  , zpislopead2 => wrk_3d_3
+      USE wrk_nemo, ONLY:   zprdia     => wrk_3d_4  , zprbio      => wrk_3d_5  , zysopt => wrk_3d_6
+      USE wrk_nemo, ONLY:   zprorca    => wrk_3d_7  , zprorcad    => wrk_3d_8
+      USE wrk_nemo, ONLY:   zprofed    => wrk_3d_9  , zprofen     => wrk_3d_10
+      USE wrk_nemo, ONLY:   zprochln   => wrk_3d_11 , zprochld    => wrk_3d_12
+      USE wrk_nemo, ONLY:   zpronew    => wrk_3d_13 , zpronewd    => wrk_3d_14
+      !
       INTEGER, INTENT(in) :: kt, jnt
+      !
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zsilfac, zfact
@@ -81,27 +87,25 @@
       REAL(wp) ::   zrfact2
 #endif
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zmixnano   , zmixdiat, zstrn
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpislopead , zpislopead2
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zprdia     , zprbio, zysopt
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zprorca    , zprorcad, zprofed
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zprofen   , zprochln, zprochld
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zpronew    , zpronewd
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
-      zprorca (:,:,:) = 0.0
-      zprorcad(:,:,:) = 0.0
-      zprofed(:,:,:) = 0.0
-      zprofen(:,:,:) = 0.0
-      zprochln(:,:,:) = 0.0
-      zprochld(:,:,:) = 0.0
-      zpronew (:,:,:) = 0.0
-      zpronewd(:,:,:) = 0.0
-      zprdia  (:,:,:) = 0.0
-      zprbio  (:,:,:) = 0.0
-      zysopt  (:,:,:) = 0.0
+      IF( wrk_in_use(2, 1,2,3)                             .OR.  &
+          wrk_in_use(3, 2,3,4,5,6,7,8,9,10,11,12,13,14)  ) THEN
+          CALL ctl_stop('p4z_prod: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      zprorca (:,:,:) = 0._wp
+      zprorcad(:,:,:) = 0._wp
+      zprofed (:,:,:) = 0._wp
+      zprofen (:,:,:) = 0._wp
+      zprochln(:,:,:) = 0._wp
+      zprochld(:,:,:) = 0._wp
+      zpronew (:,:,:) = 0._wp
+      zpronewd(:,:,:) = 0._wp
+      zprdia  (:,:,:) = 0._wp
+      zprbio  (:,:,:) = 0._wp
+      zysopt  (:,:,:) = 0._wp
 
       ! Computation of the optimal production
-
 # if defined key_degrad
       prmax(:,:,:) = rday1 * tgfunc(:,:,:) * facvol(:,:,:)
@@ -111,9 +115,9 @@
 
       ! compute the day length depending on latitude and the day
-      zrum = FLOAT( nday_year - 80 ) / REAL(nyear_len(1), wp)
-      zcodel = ASIN(  SIN( zrum * rpi * 2. ) * SIN( rad * 23.5 )  )
+      zrum = REAL( nday_year - 80, wp ) / REAL( nyear_len(1), wp )
+      zcodel = ASIN(  SIN( zrum * rpi * 2._wp ) * SIN( rad * 23.5_wp )  )
 
       ! day length in hours
-      zstrn(:,:) = 0.
+      zstrn(:,:) = 0._wp
       DO jj = 1, jpj
          DO ji = 1, jpi
@@ -187,5 +191,4 @@
                   zsilfac = MIN( 6.4,zsilfac * zsilfac2)
                   zysopt(ji,jj,jk) = grosip * zlim1 * zsilfac
-
               ENDIF
             END DO
@@ -357,14 +360,18 @@
 #endif
 
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
          WRITE(charout, FMT="('prod')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
+      ENDIF
+
+      IF(  wrk_not_released(2, 1,2,3)                          .OR.  &
+           wrk_not_released(3, 2,3,4,5,6,7,8,9,10,11,12,13,14)   )   &
+           CALL ctl_stop('p4z_prod: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_prod
 
+
    SUBROUTINE p4z_prod_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_prod_init  ***
@@ -376,9 +383,8 @@
       !!
       !! ** input   :   Namelist nampisprod
-      !!
       !!----------------------------------------------------------------------
-
       NAMELIST/nampisprod/ pislope, pislope2, excret, excret2, chlcnm, chlcdm,   &
          &              fecnm, fecdm, grosip
+      !!----------------------------------------------------------------------
 
       REWIND( numnat )                     ! read numnat
@@ -399,13 +405,22 @@
          WRITE(numout,*) '    Minimum Fe/C in diatoms                   fecdm     =', fecdm
       ENDIF
-
+      !
       rday1     = 0.6 / rday 
       texcret   = 1.0 - excret
       texcret2  = 1.0 - excret2
       tpp       = 0.
-
+      !
    END SUBROUTINE p4z_prod_init
 
 
+   INTEGER FUNCTION p4z_prod_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_prod_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( prmax(jpi,jpj,jpk), STAT=p4z_prod_alloc )
+      !
+      IF( p4z_prod_alloc /= 0 ) CALL ctl_warn('p4z_prod_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION p4z_prod_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90	(revision 2715)
@@ -29,6 +29,6 @@
    PUBLIC   p4z_rem         ! called in p4zbio.F90
    PUBLIC   p4z_rem_init    ! called in trcsms_pisces.F90
-
-   !! * Shared module variables
+   PUBLIC   p4z_rem_alloc
+
    REAL(wp), PUBLIC ::   &
      xremik  = 0.3_wp      ,  & !:
@@ -39,6 +39,5 @@
      oxymin  = 1.e-6_wp         !:
 
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::    & !:
-     &                   denitr                     !: denitrification array
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   denitr   !: denitrification array
 
 
@@ -48,7 +47,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
 
@@ -61,5 +59,10 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   ztempbac => wrk_2d_1
+      USE wrk_nemo, ONLY:   zdepbac  => wrk_3d_2 , zfesatur => wrk_3d_2 , zolimi => wrk_3d_4
+      !
       INTEGER, INTENT(in) ::   kt ! ocean time step
+      !
       INTEGER  ::   ji, jj, jk
       REAL(wp) ::   zremip, zremik , zlam1b
@@ -72,21 +75,20 @@
 #endif
       REAL(wp) ::   zlamfac, zonitr, zstep
-      REAL(wp), DIMENSION(jpi,jpj)     ::   ztempbac
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zdepbac, zfesatur, zolimi
       CHARACTER (len=25) :: charout
-
       !!---------------------------------------------------------------------
 
+      IF(  wrk_in_use(2, 1)  .OR.  wrk_in_use(3, 2,3,4)  ) THEN
+         CALL ctl_stop('p4z_rem: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
        ! Initialisation of temprary arrys
-       zdepbac (:,:,:) = 0.0
-       zfesatur(:,:,:) = 0.0
-       zolimi  (:,:,:) = 0.0
-       ztempbac(:,:)   = 0.0
+       zdepbac (:,:,:) = 0._wp
+       zfesatur(:,:,:) = 0._wp
+       zolimi  (:,:,:) = 0._wp
+       ztempbac(:,:)   = 0._wp
 
       !  Computation of the mean phytoplankton concentration as
       !  a crude estimate of the bacterial biomass
       !   --------------------------------------------------
-
       DO jk = 1, jpkm1
          DO jj = 1, jpj
@@ -362,18 +364,17 @@
                tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zscave * zdenom2
 #endif
-
-            END DO
-         END DO
-      END DO
-      !
-
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+            END DO
+         END DO
+      END DO
+      !
+
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
          WRITE(charout, FMT="('rem5')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
-       !     Update the arrays TRA which contain the biological sources and sinks
-       !     --------------------------------------------------------------------
+      ENDIF
+
+      !     Update the arrays TRA which contain the biological sources and sinks
+      !     --------------------------------------------------------------------
 
       DO jk = 1, jpkm1
@@ -385,16 +386,19 @@
          tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi(:,:,jk) + denitr(:,:,jk)
          tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + denitr(:,:,jk) * rno3 * rdenit
-     END DO
-
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+      END DO
+
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
          WRITE(charout, FMT="('rem6')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
+      ENDIF
+      !
+      IF(  wrk_not_released(2, 1)     .OR.   &
+           wrk_not_released(3, 2,3,4)  )   CALL ctl_stop('p4z_rem: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_rem
 
+
    SUBROUTINE p4z_rem_init
-
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE p4z_rem_init  ***
@@ -408,6 +412,6 @@
       !!
       !!----------------------------------------------------------------------
-
       NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xlam1, oxymin
+      !!----------------------------------------------------------------------
 
       REWIND( numnat )                     ! read numnat
@@ -425,9 +429,20 @@
          WRITE(numout,*) '    halk saturation constant for anoxia       oxymin    =', oxymin
       ENDIF
-
-      nitrfac(:,:,:) = 0.0
-      denitr (:,:,:) = 0.0  
-
+      !
+      nitrfac(:,:,:) = 0._wp
+      denitr (:,:,:) = 0._wp
+      !
    END SUBROUTINE p4z_rem_init
+
+
+   INTEGER FUNCTION p4z_rem_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_rem_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( denitr(jpi,jpj,jpk), STAT=p4z_rem_alloc )
+      !
+      IF( p4z_rem_alloc /= 0 )   CALL ctl_warn('p4z_rem_alloc: failed to allocate arrays')
+      !
+   END FUNCTION p4z_rem_alloc
 
 #else
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2715)
@@ -18,6 +18,4 @@
    USE oce_trc         !
    USE sms_pisces
-   USE lib_mpp
-   USE lib_fortran
    USE prtctl_trc
    USE p4zbio
@@ -27,5 +25,4 @@
    USE p4zrem
    USE p4zlim
-   USE lbclnk
    USE iom
 
@@ -36,32 +33,34 @@
    PUBLIC   p4z_sed   
    PUBLIC   p4z_sed_init   
+   PUBLIC   p4z_sed_alloc
 
    !! * Shared module variables
-   LOGICAL, PUBLIC ::    &
-     ln_dustfer  = .FALSE.      ,  &  !:
-     ln_river    = .FALSE.      ,  &  !:
-     ln_ndepo    = .FALSE.      ,  &  !:
-     ln_sedinput = .FALSE.            !:
-
-   REAL(wp), PUBLIC ::   &
-     sedfeinput = 1.E-9_wp   ,  &  !:
-     dustsolub  = 0.014_wp         !:
+   LOGICAL, PUBLIC :: ln_dustfer  = .FALSE.    !: boolean for dust input from the atmosphere
+   LOGICAL, PUBLIC :: ln_river    = .FALSE.    !: boolean for river input of nutrients
+   LOGICAL, PUBLIC :: ln_ndepo    = .FALSE.    !: boolean for atmospheric deposition of N
+   LOGICAL, PUBLIC :: ln_sedinput = .FALSE.    !: boolean for Fe input from sediments
+
+   REAL(wp), PUBLIC :: sedfeinput = 1.E-9_wp   !: Coastal release of Iron
+   REAL(wp), PUBLIC :: dustsolub  = 0.014_wp   !: Solubility of the dust
 
    !! * Module variables
-   REAL(wp) :: ryyss               !: number of seconds per year 
-   REAL(wp) :: ryyss1              !: inverse of ryyss
-   REAL(wp) :: rmtss               !: number of seconds per month
-   REAL(wp) :: rday1               !: inverse of rday
-
-   INTEGER , PARAMETER :: &
-        jpmth = 12, jpyr = 1
-   INTEGER ::                   &
-      numdust,                  &  !: logical unit for surface fluxes data
-      nflx1 , nflx2,            &  !: first and second record used
-      nflx11, nflx12      ! ???
-   REAL(wp), DIMENSION(jpi,jpj,jpmth) ::  dustmo    !: set of dust fields
-   REAL(wp), DIMENSION(jpi,jpj)      ::  rivinp, cotdep, nitdep, dust 
-   REAL(wp), DIMENSION(jpi,jpj)      ::  e1e2t
-   REAL(wp), DIMENSION(jpi,jpj,jpk)  ::  ironsed 
+   REAL(wp) :: ryyss                  !: number of seconds per year 
+   REAL(wp) :: ryyss1                 !: inverse of ryyss
+   REAL(wp) :: rmtss                  !: number of seconds per month
+   REAL(wp) :: rday1                  !: inverse of rday
+
+   INTEGER , PARAMETER :: jpmth = 12  !: number of months per year
+   INTEGER , PARAMETER :: jpyr  = 1   !: one year
+
+   INTEGER ::  numdust                !: logical unit for surface fluxes data
+   INTEGER ::  nflx1 , nflx2          !: first and second record used
+   INTEGER ::  nflx11, nflx12
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dustmo    !: set of dust fields
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: dust      !: dust fields
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: rivinp, cotdep    !: river input fields
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:) :: nitdep    !: atmospheric N deposition 
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ironsed   !: Coastal supply of iron
+
    REAL(wp) :: sumdepsi, rivalkinput, rivpo4input, nitdepinput
 
@@ -76,4 +75,5 @@
 CONTAINS
 
+
    SUBROUTINE p4z_sed( kt, jnt )
       !!---------------------------------------------------------------------
@@ -86,4 +86,8 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zsidep => wrk_2d_1, zwork => wrk_2d_2, zwork1 => wrk_2d_3
+      USE wrk_nemo, ONLY: znitrpot => wrk_3d_2, zirondep => wrk_3d_3
+      !
       INTEGER, INTENT(in) ::   kt, jnt ! ocean time step
       INTEGER  ::   ji, jj, jk, ikt
@@ -94,9 +98,10 @@
       REAL(wp) ::   zdenitot, znitrpottot, zlim, zfact
       REAL(wp) ::   zwsbio3, zwsbio4, zwscal
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zsidep
-      REAL(wp), DIMENSION(jpi,jpj)     ::   zwork, zwork1
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   znitrpot, zirondep
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
+
+      IF( ( wrk_in_use(2, 1,2,3) ) .OR. ( wrk_in_use(3, 2,3) ) ) THEN
+         CALL ctl_stop('p4z_sed: requested workspace arrays unavailable')  ;  RETURN
+      END IF
 
       IF( jnt == 1  .AND.  ln_dustfer  )  CALL p4z_sbc( kt )
@@ -288,4 +293,7 @@
        ENDIF
 
+      IF( ( wrk_not_released(2, 1,2,3) ) .OR. ( wrk_not_released(3, 2,3) ) )   &
+        &         CALL ctl_stop('p4z_sed: failed to release workspace arrays')
+
    END SUBROUTINE p4z_sed
 
@@ -474,5 +482,4 @@
       ryyss1 = 1. / ryyss
       !                                    ! ocean surface cell
-      e1e2t(:,:) = e1t(:,:) * e2t(:,:)
 
       ! total atmospheric supply of Si
@@ -512,4 +519,16 @@
    END SUBROUTINE p4z_sed_init
 
+   INTEGER FUNCTION p4z_sed_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_sed_alloc  ***
+      !!----------------------------------------------------------------------
+
+      ALLOCATE( dustmo(jpi,jpj,jpmth), dust(jpi,jpj)       ,     &
+        &       rivinp(jpi,jpj)      , cotdep(jpi,jpj)     ,     &
+        &       nitdep(jpi,jpj)      , ironsed(jpi,jpj,jpk), STAT=p4z_sed_alloc )  
+
+      IF( p4z_sed_alloc /= 0 ) CALL ctl_warn('p4z_sed_alloc : failed to allocate arrays.')
+
+   END FUNCTION p4z_sed_alloc
 #else
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90	(revision 2715)
@@ -21,48 +21,39 @@
    PUBLIC   p4z_sink         ! called in p4zbio.F90
    PUBLIC   p4z_sink_init    ! called in trcsms_pisces.F90
-
-   !! * Shared module variables
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &   !:
-     wsbio3, wsbio4,      &    !: POC and GOC sinking speeds
-     wscal                     !: Calcite and BSi sinking speeds
-
-   !! * Module variables
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &   !:
-     sinking, sinking2,   &    !: POC sinking fluxes (different meanings depending on the parameterization
-     sinkcal, sinksil,    &    !: CaCO3 and BSi sinking fluxes
-     sinkfer                   !: Small BFe sinking flux
-
-   INTEGER  :: &
-      iksed  = 10              !
+   PUBLIC   p4z_sink_alloc
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wsbio3   !: POC sinking speed 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wsbio4   !: GOC sinking speed
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   wscal    !: Calcite and BSi sinking speeds
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sinking, sinking2  !: POC sinking fluxes 
+   !                                                          !  (different meanings depending on the parameterization)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sinkcal, sinksil   !: CaCO3 and BSi sinking fluxes
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sinkfer            !: Small BFe sinking fluxes
+#if ! defined key_kriest
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   sinkfer2           !: Big iron sinking fluxes
+#endif
+
+   INTEGER  :: iksed  = 10
 
 #if  defined key_kriest
-   REAL(wp)          ::       &   
-      xkr_sfact    = 250.  ,  &   !: Sinking factor
-      xkr_stick    = 0.2   ,  &   !: Stickiness
-      xkr_nnano    = 2.337 ,  &   !: Nbr of cell in nano size class
-      xkr_ndiat    = 3.718 ,  &   !: Nbr of cell in diatoms size class
-      xkr_nmeso    = 7.147 ,  &   !: Nbr of cell in mesozoo  size class
-      xkr_naggr    = 9.877        !: Nbr of cell in aggregates  size class
-
-   REAL(wp)          ::       &   
-      xkr_frac
-
-   REAL(wp), PUBLIC ::        &
-      xkr_dnano            ,  &   !: Size of particles in nano pool
-      xkr_ddiat            ,  &   !: Size of particles in diatoms pool
-      xkr_dmeso            ,  &   !: Size of particles in mesozoo pool
-      xkr_daggr            ,  &   !: Size of particles in aggregates pool
-      xkr_wsbio_min        ,  &   !: min vertical particle speed
-      xkr_wsbio_max               !: max vertical particle speed
-
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   &   !:
-      xnumm                       !:     maximum number of particles in aggregates
-
-#endif
-
-#if ! defined key_kriest
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   &   !:
-     sinkfer2                  !: Big Fe sinking flux
-#endif 
+   REAL(wp) ::  xkr_sfact    = 250.     !: Sinking factor
+   REAL(wp) ::  xkr_stick    = 0.2      !: Stickiness
+   REAL(wp) ::  xkr_nnano    = 2.337    !: Nbr of cell in nano size class
+   REAL(wp) ::  xkr_ndiat    = 3.718    !: Nbr of cell in diatoms size class
+   REAL(wp) ::  xkr_nmeso    = 7.147    !: Nbr of cell in mesozoo  size class
+   REAL(wp) ::  xkr_naggr    = 9.877    !: Nbr of cell in aggregates  size class
+
+   REAL(wp) ::  xkr_frac 
+
+   REAL(wp), PUBLIC ::  xkr_dnano       !: Size of particles in nano pool
+   REAL(wp), PUBLIC ::  xkr_ddiat       !: Size of particles in diatoms pool
+   REAL(wp), PUBLIC ::  xkr_dmeso       !: Size of particles in mesozoo pool
+   REAL(wp), PUBLIC ::  xkr_daggr       !: Size of particles in aggregates pool
+   REAL(wp), PUBLIC ::  xkr_wsbio_min   !: min vertical particle speed
+   REAL(wp), PUBLIC ::  xkr_wsbio_max   !: max vertical particle speed
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   xnumm   !:  maximum number of particles in aggregates
+#endif
 
    !!* Substitution
@@ -71,10 +62,12 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
 #if defined key_kriest
+   !!----------------------------------------------------------------------
+   !!   'key_kriest'                                                    ???
+   !!----------------------------------------------------------------------
 
    SUBROUTINE p4z_sink ( kt, jnt )
@@ -87,6 +80,9 @@
       !! ** Method  : - ???
       !!---------------------------------------------------------------------
-
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   znum3d => wrk_3d_2
+      !
       INTEGER, INTENT(in) :: kt, jnt
+      !
       INTEGER  :: ji, jj, jk
       REAL(wp) :: zagg1, zagg2, zagg3, zagg4, zagg5, zaggsi, zaggsh
@@ -99,19 +95,21 @@
       INTEGER  :: ik1
 #endif
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   znum3d
       CHARACTER (len=25) :: charout
-
-      !!---------------------------------------------------------------------
-
+      !!---------------------------------------------------------------------
+      !
+      IF( wrk_in_use(3, 2 ) ) THEN
+         CALL ctl_stop('p4z_sink: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      
       !     Initialisation of variables used to compute Sinking Speed
       !     ---------------------------------------------------------
 
-       znum3d(:,:,:) = 0.e0
-       zval1 = 1. + xkr_zeta
-       zval2 = 1. + xkr_zeta + xkr_eta
-       zval3 = 1. + xkr_eta
-
-     !     Computation of the vertical sinking speed : Kriest et Evans, 2000
-     !     -----------------------------------------------------------------
+      znum3d(:,:,:) = 0.e0
+      zval1 = 1. + xkr_zeta
+      zval2 = 1. + xkr_zeta + xkr_eta
+      zval3 = 1. + xkr_eta
+
+      !     Computation of the vertical sinking speed : Kriest et Evans, 2000
+      !     -----------------------------------------------------------------
 
       DO jk = 1, jpkm1
@@ -131,7 +129,7 @@
                   zdiv1 = zeps - zval3
                   wsbio3(ji,jj,jk) = xkr_wsbio_min * ( zeps - zval1 ) / zdiv    &
-     &                             - xkr_wsbio_max *   zgm * xkr_eta  / zdiv
+                     &             - xkr_wsbio_max *   zgm * xkr_eta  / zdiv
                   wsbio4(ji,jj,jk) = xkr_wsbio_min *   ( zeps-1. )    / zdiv1   &
-     &                             - xkr_wsbio_max *   zfm * xkr_eta  / zdiv1
+                     &             - xkr_wsbio_max *   zfm * xkr_eta  / zdiv1
                   IF( znum == 1.1)   wsbio3(ji,jj,jk) = wsbio4(ji,jj,jk)
                ENDIF
@@ -140,5 +138,5 @@
       END DO
 
-      wscal(:,:,:) = MAX( wsbio3(:,:,:), 50. )
+      wscal(:,:,:) = MAX( wsbio3(:,:,:), 50._wp )
 
       !   INITIALIZE TO ZERO ALL THE SINKING ARRAYS
@@ -305,11 +303,14 @@
 #endif
       !
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
          WRITE(charout, FMT="('sink')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
+      ENDIF
+      !
+      IF( wrk_not_released(3, 2 ) )   CALL ctl_stop('p4z_sink: failed to release workspace arrays')
+      !
    END SUBROUTINE p4z_sink
+
 
    SUBROUTINE p4z_sink_init
@@ -324,5 +325,4 @@
       !!
       !! ** input   :   Namelist nampiskrs
-      !!
       !!----------------------------------------------------------------------
       INTEGER  ::   jk, jn, kiter
@@ -330,9 +330,9 @@
       REAL(wp) ::   zws, zwr, zwl,wmax, znummax
       REAL(wp) ::   zmin, zmax, zl, zr, xacc
-
+      !
       NAMELIST/nampiskrs/ xkr_sfact, xkr_stick ,  &
          &                xkr_nnano, xkr_ndiat, xkr_nmeso, xkr_naggr
-
       !!----------------------------------------------------------------------
+      !
       REWIND( numnat )                     ! read nampiskrs
       READ  ( numnat, nampiskrs )
@@ -347,25 +347,25 @@
          WRITE(numout,*) '    Nbr of cell in mesozoo size class        xkr_nmeso    = ', xkr_nmeso
          WRITE(numout,*) '    Nbr of cell in aggregates size class     xkr_naggr    = ', xkr_naggr
-     ENDIF
-
-
-     ! max and min vertical particle speed
-     xkr_wsbio_min = xkr_sfact * xkr_mass_min**xkr_eta
-     xkr_wsbio_max = xkr_sfact * xkr_mass_max**xkr_eta
-     WRITE(numout,*) ' max and min vertical particle speed ', xkr_wsbio_min, xkr_wsbio_max
-
-     !
-     !    effect of the sizes of the different living pools on particle numbers
-     !    nano = 2um-20um -> mean size=6.32 um -> ws=2.596 -> xnum=xnnano=2.337
-     !    diat and microzoo = 10um-200um -> 44.7 -> 8.732 -> xnum=xndiat=3.718
-     !    mesozoo = 200um-2mm -> 632.45 -> 45.14 -> xnum=xnmeso=7.147
-     !    aggregates = 200um-10mm -> 1414 -> 74.34 -> xnum=xnaggr=9.877
-     !    doc aggregates = 1um
-     ! ----------------------------------------------------------
-
-     xkr_dnano = 1. / ( xkr_massp * xkr_nnano )
-     xkr_ddiat = 1. / ( xkr_massp * xkr_ndiat )
-     xkr_dmeso = 1. / ( xkr_massp * xkr_nmeso )
-     xkr_daggr = 1. / ( xkr_massp * xkr_naggr )
+      ENDIF
+
+
+      ! max and min vertical particle speed
+      xkr_wsbio_min = xkr_sfact * xkr_mass_min**xkr_eta
+      xkr_wsbio_max = xkr_sfact * xkr_mass_max**xkr_eta
+      WRITE(numout,*) ' max and min vertical particle speed ', xkr_wsbio_min, xkr_wsbio_max
+
+      !
+      !    effect of the sizes of the different living pools on particle numbers
+      !    nano = 2um-20um -> mean size=6.32 um -> ws=2.596 -> xnum=xnnano=2.337
+      !    diat and microzoo = 10um-200um -> 44.7 -> 8.732 -> xnum=xndiat=3.718
+      !    mesozoo = 200um-2mm -> 632.45 -> 45.14 -> xnum=xnmeso=7.147
+      !    aggregates = 200um-10mm -> 1414 -> 74.34 -> xnum=xnaggr=9.877
+      !    doc aggregates = 1um
+      ! ----------------------------------------------------------
+
+      xkr_dnano = 1. / ( xkr_massp * xkr_nnano )
+      xkr_ddiat = 1. / ( xkr_massp * xkr_ndiat )
+      xkr_dmeso = 1. / ( xkr_massp * xkr_nmeso )
+      xkr_daggr = 1. / ( xkr_massp * xkr_naggr )
 
       !!---------------------------------------------------------------------
@@ -379,7 +379,7 @@
       WRITE(numout,*)'    kriest : Compute maximum number of particles in aggregates'
 
-      xacc     =  0.001
+      xacc     =  0.001_wp
       kiter    = 50
-      zmin     =  1.10
+      zmin     =  1.10_wp
       zmax     = xkr_mass_max / xkr_mass_min
       xkr_frac = zmax
@@ -402,47 +402,43 @@
             &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
             & - wmax
-iflag:  DO jn = 1, kiter
-           IF( zwl == 0.e0 ) THEN
-              znummax = zl
-           ELSE IF ( zwr == 0.e0 ) THEN
-              znummax = zr
-           ELSE
-              znummax = ( zr + zl ) / 2.
-              zdiv = xkr_zeta + xkr_eta - xkr_eta * znummax
-              znum = znummax - 1.
-              zws =  xkr_wsbio_min * xkr_zeta / zdiv &
-                 & - ( xkr_wsbio_max * xkr_eta * znum * &
-                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
-                 & - wmax
-              IF( zws * zwl < 0. ) THEN
-                 zr = znummax
-              ELSE
-                 zl = znummax
-              ENDIF
-              zdiv = xkr_zeta + xkr_eta - xkr_eta * zl
-              znum = zl - 1.
-              zwl =  xkr_wsbio_min * xkr_zeta / zdiv &
-                 & - ( xkr_wsbio_max * xkr_eta * znum * &
-                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
-                 & - wmax
-
-              zdiv = xkr_zeta + xkr_eta - xkr_eta * zr
-              znum = zr - 1.
-              zwr =  xkr_wsbio_min * xkr_zeta / zdiv &
-                 & - ( xkr_wsbio_max * xkr_eta * znum * &
-                 &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
-                 & - wmax
-
-              IF ( ABS ( zws )  <= xacc ) EXIT iflag
-
-           ENDIF
-
-        END DO iflag
-
-        xnumm(jk) = znummax
-        WRITE(numout,*) '       jk = ', jk, ' wmax = ', wmax,' xnum max = ', xnumm(jk)
-
-     END DO
-
+iflag:   DO jn = 1, kiter
+            IF    ( zwl == 0._wp ) THEN   ;   znummax = zl
+            ELSEIF( zwr == 0._wp ) THEN   ;   znummax = zr
+            ELSE
+               znummax = ( zr + zl ) / 2.
+               zdiv = xkr_zeta + xkr_eta - xkr_eta * znummax
+               znum = znummax - 1.
+               zws =  xkr_wsbio_min * xkr_zeta / zdiv &
+                  & - ( xkr_wsbio_max * xkr_eta * znum * &
+                  &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                  & - wmax
+               IF( zws * zwl < 0. ) THEN   ;   zr = znummax
+               ELSE                        ;   zl = znummax
+               ENDIF
+               zdiv = xkr_zeta + xkr_eta - xkr_eta * zl
+               znum = zl - 1.
+               zwl =  xkr_wsbio_min * xkr_zeta / zdiv &
+                  & - ( xkr_wsbio_max * xkr_eta * znum * &
+                  &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                  & - wmax
+
+               zdiv = xkr_zeta + xkr_eta - xkr_eta * zr
+               znum = zr - 1.
+               zwr =  xkr_wsbio_min * xkr_zeta / zdiv &
+                  & - ( xkr_wsbio_max * xkr_eta * znum * &
+                  &     xkr_frac**( -xkr_zeta / znum ) / zdiv ) &
+                  & - wmax
+               !
+               IF ( ABS ( zws )  <= xacc ) EXIT iflag
+               !
+            ENDIF
+            !
+         END DO iflag
+
+         xnumm(jk) = znummax
+         WRITE(numout,*) '       jk = ', jk, ' wmax = ', wmax,' xnum max = ', xnumm(jk)
+         !
+      END DO
+      !
   END SUBROUTINE p4z_sink_init
 
@@ -476,5 +472,5 @@
          DO jj = 1, jpj
             DO ji=1,jpi
-               zfact = MAX( 0., fsdepw(ji,jj,jk+1) - hmld(ji,jj) ) / 4000.
+               zfact = MAX( 0., fsdepw(ji,jj,jk+1) - hmld(ji,jj) ) / 4000._wp
                wsbio4(ji,jj,jk) = wsbio2 + ( 200.- wsbio2 ) * zfact
             END DO
@@ -584,11 +580,12 @@
 #endif
       !
-       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
+      IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
          WRITE(charout, FMT="('sink')")
          CALL prt_ctl_trc_info(charout)
          CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm)
-       ENDIF
-
+      ENDIF
+      !
    END SUBROUTINE p4z_sink
+
 
    SUBROUTINE p4z_sink_init
@@ -611,4 +608,7 @@
       !!      transport term, i.e.  div(u*tra).
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztraz => wrk_3d_2, zakz => wrk_3d_3, zwsink2 => wrk_3d_4
+      !
       INTEGER , INTENT(in   )                         ::   jp_tra    ! tracer index index      
       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpk) ::   pwsink    ! sinking speed
@@ -617,8 +617,10 @@
       INTEGER  ::   ji, jj, jk, jn
       REAL(wp) ::   zigma,zew,zign, zflx, zstep
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  ztraz, zakz
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwsink2
-      !!---------------------------------------------------------------------
-
+      !!---------------------------------------------------------------------
+
+      IF(  wrk_in_use(3, 2,3,4 ) ) THEN
+         CALL ctl_stop('p4z_sink2: requested workspace arrays unavailable')
+         RETURN
+      END IF
 
       zstep = rfact2 / 2.
@@ -701,10 +703,30 @@
       END DO
 
-      trn(:,:,:,jp_tra) = trb(:,:,:,jp_tra)
-      psinkflx(:,:,:)   = 2. * psinkflx(:,:,:)
-
+      trn     (:,:,:,jp_tra) = trb(:,:,:,jp_tra)
+      psinkflx(:,:,:)        = 2. * psinkflx(:,:,:)
+      !
+      IF( wrk_not_released(3, 2,3,4) )   CALL ctl_stop('p4z_sink2: failed to release workspace arrays')
       !
    END SUBROUTINE p4z_sink2
 
+
+   INTEGER FUNCTION p4z_sink_alloc()
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE p4z_sink_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( wsbio3 (jpi,jpj,jpk) , wsbio4  (jpi,jpj,jpk) , wscal(jpi,jpj,jpk) ,     &
+         &      sinking(jpi,jpj,jpk) , sinking2(jpi,jpj,jpk)                      ,     &                
+         &      sinkcal(jpi,jpj,jpk) , sinksil (jpi,jpj,jpk)                      ,     &                
+#if defined key_kriest
+         &      xnumm(jpk)                                                        ,     &                
+#else
+         &      sinkfer2(jpi,jpj,jpk)                                             ,     &                
+#endif
+         &      sinkfer(jpi,jpj,jpk)                                              , STAT=p4z_sink_alloc )                
+         !
+      IF( p4z_sink_alloc /= 0 ) CALL ctl_warn('p4z_sink_alloc : failed to allocate arrays.')
+      !
+   END FUNCTION p4z_sink_alloc
+   
 #else
    !!======================================================================
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 2715)
@@ -7,5 +7,4 @@
    !!             3.2  !  2009-04 (C. Ethe & NEMO team) style
    !!----------------------------------------------------------------------
-
 #if defined key_pisces
    !!----------------------------------------------------------------------
@@ -38,42 +37,44 @@
    !!* Damping 
    LOGICAL  ::   ln_pisdmp         !: relaxation or not of nutrients to a mean value
-                                   !: when initialize from a restart file 
    LOGICAL  ::   ln_pisclo         !: Restoring or not of nutrients to initial value
                                    !: on close seas
 
    !!*  Biological fluxes for light
-   INTEGER , DIMENSION(jpi,jpj)     ::   neln       !: number of T-levels + 1 in the euphotic layer
-   REAL(wp), DIMENSION(jpi,jpj)     ::   heup       !: euphotic layer depth
+   INTEGER , ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::  neln       !: number of T-levels + 1 in the euphotic layer
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::  heup       !: euphotic layer depth
 
    !!*  Biological fluxes for primary production
-   REAL(wp), DIMENSION(jpi,jpj)     ::   xksi       !: ???
-   REAL(wp), DIMENSION(jpi,jpj)     ::   xksimax    !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xnanono3   !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xdiatno3   !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xnanonh4   !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xdiatnh4   !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xlimphy    !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xlimdia    !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   concdfe    !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   concnfe    !: ???
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::   xksi       !: ???
+   REAL(wp), ALLOCATABLE, SAVE,   DIMENSION(:,:)  ::   xksimax    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xnanono3   !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xdiatno3   !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xnanonh4   !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xdiatnh4   !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xlimphy    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   xlimdia    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   concdfe    !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:)  ::   concnfe    !: ???
 
    !!*  SMS for the organic matter
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xfracal    !: ??
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   nitrfac    !: ??
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xlimbac    !: ??
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   xdiss      !: ??
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xfracal    !: ??
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   nitrfac    !: ??
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xlimbac    !: ??
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xdiss      !: ??
 #if defined key_diatrc
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   prodcal    !: Calcite production
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   grazing    !: Total zooplankton grazing
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   prodcal    !: Calcite production
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   grazing    !: Total zooplankton grazing
 #endif
 
    !!* Variable for chemistry of the CO2 cycle
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   akb3       !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ak13       !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ak23       !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   aksp       !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   akw3       !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   borat      !: ???
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   hi         !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   akb3       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ak13       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ak23       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   aksp       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   akw3       !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   borat      !: ???
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hi         !: ???
+
+   !!* Array used to indicate negative tracer values
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   xnegtr     !: ???
 
 #if defined key_kriest
@@ -85,4 +86,51 @@
 #endif
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION sms_pisces_alloc()
+      !!----------------------------------------------------------------------
+      !!        *** ROUTINE sms_pisces_alloc ***
+      !!----------------------------------------------------------------------
+      USE lib_mpp , ONLY: ctl_warn
+      INTEGER ::   ierr(5)        ! Local variables
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+      !*  Biological fluxes for light
+      ALLOCATE( neln(jpi,jpj), heup(jpi,jpj),                           STAT=ierr(1) )
+      !
+      !*  Biological fluxes for primary production
+      ALLOCATE( xksimax(jpi,jpj)     , xksi(jpi,jpj)        ,               &
+         &      xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk),               &
+         &      xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk),               &
+         &      xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk),               &
+         &      concdfe (jpi,jpj,jpk), concnfe (jpi,jpj,jpk),           STAT=ierr(2) ) 
+         !
+      !*  SMS for the organic matter
+      ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac (jpi,jpj,jpk),               &
+#if defined key_diatrc
+         &      prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk) ,               &
+#endif 
+         &      xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk)   ,           STAT=ierr(3) )  
+         !
+      !* Variable for chemistry of the CO2 cycle
+      ALLOCATE( akb3(jpi,jpj,jpk), ak13(jpi,jpj,jpk) ,                      &
+         &      ak23(jpi,jpj,jpk), aksp(jpi,jpj,jpk) ,                      &
+         &      akw3(jpi,jpj,jpk), borat(jpi,jpj,jpk), hi(jpi,jpj,jpk), STAT=ierr(4) )
+         !
+      !* Array used to indicate negative tracer values  
+      ALLOCATE( xnegtr(jpi,jpj,jpk),                                    STAT=ierr(5) )
+      !
+      sms_pisces_alloc = MAXVAL( ierr )
+      !
+      IF( sms_pisces_alloc /= 0 )   CALL ctl_warn('sms_pisces_alloc: failed to allocate arrays') 
+      !
+   END FUNCTION sms_pisces_alloc
+
 #else
    !!----------------------------------------------------------------------   
@@ -91,8 +139,4 @@
 #endif
    
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================   
 END MODULE sms_pisces    
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 2715)
@@ -21,5 +21,11 @@
    USE oce_trc         ! ocean variables
    USE p4zche 
-   USE lib_mpp
+   USE p4zche          ! 
+   USE p4zsink         ! 
+   USE p4zopt          ! 
+   USE p4zprod         !
+   USE p4zrem          ! 
+   USE p4zsed          ! 
+   USE p4zflx          ! 
 
    IMPLICIT NONE
@@ -28,13 +34,11 @@
    PUBLIC   trc_ini_pisces   ! called by trcini.F90 module
 
-   !! * Module variables
-   REAL(wp) :: &
-      sco2   =  2.312e-3         , &
-      alka0  =  2.423e-3         , &
-      oxyg0  =  177.6e-6         , &
-      po4    =  2.174e-6         , &
-      bioma0 =  1.000e-8         , &
-      silic1 =  91.65e-6         , &
-      no3    =  31.04e-6 * 7.6
+   REAL(wp) :: sco2   =  2.312e-3_wp
+   REAL(wp) :: alka0  =  2.423e-3_wp
+   REAL(wp) :: oxyg0  =  177.6e-6_wp 
+   REAL(wp) :: po4    =  2.174e-6_wp 
+   REAL(wp) :: bioma0 =  1.000e-8_wp  
+   REAL(wp) :: silic1 =  91.65e-6_wp  
+   REAL(wp) :: no3    =  31.04e-6_wp * 7.6_wp
 
 #  include "top_substitute.h90"
@@ -42,7 +46,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -53,13 +56,10 @@
       !! ** Purpose :   Initialisation of the PISCES biochemical model
       !!----------------------------------------------------------------------
-
-
-      !  Control consitency
-      CALL trc_ctl_pisces
-
-
+      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) ' trc_ini_pisces :   PISCES biochemical model initialisation'
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
+
+      CALL pisces_alloc()                          ! Allocate PISCES arrays
 
       !                                            ! Time-step
@@ -126,28 +126,40 @@
       IF(lwp) WRITE(numout,*) 'Initialization of PISCES tracers done'
       IF(lwp) WRITE(numout,*) ' '
-
       !
    END SUBROUTINE trc_ini_pisces
- 
-   SUBROUTINE trc_ctl_pisces
+
+
+   SUBROUTINE pisces_alloc
       !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_ctl_pisces  ***
+      !!                     ***  ROUTINE pisces_alloc  ***
       !!
-      !! ** Purpose :   control the cpp options, namelist and files 
+      !! ** Purpose :   Allocate all the dynamic arrays of PISCES 
       !!----------------------------------------------------------------------
+      USE p4zint , ONLY : p4z_int_alloc      
+      USE p4zsink, ONLY : p4z_sink_alloc      
+      USE p4zopt , ONLY : p4z_opt_alloc           
+      USE p4zprod, ONLY : p4z_prod_alloc         
+      USE p4zrem , ONLY : p4z_rem_alloc           
+      USE p4zsed , ONLY : p4z_sed_alloc          
+      USE p4zflx , ONLY : p4z_flx_alloc
+      !
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
+      !
+      ierr =         sms_pisces_alloc()          ! Start of PISCES-related alloc routines...
+      ierr = ierr +     p4z_che_alloc()
+      ierr = ierr +     p4z_int_alloc()
+      ierr = ierr +    p4z_sink_alloc()
+      ierr = ierr +     p4z_opt_alloc()
+      ierr = ierr +    p4z_prod_alloc()
+      ierr = ierr +     p4z_rem_alloc()
+      ierr = ierr +     p4z_sed_alloc()
+      ierr = ierr +     p4z_flx_alloc()
+      !
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'pisces_alloc: unable to allocate PISCES arrays' )
+      !
+   END SUBROUTINE pisces_alloc
 
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) ' use PISCES biological model '
-
-   ! Check number of tracers
-   ! -----------------------
-#if  defined key_kriest
-      IF( jp_pisces /= 23) CALL ctl_stop( ' PISCES must have 23 passive tracers. Change jp_pisces in par_pisces.F90' )
-#else
-      IF( jp_pisces /= 24) CALL ctl_stop( ' PISCES must have 24 passive tracers. Change jp_pisces in par_pisces.F90' )
-#endif
-
-   END SUBROUTINE trc_ctl_pisces
-  
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90	(revision 2715)
@@ -19,5 +19,4 @@
    USE trc             ! TOP variables
    USE sms_pisces      ! sms trends
-   USE in_out_manager  ! I/O manager
 
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2715)
@@ -18,9 +18,6 @@
    USE trcsms_pisces          ! pisces sms trends
    USE sms_pisces          ! pisces sms variables
-   USE in_out_manager  ! I/O manager
    USE iom
    USE trcdta
-   USE lib_mpp
-   USE lib_fortran
 
    IMPLICIT NONE
@@ -108,12 +105,10 @@
       !! ** purpose  : Relaxation of some tracers
       !!----------------------------------------------------------------------
-      INTEGER  :: ji, jj, jk
-      REAL(wp) ::  &
-         alkmean = 2426. ,  & ! mean value of alkalinity ( Glodap ; for Goyet 2391. )
-         po4mean = 2.165 ,  & ! mean value of phosphates
-         no3mean = 30.90 ,  & ! mean value of nitrate
-         silmean = 91.51      ! mean value of silicate
-
-      REAL(wp) :: zarea, zvol, zalksum, zpo4sum, zno3sum, zsilsum
+      REAL(wp) ::  alkmean = 2426.     ! mean value of alkalinity ( Glodap ; for Goyet 2391. )
+      REAL(wp) ::  po4mean = 2.165     ! mean value of phosphates
+      REAL(wp) ::  no3mean = 30.90     ! mean value of nitrate
+      REAL(wp) ::  silmean = 91.51     ! mean value of silicate
+
+      REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum
 
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2715)
@@ -16,6 +16,4 @@
    USE trc
    USE sms_pisces
-   USE lbclnk
-   USE lib_mpp
    
    USE p4zint          ! 
@@ -65,12 +63,18 @@
       !!              - ...
       !!---------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: ztrpis => wrk_3d_1   ! used for pisces sms trends
+      !
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index      
       !!
       INTEGER ::   jnt, jn
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrpis   ! used for pisces sms trends
       CHARACTER (len=25) :: charout
       !!---------------------------------------------------------------------
 
       IF( kt == nit000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only)
+
+      IF( wrk_in_use(3,1) )  THEN
+        CALL ctl_stop('trc_sms_pisces : requested workspace array unavailable.')  ;  RETURN
+      ENDIF
 
       IF( ndayflxtr /= nday_year ) THEN      ! New days
@@ -111,4 +115,5 @@
             CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt )   ! save trends
           END DO
+          DEALLOCATE( ztrpis )
       END IF
 
@@ -122,4 +127,6 @@
          !
       ENDIF
+
+      IF( wrk_not_released(3,1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.') 
 
    END SUBROUTINE trc_sms_pisces
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90	(revision 2715)
@@ -17,5 +17,4 @@
    USE sedarr
    USE iom
-   USE in_out_manager  ! I/O manager
 
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 2715)
@@ -10,5 +10,4 @@
    !!----------------------------------------------------------------------
    !!   'key_top'                                                TOP models
-   !!----------------------------------------------------------------------
    !!----------------------------------------------------------------------
    !!   trc_adv      : compute ocean tracer advection trend
@@ -26,15 +25,15 @@
    USE traadv_eiv      ! eddy induced velocity     (tra_adv_eiv    routine)
    USE ldftra_oce      ! lateral diffusion coefficient on tracers
-   USE in_out_manager  ! I/O manager
-   USE prtctl_trc          ! Print control
+   USE prtctl_trc      ! Print control
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   trc_adv    ! routine called by step module
+   PUBLIC   trc_adv          ! routine called by step module
+   PUBLIC   trc_adv_alloc    ! routine called by nemogcm module
 
    INTEGER ::   nadv   ! choice of the type of advection scheme
-   REAL(wp), DIMENSION(jpk) ::   r2dt  ! vertical profile time-step, = 2 rdttra
-      !                                ! except at nit000 (=rdttra) if neuler=0
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt  ! vertical profile time-step, = 2 rdttra
+   !                                                    ! except at nit000 (=rdttra) if neuler=0
 
    !! * Substitutions
@@ -46,6 +45,17 @@
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION trc_adv_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_adv_alloc  ***
+      !!----------------------------------------------------------------------
+
+      ALLOCATE( r2dt(jpk), STAT=trc_adv_alloc )
+
+      IF( trc_adv_alloc /= 0 ) CALL ctl_warn('trc_adv_alloc : failed to allocate array.')
+
+   END FUNCTION trc_adv_alloc
+
 
    SUBROUTINE trc_adv( kt )
@@ -57,11 +67,16 @@
       !! ** Method  : - Update the tracer with the advection term following nadv
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY: zun => wrk_3d_4, zvn => wrk_3d_5, zwn => wrk_3d_6   ! effective velocity
       !!
-      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
-      !
-      INTEGER :: jk 
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zun, zvn, zwn   ! effective velocity
-      CHARACTER (len=22) :: charout
-      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
+      INTEGER ::   jk 
+      CHARACTER (len=22) ::   charout
+      !!----------------------------------------------------------------------
+      !
+      IF( wrk_in_use(3, 4,5,6) ) THEN
+         CALL ctl_stop('trc_adv : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
 
       IF( kt == nit000 )   CALL trc_adv_ctl          ! initialisation & control of options
@@ -80,7 +95,7 @@
       DO jk = 1, jpkm1
          !                                                ! eulerian transport only
-         zun(:,:,jk) = e2u(:,:) * fse3u(:,:,jk) * un(:,:,jk)
-         zvn(:,:,jk) = e1v(:,:) * fse3v(:,:,jk) * vn(:,:,jk)
-         zwn(:,:,jk) = e1t(:,:) * e2t(:,:)      * wn(:,:,jk)
+         zun(:,:,jk) = e2u  (:,:) * fse3u(:,:,jk) * un(:,:,jk)
+         zvn(:,:,jk) = e1v  (:,:) * fse3v(:,:,jk) * vn(:,:,jk)
+         zwn(:,:,jk) = e1e2t(:,:)                 * wn(:,:,jk)
          !
       END DO
@@ -125,4 +140,6 @@
                                             CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
       END IF
+      !
+      IF( wrk_not_released(3, 4,5,6) ) CALL ctl_stop('trc_adv : failed to release workspace arrays.')
       !
    END SUBROUTINE trc_adv
@@ -171,4 +188,5 @@
       !
    END SUBROUTINE trc_adv_ctl
+   
 #else
    !!----------------------------------------------------------------------
@@ -181,4 +199,5 @@
    END SUBROUTINE trc_adv
 #endif
+
   !!======================================================================
 END MODULE trcadv
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 2715)
@@ -29,8 +29,10 @@
    PRIVATE
 
-   PUBLIC trc_dmp      ! routine called by step.F90
+   PUBLIC trc_dmp            ! routine called by step.F90
+   PUBLIC trc_dmp_alloc      ! routine called by nemogcm.F90
 
    LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .TRUE.   !: internal damping flag
-   !                             !!* Namelist namtrc_dmp : passive tracer newtonian damping *
+
+   !                                !!* Namelist namtrc_dmp : passive tracer newtonian damping *
    INTEGER  ::   nn_hdmp_tr =   -1   ! = 0/-1/'latitude' for damping over passive tracer
    INTEGER  ::   nn_zdmp_tr =    0   ! = 0/1/2 flag for damping in the mixed layer
@@ -40,5 +42,5 @@
    INTEGER  ::   nn_file_tr =    2   ! = 1 create a damping.coeff NetCDF file 
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::   restotr   ! restoring coeff. on tracers (s-1)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1)
 
    !! * Substitutions
@@ -47,8 +49,18 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcdmp.F90,v 1.11 2006/09/01 14:03:49 opalod Exp $ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
+
+   INTEGER FUNCTION trc_dmp_alloc()
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE trc_dmp_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( restotr(jpi,jpj,jpk) , STAT=trc_dmp_alloc )
+      !
+      IF( trc_dmp_alloc /= 0 )   CALL ctl_warn('trc_dmp_alloc: failed to allocate array')
+      !
+   END FUNCTION trc_dmp_alloc
+
 
    SUBROUTINE trc_dmp( kt )
@@ -161,5 +173,5 @@
       !!
       !! ** Method  :   read the nammbf namelist and check the parameters
-      !!      called by trc_dmp at the first timestep (nit000)
+      !!              called by trc_dmp at the first timestep (nit000)
       !!----------------------------------------------------------------------
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 2715)
@@ -27,7 +27,4 @@
    USE trdtra
    USE prtctl_trc      ! Print control
-   USE in_out_manager  ! I/O manager
-   USE lib_mpp         ! distribued memory computing library
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
 
    IMPLICIT NONE
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 2715)
@@ -3,5 +3,4 @@
    !!                       ***  MODULE  trcnxt  ***
    !! Ocean passive tracers:  time stepping on passives tracers
-   !!======================================================================
    !!======================================================================
    !! History :  7.0  !  1991-11  (G. Madec)  Original code
@@ -27,5 +26,4 @@
    !!   trc_nxt     : time stepping on passive tracers
    !!----------------------------------------------------------------------
-   !! * Modules used
    USE oce_trc         ! ocean dynamics and tracers variables
    USE trc             ! ocean passive tracers variables
@@ -43,15 +41,26 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC trc_nxt          ! routine called by step.F90
+   PUBLIC   trc_nxt          ! routine called by step.F90
+   PUBLIC   trc_nxt_alloc    ! routine called by nemogcm.F90
 
-  REAL(wp), DIMENSION(jpk) ::   r2dt
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt
+
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
+CONTAINS
 
-CONTAINS
+   INTEGER FUNCTION trc_nxt_alloc()
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE trc_nxt_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( r2dt(jpk), STAT=trc_nxt_alloc )
+      !
+      IF( trc_nxt_alloc /= 0 )   CALL ctl_warn('trc_nxt_alloc : failed to allocate array')
+      !
+   END FUNCTION trc_nxt_alloc
+
 
    SUBROUTINE trc_nxt( kt )
@@ -79,7 +88,6 @@
       !! ** Action  : - update trb, trn
       !!----------------------------------------------------------------------
-      !! * Arguments
       INTEGER, INTENT( in ) ::   kt     ! ocean time-step index
-      !! * Local declarations
+      !
       INTEGER  ::   jk, jn   ! dummy loop indices
       REAL(wp) ::   zfact            ! temporary scalar
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 2715)
@@ -17,5 +17,4 @@
    USE trdmod_oce
    USE trdtra
-   USE lib_mpp
    USE prtctl_trc          ! Print control for debbuging
 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 2715)
@@ -16,8 +16,7 @@
    !!   trc_sbc      : update the tracer trend at ocean surface
    !!----------------------------------------------------------------------
-   !! * Modules used
-   USE oce_trc             ! ocean dynamics and active tracers variables
-   USE trc                 ! ocean  passive tracers variables
-   USE prtctl_trc          ! Print control for debbuging
+   USE oce_trc         ! ocean dynamics and active tracers variables
+   USE trc             ! ocean  passive tracers variables
+   USE prtctl_trc      ! Print control for debbuging
    USE trdmod_oce
    USE trdtra
@@ -26,6 +25,5 @@
    PRIVATE
 
-   !! * Routine accessibility
-   PUBLIC trc_sbc              ! routine called by step.F90
+   PUBLIC   trc_sbc   ! routine called by step.F90
 
    !! * Substitutions
@@ -34,7 +32,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -60,14 +57,18 @@
       !!
       !!----------------------------------------------------------------------
-      !! * Arguments
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zemps  => wrk_2d_1
+      USE wrk_nemo, ONLY:   ztrtrd => wrk_3d_1
+      !
       INTEGER, INTENT( in ) ::   kt          ! ocean time-step index
-
-      !! * Local declarations
+      !
       INTEGER  ::   ji, jj, jn           ! dummy loop indices
       REAL(wp) ::   zsrau, zse3t   ! temporary scalars
-      REAL(wp), DIMENSION(jpi,jpj) ::   zemps  ! surface freshwater flux
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrtrd
       CHARACTER (len=22) :: charout
       !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) .OR.  wrk_in_use(3, 1) ) THEN
+         CALL ctl_stop('trc_sbc: requested workspace array unavailable.')   ;   RETURN
+      END IF
 
       IF( kt == nit000 ) THEN
@@ -77,6 +78,4 @@
       ENDIF
 
-
-      IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) )
 
       IF( lk_offline ) THEN          ! emps in dynamical files contains emps - rnf
@@ -113,10 +112,11 @@
       END DO                                                     ! tracer loop
       !                                                          ! ===========
-      IF( l_trdtrc ) DEALLOCATE( ztrtrd )
-
       IF( ln_ctl )   THEN
          WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout)
                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
       ENDIF
+
+      IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) )   &
+      &       CALL ctl_stop('trc_sbc: failed to release workspace array.')
 
    END SUBROUTINE trc_sbc
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 2715)
@@ -11,5 +11,4 @@
    !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
    !!   trc_ldf     : update the tracer trend with the lateral diffusion
    !!       ldf_ctl : initialization, namelist read, and parameters control
@@ -20,19 +19,18 @@
    USE trazdf_exp      ! vertical diffusion: explicit (tra_zdf_exp     routine)
    USE trazdf_imp      ! vertical diffusion: implicit (tra_zdf_imp     routine)
-   USE prtctl_trc      ! Print control
-   USE in_out_manager  ! I/O manager
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE trdmod_oce
    USE trdtra
+   USE prtctl_trc      ! Print control
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   trc_zdf    ! called by step.F90 
+   PUBLIC   trc_zdf          ! called by step.F90 
+   PUBLIC   trc_zdf_alloc    ! called by nemogcm.F90 
 
    INTEGER ::   nzdf = 0               ! type vertical diffusion algorithm used
       !                                ! defined from ln_zdf...  namlist logicals)
-   REAL(wp), DIMENSION(jpk) ::  r2dt   ! vertical profile time-step, = 2 rdttra
-      !                                ! except at nit000 (=rdttra) if neuler=0
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::  r2dt   ! vertical profile time-step, = 2 rdttra
+      !                                                 ! except at nit000 (=rdttra) if neuler=0
 
    !! * Substitutions
@@ -43,9 +41,19 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
    
+   INTEGER FUNCTION trc_zdf_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_zdf_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( r2dt(jpk) , STAT=trc_zdf_alloc )
+      !
+      IF( trc_zdf_alloc /= 0 )   CALL ctl_warn('trc_zdf_alloc : failed to allocate array.')
+      !
+   END FUNCTION trc_zdf_alloc
+
+
    SUBROUTINE trc_zdf( kt )
       !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 2715)
@@ -23,5 +23,5 @@
    USE zdfddm  , ONLY : avs  !: salinity vertical diffusivity coeff. at w-point
 # endif
-   USE trcnam_trp      ! passive tracers transport namelist variables
+   USE trcnam_trp        ! passive tracers transport namelist variables
    USE trdmod_trc_oce    ! definition of main arrays used for trends computations
    USE in_out_manager    ! I/O manager
@@ -30,4 +30,5 @@
    USE ioipsl            ! NetCDF library
    USE lbclnk            ! ocean lateral boundary conditions (or mpp link)
+   USE lib_mpp           ! MPP library
    USE trdmld_trc_rst    ! restart for diagnosing the ML trends
    USE prtctl            ! print control
@@ -39,4 +40,5 @@
 
    PUBLIC trd_mld_trc
+   PUBLIC trd_mld_trc_alloc
    PUBLIC trd_mld_bio
    PUBLIC trd_mld_trc_init
@@ -46,5 +48,5 @@
    CHARACTER (LEN=40) ::  clhstnam                                ! name of the trends NetCDF file
    INTEGER ::   nmoymltrd
-   INTEGER ::   ndextrd1(jpi*jpj)
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) ::   ndextrd1
    INTEGER, DIMENSION(jptra) ::   nidtrd, nh_t
    INTEGER ::   ndimtrd1                        
@@ -58,4 +60,11 @@
    LOGICAL :: lldebug = .TRUE.
 
+   ! Workspace array for trd_mld_trc() routine. Declared here as is 4D and
+   ! cannot use workspaces in wrk_nemo module.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  ztmltrd2   !
+#if defined key_lobster
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  ztmltrdbio2  ! only needed for mean diagnostics in trd_mld_bio()
+#endif
+
    !! * Substitutions
 #  include "top_substitute.h90"
@@ -63,8 +72,23 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Header:  $ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
+
+   INTEGER FUNCTION trd_mld_trc_alloc()
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE trd_mld_trc_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( ztmltrd2(jpi,jpj,jpltrd_trc,jptra) ,      &
+#if defined key_lobster
+         &      ztmltrdbio2(jpi,jpj,jpdiabio)      ,      &
+#endif
+         &      ndextrd1(jpi*jpj)                  ,  STAT=trd_mld_trc_alloc)
+         !
+      IF( lk_mpp                )   CALL mpp_sum ( trd_mld_trc_alloc )
+      IF( trd_mld_trc_alloc /=0 )   CALL ctl_warn('trd_mld_trc_alloc: failed to allocate arrays')
+      !
+   END FUNCTION trd_mld_trc_alloc
+
 
    SUBROUTINE trd_mld_trc_zint( ptrc_trdmld, ktrd, ctype, kjn )
@@ -88,10 +112,16 @@
       !!            surface and the control surface is called "mixed-layer"
       !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zvlmsk => wrk_2d_1
+      !!
       INTEGER, INTENT( in ) ::   ktrd, kjn                        ! ocean trend index and passive tracer rank
       CHARACTER(len=2), INTENT( in ) ::  ctype                    ! surface/bottom (2D) or interior (3D) physics
       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::  ptrc_trdmld ! passive tracer trend
       INTEGER ::   ji, jj, jk, isum
-      REAL(wp), DIMENSION(jpi,jpj) ::  zvlmsk
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('trd_mld_trc_zint: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       ! I. Definition of control surface and integration weights
@@ -177,8 +207,11 @@
             tmltrd_trc(:,:,ktrd,kjn) = tmltrd_trc(:,:,ktrd,kjn) + ptrc_trdmld(:,:,1) * wkx_trc(:,:,1)  ! non penetrative
       END SELECT
-
-    END SUBROUTINE trd_mld_trc_zint
-    
-    SUBROUTINE trd_mld_bio_zint( ptrc_trdmld, ktrd )
+      !
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('trd_mld_trc_zint: failed to release workspace array')
+      !
+   END SUBROUTINE trd_mld_trc_zint
+
+
+   SUBROUTINE trd_mld_bio_zint( ptrc_trdmld, ktrd )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE trd_mld_bio_zint  ***
@@ -198,11 +231,17 @@
       !!            surface and the control surface is called "mixed-layer"
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   ktrd          ! bio trend index
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) ::  ptrc_trdmld ! passive trc trend
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   zvlmsk => wrk_2d_1
+      !!
+      INTEGER                         , INTENT(in) ::   ktrd          ! bio trend index
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   ptrc_trdmld   ! passive trc trend
 #if defined key_lobster
-      !! local variables
+      !
       INTEGER ::   ji, jj, jk, isum
-      REAL(wp), DIMENSION(jpi,jpj) ::  zvlmsk
-      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1) ) THEN
+         CALL ctl_stop('trd_mld_bio_zint: requested workspace array unavailable')   ;   RETURN
+      ENDIF
 
       ! I. Definition of control surface and integration weights
@@ -286,10 +325,11 @@
       END DO
 
-#endif
-
-    END SUBROUTINE trd_mld_bio_zint
-
-
-    SUBROUTINE trd_mld_trc( kt )
+      IF( wrk_not_released(2, 1) )   CALL ctl_stop('trd_mld_bio_zint: failed to release workspace array')
+#endif
+      !
+   END SUBROUTINE trd_mld_bio_zint
+
+
+   SUBROUTINE trd_mld_trc( kt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE trd_mld_trc  ***
@@ -338,20 +378,25 @@
       !!       - See NEMO documentation (in preparation)
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt                               ! ocean time-step index
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE wrk_nemo, ONLY:   wrk_3d_1, wrk_3d_2, wrk_3d_3, wrk_3d_4
+      USE wrk_nemo, ONLY:   wrk_3d_5, wrk_3d_6, wrk_3d_7, wrk_3d_8, wrk_3d_9
+      !
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
+      !
       INTEGER ::   ji, jj, jk, jl, ik, it, itmod, jn
       REAL(wp) ::   zavt, zfn, zfn2
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmltot             ! d(trc)/dt over the anlysis window (incl. Asselin)
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlres             ! residual = dh/dt entrainment term
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlatf             ! for storage only
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlrad             ! for storage only (for trb<0 corr in trcrad)
-      !!
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmltot2            ! -+
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlres2            !  | working arrays to diagnose the trends
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmltrdm2           !  | associated with the time meaned ML
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlatf2            !  | passive tracers
-      REAL(wp), DIMENSION(jpi,jpj,jptra) ::   ztmlrad2            !  | (-> for trb<0 corr in trcrad)
-      REAL(wp), DIMENSION(jpi,jpj,jpltrd_trc,jptra) ::  ztmltrd2  ! -+
-      !!
+      !
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmltot             ! d(trc)/dt over the anlysis window (incl. Asselin)
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlres             ! residual = dh/dt entrainment term
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlatf             ! for storage only
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlrad             ! for storage only (for trb<0 corr in trcrad)
+      !
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmltot2            ! -+
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlres2            !  | working arrays to diagnose the trends
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmltrdm2           !  | associated with the time meaned ML
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlatf2            !  | passive tracers
+      REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztmlrad2            !  | (-> for trb<0 corr in trcrad)
+      !REAL(wp), DIMENSION(jpi,jpj,jpltrd_trc,jptra) ::  ztmltrd2  ! -+
+      !
       CHARACTER (LEN= 5) ::   clvar
 #if defined key_dimgout
@@ -361,5 +406,20 @@
       !!----------------------------------------------------------------------
 
-      IF( nn_dttrc  /= 1  ) CALL ctl_stop( " Be careful, trends diags never validated " )
+      IF( wrk_in_use(3, 1,2,3,4,5,6,7,8,9) ) THEN
+         CALL ctl_stop('trd_mld_trc : requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+      ! Set-up pointers into sub-arrays of workspaces
+      ztmltot   => wrk_3d_1(:,:,1:jptra)
+      ztmlres   => wrk_3d_2(:,:,1:jptra)
+      ztmlatf   => wrk_3d_3(:,:,1:jptra)
+      ztmlrad   => wrk_3d_4(:,:,1:jptra)
+      ztmltot2  => wrk_3d_5(:,:,1:jptra)
+      ztmlres2  => wrk_3d_6(:,:,1:jptra)
+      ztmltrdm2 => wrk_3d_7(:,:,1:jptra)
+      ztmlatf2  => wrk_3d_8(:,:,1:jptra)
+      ztmlrad2  => wrk_3d_9(:,:,1:jptra)
+
+
+      IF( nn_dttrc  /= 1  )   CALL ctl_stop( " Be careful, trends diags never validated " )
 
       ! ======================================================================
@@ -386,5 +446,5 @@
 
          DO jn = 1, jptra
-         ! ... Remove this K_z trend from the iso-neutral diffusion term (if any)
+            ! ... Remove this K_z trend from the iso-neutral diffusion term (if any)
             IF( ln_trdtrc(jn) ) &
                  tmltrd_trc(:,:,jpmld_trc_ldf,jn) = tmltrd_trc(:,:,jpmld_trc_ldf,jn) - tmltrd_trc(:,:,jpmld_trc_zdf,jn)
@@ -847,7 +907,10 @@
       IF( lrst_trc )   CALL trd_mld_trc_rst_write( kt )  ! this must be after the array swap above (III.3)
 
+      IF( wrk_not_released(3, 1,2,3,4,5,6,7,8,9) )   CALL ctl_stop('trd_mld_trc: failed to release workspace arrays')
+      !
    END SUBROUTINE trd_mld_trc
 
-    SUBROUTINE trd_mld_bio( kt )
+
+   SUBROUTINE trd_mld_bio( kt )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE trd_mld  ***
@@ -900,5 +963,4 @@
       INTEGER  ::  jl, it, itmod
       LOGICAL  :: llwarn  = .TRUE., lldebug = .TRUE.
-      REAL(wp), DIMENSION(jpi,jpj,jpdiabio) ::  ztmltrdbio2  ! only needed for mean diagnostics
       REAL(wp) :: zfn, zfn2
 #if defined key_dimgout
@@ -1085,4 +1147,5 @@
    END SUBROUTINE trd_mld_bio
 
+
    REAL FUNCTION sum2d( ztab )
       !!----------------------------------------------------------------------
@@ -1091,6 +1154,7 @@
       REAL(wp), DIMENSION(jpi,jpj), INTENT( in ) ::  ztab      
       !!----------------------------------------------------------------------
-      sum2d = SUM(ztab(2:jpi-1,2:jpj-1))
+      sum2d = SUM( ztab(2:jpi-1,2:jpj-1) )
    END FUNCTION sum2d
+
 
    SUBROUTINE trd_mld_trc_init
@@ -1378,17 +1442,13 @@
    !!   Default option :                                       Empty module
    !!----------------------------------------------------------------------
-
 CONTAINS
-
    SUBROUTINE trd_mld_trc( kt )                                   ! Empty routine
       INTEGER, INTENT( in) ::   kt
       WRITE(*,*) 'trd_mld_trc: You should not have seen this print! error?', kt
    END SUBROUTINE trd_mld_trc
-
    SUBROUTINE trd_mld_bio( kt )
       INTEGER, INTENT( in) ::   kt
       WRITE(*,*) 'trd_mld_bio: You should not have seen this print! error?', kt
    END SUBROUTINE trd_mld_bio
-
    SUBROUTINE trd_mld_trc_zint( ptrc_trdmld, ktrd, ctype, kjn )
       INTEGER               , INTENT( in ) ::  ktrd, kjn              ! ocean trend index and passive tracer rank
@@ -1400,5 +1460,4 @@
       WRITE(*,*) '  "      "      : You should not have seen this print! error?', kjn
    END SUBROUTINE trd_mld_trc_zint
-
    SUBROUTINE trd_mld_trc_init                                    ! Empty routine
       WRITE(*,*) 'trd_mld_trc_init: You should not have seen this print! error?'
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90	(revision 2715)
@@ -4,37 +4,31 @@
    !! Ocean trends :   set tracer and momentum trend variables
    !!======================================================================
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/TRD/trdmld_oce.F90,v 1.2 2005/03/27 18:35:23 opalod Exp $ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-#if defined key_top
+#if defined key_top   ||   defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
-
-   USE par_oce                        ! ocean parameters
-   USE par_trc                        ! passive tracers parameters
+   USE par_oce       ! ocean parameters
+   USE par_trc       ! passive tracers parameters
 
    IMPLICIT NONE
    PUBLIC
 
-   !!* Namelist namtoptrd:  diagnostics on passive tracers trends
-   INTEGER  ::    nn_trd_trc                 !: time step frequency dynamics and tracers trends
-   INTEGER  ::    nn_ctls_trc                !: control surface type for trends vertical integration
+   !                                         !!* Namelist namtoptrd:  diagnostics on passive tracers trends
+   INTEGER  ::    nn_trd_trc                  !: time step frequency dynamics and tracers trends
+   INTEGER  ::    nn_ctls_trc                 !: control surface type for trends vertical integration
    REAL(wp) ::    rn_ucf_trc                  !: unit conversion factor (for netCDF trends outputs)
-   LOGICAL  ::    ln_trdmld_trc_instant    !: flag to diagnose inst./mean ML trc trends
-   LOGICAL  ::    ln_trdmld_trc_restart    !: flag to restart mixed-layer trc diagnostics
-   CHARACTER(len=50) ::  cn_trdrst_trc_in  !: suffix of pass. tracer restart name (input)
-   CHARACTER(len=50) ::  cn_trdrst_trc_out !: suffix of pass. tracer restart name (output)
-   LOGICAL, DIMENSION (jptra) ::   ln_trdtrc  !: large trends diagnostic to write or not (namelist)
+   LOGICAL  ::    ln_trdmld_trc_instant       !: flag to diagnose inst./mean ML trc trends
+   LOGICAL  ::    ln_trdmld_trc_restart       !: flag to restart mixed-layer trc diagnostics
+   CHARACTER(len=50) ::  cn_trdrst_trc_in     !: suffix of pass. tracer restart name (input)
+   CHARACTER(len=50) ::  cn_trdrst_trc_out    !: suffix of pass. tracer restart name (output)
+   LOGICAL, DIMENSION(jptra) ::   ln_trdtrc   !: large trends diagnostic to write or not (namelist)
 
 # if defined key_trdtrc && defined key_iomput
    LOGICAL, PARAMETER ::   lk_trdtrc = .TRUE. 
-#else
+# else
    LOGICAL, PARAMETER ::   lk_trdtrc = .FALSE.   !: ML trend flag
-#endif
+# endif
 
-#if defined key_trdmld_trc
+# if defined key_trdmld_trc   ||   defined key_esopa
    !!----------------------------------------------------------------------
    !!   'key_trdmld_trc'                     mixed layer trends diagnostics
@@ -60,7 +54,7 @@
    !! Trends diagnostics parameters
    !!---------------------------------------------------------------------
-   INTEGER, PARAMETER ::            &
-      jpltrd_trc = 12,                  & !: number of mixed-layer trends arrays
-      jpktrd_trc = jpk                    !: max level for mixed-layer trends diag.
+   INTEGER, PARAMETER :: jpltrd_trc = 12    !: number of mixed-layer trends arrays
+      
+   INTEGER            :: jpktrd_trc         !: max level for mixed-layer trends diag.
 
    !! Arrays used for diagnosing mixed-layer trends 
@@ -68,15 +62,15 @@
    CHARACTER(LEN=80) :: clname_trc, ctrd_trc(jpltrd_trc+1,2)
 
-   INTEGER, DIMENSION(jpi,jpj) ::   &
+   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   &
       nmld_trc       , &                            !: mixed layer depth indexes 
       nbol_trc                                   !: mixed-layer depth indexes when read from file
 
-   REAL(wp), DIMENSION(jpi,jpj,jpk) ::  wkx_trc  !:
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  wkx_trc  !:
 
-   REAL(wp), DIMENSION(jpi,jpj) ::  rmld_trc     !: ML depth (m) corresponding to nmld_trc
-   REAL(wp), DIMENSION(jpi,jpj) ::  rmld_sum_trc !: needed to compute the leap-frog time mean of ML depth
-   REAL(wp), DIMENSION(jpi,jpj) ::  rmldbn_trc   !: idem
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  rmld_trc     !: ML depth (m) corresponding to nmld_trc
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  rmld_sum_trc !: needed to compute the leap-frog time mean of ML depth
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::  rmldbn_trc   !: idem
 
-   REAL(wp), DIMENSION(jpi,jpj,jptra) ::  &
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  &
       tml_trc    ,                        &      !: \ "now" mixed layer temperature/salinity
       tmlb_trc   ,                        &      !: /  and associated "before" fields
@@ -89,5 +83,5 @@
                                                  !:     previous analysis period
                                                  
-   REAL(wp), DIMENSION(jpi,jpj,jptra) ::  &      
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  &      
       tmlatfb_trc, tmlatfn_trc ,          &      !: "before" Asselin contrib. at beginning of the averaging
                                                  !:     period (i.e. last contrib. from previous such period)
@@ -98,5 +92,5 @@
       tmlradm_trc                                !: accumulator for the previous trcrad trend
 
-   REAL(wp), DIMENSION(jpi,jpj,jpltrd_trc,jptra) ::  &
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  &
       tmltrd_trc,                         &      !: \ physical contributions to the total trend (for T/S),
                                                  !: / cumulated over the current analysis window
@@ -105,14 +99,14 @@
       tmltrd_csum_ub_trc                         !: before (prev. analysis period) cumulated sum over the
                                                  !: upper triangle
-   REAL(wp), DIMENSION(jpi,jpj,jptra) ::  &
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  &
       tmltrdm_trc                                !: total cumulative trends over the analysis window
 
-#else
+# else
    LOGICAL, PARAMETER ::   lk_trdmld_trc = .FALSE.   !: ML trend flag
-#endif
+# endif
 
-#if defined key_lobster
+# if defined key_lobster
    CHARACTER(LEN=80) :: clname_bio, ctrd_bio(jpdiabio,2)
-   REAL(wp), DIMENSION(jpi,jpj,jpdiabio) ::  &
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  &
       tmltrd_bio,                         &      !: \ biological contributions to the total trend ,
                                                  !: / cumulated over the current analysis window
@@ -122,4 +116,58 @@
                                                  !: upper triangle
 #endif
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/TRD/trdmld_oce.F90,v 1.2 2005/03/27 18:35:23 opalod Exp $ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION trd_mod_trc_oce_alloc()
+      !!----------------------------------------------------------------------
+      !!         *** ROUTINE trd_mod_trc_oce_alloc ***
+      !!----------------------------------------------------------------------
+      USE lib_mpp, ONLY: ctl_warn
+      INTEGER :: ierr(2)
+      !!----------------------------------------------------------------------
+      ierr(:) = 0
+      !
+# if defined key_trdmld_trc
+      ALLOCATE(nmld_trc(jpi,jpj),          nbol_trc(jpi,jpj),           &
+               wkx_trc(jpi,jpj,jpk),       rmld_trc(jpi,jpj),           &
+               rmld_sum_trc(jpi,jpj),      rmldbn_trc(jpi,jpj),         &
+               tml_trc(jpi,jpj,jptra),     tmlb_trc(jpi,jpj,jptra),     &
+               tmlbb_trc(jpi,jpj,jptra),   tmlbn_trc(jpi,jpj,jptra),    &
+               tml_sum_trc(jpi,jpj,jptra), tml_sumb_trc(jpi,jpj,jptra), &
+               tmltrd_atf_sumb_trc(jpi,jpj,jptra),                      &
+               tmltrd_rad_sumb_trc(jpi,jpj,jptra),                      &
+               !
+               tmlatfb_trc(jpi,jpj,jptra), tmlatfn_trc(jpi,jpj,jptra),  &
+               tmlatfm_trc(jpi,jpj,jptra), tmlradb_trc(jpi,jpj,jptra),  &
+               tmlradn_trc(jpi,jpj,jptra), tmlradm_trc(jpi,jpj,jptra),  &
+               !
+               tmltrd_trc(jpi,jpj,jpltrd_trc,jptra)         , &
+               tmltrd_sum_trc(jpi,jpj,jpltrd_trc,jptra)     , &
+               tmltrd_csum_ln_trc(jpi,jpj,jpltrd_trc,jptra) , &
+               tmltrd_csum_ub_trc(jpi,jpj,jpltrd_trc,jptra) , &
+               !
+               tmltrdm_trc(jpi,jpj,jptra)                   , STAT=ierr(1) )
+#endif
+      !
+# if defined key_lobster
+      ALLOCATE( tmltrd_bio        (jpi,jpj,jpdiabio) ,     &
+         &      tmltrd_sum_bio    (jpi,jpj,jpdiabio) ,     &
+         &      tmltrd_csum_ln_bio(jpi,jpj,jpdiabio) ,     &
+         &      tmltrd_csum_ub_bio(jpi,jpj,jpdiabio) , STAT=ierr(2) )
+# endif
+      !
+      trd_mod_trc_oce_alloc = MAXVAL(ierr)
+      !
+      IF( trd_mod_trc_oce_alloc /= 0 )   CALL ctl_warn('trd_mod_trc_oce_alloc: failed to allocate arrays')
+      !
+# if defined key_trdmld_trc
+      jpktrd_trc = jpk      ! Initialise what used to be a parameter - max level for mixed-layer trends diag.
+# endif
+      !
+   END FUNCTION trd_mod_trc_oce_alloc
 
 #else
@@ -129,4 +177,4 @@
 #endif
 
-
+   !!======================================================================
 END MODULE trdmod_trc_oce
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 2715)
@@ -33,5 +33,14 @@
    !* IO manager *
    USE in_out_manager    
-                          
+ 
+   !* MPP library                         
+   USE lib_mpp 
+
+   !* Fortran utilities                         
+   USE lib_fortran
+
+   !* Lateral boundary conditions                         
+   USE lbclnk
+
    !* physical constants *
    USE phycst            
@@ -88,4 +97,5 @@
    USE dom_oce , ONLY :   e1t        =>   e1t        !: horizontal scale factors at t-point (m)  
    USE dom_oce , ONLY :   e2t        =>   e2t        !: horizontal scale factors at t-point (m)   
+   USE dom_oce , ONLY :   e1e2t      =>   e1e2t      !: cell surface at t-point (m2)
    USE dom_oce , ONLY :   e1u        =>   e1u        !: horizontal scale factors at u-point (m)
    USE dom_oce , ONLY :   e2u        =>   e2u        !: horizontal scale factors at u-point (m)
@@ -194,5 +204,4 @@
 
 #endif
-   USE lib_mpp , ONLY :   lk_mpp    =>  lk_mpp        !: Mpp flag
 
    USE dom_oce , ONLY :   nn_cla    =>  nn_cla        !: flag (0/1) for cross land advection 
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90	(revision 2715)
@@ -17,6 +17,4 @@
    USE par_trc          ! TOP parameters
    USE oce_trc          ! ocean space and time domain variables
-   USE in_out_manager   ! I/O manager
-   USE lib_mpp          ! distributed memory computing
 
    IMPLICIT NONE
@@ -69,11 +67,13 @@
       INTEGER                              , INTENT(in), OPTIONAL ::   kdim      ! k- direction for 4D arrays
       !!
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zmask, ztab3d 
       INTEGER  ::   overlap, jn, js, sind, eind, kdir, j_id
       REAL(wp) ::   zsum, zvctl
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmask, ztab3d
       CHARACTER (len=20), DIMENSION(jptra) ::   cl
       CHARACTER (len=10) ::   cl2
       !!----------------------------------------------------------------------
 
+      ALLOCATE( zmask (jpi,jpj,jpk) )
+      ALLOCATE( ztab3d(jpi,jpj,jpk) )
       !                                      ! Arrays, scalars initialization 
       overlap       = 0
@@ -150,4 +150,7 @@
          !
       END DO
+      !
+      DEALLOCATE( zmask  )
+      DEALLOCATE( ztab3d )
       !
    END SUBROUTINE prt_ctl_trc
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 2715)
@@ -19,4 +19,6 @@
    PUBLIC
 
+   PUBLIC   trc_alloc   ! called by nemogcm.F90
+
    !! passive tracers names and units (read in namelist)
    !! --------------------------------------------------
@@ -34,50 +36,48 @@
    !! passive tracers fields (before,now,after)
    !! --------------------------------------------------
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: cvol   !: volume correction -degrad option- 
    REAL(wp), PUBLIC ::   trai                          !: initial total tracer
    REAL(wp), PUBLIC ::   areatot                       !: total volume 
-
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   trn   !: traceur concentration for actual time step
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   tra   !: traceur concentration for next time step
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) ::   trb   !: traceur concentration for before time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:)   ::   cvol   !: volume correction -degrad option- 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   trn    !: traceur concentration for now time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   tra    !: traceur concentration for next time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) ::   trb    !: traceur concentration for before time step
 
    !! interpolated gradient
    !!--------------------------------------------------  
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) ::   gtru   !: horizontal gradient at u-points at bottom ocean level
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jptra) ::   gtrv   !: horizontal gradient at v-points at bottom ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   gtru   !: hor. gradient at u-points at bottom ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   gtrv   !: hor. gradient at v-points at bottom ocean level
    
    !! passive tracers restart (input and output)
    !! ------------------------------------------  
-   LOGICAL , PUBLIC          ::  ln_rsttr      !: boolean term for restart i/o for passive tracers (namelist)
-   LOGICAL , PUBLIC          ::  lrst_trc      !: logical to control the trc restart write
-   INTEGER , PUBLIC          ::  nn_dttrc      !: frequency of step on passive tracers
-   INTEGER , PUBLIC          ::  nutwrs        !: output FILE for passive tracers restart
-   INTEGER , PUBLIC          ::  nutrst        !: logical unit for restart FILE for passive tracers
-   INTEGER , PUBLIC          ::  nn_rsttr      !: control of the time step ( 0 or 1 ) for pass. tr.
-   CHARACTER(len=50), PUBLIC ::  cn_trcrst_in  !: suffix of pass. tracer restart name (input)
-   CHARACTER(len=50), PUBLIC ::  cn_trcrst_out !: suffix of pass. tracer restart name (output)
+   LOGICAL          , PUBLIC ::  ln_rsttr        !: boolean term for restart i/o for passive tracers (namelist)
+   LOGICAL          , PUBLIC ::  lrst_trc        !: logical to control the trc restart write
+   INTEGER          , PUBLIC ::  nn_dttrc        !: frequency of step on passive tracers
+   INTEGER          , PUBLIC ::  nutwrs          !: output FILE for passive tracers restart
+   INTEGER          , PUBLIC ::  nutrst          !: logical unit for restart FILE for passive tracers
+   INTEGER          , PUBLIC ::  nn_rsttr        !: control of the time step ( 0 or 1 ) for pass. tr.
+   CHARACTER(len=50), PUBLIC ::  cn_trcrst_in    !: suffix of pass. tracer restart name (input)
+   CHARACTER(len=50), PUBLIC ::  cn_trcrst_out   !: suffix of pass. tracer restart name (output)
    
    !! information for outputs
    !! --------------------------------------------------
    INTEGER , PUBLIC ::   nn_writetrc   !: time step frequency for concentration outputs (namelist)
-   REAL(wp), PUBLIC, DIMENSION(jpk) ::   rdttrc        !: vertical profile of passive tracer time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   rdttrc        !: vertical profile of passive tracer time step
    
 # if defined key_diatrc && ! defined key_iomput
    !! additional 2D/3D outputs namelist
    !! --------------------------------------------------
-   INTEGER , PUBLIC                               ::   nn_writedia   !: frequency of additional arrays outputs(namelist)
-   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2d      !: 2d output field name
-   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2u      !: 2d output field unit   
-   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3d      !: 3d output field name
-   CHARACTER(len= 8), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3u      !: 3d output field unit
-   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) ::   ctrc2l      !: 2d output field long name
-   CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) ::   ctrc3l      !: 3d output field long name
+   INTEGER         , PUBLIC                      ::   nn_writedia   !: frequency of additional arrays outputs(namelist)
+   CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) ::   ctrc2d      !: 2d output field name
+   CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) ::   ctrc2u      !: 2d output field unit   
+   CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) ::   ctrc3d      !: 3d output field name
+   CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) ::   ctrc3u      !: 3d output field unit
+   CHARACTER(len=80), PUBLIC, DIMENSION(jpdia2d) ::   ctrc2l      !: 2d output field long name
+   CHARACTER(len=80), PUBLIC, DIMENSION(jpdia3d) ::   ctrc3l      !: 3d output field long name
 
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,    jpdia2d) ::   trc2d    !:  additional 2d outputs  
-   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) ::   trc3d    !:  additional 3d outputs  
-   
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,  :) ::   trc2d    !:  additional 2d outputs  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trc3d    !:  additional 3d outputs  
 # endif
 
-#if defined key_diabio || defined key_trdmld_trc
+# if defined key_diabio || defined key_trdmld_trc
    !                                                              !!*  namtop_XXX namelist *
    INTEGER , PUBLIC                               ::   nn_writebio   !: time step frequency for biological outputs 
@@ -85,9 +85,9 @@
    CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) ::   ctrbiu      !: biological trends unit   
    CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) ::   ctrbil      !: biological trends long name
-#endif
+# endif
 # if defined key_diabio
    !! Biological trends
    !! -----------------
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jpdiabio) :: trbio   !: biological trends
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trbio   !: biological trends
 # endif
 
@@ -99,4 +99,35 @@
 # endif
 
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3.1 , NEMO Consortium (2010)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   INTEGER FUNCTION trc_alloc()
+      !!-------------------------------------------------------------------
+      !!                    *** ROUTINE trc_alloc ***
+      !!-------------------------------------------------------------------
+      USE lib_mpp, ONLY: ctl_warn
+      !!-------------------------------------------------------------------
+      !
+      ALLOCATE( cvol(jpi,jpj,jpk      ) ,                           &
+         &      trn (jpi,jpj,jpk,jptra) ,                           &
+         &      tra (jpi,jpj,jpk,jptra) ,                           &
+         &      trb (jpi,jpj,jpk,jptra) ,                           &
+         &      gtru(jpi,jpj    ,jptra) , gtrv(jpi,jpj,jptra) ,     &
+# if defined key_diatrc && ! defined key_iomput
+         &      trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), &
+# endif
+# if defined key_diabio
+         &      trbio(jpi,jpj,jpk,jpdiabio),                        &
+#endif
+               rdttrc(jpk) ,  STAT=trc_alloc )      
+
+      IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays')
+      !
+   END FUNCTION trc_alloc
+
 #else
    !!----------------------------------------------------------------------
@@ -105,8 +136,4 @@
 #endif
 
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE trc
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90	(revision 2715)
@@ -25,6 +25,4 @@
    USE par_trc
    USE dianam    ! build name of file (routine)
-   USE in_out_manager  ! I/O manager
-   USE lib_mpp
    USE ioipsl
 
@@ -32,5 +30,6 @@
    PRIVATE
 
-   PUBLIC   trc_dia   ! called by XXX module 
+   PUBLIC   trc_dia        ! called by XXX module 
+   PUBLIC   trc_dia_alloc  ! called by nemogcm.F90
 
    INTEGER  ::   nit5      !: id for tracer output file
@@ -40,6 +39,6 @@
    INTEGER  ::   ndimt51   !: number of ocean points in index array
    REAL(wp) ::   zjulian   !: ????   not DOCTOR !
-   INTEGER , DIMENSION (jpij*jpk) ::   ndext50   !: integer arrays for ocean 3D index
-   INTEGER , DIMENSION (jpij)     ::   ndext51   !: integer arrays for ocean surface index
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) ::   ndext50   !: integer arrays for ocean 3D index
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) ::   ndext51   !: integer arrays for ocean surface index
 # if defined key_diatrc
    INTEGER  ::   nitd      !: id for additional array output file
@@ -58,5 +57,5 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -68,6 +67,7 @@
       !! ** Purpose :   output passive tracers fields 
       !!---------------------------------------------------------------------
-      INTEGER, INTENT( in ) :: kt
-      INTEGER               :: kindic
+      INTEGER, INTENT(in) ::   kt   ! ocean time-step
+      !
+      INTEGER ::   kindic   ! local integer
       !!---------------------------------------------------------------------
       !
@@ -95,7 +95,7 @@
       !!        IF kindic >0, output of fields before the time step loop
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt          ! ocean time-step
-      INTEGER, INTENT( in ) ::   kindic      ! indicator of abnormal termination
-      !!
+      INTEGER, INTENT(in) ::   kt       ! ocean time-step
+      INTEGER, INTENT(in) ::   kindic   ! indicator of abnormal termination
+      !
       INTEGER ::   jn
       LOGICAL ::   ll_print = .FALSE.
@@ -183,7 +183,7 @@
          DO jn = 1, jptra
             IF( lutsav(jn) ) THEN
-               cltra  = ctrcnm(jn)   ! short title for tracer
-               cltral = ctrcnl(jn)   ! long title for tracer
-               cltrau = ctrcun(jn)   ! UNIT for tracer
+               cltra  = TRIM( ctrcnm(jn) )   ! short title for tracer
+               cltral = TRIM( ctrcnl(jn) )   ! long title for tracer
+               cltrau = TRIM( ctrcun(jn) )   ! UNIT for tracer
                CALL histdef( nit5, cltra, cltral, cltrau, jpi, jpj, nhorit5,  &
                   &          ipk, 1, ipk,  ndepit5, 32, clop, zsto, zout ) 
@@ -208,5 +208,5 @@
 
       DO jn = 1, jptra
-         cltra = ctrcnm(jn)      ! short title for tracer
+         cltra  = TRIM( ctrcnm(jn) )   ! short title for tracer
          IF( lutsav(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 )
       END DO
@@ -216,5 +216,4 @@
       IF( kt == nitend .OR. kindic < 0 )   CALL histclo( nit5 )
       !
-
    END SUBROUTINE trcdit_wr
 
@@ -237,6 +236,6 @@
       !!        IF kindic >0, output of fields before the time step loop
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt          ! ocean time-step
-      INTEGER, INTENT( in ) ::   kindic      ! indicator of abnormal termination
+      INTEGER, INTENT(in) ::   kt       ! ocean time-step
+      INTEGER, INTENT(in) ::   kindic   ! indicator of abnormal termination
       !!
       LOGICAL ::   ll_print = .FALSE.
@@ -308,7 +307,7 @@
          ! more 3D horizontal arrays
          DO jl = 1, jpdia3d
-            cltra  = ctrc3d(jl)   ! short title for 3D diagnostic
-            cltral = ctrc3l(jl)   ! long title for 3D diagnostic
-            cltrau = ctrc3u(jl)   ! UNIT for 3D diagnostic
+            cltra  = TRIM( ctrc3d(jl) )   ! short title for 3D diagnostic
+            cltral = TRIM( ctrc3l(jl) )  ! long title for 3D diagnostic
+            cltrau = TRIM( ctrc3u(jl) )  ! UNIT for 3D diagnostic
             CALL histdef( nitd, cltra, cltral, cltrau, jpi, jpj, nhoritd,   &
                &          ipk, 1, ipk,  ndepitd, 32, clop, zsto, zout )
@@ -317,7 +316,7 @@
          ! more 2D horizontal arrays
          DO jl = 1, jpdia2d
-            cltra  = ctrc2d(jl)    ! short title for 2D diagnostic
-            cltral = ctrc2l(jl)   ! long title for 2D diagnostic
-            cltrau = ctrc2u(jl)   ! UNIT for 2D diagnostic
+            cltra  = TRIM( ctrc2d(jl) )   ! short title for 2D diagnostic
+            cltral = TRIM( ctrc2l(jl) )  ! long title for 2D diagnostic
+            cltrau = TRIM( ctrc2u(jl) )  ! UNIT for 2D diagnostic
             CALL histdef( nitd, cltra, cltral, cltrau, jpi, jpj, nhoritd,  &
                &          1, 1, 1,  -99, 32, clop, zsto, zout )
@@ -345,5 +344,5 @@
       ! more 3D horizontal arrays
       DO jl = 1, jpdia3d
-         cltra = ctrc3d(jl)   ! short title for 3D diagnostic
+         cltra  = TRIM( ctrc3d(jl) )   ! short title for 3D diagnostic
          CALL histwrite( nitd, cltra, it, trc3d(:,:,:,jl), ndimt50 ,ndext50)
       END DO
@@ -351,5 +350,5 @@
       ! more 2D horizontal arrays
       DO jl = 1, jpdia2d
-         cltra = ctrc2d(jl)   ! short title for 2D diagnostic
+         cltra  = TRIM( ctrc2d(jl) )   ! short title for 2D diagnostic
          CALL histwrite(nitd, cltra, it, trc2d(:,:,jl), ndimt51  ,ndext51)
       END DO
@@ -364,5 +363,5 @@
 # else
    SUBROUTINE trcdii_wr( kt, kindic )                      ! Dummy routine
-      INTEGER, INTENT ( in ) :: kt, kindic
+      INTEGER, INTENT (in) :: kt, kindic
    END SUBROUTINE trcdii_wr
 # endif
@@ -400,5 +399,4 @@
       ! Initialisation
       ! --------------
-
       
       ! local variable for debugging
@@ -451,7 +449,7 @@
          ! biological trends
          DO jl = 1, jpdiabio
-            cltra  = ctrbio(jl)   ! short title for biological diagnostic
-            cltral = ctrbil(jl)   ! long title for biological diagnostic
-            cltrau = ctrbiu(jl)   ! UNIT for biological diagnostic
+            cltra  = TRIM( ctrbio(jl) )   ! short title for biological diagnostic
+            cltral = TRIM( ctrbil(jl) )  ! long title for biological diagnostic
+            cltrau = TRIM( ctrbiu(jl) )  ! UNIT for biological diagnostic
             CALL histdef( nitb, cltra, cltral, cltrau, jpi, jpj, nhoritb,  &
                &         ipk, 1, ipk,  ndepitb, 32, clop, zsto, zout)
@@ -477,5 +475,5 @@
 
       DO jl = 1, jpdiabio
-         cltra = ctrbio(jl)  ! short title for biological diagnostic
+         cltra  = TRIM( ctrbio(jl) )   ! short title for biological diagnostic
          CALL histwrite(nitb, cltra, it, trbio(:,:,:,jl), ndimt50,ndext50)
       END DO
@@ -485,5 +483,4 @@
       IF( kt == nitend .OR. kindic < 0 )   CALL histclo( nitb )
       !
-
    END SUBROUTINE trcdib_wr
 
@@ -496,4 +493,13 @@
 # endif 
 
+   INTEGER FUNCTION trc_dia_alloc()
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_dia_alloc  ***
+      !!---------------------------------------------------------------------
+      ALLOCATE( ndext50(jpij*jpk), ndext51(jpij), STAT=trc_dia_alloc )
+      !
+      IF( trc_dia_alloc /= 0 )   CALL ctl_warn('trc_dia_alloc : failed to allocate arrays')
+      !
+   END FUNCTION trc_dia_alloc
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 2715)
@@ -23,13 +23,14 @@
    PRIVATE
 
-   PUBLIC trc_dta   ! called in trcini.F90 and trcdmp.F90
+   PUBLIC   trc_dta         ! called in trcini.F90 and trcdmp.F90
+   PUBLIC   trc_dta_alloc   ! called in nemogcm.F90
 
    LOGICAL , PUBLIC, PARAMETER ::   lk_dtatrc = .TRUE.   !: temperature data flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk,jptra) ::   trdta   !: tracer data at given time-step
-
-   REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,2) ::   tracdta            ! tracer data at two consecutive times
-   INTEGER , DIMENSION(jptra) ::   nlectr      !: switch for reading once
-   INTEGER , DIMENSION(jptra) ::   ntrc1       !: number of first month when reading 12 monthly value
-   INTEGER , DIMENSION(jptra) ::   ntrc2       !: number of second month when reading 12 monthly value
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   trdta   !: tracer data at given time-step
+
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) ::   tracdta       ! tracer data at two consecutive times
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   nlectr      !: switch for reading once
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   ntrc1       !: number of 1st month when reading 12 monthly value
+   INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) ::   ntrc2       !: number of 2nd month when reading 12 monthly value
 
    !! * Substitutions
@@ -38,5 +39,5 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 CONTAINS
@@ -55,5 +56,5 @@
       !!      two monthly values.
       !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt     ! ocean time-step
+      INTEGER, INTENT(in) ::   kt     ! ocean time-step
       !!
       CHARACTER (len=39) ::   clname(jptra)
@@ -198,4 +199,17 @@
    END SUBROUTINE trc_dta
 
+
+   INTEGER FUNCTION trc_dta_alloc()
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE trc_dta_alloc  ***
+      !!----------------------------------------------------------------------
+      ALLOCATE( trdta  (jpi,jpj,jpk,jptra  ) ,                    &
+         &      tracdta(jpi,jpj,jpk,jptra,2) ,                    &
+         &      nlectr(jptra) , ntrc1(jptra) , ntrc2(jptra) , STAT=trc_dta_alloc)
+         !
+      IF( trc_dta_alloc /= 0 )   CALL ctl_warn('trc_dta_alloc : failed to allocate arrays')
+      !
+   END FUNCTION trc_dta_alloc
+
 #else
    !!----------------------------------------------------------------------
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 2715)
@@ -4,8 +4,8 @@
    !! TOP :   Manage the passive tracer initialization
    !!======================================================================
-   !! History :    -   !  1991-03  ()  original code
-   !!             1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90
-   !!              -   !  2005-10 (C. Ethe) print control
-   !!             2.0  !  2005-10 (C. Ethe, G. Madec) revised architecture
+   !! History :   -   ! 1991-03 (O. Marti)  original code
+   !!            1.0  ! 2005-03 (O. Aumont, A. El Moussaoui) F90
+   !!            2.0  ! 2005-10 (C. Ethe, G. Madec) revised architecture
+   !!            4.0  ! 2011-01 (A. R. Porter, STFC Daresbury) dynamical allocation
    !!----------------------------------------------------------------------
 #if defined key_top
@@ -13,6 +13,6 @@
    !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
-   !!----------------------------------------------------------------------
-   !!   trc_init :   Initialization for passive tracer
+   !!   trc_init  :   Initialization for passive tracer
+   !!   top_alloc :   allocate the TOP arrays
    !!----------------------------------------------------------------------
    USE oce_trc
@@ -26,12 +26,7 @@
    USE trcini_my_trc   ! MY_TRC   initialisation
    USE trcdta   
-#if defined key_offline
    USE daymod
-#endif
    USE zpshde          ! partial step: hor. derivative   (zps_hde routine)
-   USE in_out_manager  ! I/O manager
    USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
-   USE lib_mpp         ! distributed memory computing library
-   USE lib_fortran     ! 
    
    IMPLICIT NONE
@@ -42,5 +37,9 @@
     !! * Substitutions
 #  include "domzgr_substitute.h90"
-  
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 4.0 , NEMO Consortium (2011)
+   !! $Id$ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
 CONTAINS
    
@@ -59,5 +58,4 @@
       INTEGER ::   jk, jn    ! dummy loop indices
       CHARACTER (len=25) :: charout
-
       !!---------------------------------------------------------------------
 
@@ -66,10 +64,12 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~'
 
-      !                 ! masked grid volume
+      CALL top_alloc()              ! allocate TOP arrays
+
+      !                             ! masked grid volume
       DO jk = 1, jpk
          cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 
       END DO
 
-      ! total volume of the ocean
+      !                             ! total volume of the ocean
 #if ! defined key_degrad
       areatot = glob_sum( cvol(:,:,:) )
@@ -78,16 +78,18 @@
 #endif
 
-                                  CALL trc_nam      ! read passive tracers namelists
-
-      ! restart for passive tracer (input)
+      CALL trc_nam                  ! read passive tracers namelists
+
+      !                             ! restart for passive tracer (input)
       IF( ln_rsttr ) THEN
          IF(lwp) WRITE(numout,*) '       read a restart file for passive tracer : ', cn_trcrst_in
          IF(lwp) WRITE(numout,*) ' '
       ELSE
-         IF(lwp) WRITE(numout,*)
-         DO jn = 1, jptra
-            IF( lwp .AND. lutini(jn) )  &                  ! open input FILE only IF lutini(jn) is true
-            &  WRITE(numout,*) '        read an initial file  for passive tracer number :', jn, ' traceur : ', ctrcnm(jn) 
-         END DO
+         IF( lwp .AND. lk_dtatrc ) THEN
+            DO jn = 1, jptra
+               IF( lutini(jn) )  &                  ! open input FILE only IF lutini(jn) is true
+                  &  WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' traceur : ', ctrcnm(jn) 
+             END DO
+          ENDIF
+          IF( lwp ) WRITE(numout,*)
       ENDIF
 
@@ -138,12 +140,12 @@
       ENDIF
  
-      tra(:,:,:,:) = 0.
+      tra(:,:,:,:) = 0._wp
       
       IF( ln_zps .AND. .NOT. lk_c1d )   &              ! Partial steps: before horizontal gradient of passive
-      &                     CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
-
-
-      !                 ! Computation content of all tracers
-      trai = 0.e0
+        &    CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
+
+
+      !           
+      trai = 0._wp         ! Computation content of all tracers
       DO jn = 1, jptra
 #if ! defined key_degrad
@@ -154,22 +156,72 @@
       END DO      
 
-      !                 ! control print
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
-      IF(lwp) WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
-      IF(lwp) WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
-      IF(lwp) WRITE(numout,*)
-
-      IF( ln_ctl )   CALL prt_ctl_trc_init      ! control print
-      !
-
-      IF(ln_ctl) THEN      ! print mean trends (used for debugging)
+      IF(lwp) THEN               ! control print
+         WRITE(numout,*)
+         WRITE(numout,*)
+         WRITE(numout,*) '          *** Total number of passive tracer jptra = ', jptra
+         WRITE(numout,*) '          *** Total volume of ocean                = ', areatot
+         WRITE(numout,*) '          *** Total inital content of all tracers  = ', trai
+         WRITE(numout,*)
+      ENDIF
+
+      IF(ln_ctl) THEN            ! print mean trends (used for debugging)
+         CALL prt_ctl_trc_init
          WRITE(charout, FMT="('ini ')")
          CALL prt_ctl_trc_info( charout )
          CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
       ENDIF
-
+      !
    END SUBROUTINE trc_init
+
+
+   SUBROUTINE top_alloc
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE top_alloc  ***
+      !!
+      !! ** Purpose :   Allocate all the dynamic arrays of the OPA modules
+      !!----------------------------------------------------------------------
+      USE trcadv        , ONLY:   trc_adv_alloc          ! TOP-related alloc routines...
+      USE trc           , ONLY:   trc_alloc
+      USE trcnxt        , ONLY:   trc_nxt_alloc
+      USE trczdf        , ONLY:   trc_zdf_alloc
+      USE trdmod_trc_oce, ONLY:   trd_mod_trc_oce_alloc
+#if ! defined key_iomput
+      USE trcdia        , ONLY:   trc_dia_alloc
+#endif
+#if defined key_trcdmp 
+      USE trcdmp        , ONLY:   trc_dmp_alloc
+#endif
+#if defined key_dtatrc
+      USE trcdta        , ONLY:   trc_dta_alloc
+#endif
+#if defined key_trdmld_trc   ||   defined key_esopa
+      USE trdmld_trc    , ONLY:   trd_mld_trc_alloc
+#endif
+      !
+      INTEGER :: ierr
+      !!----------------------------------------------------------------------
+      !
+      ierr =        trc_adv_alloc()          ! Start of TOP-related alloc routines...
+      ierr = ierr + trc_alloc    ()
+      ierr = ierr + trc_nxt_alloc()
+      ierr = ierr + trc_zdf_alloc()
+      ierr = ierr + trd_mod_trc_oce_alloc()
+#if ! defined key_iomput
+      ierr = ierr + trc_dia_alloc()
+#endif
+#if defined key_trcdmp 
+      ierr = ierr + trc_dmp_alloc()
+#endif
+#if defined key_dtatrc
+      ierr = ierr + trc_dta_alloc()
+#endif
+#if defined key_trdmld_trc   ||   defined key_esopa
+      ierr = ierr + trd_mld_trc_alloc()
+#endif
+      !
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'top_alloc : unable to allocate standard ocean arrays' )
+      !
+   END SUBROUTINE top_alloc
 
 #else
@@ -182,8 +234,4 @@
 #endif
 
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!======================================================================
 END MODULE trcini
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 2715)
@@ -26,5 +26,4 @@
    USE trcnam_c14b       ! C14 SMS namelist
    USE trcnam_my_trc     ! MY_TRC SMS namelist
-   USE in_out_manager    ! I/O manager
    USE trdmod_trc_oce
 
@@ -103,9 +102,9 @@
 
       DO jn = 1, jptra
-         ctrcnm(jn) = sn_tracer(jn)%clsname
-         ctrcnl(jn) = sn_tracer(jn)%cllname
-         ctrcun(jn) = sn_tracer(jn)%clunit
-         lutini(jn) = sn_tracer(jn)%llinit
-         lutsav(jn) = sn_tracer(jn)%llsave
+         ctrcnm(jn) = TRIM( sn_tracer(jn)%clsname )
+         ctrcnl(jn) = TRIM( sn_tracer(jn)%cllname )
+         ctrcun(jn) = TRIM( sn_tracer(jn)%clunit  )
+         lutini(jn) =       sn_tracer(jn)%llinit 
+         lutsav(jn) =       sn_tracer(jn)%llsave
       END DO
 
@@ -121,7 +120,7 @@
          DO jn = 1, jptra
             WRITE(numout,*) '   tracer nb             : ', jn 
-            WRITE(numout,*) '   short name            : ', TRIM(ctrcnm(jn))
-            WRITE(numout,*) '   long name             : ', TRIM(ctrcnl(jn))
-            WRITE(numout,*) '   unit                  : ', TRIM(ctrcun(jn))
+            WRITE(numout,*) '   short name            : ', ctrcnm(jn)
+            WRITE(numout,*) '   long name             : ', ctrcnl(jn)
+            WRITE(numout,*) '   unit                  : ', ctrcun(jn)
             WRITE(numout,*) '   initial value in FILE : ', lutini(jn) 
             WRITE(numout,*) ' '
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2715)
@@ -26,6 +26,4 @@
    USE trc
    USE trcnam_trp
-   USE lib_mpp
-   USE lib_fortran
    USE iom
    USE trcrst_cfc      ! CFC      
Index: /trunk/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 2714)
+++ /trunk/NEMOGCM/NEMO/TOP_SRC/trcsms.F90	(revision 2715)
@@ -30,7 +30,6 @@
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
    !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
