source: flex_extract.git/source/python/_config.py @ 295ff45

dev
Last change on this file since 295ff45 was 295ff45, checked in by Anne Philipp <anne.philipp@…>, 9 months ago

added request output option also for basetime requests; changed output to csv format

  • Property mode set to 100644
File size: 3.9 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
34FILE_MARS_REQUESTS = 'mars_requests.csv'
35FORTRAN_EXECUTABLE = 'CONVERT2'
36FILE_USER_ENVVARS = 'ECMWF_ENV'
37TEMPFILE_INSTALL_COMPILEJOB = 'compilejob.temp'
38FILE_INSTALL_COMPILEJOB = 'compilejob.ksh'
39TEMPFILE_INSTALL_JOB = 'job.temp.o'
40TEMPFILE_JOB = 'job.temp'
41FILE_JOB_OD = 'job.ksh'
42FILE_JOB_OP = 'jopoper.ksh'
43FILE_NAMELIST = 'fort.4'
44FILE_GRIB_INDEX = 'date_time_stepRange.idx'
45FILE_GRIBTABLE = 'ecmwf_grib1_table_128'
46
47# ------------------------------------------------------------------------------
48# DIRECTORY NAMES
49# ------------------------------------------------------------------------------
50
51FLEXEXTRACT_DIRNAME = 'flex_extract_v' + _VERSION_STR
52INPUT_DIRNAME_DEFAULT = 'workspace'
53
54# ------------------------------------------------------------------------------
55#  PATHES
56# ------------------------------------------------------------------------------
57
58# path to the local python source files
59# first thing to get because the submitted python script starts in here
60PATH_LOCAL_PYTHON = os.path.dirname(os.path.abspath(
61    inspect.getfile(inspect.currentframe())))
62# add path to pythonpath
63if PATH_LOCAL_PYTHON not in sys.path:
64    sys.path.append(PATH_LOCAL_PYTHON)
65PATH_FLEXEXTRACT_DIR = os.path.normpath(os.path.dirname(os.path.abspath(
66    inspect.getfile(inspect.currentframe()))) + '/../../')
67PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'run')
68PATH_SOURCES = os.path.join(PATH_FLEXEXTRACT_DIR, 'source')
69PATH_TEMPLATES = os.path.join(PATH_FLEXEXTRACT_DIR, 'templates')
70PATH_ECMWF_ENV = os.path.join(PATH_RUN_DIR, FILE_USER_ENVVARS)
71PATH_GRIBTABLE = os.path.join(PATH_TEMPLATES, FILE_GRIBTABLE)
72PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'jobscripts')
73PATH_FORTRAN_SRC = os.path.join(PATH_SOURCES, 'fortran')
74PATH_TEST_DIR = os.path.join(PATH_SOURCES, 'pythontest')
75PATH_INPUT_DIR = os.path.join(PATH_RUN_DIR, INPUT_DIRNAME_DEFAULT)
76if os.getenv('CONTROL') and '/' in os.getenv('CONTROL'):
77    # this is only needed if remote version with job script is used!
78    # because job is directly submitted from SCRATCH and because the
79    # CONTROL file is stored there, the normal path is not valid.
80    PATH_CONTROLFILES = os.getenv('CONTROL')
81else:
82    PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control')
83#
84# ------------------------------------------------------------------------------
85# for making the installation tar ball, the relative pathes to the
86# flex_extract root directory are needed
87# ------------------------------------------------------------------------------
88
89PATH_REL_PYTHON = os.path.relpath(PATH_LOCAL_PYTHON, PATH_FLEXEXTRACT_DIR)
90PATH_REL_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR)
91PATH_REL_TEMPLATES = os.path.relpath(PATH_TEMPLATES, PATH_FLEXEXTRACT_DIR)
92PATH_REL_ECMWF_ENV = os.path.relpath(PATH_ECMWF_ENV, PATH_FLEXEXTRACT_DIR)
93PATH_REL_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR)
94PATH_REL_JOBSCRIPTS = os.path.relpath(PATH_JOBSCRIPTS, PATH_FLEXEXTRACT_DIR)
95PATH_REL_FORTRAN_SRC = os.path.relpath(PATH_FORTRAN_SRC, PATH_FLEXEXTRACT_DIR)
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG