Changeset f20af73 in flex_extract.git for source/python/mods/prepare_flexpart.py


Ignore:
Timestamp:
Mar 8, 2019, 10:05:20 AM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
82c2959
Parents:
b4a4777
Message:

added CDS API support for ERA5 instead of ECMWFAPI / refactored setup of CONTROL parameter because for local version it wanted to use not installed ECMWF_ENV file.

File:
1 edited

Legend:

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

    re811e1a rf20af73  
    7171    inspect.getfile(inspect.currentframe()))) + '/../')
    7272import _config
    73 from checks import check_ppid
     73from .checks import check_ppid
    7474from classes.UioFiles import UioFiles
    7575from classes.ControlFile import ControlFile
    76 from tools import clean_up, get_cmdline_args, read_ecenv, make_dir
     76from .tools import (setup_controldata, clean_up, get_cmdline_args,
     77                   read_ecenv, make_dir)
    7778from classes.EcFlexpart import EcFlexpart
    78 
    79 ecapi = 'ecmwf' not in socket.gethostname()
    80 try:
    81     if ecapi:
    82         import ecmwfapi
    83 except ImportError:
    84     ecapi = False
    8579
    8680# ------------------------------------------------------------------------------
     
    10195    '''
    10296
    103     args = get_cmdline_args()
    104     c = ControlFile(args.controlfile)
    105 
    106     env_parameter = read_ecenv(_config.PATH_ECMWF_ENV)
    107     c.assign_args_to_control(args)
    108     c.assign_envs_to_control(env_parameter)
    109     c.check_conditions(args.queue)
    110 
    111     prepare_flexpart(args.ppid, c)
     97    c, ppid, _, _ = setup_controldata()
     98    prepare_flexpart(ppid, c)
     99    normal_exit('Preparing FLEXPART output files: Done!')
    112100
    113101    return
     
    136124    '''
    137125    check_ppid(c, ppid)
    138 
    139     c.ecapi = ecapi
    140126
    141127    # create the start and end date
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG