Index: codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90	(revision 686)
+++ codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90	(revision 688)
@@ -8,5 +8,5 @@
 CONTAINS
 
-#define DBL REAL(C_DOUBLE)
+#include "unstructured.h90"
 
 #define INDICES1 ij,l,iq,iedge,edge,ivertex,vertex,ij_left,ij_right
@@ -18,22 +18,7 @@
 #define LENGTHS le_de1,le_de2,le_de3,le_de4,le_de5,le_de6
 #define DECLARE_INDICES INTEGER INDICES1,INDICES2
-#define DECLARE_EDGES DBL SIGNS,LENGTHS ; INTEGER EDGES, EDGE_ENDS
+#define DECLARE_EDGES NUM SIGNS,LENGTHS ; INTEGER EDGES, EDGE_ENDS
 #define DECLARE_VERTICES INTEGER VERTICES
 #define PHI_BOT(ij) Phi_bot
-
-#define BINDC_(thename) BIND(C, name=#thename)
-#define BINDC(thename) BINDC_(dynamico_ ## thename)
-
-#define DOUBLE1(m) DBL, DIMENSION(m)
-#define DOUBLE2(m,n) DBL, DIMENSION(m,n)
-#define DOUBLE3(m,n,p) DBL, DIMENSION(m,n,p)
-
-#define FIELD_PS      DOUBLE1(primal_num)
-#define FIELD_MASS    DOUBLE2(llm, primal_num)
-#define FIELD_Z       DOUBLE2(llm, dual_num)
-#define FIELD_U       DOUBLE2(llm, edge_num)
-#define FIELD_UL      DOUBLE2(llm+1, edge_num)
-#define FIELD_THETA   DOUBLE3(llm, primal_num, nqdyn)
-#define FIELD_GEOPOT  DOUBLE2(llm+1, primal_num)
 
 #define HASNAN(field) (ANY(.NOT.ABS(field)<1e20))
@@ -47,12 +32,12 @@
   FIELD_MASS   :: m_ik, theta   ! IN*2
   FIELD_GEOPOT :: m_il, W_il, Phi_il, Phi_star_il  ! IN,INOUT*2, LOCAL
-  DBL :: tau, gamma, tau2_g, tau2_g2, g2, gm2, vreff, Rd_preff
+  NUM :: tau, gamma, tau2_g, tau2_g2, g2, gm2, vreff, Rd_preff
   INTEGER :: iter
   DECLARE_INDICES
-  DBL :: rho_ij, X_ij, Y_ij, wil, rho_c2_mik, c2_mik, ml_g2
+  NUM :: rho_ij, X_ij, Y_ij, wil, rho_c2_mik, c2_mik, ml_g2
 #define COLUMN 0
 #if COLUMN 
-  DOUBLE1(llm)  :: pk, Ak, Ck
-  DOUBLE1(llm+1):: Rl, Bl, Dl, xl
+  NUM1(llm)  :: pk, Ak, Ck
+  NUM1(llm+1):: Rl, Bl, Dl, xl
 #define p_ik(l,ij) pk(l)
 #define A_ik(l,ij) Ak(l)
@@ -90,5 +75,5 @@
   DECLARE_INDICES
   DECLARE_EDGES
-  DBL :: W_el, W2_el, gPhi2, dP, divG, u2, uu
+  NUM :: W_el, W2_el, gPhi2, dP, divG, u2, uu
   START_TRACE(id_slow_NH, 5,0,3)
 #include "../kernels_unst/caldyn_slow_NH.k90"
@@ -97,5 +82,5 @@
 
 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta, berni,pres,m_il, pk,geopot,W,dPhi,dW,du)
-  DBL, INTENT(IN) :: tau
+  NUM, INTENT(IN) :: tau
   FIELD_MASS   :: rhodz,pk,berni,pres    ! IN, OUT, BUF*2
   FIELD_THETA  :: theta                  ! IN
@@ -103,5 +88,5 @@
   FIELD_U      :: du                     ! OUT
   DECLARE_INDICES
-  DBL :: X_ij, rho_ij, T_ij, gamma, Cvd, vreff, Rd_preff
+  NUM :: X_ij, rho_ij, T_ij, gamma, Cvd, vreff, Rd_preff
 #include "../kernels_unst/caldyn_mil.k90"
   IF(tau>0) THEN ! solve implicit problem for geopotential
