Changeset 1238 in lmdz_wrf for trunk


Ignore:
Timestamp:
Oct 27, 2016, 10:37:16 AM (9 years ago)
Author:
lfita
Message:

Commiting with some tests due to 'segmentation fault'!

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.py

    r1227 r1238  
    914914    otrackf.close()
    915915
     916    quit(-1)
    916917    # Joining variable files
    917918    if not os.path.isfile(fileon):
     
    11581159            # pinterp: pressure interpolation (to the given $plevels)
    11591160            vals=plevels + ',1,1'
     1161            print fname + '; Lluis vals:', vals, 'plevels:', plevels
    11601162            if dofile:
    11611163                try:
     
    38073809        op = vnop.split('_')[1]
    38083810        values = allcompvar[vnop]
    3809         print fname + ': Lluis first values:', values
    38103811        VnOpS = varnoper(vn, op, opersurnames)
    38113812
     
    43934394        if addfiles:
    43944395            if dbg:
    4395                 print '  ' + main + ": adding variables to copmute removing " +      \
     4396                print '  ' + main + ": adding variables to compute removing " +      \
    43964397                  "file '" + varcompf + "' ..."
    43974398            sub.call('rm ' + varcompf +' >& /dev/null', shell=True)
     
    44104411                    sout = sub.call(ins, shell=True)
    44114412                files1h = gen.files_folder(iwdir,fh)
     4413                print sub.call('ls ' + iwdir + '/' + fh + '*', shell=True)
     4414                print main + '; Lluis file1h:', files1h, 'iwdir:', iwdir, 'fh:', fh
    44124415                if len(files1h) < 1:
    44134416                    print errmsg
  • trunk/tools/nc_var_tools.py

    r1237 r1238  
    1707817078        ovar2 = onc.variables['PB']
    1707917079
    17080         pres = (ovar1[:] + ovar2[:]).astype('float64')
     17080        pres0 = ovar1[:] + ovar2[:]
     17081        pres = pres0.astype('float64')
    1708117082
    1708217083        dimx = pres.shape[3]
     
    1717117172    # temperature
    1717217173    if modname == 'WRF':
    17173         Rd = 287.04
    17174         Cp = 7.*Rd/2.
    17175         RCP = Rd/Cp
    17176         p0 = 100000.
    17177         ovar1 = onc.variables['T']
    17178         temp = ((ovar1[:]+300.)*(pres[:]/p0)**RCP).astype('float64')
     17174        Rd = np.float64(287.04)
     17175        Cp = np.float64(7.*Rd/2.)
     17176        RCP = np.float64(Rd/Cp)
     17177        p0 = np.float64(100000.)
     17178        ovar10 = onc.variables['T']
     17179        var10 = ovar10[:]
     17180        ovar1 = (var10).astype('float64')
     17181        temp0 = (ovar1[:]+300.)*(pres[:]/p0)**RCP
     17182        temp = temp0.astype('float64')
    1717917183    elif modname == 'LMDZ' or modname == 'cfLMDZ':
    1718017184        ovar1 = onc.variables['temp']
     
    1722617230    # Creation of pressure variable dimension
    1722717231    newvar = onewnc.createVariable('pres', 'f8', ('pres'))
    17228     newvar[:] = interplevs
     17232    newvar[:] = interplevs[:]
    1722917233    basicvardef(newvar, 'pressure', 'Pressure', 'Pa')
    1723017234    attr = set_attribute(newvar, 'positive', 'down')
     
    1729517299                newvarattr[attrn] = attrv
    1729617300
     17301        print fname + '; Lluis varin shape:', varin.shape
    1729717302        if varin is not None:
    1729817303            varint = varin.transpose()
     
    1730317308            qvt = qv.transpose()
    1730417309
     17310            print fname + '; Lluis going to the subroutine....'
     17311            print fname + '; Lluis shapes: varint:', varint.shape,'prest:',prest.shape,'psfct:',psfct.shape,\
     17312              'hgtt:', hgtt.shape,'tempt:',tempt.shape,'qvt:',qvt.shape
    1730517313            varinterp = fin.module_forinterpolate.interp( data_in=varint,            \
    1730617314              pres_field=prest, interp_levels=interplevs, psfc=psfct,                \
    1730717315              ter=hgtt, tk=tempt, qv=qvt, linlog=linloginterp,                       \
    17308               extrapolate=extrap, geopt=isgeop, missing=gen.fillValueF)
     17316              extrapolate=extrap, geopt=isgeop, missing=gen.fillValueF, ix=dimx,     \
     17317              iy=dimy, iz=dimz, it=dimt, num_metgrid_levels=len(interplevs))
     17318            print fname + '; Lluis after the subroutine'
    1730917319
    1731017320            newvar = onewnc.createVariable(CFvn, 'f4', tuple(newMODdims),            \
Note: See TracChangeset for help on using the changeset viewer.