Author Message
mecej4

Joined: 31 Oct 2006
Posts: 1156 Posted: Sat Oct 13, 2018 1:39 am    Post subject: FTN95 incorrectly flags 2-D array as scalar The subroutine code given below has no syntax errors (as checked by Gfortran). The local variable D5V is declared as a 2-dimensional array, and is assigned a rank-2 array expression in a WHERE statement on line 26.
 Code: Subroutine merit (l, m, me, n, r, df, g, dg, v, dphi, active) ! !********************************************************************* !       Implicit None !----------------------------------------------- !   D u m m y   A r g u m e n t s !-----------------------------------------------       Integer, Intent (In) :: l, m, me, n       Real, Intent (In)    :: df (n), g (m, l), dg (m, n), v (m), r (m)       Real, Intent (Inout) :: dphi (m + n)       Logical, Intent (Out) :: active (m) !----------------------------------------------- !   L o c a l   V a r i a b l e s !-----------------------------------------------       Integer :: j1       Real :: d5v (m, n)              ! NOTE: Rank = 2 !----------------------------------------------- !       active = .True.       Where ( (/ (j1, j1=1, m) /) > me .And. &              r * g(:, 1) > v) active = .False. !       dphi (:n) = df       Where (spread(active, dim=2, ncopies=n)) &          d5v = dg (:, :) * (spread(v, dim=2, ncopies=n) &  ! FTN95 says d5v is SCALAR!               - spread(r, dim=2, ncopies=n) &               * spread(g(:, 1), dim=2, ncopies=n))       dphi (:n) = dphi (:n) - sum (d5v, mask= &                   spread(active, dim=2, ncopies=n), dim=1)       Where (active)          dphi (n+1:m+n) = - g (:, 1)       Elsewhere          dphi (n+1:m+n) = - v / r       End Where       Return End Subroutine

The compiler says
 Code: [FTN95/Win32 Ver. 8.30.279 Copyright (c) Silverfrost Ltd 1993-2018] 0025)       Where (spread(active, dim=2, ncopies=n)) & 0026)          d5v = dg (:, :) * (spread(v, dim=2, ncopies=n) &  ! FTN95 says d5v is SCALAR! 0027)               - spread(r, dim=2, ncopies=n) & 0028)               * spread(g(:, 1), dim=2, ncopies=n)) *** The test of the enclosing WHERE statement is rank 2, whereas the left hand side of this assignment is a scalar     1 ERROR  [ FTN95 v8.30.279] *** Compilation failed   PaulLaidler
Site Admin Joined: 21 Feb 2005
Posts: 5967
Location: Salford, UK Posted: Sat Oct 13, 2018 8:01 am    Post subject: Thank you for the feedback. I have made a note that this needs investigating.   Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT + 1 Hour Page 1 of 1

 Jump to: Select a forum Admin----------------Announcements FTN95----------------GeneralKBaseSupportSuggestionsClearWin+Plato64-bit FTN77----------------Support
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group