Index: /codes/icosagcm/trunk/src/dissip/dissip_gcm.F90
===================================================================
--- /codes/icosagcm/trunk/src/dissip/dissip_gcm.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/dissip/dissip_gcm.F90	(revision 954)
@@ -207,5 +207,5 @@
           u=f_u(ind)
           du=f_du(ind)
-          CALL compute_gradiv_inplace(u,1,1)
+          CALL compute_gradiv_inplace(u,Ai,ne,le,de,1,1)
           ! This should be ported on GPU but we are running into compiler issues...
           !$acc update host(u(:)) wait
@@ -306,5 +306,5 @@
           u=f_u(ind)
           du=f_du(ind)
-          CALL compute_gradrot_inplace(u,1,1)
+          CALL compute_gradrot_inplace(u,Av,ne,le,de,1,1)
           ! This should be ported on GPU but we are running into compiler issues...
           !$acc update host(u(:)) wait
@@ -401,5 +401,5 @@
           theta=f_theta(ind)
           dtheta=f_dtheta(ind)
-          CALL compute_divgrad_inplace(theta,1,1)
+          CALL compute_divgrad_inplace(theta,Ai,ne,le,de,1,1)
           ! This should be ported on GPU but we are running into compiler issues...
           !$acc update host(theta(:)) wait
@@ -707,5 +707,5 @@
         CALL swap_geometry(ind)
         due=f_due(ind)
-        CALL compute_gradiv_inplace(due,ll_begin,ll_end)
+        CALL compute_gradiv_inplace(due,Ai,ne,le,de,ll_begin,ll_end)
       ENDDO
     ENDDO
@@ -757,5 +757,5 @@
         CALL swap_geometry(ind)
         due=f_due(ind) 
-        CALL compute_gradrot_inplace(due,ll_begin,ll_end)
+        CALL compute_gradrot_inplace(due,Av,ne,le,de,ll_begin,ll_end)
       ENDDO
 
@@ -805,5 +805,5 @@
         CALL swap_geometry(ind)
         dtheta=f_dtheta(ind) 
-        CALL compute_divgrad_inplace(dtheta,ll_begin,ll_end)
+        CALL compute_divgrad_inplace(dtheta,Ai,ne,le,de,ll_begin,ll_end)
       ENDDO
 
@@ -857,5 +857,5 @@
         CALL swap_geometry(ind)
         dtheta_rhodz=f_dtheta_rhodz(ind) 
-        CALL compute_divgrad_inplace(dtheta_rhodz,ll_begin,ll_end)
+        CALL compute_divgrad_inplace(dtheta_rhodz,Ai,ne,le,de,ll_begin,ll_end)
       ENDDO
 
@@ -884,20 +884,27 @@
   END SUBROUTINE divgrad_theta_rhodz
 
