Changeset 6470422 in flex_extract.git


Ignore:
Timestamp:
Jul 29, 2019, 9:52:14 AM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
12face2
Parents:
a2f1e75
Message:

python2 downgrade/optimized description of command line parameters/correction of paramId conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/tools.py

    rd727af2 r6470422  
    1 #!/usr/bin/env python3
     1#!/usr/bin/env python
    22# -*- coding: utf-8 -*-
    33#*******************************************************************************
     
    5959# MODULES
    6060# ------------------------------------------------------------------------------
     61from __future__ import print_function
     62
    6163import os
    6264import errno
     
    7173from datetime import datetime, timedelta
    7274from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
    73 
    74 
    7575
    7676# ------------------------------------------------------------------------------
     
    183183                        help="# of days to be retrieved within a single job")
    184184    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.")
    187187    parser.add_argument("--basetime", dest="basetime",
    188188                        type=none_or_int, default=None,
     
    190190    parser.add_argument("--step", dest="step",
    191191                        type=none_or_str, default=None,
    192                         help="steps such as 00/to/48")
     192                        help="Forecast steps such as 00/to/48")
    193193    parser.add_argument("--levelist", dest="levelist",
    194194                        type=none_or_str, default=None,
     
    204204    parser.add_argument("--oper", dest="oper",
    205205                        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')
    208208    parser.add_argument("--request", dest="request",
    209209                        type=none_or_int, default=None,
     
    214214    parser.add_argument("--rrint", dest="rrint",
    215215                        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)')
    219220
    220221    # set directories
    221222    parser.add_argument("--inputdir", dest="inputdir",
    222223                        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.')
    224226    parser.add_argument("--outputdir", dest="outputdir",
    225227                        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.')
    232230
    233231    # this is only used by prepare_flexpart.py to rerun a postprocessing step
    234232    parser.add_argument("--ppid", dest="ppid",
    235233                        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.')
    238237
    239238    # arguments for job submission to ECMWF, only needed by submit.py
    240239    parser.add_argument("--job_template", dest='job_template',
    241240                        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.')
    243243    parser.add_argument("--queue", dest="queue",
    244244                        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)')
    247248
    248249    args = parser.parse_args()
     
    533534    ipar = []
    534535    for par in cpar:
     536        par = par.strip()
    535537        for k, v in table.items():
     538            if par.isdigit():
     539                par = str(int(par)).zfill(3)
    536540            if par == k or par == v:
    537541                ipar.append(int(k))
     
    575579    for par in cpar:
    576580        for k, v in table.items():
     581            if par.isdigit():
     582                par = str(int(par)).zfill(3)
    577583            if par == k or par == v:
    578584                spar.append(k + '.128')
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG