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_HIRDLS_Aura_L2 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(1,4500) 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(4500) 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(4500) 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 'HIRDLS-Aura_L2_v02-04-09-c03_2005d033.he5' using swath API swathfile1 = he5_swopen $ ('HIRDLS-Aura_L2_v02-04-09-c03_2005d033.he5', HE5F_ACC_RDONLY) c Open a swath named 'HIRDLS' swath1 = he5_swattach(swathfile1, 'HIRDLS') c Retrieve information about 'CloudTopPressure' datafield status = he5_swfldinfo(swath1, 'CloudTopPressure', datafield1rank $ , datafield1dimsize, datafield1type, datafield1dimname, $ datafield1maxdimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 1 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 4500 c Read data from 'CloudTopPressure' status = he5_swrdfld(swath1, 'CloudTopPressure', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from 'CloudTopPressure' 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) = 4500 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) = 4500 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 'HIRDLS' status = he5_swdetach(swath1) c Close 'HIRDLS-Aura_L2_v02-04-09-c03_2005d033.he5' status = he5_swclose(swathfile1) end