program met_read c c This program reads NOPP ascii format met files. c It creates real time series arrays which c are evenly spaced in time of zonal and meridional winds c (uwnd and vwnd), wind speed, wind direction, relative c humidity (rh), and air temperature (airt). c c Also created are integer arrays of data quality. c c You can easily adapt this program to your needs. c c Programmed by Dai McClurg, NOAA/PMEL/OCRD, August 1999 c implicit none c integer nt parameter(nt = 1000000) c integer n, m c integer nblock, nn, ntime, n1, n2 c integer idate(nt), ihms(nt) integer iquwnd(nt), iqvwnd(nt), iqspd(nt), iqdir(nt), iqrh(nt) integer iqairt(nt) c real uwnd(nt), vwnd(nt), spd(nt), dir(nt), rh(nt), airt(nt) real flag c integer idepuwnd, idepvwnd, idepspd, idepdir integer ideprh, idepsst, idepairt c character infile*80, header*132 c c ....................................................................... c write(*,*) ' Enter the input met 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) ntime, nblock 10 format(63x,i7,7x,i3) c write(*,*) ntime, nblock c c Read the missing data flag c read(1,20) flag 20 format(63x,f6.1) c write(*,*) flag c c Initialize data arrays to flag and quality arrays to 5. c do n = 1, nt uwnd(n) = flag vwnd(n) = flag spd(n) = flag dir(n) = flag rh(n) = flag airt(n) = flag iquwnd(n) = 5 iqvwnd(n) = 5 iqspd(n) = 5 iqdir(n) = 5 iqrh(n) = 5 iqairt(n) = 5 enddo c c Read the data. c do m = 1, nblock read(1,30) n1, n2, nn read(1,50) idepuwnd, idepvwnd, idepspd, idepdir, . ideprh, idepairt read(1,'(a)') header do n = n1, n2 read(1,60) idate(n), ihms(n), uwnd(n), vwnd(n), spd(n), . dir(n), airt(n), rh(n), iquwnd(n), iqvwnd(n), . iqspd(n), iqdir(n), iqairt(n), iqrh(n) enddo enddo c 30 format(54x,i7,3x,i7,x,i7) 50 format(16x,5i6,i7) 60 format(x,i8,x,i6,3f6.2,f6.1,f6.2,f7.2,x,6i1) c close(1) c c Now write out the data and quality arrays to the standard output. c write(*,*) idepuwnd, idepvwnd, idepspd, idepdir, ideprh, . idepairt, idepsst c do n = 1, ntime write(*,60) idate(n), ihms(n), uwnd(n), vwnd(n), spd(n), . dir(n), airt(n), rh(n), iquwnd(n), iqvwnd(n), . iqspd(n), iqdir(n), iqairt(n), iqrh(n) enddo c end