I have a parameter set that IO want to include with every INCLUDE'd file. Borrowing from 'C', I have coded the parameter file (parameters.ins) to look like this:
#ifndef parameters_already_included
#define parameters_already_included
.
.
integer,parameter::abcd=0
.
.
#endif
At the start of every other included file is:
include 'parameters.ins'
Within the main modules are INCLUDE sequences like this:
include 'abcd.ins'
include 'defg.ins'
Both abcd.ins and defg.ins have the parameter.ins file included. Logically, the parameter.ins file is included when abcd.ins is itself included (the variable parameters_already_included does not exist), then when defg.ins is included, the body of the parameters.ins file will not be compiled because the variable parameters_already_included does now exist.
What appears to be happening is that the condtionals are failing to properly execute, causing each parameter statement to be flagged as an error (duplicate definition).
Anyone else having this as an issue?