c This example shows how to read a data field in HDF-EOS2 grid data. program read_datafield_grid_AIRH3QPM implicit none integer*4 gridfile1 integer*4 grid1 integer status integer*4 datafield1rank(32) integer*4 datafield1dimsize(32) integer*4 datafield1type(1) character*512 datafield1dimname real*4 datafield1data(72,36,200) integer*4 datafield1start(3) integer*4 datafield1stride(3) integer*4 datafield1edge(3) integer*4 i, j, k integer gdrdfld, gdfldinfo, gddetach, gdclose external gdrdfld, gdfldinfo, gddetach, gdclose integer*4 gdopen, gdattach external gdopen, gdattach integer*4 DFACC_READ parameter (DFACC_READ=1) c Open 'AIRS.2002.09.01.L3.RetQuant_H030.v5.0.14.0.G07191213218.hdf' c using grid API gridfile1 = gdopen $ ('AIRS.2002.09.01.L3.RetQuant_H030.v5.0.14.0.G07191213218.hdf', $ DFACC_READ) c Open a grid named 'L3Quant' grid1 = gdattach(gridfile1, 'L3Quant') c Retrieve information about 'Entropy' datafield status = gdfldinfo(grid1, 'Entropy', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 72 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 36 datafield1start(3) = 0 datafield1stride(3) = 1 datafield1edge(3) = 200 c Read data from 'Entropy' status = gdrdfld(grid1, 'Entropy', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'Entropy' do i = 1, 3 do j = 1, 4 do k = 1, 5 write(*,*), datafield1data(k,j,i) enddo write(*,*) enddo write(*,*) enddo c Close the grid named 'L3Quant' status = gddetach(grid1) c Close 'AIRS.2002.09.01.L3.RetQuant_H030.v5.0.14.0.G07191213218.hdf' status = gdclose(gridfile1) end