program ncar_ezmap ! !******************************************************************************* ! !! NCAR_EZMAP converts text EZMAPDAT to binary EZMAPDATA. ! ! ! Discussion: ! ! The NCAR graphics package mapping routines need the binary data file. ! ! Modified: ! ! 23 January 2001 ! character ( len = 8 ) date real flim(4) integer i integer idls integer idrs integer igid character ( len = 80 ) :: input_file integer input_read integer ios integer npts character ( len = 80 ) :: output_file integer output_write real pnts(200) character ( len = 80 ) s character ( len = 10 ) time ! call date_and_time ( date, time ) input_file = 'ezmapdat' input_read = 0 output_file = 'ezmapdata' output_write = 0 write ( *, * ) ' ' write ( *, * ) 'NCAR_EZMAP' write ( *, * ) ' Convert the formatted text file ' // trim ( input_file ) write ( *, * ) ' to the unformatted file ' // trim ( output_file ) write ( *, * ) ' ' write ( *, * ) ' The unformatted file is used by the NCAR graphics' write ( *, * ) ' package EZMAP routines.' write ( *, * ) ' ' write ( *, * ) ' Today''s date: ', date write ( *, * ) ' Today''s time: ', time open ( unit = 1, status = 'old', file = input_file, iostat = ios ) if ( ios /= 0 ) then write ( *, * ) ' ' write ( *, * ) 'NCAR_EZMAP - Fatal error!' write ( *, * ) ' Could not open the input file: ', trim ( input_file ) stop end if open ( unit = 2, status = 'replace', form = 'unformatted', & file = output_file, iostat = ios ) if ( ios /= 0 ) then write ( *, * ) ' ' write ( *, * ) 'NCAR_EZMAP - Fatal error!' write ( *, * ) ' Could not open the output file: ', trim ( output_file ) stop end if do i = 1, 10 read ( 1, '(a)' ) s input_read = input_read + 1 end do do read ( 1, '(4i4,4f8.3)', iostat = ios ) npts, igid, idls, idrs, flim(1:4) if ( ios /= 0 ) then exit end if input_read = input_read + 1 if ( npts > 1 ) then read ( 1, '(10f8.3)', iostat = ios ) pnts(1:npts) if ( ios /= 0 ) then exit end if input_read = input_read + 1 + ( ( npts - 1 ) / 10 ) end if write ( 2 ) npts, igid, idls, idrs, flim(1:4), pnts(1:npts) output_write = output_write + 1 end do write ( *, * ) ' ' write ( *, * ) 'NCAR_EZMAP' write ( *, * ) ' Number of lines read was ', input_read write ( *, * ) ' Number of records written was ', output_write write ( *, * ) ' ' write ( *, * ) 'NCAR_EZMAP' write ( *, * ) ' Normal end of execution.' stop end