source: flex_extract.git/python/_config.py @ 2fb99de

ctbtodev
Last change on this file since 2fb99de was 2fb99de, checked in by Anne Philipp <anne.philipp@…>, 6 years ago

introduced config with path definitions and changed py files accordingly; Installation works; some tests were added for tarball making; Problems in submission to ecgate

  • Property mode set to 100644
File size: 3.3 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#*******************************************************************************
4# @Author: Anne Philipp (University of Vienna)
5#
6# @Date: August 2018
7#
8# @Change History:
9#
10# @License:
11#    (C) Copyright 2014-2018.
12#
13#    This software is licensed under the terms of the Apache Licence Version 2.0
14#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
15#
16# @Description:
17#    Contains constant value parameter for flex_extract.
18#
19#*******************************************************************************
20
21# ------------------------------------------------------------------------------
22# MODULES
23# ------------------------------------------------------------------------------
24import os
25import sys
26import inspect
27
28_VERSION_STR = '7.1'
29
30# ------------------------------------------------------------------------------
31# FILENAMES
32# ------------------------------------------------------------------------------
33
34FLEXEXTRACT_DIRNAME = 'flex_extract_v' + _VERSION_STR
35FILE_MARS_REQUESTS = 'mars_requests.dat'
36FORTRAN_EXECUTABLE = 'CONVERT2'
37FILE_USER_ENVVARS = 'ECMWF_ENV'
38TEMPFILE_INSTALL_COMPILEJOB = 'compilejob.temp'
39FILE_INSTALL_COMPILEJOB = 'compilejob.ksh'
40TEMPFILE_INSTALL_JOB = 'job.temp.o'
41TEMPFILE_JOB = 'job.temp'
42FILE_JOB_OD = 'job.ksh'
43FILE_JOB_OP = 'jopoper.ksh'
44FILE_NAMELIST = 'fort.4'
45FILE_GRIB_INDEX = 'date_time_stepRange.idx'
46
47# ------------------------------------------------------------------------------
48#  PATHES
49# ------------------------------------------------------------------------------
50
51# path to the flex_extract directory
52PATH_FLEXEXTRACT_DIR = os.path.normpath(os.path.dirname(os.path.abspath(
53    inspect.getfile(inspect.currentframe()))) + '/../')
54
55# path to the local python source files
56PATH_LOCAL_PYTHON = os.path.dirname(os.path.abspath(
57    inspect.getfile(inspect.currentframe())))
58PATH_RELATIVE_PYTHON = os.path.relpath(PATH_LOCAL_PYTHON, PATH_FLEXEXTRACT_DIR)
59# add path to pythonpath
60if PATH_LOCAL_PYTHON not in sys.path:
61    sys.path.append(PATH_LOCAL_PYTHON)
62
63# path to the templates
64PATH_TEMPLATES = os.path.join(PATH_FLEXEXTRACT_DIR, '_templates')
65PATH_RELATIVE_TEMPLATES = os.path.relpath(PATH_TEMPLATES, PATH_FLEXEXTRACT_DIR)
66
67# path to the environment parameter file
68PATH_ECMWF_ENV = os.path.join(PATH_LOCAL_PYTHON, FILE_USER_ENVVARS)
69PATH_RELATIVE_ECMWF_ENV = os.path.relpath(PATH_ECMWF_ENV, PATH_FLEXEXTRACT_DIR)
70
71# path to gribtable
72PATH_GRIBTABLE = os.path.join(PATH_TEMPLATES, 'ecmwf_grib1_table_128')
73
74# path to run directory
75PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'run')
76PATH_RELATIVE_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR)
77
78# path to directory where all control files are stored
79PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control')
80PATH_RELATIVE_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR)
81
82# path to directory where all job scripts are stored
83PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'jobscripts')
84PATH_RELATIVE_JOBSCRIPTS = os.path.relpath(PATH_JOBSCRIPTS, PATH_FLEXEXTRACT_DIR)
85
86# path to the fortran executable and the source code
87PATH_FORTRAN_SRC = os.path.join(PATH_FLEXEXTRACT_DIR, 'src')
88PATH_RELATIVE_FORTRAN_SRC = os.path.relpath(PATH_FORTRAN_SRC, PATH_FLEXEXTRACT_DIR)
89
90# path to the python testing directory
91PATH_TEST_DIR = os.path.join(PATH_LOCAL_PYTHON, 'pythontest')
92
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG