28 #include "nav_cnst.fin"
30 real*4 smat(3,3,*), pos(3,*), coef(6,*)
31 real*4 xlon(maxlin,3), xlat(maxlin,3), xla(3)
32 real*4 xlo(3), solz(3), sola(3), senz(3), sena(3)
33 real*4 csolz(maxlin), sunr(3,maxlin)
34 integer*4 prod_ID, iret
35 integer*4 sr_id, sl_id, at_id, ind, dfflt
36 integer*4 istart(3), istr(3), idims(3)
37 integer*4 nflag(maxlin)
38 integer sfn2index, sfselect, sfwdata, sfrdata, sfendacc
41 data istart/3*0/, istr/3*1/, dfflt/5/
46 ind = sfn2index(prod_id,
'sun_ref')
49 write(*,*)
'Error getting index for sun_ref'
52 sr_id = sfselect(prod_id, ind)
55 write(*,*)
'Error selecting sun_ref'
60 iret = sfrdata(sr_id, istart, istr, idims, sunr)
62 write(*,*)
'Error reading sun_ref'
65 iret = sfendacc(sr_id)
77 call geonav( pos(1,ilin), smat(1,1,ilin), coef(1,ilin),
78 1 sunr(1,ilin), nsta, ninc, npix, xla, xlo,
79 2 solz, sola, senz, sena )
88 if ( xlo(1) .gt. xlo(3) ) cross = .true.
94 xlanth =
max(xlat(1,1),xlat(1,2))
95 xlasth =
min(xlat(nlin,2),xlat(nlin,3) )
99 xlactr = xlat(icntr,2)
100 xloctr = xlon(icntr,2)
101 solzct = csolz(icntr)
109 write(*,*)
'Error writing slat'
117 write(*,*)
'Error writing clat'
125 write(*,*)
'Error writing elat'
133 write(*,*)
'Error writing slon'
141 write(*,*)
'Error writing clon'
149 write(*,*)
'Error writing elon'
157 write(*,*)
'Error writing csol_z'
165 iret = sfsattr(prod_id,
'Scene Center Solar Zenith', dfflt,
168 write(*,*)
'Error writing Scene Center Solar Zenith'
172 iret = sfsattr(prod_id,
'Scene Center Latitude', dfflt,
175 write(*,*)
'Error writing Scene Center Latitude'
179 iret = sfsattr(prod_id,
'Scene Center Longitude', dfflt,
182 write(*,*)
'Error writing Scene Center Longitude'
186 iret = sfsattr(prod_id,
'Upper Right Latitude', dfflt,
189 write(*,*)
'Error writing Upper Right Latitude'
193 iret = sfsattr(prod_id,
'Upper Right Longitude', dfflt,
196 write(*,*)
'Error writing Upper Right Longitude'
200 iret = sfsattr(prod_id,
'Upper Left Latitude', dfflt,
203 write(*,*)
'Error writing Upper Left Latitude'
207 iret = sfsattr(prod_id,
'Upper Left Longitude', dfflt,
210 write(*,*)
'Error writing Upper Left Longitude'
214 iret = sfsattr(prod_id,
'Lower Left Latitude', dfflt,
217 write(*,*)
'Error writing Lower Left Latitude'
221 iret = sfsattr(prod_id,
'Lower Left Longitude', dfflt,
224 write(*,*)
'Error writing Lower Left Longitude'
228 iret = sfsattr(prod_id,
'Lower Right Latitude', dfflt,
231 write(*,*)
'Error writing Lower Right Latitude'
235 iret = sfsattr(prod_id,
'Lower Right Longitude', dfflt,
238 write(*,*)
'Error writing Lower Right Longitude'
242 iret = sfsattr(prod_id,
'Start Center Latitude', dfflt,
245 write(*,*)
'Error writing Start Center Latitude'
249 iret = sfsattr(prod_id,
'Start Center Longitude', dfflt,
252 write(*,*)
'Error writing Start Center Longitude'
256 iret = sfsattr(prod_id,
'End Center Latitude', dfflt,
259 write(*,*)
'Error writing End Center Latitude'
263 iret = sfsattr(prod_id,
'End Center Longitude', dfflt,
266 write(*,*)
'Error writing End Center Longitude'
270 iret = sfsattr(prod_id,
'Northernmost Latitude', dfflt,
273 write(*,*)
'Error writing Northernmost Latitude'
277 iret = sfsattr(prod_id,
'Southernmost Latitude', dfflt,
280 write(*,*)
'Error writing Southernmost Latitude'
284 iret = sfsattr(prod_id,
'Westernmost Longitude', dfflt,
287 write(*,*)
'Error writing Westernmost Longitude'
291 at_id = sfsattr(prod_id,
'Easternmost Longitude', dfflt,
294 write(*,*)
'Error writing Easternmost Longitude'
305 integer*4 prod_ID, idim, iret
306 integer*4 istart(2), istr(2), idims(2), ind, sd_id
307 integer sfn2index, sfselect, sfwdata, sfendacc
309 data istart/2*0/, istr/2*1/
311 ind = sfn2index(prod_id, sdname)
314 write(*,*)
'Error getting sds index'
318 sd_id = sfselect(prod_id, ind)
319 if (sd_id.eq.-1)
then
321 write(*,*)
'Error selecting sds'
326 iret = sfwdata(sd_id, istart, istr, idims, sddata)
328 write(*,*)
'Error writing sds'
332 iret = sfendacc(sd_id)