- Timestamp:
- Aug 30, 2016, 6:49:41 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r1065 r1066 666 666 >>> CFvar_DIAGvar('hurs') 667 667 {'TSrhs': ['psfc', 't', 'q'], 'LMDZrhs': ['psol', 't2m', 'q2m'], 'WRFrhs': ['PSFC', 'T2', 'Q2']} 668 >>> CFvar_DIAGvar('wss') 669 {'wss': [['U10', 'V10'], ['u10m', 'v10m']]} 668 670 """ 669 671 import subprocess as sub … … 687 689 688 690 MODvars = {} 691 MODdiags = [] 689 692 for line in ncf: 690 693 if line[0:1] != '#': 691 694 values = line.replace('\n','').replace(' ','').split(',') 692 if values[0] == varn: MODvars[values[1]] = values[2].split('@') 695 if values[0] == varn: 696 MODdiags.append(values[2].split('@')) 697 698 MODvars[varn] = MODdiags 693 699 694 700 if len(MODvars) == 0: -
trunk/tools/nc_var_tools.py
r1063 r1066 15998 15998 modelvars = gen.CFvar_MODvar(varname) 15999 15999 diagvars = gen.CFvar_DIAGvar(varname) 16000 print fname + '; Lluis varname:', varname,' diagvars:', diagvars 16000 16001 16001 16002 computevarmod = [] … … 16008 16009 if diagvars is not None: 16009 16010 for diagn in diagvars.keys(): 16010 combovar = diagvars[diagn] 16011 alltrue = False 16012 if len(combovar) > 1: 16013 for cvar in combovar: 16014 if gen.searchInlist(NOchk,cvar): 16015 alltrue = True 16016 else: 16017 if gen.searchInlist(ncvars,cvar): alltrue = True 16018 else: 16019 if gen.searchInlist(ncvars,combovar[0]): alltrue = True 16020 16021 if alltrue: computevardiag.append([diagn] + combovar) 16011 combovars = diagvars[diagn] 16012 for combovar in combovars: 16013 alltrue = False 16014 if type(combovar) == type([1,2]): 16015 for cvar in combovar: 16016 if gen.searchInlist(NOchk,cvar): 16017 alltrue = True 16018 elif gen.searchInlist(ncvars,cvar): 16019 alltrue = True 16020 else: 16021 alltrue = False 16022 else: 16023 if gen.searchInlist(ncvars,combovar): alltrue = True 16024 16025 if alltrue: 16026 computevardiag.append([diagn] + combovar) 16027 break 16022 16028 16023 16029 if len(computevardiag) < 1: computevardiag = None
Note: See TracChangeset
for help on using the changeset viewer.