Changes in Source/Python/_config.py [0a75335:75db9b0] in flex_extract.git


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Source/Python/_config.py

    r0a75335 r75db9b0  
    99#      June 2020 - Anne Philipp
    1010#         - changed template filenames to .template
     11#      August 2020 - Leopold Haimberger
     12#         - added another target for installation
     13#         - added filename which will contain paths for system version     
     14#         - checks if software runs in normal local mode or system local mode
     15#           and defines paths to user directory and executable paths   
    1116#
    1217# @License:
     
    3843# ------------------------------------------------------------------------------
    3944
    40 _VERSION_STR = '7.1.2'
     45_VERSION_STR = '7.1.2_ctbto'
    4146
    4247FLAG_ON_ECMWFSERVER = 'ecgb' in platform.node()
     
    4449QUEUES_LIST = ['ecgate', 'cca', 'ccb']
    4550
    46 INSTALL_TARGETS = ['local', 'ecgate', 'cca', 'ccb']
     51INSTALL_TARGETS = ['local', 'syslocal', 'ecgate', 'cca', 'ccb']
    4752
    4853CDS_DATASET_ML = 'reanalysis-era5-complete'
     
    7075FILE_GRIB_INDEX = 'date_time_stepRange.idx'
    7176FILE_GRIBTABLE = 'ecmwf_grib1_table_128'
     77FILE_SYS_CONFIG = '.setup.rc'
    7278
    7379# ------------------------------------------------------------------------------
     
    7985
    8086# ------------------------------------------------------------------------------
    81 PATHES
     87LOAD ENVIRONMENT VARIABLES FOR SYS VERSION; IF NECESSARRY
    8288# ------------------------------------------------------------------------------
    8389
     
    8995if PATH_LOCAL_PYTHON not in sys.path:
    9096    sys.path.append(PATH_LOCAL_PYTHON)
     97
     98# ------------------------------------------------------------------------------
     99#  PATHES
     100# ------------------------------------------------------------------------------
     101
    91102PATH_FLEXEXTRACT_DIR = os.path.normpath(os.path.dirname(os.path.abspath(
    92103    inspect.getfile(inspect.currentframe()))) + '/../../')
     104if not os.path.isdir(os.path.join(PATH_FLEXEXTRACT_DIR,'Run')):
     105    # if it does not exist, we have a system installation in place
     106    # we need to have a sys and user path
     107    # configure correct system path
     108    PATH_SYSTEM_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, FLEXEXTRACT_DIRNAME)
     109    # configure correct user path
     110    PATH_FLEXEXTRACT_DIR = os.environ.get('FLEXEXTRACT_USER_DIR')
     111else:
     112    PATH_SYSTEM_DIR = PATH_FLEXEXTRACT_DIR
     113
    93114PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'Run')
    94 PATH_SOURCES = os.path.join(PATH_FLEXEXTRACT_DIR, 'Source')
     115PATH_SOURCES = os.path.join(PATH_SYSTEM_DIR, 'Source')
    95116PATH_TEMPLATES = os.path.join(PATH_FLEXEXTRACT_DIR, 'Templates')
    96117PATH_ECMWF_ENV = os.path.join(PATH_RUN_DIR, FILE_USER_ENVVARS)
    97118PATH_GRIBTABLE = os.path.join(PATH_TEMPLATES, FILE_GRIBTABLE)
    98119PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'Jobscripts')
    99 PATH_FORTRAN_SRC = os.path.join(PATH_SOURCES, 'Fortran')
     120if os.path.isdir(os.path.join(PATH_SYSTEM_DIR,'Fortran')):
     121    PATH_FORTRAN_SRC = PATH_SYSTEM_DIR
     122else:
     123    PATH_FORTRAN_SRC = os.path.join(PATH_SOURCES, 'Fortran')
    100124PATH_PYTHONTEST_SRC = os.path.join(PATH_SOURCES, 'Pythontest')
    101125PATH_INPUT_DIR = os.path.join(PATH_RUN_DIR, INPUT_DIRNAME_DEFAULT)
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG