Index: branches/CMIP5_IPSL/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- branches/CMIP5_IPSL/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1846)
+++ branches/CMIP5_IPSL/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1880)
@@ -362,4 +362,95 @@
 #endif
 
+            ! Transports
+            ! T times V on T points (include bolus velocities)
+#if defined key_diaeiv 
+            DO jj = 2, jpj
+               DO ji = 1, jpi
+                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + u_eiv(ji,jj,:) + u_eiv(ji,jj-1,:) )*0.5
+                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + v_eiv(ji,jj,:) + v_eiv(ji,jj-1,:) )*0.5
+               END DO
+            END DO
+#else
+            DO jj = 2, jpj
+               DO ji = 1, jpi
+                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
+                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
+               END DO
+            END DO
+#endif 
+            CALL lbc_lnk( vs, 'V', -1. )   ;   CALL lbc_lnk( vt, 'V', -1. )
+
+            ht_glo(:) = SUM( ptr_vjk( vt(:,:,:)), 2 )
+            st_glo(:) = SUM( ptr_vjk( vs(:,:,:)), 2 )
+
+            IF ( ln_subbas ) THEN 
+               ht_atl(:) = SUM( ptr_vjk( vt (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
+               ht_pac(:) = SUM( ptr_vjk( vt (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
+               ht_ind(:) = SUM( ptr_vjk( vt (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
+               ht_ipc(:) = SUM( ptr_vjk( vt (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
+               st_atl(:) = SUM( ptr_vjk( vs (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
+               st_pac(:) = SUM( ptr_vjk( vs (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
+               st_ind(:) = SUM( ptr_vjk( vs (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
+               st_ipc(:) = SUM( ptr_vjk( vs (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
+            ENDIF
+
+            ! poleward tracer transports: 
+            ! overturning components:
+            IF ( ln_ptrcomp ) THEN 
+               pht_ove_glo(:) = SUM( v_msf_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
+               pst_ove_glo(:) = SUM( v_msf_glo(:,:) * sn_jk_glo(:,:), 2 )  
+               IF ( ln_subbas ) THEN 
+                  pht_ove_atl(:) = SUM( v_msf_atl(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
+                  pst_ove_atl(:) = SUM( v_msf_atl(:,:) * sn_jk_atl(:,:), 2 )  
+                  pht_ove_pac(:) = SUM( v_msf_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
+                  pst_ove_pac(:) = SUM( v_msf_pac(:,:) * sn_jk_pac(:,:), 2 )  
+                  pht_ove_ind(:) = SUM( v_msf_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
+                  pst_ove_ind(:) = SUM( v_msf_ind(:,:) * sn_jk_ind(:,:), 2 )  
+                  pht_ove_ipc(:) = SUM( v_msf_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
+                  pst_ove_ipc(:) = SUM( v_msf_ipc(:,:) * sn_jk_ipc(:,:), 2 )  
+               END IF
+            END IF
+
+            ! Bolus component
+#if defined key_diaeiv
+            pht_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
+            pst_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_glo(:,:), 2 )   ! SUM over jk
+            IF ( ln_subbas ) THEN 
+               pht_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
+               pst_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_atl(:,:), 2 )   ! SUM over jk
+               pht_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
+               pst_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * sn_jk_pac(:,:), 2 )   ! SUM over jk
+               pht_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
+               pst_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * sn_jk_ind(:,:), 2 )   ! SUM over jk
+               pht_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
+               pst_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * sn_jk_ipc(:,:), 2 )   ! SUM over jk
+            ENDIF
+#endif
+
+            ! conversion in PW and G g
+            zpwatt = zpwatt * rau0 * rcp
+            pht_adv(:) = pht_adv(:) * zpwatt  
+            pht_ldf(:) = pht_ldf(:) * zpwatt
+            pst_adv(:) = pst_adv(:) * zggram
+            pst_ldf(:) = pst_ldf(:) * zggram
+            IF ( ln_ptrcomp ) THEN 
+               pht_ove_glo(:) = pht_ove_glo(:) * zpwatt
+               pst_ove_glo(:) = pst_ove_glo(:) * zggram
+            END IF
+#if defined key_diaeiv
+            pht_eiv_glo(:) = pht_eiv_glo(:) * zpwatt
+            pst_eiv_glo(:) = pst_eiv_glo(:) * zggram
+#endif
+            IF( ln_subbas ) THEN
+               ht_atl(:) = ht_atl(:) * zpwatt
+               ht_pac(:) = ht_pac(:) * zpwatt
+               ht_ind(:) = ht_ind(:) * zpwatt
+               ht_ipc(:) = ht_ipc(:) * zpwatt
+               st_atl(:) = st_atl(:) * zggram 
+               st_pac(:) = st_pac(:) * zggram
+               st_ind(:) = st_ind(:) * zggram
+               st_ipc(:) = st_ipc(:) * zggram
+            ENDIF
+
             ! "Meridional" Stream-Function
             DO jk = 2,jpk 
@@ -394,95 +485,4 @@
                v_msf_ind(:,:) = v_msf_ind(:,:) * zsverdrup
                v_msf_ipc(:,:) = v_msf_ipc(:,:) * zsverdrup
-            ENDIF
-
-            ! Transports
-            ! T times V on T points (include bolus velocities)
-#if defined key_diaeiv 
-            DO jj = 2, jpj
-               DO ji = 1, jpi
-                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + u_eiv(ji,jj,:) + u_eiv(ji,jj-1,:) )*0.5
-                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) + v_eiv(ji,jj,:) + v_eiv(ji,jj-1,:) )*0.5
-               END DO
-            END DO
-#else
-            DO jj = 2, jpj
-               DO ji = 1, jpi
-                  vt(ji,jj,:) = tn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
-                  vs(ji,jj,:) = sn(ji,jj,:) * ( vn(ji,jj,:) + vn(ji,jj-1,:) )*0.5
-               END DO
-            END DO
-#endif 
-            CALL lbc_lnk( vs, 'V', -1. )   ;   CALL lbc_lnk( vt, 'V', -1. )
-
-            ht_glo(:) = SUM( ptr_vjk( vt(:,:,:)), 2 )
-            st_glo(:) = SUM( ptr_vjk( vs(:,:,:)), 2 )
-
-            IF ( ln_subbas ) THEN 
-               ht_atl(:) = SUM( ptr_vjk( vt (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
-               ht_pac(:) = SUM( ptr_vjk( vt (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
-               ht_ind(:) = SUM( ptr_vjk( vt (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
-               ht_ipc(:) = SUM( ptr_vjk( vt (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
-               st_atl(:) = SUM( ptr_vjk( vs (:,:,:), abasin(:,:)*sbasin(:,:)), 2 )
-               st_pac(:) = SUM( ptr_vjk( vs (:,:,:), pbasin(:,:)*sbasin(:,:)), 2 )
-               st_ind(:) = SUM( ptr_vjk( vs (:,:,:), ibasin(:,:)*sbasin(:,:)), 2 )
-               st_ipc(:) = SUM( ptr_vjk( vs (:,:,:), dbasin(:,:)*sbasin(:,:)), 2 )
-            ENDIF
-
-            ! poleward tracer transports: 
-            ! overturning components:
-            IF ( ln_ptrcomp ) THEN 
-               pht_ove_glo(:) = SUM( v_msf_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
-               pst_ove_glo(:) = SUM( v_msf_glo(:,:) * sn_jk_glo(:,:), 2 )  
-               IF ( ln_subbas ) THEN 
-                  pht_ove_atl(:) = SUM( v_msf_atl(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
-                  pst_ove_atl(:) = SUM( v_msf_atl(:,:) * sn_jk_atl(:,:), 2 )  
-                  pht_ove_pac(:) = SUM( v_msf_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
-                  pst_ove_pac(:) = SUM( v_msf_pac(:,:) * sn_jk_pac(:,:), 2 )  
-                  pht_ove_ind(:) = SUM( v_msf_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
-                  pst_ove_ind(:) = SUM( v_msf_ind(:,:) * sn_jk_ind(:,:), 2 )  
-                  pht_ove_ipc(:) = SUM( v_msf_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
-                  pst_ove_ipc(:) = SUM( v_msf_ipc(:,:) * sn_jk_ipc(:,:), 2 )  
-               END IF
-            END IF
-
-            ! Bolus component
-#if defined key_diaeiv
-            pht_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_glo(:,:), 2 )   ! SUM over jk
-            pst_eiv_glo(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_glo(:,:), 2 )   ! SUM over jk
-            IF ( ln_subbas ) THEN 
-               pht_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * tn_jk_atl(:,:), 2 )   ! SUM over jk
-               pst_eiv_atl(:) = SUM( v_msf_eiv_glo(:,:) * sn_jk_atl(:,:), 2 )   ! SUM over jk
-               pht_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * tn_jk_pac(:,:), 2 )   ! SUM over jk
-               pst_eiv_pac(:) = SUM( v_msf_eiv_pac(:,:) * sn_jk_pac(:,:), 2 )   ! SUM over jk
-               pht_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * tn_jk_ind(:,:), 2 )   ! SUM over jk
-               pst_eiv_ind(:) = SUM( v_msf_eiv_ind(:,:) * sn_jk_ind(:,:), 2 )   ! SUM over jk
-               pht_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * tn_jk_ipc(:,:), 2 )   ! SUM over jk
-               pst_eiv_ipc(:) = SUM( v_msf_eiv_ipc(:,:) * sn_jk_ipc(:,:), 2 )   ! SUM over jk
-            ENDIF
-#endif
-
-            ! conversion in PW and G g
-            zpwatt = zpwatt * rau0 * rcp
-            pht_adv(:) = pht_adv(:) * zpwatt  
-            pht_ldf(:) = pht_ldf(:) * zpwatt
-            pst_adv(:) = pst_adv(:) * zggram
-            pst_ldf(:) = pst_ldf(:) * zggram
-            IF ( ln_ptrcomp ) THEN 
-               pht_ove_glo(:) = pht_ove_glo(:) * zpwatt
-               pst_ove_glo(:) = pst_ove_glo(:) * zggram
-            END IF
-#if defined key_diaeiv
-            pht_eiv_glo(:) = pht_eiv_glo(:) * zpwatt
-            pst_eiv_glo(:) = pst_eiv_glo(:) * zggram
-#endif
-            IF( ln_subbas ) THEN
-               ht_atl(:) = ht_atl(:) * zpwatt
-               ht_pac(:) = ht_pac(:) * zpwatt
-               ht_ind(:) = ht_ind(:) * zpwatt
-               ht_ipc(:) = ht_ipc(:) * zpwatt
-               st_atl(:) = st_atl(:) * zggram 
-               st_pac(:) = st_pac(:) * zggram
-               st_ind(:) = st_ind(:) * zggram
-               st_ipc(:) = st_ipc(:) * zggram
             ENDIF
          ENDIF
