Changeset 1068 in lmdz_wrf
- Timestamp:
- Aug 31, 2016, 1:12:33 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
-
generic_tools.py (modified) (1 diff)
-
nc_var_tools.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r1066 r1068 689 689 690 690 MODvars = {} 691 MODdiags = []692 691 for line in ncf: 693 692 if line[0:1] != '#': 694 693 values = line.replace('\n','').replace(' ','').split(',') 695 694 if values[0] == varn: 696 MODdiags.append(values[2].split('@')) 697 698 MODvars[varn] = MODdiags 695 MODdiags = values[2].split('@') 696 if MODvars.has_key(values[1]): 697 oldvals = MODvars[values[1]] 698 oldvals = [oldvals, MODdiags] 699 MODvars[values[1]] = oldvals 700 else: 701 MODvars[values[1]] = MODdiags 699 702 700 703 if len(MODvars) == 0: -
trunk/tools/nc_var_tools.py
r1066 r1068 15998 15998 modelvars = gen.CFvar_MODvar(varname) 15999 15999 diagvars = gen.CFvar_DIAGvar(varname) 16000 print fname + '; Lluis varname:', varname,' diagvars:', diagvars16001 16000 16002 16001 computevarmod = [] … … 16010 16009 for diagn in diagvars.keys(): 16011 16010 combovars = diagvars[diagn] 16012 for combovar in combovars: 16011 # Checking if there is more than one possible combination 16012 if type(combovars[0]) == type([1,2]): 16013 for combovs in combovars: 16014 alltrue = False 16015 if type(combovs) == type([1,2]): 16016 for cvar in combovs: 16017 if gen.searchInlist(NOchk,cvar): 16018 alltrue = True 16019 elif gen.searchInlist(ncvars,cvar): 16020 alltrue = True 16021 else: 16022 alltrue = False 16023 else: 16024 if gen.searchInlist(ncvars,combovs): alltrue = True 16025 16026 if alltrue: 16027 computevardiag.append([diagn] + combovs) 16028 break 16029 else: 16030 combovar = combovars 16013 16031 alltrue = False 16014 16032 if type(combovar) == type([1,2]): … … 16026 16044 computevardiag.append([diagn] + combovar) 16027 16045 break 16046 if alltrue: break 16028 16047 16029 16048 if len(computevardiag) < 1: computevardiag = None … … 16033 16052 def computevar_model(values, ncfile): 16034 16053 """ Function to provide the way to compute a CF-variable providing its name 16035 va rname= CF-compilant variable name16054 values= CF-compilant variable name 16036 16055 ncfile= netCDF file from which the variable should be retrieved 16037 16056 """
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/LMDZ_WRF/chrome/site/your_project_logo.png)