Changeset 2d56c04 in flex_extract.git
- Timestamp:
- Nov 27, 2018, 11:34:34 PM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 6cda7c1
- Parents:
- d8785f8
- Location:
- source/python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/ControlFile.py
rd8785f8 r2d56c04 327 327 # otherwise program is not allowed to run 328 328 if not self.start_date: 329 print('start_date specified neither in command line nor \330 329 print('start_date specified neither in command line nor ' 330 'in CONTROL file ' + self.controlfile) 331 331 print('Try "' + sys.argv[0].split('/')[-1] + 332 332 ' -h" to print usage information') … … 365 365 print('Check parameter "LEVEL" or the max level of "LEVELIST"!') 366 366 sys.exit(1) 367 368 # if area was provided (only from commandline)369 # decompose area into its 4 components370 if self.area:371 components = self.area.split('/')372 # convert float to integer coordinates373 if '.' in self.area:374 components = [str(int(float(item) * 1000))375 for i, item in enumerate(components)]376 self.upper, self.left, self.lower, self.right = components377 367 378 368 # prepare step list if "/" signs are found … … 386 376 elif 'to' in self.step.lower() and 'by' not in self.step.lower(): 387 377 my_error(self.mailfail, self.step + ':\n' + 388 'if "to" is used in steps parameter, \389 please use "by" as well')378 'if "to" is used in steps parameter, ' 379 'please use "by" as well') 390 380 else: 391 381 self.step = steps … … 427 417 not self.gateway or not self.destination or \ 428 418 not self.ecuid or not self.ecgid: 429 print('\nEnvironment variables GATEWAY, DESTINATION, ECUID and \430 431 print('Please check for existence of file "ECMWF_ENV" in the \432 419 print('\nEnvironment variables GATEWAY, DESTINATION, ECUID and ' 420 'ECGID were not set properly!') 421 print('Please check for existence of file "ECMWF_ENV" in the ' 422 'python directory!') 433 423 sys.exit(1) 434 424 … … 484 474 print('Use default value "12" for flux forecast!') 485 475 self.accmaxstep='12' 476 477 # if area was provided (only from commandline) 478 # decompose area into its 4 components 479 if self.area: 480 components = self.area.split('/') 481 self.upper, self.left, self.lower, self.right = components 482 483 # convert grid and area components to correct format and input 484 if 'N' in self.grid: # Gaussian output grid 485 self.area = 'G' 486 else: 487 # check on grid format 488 if float(self.grid) / 100. >= 0.5: 489 # grid is defined in 1/1000 degrees; old method 490 self.grid = '{}/{}'.format(float(self.grid) / 1000., 491 float(self.grid) / 1000.) 492 self.area = '{}/{}/{}/{}'.format(float(self.upper) / 1000., 493 float(self.left) / 1000., 494 float(self.lower) / 1000., 495 float(self.right) / 1000.) 496 elif float(self.grid) / 100. < 0.5: 497 # grid is defined in normal degree; new method 498 self.grid = '{}/{}'.format(float(self.grid), float(self.grid)) 499 self.area = '{}/{}/{}/{}'.format(float(self.upper), 500 float(self.left), 501 float(self.lower), 502 float(self.right)) 486 503 487 504 return -
source/python/classes/EcFlexpart.py
rd43706b r2d56c04 194 194 self.glevelist = '1/to/' + c.level 195 195 self.gaussian = c.gaussian 196 197 if 'N' in c.grid: # Gaussian output grid 198 self.grid = c.grid 199 self.area = 'G' 200 else: 201 self.grid = '{}/{}'.format(int(c.grid) / 1000., int(c.grid) / 1000.) 202 self.area = '{}/{}/{}/{}'.format(int(c.upper) / 1000., 203 int(c.left) / 1000., 204 int(c.lower) / 1000., 205 int(c.right) / 1000.) 206 196 self.grid = c.grid 197 self.area = c.area 207 198 self.outputfilelist = [] 208 199 … … 1107 1098 is set to 1 in CONTROL file') 1108 1099 1100 # write out all output to log file before starting fortran programm 1101 sys.stdout.flush() 1102 1109 1103 # Fortran program creates file fort.15 (with u,v,etadot,t,sp,q) 1110 1104 p = subprocess.check_call([os.path.join( -
source/python/mods/tools.py
r786cfd6 r2d56c04 106 106 return True 107 107 return False 108 109 110 108 111 109 def get_cmdline_arguments():
Note: See TracChangeset
for help on using the changeset viewer.