For procedures, they are called arguments, not parameters.
You should also include submodules.
For types of variables, they are either intrinsic or derived (not necessarily user defined, as there are some derived types defined in the intrinsic module iso_fortran_env).
You many want to include named constants alongside variables.
The Fortran Standard says nothing about files. I understand include doesn’t make a whole lot of sense without them, and 99+% of the time the source code is in files.
Keep up the good work. This could be quite valuable learning material.
I agree, they are not parameters but rather arguments.
If I understand correctly, a submodule allows you to implement a module? I followed your youtube channel on the circle module (in tdd) to learn modern fortran. I work on fortran code but I don’t use fortran so I only have the basics.
okay I’ll take that into account
I will add them
I didn’t understand, include is no longer supported in modern fortran ? which is understandable with the use of modules.
and thanks again and if you have any other ideas or suggestions, don’t hesitate.
It is the other way around. Modern fortran does support include, but f77 and earlier did not. Many f77 compilers supported include as an extension, but it was not part of the standard language. Include is problematic because, although it is part of the language, the actual file names are dependent on the OS and file system conventions. Specifically, are directories denoted with slashes or colons or backslashes, are the file names folded to upper or lower case, is the filesystem case sensitive or case insensitive, and so on.
A submodule is where you can put (hidden) implementations of procedures declared in a module.
It’s still “supported” (i.e. the statement is still part of the standard), but see the relevant text from the standard
Additional text can be incorporated into the source text of a program unit during processing. This is accomplished with the INCLUDE line, which has the form
INCLUDE char-literal-constant
…
The interpretation of char-literal-constant is processor dependent.
It’s typically interpreted as the name of a file, but as I said, the Fortran standard doesn’t say that Fortran source code is necessarily contained in files.
So if I understand correctly, I don’t need this “include” link, I can delete it (by the way, it can be replaced, and often is in the source I have to process, by the #include directive)
The closest to this idea in f77 is a statement function, which is somewhere in between the concept of a contained procedure and a macro expansion.
Another possibility is a routine with entry points. In this case the entry points can be called from outside the procedure, but they cannot be called from within the procedure. Before modules were introduced in f90, entry points were the only way to share data that is local within the procedure among the entry points.
Entry points were also sometimes used to simply alias two external names to the same procedure code. That is now done typically by renaming the entity within the USE statement.
* can a blockdata contain a body (instructions like accesses )?
No, a block data contains only local variable and parameter declarations and data statements. Block data is required any time common block variables are initialized. Some f77 compilers allowed initialization of common block variables in other places, such as, for example, a main program, but I don’t think that was ever allowed by any fortran standard.