Changeset 1626 in lmdz_wrf


Ignore:
Timestamp:
Sep 10, 2017, 6:46:15 PM (7 years ago)
Author:
lfita
Message:

Adding opening of the file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1625 r1626  
    1856418564    Tunits = values.split(':')[3]
    1856518565 
     18566    ncf = NetCDFFile(ncfile, 'r')
    1856618567    # CFing lon,lat
    18567     if not ncf.variables.has_key('time'):
     18568    if not ncf.variables.has_key('lon'):
     18569        ncf.close()
    1856818570        WRF_CFlonlat_creation('lon,lat,true', ncfile, wrfvl+','+wrfvL)
    1856918571    else:
    1857018572        print warnmsg
    1857118573        print '  ' + fname + ": file already with variable 'lon,lat' skipping them!!"
     18574        ncf.close()
    1857218575
    1857318576    ncf = NetCDFFile(ncfile,'a')
     
    1858718590
    1858818591    # CFing time
     18592    ncf = NetCDFFile(ncfile, 'r')
    1858918593    if not ncf.variables.has_key('time'):
     18594        ncf.close()
    1859018595        WRF_CFtime_creation(refDateTime+','+Tunits, ncfile, 'time')
    1859118596    else:
    1859218597        print warnmsg
    18593         print '  ' + fname + ": file already with variable 'lon,lat' skipping them!!"
     18598        print '  ' + fname + ": file already with variable 'time' skipping them!!"
     18599        ncf.close()
    1859418600
    1859518601    ncf = NetCDFFile(ncfile,'a')
Note: See TracChangeset for help on using the changeset viewer.