Changeset 64cf353 in flex_extract.git for python/prepareFLEXPART.py
- Timestamp:
- Feb 8, 2018, 9:54:05 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 02c8c50
- Parents:
- 6180177
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/prepareFLEXPART.py
rd69b677 r64cf353 1 1 #!/usr/bin/env python 2 # 2 # 3 3 # 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 # 6 6 # Functionality provided: Prepare input 3D-wind fields in hybrid coordinates + surface fields for FLEXPART runs 7 7 # 8 8 # 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: 10 10 # - using the WebAPI also for general MARS retrievals 11 11 # - job submission on ecgate and cca … … 15 15 # - conversion into GRIB2 16 16 # - conversion into .fp format for faster execution of FLEXPART 17 # 18 # Requirements: 17 # 18 # Requirements: 19 19 # 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/ 21 22 # dateutils 22 23 # matplotlib (optional, for debugging) 23 # 24 # 24 25 import calendar 25 26 import shutil … … 36 37 #from string import strip 37 38 from GribTools import GribTools 38 from FlexpartTools import EIFlexpart, Control, interpret_args_and_control, cleanup39 from FlexpartTools import EIFlexpart, Control, interpret_args_and_control, cleanup 39 40 40 41 hostname=socket.gethostname() … … 45 46 import ecmwfapi 46 47 except ImportError: 47 ecapi =False48 48 ecapi = False 49 49 50 50 51 def prepareFLEXPART(args,c): … … 53 54 54 55 namelist='fort.4' 55 56 56 57 if not args.ppid: 57 58 c.ppid=str(os.getppid()) … … 78 79 inputfiles.listFiles(c.inputdir, '*OG_acc_SL*.'+c.ppid+'.*') 79 80 if not os.path.exists(c.outputdir): 80 81 81 os.makedirs(c.outputdir) 82 82 83 flexpart = EIFlexpart(c,fluxes=True) 83 84 flexpart.create_namelist(c,'fort.4') … … 97 98 98 99 if int(c.debug)!=0: 99 100 print('Temporary files left intact') 100 101 else: 101 102 cleanup(c) 102 103 103 104 if __name__ == "__main__": 104 args, c=interpret_args_and_control()105 prepareFLEXPART(args, c)105 args, c = interpret_args_and_control() 106 prepareFLEXPART(args, c) 106 107 cleanup(c) 107 108
Note: See TracChangeset
for help on using the changeset viewer.