Changeset 1887 in lmdz_wrf for trunk


Ignore:
Timestamp:
Apr 4, 2018, 2:22:43 AM (7 years ago)
Author:
lfita
Message:

Fixing 'CFmorzization' (but not finished!)

Location:
trunk/tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/CFvariables.dat

    r1864 r1887  
    1414uas new_z_dim height height 10.
    1515vas new_z_dim height height 10.
    16 hus new_z_dim pressure pressure 'FROMfile,press'
    17 ta new_z_dim pressure pressure 'FROMfile,press'
    18 ua new_z_dim pressure pressure 'FROMfile,press'
    19 va new_z_dim pressure pressure 'FROMfile,press'
    20 wa new_z_dim pressure pressure 'FROMfile,press'
    21 zg new_z_dim pressure pressure 'FROMfile,press'
     16hus new_z_dim pressure pressure FROMfile,pres
     17ta new_p_dim pressure pressure FROMfile,pres
     18ua new_p_dim pressure pressure FROMfile,pres
     19va new_p_dim pressure pressure FROMfile,pres
     20wa new_p_dim pressure pressure FROMfile,pres
     21zg new_p_dim pressure pressure FROMfile,pres
    2222
  • trunk/tools/generic_tools.py

    r1870 r1887  
    1273412734      'axis': 'Y', '_CoordinateAxisType': 'Lat',                                     \
    1273512735      'maxrank':  2, 'length': 0}
    12736     CFpress= {'dimn': 'pressure', 'vdimn': 'pressure',                               \
     12736    CFpress= {'dimn': 'pres', 'vdimn': 'pres',                                       \
    1273712737      'stdn': 'pressure', 'longname': 'Pressure', 'units': 'Pa',                     \
    1273812738      'axis': 'Z', '_CoordinateAxisType': 'Pres', 'positive': 'down',                \
     
    1274812748
    1274912749    # names to search for
    12750     lonn = ['lon', 'X', 'Longitude', 'longitude', 'x']
    12751     latn = ['lat', 'Y', 'Latitude', 'latitude', 'y']
    12752     pressn = ['press', 'P', 'Press', 'Pressure', 'pressure', 'p']
     12750    lonn = ['lon', 'X', 'Longitude', 'longitude', 'x', 'west_east']
     12751    latn = ['lat', 'Y', 'Latitude', 'latitude', 'y', 'south_north']
     12752    pressn = ['pres', 'press', 'P', 'Press', 'Pressure', 'pressure', 'p']
    1275312753    heightn = ['height', 'Z', 'Height', 'z']
    1275412754    timen = ['time', 'T', 'Time', 'TIME', 't']
  • trunk/tools/nc_var_tools.py

    r1886 r1887  
    2296622966      listoc= list of NetCDF file objects
    2296722967    """
    22968     fname = 'getvar_listonc'
     22968    fname = 'getdim_listonc'
    2296922969
    2297022970    allfs = {}
     
    2327323273    fname = 'CFvars'
    2327423274
    23275     availactions = ['new_p_dim','new_z_dim']
     23275    availactions = ['new_p_dim', 'new_z_dim']
    2327623276
    2327723277    folder = os.path.dirname(os.path.realpath(__file__))
     
    2330723307                newvvar = np.float(CFactions[3])
    2330823308            else:
    23309                 vn = CFactinos[3].split[0]
     23309                vn = CFactions[3].split(',')[1]
    2331023310                if not innc.variables.has_key(vn):
    2331123311                    print errormsg
     
    2331623316                ovar = innc.variables[vn]
    2331723317                # Assuming all the same value!
    23318                 var1D = ovar.flatten()
     23318                var1D = ovar[:].flatten()
    2331923319                newvvar = var1D[0]
    2332023320            outnc.createDimension(newdim, 1)
     
    2335423354                newvvar = np.float(CFactions[3])
    2335523355            else:
    23356                 vn = CFactinos[3].split[0]
     23356                vn = CFactions[3].split(',')[1]
    2335723357                if not innc.variables.has_key(vn):
    2335823358                    print errormsg
     
    2363323633
    2363423634        # CF values of axis
    23635         CFdimvalues = gen.CFcorValues(axn)
     23635        CFdimvalues = gen.CFcorValues(dimn)
    2363623636        #print '  ' + axn + " ..."
    2363723637        #print '    dimension in file:', dimn, ' variable in file:', vardimn
     
    2367023670                    if dn == dimn and CFdimvalues['length'] != -1:
    2367123671                        CFdimvalues['length'] = len(oaxisd)
    23672             axsiv = oaxisv[tuple(varslice)]
     23672            axisv = oaxisv[tuple(varslice)]
    2367323673        else:
    2367423674            print errormsg
     
    2373723737
    2373823738        CFdimvals[axn] = CFdimvalues
    23739         filedimvals[axn] = axsiv[:]
     23739        filedimvals[axn] = axisv[:]
    2374023740        CFaxisvardimvals[axn] = CFvardimvalues
    2374123741
     
    2391123911                    varv = np.where(varv == fill_value, gen.fillValueF, varv)
    2391223912            else:
     23913                print 'Lluis: ', newVdims
    2391323914                newvar=onewnc.createVariable(cfvarn, 'f4', tuple(newVdims),          \
    2391423915                  fill_value=gen.fillValueF)
  • trunk/tools/variables_values.dat

    r1858 r1887  
    304304LPR_CON_L, prcl, convective_liquid_precipitation_flux, 0., 0.003, convective|liquid|precipitation|flux, kgm-2s-1, Blues, $prcl$, prcl
    305305plev, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $plev$, plev
    306 presnivs, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
    307 pres, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
    308 lpres, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
    309 LPRES, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
    310 PRES, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
    311 WRFp, plev, air_pressure, 0., 103000., air|pressure, Pa, Blues, $press$, press
     306presnivs, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
     307pres, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
     308lpres, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
     309LPRES, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
     310PRES, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
     311WRFp, pres, air_pressure, 0., 103000., air|pressure, Pa, Blues, $pres$, pres
    312312p_base, p_base, air_pressure_base, 0., 103000., air|pressure|base|state, Pa, Blues, $press^{base}$, press_base
    313313PB, p_base, air_pressure_base, 0., 103000., air|pressure|base|state, Pa, Blues, $press^{base}$, press_base
Note: See TracChangeset for help on using the changeset viewer.