Changeset 1918 for trunk/LMDZ.MARS/libf


Ignore:
Timestamp:
Apr 12, 2018, 8:35:48 AM (7 years ago)
Author:
emillour
Message:

Mars GCM:
Code cleanup:

  • remove "comorbit.h" since it is no longer used.
  • turn "datafile.h" into module datafile_mod.F90 (and rename variable "datafile" as "datadir" since it stores the path to the datafile directory).

EM

Location:
trunk/LMDZ.MARS/libf
Files:
1 deleted
19 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90

    r1660 r1918  
    55      USE vertical_layers_mod, ONLY: aps,bps
    66      USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
     7      USE datafile_mod, ONLY: datadir
    78      implicit none
    89
     
    3637
    3738      include "callkeys.h"
    38       include "datafile.h"
    3939
    4040! inputs :
     
    454454! 2.1 open initialization files
    455455
    456       open(210, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_may.dat')
     456      open(210, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_may.dat')
    457457      if (ierr /= 0) then
    458458         write(*,*)'Error : cannot open file atmosfera_LMD_may.dat '
    459459         write(*,*)'(in aeronomars/inichim_newstart.F)'
    460          write(*,*)'It should be in :', trim(datafile),'/'
     460         write(*,*)'It should be in :', trim(datadir),'/'
    461461         write(*,*)'1) You can change this path in callphys.def with'
    462462         write(*,*)'   datadir=/path/to/datafiles/'
     
    466466         stop
    467467      end if
    468       open(220, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_min.dat')
     468      open(220, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_min.dat')
    469469      if (ierr /= 0) then
    470470         write(*,*)'Error : cannot open file atmosfera_LMD_min.dat '
    471471         write(*,*)'(in aeronomars/inichim_newstart.F)'
    472          write(*,*)'It should be in :', trim(datafile),'/'
     472         write(*,*)'It should be in :', trim(datadir),'/'
    473473         write(*,*)'1) You can change this path in callphys.def with'
    474474         write(*,*)'   datadir=/path/to/datafiles/'
     
    479479      end if
    480480      if(flagnitro) then
    481          open(230, iostat=ierr,file=trim(datafile)//'/atmosfera_LMD_nitr.dat')
     481         open(230, iostat=ierr,file=trim(datadir)//'/atmosfera_LMD_nitr.dat')
    482482         if (ierr.ne.0) then
    483483            write(*,*)'Error : cannot open file atmosfera_LMD_nitr.dat '
    484484            write(*,*)'(in aeronomars/inichim_newstart.F)'
    485             write(*,*)'It should be in :', datafile
    486             write(*,*)'1) You can change this directory address in '
    487             write(*,*)'   file phymars/datafile.h'
     485            write(*,*)'It should be in :', trim(datadir),'/'
     486            write(*,*)'1) You can change this path in callphys.def with'
     487            write(*,*)'   datadir=/path/to/datafiles/'
    488488            write(*,*)'2) If necessary atmosfera_LMD_nitr.dat (and others)'
    489489            write(*,*)'   can be obtained online on:'
  • trunk/LMDZ.MARS/libf/aeronomars/param_read.F

    r1381 r1918  
    1414     .    fluxtop,ct1,ct2,p1,p2
    1515
     16      use datafile_mod, only: datadir
     17     
    1618      implicit none
    1719
    18 
    19 c     common variables and constants
    20       include 'datafile.h'
    21  
    2220 
    2321c     local variables
     
    3432      !Tabulated column amount
    3533      open(210, status = 'old',
    36 c    $file=trim(datafile)//'/EUVDAT/coln.dat',iostat=ierr)
    37      $file=trim(datafile)//'/EUVDAT/param_v5/coln.dat',iostat=ierr)
     34c    $file=trim(datadir)//'/EUVDAT/coln.dat',iostat=ierr)
     35     $file=trim(datadir)//'/EUVDAT/param_v5/coln.dat',iostat=ierr)
    3836
    3937      IF (ierr.NE.0) THEN
    4038       write(*,*)'cant find directory EUVDAT containing param_v5 subdir'
    4139       write(*,*)'(in aeronomars/param_read.F)'
    42        write(*,*)'It should be in :', trim(datafile),'/'
     40       write(*,*)'It should be in :', trim(datadir),'/'
    4341       write(*,*)'1) You can change this directory address in '
    4442       write(*,*)'   callphys.def with datadir=/path/to/dir'
     
    5048 
    5149      !Tabulated photoabsorption coefficients
    52       open(220,file=trim(datafile)//'/EUVDAT/param_v5/j2_an.dat')
    53       open(230,file=trim(datafile)//'/EUVDAT/param_v5/j3_an.dat')
    54       open(240,file=trim(datafile)//'/EUVDAT/param_v5/j1_an.dat')
    55       open(250,file=trim(datafile)//'/EUVDAT/param_v5/j2_bn.dat')
    56       open(260,file=trim(datafile)//'/EUVDAT/param_v5/j2_cn.dat')
    57       open(300,file=trim(datafile)//'/EUVDAT//param_v5/j2_dn.dat')
    58       open(270,file=trim(datafile)//'/EUVDAT//param_v5/j1_bn.dat')
    59       open(280,file=trim(datafile)//'/EUVDAT//param_v5/j1_cn.dat')
    60       open(290,file=trim(datafile)//'/EUVDAT//param_v5/j1_dn.dat')
    61       open(150,file=trim(datafile)//'/EUVDAT//param_v5/j4n.dat')
    62       open(160,file=trim(datafile)//'/EUVDAT//param_v5/j5n.dat')
    63       open(170,file=trim(datafile)//'/EUVDAT//param_v5/j6n.dat')
    64       open(180,file=trim(datafile)//'/EUVDAT//param_v5/j7n.dat')
    65       open(390,file=trim(datafile)//'/EUVDAT//param_v5/j8_an.dat')
    66       open(400,file=trim(datafile)//'/EUVDAT//param_v5/j8_bn.dat')
    67       open(410,file=trim(datafile)//'/EUVDAT//param_v5/j9n.dat')
    68       open(420,file=trim(datafile)//'/EUVDAT//param_v5/j10_an.dat')
    69       open(430,file=trim(datafile)//'/EUVDAT//param_v5/j10_bn.dat')
    70       open(440,file=trim(datafile)//'/EUVDAT//param_v5/j10_cn.dat')
    71       open(450,file=trim(datafile)//'/EUVDAT//param_v5/j11_an.dat')
    72       open(460,file=trim(datafile)//'/EUVDAT//param_v5/j11_bn.dat')
    73       open(470,file=trim(datafile)//'/EUVDAT//param_v5/j11_cn.dat')
    74       open(480,file=trim(datafile)//'/EUVDAT//param_v5/j12n.dat')
    75       open(490,file=trim(datafile)//'/EUVDAT//param_v5/j13_an.dat')
    76       open(500,file=trim(datafile)//'/EUVDAT//param_v5/j13_bn.dat')
    77       open(510,file=trim(datafile)//'/EUVDAT//param_v5/j13_cn.dat')
     50      open(220,file=trim(datadir)//'/EUVDAT/param_v5/j2_an.dat')
     51      open(230,file=trim(datadir)//'/EUVDAT/param_v5/j3_an.dat')
     52      open(240,file=trim(datadir)//'/EUVDAT/param_v5/j1_an.dat')
     53      open(250,file=trim(datadir)//'/EUVDAT/param_v5/j2_bn.dat')
     54      open(260,file=trim(datadir)//'/EUVDAT/param_v5/j2_cn.dat')
     55      open(300,file=trim(datadir)//'/EUVDAT//param_v5/j2_dn.dat')
     56      open(270,file=trim(datadir)//'/EUVDAT//param_v5/j1_bn.dat')
     57      open(280,file=trim(datadir)//'/EUVDAT//param_v5/j1_cn.dat')
     58      open(290,file=trim(datadir)//'/EUVDAT//param_v5/j1_dn.dat')
     59      open(150,file=trim(datadir)//'/EUVDAT//param_v5/j4n.dat')
     60      open(160,file=trim(datadir)//'/EUVDAT//param_v5/j5n.dat')
     61      open(170,file=trim(datadir)//'/EUVDAT//param_v5/j6n.dat')
     62      open(180,file=trim(datadir)//'/EUVDAT//param_v5/j7n.dat')
     63      open(390,file=trim(datadir)//'/EUVDAT//param_v5/j8_an.dat')
     64      open(400,file=trim(datadir)//'/EUVDAT//param_v5/j8_bn.dat')
     65      open(410,file=trim(datadir)//'/EUVDAT//param_v5/j9n.dat')
     66      open(420,file=trim(datadir)//'/EUVDAT//param_v5/j10_an.dat')
     67      open(430,file=trim(datadir)//'/EUVDAT//param_v5/j10_bn.dat')
     68      open(440,file=trim(datadir)//'/EUVDAT//param_v5/j10_cn.dat')
     69      open(450,file=trim(datadir)//'/EUVDAT//param_v5/j11_an.dat')
     70      open(460,file=trim(datadir)//'/EUVDAT//param_v5/j11_bn.dat')
     71      open(470,file=trim(datadir)//'/EUVDAT//param_v5/j11_cn.dat')
     72      open(480,file=trim(datadir)//'/EUVDAT//param_v5/j12n.dat')
     73      open(490,file=trim(datadir)//'/EUVDAT//param_v5/j13_an.dat')
     74      open(500,file=trim(datadir)//'/EUVDAT//param_v5/j13_bn.dat')
     75      open(510,file=trim(datadir)//'/EUVDAT//param_v5/j13_cn.dat')
    7876
    7977     
     
    228226
    229227      !Parameters for the variation of the solar flux with 11 years cycle
    230       open(100,file=trim(datafile)//'/EUVDAT/param_v5/varflujo.dat')
     228      open(100,file=trim(datadir)//'/EUVDAT/param_v5/varflujo.dat')
    231229      read(100,*)
    232230      do i=1,24
     
    266264c     CO2, O2, NO
    267265
    268       open(120,file=trim(datafile)//'/EUVDAT/param_v5/efdis_inter.dat')
     266      open(120,file=trim(datadir)//'/EUVDAT/param_v5/efdis_inter.dat')
    269267      read(120,*)
    270268!      do i=1,21
  • trunk/LMDZ.MARS/libf/aeronomars/param_read_e107.F

    r1888 r1918  
    1616     .    fluxtop,ct1,ct2,p1,p2
    1717
     18      use datafile_mod, only: datadir
     19
    1820      implicit none
    1921
    2022
    2123c     common variables and constants
    22       include 'datafile.h'
    2324      include "callkeys.h"
    2425 
     
    3940      !Tabulated column amount
    4041      open(210, status = 'old',
    41 c    $file=trim(datafile)//'/EUVDAT/coln.dat',iostat=ierr)
    42      $file=trim(datafile)//'/EUVDAT/param_v6/coln.dat',iostat=ierr)
     42c    $file=trim(datadir)//'/EUVDAT/coln.dat',iostat=ierr)
     43     $file=trim(datadir)//'/EUVDAT/param_v6/coln.dat',iostat=ierr)
    4344
    4445      IF (ierr.NE.0) THEN
    4546       write(*,*)'cant find directory EUVDAT containing param_v6 subdir'
    4647       write(*,*)'(in aeronomars/param_read.F)'
    47        write(*,*)'It should be in :', trim(datafile),'/'
     48       write(*,*)'It should be in :', trim(datadir),'/'
    4849       write(*,*)'1) You can change this directory address in '
    4950       write(*,*)'   callphys.def with datadir=/path/to/dir'
     
    5556 
    5657      !Tabulated photoabsorption coefficients
    57       open(220,file=trim(datafile)//'/EUVDAT/param_v6/trans2_an.dat')
    58       open(230,file=trim(datafile)//'/EUVDAT/param_v6/trans3_an.dat')
    59       open(240,file=trim(datafile)//'/EUVDAT/param_v6/trans1_an.dat')
    60       open(250,file=trim(datafile)//'/EUVDAT/param_v6/trans2_bn.dat')
    61       open(260,file=trim(datafile)//'/EUVDAT/param_v6/trans2_cn.dat')
    62       open(300,file=trim(datafile)//'/EUVDAT/param_v6/trans2_dn.dat')
    63       open(270,file=trim(datafile)//'/EUVDAT/param_v6/trans1_bn.dat')
    64       open(280,file=trim(datafile)//'/EUVDAT/param_v6/trans1_cn.dat')
    65       open(290,file=trim(datafile)//'/EUVDAT/param_v6/trans1_dn.dat')
    66       open(150,file=trim(datafile)//'/EUVDAT/param_v6/trans4n.dat')
    67       open(160,file=trim(datafile)//'/EUVDAT/param_v6/trans5n.dat')
    68       open(170,file=trim(datafile)//'/EUVDAT/param_v6/trans6n.dat')
    69       open(180,file=trim(datafile)//'/EUVDAT/param_v6/trans7n.dat')
    70       open(390,file=trim(datafile)//'/EUVDAT/param_v6/trans8_an.dat')
    71       open(400,file=trim(datafile)//'/EUVDAT/param_v6/trans8_bn.dat')
    72       open(410,file=trim(datafile)//'/EUVDAT/param_v6/trans9n.dat')
    73       open(420,file=trim(datafile)//'/EUVDAT/param_v6/trans10_an.dat')
    74       open(430,file=trim(datafile)//'/EUVDAT/param_v6/trans10_bn.dat')
    75       open(440,file=trim(datafile)//'/EUVDAT/param_v6/trans10_cn.dat')
    76       open(450,file=trim(datafile)//'/EUVDAT/param_v6/trans11_an.dat')
    77       open(460,file=trim(datafile)//'/EUVDAT/param_v6/trans11_bn.dat')
    78       open(470,file=trim(datafile)//'/EUVDAT/param_v6/trans11_cn.dat')
    79       open(480,file=trim(datafile)//'/EUVDAT/param_v6/trans12n.dat')
    80       open(490,file=trim(datafile)//'/EUVDAT/param_v6/trans13_an.dat')
    81       open(500,file=trim(datafile)//'/EUVDAT/param_v6/trans13_bn.dat')
    82       open(510,file=trim(datafile)//'/EUVDAT/param_v6/trans13_cn.dat')
     58      open(220,file=trim(datadir)//'/EUVDAT/param_v6/trans2_an.dat')
     59      open(230,file=trim(datadir)//'/EUVDAT/param_v6/trans3_an.dat')
     60      open(240,file=trim(datadir)//'/EUVDAT/param_v6/trans1_an.dat')
     61      open(250,file=trim(datadir)//'/EUVDAT/param_v6/trans2_bn.dat')
     62      open(260,file=trim(datadir)//'/EUVDAT/param_v6/trans2_cn.dat')
     63      open(300,file=trim(datadir)//'/EUVDAT/param_v6/trans2_dn.dat')
     64      open(270,file=trim(datadir)//'/EUVDAT/param_v6/trans1_bn.dat')
     65      open(280,file=trim(datadir)//'/EUVDAT/param_v6/trans1_cn.dat')
     66      open(290,file=trim(datadir)//'/EUVDAT/param_v6/trans1_dn.dat')
     67      open(150,file=trim(datadir)//'/EUVDAT/param_v6/trans4n.dat')
     68      open(160,file=trim(datadir)//'/EUVDAT/param_v6/trans5n.dat')
     69      open(170,file=trim(datadir)//'/EUVDAT/param_v6/trans6n.dat')
     70      open(180,file=trim(datadir)//'/EUVDAT/param_v6/trans7n.dat')
     71      open(390,file=trim(datadir)//'/EUVDAT/param_v6/trans8_an.dat')
     72      open(400,file=trim(datadir)//'/EUVDAT/param_v6/trans8_bn.dat')
     73      open(410,file=trim(datadir)//'/EUVDAT/param_v6/trans9n.dat')
     74      open(420,file=trim(datadir)//'/EUVDAT/param_v6/trans10_an.dat')
     75      open(430,file=trim(datadir)//'/EUVDAT/param_v6/trans10_bn.dat')
     76      open(440,file=trim(datadir)//'/EUVDAT/param_v6/trans10_cn.dat')
     77      open(450,file=trim(datadir)//'/EUVDAT/param_v6/trans11_an.dat')
     78      open(460,file=trim(datadir)//'/EUVDAT/param_v6/trans11_bn.dat')
     79      open(470,file=trim(datadir)//'/EUVDAT/param_v6/trans11_cn.dat')
     80      open(480,file=trim(datadir)//'/EUVDAT/param_v6/trans12n.dat')
     81      open(490,file=trim(datadir)//'/EUVDAT/param_v6/trans13_an.dat')
     82      open(500,file=trim(datadir)//'/EUVDAT/param_v6/trans13_bn.dat')
     83      open(510,file=trim(datadir)//'/EUVDAT/param_v6/trans13_cn.dat')
    8384
    8485     
     
    233234
    234235      !Parameters for the variation of the solar flux with 11 years cycle
    235       open(620,file=trim(datafile)//'/EUVDAT/param_v6/fit_js_e107.dat')
     236      open(620,file=trim(datadir)//'/EUVDAT/param_v6/fit_js_e107.dat')
    236237      do i=1,ninter
    237238         read(620,*)
     
    274275      endif
    275276     
    276       open(640,file=trim(datafile)//'/EUVDAT/param_v6/'//filename)
     277      open(640,file=trim(datadir)//'/EUVDAT/param_v6/'//filename)
    277278      read(640,*)
    278279      do i=1,669
     
    316317c     CO2, O2, NO
    317318
    318 !      open(120,file=trim(datafile)//'/EUVDAT/param_v5/efdis_inter.dat')
     319!      open(120,file=trim(datadir)//'/EUVDAT/param_v5/efdis_inter.dat')
    319320!      read(120,*)
    320321!!      do i=1,21
     
    375376         
    376377      !4 possible channels for CO2 ionization
    377       open(130,file=trim(datafile)//'/EUVDAT'//
     378      open(130,file=trim(datadir)//'/EUVDAT'//
    378379     $     '/co2ion_branchingratio_schunkandnagy2000_param.dat')
    379380      do inter=1,16
     
    408409
    409410      !2 possible channels for O2 ionization
    410       open(131,file=trim(datafile)//'/EUVDAT'//
     411      open(131,file=trim(datadir)//'/EUVDAT'//
    411412     $     '/o2ion_branchingratio_schunkandnagy2000_param.dat')
    412413      do inter=1,23
     
    430431
    431432      !2 channels for N2 ionization
    432       open(132,file=trim(datafile)//'/EUVDAT'//
     433      open(132,file=trim(datadir)//'/EUVDAT'//
    433434     $     '/n2ion_branchingratio_schunkandnagy2000_param.dat')
    434435      do inter=1,15
     
    453454     
    454455      !3 channels for CO ionization
    455        open(133,file=trim(datafile)//'/EUVDAT'//
     456       open(133,file=trim(datadir)//'/EUVDAT'//
    456457     $     '/coion_branchingratio_schunkandnagy2000_param.dat')
    457458      do inter=1,16
  • trunk/LMDZ.MARS/libf/aeronomars/read_phototable.F90

    r1430 r1918  
    2121!***********************************************************************
    2222
    23       use ioipsl_getincom
     23      use ioipsl_getincom, only: getin
     24      use datafile_mod, only: datadir
    2425
    2526      implicit none
    2627
    27 #include "chimiedata.h"
    28 #include "datafile.h"
     28      include "chimiedata.h"
    2929
    3030!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
    5050
    5151      open(fic, form = 'formatted', status = 'old',                &
    52            file =trim(datafile)//"/"//trim(phototable),iostat=ierr)
     52           file =trim(datadir)//"/"//trim(phototable),iostat=ierr)
    5353
    5454      if (ierr /= 0) THEN
    5555        write(*,*)'Error : cannot open photolysis lookup table ', trim(phototable)
    56         write(*,*)'It should be in :',trim(datafile),'/'
     56        write(*,*)'It should be in :',trim(datadir),'/'
    5757        write(*,*)'1) You can change this directory in callphys.def'
    5858        write(*,*)'   with:'
  • trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/datareadnc.F

    r1422 r1918  
    4545       use ioipsl_getincom
    4646      USE comconst_mod, ONLY: g,pi
     47      use datafile_mod, only: datadir
    4748
    4849      implicit none
    4950
    50 #include "dimensions.h"
    51 #include "paramet.h"
    52 #include "comgeom.h"
    53 #include "netcdf.inc"
    54 #include "datafile.h"
     51      include "dimensions.h"
     52      include "paramet.h"
     53      include "comgeom.h"
     54      include "netcdf.inc"
    5555
    5656c=======================================================================
     
    113113      write(*,*) 'datareadnc: opening file surface.nc'
    114114
    115       datafile="/u/lmdz/WWW/planets/mars/datadir" ! default path to surface.nc
    116       call getin("datadir",datafile) ! but users may specify another path
     115      datadir="/u/lmdz/WWW/planets/mars/datadir" ! default path to surface.nc
     116      call getin("datadir",datadir) ! but users may specify another path
    117117     
    118       ierr = NF_OPEN (trim(datafile)//'/surface.nc',
     118      ierr = NF_OPEN (trim(datadir)//'/surface.nc',
    119119     &  NF_NOWRITE,unit)
    120120      IF (ierr.NE.NF_NOERR) THEN
    121121        write(*,*)'Error : cannot open file surface.nc '
    122122        write(*,*)'(in phymars/datareadnc.F)'
    123         write(*,*)'It should be in :',trim(datafile),'/'
     123        write(*,*)'It should be in :',trim(datadir),'/'
    124124        write(*,*)'1) You can set this path in the
    125125     & callphys.def file:'
     
    210210      if (ierr.ne.nf_noerr) then
    211211        write(*,*) 'datareadnc error, cannot find ',trim(string(k))
    212         write(*,*) ' in file ',trim(datafile),'/surface.nc'
     212        write(*,*) ' in file ',trim(datadir),'/surface.nc'
    213213        stop
    214214      endif
  • trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/newstart.F

    r1711 r1918  
    5151#include "clesph0.h"
    5252#include "netcdf.inc"
    53 #include "datafile.h"
    5453c=======================================================================
    5554c   Declarations
     
    16801679!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    16811680      subroutine load_MONS_data(MONS_Hdn,MONS_d21)
     1681     
     1682      use datafile_mod, only:datadir
     1683     
    16821684      implicit none
    16831685      ! routine to load Benedicte Diez MONS dataset, fill in date in southern
    16841686      ! polar region, and interpolate the result onto the GCM grid
    1685 #include"dimensions.h"
    1686 #include"paramet.h"
    1687 #include"datafile.h"
    1688 #include"comgeom.h"
     1687      include"dimensions.h"
     1688      include"paramet.h"
     1689      include"comgeom.h"
    16891690      ! arguments:
    16901691      real,intent(out) :: MONS_Hdn(iip1,jjp1) ! Hdn: %WEH=Mass fraction of H2O
     
    17151716
    17161717      ! Open MONS datafile:
    1717       open(42,file=trim(datafile)//"/"//trim(filename),
     1718      open(42,file=trim(datadir)//"/"//trim(filename),
    17181719     &     status="old",iostat=ierr)
    17191720      if (ierr/=0) then
    17201721        write(*,*) "Error in load_MONS_data:"
    17211722        write(*,*) "Failed opening file ",
    1722      &             trim(datafile)//"/"//trim(filename)
    1723         write(*,*)'1) You can change the path to the file in '
    1724         write(*,*)'   file phymars/datafile.h'
     1723     &             trim(datadir)//"/"//trim(filename)
     1724        write(*,*)'1) You can change this directory address in ',
     1725     &            'callfis.def with'
     1726        write(*,*)'   datadir=/path/to/datafiles'
    17251727        write(*,*)'2) If necessary ',trim(filename),
    17261728     &                 ' (and other datafiles)'
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/datareadnc.F

    r1422 r1918  
    4242c=======================================================================
    4343
    44 ! to use  'getin'
    45        use ioipsl_getincom
     44      use ioipsl_getincom, only: getin
    4645      USE comconst_mod, ONLY: g,pi
     46      use datafile_mod, only: datadir
    4747
    4848      implicit none
    4949
    50 #include "dimensions.h"
    51 #include "paramet.h"
    52 #include "comgeom.h"
    53 #include "netcdf.inc"
    54 #include "datafile.h"
     50      include "dimensions.h"
     51      include "paramet.h"
     52      include "comgeom.h"
     53      include "netcdf.inc"
    5554
    5655c=======================================================================
     
    113112      write(*,*) 'datareadnc: opening file surface.nc'
    114113
    115       datafile="/u/lmdz/WWW/planets/mars/datadir" ! default path to surface.nc
    116       call getin("datadir",datafile) ! but users may specify another path
     114      datadir="/u/lmdz/WWW/planets/mars/datadir" ! default path to surface.nc
     115      call getin("datadir",datadir) ! but users may specify another path
    117116     
    118       ierr = NF_OPEN (trim(datafile)//'/surface.nc',
     117      ierr = NF_OPEN (trim(datadir)//'/surface.nc',
    119118     &  NF_NOWRITE,unit)
    120119      IF (ierr.NE.NF_NOERR) THEN
    121120        write(*,*)'Error : cannot open file surface.nc '
    122121        write(*,*)'(in phymars/datareadnc.F)'
    123         write(*,*)'It should be in :',trim(datafile),'/'
     122        write(*,*)'It should be in :',trim(datadir),'/'
    124123        write(*,*)'1) You can set this path in the
    125124     & callphys.def file:'
     
    210209      if (ierr.ne.nf_noerr) then
    211210        write(*,*) 'datareadnc error, cannot find ',trim(string(k))
    212         write(*,*) ' in file ',trim(datafile),'/surface.nc'
     211        write(*,*) ' in file ',trim(datadir),'/surface.nc'
    213212        stop
    214213      endif
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r1711 r1918  
    5353      include "clesph0.h"
    5454      include "netcdf.inc"
    55       include "datafile.h"
    5655c=======================================================================
    5756c   Declarations
     
    16621661!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    16631662      subroutine load_MONS_data(MONS_Hdn,MONS_d21)
     1663     
     1664      use datafile_mod, only:datadir
     1665     
    16641666      implicit none
    16651667      ! routine to load Benedicte Diez MONS dataset, fill in date in southern
    16661668      ! polar region, and interpolate the result onto the GCM grid
    1667 #include"dimensions.h"
    1668 #include"paramet.h"
    1669 #include"datafile.h"
    1670 #include"comgeom.h"
     1669      include"dimensions.h"
     1670      include"paramet.h"
     1671      include"comgeom.h"
    16711672      ! arguments:
    16721673      real,intent(out) :: MONS_Hdn(iip1,jjp1) ! Hdn: %WEH=Mass fraction of H2O
     
    16971698
    16981699      ! Open MONS datafile:
    1699       open(42,file=trim(datafile)//"/"//trim(filename),
     1700      open(42,file=trim(datadir)//"/"//trim(filename),
    17001701     &     status="old",iostat=ierr)
    17011702      if (ierr/=0) then
    17021703        write(*,*) "Error in load_MONS_data:"
    17031704        write(*,*) "Failed opening file ",
    1704      &             trim(datafile)//"/"//trim(filename)
    1705         write(*,*)'1) You can change the path to the file in '
    1706         write(*,*)'   file phymars/datafile.h'
     1705     &             trim(datadir)//"/"//trim(filename)
     1706        write(*,*)'1) You can change this directory address in ',
     1707     &            'callfis.def with'
     1708        write(*,*)'   datadir=/path/to/datafiles'
    17071709        write(*,*)'2) If necessary ',trim(filename),
    17081710     &                 ' (and other datafiles)'
  • trunk/LMDZ.MARS/libf/phymars/albedocaps.F90

    r1779 r1918  
    9090use geometry_mod, only: latitude, longitude ! in radians
    9191use surfdat_h, only: albedice, TESice_Ncoef, TESice_Scoef
     92use datafile_mod, only: datadir
    9293use netcdf, only: nf90_open, NF90_NOWRITE, NF90_NOERR, &
    9394                  nf90_strerror, nf90_inq_varid, nf90_get_var, nf90_close
    9495                 
    9596implicit none
    96 include"datafile.h"
    9797
    9898! arguments:
     
    151151if (firstcall) then
    152152! Load TES albedoes for Northern Hemisphere
    153   ! Note: datafile() is defined in "datafile.h"
    154   ierr=nf90_open(trim(datafile)//"/npsc_albedo.nc",NF90_NOWRITE,nid)
     153  ierr=nf90_open(trim(datadir)//"/npsc_albedo.nc",NF90_NOWRITE,nid)
    155154  IF (ierr.NE.NF90_NOERR) THEN
    156155    write(*,*)'Problem opening npsc_albedo.nc (phymars/albedocaps.F90)'
    157     write(*,*)'It should be in :',trim(datafile),'/'
     156    write(*,*)'It should be in :',trim(datadir),'/'
    158157    write(*,*)'1) You can change this directory address in callfis.def with'
    159158    write(*,*)'   datadir=/path/to/datafiles'
     
    163162    CALL ABORT
    164163  ELSE
    165     write(*,*) "albedocaps: using file ",trim(datafile)//"/npsc_albedo.nc"
     164    write(*,*) "albedocaps: using file ",trim(datadir)//"/npsc_albedo.nc"
    166165  ENDIF
    167166 
     
    225224
    226225! Load albedoes for Southern Hemisphere
    227   ierr=nf90_open(trim(datafile)//"/spsc_albedo.nc",NF90_NOWRITE,nid)
     226  ierr=nf90_open(trim(datadir)//"/spsc_albedo.nc",NF90_NOWRITE,nid)
    228227  IF (ierr.NE.NF90_NOERR) THEN
    229228    write(*,*)'Problem opening spsc_albedo.nc (phymars/albedocaps.F90)'
    230     write(*,*)'It should be in :',trim(datafile),'/'
     229    write(*,*)'It should be in :',trim(datadir),'/'
    231230    write(*,*)'1) You can change this directory address in callfis.def with'
    232231    write(*,*)'   datadir=/path/to/datafiles'
     
    236235    CALL ABORT
    237236  ELSE
    238     write(*,*) "albedocaps: using file ",trim(datafile)//"/spsc_albedo.nc"
     237    write(*,*) "albedocaps: using file ",trim(datadir)//"/spsc_albedo.nc"
    239238  ENDIF
    240239
  • trunk/LMDZ.MARS/libf/phymars/callradite_mod.F

    r1776 r1918  
    1111     &     nuice,co2ice,clearsky,totcloudfrac)
    1212
    13       use aeropacity_mod
     13      use aeropacity_mod, only: aeropacity
    1414      use dimradmars_mod, only: ndomainsz, nflev, nsun, nir
    1515      use dimradmars_mod, only: naerkind, name_iaer,
     
    5959c   The names of the corresponding ASCII files have to be set in
    6060c   this subroutine (file_id variable), and files must be in the
    61 c   directory specified in datafile.h. Please make sure that the
     61c   directory specified in datafile_mod. Please make sure that the
    6262c   ASCII files are correctly written, and that the range
    6363c   of particle sizes is consistent with what you would expect.
  • trunk/LMDZ.MARS/libf/phymars/co2cloud.F

    r1913 r1918  
    1919     &     rho_ice_co2,r3n_q,rho_ice,nuice_sed
    2020      USE newsedim_mod, ONLY: newsedim
     21      USE datafile_mod, ONLY: datadir
    2122      IMPLICIT NONE
    2223
    23       include "datafile.h"
    2424      include "callkeys.h"
    2525      include "microphys.h"
     
    248248
    249249c   read the Qext values
    250         INQUIRE(FILE=datafile(1:LEN_TRIM(datafile))//
     250        INQUIRE(FILE=TRIM(datadir)//
    251251     &       '/optprop_co2ice_1mic.dat', EXIST=file_ok)
    252252        IF (.not. file_ok) THEN
    253253           write(*,*) 'file optprop_co2ice_1mic.dat should be in '
    254      &          ,datafile
     254     &          ,trim(datadir)
    255255           STOP
    256256        endif
    257 !        open(newunit=uQext,file=trim(datafile)//
    258         open(unit=uQext,file=trim(datafile)//
     257!        open(newunit=uQext,file=trim(datadir)//
     258        open(unit=uQext,file=trim(datadir)//
    259259     &       '/optprop_co2ice_1mic.dat'
    260260     &       ,FORM='formatted')
  • trunk/LMDZ.MARS/libf/phymars/conf_phys.F

    r1818 r1918  
    4141      use time_phylmdz_mod, only: ecritphy,day_step,iphysiq,ecritstart,
    4242     &                            daysec,dtphys
    43       use planete_h
    4443      use dimradmars_mod, only: naerkind, name_iaer,
    4544     &                      ini_scatterers,tauvis
     45      use datafile_mod, only: datadir
    4646
    4747      IMPLICIT NONE
    48 #include "callkeys.h"
    49 #include "datafile.h"
    50 #include "microphys.h"
     48      include "callkeys.h"
     49      include "microphys.h"
    5150
    5251      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
     
    8584
    8685         write(*,*) "Directory where external input files are:"
    87          datafile="/u/lmdz/WWW/planets/mars/datadir"
    88          call getin("datadir",datafile) ! default path
    89          write(*,*) " datafile = ",trim(datafile)
     86         ! default path is set in datafile_mod
     87         call getin("datadir",datadir)
     88         write(*,*) " datadir = ",trim(datadir)
    9089
    9190         write(*,*) "Run with or without tracer transport ?"
  • trunk/LMDZ.MARS/libf/phymars/datafile_mod.F90

    r1916 r1918  
    11!-----------------------------------------------------------------------
    2 ! INCLUDE datafile.h
     2module datafile_mod
    33
    4 !  Address of the directory containing tables of data needed by the GCM   
    5       COMMON/datadirectory/datafile
    6       character (len=300) :: datafile
    7 ! NB: default value for 'datafile' is set in conf_phys.F
     4implicit none
     5
     6! root path to directory containing tables
     7! and datasets needed by the GCM
     8character(len=300),save :: datadir="/u/lmdz/WWW/planets/mars/datadir"
     9
     10end module datafile_mod
    811!-----------------------------------------------------------------------
  • trunk/LMDZ.MARS/libf/phymars/improvedCO2clouds.F

    r1913 r1918  
    1313     &                      rho_ice_co2
    1414      use conc_mod, only: mmean
     15      use datafile_mod, only: datadir
    1516
    1617      implicit none
     
    5556      include "callkeys.h"
    5657      include "microphys.h"
    57       include "datafile.h"
    5858c------------------------------------------------------------------
    5959c     Arguments:
     
    247247           ! Initialisation of the flux: it is constant and is it saved
    248248           !We must interpolate the table to the GCM pressures
    249            INQUIRE(FILE=datafile(1:LEN_TRIM(datafile))//
     249           INQUIRE(FILE=TRIM(datadir)//
    250250     &       '/Meteo_flux_Plane.dat', EXIST=file_ok)
    251251           IF (.not. file_ok) THEN
    252252              write(*,*) 'file Meteo_flux_Plane.dat should be in '
    253      &             ,datafile
     253     &             ,trim(datadir)
    254254              STOP
    255255           endif
    256256!used Variables
    257 !           open(newunit=uMeteor,file=trim(datafile)//
    258            open(unit=uMeteor,file=trim(datafile)//
     257!           open(newunit=uMeteor,file=trim(datadir)//
     258           open(unit=uMeteor,file=trim(datadir)//
    259259     &          '/Meteo_flux_Plane.dat'
    260260     &          ,FORM='formatted')
  • trunk/LMDZ.MARS/libf/phymars/nir_leedat.F

    r498 r1918  
    77c***********************************************************************
    88
     9      use datafile_mod, only: datadir
     10
    911      implicit none                                 
    1012                                               
    11       include 'datafile.h'
    1213      include 'nirdata.h'
    1314                                               
     
    2021c***********************************************************************
    2122
    22       open(43,file=trim(datafile)//'/NIRcorrection_feb2011.dat',
     23      open(43,file=trim(datadir)//'/NIRcorrection_feb2011.dat',
    2324     $       status='old')         
    2425      do ind=1,9
  • trunk/LMDZ.MARS/libf/phymars/nlte_calc.F

    r1124 r1918  
    3131      implicit none
    3232
    33       include 'datafile.h'
    3433      include 'nlte_paramdef.h'
    3534      include 'nlte_commons.h'
     
    228227      implicit none
    229228
    230       include 'datafile.h'
    231229      include 'nlte_paramdef.h'
    232230      include 'nlte_commons.h'
     
    793791      implicit none
    794792
    795       include 'datafile.h'
    796793      include 'nlte_paramdef.h'
    797794      include 'nlte_commons.h'
     
    13181315      implicit none
    13191316
    1320       include 'datafile.h'
    13211317      include 'nlte_paramdef.h'
    13221318      include 'nlte_commons.h'
     
    15851581      implicit none
    15861582
    1587       include 'datafile.h'
    15881583      include 'nlte_paramdef.h'
    15891584      include 'nlte_commons.h'
  • trunk/LMDZ.MARS/libf/phymars/nlte_setup.F

    r757 r1918  
    1717c***********************************************************************
    1818
     19      use datafile_mod, only: datadir
     20     
    1921      implicit none
    2022
    21       include   'datafile.h'
    2223      include   'nlte_paramdef.h'
    2324      include   'nlte_commons.h'
     
    4950         write (isotcode,132) indexisot(k)
    5051         open (lun1,
    51      $        file=trim(datafile)//'/NLTEDAT/enelow'
     52     $        file=trim(datadir)//'/NLTEDAT/enelow'
    5253     $        //isotcode//'.dat',status='old')
    5354         open (lun2,
    54      $        file=trim(datafile)//'/NLTEDAT/deltanu'
     55     $        file=trim(datadir)//'/NLTEDAT/deltanu'
    5556     $        //isotcode//'.dat',status='old')
    5657         read (lun1,*)
     
    7172c     *** Old LeeESCTVCISO_dlvr11 ***
    7273
    73       open( 11, file=trim(datafile)//
     74      open( 11, file=trim(datadir)//
    7475     $     '/NLTEDAT/parametp_Tstar_IAA1204.dat' )
    7576      read (11, *)
     
    8081      close (11)
    8182
    82       open( 12, file=trim(datafile)//
     83      open( 12, file=trim(datadir)//
    8384     $     '/NLTEDAT/parametp_VC_IAA1204.dat' )
    8485      read (12, *)
     
    104105c***********************************************************************
    105106
     107      use datafile_mod, only: datadir
     108
    106109      implicit none
    107110
    108       include 'datafile.h'
    109111      include   'nlte_paramdef.h'
    110112      include   'nlte_commons.h'
     
    119121                                ! Banda fundamental
    120122                                !
    121       hisfile = trim(datafile)//
     123      hisfile = trim(datadir)//
    122124     $     '/NLTEDAT/hid26-1.dat'
    123125      ihist = 1
     
    127129                                ! First Hot bands       
    128130                                !     
    129       hisfile = trim(datafile)//
     131      hisfile = trim(datadir)//
    130132     $     '/NLTEDAT/hid26-2.dat'
    131133      ihist = 2
    132134      call rhist_03 (ihist)
    133135
    134       hisfile = trim(datafile)//
     136      hisfile = trim(datadir)//
    135137     $     '/NLTEDAT/hid26-3.dat'
    136138      ihist = 3
    137139      call rhist_03 (ihist)
    138140
    139       hisfile = trim(datafile)//
     141      hisfile = trim(datadir)//
    140142     $     '/NLTEDAT/hid26-4.dat'
    141143      ihist = 4
  • trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90

    r1861 r1918  
    55use netcdf
    66use geometry_mod, only: latitude, longitude ! in radians
     7use datafile_mod, only: datadir
    78implicit none
    89
    9 include "datafile.h"
    1010include "callkeys.h"
    1111
     
    9292   endif
    9393   
    94    ! Note: datafile() is defined in "datafile.h"
    95    !ierr=NF_OPEN(trim(datafile)//"/"//trim(filename),NF_NOWRITE,nid)
    96    ierr=nf90_open(trim(datafile)//"/"//trim(filename),NF90_NOWRITE,nid)
     94   ierr=nf90_open(trim(datadir)//"/"//trim(filename),NF90_NOWRITE,nid)
    9795   IF (ierr.NE.nf90_noerr) THEN
    9896     write(*,*)'Problem opening ',trim(filename),' (in phymars/read_dust_scenario.F90)'
    99      write(*,*)'It should be in :',trim(datafile),'/'
     97     write(*,*)'It should be in :',trim(datadir),'/'
    10098     write(*,*)'1) You can change this directory address in callfis.def with'
    10199     write(*,*)'   datadir=/path/to/datafiles'
  • trunk/LMDZ.MARS/libf/phymars/suaer.F90

    r1381 r1918  
    1111                    omegaREFvis, omegaREFir, &
    1212                    nsize
     13use datafile_mod, only: datadir
    1314IMPLICIT NONE
    1415!==================================================================
     
    4344! Includes:
    4445
    45 #include "callkeys.h"
    46 #include "datafile.h"
     46include "callkeys.h"
    4747
    4848! Optical properties (read in external ASCII files)
     
    188188!       1.1 Open the ASCII file
    189189
    190 INQUIRE(FILE=datafile(1:LEN_TRIM(datafile))//&
    191   '/'//file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&
     190INQUIRE(FILE=TRIM(datadir)//&
     191  '/'//TRIM(file_id(iaer,idomain)),&
    192192  EXIST=file_ok)
    193193IF(.NOT.file_ok) THEN
    194194  write(*,*)'Problem opening ',&
    195     file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain)))
     195    TRIM(file_id(iaer,idomain))
    196196  write(*,*)'It should be in: ',&
    197     datafile(1:LEN_TRIM(datafile))
    198   write(*,*)'1) You can change this directory address in '
    199   write(*,*)' file phymars/datafile.h'
     197    TRIM(datadir)
     198  write(*,*)'1) You can change this directory address in callfis.def with'
     199  write(*,*)'   datadir=/path/to/datafiles'
    200200  write(*,*)'2) If ',&
    201     file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&
     201    TRIM(file_id(iaer,idomain)),&
    202202    ' is a LMD reference datafile, it'
    203203  write(*,*)' can be obtained online on:'
     
    210210ENDIF
    211211OPEN(UNIT=file_unit,&
    212   FILE=datafile(1:LEN_TRIM(datafile))//&
    213   '/'//file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&
     212  FILE=TRIM(datadir)//&
     213  '/'//TRIM(file_id(iaer,idomain)),&
    214214  FORM='formatted')
    215215
     
    222222  if (read_ok.ne.0) then
    223223    write(*,*)' readoptprop: Error reading file',&
    224     trim(datafile(1:LEN_TRIM(datafile))//&
    225     '/'//file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))))
     224    TRIM(datadir)//&
     225    '/'//TRIM(file_id(iaer,idomain))
    226226    call abort
    227227  endif
     
    236236          trim(scanline)
    237237          write(*,*)'   of file',&
    238           trim(datafile(1:LEN_TRIM(datafile))//&
    239           '/'//file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))))
     238          TRIM(datadir)//&
     239          '/'//TRIM(file_id(iaer,idomain))
    240240          call abort
    241241        endif
     
    247247          trim(scanline)
    248248          write(*,*)'   of file',&
    249           trim(datafile(1:LEN_TRIM(datafile))//&
    250           '/'//file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))))
     249          TRIM(datadir)//&
     250          '/'//TRIM(file_id(iaer,idomain))
    251251          call abort
    252252        endif
  • trunk/LMDZ.MARS/libf/phymars/surfini.F

    r1543 r1918  
    11      SUBROUTINE surfini(ngrid,piceco2,qsurf,psolaralb)
    2    ! to use  'getin'
    3       USE ioipsl_getincom
     2
     3      USE ioipsl_getincom, only: getin
    44      use netcdf
    55      use tracer_mod, only: nqmx, noms
     
    1414      USE comcstfi_h
    1515      use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat
     16      use datafile_mod, only: datadir
    1617      IMPLICIT NONE
    1718c=======================================================================
     
    2324c   Declarations:
    2425c   -------------
    25 #include "callkeys.h"
    26 #include "datafile.h"
     26      include "callkeys.h"
    2727
    2828      integer,intent(in) :: ngrid ! number of atmospheric columns
     
    173173
    174174           
    175          zedatafile = trim(datafile)
     175         zedatafile = trim(datadir)
    176176 
    177177       
Note: See TracChangeset for help on using the changeset viewer.