Skip to content

Commit f3706ea

Browse files
authored
Output format changed
The output format has now more details on the plasma behaviour in the solutions to the hot-plasma dispersion relation. This includes fluctuations in the pressure now.
1 parent ca34505 commit f3706ea

4 files changed

Lines changed: 244 additions & 28 deletions

File tree

missing

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
#! /bin/sh
2+
# Common wrapper for a few potentially missing GNU programs.
3+
4+
scriptversion=2018-03-07.03; # UTC
5+
6+
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
7+
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
8+
9+
# This program is free software; you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation; either version 2, or (at your option)
12+
# any later version.
13+
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
21+
22+
# As a special exception to the GNU General Public License, if you
23+
# distribute this file as part of a program that contains a
24+
# configuration script generated by Autoconf, you may include it under
25+
# the same distribution terms that you use for the rest of that program.
26+
27+
if test $# -eq 0; then
28+
echo 1>&2 "Try '$0 --help' for more information"
29+
exit 1
30+
fi
31+
32+
case $1 in
33+
34+
--is-lightweight)
35+
# Used by our autoconf macros to check whether the available missing
36+
# script is modern enough.
37+
exit 0
38+
;;
39+
40+
--run)
41+
# Back-compat with the calling convention used by older automake.
42+
shift
43+
;;
44+
45+
-h|--h|--he|--hel|--help)
46+
echo "\
47+
$0 [OPTION]... PROGRAM [ARGUMENT]...
48+
49+
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
50+
to PROGRAM being missing or too old.
51+
52+
Options:
53+
-h, --help display this help and exit
54+
-v, --version output version information and exit
55+
56+
Supported PROGRAM values:
57+
aclocal autoconf autoheader autom4te automake makeinfo
58+
bison yacc flex lex help2man
59+
60+
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
61+
'g' are ignored when checking the name.
62+
63+
Send bug reports to <bug-automake@gnu.org>."
64+
exit $?
65+
;;
66+
67+
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
68+
echo "missing $scriptversion (GNU Automake)"
69+
exit $?
70+
;;
71+
72+
-*)
73+
echo 1>&2 "$0: unknown '$1' option"
74+
echo 1>&2 "Try '$0 --help' for more information"
75+
exit 1
76+
;;
77+
78+
esac
79+
80+
# Run the given program, remember its exit status.
81+
"$@"; st=$?
82+
83+
# If it succeeded, we are done.
84+
test $st -eq 0 && exit 0
85+
86+
# Also exit now if we it failed (or wasn't found), and '--version' was
87+
# passed; such an option is passed most likely to detect whether the
88+
# program is present and works.
89+
case $2 in --version|--help) exit $st;; esac
90+
91+
# Exit code 63 means version mismatch. This often happens when the user
92+
# tries to use an ancient version of a tool on a file that requires a
93+
# minimum version.
94+
if test $st -eq 63; then
95+
msg="probably too old"
96+
elif test $st -eq 127; then
97+
# Program was missing.
98+
msg="missing on your system"
99+
else
100+
# Program was found and executed, but failed. Give up.
101+
exit $st
102+
fi
103+
104+
perl_URL=https://www.perl.org/
105+
flex_URL=https://github.com/westes/flex
106+
gnu_software_URL=https://www.gnu.org/software
107+
108+
program_details ()
109+
{
110+
case $1 in
111+
aclocal|automake)
112+
echo "The '$1' program is part of the GNU Automake package:"
113+
echo "<$gnu_software_URL/automake>"
114+
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
115+
echo "<$gnu_software_URL/autoconf>"
116+
echo "<$gnu_software_URL/m4/>"
117+
echo "<$perl_URL>"
118+
;;
119+
autoconf|autom4te|autoheader)
120+
echo "The '$1' program is part of the GNU Autoconf package:"
121+
echo "<$gnu_software_URL/autoconf/>"
122+
echo "It also requires GNU m4 and Perl in order to run:"
123+
echo "<$gnu_software_URL/m4/>"
124+
echo "<$perl_URL>"
125+
;;
126+
esac
127+
}
128+
129+
give_advice ()
130+
{
131+
# Normalize program name to check for.
132+
normalized_program=`echo "$1" | sed '
133+
s/^gnu-//; t
134+
s/^gnu//; t
135+
s/^g//; t'`
136+
137+
printf '%s\n' "'$1' is $msg."
138+
139+
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
140+
case $normalized_program in
141+
autoconf*)
142+
echo "You should only need it if you modified 'configure.ac',"
143+
echo "or m4 files included by it."
144+
program_details 'autoconf'
145+
;;
146+
autoheader*)
147+
echo "You should only need it if you modified 'acconfig.h' or"
148+
echo "$configure_deps."
149+
program_details 'autoheader'
150+
;;
151+
automake*)
152+
echo "You should only need it if you modified 'Makefile.am' or"
153+
echo "$configure_deps."
154+
program_details 'automake'
155+
;;
156+
aclocal*)
157+
echo "You should only need it if you modified 'acinclude.m4' or"
158+
echo "$configure_deps."
159+
program_details 'aclocal'
160+
;;
161+
autom4te*)
162+
echo "You might have modified some maintainer files that require"
163+
echo "the 'autom4te' program to be rebuilt."
164+
program_details 'autom4te'
165+
;;
166+
bison*|yacc*)
167+
echo "You should only need it if you modified a '.y' file."
168+
echo "You may want to install the GNU Bison package:"
169+
echo "<$gnu_software_URL/bison/>"
170+
;;
171+
lex*|flex*)
172+
echo "You should only need it if you modified a '.l' file."
173+
echo "You may want to install the Fast Lexical Analyzer package:"
174+
echo "<$flex_URL>"
175+
;;
176+
help2man*)
177+
echo "You should only need it if you modified a dependency" \
178+
"of a man page."
179+
echo "You may want to install the GNU Help2man package:"
180+
echo "<$gnu_software_URL/help2man/>"
181+
;;
182+
makeinfo*)
183+
echo "You should only need it if you modified a '.texi' file, or"
184+
echo "any other file indirectly affecting the aspect of the manual."
185+
echo "You might want to install the Texinfo package:"
186+
echo "<$gnu_software_URL/texinfo/>"
187+
echo "The spurious makeinfo call might also be the consequence of"
188+
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
189+
echo "want to install GNU make:"
190+
echo "<$gnu_software_URL/make/>"
191+
;;
192+
*)
193+
echo "You might have modified some files without having the proper"
194+
echo "tools for further handling them. Check the 'README' file, it"
195+
echo "often tells you about the needed prerequisites for installing"
196+
echo "this package. You may also peek at any GNU archive site, in"
197+
echo "case some other package contains this missing '$1' program."
198+
;;
199+
esac
200+
}
201+
202+
give_advice "$1" | sed -e '1s/^/WARNING: /' \
203+
-e '2,$s/^/ /' >&2
204+
205+
# Propagate the correct exit status (expected to be 127 for a program
206+
# not found, 63 for a program that failed due to version mismatch).
207+
exit $st
208+
209+
# Local variables:
210+
# eval: (add-hook 'before-save-hook 'time-stamp)
211+
# time-stamp-start: "scriptversion="
212+
# time-stamp-format: "%:y-%02m-%02d.%02H"
213+
# time-stamp-time-zone: "UTC0"
214+
# time-stamp-end: "; # UTC"
215+
# End:

