editing a netcdf file

From: Cathryn Meyer (cathryn.meyer AT yale.edu)
Date: Fri Apr 15 2005 - 08:59:47 MDT

  • Next message: Li Tao: "help: standardize problem"

    Hello,

    I am planning to run CAM3 using a new set of zonally-averaged SSTs,
    however I am having trouble editing the SST input netcdf file. My
    problem is that the zonally-averaged SST data I want to use is
    dimensioned (12,90,180) instead of (12,64,128). I can get the
    dimensions worked out okay, but I can't figure out how to get rid of the
    lat/lon values in the zonal SST file. I simply want to move the zonal
    SST values onto the CAM3 grid, without moving over the lat/lon values
    from the zonal file. Any thoughts on how to do this?

    To help clarify this better, below is the output of PrintVarSummary(lat)
    from the zonal SST file and the original CAM file. You can see how the
    coordinates are different, even after I have re-dimensioned the zonal
    file - I think they need to be the same.

    ----------------------------------------------------

    Variable: lat
    Type: double
    Total Size: 512 bytes
                64 values
    Number of Dimensions: 1
    Dimensions and sizes: [lat | 64]
    Coordinates:
                lat: [ -87.. 87]
    Number Of Attributes: 5
      units : degrees_north
      long_name : latitude
      axis : Y
      _FillValue : -999
      cartesian_axis : y
    -----------
    Variable: lat
    Type: double
    Total Size: 512 bytes
                64 values
    Number of Dimensions: 1
    Dimensions and sizes: [lat | 64]
    Coordinates:
                lat: [-87.86380004882812..87.86380004882812]
    Number Of Attributes: 3
      units : degrees_north
      long_name : latitude
      axis : Y
    ---------------------------------------------------------

    I also get the following errors in trying to write this new SST variable
    into the CAM SST input file:
    fatal:NetWriteAtt: length of string exceeds available space for
    attribute (units)
    warning:FileWriteVarVar: Could not attribute (units) to file
    (sst_HadOIBl_bc_64x128_clim_c020411), continuing anyway
    ----------------------------------------------------------

    Thanks,
    Cathy

    -- 
    Cathryn Meyer
    Department of Geology and Geophysics
    Yale University
    cathryn.meyer@yale.edu
    (203)432-1959
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Fri Apr 15 2005 - 11:43:29 MDT