ecmwf / fckit

A Fortran toolkit for interoperating Fortran with C/C++
https://confluence.ecmwf.int/display/fckit
Apache License 2.0
29 stars 13 forks source link

NAG porting fixes. #34

Closed DJDavies2 closed 4 months ago

DJDavies2 commented 4 months ago

This is related to https://github.com/ecmwf/fckit/issues/33. There are three distinct changes:

1)

The use of FCKIT_SUPPRESS_UNUSED(mold) in fckit_array.F90 is being used on optional dummy arguments; this is a bug when these procedures are called without the optional argument. The fix is use of the present intrinsic.

2)

"loc" is not a standard Fortran intrinsic. I'm not sure of the best, most portable, alternative but I noticed that fckit itself does have a solution in the use of c_ptr_to_loc in conjunction with standard intrinsic c_loc. It seems to work for us. What do you think?

3)

test_array.F90 relies on a pointer to a dummy argument remaining valid after the subroutine returns. This is only valid if the actual argument has the target attribute; pointers cannot point at things that are not targets. I have added the target attribute.

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 4.00000% with 96 lines in your changes are missing coverage. Please review.

Project coverage is 51.69%. Comparing base (a92be06) to head (a1c6ec1).

Files Patch % Lines
src/fckit/module/fckit_array.F90 4.00% 96 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #34 +/- ## =========================================== - Coverage 52.07% 51.69% -0.38% =========================================== Files 52 52 Lines 4388 4418 +30 =========================================== - Hits 2285 2284 -1 - Misses 2103 2134 +31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.