subroutine get_collocation_indecis(debug, hdf_file_id, altrk_idx, actrk_idx) c----------------------------------------------------------------------------------- c Description: Acquire indecis of AVHRR (GAC) pixels that fall within the HIRS FOVs c in the current orbit. There are up to 30 collocated pixels for each c of a maximum of 56 x 1100 HIRS FOVs in the orbit. c c Input parameters: c debug debug write flag c hdf_file_id HDF file handle for collocation index file c c Output parameters: c altrk_idx AVHRR line numbers of collocated pixels c actrk_idx AVHRR element numbers of collocated pixels c c Revision history: 12/10 R. Frey Original version c 01/11 R. Frey Changed dimensions of 'altrk_idx' c and 'actrk_idx' c c Non-HDF calls: subroutine message c c----------------------------------------------------------------------------------- IMPLICIT NONE save c----------------------------------------------------------------------------------- include 'hdf.inc' c----------------------------------------------------------------------------------- c Calling arguments. integer debug, hdf_file_id, altrk_idx(100,56,1100), actrk_idx(100,56,1100) c Local variables. character*160 errmsg character*48 SDS_name integer sfn2index, sfselect, sfginfo, sfrdata, num_type, nattrs, rank integer sds_indx, pid, irt, dims(3), start(3), stride(3), edge(3) integer j, k, status, level 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 along-track indecis. c Get SDS index and array identifier. sds_indx = sfn2index(hdf_file_id,'AVHRR_Along_Track_IDX') pid = sfselect(hdf_file_id,sds_indx) c Get array dimensions. irt = sfginfo(pid,SDS_name,rank,dims,num_type,nattrs) edge(1) = dims(1) edge(2) = dims(2) edge(3) = dims(3) c Read array. irt = sfrdata(pid,start,stride,edge,altrk_idx) if(irt .ne. 0) then write(*,'(/,''sds index, pid, dims'',5i10)') sds_indx, pid, dims level = 3 status = -1 write( errmsg,'('' Cannot read along track GAC indecis'',i10)') call message( 'get_collocation_indecis', errmsg, status, level ) end if c------------------------------------------------------------------------------ c Get across-track indecis. c Get SDS index and array identifier. sds_indx = sfn2index(hdf_file_id,'AVHRR_Across_Track_IDX') pid = sfselect(hdf_file_id,sds_indx) c Get array dimensions. irt = sfginfo(pid,SDS_name,rank,dims,num_type,nattrs) edge(1) = dims(1) edge(2) = dims(2) edge(3) = dims(3) c Read array. irt = sfrdata(pid,start,stride,edge,actrk_idx) if(irt .ne. 0) then write(*,'(/,''sds index, pid, dims'',5i10)') sds_indx, pid, dims level = 3 status = -1 write( errmsg,'('' Cannot read across track GAC indecis'',i10)') call message( 'get_collocation_indecis', errmsg, status, level ) end if c------------------------------------------------------------------------------ c Debug write statements. if(debug .gt. 0) then write(*,'(/,''Dimensions: '',3i10)') dims(1), dims(2), dims(3) write(*,'(''Along and across-track indecis for HIRS FOV (1,1):'')') do k = 1, 100 do j = 1, 1 write(*,'(3i10)') k, altrk_idx(k,j,1), actrk_idx(k,j,1) enddo enddo end if c------------------------------------------------------------------------------ return end