COESA_atmosphere Function

public function COESA_atmosphere(Z) result(s)

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in) :: Z

Return Value type(State)


Calls

proc~~coesa_atmosphere~~CallsGraph proc~coesa_atmosphere COESA_atmosphere proc~pressure_upper pressure_upper proc~coesa_atmosphere->proc~pressure_upper proc~mean_molecular_weight_upper mean_molecular_weight_upper proc~coesa_atmosphere->proc~mean_molecular_weight_upper proc~geopotential_altitude geopotential_altitude proc~coesa_atmosphere->proc~geopotential_altitude proc~mean_molecular_weight_lower mean_molecular_weight_lower proc~coesa_atmosphere->proc~mean_molecular_weight_lower proc~temperature_upper temperature_upper proc~coesa_atmosphere->proc~temperature_upper proc~pressure_lower pressure_lower proc~coesa_atmosphere->proc~pressure_lower proc~speed_of_sound_lower speed_of_sound_lower proc~coesa_atmosphere->proc~speed_of_sound_lower proc~temperature_lower temperature_lower proc~coesa_atmosphere->proc~temperature_lower proc~speed_of_sound_86km speed_of_sound_86km proc~coesa_atmosphere->proc~speed_of_sound_86km proc~interpolation_index interpolation_index proc~pressure_upper->proc~interpolation_index proc~interpolation_scale_factors interpolation_scale_factors proc~pressure_upper->proc~interpolation_scale_factors proc~mean_molecular_weight_upper->proc~interpolation_index proc~mean_molecular_weight_upper->proc~interpolation_scale_factors proc~mean_molecular_weight_ratio_lower mean_molecular_weight_ratio_lower proc~mean_molecular_weight_lower->proc~mean_molecular_weight_ratio_lower proc~find find proc~pressure_lower->proc~find proc~tm Tm proc~temperature_lower->proc~tm proc~speed_of_sound_86km->proc~geopotential_altitude proc~speed_of_sound_86km->proc~mean_molecular_weight_lower proc~speed_of_sound_86km->proc~speed_of_sound_lower proc~speed_of_sound_86km->proc~temperature_lower proc~interpolation_index->proc~find proc~tm->proc~find proc~mean_molecular_weight_ratio_lower->proc~find

Contents

Source Code


Source Code

function COESA_atmosphere(Z) result(s)
    real(wp),intent(in) :: Z ! altitude in meters
    type(state) :: s
    real(wp) :: H,M,T,P,c
    if (Z < -5000.0_wp) then
        error stop "altitude below lower bound of -5000 m"
    else if (Z > 1000000.0_wp) then
        error stop "altitude above upper bound of 1000000 m"
    else if (Z < 86000.0_wp) then
        H = geopotential_altitude(Z)
        M = mean_molecular_weight_lower(Z)
        T = temperature_lower(H, M)
        P = pressure_lower(H)
        c = speed_of_sound_lower(T, M)
    else
        T = temperature_upper(Z)
        P = pressure_upper(Z)
        M = mean_molecular_weight_upper(Z)
        c = speed_of_sound_86km()
    end if
    s = State(M, T, P, c)
end function COESA_atmosphere