From c5e7ac407818bf8473120f551bcfc17f21e3843c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 12 Apr 2012 16:43:26 -0400 Subject: [PATCH 1/2] Moved output in calculate_keff to the output module. --- src/intercycle.F90 | 39 +++++---------------------------------- src/output.F90 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/src/intercycle.F90 b/src/intercycle.F90 index 8c9d55e05b..06dbbdc463 100644 --- a/src/intercycle.F90 +++ b/src/intercycle.F90 @@ -6,7 +6,7 @@ module intercycle use global use mesh, only: count_bank_sites use mesh_header, only: StructuredMesh - use output, only: write_message + use output, only: write_message, print_batch_keff use random_lcg, only: prn, set_particle_seed, prn_skip use search, only: binary_search use string, only: to_str @@ -350,7 +350,7 @@ contains !=============================================================================== ! CALCULATE_KEFF calculates the single batch estimate of keff as well as the -! mean and standard deviation of the mean for active batches and displays them +! mean and standard deviation of the mean for active batches !=============================================================================== subroutine calculate_keff() @@ -430,37 +430,10 @@ contains end if end if - ! Display output for this batch - if (master) then - if (current_batch > n_inactive + 1) then - if (entropy_on) then - write(UNIT=OUTPUT_UNIT, FMT=103) current_batch, k_batch, & - entropy, keff, keff_std - else - write(UNIT=OUTPUT_UNIT, FMT=101) current_batch, k_batch, & - keff, keff_std - end if - else - if (entropy_on) then - write(UNIT=OUTPUT_UNIT, FMT=102) current_batch, k_batch, entropy - else - write(UNIT=OUTPUT_UNIT, FMT=100) current_batch, k_batch - end if - end if - end if else ! ======================================================================= ! INACTIVE BATCHES - ! Display output for inactive batch - if (master) then - if (entropy_on) then - write(UNIT=OUTPUT_UNIT, FMT=102) current_batch, k_batch, entropy - else - write(UNIT=OUTPUT_UNIT, FMT=100) current_batch, k_batch - end if - end if - ! Set keff keff = k_batch @@ -468,16 +441,14 @@ contains global_tallies(:) % value = ZERO end if + ! Display output + if (master) call print_batch_keff() + #ifdef MPI ! Broadcast new keff value to all processors call MPI_BCAST(keff, 1, MPI_REAL8, 0, MPI_COMM_WORLD, mpi_err) #endif -100 format (2X,I5,2X,F8.5) -101 format (2X,I5,2X,F8.5,5X,F8.5," +/-",F8.5) -102 format (2X,I5,2X,F8.5,3X,F8.5) -103 format (2X,I5,2X,F8.5,3X,F8.5,3X,F8.5," +/-",F8.5) - end subroutine calculate_keff !=============================================================================== diff --git a/src/output.F90 b/src/output.F90 index d95a735dbc..3ff924e6e6 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -933,6 +933,52 @@ contains end subroutine print_summary +!=============================================================================== +! PRINT_BATCH_KEFF displays the last batch's tallied value of the neutron +! multiplication factor as well as the average value if we're in active batches +!=============================================================================== + + subroutine print_batch_keff() + + if (current_batch <= n_inactive) then + ! ====================================================================== + ! INACTIVE BATCHES + + if (entropy_on) then + write(UNIT=OUTPUT_UNIT, FMT=102) current_batch, k_batch, entropy + else + write(UNIT=OUTPUT_UNIT, FMT=100) current_batch, k_batch + end if + + elseif (current_batch == n_inactive + 1) then + ! ====================================================================== + ! ACTIVE BATCHES + + if (entropy_on) then + write(UNIT=OUTPUT_UNIT, FMT=102) current_batch, k_batch, entropy + else + write(UNIT=OUTPUT_UNIT, FMT=100) current_batch, k_batch + end if + + elseif (current_batch > n_inactive + 1) then + + if (entropy_on) then + write(UNIT=OUTPUT_UNIT, FMT=103) current_batch, k_batch, & + entropy, keff, keff_std + else + write(UNIT=OUTPUT_UNIT, FMT=101) current_batch, k_batch, & + keff, keff_std + end if + + end if + +100 format (2X,I5,2X,F8.5) +101 format (2X,I5,2X,F8.5,5X,F8.5," +/-",F8.5) +102 format (2X,I5,2X,F8.5,3X,F8.5) +103 format (2X,I5,2X,F8.5,3X,F8.5,3X,F8.5," +/-",F8.5) + + end subroutine print_batch_keff + !=============================================================================== ! PRINT_PLOT displays selected options for plotting !=============================================================================== From 653535d08bab285df0a5d6a30c65d8931ec4114d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 12 Apr 2012 16:50:47 -0400 Subject: [PATCH 2/2] Moved column output in run_criticality to output module. --- src/criticality.F90 | 14 ++------------ src/output.F90 | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/criticality.F90 b/src/criticality.F90 index e2492cbf82..c7978d4e84 100644 --- a/src/criticality.F90 +++ b/src/criticality.F90 @@ -4,7 +4,7 @@ module criticality use global use intercycle, only: shannon_entropy, calculate_keff, synchronize_bank, & count_source_for_ufs - use output, only: write_message, header + use output, only: write_message, header, print_columns use physics, only: transport use source, only: get_source_particle use string, only: to_str @@ -31,17 +31,7 @@ contains allocate(p) ! Display column titles - if (entropy_on) then - message = " Batch k(batch) Entropy Average k" - call write_message(1) - message = " ===== ======== ======= ===================" - call write_message(1) - else - message = " Batch k(batch) Average k" - call write_message(1) - message = " ===== ======== ===================" - call write_message(1) - end if + call print_columns() ! ========================================================================== ! LOOP OVER BATCHES diff --git a/src/output.F90 b/src/output.F90 index 3ff924e6e6..389e7ca783 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -933,6 +933,27 @@ contains end subroutine print_summary +!=============================================================================== +! PRINT_COLUMNS displays a header listing what physical values will displayed +! below them +!=============================================================================== + + subroutine print_columns() + + if (entropy_on) then + message = " Batch k(batch) Entropy Average k" + call write_message(1) + message = " ===== ======== ======= ===================" + call write_message(1) + else + message = " Batch k(batch) Average k" + call write_message(1) + message = " ===== ======== ===================" + call write_message(1) + end if + + end subroutine print_columns + !=============================================================================== ! PRINT_BATCH_KEFF displays the last batch's tallied value of the neutron ! multiplication factor as well as the average value if we're in active batches