Skip to content

Commit 41c0e12

Browse files
committed
Correct intersentence spacing (+ other chktex fixes)
1 parent 1183bd2 commit 41c0e12

9 files changed

Lines changed: 27 additions & 28 deletions

chapters/Coding_style.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ \chapter{Coding style}
5555
The how should be evident from the code itself.
5656
\emph{``Good code is its own best documentation.''} If you follow the other guidelines regarding naming and keeping functions small, you can generally suffice with a small comment at the beginning of every function or subroutine.
5757
\end{itemize}
58-
One final point, not of style, but important nonetheless: start every program and module with \keyword{implicit none}\marginnote{The \texttt{-fimplicit-none}\index{compiler flags!-fimplicit-none} compiler flag will also turn off implicit typing globally.} \index{Fortran!implicit none@\keyword{implicit none}}.
58+
One final point, not of style, but important nonetheless: start every program and module with \keyword{implicit none}\marginnote{The \texttt{-fimplicit-none}\index{compiler flags!-fimplicit-none} compiler flag will also turn off implicit typing globally.}\index{Fortran!implicit none@\keyword{implicit none}}.
5959
This is an unfortunate holdover from older versions of Fortran; it forces you to explicitly declare all variables, instead of allowing Fortran to infer the type from the name.
6060
Forgetting \keyword{implicit none} and making a typo in one of your variable names is a major source of bugs.
6161
\emph{Never ever omit this!}

