Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade cvode #286

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- numdiff

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=$PWD/cvode/lib:$PWD/openlibm-0.4.1 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=$PWD/cvode-3.1.2-install/lib:$PWD/openlibm-0.4.1 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++' ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./tools/install/install_cvode.sh $PWD /usr/local/Cellar/[email protected]/4.9.4_1/bin/gfortran-4.9 ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./tools/install/install_cvode.sh $PWD /usr/bin/gfortran ; fi
Expand Down
14 changes: 11 additions & 3 deletions src/atchem2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,27 @@ end subroutine FCVFUN
! SELECT SOLVER TYPE ACCORDING TO FILE INPUT
! SPGMR SOLVER
if ( solverType == 1 ) then
call FCVSPGMR( 0, 1, lookBack, deltaMain, ier )
call FSUNSPGMRINIT( 1, 0, lookBack, ier )
! call FCVSPGMR( 0, 1, lookBack, deltaMain, ier )
call FCVSPILSINIT( ier )
! SPGMR SOLVER WITH BANDED PRECONDITIONER
else if ( solverType == 2 ) then
call FCVSPGMR( 1, 1, lookBack, deltaMain, ier )
call FSUNSPGMRINIT( 1, 1, lookBack, ier )
call FCVSPILSINIT( ier )
call FCVBPINIT( neq, preconBandUpper, preconBandLower, ier )
! call FCVSPGMR( 1, 1, lookBack, deltaMain, ier )
! call FCVBPINIT( neq, preconBandUpper, preconBandLower, ier )
if ( ier /= 0 ) then
write (stderr,*) 'SUNDIALS_ERROR: preconditioner returned ier = ', ier ;
call FCVFREE()
stop
end if
! DENSE SOLVER
else if ( solverType == 3 ) then
call FCVDENSE( neq, ier )
call FSUNDENSEMATINIT( 1, neq, neq, ier )
! call FCVDENSE( neq, ier )
call FSUNDENSELINSOLINIT( 1, ier )
call FCVDLSINIT( ier )
! UNEXPECTED SOLVER TYPE
else
write (stderr,*) 'Error with solverType input, input = ', solverType
Expand Down
2 changes: 1 addition & 1 deletion src/outputFunctions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ end subroutine outputInstantaneousRates
subroutine outputSpeciesOfInterest( t, specOutReqNames, allSpeciesConcs )
use types_mod
use storage_mod, only : maxSpecLength
use config_functions_mod, only: getConcForSpeciesOfInterest
use config_functions_mod, only : getConcForSpeciesOfInterest
implicit none

real(kind=DP), intent(in) :: t
Expand Down
2 changes: 2 additions & 0 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ ifeq ($(TRAVIS_OS_NAME),linux)
# if linux, pass gfortran
FORT_COMP = gfortran
FORT_LIB = ""
CVODELIB = /home/travis/build/AtChem/AtChem2/cvode-3.1.2-install/lib
else
# if macOS, pass homebrew gfortran
FORT_COMP = /usr/local/Cellar/[email protected]/4.9.4_1/bin/gfortran-4.9
FORT_LIB = /usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9
CVODELIB = /Users/travis/build/AtChem/AtChem2/cvode-3.1.2-install/lib
endif
# else it's not on Travis, so set the fortran compiler as gfortran
else
Expand Down
10 changes: 5 additions & 5 deletions tools/install/install_cvode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ fi
# Move to provided directory
cd $cvode_dir

wget https://computation.llnl.gov/projects/sundials/download/sundials-2.7.0.tar.gz
tar -zxf sundials-2.7.0.tar.gz
rm sundials-2.7.0.tar.gz
cd sundials-2.7.0/
wget https://computation.llnl.gov/projects/sundials/download/cvode-3.1.2.tar.gz
tar -zxf cvode-3.1.2.tar.gz
rm cvode-3.1.2.tar.gz
cd cvode-3.1.2/

mkdir build
cd build

cmake -DCMAKE_INSTALL_PREFIX=$cvode_dir/cvode \
cmake -DCMAKE_INSTALL_PREFIX=$cvode_dir/cvode-3.1.2-install \
-DCMAKE_C_COMPILER:FILEPATH=gcc \
-DCMAKE_Fortran_COMPILER=$FORT_COMP \
-DBUILD_ARKODE:BOOL=OFF \
Expand Down
2 changes: 1 addition & 1 deletion travis/tests/full/full.out.cmp
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,5 @@ AtChem2 v1.1-dev
No. nonlinear convergence failures = 0
No. error test failures = 0