-  SUBROUTINE compute_gradiv(ue,gradivu_e,llb,lle)
+  SUBROUTINE compute_gradiv(ue,gradivu_e,Ai,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(OUT) :: gradivu_e(iim*3*jjm,llm)
     REAL(rstd),INTENT(IN)  :: ue(iim*3*jjm,llm)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
 
     gradivu_e = ue
-    CALL compute_gradiv_inplace(gradivu_e,llb,lle)
+    CALL compute_gradiv_inplace(gradivu_e,Ai,ne,le,de,llb,lle)
 
   END SUBROUTINE compute_gradiv
   
-  SUBROUTINE compute_gradiv_inplace(ue_gradivu_e,llb,lle)
-    USE geometry, ONLY : Ai, ne, le, de
+  SUBROUTINE compute_gradiv_inplace(ue_gradivu_e,Ai,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(INOUT) :: ue_gradivu_e(iim*3*jjm,llm)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
     REAL(rstd) :: divu_i(iim*jjm,llb:lle)
     
@@ -945,19 +952,26 @@
   END SUBROUTINE compute_gradiv_inplace
 
-  SUBROUTINE compute_divgrad(theta,divgrad_i,llb,lle)
+  SUBROUTINE compute_divgrad(theta,divgrad_i,Ai,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(IN) :: theta(iim*jjm,1:lle)
     REAL(rstd),INTENT(OUT) :: divgrad_i(iim*jjm,1:lle)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
 
     divgrad_i = theta
-    CALL compute_divgrad_inplace(divgrad_i,llb,lle)
+    CALL compute_divgrad_inplace(divgrad_i,Ai,ne,le,de,llb,lle)
   END SUBROUTINE compute_divgrad
   
-  SUBROUTINE compute_divgrad_inplace(theta_divgrad_i,llb,lle)
-    USE geometry, ONLY : Ai, ne, le, de
+  SUBROUTINE compute_divgrad_inplace(theta_divgrad_i,Ai,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(INOUT) :: theta_divgrad_i(iim*jjm,1:lle)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
     REAL(rstd)  :: grad_e(3*iim*jjm,llb:lle)
 
@@ -1003,19 +1017,26 @@
   END SUBROUTINE compute_divgrad_inplace
 
-  SUBROUTINE compute_gradrot(ue,gradrot_e,llb,lle)
+  SUBROUTINE compute_gradrot(ue,gradrot_e,Av,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(IN) :: ue(iim*3*jjm,lle)
     REAL(rstd),INTENT(OUT) :: gradrot_e(iim*3*jjm,lle)
+    REAL(rstd),INTENT(IN)  :: Av(2*iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
 
     gradrot_e = ue
-    CALL compute_gradrot_inplace(gradrot_e,llb,lle)
+    CALL compute_gradrot_inplace(gradrot_e,Av,ne,le,de,llb,lle)
   END SUBROUTINE compute_gradrot
 
-  SUBROUTINE compute_gradrot_inplace(ue_gradrot_e,llb,lle)
-    USE geometry, ONLY : Av, ne, le, de
+  SUBROUTINE compute_gradrot_inplace(ue_gradrot_e,Av,ne,le,de,llb,lle)
     INTEGER,INTENT(IN)     :: llb
     INTEGER,INTENT(IN)     :: lle
     REAL(rstd),INTENT(INOUT) :: ue_gradrot_e(iim*3*jjm,lle)
+    REAL(rstd),INTENT(IN)  :: Av(2*iim*jjm)
+    INTEGER,INTENT(IN)     :: ne(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: le(iim*3*jjm)
+    REAL(rstd),INTENT(IN)  :: de(iim*3*jjm)
     REAL(rstd) :: rot_v(2*iim*jjm,llb:lle)
 
Index: /codes/icosagcm/trunk/src/dynamics/caldyn_gcm.F90
===================================================================
--- /codes/icosagcm/trunk/src/dynamics/caldyn_gcm.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/dynamics/caldyn_gcm.F90	(revision 954)
@@ -188,5 +188,5 @@
        f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du)
     USE observable_mod
-    USE disvert_mod, ONLY : caldyn_eta, eta_mass
+    USE disvert_mod, ONLY : caldyn_eta, eta_mass, bp
     USE trace
     LOGICAL,INTENT(IN)    :: write_out
@@ -319,5 +319,5 @@
              wwuu=f_wwuu(ind)
              dps=f_dps(ind)
-             CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz(:,:,1), du)
+             CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz(:,:,1), du, bp)
           END IF
        ENDDO       
@@ -348,5 +348,5 @@
              wwuu=f_wwuu(ind)
              dps=f_dps(ind)
-             CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz, du)
+             CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz, du, bp)
           END IF
        ENDDO
Index: /codes/icosagcm/trunk/src/dynamics/caldyn_hevi.F90
===================================================================
--- /codes/icosagcm/trunk/src/dynamics/caldyn_hevi.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/dynamics/caldyn_hevi.F90	(revision 954)
@@ -16,5 +16,5 @@
     USE icosa
     USE observable_mod
-    USE disvert_mod, ONLY : caldyn_eta, eta_mass
+    USE disvert_mod, ONLY : caldyn_eta, eta_mass, bp, mass_dak, mass_dbk
     USE vorticity_mod
     USE kinetic_mod
@@ -110,5 +110,5 @@
        mass=f_mass(ind)
        theta = f_theta(ind)
-       CALL compute_theta(ps,theta_rhodz, mass,theta)
+       CALL compute_theta(ps,theta_rhodz, mass,theta, mass_dak, mass_dbk)
        pk = f_pk(ind)
        geopot = f_geopot(ind)
@@ -145,5 +145,5 @@
        qu=f_qu(ind)
        qv=f_qv(ind)
-       CALL compute_pvort_only(u,mass,qu,qv)
+       CALL compute_pvort_only(u,mass,qu,qv,Av,Riv2,fv)
     ENDDO
     
@@ -165,5 +165,5 @@
 
        IF(hydrostatic) THEN
-          CALL compute_caldyn_slow_hydro(u,mass,hflux,du, .TRUE.)
+          CALL compute_caldyn_slow_hydro(u,mass,hflux,du,Ai,le_de, .TRUE.)
        ELSE
           CALL abort_acc("HEVI_scheme/!hydrostatic")
@@ -177,5 +177,5 @@
           CALL compute_caldyn_slow_NH(u,mass,geopot,W, F_el,gradPhi2,w_il, hflux,du,dPhi,dW)
        END IF
-       CALL compute_caldyn_Coriolis(hflux,theta,qu,convm,dtheta_rhodz,du)
+       CALL compute_caldyn_Coriolis(hflux,theta,qu,convm,dtheta_rhodz,du,Ai,wee)
        
        IF(caldyn_eta==eta_mass) THEN
@@ -183,5 +183,5 @@
           wwuu=f_wwuu(ind)
           dps=f_dps(ind)
-          CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz, du)
+          CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz, du, bp)
           IF(.NOT.hydrostatic) THEN
              CALL abort_acc("HEVI_scheme/!hydrostatic")
