Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/cfgs/SHARED/field_def_nemo-ice.xml
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12394)
@@ -178,5 +178,7 @@
           <field id="icettop_cat"  long_name="Ice/snow surface temperature per category"         unit="degC"   grid_ref="grid_T_3D_ncatice" />
           <field id="iceapnd_cat"  long_name="Ice melt pond concentration per category"          unit="%"      grid_ref="grid_T_3D_ncatice" /> 
+          <!--
           <field id="icehpnd_cat"  long_name="Ice melt pond thickness per category"              unit="m"      grid_ref="grid_T_3D_ncatice" /> 
+          -->
           <field id="iceafpnd_cat" long_name="Ice melt pond fraction per category"               unit="m"      grid_ref="grid_T_3D_ncatice" /> 
           <field id="icehlid_cat"  long_name="Ice melt pond lid thickness per category"          unit="m"      grid_ref="grid_T_3D_ncatice" />
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icedyn_rdgrft.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icedyn_rdgrft.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icedyn_rdgrft.F90	(revision 12394)
@@ -500,6 +500,6 @@
       REAL(wp)                  ::   airdg1, oirdg1, aprdg1, virdg1, sirdg1
       REAL(wp)                  ::   airft1, oirft1, aprft1
-      REAL(wp), DIMENSION(jpij) ::   airdg2, oirdg2, aprdg2, virdg2, sirdg2, vsrdg, vprdg  ! area etc of new ridges
-      REAL(wp), DIMENSION(jpij) ::   airft2, oirft2, aprft2, virft , sirft , vsrft, vprft  ! area etc of rafted ice
+      REAL(wp), DIMENSION(jpij) ::   airdg2, oirdg2, aprdg2, virdg2, sirdg2, vsrdg, vprdg, lhprdg  ! area etc of new ridges
+      REAL(wp), DIMENSION(jpij) ::   airft2, oirft2, aprft2, virft , sirft , vsrft, vprft, lhprft  ! area etc of rafted ice
       !
       REAL(wp), DIMENSION(jpij) ::   ersw             ! enth of water trapped into ridges
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icerst.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icerst.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icerst.F90	(revision 12394)
@@ -219,4 +219,5 @@
          lh_ip(:,:,:) = 0._wp
       ENDIF
+      WRITE(numout,*) 'icerst: lh_ip(42,26,1) = ',lh_ip(42,26,1)
       ! Snow enthalpy
       DO jk = 1, nlay_s
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icethd_pnd.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icethd_pnd.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icethd_pnd.F90	(revision 12394)
@@ -151,5 +151,5 @@
 
       ! Define time-independent field for use in refreezing
-      omega_dt = 2.0_wp * rcnd_i * rdtice / (rLfus * rhow)
+      omega_dt = 2.0_wp * rcnd_i * rdt_ice / (rLfus * rhow)
 
       DO ji = 1, npti
@@ -167,4 +167,7 @@
             h_ip_1d(ji)      = 0._wp
             lh_ip_1d(ji)     = 0._wp
+
+            actual_mlt = 0._wp
+            actual_frz = 0._wp
             !                                                     !--------------------------------!
          ELSE                                                     ! Case ice thickness >= rn_himin !
@@ -190,5 +193,5 @@
                
                ! The following equation is a rearranged form of:
-               ! lid_thickness_end - lid_thickness_start = rcnd_i * t_grad * rdtice / (0.5*(lid_thickness_end + lid_thickness_start) * rLfus * rhow)
+               ! lid_thickness_end - lid_thickness_start = rcnd_i * t_grad * rdt_ice / (0.5*(lid_thickness_end + lid_thickness_start) * rLfus * rhow)
                ! where: lid_thickness_start = lh_ip_1d(ji)
                !        lid_thickness_end = lh_ip_end
@@ -209,12 +212,14 @@
             END IF
 
