Changeset 0e576fc in flex_extract.git for source/python/classes/EcFlexpart.py


Ignore:
Timestamp:
Oct 8, 2018, 3:44:58 PM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
0aaeb04
Parents:
ae88f7d
Message:

implemented extraction possibility of EA5 und CERA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/classes/EcFlexpart.py

    r5bad6ec r0e576fc  
    135135
    136136        if c.maxstep > len(c.type):    # Pure forecast mode
    137             c.type = [c.type[1]]
     137            c.type = [c.type[0]]
    138138            c.step = ['{:0>3}'.format(int(c.step[0]))]
    139139            c.time = [c.time[0]]
     
    155155            # the initialisation times of the flux fields
    156156            # 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)}
    159160        else:
    160161            for ty, st, ti in zip(c.type, c.step, c.time):
     
    165166                    btlist = [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0]
    166167
    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):
    168174
    169175                    if ty not in self.types.keys():
     
    191197        # for gaussian grid retrieval
    192198        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
    198200
    199201        if 'N' in c.grid:  # Gaussian output grid
     
    239241                self.params['OG__SL'][0] += '/' + '/'.join(c.addpar)
    240242
    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]
    243249
    244250            self.params['OG__ML'] = ['T/Q', 'ML', self.levelist, self.grid]
     
    543549                if pk == 'OG_OROLSM__SL' and not oro:
    544550                    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'
    546554                    retr_param_dict['type'] = 'AN'
    547555                    retr_param_dict['time'] = '00'
     
    834842                    values = (np.reshape(values, (nj, ni))).flatten() / fak
    835843                    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):
    837846                        svdp.append(values[:] / int(c.dtime))
    838847                    else:  # deaccumulate values
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG