Changeset 64cf353 in flex_extract.git for python/prepareFLEXPART.py


Ignore:
Timestamp:
Feb 8, 2018, 9:54:05 PM (6 years ago)
Author:
Anne Philipp <bscannephilipp@…>
Branches:
master, ctbto, dev
Children:
02c8c50
Parents:
6180177
Message:

pep8 changes + documentation added + minor code style changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/prepareFLEXPART.py

    rd69b677 r64cf353  
    11#!/usr/bin/env python
    2 #             
     2#
    33# This software is licensed under the terms of the Apache Licence Version 2.0
    4 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
    5 # 
     4# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
     5#
    66# Functionality provided: Prepare input 3D-wind fields in hybrid coordinates + surface fields for FLEXPART runs
    77#
    88# Creation: October  2014 - Anne Fouilloux - University of Oslo
    9 # Extension November 2015 - Leopold Haimberger - University of Vienna for: 
     9# Extension November 2015 - Leopold Haimberger - University of Vienna for:
    1010# - using the WebAPI also for general MARS retrievals
    1111# - job submission on ecgate and cca
     
    1515# - conversion into GRIB2
    1616# - conversion into .fp format for faster execution of FLEXPART
    17 # 
    18 # Requirements: 
     17#
     18# Requirements:
    1919# in addition to a standard python 2.6 or 2.7 installation the following packages need to be installed
    20 # ECMWF WebMARS, gribAPI with python enabled, emoslib, ecaccess web toolkit, all available from https://software.ecmwf.int/
     20# ECMWF WebMARS, gribAPI with python enabled, emoslib, ecaccess web toolkit,
     21# all available from https://software.ecmwf.int/
    2122# dateutils
    2223# matplotlib (optional, for debugging)
    23 # 
     24#
    2425import calendar
    2526import shutil
     
    3637#from string import strip
    3738from GribTools import GribTools
    38 from FlexpartTools import EIFlexpart, Control,interpret_args_and_control, cleanup
     39from FlexpartTools import EIFlexpart, Control, interpret_args_and_control, cleanup
    3940
    4041hostname=socket.gethostname()
     
    4546        import ecmwfapi
    4647except ImportError:
    47     ecapi=False
    48    
     48    ecapi = False
     49
    4950
    5051def prepareFLEXPART(args,c):
     
    5354
    5455    namelist='fort.4'
    55    
     56
    5657    if not args.ppid:
    5758        c.ppid=str(os.getppid())
     
    7879    inputfiles.listFiles(c.inputdir, '*OG_acc_SL*.'+c.ppid+'.*')
    7980    if not os.path.exists(c.outputdir):
    80         os.makedirs(c.outputdir)
    81        
     81    os.makedirs(c.outputdir)
     82
    8283    flexpart = EIFlexpart(c,fluxes=True)
    8384    flexpart.create_namelist(c,'fort.4')
     
    9798
    9899    if int(c.debug)!=0:
    99         print('Temporary files left intact')
     100    print('Temporary files left intact')
    100101    else:
    101         cleanup(c)
     102    cleanup(c)
    102103
    103104if __name__ == "__main__":
    104     args,c=interpret_args_and_control()
    105     prepareFLEXPART(args,c)
     105    args, c = interpret_args_and_control()
     106    prepareFLEXPART(args, c)
    106107    cleanup(c)
    107    
     108
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG