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_MLS_Aura_L2GP_BrO implicit none integer swathfile1 integer swath1 integer status integer datafield1rank(32) integer*4 datafield1dimsize(32) integer datafield1type(1) character*512 datafield1dimname character*512 datafield1maxdimname real*4 datafield1data(37,3494) 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(3494) integer*4 geofield1start(1) integer*4 geofield1stride(1) integer*4 geofield1edge(1) integer geofield2rank(32) integer*4 geofield2dimsize(32) integer geofield2type(1) character*512 geofield2dimname character*512 geofield2maxdimname real*4 geofield2data(3494) integer*4 geofield2start(1) integer*4 geofield2stride(1) integer*4 geofield2edge(1) 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 'MLS-Aura_L2GP-BrO_v01-52-c01_2007d029.he5' using swath API swathfile1 = he5_swopen $ ('MLS-Aura_L2GP-BrO_v01-52-c01_2007d029.he5', HE5F_ACC_RDONLY) c Open a swath named 'BrO' swath1 = he5_swattach(swathfile1, 'BrO') c Retrieve information about 'L2gpValue' datafield status = he5_swfldinfo(swath1, 'L2gpValue', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname, $ datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 37 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 3494 c Read data from 'L2gpValue' status = he5_swrdfld(swath1, 'L2gpValue', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'L2gpValue' do i = 1, 30 do j = 1, 1 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) = 3494 c Read data from 'Longitude' status = he5_swrdfld(swath1, 'Longitude', geofield1start, $ geofield1stride, geofield1edge, geofield1data) c Dump data from 'Longitude' do i = 1, 30 write(*,*), geofield1data(i) 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) = 3494 c Read data from 'Latitude' status = he5_swrdfld(swath1, 'Latitude', geofield2start, $ geofield2stride, geofield2edge, geofield2data) c Dump data from 'Latitude' do i = 1, 30 write(*,*), geofield2data(i) enddo c Close the swath named 'BrO' status = he5_swdetach(swath1) c Close 'MLS-Aura_L2GP-BrO_v01-52-c01_2007d029.he5' status = he5_swclose(swathfile1) end