Closed hiker closed 7 months ago
As discussed in the telco, this is considered useful. It will be implemented using an optional flag to enable this. And it is expected to be handled in the reader - detect the sentinels and remove them. We just need to take care not to remove !$
for real openmp statements. According to the standard, an OpenMP directive may not have a whitespace between !$
and omp
, while a sentinel must have a whitespace after !$
.
Some UM code contains declarations in OpenMP sentinels, e.g.:
Fparser skips these lines as comment lines, and as a result, FAB misses dependencies if compilation is done with OpenMP enabled.
While I have a FAB patch that fixes it (if a comment is found, check if it starts with
!$
, and then tryUse_Stmt.match(...)
, and that works fine for me), I think it could be useful if fparser could be instructed to handle!$
. That should be easier than pre-processing directive (since the string following!$
must be valid Fortran - I believe we could simply pass a flag to the reader to delete the first two characters if they are!$
?If you don't think that this could be useful for fparser, let me know, and I'll get my current FAB workaround merged in.