Index: /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_base.F90
===================================================================
--- /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_base.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_base.F90	(revision 954)
@@ -209,6 +209,5 @@
   END SUBROUTINE compute_geopot
 
-  SUBROUTINE compute_caldyn_vert(u, theta, rhodz, convm, wflux, wwuu, dps, dtheta_rhodz, du)
-    USE disvert_mod, ONLY : bp
+  SUBROUTINE compute_caldyn_vert(u, theta, rhodz, convm, wflux, wwuu, dps, dtheta_rhodz, du, bp)
     REAL(rstd),INTENT(IN)  :: u(iim*3*jjm,llm)
     REAL(rstd),INTENT(IN)  :: theta(iim*jjm,llm,nqdyn)
@@ -221,4 +220,5 @@
     REAL(rstd),INTENT(INOUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn)
     REAL(rstd),INTENT(OUT) :: dps(iim*jjm)
+    REAL(rstd),INTENT(IN)  :: bp(llm)
 
     ! temporary variable    
Index: /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_hevi.F90
===================================================================
--- /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_hevi.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/dynamics/caldyn_kernels_hevi.F90	(revision 954)
@@ -20,10 +20,11 @@
 CONTAINS
 
-  SUBROUTINE compute_theta(ps,theta_rhodz, rhodz,theta)
-    USE disvert_mod, ONLY : mass_dbk, mass_dak
+  SUBROUTINE compute_theta(ps,theta_rhodz, rhodz,theta, mass_dak, mass_dbk)
     REAL(rstd),INTENT(IN)    :: ps(iim*jjm)
     REAL(rstd),INTENT(IN)    :: theta_rhodz(iim*jjm,llm,nqdyn)
     REAL(rstd),INTENT(INOUT) :: rhodz(iim*jjm,llm)
     REAL(rstd),INTENT(OUT)   :: theta(iim*jjm,llm,nqdyn)
+    REAL(rstd),INTENT(IN)    :: mass_dak(llm)
+    REAL(rstd),INTENT(IN)    :: mass_dbk(llm)
     INTEGER :: ij,l,iq
     REAL(rstd) :: m
@@ -59,10 +60,12 @@
   END SUBROUTINE compute_theta
 
-  SUBROUTINE compute_pvort_only(u,rhodz,qu,qv)
-    USE geometry, ONLY : Av, Riv2, fv
+  SUBROUTINE compute_pvort_only(u,rhodz,qu,qv,Av,Riv2,fv)
     REAL(rstd),INTENT(IN)  :: u(iim*3*jjm,llm)
     REAL(rstd),INTENT(INOUT) :: rhodz(iim*jjm,llm)
     REAL(rstd),INTENT(OUT) :: qu(iim*3*jjm,llm)
     REAL(rstd),INTENT(OUT) :: qv(iim*2*jjm,llm)
+    REAL(rstd),INTENT(IN)  :: Av(2*iim*jjm)
+    REAL(rstd),INTENT(IN)  :: Riv2(iim*jjm,6)
+    REAL(rstd),INTENT(IN)  :: fv(2*iim*jjm)
 
     INTEGER :: ij,l
@@ -551,6 +554,5 @@
   END SUBROUTINE compute_caldyn_fast
     
-  SUBROUTINE compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz,du)
-    USE geometry, ONLY : Ai, wee
+  SUBROUTINE compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz,du,Ai,wee)
     REAL(rstd),INTENT(IN)  :: hflux(3*iim*jjm,llm)  ! hflux in kg/s
     REAL(rstd),INTENT(IN)  :: theta(iim*jjm,llm,nqdyn) ! active scalars
@@ -559,4 +561,6 @@
     REAL(rstd),INTENT(OUT) :: dtheta_rhodz(iim*jjm,llm,nqdyn)
     REAL(rstd),INTENT(INOUT) :: du(3*iim*jjm,llm)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    REAL(rstd),INTENT(IN)  :: wee(3*iim*jjm,5,2)
     
     REAL(rstd) :: Ftheta(3*iim*jjm,llm)  ! potential temperature flux
@@ -730,6 +734,5 @@
   END SUBROUTINE compute_caldyn_Coriolis
 
-  SUBROUTINE compute_caldyn_slow_hydro(u,rhodz,hflux,du,zero)
-    USE geometry, ONLY : Ai, le_de
+  SUBROUTINE compute_caldyn_slow_hydro(u,rhodz,hflux,du,Ai,le_de,zero)
     LOGICAL, INTENT(IN) :: zero
     REAL(rstd),INTENT(IN)  :: u(3*iim*jjm,llm)    ! prognostic "velocity"
