Fortran

 

The parameters contained within the FORTRAN section are used for the control of compiler based error and warning messages.  Also, any additional source files, required for the compilation of the project, are indicated here as well.

Runtime Debugging

The input parameters involved here are outlined below.

 

Enable Addition of Runtime Debugging Information

This option will add some additional information to the build, so as to allow for the effective use of a Fortran debugger.  If you have selected this option, you should also select all of the checks available in the Checks section (see below).

 

When a program crashes on a PC, the operating system brings up a dialog asking if you would like to debug the case.  If you select Yes and if you had this option selected, the FORTRAN debugger can load the source file and point to the line of code that is causing the crash.

Checks

The input parameters involved here are outlined below.

 

Array & String Bounds

With this option selected, the program will stop if you are accessing an invalid array index.  For example, if the array X is declared to be of dimension 10, and you have a line of source code that has X(J).  If J ever goes greater than 10, the program will stop with a proper message.  If this option is de-selected, the program will continue execution and eventually may crash, adding difficulty to tracing the cause.

 

This option should be used when testing your new models.  It will slow down the simulation and the speed penalty will vary from machine to machine – you can disable this option if speed is a concern.  Please read your FORTRAN compiler documentation you are using for more details.

Floating Point Underflow

This option is useful for debugging but has a speed penalty that is again architecture dependent.  Please read your Fortran compiler documentation for more details.

Integer Overflow

This option is useful for debugging but has a speed penalty that is again architecture dependent.  Please read your Fortran compiler documentation for more details.

Argument Mismatch

The Fortran compiler issues a warning if the argument type (REAL, INTEGER, etc.) of the CALL statement does not match with the subroutine statement (this is applicable to functions as well).

 

Do not ignore this warning as it may have the potential to create unpredictable and hard to trace results.

Uncalled Routines

The Fortran compiler issues a warning if a routine is not called in the program.

Uninitialized Variables

A warning is issued if a variable is used before it is assigned a value.  Normally, the cause of this is a typographical mistake in the source code.

Preprocessor

This option provides the ability to enable/disable the Fortran preprocessor. Disabled by default, this option is supported on both the Intel and GFortran compilers. An additional text field is also provided to allow the user to define a comma-separated list of preprocessor identifiers.

 

Additional Source files (*.f, *.for, *.f90, *.c, *.cpp)

This input field allows you to link one or more external source code files, so as to be included during compilation of the associated project.  An external source code file could contain one or more subroutines, which must be called from within the FORTRAN segment of the component that uses it.

 

Files may be referenced in this field either by an absolute, or relative path specification.  For example, a file referenced with an absolute path may appear as follows:

 

 

If only the filename is entered, PSCAD will assume that the source file is located in the same directory as the project file itself, and will append this path to the filename.  You may also use standard directory navigational features when working with relative paths.  For example, if a source file called test.f is located in the directory directly above the project file, then the file entry would appear as follows:

 

 

When entering multiple source files, each entry must be separated either by a blank space, a comma or a semicolon:

 

Wildcard Character

The wildcard character (i.e. *) is also supported. For example, entering the following:

 

 

Will ensure all *.f files in the folder temp, will be included in the project build and make.

Supported File Types

This input field will only accept the following source file types: