fortran: Fix MINLOC/MAXLOC with MASK and BACK=.true.
Corrects MINLOC and MAXLOC intrinsic functions in Fortran when using MASK and BACK=.true.
This commit addresses an issue in the Fortran runtime library affecting the MINLOC and MAXLOC intrinsic functions. When the MASK argument was used in conjunction with BACK=.true., the library templates did not correctly advance through the array argument, leading to incorrect results. The fix involves regenerating numerous runtime library templates after modifying the relevant m4 macro to ensure proper array traversal under these specific conditions.
In Details
The generated Fortran runtime library templates for MINLOC and MAXLOC had an incorrect traversal logic when MASK was present and BACK was set to .true.. Specifically, the array argument was not advanced properly. This commit regenerates many specialized C files that implement these intrinsics, based on an updated m4 macro (m4/minlocmaxloc1.m4, implicitly, as the diff shows regeneration of many files generated from similar macros) that corrects this traversal bug.
- MINLOC
- A Fortran intrinsic function that returns the index (or indices) of the first occurrence of the minimum value within an array, optionally considering a mask and direction (BACK).
- MAXLOC
- A Fortran intrinsic function that returns the index (or indices) of the first occurrence of the maximum value within an array, optionally considering a mask and direction (BACK).
- BACK
- In Fortran intrinsic functions like MINLOC/MAXLOC, the BACK=.true. argument specifies that the search should proceed from the end of the array towards the beginning.
- runtime library
- A collection of pre-compiled functions and routines that are linked with a program at runtime to provide essential services, such as I/O, memory management, and intrinsic function implementations.
- m4 macro processor
- A general-purpose macro processor that can be used to preprocess source code. In this context, it's used to generate specialized versions of Fortran runtime library routines based on various data types and arguments.