Changeset 1470 for trunk/LMDZ.GENERIC


Ignore:
Timestamp:
Sep 16, 2015, 1:00:04 PM (9 years ago)
Author:
emillour
Message:

Generic GCM:

  • reorganizing the "datadir" structure: aerosol properties should now be in subdirectory 'aerosol_properties' of datadir, and surface.nc files should be in subdirectory 'surface_data'. These subdirectory names are stored in module datafile_mod.
  • Made things retro-compatible so that using an 'old' datadir structure (ie. aerosol properties files and surface files in datadir) still works.

EM

Location:
trunk/LMDZ.GENERIC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r1423 r1470  
    10751075- Return to a previous interpolation scheme for pmid and tmid in callcorrk.
    10761076
     1077== 16/09/2015 == EM
     1078- reorganizing the "datadir" structure: aerosol properties should now be in
     1079  subdirectory 'aerosol_properties' of datadir, and surface.nc files should
     1080  be in subdirectory 'surface_data'. These subdirectory names are stored in
     1081  module datafile_mod.
     1082- Made things retro-compatible so that using an 'old' datadir structure (ie.
     1083  aerosol properties files and surface files in datadir) still works.
     1084
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/datareadnc.F

    r1422 r1470  
    4242c=======================================================================
    4343
    44       use datafile_mod, only: datadir
     44      use datafile_mod, only: datadir, surfdir
    4545! to use  'getin'
    4646      USE ioipsl_getincom
     
    9494      CHARACTER*20 string
    9595      DIMENSION string(4)
    96 
    9796!#include "fxyprim.h"
    9897
     
    106105c    Lecture NetCDF des donnees latitude et longitude
    107106c-----------------------------------------------------------------------
    108       ierr = NF_OPEN (trim(datadir)//'/'//trim(adjustl(filename)),
    109      &  NF_NOWRITE,unit)
     107      ierr = NF_OPEN (trim(datadir)//'/'//trim(surfdir)//'/'//
     108     &                trim(adjustl(filename)),
     109     &                NF_NOWRITE,unit)
     110      IF (ierr.NE.NF_NOERR) THEN
     111        ! In ye old days this file was stored in datadir;
     112        ! let's be retro-compatible
     113        ierr = NF_OPEN (trim(datadir)//'/'//
     114     &                trim(adjustl(filename)),
     115     &                NF_NOWRITE,unit)
     116       
     117      ENDIF
    110118      IF (ierr.NE.NF_NOERR) THEN
    111119        write(*,*)'Error : cannot open file '//trim(filename)
    112120        write(*,*)'(in phystd/datareadnc.F)'
    113         write(*,*)'It should be in :',trim(datadir),'/'
     121        write(*,*)'It should be in :',trim(datadir),'/',trim(surfdir)
    114122        write(*,*)'Check that your path to datagcm:',trim(datadir)
    115123        write(*,*)' is correct. You can change it in callphys.def with:'
     
    117125        write(*,*)'If necessary surface.nc (and other datafiles)'
    118126        write(*,*)' can be obtained online on:'
    119         write(*,*)' http://www.lmd.jussieu.fr/~forget/datagcm/datafile'
     127        write(*,*)' http://www.lmd.jussieu.fr/~lmdz/planets/'//
     128     &             'LMDZ.GENERIC/datagcm/'
    120129        STOP
    121130      ENDIF
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/newstart.F

    r1422 r1470  
    2121     &                     zmea, zstd, zsig, zgam, zthe
    2222      USE comgeomfi_h, ONLY: lati, long, area
    23       use datafile_mod, only: datadir
     23      use datafile_mod, only: datadir, surfdir
    2424! to use  'getin'
    2525!      USE ioipsl_getincom, only: getin
     
    498498        call getin_p("datadir",datadir)
    499499        write(*,*) 'Available surface data files are:'
    500         filestring='ls '//trim(datadir)//' | grep .nc'
     500        filestring='ls '//trim(datadir)//'/'//
     501     &                    trim(surfdir)//' | grep .nc'
     502        call system(filestring)
     503        ! but in ye old days these files were in datadir, so scan it as well
     504        ! for the sake of retro-compatibility
     505        filestring='ls '//trim(datadir)//'/'//' | grep .nc'
    501506        call system(filestring)
    502507
  • trunk/LMDZ.GENERIC/libf/phystd/datafile_mod.F90

    r716 r1470  
    11!-----------------------------------------------------------------------
    22      module datafile_mod
    3 !  Address of the directory containing tables of data needed by the UCM
     3!  Address of the directory containing tables of data needed by the GCM
    44      implicit none
    55
     6      ! Main directory: 'datadir':
    67      ! Default for Berserker @ UChicago:
    78!      character(len=300) :: datadir='/home/rwordsworth/datagcm'
     
    910!      character(len=300) :: datadir='/san/home/rdword/gcm/datagcm'
    1011      ! Default for LMD machines:
    11       character(len=300) :: datadir='/u/rwlmd/datagcm'
     12      character(len=300) :: datadir='/u/lmdz/WWW/planets/LMDZ.GENERIC/datagcm'
     13     
     14      ! Subdirectories of 'datadir':
     15     
     16      ! surfdir stores planetary topography, albedo, etc. (surface.nc files)
     17      character(len=12),parameter :: surfdir="surface_data"
     18     
     19      ! aerdir stores aerosol properties files (optprop_*dat files)
     20      character(LEN=18),parameter :: aerdir="aerosol_properties"
    1221
    1322      end module datafile_mod
  • trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90

    r1397 r1470  
    44      use radinc_h,    only: L_NSPECTI,L_NSPECTV,nsizemax,iim,jjm,naerkind
    55      use radcommon_h, only: blamv,blami,lamrefir,lamrefvis
    6       use datafile_mod, only: datadir
     6      use datafile_mod, only: datadir, aerdir
    77
    88      ! outputs
     
    205205
    206206!$OMP MASTER
    207             INQUIRE(FILE=TRIM(datadir)//&
    208          '/'//TRIM(file_id(iaer,idomain)),&
    209             EXIST=file_ok)
     207            INQUIRE(FILE=TRIM(datadir)//'/'//TRIM(aerdir)//&
     208                    '/'//TRIM(file_id(iaer,idomain)),&
     209                    EXIST=file_ok)
     210            IF (file_ok) THEN
     211              OPEN(UNIT=file_unit,&
     212                   FILE=TRIM(datadir)//'/'//TRIM(aerdir)//&
     213                        '/'//TRIM(file_id(iaer,idomain)),&
     214                   FORM='formatted')
     215            ELSE
     216             ! In ye old days these files were stored in datadir;
     217             ! let's be retro-compatible
     218              INQUIRE(FILE=TRIM(datadir)//&
     219                      '/'//TRIM(file_id(iaer,idomain)),&
     220                      EXIST=file_ok)
     221              IF (file_ok) THEN
     222                OPEN(UNIT=file_unit,&
     223                     FILE=TRIM(datadir)//&
     224                          '/'//TRIM(file_id(iaer,idomain)),&
     225                     FORM='formatted')
     226              ENDIF             
     227            ENDIF
    210228            IF(.NOT.file_ok) THEN
    211229               write(*,*)'suaer_corrk: Problem opening ',&
    212230               TRIM(file_id(iaer,idomain))
    213                write(*,*)'It should be in: ',TRIM(datadir)
     231               write(*,*)'It should be in: ',TRIM(datadir)//'/'//TRIM(aerdir)
    214232               write(*,*)'1) You can set this directory address ',&
    215233               'in callphys.def with:'
     
    220238               write(*,*)' can be obtained online at:'
    221239               write(*,*)' http://www.lmd.jussieu.fr/',&
    222                '~forget/datagcm/datafile'
     240               '~lmdz/planets/LMDZ.GENERIC/datagcm/'
    223241               CALL ABORT
    224242            ENDIF
    225             OPEN(UNIT=file_unit,&
    226             FILE=TRIM(datadir)//&
    227          '/'//TRIM(file_id(iaer,idomain)),&
    228             FORM='formatted')
    229243
    230244!     1.2 Allocate the optical property table
Note: See TracChangeset for help on using the changeset viewer.