#include Absorbed Solar Flux (w/m**2) Optical Thickness of Atmosphere R/Cp
",solar,tau1,rcp);
/*Determine tropopause pressure (relative to surface pressure).
delta is ratio (p(trop)/p(surf)). */
/* The following iteration loop solves for rad(delta)=1 by
bisection. */
delta1 = 1.e-8;delta2=1. - 1.e-8;
for(its=0;its<100;its++) {
rad1 = rad(delta1);rad2=rad(delta2);radmid=rad(.5*(delta1+delta2));
if( (rad1-1.)*(radmid-1.) <= 0.)
delta2 = .5*(delta1+delta2);
if( (radmid-1.)*(rad2-1.) <= 0.)
delta1 = .5*(delta1+delta2);
if( fabs(delta1-delta2) < 1.e-7) break;
}
delta = .5*(delta1+delta2);
/* Determine tropopause temperature from delta and solar input */
Ttp = pow(solar*(1.+tau1*delta) /(2.*sig), .25);
/*Warning. The following estimate of surface temperature becomes
innacurate if delta gets too large.*/
Tg = Ttp*pow(1./delta,rcp);
/*Write out results*/
printf("
%lf
%lf
%lf
Tropopause pressure |
%f times surface pressure |
Tropopause Temperature |
%f Kelvin |
Surface Temperature |
%f Kelvin |