subroutine get_1d_hirs(hdf_file_id, SDS_name, array_out, nscans, rflag) c----------------------------------------------------------------------------------- c Description: Read 1D SDS from HIRS HDF L1b file. c c Input parameters: c hdf_file_id HDF file handle c SDS_name SDS 1D array name c c Output parameters: c array_out 1D array of values in 'SDS_name' c rflag return flag c c Revision history: 07/10 R. Frey Original version c 12/10 Added header c c Non-HDF calls: None c c----------------------------------------------------------------------------------- IMPLICIT NONE save c----------------------------------------------------------------------------------- include 'hdf.inc' c----------------------------------------------------------------------------------- c Calling arguments. character*(*) SDS_name integer nscans, rflag real array_out(1100) c Local variables. integer sfn2index, sfselect, sfginfo, sfrdata, num_type, nattrs, rank integer hdf_file_id, sds_indx, pid, irt, dims(3), start(3) integer stride(3), edge(3) c----------------------------------------------------------------------------------- c Initializations. dims(1) = -1 dims(2) = -1 dims(3) = -1 start(1) = 0 start(2) = 0 start(3) = 0 stride(1) = 1 stride(2) = 1 stride(3) = 1 c----------------------------------------------------------------------------------- c Get SDS index. sds_indx = sfn2index(hdf_file_id,SDS_name) if(sds_indx .lt. 0) then write(*,'(''Cannot get sds indx for '',20a)') SDS_name end if c Get data set identifier. pid = sfselect(hdf_file_id,sds_indx) if(pid .lt. 0) then write(*,'(''Cannot get pid for '',20a)') SDS_name end if c Get array dimensions. irt = sfginfo(pid,SDS_name,rank,dims,num_type,nattrs) if(irt .ne. 0) then write(*,'(''Cannot get dimensions'')') write(*,'(''Dims: '',4i10)') irt, dims(1),dims(2),dims(3) end if edge(1) = dims(1) nscans = edge(1) c Read array data. irt = sfrdata(pid,start,stride,edge,array_out) if(irt .ne. 0) then write(*,'(''Cannot get data in get_1d_hirs'')') write(*,'(''sds index, pid '',2i10)') sds_indx, pid end if c----------------------------------------------------------------------------------- rflag = irt c----------------------------------------------------------------------------------- return end