;{CR10X} ; Bucknell University Weather Station ; Base Configuration ; Duane A. Griffin, Geography Dept. ; BASE 6.2 Revised 9/18/03 ; ;---------------------------------------------------------- ;////////////////////// CR10X ///////////////////////////// ;---------------------------------------------------------- ; ; This program is the base configuration for the Bunknell University Weather ; Station CR10X datalogger in its primary configuration. The station can be ; reprogrammed or reconfigured to meet special research or teaching needs. ; ; The program is documented extensively and can be readily modified with a basic ; understanding of Campbell Scientific's programming system. A copy of the CR10X ; user manual (including programming instructions and reference) is available in ; the Geography Department office. ; ; Base configuration program process: ; Inputs ; 1. Measure pressure (every five minutes) ; 2. Measure wind speed and direction ; 3. Measure temperature and relative humidity, calculate wndchill, heat index, ; and dewpoint temperatures. ; 4. Measure rainfall ; 5. Calculate hourly evapotranspiration estimate and surface moisture balance ; 6. Measure radiation ; 7. Calculate sunshine hours ; Outputs ; 1. Array 101 output (hourly values) ; 2. Array 102 output (24 hour summary) ; ; Note that the station uses Eastern Standard Time. Adjustments to DST must be made ; manually when using output data. ; ;---------------------------------------------------------- ;////////////////////// START ///////////////////////////// ;---------------------------------------------------------- ; ; Set execution interval ; Measure datalogger battery voltage (in volts) and write to input location 1 ; Set signature and write to input location 2 at beginning of 24hr period ; Record internal temperature and writes to input location 3. ; *Table 1 Program 01: 60 Execution Interval (seconds) 1: Batt Voltage (P10) 1: 1 Loc [ Batt_Volt ] 2: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 1440 Interval (same units as above) 3: 30 Then Do 3: Signature (P19) 1: 2 Loc [ Prog_Sig ] 4: End (P95) 5: Internal Temperature (P17) 1: 3 Loc [ ITemp_C ] ;========================================================== ;///////////////// BAROMETRIC PRESSURE //////////////////// ;---------------------------------------------------------- ; Measures CS105 Barometric Pressure Sensor in hPa (= mb) with offset for ; Lewisburg elevation. Sensor must be turned on 1 minute before measurement ; in order to warm up. 6: If time is (P92) 1: 4 Minutes (Seconds --) into a 2: 5 Interval (same units as above) 3: 42 Set Port 2 High 7: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 5 Interval (same units as above) 3: 30 Then Do 8: Volt (SE) (P1) ;Actual measurement 1: 1 Reps 2: 25 2500 mV 60 Hz Rejection Range 3: 4 SE Channel 4: 4 Loc [ P_mb ] 5: .184 Mult 6: 616 Offset 9: Do (P86) 1: 52 Set Port 2 Low 10: End (P95) ;========================================================== ;/////////////// WIND SPEED AND DIRECTION ///////////////// ;---------------------------------------------------------- ; Measures wind speed and direction from MET One 0345-L windset ; Measure wind speed 11: Pulse (P3) 1: 1 Reps 2: 1 Pulse Channel 1 3: 22 Switch Closure, Output Hz 4: 5 Loc [ WS_ms ] 5: 0.799 Mult 6: 0.2811 Offset ; Set speed to zero if wind is not blowing 12: If (X<=>F) (P89) 1: 5 X Loc [ WS_ms ] 2: 4 < 3: 0.2911 F 4: 30 Then Do 13: Z=F (P30) 1: 0 F 2: 0 Exponent of 10 3: 5 Z Loc [ WS_ms ] 14: End (P95) 15: Z=X*F (P37) 1: 5 X Loc [ WS_ms ] 2: 2.2369 F 3: 6 Z Loc [ WS_mph ] ; Measure wind direction 16: Excite-Delay (SE) (P4) 1: 1 Reps 2: 5 2500 mV Slow Range 3: 3 SE Channel 4: 1 Excite all reps w/Exchan 1 5: 2 Delay (units 0.01 sec) 6: 2500 mV Excitation 7: 7 Loc [ WindDir ] 8: 0.288 Mult 9: 0 Offset 17: If (X<=>F) (P89) 1: 7 X Loc [ WindDir ] 2: 3 >= 3: 360 F 4: 30 Then Do 18: Z=F (P30) 1: 0 F 2: 0 Exponent of 10 3: 7 Z Loc [ WindDir ] 19: End (P95) ; ========================================================= ;//////////// TEMPERATURE AND RELATIVE HUMIDITY /////////// ;---------------------------------------------------------- ; Measure air temperature and humidity from HMP45C probe 20: Do (P86) 1: 41 Set Port 1 High ; Pause 150 mSec to allow probe to stabilize before making measurements 21: Excitation with Delay (P22) 1: 1 Ex Channel ;orange wire 2: 15 Delay W/Ex (units = 0.01 sec) 3: 0 Delay After Ex (units = 0.01 sec) 4: 0 mV Excitation ; Measure HMP45C temperature (Celsius) 22: Volt (SE) (P1) 1: 1 Reps 2: 25 2500 mV 60 Hz Rejection Range 3: 2 SE Channel 4: 8 Loc [ AirTC ] ;yellow wire 5: 0.1 Mult 6: -40.0 Offset ; Measure HMP45C temperature (Farenheit) 23: Volt (SE) (P1) 1: 1 Reps 2: 25 2500 mV 60 Hz Rejection Range 3: 2 SE Channel 4: 9 Loc [ AirTF ] 5: .18 Mult 6: -40 Offset ; Measure HMP45C Relative Humidity (as fraction for absolute humidity calc.) 24: Volt (SE) (P1) 1: 1 Reps 2: 25 2500 mV 60 Hz Rejection Range 3: 1 SE Channel 4: 10 Loc [ RH_frac ] ;blue wire 5: 0.001 Mult 6: 0 Offset ; Turn HMP45C off 25: Do (P86) 1: 51 Set Port 1 Low ; Calculate RH as percent 26: Z=X*F (P37) 1: 10 X Loc [ RH_frac ] 2: 100 F 3: 11 Z Loc [ RH ] ; Under saturated conditions, readings for RH may be >100% ; This subroutine checks and sets maximum RH at 100%. 27: If (X<=>F) (P89) 1: 11 X Loc [ RH ] 2: 3 >= 3: 100 F 4: 30 Then Do 28: If (X<=>F) (P89) 1: 11 X Loc [ RH ] 2: 4 < 3: 108 F 4: 30 Then Do 29: Z=F (P30) 1: 100 F 2: 0 Exponent of 10 3: 11 Z Loc [ RH ] 30: End (P95) 31: End (P95) ;----------------------------------- ; Compute vapor pressure (e) and saturation vapor pressure (e_sat). ; (Units = kPa) ; ; Datalogger computes vapor pressure (equation: Vp=RH*SVp/100 ; where RH = relative humidity (%) and SVp = saturation vapor ; pressure (kPa) ; ; Datalogger calculates saturation vapor pressure with instruction ; 56 which uses an approximating polynomial to calculate saturation ; vapor pressure from air temperature (Lowe, P.R. 1930. J. Appl. ; Meteor., 16:100-103). 32: Saturation Vapor Pressure (P56) 1: 8 Temperature Loc [ AirTC ] 2: 12 Loc [ e_sat ] 33: Z=X*Y (P36) 1: 12 X Loc [ e_sat ] 2: 10 Y Loc [ RH_frac ] 3: 13 Z Loc [ e ] ; Convert to mb 34: Z=X*F (P37) 1: 12 X Loc [ e_sat ] 2: 10 F 3: 14 Z Loc [ e_sat_mb ] 35: Z=X*F (P37) 1: 13 X Loc [ e ] 2: 10 F 3: 15 Z Loc [ e_mb ] ;----------------------------------- ; DEWPOINT TEMPERATURE (TdF) ; The equation used to calculate dew point is: ; Td=(241.88*ln(Vp/0.61078))/(17.558-ln(Vp/0.61078)) ; where ; Td = dew point (Deg C) ; and Vp = vapor pressure (kPa) ; ; The equation is an inverse of a version of Teten's equation (Tetens, O. 1930. ; Z. Geophys., 6:297), optimized for dew points in the range -35 to 50 deg C, ; and is accurate to within +/-0.1 deg C within that range. ; ; Campbell Scientific has a "Calculating Dew Point from RH and Air Temperature" ; Application Note at http://www.campbellsci.co.uk/support/technts/technt16.pdf ; Calculate Td TdC=(241.88*ln(e/0.61078))/(17.558-ln(e/0.61078)) ; Convert to deg F (TdF) 36: Z=X*F (P37) 1: 44 X Loc [ TDC ] 2: 1.8 F 3: 45 Z Loc [ TDscratch ] 37: Z=X+F (P34) 1: 45 X Loc [ TDscratch ] 2: 32 F 3: 29 Z Loc [ TdF ] ;----------------------------------------- ; CALCULATE HEAT INDEX ; ; NOTE: HEAT INDEX VALUES CALCULATED IN AUGUST '03 WERE BADLY FLAWED ; SO THIS VARIABLE HAS BEEN COMMENTED OUT AND REMOVED FROM THE OUTPUT ; ;The Heat Index is the perceived temperature as influenced by the relative humidity. ;The equation used in this calculation is from the National Weather Service; a good ;explanation may be found at http://www.srh.noaa.gov/bmx/tables/heat_index.html ; ;The equation is only useful if air temperature > 80 degF (27 degC) and relative humidity > ;40%, therefore, the program will set the heat index temperature equal to the current ;air temperature if air temperature is < 80 degF (27 degC) or relative humidity < 40% or ;the heat index < current air temperature. ; ;The equation is: ; ;HI=-42.379+2.049*T+10.143*R-0.22476*T*R-6.8378x10^-3*T^2-5.4817x10^-2*R^2+1.2287x10^-3*T^2*R+8.5282x10^-4*T*R^2-1.99x10^-6*T^2*R^2 ; ;where: ; ;HI = heat index in Deg F ;T = air temperature in Deg F ;R = relative humidity in percent (e.g., 30) ; ;Campbell Scientific also has a "Heat Index" Application Note at ;ftp://ftp.campbellsci.com/pub/outgoing/apnotes/heatindx.pdf ; If T<80 degF, or RH < 40%, set HI to AirTF 38: If (X<=>F) (P89) 1: 9 X Loc [ AirTF ] 2: 4 < 3: 80 F 4: 30 Then Do 39: Z=X (P31) 1: 9 X Loc [ AirTF ] 2: 28 Z Loc [ HI ] 40: Else (P94) 41: If (X<=>F) (P89) 1: 11 X Loc [ RH ] 2: 4 < 3: 40 F 4: 30 Then Do 42: Z=X (P31) 1: 9 X Loc [ AirTF ] 2: 28 Z Loc [ HI ] 43: Else (P94) ; Calculate Heat Index HI=-42.379+2.049*AirTF+10.143*RH-0.22476*AirTF*RH-6.8378*10^(-3)*_ AirTF^2-5.4817*10^(-2)*RH^2+1.2287*10^(-3)*AirTF^2*RH+8.5282*_ 10^(-4)*AirTF*RH^2-1.99*10^(-6)*AirTF^2*RH^2 44: End (P95) 45: End (P95) ;----------------------------------- ; CALCULATE WINDCHILL ; ; ; The formula used in this calculation is the new (winter of 2001/2002) ; National Weather Service formula and may be found at ; http://www.srh.noaa.gov/ftproot/ffc/html/wci.shtml: ; ; Twc = 35.74 + 0.6215T - 35.75(V^0.16) + 0.4275T(V^0.16) ; ; where: ; ; Twc = Wind Chill (deg F) ; T = Air Temperature (deg F) ; V = Wind Speed (mph) ; ; Wind chill is only defined for air temperature < 50 deg F and wind speed > 3 mph, ; therefore, the program will set the wind chill temperature equal to the current ; air temperature if air temperature > 50 deg F or wind speed < 3 mph. ; If T > 50 degF, or WS < 3 mph, set TwcF to AirTF 46: If (X<=>F) (P89) 1: 9 X Loc [ AirTF ] 2: 3 >= 3: 50 F 4: 30 Then Do 47: Z=X (P31) 1: 9 X Loc [ AirTF ] 2: 30 Z Loc [ TwcF ] 48: Else (P94) 49: If (X<=>F) (P89) 1: 6 X Loc [ WS_mph ] 2: 4 < 3: 3 F 4: 30 Then Do 50: Z=X (P31) 1: 9 X Loc [ AirTF ] 2: 30 Z Loc [ TwcF ] ; Calculate Wind Chill TwcF=35.74+0.6215*AirTF-35.75*(WS_mph^0.16)+0.4275*AirTF*(WS_mph^0.16) 51: End (P95) 52: End (P95) ;========================================================== ;/////////////////////// RAIN GAGE //////////////////////// ;---------------------------------------------------------- ; Measures TE525 Tipping Bucket Rain Gage 53: Pulse (P3) 1: 1 Reps 2: 2 Pulse Channel 2 3: 2 Switch Closure, All Counts 4: 16 Loc [ Rain_mm ] 5: .01 Mult 6: 0.00 Offset 54: Z=X*F (P37) 1: 16 X Loc [ Rain_mm ] 2: .03937 F 3: 17 Z Loc [ Rain_in ] 55: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 1440 Interval (same units as above) 3: 30 Then Do 56: Z=X (P31) 1: 17 X Loc [ Rain_in ] 2: 52 Z Loc [ Raindayin ] 57: End (P95) 58: Z=X+Y (P33) 1: 52 X Loc [ Raindayin ] 2: 17 Y Loc [ Rain_in ] 3: 52 Z Loc [ Raindayin ] ;========================================================== ;///////////////// CNR 1 NET RADIOMETER /////////////////// ;---------------------------------------------------------- ; ; Note: Mult value = 1000/Sensitivity. Sensitivity value from instrument ; calibration certificate. ; Measure CM3 up (incoming shortwave) 59: Volt (SE) (P1) 1: 1 Reps 2: 33 25 mV 50 Hz Rejection Range 3: 5 SE Channel 4: 18 Loc [ SW_in ] 5: 90.4 Mult 6: 0.0 Offset ; if incoming SW < 0, set SW_in = 0 60: If (X<=>F) (P89) 1: 18 X Loc [ SW_in ] 2: 4 < 3: 0.0 F 4: 30 Then Do 61: Z=F x 10^n (P30) 1: 0.0 F 2: 00 n, Exponent of 10 3: 18 Z Loc [ SW_in ] 62: End (P95) ; Measure CM3 down (outgoing shortwave) 63: Volt (SE) (P1) 1: 1 Reps 2: 33 25 mV 50 Hz Rejection Range 3: 6 SE Channel 4: 19 Loc [ SW_out ] 5: 90.4 Mult 6: 0.0 Offset ; if incoming SW < 0, set SW_out = 0 64: If (X<=>F) (P89) 1: 18 X Loc [ SW_in ] 2: 1 = 3: 0.0 F 4: 30 Then Do 65: Z=F x 10^n (P30) 1: 0.0 F 2: 00 n, Exponent of 10 3: 19 Z Loc [ SW_out ] 66: End (P95) ; Measure CG3 up (incoming longwave) 67: Volt (SE) (P1) 1: 1 Reps 2: 33 25 mV 50 Hz Rejection Range 3: 7 SE Channel 4: 36 Loc [ LWin_raw ] 5: 90.4 Mult 6: 0.0 Offset ; Measure CG3 down (outgoing longwave) 68: Volt (SE) (P1) 1: 1 Reps 2: 33 25 mV 50 Hz Rejection Range 3: 8 SE Channel 4: 37 Loc [ LWout_raw ] 5: 90.4 Mult 6: 0 Offset ; Measure CNR1 Temperature 69: Full Bridge w/mv Excit (P9) 1: 1 Reps 2: 33 25 mV 50 Hz Rejection Ex Range 3: 33 25 mV 50 Hz Rejection Br Range 4: 5 DIFF Channel 5: 3 Excite all reps w/Exchan 3 6: 2100 mV Excitation 7: 38 Loc [ CNR1TempC ] 8: 1.0 Mult 9: 0.0 Offset 70: Temperature RTD (P16) 1: 1 Reps 2: 38 R/R0 Loc [ CNR1TempC ] 3: 38 Loc [ CNR1TempC ] 4: 1.0 Mult 5: 0.0 Offset 71: Z=X+F (P34) 1: 38 X Loc [ CNR1TempC ] 2: 273.18 F 3: 39 Z Loc [ CNR1TempK ] ; ================================================ ; Calculations ; =============================================== ; LW temperature corrections ; CG3_Up temperature correction = CG3_up+5.67*10^-8Temp_K^4 ; CG3_Dn temperature correction = CG3_dn+5.67*10^-8Temp_K^4 72: Z=F (P30) 1: 5.67 F 2: -8 Exponent of 10 3: 40 Z Loc [ scratch_1 ] 73: Z=F (P30) 1: 4 F 2: 0 Exponent of 10 3: 41 Z Loc [ scratch_2 ] 74: Z=X^Y (P47) 1: 39 X Loc [ CNR1TempK ] 2: 41 Y Loc [ scratch_2 ] 3: 42 Z Loc [ scratch_3 ] 75: Z=X*Y (P36) 1: 40 X Loc [ scratch_1 ] 2: 42 Y Loc [ scratch_3 ] 3: 43 Z Loc [ scratch_4 ] 76: Z=X+Y (P33) 1: 36 X Loc [ LWin_raw ] 2: 43 Y Loc [ scratch_4 ] 3: 21 Z Loc [ LW_in ] 77: Z=X+Y (P33) 1: 37 X Loc [ LWout_raw ] 2: 43 Y Loc [ scratch_4 ] 3: 22 Z Loc [ LW_out ] ; Calculate Net Radiation ------------ ; SW_net = SW_in - SW_out 78: Z=X-Y (P35) 1: 18 X Loc [ SW_in ] 2: 19 Y Loc [ SW_out ] 3: 23 Z Loc [ SW_net ] ; NW_Net = LW_in - LW_out 79: Z=X-Y (P35) 1: 21 X Loc [ LW_in ] 2: 22 Y Loc [ LW_out ] 3: 24 Z Loc [ LW_net ] ; Albedo= SW_out / SW_in 80: Z=X/Y (P38) 1: 19 X Loc [ SW_out ] 2: 18 Y Loc [ SW_in ] 3: 20 Z Loc [ Albedo ] ; Net total radiation = (SW_in + LW_in) - (SW_out + SW_in) 81: Z=X+Y (P33) 1: 18 X Loc [ SW_in ] 2: 21 Y Loc [ LW_in ] 3: 25 Z Loc [ Total_in ] 82: Z=X+Y (P33) 1: 19 X Loc [ SW_out ] 2: 22 Y Loc [ LW_out ] 3: 26 Z Loc [ Total_out ] 83: Z=X-Y (P35) 1: 25 X Loc [ Total_in ] 2: 26 Y Loc [ Total_out ] 3: 27 Z Loc [ Total_net ] ;========================================================== ;//////////////// SUNSHINE HOURS ESTIMATE ///////////////// ;---------------------------------------------------------- ;Sunshine Hours ;Units for Sunshine Hours: Hours ; ;Estimates if current weather is sunny by checking if current global radiation is ;>0.4 times the current potential solar radiation outside Earth's atmosphere, calculated ; from solar angle calculation. ; ;See "Calculating Sunshine Hours from Pyranometer/Solarimeter Data" Application Note at ;http://www.campbellsci.co.uk/support/technts/technt18.pdf ; ----------------------------- ;Calculate threshold ; Set latitude 84: Z=F x 10^n (P30) 1: 41 F 2: 0 n, Exponent of 10 3: 54 Z Loc [ latitude ] ; Longitude correction 85: Z=F x 10^n (P30) 1: -0.1333 F 2: 0 n, Exponent of 10 3: 55 Z Loc [ loncor ] ; get julian day 86: Time (P18) 1: 2 Hours into current year {maximum 8784) 2: 0 Mod/By 3: 56 Loc [ clndrday ] 87: Z=X*F (P37) 1: 56 X Loc [ clndrday ] 2: 0.04167 F 3: 56 Z Loc [ clndrday ] ; Scale days for polynomial and calculate sin(d) 88: Z=X*F (P37) 1: 56 X Loc [ clndrday ] 2: 0.01 F 3: 57 Z Loc [ day100 ] 89: Polynomial (P55) 1: 1 Reps 2: 57 X Loc [ day100 ] 3: 58 F(X) Loc [ sind ] 4: -.37726 C0 5: -.10564 C1 6: 1.2458 C2 7: -.75478 C3 8: .13627 C4 9: -.00572 C5 90: If (X<=>F) (P89) 1: 56 X Loc [ clndrday ] 2: 3 >= 3: 180 F 4: 30 Then Do 91: Z=X+F (P34) 1: 57 X Loc [ day100 ] 2: -1.8 F 3: 59 Z Loc [ eqoftime ] 92: Polynomial (P55) 1: 1 Reps 2: 59 X Loc [ eqoftime ] 3: 59 F(X) Loc [ eqoftime ] 4: -.05039 C0 5: -.33954 C1 6: .04084 C2 7: 1.8928 C3 8: -1.7619 C4 9: .4224 C5 93: Else (P94) 94: Polynomial (P55) 1: 1 Reps 2: 59 X Loc [ eqoftime ] 3: 59 F(X) Loc [ eqoftime ] 4: -.04056 C0 5: -.74503 C1 6: .08823 C2 7: 2.0516 C3 8: -1.8111 C4 9: .42832 C5 95: End (P95) 96: Z=X*Y (P36) 1: 58 X Loc [ sind ] 2: 58 Y Loc [ sind ] 3: 60 Z Loc [ cosd ] 97: Z=X*F (P37) 1: 60 X Loc [ cosd ] 2: -1 F 3: 60 Z Loc [ cosd ] 98: Z=Z+1 (P32) 1: 60 Z Loc [ cosd ] 99: Z=SQRT(X) (P39) 1: 60 X Loc [ cosd ] 2: 60 Z Loc [ cosd ] 100: Z=SIN(X) (P48) 1: 54 X Loc [ latitude ] 2: 61 Z Loc [ sinlxd ] 101: Z=X*Y (P36) 1: 58 X Loc [ sind ] 2: 61 Y Loc [ sinlxd ] 3: 61 Z Loc [ sinlxd ] 102: Z=X+F (P34) 1: 54 X Loc [ latitude ] 2: 90 F 3: 62 Z Loc [ coslxd ] 103: Z=SIN(X) (P48) 1: 62 X Loc [ coslxd ] 2: 62 Z Loc [ coslxd ] 104: Z=X*Y (P36) 1: 60 X Loc [ cosd ] 2: 62 Y Loc [ coslxd ] 3: 62 Z Loc [ coslxd ] 105: Time (P18) 1: 1 Minutes into current day (maximum 1440) 2: 0 Mod/By 3: 63 Loc [ t ] 106: Z=X*F (P37) 1: 63 X Loc [ t ] 2: .01667 F 3: 63 Z Loc [ t ] 107: Z=X+F (P34) 1: 63 X Loc [ t ] 2: -12 F 3: 64 Z Loc [ tto ] 108: Z=X+Y (P33) 1: 64 X Loc [ tto ] 2: 55 Y Loc [ loncor ] 3: 64 Z Loc [ tto ] 109: Z=X+Y (P33) 1: 64 X Loc [ tto ] 2: 59 Y Loc [ eqoftime ] 3: 64 Z Loc [ tto ] 110: Z=X*F (P37) 1: 64 X Loc [ tto ] 2: 15 F 3: 65 Z Loc [ sinl ] 111: Z=X+F (P34) 1: 65 X Loc [ sinl ] 2: 90 F 3: 65 Z Loc [ sinl ] 112: Z=SIN(X) (P48) 1: 65 X Loc [ sinl ] 2: 65 Z Loc [ sinl ] 113: Z=X*Y (P36) 1: 65 X Loc [ sinl ] 2: 62 Y Loc [ coslxd ] 3: 65 Z Loc [ sinl ] 114: Z=X+Y (P33) 1: 65 X Loc [ sinl ] 2: 61 Y Loc [ sinlxd ] 3: 65 Z Loc [ sinl ] 115: If (X<=>F) (P89) 1: 65 X Loc [ sinl ] 2: 4 < 3: 0 F 4: 30 Then Do 116: Z=F x 10^n (P30) 1: 0 F 2: 0 n, Exponent of 10 3: 65 Z Loc [ sinl ] 117: End (P95) 118: Z=X*F (P37) 1: 65 X Loc [ sinl ] 2: 1373 F 3: 66 Z Loc [ PotSolar ] 119: Z=X*F (P37) 1: 66 X Loc [ PotSolar ] 2: 0.4 F 3: 67 Z Loc [ Threshold ] ; calculate potential solar radiation at surface (estimated as 72% of PotSolar; assumes 28% ; absorbtion by atmospheric absorbtion and diffuse reflection (without clouds). Then calculate SWin as a ; percentage of SWinPot. Useful for education purposes only. 120: Z=X*F (P37) 1: 66 X Loc [ PotSolar ] 2: 0.72 F 3: 70 Z Loc [ PotSWin ] ; if sw in >= potential sw in, set to 1 121: If (X<=>Y) (P88) 1: 18 X Loc [ SW_in ] 2: 3 >= 3: 70 Y Loc [ PotSWin ] 4: 30 Then Do 122: Z=F x 10^n (P30) 1: 1 F 2: 00 n, Exponent of 10 3: 71 Z Loc [ PropSWin ] ; else if sw in pot solar <= 0.01, prop sw in = 0. ; Not true, strictly speaking, but useful for graphing. 123: Else (P94) 124: If (X<=>F) (P89) 1: 66 X Loc [ PotSolar ] 2: 4 < 3: 0.01 F 4: 30 Then Do 125: Z=F x 10^n (P30) 1: 0.0 F 2: 00 n, Exponent of 10 3: 71 Z Loc [ PropSWin ] 126: Else (P94) 127: Z=X/Y (P38) 1: 18 X Loc [ SW_in ] 2: 70 Y Loc [ PotSWin ] 3: 71 Z Loc [ PropSWin ] 128: End (P95) 129: End (P95) 130: Z=X*F (P37) 1: 71 X Loc [ PropSWin ] 2: 100 F 3: 72 Z Loc [ PctSWin ] ;---------------------------------- 131: If (X<=>Y) (P88) 1: 18 X Loc [ SW_in ] 2: 3 >= 3: 67 Y Loc [ Threshold ] 4: 30 Then Do 132: If (X<=>F) (P89) 1: 65 X Loc [ sinl ] 2: 3 >= 3: 0.1 F 4: 30 Then Do 133: Z=X+F (P34) 1: 68 X Loc [ Sun_hrs ] 2: .01667 F 3: 68 Z Loc [ Sun_hrs ] 134: End (P95) 135: End (P95) ;========================================================== ;///////////// EVAPOTRANSPIRATION ESTIMATE //////////////// ;---------------------------------------------------------- ; INSERT HERE ;---------------------------------------------------------- ;////////////////////// OUTPUT //////////////////////////// ;---------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Array 101: HOURLY DATA ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 136: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 10 Set Output Flag High (Flag 0) 137: Set Active Storage Area (P80)^9238 1: 1 Final Storage Area 1 2: 101 Array ID 138: Real Time (P77)^5531 1: 1220 Year,Day,Hour/Minute (midnight = 2400) 139: Minimum (P74)^28547 1: 1 Reps 2: 00 Value Only 3: 1 Loc [ Batt_Volt ] 140: Sample (P70)^15084 1: 1 Reps 2: 2 Loc [ Prog_Sig ] 141: Average (P71)^2201 1: 1 Reps 2: 3 Loc [ ITemp_C ] ;---------------- Pressure (mb) -------------- 142: Sample (P70)^20389 1: 1 Reps 2: 4 Loc [ P_mb ] ;---------------- Wind (mph) -------------- 143: Maximum (P73)^19837 1: 1 Reps 2: 0 Value Only 3: 6 Loc [ WS_mph ] 144: Wind Vector (P69)^4992 1: 1 Reps 2: 4 Samples per Sub-Interval 3: 0 S, é1, & å(é1) Polar 4: 6 Wind Speed/East Loc [ WS_mph ] 5: 7 Wind Direction/North Loc [ WindDir ] ;---------------- Air Temp (F) -------------- 145: Average (P71)^18114 1: 1 Reps 2: 9 Loc [ AirTF ] 146: Average (P71)^21961 1: 1 Reps 2: 8 Loc [ AirTC ] ;---------------- Wind Chill (F) -------------- 147: Average (P71)^7584 1: 1 Reps 2: 30 Loc [ TwcF ] 148: Minimum (P74)^19726 1: 1 Reps 2: 00 Time Option 3: 30 Loc [ TwcF ] ;---------------- Heat Index (F) -------------- ; ;78: Average (P71) ; 1: 1 Reps ; 2: 28 Loc [ HI ] ;---------------- Humidity (%) -------------- 149: Sample (P70)^22427 1: 1 Reps 2: 11 Loc [ RH ] ;---------------- Dewpoint Temp (F) -------------- 150: Average (P71)^18074 1: 1 Reps 2: 29 Loc [ TdF ] ;---------------- Precipitation (in) -------------- 151: Totalize (P72)^7835 1: 1 Reps 2: 17 Loc [ Rain_in ] ; --------------- Potential incoming SW radiation (w/m^2) -------------- 152: Average (P71)^22134 1: 1 Reps 2: 70 Loc [ PotSWin ] ;---------------- Incoming SW radiation (w/m^2) -------------- 153: Average (P71)^32655 1: 1 Reps 2: 18 Loc [ SW_in ] ;---------------- Outgoing SW radiation (w/m^2) -------------- 154: Average (P71)^15085 1: 1 Reps 2: 19 Loc [ SW_out ] ;---------------- Incoming LW radiation, corrected (w/m^2) -------------- 155: Average (P71)^6296 1: 1 Reps 2: 21 Loc [ LW_in ] ;---------------- Outgoing LW radiation, corrected (w/m^2) -------------- 156: Average (P71)^10393 1: 1 Reps 2: 22 Loc [ LW_out ] ;---------------- Net SW radiation (w/m^2) -------------- 157: Average (P71)^17587 1: 1 Reps 2: 23 Loc [ SW_net ] ;---------------- Net LW radiation (w/m^2) -------------- 158: Average (P71)^5602 1: 1 Reps 2: 24 Loc [ LW_net ] ;---------------- Total incoming radiation (w/m^2) -------------- 159: Average (P71)^3213 1: 1 Reps 2: 25 Loc [ Total_in ] ;---------------- Total outgoing radiation (w/m^2) -------------- 160: Average (P71)^4262 1: 1 Reps 2: 26 Loc [ Total_out ] ;---------------- Total net radiation (w/m^2) -------------- 161: Average (P71)^20006 1: 1 Reps 2: 27 Loc [ Total_net ] ;---------------- Albedo (w/m^2) -------------- 162: Average (P71)^18051 1: 1 Reps 2: 20 Loc [ Albedo ] ;---------------- Percent of Potential Incoming SW 163: Average (P71)^6611 1: 1 Reps 2: 72 Loc [ PctSWin ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Array 102: Daily values ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 164: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 1440 Interval (same units as above) 3: 10 Set Output Flag High (Flag 0) 165: Set Active Storage Area (P80)^26094 1: 1 Final Storage Area 1 2: 102 Array ID 166: Real Time (P77)^26335 1: 1220 Year,Day,Hour/Minute (midnight = 2400) ;---------------- Pressure -------------- 167: Average (P71)^3563 1: 1 Reps 2: 4 Loc [ P_mb ] 168: Minimum (P74)^245 1: 1 Reps 2: 00 Time Option 3: 4 Loc [ P_mb ] 169: Maximum (P73)^28969 1: 1 Reps 2: 00 Time Option 3: 4 Loc [ P_mb ] ;---------------- Wind -------------- 170: Maximum (P73)^6016 1: 1 Reps 2: 0 Value Only 3: 5 Loc [ WS_ms ] 171: Wind Vector (P69)^17200 1: 1 Reps 2: 72 Samples per Sub-Interval 3: 0 S, é1, & å(é1) Polar 4: 5 Wind Speed/East Loc [ WS_ms ] 5: 7 Wind Direction/North Loc [ WindDir ] ;---------------- Air T -------------- 172: Average (P71)^154 1: 1 Reps 2: 9 Loc [ AirTF ] 173: Minimum (P74)^9660 1: 1 Reps 2: 00 Time Option 3: 9 Loc [ AirTF ] 174: Maximum (P73)^18826 1: 1 Reps 2: 00 Time Option 3: 9 Loc [ AirTF ] ;---------------- Humidity -------------- 175: Minimum (P74)^7708 1: 1 Reps 2: 00 Time Option 3: 11 Loc [ RH ] 176: Maximum (P73)^22320 1: 1 Reps 2: 00 Time Option 3: 11 Loc [ RH ] 177: Average (P71)^1129 1: 1 Reps 2: 15 Loc [ e_mb ] 178: Minimum (P74)^23787 1: 1 Reps 2: 00 Time Option 3: 15 Loc [ e_mb ] 179: Maximum (P73)^19443 1: 1 Reps 2: 00 Time Option 3: 15 Loc [ e_mb ] ;---------------- Rainfall -------------- 180: Totalize (P72)^4994 1: 1 Reps 2: 17 Loc [ Rain_in ] ;---------------- Radiation -------------- 181: Average (P71)^5490 1: 1 Reps 2: 18 Loc [ SW_in ] 182: Average (P71)^4784 1: 1 Reps 2: 19 Loc [ SW_out ] 183: Average (P71)^26766 1: 1 Reps 2: 21 Loc [ LW_in ] 184: Average (P71)^20929 1: 1 Reps 2: 22 Loc [ LW_out ] 185: Average (P71)^6830 1: 1 Reps 2: 25 Loc [ Total_in ] 186: Average (P71)^7221 1: 1 Reps 2: 26 Loc [ Total_out ] 187: Average (P71)^21464 1: 1 Reps 2: 27 Loc [ Total_net ] ;---------------- Sunshine (hrs) -------------- 188: Sample (P70)^9715 1: 1 Reps 2: 68 Loc [ Sun_hrs ] 189: If Flag/Port (P91) 1: 10 Do if Output Flag is High (Flag 0) 2: 30 Then Do 190: Z=F x 10^n (P30) 1: 0.0 F 2: 00 n, Exponent of 10 3: 68 Z Loc [ Sun_hrs ] 191: End (P95) ; Convert S into MJ/m2 per scan interval 192: Z=X*F (P37) 1: 18 X Loc [ SW_in ] 2: 0.06 F 3: 69 Z Loc [ MJ_m2 ] 193: Totalize (P72)^27887 1: 1 Reps 2: 69 Loc [ MJ_m2 ] ;------------------------------------------------------------ *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines End Program -Input Locations- 1 Batt_Volt 1 1 1 2 Prog_Sig 1 1 1 3 ITemp_C 1 1 1 4 P_mb 1 4 1 5 WS_ms 1 4 2 6 WS_mph 1 3 1 7 WindDir 1 3 2 8 AirTC 1 2 1 9 AirTF 1 10 1 10 RH_frac 1 2 1 11 RH 1 6 2 12 e_sat 1 2 1 13 e 1 1 1 14 e_sat_mb 1 0 1 15 e_mb 1 3 1 16 Rain_mm 1 1 1 17 Rain_in 1 4 1 18 SW_in 1 11 2 19 SW_out 1 5 2 20 Albedo 1 1 1 21 LW_in 1 4 1 22 LW_out 1 4 1 23 SW_net 1 1 1 24 LW_net 1 1 1 25 Total_in 1 3 1 26 Total_out 1 3 1 27 Total_net 1 2 1 28 HI 1 1 2 29 TdF 1 1 1 30 TwcF 1 2 2 31 _________ 1 0 0 32 _________ 0 0 0 33 _________ 0 0 0 34 _________ 0 0 0 35 _________ 0 0 0 36 LWin_raw 1 1 1 37 LWout_raw 1 1 1 38 CNR1TempC 1 2 2 39 CNR1TempK 1 1 1 40 scratch_1 1 1 1 41 scratch_2 1 1 1 42 scratch_3 1 1 1 43 scratch_4 1 2 1 44 TDC 1 1 0 45 TDscratch 1 1 1 46 CSI_R 0 0 0 47 CSI_1 0 0 0 48 CSI_2 0 0 0 49 CSI_3 0 0 0 50 CSI_4 0 0 0 51 PPT_inTot 1 0 0 52 Raindayin 1 1 2 53 _________ 0 0 0 54 latitude 1 2 1 55 loncor 1 1 1 56 clndrday 1 3 2 57 day100 1 2 1 58 sind 1 3 1 59 eqoftime 1 3 3 60 cosd 1 3 4 61 sinlxd 1 2 2 62 coslxd 1 3 3 63 t 1 2 2 64 tto 1 3 3 65 sinl 1 7 6 66 PotSolar 1 3 1 67 Threshold 1 1 1 68 Sun_hrs 1 2 2 69 MJ_m2 1 1 1 70 PotSWin 1 3 1 71 PropSWin 1 1 3 72 PctSWin 1 1 1 -Program Security- 0000 0000 0000 -Mode 4- -Final Storage Area 2- 0 -CR10X ID- 0 -CR10X Power Up- 3 -CR10X Compile Setting- 3 -CR10X RS-232 Setting- -1 -DLD File Labels- 0 -Final Storage Labels- 0,101,9238 1,Year_RTM,5531 1,Day_RTM 1,Hour_Minute_RTM 2,P_mb~4,20389 3,{WS_MAX_mph~6,19837 4,{WS_AV_mph~6,4992 4,{Wind_Dir~7 4,{WindDir_SD~7 5,AirTF_AVG~9,18114 6,RH~11,22427 7,Rain_in_TOT~17,7835 8,SW_in_AVG~18,32655 9,SW_out_AVG~19,15085 10,LW_in_AVG~21,6296 11,LW_out_AVG~22,10393 12,SW_net_AVG~23,17587 13,LW_net_AVG~24,5602 14,Total_in_AVG~25,3213 15,Total_out_AVG~26,4262 16,Total_net_AVG~27,20006 17,Albedo_AVG~20,18051 18,Batt_Volt_MIN~1,28547 19,Prog_Sig~2,15084 20,ITemp_C_AVG~3,2201 21,102,26094 22,Year_RTM,26335 22,Day_RTM 22,Hour_Minute_RTM 23,TdF_AVG~29,18074 24,TwcF_AVG~30,7584 25,PotSWin_AVG~70,22134 26,Sun_hrs~68,9715 27,MJ_m2_TOT~69,27887 28,AirTC_AVG~8,21961 29,PctSWin_AVG~72,6611 30,TwcF_MIN~30,19726 31,P_mb_AVG~4,3563 32,P_mb_MIN~4,245 33,P_mb_MAX~4,28969 34,WS_ms_MAX~5,6016 35,WS_ms_S_WVT~5,17200 35,WindDir_D1_WVT~7 35,WindDir_SD1_WVT~7 36,AirTF_AVG~9,154 37,AirTF_MIN~9,9660 38,AirTF_MAX~9,18826 39,RH_MIN~11,7708 40,RH_MAX~11,22320 41,e_mb_AVG~15,1129 42,e_mb_MIN~15,23787 43,e_mb_MAX~15,19443 44,Rain_in_TOT~17,4994 45,SW_in_AVG~18,5490 46,SW_out_AVG~19,4784 47,LW_in_AVG~21,26766 48,LW_out_AVG~22,20929 49,Total_in_AVG~25,6830 50,Total_out_AVG~26,7221 51,Total_net_AVG~27,21464