program freq ! This program reads in the apparent frequency calculated by GS2, and ! corrects it for the finite size time step and the implicitness parameter ! to calculate what the "true" frequency would be in the limit of ! zero time step for this eigenmode. (There may be other eigenmodes that ! are faster growing. GS2 will pick out the mode with the fastest growing ! "apparent" time step for this time step and choice of implicitness ! parameter.) ! ! See the notes in docs/algorithm.txt. ! ! I guess I'd suggest running with something like fexpr=0.4, and check that ! ! delt*|frequency| < 0.4 ! ! this should make the error in the growth rate less than about 3.4% of ! the absolute value of the complex frequency, |frequency|. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Inputs: ! ! delt = time step parameter from gs2 *.in file ! fexpr = implicitness parameter from gs2 *.in file ! omega1 = complex frequency calculated by GS2 ! ! Outputs: ! omega2 = "true" frequency for this eigenmode in the delt->0 limit ! implicit none complex omega1, omega2, ratio, zi real fexpr, delta, delt, delta_t, omega1_re, omega1_im zi=cmplx(0.0,1.0) write(*,*) "delt, fexpr, Real(omega1), Imag(omega1) =" read(*,*) delt, fexpr, omega1_re, omega1_im omega1=cmplx(omega1_re,omega1_im) delta=1-fexpr delta_t=delt/sqrt(2.0) write(*,*) delt, delta, omega1 ratio=exp(-zi*omega1*delta_t) omega2=-zi*(1-ratio)/(1-delta+delta*ratio)/delta_t write(*,*) "omega2 =", omega2 stop end program freq