19 include
'sfc21tbl90.inc'
21 character(*),
intent (in) :: lut_file
22 integer,
intent (out) :: status
23 integer,
dimension (4) :: start, edges, stride
25 integer :: number_type, nattrs
26 integer :: sds_id, sds_index, attr_index, hdfid
27 character(len=255) :: sds_name
28 character(len=255) :: dset_name
29 character(len=255) :: attr_name
30 character(len=255) :: group_name
38 edges = (/ 10,46,30,4 /)
39 stride = (/ 1,1,1,1 /)
41 status = nf90_open(lut_file, nf90_nowrite, nc_id)
42 if (status /= nf90_noerr)
then
43 print *,
"ERROR: Failed to open deepblue lut_nc4 file: ", status
47 group_name =
'VEG_21SFC'
48 status = nf90_inq_ncid(nc_id, group_name, grp_id)
49 if (status /= nf90_noerr)
then
50 print *,
"ERROR: Failed to get ID of group "//
trim(group_name)//
": ", status
54 dset_name =
'NVALX21_SFC'
55 status = nf90_inq_varid(grp_id, dset_name, dset_id)
56 if (status /= nf90_noerr)
then
57 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
60 status = nf90_get_var(grp_id, dset_id, nvalx21, start=start, &
61 stride=stride, count=edges)
62 if (status /= nf90_noerr)
then
63 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
67 dset_name =
'R0X21_SFC'
68 status = nf90_inq_varid(grp_id, dset_name, dset_id)
69 if (status /= nf90_noerr)
then
70 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
73 status = nf90_get_var(grp_id, dset_id, r0x_21, start=start, &
74 stride=stride, count=edges)
75 if (status /= nf90_noerr)
then
76 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
80 dset_name =
'SX21_SFC'
81 status = nf90_inq_varid(grp_id, dset_name, dset_id)
82 if (status /= nf90_noerr)
then
83 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
86 status = nf90_get_var(grp_id, dset_id, sx_21, start=start, &
87 stride=stride, count=edges)
88 if (status /= nf90_noerr)
then
89 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
93 dset_name =
'TX21_SFC'
94 status = nf90_inq_varid(grp_id, dset_name, dset_id)
95 if (status /= nf90_noerr)
then
96 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
99 status = nf90_get_var(grp_id, dset_id, tx_21, start=start, &
100 stride=stride, count=edges)
101 if (status /= nf90_noerr)
then
102 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
106 dset_name =
'NVALX672_SFC'
107 status = nf90_inq_varid(grp_id, dset_name, dset_id)
108 if (status /= nf90_noerr)
then
109 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
112 status = nf90_get_var(grp_id, dset_id, nvalx672, start=start, &
113 stride=stride, count=edges)
114 if (status /= nf90_noerr)
then
115 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
119 dset_name =
'R0X672_SFC'
120 status = nf90_inq_varid(grp_id, dset_name, dset_id)
121 if (status /= nf90_noerr)
then
122 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
125 status = nf90_get_var(grp_id, dset_id, r0x_672, start=start, &
126 stride=stride, count=edges)
127 if (status /= nf90_noerr)
then
128 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
132 dset_name =
'SX672_SFC'
133 status = nf90_inq_varid(grp_id, dset_name, dset_id)
134 if (status /= nf90_noerr)
then
135 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
138 status = nf90_get_var(grp_id, dset_id, sx_672, start=start, &
139 stride=stride, count=edges)
140 if (status /= nf90_noerr)
then
141 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
145 dset_name =
'TX672_SFC'
146 status = nf90_inq_varid(grp_id, dset_name, dset_id)
147 if (status /= nf90_noerr)
then
148 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
151 status = nf90_get_var(grp_id, dset_id, tx_672, start=start, &
152 stride=stride, count=edges)
153 if (status /= nf90_noerr)
then
154 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
158 dset_name =
'NVALX865_SFC'
159 status = nf90_inq_varid(grp_id, dset_name, dset_id)
160 if (status /= nf90_noerr)
then
161 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
164 status = nf90_get_var(grp_id, dset_id, nvalx865, start=start, &
165 stride=stride, count=edges)
166 if (status /= nf90_noerr)
then
167 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
171 dset_name =
'R0X865_SFC'
172 status = nf90_inq_varid(grp_id, dset_name, dset_id)
173 if (status /= nf90_noerr)
then
174 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
177 status = nf90_get_var(grp_id, dset_id, r0x_865, start=start, &
178 stride=stride, count=edges)
179 if (status /= nf90_noerr)
then
180 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
184 dset_name =
'SX865_SFC'
185 status = nf90_inq_varid(grp_id, dset_name, dset_id)
186 if (status /= nf90_noerr)
then
187 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
190 status = nf90_get_var(grp_id, dset_id, sx_865, start=start, &
191 stride=stride, count=edges)
192 if (status /= nf90_noerr)
then
193 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
197 dset_name =
'TX865_SFC'
198 status = nf90_inq_varid(grp_id, dset_name, dset_id)
199 if (status /= nf90_noerr)
then
200 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
203 status = nf90_get_var(grp_id, dset_id, tx_865, start=start, &
204 stride=stride, count=edges)
205 if (status /= nf90_noerr)
then
206 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
210 status = nf90_close(nc_id)
211 if (status /= nf90_noerr)
then
212 print *,
"ERROR: Failed to close lut_nc4 file: ", status