Index: /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 10045)
+++ /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 10046)
@@ -405,5 +405,4 @@
    rn_antarctica_calving_fraction = 0.5 ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
    rn_iceshelf_fluxes_tolerance = 1e-6  ! Fractional threshold for detecting differences in icesheet masses (must be positive definite).
-   nn_cpl_river = 0              ! Number of rivers to be dealt with in atmos-ocean coupling. 
 /
 !-----------------------------------------------------------------------
Index: /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90
===================================================================
--- /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 10045)
+++ /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90	(revision 10046)
@@ -372,4 +372,5 @@
       ! End of definition phase
       !------------------------------------------------------------------
+      
       CALL oasis_enddef(nerror)
       IF( nerror /= OASIS_Ok )   CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef')
Index: /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10045)
+++ /branches/UKMO/dev_r5518_cleanup_1d_cpl/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10046)
@@ -257,7 +257,4 @@
          &                  sn_rcv_atm_pco2, sn_rcv_atm_dust
 
-      ! Add river coupling related field to namelist
-      NAMELIST/namsbc_cpl/ nn_cpl_river
-
 
       !!---------------------------------------------------------------------
@@ -331,5 +328,4 @@
          WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction
          WRITE(numout,*)'  rn_iceshelf_fluxes_tolerance        = ', rn_iceshelf_fluxes_tolerance
-         WRITE(numout,*)'  nn_cpl_river                        = ', nn_cpl_river
 
       ENDIF
@@ -483,12 +479,14 @@
       !
       srcv(jpr_cal   )%clname = 'OCalving'   
-      IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE.
-      srcv(jpr_grnm  )%clname = 'OGrnmass'   
-      srcv(jpr_grnm  )%dimensions = 0 ! Scalar field
-
-      IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' )   srcv(jpr_grnm)%laction = .TRUE.
-      srcv(jpr_antm  )%clname = 'OAntmass'   
-      srcv(jpr_antm  )%dimensions = 0 ! Scalar field   
-      IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' )   srcv(jpr_antm)%laction = .TRUE.
+      IF( TRIM( sn_rcv_cal%cldes ) == 'coupled' )   srcv(jpr_cal)%laction = .TRUE.     
+
+      srcv(jpr_grnm  )%clname = 'OGrnmass' 
+      IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm)%laction = .TRUE.        
+      IF( TRIM( sn_rcv_grnm%cldes ) == 'coupled0d' ) srcv(jpr_grnm  )%dimensions = 0 ! Scalar field
+      
+      srcv(jpr_antm  )%clname = 'OAntmass'
+      IF( TRIM( sn_rcv_antm%cldes ) == 'coupled' .OR. TRIM( sn_rcv_antm%cldes ) == 'coupled0d' )  srcv(jpr_antm)%laction = .TRUE.
+      IF( TRIM( sn_rcv_antm%cldes ) == 'coupled0d' ) srcv(jpr_antm  )%dimensions = 0 ! Scalar field   
+      
 
 
@@ -1114,5 +1112,5 @@
          IF( srcv(jn)%laction ) THEN 
 
-            IF ( srcv(jn)%dimensions == 0 ) THEN
+            IF ( srcv(jn)%dimensions <= 1 ) THEN
                CALL cpl_rcv_1d( jn, isec, frcv(jn)%z3, SIZE(frcv(jn)%z3), nrcvinfo(jn) )
             ELSE
@@ -1424,6 +1422,19 @@
 
       IF( srcv(jpr_grnm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN
-         ! This is a zero dimensional, single value field. 
-         zgreenland_icesheet_mass_in =  frcv(jpr_grnm)%z3(1,1,1)
+         
+         IF( srcv(jpr_grnm)%dimensions == 0 ) THEN
+      
+           ! This is a zero dimensional, single value field. 
+           zgreenland_icesheet_mass_in =  frcv(jpr_grnm)%z3(1,1,1)
+           
+         ELSE
+         
+           greenland_icesheet_mass_array(:,:) = frcv(jpr_grnm)%z3(:,:,1) 
+           ! take average over ocean points of input array to avoid cumulative error over time 
+           ! The following must be bit reproducible over different PE decompositions 
+           zgreenland_icesheet_mass_in = glob_sum( greenland_icesheet_mass_array(:,:) * tmask(:,:,1) )  
+           zgreenland_icesheet_mass_in = zgreenland_icesheet_mass_in / zmask_sum 
+           
+         END IF
 
          greenland_icesheet_timelapsed = greenland_icesheet_timelapsed + rdt         
@@ -1458,6 +1469,19 @@
       !                                                        ! land ice masses : Antarctica
       IF( srcv(jpr_antm)%laction .AND. nn_coupled_iceshelf_fluxes == 1 ) THEN
-         ! This is a zero dimensional, single value field. 
-         zantarctica_icesheet_mass_in = frcv(jpr_antm)%z3(1,1,1)
+      
+         IF( srcv(jpr_antm)%dimensions == 0 ) THEN
+         
+           ! This is a zero dimensional, single value field. 
+           zantarctica_icesheet_mass_in = frcv(jpr_antm)%z3(1,1,1)
+           
+         ELSE
+         
+           antarctica_icesheet_mass_array(:,:) = frcv(jpr_antm)%z3(:,:,1) 
+           ! take average over ocean points of input array to avoid cumulative error from rounding errors over time 
+           ! The following must be bit reproducible over different PE decompositions 
+           zantarctica_icesheet_mass_in = glob_sum( antarctica_icesheet_mass_array(:,:) * tmask(:,:,1) )  
+           zantarctica_icesheet_mass_in = zantarctica_icesheet_mass_in / zmask_sum 
+           
+         END IF
 
          antarctica_icesheet_timelapsed = antarctica_icesheet_timelapsed + rdt         