@@ -118,5 +103,5 @@
   FIELD_U      :: du ! INOUT
   DECLARE_INDICES
-  DBL :: w_ij, wflux_ij
+  NUM :: w_ij, wflux_ij
   START_TRACE(id_vert_NH, 6,0,1)
 #include "../kernels_unst/caldyn_vert_NH.k90"
@@ -132,5 +117,5 @@
   FIELD_PS     :: ps        ! OUT
   DECLARE_INDICES
-  DBL :: gdz, ke, uu, chi, gv, exner_ik, temp_ik, p_ik, qv, Rmix
+  NUM :: gdz, ke, uu, chi, gv, exner_ik, temp_ik, p_ik, qv, Rmix
   START_TRACE(id_geopot, 3,0,3)
 #include "../kernels_unst/compute_geopot.k90"
@@ -145,5 +130,5 @@
   DECLARE_EDGES
   LOGICAL, PARAMETER :: zero=.TRUE.
-  DBL :: ke, uu
+  NUM :: ke, uu
   START_TRACE(id_slow_hydro, 3,0,3)
 #include "../kernels_unst/caldyn_slow_hydro.k90"
@@ -161,5 +146,5 @@
   FIELD_UL     :: wwuu
   DECLARE_INDICES
-  DBL :: dF_deta, dFu_deta
+  NUM :: dF_deta, dFu_deta
   wwuu=0.
   !$OMP BARRIER
@@ -177,5 +162,5 @@
   DECLARE_INDICES
   DECLARE_EDGES
-  DBL :: divF, du_trisk
+  NUM :: divF, du_trisk
   START_TRACE(id_coriolis, 3,4,0) ! primal, dual, edge
 #include "../kernels_unst/coriolis.k90"
@@ -188,5 +173,5 @@
   FIELD_THETA :: theta, theta_rhodz
   DECLARE_INDICES
-  DBL :: m
+  NUM :: m
   START_TRACE(id_theta, 3,0,0) ! primal, dual, edge
 #include "../kernels_unst/theta.k90"
@@ -201,5 +186,5 @@
   DECLARE_EDGES
   DECLARE_VERTICES
-  DBL :: etav, hv
+  NUM :: etav, hv
   START_TRACE(id_pvort_only, 1,1,2) ! primal, dual, edge
 #include "../kernels_unst/pvort_only.k90"
@@ -208,5 +193,5 @@
 
 SUBROUTINE compute_caldyn_fast(tau, pk,berni,theta,geopot, du,u)
-  DBL, INTENT(IN) :: tau
+  NUM, INTENT(IN) :: tau
   FIELD_MASS   :: pk,berni  ! INOUT, OUT
   FIELD_THETA  :: theta     ! IN
@@ -215,5 +200,5 @@
   DECLARE_INDICES
   DECLARE_EDGES
-  DBL          :: due
+  NUM          :: due
   START_TRACE(id_fast, 4,0,2) ! primal, dual, edge
 #include "../kernels_unst/caldyn_fast.k90"
@@ -224,6 +209,6 @@
 
 SUBROUTINE gradient(b,grad) BINDC(gradient)
-  DOUBLE2(llm,primal_num) :: b
-  DOUBLE2(llm,edge_num)  :: grad
+  FIELD_MASS :: b
+  FIELD_u    :: grad
   DECLARE_INDICES
 #include "../kernels_unst/gradient.k90"
@@ -231,9 +216,9 @@
 !
 SUBROUTINE div(u,divu) BINDC(div)
-  DOUBLE2(llm,primal_num) :: divu
-  DOUBLE2(llm,edge_num)  :: u
-  DECLARE_INDICES
-  DECLARE_EDGES
-  DBL :: div_ij
+  FIELD_MASS :: divu
+  FIELD_u    :: u
+  DECLARE_INDICES
+  DECLARE_EDGES
+  NUM :: div_ij
   !$OMP PARALLEL NUM_THREADS(nb_threads)
 #include "../kernels_unst/div.k90"
Index: codes/icosagcm/devel/src/unstructured/data_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/data_unstructured.F90	(revision 686)
+++ codes/icosagcm/devel/src/unstructured/data_unstructured.F90	(revision 688)
@@ -5,13 +5,5 @@
   SAVE
 
-#define BINDC_(thename) BIND(C, name=#thename)
-#define BINDC(thename) BINDC_(dynamico_ ## thename)
-
-#define DBL REAL(C_DOUBLE)
-#define DOUBLE1(m) DBL, DIMENSION(m)
-#define DOUBLE2(m,n) DBL, DIMENSION(m,n)
-#define DOUBLE3(m,n,p) DBL, DIMENSION(m,n,p)
-#define DOUBLE4(m,n,p,q) DBL, DIMENSION(m,n,p,q)
-#define INDEX INTEGER(C_INT)
+  #include "unstructured.h90"
 
   INTEGER, PARAMETER :: eta_mass=1, eta_lag=2, &
@@ -34,11 +26,11 @@
   ! circulation is positive when going from down to up
 
-  DBL, BIND(C) :: elapsed, g, ptop, cpp, cppv, Rd, Rv, preff, Treff, &
-       pbot, Phi_bot, rho_bot
-  DBL :: kappa
-  DOUBLE1(max_nb_stage), BIND(C)              :: tauj       ! diagonal of fast Butcher tableau
-  DOUBLE2(max_nb_stage,max_nb_stage), BIND(C) :: cslj, cflj ! slow and fast modified Butcher tableaus
-  DOUBLE1(:), ALLOCATABLE            :: le_de, fv, Av, Ai
-  DOUBLE2(:,:), ALLOCATABLE          :: Riv2, wee, ap,bp, mass_bl, mass_dak, mass_dbk
+  TIME, BIND(C) :: elapsed
+  NUM, BIND(C) :: g, ptop, cpp, cppv, Rd, Rv, preff, Treff, pbot, Phi_bot, rho_bot
+  NUM :: kappa
+  NUM1(max_nb_stage), BIND(C)              :: tauj       ! diagonal of fast Butcher tableau
+  NUM2(max_nb_stage,max_nb_stage), BIND(C) :: cslj, cflj ! slow and fast modified Butcher tableaus
+  NUM1(:), ALLOCATABLE            :: le_de, fv, Av, Ai
+  NUM2(:,:), ALLOCATABLE          :: Riv2, wee, ap,bp, mass_bl, mass_dak, mass_dbk
 
   INTEGER(C_INT), BIND(C) :: comm_icosa
@@ -47,5 +39,5 @@
        id_pvort_only=3, id_slow_hydro=4, id_fast=5, id_coriolis=6, id_theta=7, id_geopot=8, id_vert=9, &
        id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, nb_routines=14 
-  DBL, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel
+  TIME, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel
   INTEGER, PRIVATE :: current_id, nb_calls(nb_routines)
   INTEGER(KIND=8), PRIVATE :: bytes(nb_routines) ! bytes read or written by each kernel
@@ -61,5 +53,5 @@
           num(:), & ! number of cells to send to / receive from other MPI ranks
           cells(:) ! local indices of cells to send/receive
-     DBL, ALLOCATABLE :: buf2(:,:)
+     NUM, ALLOCATABLE :: buf2(:,:)
   END TYPE Halo_transfer
   TYPE(Halo_transfer), TARGET :: send_info(transfer_max), recv_info(transfer_max)
@@ -79,5 +71,5 @@
   SUBROUTINE print_trace()
     INTEGER :: id
-    DBL :: total_spent
+    TIME :: total_spent
     !$OMP MASTER
     total_spent=SUM(time_spent)
@@ -106,5 +98,5 @@
 
   SUBROUTINE exit_trace()
-    DBL :: elapsed
+    TIME :: elapsed
     !$OMP MASTER
     elapsed = OMP_GET_WTIME()-start_time
@@ -180,10 +172,11 @@
   END SUBROUTINE init_mesh
 
+  ! Input arrays to init_metric and init_hybrid are declared DBL
+  ! => always float64 on the Python side
+  ! They are copied to Fortran arrays of type NUM (float or double)
+
   SUBROUTINE init_metric(Ai_, Av_, fv_, le_de_, Riv2_, wee_) BINDC(init_metric)
