c This example shows how to read a data field in HDF-EOS5 grid data. program read_datafield_grid_MLS_Aura_L3DM 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(90,83,32) integer*4 datafield1start(3) integer*4 datafield1stride(3) integer*4 datafield1edge(3) integer*4 i, j, k 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 'MLS-Aura_L3DM-Temperature_v02-21-c01_2006d020.he5' using grid c API gridfile1 = he5_gdopen $ ('MLS-Aura_L3DM-Temperature_v02-21-c01_2006d020.he5', $ HE5F_ACC_RDONLY) c Open a grid named 'Temperature' grid1 = he5_gdattach(gridfile1, 'Temperature') c Retrieve information about 'L3dmValue' datafield status = he5_gdfldinfo(grid1, 'L3dmValue', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname, $ datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 90 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 83 datafield1start(3) = 0 datafield1stride(3) = 1 datafield1edge(3) = 32 c Read data from 'L3dmValue' status = he5_gdrdfld(grid1, 'L3dmValue', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'L3dmValue' do i = 1, 3 do j = 1, 8 do k = 1, 9 write(*,*), datafield1data(k,j,i) enddo write(*,*) enddo write(*,*) enddo c Close the grid named 'Temperature' status = he5_gddetach(grid1) c Close 'MLS-Aura_L3DM-Temperature_v02-21-c01_2006d020.he5' status = he5_gdclose(gridfile1) end