src/NHDS.f90

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ program NHDS
8989

9090
if (output_mom) then
9191
open(unit=11,file='output_'//trim(filename)//'_plasma.dat',status='replace',action='write')
92-
write (11,*) '# kk, theta, j, Re(dn), Im(dn), Re(dUperpx), Im(dUperpx), Re(dUperpy), Im(dUperpy), Re(dUpar), Im(dUpar)'
92+
write (11,*) '# kk, theta, j, Re(dn), Im(dn), Re(dUperpx), Im(dUperpx), Re(dUperpy), Im(dUperpy), Re(dUpar), &
93+
Im(dUpar), Re(dpper), Im(dpperp), Re(dppar), Im(dppar)'
9394
endif
9495
if (output_EB) then
9596
open(unit=12,file='output_'//trim(filename)//'_EB.dat',status='replace',action='write')
@@ -122,8 +123,8 @@ subroutine compute(kk,theta,x,outputm,outputeb)
122123
double precision, intent(in) :: kk, theta
123124
double complex, intent(inout) :: x
124125
logical, intent(in) :: outputm, outputeb
125-
double complex :: pol,polz,xi,deltaRj, Ek(3), Bk(3)
126-
double complex :: dUperpx,dUperpy,dUpar, Avec(3)
126+
double complex :: pol,polz,xi,Ek(3), Bk(3)
127+
double complex :: dUperpx,dUperpy,dUpar,dpperp,dppar,Avec(3)
127128
double precision :: kperp,kz,energy,gamma_contribution(10)
128129
real :: quality
129130
integer :: j
@@ -140,11 +141,12 @@ subroutine compute(kk,theta,x,outputm,outputeb)
140141
do j=1,numspec
141142
call calc_xi(xi,j,pol,polz,x,kz,kperp)
142143
! second parameter is index of species
143-
call calc_fluctRj(deltaRj,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
144+
call calc_fluctRj(dpperp,dppar,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
144145
! fifth parameter is index of species
145-
write(11,'(2F14.5,I3,8F14.5)') kk, theta, j, real(xi), aimag(xi), real(dUperpx), &
146+
write(11,'(2F10.5,I3,12F14.5)') kk, theta, j, real(xi), aimag(xi), real(dUperpx), &
146147
aimag(dUperpx), real(dUperpy), aimag(dUperpy), &
147-
real(dUpar), aimag(dUpar)
148+
real(dUpar), aimag(dUpar), real(dpperp), aimag(dpperp), &
149+
real(dppar), aimag(dppar)
148150
enddo
149151
endif
150152

@@ -176,16 +178,16 @@ subroutine compute(kk,theta,x,outputm,outputeb)
176178
Bk(2)=(kz*Ek(1)-kperp*Ek(3))/(x*vAc)
177179
Bk(3)=kperp*Ek(2)/(x*vAc)
178180

179-
write(12,'(14E14.5)') kk, theta, real(Ek(1)), aimag(Ek(1)), real(Ek(2))&
181+
write(12,'(2F10.5,12E14.5)') kk, theta, real(Ek(1)), aimag(Ek(1)), real(Ek(2))&
180182
,aimag(Ek(2)), real(Ek(3)), aimag(Ek(3)), real(Bk(1))&
181183
,aimag(Bk(1)), real(Bk(2)), aimag(Bk(2)), real(Bk(3))&
182184
,aimag(Bk(3))
183185
endif
184186

185187
! write (*, '(10F9.5)') kk(i),theta(j),real(x),aimag(x),real(pol),aimag(pol),&
186188
! real(polz),aimag(polz),energy,quality
187-
write (*, '(3F10.5,3E14.5)' ) kk, theta, real(x), aimag(x), quality
188-
write (10,'(3F10.5,7E14.5)') kk, theta, real(x), aimag(x), real(pol*uniti), aimag(pol*uniti),&
189+
write (*, '(2F10.5,3E14.5)' ) kk, theta, real(x), aimag(x), quality
190+
write (10,'(2F10.5,8E14.5)') kk, theta, real(x), aimag(x), real(pol*uniti), aimag(pol*uniti),&
189191
real(polz), aimag(polz), energy, quality
190192

191193

src/NHDS_with_hdf5.f90

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ program NHDS
8989

9090
if (output_mom) then
9191
open(unit=11,file='output_'//trim(filename)//'_plasma.dat',status='replace',action='write')
92-
write (11,*) '# kk, theta, j, Re(dn), Im(dn), Re(dUperpx), Im(dUperpx), Re(dUperpy), Im(dUperpy), Re(dUpar), Im(dUpar)'
92+
write (11,*) '# kk, theta, j, Re(dn), Im(dn), Re(dUperpx), Im(dUperpx), Re(dUperpy), Im(dUperpy), Re(dUpar), &
93+
Im(dUpar), Re(dpper), Im(dpperp), Re(dppar), Im(dppar)'
9394
endif
9495
if (output_EB) then
9596
open(unit=12,file='output_'//trim(filename)//'_EB.dat',status='replace',action='write')
@@ -122,8 +123,8 @@ subroutine compute(kk,theta,x,outputm,outputeb)
122123
double precision, intent(in) :: kk, theta
123124
double complex, intent(inout) :: x
124125
logical, intent(in) :: outputm, outputeb
125-
double complex :: pol,polz,xi,deltaRj, Ek(3), Bk(3)
126-
double complex :: dUperpx,dUperpy,dUpar, Avec(3)
126+
double complex :: pol,polz,xi,Ek(3), Bk(3)
127+
double complex :: dUperpx,dUperpy,dUpar,dpperp,dppar,Avec(3)
127128
double precision :: kperp,kz,energy,gamma_contribution(10)
128129
real :: quality
129130
integer :: j
@@ -140,11 +141,12 @@ subroutine compute(kk,theta,x,outputm,outputeb)
140141
do j=1,numspec
141142
call calc_xi(xi,j,pol,polz,x,kz,kperp)
142143
! second parameter is index of species
143-
call calc_fluctRj(deltaRj,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
144+
call calc_fluctRj(dpperp,dppar,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
144145
! fifth parameter is index of species
145-
write(11,'(2F14.5,I3,8F14.5)') kk, theta, j, real(xi), aimag(xi), real(dUperpx), &
146+
write(11,'(2F10.5,I3,12F14.5)') kk, theta, j, real(xi), aimag(xi), real(dUperpx), &
146147
aimag(dUperpx), real(dUperpy), aimag(dUperpy), &
147-
real(dUpar), aimag(dUpar)
148+
real(dUpar), aimag(dUpar), real(dpperp), aimag(dpperp), &
149+
real(dppar), aimag(dppar)
148150
enddo
149151
endif
150152

@@ -176,19 +178,19 @@ subroutine compute(kk,theta,x,outputm,outputeb)
176178
Bk(2)=(kz*Ek(1)-kperp*Ek(3))/(x*vAc)
177179
Bk(3)=kperp*Ek(2)/(x*vAc)
178180

179-
write(12,'(14E14.5)') kk, theta, real(Ek(1)), aimag(Ek(1)), real(Ek(2))&
181+
write(12,'(2F10.5,12E14.5)') kk, theta, real(Ek(1)), aimag(Ek(1)), real(Ek(2))&
180182
,aimag(Ek(2)), real(Ek(3)), aimag(Ek(3)), real(Bk(1))&
181183
,aimag(Bk(1)), real(Bk(2)), aimag(Bk(2)), real(Bk(3))&
182184
,aimag(Bk(3))
183185
endif
184186

185187
! write (*, '(10F9.5)') kk(i),theta(j),real(x),aimag(x),real(pol),aimag(pol),&
186188
! real(polz),aimag(polz),energy,quality
187-
write (*, '(3F10.5,3E14.5)' ) kk, theta, real(x), aimag(x), quality
188-
write (10,'(3F10.5,7E14.5)') kk, theta, real(x), aimag(x), real(pol*uniti), aimag(pol*uniti),&
189+
write (*, '(2F10.5,3E14.5)' ) kk, theta, real(x), aimag(x), quality
190+
write (10,'(2F10.5,8E14.5)') kk, theta, real(x), aimag(x), real(pol*uniti), aimag(pol*uniti),&
189191
real(polz), aimag(polz), energy, quality
190192

191-
if (output_df) call write_delta_f(species_df,kk,theta,x,pol,polz) ! first parameter is index of species
193+
if (output_df) call write_delta_f(species_df,kk,theta,x,pol,polz) ! first parameter is index of species
192194

193195

194196
end subroutine compute

src/calc_xi.f90

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ subroutine calc_xi(xi,j,pol,polz,x,kz,kperp)
6868

6969

7070

71-
subroutine calc_fluctRj(deltaRj,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
71+
subroutine calc_fluctRj(dpperp,dppar,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
7272
use input_params
7373
implicit none
7474
double precision :: kz,kperp,z,besselI,BInz,dBInzdz,d2BInzdz2
75-
double complex :: x,pol,polz,Avec(3),dispfunct,zeta,deltaRj,chi(3,3)
75+
double complex :: x,pol,polz,Avec(3),dispfunct,zeta,chi(3,3)
7676
double complex :: Z0,Z1,Z2,Z3,dpperp,dppar,Exterm,Eyterm,Ezterm,dUpar
7777
double complex :: dUperpx,dUperpy,Ubar
7878
logical :: kpos,Bessel_run
@@ -146,8 +146,8 @@ subroutine calc_fluctRj(deltaRj,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
146146
endif
147147

148148

149-
! dpperp is deltapperp^2 / ampl in units of the magnetic background pressure
150-
! dppar is deltappar^2 / ampl in units of the magnetic background pressure.
149+
! dpperp is deltapperp in units of the magnetic background pressure
150+
! dppar is deltappar in units of the magnetic background pressure.
151151

152152
dpperp=0.d0
153153
dppar=0.d0
@@ -215,11 +215,8 @@ subroutine calc_fluctRj(deltaRj,dUperpx,dUperpy,dUpar,j,pol,polz,x,kz,kperp)
215215
enddo
216216

217217

218-
dpperp=-2.d0*uniti*mass(j)*density(j)*Omega(j)*dpperp*exp(-z)/(kz*vtherm(j))
219-
dppar=-4.d0*uniti*mass(j)*density(j)*Omega(j)*dppar*exp(-z)/(kz*vtherm(j))
218+
dpperp=-2.d0*uniti*ampl*mass(j)*density(j)*Omega(j)*dpperp*exp(-z)/(kz*vtherm(j))
219+
dppar=-4.d0*uniti*ampl*mass(j)*density(j)*Omega(j)*dppar*exp(-z)/(kz*vtherm(j))
220220

221221

222-
deltaRj = (vtherm(j)*vtherm(j)*alpha(j)+ampl*dpperp/(density(j)*mass(j)))
223-
deltaRj = deltaRj /(vtherm(j)*vtherm(j)+ampl*dppar/(density(j)*mass(j)))
224-
225222
end subroutine

0 commit comments

Comments
 (0)