@@ -737,4 +740,6 @@
     REAL(rstd),INTENT(OUT) :: hflux(3*iim*jjm,llm) ! hflux in kg/s
     REAL(rstd),INTENT(INOUT) :: du(3*iim*jjm,llm)
+    REAL(rstd),INTENT(IN)  :: Ai(iim*jjm)
+    REAL(rstd),INTENT(IN)  :: le_de(3*iim*jjm)
     
     REAL(rstd) :: berni(iim*jjm,llm)  ! Bernoulli function
Index: /codes/icosagcm/trunk/src/transport/advect.F90
===================================================================
--- /codes/icosagcm/trunk/src/transport/advect.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/transport/advect.F90	(revision 954)
@@ -49,5 +49,5 @@
   !=======================================================================================
 
-  SUBROUTINE compute_gradq3d(qi,sqrt_leng,gradq3d,xyz_i, xyz_v)
+  SUBROUTINE compute_gradq3d(qi,sqrt_leng,gradq3d,xyz_i,xyz_v)
     USE trace
     USE omp_para
@@ -348,6 +348,6 @@
 
   ! Backward trajectories, for use with Miura approach
-  SUBROUTINE compute_backward_traj(normal,tangent,ue,tau,cc)
-    USE geometry, ONLY : xyz_e, de, wee, le
+  SUBROUTINE compute_backward_traj(normal,tangent,ue,tau, cc, &
+                                   xyz_e, de, wee, le         ) ! metrics terms
     USE trace
     USE omp_para
@@ -358,4 +358,9 @@
     REAL(rstd),INTENT(OUT)   :: cc(3*iim*jjm,llm,3) ! start of backward trajectory
     REAL(rstd),INTENT(IN)    :: tau
+! metrics terms
+    REAL(rstd),INTENT(IN)    :: xyz_e(iim*3*jjm,3)
+    REAL(rstd),INTENT(IN)    :: de(iim*3*jjm)
+    REAL(rstd),INTENT(IN)    :: wee(iim*3*jjm,5,2)
+    REAL(rstd),INTENT(IN)    :: le(iim*3*jjm)
 
     REAL(rstd) :: v_e(3), up_e   
@@ -427,9 +432,9 @@
   ! Horizontal transport (S. Dubey, T. Dubos)
   ! Slope-limited van Leer approach with hexagons
-  SUBROUTINE compute_advect_horiz(update_mass,diagflux_on, hfluxt,cc,gradq3d, mass, qi, qfluxt)
+  SUBROUTINE compute_advect_horiz(update_mass,diagflux_on, hfluxt,cc,gradq3d, mass, qi, qfluxt,  &
+                                  Ai, xyz_i)   ! metrics terms 
     USE trace
     USE omp_para
     USE abort_mod
-    USE geometry, only : Ai, xyz_i
     IMPLICIT NONE
     LOGICAL, INTENT(IN)       :: update_mass, diagflux_on
@@ -441,4 +446,6 @@
     REAL(rstd), INTENT(INOUT) :: qfluxt(3*iim*jjm,MERGE(llm,1,diagflux_on)) ! time-integrated tracer flux
 ! metrics terms
+    REAL(rstd), INTENT(IN)    :: Ai(iim*jjm)
+    REAL(rstd), INTENT(IN)    :: xyz_i(iim*jjm,3)
     
     REAL(rstd) :: dq,dmass,qe,newmass
Index: /codes/icosagcm/trunk/src/transport/advect_tracer.F90
===================================================================
--- /codes/icosagcm/trunk/src/transport/advect_tracer.F90	(revision 953)
+++ /codes/icosagcm/trunk/src/transport/advect_tracer.F90	(revision 954)
@@ -143,5 +143,6 @@
        END DO
 
-       CALL compute_backward_traj(tangent,normal,u,0.5*dt*itau_adv, cc)
+       CALL compute_backward_traj(tangent,normal,u,0.5*dt*itau_adv, cc,   &
+                                  xyz_e, de, wee, le                   ) ! metrics terms
     END DO
 
@@ -193,5 +194,6 @@
              END IF
           END IF
-          CALL compute_advect_horiz(k==nq_last,frac>0., hfluxt,cc,gradq3d, rhodz, q(:,:,k), qfluxt(:,:,k))
+          CALL compute_advect_horiz(k==nq_last,frac>0., hfluxt,cc,gradq3d, rhodz, q(:,:,k), qfluxt(:,:,k),  &
+                                    Ai, xyz_i)   ! metrics terms
         END DO
 
Index: /codes/icosagcm/trunk/src/vertical/disvert.f90
===================================================================
--- /codes/icosagcm/trunk/src/vertical/disvert.f90	(revision 953)
+++ /codes/icosagcm/trunk/src/vertical/disvert.f90	(revision 954)
