From 3758198258ebd9790ee1de9f28dedeab578edc06 Mon Sep 17 00:00:00 2001 From: Caoxiang Zhu Date: Wed, 18 May 2022 20:40:13 +0800 Subject: [PATCH] move call perturbation to solvers.f90 --- sources/focus.f90 | 10 +--------- sources/solvers.f90 | 3 +++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sources/focus.f90 b/sources/focus.f90 index 13c7fbc..609b545 100644 --- a/sources/focus.f90 +++ b/sources/focus.f90 @@ -37,7 +37,7 @@ PROGRAM focus use globals, only: dp, ncpu, myid, ounit, ierr, astat, eunit, case_surface, case_coils, case_optimize, & case_postproc, xdof, time_initialize, time_optimize, time_postproc, & - version, Npert, weight_sbnorm, MPI_COMM_FOCUS, plasma_surf_boozer + version, MPI_COMM_FOCUS, plasma_surf_boozer use mpi !to enable gfortran mpi_wtime bugs; 07/20/2017 implicit none @@ -75,14 +75,6 @@ PROGRAM focus call MPI_BARRIER( MPI_COMM_FOCUS, ierr ) - ! Call stochastic construction if neccessary - if ( weight_sbnorm .gt. 0.0 .or. Npert .gt. 0 ) then - if(myid==0) write(ounit, '(8X,": weight_sbnorm = ", ES12.5, "; Npert = ", I10)') weight_sbnorm, Npert - call perturbation(0) - endif - - call MPI_BARRIER( MPI_COMM_FOCUS, ierr ) - tfinish = MPI_Wtime() time_initialize = tfinish - tstart if( myid == 0 ) write(ounit, '(A, ES12.5, A3)') "focus : Initialization took ", time_initialize," S." diff --git a/sources/solvers.f90 b/sources/solvers.f90 index b33e638..b996016 100644 --- a/sources/solvers.f90 +++ b/sources/solvers.f90 @@ -108,6 +108,9 @@ subroutine solvers endif endif + ! Call stochastic construction if neccessary + if ( weight_sbnorm .gt. 0.0 .or. Npert .gt. 0 ) call perturbation(0) + if (abs(case_optimize) >= 1) call AllocData(1) if (abs(case_optimize) >= 2) call AllocData(2)