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

Legend:

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