program jslapm * c *Purpose: convert "archive" to "processing" format for monthly data. c c *Declare Variables character dstn*3, ver*1 character afile*11, pfile*9 character head*19, hbuf*4, lat*6, long*7 * dimension idar(12) * data afile / 'msssv.dat' / data pfile / 'mvsss.dat' / * call userin( dstn, ver ) * c *build filenames and open. afile(2:4) = dstn afile(5:5) = ver pfile(2:2) = ver pfile(3:5) = dstn open(unit=10,file=afile,status='old') open(unit=12,file=pfile,status='new') * c *read in and write out header read(10,100) hbuf, head, istart, iend, lat, long 100 format(a4,1x,a19,20x,i4,1x,i4,1x,a6,1x,a7) write(12,200) head, lat, long, istart, iend 200 format(a19,21x,a6,1x,a7,i4,'-',i4) * c *read in one year at a time do 5 iy = istart, iend read(10,300) idar 300 format(14x,6(5x,i4),/,14x,6(5x,i4)) * c *write out in "proc" format write(12,500) head(1:4), iy, (idar(i),i=1,12) 5 continue * 500 format(a4,6x,i4,'M',12i4) * close(10) close(12) stop 'cowabunga' end * subroutine userin( dstn, ver ) * character dstn*3, ver*1 * write(6,100) 100 format(///////' Convert "archiving" to "processing" format',/, + ' for monthly data ',//) * write(6,300) 300 format(/,' Enter station # (ie, 001) : ',\) read(5,'(a)') dstn * write(6,500) 500 format(/,' Enter series version (ie, a) : ',\) read(5,'(a)') ver * return end