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/dynlonlat_phylonlat/phymars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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)'
Note: See TracChangeset for help on using the changeset viewer.