subroutine get_HIRS_orbit(input_rad_file, HIRS_2d, HIRS_1d, sat, nscans) c----------------------------------------------------------------------------------- c Description: Acquire HIRS geolocation and radiance data for current orbit. c c Input parameters: c input_rad_file input HIRS data file (one orbit) c c Output parameters: c HIRS_2d array of 2d variables (scan x elem x parms) c HIRS_1d array of 1d variables (scan x parms) c sat satellite name c nscans number of scans in orbit c c Revision history: 12/10 R. Frey Original version c c Non-HDF calls: subroutine get_2d_hirs c subroutine get_1d_hirs c subroutine message c c----------------------------------------------------------------------------------- IMPLICIT NONE save c----------------------------------------------------------------------------------- include 'hdf.inc' c----------------------------------------------------------------------------------- integer num_2d_SDS parameter (num_2d_SDS = 13) integer num_1d_SDS parameter (num_1d_SDS = 3) c----------------------------------------------------------------------------------- c Calling arguments. character*120 input_rad_file real*4 HIRS_2d(56,1100,num_2d_SDS), HIRS_1d(1100,num_1d_SDS) integer nscans c Local variables. character*160 errmsg character*48 SDS_2d_name_list(num_2d_SDS), SDS_name character*48 SDS_1d_name_list(num_1d_SDS) character*7 sat0, metop character*6 sat integer jj, level, status c HDF functions and associated variables. integer sfstart, sfend, hdf_file_id, irt, sffattr, attr_index, sfrattr c----------------------------------------------------------------------------------- c List of 2-D SDSs to read from input HIRS hdf file. c Data arrays appear in array 'HIRS_2d' in this order. data SDS_2d_name_list / & 'latitude ', & 'longitude ', & 'solar_zenith ', & 'satellite_zenith ', & 'channel_4_brightness_temperature ', & 'channel_5_brightness_temperature ', & 'channel_6_brightness_temperature ', & 'channel_7_brightness_temperature ', & 'channel_8_brightness_temperature ', & 'channel_10_brightness_temperature ', & 'channel_11_brightness_temperature ', & 'channel_12_brightness_temperature ', & 'channel_20_reflectance '/ c List of 1-D SDSs to read from input HIRS hdf file. c Data arrays appear in array 'HIRS_1d' in this order. data SDS_1d_name_list / & 'scan_line_year ', & 'scan_line_day_of_year ', & 'scan_line_UTC_time_of_day '/ data metop /'METOP'/ c----------------------------------------------------------------------------------- c Open HIRS L1b file. hdf_file_id = -100 hdf_file_id = sfstart(input_rad_file,DFACC_READ) c Read 2-D arrays. do jj = 1, num_2d_SDS SDS_name = SDS_2d_name_list(jj) call get_2d_hirs(hdf_file_id, SDS_name, HIRS_2d(1,1,jj), irt) if(irt .ne. 0) then irt = sfend(hdf_file_id) level = 3 status = -1 write(errmsg,'('' Cannot read input HIRS 2D data - aborting'')') call message('get_HIRS_orbit', errmsg, status, level) end if enddo c----------------------------------------------------------------------------------- c Read 1-D arrays. do jj = 1, num_1d_SDS SDS_name = SDS_1d_name_list(jj) call get_1d_hirs(hdf_file_id, SDS_name, HIRS_1d(1,jj), nscans, irt) if(irt .ne. 0) then irt = sfend(hdf_file_id) level = 3 status = -1 write(errmsg,'('' Cannot read input HIRS 1D data - aborting'')') call message('get_HIRS_orbit', errmsg, status, level) end if enddo c----------------------------------------------------------------------------------- c Read satellite number from global attribute. attr_index = sffattr (hdf_file_id, 'spacecraft_id') irt = sfrattr(hdf_file_id, attr_index, sat0) if(irt .ne. 0) then irt = sfend(hdf_file_id) level = 3 status = -1 write(errmsg,'('' Cannot read spacecraft ID - aborting'')') call message('get_HIRS_orbit', errmsg, status, level) end if if(sat0(1:5) .eq. metop) then sat = sat0(1:5)//sat0(7:7) else sat = sat0(1:4)//sat0(6:7) end if c----------------------------------------------------------------------------------- c Close HIRS L1b file. irt = sfend(hdf_file_id) c----------------------------------------------------------------------------------- return end