Skip to content

Commit

Permalink
Add some missing initialisations found when compiling with debug on
Browse files Browse the repository at this point in the history
  • Loading branch information
bpatel2107 committed Aug 1, 2024
1 parent be62bb1 commit 5aa43d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion cgyro/src/cgyro_init_kernel.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cgyro/src/cgyro_timer_lib.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions cgyro/src/cgyro_write_initdata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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,*)
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions shared/math/half_hermite.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5aa43d1

Please sign in to comment.