/usr/share/doc/libhdfeos-dev/examples/inquiregrid.f is in libhdfeos-dev 2.19v1.00+dfsg.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | program inquiregrid
integer status, i, gddetach, gdclose, gdgridinfo
integer gdprojinfo
integer*4 gdfid, gdid1, ndim, nflds, gddiminfo
integer*4 dims(32), rank(32), ntype(32), gdopen, gdattach
integer*4 n, strbufsize, gdid2, gdinqdims, gdinqflds
integer*4 xdimsize, ydimsize, dimsize, projcode,zonecode
integer*4 spherecode, origincode
real*8 upleftpt(2), lowrightpt(2), projparm(13)
character*72 dimname, fieldlist
integer DFACC_READ
parameter (DFACC_READ=1)
gdfid = gdopen('GridFile_created_with_hadeos_sample_file_writer_
1of_HDFEOS2_version_219_or_higher_release.hdf', DFACC_READ)
if (gdfid .ne. -1) then
gdid1 = gdattach(gdfid, 'UTMGrid')
gdid2 = gdattach(gdfid, 'PolarGrid')
ndim = gdinqdims(gdid1, dimname, dims)
write(*,*) 'Dimension list (UTMGrid): ', dimname
do i=1,ndim
write(*,*) 'dim size: ', dims(i)
enddo
ndim = gdinqdims(gdid2, dimname, dims)
write(*,*) 'Dimension list (PolarGrid): ', dimname
do i=1,ndim
write(*,*) 'dim size: ', dims(i)
enddo
dimsize = gddiminfo(gdid1, 'Time')
write(*,*) 'Size of "Time" Array: ', dimsize
dimsize = gddiminfo(gdid2, 'Bands')
write(*,*) 'Size of "Bands" Array: ', dimsize
status = gdgridinfo(gdid1, xdimsize, ydimsize,
1 upleftpt, lowrightpt)
write(*,*) 'X dim size, Y dim size (UTMGrid): ',
1 xdimsize, ydimsize
write(*,*) 'Up left pt (UTMGrid): ',
1 upleftpt(1), upleftpt(2)
write(*,*) 'Low right pt (UTMGrid): ',
1 lowrightpt(1), lowrightpt(2)
status = gdgridinfo(gdid2, xdimsize, ydimsize,
1 upleftpt, lowrightpt)
write(*,*) 'X dim size, Y dim size (PolarGrid): ',
1 xdimsize, ydimsize
write(*,*) 'Up left pt (PolarGrid): ',
1 upleftpt(1), upleftpt(2)
write(*,*) 'Low right pt (PolarGrid): ',
1 lowrightpt(1), lowrightpt(2)
status = gdprojinfo(gdid1, projcode, zonecode,
1 spherecode, projparm)
write(*,*) 'projcode , zonecode (UTMGrid): ', projcode,
1 zonecode
write(*,*) 'spherecode (UTMGrid): ', spherecode
status = gdprojinfo(gdid2, projcode, zonecode,
1 spherecode, projparm)
status = gdprojinfo(gdid2, projcode, zonecode,
1 spherecode, projparm)
write(*,*) 'projcode (PolarGrid): ', projcode
write(*,*) 'spherecode (PolarGrid): ', spherecode
do i=1,13
write(*,*) 'Projection Parameter: ',i,projparm(i)
enddo
nflds = gdinqflds(gdid1, fieldlist, rank, ntype)
if (nflds .ne. 0) then
write(*,*) 'Data fields (UTMGrid): ', fieldlist
do i=1,nflds
write(*,*) 'rank type: ',rank(i),ntype(i)
enddo
endif
nflds = gdinqflds(gdid2, fieldlist, rank, ntype)
if (nflds .ne. 0) then
write(*,*) 'Data fields (PolarGrid): ', fieldlist
do i=1,nflds
write(*,*) 'rank type: ',rank(i),ntype(i)
enddo
endif
status = gdfldinfo(gdid2, 'Spectra', rank,
1 dims, ntype, dimname)
write(*,*) 'Spectra rank dims: ',rank(1)
do i=1,rank(1)
write(*,*) 'Spectra dims: ',i,dims(i), dimname
enddo
C n = gdnentries(gdid1, HDFE_NENTDIM, strbufsize)
C write(*,*) 'Number of dimension entries (UTMGrid): ', n
C write(*,*) 'Length of Dimension List (UTMGrid): ', strbufsize
C n = gdnentries(gdid1, HDFE_NENTDFLD, strbufsize)
C write(*,*) 'Number of data fields (UTMGrid): ', n
C write(*,*) 'Length of Field List (UTMGrid): ', strbufsize
endif
status = gddetach(gdid1)
status = gddetach(gdid2)
status = gdclose(gdfid)
stop
end
|