Today’s learning can be split mainly into the following two sections.
I/O Formatting
The formatting string in fortran is passed as a string to print or write statements.
|
|
The following formats are available
i<w>.<d>
- Integersf<w>.<d>
- floating pointe<w>.<d>e<d2>
,en
,es
- edit descriptor (engineering and scientific notation)a<d>
- stringl<d>
- logicalg<d>
- general
All these can be preceeded by a number to denote how many of that type is present. I believe more info regarding the same can be found here - https://masuday.github.io/fortran_tutorial/format.html
Implicit Save:
In fortran, declaring a variable in the following way
|
|
is equivalent to doing the following
|
|
Hence, the last value of the f variable is remembered for the next function call. This will lead to unexpected bugs. Hence, the following procedure process is necessary while declaring and assigning any variable.
|
|