2
c In this example we will (1) open the "GridFile" HDF file, (2) attach to
3
c the "PolarGrid" grid, and (3) subset data from the "Temperature" field.
9
integer status, gdextreg, gdreginfo, gddetach, gdclose
10
integer*4 gdfid, gdid, gdopen, gdattach, dims(8)
11
integer*4 rank, ntype, gddefboxreg
13
real*8 cornerlon(2), cornerlat(2)
14
real*8 upleft(2), lowright(2)
15
real*4 datbuf(100*100)
18
parameter (DFACC_READ=1)
22
c Open the HDF grid file, "GridFile.hdf"
25
gdfid = gdopen("GridFile.hdf", DFACC_READ)
27
if (gdfid .NE. -1) then
29
gdid = gdattach(gdfid, "PolarGrid")
31
if (gdid .NE. -1) then
38
regionid = gddefboxreg(gdid, cornerlon, cornerlat)
40
status = gdreginfo(gdid, regionid, "Temperature", ntype,
41
1 rank, dims, size, upleft, lowright)
42
write(*,*) dims(1), dims(2), dims(3), rank, ntype
44
status = gdextreg(gdid, regionid, "Temperature",
50
status = gddetach(gdid)
51
status = gdclose(gdfid)