Changeset 2029 in lmdz_wrf


Ignore:
Timestamp:
Aug 6, 2018, 4:39:09 PM (7 years ago)
Author:
lfita
Message:

Fixing `inf_operSlist' threshold on negative intervals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2028 r2029  
    1362013620      char= character to provide different values
    1362113621      oper= available operations
     13622        'getvalue': get the value at a given index
    1362213623        'maxloc': index of the maximum value
    1362313624        'minloc': index of the minimum value
     
    1363513636    """
    1363613637    fname = 'inf_operSlist'
    13637     availoper = ['maxloc', 'minloc', 'sort', 'threshold']
     13638    availoper = ['getvalue', 'getvalue''maxloc', 'minloc', 'sort', 'threshold']
    1363813639
    1363913640    haschar = listS.find(char)
     
    1364613647    listv = str_list_k(listS, char, 'F')
    1364713648
    13648     if oper == 'maxloc':
     13649    if oper == 'getvalue':
     13650        return listv[int(values)]
     13651    elif oper == 'maxloc':
    1364913652        xl = np.max(listv)
    1365013653        return index_vec(listv, xl)
     
    1369813701        elif sign < 0.:
    1369913702            for iloc in range(Nval-1):
    13700                 if listv[iloc] >= val and listv[iloc-1] < val: return iloc
     13703                if listv[iloc+1] >= val and listv[iloc] < val: return iloc
    1370113704            return Nval
    1370213705
Note: See TracChangeset for help on using the changeset viewer.