Changeset 6470422 in flex_extract.git
- Timestamp:
- Jul 29, 2019, 9:52:14 AM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 12face2
- Parents:
- a2f1e75
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/mods/tools.py
rd727af2 r6470422 1 #!/usr/bin/env python 31 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 3 #******************************************************************************* … … 59 59 # MODULES 60 60 # ------------------------------------------------------------------------------ 61 from __future__ import print_function 62 61 63 import os 62 64 import errno … … 71 73 from datetime import datetime, timedelta 72 74 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter 73 74 75 75 76 76 # ------------------------------------------------------------------------------ … … 183 183 help="# of days to be retrieved within a single job") 184 184 parser.add_argument("--controlfile", dest="controlfile", 185 type=none_or_str, default='CONTROL .temp',186 help=" file with CONTROL parameters")185 type=none_or_str, default='CONTROL_EA5', 186 help="The file with all CONTROL parameters.") 187 187 parser.add_argument("--basetime", dest="basetime", 188 188 type=none_or_int, default=None, … … 190 190 parser.add_argument("--step", dest="step", 191 191 type=none_or_str, default=None, 192 help=" steps such as 00/to/48")192 help="Forecast steps such as 00/to/48") 193 193 parser.add_argument("--levelist", dest="levelist", 194 194 type=none_or_str, default=None, … … 204 204 parser.add_argument("--oper", dest="oper", 205 205 type=none_or_int, default=None, 206 help= "operational mode - prepares dates with \207 environment variables")206 help='operational mode - prepares dates with ' 207 'environment variables') 208 208 parser.add_argument("--request", dest="request", 209 209 type=none_or_int, default=None, … … 214 214 parser.add_argument("--rrint", dest="rrint", 215 215 type=none_or_int, default=None, 216 help="select old or new precipitation interpolation \ 217 0 - old method\ 218 1 - new method (additional subgrid points)") 216 help='Selection of old or new precipitation ' 217 'interpolation:\n' 218 ' 0 - old method\n' 219 ' 1 - new method (additional subgrid points)') 219 220 220 221 # set directories 221 222 parser.add_argument("--inputdir", dest="inputdir", 222 223 type=none_or_str, default=None, 223 help="root directory for storing intermediate files") 224 help='Path to the temporary directory for the ' 225 'retrieval grib files and other processing files.') 224 226 parser.add_argument("--outputdir", dest="outputdir", 225 227 type=none_or_str, default=None, 226 help="root directory for storing output files") 227 parser.add_argument("--flexpartdir", dest="flexpartdir", 228 type=none_or_str, default=None, 229 help="FLEXPART root directory (to find grib2flexpart \ 230 and COMMAND file)\n Normally flex_extract resides in \ 231 the scripts directory of the FLEXPART distribution") 228 help='Path to the final directory where the final ' 229 'FLEXPART ready input files are stored.') 232 230 233 231 # this is only used by prepare_flexpart.py to rerun a postprocessing step 234 232 parser.add_argument("--ppid", dest="ppid", 235 233 type=none_or_str, default=None, 236 help="specify parent process id for \ 237 rerun of prepare_flexpart") 234 help='This is the specify parent process id of a ' 235 'single flex_extract run to identify the files. ' 236 'It is the second number in the GRIB files.') 238 237 239 238 # arguments for job submission to ECMWF, only needed by submit.py 240 239 parser.add_argument("--job_template", dest='job_template', 241 240 type=none_or_str, default="job.temp", 242 help="job template file for submission to ECMWF") 241 help='The job template file which are adapted to be ' 242 'submitted to the batch system on ECMWF server.') 243 243 parser.add_argument("--queue", dest="queue", 244 244 type=none_or_str, default=None, 245 help="queue for submission to ECMWF \ 246 (e.g. ecgate or cca )") 245 help='The ECMWF server name for submission of the ' 246 'job script to the batch system ' 247 '(e.g. ecgate | cca | ccb)') 247 248 248 249 args = parser.parse_args() … … 533 534 ipar = [] 534 535 for par in cpar: 536 par = par.strip() 535 537 for k, v in table.items(): 538 if par.isdigit(): 539 par = str(int(par)).zfill(3) 536 540 if par == k or par == v: 537 541 ipar.append(int(k)) … … 575 579 for par in cpar: 576 580 for k, v in table.items(): 581 if par.isdigit(): 582 par = str(int(par)).zfill(3) 577 583 if par == k or par == v: 578 584 spar.append(k + '.128')
Note: See TracChangeset
for help on using the changeset viewer.