diff --git a/src/error.F90 b/src/error.F90 index 0964ca1f24..803a0617cf 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -30,20 +30,24 @@ contains integer :: indent ! length of indentation character(:), allocatable :: message ! input message with a prefix - ! Prefix the message - if (.not. present(deprecation)) then - message = 'WARNING: ' // message_in - else if (deprecation) then - message = 'DEPRECATION WARNING: ' // message_in - else - message = 'WARNING: ' // message_in - end if - ! Set line wrapping and indentation line_wrap = 80 indent = 10 ! Determine length of message + length = len_trim(message_in) + + ! Prefix the message + if (.not. present(deprecation)) then + allocate(character(length+9) :: message) + message = 'WARNING: ' // message_in + else if (deprecation) then + allocate(character(length+23) :: message) + message = 'DEPRECATION WARNING: ' // message_in + else + allocate(character(length+9) :: message) + message = 'WARNING: ' // message_in + end if length = len_trim(message) i_start = 0 diff --git a/src/geometry.F90 b/src/geometry.F90 index a1ce314856..1bb11667b6 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -135,7 +135,6 @@ contains integer :: i_xyz(3) ! indices in lattice integer :: n ! number of cells to search integer :: index_cell ! index in cells array - real(8) :: xyz(3) ! temporary location logical :: use_search_cells ! use cells provided as argument type(Cell), pointer, save :: c => null() ! pointer to cell class(Lattice), pointer, save :: lat => null() ! pointer to lattice @@ -225,7 +224,7 @@ contains ! Determine lattice indices i_xyz = get_lat_indices(lat, & - &p % coord % xyz + TINY_BIT * p % coord % uvw, p % coord % uvw) + &p % coord % xyz + TINY_BIT * p % coord % uvw) ! Create new level of coordinates allocate(p % coord % next) @@ -348,17 +347,15 @@ contains ! coordinates. !=============================================================================== - function get_lat_indices(lat, xyz, uvw) result(i_xyz) + function get_lat_indices(lat, xyz) result(i_xyz) class(Lattice), intent(in) :: lat - real(8) , intent(in) :: xyz(3) - real(8) , intent(in) :: uvw(3) + real(8), intent(in) :: xyz(3) integer :: i_xyz(3) - real(8) :: alpha, beta_dir + real(8) :: alpha real(8) :: xyz_t(3) real(8) :: dists(4) - integer :: n_rings integer :: i, j, k, loc(1) select type(lat) @@ -811,9 +808,8 @@ contains integer :: i ! index for surface in cell integer :: index_surf ! index in surfaces array (with sign) real(8) :: x,y,z ! particle coordinates - real(8) :: alpha, beta, gama ! skewed particle coordiantes + real(8) :: beta, gama ! skewed particle coordiantes real(8) :: u,v,w ! particle directions - real(8) :: alpha_dir ! skewed particle direction real(8) :: beta_dir ! skewed particle direction real(8) :: gama_dir ! skewed particle direction real(8) :: edge ! distance to oncoming edge diff --git a/src/output.F90 b/src/output.F90 index d1b8ccf768..d673ae4bbc 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -476,8 +476,6 @@ contains integer, optional :: unit integer :: unit_ ! unit to write to - character(MAX_LINE_LEN) :: string - ! set default unit if not specified if (present(unit)) then @@ -492,19 +490,34 @@ contains select type(lat) type is (RectLattice) ! Write dimension of lattice. - string = to_str(lat % n_cells(1)) // ' ' // to_str(lat % n_cells(2)) - if (lat % is_3d) string = string // ' ' // to_str(lat % n_cells(3)) - write(unit_,*) ' Dimension =' // string + if (lat % is_3d) then + write(unit_, *) ' Dimension = ' // to_str(lat % n_cells(1)) & + &// ' ' // to_str(lat % n_cells(2)) // ' ' & + &// to_str(lat % n_cells(3)) + else + write(unit_, *) ' Dimension = ' // to_str(lat % n_cells(1)) & + &// ' ' // to_str(lat % n_cells(2)) + end if ! Write lower-left coordinates of lattice. - string = to_str(lat % lower_left(1)) // ' ' // to_str(lat % lower_left(2)) - if (lat % is_3d) string = string // ' ' // to_str(lat % lower_left(3)) - write(unit_,*) ' Lower-left =' // string + if (lat % is_3d) then + write(unit_, *) ' Lower-left = ' // to_str(lat % lower_left(1)) & + &// ' ' // to_str(lat % lower_left(2)) // ' ' & + &// to_str(lat % lower_left(3)) + else + write(unit_, *) ' Lower-left = ' // to_str(lat % lower_left(1)) & + &// ' ' // to_str(lat % lower_left(2)) + end if ! Write lattice pitch along each axis. - string = to_str(lat % pitch(1)) // ' ' // to_str(lat % pitch(2)) - if (lat % is_3d) string = string // ' ' // to_str(lat % pitch(3)) - write(unit_,*) ' Pitch =' // string + if (lat % is_3d) then + write(unit_, *) ' Pitch = ' // to_str(lat % pitch(1)) & + &// ' ' // to_str(lat % pitch(2)) // ' ' & + &// to_str(lat % pitch(3)) + else + write(unit_, *) ' Pitch = ' // to_str(lat % pitch(1)) & + &// ' ' // to_str(lat % pitch(2)) + end if write(unit_,*) type is (HexLattice) @@ -513,14 +526,22 @@ contains if (lat % is_3d) write(unit_,*) ' N-axial = ' // to_str(lat % n_axial) ! Write center coordinates of lattice. - string = to_str(lat % center(1)) // ' ' // to_str(lat % center(2)) - if (lat % is_3d) string = string // ' ' // to_str(lat % center(3)) - write(unit_,*) ' Center =' // string + if (lat % is_3d) then + write(unit_, *) ' Center = ' // to_str(lat % center(1)) & + &// ' ' // to_str(lat % center(2)) // ' ' & + &// to_str(lat % center(3)) + else + write(unit_, *) ' Center = ' // to_str(lat % center(1)) & + &// ' ' // to_str(lat % center(2)) + end if ! Write lattice pitch along each axis. - string = to_str(lat % pitch(1)) - if (lat % is_3d) string = string // ' ' // to_str(lat % pitch(2)) - write(unit_,*) ' Pitch =' // string + if (lat % is_3d) then + write(unit_, *) ' Pitch = ' // to_str(lat % pitch(1)) & + &// ' ' // to_str(lat % pitch(2)) + else + write(unit_, *) ' Pitch = ' // to_str(lat % pitch(1)) + end if write(unit_,*) end select