Changeset 2166 in lmdz_wrf
- Timestamp:
- Oct 4, 2018, 10:45:23 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r2164 r2166 25 25 fillValue = 1.e20 26 26 fillValueF = 1.e20 27 fillValueR = 1.e20 27 28 fillValueD = 1.e20 28 29 fillValueC = '-' … … 2351 2352 22 2352 2353 """ 2353 2354 2354 fname = 'index_vec' 2355 2355 … … 2360 2360 valpos = i 2361 2361 break 2362 elif type(vec) == type(tuple([1,2])): 2363 valpos = -1 2364 for i in range(len(vec)): 2365 if vec[i] == val: 2366 valpos = i 2367 break 2362 2368 elif type(vec) == type(range(2)): 2363 2369 valpos = vec.index(val) 2370 else: 2371 print errormsg 2372 print ' ' + fname + ': type', type(vec), 'not ready !!' 2373 print ' available ones:', type(np.arange(2)), type(range(2)), \ 2374 type(tuple([1,2])) 2375 quit(-1) 2364 2376 2365 2377 return valpos … … 14132 14144 print ' available ones:', type(np.arange(1)), type(range(2)) 14133 14145 quit(-1) 14134 print 'mat times _______'14135 for it in range(dimt):14136 print ' ',it, mattimes[it,:]14146 #print 'mat times _______' 14147 #for it in range(dimt): 14148 # print ' ',it, mattimes[it,:] 14137 14149 14138 14150 # Beginning and Ending of time data … … 14146 14158 istats = mattimes[0,:] 14147 14159 estats = mattimes[dimt-1,:] 14148 print 'idate:', idate, 'edate:', edate14160 #print 'idate:', idate, 'edate:', edate 14149 14161 14150 14162 # Getting the dates … … 14281 14293 Nslices = len(stmatdates) 14282 14294 stmdates = np.zeros((Nslices,6), dtype=np.int) 14283 print ' dates slices ________'14295 #print ' dates slices ________' 14284 14296 for islc in range(Nslices): 14285 print islc, ' ', stmatdates[islc]14297 # print islc, ' ', stmatdates[islc] 14286 14298 stmdates[islc,:] = stmatdates[islc] 14287 14299 … … 14302 14314 14303 14315 Nslices = len(slices) 14316 print infmsg 14317 print ' ' + fname + ' slices _______' 14304 14318 for isl in range(Nslices-1): 14305 print isl, stmatdates[isl], stmatdates[isl+1], ':', slices[isl]14319 print ' ', isl, stmatdates[isl], stmatdates[isl+1], ':', slices[isl] 14306 14320 14307 14321 return slices, Nslices
Note: See TracChangeset
for help on using the changeset viewer.