![]() So your example (with some corrections) would look like: PROGRAM Diffraction The final part is the CONTAINS part, where your functions and subroutines are placed, which can use every variable, which is defined in the program (but this would be bad praxis.). ![]() (The first line in your example.)Īfter this, the main part is following, where you execute your code. The next part is the variable definition part, where your variables are defined. Otherwise, every variable starting with I to N would be of type INTEGER and every other variable would be of type REAL. This means, that no variables have a predefined type. ![]() After this, it is good practice to write IMPLICIT NONE. Your program should start with PROGRAM followed by your used modules. So your "floating" definitions are a bit odd. Among the better-known is BASIC, which is based on FORTRAN II with a number of syntax cleanups, notably better logical structures, and other changes to work more easily in an interactive environment. Generally speaking, it is a good idea to put all definitions in the main program or a module. Fortran's design was the basis for many other programming languages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |