Changeset f61e1df in flex_extract.git for Source


Ignore:
Timestamp:
Jul 9, 2020, 8:13:25 AM (4 years ago)
Author:
anphi <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
82564d8
Parents:
3e13e02 (diff), 6931f61 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of language editing branch into master

Location:
Source
Files:
1 added
22 edited

Legend:

Unmodified
Added
Removed
  • Source/Python/Mods/checks.py

    r026b359 rf61e1df  
    119119    '''Defines the correct area string.
    120120
    121     Checks on the format of the four area components. Wether it is of
    122     the order of 1000 or 1. Also checks wether area was already set by command
    123     line, then the four components are overwritten.
     121    Checks the format of the four area components wether it is on
     122    the order of 1000 or 1.
     123    Also checks wether area was already set on command line,
     124    then the four components are overwritten.
    124125    Convert to correct format of the order of magnitude "1" and sets the
    125126    area parameter (North/West/South/East).
     
    135136
    136137    upper : str
    137         The northern most latitude.
     138        The northernmost latitude.
    138139
    139140    lower : str
    140         The souther most latitude.
     141        The southernmost latitude.
    141142
    142143    left : str
    143         The western most longitude.
     144        The westernmost longitude.
    144145
    145146    right : str
    146         The eastern most longiude.
     147        The easternmost longitude.
    147148
    148149    Return
    149150    ------
    150151    grid : str
    151         Contains grid in format Lat/lon. E.g. 0.1/0.1
     152        Contains grid in format lat/lon. E.g. 0.1/0.1
    152153    '''
    153154    if 'N' in grid:  # Gaussian output grid
     
    180181                                    float(right))
    181182    else:
    182         raise ValueError('The area components have different '
     183        raise ValueError('Area components have inconsisten or unrecognised '
    183184                         'formats (upper, lower, left, right): '
    184185                         '{}/{}/{}/{}'.format(str(upper), str(lower),
     
    209210    level : str
    210211        Specifies the maximum level. It has to be one of the
    211         available maximum level number as contained in the variable
    212         MAX_LEVEL_LIST in "_config". E.g. [16, 19, 31, 40, 50, 60, 62, 91, 137]
     212        available maximum level numbers as contained in the variable
     213        MAX_LEVEL_LIST in "_config": [16, 19, 31, 40, 50, 60, 62, 91, 137]
    213214
    214215    '''
     
    346347    for i, val in enumerate(ftype):
    347348        if ftype[i] == 'AN' and int(steps[i]) != 0:
    348             print('Analysis retrievals must have STEP = 0 (now set to 0)')
     349            print('For analysis data, STEP = 0 is needed. Setting to 0 now.)')
    349350            ftype[i] = 0
    350351
     
    386387    maxstep : int
    387388        The maximum forecast time step in hours from the forecast base time.
    388         This is the maximum step for non flux (accumulated) forecast data.
     389        This is the maximum step for non-flux (not accumulated) forecast data.
    389390
    390391    purefc : int
     
    405406    if not len(ftype) == len(ftime) == len(steps):
    406407        raise ValueError('ERROR: The number of field types, times and steps '
    407                          'are not the same! Please check the setting in the '
     408                         'are not the same! Please check the settings in the '
    408409                         'CONTROL file!')
    409410
     
    423424
    424425def check_mail(mail):
    425     '''Check the string of mail addresses, seperate them and convert to a list.
     426    '''Check the string of mail addresses, separate them and convert to list.
    426427
    427428    Parameters
     
    529530
    530531def check_dates(start, end):
    531     '''Checks if there is at least a start date for a one day retrieval.
     532    '''Checks if there is at least a start date for a one-day retrieval.
    532533
    533534    Checks if end date lies after start date and end date is set.
     
    628629
    629630def check_request(request, marsfile):
    630     '''Check if there is an old mars request file and remove it.
     631    '''Check if there is an old MARS request file; if so, remove it.
    631632
    632633    Parameters
     
    651652
    652653def check_public(public, dataset):
    653     '''Check wether the dataset parameter is set for a
    654     public data set retrieval.
     654    '''Check wether the dataset parameter is set to a
     655    public data set.
    655656
    656657    Parameters
     
    667668    '''
    668669    if public and not dataset:
    669         raise ValueError('ERROR: If public mars data wants to be retrieved, '
    670                          'the "dataset"-parameter has to be set too!')
     670        raise ValueError('ERROR: If public MARS data are to be retrieved, '
     671                         'the "dataset"-parameter has to be set, too!')
    671672    return
    672673
     
    674675    '''Guarantees that the accumulation field type is set.
    675676
    676     If not set, it is derivated as in the old method (TYPE[1]).
     677    If not set, it is derived with the old method (TYPE[1]).
    677678
    678679    Parameters
     
    710711    '''Guarantees that the accumulation forecast times were set.
    711712
    712     If it is not set, it tries to set the value for some of the
    713     most commonly used data sets. Otherwise it raises an error.
     713    If not set, setting the value to some of the most commonly used data sets
     714    is attempted. Otherwise, an eror is raised.
    714715
    715716    Parameters
    716717    ----------
    717718    acctime : str
    718         The starting time from the accumulated forecasts.
     719        The starting time for the accumulated forecasts.
    719720
    720721    marsclass : str
     
    727728    ------
    728729    acctime : str
    729         The starting time from the accumulated forecasts.
     730        The starting time for the accumulated forecasts.
    730731    '''
    731732
    732733    if not acctime:
    733         print('... Control parameter ACCTIME was not defined.')
     734        print('... Control parameter ACCTIME was not set.')
    734735        print('... Value will be set depending on field type:\n '
    735736              '\t\t EA=06/18\n\t\t EI/OD=00/12\n\t\t EP=18')
     
    745746            acctime = time[0]
    746747        else:
    747             raise ValueError('ERROR: Accumulation forecast time can not '
    748                              'automatically be derived!')
     748            raise ValueError('ERROR: Accumulation forecast time can not be'
     749                             'derived automatically!')
    749750    return acctime
    750751
    751752def check_accmaxstep(accmaxstep, marsclass, purefc, maxstep):
    752     '''Guarantees that the accumulation forecast step were set.
     753    '''Guarantees that the accumulation forecast step was set.
    753754
    754755    Parameters
     
    765766    maxstep : str
    766767        The maximum forecast time step in hours from the forecast base time.
    767         This is the maximum step for non flux (accumulated) forecast data.
     768        This is the maximum step for non-flux (accumulated) forecast data.
    768769
    769770    Return
     
    773774    '''
    774775    if not accmaxstep:
    775         print('... Control parameter ACCMAXSTEP was not defined.')
     776        print('... Control parameter ACCMAXSTEP was not set.')
    776777        print('... Value will be set depending on field type/time: '
    777778              '\n\t\t EA/EI/OD=12\n\t\t EP=24')
     
    785786            print('... For pure forecast mode, the accumulated forecast must '
    786787                  'have the same maxstep as the normal forecast fields!\n'
    787                   '\t\t Accmaxstep was set to maxstep!')
     788                  '\t\t ACCMAXSTEP was set to MAXSTEP!')
    788789        else:
    789             raise ValueError('ERROR: Accumulation forecast step can not '
    790                              'automatically be derived!')
     790            raise ValueError('ERROR: Accumulation forecast step can not be'
     791                             'derived automatically!')
    791792    else:
    792793        if purefc and int(accmaxstep) != int(maxstep):
     
    794795            print('... For pure forecast mode, the accumulated forecast must '
    795796                  'have the same maxstep as the normal forecast fields!\n'
    796                   '\t\t Accmaxstep was set to maxstep!')
     797                  '\t\t ACCMAXSTEP was set to MAXSTEP!')
    797798    return accmaxstep
    798799
    799800def check_addpar(addpar):
    800801    '''Check that addpar has correct format of additional parameters in
    801     a single string, so that it can be easily appended to the hard coded
    802     parameters that are retrieved in any case.
     802    a single string, so that it can be easily appended to the hard-coded
     803    parameters retrieved in any case.
    803804
    804805    Parameters
     
    826827
    827828def check_job_chunk(job_chunk):
    828     '''Checks that if job chunk is set, the number is positive and non zero.
     829    '''Checks that if job chunk is set, the number is positive and nonzero.
    829830
    830831    Parameters
     
    844845
    845846    if job_chunk < 0:
    846         raise ValueError('ERROR: The number of job chunk is negative!\n'
     847        raise ValueError('ERROR: The number of job chunks is negative!\n'
    847848                         'It has to be a positive number!')
    848849    elif job_chunk == 0:
  • Source/Python/Mods/get_mars_data.py

    r026b359 rf61e1df  
    1010#    November 2015 - Leopold Haimberger (University of Vienna):
    1111#        - moved the getEIdata program into a function "get_mars_data"
    12 #        - moved the AgurmentParser into a seperate function
    13 #        - adatpted the function for the use in flex_extract
    14 #        - renamed file to get_mars_data
     12#        - moved the AgurmentParser into a separate function
     13#        - adapted the function for use in flex_extract
     14#        - renamed source file to get_mars_data
    1515#
    1616#    February 2018 - Anne Philipp (University of Vienna):
     
    2222#          online documentation)
    2323#        - use of UIFiles class for file selection and deletion
    24 #        - seperated get_mars_data function into several smaller pieces:
     24#        - separated get_mars_data function into several smaller pieces:
    2525#          write_reqheader, mk_server, mk_dates, remove_old, do_retrievment
    2626#
     
    3636#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
    3737#*******************************************************************************
    38 '''This script extracts MARS data from ECMWF servers.
     38'''This script extracts MARS data from ECMWF.
    3939
    4040At first, the necessary parameters from command line and CONTROL files are
     
    4444functions:
    4545
    46     * main - the main function of the script
    47     * get_mars_data - overall control of ECMWF data retrievment
     46    * main            - the main function of the script
     47    * get_mars_data   - overall control of ECMWF data retrievment
    4848    * write_reqheader - writes the header into the mars_request file
    49     * mk_server - creates the server connection to ECMWF servers
    50     * mk_dates - defines the start and end date
    51     * remove_old - deletes old retrieved grib files
    52     * do_retrievement - creates individual retrievals
    53 
    54 Type: get_mars_data.py --help
     49    * mk_server       - creates the server connection to ECMWF servers
     50    * mk_dates        - defines the start and end date
     51    * remove_old      - deletes old retrieved grib files
     52    * do_retrieval    - creates individual retrievals
     53
     54Type get_mars_data.py --help
    5555to get information about command line parameters.
    5656Read the documentation for usage instructions.
     
    6666from datetime import datetime, timedelta
    6767
    68 # software specific classes and modules from flex_extract
    69 # add path to local main python path for flex_extract to get full access
     68# software-specific classes and modules from flex_extract
     69# add path to local main Python path for flex_extract to get full access
    7070sys.path.append(os.path.dirname(os.path.abspath(
    7171    inspect.getfile(inspect.currentframe()))) + '/../')
     
    9494# ------------------------------------------------------------------------------
    9595def main():
    96     '''Controls the program to get data out of mars.
    97 
    98     This is done if it is called directly from command line.
    99     Then it also takes program call arguments and control file input.
     96    '''Controls the program to retrieve data from MARS.
     97
     98    This is done if called directly from command line.
     99    Then, arguments and control file are taken as input.
    100100
    101101    Parameters
     
    114114
    115115def get_mars_data(c):
    116     '''Retrieves the EC data needed for a FLEXPART simulation.
    117 
    118     Start and end dates for retrieval period is set. Retrievals
    119     are divided into smaller periods if necessary and datechunk parameter
     116    '''Retrieves the ECMWF data required for a FLEXPART simulation.
     117
     118    Start and end dates for retrieval period are set. Retrievals
     119    are divided into shorter periods if necessary and if datechunk parameter
    120120    is set.
    121121
     
    137137
    138138    if c.request == 0:
    139         print("Retrieving EC data!")
     139        print("Retrieving ECMWF data!")
    140140    else:
    141141        if c.request == 1:
    142             print("Printing mars requests!")
     142            print("Printing MARS requests!")
    143143        elif c.request == 2:
    144             print("Retrieving EC data and printing mars request!")
     144            print("Retrieving ECMWF data and printing MARS request!")
    145145        write_reqheader(os.path.join(c.inputdir, _config.FILE_MARS_REQUESTS))
    146146
     
    165165
    166166def write_reqheader(marsfile):
    167     '''Writes header with column names into mars request file.
     167    '''Writes header with column names into MARS request file.
    168168
    169169    Parameters
    170170    ----------
    171171    marsfile : str
    172         Path to the mars request file.
     172        Path to the MARS request file.
    173173
    174174    Return
     
    188188
    189189def mk_server(c):
    190     '''Creates a server connection with available python API.
    191 
    192     Which API is used depends on availability and the dataset to be retrieved.
    193     The CDS API is used for ERA5 dataset no matter if the user is a member or
    194     a public user. ECMWF WebAPI is used for all other available datasets.
     190    '''Creates a server connection with available Python API.
     191
     192    The API selected depends on availability and the data set to be retrieved.
     193    The CDS API is used for ERA5 data, no matter whether the user is a
     194    member-state or a public user.
     195    ECMWF WebAPI is used for all other available datasets.
    195196
    196197    Parameters
     
    247248
    248249def mk_dates(c, fluxes):
    249     '''Prepares start and end date depending on flux or non flux data.
    250 
    251     If forecast for maximum one day (upto 24h) are to be retrieved, then
     250    '''Prepares start and end date depending on flux or non-flux type of data.
     251
     252    If forecasts for a maximum of one day (24 h) are to be retrieved, then
    252253    collect accumulation data (flux data) with additional days in the
    253     beginning and at the end (used for complete disaggregation of
     254    beginning and at the end (needed for complete disaggregation of
    254255    original period)
    255256
    256     If forecast data longer than 24h are to be retrieved, then
     257    If forecast data for more than +24 h are to be retrieved, then
    257258    collect accumulation data (flux data) with the exact start and end date
    258259    (disaggregation will be done for the exact time period with
     
    314315    ----------
    315316    pattern : str
    316         The sub string pattern which identifies the files to be deleted.
     317        The substring pattern which identifies the files to be deleted.
    317318
    318319    inputdir : str, optional
    319         Path to the directory where the retrieved data is stored.
    320 
    321     Return
    322     ------
    323 
    324     '''
    325     print('... removing old content of ' + inputdir)
     320        Path to the directory where the retrieved data are stored.
     321
     322    Return
     323    ------
     324
     325    '''
     326    print('... removing old files in ' + inputdir)
    326327
    327328    tobecleaned = UioFiles(inputdir, pattern)
     
    332333
    333334def do_retrievement(c, server, start, end, delta_t, fluxes=False):
    334     '''Divides the complete retrieval period in smaller chunks and
     335    '''Divides the total retrieval period into smaller chunks and
    335336    retrieves the data from MARS.
    336337
     
    351352
    352353    delta_t : datetime
    353         Delta_t + 1 is the maximal time period of a single
    354         retrieval.
     354        Delta_t + 1 is the maximum time period of a single retrieval.
    355355
    356356    fluxes : boolean, optional
     
    365365
    366366    # since actual day also counts as one day,
    367     # we only need to add datechunk - 1 days to retrieval
    368     # for a period
     367    # we only need to add datechunk - 1 days to retrieval for a period
    369368    delta_t_m1 = delta_t - timedelta(days=1)
    370369
  • Source/Python/Mods/prepare_flexpart.py

    r026b359 rf61e1df  
    1313#        - job templates suitable for twice daily operational dissemination
    1414#        - dividing retrievals of longer periods into digestable chunks
    15 #        - retrieve also longer term forecasts, not only analyses and
    16 #          short term forecast data
     15#        - retrieve also longer-term forecasts, not only analyses and
     16#          short-term forecast data
    1717#        - conversion into GRIB2
    18 #        - conversion into .fp format for faster execution of FLEXPART
     18#       
    1919#
    2020#    February 2018 - Anne Philipp (University of Vienna):
     
    4545
    4646It converts the bunch of grib files extracted via get_mars_data before,
    47 by doing the necessary conversion to get consistent grids or the
     47by doing the necessary conversion to obtain consistent grids or the
    4848disaggregation of flux data. Finally, the data fields are combined
    49 in files per available hour with the naming convention xxYYMMDDHH,
     49in files per hour available with the naming convention xxYYMMDDHH,
    5050where xx should be 2 arbitrary letters (mostly xx is chosen to be "EN").
    5151
     
    8888# ------------------------------------------------------------------------------
    8989def main():
    90     '''Controls the program to prepare flexpart input files from mars data.
     90    '''Controls the program to prepare FLEXPART input files from MARS data.
    9191
    92     This is done if it is called directly from command line.
    93     Then it also takes program call arguments and control file input.
     92    This is done if called directly from the command line.
     93    Then, arguments and control file are taken as input.
    9494
    9595    Parameters
     
    108108
    109109def prepare_flexpart(ppid, c):
    110     '''Converts the mars data into flexpart ready input files.
     110    '''Converts the MARS data into files ready as input for FLEXPART.
    111111
    112     Specific data fields are converted to a different grid and the flux
    113     data are going to be disaggregated. The data fields are collected by
    114     hour and stored in a file with a specific FLEXPART relevant naming
    115     convention.
     112    Certain fields are converted to a different grid and the flux
     113    data are disaggregated. Fields are collected by hour and stored in a file
     114    with a specific naming convention.
    116115
    117116    Parameters
  • Source/Python/Mods/tools.py

    r026b359 rf61e1df  
    1818#        - added documentation
    1919#        - moved all non class methods from former file Flexparttools in here
    20 #        - seperated args and control interpretation
     20#        - separated args and control interpretation
    2121#        - added functions get_list_as_string, read_ecenv, send_mail, make_dir,
    2222#          put_file_to_ecserver, submit_job_to_ecserver, get_informations,
     
    118118
    119119def none_or_str(value):
    120     '''Converts the input string into pythons None-type if the string
    121     contains string "None".
     120    '''Converts the input string into Pythons None type if it
     121    contains the string "None".
    122122
    123123    Parameters
     
    130130    None or value:
    131131        Return depends on the content of the input value. If it was "None",
    132         then the python type None is returned. Otherwise the string itself.
     132        then the Python type None is returned, otherwise the string itself.
    133133    '''
    134134    if value == 'None':
     
    137137
    138138def none_or_int(value):
    139     '''Converts the input string into pythons None-type if the string
    140     contains string "None". Otherwise it is converted to an integer value.
     139    '''Converts the input string into Pythons None-type if it
     140    contains string "None"; otherwise it is converted to an integer value.
    141141
    142142    Parameters
     
    158158def get_cmdline_args():
    159159    '''Decomposes the command line arguments and assigns them to variables.
    160     Apply default values for non mentioned arguments.
     160    Apply default values for arguments not present.
    161161
    162162    Parameters
     
    166166    ------
    167167    args : Namespace
    168         Contains the commandline arguments from script/program call.
     168        Contains the command line arguments from the script / program call.
    169169    '''
    170170
     
    191191    parser.add_argument("--basetime", dest="basetime",
    192192                        type=none_or_int, default=None,
    193                         help="base such as 0 or 12 (for half day retrievals)")
     193                        help="base time such as 0 or 12 (for half day retrievals)")
    194194    parser.add_argument("--step", dest="step",
    195195                        type=none_or_str, default=None,
     
    200200    parser.add_argument("--area", dest="area",
    201201                        type=none_or_str, default=None,
    202                         help="area defined as north/west/south/east")
     202                        help="area, defined by north/west/south/east")
    203203
    204204    # some switches
    205205    parser.add_argument("--debug", dest="debug",
    206206                        type=none_or_int, default=None,
    207                         help="debug mode - leave temporary files intact")
     207                        help="debug mode - temporary files will be conserved")
    208208    parser.add_argument("--oper", dest="oper",
    209209                        type=none_or_int, default=None,
    210                         help='operational mode - prepares dates with '
     210                        help='operational mode - prepares dates from '
    211211                        'environment variables')
    212212    parser.add_argument("--request", dest="request",
    213213                        type=none_or_int, default=None,
    214                         help="list all mars requests in file mars_requests.dat")
     214                        help="list all MARS requests in file mars_requests.dat")
    215215    parser.add_argument("--public", dest="public",
    216216                        type=none_or_int, default=None,
    217                         help="public mode - retrieves the public datasets")
     217                        help="public mode - retrieves public datasets")
    218218    parser.add_argument("--rrint", dest="rrint",
    219219                        type=none_or_int, default=None,
    220                         help='Selection of old or new precipitation '
    221                         'interpolation:\n'
     220                        help='Selection of old or new '
     221                        'interpolation method for precipitation:\n'
    222222                        '     0 - old method\n'
    223223                        '     1 - new method (additional subgrid points)')
     
    226226    parser.add_argument("--inputdir", dest="inputdir",
    227227                        type=none_or_str, default=None,
    228                         help='Path to the temporary directory for the '
    229                         'retrieval grib files and other processing files.')
     228                        help='Path to temporary directory for '
     229                        'retrieved grib files and other processing files.')
    230230    parser.add_argument("--outputdir", dest="outputdir",
    231231                        type=none_or_str, default=None,
    232                         help='Path to the final directory where the final '
    233                         'FLEXPART ready input files are stored.')
     232                        help='Path to final directory where '
     233                        'FLEXPART input files will be stored.')
    234234
    235235    # this is only used by prepare_flexpart.py to rerun a postprocessing step
    236236    parser.add_argument("--ppid", dest="ppid",
    237237                        type=none_or_str, default=None,
    238                         help='This is the specify parent process id of a '
     238                        help='This is the specify the parent process id of a '
    239239                        'single flex_extract run to identify the files. '
    240240                        'It is the second number in the GRIB files.')
     
    243243    parser.add_argument("--job_template", dest='job_template',
    244244                        type=none_or_str, default="job.temp",
    245                         help='The job template file which are adapted to be '
    246                         'submitted to the batch system on ECMWF server.')
     245                        help='Job template file. Will be used for submission '
     246                        'to the batch system on the ECMWF server after '
     247                        'modification.')
    247248    parser.add_argument("--queue", dest="queue",
    248249                        type=none_or_str, default=None,
    249                         help='The ECMWF server name for submission of the '
    250                         'job script to the batch system '
     250                        help='The name of the ECMWF server name where the'
     251                        'job script is to be submitted '
    251252                        '(e.g. ecgate | cca | ccb)')
    252253
     
    289290
    290291    It keeps the final FLEXPART input files if program runs without
    291     ECMWF Api and keywords "ectrans" or "ecstorage" are set to "1".
     292    ECMWF API and keywords "ectrans" or "ecstorage" are set to "1".
    292293
    293294    Parameters
     
    410411
    411412    This method combines the single characters of the passed arguments
    412     with each other. So that each character of each argument value
     413    with each other in a way that each character of each argument value
    413414    will be combined with each character of the other arguments as a tuple.
    414415
     
    519520    pars : str
    520521        Addpar argument from CONTROL file in the format of
    521         parameter names instead of ids. The parameter short
    522         names are sepearted with "/" and they are passed as
    523         one single string.
     522        parameter names instead of IDs. The parameter short
     523        names are separated by "/" and passed as one single string.
    524524
    525525    table : dict
     
    555555
    556556def to_param_id_with_tablenumber(pars, table):
    557     '''Transform parameter names to parameter ids and add table id.
     557    '''Transform parameter names to parameter IDs and add table ID.
    558558
    559559    Conversion with ECMWF grib table 128.
     
    563563    pars : str
    564564        Addpar argument from CONTROL file in the format of
    565         parameter names instead of ids. The parameter short
    566         names are sepearted with "/" and they are passed as
    567         one single string.
     565        parameter names instead of ID. The parameter short
     566        names are separated by "/" and passed as one single string.
    568567
    569568    table : dict
     
    576575    spar : str
    577576        List of addpar parameters from CONTROL file transformed to
    578         parameter ids in the format of integer.
     577        parameter IDs in the format of integer.
    579578    '''
    580579    if not pars:
     
    598597
    599598def get_list_as_string(list_obj, concatenate_sign=', '):
    600     '''Converts a list of arbitrary content into a single string.
     599    '''Converts a list of arbitrary content into a single string using a given
     600    concatenation character.
    601601
    602602    Parameters
     
    624624    '''Creates a directory.
    625625
    626     It gives a warning if the directory already exists and skips process.
    627     The program stops only if there is another problem.
     626    If the directory already exists, an information is printed and the creation
     627    skipped. The program stops only if there is another problem.
    628628
    629629    Parameters
     
    641641        # errno.EEXIST = directory already exists
    642642        if e.errno == errno.EEXIST:
    643             print('WARNING: Directory {0} already exists!'.format(directory))
     643            print('INFORMATION: Directory {0} already exists!'.format(directory))
    644644        else:
    645645            raise # re-raise exception if a different error occured
     
    720720    ------
    721721    job_id : int
    722         The id number of the job as a reference at the ecmwf server.
     722        The id number of the job as a reference at the ECMWF server.
    723723    '''
    724724
     
    732732
    733733        print('\n... Do you have a valid ecaccess certification key?')
    734         sys.exit('... ECACCESS-JOB-SUBMIT FAILED!')
     734        sys.exit('... ecaccess-job-submit FAILED!')
    735735    except OSError as e:
    736736        print('... ERROR CODE: ' + str(e.errno))
     
    738738
    739739        print('\n... Most likely the ECACCESS library is not available!')
    740         sys.exit('... ECACCESS-JOB-SUBMIT FAILED!')
     740        sys.exit('... ecaccess-job-submit FAILED!')
    741741
    742742    return job_id.decode()
     
    744744
    745745def get_informations(filename):
    746     '''Gets basic information from an example grib file.
    747 
    748     These information are important for later use and the
    749     initialization of numpy arrays for data storing.
     746    '''Extracts basic information from a sample grib file.
     747
     748    This information is needed for later use and the
     749    initialization of numpy arrays where data are stored.
    750750
    751751    Parameters
     
    768768
    769769    # --- open file ---
    770     print("Opening file for getting information data --- %s" % filename)
     770    print("Opening grib file for extraction of information --- %s" % filename)
    771771    with open(filename, 'rb') as f:
    772772        # load first message from file
     
    785785               ]
    786786
    787         print('\nInformations are: ')
     787        print('\nInformation extracted: ')
    788788        for key in keys:
    789789            # Get the value of the key in a grib message.
     
    798798
    799799def get_dimensions(info, purefc, dtime, index_vals, start_date, end_date):
    800     '''This function specifies the correct dimensions for x, y and t.
     800    '''This function specifies the correct dimensions for x, y, and t.
    801801
    802802    Parameters
     
    817817    index_vals : list of list of str
    818818        Contains the values from the keys used for a distinct selection
    819         of grib messages in processing the grib files.
     819        of GRIB messages in processing the grib files.
    820820        Content looks like e.g.:
    821821        index_vals[0]: ('20171106', '20171107', '20171108') ; date
     
    849849
    850850def execute_subprocess(cmd_list, error_msg='SUBPROCESS FAILED!'):
    851     '''Executes a command line instruction via a subprocess.
     851    '''Executes a command via a subprocess.
    852852
    853853    Error handling is done if an error occures.
     
    856856    ----------
    857857    cmd_list : list of str
    858         A list of the components for the command line execution. Each
    859         list entry is a single part of the command which is seperated from
    860         the rest by a blank space.
    861         E.g. ['mv', file1, file2]
     858        A list of the components for the command line execution.
     859        They will be concatenated with blank space for the command
     860        to be submitted, like ['mv', file1, file2] for mv file1 file2.
    862861
    863862    Return
    864863    ------
    865864    error_msg : str, optional
    866         The possible error message if the subprocess failed.
    867         By default it will just tell "SUBPROCESS FAILED!".
     865        Error message if the subprocess fails.
     866        By default it will just say "SUBPROCESS FAILED!".
    868867    '''
    869868
  • Source/Python/install.py

    ra916e8f rf61e1df  
    5151
    5252Depending on the selected installation environment (locally or on the
    53 ECMWF server ecgate or cca) the program extracts the commandline
     53ECMWF server ecgate or cca) the program extracts the command line
    5454arguments and the CONTROL file parameter and prepares the corresponding
    5555environment.
    56 The necessary files are collected in a tar-ball and placed
    57 at the target location. There its untared, the environment variables will
    58 be set and the Fortran code will be compiled.
    59 If the ECMWF environment is selected a job script is prepared and submitted
    60 for the remaining configurations after putting the tar-ball to the
     56The necessary files are collected in a tar ball and placed
     57at the target location. There, is is untared, the environment variables are
     58set, and the Fortran code is compiled.
     59If the ECMWF environment is selected, a job script is prepared and submitted
     60for the remaining configurations after putting the tar ball on the
    6161target ECMWF server.
    6262
     
    112112def get_install_cmdline_args():
    113113    '''Decomposes the command line arguments and assigns them to variables.
    114     Apply default values for non mentioned arguments.
     114    Apply default values for arguments not present.
    115115
    116116    Parameters
     
    132132    parser.add_argument("--makefile", dest="makefile",
    133133                        type=none_or_str, default=None,
    134                         help='Name of Makefile to use for compiling the '
     134                        help='Name of makefile for compiling the '
    135135                        'Fortran program')
    136136    parser.add_argument("--ecuid", dest="ecuid",
    137137                        type=none_or_str, default=None,
    138                         help='The user id at ECMWF.')
     138                        help='User id at ECMWF')
    139139    parser.add_argument("--ecgid", dest="ecgid",
    140140                        type=none_or_str, default=None,
    141                         help='The group id at ECMWF.')
     141                        help='Group id at ECMWF')
    142142    parser.add_argument("--gateway", dest="gateway",
    143143                        type=none_or_str, default=None,
    144                         help='The name of the local gateway server.')
     144                        help='Name of the local gateway server')
    145145    parser.add_argument("--destination", dest="destination",
    146146                        type=none_or_str, default=None,
    147                         help='The ecaccess association, e.g. '
     147                        help='ecaccess association, e.g. '
    148148                        'myUser@genericSftp')
    149149
    150150    parser.add_argument("--installdir", dest="installdir",
    151151                        type=none_or_str, default=None,
    152                         help='Root directory where '
    153                         'flex_extract will be installed to.')
     152                        help='Root directory of the '
     153                        'flex_extract installation')
    154154
    155155    # arguments for job submission to ECMWF, only needed by submit.py
    156156    parser.add_argument("--job_template", dest='job_template',
    157157                        type=none_or_str, default="job.template",
    158                         help='The rudimentary template file to create a batch '
    159                         'job template for submission to ECMWF servers.')
     158                        help='Rudimentary template file to create a batch '
     159                        'job template for submission to ECMWF servers')
    160160
    161161    parser.add_argument("--controlfile", dest="controlfile",
    162162                        type=none_or_str, default='CONTROL_EA5',
    163                         help="The file with all CONTROL parameters.")
     163                        help="A file that contains all CONTROL parameters.")
    164164
    165165    args = parser.parse_args()
     
    169169
    170170def install_via_gateway(c):
    171     '''Prepare data transfer to remote gate and submit a job script which will
    172     install everything on the remote gate.
     171    '''Prepare data transfer to remote gateway and submit a job script which will
     172    install everything on the remote gateway.
    173173
    174174    Parameters
     
    264264
    265265def check_install_conditions(c):
    266     '''Checks a couple of necessary attributes and conditions
    267     for the installation such as if they exist and contain values.
     266    '''Checks necessary attributes and conditions
     267    for the installation, e.g. whether they exist and contain values.
    268268    Otherwise set default values.
    269269
     
    330330    '''Creates a tarball with all necessary files which need to be sent to the
    331331    installation directory.
    332     It does not matter if this is local or remote.
    333     Collects all python files, the Fortran source and makefiles,
     332    It does not matter whether this is local or remote.
     333    Collects all Python files, the Fortran source and makefiles,
    334334    the ECMWF_ENV file, the CONTROL files as well as the
    335335    template files.
     
    515515    ----------
    516516    makefile : str
     517<<<<<<< HEAD
    517518        Name of the makefile which should be used to compile FORTRAN
     519=======
     520        Name of the makefile which should be used to compile the Fortran
     521>>>>>>> origin/task/language-editing
    518522        program.
    519523
     
    705709            print('Please edit ' + makefile +
    706710                  ' or try another makefile in the src directory.')
     711<<<<<<< HEAD
    707712            print('Most likely ECCODES_INCLUDE_DIR, ECCODES_LIB '
     713=======
     714            print('Most likely GRIB_API_INCLUDE_DIR, GRIB_API_LIB '
     715>>>>>>> origin/task/language-editing
    708716                  'and EMOSLIB must be adapted.')
    709717            print('Available makefiles:')
     
    711719            sys.exit('Compilation failed!')
    712720    except ValueError as e:
     721<<<<<<< HEAD
    713722        print('ERROR: makefile call failed:')
     723=======
     724        print('ERROR: make of Fortran code failed:')
     725>>>>>>> origin/task/language-editing
    714726        print(e)
    715727    else:
    716         execute_subprocess(['ls', '-l',
     728        execute_subprocess(['ls', '-l', 
    717729                            os.path.join(src_path, _config.FORTRAN_EXECUTABLE)],
    718730                           error_msg='FORTRAN EXECUTABLE COULD NOT BE FOUND!')
  • Source/Fortran/calc_etadot.f90

    rdfa7dbd rd90a529  
    486486  END IF ! MGAUSS
    487487
    488 !! CREATE FILE VERTICAL.EC NEEDED BY POP MODEL 
    489 
    490   OPEN(21,FILE='VERTICAL.EC')
    491   WRITE(21,'(A)')
    492   WRITE(21,'(A)') 'VERTICAL DISCRETIZATION OF POP MODEL'
    493   WRITE(21,'(A)')
    494   write(21,'(i3,a)') MLEVEL,'   number of layers'
    495   WRITE(21,'(A)')
    496   WRITE(21,'(A)') '* A(NLEV+1)'
    497   WRITE(21,'(A)')
    498   DO 205 I=1,MLEVEL+1
    499 205 WRITE(21,'(F18.12)') AK(I)
    500   WRITE(21,'(A)')
    501   WRITE(21,'(A)') '* B(NLEV+1)'
    502   WRITE(21,'(A)')
    503   DO 210 I=1,MLEVEL+1
    504 210 WRITE(21,'(F18.12)') BK(I)
    505   CLOSE(21)
     488! CREATE FILE VERTICAL.EC NEEDED BY POP MODEL 
     489! 2020-06-25 Commented out by PS - not needed anymore
     490
     491!  OPEN(21,FILE='VERTICAL.EC')
     492!  WRITE(21,'(A)')
     493!  WRITE(21,'(A)') 'VERTICAL DISCRETIZATION OF POP MODEL'
     494!  WRITE(21,'(A)')
     495!  write(21,'(i3,a)') MLEVEL,'   number of layers'
     496!  WRITE(21,'(A)')
     497!  WRITE(21,'(A)') '* A(NLEV+1)'
     498!  WRITE(21,'(A)')
     499!  DO 205 I=1,MLEVEL+1
     500!205 WRITE(21,'(F18.12)') AK(I)
     501!  WRITE(21,'(A)')
     502!  WRITE(21,'(A)') '* B(NLEV+1)'
     503!  WRITE(21,'(A)')
     504!  DO 210 I=1,MLEVEL+1
     505!210 WRITE(21,'(F18.12)') BK(I)
     506!  CLOSE(21)
    506507
    507508!------------------------------------------------------------------
  • Source/Fortran/makefile_debug

    r5868d74 rd2d6cf9  
    1515EXE      =  calc_etadot_debug.out
    1616
    17 ECCODES_LIB=  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
     17ECCODES_LIB=  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm
    1818EMOSLIB=-lemosR64
    1919LIB =  $(ECCODES_LIB) $(EMOSLIB)
  • Source/Fortran/makefile_fast

    rda1b788 r14d9618  
    1515EXE      =  calc_etadot_fast.out
    1616
    17 ECCODES_LIB =  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper
     17ECCODES_LIB =  -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm
    1818EMOSLIB=-lemosR64
    1919LIB =  $(ECCODES_LIB) $(EMOSLIB)
    2020
    2121ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15
     22#/usr/local/include/ #oldstable
     23
    2224INC = -I. -I$(ECCODES_INCLUDE_DIR)
    2325
    2426FC = gfortran
    25 OPT = -O3 -march=native
     27OPT = -O3 # -O3 -march=native
    2628FFLAGS =   $(OPT) $(LIB) $(INC) -fdefault-real-8 -fopenmp -fconvert=big-endian
    2729LDFLAGS =  $(OPT) $(LIB) -fopenmp
  • Source/Fortran/posnam.f90

    rdfa7dbd r36dbabb  
    11  SUBROUTINE POSNAM(KULNAM,CDNAML)
    22
    3  !! position in namelist file.
    4  ! author:  Mats Hamrud, ECMWF
     3 !! Position in namelist file.
     4 !! Author:  Mats Hamrud, ECMWF
    55
    66    INTEGER, INTENT(IN)       :: KULNAM
  • Source/Fortran/rwgrib2.f90

    r5b5589b r36dbabb  
    11 MODULE RWGRIB2
     2
     3!! Read or write a field variable on a lat/lon grid from/to GRIB file, or
     4!! read a field in spectral representation from GRIB file
    25
    36 CONTAINS
     
    8588!      print*,i
    8689   END DO iloop
    87 !!   write(*,*) 'readlatlon: ',i-1,' records read'
     90! !   write(*,*) 'readlatlon: ',i-1,' records read'
    8891 
    8992   DO i=1,n
     
    169172   SUBROUTINE READSPECTRAL(FILENAME,CXMN,MNAUF,MLEVEL,MAXLEV,MPAR,A,B)
    170173
    171 !!  read a GRIB file in spherical harmonics
     174!!  Read a GRIB file in spherical harmonics
    172175
    173176   USE GRIB_API
     
    249252   END DO iloop
    250253
    251 !!   write(*,*) 'readspectral: ',i-1,' records read'
     254! !   write(*,*) 'readspectral: ',i-1,' records read'
    252255 
    253256   DO i=1,n
  • Source/Python/Classes/ControlFile.py

    r0f89116 r5f67883  
    1919#        - divided assignment of attributes and the check of conditions
    2020#        - outsourced the commandline argument assignments to control attributes
     21#   June 2020 - Anne Philipp
     22#        - update default makefile to None
    2123#
    2224# @License:
    23 #    (C) Copyright 2014-2019.
     25#    (C) Copyright 2014-2020.
    2426#    Anne Philipp, Leopold Haimberger
    2527#
     
    267269    makefile : str
    268270        Name of the makefile to be used for the Fortran program.
    269         Default value is 'Makefile.gfortran'.
     271        Default value is None.
    270272
    271273    destination : str
     
    402404        self.exedir = _config.PATH_FORTRAN_SRC
    403405        self.installdir = None
    404         self.makefile = 'Makefile.gfortran'
     406        self.makefile = None
    405407        self.destination = None
    406408        self.gateway = None
  • Source/Python/Classes/EcFlexpart.py

    r53d3b2a r2c3c135  
    3939#
    4040# @License:
    41 #    (C) Copyright 2014-2019.
     41#    (C) Copyright 2014-2020.
    4242#    Anne Philipp, Leopold Haimberger
    4343#
     
    14161416                                        'stepRange', 'values'],
    14171417                              keyvalues=[inumb, int(date.strftime('%Y%m%d')),
    1418                                          date.hour*100, 0, lsp_new_np[inumb, :, it]],
     1418                                         date.hour*100, 0, lsp_new_np[inumb, :, it]]
    14191419                             )
    14201420            fluxfile.set_keys(tmpfile, filemode='ab',
     
    14791479
    14801480        gribfile = GribUtil(os.path.join(inputdir, 'rr_grib_dummy.grb'))
    1481 
    1482         gribfile.copy_dummy_msg(ifile, keynames=['paramId'],
    1483                                 keyvalues=[142], filemode='wb')
    1484 
    1485         gribfile.copy_dummy_msg(ifile, keynames=['paramId'],
    1486                                 keyvalues=[143], filemode='ab')
     1481       
     1482        gribfile.copy_dummy_msg(ifile, keynames=['paramId','paramId'],
     1483                                keyvalues=[142,143], filemode='wb')       
    14871484
    14881485        return
     
    17221719# ============================================================================================
    17231720            # create name of final output file, e.g. EN13040500 (ENYYMMDDHH)
     1721            # for CERA-20C we need all 4 digits for the year sinc 1900 - 2010
    17241722            if c.purefc:
    1725                 suffix = cdate[2:8] + '.' + ctime + '.' + cstep
     1723                if c.marsclass == 'EP':
     1724                    suffix = cdate[0:8] + '.' + ctime + '.' + cstep
     1725                else:
     1726                    suffix = cdate[2:8] + '.' + ctime + '.' + cstep
    17261727            else:
    1727                 suffix = cdate_hour[2:10]
     1728                if c.marsclass == 'EP':
     1729                    suffix = cdate_hour[0:10]
     1730                else:
     1731                    suffix = cdate_hour[2:10]
    17281732
    17291733            # if necessary, add ensemble member number to filename suffix
     
    17481752                                                c.ppid +
    17491753                                                '*')[0])
    1750             fluxfile = 'flux' + cdate[0:2] + suffix
     1754            if c.marsclass == 'EP':
     1755                fluxfile = 'flux' + suffix
     1756            else:
     1757                fluxfile = 'flux' + cdate[0:2] + suffix
    17511758            if not c.cwc:
    17521759                flist = ['fort.15', fluxfile, 'fort.16', orolsm]
  • Source/Python/Classes/GribUtil.py

    r0f89116 r2c3c135  
    1313#
    1414# @License:
    15 #    (C) Copyright 2014-2019.
     15#    (C) Copyright 2014-2020.
    1616#    Anne Philipp, Leopold Haimberger
    1717#
     
    122122
    123123
    124     def set_keys(self, fromfile, keynames, keyvalues, wherekeynames,
    125                  wherekeyvalues, filemode='wb'):
     124    def set_keys(self, fromfile, filemode='wb', keynames=[], keyvalues=[],
     125                 wherekeynames=[], wherekeyvalues=[]):
    126126        '''Opens the file to read the grib messages and then write
    127127        the selected messages (with wherekeys) to a new output file.
     
    162162
    163163        fout = open(self.filenames, filemode)
    164 
    165         with open(fromfile, 'rb') as fin:
     164       # print(fout)
     165        fin = open(fromfile, 'rb')
     166       # print(fin)
     167        while True:
    166168            gid = codes_grib_new_from_file(fin)
    167 
     169           # print('test')
     170            if gid is None:
     171                break           
     172           
    168173            select = True
    169             i = 0
    170             for wherekey in wherekeynames:
     174            #print(str(codes_get(gid,'paramId')))
     175            for i, wherekey in enumerate(wherekeynames):
    171176                if not codes_is_defined(gid, wherekey):
    172177                    raise Exception("wherekey was not defined")
     
    174179                select = (select and (str(wherekeyvalues[i]) ==
    175180                                      str(codes_get(gid, wherekey))))
    176                 i += 1
    177181
    178182            if select:
    179                 i = 0
    180                 for key in keynames:
     183                for i, key in enumerate(keynames):
    181184                    if key == 'values':
    182185                        codes_set_values(gid, keyvalues[i])
    183186                    else:
    184187                        codes_set(gid, key, keyvalues[i])
    185                     i += 1
    186188
    187189                codes_write(gid, fout)
     
    190192
    191193        fout.close()
     194        fin.close()
    192195
    193196        return
     
    229232            raise Exception("Give a value for each keyname!")
    230233
    231 
    232234        fout = open(self.filenames, filemode)
    233 
     235        fin = open(filename_in, 'rb')
     236       
    234237        fields = 0
    235 
    236         with open(filename_in, 'rb') as fin:
    237             if fields >= 1:
     238        while True:
     239            if fields >= len(keyvalues):
    238240                fout.close()
     241                fin.close()
    239242                return
    240 
     243               
    241244            gid = codes_grib_new_from_file(fin)
    242 
    243             select = True
    244             i = 0
    245             for key in keynames:
     245            if gid is None:
     246                break           
     247
     248            for i, key in enumerate(keynames):
     249               
     250                select = True
     251               
    246252                if not codes_is_defined(gid, key):
    247253                    raise Exception("Key was not defined")
     
    253259                    select = (select and (str(keyvalues[i]) !=
    254260                                          str(codes_get(gid, key))))
    255                 i += 1
    256 
    257             if select:
    258                 fields = fields + 1
    259                 codes_write(gid, fout)
    260 
     261               
     262                if select:
     263                    fields = fields + 1
     264                    codes_write(gid, fout)
     265                   
    261266            codes_release(gid)
    262267
    263268        fout.close()
     269        fin.close()
    264270
    265271        return
  • Source/Python/Classes/MarsRetrieval.py

    r0f89116 r026b359  
    2020#
    2121# @License:
    22 #    (C) Copyright 2014-2019.
     22#    (C) Copyright 2014-2020.
    2323#    Anne Philipp, Leopold Haimberger
    2424#
  • Source/Python/Classes/UioFiles.py

    rd9abaac r026b359  
    2323#
    2424# @License:
    25 #    (C) Copyright 2014-2019.
     25#    (C) Copyright 2014-2020.
    2626#    Anne Philipp, Leopold Haimberger
    2727#
  • Source/Python/Classes/__init__.py

    rba99230 r026b359  
    77#
    88# @License:
    9 #    (C) Copyright 2015-2018.
     9#    (C) Copyright 2014-2020.
     10#    Anne Philipp, Leopold Haimberger
    1011#
    11 #    This software is licensed under the terms of the Apache Licence Version 2.0
    12 #    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
     12#    SPDX-License-Identifier: CC-BY-4.0
     13#
     14#    This work is licensed under the Creative Commons Attribution 4.0
     15#    International License. To view a copy of this license, visit
     16#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
     17#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
    1318#
    1419#*******************************************************************************
  • Source/Python/Mods/__init__.py

    rba99230 r026b359  
    77#
    88# @License:
    9 #    (C) Copyright 2015-2018.
     9#    (C) Copyright 2014-2020.
     10#    Anne Philipp, Leopold Haimberger
    1011#
    11 #    This software is licensed under the terms of the Apache Licence Version 2.0
    12 #    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
     12#    SPDX-License-Identifier: CC-BY-4.0
     13#
     14#    This work is licensed under the Creative Commons Attribution 4.0
     15#    International License. To view a copy of this license, visit
     16#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
     17#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
    1318#
    1419#*******************************************************************************
  • Source/Python/Mods/disaggregation.py

    r0f89116 ra916e8f  
    1919#        - added the new disaggregation method for precipitation
    2020#
     21#    June 2020 - Anne Philipp (University of Vienna):
     22#        - reformulated formular for dapoly
     23#
    2124# @License:
    22 #    (C) Copyright 2014-2019.
     25#    (C) Copyright 2014-2020.
    2326#    Anne Philipp, Leopold Haimberger
    2427#
     
    9295
    9396    """
    94 
    95     pya = (alist[3] - alist[0] + 3. * (alist[1] - alist[2])) / 6.
    96     pyb = (alist[2] + alist[0]) / 2. - alist[1] - 9. * pya / 2.
    97     pyc = alist[1] - alist[0] - 7. * pya / 2. - 2. * pyb
    98     pyd = alist[0] - pya / 4. - pyb / 3. - pyc / 2.
    99     nfield = 8. * pya + 4. * pyb + 2. * pyc + pyd
     97   
     98    nfield = -1./12.*alist[0] + \
     99              7./12.*alist[1] + \
     100              7./12.*alist[2] - \
     101              1./12.*alist[3]
    100102
    101103    return nfield
  • Source/Python/Mods/profiling.py

    r0f89116 r026b359  
    1212#
    1313# @License:
    14 #    (C) Copyright 2018.
     14#    (C) Copyright 2020.
    1515#
    1616#    This software is licensed under the terms of the Apache Licence Version 2.0
  • Source/Python/__init__.py

    rba99230 r026b359  
    77#
    88# @License:
    9 #    (C) Copyright 2015-2018.
     9#    (C) Copyright 2014-2020.
     10#    Anne Philipp, Leopold Haimberger
    1011#
    11 #    This software is licensed under the terms of the Apache Licence Version 2.0
    12 #    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
     12#    SPDX-License-Identifier: CC-BY-4.0
     13#
     14#    This work is licensed under the Creative Commons Attribution 4.0
     15#    International License. To view a copy of this license, visit
     16#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
     17#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
    1318#
    1419#*******************************************************************************
  • Source/Python/_config.py

    r0422cad r98f09d2  
    77#
    88# @Change History:
     9#      June 2020 - Anne Philipp
     10#         - changed template filenames to .template
    911#
    1012# @License:
    11 #    (C) Copyright 2014-2019.
     13#    (C) Copyright 2014-2020.
    1214#    Anne Philipp, Leopold Haimberger
    1315#
     
    3638# ------------------------------------------------------------------------------
    3739
    38 _VERSION_STR = '7.1.1'
     40_VERSION_STR = '7.1.2'
    3941
    4042FLAG_ON_ECMWFSERVER = 'ecgb' in platform.node()
     
    5759TEMPFILE_USER_ENVVARS = 'ECMWF_ENV.template'
    5860FILE_USER_ENVVARS = 'ECMWF_ENV'
    59 TEMPFILE_INSTALL_COMPILEJOB = 'compilejob.template'
     61TEMPFILE_INSTALL_COMPILEJOB = 'installscript.template'
    6062FILE_INSTALL_COMPILEJOB = 'compilejob.ksh'
    61 TEMPFILE_INSTALL_JOB = 'job.template'
    62 TEMPFILE_JOB = 'job.temp'
     63TEMPFILE_INSTALL_JOB = 'jobscript.template'
     64TEMPFILE_JOB = 'submitscript.template'
    6365FILE_JOB_OD = 'job.ksh'
    6466FILE_JOB_OP = 'jopoper.ksh'
    65 TEMPFILE_NAMELIST = 'convert.nl'
     67TEMPFILE_NAMELIST = 'calc_etadot_nml.template'
    6668FILE_NAMELIST = 'fort.4'
    6769FILE_GRIB_INDEX = 'date_time_stepRange.idx'
  • Source/Python/submit.py

    r0f89116 ra916e8f  
    2121#        - splitted submit function to use genshi templates for the
    2222#          job script and avoid code duplication
     23#    June 2020 - Anne Philipp
     24#        - changed finale job_file to filename from config file
     25#          instead of generating from the template filename
    2326#
    2427# @License:
    25 #    (C) Copyright 2014-2019.
     28#    (C) Copyright 2014-2020.
    2629#    Anne Philipp, Leopold Haimberger
    2730#
     
    7275from Mods.get_mars_data import get_mars_data
    7376from Mods.prepare_flexpart import prepare_flexpart
    74 #from Classes.ControlFile import ControlFile
    75 
    7677
    7778# ------------------------------------------------------------------------------
     
    129130        module and variable settings for the ECMWF environment as well as
    130131        the job call and mail report instructions.
    131         Default is "job.temp".
     132        Default is _config.TEMPFILE_JOB.
    132133
    133134    c : ControlFile
     
    151152
    152153        job_file = os.path.join(_config.PATH_JOBSCRIPTS,
    153                                 jtemplate[:-5] + '.ksh')
     154                                _config.FILE_JOB_OD)
    154155
    155156        # divide time periode into specified number of job chunks
     
    189190
    190191        job_file = os.path.join(_config.PATH_JOBSCRIPTS,
    191                                 jtemplate[:-5] + 'oper.ksh')
     192                                _config.FILE_JOB_OP)
    192193
    193194        c.start_date = '${MSJ_YEAR}${MSJ_MONTH}${MSJ_DAY}'
     
    214215    ----------
    215216    jtemplate : str
    216         Job template file from sub-directory "_templates" for
     217        Job template file from sub-directory "Templates" for
    217218        submission to ECMWF. It contains all necessary
    218219        module and variable settings for the ECMWF environment as well as
    219220        the job call and mail report instructions.
    220         Default is "job.temp".
     221        Default is _config.TEMPFILE_JOB.
    221222
    222223    job_file : str
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG