1
c In this program we (1) open the "swath.he5" file, (2) attach to
2
c the "Swath1" swath, and (3) read data from the "Longitude" field
3
c ================================================================
5
program he5_sw_readdataF_64
20
integer buffer_out(250)
35
character*4 charfield(10)
41
c Open HDF-EOS swath file, "swath.he5"
42
c ------------------------------------
43
swfid = he5_swopen("swath.he5",HE5F_ACC_RDONLY)
44
write(*,*) 'File ID returned by he5_swopen(): ',swfid
46
if (swfid .NE. FAIL) then
47
swid = he5_swattach(swfid, "Swath1")
48
write(*,*) 'Swath ID returned by he5_swattach(): ',swid
50
if (swid .NE. FAIL) then
53
c Read the entire Longitude field
54
c -------------------------------
62
status = he5_swrdfld(swid,"Longitude",
63
1 start,stride,count,lng)
67
write(*,*)'i j Longitude ',i,j,lng(j,i)
74
status = he5_swrdfld(swid,"test_string",
75
1 start,stride,count,charfield)
78
write(*,*)'i = ',i,charfield(i)
81
c Read data from the Profile
82
c --------------------------
87
status = he5_prread(swid,"Profile-2000",start,stride,count,
90
write(*,*) 'Status returned from he5_prread: ',status
92
c Display the Profile data
93
c ------------------------
95
write(*,*) 'len(',i,'): ',len(i)
99
write(*,*) 'buffer_out: '
100
write(*,*) buffer_out
105
element1(i) = buffer_out(i)
108
write(*,*) '1st element: '
114
element2(i) = buffer_out(j1 + i)
117
write(*,*) '2nd element: '
123
element3(i) = buffer_out(j1 + i)
126
write(*,*) '3rd element: '
132
element4(i) = buffer_out(j1 + i)
135
write(*,*) '4th element: '
141
status = he5_swrdattr(swid, "TestAttr", attr)
143
write(*,*) 'Attribute Element', i, ':', attr(i)
151
status = he5_swdetach(swid)
152
write(*,*) 'Status returned from he5_swdetach: ',status
156
status = he5_swclose(swfid)
157
write(*,*) 'Status returned from he5_swclose: ',status