Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/common/include/macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
end if
#:enddef

#define t_vec3 real(kind(0d0)), dimension(1:3)
#define t_mat4x4 real(kind(0d0)), dimension(1:4,1:4)
#define t_vec3 real(wp), dimension(1:3)
#define t_mat4x4 real(wp), dimension(1:4,1:4)

#:def ASSERT(predicate, message = None)
if (.not. (${predicate}$)) then
Expand Down
30 changes: 15 additions & 15 deletions src/common/m_checker_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contains
!! Called by s_check_inputs_common for simulation and post-processing
subroutine s_check_inputs_time_stepping
if (cfl_dt) then
@:PROHIBIT(cfl_target < 0 .or. cfl_target > 1d0)
@:PROHIBIT(cfl_target < 0 .or. cfl_target > 1._wp)
@:PROHIBIT(t_stop <= 0)
@:PROHIBIT(t_save <= 0)
@:PROHIBIT(t_save > t_stop)
Expand Down Expand Up @@ -144,10 +144,10 @@ contains
@:PROHIBIT(relax .and. model_eqns /= 3, "phase change requires model_eqns = 3")
@:PROHIBIT(relax .and. relax_model < 0, "relax_model must be in between 0 and 6")
@:PROHIBIT(relax .and. relax_model > 6, "relax_model must be in between 0 and 6")
@:PROHIBIT(relax .and. palpha_eps <= 0d0, "palpha_eps must be positive")
@:PROHIBIT(relax .and. palpha_eps >= 1d0, "palpha_eps must be less than 1")
@:PROHIBIT(relax .and. ptgalpha_eps <= 0d0, "ptgalpha_eps must be positive")
@:PROHIBIT(relax .and. ptgalpha_eps >= 1d0, "ptgalpha_eps must be less than 1")
@:PROHIBIT(relax .and. palpha_eps <= 0._wp, "palpha_eps must be positive")
@:PROHIBIT(relax .and. palpha_eps >= 1._wp, "palpha_eps must be less than 1")
@:PROHIBIT(relax .and. ptgalpha_eps <= 0._wp, "ptgalpha_eps must be positive")
@:PROHIBIT(relax .and. ptgalpha_eps >= 1._wp, "ptgalpha_eps must be less than 1")
@:PROHIBIT((.not. relax) .and. &
((relax_model /= dflt_int) .or. (.not. f_is_default(palpha_eps)) .or. (.not. f_is_default(ptgalpha_eps))), &
"relax is not set as true, but other phase change parameters have been modified. " // &
Expand Down Expand Up @@ -262,35 +262,35 @@ contains

do i = 1, num_fluids
call s_int_to_str(i, iStr)
@:PROHIBIT(.not. f_is_default(fluid_pp(i)%gamma) .and. fluid_pp(i)%gamma <= 0d0, &
@:PROHIBIT(.not. f_is_default(fluid_pp(i)%gamma) .and. fluid_pp(i)%gamma <= 0._wp, &
"fluid_pp("//trim(iStr)//")%gamma must be positive")

@:PROHIBIT(model_eqns == 1 .and. (.not. f_is_default(fluid_pp(i)%gamma)), &
"model_eqns = 1 does not support fluid_pp("//trim(iStr)//")%gamma")

@:PROHIBIT((i <= num_fluids + bub_fac .and. fluid_pp(i)%gamma <= 0d0) .or. &
@:PROHIBIT((i <= num_fluids + bub_fac .and. fluid_pp(i)%gamma <= 0._wp) .or. &
(i > num_fluids + bub_fac .and. (.not. f_is_default(fluid_pp(i)%gamma))), &
"for fluid_pp("//trim(iStr)//")%gamma")

@:PROHIBIT(.not. f_is_default(fluid_pp(i)%pi_inf) .and. fluid_pp(i)%pi_inf < 0d0, &
@:PROHIBIT(.not. f_is_default(fluid_pp(i)%pi_inf) .and. fluid_pp(i)%pi_inf < 0._wp, &
"fluid_pp("//trim(iStr)//")%pi_inf must be non-negative")

@:PROHIBIT(model_eqns == 1 .and. (.not. f_is_default(fluid_pp(i)%pi_inf)), &
"model_eqns = 1 does not support fluid_pp("//trim(iStr)//")%pi_inf")

@:PROHIBIT((i <= num_fluids + bub_fac .and. fluid_pp(i)%pi_inf < 0d0) .or. &
@:PROHIBIT((i <= num_fluids + bub_fac .and. fluid_pp(i)%pi_inf < 0._wp) .or. &
(i > num_fluids + bub_fac .and. (.not. f_is_default(fluid_pp(i)%pi_inf))), &
"for fluid_pp("//trim(iStr)//")%pi_inf")

@:PROHIBIT(fluid_pp(i)%cv < 0d0, &
@:PROHIBIT(fluid_pp(i)%cv < 0._wp, &
"fluid_pp("//trim(iStr)//")%cv must be positive")
end do
end subroutine s_check_inputs_stiffened_eos

!> Checks constraints on the surface tension parameters.
!! Called by s_check_inputs_common for all three stages
subroutine s_check_inputs_surface_tension
@:PROHIBIT(.not. f_is_default(sigma) .and. sigma < 0d0, &
@:PROHIBIT(.not. f_is_default(sigma) .and. sigma < 0._wp, &
"sigma must be greater than or equal to zero")

@:PROHIBIT(.not. f_is_default(sigma) .and. model_eqns /= 3, &
Expand All @@ -301,9 +301,9 @@ contains
!! Called by s_check_inputs_common for all three stages
subroutine s_check_inputs_moving_bc
#:for X, VB2, VB3 in [('x', 'vb2', 'vb3'), ('y', 'vb3', 'vb1'), ('z', 'vb1', 'vb2')]
if (any((/bc_${X}$%vb1, bc_${X}$%vb2, bc_${X}$%vb3/) /= 0d0)) then
if (any((/bc_${X}$%vb1, bc_${X}$%vb2, bc_${X}$%vb3/) /= 0._wp)) then
if (bc_${X}$%beg == -15) then
if (any((/bc_${X}$%${VB2}$, bc_${X}$%${VB3}$/) /= 0d0)) then
if (any((/bc_${X}$%${VB2}$, bc_${X}$%${VB3}$/) /= 0._wp)) then
call s_mpi_abort("bc_${X}$%beg must be -15 if "// &
"bc_${X}$%${VB2}$ or bc_${X}$%${VB3}$ "// &
"is set. Exiting ...")
Expand All @@ -316,9 +316,9 @@ contains
#:endfor

#:for X, VE2, VE3 in [('x', 've2', 've3'), ('y', 've3', 've1'), ('z', 've1', 've2')]
if (any((/bc_${X}$%ve1, bc_${X}$%ve2, bc_${X}$%ve3/) /= 0d0)) then
if (any((/bc_${X}$%ve1, bc_${X}$%ve2, bc_${X}$%ve3/) /= 0._wp)) then
if (bc_${X}$%end == -15) then
if (any((/bc_${X}$%${VE2}$, bc_${X}$%${VE3}$/) /= 0d0)) then
if (any((/bc_${X}$%${VE2}$, bc_${X}$%${VE3}$/) /= 0._wp)) then
call s_mpi_abort("bc_${X}$%end must be -15 if "// &
"bc_${X}$%${VE2}$ or bc_${X}$%${VE3}$ "// &
"is set. Exiting ...")
Expand Down
18 changes: 10 additions & 8 deletions src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

module m_constants

use m_precision_select

character, parameter :: dflt_char = ' ' !< Default string value

real(kind(0d0)), parameter :: dflt_real = -1d6 !< Default real value
real(kind(0d0)), parameter :: sgm_eps = 1d-16 !< Segmentation tolerance
real(kind(0d0)), parameter :: small_alf = 1d-11 !< Small alf tolerance
real(kind(0d0)), parameter :: pi = 3.141592653589793d0 !< Pi
real(kind(0d0)), parameter :: verysmall = 1.d-12 !< Very small number
real(wp), parameter :: dflt_real = -1d6 !< Default real value
real(wp), parameter :: sgm_eps = 1d-16 !< Segmentation tolerance
real(wp), parameter :: small_alf = 1d-11 !< Small alf tolerance
real(wp), parameter :: pi = 3.141592653589793_wp !< Pi
real(wp), parameter :: verysmall = 1.d-12 !< Very small number

integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
integer, parameter :: path_len = 400 !< Maximum path length
Expand All @@ -22,8 +24,8 @@ module m_constants
integer, parameter :: num_patches_max = 10
integer, parameter :: pathlen_max = 400
integer, parameter :: nnode = 4 !< Number of QBMM nodes
real(kind(0d0)), parameter :: capillary_cutoff = 1e-6 !< color function gradient magnitude at which to apply the surface tension fluxes
real(kind(0d0)), parameter :: acoustic_spatial_support_width = 2.5d0 !< Spatial support width of acoustic source, used in s_source_spatial
real(kind(0d0)), parameter :: dflt_vcfl_dt = 100d0 !< value of vcfl_dt when viscosity is off for computing adaptive timestep size
real(wp), parameter :: capillary_cutoff = 1e-6 !< color function gradient magnitude at which to apply the surface tension fluxes
real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp !< Spatial support width of acoustic source, used in s_source_spatial
real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size

end module m_constants
3 changes: 2 additions & 1 deletion src/common/m_delay_file_access.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module m_delay_file_access
use m_precision_select
implicit none
private

Expand All @@ -14,7 +15,7 @@ subroutine DelayFileAccess(ProcessRank)
integer, intent(in) :: ProcessRank

integer :: iDelay, nFileAccessDelayIterations
real(kind(0d0)) :: Number, Dummy
real(wp) :: Number, Dummy

nFileAccessDelayIterations &
= (ProcessRank/N_PROCESSES_FILE_ACCESS)*FILE_ACCESS_DELAY_UNIT
Expand Down
Loading