:78 Function create_function() is deprecated [8192]

Another instance of the optional argument bug fixed.

Bruno Mundim [2017-01-25 00:13:29]
Another instance of the optional argument bug fixed.
Filename
src/trainset.f90
diff --git a/src/trainset.f90 b/src/trainset.f90
index 6040608..f1faebb 100644
--- a/src/trainset.f90
+++ b/src/trainset.f90
@@ -295,11 +295,17 @@ contains
     call ts_assert_init(ts)
     call ts_assert_readmode(ts)

-    if (present(rec) .and. (rec > 0)) then
-       irec = rec - 1
+    ! BCM: break the if statement so to evaluate present(rec) only
+    if (present(rec)) then
+       if (rec > 0) then
+         irec = rec - 1
+       else
+         irec = 0
+       end if
     else
        irec = 0
     end if
+    ! BCM: done!

     if (ts%iStruc > irec) then
        rewind(ts%unit)
ViewGit