Line data Source code
1 1 : program test_num
2 :
3 1 : use test_support
4 : use test_brent
5 : use test_newuoa
6 : use test_bobyqa
7 : use test_newton
8 : !use test_radau5_pollu, only: do_test_radau5_pollu
9 : !use test_radau5_hires, only: do_test_radau5_hires
10 : use test_int_support
11 :
12 : use test_beam
13 : use test_chemakzo
14 : use test_medakzo
15 : use test_vdpol
16 :
17 : use test_diffusion
18 : use test_simplex
19 :
20 : use test_integrate
21 : use test_accurate_sum
22 :
23 : use const_def
24 : use const_lib, only: const_init
25 : use num_def
26 : use mtx_lib
27 : use mtx_def
28 : use utils_lib, only: mesa_error
29 :
30 : implicit none
31 :
32 : logical, parameter :: show_all = .false. ! false for releases
33 :
34 : integer :: i, decsol, ierr
35 : logical :: do_numerical_jacobian, m_band, j_band, quiet
36 : character(len=32) :: my_mesa_dir
37 :
38 1 : my_mesa_dir = '../..'
39 1 : call const_init(my_mesa_dir, ierr)
40 1 : if (ierr /= 0) then
41 0 : write (*, *) 'const_init failed'
42 0 : call mesa_error(__FILE__, __LINE__)
43 : end if
44 1 : call math_init()
45 :
46 1 : quiet = .false.
47 1 : m_band = .false.
48 1 : j_band = .false.
49 : do_numerical_jacobian = .false.
50 1 : decsol = lapack
51 :
52 : ! newton solver
53 1 : do_numerical_jacobian = .false.
54 :
55 1 : write (*, *) 'call do_test_newton lapack'
56 1 : call do_test_newton(do_numerical_jacobian, lapack)
57 :
58 1 : write (*, *) 'call do_test_newton block_thomas_dble'
59 1 : call do_test_newton(do_numerical_jacobian, block_thomas_dble)
60 :
61 1 : write (*, *) 'call test_find0_quadratic'
62 1 : call test_find0_quadratic
63 :
64 1 : write (*, *) 'call test_find_max_quadratic'
65 1 : call test_find_max_quadratic
66 :
67 1 : write (*, *) 'call test_qsort'
68 1 : call test_qsort
69 :
70 1 : write (*, *) 'call do_test_newuoa'
71 1 : call do_test_newuoa
72 :
73 1 : write (*, *) 'call do_test_bobyqa'
74 1 : call do_test_bobyqa
75 :
76 1 : write (*, *) 'call do_test_simplex'
77 1 : call do_test_simplex
78 :
79 1 : write (*, *) 'call do_test_brent'
80 1 : call do_test_brent
81 :
82 1 : write (*, *) 'call test_binary_search'
83 1 : call test_binary_search
84 :
85 1 : write (*, *) 'call test_root routines'
86 1 : call test_root_with_brackets
87 1 : call test_root2
88 1 : call test_root3
89 1 : call test_root_no_brackets
90 :
91 : ! explicit solvers
92 1 : call test_dopri(.false., show_all)
93 1 : call test_dopri(.true., show_all)
94 :
95 : ! test each implicit solver with dense matrix
96 : ! ijob M J test
97 : ! 1 I F vdpol
98 1 : write (*, *) 'ijob 1'
99 : decsol = lapack
100 1 : write (*, *) 'numerical jacobians'
101 1 : do_numerical_jacobian = .true.
102 8 : do i = 1, num_solvers
103 8 : call do_test_vdpol(i, decsol, do_numerical_jacobian, show_all, quiet)
104 : end do
105 :
106 1 : write (*, *) 'analytical jacobians'
107 1 : do_numerical_jacobian = .false.
108 8 : do i = 1, num_solvers
109 8 : call do_test_vdpol(i, decsol, do_numerical_jacobian, show_all, quiet)
110 : end do
111 :
112 : ! test each implicit solver with banded matrix
113 : ! ijob M J test
114 : ! 2 I B medakzo
115 1 : write (*, *) 'ijob 2'
116 : decsol = lapack
117 1 : write (*, *) 'numerical jacobians'
118 1 : do_numerical_jacobian = .true.
119 8 : do i = 1, num_solvers
120 7 : if (i <= ros3p_solver) cycle
121 8 : call do_test_medakzo(i, decsol, do_numerical_jacobian, show_all, quiet)
122 : end do
123 :
124 1 : write (*, *) 'analytical jacobians'
125 1 : do_numerical_jacobian = .false.
126 8 : do i = 1, num_solvers
127 7 : if (i <= ros3p_solver) cycle
128 8 : call do_test_medakzo(i, decsol, do_numerical_jacobian, show_all, quiet)
129 : end do
130 :
131 : ! as of dec, 2013, non-identity mass matrix causes diff results with ifort vs gfortran
132 : ! ! test each implicit solver with banded implicit ODE system and dense matrix
133 : ! ! ijob M J test
134 : ! ! 3 B F chemakzo
135 : ! write(*,*) 'ijob 3'
136 : ! decsol = lapack
137 : ! do i=1,num_solvers
138 : ! m_band = .true.
139 : ! if (i <= ros3p_solver) cycle
140 : ! call do_test_chemakzo(i,decsol,m_band,do_numerical_jacobian,show_all,quiet)
141 : ! end do
142 : !
143 : !
144 : ! ! each implicit solver with full implicit ODE system
145 : ! ! ijob M J test
146 : ! ! 5 F F chemakzo
147 : ! write(*,*) 'ijob 5'
148 : ! decsol = lapack
149 : ! do i=1,num_solvers
150 : ! m_band = .false.
151 : ! if (i <= ros3p_solver) cycle
152 : ! call do_test_chemakzo(i,decsol,m_band,do_numerical_jacobian,show_all,quiet)
153 : ! end do
154 :
155 : ! test with m1 /= 0
156 : ! ijob M J test
157 : ! 11 I F x beam
158 1 : write (*, *) 'ijob 11'
159 : decsol = lapack
160 : if (show_all) then
161 : do i = 1, num_solvers
162 : if (i <= ros3pl_solver) cycle ! beam is too hard for these
163 : call do_test_beam(i, decsol, .true., show_all, quiet)
164 : end do
165 : end if
166 :
167 : ! test solvers with tridiagonal jacobian
168 : decsol = lapack
169 1 : do_numerical_jacobian = .false.
170 1 : quiet = .false.
171 8 : do i = 1, num_solvers
172 8 : call do_test_diffusion(i, decsol, do_numerical_jacobian, show_all, quiet)
173 : end do
174 :
175 1 : write (*, *) 'call test_integrate routines'
176 1 : call run_test_integrate()
177 :
178 1 : call run_test_accurate_sum()
179 :
180 1 : end program test_num
|