Changeset 1056 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 27, 2016, 11:56:31 AM (9 years ago)
Author:
lfita
Message:

Working up to the differences among experiments even with `LMDZ'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.py

    r1048 r1056  
    609609            # Attaching necessary variables for the pressure interpolation
    610610            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
    613623                print "   " + fname + ": adding variables:", requiredinterpvars,     \
    614624                  ' to allow pressure interpolation'
     
    639649                    for sout in output: print sout
    640650            elif minf.name == 'LMDZ':
    641                 ncvar.LMDZ_toCF(ifilen)
    642 
    643651                try:
    644652                    with gen.Capturing() as output:
     
    10681076                otrackf.write(pyins + "\n")
    10691077
     1078            # removing dimension variable-dimension 'lon'
     1079            varnCFs.remove('lon')
     1080
    10701081            varkeep.append('lonstats')
    10711082
     
    10951106                otrackf.write("# " + CFvarn + " " + Fopers + "\n")
    10961107                otrackf.write(pyins + "\n")
     1108
     1109            # removing dimension variable-dimension 'lat'
     1110            varnCFs.remove('lat')
    10971111
    10981112            varkeep.append('latstats')
     
    11441158                    except:
    11451159                        print errmsg
    1146                         print 'fvaradd(', prevfile, ','+CFvn+','+fileon+')'
     1160                        print 'fvaradd(' + prevfile + ',' + CFvn +', '+fileon+')'
    11471161                        for sout in output: print sout
    11481162                        quit(-1)
     
    12031217        if model is not None or diag is not None:
    12041218            vinf = VariableInf(vn,fheader,model,diag)
     1219            if op.find('pinterp') != -1:
     1220                SP = 'p'
     1221            else:
     1222                SP = ''
     1223
    12051224            # 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)
    12081232
    12091233            # 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)
    12121242
    12131243        else:
     
    14511481            crange = str(cnt[0]) + ',' + str(cnt[1])
    14521482            cfmt = cnt[3]
    1453             cline = cnt[4]
     1483            ckind = cnt[4]
     1484            cline = cnt[5]
    14541485
    14551486            graphvals = ','.join(CFvplot)
    14561487            graphvals = graphvals + ':lon|-1,lat|-1:lon|-1,lat|-1:lon:lat:' + cbar + \
    1457               ':fixc,' + cline + ':' + cfmt + ':' + srange + ':' + crange + ',9:' + \
    1458               figtit + ':' + kfig + ':None:' + mapval
     1488              ':' + ckind + ',' + cline + ':' + cfmt + ':' + srange + ':' + crange + \
     1489              ',9:' + figtit + ':' + kfig + ':None:' + mapval
    14591490
    14601491            fvarS = ','.join(vplot)
     
    14921523            crange = str(cnt[0]) + ',' + str(cnt[1])
    14931524            cfmt = cnt[3]
    1494             cline = cnt[4]
     1525            ckind = cnt[4]
     1526            cline = cnt[5]
    14951527            # It is assumed that if the space variable is 'lon': is desired a
    14961528            #   (lon, time) plot it it is 'lat': then (time, lat) plot
     
    15121544            graphvals = ','.join(CFvplot)
    15131545            graphvals = graphvals + ';'+ dims +';'+ cbar +  \
    1514               ';fixsigc,' + cline + ';' + cfmt + ';' + srange + ';' + crange +',9;'+ \
    1515               figtit + ';' + kfig + ';' + reverse + ';' + 'time|' + tunits + '|'+ \
    1516               timekind + '|' + timefmt + '|' + timelabel
     1546              ';' + ckind + ',' + cline + ';' + cfmt + ';' + srange + ';' + crange + \
     1547              ',9;' + figtit + ';' + kfig + ';' + reverse + ';' + 'time|' + tunits + \
     1548              '|'+ timekind + '|' + timefmt + '|' + timelabel
    15171549
    15181550            fvarS = ','.join(vplot)
     
    15501582            crange = str(cnt[0]) + ',' + str(cnt[1])
    15511583            cfmt = cnt[3]
    1552             cline = cnt[4]
     1584            ckind = cnt[4]
     1585            cline = cnt[5]
    15531586
    15541587            # It is assumed that if the space variable is 'lon': is desired a
     
    15711604
    15721605            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'
    15761609 
    15771610            fvarS = ','.join(vplot)
Note: See TracChangeset for help on using the changeset viewer.