Changeset 1048 in lmdz_wrf


Ignore:
Timestamp:
Aug 26, 2016, 9:21:12 PM (9 years ago)
Author:
lfita
Message:

Up to first differences with LMDZ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.py

    r1043 r1048  
    556556                try:
    557557                    with gen.Capturing() as output:
    558                         ncvar.DataSetSection_multivars(values, cf, vs)
     558                        ncvar.DataSetSection_multivars(values, idir + '/' + cf, vs)
    559559                except:
    560560                    print errmsg
    561                     print 'ncvar.DataSetSection_multivars('+values+', '+cf+', '+vs+')'
     561                    print 'ncvar.DataSetSection_multivars('+values+', '+idir+'/'+cf+ \
     562                      ', '+vs+')'
    562563                    for sout in output: print sout
    563564                    quit(-1)
     
    568569
    569570                # Keeping track of the operations
    570                 pyins = pyH + "/nc_var.py -f "+cf+" -o DataSetSection_multivars -v "+\
    571                   vs + " -S '" + values + "'"
     571                pyins = pyH + "/nc_var.py -f " + idir + '/' + cf +                   \
     572                  " -o DataSetSection_multivars -v " + vs + " -S '" + values + "'"
    572573                otrackf.write('\n')
    573574                otrackf.write('# ' + CFvarn + " " + modvar + '\n')
    574                 otrackf.write(pyins + '\n')
     575                otrackf.write('python ' + pyins + '\n')
    575576
    576577                # CF renaming of variable
     
    584585                diagc = '@'.join(diagvar[1:])
    585586           
    586                 values = '-f ' + cf + " -d '" + dims + "' -v '" + diagn + '|' +      \
    587                   diagc + "'"
     587                values = '-f ' + idir + '/' + cf + " -d '" + dims + "' -v '" +       \
     588                  diagn + '|' + diagc + "'"
    588589                try:
    589590                    with gen.Capturing() as output:
     
    624625                        for sout in output: print sout
    625626
    626             # adding CF lon,lat,time in WRF files
    627             if minf.name == 'WRF':
     627            # CFification of files
     628            if minf.name == 'WRF' or minf.name == 'WRF_LMDZ':
    628629                values = vdnx + ':' + vdny + ':'+ Tref + ':' + Tunits
    629                 ncvar.WRF_toCF(values, ifilen)
     630                try:
     631                    with gen.Capturing() as output:
     632                        ncvar.WRF_toCF(values, ifilen)
     633                except:
     634                    print errmsg
     635                    print 'WRF_toCF('+ values +', ' + ifilen + ')'
     636                    for sout in output: print sout
     637                    quit(-1)
     638                if db:
     639                    for sout in output: print sout
     640            elif minf.name == 'LMDZ':
     641                ncvar.LMDZ_toCF(ifilen)
     642
     643                try:
     644                    with gen.Capturing() as output:
     645                        ncvar.LMDZ_toCF(ifilen)
     646                except:
     647                    print errmsg
     648                    print 'LMDZ_toCF('+ ifilen + ')'
     649                    for sout in output: print sout
     650                    quit(-1)
     651                if db:
     652                    for sout in output: print sout
     653            else:
     654                print errmsg
     655                print '  ' + fname + ": no CFification for model '" +minf.name+ "' !!"
     656                print "    available ones: 'WRF', 'WRF_LMDZ', 'LMDZ'"
     657                quit(-1)
    630658
    631659        ifile = ifile + 1
     
    29402968        # End of avoiding to repeat all the experiment search
    29412969
    2942         print "  For experiment '"+exp+"' is required to compute:", Nvar, "variables"
     2970        print "    For experiment '" + exp + "' is required to compute:", Nvar,      \
     2971          "variables"
    29432972
    29442973        if dbg:
     
    29552984# Figures of variables direct from files
    29562985##
    2957         print "  " + main + ": Plotting direct figures ..."
     2986        print "    Plotting direct figures ..."
    29582987        dirfigf = owdir + '/directplotsdraw.inf'
    29592988        if figscratch:
     
    29763005        # End of avoiding to repeat all the plots search
    29773006
    2978         print "  For experiment '"+exp+"' is required to plot:", Nplt, "plots"
     3007        print "    For experiment '" + exp + "' is required to plot:", Nplt, "plots"
    29793008
    29803009        if dbg:
     
    29923021# Experiments loop
    29933022##
     3023    print '  ******* ****** ***** **** *** ** * ** *** **** ***** ****** *******'
     3024    print "  ** '" + mod + "': Inter experiments differences  "
     3025    print '  ******* ****** ***** **** *** ** * ** *** **** ***** ****** *******'
     3026    print '    experiments:', exps
    29943027    # There are two kind of differences:
    29953028    #   DIFFop: differences between operations of each given variable.
     
    30023035
    30033036    Nexps = len(exps)
    3004     for exp1 in exps[0:Nexps-1]:
    3005         for exp2 in exps[1:Nexps]:
     3037    for iexp1 in range(0,Nexps-1):
     3038        exp1 = exps[iexp1]
     3039        for iexp2 in range(iexp1+1,Nexps):
     3040            exp2 = exps[iexp2]
    30063041            Sexps = exp2 + '-' + exp1
    30073042            print '  ' + Sexps + '...'
     
    30433078        # End of avoiding to repeat all the experiment search
    30443079
    3045         print "  For experiments '"+exp2+"'-'"+exp1+"' is required to compute:",     \
     3080        print "    For experiments '"+exp2+"'-'"+exp1+"' is required to compute:",   \
    30463081          Nvar, "differences"
    30473082
     
    30943129          dbg)
    30953130
    3096     quit()
     3131#    quit()
    30973132# end of mods loop
    30983133
Note: See TracChangeset for help on using the changeset viewer.