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_TES_Aura_L2_ANCILLARY 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(3275) integer*4 datafield1start(1) integer*4 datafield1stride(1) integer*4 datafield1edge(1) integer geofield1rank(32) integer*4 geofield1dimsize(32) integer geofield1type(1) character*512 geofield1dimname character*512 geofield1maxdimname real*4 geofield1data(3275) 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(3275) integer*4 geofield2start(1) integer*4 geofield2stride(1) integer*4 geofield2edge(1) integer*4 i 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 'TES-Aura_L2-ANCILLARY_r0000005209_F04_04.he5' using swath API swathfile1 = he5_swopen $ ('TES-Aura_L2-ANCILLARY_r0000005209_F04_04.he5', HE5F_ACC_RDONLY) c Open a swath named 'AncillaryNadirSwath' swath1 = he5_swattach(swathfile1, 'AncillaryNadirSwath') c Retrieve information about 'TropopausePressure' datafield status = he5_swfldinfo(swath1, 'TropopausePressure', $ datafield1rank, datafield1dimsize, datafield1type, $ datafield1dimname, datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 3275 c Read data from 'TropopausePressure' status = he5_swrdfld(swath1, 'TropopausePressure', $ datafield1start, datafield1stride, datafield1edge, $ datafield1data) c Dump data from 'TropopausePressure' do i = 1, 30 write(*,*), datafield1data(i) 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) = 3275 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) = 3275 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 'AncillaryNadirSwath' status = he5_swdetach(swath1) c Close 'TES-Aura_L2-ANCILLARY_r0000005209_F04_04.he5' status = he5_swclose(swathfile1) end