function calculateACFM() {
  var form = document.acfm_form;
  var tconst = 460;
  
  var acfm = 0;
  var scfm = form.scfm.value - 0;
  
  //CAGI constants
  var ps = 14.7;
  var rhs = 0.36;
  var pvs = 0.3391;
  var ts = 68 + tconst;
  
  var ta = form.temp_act.value - 0 + tconst;
  var pa = form.pres_act.value - 0;
  var pb = form.baro_pres.value - 0;
  var rha = form.rel_hum.value - 0;
  //var pva = vapor_pressure[form.temp_act.value];
  var tac = tempToCelsius(form.temp_act.value);
  var pva = calculatePVA(tac);
  
  acfm = scfm * ( (ps - (rhs * pvs)) / (pb - (rha * pva)) ) * (ta / ts) * (pb / pa);
  acfm = acfm.toFixed(2);

  form.acfm.value = acfm;
} // end function calculateACFM()

function tempToCelsius(tempF) {
  var tempC = .55556 * (tempF - 32);
  return tempC;
} //end function tempToCelsius()

function vaporPresToPSI(vpa) {
  var psi = 0.0145038*vpa;
  return psi;
} //end function vaporPresToPSI()

function calculatePVA(temp) {
  var pva = 6.11 * Math.pow(10, (7.51 * temp / (237.7 + temp)));
  pva = vaporPresToPSI(pva);
  return pva;
} //end function calculatePVA()

function enforceNumber(el) {
  el.value = el.value.replace(/[^0-9-.]/g, "");
  el = null;
} // end function enforceNumber()

function enforcePresMin(el) {
  enforceNumber(el);
  if (el.value < 0) el.value = 0;
} //end function enforcePresMin()

function enforceHumid(el) {
  enforceNumber(el);
  if (el.value < 0) el.value = 0.0;
  if (el.value > 1) el.value = 1.0;
} //end function enforcePresMin()