program rad_dy_read c c This program reads anonymous FTP ascii format daily radiation files, c for example 0n156e_dy.rad. It creates real time series arrays c which are evenly spaced in time. c c Also created is an integer array of quality c c You can easily adapt this program to your needs. c c Programmed by Dai McClurg, NOAA/PMEL/OCRD, April 1999 c implicit none c integer nt parameter(nt = 50000) c integer n, m c integer nblock, nn, nday, n1, n2 c integer idate(nt), ihour(nt) integer iqrad(nt) c real rad(nt), flag c real deprad c character infile*80, header*132 c c ....................................................................... c write(*,*) ' Enter the input daily Radiation file name ' read(*,'(a)') infile c open(1,file=infile,status='old',form='formatted') c c Read total number of hours and blocks of data. c read(1,10) nday, nblock 10 format(63x,i6,7x,i3) c write(*,*) nday, nblock c c Read the missing data flag c read(1,20) flag 20 format(20x,f6.1) c write(*,*) flag c c Initialize data arrays to flag and quality arrays to 5. c do n = 1, nt rad(n) = flag iqrad(n) = 5 enddo c c Read the data. c do m = 1, nblock read(1,30) n1, n2, nn read(1,50) deprad read(1,'(a)') header do n = n1, n2 read(1,60) idate(n), ihour(n), rad(n) enddo enddo c 30 format(54x,i6,3x,i6,x,i6) 50 format(16x,f9.1) 60 format(x,i8,x,i6,f9.2,x,i1) c close(1) c c Now write out the data and quality arrays to the standard output. c write(*,*) deprad c do n = 1, nday write(*,60) idate(n), ihour(n), rad(n) enddo c end