Switched to assumed-length characters for #332

This commit is contained in:
Sterling Harper 2014-10-14 14:00:09 -04:00
parent d9f6e44ca0
commit 56c79d16ee
10 changed files with 49 additions and 82 deletions

View file

@ -11,8 +11,6 @@ module cmfd_execute
private
public :: execute_cmfd, cmfd_init_batch
character(2*MAX_LINE_LEN) :: message
contains
!==============================================================================
@ -46,8 +44,7 @@ contains
elseif (trim(cmfd_solver_type) == 'jfnk') then
call cmfd_jfnk_execute()
else
message = 'solver type became invalid after input processing'
call fatal_error(message)
call fatal_error('solver type became invalid after input processing')
end if
#else
call cmfd_solver_execute()
@ -316,8 +313,7 @@ contains
! Check for sites outside of the mesh
if (master .and. outside) then
message = "Source sites outside of the CMFD mesh!"
call fatal_error(message)
call fatal_error("Source sites outside of the CMFD mesh!")
end if
! Have master compute weight factors (watch for 0s)
@ -347,12 +343,10 @@ contains
n_groups = size(cmfd % egrid) - 1
if (source_bank(i) % E < cmfd % egrid(1)) then
e_bin = 1
message = 'Source pt below energy grid'
if (master) call warning(message)
if (master) call warning('Source pt below energy grid')
elseif (source_bank(i) % E > cmfd % egrid(n_groups + 1)) then
e_bin = n_groups
message = 'Source pt above energy grid'
if (master) call warning(message)
if (master) call warning('Source pt above energy grid')
else
e_bin = binary_search(cmfd % egrid, n_groups + 1, source_bank(i) % E)
end if
@ -362,8 +356,7 @@ contains
! Check for outside of mesh
if (.not. in_mesh) then
message = 'Source site found outside of CMFD mesh'
call fatal_error(message)
call fatal_error('Source site found outside of CMFD mesh')
end if
! Reweight particle
@ -419,8 +412,7 @@ contains
integer :: i ! loop counter
! Print message
message = "CMFD tallies reset"
call write_message(message, 7)
call write_message("CMFD tallies reset", 7)
! Begin loop around CMFD tallies
do i = 1, n_cmfd_tallies

View file

@ -12,26 +12,25 @@ module cmfd_solver
private
public :: cmfd_solver_execute
real(8) :: k_n ! New k-eigenvalue
real(8) :: k_o ! Old k-eigenvalue
real(8) :: k_s ! Shift of eigenvalue
real(8) :: k_ln ! New shifted eigenvalue
real(8) :: k_lo ! Old shifted eigenvalue
real(8) :: norm_n ! Current norm of source vector
real(8) :: norm_o ! Old norm of source vector
real(8) :: kerr ! Error in keff
real(8) :: serr ! Error in source
real(8) :: ktol ! Tolerance on keff
real(8) :: stol ! Tolerance on source
logical :: adjoint_calc ! Run an adjoint calculation
type(Matrix) :: loss ! Cmfd loss matrix
type(Matrix) :: prod ! Cmfd prod matrix
type(Vector) :: phi_n ! New flux vector
type(Vector) :: phi_o ! Old flux vector
type(Vector) :: s_n ! New source vector
type(Vector) :: s_o ! Old flux vector
type(Vector) :: serr_v ! Error in source
character(2*MAX_LINE_LEN) :: message ! Message to output unit
real(8) :: k_n ! New k-eigenvalue
real(8) :: k_o ! Old k-eigenvalue
real(8) :: k_s ! Shift of eigenvalue
real(8) :: k_ln ! New shifted eigenvalue
real(8) :: k_lo ! Old shifted eigenvalue
real(8) :: norm_n ! Current norm of source vector
real(8) :: norm_o ! Old norm of source vector
real(8) :: kerr ! Error in keff
real(8) :: serr ! Error in source
real(8) :: ktol ! Tolerance on keff
real(8) :: stol ! Tolerance on source
logical :: adjoint_calc ! Run an adjoint calculation
type(Matrix) :: loss ! Cmfd loss matrix
type(Matrix) :: prod ! Cmfd prod matrix
type(Vector) :: phi_n ! New flux vector
type(Vector) :: phi_o ! Old flux vector
type(Vector) :: s_n ! New source vector
type(Vector) :: s_o ! Old flux vector
type(Vector) :: serr_v ! Error in source
! CMFD linear solver interface
procedure(linsolve), pointer :: cmfd_linsolver => null()
@ -195,8 +194,7 @@ contains
call prod % write_petsc_binary('adj_prodmat.bin')
end if
#else
message = 'Adjoint calculations only allowed with PETSc'
call fatal_error(message)
call fatal_error('Adjoint calculations only allowed with PETSc')
#endif
end subroutine compute_adjoint
@ -237,8 +235,8 @@ contains
! Check if reached iteration 10000
if (i == 10000) then
message = 'Reached maximum iterations in CMFD power iteration solver.'
call fatal_error(message)
call fatal_error('Reached maximum iterations in CMFD power iteration ' &
& // 'solver.')
end if
! Compute source vector
@ -401,8 +399,7 @@ contains
! Check for max iterations met
if (igs == 10000) then
message = 'Maximum Gauss-Seidel iterations encountered.'
call fatal_error(message)
call fatal_error('Maximum Gauss-Seidel iterations encountered.')
endif
! Copy over x vector
@ -520,8 +517,7 @@ contains
! Check for max iterations met
if (igs == 10000) then
message = 'Maximum Gauss-Seidel iterations encountered.'
call fatal_error(message)
call fatal_error('Maximum Gauss-Seidel iterations encountered.')
endif
! Copy over x vector
@ -653,8 +649,7 @@ contains
! Check for max iterations met
if (igs == 10000) then
message = 'Maximum Gauss-Seidel iterations encountered.'
call fatal_error(message)
call fatal_error('Maximum Gauss-Seidel iterations encountered.')
endif
! Copy over x vector

View file

@ -5,8 +5,6 @@ module energy_grid
use list_header, only: ListReal
use output, only: write_message
character(2*MAX_LINE_LEN) :: message ! Message to output unit
contains
!===============================================================================
@ -23,8 +21,7 @@ contains
type(ListReal), pointer :: list => null()
type(Nuclide), pointer :: nuc => null()
message = "Creating unionized energy grid..."
call write_message(message, 5)
call write_message("Creating unionized energy grid...", 5)
! Add grid points for each nuclide in the problem
do i = 1, n_nuclides_total

View file

@ -20,7 +20,7 @@ contains
subroutine warning(message)
character(2*MAX_LINE_LEN) :: message
character(*) :: message
integer :: i_start ! starting position
integer :: i_end ! ending position
@ -78,7 +78,7 @@ contains
subroutine fatal_error(message, error_code)
character(2*MAX_LINE_LEN) :: message
character(*) :: message
integer, optional :: error_code ! error code
integer :: code ! error code

View file

@ -8,8 +8,6 @@ module fission
implicit none
character(2*MAX_LINE_LEN) :: message ! Message to output unit
contains
!===============================================================================
@ -28,8 +26,7 @@ contains
real(8) :: c ! polynomial coefficient
if (nuc % nu_t_type == NU_NONE) then
message = "No neutron emission data for table: " // nuc % name
call fatal_error(message)
call fatal_error("No neutron emission data for table: " // nuc % name)
elseif (nuc % nu_t_type == NU_POLYNOMIAL) then
! determine number of coefficients
NC = int(nuc % nu_t_data(1))

View file

@ -8,8 +8,6 @@ module interpolation
implicit none
character(2*MAX_LINE_LEN) :: message ! Message to output unit
interface interpolate_tab1
module procedure interpolate_tab1_array, interpolate_tab1_object
end interface interpolate_tab1
@ -119,8 +117,7 @@ contains
r = (log(x) - log(x0))/(log(x1) - log(x0))
y = exp((1-r)*log(y0) + r*log(y1))
case default
message = "Unsupported interpolation scheme: " // to_str(interp)
call fatal_error(message)
call fatal_error("Unsupported interpolation scheme: " // to_str(interp))
end select
end function interpolate_tab1_array
@ -205,8 +202,7 @@ contains
r = (log(x) - log(x0))/(log(x1) - log(x0))
y = exp((1-r)*log(y0) + r*log(y1))
case default
message = "Unsupported interpolation scheme: " // to_str(interp)
call fatal_error(message)
call fatal_error("Unsupported interpolation scheme: " // to_str(interp))
end select
end function interpolate_tab1_object

View file

@ -195,7 +195,7 @@ contains
subroutine write_message(message, level)
character(2*MAX_LINE_LEN) :: message
character(*) :: message
integer, optional :: level ! verbosity level
integer :: i_start ! starting position

View file

@ -16,8 +16,6 @@ module plot
implicit none
character(2*MAX_LINE_LEN) :: message ! Message to output unit
contains
!===============================================================================
@ -33,8 +31,8 @@ contains
pl => plots(i)
! Display output message
message = "Processing plot " // trim(to_str(pl % id)) // "..."
call write_message(message, 5)
call write_message("Processing plot " // trim(to_str(pl % id)) &
&// "...", 5)
if (pl % type == PLOT_TYPE_SLICE) then
! create 2d image

View file

@ -9,8 +9,6 @@ module search
module procedure binary_search_real, binary_search_int4, binary_search_int8
end interface binary_search
character(2*MAX_LINE_LEN) :: message ! Message to output unit
contains
!===============================================================================
@ -34,8 +32,7 @@ contains
R = n
if (val < array(L) .or. val > array(R)) then
message = "Value outside of array during binary search"
call fatal_error(message)
call fatal_error("Value outside of array during binary search")
end if
n_iteration = 0
@ -62,8 +59,8 @@ contains
! check for large number of iterations
n_iteration = n_iteration + 1
if (n_iteration == MAX_ITERATION) then
message = "Reached maximum number of iterations on binary search."
call fatal_error(message)
call fatal_error("Reached maximum number of iterations on binary " &
&// "search.")
end if
end do
@ -87,8 +84,7 @@ contains
R = n
if (val < array(L) .or. val > array(R)) then
message = "Value outside of array during binary search"
call fatal_error(message)
call fatal_error("Value outside of array during binary search")
end if
n_iteration = 0
@ -115,8 +111,8 @@ contains
! check for large number of iterations
n_iteration = n_iteration + 1
if (n_iteration == MAX_ITERATION) then
message = "Reached maximum number of iterations on binary search."
call fatal_error(message)
call fatal_error("Reached maximum number of iterations on binary " &
&// "search.")
end if
end do
@ -140,8 +136,7 @@ contains
R = n
if (val < array(L) .or. val > array(R)) then
message = "Value outside of array during binary search"
call fatal_error(message)
call fatal_error("Value outside of array during binary search")
end if
n_iteration = 0
@ -168,8 +163,8 @@ contains
! check for large number of iterations
n_iteration = n_iteration + 1
if (n_iteration == MAX_ITERATION) then
message = "Reached maximum number of iterations on binary search."
call fatal_error(message)
call fatal_error("Reached maximum number of iterations on binary " &
&// "search.")
end if
end do

View file

@ -1,6 +1,5 @@
module solver_interface
use constants
use error, only: fatal_error
use matrix_header, only: Matrix
use vector_header, only: Vector
@ -13,8 +12,6 @@ module solver_interface
implicit none
private
character(2*MAX_LINE_LEN) :: message ! Message to output unit
! GMRES solver type
type, public :: GMRESSolver
#ifdef PETSC