atmospheres.py 827 B

12345678910111213141516171819202122232425262728293031
  1. # This file, atmospheres.py, has been generated from atmospheres.f90 by protos.scm
  2. import ctypes
  3. from ctypes import c_int32, c_double, byref
  4. from ctypes.util import find_library
  5. liba = ctypes.cdll.LoadLibrary(find_library('atmospheres'))
  6. ec = liba.atmospheres_init()
  7. if ec!=0:
  8. raise RuntimeError('prop-618 could not be initialized (error: {})'.format(ec))
  9. def init():
  10. liba.atmospheres_init.restype = c_int32
  11. result_ = liba.atmospheres_init()
  12. return result_
  13. def p835_ref(h):
  14. p_h = c_double(h)
  15. p_P = c_double(0)
  16. p_rho = c_double(0)
  17. p_temp = c_double(0)
  18. p_error = c_int32(0)
  19. liba.p835_ref(byref(p_h), byref(p_P), byref(p_rho), byref(p_temp), byref(p_error))
  20. return p_P.value, \
  21. p_rho.value, \
  22. p_temp.value, \
  23. p_error.value
  24. # end of atmospheres.py