Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various suggestions #42

Open
Beliavsky opened this issue Apr 8, 2024 · 1 comment
Open

Various suggestions #42

Beliavsky opened this issue Apr 8, 2024 · 1 comment

Comments

@Beliavsky
Copy link
Contributor

Thanks for the nice tutorial. Here are some suggestions. If you agree with them I could create a pull request.

"Directly after the gfortran command, you find the input file name."

I would use the term "source file" instead, since an input file is typically a file with data that a program reads.

"The main program in Fortran is indicated by the program statement, which is not present in the empty file we gave to gfortran."

I understand what you are trying to convey, but this is not quite correct, since

print*,"hi"
end

is a valid program, with program not appearing anywhere.

Capitalize the "c" in

check the conditions for simple cases, start by setting up quadratic equations with known roots and compare your results against the program.

and change

"there is no reason to limit us to positive values, modify the program such that it also takes negative values and breaks at zero."

to

"There is no reason to limit ourselves to positive values. Modify the program such that it also takes negative values and breaks at zero."

For the program

program array
  implicit none
  intrinsic :: sum, product, maxval, minval
  integer :: vec(3)
  ! get all elements from standard input
  read(*, *) vec
  ! produce some results
  write(*, *) "Sum of all elements", sum(vec)
  write(*, *) "Product of all elemnts", product(vec)
  write(*, *) "Maximal/minimal value", maxval(vec), minval(vec)
end program array

I suggest adding the line

write(*,*) "Positions of maximal/minimal values", maxloc(vec), minloc(vec)

Break "The sum and product can also work on only one of the two dimensions, try to use them only for the rows or columns of the matrix" into 2 sentences as

"The sum and product can also work on only one of the two dimensions. Try to use them only for the rows or columns of the matrix."

I suggest rewording

"Functions of this kind are called subroutines"

as

"Procedures of this kind are called subroutines."

@marvinfriede
Copy link
Member

I agree with all suggestions. We would gladly accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants