Index: trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90
===================================================================
--- trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90	(revision 1888)
+++ trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90	(revision 1918)
@@ -5,4 +5,5 @@
       USE vertical_layers_mod, ONLY: aps,bps
       USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
+      USE datafile_mod, ONLY: datadir
       implicit none
 
@@ -36,5 +37,4 @@
 
       include "callkeys.h"
-      include "datafile.h"
 
 ! inputs :
@@ -454,9 +454,9 @@
 ! 2.1 open initialization files
 
-      open(210, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_may.dat')
+      open(210, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_may.dat')
       if (ierr /= 0) then
          write(*,*)'Error : cannot open file atmosfera_LMD_may.dat '
          write(*,*)'(in aeronomars/inichim_newstart.F)'
-         write(*,*)'It should be in :', trim(datafile),'/'
+         write(*,*)'It should be in :', trim(datadir),'/'
          write(*,*)'1) You can change this path in callphys.def with'
          write(*,*)'   datadir=/path/to/datafiles/'
@@ -466,9 +466,9 @@
          stop
       end if
-      open(220, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_min.dat')
+      open(220, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_min.dat')
       if (ierr /= 0) then
          write(*,*)'Error : cannot open file atmosfera_LMD_min.dat '
          write(*,*)'(in aeronomars/inichim_newstart.F)'
-         write(*,*)'It should be in :', trim(datafile),'/'
+         write(*,*)'It should be in :', trim(datadir),'/'
          write(*,*)'1) You can change this path in callphys.def with'
          write(*,*)'   datadir=/path/to/datafiles/'
@@ -479,11 +479,11 @@
       end if
       if(flagnitro) then
-         open(230, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_nitr.dat')
+         open(230, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_nitr.dat')
          if (ierr.ne.0) then
             write(*,*)'Error : cannot open file atmosfera_LMD_nitr.dat '
             write(*,*)'(in aeronomars/inichim_newstart.F)'
-            write(*,*)'It should be in :', datafile
-            write(*,*)'1) You can change this directory address in '
-            write(*,*)'   file phymars/datafile.h'
+            write(*,*)'It should be in :', trim(datadir),'/'
+            write(*,*)'1) You can change this path in callphys.def with'
+            write(*,*)'   datadir=/path/to/datafiles/'
             write(*,*)'2) If necessary atmosfera_LMD_nitr.dat (and others)'
             write(*,*)'   can be obtained online on:'
Index: trunk/LMDZ.MARS/libf/aeronomars/param_read.F
===================================================================
--- trunk/LMDZ.MARS/libf/aeronomars/param_read.F	(revision 1888)
+++ trunk/LMDZ.MARS/libf/aeronomars/param_read.F	(revision 1918)
@@ -14,10 +14,8 @@
      .    fluxtop,ct1,ct2,p1,p2
 
+      use datafile_mod, only: datadir
+      
       implicit none
 
-
-c     common variables and constants
-      include 'datafile.h'
- 
  
 c     local variables
@@ -34,11 +32,11 @@
       !Tabulated column amount
       open(210, status = 'old',
-c    $file=trim(datafile)//'/EUVDAT/coln.dat',iostat=ierr)
-     $file=trim(datafile)//'/EUVDAT/param_v5/coln.dat',iostat=ierr)
+c    $file=trim(datadir)//'/EUVDAT/coln.dat',iostat=ierr)
+     $file=trim(datadir)//'/EUVDAT/param_v5/coln.dat',iostat=ierr)
 
       IF (ierr.NE.0) THEN 
        write(*,*)'cant find directory EUVDAT containing param_v5 subdir'
        write(*,*)'(in aeronomars/param_read.F)'
-       write(*,*)'It should be in :', trim(datafile),'/'
+       write(*,*)'It should be in :', trim(datadir),'/'
        write(*,*)'1) You can change this directory address in '
        write(*,*)'   callphys.def with datadir=/path/to/dir'
@@ -50,30 +48,30 @@
  
       !Tabulated photoabsorption coefficients
-      open(220,file=trim(datafile)//'/EUVDAT/param_v5/j2_an.dat')
-      open(230,file=trim(datafile)//'/EUVDAT/param_v5/j3_an.dat')
-      open(240,file=trim(datafile)//'/EUVDAT/param_v5/j1_an.dat')
-      open(250,file=trim(datafile)//'/EUVDAT/param_v5/j2_bn.dat')
-      open(260,file=trim(datafile)//'/EUVDAT/param_v5/j2_cn.dat')
-      open(300,file=trim(datafile)//'/EUVDAT//param_v5/j2_dn.dat')
-      open(270,file=trim(datafile)//'/EUVDAT//param_v5/j1_bn.dat')
-      open(280,file=trim(datafile)//'/EUVDAT//param_v5/j1_cn.dat')
-      open(290,file=trim(datafile)//'/EUVDAT//param_v5/j1_dn.dat')
-      open(150,file=trim(datafile)//'/EUVDAT//param_v5/j4n.dat')
-      open(160,file=trim(datafile)//'/EUVDAT//param_v5/j5n.dat')
-      open(170,file=trim(datafile)//'/EUVDAT//param_v5/j6n.dat')
-      open(180,file=trim(datafile)//'/EUVDAT//param_v5/j7n.dat')
-      open(390,file=trim(datafile)//'/EUVDAT//param_v5/j8_an.dat')
-      open(400,file=trim(datafile)//'/EUVDAT//param_v5/j8_bn.dat')
-      open(410,file=trim(datafile)//'/EUVDAT//param_v5/j9n.dat')
-      open(420,file=trim(datafile)//'/EUVDAT//param_v5/j10_an.dat')
-      open(430,file=trim(datafile)//'/EUVDAT//param_v5/j10_bn.dat')
-      open(440,file=trim(datafile)//'/EUVDAT//param_v5/j10_cn.dat')
-      open(450,file=trim(datafile)//'/EUVDAT//param_v5/j11_an.dat')
-      open(460,file=trim(datafile)//'/EUVDAT//param_v5/j11_bn.dat')
-      open(470,file=trim(datafile)//'/EUVDAT//param_v5/j11_cn.dat')
-      open(480,file=trim(datafile)//'/EUVDAT//param_v5/j12n.dat')
-      open(490,file=trim(datafile)//'/EUVDAT//param_v5/j13_an.dat')
-      open(500,file=trim(datafile)//'/EUVDAT//param_v5/j13_bn.dat')
-      open(510,file=trim(datafile)//'/EUVDAT//param_v5/j13_cn.dat')
+      open(220,file=trim(datadir)//'/EUVDAT/param_v5/j2_an.dat')
+      open(230,file=trim(datadir)//'/EUVDAT/param_v5/j3_an.dat')
+      open(240,file=trim(datadir)//'/EUVDAT/param_v5/j1_an.dat')
+      open(250,file=trim(datadir)//'/EUVDAT/param_v5/j2_bn.dat')
+      open(260,file=trim(datadir)//'/EUVDAT/param_v5/j2_cn.dat')
+      open(300,file=trim(datadir)//'/EUVDAT//param_v5/j2_dn.dat')
+      open(270,file=trim(datadir)//'/EUVDAT//param_v5/j1_bn.dat')
+      open(280,file=trim(datadir)//'/EUVDAT//param_v5/j1_cn.dat')
+      open(290,file=trim(datadir)//'/EUVDAT//param_v5/j1_dn.dat')
+      open(150,file=trim(datadir)//'/EUVDAT//param_v5/j4n.dat')
+      open(160,file=trim(datadir)//'/EUVDAT//param_v5/j5n.dat')
+      open(170,file=trim(datadir)//'/EUVDAT//param_v5/j6n.dat')
+      open(180,file=trim(datadir)//'/EUVDAT//param_v5/j7n.dat')
+      open(390,file=trim(datadir)//'/EUVDAT//param_v5/j8_an.dat')
+      open(400,file=trim(datadir)//'/EUVDAT//param_v5/j8_bn.dat')
+      open(410,file=trim(datadir)//'/EUVDAT//param_v5/j9n.dat')
+      open(420,file=trim(datadir)//'/EUVDAT//param_v5/j10_an.dat')
+      open(430,file=trim(datadir)//'/EUVDAT//param_v5/j10_bn.dat')
+      open(440,file=trim(datadir)//'/EUVDAT//param_v5/j10_cn.dat')
+      open(450,file=trim(datadir)//'/EUVDAT//param_v5/j11_an.dat')
+      open(460,file=trim(datadir)//'/EUVDAT//param_v5/j11_bn.dat')
+      open(470,file=trim(datadir)//'/EUVDAT//param_v5/j11_cn.dat')
+      open(480,file=trim(datadir)//'/EUVDAT//param_v5/j12n.dat')
+      open(490,file=trim(datadir)//'/EUVDAT//param_v5/j13_an.dat')
+      open(500,file=trim(datadir)//'/EUVDAT//param_v5/j13_bn.dat')
+      open(510,file=trim(datadir)//'/EUVDAT//param_v5/j13_cn.dat')
 
       
@@ -228,5 +226,5 @@
 
       !Parameters for the variation of the solar flux with 11 years cycle
-      open(100,file=trim(datafile)//'/EUVDAT/param_v5/varflujo.dat')
+      open(100,file=trim(datadir)//'/EUVDAT/param_v5/varflujo.dat')
       read(100,*)
       do i=1,24
@@ -266,5 +264,5 @@
 c     CO2, O2, NO
 
-      open(120,file=trim(datafile)//'/EUVDAT/param_v5/efdis_inter.dat')
+      open(120,file=trim(datadir)//'/EUVDAT/param_v5/efdis_inter.dat')
       read(120,*)
 !      do i=1,21
Index: trunk/LMDZ.MARS/libf/aeronomars/param_read_e107.F
===================================================================
--- trunk/LMDZ.MARS/libf/aeronomars/param_read_e107.F	(revision 1888)
+++ trunk/LMDZ.MARS/libf/aeronomars/param_read_e107.F	(revision 1918)
@@ -16,9 +16,10 @@
      .    fluxtop,ct1,ct2,p1,p2
 
+      use datafile_mod, only: datadir
+
       implicit none
 
 
 c     common variables and constants
-      include 'datafile.h'
       include "callkeys.h"
  
@@ -39,11 +40,11 @@
       !Tabulated column amount
       open(210, status = 'old',
-c    $file=trim(datafile)//'/EUVDAT/coln.dat',iostat=ierr)
-     $file=trim(datafile)//'/EUVDAT/param_v6/coln.dat',iostat=ierr)
+c    $file=trim(datadir)//'/EUVDAT/coln.dat',iostat=ierr)
+     $file=trim(datadir)//'/EUVDAT/param_v6/coln.dat',iostat=ierr)
 
       IF (ierr.NE.0) THEN 
        write(*,*)'cant find directory EUVDAT containing param_v6 subdir'
        write(*,*)'(in aeronomars/param_read.F)'
-       write(*,*)'It should be in :', trim(datafile),'/'
+       write(*,*)'It should be in :', trim(datadir),'/'
        write(*,*)'1) You can change this directory address in '
        write(*,*)'   callphys.def with datadir=/path/to/dir'
@@ -55,30 +56,30 @@
  
       !Tabulated photoabsorption coefficients
-      open(220,file=trim(datafile)//'/EUVDAT/param_v6/trans2_an.dat')
-      open(230,file=trim(datafile)//'/EUVDAT/param_v6/trans3_an.dat')
-      open(240,file=trim(datafile)//'/EUVDAT/param_v6/trans1_an.dat')
-      open(250,file=trim(datafile)//'/EUVDAT/param_v6/trans2_bn.dat')
-      open(260,file=trim(datafile)//'/EUVDAT/param_v6/trans2_cn.dat')
-      open(300,file=trim(datafile)//'/EUVDAT/param_v6/trans2_dn.dat')
-      open(270,file=trim(datafile)//'/EUVDAT/param_v6/trans1_bn.dat')
-      open(280,file=trim(datafile)//'/EUVDAT/param_v6/trans1_cn.dat')
-      open(290,file=trim(datafile)//'/EUVDAT/param_v6/trans1_dn.dat')
-      open(150,file=trim(datafile)//'/EUVDAT/param_v6/trans4n.dat')
-      open(160,file=trim(datafile)//'/EUVDAT/param_v6/trans5n.dat')
-      open(170,file=trim(datafile)//'/EUVDAT/param_v6/trans6n.dat')
-      open(180,file=trim(datafile)//'/EUVDAT/param_v6/trans7n.dat')
-      open(390,file=trim(datafile)//'/EUVDAT/param_v6/trans8_an.dat')
-      open(400,file=trim(datafile)//'/EUVDAT/param_v6/trans8_bn.dat')
-      open(410,file=trim(datafile)//'/EUVDAT/param_v6/trans9n.dat')
-      open(420,file=trim(datafile)//'/EUVDAT/param_v6/trans10_an.dat')
-      open(430,file=trim(datafile)//'/EUVDAT/param_v6/trans10_bn.dat')
-      open(440,file=trim(datafile)//'/EUVDAT/param_v6/trans10_cn.dat')
-      open(450,file=trim(datafile)//'/EUVDAT/param_v6/trans11_an.dat')
-      open(460,file=trim(datafile)//'/EUVDAT/param_v6/trans11_bn.dat')
-      open(470,file=trim(datafile)//'/EUVDAT/param_v6/trans11_cn.dat')
-      open(480,file=trim(datafile)//'/EUVDAT/param_v6/trans12n.dat')
-      open(490,file=trim(datafile)//'/EUVDAT/param_v6/trans13_an.dat')
-      open(500,file=trim(datafile)//'/EUVDAT/param_v6/trans13_bn.dat')
-      open(510,file=trim(datafile)//'/EUVDAT/param_v6/trans13_cn.dat')
+      open(220,file=trim(datadir)//'/EUVDAT/param_v6/trans2_an.dat')
+      open(230,file=trim(datadir)//'/EUVDAT/param_v6/trans3_an.dat')
+      open(240,file=trim(datadir)//'/EUVDAT/param_v6/trans1_an.dat')
+      open(250,file=trim(datadir)//'/EUVDAT/param_v6/trans2_bn.dat')
+      open(260,file=trim(datadir)//'/EUVDAT/param_v6/trans2_cn.dat')
+      open(300,file=trim(datadir)//'/EUVDAT/param_v6/trans2_dn.dat')
+      open(270,file=trim(datadir)//'/EUVDAT/param_v6/trans1_bn.dat')
+      open(280,file=trim(datadir)//'/EUVDAT/param_v6/trans1_cn.dat')
+      open(290,file=trim(datadir)//'/EUVDAT/param_v6/trans1_dn.dat')
+      open(150,file=trim(datadir)//'/EUVDAT/param_v6/trans4n.dat')
+      open(160,file=trim(datadir)//'/EUVDAT/param_v6/trans5n.dat')
+      open(170,file=trim(datadir)//'/EUVDAT/param_v6/trans6n.dat')
+      open(180,file=trim(datadir)//'/EUVDAT/param_v6/trans7n.dat')
+      open(390,file=trim(datadir)//'/EUVDAT/param_v6/trans8_an.dat')
+      open(400,file=trim(datadir)//'/EUVDAT/param_v6/trans8_bn.dat')
+      open(410,file=trim(datadir)//'/EUVDAT/param_v6/trans9n.dat')
+      open(420,file=trim(datadir)//'/EUVDAT/param_v6/trans10_an.dat')
+      open(430,file=trim(datadir)//'/EUVDAT/param_v6/trans10_bn.dat')
+      open(440,file=trim(datadir)//'/EUVDAT/param_v6/trans10_cn.dat')
+      open(450,file=trim(datadir)//'/EUVDAT/param_v6/trans11_an.dat')
+      open(460,file=trim(datadir)//'/EUVDAT/param_v6/trans11_bn.dat')
+      open(470,file=trim(datadir)//'/EUVDAT/param_v6/trans11_cn.dat')
+      open(480,file=trim(datadir)//'/EUVDAT/param_v6/trans12n.dat')
+      open(490,file=trim(datadir)//'/EUVDAT/param_v6/trans13_an.dat')
+      open(500,file=trim(datadir)//'/EUVDAT/param_v6/trans13_bn.dat')
+      open(510,file=trim(datadir)//'/EUVDAT/param_v6/trans13_cn.dat')
 
       
@@ -233,5 +234,5 @@
 
       !Parameters for the variation of the solar flux with 11 years cycle
-      open(620,file=trim(datafile)//'/EUVDAT/param_v6/fit_js_e107.dat')
+      open(620,file=trim(datadir)//'/EUVDAT/param_v6/fit_js_e107.dat')
       do i=1,ninter
          read(620,*)
@@ -274,5 +275,5 @@
       endif
       
-      open(640,file=trim(datafile)//'/EUVDAT/param_v6/'//filename)
+      open(640,file=trim(datadir)//'/EUVDAT/param_v6/'//filename)
       read(640,*)
       do i=1,669
@@ -316,5 +317,5 @@
 c     CO2, O2, NO
 
-!      open(120,file=trim(datafile)//'/EUVDAT/param_v5/efdis_inter.dat')
+!      open(120,file=trim(datadir)//'/EUVDAT/param_v5/efdis_inter.dat')
 !      read(120,*)
 !!      do i=1,21
@@ -375,5 +376,5 @@
          
       !4 possible channels for CO2 ionization
-      open(130,file=trim(datafile)//'/EUVDAT'//
+      open(130,file=trim(datadir)//'/EUVDAT'//
      $     '/co2ion_branchingratio_schunkandnagy2000_param.dat')
       do inter=1,16
@@ -408,5 +409,5 @@
 
       !2 possible channels for O2 ionization
-      open(131,file=trim(datafile)//'/EUVDAT'//
+      open(131,file=trim(datadir)//'/EUVDAT'//
      $     '/o2ion_branchingratio_schunkandnagy2000_param.dat')
       do inter=1,23
@@ -430,5 +431,5 @@
 
       !2 channels for N2 ionization
-      open(132,file=trim(datafile)//'/EUVDAT'//
+      open(132,file=trim(datadir)//'/EUVDAT'//
      $     '/n2ion_branchingratio_schunkandnagy2000_param.dat')
       do inter=1,15
@@ -453,5 +454,5 @@
      
       !3 channels for CO ionization
-       open(133,file=trim(datafile)//'/EUVDAT'//
+       open(133,file=trim(datadir)//'/EUVDAT'//
      $     '/coion_branchingratio_schunkandnagy2000_param.dat')
       do inter=1,16
Index: trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90
===================================================================
--- trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90	(revision 1888)
+++ trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90	(revision 1918)
@@ -21,10 +21,10 @@
 !***********************************************************************
 
-      use ioipsl_getincom 
+      use ioipsl_getincom, only: getin
+      use datafile_mod, only: datadir
 
       implicit none
 
-#include "chimiedata.h"
-#include "datafile.h"
+      include "chimiedata.h"
 
 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
@@ -50,9 +50,9 @@
 
       open(fic, form = 'formatted', status = 'old',                &
-           file =trim(datafile)//"/"//trim(phototable),iostat=ierr)
+           file =trim(datadir)//"/"//trim(phototable),iostat=ierr)
 
       if (ierr /= 0) THEN
         write(*,*)'Error : cannot open photolysis lookup table ', trim(phototable)
-        write(*,*)'It should be in :',trim(datafile),'/'
+        write(*,*)'It should be in :',trim(datadir),'/'
         write(*,*)'1) You can change this directory in callphys.def'
         write(*,*)'   with:'
