10000 REM ******************* ozsum routine 24/06/98 ****************** 10010 REM MKII/MKIII/MKIV DS and ZS Ozone Summary 10020 REM 10030 REM (SCI-TEC Instruments, June 1998) 10040 REM 10060 REM ************************************************************* 10070 REM 10080 REM This routine outputs a summary list of direct sun and 10090 REM zenith sky observations for the current day. All data 10100 REM is generated from ozone observations. The output format 10110 REM used is WODC's standard format. 10120 REM 10220 REM Global Variables Referenced: 10230 REM TC() TQ() 10240 REM A1 B1 B2 10250 REM CL$ DC$ DD$ JD$ L1$ L2$ LO$ MDD$ NO$ TYP$ YF$ 10260 REM 10270 REM Exits: 11050, 15030, 31020 10280 REM 10290 REM Uses: 3100, 5400, 7220, 8000, 8025, 8050, 8075, 8100, 8150 10300 REM 10500 REM ************************************************************** 10510 REM History: dd/mm/yy 10520 REM 24/06/98 - Better error handling 10530 REM 08/04/96 - Improved format of OZOAVG file 10540 REM 12/10/95 - year added to file name OZOAVG in line 12100 10550 REM 21/07/95 - Check for negative ozone values; changed format 10560 REM 12/01/95 - No temperature constants -> no correction done 10570 REM ************************************************************** 11000 ' 11001 ' *** Setup *** 11002 ' 11010 DATA ozsum 11020 I=1:GOSUB 5400:REM temp coeffs 11030 TOBS=0:OOBS=0:NOBS=0:REM total/DS/ZS observations 12000 ' 12001 ' *** Open Brewer Data File and Print Header for Summary *** 12002 ' 12010 ON ERROR GOTO 30000:CLOSE 8 12020 OPEN DD$+"B"+JD$+YF$+"."+NO$ FOR INPUT AS 8 12030 ON ERROR GOTO 31000 12040 IF EOF(8) THEN 12200 12050 INPUT#8,A$:IF A$="ds" OR LEFT$(A$,1)="z" THEN 12500 12060 GOTO 12040 12200 PRINT "No ozone data available for this day.":X=1:GOSUB 7220 12210 ON ERROR GOTO 3100:CLOSE 8:RETURN 12500 CLOSE 8:OPEN DD$+"B"+JD$+YF$+"."+NO$ FOR INPUT AS 8 12510 PRINT CL$:PRINT "Position paper to top of page":GOSUB 9650 12520 PRINT#4,:PRINT#4,"Summary of Brewer ozone measurements for ";DC$;" (";JD$;")" 12530 PRINT#4,"Measurements made at ";LO$;" with instrument # ";NO$ 12540 PRINT#4,USING " Latitude = \ \ Longitude = \ \";L1$;L2$ 12550 PRINT#4,USING " ETC Values (O3/SO2) = #####/##### Absorption (O3/SO2) = .#####/##.####";B1;B2;A1;A3 12560 PRINT#4, 12570 PRINT#4,"Type Time(GMT) Temp Airmass dsO3 zsO3 Error dsSO2 zsSO2 Error" 12580 PRINT#4, 13000 ' 13001 ' *** Process Brewer DS/ZS Ozone Data *** 13002 ' 13010 GOSUB 8000:GOSUB 8025:MS(0)=4:MZ(0)=4:T%=0 13100 IF EOF(8) THEN 14000 13110 INPUT#8,A$:IF A$="inst" THEN GOSUB 25000 13120 IF A$<>"summary" THEN 13100 13130 INPUT#8,H$,A$,A$,A$,ZA,MU,TQ,TY$,FL$ 13140 IF TQ=-30 THEN 13100 13150 IF TY$<>"ds" AND LEFT$(TY$,1)<>"z" THEN 13100 13160 TOBS=TOBS+1 13170 INPUT#8,A$,A$,A$,A$,R5,R6,SO,OZ 13180 INPUT#8,A$,A$,A$,A$,A$,A$,ES,EO 13190 PRINT#4,RIGHT$(TY$,2);RIGHT$(" "+FL$,2);RIGHT$(" "+H$,10); 13200 IF LEFT$(TY$,1)="z" THEN 13300 13210 OZ=(R6-B1+T%*TQ*(TQ(1)-TC(1)))/MU/A1 13220 SO=((R5-B2+T%*TQ*(TQ(0)-TC(0)))/MU/A3-OZ)/A2 13230 OZ=OZ/10:SO=SO/10 13240 PRINT#4,USING " ### ###.### #####.# +###.# #####.# +####.#";TQ;MU;OZ;EO;SO;ES 13250 GOSUB 20000:GOTO 13100 13300 PRINT#4,USING " ### ###.### #####.# +###.# #####.# +####.#";TQ;MU;OZ;EO;SO;ES 13310 GOSUB 21000:GOTO 13100 14000 ' 14001 ' *** Close Brewer File and Print Out Summary Data *** 14002 ' 14010 PRINT#4,:CLOSE 8:GOSUB 22000 14020 IF S(0)+Z(0)>0 THEN GOSUB 23000 14030 IF S(0)>0 OR Z(0)>0 THEN PRINT#4,USING " ### observations.";TOBS:GOTO 15000 14100 PRINT#4, 14110 PRINT#4,"*** Insufficient data to calculate ***" 14120 PRINT#4,"*** statistics for this day's observations. ***" 15000 ' 15001 ' *** Clean Up and Exit *** 15002 ' 15010 ON ERROR GOTO 3100 15020 RETURN 20000 ' 20001 ' *** Include DS Ozone Observation in Calculations *** 20002 ' 20010 OOBS=OOBS+1:IF OZ<0 OR MU>4 OR EO>2.5 THEN RETURN 20100 REM 20101 REM Calculate sums 20102 REM 20110 MS(1)=OZ:MS(2)=SO:MS(3)=1/MU:MS(4)=VAL(LEFT$(H$,4)) 20111 ' HPREV=HOUR 20112 ' MIN=VAL(MID$(H$,4,2)) 20113 ' HOUR=VAL(LEFT$(H$,2)) 20114 ' IF MIN>30 THEN HOUR=HOUR+1 20115 ' IF HOUR4 OR EO>2.5 THEN RETURN 21100 REM 21101 REM Calculate sums 21102 REM 21110 MZ(1)=OZ:MZ(2)=SO:MZ(3)=1/MU:MZ(4)=VAL(LEFT$(H$,4)) 21120 GOSUB 8075:RETURN 22000 ' 22001 ' *** Print Daily Mean Values *** 22002 ' 22010 GOSUB 8100:GOSUB 8150 22020 IF S(3)>0 THEN S(3)=100/S(3) 22030 IF Z(3)>0 THEN Z(3)=100/Z(3) 22200 IF S(0)>0 OR Z(0)>0 THEN PRINT#4,USING " Daily means: #####.# #####.# #####.# #####.#";S(1);Z(1);S(2);Z(2) 22210 IF S(0)>0 OR Z(0)>0 THEN PRINT#4,USING " Standard deviation: #####.# #####.# #####.# #####.#";S(16);Z(16);S(17);Z(17) 22220 IF S(0)>0 OR Z(0)>0 THEN PRINT#4,USING " Number of observations: ### /### ### /###";S(0);OOBS;Z(0);NOBS; 22230 RETURN 23000 ' 23001 ' *** Add Daily Mean Values to Ozone Average File *** 23002 ' 23010 ON ERROR GOTO 32000 23020 AVGFILE$="OZOAVG" 23100 CLOSE 6:OPEN DD$+AVGFILE$+YF$+"."+NO$ FOR APPEND AS #6 23110 REM DS-ozone +/-DS-ozone DS-SO2 +/-DS-SO2 num/tot hmud emitd 23120 REM ZS-ozone +/-FZ-ozone FZ-SO2 +/-FZ-SO2 num/tot hmuz emitz 23130 PRINT#6,JD$;YF$; 23140 PRINT#6,USING "####.# +##.# ###.# +##.# ##/### ### ##";S(1);S(16);S(2);S(17);S(0);OOBS;S(3);S(4); 23150 PRINT#6,USING "####.# +##.# ###.# +##.# ##/### ### ##";Z(1);Z(16);Z(2);Z(17);Z(0);NOBS;Z(3);Z(4) 23160 CLOSE 6 23200 ON ERROR GOTO 31000 23210 RETURN 25000 ' 25001 ' *** Reads in Temperature Coefficients when Data was Recorded *** 25002 ' 25010 FOR I=2 TO 6:INPUT#8,TQ(I):NEXT:FOR I=1 TO 19:INPUT#8,A$:NEXT 25020 INPUT#8,TQ(7),NTQ(7):FOR I=2 TO 6:INPUT#8,NTQ(I):NEXT 25030 TQ(0)=TQ(2)-TQ(5)-3.2*(TQ(5)-TQ(6)) 25040 TQ(1)=TQ(3)-TQ(5)-.5*(TQ(4)-TQ(5))-1.7*(TQ(5)-TQ(6)) 25050 NTQ(1)=.1*NTQ(2)-.59*NTQ(3)+.11*NTQ(4)+1.2*NTQ(5)-.82*NTQ(6) 25060 T%=1:RETURN 30000 ' 30001 ' *** Error Handler on File Open *** 30002 ' 30010 PRINT "No Brewer (B) file available for this day." 30020 RESUME 30030 30030 X=1:GOSUB 7220:ON ERROR GOTO 3100:CLOSE 8:RETURN 31000 ' 31001 ' *** Generic Error Handler *** 31002 ' 31010 GOTO 3100 32000 ' 32001 ' *** Error Handler for Average File *** 32002 ' 32010 IF ERR=53 AND ERL=23100 THEN RESUME 23160 32020 GOTO 31000 65529 REM proper last line