Skip to content

Instantly share code, notes, and snippets.

@james-roden
Last active October 25, 2019 11:15
Show Gist options
  • Save james-roden/a278fe54312eeca0637c0113868828fa to your computer and use it in GitHub Desktop.
Save james-roden/a278fe54312eeca0637c0113868828fa to your computer and use it in GitHub Desktop.
Joides Gas Hydrate Stability Zone Formula (Returns the base of the gas hydrate stability zone for a given water depth)
#!Python3
def joides(water_depth, base_water_temp, geothermal_gradient):
"""Returns the base of the gas hydrate stability zone for a given water depth
Joides formula for calculating the base gas hydrate stability meters below sea floor. As per the publication:
Ocean Drilling Program Guidelines for Pollution Prevention and Safety; JOIDES Journal, Volume 18, Special Issue
No. 7, October 1992.
A range of 1-2501 is used, as per studies, generally the maximum is 2000 meters below surface.
Args:
water_depth: The absolute value of the water depth in meters
base_water_temp: Bottom water temperature in degrees celsius
geothermal_gradient: Geothermal gradient in degrees celsius/kilometers
"""
for z in range(1, 2501):
a = math.log((10.17 * (water_depth + z)))
if a > 9.355001:
for z2 in range(1, 2500):
a = math.log((10.17 * (water_depth + z2)))
b = 46.74 - (10748.1 / (base_water_temp + ((z2 * geothermal_gradient) / 1000) + 273.15))
if a < b:
return z2
else:
b = 38.53 - (8386.8 / ((base_water_temp + (z * geothermal_gradient / 1000)) + 273.15))
if a < b:
return z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment