PageRenderTime 120ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/src/mixeos_def.f

https://bitbucket.org/NeilMiller/h5tbuilder
FORTRAN Legacy | 95 lines | 57 code | 20 blank | 18 comment | 0 complexity | d4e5080d8de0d380ae77243db1c1aff4 MD5 | raw file
  1. module mixeos_def
  2. implicit none
  3. integer, parameter :: i_P = 1
  4. integer, parameter :: i_E = 2
  5. integer, parameter :: i_S = 3
  6. integer, parameter :: i_val = 1
  7. integer, parameter :: i_dRho = 2
  8. integer, parameter :: i_dlnRho = 2
  9. integer, parameter :: i_dlnP = 2
  10. integer, parameter :: i_dX = 2
  11. integer, parameter :: i_dZ = 2
  12. integer, parameter :: i_dT = 3
  13. integer, parameter :: i_dlnT = 3
  14. integer, parameter :: i_dY = 3
  15. integer, parameter :: i_dRho2 = 4
  16. integer, parameter :: i_dlnRho2 = 4
  17. integer, parameter :: i_dlnP2 = 4
  18. integer, parameter :: i_dX2 = 4
  19. integer, parameter :: i_dZ2 = 4
  20. integer, parameter :: i_dT2 = 5
  21. integer, parameter :: i_dlnT2 = 5
  22. integer, parameter :: i_dY2 = 5
  23. integer, parameter :: i_dRhodT = 6
  24. integer, parameter :: i_dlnRhodlnT = 6
  25. integer, parameter :: i_dlnPdlnT = 6
  26. integer, parameter :: i_dXdY = 6
  27. integer, parameter :: i_dZdY = 6
  28. integer, parameter :: i_dRho3 = 7
  29. integer, parameter :: i_dRho2dT = 8
  30. integer, parameter :: i_dRhodT2 = 9
  31. integer, parameter :: i_dT3 = 10
  32. !! size of derivative vectors : for allocation
  33. integer, parameter :: num_derivs = 6
  34. integer, parameter :: num_derivs3 = 10
  35. integer, parameter :: NUM_METALS = 5
  36. double precision, parameter :: minRho = 1e-10
  37. double precision, parameter :: maxRho = 1e5
  38. double precision, parameter :: minT = 1e1
  39. double precision, parameter :: maxT = 1e8
  40. double precision, parameter :: minlog10Rho = log10(minRho)
  41. double precision, parameter :: maxlog10Rho = log10(maxRho)
  42. double precision, parameter :: minlog10T = log10(minT)
  43. double precision, parameter :: maxlog10T = log10(maxT)
  44. integer, parameter :: MIXEOSERR_MEM = -32
  45. !! Mixeos access. Often when we call a function, we put the temporary variables here.
  46. !! such that they don't have to be constantly allocated and deallocated.
  47. !! Since you may want to access the eos with multiple processes, each of those processes
  48. !! should hold a unique access structure. All of the access structures are stored in
  49. !! a public variable array below.
  50. type mixeos_access
  51. !! Make these static if possible so that we don't have to worry about memory allocation
  52. ! double precision, target :: Pvect(num_derives, NUM_METALS), &
  53. ! Svect(num_derives, NUM_METALS), &
  54. ! Evect(num_derives, NUM_METALS), &
  55. ! lnPvect(num_derives, NUM_METALS), &
  56. ! lnSvect(num_derives, NUM_METALS), &
  57. ! lnEvect(num_derives, NUM_METALS), &
  58. ! lnRhovect_PT(num_derivs, NUM_METALS+1), &
  59. ! lnSvect_PT(num_derivs, NUM_METALS+1), &
  60. ! lnEvect_PT(num_derivs, NUM_METALS+1)
  61. integer :: handle = 0
  62. integer :: eos_handle = 0
  63. end type mixeos_access
  64. !! Adjust this if you have more than 8 processes
  65. !! Make sure that the eos module is willing to also give as many handles as we are looking for here
  66. integer, parameter :: MIXREGSIZE = 8
  67. type (mixeos_access), pointer, dimension(:) :: mix_register
  68. integer, parameter :: ERROR_OUTOFBOUND = -16
  69. integer, parameter :: ERROR_ACCESS = -17
  70. integer, parameter :: ERROR_ARGS = -18
  71. double precision, parameter :: mixeos_epsilon = 1d-8
  72. integer, parameter :: mixeos_getRhoT_maxiter = 100
  73. double precision, parameter :: lnPmin = 15.
  74. double precision, parameter :: lnPmax = 35.
  75. end module mixeos_def