Appendix A. Example Programs
A-9
'Find the HMP45C vapor pressure and saturation vapor pressure (kPa).
VaporPressure (e_hmp,t_hmp,rh_hmp)
SatVP (e_sat_hmp,t_hmp)
'Compute net radiation, albedo, downwelling and upwelling longwave radiation.
t_nr01 = t_nr01/100
PRT (t_nr01,1,t_nr01,1,273.15)
Rn = Rs_downwell-RsRl_down_meas-Rl_up_meas
albedo = Rs_upwell/Rs_downwell
Rl_downwell = Rl_do(5.67e-8*t_nr01*t_nr01*t_nr01*t_nr01)
Rl_upwell = Rl_(5.67e-8*t_nr01*t_nr01*t_nr01*t_nr01)
CallTable (scratch)
If ( scratch.Output(1,1) ) Then
GetRecord (scratch_out(1),scratch,1)
rh_hmp_mean = 100*e_hmp_mean/e_sat_hmp_mean
DewPoint (t_dew_hmp_mean,t_hmp_mean,rh_hmp_mean)
'Control the NR 01 heater using 4 Hz pulse width modulation. Below the dew
' point temperature applies 100% power. Above the dew point, power is reduced
' linearly to 20% until the dew point plus DELTA_SET_POINT_1. After the dew
' point plus DELTA_SET_POINT_1 and until the dew point plus
' DELTA_SET_POINT_2 plus DELTA_SET_POINT_2, the power is reduced linearly to 0%.
If ( (t_nr01 <> NaN) AND (t_dew_hmp_mean <> NaN) AND (no_heat_flag <> TRUE) ) Then
set_point_temperature = t_dew_h273.15
Select Case t_nr01
Case Is < ( set_point_temperature )
duty_cycle = 1
Case Is < ( set_point_tempDELTA_SET_POINT_1 )
duty_cycle = MAX_DUTY_(t_nr01-(t_dew_h273.15))*SLOPE_1
Case Is < ( set_point_tempDELTA_SET_DELTA_SET_POINT_2 )
duty_cycle = MAX_DUTY_(t_nr01-
(t_dew_h273.15+DELTA_SET_POINT_1))*SLOPE_2
Case Else
duty_cycle = 0.01
EndSelect
Else
duty_cycle = 0.01
EndIf
EndIf
CallTable (stats)
NextScan
EndProg
Содержание NR01
Страница 2: ......
Страница 6: ......
Страница 38: ...Appendix A Example Programs A 10...
Страница 41: ......