- Timestamp:
- Jul 14, 2019, 8:49:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.py
r2679 r2681 103 103 104 104 # Variables not to check 105 NONcheckingvars = ['accum', 'cllmh', 'deaccum', 'face', 'LONLATdxdy', 106 ' params', 'reglonlatbnds', 'TSrhs', 'TStd', 'TSwds', 'TSwss',\105 NONcheckingvars = ['accum', 'cllmh', 'deaccum', 'face', 'LONLATdxdy', 'LONLATdx', \ 106 'LONLATdy', 'params', 'reglonlatbnds', 'TSrhs', 'TStd', 'TSwds', 'TSwss', \ 107 107 'UNua', 'UNva', 'UNwa', \ 108 108 'WRFbils', 'WRFbnds', \ … … 170 170 WRFz_compute = False 171 171 WRFdx_compute = False 172 WRFd x_compute = False172 WRFdy_compute = False 173 173 WRFdz_compute = False 174 174 WRFdxdy_compute = False 175 175 WRFdxdywps_compute = False 176 176 LONLATdxdy_compute = False 177 LONLATdx_compute = False 178 LONLATdy_compute = False 177 179 UNua_compute = False 178 180 UNva_compute = False … … 208 210 if dnv == 'WRFdxdywps':WRFdxdywps_compute = True 209 211 if dnv == 'LONLATdxdy':LONLATdxdy_compute = True 212 if dnv == 'LONLATdx':LONLATdx_compute = True 213 if dnv == 'LONLATdy':LONLATdy_compute = True 210 214 if dnv[0:4] == 'UNua': 211 215 UNua_compute = True … … 240 244 if depvars == 'WRFdxdywps': WRFdxdywps_compute = True 241 245 if depvars == 'LONLATdxdy': LONLATdxdy_compute = True 246 if depvars == 'LONLATdx': LONLATdx_compute = True 247 if depvars == 'LONLATdy': LONLATdy_compute = True 242 248 if depvars[0:4] == 'UNua': 243 249 UNua_compute = True … … 266 272 if gen.searchInlist(depvars, 'WRFdxdywps'): WRFdxdywps_compute = True 267 273 if gen.searchInlist(depvars, 'LONLATdxdy'): LONLATdxdy_compute = True 274 if gen.searchInlist(depvars, 'LONLATdx'): LONLATdx_compute = True 275 if gen.searchInlist(depvars, 'LONLATdy'): LONLATdy_compute = True 268 276 if gen.searchInlist_Strsec(depvars, 0, 3, 'UNua'): 269 277 UNua_compute = True … … 462 470 'long_name': Vvals[4].replace('|',' '), 'units': Vvals[5]} 463 471 464 if WRFdxdy_compute or WRFdx_compute or WRFdy_co pute:472 if WRFdxdy_compute or WRFdx_compute or WRFdy_compute: 465 473 print ' ' + main + ': Retrieving dxdy: real distance between grid points ' + \ 466 474 'from WRF as dx=(XLONG(i+1)-XLONG(i))*DX/MAPFAC_M, dy=(XLAT(j+1)-XLAT(i))*DY/'+\ … … 549 557 'long_name': Vvals[4].replace('|',' '), 'units': Vvals[5]} 550 558 551 if LONLATdxdy_compute :559 if LONLATdxdy_compute or LONLATdx_compute or LONLATdy_compute : 552 560 print ' ' + main + ': Retrieving dxdy: real distance between grid points ' + \ 553 561 'from a regular lonlat projection as dx=(lon[i+1]-lon[i])*raddeg*Rearth*' + \ … … 921 929 var1 = ncobj.variables[depvars[1]] 922 930 var2 = ncobj.variables[depvars[2]] 923 if depvars[3] == 'WRFdx' : var3 = WRFdx931 if depvars[3] == 'WRFdx' or depvars[3] == 'LONLATdx': var3 = WRFdx 924 932 else: var3 = ncobj.variables[depvars[3]] 925 if depvars[4] == 'WRFdy' : var4 = WRFdy933 if depvars[4] == 'WRFdy' or depvars[4] == 'LONLATdy': var4 = WRFdy 926 934 else: var4 = ncobj.variables[depvars[4]] 927 935 par1 = np.float(depvars[5].split(':')[1]) … … 997 1005 else: var3 = ncobj.variables[depvars[3]][:] 998 1006 if depvars[4] == 'WRFp': var4 = WRFp 999 else: var4 = ncobj.variables[depvars[4]] 1007 else: var4 = ncobj.variables[depvars[4]][:] 1000 1008 if depvars[5] == 'WRFdx': var5 = WRFdx 1001 else: var5 = ncobj.variables[depvars[5]] 1009 else: var5 = ncobj.variables[depvars[5]][:] 1002 1010 if depvars[6] == 'WRFdy': var6 = WRFdy 1003 else: var6 = ncobj.variables[depvars[6]] 1011 else: var6 = ncobj.variables[depvars[6]][:] 1004 1012 if depvars[7] == 'WRFdz': var7 = WRFdz[0,0:dz,0,0] 1005 else: var7 = ncobj.variables[depvars[7]] 1013 else: var7 = ncobj.variables[depvars[7]][:] 1006 1014 if depvars[8] == 'WRFtime': var08 = WRFtime 1007 else: var08 = ncobj.variables[depvars[8]] 1015 else: var08 = ncobj.variables[depvars[8]][:] 1008 1016 1009 1017 # Assuming monotonic time-axis... 1010 1018 var8 = var08[1] - var08[0] 1011 1019 1012 var5 = var5/var5 1013 var6 = var6/var6 1014 var7 = var7/var7 1020 if len(var4.shape) == 1: 1021 print ' ' + diagn + ': rank 1 press !!' 1022 print ' spreading over 4D !!' 1023 var40 = var4 + 0. 1024 var4 = np.zeros((dt,dz,dy,dx), dtype=np.float) 1025 for it in range(dt): 1026 for iy in range(dy): 1027 for ix in range(dx): 1028 var4[it,:,iy,ix] = var40 1029 1030 # Unifying... 1031 #var5 = var5/var5 1032 #var6 = var6/var6 1033 #var7 = var7/var7 1015 1034 1016 1035 diag1, diag2, diag3, diag4, diag5, diag6, diag7, diag8, diag9, diag10, \
Note: See TracChangeset
for help on using the changeset viewer.