1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
c
c
program subsetpoint
integer status, ptextreg, ptreginfo, ptdetach
integer ptextper, ptperinfo, ptclose
integer*4 ptfid, ptid, ptopen, ptattach
integer*4 size, ptdefboxreg, ptdeftmeper
integer*4 regionid, periodid
real*8 cornerlon(2), cornerlat(2)
real*8 datbuf(128), starttime, stoptime
integer DFACC_READ
parameter (DFACC_READ=1)
c
c Open the HDF point file, "PointFile.hdf"
c
ptfid = ptopen("PointFile_created_with_hadeos_sample_file_write"//
1"r_of_HDFEOS2_version_219_or_higher_release.hdf", DFACC_READ)
if (ptfid .NE. -1) then
ptid = ptattach(ptfid, "FloatBuoy Point")
if (ptid .NE. -1) then
cornerlon(1) = -145.
cornerlat(1) = -15.
cornerlon(2) = -135.
cornerlat(2) = 8.
regionid = ptdefboxreg(ptid, cornerlon, cornerlat)
level = 1
status = ptreginfo(ptid, regionid, level,
1 "Longitude,Latitude", size)
status = ptextreg(ptid, regionid, level,
1 "Longitude,Latitude", datbuf)
do 100 i=1,size/16
write(*,*) i, datbuf(2*i-1),datbuf(2*i)
100 continue
c Time Subsetting
starttime = 35208757.6d0
stoptime = 35984639.2d0
periodid = ptdeftmeper(ptid, starttime, stoptime)
level = 1
status = ptperinfo(ptid, periodid, level, "Time", size)
status = ptextper(ptid, periodid, level, "Time", datbuf)
do 200 i=1,size/8
write(*,*) i, datbuf(i)
200 continue
endif
status = ptdetach(ptid)
status = ptclose(ptfid)
endif
stop
end
|