diff --git a/cgyro/src/cgyro_init_kernel.F90 b/cgyro/src/cgyro_init_kernel.F90 index 5bc3c17c1..23e4469a7 100644 --- a/cgyro/src/cgyro_init_kernel.F90 +++ b/cgyro/src/cgyro_init_kernel.F90 @@ -74,7 +74,8 @@ subroutine cgyro_init_kernel if (error_status > 0) then ! something went terribly wrong, hard abort, as things may be ! in weird state - call abort + call cgyro_final_kernel + return endif if (test_flag == 1) return diff --git a/cgyro/src/cgyro_timer_lib.f90 b/cgyro/src/cgyro_timer_lib.f90 index edcbf1ca2..0c954ad56 100644 --- a/cgyro/src/cgyro_timer_lib.f90 +++ b/cgyro/src/cgyro_timer_lib.f90 @@ -82,7 +82,7 @@ real function timer_lib_time(tag) implicit none character(len=*), intent(in) :: tag integer :: indx - + timer_lib_time = 0.0 do indx=1,timer_cpu_maxindx if (trim(tag) == trim(timer_cpu_tag(indx))) then timer_lib_time = timer_cpu(indx) diff --git a/cgyro/src/cgyro_write_initdata.f90 b/cgyro/src/cgyro_write_initdata.f90 index cab06fbc2..9a51871a3 100644 --- a/cgyro/src/cgyro_write_initdata.f90 +++ b/cgyro/src/cgyro_write_initdata.f90 @@ -23,7 +23,6 @@ subroutine cgyro_write_initdata ! NOTE: Some of this data is reproduced in other data files. ! if (silent_flag == 0 .and. i_proc == 0) then - open(unit=io,file=trim(path)//runfile_info,status='old',position='append') write(io,*) @@ -41,12 +40,6 @@ subroutine cgyro_write_initdata endif write(io,*) - if (kymax < -99.9) then - lfmt = '(a,i4,2x,2(f7.2,2x),2x,f6.2,5x,i4,2a)' - else - lfmt = '(a,i4,2x,2(f7.3,2x),2x,f6.2,5x,i4,2a)' - endif - if (zf_test_mode == 0) then ! Compute kymax @@ -56,8 +49,13 @@ subroutine cgyro_write_initdata kymax = q/rmin*(n_toroidal-1)*rho endif - if (nonlinear_flag == 0) then + if (kymax < -99.9) then + lfmt = '(a,i4,2x,2(f7.2,2x),2x,f9.2,5x,i4,2a)' + else + lfmt = '(a,i4,2x,2(f7.3,2x),2x,f9.2,5x,i4,2a)' + endif + if (nonlinear_flag == 0) then write(io,*) ' n Delta Max L/rho' write(io,lfmt) ' kx*rho:',& n_radial,2*pi*rho/length,2*pi*rho*(n_radial/2-1)/length,length/rho diff --git a/shared/math/half_hermite.f90 b/shared/math/half_hermite.f90 index 8369b809b..1ec3e6c9a 100644 --- a/shared/math/half_hermite.f90 +++ b/shared/math/half_hermite.f90 @@ -163,6 +163,8 @@ subroutine half_hermite_norm(n,xmin,xmax,sign,alpha,a1,b1,c1,a,bsq,logg,verbos& tanhb(x)=2*x/(1+x) tanhp1(x)=tanhb(exp(2*x)) ! tanh(x)+1 for x<0 approx. 2*exp(2*x) for x<<-1 tanhm1(x)=-tanhb(exp(-2*x)) ! tanh(x)-1 for x>0 + leftnew=0 + rightnew=0 if (n==0) return nn=n