Index: /branches/GRISLIv3/SOURCES/prescribe-H-i2s_mod.f90
===================================================================
--- /branches/GRISLIv3/SOURCES/prescribe-H-i2s_mod.f90	(revision 430)
+++ /branches/GRISLIv3/SOURCES/prescribe-H-i2s_mod.f90	(revision 431)
@@ -18,30 +18,24 @@
 module prescribe_H
 
-  use module3D_phy
-  use param_phy_mod
-  use interface_input
-
-! pour les reculs de type ice2sea
-!  use toy_retreat_mod
+  ! pour les reculs de type ice2sea
+  !  use toy_retreat_mod
 
   implicit none
-!  real,dimension(nx,ny)    :: Hp           !< H value if prescribed
-!  real,dimension(nx,ny)    :: Hp0          !< H value if prescribed (reference value)
-!  real,dimension(nx,ny)    :: Delta_H      !< Delta_H value if prescribed
-!  integer,dimension(nx,ny) :: i_delta_H    !< 1 if Delta_H is prescribed on this node, else 0
-!  integer,dimension(nx,ny) :: i_Hp         !< 1 if H is prescribed on this node, else 0
-!  integer,dimension(nx,ny) :: i_Hp0        !< i_hp mask reference value does not change with time
-!  integer,dimension(nx,ny) :: MK_gl0       !< mask grounding line initial
-!  integer,dimension(nx,ny) :: MK_flot0     !< mask float initial
-
-! pour grounding line retreat, ice2sea
-! nouvelle version interactive pour imposer des contraintes variees.
-! sanity check, temps de depart en fonction des bassins, ....
-
-
-! nouvelle version recul grounding line pour ice2sea
-! ------------------------------------------------------
-
-
+  !  real,dimension(nx,ny)    :: Hp           !< H value if prescribed
+  !  real,dimension(nx,ny)    :: Hp0          !< H value if prescribed (reference value)
+  !  real,dimension(nx,ny)    :: Delta_H      !< Delta_H value if prescribed
+  !  integer,dimension(nx,ny) :: i_delta_H    !< 1 if Delta_H is prescribed on this node, else 0
+  !  integer,dimension(nx,ny) :: i_Hp         !< 1 if H is prescribed on this node, else 0
+  !  integer,dimension(nx,ny) :: i_Hp0        !< i_hp mask reference value does not change with time
+  !  integer,dimension(nx,ny) :: MK_gl0       !< mask grounding line initial
+  !  integer,dimension(nx,ny) :: MK_flot0     !< mask float initial
+
+  ! pour grounding line retreat, ice2sea
+  ! nouvelle version interactive pour imposer des contraintes variees.
+  ! sanity check, temps de depart en fonction des bassins, ....
+
+
+  ! nouvelle version recul grounding line pour ice2sea
+  ! ------------------------------------------------------
 
 contains
@@ -54,6 +48,11 @@
   subroutine init_prescribe_H
 
+    use module3D_phy, only: flot,MK_flot0,MK_gl0,Hp0,H0,Mk_init,i_hp0
+    use geography, only: nx,ny,geoplace
+    use runparam, only: itracebug 
+
     implicit none
     integer    :: voisin   !< pour test sur des masques
+    integer :: i,j
 
     if (itracebug.eq.1)  call tracebug(' Entree dans routine init_prescribe_H')
@@ -66,10 +65,8 @@
     end where
 
-
     ! determine the initial grounding line
 
     MK_gl0(:,:)=0
     HP0(:,:)=H0(:,:)
-
 
     do j=2,ny-1
@@ -78,14 +75,11 @@
           if ((MK_flot0(i,j).eq.0).and.(voisin.gt.0))  then  ! grounded and at least one neighbour floating
              MK_gl0(i,j) = 1                                ! tagged mask grounding line
-
           end if
        end do
     end do
 
-
     call prescribe_grid_boundary_0
 
-
-! Dans le cas du Groenland ice2sea, mk_init = 3 -> noeuds qui ne bougent pas
+    ! Dans le cas du Groenland ice2sea, mk_init = 3 -> noeuds qui ne bougent pas
 
     if (geoplace(1:4).eq.'GI2S') then
@@ -108,5 +102,8 @@
 
   subroutine prescribe_present_H_gl
-
+    
+    use module3D_phy, only: MK_flot0,MK_gl0,i_hp,Hp,Hp0
+    use runparam, only: itracebug 
+    
     implicit none
 
@@ -115,12 +112,11 @@
     where ((MK_flot0(:,:).eq. 1).or.(MK_gl0(:,:) .eq. 1)) ! floating or grounding line
        i_hp(:,:) = 1                                      ! thickness prescribed to present value
-       hp(:,:)   = Hp0(:,:)
-    end where
-if (itracebug.eq.1)  call tracebug(' fin prescribe_present_H_gl')
-
+       Hp(:,:)   = Hp0(:,:)
+    end where
+    if (itracebug.eq.1)  call tracebug(' fin prescribe_present_H_gl')
 
   end subroutine prescribe_present_H_gl
-  
-   !______________________________________________________________________________________
+
+  !______________________________________________________________________________________
   !>  function prescribe_present_H_gl_bmelt
   !! calculate the initial grounding line position
@@ -129,16 +125,18 @@
 
   subroutine prescribe_present_H_gl_bmelt
-
+    
+    use module3D_phy, only: i_hp
+    use runparam, only: itracebug 
+    
     implicit none
 
     if (itracebug.eq.1)  call tracebug(' Entree dans routine  prescribe_present_H_gl_bmelt')
 
