c This example shows how to read a data field and two geo-location c fields in HDF-EOS2 swath data. program read_fields_swath_NOAA_17_AMSU implicit none integer*4 swathfile1 integer*4 swath1 integer status integer*4 datafield1rank(32) integer*4 datafield1dimsize(32) integer*4 datafield1type(1) character*512 datafield1dimname real*4 datafield1data(30,783) integer*4 datafield1start(2) integer*4 datafield1stride(2) integer*4 datafield1edge(2) integer*4 geofield1rank(32) integer*4 geofield1dimsize(32) integer*4 geofield1type(1) character*512 geofield1dimname real*4 geofield1data(30,783) integer*4 geofield1start(2) integer*4 geofield1stride(2) integer*4 geofield1edge(2) integer*4 geofield2rank(32) integer*4 geofield2dimsize(32) integer*4 geofield2type(1) character*512 geofield2dimname real*4 geofield2data(30,783) integer*4 geofield2start(2) integer*4 geofield2stride(2) integer*4 geofield2edge(2) integer*4 i, j integer swrdfld, swfldinfo, swdetach, swclose external swrdfld, swfldinfo, swdetach, swclose integer*4 swopen, swattach external swopen, swattach integer*4 DFACC_READ parameter (DFACC_READ=1) c Open 'amsua17_2003.007_02805_2302_0046_GC.eos' using swath API swathfile1 = swopen('amsua17_2003.007_02805_2302_0046_GC.eos', $ DFACC_READ) c Open a swath named 'Orbit 2805' swath1 = swattach(swathfile1, 'Orbit 2805') c Retrieve information about '23800.37 MHz' datafield status = swfldinfo(swath1, '23800.37 MHz', datafield1rank, $ datafield1dimsize, datafield1type, datafield1dimname) c Select necessary range of elements datafield1start(1) = 0 datafield1stride(1) = 1 datafield1edge(1) = 30 datafield1start(2) = 0 datafield1stride(2) = 1 datafield1edge(2) = 783 c Read data from '23800.37 MHz' status = swrdfld(swath1, '23800.37 MHz', datafield1start, $ datafield1stride, datafield1edge, datafield1data) c Dump data from '23800.37 MHz' do i = 1, 20 do j = 1, 2 write(*,*), datafield1data(j,i) enddo write(*,*) enddo c Retrieve information about 'Longitude' geolocation field status = swfldinfo(swath1, 'Longitude', geofield1rank, $ geofield1dimsize, geofield1type, geofield1dimname) c Select necessary range of elements geofield1start(1) = 0 geofield1stride(1) = 1 geofield1edge(1) = 30 geofield1start(2) = 0 geofield1stride(2) = 1 geofield1edge(2) = 783 c Read data from 'Longitude' status = swrdfld(swath1, 'Longitude', geofield1start, $ geofield1stride, geofield1edge, geofield1data) c Dump data from 'Longitude' do i = 1, 20 do j = 1, 2 write(*,*), geofield1data(j,i) enddo write(*,*) enddo c Retrieve information about 'Latitude' geolocation field status = swfldinfo(swath1, 'Latitude', geofield2rank, $ geofield2dimsize, geofield2type, geofield2dimname) c Select necessary range of elements geofield2start(1) = 0 geofield2stride(1) = 1 geofield2edge(1) = 30 geofield2start(2) = 0 geofield2stride(2) = 1 geofield2edge(2) = 783 c Read data from 'Latitude' status = swrdfld(swath1, 'Latitude', geofield2start, $ geofield2stride, geofield2edge, geofield2data) c Dump data from 'Latitude' do i = 1, 20 do j = 1, 2 write(*,*), geofield2data(j,i) enddo write(*,*) enddo c Close the swath named 'Orbit 2805' status = swdetach(swath1) c Close 'amsua17_2003.007_02805_2302_0046_GC.eos' status = swclose(swathfile1) end