Runtime = 10
Runtime = 12
Deallocating memory.
10 changes: 5 additions & 5 deletions travis/tests/full/output/mainSolverParameters.output.cmp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
t currentStepSize previousStepSize LENRW LENIW NST NFE NETF NCFN NNI NSETUPS QU QCUR NOR LENRWLS LENIWLS LS_FLAG NFELS NJTV NPE NPS NLI NCFL
4.50E+03 1.00000000E+002 1.00000000E+002 58409 50 10 14 0 0 10 2 1 1 0 622761 105 0 0 0 1 0 0 0
5.40E+03 1.00000000E+002 1.00000000E+002 58409 50 19 23 0 0 19 2 1 1 0 622761 105 0 0 0 1 0 0 0
6.30E+03 1.00000000E+002 1.00000000E+002 58409 50 28 32 0 0 28 3 1 1 0 622761 105 0 0 0 1 0 0 0
7.20E+03 1.00000000E+002 1.00000000E+002 58409 50 37 41 0 0 37 3 1 1 0 622761 105 0 0 0 1 0 0 0
8.10E+03 1.00000000E+002 1.00000000E+002 58409 50 46 50 0 0 46 4 1 1 0 622761 105 0 0 0 1 0 0 0
4.50E+03 1.00000000E+002 1.00000000E+002 58409 50 10 14 0 0 10 2 1 1 0 634429 117 0 0 0 1 0 0 0
5.40E+03 1.00000000E+002 1.00000000E+002 58409 50 19 23 0 0 19 2 1 1 0 634429 117 0 0 0 1 0 0 0
6.30E+03 1.00000000E+002 1.00000000E+002 58409 50 28 32 0 0 28 3 1 1 0 634429 117 0 0 0 1 0 0 0
7.20E+03 1.00000000E+002 1.00000000E+002 58409 50 37 41 0 0 37 3 1 1 0 634429 117 0 0 0 1 0 0 0
8.10E+03 1.00000000E+002 1.00000000E+002 58409 50 46 50 0 0 46 4 1 1 0 634429 117 0 0 0 1 0 0 0
6 changes: 3 additions & 3 deletions travis/tests/short/output/mainSolverParameters.output.cmp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t currentStepSize previousStepSize LENRW LENIW NST NFE NETF NCFN NNI NSETUPS QU QCUR NOR LENRWLS LENIWLS LS_FLAG NFELS NJTV NPE NPS NLI NCFL
4.35E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 21321 105 0 0 0 1 0 0 0
4.38E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 21321 105 0 0 0 1 0 0 0
4.41E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 21321 105 0 0 0 1 0 0 0
4.35E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 21533 117 0 0 0 1 0 0 0
4.38E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 21533 117 0 0 0 1 0 0 0
4.41E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 21533 117 0 0 0 1 0 0 0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t currentStepSize previousStepSize LENRW LENIW NST NFE NETF NCFN NNI NSETUPS QU QCUR NOR LENRWLS LENIWLS LS_FLAG NFELS NJE
4.35E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 21632 104 0 104 1
4.38E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 21632 104 0 104 1
4.41E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 21632 104 0 104 1
4.35E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 10920 214 0 104 1
4.38E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 10920 214 0 104 1
4.41E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 10920 214 0 104 1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
t currentStepSize previousStepSize LENRW LENIW NST NFE NETF NCFN NNI NSETUPS QU QCUR NOR LENRWLS LENIWLS LS_FLAG NFELS NJTV NPE NPS NLI NCFL
8.49E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.52E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.55E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.58E+04 1.00000000E+002 1.00000000E+002 1129 50 13 17 0 0 13 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.61E+04 1.00000000E+002 1.00000000E+002 1129 50 16 20 0 0 16 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.64E+04 1.00000000E+002 1.00000000E+002 1129 50 19 23 0 0 19 2 1 1 0 21321 105 0 0 0 1 0 0 0
8.67E+04 1.00000000E+002 1.00000000E+002 1129 50 22 26 0 0 22 3 1 1 0 21321 105 0 0 0 1 0 0 0
8.70E+04 1.00000000E+002 1.00000000E+002 1129 50 25 29 0 0 25 3 1 1 0 21321 105 0 0 0 1 0 0 0
8.73E+04 1.00000000E+002 1.00000000E+002 1129 50 28 32 0 0 28 3 1 1 0 21321 105 0 0 0 1 0 0 0
8.76E+04 1.00000000E+002 1.00000000E+002 1129 50 31 35 0 0 31 3 1 1 0 21321 105 0 0 0 1 0 0 0
8.49E+04 1.00000000E+002 1.00000000E+002 1129 50 4 8 0 0 4 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.52E+04 1.00000000E+002 1.00000000E+002 1129 50 7 11 0 0 7 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.55E+04 1.00000000E+002 1.00000000E+002 1129 50 10 14 0 0 10 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.58E+04 1.00000000E+002 1.00000000E+002 1129 50 13 17 0 0 13 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.61E+04 1.00000000E+002 1.00000000E+002 1129 50 16 20 0 0 16 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.64E+04 1.00000000E+002 1.00000000E+002 1129 50 19 23 0 0 19 2 1 1 0 21533 117 0 0 0 1 0 0 0
8.67E+04 1.00000000E+002 1.00000000E+002 1129 50 22 26 0 0 22 3 1 1 0 21533 117 0 0 0 1 0 0 0
8.70E+04 1.00000000E+002 1.00000000E+002 1129 50 25 29 0 0 25 3 1 1 0 21533 117 0 0 0 1 0 0 0
8.73E+04 1.00000000E+002 1.00000000E+002 1129 50 28 32 0 0 28 3 1 1 0 21533 117 0 0 0 1 0 0 0
8.76E+04 1.00000000E+002 1.00000000E+002 1129 50 31 35 0 0 31 3 1 1 0 21533 117 0 0 0 1 0 0 0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
t M TEMP PRESS RH H2O DEC BLHEIGHT DILUTE JFAC ROOFOPEN RO2
4.350000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 1.702440E+007
4.380000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 2.499414E+007
4.410000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 3.245431E+007
4.350000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 1.702469E+007
4.380000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 2.499424E+007
4.410000E+004 2.445710E+019 3.000000E+002 1.013000E+003 -1.000000E+000 7.020000E+017 1.925804E-001 -1.000000E+000 -1.000000E+000 1.000000E+000 1.000000E+000 3.245428E+007
Loading