Пример #1
0
/*
 * Function: StateEquation
 * Usage: rho = StateEquation(prop,s,T,p);
 * ---------------------------------------
 * Returns the density as a function of temperature, salinity, and
 * pressure, where pressure is the hydrostatic pressure p=RHO0*prop->grav*z,
 * and RHO0 and prop->grav are defined in suntans.h.  Note that rho should
 * always normalized by RHO0 so that this function returns a dimensionless
 * quantity.
 *
 */
REAL StateEquation(const propT *prop, const REAL s, const REAL T, const REAL p) {
  REAL sigma;
  // If temperature is a passive scalar
  //  return prop->beta*s;
  // Otherwise temperature is not passive
  // return prop->beta*s - prop->alpha*T;

  sigma=pden(s,T,p*1e-4,0)-RHO0;

  return sigma/RHO0;
}
Пример #2
0
void dbgset(set<rational>& cset)
{
    for(auto iter = cset.begin(); iter!=cset.end(); ++iter) {
        printf("%lld, %lld\n", iter->pnum(),iter->pden());
    }
}