-            ! melt pond mass flux diagnostic (melt only)
-            zfac = actual_mlt * a_i_1d(ji * rhow * r1_rdtice
-            wfx_pnd_1d(ji) = wfx_pnd_1d(ji) - zfac
-            !
-            ! adjust ice/snow melting flux to balance melt pond flux (>0)
-            zdum = zfac / ( wfx_snw_sum_1d(ji) + wfx_sum_1d(ji) )
-            wfx_snw_sum_1d(ji) = wfx_snw_sum_1d(ji) * (1._wp + zdum)
-            wfx_sum_1d(ji)     = wfx_sum_1d(ji)     * (1._wp + zdum)
+            ! melt pond mass flux (<0)
+            IF( zdv_mlt > 0._wp ) THEN
+               zfac = actual_mlt * a_i_1d(ji) * rhow * r1_rdtice
+               wfx_pnd_1d(ji) = wfx_pnd_1d(ji) - zfac
+               !
+               ! adjust ice/snow melting flux to balance melt pond flux (>0)
+               zdum = zfac / ( wfx_snw_sum_1d(ji) + wfx_sum_1d(ji) )
+               wfx_snw_sum_1d(ji) = wfx_snw_sum_1d(ji) * (1._wp + zdum)
+               wfx_sum_1d(ji)     = wfx_sum_1d(ji)     * (1._wp + zdum)
+            ENDIF
             !
             ! Make sure pond volume or lid thickness has not gone negative
@@ -243,4 +248,5 @@
             write(numout,*)'icethd_pnd: a_i_1d(ji), v_ip_1d(ji), t_su_1d(ji), zfr_mlt, zdv_mlt = ',a_i_1d(ji), ' ', v_ip_1d(ji), ' ', t_su_1d(ji), ' ', zfr_mlt, ' ', zdv_mlt
             write(numout,*)'icethd_pnd: meltt = ', -( dh_i_sum(ji)*rhoi + dh_s_mlt(ji)*rhos ) / rhoi
+            write(numout,*)'icethd_pnd: lh_ip_1d(ji), actual_mlt, actual_frz, t_su_1d(ji) = ',lh_ip_1d(ji), ' ', actual_mlt, ' ', actual_frz, ' ', t_su_1d(ji)
          END IF
 
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/iceupdate.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/iceupdate.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/iceupdate.F90	(revision 12394)
@@ -279,5 +279,5 @@
       IF( iom_use('hfxcndbot'  ) )   CALL iom_put( "hfxcndbot"  , SUM( qcn_ice_bot * a_i_b, dim=3 ) )   ! Bottom conduction flux
       IF( iom_use('hfxcndtop'  ) )   CALL iom_put( "hfxcndtop"  , SUM( qcn_ice_top * a_i_b, dim=3 ) )   ! Surface conduction flux
-      IF( iom_use('hfxcndcpl'  ) )   CALL iom_put( "hfxcndcpl"  , SUM( qcn_ice * a_i_b, dim=3 ) )       ! Conduction flux we are giving it
+      ! IF( iom_use('hfxcndcpl'  ) )   CALL iom_put( "hfxcndcpl"  , SUM( qcn_ice * a_i_b, dim=3 ) )       ! Conduction flux we are giving it
 
       ! diags
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icewri.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icewri.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/icewri.F90	(revision 12394)
@@ -155,5 +155,5 @@
       IF( iom_use('iceconc_cat' ) )   CALL iom_put( "iceconc_cat" , a_i * zmsk00l                                              )   ! area for categories
       IF( iom_use('icethic_cat' ) )   CALL iom_put( "icethic_cat" , h_i * zmsk00l                                              )   ! thickness for categories
-      IF( iom_use('icevol_cat'  ) )   CALL iom_put( "icevol_cat" , v_i * zmsk00l                                               )   ! volume for categories
+      ! IF( iom_use('icevol_cat'  ) )   CALL iom_put( "icevol_cat" , v_i * zmsk00l                                               )   ! volume for categories
       IF( iom_use('snwthic_cat' ) )   CALL iom_put( "snwthic_cat" , h_s * zmsksnl                                              )   ! snow depth for categories
       IF( iom_use('icesalt_cat' ) )   CALL iom_put( "icesalt_cat" , s_i * zmsk00l                                              )   ! salinity for categories
@@ -164,7 +164,7 @@
       IF( iom_use('icebrv_cat'  ) )   CALL iom_put( "icebrv_cat"  ,   bv_i * 100.  * zmsk00l                                   )   ! brine volume
       IF( iom_use('iceapnd_cat' ) )   CALL iom_put( "iceapnd_cat" ,   a_ip         * zmsk00l                                   )   ! melt pond frac for categories
-      IF( iom_use('icehpnd_cat' ) )   CALL iom_put( "icehpnd_cat" ,   h_ip         * zmsk00l                                   )   ! melt pond frac for categories
+      ! IF( iom_use('icehpnd_cat' ) )   CALL iom_put( "icehpnd_cat" ,   h_ip         * zmsk00l                                   )   ! melt pond frac for categories
       IF( iom_use('iceafpnd_cat') )   CALL iom_put( "iceafpnd_cat",   a_ip_frac    * zmsk00l                                   )   ! melt pond frac for categories
-      IF( iom_uce('icehlid_cat' ) )   CALL iom_put( "icehlid_cat",    lh_ip        * zmsk00l                                   )   ! melt pond lid thickness for categories
+      ! IF( iom_use('icehlid_cat' ) )   CALL iom_put( "icehlid_cat",    lh_ip        * zmsk00l                                   )   ! melt pond lid thickness for categories
 
       !------------------
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/BDY/bdyice.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/BDY/bdyice.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/BDY/bdyice.F90	(revision 12394)
@@ -172,4 +172,5 @@
                   a_ip(ji,jj,  jl) = 0._wp                            ! pond concentration
                   v_ip(ji,jj,  jl) = 0._wp                            ! pond volume
+                  lh_ip(ji,jj, jl) = 0._wp                            ! pond lid thickness
                   t_su(ji,jj,  jl) = rn_ice_tem(jbdy)                 ! temperature surface
                   t_s (ji,jj,:,jl) = rn_ice_tem(jbdy)                 ! temperature snw
@@ -183,4 +184,5 @@
                   a_ip(ji,jj,  jl) = a_ip(ib,jb,  jl) ! pond concentration
                   v_ip(ji,jj,  jl) = v_ip(ib,jb,  jl) ! pond volume
+                  lh_ip(ji,jj, jl) = lh_ip(ib,jb, jl) ! pond lid thickness
                   t_su(ji,jj,  jl) = t_su(ib,jb,  jl) ! temperature surface
                   t_s (ji,jj,:,jl) = t_s (ib,jb,:,jl) ! temperature snw
@@ -222,4 +224,5 @@
                a_ip(ji,jj,  jl) = 0._wp
                v_ip(ji,jj,  jl) = 0._wp
+               lh_ip(ji,jj, jl) = 0._wp
                t_su(ji,jj,  jl) = rt0
                t_s (ji,jj,:,jl) = rt0
@@ -253,4 +256,5 @@
       CALL lbc_bdy_lnk( 'bdyice', a_ip(:,:,:)  , 'T', 1., jbdy )
       CALL lbc_bdy_lnk( 'bdyice', v_ip(:,:,:)  , 'T', 1., jbdy )
+      CALL lbc_bdy_lnk( 'bdyice', lh_ip(:,:,:) , 'T', 1., jbdy )
       CALL lbc_bdy_lnk( 'bdyice', s_i (:,:,:)  , 'T', 1., jbdy )
       CALL lbc_bdy_lnk( 'bdyice', t_su(:,:,:)  , 'T', 1., jbdy )
Index: /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/SBC/sbccpl.F90
===================================================================
--- /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/SBC/sbccpl.F90	(revision 12393)
+++ /NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/OCE/SBC/sbccpl.F90	(revision 12394)
@@ -2348,4 +2348,6 @@
             CASE( 'yes' )  
 
+               write(numout,*) 'sbccpl: lh_ip(42,26,1) = ',lh_ip(42,26,1)
+
                ! Calculate how much meltpond is exposed (not under a frozen lid)
                lfrac_pnd(:,:,1:jpl) = 1.0
@@ -2359,4 +2361,6 @@
                ztmp3(:,:,1:jpl) =  a_ip_frac(:,:,1:jpl) * lfrac_pnd(:,:,1:jpl)
                ztmp4(:,:,1:jpl) =  h_ip(:,:,1:jpl)
+
+               write(numout,*) 'sbccpl: lfrac_pnd(42,26,1), a_ip_frac(42,26,1), ztmp3(42,26,1) = ',lfrac_pnd(42,26,1), a_ip_frac(42,26,1), ztmp3(42,26,1)
             CASE( 'no' )  
                ztmp3(:,:,:) = 0.0  
