~ubuntu-branches/ubuntu/lucid/hdf-eos5/lucid

« back to all changes in this revision

Viewing changes to samples/he5_gd_readdataF_64.f

  • Committer: Bazaar Package Importer
  • Author(s): Alastair McKinstry
  • Date: 2009-08-17 23:07:29 UTC
  • Revision ID: james.westby@ubuntu.com-20090817230729-gzbwp1ny01hv2nlk
Tags: upstream-5.1.12.dfsg.1
ImportĀ upstreamĀ versionĀ 5.1.12.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      program       he5_gd_readdataF_64
 
2
 
 
3
      implicit      none
 
4
 
 
5
      include       'hdfeos5.inc'
 
6
 
 
7
          integer       status
 
8
          integer       gdfid 
 
9
      integer       gdid
 
10
          integer       he5_gdopen
 
11
      integer       he5_gdattach
 
12
      integer       he5_gdrdfld
 
13
      integer       he5_gdrdattr
 
14
      integer       he5_gddetach 
 
15
          integer       he5_gdclose
 
16
 
 
17
          integer*8     start(2)
 
18
      integer*8     stride(2)
 
19
      integer*8     count(2)
 
20
 
 
21
          real*4        f
 
22
      real*4        veg(120,200)
 
23
 
 
24
      integer       FAIL
 
25
      parameter     (FAIL=-1)
 
26
 
 
27
c     Open HDF-EOS "grid.he5" file
 
28
c     -----------------------------
 
29
          gdfid = he5_gdopen("grid.he5",HE5F_ACC_RDWR)
 
30
      write(*,*) 'File ID returned by he5_gdopen():  ',gdid
 
31
  
 
32
          if (gdfid .ne. FAIL) then 
 
33
                 
 
34
c        Attach to the UTM grid 
 
35
c        ----------------------
 
36
                 gdid = he5_gdattach(gdfid, "UTMGrid")
 
37
         write(*,*) 'Grid ID returned by he5_gdattach():  ',gdid
 
38
                 
 
39
                 if (gdid .ne. FAIL) then                       
 
40
                        start(1)  = 0
 
41
                        start(2)  = 0
 
42
                        stride(1) = 1
 
43
                        stride(2) = 1
 
44
                        count(1)  = 120
 
45
                        count(2)  = 200
 
46
 
 
47
c           Read the data from "Vegetation" field
 
48
c           -------------------------------------
 
49
                        status = he5_gdrdfld(gdid,"Vegetation",
 
50
     1           start,stride,count,veg)
 
51
            write(*,*) 'Status returned by he5_gdrdfld():  ',status
 
52
 
 
53
c           Read global attribute "float"
 
54
c           -----------------------------             
 
55
                        status = he5_gdrdattr(gdid, "float", f)
 
56
            write(*,*) 'Status returned by he5_gdrdattr():  ',status
 
57
                        write(*,*) 'global attribute value: ', f
 
58
                 endif
 
59
          endif
 
60
 
 
61
c     Detach from the grid
 
62
c     --------------------        
 
63
          status = he5_gddetach(gdid)
 
64
      write(*,*) 'Status returned by he5_gddetach():  ',status
 
65
 
 
66
c     Close the file
 
67
c     --------------
 
68
          status = he5_gdclose(gdfid)
 
69
      write(*,*) 'Status returned by he5_gdclose():  ',status
 
70
          
 
71
          stop
 
72
          end
 
73
 
 
74
 
 
75
 
 
76