Changeset 0e576fc in flex_extract.git
- Timestamp:
- Oct 8, 2018, 3:44:58 PM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 0aaeb04
- Parents:
- ae88f7d
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
run/run.sh
r5bad6ec r0e576fc 23 23 LEVELIST=None 24 24 AREA=None 25 INPUTDIR='/nas/tmc/Anne/Interpolation/flexextract/flex_extract_v7.1/run/workspace/test '25 INPUTDIR='/nas/tmc/Anne/Interpolation/flexextract/flex_extract_v7.1/run/workspace/test3' 26 26 OUTPUTDIR=None 27 27 FLEXPART_ROOT_SCRIPTS=None 28 28 PP_ID=None 29 29 JOB_TEMPLATE='job.temp' 30 CONTROLFILE='CONTROL_E I.public'30 CONTROLFILE='CONTROL_EA5' 31 31 DEBUG=1 32 REQUEST= 133 PUBLIC= 132 REQUEST=2 33 PUBLIC=0 34 34 35 35 # ----------------------------------------------------------------- -
source/python/classes/ControlFile.py
r5bad6ec r0e576fc 113 113 self.time = None 114 114 self.step = None 115 self.acctype = None 116 self.acctime = None 117 self.accmaxstep = None 115 118 self.marsclass = None 116 119 self.dataset = None … … 118 121 self.number = 'OFF' 119 122 self.expver = '1' 123 self.gaussian = '' 120 124 self.grid = None 121 125 self.area = '' … … 346 350 # check for having at least a starting date 347 351 # otherwise program is not allowed to run 348 if self.start_date is None:352 if not self.start_date: 349 353 print('start_date specified neither in command line nor \ 350 354 in CONTROL file ' + self.controlfile) … … 354 358 355 359 # retrieve just one day if end_date isn't set 356 if self.end_date is None:360 if not self.end_date: 357 361 self.end_date = self.start_date 358 362 … … 365 369 366 370 # assure consistency of levelist and level 367 if self.levelist is None and self.level is None: 371 # up-to-date available maximum level numbers at ECMWF, 05.10.2018 372 max_level_list = [16, 19, 31, 40, 50, 60, 62, 91, 137] 373 if not self.levelist and not self.level: 368 374 print('Warning: neither levelist nor level \ 369 375 specified in CONTROL file') 370 376 sys.exit(1) 371 elif self.levelist is Noneand self.level:377 elif not self.levelist and self.level: 372 378 self.levelist = '1/to/' + self.level 373 elif (self.levelist and self.level is None) or \379 elif (self.levelist and not self.level) or \ 374 380 (self.levelist[-1] != self.level[-1]): 375 381 self.level = self.levelist.split('/')[-1] 376 382 else: 377 383 pass 384 385 # check if max level is a valid level 386 if int(self.level) not in max_level_list: 387 print('ERROR: ') 388 print('LEVEL must be the maximum level of a specified ' 389 'level list from ECMWF, e.g.') 390 print('[16, 19, 31, 40, 50, 60, 62, 91 or 137]') 391 print('Check parameter "LEVEL" or the max level of "LEVELIST"!') 392 sys.exit(1) 378 393 379 394 # if area was provided (only from commandline) … … 404 419 # if maxstep wasn't provided 405 420 # search for it in the "step" parameter 406 if self.maxstep is None:421 if not self.maxstep: 407 422 self.maxstep = 0 408 423 for s in self.step: … … 461 476 'the "dataset"-parameter has to be set in the control file!') 462 477 sys.exit(1) 478 479 if not isinstance(self.type, list): 480 self.type = [self.type] 481 482 for i, val in enumerate(self.type): 483 if self.type[i] == 'AN' and int(self.step[i]) != 0: 484 print('Analysis retrievals must have STEP = 0 (is set to 0)') 485 self.type[i] = 0 486 487 if not isinstance(self.time, list): 488 self.time = [self.time] 489 490 if not isinstance(self.step, list): 491 self.step = [self.step] 492 493 if not self.acctype: 494 print('... Control paramter ACCTYPE was not defined.') 495 try: 496 if len(self.type) > 1 and self.type[1] != 'AN': 497 print('Use old setting by using TYPE[1] for flux forecast!') 498 self.acctype = self.type[1] 499 except: 500 print('Use default value "FC" for flux forecast!') 501 self.acctype='FC' 502 503 if not self.acctime: 504 print('... Control paramter ACCTIME was not defined.') 505 print('Use default value "00/12" for flux forecast!') 506 self.acctime='00/12' 507 508 if not self.accmaxstep: 509 print('... Control paramter ACCMAXSTEP was not defined.') 510 print('Use default value "12" for flux forecast!') 511 self.accmaxstep='12' 463 512 464 513 return -
source/python/classes/EcFlexpart.py
r5bad6ec r0e576fc 135 135 136 136 if c.maxstep > len(c.type): # Pure forecast mode 137 c.type = [c.type[ 1]]137 c.type = [c.type[0]] 138 138 c.step = ['{:0>3}'.format(int(c.step[0]))] 139 139 c.time = [c.time[0]] … … 155 155 # the initialisation times of the flux fields 156 156 # and therefore are zero all the time) 157 self.types[c.type[1]] = {'times': '00/12', 'steps': 158 '{}/to/12/by/{}'.format(c.dtime, c.dtime)} 157 self.types[str(c.acctype)] = {'times': str(c.acctime), 158 'steps': '{}/to/{}/by/{}'.format( 159 c.dtime, c.accmaxstep, c.dtime)} 159 160 else: 160 161 for ty, st, ti in zip(c.type, c.step, c.time): … … 165 166 btlist = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0] 166 167 167 if i % int(c.dtime) == 0 and (i in btlist or c.maxstep > 24): 168 if ((ty.upper() == 'AN' and 169 int(c.time[i]) % int(c.dtime) ==0) or 170 (ty.upper() != 'AN' and 171 int(c.step[i]) % int(c.dtime) == 0 and 172 int(c.step[i]) % int(c.dtime) == 0) ) and \ 173 (int(c.time[i]) in btlist or c.maxstep > 24): 168 174 169 175 if ty not in self.types.keys(): … … 191 197 # for gaussian grid retrieval 192 198 self.glevelist = '1/to/' + c.level 193 194 if hasattr(c, 'gaussian') and c.gaussian: 195 self.gaussian = c.gaussian 196 else: 197 self.gaussian = '' 199 self.gaussian = c.gaussian 198 200 199 201 if 'N' in c.grid: # Gaussian output grid … … 239 241 self.params['OG__SL'][0] += '/' + '/'.join(c.addpar) 240 242 241 self.params['OG_OROLSM__SL'] = ["160/27/28/173", \ 242 'SFC', '1', self.grid] 243 if c.marsclass.upper() == 'EA' or c.marsclass.upper() == 'EP': 244 self.params['OG_OROLSM__SL'] = ["160/27/28/244", 245 'SFC', '1', self.grid] 246 else: 247 self.params['OG_OROLSM__SL'] = ["160/27/28/173", \ 248 'SFC', '1', self.grid] 243 249 244 250 self.params['OG__ML'] = ['T/Q', 'ML', self.levelist, self.grid] … … 543 549 if pk == 'OG_OROLSM__SL' and not oro: 544 550 oro = True 545 retr_param_dict['stream'] = 'OPER' 551 # in CERA20C (class EP) there is no stream "OPER"! 552 if self.marsclass.upper() != 'EP': 553 retr_param_dict['stream'] = 'OPER' 546 554 retr_param_dict['type'] = 'AN' 547 555 retr_param_dict['time'] = '00' … … 834 842 values = (np.reshape(values, (nj, ni))).flatten() / fak 835 843 vdp.append(values[:]) # save the accumulated values 836 if step <= int(c.dtime): 844 if c.marsclass.upper() == 'EA' or \ 845 step <= int(c.dtime): 837 846 svdp.append(values[:] / int(c.dtime)) 838 847 else: # deaccumulate values -
source/python/classes/MarsRetrieval.py
r5bad6ec r0e576fc 463 463 # find all keys without a value and convert all other values to strings 464 464 empty_keys = [] 465 for key, value in attrs.it teritems():465 for key, value in attrs.iteritems(): 466 466 if value == '': 467 467 empty_keys.append(str(key)) … … 486 486 print("ERROR: ", e) 487 487 print('MARS Request failed!') 488 if not self.public and os.stat(target).st_size == 0: 489 print('MARS Request returned no data - please check request') 490 raise IOError 491 elif self.public and os.stat(target).st_size == 0: 492 print('Public MARS Request returned no data - ' 493 'please check request') 494 raise IOError 495 else: 496 raise IOError 488 if not self.public and os.stat(target).st_size == 0: 489 print('MARS Request returned no data - ' 490 'please check request') 491 raise IOError 492 elif self.public and os.stat(target).st_size == 0: 493 print('Public MARS Request returned no data - ' 494 'please check request') 495 raise IOError 496 else: 497 raise IOError 497 498 # MARS request via extra process in shell 498 499 else: … … 515 516 print('MARS Request returned no data - please check request') 516 517 raise IOError 517 else:518 raise519 518 520 519 return
Note: See TracChangeset
for help on using the changeset viewer.