CHKSYS - Fortran 90/95 ---------------------- (January 2004, Arjen Markus - arjen dot markus at wldelft dot nl) This collection of programs written in Fortran 90/95 is intended to provide insight in the properties of the language and the capabilities of the compilers. The programs can be divided in two categories: Those that can be compiled and those that should cause error messages from the compiler. In the latter category we have: chkfunc.f90 - "obvious" errors regarding function calls (wrong interfaces etc.) chkname.f90 - mistakes that are related to variables and their scope/name chkarray.f90 - mistakes related to array handling (passing arrays to subroutines without an explicit interface for instance) Unfortunately, not all compilers will find these mistakes. The source code contains a description of the problems and an indication where they are found in the source code (the comment lines that start with !PROBLEM). The programs that do run are: chkformt.f90 - Checks the treatment of floating-point numbers in formats chkstar.f90 - Shows the properties of list-directed input (READ( lu, *)) for a particular OS/compiler - some are compiler-specific! test_genstruct.f90 - Demonstration of a method for storing of various types (via the function TRANSFER()) The last program may require some explanation: Fortran 90/95 does not have a generic data type. So it would seem that storing a real array and a derived type in one general structure is impossible, unless you make a general structure that has "slots" for all types that are to be stored, like: type ALL_DATA_TYPES_STORE integer, dimension(:), pointer :: int_array real, dimension(:), pointer :: real_array type(MYDATA), dimension(:), pointer :: mydata_array ... end type The program test_genstruct.f90 shows that this is not necessary at all. Programs that need still to be written: - Program to check the behaviour with various types of files (notably line-endings and direct access files) - Program that causes runtime errors (such as array bound violations, with the proper compiler flags, these errors must be detected) - Program to check for a possible timestamp in module intermediate files - important to know this for the prevention of the so-called compilation cascade. - Possibly others