Skip to content
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
7 changes: 4 additions & 3 deletions src/1d/controller_module.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module controller_module
use precision_module, only: dp

implicit none

Expand All @@ -20,7 +21,7 @@ logical function run_simulation(solution, solver, clawdata) result(success)
! Locals
integer :: frame, stat
integer, allocatable :: no_aux_output(:)
real(kind=8) :: dt_out, t_start
real(dp) :: dt_out, t_start

! Log file settings
integer, parameter :: LOG_UNIT = 213
Expand Down Expand Up @@ -55,7 +56,7 @@ logical function run_simulation(solution, solver, clawdata) result(success)
! Setup time output steps
if (clawdata%output_style == 1) then
dt_out = (clawdata%t_final - clawdata%t0) &
/ real(clawdata%num_output_times,kind=8)
/ real(clawdata%num_output_times, dp)
end if

! Open log file
Expand Down Expand Up @@ -108,4 +109,4 @@ logical function run_simulation(solution, solver, clawdata) result(success)

end function run_simulation

end module controller_module
end module controller_module
7 changes: 4 additions & 3 deletions src/1d/evolve_to_time.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ logical function evolve_to_time(t_end, solution, solver, single_step) result(suc

use solution_module, only: solution_type
use solver_module, only: solver_type, check_CFL
use precision_module, only: dp

implicit none

! Arguments
real(kind=8), intent(in) :: t_end
real(dp), intent(in) :: t_end
type(solution_type), intent(in out) :: solution
type(solver_type), intent(in out) :: solver
logical, optional, intent(in) :: single_step

! Locals
integer :: num_steps
real(kind=8) :: t_old, t_new, t_start
real(dp) :: t_old, t_new, t_start

character(len=*), parameter :: stat_msg = "('CLAW1... Step',i4," // &
"' Courant number =',f6.3,' dt =',d12.4," // &
Expand Down Expand Up @@ -112,4 +113,4 @@ logical function evolve_to_time(t_end, solution, solver, single_step) result(suc

success = .true.

end function evolve_to_time
end function evolve_to_time
4 changes: 2 additions & 2 deletions src/1d/hyperbolic_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subroutine hyperbolic_step(solution,solver)
! Local storage
integer :: i, m, mw
type(geometry_type) :: geometry
real(kind=8) :: cfl
real(dp) :: cfl

! Take apart solution and solver data types for ease of reference below
associate(q => solution%q, aux => solution%aux, f => solver%f, &
Expand Down Expand Up @@ -124,4 +124,4 @@ subroutine hyperbolic_step(solution,solver)

end associate

end subroutine hyperbolic_step
end subroutine hyperbolic_step
9 changes: 5 additions & 4 deletions src/1d/limiter.f90
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
subroutine limiter(num_cells, num_ghost, num_eqn, num_waves, wave, s, mthlim)
use precision_module, only: dp

implicit none

! Input
integer :: num_cells, num_ghost, num_eqn, num_waves
real(kind=8), intent(in out) :: wave(num_eqn, num_waves, 1-num_ghost:num_cells + num_ghost)
real(kind=8), intent(in out) :: s(num_waves, 1-num_ghost:num_cells + num_ghost)
real(dp), intent(in out) :: wave(num_eqn, num_waves, 1-num_ghost:num_cells + num_ghost)
real(dp), intent(in out) :: s(num_waves, 1-num_ghost:num_cells + num_ghost)
integer, intent(in) :: mthlim(num_waves)

! Locals
integer :: i, mw
real(kind=8) :: dot_product_right, dot_product_left, wave_norm, philim, r
real(dp) :: dot_product_right, dot_product_left, wave_norm, philim, r

! print *, wave
! print *, num_cells, num_ghost, num_eqn, num_waves
Expand Down Expand Up @@ -63,4 +64,4 @@ subroutine limiter(num_cells, num_ghost, num_eqn, num_waves, wave, s, mthlim)
endif
enddo

end subroutine limiter
end subroutine limiter
8 changes: 4 additions & 4 deletions src/1d/solution_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

module solution_module

use precision_module
use precision_module, only: dp

implicit none

Expand All @@ -17,8 +17,8 @@ module solution_module
! Solution extents
integer :: num_dim, num_eqn, num_aux
integer, allocatable :: num_cells(:)
real(kind=8) :: t
real(kind=8), allocatable :: dx(:), lower(:), upper(:), centers(:)
real(dp) :: t
real(dp), allocatable :: dx(:), lower(:), upper(:), centers(:)

! Aux array descriptors
integer :: capa_index
Expand Down Expand Up @@ -107,7 +107,7 @@ subroutine output_solution(solution,t,frame,q_components,aux_components)

! Arguments
type(solution_type), intent(in out) :: solution
real(kind=8), intent(in) :: t
real(dp), intent(in) :: t
integer, intent(in) :: frame
integer, intent(in) :: q_components(solution%num_eqn)
integer, intent(in) :: aux_components(solution%num_aux)
Expand Down
10 changes: 5 additions & 5 deletions src/1d/solver_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module solver_module

use iso_c_binding, only: c_ptr, C_NULL_PTR
use precision_module
use precision_module, only: dp

implicit none

Expand Down Expand Up @@ -72,13 +72,13 @@ end subroutine rp_ptwise

! Status of solver
integer :: num_steps
real(kind=8) :: dt_min, dt_max, cfl, cfl_max, dt
real(dp) :: dt_min, dt_max, cfl, cfl_max, dt

! Solver parameters
integer :: order, transverse_waves, dimensional_split, source_splitting
integer :: num_waves, verbosity, steps_max
integer, allocatable :: limiters(:)
real(kind=8) :: dt_max_allowed, cfl_max_allowed, cfl_desired
real(dp) :: dt_max_allowed, cfl_max_allowed, cfl_desired
logical :: use_fwaves, dt_variable

! Time stepper function controls
Expand Down Expand Up @@ -204,14 +204,14 @@ logical function evolve_to_time(t_end, solution, solver, single_step) result(suc
implicit none

! Arguments
real(kind=8), intent(in) :: t_end
real(dp), intent(in) :: t_end
type(solution_type), intent(in out) :: solution
type(solver_type), intent(in out) :: solver
logical, optional, intent(in) :: single_step

! Locals
integer :: num_steps
real(kind=8) :: t_old, t_new, t_start
real(dp) :: t_old, t_new, t_start

character(len=*), parameter :: stat_msg = "('CLAW1... Step',i4," // &
"' Courant number =',f6.3,' dt =',d12.4," // &
Expand Down
5 changes: 3 additions & 2 deletions src/1d/source_term.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ subroutine source_term(t, dt, solution, solver)

use solution_module, only: solution_type
use solver_module, only: solver_type
use precision_module, only: dp

implicit none

real(kind=8), intent(in) :: t, dt
real(dp), intent(in) :: t, dt
type(solution_type), intent(in out) :: solution
type(solver_type), intent(in out) :: solver

end subroutine source_term
end subroutine source_term
13 changes: 7 additions & 6 deletions src/clawdata_module.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module clawdata_module

use precision_module, only: dp
implicit none

! Representation of the clawpack intput data file
Expand All @@ -11,23 +12,23 @@ module clawdata_module

! Domain specification
integer :: capa_index
real(kind=8) :: t0
real(kind=8), allocatable :: lower(:), upper(:)
real(dp) :: t0
real(dp), allocatable :: lower(:), upper(:)

! Output
integer :: output_style, num_output_times, output_step_interval
integer :: total_steps, output_format
integer, allocatable :: output_q_components(:), output_aux_components(:)
logical :: output_t0, output_aux_onlyonce
real(kind=8) :: t_final
real(kind=8), allocatable :: t_out(:)
real(dp) :: t_final
real(dp), allocatable :: t_out(:)

! Solver attributes
integer :: steps_max, order, transverse_waves, dimensional_split
integer :: source_splitting, num_waves, verbosity
logical :: dt_variable, use_fwaves
real(kind=8) :: cfl_max_allowed, cfl_desired, dt_max_allowed, dt_init
real(kind=8), allocatable :: limiters(:)
real(dp) :: cfl_max_allowed, cfl_desired, dt_max_allowed, dt_init
real(dp), allocatable :: limiters(:)

! Boundary conditions
integer :: num_ghost
Expand Down
3 changes: 2 additions & 1 deletion tests/advection/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ program advection1d
use controller_module
use rp1_advection, only: rp1_advection_ptwise, rp1_advection_vectorized
use rp1_advection, only: rp_type
use precision_module, only: dp

use clawdata_module

Expand All @@ -18,7 +19,7 @@ program advection1d

type(rp_type), target :: rp_aux

real(kind=8) :: beta
real(dp) :: beta
integer :: i

! Read in advective speed and initial condition data
Expand Down
6 changes: 3 additions & 3 deletions tests/advection/rp1_advection.f90
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module rp1_advection

use precision_module, only: dp
implicit none

type rp_type
! Advection speed
real(kind=8) :: u
real(dp) :: u
end type rp_type

contains
Expand All @@ -15,7 +16,6 @@ subroutine rp1_advection_vectorized(num_eqn, num_aux, num_ghost, num_cells, num_

use iso_c_binding, only: c_ptr, c_loc, c_f_pointer
use geometry_module, only: geometry_type
use precision_module, only: DP

implicit none

Expand Down Expand Up @@ -105,4 +105,4 @@ subroutine rp1_advection_ptwise(num_eqn, num_aux, num_waves, rp_data, geometry,

end subroutine rp1_advection_ptwise

end module rp1_advection
end module rp1_advection