From 1d4a9351f0711e6a31d97475156ef23321c33563 Mon Sep 17 00:00:00 2001 From: Bhavin Patel <15210802+bpatel2107@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:52:54 +0100 Subject: [PATCH] Add flag to turn on calculation --- cgyro/bin/cgyro_parse.py | 1 + cgyro/src/cgyro_flux.f90 | 2 +- cgyro/src/cgyro_globals.F90 | 2 +- cgyro/src/cgyro_init_manager.F90 | 2 +- cgyro/src/cgyro_read_input.f90 | 1 + cgyro/src/cgyro_write_timedata.f90 | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cgyro/bin/cgyro_parse.py b/cgyro/bin/cgyro_parse.py index 221e9016d..95c5716fd 100644 --- a/cgyro/bin/cgyro_parse.py +++ b/cgyro/bin/cgyro_parse.py @@ -67,6 +67,7 @@ x.add('MOMENT_PRINT_FLAG','0') x.add('GFLUX_PRINT_FLAG','0') x.add('FIELD_PRINT_FLAG','0') +x.add('STRESS_PRINT_FLAG','0') x.add('AMP0','0.0') x.add('AMP','0.1') x.add('GAMMA_E','0.0') diff --git a/cgyro/src/cgyro_flux.f90 b/cgyro/src/cgyro_flux.f90 index 16db72223..4da5f6765 100644 --- a/cgyro/src/cgyro_flux.f90 +++ b/cgyro/src/cgyro_flux.f90 @@ -218,7 +218,7 @@ subroutine cgyro_flux gflux_loc(:,:,:,:,itor) = gflux_loc(:,:,:,:,itor)/rho**2 cflux_loc(:,:,:,itor) = cflux_loc(:,:,:,itor)/rho**2 - if (stress_flag .eq. 1) then + if (stress_print_flag .eq. 1) then stress(:, :, :, :) = 0.0 if (i_time .ne. 0) then diff --git a/cgyro/src/cgyro_globals.F90 b/cgyro/src/cgyro_globals.F90 index e5b8cb205..40639d3c5 100644 --- a/cgyro/src/cgyro_globals.F90 +++ b/cgyro/src/cgyro_globals.F90 @@ -69,7 +69,6 @@ module cgyro_globals integer :: z_eff_method integer :: zf_test_mode integer :: nonlinear_flag - integer :: stress_flag=1 real :: temp_ae real :: dens_ae real :: mass_ae @@ -81,6 +80,7 @@ module cgyro_globals integer :: moment_print_flag integer :: gflux_print_flag integer :: field_print_flag + integer :: stress_print_flag real :: amp0 real :: amp real :: gamma_e diff --git a/cgyro/src/cgyro_init_manager.F90 b/cgyro/src/cgyro_init_manager.F90 index d8736c59e..f7e78631e 100644 --- a/cgyro/src/cgyro_init_manager.F90 +++ b/cgyro/src/cgyro_init_manager.F90 @@ -307,7 +307,7 @@ subroutine cgyro_init_manager #endif endif - if (stress_flag == 1) then + if (stress_print_flag == 1) then allocate(stress(nc,nv_loc,nt1:nt2,n_field)) allocate(stress_integrated_loc(n_radial,n_theta,nt1:nt2,n_field)) allocate(stress_integrated(n_radial,n_theta,nt1:nt2,n_field)) diff --git a/cgyro/src/cgyro_read_input.f90 b/cgyro/src/cgyro_read_input.f90 index c95124f36..858aafc66 100644 --- a/cgyro/src/cgyro_read_input.f90 +++ b/cgyro/src/cgyro_read_input.f90 @@ -70,6 +70,7 @@ subroutine cgyro_read_input call cgyro_readbc_int(moment_print_flag,'MOMENT_PRINT_FLAG') call cgyro_readbc_int(gflux_print_flag,'GFLUX_PRINT_FLAG') call cgyro_readbc_int(field_print_flag,'FIELD_PRINT_FLAG') + call cgyro_readbc_int(stress_print_flag,'STRESS_PRINT_FLAG') call cgyro_readbc_real(amp0) call cgyro_readbc_real(amp) call cgyro_readbc_real(gamma_e) diff --git a/cgyro/src/cgyro_write_timedata.f90 b/cgyro/src/cgyro_write_timedata.f90 index b4b925b70..1183fa30b 100644 --- a/cgyro/src/cgyro_write_timedata.f90 +++ b/cgyro/src/cgyro_write_timedata.f90 @@ -93,7 +93,7 @@ subroutine cgyro_write_timedata field_plot) enddo - if (stress_flag == 1) then + if (stress_print_flag == 1) then do i_field=1,n_field ! Sort out subset of theta values for plotting call cgyro_write_distributed_bcomplex(&