c sample main program to check stdatm c w.h. mason, Feb. 27, 1994 c Dept. of Aerospace and Ocean Engineering c Blacksburg, VA 24061 c mason@aoe.vt.edu c this is a sample main showing how to c call stdatm c the loop is done twice to get output c suitable to include in text(80 col) real mu kd = 1 write(6,90) do 10 i = 1,21 z = 5000.*(i-1) call stdatm(z,t,p,r,a,mu,ts,rr,pp,rm,qm,kd,kk) if (kk .ne. 0) then write(6,120) stop endif write(6,100) z,t,p,r,a,mu 10 continue write(6,110) do 20 i = 1,21 z = 5000.*(i-1) call stdatm(z,t,p,r,a,mu,ts,rr,pp,rm,qm,kd,kk) if (kk .ne. 0) then write(6,160) stop endif write(6,120) z,ts,rr,pp,rm,qm 20 continue 90 format(/3x,'1976 Standard Atmoshere'// 1 3x,' alt T P Rho', 2 2x,' a Mu', 4 /3x,' (ft) (deg R) (psf) (s/ft^3)', 5 2x,' (f/s) (slugs/ft/sec)') 100 format(3x,f9.1,f8.2,f8.2,e12.4,f8.2,e12.4) 110 format(/3x,'1976 Standard Atmoshere'// 1 3x,' alt T/Tsl R/Rsl', 2 2x, 'P/Psl Re/M/ft q/M^2', 4 /3x,' (ft)',34x,'(lb/ft^2)') 120 format(3x,f9.1,3f7.4,e10.3,f10.4) 160 format(/4x,'error in return code from stdatm - pgm stops'/) stop end subroutine stdatm(z,t,p,r,a,mu,ts,rr,pp,rm,qm,kd,kk) c c *********** 1976 STANDARD ATMOSPHERE SUBROUTINE ********** c c Mason's BASIC program, converted to FORTRAN - Sept. 1, 1989 c c W.H. Mason c Department of Aerospace and Ocean Engineering c Virginia Tech, Blacksburg, VA 24061 c email: mason@aoe.vt.edu c c kd - = 0 - metric units c <> 0 - English units c c kk - 0 - good return c 1 - error: altitude out of table, c do not use output (max altitude for this c routine is 84.85 km or 282,152 ft.) c c z - input altitude, in feet or meters (depending on kd) c c output: c units: metric English c t - temp. deg K deg R c p - pressure N/m^2 lb/ft^2 c r - density (rho) Kg/m^3 slug/ft^3 c a - speed of sound m/sec ft/sec c mu - viscosity Kg/(m sec) slug/ 84.852 km'/) return end