/* =============================================================================== */
/* SUBROUTINE CALC_BAROMETRIC_PRESSURE */
/* Purpose: This sub calculates barometric pressure at altitude based on the */
/* publication "U.S. Standard Atmosphere, 1976", U.S. Government Printing */
/* Office, Washington, D.C. The source for this code is a Fortran 90 program */
/* written by Ralph L. Carmichael (retired NASA researcher) and endorsed by */
/* the National Geophysical Data Center of the National Oceanic and */
/* Atmospheric Administration. It is available for download free from */
/* Public Domain Aeronautical Software at: http://www.pdas.com/atmos.htm */
/* =============================================================================== */
int calc_barometric_pressure(real *altitude)
{
/* Local variables */
static real altitude_meters,
molecular_weight_of_air,
acceleration_of_operation,
altitude_kilometers,
altitude_feet,
temp_gradient,
temp_at_sea_level,
pressure_at_sea_level,
geopotential_altitude,
gmr_factor,
pressure_at_sea_level_fsw,
pressure_at_sea_level_msw,
temp_at_geopotential_altitude,
gas_constant_r,
radius_of_earth;
/* =============================================================================== */
/* CALCULATIONS */
/* =============================================================================== */
radius_of_earth = 6369.; /* ki */
acceleration_of_operation = 9.80665; /* meters/ */
molecular_weight_of_air = 28.9644;
gas_constant_r = 8.31432; /* Joules/mol*de */
temp_at_sea_level = 288.15; /* degree */
pressure_at_sea_level_fsw = 33.; /* at sea level (Standard Atm */
/* feet of seawater based on 1 */
pressure_at_sea_level_msw = 10.; /* at sea level (European */
/* meters of seawater based on 1 */
temp_gradient = -6.5; /* change in geopotential a */
/* valid for first layer of at */
/* up to 11 kilometers or 36, */
/* Change in Temp deg Kel */
gmr_factor =
acceleration_of_operation * molecular_weight_of_air / gas_constant_r;
if (units_equal_fsw) {
altitude_feet = *altitude;
altitude_kilometers = altitude_feet / 3280.839895;
pressure_at_sea_level = pressure_at_sea_level_fsw;
}
if (units_equal_msw) {
altitude_meters = *altitude;
altitude_kilometers = altitude_meters / 1e3;
pressure_at_sea_level = pressure_at_sea_level_msw;
}
geopotential_altitude =
altitude_kilometers * radius_of_earth / (altitude_kilometers + radius_of_earth);
temp_at_geopotential_altitude =
temp_at_sea_level + temp_gradient * geopotential_altitude;
barometric_pressure =
pressure_at_sea_level *
exp(log(temp_at_sea_level / temp_at_geopotential_altitude) * gmr_factor / temp_gradient);
return 0;
} /* calc_barometric_pressure */
Quote:
WARNING: Breathing compressed gas underwater, whether with conventional open-circuit scuba or closed-circuit rebreathers, is a potentially dangerous activity that requires specialized training. Breathing gas mixtures other than air underwater and especially using rebreather technology underwater, are activities which require considerable specialized training and certification. No one should ever attempt these activities without professional training. The information and software related to scuba diving, decompression theory and software code in this forum is provided for informational purposes only; and this information does not constitute adequate or proper training!
I am looking for an unzip application that can handle Unix .z files, but from a Windows environment AND has a command-line prompt. Anybody know of anything?
TIA,
H2M3 (2 Replies)
I am having some trouble decompressing a tar.bz2 with Cygwin. Is it even possible to do this? I am new to Unix so I have no idea.
I downloaded GCC on my Windows machine (gcc-3.4.4.tar.bz2) and I've been trying to decompress and install it. Is cygwin this best way to decompress on a windows... (3 Replies)
Hi Guys,
I'm just wondering how to compress and decompress a file in the same script using multiple programs, and can it be done in one line?
e.g gzip file && gunzip file
bzip2 file && bunzip file
I tried this and a few other combinations but it doesn't seem to work. Any... (6 Replies)
hI MY Nerd folks...i have ubuntu 10.4 in my machine...i want to use open shh in my latop for the sake of being complete anonymous...but am just a noob anyont got any tips for me for the complete steps or for How to LInks ...watever..thanks in advance (4 Replies)
Continued from here.
Port the main loop C code to PHP. Here is the C code for the main loop:
/* =============================================================================== */
/* Begin MAIN proc (see endofpgm for alternate entry) */
/*... (2 Replies)
Discussion started by: Neo
2 Replies
6. Post Here to Contact Site Administrators and Moderators
Hi Neo,
i have followed your porting of the VPM algorithm to C+. Did you ever finish this exercise? I am playing around with some ARM chips and would love to run the algorithm on them... would you care to share the final results?
Thanks for your help.
Greetings Carsten (0 Replies)