Changeset 991df6a in flex_extract.git for python/submit.py
- Timestamp:
- May 14, 2018, 10:11:29 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 812283d
- Parents:
- efdb01a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/submit.py
refdb01a r991df6a 7 7 # - dead code ? what to do? 8 8 # - seperate operational and reanlysis for clarification 9 # - add correct file description10 9 # - divide in two submits , ondemand und operational 11 10 # - 12 11 #************************************************************************ 13 """14 @Author: Anne Fouilloux (University of Oslo)15 12 16 @Date: October 2014 13 #******************************************************************************* 14 # @Author: Anne Fouilloux (University of Oslo) 15 # 16 # @Date: October 2014 17 # 18 # @Change History: 19 # 20 # November 2015 - Leopold Haimberger (University of Vienna): 21 # - job submission on ecgate and cca 22 # - job templates suitable for twice daily operational dissemination 23 # 24 # February 2018 - Anne Philipp (University of Vienna): 25 # - applied PEP8 style guide 26 # - added documentation 27 # - minor changes in programming style (for consistence) 28 # 29 # @License: 30 # (C) Copyright 2014-2018. 31 # 32 # This software is licensed under the terms of the Apache Licence Version 2.0 33 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 34 # 35 # @Program Functionality: 36 # This program is the main program of flex_extract and controls the 37 # program flow. 38 # If it is supposed to work locally then it works through the necessary 39 # functions getMARSdata and prepareFlexpart. Otherwise it prepares 40 # a shell job script which will do the necessary work on the 41 # ECMWF server and is submitted via ecaccess-job-submit. 42 # 43 # @Program Content: 44 # - main 45 # - submit 46 # 47 #******************************************************************************* 17 48 18 @ChangeHistory:19 November 2015 - Leopold Haimberger (University of Vienna):20 - job submission on ecgate and cca21 - job templates suitable for twice daily operational dissemination22 23 February 2018 - Anne Philipp (University of Vienna):24 - applied PEP8 style guide25 - added documentation26 - minor changes in programming style (for consistence)27 28 @License:29 (C) Copyright 2014-2018.30 31 This software is licensed under the terms of the Apache Licence Version 2.032 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.33 34 @Requirements:35 - A standard python 2.6 or 2.7 installation36 37 @Description:38 Further documentation may be obtained from www.flexpart.eu.39 40 41 """42 49 # ------------------------------------------------------------------------------ 43 50 # MODULES … … 48 55 import subprocess 49 56 import inspect 50 # add the pythondir path so that python finds its buddies (from flex_extract) 51 localpythonpath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) 52 sys.path.append(localpythonpath) 57 # add path to pythonpath so that python finds its buddies 58 localpythonpath = os.path.dirname(os.path.abspath( 59 inspect.getfile(inspect.currentframe()))) 60 if localpythonpath not in sys.path: 61 sys.path.append(localpythonpath) 53 62 54 63 # software specific classes and modules from flex_extract … … 56 65 from getMARSdata import getMARSdata 57 66 from prepareFLEXPART import prepareFLEXPART 67 58 68 # ------------------------------------------------------------------------------ 59 69 # FUNCTIONS 60 70 # ------------------------------------------------------------------------------ 71 61 72 def main(): 62 73 ''' 63 74 @Description: 64 Get the arguments from script call and from C ontrolfile.75 Get the arguments from script call and from CONTROL file. 65 76 Decides from the argument "queue" if the local version 66 77 is done "queue=None" or the gateway version with "queue=ecgate" … … 102 113 Default is "job.temp". 103 114 104 c: instance of class Control 105 Contains all the parameters of control files, which are e.g.:115 c: instance of class ControlFile 116 Contains all the parameters of CONTROL file, which are e.g.: 106 117 DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME, 107 118 STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT, … … 127 138 insert_point = lftext.index('EOF') 128 139 129 # put all parameters of controlinstance into a list140 # put all parameters of ControlFile instance into a list 130 141 clist = c.tolist() 131 142 colist = [] # operational
Note: See TracChangeset
for help on using the changeset viewer.