! ! Created this program for two purposes: ! 1) To list header information for users, and list the number of 5-min SO2 receptors available for each one-week period ! 2) To make sure I can describe how to read this file. ! character*4 RouOrInt, id(32), blank character*5 filename integer month1,day1,year1,month2,day2,year2 integer iyear(2016),imonth(2016),iday(2016),ihour(2016),iperiod(2016) real utmns(32),utmew(32),z(32) real metdata(2016,28),so2(2016,32) open(30,file='info.txt') open(20,file='List5minData.txt',status='old') !read past first two lines do i=1,2 read(20,1000) blank 1000 format(a4) end do !we are now ready to process 60 weeks of 5-min values do iwk=1,60 read(20,1000) blank !each week starts with one blank line read(20,1010) filename,RouOrInt,month1,day1,year1,month2,day2,year2 1010 format(8x,a5,22x,a4,1x,3i2,1x,3i2) !filename = Name of Archive File !RouOrInt = ROUT = Routine Sampling Period; INTN = Intensive Sampling Period !Month1,Day1,Year1 = Start date of week: month, day, year !Month2,Day2,Year2 = Stop date of week: month, day, year read(20,1020) num,(id(j),j=1,num) 1020 format(300x,i2,13x,32(3x,a4,3x)) !Num = Number of 5-min SO2 receptors for this one-week period !ID = 5-min SO2 receptor Identifications read(20,1030) num,(utmns(j),j=1,num) 1030 format(300x,i2,13x,32f10.3) !Num = Number of 5-min SO2 receptors for this one-week period !utmns = North-South UTM coordinates of receptor (km) read(20,1040) num,(utmew(j),j=1,num) 1040 format(300x,i2,13x,32f10.3) !Num = Number of 5-min SO2 receptors for this one-week period !utmew = East-West UTM coordinates of receptor (km) read(20,1050) num,(z(j),j=1,num) 1050 format(300x,i2,13x,32f10.2) !Num = Number of 5-min SO2 receptors for this one-week period !Z = Terrain elevation of receptor (km) write(30,2000) filename,RouOrInt,month1,day1,year1,month2,day2,year2,num 2000 format(2x,'File: ',a5,2x,a4,2x,3i2.2,2x,3i2.2,2x,'Num: ',i2) do ip=1,2016 read(20,3000) iyear(ip),imonth(ip),iday(ip),ihour(ip),iperiod(ip),(metdata(ip,k),k=1,28),(so2(ip,j),j=1,num) 3000 format(5i3,28f10.4,20x,32f10.4) end do !For each one-week period, there are 2016 5-min periods (ip). For each period we have: !Date/Time Group, 28 Meteorological Variables, and up to 32 5-min SO2 Values !NOTE: Be warned that when SAI created their archive files, they placed the last 5-min period ! of the previous week as the first 5-min period in each 1-week archive. So even though ! it looks strange, it is a known artifact of how the archive files were created. !Imonth(ip),Iday(ip),Iyear(ip) = month, day and year of 5-min period !Iperiod(ip) = Indicates which 5-min period within the hour: ! 1 = first 5-min period of the hour, and 12 = last 5-min period of the hour !metdata(ip,k) = 28 meteorological variables, see List5minData.txt for definitions. !so2(ip,k) = 5-min SO2 values (PPB). The number of SO2 receptors varies with each week, so be careful! end do stop end