From 1c4c072826256e7db53cedee2742913070c42949 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 21 Nov 2011 09:36:26 -0800 Subject: [PATCH] Fixed null pointer on rxn%MT in sample_reaction. Miscellaneous changes for PGI compiler. --- src/error.f90 | 5 ++++- src/global.f90 | 3 --- src/output.f90 | 22 ++++++++++++---------- src/physics.f90 | 9 ++++++--- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/error.f90 b/src/error.f90 index 73e23c386b..fab7c8dc84 100644 --- a/src/error.f90 +++ b/src/error.f90 @@ -64,9 +64,12 @@ contains write(eu,*) end if - ! All processors abort + ! Release memory from all allocatable arrays call free_memory() + ! Abort program + stop + end subroutine fatal_error end module error diff --git a/src/global.f90 b/src/global.f90 index 2356e5c8d6..e5533a6385 100644 --- a/src/global.f90 +++ b/src/global.f90 @@ -196,9 +196,6 @@ contains call MPI_FINALIZE(ierr) #endif - ! End program - stop - end subroutine free_memory end module global diff --git a/src/output.f90 b/src/output.f90 index 6aa6a5d0d4..79fed24808 100644 --- a/src/output.f90 +++ b/src/output.f90 @@ -763,17 +763,18 @@ contains subroutine print_runtime() - integer(8) :: total_particles - real(8) :: speed + integer(8) :: total_particles + real(8) :: speed + character(15) :: string ! display header block call header("Time Elapsed") ! display time elapsed for various sections - write(ou,100) "Total time elapsed", trim(real_to_str(time_total % elapsed)) - write(ou,100) "Total time for initialization", trim(real_to_str(time_init % elapsed)) - write(ou,100) "Total time in computation", trim(real_to_str(time_compute % elapsed)) - write(ou,100) "Total time between cycles", trim(real_to_str(time_intercycle % elapsed)) + write(ou,100) "Total time elapsed", time_total % elapsed + write(ou,100) "Total time for initialization", time_init % elapsed + write(ou,100) "Total time in computation", time_compute % elapsed + write(ou,100) "Total time between cycles", time_intercycle % elapsed ! display header block call header("Run Statistics") @@ -781,14 +782,15 @@ contains ! display calculate rate and final keff total_particles = n_particles * n_cycles speed = real(total_particles) / time_compute % elapsed - write(ou,101) "Calculation Rate", trim(real_to_str(speed)) - write(ou,102) "Final Keff", trim(real_to_str(keff)), trim(real_to_str(keff_std)) + string = real_to_str(speed) + write(ou,101) "Calculation Rate", trim(string) + write(ou,102) "Final Keff", keff, keff_std write(ou,*) ! format for write statements -100 format (1X,A,T33,"= ",A," seconds") +100 format (1X,A,T33,"= ",ES11.4," seconds") 101 format (1X,A,T20,"= ",A," neutrons/second") -102 format (1X,A,T20,"= ",A," +/- ",A) +102 format (1X,A,T20,"= ",F8.5," +/- ",F8.5) end subroutine print_runtime diff --git a/src/physics.f90 b/src/physics.f90 index a0566dc5dc..65bcc3a0a6 100644 --- a/src/physics.f90 +++ b/src/physics.f90 @@ -621,8 +621,11 @@ contains ! Perform collision physics for elastic scattering call elastic_scatter(p, nuc, rxn) + end if + ! Set MT to be returned + MT = 2 else ! ======================================================================= ! INELASTIC SCATTERING @@ -662,10 +665,10 @@ contains ! Perform collision physics for inelastics scattering call inelastic_scatter(p, nuc, rxn) - end if - ! Set MT to be returned - MT = rxn % MT + ! Set MT to be returned + MT = rxn % MT + end if end subroutine sample_reaction