morenococo / crqa

Cross-recurrence quantification analysis of two time-series, of either categorical or continuous values. It provides different methods for profiling cross-recurrence, i.e., only looking at the diagonal recurrent points, as well as more in-depth measures of the whole cross-recurrence plot, e.g., recurrence rate.
9 stars 1 forks source link

Use of deprecated Hollerith constant in Fortran code #10

Closed danm0nster closed 4 months ago

danm0nster commented 6 months ago

The CRAN check has flagged the use of a deprecated feature, Hollerith constants in FORMAT statements, that should be fixed.

Here is the output from CRAN check

Version: 2.0.5
Check: whether package can be installed
Result: WARN 
  Found the following significant warnings:
    ./jspd.f:46:14: portability: deprecated usage
  See ‘/data/gannet/ripley/R/packages/tests-clang/crqa.Rcheck/00install.out’ for details.
  * used C compiler: ‘clang version 18.1.5’
  * used Fortran compiler: ‘flang-new version 18.1.5’
Flavor: [r-devel-linux-x86_64-fedora-clang](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/crqa-00check.html)Version: 2.0.5
Check: whether package can be installed
Result: WARN 
  Found the following significant warnings:
    ./jspd.f:46:14: portability: deprecated usage
  See ‘/data/gannet/ripley/R/packages/tests-clang/crqa.Rcheck/00install.out’ for details.
  * used C compiler: ‘clang version 18.1.5’
  * used Fortran compiler: ‘flang-new version 18.1.5’
Flavor: [r-devel-linux-x86_64-fedora-clang](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/crqa-00check.html)
danm0nster commented 6 months ago

A quick look at the issues shows that the offending line (46) of the file jspd.f is not used by the code:

 1000 FORMAT(1H ,25f4.0)

It is referenced only in some code that has been turned into comments, so it was most likely used for debugging purposes during development.

NOTE: The "1H" part is the Hollerith constant, denoting a length of 1. It seems to be meant for printing an integer that is either 0 or 1 as in the commented code in line 45:

C      print 1000,(Adata(i), i=1,je)

So we can either change the FORMAT statement from "1H" to "I" or "I1", or we can simply turn the line into a comment.

In fact, we can do both of these things, which seems to be the best way forward right now.

morenococo commented 4 months ago

I rewrote the function in Fortran 90 to update the code in general.