Index: /branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- /branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 9817)
+++ /branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 9818)
@@ -218,5 +218,5 @@
          ! there is no restart file.
          ! Values from a CICE restart file would overwrite this
-         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.) 
+         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1., 'sst1') 
 #endif
 
@@ -225,5 +225,5 @@
       ! calculate surface freezing temperature and send to CICE
       CALL  eos_fzp(sss_m(:,:), sstfrz(:,:), fsdept_n(:,:,1)) 
-      CALL nemo2cice(sstfrz,Tf, 'T', 1. )
+      CALL nemo2cice(sstfrz,Tf, 'T', 1., 'tfl' )
 
       CALL cice2nemo(aice,fr_i, 'T', 1. )
@@ -353,5 +353,5 @@
             ENDDO
          ENDDO
-         CALL nemo2cice(ztmp,strax,'F', -1. )
+         CALL nemo2cice(ztmp,strax,'F', -1. , 'strax')
 
 ! y comp of wind stress (CI_2)
@@ -363,5 +363,5 @@
             ENDDO
          ENDDO
-         CALL nemo2cice(ztmp,stray,'F', -1. )
+         CALL nemo2cice(ztmp,stray,'F', -1. , 'stray')
 
 
@@ -392,5 +392,5 @@
 
          DO jl=1,ncat
-            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. )
+            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1., 'flatn' )
 
 ! GBM conductive flux through ice (CI_6)
@@ -401,5 +401,5 @@
                ztmp(:,:) = botmelt(:,:,jl)
             ENDIF
-            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1. )
+            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1., 'fcondtopn' )
 
 ! GBM surface heat flux (CI_7)
@@ -410,5 +410,5 @@
                ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))
             ENDIF
-            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. )
+            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1., 'fsurfn_f' )
          ENDDO
 
@@ -418,24 +418,24 @@
 ! x comp and y comp of atmosphere surface wind (CICE expects on T points)
          ztmp(:,:) = wndi_ice(:,:)
-         CALL nemo2cice(ztmp,uatm,'T', -1. )
+         CALL nemo2cice(ztmp,uatm,'T', -1., 'uatm' )
          ztmp(:,:) = wndj_ice(:,:)
-         CALL nemo2cice(ztmp,vatm,'T', -1. )
+         CALL nemo2cice(ztmp,vatm,'T', -1. , 'vatm')
          ztmp(:,:) = SQRT ( wndi_ice(:,:)**2 + wndj_ice(:,:)**2 )
-         CALL nemo2cice(ztmp,wind,'T', 1. )    ! Wind speed (m/s)
+         CALL nemo2cice(ztmp,wind,'T', 1., 'wind' )    ! Wind speed (m/s)
          ztmp(:,:) = qsr_ice(:,:,1)
-         CALL nemo2cice(ztmp,fsw,'T', 1. )     ! Incoming short-wave (W/m^2)
+         CALL nemo2cice(ztmp,fsw,'T', 1., 'fsw' )     ! Incoming short-wave (W/m^2)
          ztmp(:,:) = qlw_ice(:,:,1)
-         CALL nemo2cice(ztmp,flw,'T', 1. )     ! Incoming long-wave (W/m^2)
+         CALL nemo2cice(ztmp,flw,'T', 1., 'flw' )     ! Incoming long-wave (W/m^2)
          ztmp(:,:) = tatm_ice(:,:)
-         CALL nemo2cice(ztmp,Tair,'T', 1. )    ! Air temperature (K)
-         CALL nemo2cice(ztmp,potT,'T', 1. )    ! Potential temp (K)
+         CALL nemo2cice(ztmp,Tair,'T', 1., 'tair' )    ! Air temperature (K)
+         CALL nemo2cice(ztmp,potT,'T', 1. , 'pott')    ! Potential temp (K)
 ! Following line uses MAX(....) to avoid problems if tatm_ice has unset halo rows  
          ztmp(:,:) = 101000. / ( 287.04 * MAX(1.0,tatm_ice(:,:)) )    
                                                ! Constant (101000.) atm pressure assumed
-         CALL nemo2cice(ztmp,rhoa,'T', 1. )    ! Air density (kg/m^3)
+         CALL nemo2cice(ztmp,rhoa,'T', 1., 'rhoa' )    ! Air density (kg/m^3)
          ztmp(:,:) = qatm_ice(:,:)
-         CALL nemo2cice(ztmp,Qa,'T', 1. )      ! Specific humidity (kg/kg)
+         CALL nemo2cice(ztmp,Qa,'T', 1., 'qa' )      ! Specific humidity (kg/kg)
          ztmp(:,:)=10.0
