5
program he5_pt_updatelevelsF_32
11
integer rank, datatype
17
integer*4 num_elements
19
real*4 concentration_tt(4)
29
character*80 fieldname
38
integer he5_ptupdatelevel
43
c Open the HDF-EOS point file, "point.he5"
44
c ----------------------------------------
45
ptfid = he5_ptopen('point.he5',HE5F_ACC_RDWR)
46
write(*,*) 'File ID returned by he5_ptopen(): ',ptfid
50
ptid = HE5_PTattach(ptfid, "Simple Point")
51
write(*,*) 'Point ID returned by he5_ptattach(): ',ptid
54
open(unit=1, file='simple_a.txt', status='OLD')
58
read(1, *, end=100) time_tt, concentration_tt(1),
59
1 concentration_tt(2),
60
2 concentration_tt(3),
61
3 concentration_tt(4),
64
conc(i,1) = concentration_tt(1)
65
conc(i,2) = concentration_tt(2)
66
conc(i,3) = concentration_tt(3)
67
conc(i,4) = concentration_tt(4)
79
print *,conc(i,1),conc(i,2),conc(i,3),conc(i,4)
83
c.....specify the storage size of each atomic field
88
dtype(1) = HE5T_NATIVE_DOUBLE
89
dtype(2) = HE5T_NATIVE_FLOAT
90
dtype(3) = HE5T_NATIVE_CHAR
93
cc... One way that works
97
cc... Another way that works
105
fieldname = 'Concentration'
113
c.....Convert array to 'C' order
117
datatype = HE5T_NATIVE_FLOAT
119
num_elements = he5_ptfort2c(dimens, rank, datatype, conc,
121
write(*,*) 'num_elements returned by he5_ptfort2c(): ',num_elements
123
c status = he5_ptupdatelevel(ptid, level, fieldname, nrec,
124
c 1recs, datasize_conc, dtype(2), conc)
125
status = he5_ptupdatelevel(ptid, level, fieldname, nrec,
126
1recs, datasize_conc, dtype(2), outconc)
127
write(*,*) 'Status returned by he5_ptupdatelevel(): ',status
134
cc time_tt = 13131313.0
136
status = he5_ptupdatelevel(ptid, level, fieldname, nrec,
137
1recs, datasize_time, dtype(1), time)
138
write(*,*) 'Status returned by he5_ptupdatelevel(): ',status
143
fieldname = 'Species'
147
status = he5_ptupdatelevel(ptid, level, fieldname, nrec,
148
1recs, datasize_spc, dtype(3), spc)
149
write(*,*) 'Status returned by he5_ptupdatelevel(): ',status
156
c.....Close out the point interface
157
status = he5_ptdetach(ptid)
158
write(*,*) 'Status returned by he5_ptdetach(): ',status
161
status = he5_ptclose(ptfid)
162
write(*,*) 'Status returned by he5_ptclose(): ',status