c This example shows how to read a data field in HDF-EOS5 grid data. program read_datafield_grid_TES_Aura_L3_CH4 implicit none integer gridfile1 integer grid1 integer status integer datafield1rank(32) integer*4 datafield1dimsize(32) integer datafield1type(1) character*512 datafield1dimname character*512 datafield1maxdimname real*4 datafield1data(83,90) integer*4 datafield1start(2) integer*4 datafield1stride(2) integer*4 datafield1edge(2) integer*4 i, j integer he5_gdfldinfo, he5_gdrdfld, he5_gddetach, he5_gdopen, $ he5_gdclose, he5_gdattach external he5_gdfldinfo, he5_gdrdfld, he5_gddetach, he5_gdopen, $ he5_gdclose, he5_gdattach integer HE5F_ACC_RDONLY parameter (HE5F_ACC_RDONLY=101) c Open 'TES-Aura_L3-CH4_r0000002135_F01_05.he5' using grid API gridfile1 = he5_gdopen('TES-Aura_L3-CH4_r0000002135_F01_05.he5', $ HE5F_ACC_RDONLY) c Open a grid named 'NadirGrid' grid1 = he5_gdattach(gridfile1, 'NadirGrid') c Retrieve information about 'CH4AtSurface' datafield status = he5_gdfldinfo(grid1, 'CH4AtSurface', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname, $ datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 83 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 90 c Read data from 'CH4AtSurface' status = he5_gdrdfld(grid1, 'CH4AtSurface', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'CH4AtSurface' do i = 1, 9 do j = 1, 8 write(*,*), datafield1data(j,i) enddo write(*,*) enddo c Close the grid named 'NadirGrid' status = he5_gddetach(grid1) c Close 'TES-Aura_L3-CH4_r0000002135_F01_05.he5' status = he5_gdclose(gridfile1) end