-         CALL nemo2cice(ztmp,zlvl,'T', 1. )    ! Atmos level height (m)
+         CALL nemo2cice(ztmp,zlvl,'T', 1., 'zlvl' )    ! Atmos level height (m)
 
 ! May want to check all values are physically realistic (as in CICE routine 
@@ -444,11 +444,11 @@
 ! Divide shortwave into spectral bands (as in prepare_forcing)
          ztmp(:,:)=qsr_ice(:,:,1)*frcvdr       ! visible direct
-         CALL nemo2cice(ztmp,swvdr,'T', 1. )             
+         CALL nemo2cice(ztmp,swvdr,'T', 1., 'swvdr' )             
          ztmp(:,:)=qsr_ice(:,:,1)*frcvdf       ! visible diffuse
-         CALL nemo2cice(ztmp,swvdf,'T', 1. )              
+         CALL nemo2cice(ztmp,swvdf,'T', 1., 'swvdf' )              
          ztmp(:,:)=qsr_ice(:,:,1)*frcidr       ! near IR direct
-         CALL nemo2cice(ztmp,swidr,'T', 1. )
+         CALL nemo2cice(ztmp,swidr,'T', 1., 'swidr' )
          ztmp(:,:)=qsr_ice(:,:,1)*frcidf       ! near IR diffuse
-         CALL nemo2cice(ztmp,swidf,'T', 1. )
+         CALL nemo2cice(ztmp,swidf,'T', 1., 'swidf' )
 
       ENDIF
@@ -458,29 +458,29 @@
       IF( iom_use('snowpre') )   CALL iom_put('snowpre',MAX( (1.0-fr_i(:,:))*sprecip(:,:) ,0.0)) !!Joakim edit  
       ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0)  
-      CALL nemo2cice(ztmp,fsnow,'T', 1. ) 
+      CALL nemo2cice(ztmp,fsnow,'T', 1., 'fsnow' ) 
 
 ! Rainfall
       IF( iom_use('precip') )   CALL iom_put('precip', (1.0-fr_i(:,:))*(tprecip(:,:)-sprecip(:,:)) ) !!Joakim edit
       ztmp(:,:)=fr_i(:,:)*(tprecip(:,:)-sprecip(:,:))
-      CALL nemo2cice(ztmp,frain,'T', 1. ) 
+      CALL nemo2cice(ztmp,frain,'T', 1., 'frain' ) 
 
 ! Recalculate freezing temperature and send to CICE 
       CALL eos_fzp(sss_m(:,:), sstfrz(:,:), fsdept_n(:,:,1)) 
-      CALL nemo2cice(sstfrz,Tf,'T', 1. )
+      CALL nemo2cice(sstfrz,Tf,'T', 1., 'Tf' )
 
 ! Freezing/melting potential
 ! Calculated over NEMO leapfrog timestep (hence 2*dt)
       nfrzmlt(:,:)=rau0*rcp*fse3t_m(:,:)*(sstfrz(:,:)-sst_m(:,:))/(2.0*dt) 
-      CALL nemo2cice(nfrzmlt,frzmlt,'T', 1. )
+      CALL nemo2cice(nfrzmlt,frzmlt,'T', 1., 'frzmlt' )
 
 ! SST  and SSS
 
-      CALL nemo2cice(sst_m,sst,'T', 1. )
-      CALL nemo2cice(sss_m,sss,'T', 1. )
+      CALL nemo2cice(sst_m,sst,'T', 1.,'sst' )
+      CALL nemo2cice(sss_m,sss,'T', 1.,'sss' )
 
       IF( ksbc == jp_purecpl ) THEN
 ! Sea ice surface skin temperature
          DO jl=1,ncat
-           CALL nemo2cice(tsfc_ice(:,:,jl), trcrn(:,:,nt_tsfc,jl,:),'T',1.)
+           CALL nemo2cice(tsfc_ice(:,:,jl), trcrn(:,:,nt_tsfc,jl,:),'T',1., 'trcrn')
          ENDDO 
       ENDIF
@@ -493,5 +493,5 @@
          ENDDO
       ENDDO
-      CALL nemo2cice(ztmp,uocn,'F', -1. )
+      CALL nemo2cice(ztmp,uocn,'F', -1., 'uocn' )
 
 ! V point to F point
@@ -501,5 +501,5 @@
          ENDDO
       ENDDO
-      CALL nemo2cice(ztmp,vocn,'F', -1. )
+      CALL nemo2cice(ztmp,vocn,'F', -1., 'vocn' )
 
       IF( nn_ice_embd == 2 ) THEN             !== embedded sea ice: compute representative ice top surface ==!
@@ -529,5 +529,5 @@
          ENDDO
       ENDDO
-      CALL nemo2cice(ztmp,ss_tltx,'F', -1. )
+      CALL nemo2cice(ztmp,ss_tltx,'F', -1., 'ss_tltx' )
 
 ! T point to F point
@@ -539,5 +539,5 @@
          ENDDO
       ENDDO
-      CALL nemo2cice(ztmp,ss_tlty,'F', -1. )
+      CALL nemo2cice(ztmp,ss_tlty,'F', -1., 'ss_tlty' )
 
       CALL wrk_dealloc( jpi,jpj, ztmp, zpice )
@@ -925,5 +925,5 @@
    END SUBROUTINE cice_sbc_force
 
-   SUBROUTINE nemo2cice( pn, pc, cd_type, psgn)
+   SUBROUTINE nemo2cice( pn, pc, cd_type, psgn, varname)
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE nemo2cice  ***
@@ -957,4 +957,5 @@
 #endif
       REAL (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: pc
+      CHARACTER(len=10), INTENT( in ) :: varname
       INTEGER (int_kind) :: &
          field_type,        &! id for type of field (scalar, vector, angle)
@@ -1034,4 +1035,9 @@
       CALL scatter_global(pc, pcg, 0, distrb_info, grid_loc, field_type)
 #endif
+
+   IF ( ln_ctl ) THEN
+      WRITE(numout,*)'nemo2cice: ',varname,' min,max = ',MINVAL(pc(:,:,:)), MAXVAL(pc(:,:,:))
+      CALL flush(numout)
+   ENDIF
 
    END SUBROUTINE nemo2cice
