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

Sdc fix #57

Merged
merged 5 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions integration/BS/bs_type_sdc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ subroutine clean_state(state)
use actual_network, only: nspec
use sdc_type_module, only: SFS, SEDEN, SEINT
use rpar_indices, only: irp_SRHO, irp_SMX, irp_SMZ
use eos_module, only: eos_get_small_dens, eos_get_max_dens, eos
use eos_type_module, only: eos_input_rt, eos_t
use eos_module, only: eos
use eos_type_module, only: eos_input_rt, eos_t, eos_get_small_dens, eos_get_max_dens


implicit none
Expand Down Expand Up @@ -182,7 +182,7 @@ subroutine sdc_to_bs(sdc, bs)
bs % k = sdc % k

bs % n_rhs = sdc % n_rhs
bs % n_rhs = sdc % n_rhs
bs % n_jac = sdc % n_jac

bs % T_from_eden = sdc % T_from_eden

Expand Down Expand Up @@ -297,8 +297,8 @@ subroutine bs_to_burn(bs, burn)
use actual_network, only: nspec
use burn_type_module, only: burn_t, burn_to_eos, eos_to_burn
use bl_types, only: dp_t
use eos_type_module, only: eos_input_re, eos_t
use eos_module, only: eos, eos_get_small_temp, eos_get_max_temp
use eos_type_module, only: eos_input_re, eos_t, eos_get_small_temp, eos_get_max_temp
use eos_module, only: eos
use sdc_type_module, only: SEDEN, SEINT, SFS
use rpar_indices, only: irp_SRHO, irp_SMX, irp_SMZ

Expand Down Expand Up @@ -347,11 +347,11 @@ end subroutine bs_to_burn

subroutine dump_bs_state(bs)

use eos_type_module, only: eos_input_re, eos_t
use eos_type_module, only: eos_input_re, eos_t, eos_get_small_temp, eos_get_max_temp
use sdc_type_module, only: SEDEN, SEINT, SFS
use rpar_indices, only: irp_SRHO, irp_SMX, irp_SMZ
use actual_network, only: nspec
use eos_module, only: eos, eos_get_small_temp, eos_get_max_temp
use eos_module, only: eos

type (bs_t) :: bs
type (eos_t) :: eos_state
Expand Down
10 changes: 5 additions & 5 deletions integration/BS/numerical_jacobian_sdc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ subroutine numerical_jac(state)

!$acc routine seq

use rhs_module, only: f_rhs
use bs_rhs_module, only: f_bs_rhs
use extern_probin_module, only: centered_diff_jac
use sdc_type_module, only: sdc_t, SVAR_EVOLVE
use bs_type_module, only: bs_t
Expand All @@ -29,7 +29,7 @@ subroutine numerical_jac(state)
state % jac(:,:) = ZERO

! default
call f_rhs(state)
call f_bs_rhs(state)

if (centered_diff_jac) then

Expand All @@ -41,12 +41,12 @@ subroutine numerical_jac(state)
state_delp % y = state % y
state_delp % y(n) = state % y(n) * (ONE + eps)

call f_rhs(state_delp)
call f_bs_rhs(state_delp)

state_delm % y = state % y
state_delm % y(n) = state % y(n) * (ONE - eps)

call f_rhs(state_delm)
call f_bs_rhs(state_delm)

do m = 1, SVAR_EVOLVE

Expand All @@ -65,7 +65,7 @@ subroutine numerical_jac(state)
state_delp % y = state % y
state_delp % y(n) = state % y(n) * (ONE + eps)

call f_rhs(state_delp)
call f_bs_rhs(state_delp)

do m = 1, SVAR_EVOLVE

Expand Down
5 changes: 5 additions & 0 deletions integration/BS/stiff_ode.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ module stiff_ode
use bl_types
use burn_type_module
use bs_type_module
#ifdef SDC
use bs_rhs_module
use bs_jac_module
#else
use rhs_module
use jac_module
#endif

implicit none

Expand Down
29 changes: 27 additions & 2 deletions integration/integrator_sdc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ module integrator_module

subroutine integrator_init()

#if (INTEGRATOR == 0 || INTEGRATOR == 1)
use vode_integrator_module, only: vode_integrator_init
use bs_integrator_module, only: bs_integrator_init
#else
use actual_integrator_module, only: actual_integrator_init
#endif

implicit none

#if (INTEGRATOR == 0 || INTEGRATOR == 1)
call vode_integrator_init()
call bs_integrator_init()
#else
call actual_integrator_init()
#endif

end subroutine integrator_init

Expand All @@ -24,22 +32,39 @@ subroutine integrator(state_in, state_out, dt, time)

!$acc routine seq

#if (INTEGRATOR == 0 || INTEGRATOR == 1)
use vode_integrator_module, only: vode_integrator
use bs_integrator_module, only: bs_integrator
#endif

use bl_error_module, only: bl_error
use bl_types, only: dp_t
use integration_data, only: integration_status_t
use sdc_type_module, only: sdc_t
use extern_probin_module, only: rtol_spec, rtol_temp, rtol_enuc, &
atol_spec, atol_temp, atol_enuc

implicit none

type (sdc_t), intent(in ) :: state_in
type (sdc_t), intent(inout) :: state_out
real(dp_t), intent(in ) :: dt, time

type (integration_status_t) :: status

status % atol_spec = atol_spec
status % rtol_spec = rtol_spec

status % atol_temp = atol_temp
status % rtol_temp = rtol_temp

status % atol_enuc = atol_enuc
status % rtol_enuc = rtol_enuc

#if INTEGRATOR == 0
call vode_integrator(state_in, state_out, dt, time)
call vode_integrator(state_in, state_out, dt, time, status)
#elif INTEGRATOR == 1
call bs_integrator(state_in, state_out, dt, time)
call bs_integrator(state_in, state_out, dt, time, status)
#else
call bl_error("Unknown integrator.")
#endif
Expand Down