Skip to content

Commit

Permalink
increment Python version to 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Guymer committed Sep 28, 2024
1 parent 42f368f commit 0aa50e4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CUT := $(shell which cut 2> /dev/null || echo "ERROR")
FC := $(shell which mpif90-openmpi-gcc14 2> /dev/null || echo "ERROR")
GREP := $(shell which grep 2> /dev/null || echo "ERROR")
LN := $(shell which ln 2> /dev/null || echo "ERROR")
PYTHON3 := $(shell which python3.11 2> /dev/null || echo "ERROR")
PYTHON3 := $(shell which python3.12 2> /dev/null || echo "ERROR")
RM := $(shell which rm 2> /dev/null || echo "ERROR")

# ******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MACH_OPTS := -march=native -m64
CUT := $(shell which cut 2> /dev/null || echo "ERROR")
FC := $(shell which mpif90-openmpi-gcc14 2> /dev/null || echo "ERROR")
GREP := $(shell which grep 2> /dev/null || echo "ERROR")
PYTHON3 := $(shell which python3.11 2> /dev/null || echo "ERROR")
PYTHON3 := $(shell which python3.12 2> /dev/null || echo "ERROR")
RM := $(shell which rm 2> /dev/null || echo "ERROR")

# ******************************************************************************
Expand Down
8 changes: 4 additions & 4 deletions tests/test14.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ PROGRAM test14
lat2 = 44.0e0_REAL64 ! [°]