-    DOUBLE1(primal_num) :: Ai_
-    DOUBLE1(dual_num)   :: Av_, fv_
-    DOUBLE1(edge_num)   :: le_de_
-    DOUBLE2(max_dual_deg,dual_num) :: Riv2_
-    DOUBLE2(max_trisk_deg,edge_num) :: wee_
+    DBL :: Ai_(primal_num), Av_(dual_num), fv_(dual_num), le_de_(edge_num), &
+         Riv2_(max_dual_deg,dual_num), wee_(max_trisk_deg,edge_num)
     PRINT *, 'init_metric ...'
     ALLOC1(Ai,primal_num)
@@ -235,6 +228,6 @@
   !
   SUBROUTINE init_hybrid(bl,dak,dbk) BINDC(init_hybrid)
-    DOUBLE2(llm+1, primal_num) :: bl
-    DOUBLE2(llm, primal_num) :: dak,dbk
+    DBL :: bl(llm+1, primal_num), &
+         dak(llm, primal_num), dbk(llm, primal_num)
     PRINT *, 'Setting hybrid coefficients ...'
     ALLOC2(mass_bl, llm+1, primal_num)
Index: codes/icosagcm/devel/src/unstructured/timestep_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/timestep_unstructured.F90	(revision 686)
+++ codes/icosagcm/devel/src/unstructured/timestep_unstructured.F90	(revision 688)
@@ -11,14 +11,4 @@
   SAVE
 
-#define BINDC_(thename) BIND(C, name=#thename)
-#define BINDC(thename) BINDC_(dynamico_ ## thename)
-
-#define DBL REAL(C_DOUBLE)
-#define DOUBLE1(m) DBL, DIMENSION(m)
-#define DOUBLE2(m,n) DBL, DIMENSION(m,n)
-#define DOUBLE3(m,n,p) DBL, DIMENSION(m,n,p)
-#define DOUBLE4(m,n,p,q) DBL, DIMENSION(m,n,p,q)
-#define INDEX INTEGER(C_INT)
-
 #ifdef CPP_USING_XIOS
   TYPE(xios_context) :: ctx_hdl
@@ -27,11 +17,5 @@
 CONTAINS
 
-#define FIELD_PS      DOUBLE1(primal_num)
-#define FIELD_MASS    DOUBLE2(llm, primal_num)
-#define FIELD_Z       DOUBLE2(llm, dual_num)
-#define FIELD_U       DOUBLE2(llm, edge_num)
-#define FIELD_UL      DOUBLE2(llm+1, edge_num)
-#define FIELD_THETA   DOUBLE3(llm, primal_num, nqdyn)
-#define FIELD_GEOPOT  DOUBLE2(llm+1, primal_num)
+#include "unstructured.h90"
 
 #define HASNAN(field) (ANY(.NOT.ABS(field)<1e20))
@@ -41,5 +25,5 @@
                                  dmass_col,drhodz,dtheta_rhodz,du_fast,du_slow, &
                                  dPhi_fast, dPhi_slow, dW_fast, dW_slow) BINDC(caldyn_unstructured) ! OUT : tendencies
-    DBL, VALUE :: tau
+    NUM, VALUE :: tau
     FIELD_MASS   :: rhodz, drhodz, pk, berni          ! IN, OUT, DIAG
     FIELD_THETA  :: theta_rhodz, dtheta_rhodz, theta  ! IN, OUT, DIAG
@@ -54,5 +38,5 @@
     FIELD_UL     :: bufu1, bufu2, bufu3,bufu4
 
-    DBL          :: time1,time2
+    TIME          :: time1,time2
     INTEGER :: ij
     
@@ -124,9 +108,9 @@
     FIELD_GEOPOT :: geopot, w, wflux                 ! IN, INOUT, DIAG
     FIELD_Z      :: qv                               ! DIAG
-    DOUBLE2(       primal_num, max_nb_stage) :: dmass_col    ! OUT
-    DOUBLE3(llm,   primal_num, max_nb_stage) :: drhodz   ! OUT
-    DOUBLE4(llm,   primal_num, nqdyn, max_nb_stage) :: dtheta_rhodz ! OUT
-    DOUBLE3(llm,   edge_num,   max_nb_stage) :: du_fast,du_slow ! OUT
-    DOUBLE3(llm+1, primal_num, max_nb_stage) :: &
+    NUM2(       primal_num, max_nb_stage) :: dmass_col    ! OUT
+    NUM3(llm,   primal_num, max_nb_stage) :: drhodz   ! OUT
+    NUM4(llm,   primal_num, nqdyn, max_nb_stage) :: dtheta_rhodz ! OUT
+    NUM3(llm,   edge_num,   max_nb_stage) :: du_fast,du_slow ! OUT
+    NUM3(llm+1, primal_num, max_nb_stage) :: &
          dPhi_fast, dPhi_slow, dW_fast, dW_slow      ! OUT
     ! buffers for fields that need to be shared among OpenMP threads
@@ -134,5 +118,5 @@
     FIELD_GEOPOT :: bufm1, bufm2, bufm3
     FIELD_UL     :: bufu1, bufu2, bufu3,bufu4
-    DBL       :: time1,time2
+    TIME       :: time1,time2
     INTEGER :: step, stage, iq, ij
     
@@ -240,7 +224,7 @@
   SUBROUTINE update(j,sz,clj,field,dfield)
     INTEGER :: j, sz ! stage in ARK scheme, field size
-    DOUBLE2(max_nb_stage,max_nb_stage) :: clj ! modified Butcher tableau
-    DOUBLE1(sz) :: field
-    DOUBLE2(sz, max_nb_stage) :: dfield
+    NUM2(max_nb_stage,max_nb_stage) :: clj ! modified Butcher tableau
+    NUM1(sz) :: field
+    NUM2(sz, max_nb_stage) :: dfield
     !
     INTEGER :: l, ij
Index: codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90	(revision 686)
+++ codes/icosagcm/devel/src/unstructured/transfer_unstructured.F90	(revision 688)
@@ -4,4 +4,6 @@
   SAVE
   PRIVATE
+
+#include "unstructured.h90"
 
   INCLUDE 'mpif.h'
@@ -47,5 +49,5 @@
   SUBROUTINE copy_in(lldata, ndata, llbuf, nbuf, cells, data, buf)
     INTEGER :: ndata, lldata, nbuf, llbuf, cells(nbuf), i
-    REAL(C_DOUBLE) :: data(lldata,ndata), buf(llbuf,nbuf)
+    NUM :: data(lldata,ndata), buf(llbuf,nbuf)
     !$OMP DO
     DO i=1,nbuf
@@ -57,5 +59,5 @@
   SUBROUTINE copy_out(lldata, ndata, llbuf, nbuf, cells, data, buf)
     INTEGER :: ndata, lldata, nbuf, llbuf, cells(nbuf), i
-    REAL(C_DOUBLE) :: data(lldata,ndata), buf(llbuf,nbuf)
+    NUM :: data(lldata,ndata), buf(llbuf,nbuf)
     !$OMP DO SCHEDULE(STATIC)
     DO i=1,nbuf
@@ -67,7 +69,7 @@
   SUBROUTINE update_halo(index, data)
     INTEGER :: index ! transfer_XXX, cf data_unstructured.F90
-    REAL(C_DOUBLE) :: data(:,:)    
+    NUM :: data(:,:)    
     TYPE(Halo_transfer), POINTER :: halo
-    REAL(C_DOUBLE), POINTER :: buf(:,:)
+    NUM, POINTER :: buf(:,:)
     INTEGER :: req(send_info(index)%ranks+recv_info(index)%ranks), &
          status(MPI_STATUS_SIZE, send_info(index)%ranks+recv_info(index)%ranks)
@@ -85,5 +87,5 @@
        num = halo%num(i)
        ireq = ireq+1
-       call MPI_ISEND(buf(1,istart), llbuf*num, MPI_REAL8, halo%rank(i), &
+       call MPI_ISEND(buf(1,istart), llbuf*num, MPI_NUM, halo%rank(i), &
             42, MPI_COMM_WORLD, req(ireq), ierr)
        istart = istart+num
@@ -98,5 +100,5 @@
        num = halo%num(i)
        ireq = ireq+1
-       call MPI_IRECV(buf(1,istart), llbuf*num, MPI_REAL8, halo%rank(i), &
+       call MPI_IRECV(buf(1,istart), llbuf*num, MPI_NUM, halo%rank(i), &
             42, MPI_COMM_WORLD, req(ireq), ierr)
        istart = istart+num
@@ -111,5 +113,5 @@
   SUBROUTINE update_halo_c(index, lldata, ndata, data) BIND(C, name='dynamico_update_halo')
     INTEGER, VALUE :: index, lldata, ndata
-    REAL(C_DOUBLE) :: data(lldata, ndata)
+    NUM :: data(lldata, ndata)
     CALL update_halo(index, data)
   END SUBROUTINE update_halo_c
Index: codes/icosagcm/devel/src/unstructured/transport_unstructured.F90
===================================================================
--- codes/icosagcm/devel/src/unstructured/transport_unstructured.F90	(revision 686)
+++ codes/icosagcm/devel/src/unstructured/transport_unstructured.F90	(revision 688)
@@ -7,24 +7,7 @@
   SAVE
 
-#define BINDC_(thename) BIND(C, name=#thename)
-#define BINDC(thename) BINDC_(dynamico_ ## thename)
-
-#define DBL REAL(C_DOUBLE)
-#define DOUBLE1(m) DBL, DIMENSION(m)
-#define DOUBLE2(m,n) DBL, DIMENSION(m,n)
-#define DOUBLE3(m,n,p) DBL, DIMENSION(m,n,p)
-#define DOUBLE4(m,n,p,q) DBL, DIMENSION(m,n,p,q)
-#define INDEX INTEGER(C_INT)
-
 CONTAINS
 
-#define FIELD_PS      DOUBLE1(primal_num)
-#define FIELD_MASS    DOUBLE2(llm, primal_num)
-#define FIELD_Z       DOUBLE2(llm, dual_num)
-#define FIELD_U       DOUBLE2(llm, edge_num)
-#define FIELD_UL      DOUBLE2(llm+1, edge_num)
-#define FIELD_THETA   DOUBLE3(llm, primal_num, nqdyn)
-#define FIELD_GEOPOT  DOUBLE2(llm+1, primal_num)
-
+#include "unstructured.h90"
 #define HASNAN(field) (ANY(.NOT.ABS(field)<1e20))
 
@@ -40,5 +23,6 @@
     INTEGER, DIMENSION(primal_num) :: cur_lev
 
-    DBL          :: rhodz_cum_target, rhodz_cum_lev, rhodz_cum_levp1, X, time1,time2
+    NUM          :: rhodz_cum_target, rhodz_cum_lev, rhodz_cum_levp1, X
+    TIME         :: time1,time2
     INTEGER :: ij, l, level, edge, ij_left, ij_right
     
Index: codes/icosagcm/devel/src/unstructured/unstructured.h90
===================================================================
--- codes/icosagcm/devel/src/unstructured/unstructured.h90	(revision 688)
+++ codes/icosagcm/devel/src/unstructured/unstructured.h90	(revision 688)
@@ -0,0 +1,33 @@
+#undef PREC_DOUBLE
+
+#define DBL REAL(C_DOUBLE)
+#define FLT REAL(C_FLOAT)
+#define TIME DBL
+
+#ifdef PREC_DOUBLE
+#define NUM DBL
+#define MPI_NUM MPI_REAL8
+#else
+#define NUM FLT
+#define MPI_NUM MPI_REAL4
+#endif
+
+! NUM and MPI_NUM are used for physical quantities (scalar or array)
+! DBL and MPI_REAL8 are used for variables that always require double precision
+
+#define NUM1(m) NUM, DIMENSION(m)
+#define NUM2(m,n) NUM, DIMENSION(m,n)
+#define NUM3(m,n,p) NUM, DIMENSION(m,n,p)
+#define NUM4(m,n,p,q) NUM, DIMENSION(m,n,p,q)
+#define INDEX INTEGER(C_INT)
+
+#define FIELD_PS      NUM1(primal_num)
+#define FIELD_MASS    NUM2(llm, primal_num)
+#define FIELD_Z       NUM2(llm, dual_num)
+#define FIELD_U       NUM2(llm, edge_num)
+#define FIELD_UL      NUM2(llm+1, edge_num)
+#define FIELD_THETA   NUM3(llm, primal_num, nqdyn)
+#define FIELD_GEOPOT  NUM2(llm+1, primal_num)
+
+#define BINDC_(thename) BIND(C, name=#thename)
+#define BINDC(thename) BINDC_(dynamico_ ## thename)
