NCL IO problem

From: Juno Hsu (juno AT XXXXXX)
Date: Tue Feb 24 2004 - 16:59:05 MST

  • Next message: Rick Grubin: "Request for info/survey: Linux distributions"

    Maybe somebody can help me out here (I am new to ncl). I am using ncl to
    read modis land satellite data in HDF4_EOS format. I extracted some
    variables such as leaf area index and wrote them out by using
    fbindirwrite command. I re-read the data by using matlab and they looked
    right (at least some of variables that I know what the range should be).
    The problem is trying to re-read the data with Fortran. For example,
    the variable Lai has size of 1200 x 1200. The saved data have the size
    of 1200*1200*4 bytes. So I tried to read the data with "direct access"
    and declared the variable A(1200,1200) to be integer or real*4. Neither
    output is correct. Byteswapping the data does not help. Any body know
    what I did wrong. Below is the few lines from my ncl srcipt. Thanks.
    --Juno Hsu

    begin

    modis=addfile ("MOD15A2.A2000057.h19v04.004.2002357024119.hdf", "r")
    vNames= getfilevarnames (modis) ; get names of all variables on file
    print(vNames)

    nNames= dimsizes (vNames) ; number of variables on the files

    do n=0, nNames-1
      
      v=modis->$vNames(n)$ ; read the variable to memory
      dimv= dimsizes(v)
      print(dimv)
    ; rank= dimsizes(dimv) ; number of dimensions
    ; print(rank)
      delete (v)
      delete (dimv)

    end do
    QA1=modis->$vNames(0)$
    QA2=modis->$vNames(1)$
    Lai=modis->$vNames(2)$
    Fpar=modis->$vNames(3)$
    Lai_reduced=Lai(::50,::50)

    fbindirwrite("QA1.dat", QA1) ;write in direct access format
    fbindirwrite("QA2.dat", QA2) ;write in direct access format
    fbindirwrite("Lai.dat", Lai) ;write in direct access format
    fbindirwrite("Fpar.dat",Fpar);write in direct access format

    _______________________________________________
    ncl-talk mailing list
    ncl-talk AT ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Wed Feb 25 2004 - 07:54:45 MST