! Solve and print summary ...
! NOTE: python3.11 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_dist_between_two_locs(20.0, 40.0, 31.0, 44.0));"
! NOTE: python3.12 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_dist_between_two_locs(20.0, 40.0, 31.0, 44.0));"
CALL sub_calc_dist_between_two_locs(lon1, lat1, lon2, lat2, dist, bear1, bear2)
WRITE(fmt = '("How does Python compare to FORTRAN?")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.6, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 1012752.1163662494e0_REAL64, 60.39569659166906e0_REAL64, 112.22682686474255e0_REAL64
Expand All @@ -36,7 +36,7 @@ PROGRAM test14
lat2 = 14.0e0_REAL64 ! [°]

! Solve and print summary ...
! NOTE: python3.11 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_dist_between_two_locs(170.0, 10.0, -153.0, 14.0));"
! NOTE: python3.12 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_dist_between_two_locs(170.0, 10.0, -153.0, 14.0));"
CALL sub_calc_dist_between_two_locs(lon1, lat1, lon2, lat2, dist, bear1, bear2)
WRITE(fmt = '("How does Python compare to FORTRAN?")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.6, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 4049560.052853737e0_REAL64, 79.97059150621645e0_REAL64, 92.06388518630848e0_REAL64
Expand All @@ -50,7 +50,7 @@ PROGRAM test14
dist = 1.0e6_REAL64 ! [m]

! Solve and print summary ...
! NOTE: python3.11 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist(20.0, 40.0, 60.0, 1000000.0));"
! NOTE: python3.12 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist(20.0, 40.0, 60.0, 1000000.0));"
CALL sub_calc_loc_from_loc_and_bearing_and_dist(lon1, lat1, bear1, dist, lon2, lat2, bear2)
WRITE(fmt = '("How does Python compare to FORTRAN?")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 30.82007234507776e0_REAL64, 44.01366546403752e0_REAL64, 67.2573906563704e0_REAL64
Expand All @@ -64,7 +64,7 @@ PROGRAM test14
dist = 4.0e6_REAL64 ! [m]

! Solve and print summary ...
! NOTE: python3.11 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist(170.0, 10.0, 80.0, 4000000.0));"
! NOTE: python3.12 -c "import pyguymer3; import pyguymer3.geo; print(pyguymer3.geo.calc_loc_from_loc_and_bearing_and_dist(170.0, 10.0, 80.0, 4000000.0));"
CALL sub_calc_loc_from_loc_and_bearing_and_dist(lon1, lat1, bear1, dist, lon2, lat2, bear2)
WRITE(fmt = '("How does Python compare to FORTRAN?")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) -153.45774412535758e0_REAL64, 13.966090287654401e0_REAL64, 87.84921951322094e0_REAL64
Expand Down
30 changes: 15 additions & 15 deletions tests/test15.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ PROGRAM test15

! Calculate and print summary ...
! NOTE: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.poch.html
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.poch(2.0, 0.0));"
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.poch(1.0, 5.0));"
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.poch(3.7, 2.1));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.poch(2.0, 0.0));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.poch(1.0, 5.0));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.poch(3.7, 2.1));"
WRITE(fmt = '("How does Python compare to FORTRAN? (func_rising_factorial)")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 1.0e0_REAL64, 120.0e0_REAL64, 20.529581933776953e0_REAL64
WRITE(fmt = '(" FORTRAN = ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) func_rising_factorial(2.0e0_REAL64, 0.0e0_REAL64), func_rising_factorial(1.0e0_REAL64, 5.0e0_REAL64), func_rising_factorial(3.7e0_REAL64, 2.1e0_REAL64)
Expand All @@ -37,10 +37,10 @@ PROGRAM test15

! Calculate and print summary ...
! NOTE: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.hyp2f1.html
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(1.0, 1.0, 2.0, +0.5 ));"
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.0, 1.5, +0.25));"
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.0, 1.5, -0.25));"
! NOTE: python3.11 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.5, 1.5, -2.0 ));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(1.0, 1.0, 2.0, +0.5 ));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.0, 1.5, +0.25));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.0, 1.5, -0.25));"
! NOTE: python3.12 -c "import scipy; import scipy.special; print(scipy.special.hyp2f1(0.5, 1.5, 1.5, -2.0 ));"
WRITE(fmt = '("How does Python compare to FORTRAN? (func_hypergeometric)")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 1.3862943611198901e0_REAL64, 1.098612288668109e0_REAL64, 0.9272952180016117e0_REAL64, 0.5773502691896257e0_REAL64
WRITE(fmt = '(" FORTRAN = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) func_hypergeometric(1.0e0_REAL64, 1.0e0_REAL64, 2.0e0_REAL64, +0.5e0_REAL64), func_hypergeometric(0.5e0_REAL64, 1.0e0_REAL64, 1.5e0_REAL64, +0.25e0_REAL64), func_hypergeometric(0.5e0_REAL64, 1.0e0_REAL64, 1.5e0_REAL64, -0.25e0_REAL64), func_hypergeometric(0.5e0_REAL64, 1.5e0_REAL64, 1.5e0_REAL64, -2.0e0_REAL64)
Expand All @@ -50,10 +50,10 @@ PROGRAM test15

! Calculate and print summary ...
! NOTE: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf( 0.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(-2.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(+2.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(+5.0, 5.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf( 0.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(-2.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(+2.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.pdf(+5.0, 5.0));"
WRITE(fmt = '("How does Python compare to FORTRAN? (func_t_PDF)")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 0.3535533905932738e0_REAL64, 0.06804138174397717e0_REAL64, 0.06804138174397717e0_REAL64, 0.0017574383788078445e0_REAL64
WRITE(fmt = '(" FORTRAN = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) func_t_PDF( 0.0e0_REAL64, 2.0e0_REAL64), func_t_PDF(-2.0e0_REAL64, 2.0e0_REAL64), func_t_PDF(+2.0e0_REAL64, 2.0e0_REAL64), func_t_PDF(+5.0e0_REAL64, 5.0e0_REAL64)
Expand All @@ -63,10 +63,10 @@ PROGRAM test15

! Calculate and print summary ...
! NOTE: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf( 0.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(-2.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(+2.0, 2.0));"
! NOTE: python3.11 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(+5.0, 5.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf( 0.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(-2.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(+2.0, 2.0));"
! NOTE: python3.12 -c "import scipy; import scipy.stats; print(scipy.stats.t.cdf(+5.0, 5.0));"
WRITE(fmt = '("How does Python compare to FORTRAN? (func_t_CDF)")', unit = OUTPUT_UNIT)
WRITE(fmt = '(" Python = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) 0.5e0_REAL64, 0.09175170953613696e0_REAL64, 0.908248290463863e0_REAL64, 0.9979476420099733e0_REAL64
WRITE(fmt = '(" FORTRAN = ", f14.9, "; ", f14.9, "; ", f14.9, "; ", f14.9)', unit = OUTPUT_UNIT) func_t_CDF( 0.0e0_REAL64, 2.0e0_REAL64), func_t_CDF(-2.0e0_REAL64, 2.0e0_REAL64), func_t_CDF(+2.0e0_REAL64, 2.0e0_REAL64), func_t_CDF(+5.0e0_REAL64, 5.0e0_REAL64)
Expand Down

0 comments on commit 0aa50e4

Please sign in to comment.