- Timestamp:
- Aug 27, 2016, 11:56:31 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1048 r1056 609 609 # Attaching necessary variables for the pressure interpolation 610 610 if gP != 'none': 611 requiredinterpvars = ['P', 'PB', 'PSFC', 'PH', 'PHB', 'HGT', 'T', \ 612 'QVAPOR', 'XLONG', 'XLAT', 'Times'] 611 if minf.name == 'WRF' or minf.name == 'WRF_LMDZ': 612 requiredinterpvars = ['P', 'PB', 'PSFC', 'PH', 'PHB', 'HGT', 'T',\ 613 'QVAPOR', 'XLONG', 'XLAT', 'Times'] 614 elif minf.name == 'LMDZ': 615 requiredinterpvars = ['pres', 'psol', 'geop', 'phis', 'temp', \ 616 'ovap', 'lon', 'lat', 'time_counter'] 617 else: 618 print errmsg 619 print fname + ": for model '" + minf.name + "' required " + \ 620 " variables for vertical interpolation are not known !!" 621 quit(-1) 622 613 623 print " " + fname + ": adding variables:", requiredinterpvars, \ 614 624 ' to allow pressure interpolation' … … 639 649 for sout in output: print sout 640 650 elif minf.name == 'LMDZ': 641 ncvar.LMDZ_toCF(ifilen)642 643 651 try: 644 652 with gen.Capturing() as output: … … 1068 1076 otrackf.write(pyins + "\n") 1069 1077 1078 # removing dimension variable-dimension 'lon' 1079 varnCFs.remove('lon') 1080 1070 1081 varkeep.append('lonstats') 1071 1082 … … 1095 1106 otrackf.write("# " + CFvarn + " " + Fopers + "\n") 1096 1107 otrackf.write(pyins + "\n") 1108 1109 # removing dimension variable-dimension 'lat' 1110 varnCFs.remove('lat') 1097 1111 1098 1112 varkeep.append('latstats') … … 1144 1158 except: 1145 1159 print errmsg 1146 print 'fvaradd(' , prevfile, ','+CFvn+','+fileon+')'1160 print 'fvaradd(' + prevfile + ',' + CFvn +', '+fileon+')' 1147 1161 for sout in output: print sout 1148 1162 quit(-1) … … 1203 1217 if model is not None or diag is not None: 1204 1218 vinf = VariableInf(vn,fheader,model,diag) 1219 if op.find('pinterp') != -1: 1220 SP = 'p' 1221 else: 1222 SP = '' 1223 1205 1224 # Comppute variable 1206 compute_variable(modinf, idir, Files, odir, vinf, globalP, fscr, \ 1207 config['pyHOME'], config['CFreftime'], config['CFunitstime'], debug) 1225 finalfilen = odir + '/' + vn + '_' + fheader + SP + '.nc' 1226 if fscr: 1227 sout = sub.call('rm ' + finalfilen + ' >& /dev/null', shell=True) 1228 1229 if not os.path.isfile(finalfilen): 1230 compute_variable(modinf, idir, Files, odir, vinf, globalP, fscr, \ 1231 config['pyHOME'], config['CFreftime'], config['CFunitstime'], debug) 1208 1232 1209 1233 # Compute variable statistics 1210 compute_statistics(modinf, cnf, iwdir, Files, owdir, vinf, globalP, op, \ 1211 fscr, debug) 1234 finalfilen = odir + '/' + vn + '_' + fheader + SP + '_' + \ 1235 op.replace('+','_') + '.nc' 1236 if fscr: 1237 sout = sub.call('rm ' + finalfilen + ' >& /dev/null', shell=True) 1238 1239 if not os.path.isfile(finalfilen): 1240 compute_statistics(modinf, cnf, iwdir, Files, owdir, vinf, globalP, \ 1241 op, fscr, debug) 1212 1242 1213 1243 else: … … 1451 1481 crange = str(cnt[0]) + ',' + str(cnt[1]) 1452 1482 cfmt = cnt[3] 1453 cline = cnt[4] 1483 ckind = cnt[4] 1484 cline = cnt[5] 1454 1485 1455 1486 graphvals = ','.join(CFvplot) 1456 1487 graphvals = graphvals + ':lon|-1,lat|-1:lon|-1,lat|-1:lon:lat:' + cbar + \ 1457 ': fixc,' + cline + ':' + cfmt + ':' + srange + ':' + crange + ',9:' +\1458 figtit + ':' + kfig + ':None:' + mapval1488 ':' + ckind + ',' + cline + ':' + cfmt + ':' + srange + ':' + crange + \ 1489 ',9:' + figtit + ':' + kfig + ':None:' + mapval 1459 1490 1460 1491 fvarS = ','.join(vplot) … … 1492 1523 crange = str(cnt[0]) + ',' + str(cnt[1]) 1493 1524 cfmt = cnt[3] 1494 cline = cnt[4] 1525 ckind = cnt[4] 1526 cline = cnt[5] 1495 1527 # It is assumed that if the space variable is 'lon': is desired a 1496 1528 # (lon, time) plot it it is 'lat': then (time, lat) plot … … 1512 1544 graphvals = ','.join(CFvplot) 1513 1545 graphvals = graphvals + ';'+ dims +';'+ cbar + \ 1514 '; fixsigc,' + cline + ';' + cfmt + ';' + srange + ';' + crange +',9;'+ \1515 figtit + ';' + kfig + ';' + reverse + ';' + 'time|' + tunits + '|'+ \1516 timekind + '|' + timefmt + '|' + timelabel1546 ';' + ckind + ',' + cline + ';' + cfmt + ';' + srange + ';' + crange + \ 1547 ',9;' + figtit + ';' + kfig + ';' + reverse + ';' + 'time|' + tunits + \ 1548 '|'+ timekind + '|' + timefmt + '|' + timelabel 1517 1549 1518 1550 fvarS = ','.join(vplot) … … 1550 1582 crange = str(cnt[0]) + ',' + str(cnt[1]) 1551 1583 cfmt = cnt[3] 1552 cline = cnt[4] 1584 ckind = cnt[4] 1585 cline = cnt[5] 1553 1586 1554 1587 # It is assumed that if the space variable is 'lon': is desired a … … 1571 1604 1572 1605 graphvals = ','.join(CFvplot) 1573 graphvals = graphvals + ':' + dims + ':' + cbar + ': fixc,' + cline +\1574 ':' + cfmt + ':' + srange + ':' + crange + ',9:' + figtit + ':' +\1575 kfig + ':' + reverse + ':None'1606 graphvals = graphvals + ':' + dims + ':' + cbar + ':' + ckind + ',' + \ 1607 cline + ':' + cfmt + ':' + srange + ':' + crange + ',9:' + figtit + \ 1608 ':' + kfig + ':' + reverse + ':None' 1576 1609 1577 1610 fvarS = ','.join(vplot)
Note: See TracChangeset
for help on using the changeset viewer.