Changeset 4971f63 in flex_extract.git for source/python
- Timestamp:
- Sep 27, 2018, 12:31:47 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 82b624a
- Parents:
- 25b14be
- Location:
- source/python
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/ControlFile.py
r25b14be r4971f63 180 180 181 181 # read whole CONTROL file 182 with open(os.path.join(_config.PATH_CONTROLFILES, 183 self.controlfile)) as f: 184 fdata = f.read().split('\n') 182 183 try: 184 with open(os.path.join(_config.PATH_CONTROLFILES, 185 self.controlfile)) as f: 186 fdata = f.read().split('\n') 187 except IOError: 188 print('Could not read CONTROL file "' + args.controlfile + '"') 189 print('Either it does not exist or its syntax is wrong.') 190 print('Try "' + sys.argv[0].split('/')[-1] + \ 191 ' -h" to print usage information') 192 sys.exit(1) 185 193 186 194 # go through every line and store parameter -
source/python/classes/EcFlexpart.py
r25b14be r4971f63 807 807 over all messages in each grib file which were passed through the 808 808 parameter "inputfiles" to seperate specific parameters into fort.* 809 files. Afterwards the FORTRAN program Convert2is called to convert809 files. Afterwards the FORTRAN program is called to convert 810 810 the data fields all to the same grid and put them in one file 811 811 per unique time step (combination of "date", "time" and … … 866 866 # per date e.g. time = 0, 1200 867 867 # per time e.g. step = 3, 6, 9, 12 868 # flag for Fortran program CONVERT2and file merging868 # flag for Fortran program and file merging 869 869 convertFlag = False 870 870 print('current prod: ', prod) … … 884 884 # Combine all temporary data files into final grib file if 885 885 # gid is at least one time not None. Therefore set convertFlag 886 # to save information. The fortran program CONVERT2is also887 # only doneif convertFlag is True886 # to save information. The Fortran program is also 887 # only executed if convertFlag is True 888 888 convertFlag = True 889 889 # remove old fort.* files and open new ones … … 997 997 f.close() 998 998 999 # call for CONVERT2if flag is True999 # call for Fortran program if flag is True 1000 1000 if convertFlag: 1001 1001 pwd = os.getcwd() … … 1009 1009 1010 1010 # create the corresponding output file fort.15 1011 # (generated by CONVERT2) + fort.16 (paramId 167 and 168)1012 p = subprocess.check_call([os.path.join( c.exedir, 'CONVERT2')],1013 1011 # (generated by Fortran program) + fort.16 (paramId 167 and 168) 1012 p = subprocess.check_call([os.path.join( 1013 c.exedir, _config.FORTRAN_EXECUTABLE)], shell=True) 1014 1014 os.chdir(pwd) 1015 1015 -
source/python/install.py
r25b14be r4971f63 78 78 ''' 79 79 80 #os.chdir(_config.PATH_LOCAL_PYTHON)81 82 80 args = get_install_cmdline_arguments() 83 84 try: 85 c = ControlFile(args.controlfile) 86 except IOError: 87 print('Could not read CONTROL file "' + args.controlfile + '"') 88 print('Either it does not exist or its syntax is wrong.') 89 print('Try "' + sys.argv[0].split('/')[-1] + 90 ' -h" to print usage information') 91 exit(1) 92 81 c = ControlFile(args.controlfile) 93 82 c.assign_args_to_control(args) 94 83 c.check_install_conditions() -
source/python/mods/get_mars_data.py
r25b14be r4971f63 79 79 80 80 args = get_cmdline_arguments() 81 82 try: 83 c = ControlFile(args.controlfile) 84 except IOError: 85 print('Could not read CONTROL file "' + args.controlfile + '"') 86 print('Either it does not exist or its syntax is wrong.') 87 print('Try "' + sys.argv[0].split('/')[-1] + \ 88 ' -h" to print usage information') 89 sys.exit(1) 81 c = ControlFile(args.controlfile) 90 82 91 83 env_parameter = read_ecenv(_config.PATH_ECMWF_ENV) -
source/python/mods/prepare_flexpart.py
r25b14be r4971f63 89 89 90 90 args = get_cmdline_arguments() 91 92 try: 93 c = ControlFile(args.controlfile) 94 except IOError: 95 print('Could not read CONTROL file "' + args.controlfile + '"') 96 print('Either it does not exist or its syntax is wrong.') 97 print('Try "' + sys.argv[0].split('/')[-1] + \ 98 ' -h" to print usage information') 99 sys.exit(1) 91 c = ControlFile(args.controlfile) 100 92 101 93 env_parameter = read_ecenv(_config.PATH_ECMWF_ENV) -
source/python/submit.py
r25b14be r4971f63 77 77 78 78 args = get_cmdline_arguments() 79 80 try: 81 c = ControlFile(args.controlfile) 82 except IOError: 83 print('Could not read CONTROL file "' + args.controlfile + '"') 84 print('Either it does not exist or its syntax is wrong.') 85 print('Try "' + sys.argv[0].split('/')[-1] + \ 86 ' -h" to print usage information') 87 sys.exit(1) 79 c = ControlFile(args.controlfile) 88 80 89 81 env_parameter = read_ecenv(_config.PATH_ECMWF_ENV) … … 95 87 # on ECMWF server this would also be the local side 96 88 called_from_dir = os.getcwd() 97 if args.queue is None:89 if not args.queue: 98 90 if c.inputdir[0] != '/': 99 91 c.inputdir = os.path.join(called_from_dir, c.inputdir)
Note: See TracChangeset
for help on using the changeset viewer.