From 4ec7aa32e962aa15496aa75487c7291d0211239b Mon Sep 17 00:00:00 2001 From: Bhavin Patel <15210802+bpatel2107@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:56:25 +0000 Subject: [PATCH] Write only when STRESS_PRINT_FLAG=1 --- cgyro/src/cgyro_flux.f90 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cgyro/src/cgyro_flux.f90 b/cgyro/src/cgyro_flux.f90 index 1bac8f546..80ab8416e 100644 --- a/cgyro/src/cgyro_flux.f90 +++ b/cgyro/src/cgyro_flux.f90 @@ -261,15 +261,17 @@ subroutine cgyro_flux NEW_COMM_1, & i_err) - ! Reduce complex stress(kx, theta), distributed over n - - call MPI_ALLREDUCE(stress_integrated_loc, & - stress_integrated, & - size(stress_integrated), & - MPI_DOUBLE_COMPLEX, & - MPI_SUM, & - NEW_COMM_1, & - i_err) + if (stress_print_flag .eq 1) then + ! Reduce complex stress(kx, theta), distributed over n + + call MPI_ALLREDUCE(stress_integrated_loc, & + stress_integrated, & + size(stress_integrated), & + MPI_DOUBLE_COMPLEX, & + MPI_SUM, & + NEW_COMM_1, & + i_err) + end if ! Reduced real cflux(ky), below, is still distributed over n