Changeset 1809 in lmdz_wrf
- Timestamp:
- Mar 16, 2018, 6:31:51 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.inf
r1804 r1809 50 50 zg, WRFght, PH@PHB 51 51 zmla, WRFzmlagen, T@QVAPOR@WRFgeop@HGT 52 53 # Specials (variables which depend on the selection) 54 varn WRF_denszint WRFdens@varn=clivi@QCLOUD@QICE@QGRAUPEL -
trunk/tools/diagnostics.py
r1806 r1809 78 78 availdiags = ['ACRAINTOT', 'accum', 'clt', 'cllmh', 'deaccum', 'LMDZrh', 'mslp', \ 79 79 'OMEGAw', 'RAINTOT', \ 80 'rvors', 'td', 'turbulence', 'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', 'WRFgeop', \ 80 'rvors', 'td', 'turbulence', 'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', \ 81 'WRF_denszint', 'WRFgeop', \ 81 82 'WRFmrso', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf', \ 82 83 'WRFpsl_ptarget', 'WRFrvors', 'WRFslw', 'ws', 'wds', 'wss', 'WRFheight', \ … … 89 90 'WRFclivi', 'WRFclwvi', 'WRFdens', 'WRFgeop', \ 90 91 'WRFp', 'WRFtd', \ 91 'WRFpos', 'WRFp otevap_orPM', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs',\92 'WRFpos', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs', \ 92 93 'WRFrhs', 'WRFrvors', \ 93 94 'WRFt', 'WRFtime', 'WRFua', 'WRFva', 'WRFwds', 'WRFwss', 'WRFheight', 'WRFz'] 95 96 # diagnostics not to check their dependeny 97 NONcheckdepvars = ['WRF_denszint', 'WRFzwind_log', 'WRFzwind', 'WRFzwindMO'] 94 98 95 99 NONchkvardims = ['WRFtime'] … … 360 364 diagn = diags[idiag].split('|')[0] 361 365 depvars = diags[idiag].split('|')[1].split('@') 362 if diags[idiag].split('|')[1].find('@') != -1: 363 depvars = diags[idiag].split('|')[1].split('@') 364 if depvars[0] == 'deaccum': diagn='deaccum' 365 if depvars[0] == 'accum': diagn='accum' 366 for depv in depvars: 367 if not ncobj.variables.has_key(depv) and not \ 368 gen.searchInlist(NONcheckingvars, depv) and \ 369 not gen.searchInlist(methods, depv) and not depvars[0] == 'deaccum' \ 370 and not depvars[0] == 'accum' and not depv[0:2] == 'z=': 366 if not gen.searchInlist(NONcheckdepvars, diagn): 367 if diags[idiag].split('|')[1].find('@') != -1: 368 depvars = diags[idiag].split('|')[1].split('@') 369 if depvars[0] == 'deaccum': diagn='deaccum' 370 if depvars[0] == 'accum': diagn='accum' 371 for depv in depvars: 372 if not ncobj.variables.has_key(depv) and not \ 373 gen.searchInlist(NONcheckingvars, depv) and \ 374 not gen.searchInlist(methods, depv) and not depvars[0] == 'deaccum'\ 375 and not depvars[0] == 'accum' and not depv[0:2] == 'z=': 376 print errormsg 377 print ' ' + main + ": file '" + opts.ncfile + \ 378 "' does not have variable '" + depv + "' !!" 379 quit(-1) 380 else: 381 depvars = diags[idiag].split('|')[1] 382 if not ncobj.variables.has_key(depvars) and not \ 383 gen.searchInlist(NONcheckingvars, depvars) and \ 384 not gen.searchInlist(methods, depvars): 371 385 print errormsg 372 386 print ' ' + main + ": file '" + opts.ncfile + \ 373 "' does not have variable '" + depv + "' !!"387 "' does not have variable '" + depvars + "' !!" 374 388 quit(-1) 375 else:376 depvars = diags[idiag].split('|')[1]377 if not ncobj.variables.has_key(depvars) and not \378 gen.searchInlist(NONcheckingvars, depvars) and \379 not gen.searchInlist(methods, depvars):380 print errormsg381 print ' ' + main + ": file '" + opts.ncfile + \382 "' does not have variable '" + depvars + "' !!"383 quit(-1)384 389 385 390 print "\n Computing '" + diagn + "' from: ", depvars, '...' … … 745 750 746 751 newvarn = depvars + 'turb' 747 print main + '; Lluis newvarn:', newvarn748 752 ncvar.insert_variable(ncobj, newvarn, diagout, diagoutd, 749 753 diagoutvd, newnc) 750 print main + '; Lluis variables:', newnc.variables.keys()751 754 varobj = newnc.variables[newvarn] 752 755 attrv = varobj.long_name … … 847 850 varsadd.append(nonvd) 848 851 ncvar.insert_variable(ncobj, 'clwvi', diagout, diagoutd, diagoutvd, newnc) 852 853 # WRF_denszint WRF vertical integration as WRFdens, sum(Q[water species1], ..., Q[water speciesN]), varn=[varN] 854 elif diagn == 'WRF_denszint': 855 856 var0 = WRFdens 857 varn = depvars[1].split('=')[1] 858 qtot = ncobj.variables[depvars[2]] 859 qtotv = ncobj.variables[depvars[2]] 860 Nspecies = len(depvars) - 2 861 for iv in range(Nspecies): 862 if ncobj.variables.has_key(depvars[iv+2]): 863 var1 = ncobj.variables[depvars[iv+2]] 864 qtotv = qtotv + var1[:] 865 866 dnamesvar = list(qtot.dimensions) 867 dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames) 868 869 diagout, diagoutd, diagoutvd = diag.compute_clwvl(var0, qtotv, dnamesvar,dvnamesvar) 870 871 # Removing the nonChecking variable-dimensions from the initial list 872 varsadd = [] 873 diagoutvd = list(dvnames) 874 for nonvd in NONchkvardims: 875 if gen.searchInlist(dvnames,nonvd): diagoutvd.remove(nonvd) 876 varsadd.append(nonvd) 877 ncvar.insert_variable(ncobj, varn, diagout, diagoutd, diagoutvd, newnc) 849 878 850 879 # WRFgeop geopotential from WRF as PH + PHB -
trunk/tools/documentation/other/diagnostics.html
r1808 r1809 113 113 </TBODY> 114 114 </TABLE> 115 Special diagnostics (variables which depend on the selection):<BR> 116 <TABLE ID="t01"> 117 <THEAD> 118 <TR><TH>CF Name</TH><TH>Name in script</TH><TH>variables</TH><TH>description</TH></TR> 119 </THEAD> 120 <TFOOT> 121 </TFOOT> 122 <TBODY> 123 <TR><TD>[varn]</TD><TD>WRF_denszint</TD><TD>WRFdens@varn=clivi@QCLOUD@QICE@QGRAUPEL</TD><TD> Vertical mass integration (vertical density dependence) of a series of variables from WRF with name [varn]</TD></TR> 124 </TBODY> 115 125 </DIV> 116 126 <DIV CLASS="valins">
Note: See TracChangeset
for help on using the changeset viewer.