-!    where (MK_gl0(:,:) .eq. 1) ! grounding line only !cdc pour calcule fonte basale
-!       i_hp(:,:) = 1                                 ! thickness prescribed to present value
-!       hp(:,:)   = Hp0(:,:)
-!    end where
+    !    where (MK_gl0(:,:) .eq. 1) ! grounding line only !cdc pour calcule fonte basale
+    !       i_hp(:,:) = 1                                 ! thickness prescribed to present value
+    !       hp(:,:)   = Hp0(:,:)
+    !    end where
     i_hp(:,:) = 0
-if (itracebug.eq.1)  call tracebug(' fin prescribe_present_H_gl_bmelt')
-
+    if (itracebug.eq.1)  call tracebug(' fin prescribe_present_H_gl_bmelt')
 
   end subroutine prescribe_present_H_gl_bmelt
@@ -150,6 +148,9 @@
 
   subroutine prescribe_fixed_points
-
-if (itracebug.eq.1)  call tracebug(' Entree dans routine  prescribe_fixed_points')
+    
+    use module3D_phy, only: i_hp0,i_hp,Hp,Hp0
+    use runparam, only: itracebug 
+    
+    if (itracebug.eq.1)  call tracebug(' Entree dans routine  prescribe_fixed_points')
     where (i_hp0(:,:).eq.1)             ! les points i_hp0 le sont pour tout le run
        i_hp(:,:) = i_hp0(:,:)
@@ -157,6 +158,5 @@
     end where
 
-if (itracebug.eq.1)  call tracebug(' fin prescribe_fixed_points')
-
+    if (itracebug.eq.1)  call tracebug(' fin prescribe_fixed_points')
 
   end subroutine prescribe_fixed_points
@@ -169,5 +169,9 @@
 
   subroutine prescribe_paleo_gl_shelf
-
+    
+    use module3D_phy, only: MK_flot0,MK_gl0,i_hp,hp,sealevel_2d,Bsoc
+    use runparam, only: itracebug 
+    use param_phy_mod, only: row,ro
+    
     implicit none
 
@@ -175,5 +179,5 @@
 
 
-!   noeuds qui doivent être imposés
+    !   noeuds qui doivent être imposés
 
     where ((MK_flot0(:,:).eq. 1).or.(MK_gl0(:,:) .eq. 1)) ! floating or grounding line
@@ -181,5 +185,5 @@
     end where
 
-! valeur imposee
+    ! valeur imposee
     where (MK_flot0(:,:).eq. 1)                          ! paleo shelf epaisseur a 1
        hp(:,:)   = 1.
@@ -191,5 +195,4 @@
     end where
 
-
   end subroutine prescribe_paleo_gl_shelf
 
@@ -200,6 +203,11 @@
 
   subroutine prescribe_grid_boundary_0
-
-    implicit none
+    
+    use module3D_phy, only: i_hp,hp,i_hp0,hp0
+    use runparam, only: itracebug 
+    use geography, only: nx,ny
+
+    implicit none
+
     if (itracebug.eq.1)  call tracebug(' Entree dans routine prescribe_grid_boundary_0')
 
@@ -217,5 +225,5 @@
     hp(:,ny)  = 0
 
-! valeurs de reference
+    ! valeurs de reference
     i_hp0(1,:)  = 1
     i_hp0(nx,:) = 1
@@ -228,5 +236,4 @@
     hp0(:,ny)   = 0
 
-
   end subroutine prescribe_grid_boundary_0
   !______________________________________________________________________________________
@@ -237,5 +244,8 @@
   !!
   subroutine break_all_ice_shelves
-
+    
+    use module3D_phy, only: i_hp,hp,hp0,H,debug_3D,flot,MK_flot0
+    use runparam, only: itracebug
+    
     implicit none
     if (itracebug.eq.1)  call tracebug(' Entree dans routine break_all_ice_shelves ')
@@ -259,5 +269,4 @@
     end where
 
-
   end subroutine break_all_ice_shelves
 
@@ -268,8 +277,14 @@
   !!
   subroutine melt_ice_shelves
-
-    implicit none
+    
+    use module3D_phy, only: i_hp,H,hp,dt,flot
+    use runparam, only: itracebug 
+    use geography, only: nx,ny
+    
+    implicit none
+    
     integer :: nbvoisins,nbdeglac,iv,jv
     real    :: hmoy,hmin,hmax
+    integer :: i,j
 
     if (itracebug.eq.1)  call tracebug(' Entree dans routine melt_ice_shelves')
@@ -314,5 +329,5 @@
 
 
-   !______________________________________________________________________________________
+  !______________________________________________________________________________________
   !>  function prescribe_present_H_gl
   !! calculate the initial grounding line position
@@ -320,6 +335,12 @@
 
   subroutine prescribe_present_H_gl_copy
-
-    implicit none
+    
+    use module3D_phy, only: i_hp,hp,Hp0,MK_flot0,MK_gl0
+    use runparam, only: itracebug 
+    use geography, only: nx,ny
+    
+    implicit none
+    integer :: i,j
+    
     if (itracebug.eq.1)  call tracebug(' Entree dans routine  prescribe_present_H_gl-copy')
 
@@ -333,12 +354,6 @@
     end do
 
-!!$where ((MK_flot0(:,:).eq. 1).or.(MK_gl0(:,:) .eq. 1)) ! floating or grounding line
-!!$   i_hp(:,:) = 1                                      ! thickness prescribed to present value
-!!$!   hp(:,:)   = 1   !Hp0(:,:)
-!!$end where
-
-
   end subroutine prescribe_present_H_gl_copy
-!______________________________________________________________________________________
+  !______________________________________________________________________________________
 
 
