c This example shows how to read a data field and two geo-location c fields in HDF-EOS5 swath data. program read_fields_swath_OMI_Aura_L2_OMAERO implicit none integer swathfile1 integer swath1 integer status integer datafield1rank(32) integer*4 datafield1dimsize(32) integer datafield1type(1) character*512 datafield1dimname character*512 datafield1maxdimname integer*2 datafield1data(60,1644) integer*4 datafield1start(2) integer*4 datafield1stride(2) integer*4 datafield1edge(2) integer geofield1rank(32) integer*4 geofield1dimsize(32) integer geofield1type(1) character*512 geofield1dimname character*512 geofield1maxdimname real*4 geofield1data(60,1644) integer*4 geofield1start(2) integer*4 geofield1stride(2) integer*4 geofield1edge(2) integer geofield2rank(32) integer*4 geofield2dimsize(32) integer geofield2type(1) character*512 geofield2dimname character*512 geofield2maxdimname real*4 geofield2data(60,1644) integer*4 geofield2start(2) integer*4 geofield2stride(2) integer*4 geofield2edge(2) integer*4 i, j integer he5_swfldinfo, he5_swrdfld, he5_swdetach, he5_swopen, $ he5_swclose, he5_swattach external he5_swfldinfo, he5_swrdfld, he5_swdetach, he5_swopen, $ he5_swclose, he5_swattach integer HE5F_ACC_RDONLY parameter (HE5F_ACC_RDONLY=101) c Open 'OMI-Aura_L2-OMAERO_2004m1001t0003-o01132_v003.he5' using swath c API swathfile1 = he5_swopen $ ('OMI-Aura_L2-OMAERO_2004m1001t0003-o01132_v003.he5', $ HE5F_ACC_RDONLY) c Open a swath named 'ColumnAmountAerosol' swath1 = he5_swattach(swathfile1, 'ColumnAmountAerosol') c Retrieve information about 'AerosolIndexUV' datafield status = he5_swfldinfo(swath1, 'AerosolIndexUV', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname, $ datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 60 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 1644 c Read data from 'AerosolIndexUV' status = he5_swrdfld(swath1, 'AerosolIndexUV', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'AerosolIndexUV' do i = 1, 16 do j = 1, 6 write(*,*), datafield1data(j,i) enddo write(*,*) enddo c Retrieve information about 'Longitude' geolocation field status = he5_swfldinfo(swath1, 'Longitude', geofield1rank, $ geofield1dimsize, geofield1type, geofield1dimname, $ geofield1maxdimname) c Select necessary range of elements geofield1start(1) = 0 geofield1stride(1) = 1 geofield1edge(1) = 60 geofield1start(2) = 0 geofield1stride(2) = 1 geofield1edge(2) = 1644 c Read data from 'Longitude' status = he5_swrdfld(swath1, 'Longitude', geofield1start, $ geofield1stride, geofield1edge, geofield1data) c Dump data from 'Longitude' do i = 1, 16 do j = 1, 6 write(*,*), geofield1data(j,i) enddo write(*,*) enddo c Retrieve information about 'Latitude' geolocation field status = he5_swfldinfo(swath1, 'Latitude', geofield2rank, $ geofield2dimsize, geofield2type, geofield2dimname, $ geofield2maxdimname) c Select necessary range of elements geofield2start(1) = 0 geofield2stride(1) = 1 geofield2edge(1) = 60 geofield2start(2) = 0 geofield2stride(2) = 1 geofield2edge(2) = 1644 c Read data from 'Latitude' status = he5_swrdfld(swath1, 'Latitude', geofield2start, $ geofield2stride, geofield2edge, geofield2data) c Dump data from 'Latitude' do i = 1, 16 do j = 1, 6 write(*,*), geofield2data(j,i) enddo write(*,*) enddo c Close the swath named 'ColumnAmountAerosol' status = he5_swdetach(swath1) c Close 'OMI-Aura_L2-OMAERO_2004m1001t0003-o01132_v003.he5' status = he5_swclose(swathfile1) end