chapters/Getting_your_toes_wet.tex

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
\Chapter{Getting your toes wet}{with Fortran and Linux}
22
\label{chap:Getting your toes wet}
33
\begin{quote}\small
4-
\emph{``1957: John Backus and IBM create FORTRAN. There's nothing funny about IBM or FORTRAN. It is a syntax error to write FORTRAN while not wearing a blue tie.''} \\ \hspace*{\fill}---James Iry
4+
\emph{``1957: John Backus and IBM create FORTRAN\@. There's nothing funny about IBM or FORTRAN\@. It is a syntax error to write FORTRAN while not wearing a blue tie.''} \\ \hspace*{\fill}---James Iry
55
\end{quote}
66

77
For this course we recommend using the GNU Fortran compiler, as it is free and of reasonably high quality.\footnote{You're welcome to use the Intel Fortran compiler, which is free on Linux, but remember to change the compiler flags, since they differ from \texttt{gfortran}.}
@@ -16,9 +16,9 @@
1616
$ sudo apt-get install gfortran gfortran-doc
1717
\end{lstlisting}
1818
\emph{Note that anything you type in the console is case-sensitive!}
19-
This command grants \texttt{aptitude} privileges to search for and then install the \texttt{gfortran} package and its documentation.
19+
This command grants the package manager (\texttt{aptitude}) privileges to search for and then install the \texttt{gfortran} package and its documentation.
2020
You may also find it useful to install the \LaTeX\ typesetting system for writing reports.
21-
You can install it with another call to \texttt{aptitude}:
21+
You can install it with another call to \texttt{apt-get}:
2222
\begin{lstlisting}[style=prompt, nolol, breaklines=false]
2323
$ sudo apt-get install texlive # or texlive-full for a complete installation
2424
\end{lstlisting}
@@ -29,19 +29,19 @@
2929
\begin{lstlisting}[style=prompt, nolol, linewidth=30cm]
3030
$ ls # display the contents of the current directory
3131
$ ls -l # display contents with extra details
32-
$ cp file path # copy 'file' to 'path'
33-
$ mv file path # move 'file' to 'path'
34-
$ rm file # remove 'file'
35-
$ mkdir dir # create a new directory called 'dir'
36-
$ cd dir # change current directory to 'dir'
37-
$ rmdir dir # remove directory 'dir' (only if it's empty)
38-
$ rm -r dir # remove directory 'dir' (even if it's not empty)
39-
$ man cmd # provide documentation on 'cmd'
32+
$ cp file path # copy `file' to `path'
33+
$ mv file path # move `file' to `path'
34+
$ rm file # remove `file'
35+
$ mkdir dir # create a new directory called `dir'
36+
$ cd dir # change current directory to `dir'
37+
$ rmdir dir # remove directory `dir' (only if it's empty)
38+
$ rm -r dir # remove directory `dir' (even if it's not empty)
39+
$ man cmd # provide documentation on `cmd'
4040
\end{lstlisting}
4141

4242
For your first program, open a terminal, create a directory for ICCP files and open your first Fortran file by typing
43-
\marginnote[-0.5cm]{Modern terminal emulators all have a feature called
44-
\emph{tab completion}\index{Tab completion}; hit the \texttt{TAB} key after you've entered part of a command and the terminal will attempt to fill in the rest of the command for you.}
43+
\marginnote[-0.5cm]{Modern shells all have a feature called
44+
\emph{tab completion}\index{Tab completion}; hit the \texttt{TAB} key after you've entered part of a command and the shell will attempt to fill in the rest of the command for you.}
4545
\begin{lstlisting}[style=prompt, nolol, linewidth=30cm]
4646
$ mkdir iccp # create a new directory called 'iccp'
4747
$ cd iccp # move to the new directory
@@ -62,8 +62,7 @@
6262
For double-precision numbers, use \texttt{d} instead of \texttt{e} in scientific notation, \eg, \texttt{1d-1}.
6363
It is also possible to specify the precision as a suffix: \texttt{1.0\_4} for single and \texttt{1.0\_8} for double precision.
6464
This also works for integers.
65-
\item \texttt{\keyword{integer} :: fibonacci(N)} allocates an array of 20
66-
integers, with the array\index{Fortran!arrays} index\footnote{Array indices can start at any integer by replacing \texttt{N} with a lower and upper bound separated with a colon. Thus, \lstinline$real :: myArray(-312:74)$ means \texttt{myArray} starts at index -312 and runs through index 74.} running from 1 to 20.
65+
\item \texttt{\keyword{integer} :: fibonacci(N)} allocates an array of 20 integers, with the array\index{Fortran!arrays} index\footnote{Array indices can start at any integer by replacing \texttt{N} with a lower and upper bound separated with a colon. Thus, \lstinline$real :: myArray(-312:74)$ means \texttt{myArray} starts at index -312 and runs through index 74.} running from 1 to 20.
6766
\item `\texttt{*}' is multiplication, `\texttt{**}' is exponentiation.
6867
\item The \keyword{print} statement on line 24 contains the format code\index{Fortran!format codes} \str{"(4I6)"}.
6968
This tells Fortran to print 4 records of integer type, each having a width of 6 characters (including spaces), per line.
@@ -116,4 +115,4 @@
116115
Note that \texttt{./} specifies the \emph{path}, \ie, the location where to find the program.
117116
The dot means the current directory (similarly, \texttt{..} refers to the parent directory), and the slash separates directories and file names (like the backslash in DOS and Windows).
118117

119-
\lstinputlisting[float=h!,label=lst:myProg]{examples/myProg.f90}
118+
%\lstinputlisting[float=h!,label=lst:myProg]{examples/myProg.f90}

chapters/Introduction.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ \chapter{Introduction}
1515
We won't force you to use a particular language, but for most of the programs you'll write, dynamic languages such as MATLAB or Python are too slow, while C, \Cplusplus, and Java lack the built-in numerical facilities\footnote{It's called Fortran---short for FORmula TRANslation---for a reason!} (with Java also being slow).
1616
Fortran is over half a century old---it first appeared in 1957---and can be a bit quirky, but for better or worse, it's still the industry standard when it comes to scientific computing.
1717
Besides, modern Fortran---the most recent standard updates appeared in 2003 and 2008---is not nearly the monstrosity it used to be; it's actually a quite pleasant language for computational physics.
18-
Even if you already have some experience with another language, take it from us that both you and your code will be faster if you use Fortran for ICCP.
18+
Even if you already have some experience with another language, take it from us that both you and your code will be faster if you use Fortran for ICCP\@.
1919
If you want to continue in computational physics you'll encounter it sooner or later anyway (think \indexentry{LAPACK}), and ICCP is the perfect time to learn.
2020

2121
These notes are by no means a complete Fortran reference.

chapters/Optimization.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Always make sure your code is correct and readable before you try to make it faster.
1414
And when you do try to make it faster, conventional wisdom says: \emph{don't optimize your code, optimize your algorithms.}
1515
This may seen counter-intuitive; after all, what's wrong with fast code?
16-
However, modern CPUs are complex beasts, and unless you're an expert, it's not at all obvious which expressions result in the fastest code.
16+
However, modern CPUs are complex beasts, and unless you're an expert, it's not at all obvious which expressions will result in the fastest code.
1717
This also means that a lot of tricks that used to be valid ten years ago no longer are.
1818
Let's look at a few examples:
1919
\begin{itemize}
@@ -117,7 +117,7 @@ \section{Scalability; or, the importance of big O}
117117
For this, we recommend the book \emph{Numerical Recipes}\index{Numerical Recipes}\footnote{Available free online at \url{http://apps.nrbook.com/fortran/index.html}}.
118118
It covers a wide range of topics, focuses on best practices, and does not ignore coding effort when comparing algorithms.
119119
It even includes the full source code of the implementations! We recommend
120-
always using it as your starting point, with one exception: \nameref{chap:linear algebra}.
120+
always using it as your starting point, with one exception: \nameref{chap:Linear algebra}.
121121

122122
We conclude this section with an overview of the computational complexity of certain common operations.
123123
This will give you an idea of the most likely bottleneck in your code.

chapters/Parallel_computing.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
end do
3232
!$omp end parallel do
3333
\end{lstlisting}
34-
will execute the loop in parallel. Use Google for more information on how to use OpenMP.
34+
will execute the loop in parallel. Use Google for more information on how to use OpenMP\@.
3535
\item\textbf{Don't use more threads than you have physical cores.} This may seem like stating the obvious, but it actually happens rather often.
3636
Most modern Intel processors implement hyper-threading.
3737
This doubles the apparent number of cores, which helps with task switching when you're running many different programs at once.

chapters/Random_numbers.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ \chapter{A short word on random numbers}
99
When generating random numbers, you'll want to take care in the methods you use; some RNGs are most definitely better than others.
1010
You can always code your own, but Fortran has a few reasonably good subroutines to do it for you.
1111
The default \texttt{gfortran} installation provides access to a low-level \texttt{\keyword{rand}()} function, but you'll almost certainly want to use the more sophisticated \keyword{random\_number} subroutine instead; it generates much higher quality random numbers and automatically threads over (fills) arrays.
12-
When you've ironed out your algorithm and want to start collecting data, you should also remember to seed the RNG.
12+
When you've ironed out your algorithm and want to start collecting data, you should also remember to seed the RNG\@.
1313
Computers generate random numbers by way of a procedural mathematical formula, so using the same seed produces the same series of random values.
14-
The subroutine in \cref{lst:init_random_seed} will seed the RNG with entropy collected by the system if it's available, otherwise it will use the current time \& process ID.
14+
The subroutine in \cref{lst:init_random_seed} will seed the RNG with entropy collected by the system if it's available, otherwise it will use the current time \& process ID\@.
1515
\lstinputlisting[float=htbp,label=lst:init_random_seed]{examples/init_random_seed.f90}
1616

1717
The Fortran random number generator produces uniformly distributed reals on the interval\footnote{Be careful with operations that might fail with \texttt{0.0d0}.} $\left[0, 1\right)$, but simulations often require numbers drawn from a different distribution.

chapters/Revision_control.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ \chapter{Revision control}
22
\label{chap:Revision control}
33

44
\begin{quote}
5-
\emph{``And then there's \texttt{git rebase --interactive}, which is a bit like \texttt{git commit --amend} hopped up on acid and holding a chainsaw---completely insane and quite dangerous but capable of exposing entirely new states of mind."} \\ \hspace*{\fill}---Ryan Tomayko
5+
\emph{``And then there's \texttt{git rebase --interactive}, which is a bit like \texttt{git commit --amend} hopped up on acid and holding a chainsaw---completely insane and quite dangerous but capable of exposing entirely new states of mind.''} \\ \hspace*{\fill}---Ryan Tomayko
66
\end{quote}
77

88
A revision control system is perhaps the third most useful tool to a programmer after only the editor and compiler.
@@ -64,7 +64,7 @@ \chapter{Revision control}
6464
\hspace*{\fill}---Randall Munroe (\href{https://xkcd.com/1296/}{XKCD})
6565
\end{marginfigure}
6666
\item \textbf{Commit the bare minimum}. Only commit what's needed to recompile a functional program.
67-
Git just tracks the differences in files between commits to save space, but executables, output data, PDFs, images, etc. all require a totally new copy in the history every time they change (and that's frequently!)
67+
Git just tracks the differences in files between commits to save space, but executables, output data, PDFs, images, \etc\ all require a totally new copy in the history every time they change (and that's frequently!)
6868
Tracking a \texttt{.gitignore} file with some simple patterns can automatically ignore files of a similar type.
6969
\item \textbf{Learn the advanced Git features}. Basic commits barely scratch the surface of Git's functionality.
7070
Branching lets you test drive changes in a copy of your code in an easily-reset sandbox, the network features let you not only backup code but also collaborate with other developers, and \texttt{git-bisect} can help you \emph{automatically} pinpoint exactly where and when a bug crept in.

chapters/The_magic_of_makefiles.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ \chapter{The magic of Makefiles}
3636
\item Makefiles are built around rules, which have the form `\texttt{\emph{target}: \emph{dependencies}}' followed by lines with rules to create the target from the dependencies\footnote{You \emph{must} indent lines containing rules with a tab character, not spaces! \Cref{lst:example_makefile} represents tabs with a wide underscore for easy identification.}.
3737
Except for a few special targets, such as \texttt{all} and \texttt{clean}, \texttt{make} will assume the target is a file, and try to recreate it if the target is older than the dependencies.
3838
\item If \texttt{make} is invoked without any parameters, the default target is the first entry in the \texttt{Makefile} (in this case \texttt{all}), which depends on \texttt{myprog} here.
39-
\texttt{myprog} in turn depends on the list of object files in \texttt{\$(OBJS}).
39+
\texttt{myprog} in turn depends on the list of object files in \texttt{\$(OBJS)}.
4040
This is the reason we only specified the object files and not the source code files.
4141
The executable is generated by invoking the linker, which combines the object files with the external libraries.
4242
In the \texttt{Makefile}, \texttt{\$@} is an alias for the target.

coding_notes.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102

103103
\pagestyle{empty}
104104

105-
\newpage
106-
\null
105+
\newpage\
106+
\null\
107107
\vfill
108108
\begin{center}
109109
\includegraphics[width=0.15\textwidth]{figures/by-nc-sa.eps}

0 commit comments

Comments
 (0)