|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
shah
Joined: 18 Oct 2011 Posts: 13
|
Posted: Thu Oct 20, 2011 1:04 pm Post subject: help me to understand this |
|
|
there are no errors in programme but with few warnings
& after clicking compiling button it shows the following msg
*** SUBROUTINE 'PASSIN' called with argument no 7 as a REAL(KIND=2) when a INTEGER(KIND=3) was expected (from the main program)
& then the Compilation failed.
what ot do?
(where SUBROUTINE 'PASSIN' is the subroutine of the main programme) |
|
Back to top |
|
|
brucebowler Guest
|
Posted: Thu Oct 20, 2011 1:24 pm Post subject: |
|
|
Sounds to me like the declaration of passin wants the 7th argument to be an integer and you're passing it a real when you call passin, but with out the declarations and the call, it's hard to say for sure... |
|
Back to top |
|
|
shah
Joined: 18 Oct 2011 Posts: 13
|
Posted: Thu Oct 20, 2011 1:38 pm Post subject: Re: |
|
|
can u plz tell me elaborately the meaning of argument 7.
i am still unable to understant tne meaning of argument 7
if possible plz explain with an example.
may be because of this m unable to sort out the problem...
Last edited by shah on Fri Oct 21, 2011 10:01 am; edited 1 time in total |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Thu Oct 20, 2011 2:49 pm Post subject: |
|
|
If you had
CALL passin(x1, x2, etc)
then x1 is the first 'argument' and so on.
Apparently argument number 7 has the wrong TYPE.
It is REAL when an INTEGER is expected.
You will have to show us the lines of code that have CALL passin(...
to make sense of this. Also the first few lines of SUBROUTINE passin(... |
|
Back to top |
|
|
shah
Joined: 18 Oct 2011 Posts: 13
|
Posted: Fri Oct 21, 2011 8:32 am Post subject: Re: |
|
|
ok.so heres the full subroutine progamme:
SUBROUTINE PASSIN(X,Y,Z,E,PR,WD,NDF,NSN,NMP,NEQ)
IMPLICIT REAL*8(A-H,O-Z)
COMMON/PRECI/ITWO
COMMON/TAPES/ISTRES,NDARAY,IPR
DIMENSION X(NSN),Y(NSN),Z(NSN),E(NMP),PR(NMP),WD(NMP)
DIMENSION NDF(6,NSN),JF(6)
DIMENSION NCYLT(1000)
FLOAT(I)=DBLE(I)
MN=0
100 READ(5,33)NN,(JF(I),I=1,6),X(NN),Y(NN),Z(NN),NI,NCYL
NCYLT(NN)=NCYL
N=MN+NI
MN=MN+1
110 DO 120 I=1,6
NDF(I,NN)=JF(I)
120 CONTINUE
IF (NI.EQ.0) GO TO 130
IF (NN-MN)130,125,140
125 CONTINUE
IF(NSN-NN)170,170,100
130 MN=NN
GO TO 125
C
C AUTOMATIC GENERATION OF NODAL DATA
C
140 NX=(NN-N+NI)/NI
XD=(X(NN)-X(N-NI))/FLOAT(NX)
YD=(Y(NN)-Y(N-NI))/FLOAT(NX)
ZD=(Z(NN)-Z(N-NI))/FLOAT(NX)
MN=NN
150 X(N)=X(N-NI)+XD
Y(N)=Y(N-NI)+YD
Z(N)=Z(N-NI)+ZD
NCYLT(N)=NCYLT(NN)
DO 160 I=1,6
NDF(I,N)=JF(I)
160 CONTINUE
N=N+NI
IF(N.LT.NN) GO TO 150
IF(NSN-NN)170,170,100
170 CONTINUE
DO 180 I=1,NSN
IF(NCYLT(I).EQ.0) GO TO 180
THETA=Y(I)*3.14159/180.0
Y(I)=X(I)*DSIN(THETA)
Y(I)=X(I)*DCOS(THETA)
180 CONTINUE
IF(IPR.EQ.0)WRITE(6,44)(I,(NDF(J,I),J=1,6),X(I),Y(I),Z(I),I=1,NSN)
C CONVERT '0' & '1' OF 'NDF' ARRAY TO EQUATION NUMBERS & '0'S.
NEQ=0
DO 30 N=1,NSN
DO 30 I=1,6
IF(NDF(I,N))10,20,10
20 NEQ=NEQ+1
NDF(I,N)=NEQ
GO TO 30
10 NDF(I,N)=0
30 CONTINUE
IF(IPR.EQ.0)WRITE(6,77)(I,(NDF(J,I),J=1,6),I=1,NSN)
C READ & PRINT MATERIAL PROPERTIES
DO 1 J=1,NMP
1 READ(5,55)I,E(I),PR(I),WD(I)
WRITE(6,66)(I,E(I),PR(I),WD(I),I=1,NMP)
& thanx for your valuable advice,
& if u also find some problem with this subroutine plz let me know..
i will also now try to eliminate the error shown to me.
Last edited by shah on Fri Oct 21, 2011 10:00 am; edited 1 time in total |
|
Back to top |
|
|
shah
Joined: 18 Oct 2011 Posts: 13
|
Posted: Fri Oct 21, 2011 8:58 am Post subject: Re: |
|
|
& heres the call of the above sub routine:
CALL PASSIN (A(N2),A(N3),A(N4),A(N5),A(N6),A(N7),A(N1),
*NSN,NMP,NEQ) |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Fri Oct 21, 2011 9:09 am Post subject: |
|
|
So the 7th argument is defined as INTEGER but is REAL in the call. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Fri Oct 21, 2011 9:48 am Post subject: |
|
|
Just a remark:
You should always use IMPLICIT NONE (and never things like IMPLICIT REAL ...).
Doing this, you help the compiler to find errors, and you force yourself to make explicit definitions of all of your variables.
Regards - Wilfried |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Fri Oct 21, 2011 11:55 am Post subject: |
|
|
Wilfried, I doubt very much that this is newly written code, it is almost certainly legacy code from the 70's or 80's when the use of IMPLICIT REAL*8(A-H,O-Z) was common place.
I for one have never used IMPLICIT NONE but continue to use IMPLICIT DOUBLE PRECISION and I know that I am not alone in these fora to do this. It doesn't cause me any problems _________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Sat Oct 22, 2011 1:59 am Post subject: |
|
|
Quote: | *** SUBROUTINE 'PASSIN' called with argument no 7 as a REAL(KIND=2) when a INTEGER(KIND=3) was expected (from the main program)
| This is a mixed mode warning message, as when PASSIN was called, array NDF(6,NSN) was supplied memory in the array A from position (N1). This is a warning message.
Quote: | & then the Compilation failed.
| is due to some other problem.
To remove the mixed mode error, use /error_numbers compilation option and then you can use /ignore nnn to ignore this warning. See the help for more info. You can place these compilation options in a file ftn95.cfg. I use
/ERROR_NUMBERS
/IMPLICIT_NONE
/INTL
/LOGL
I tried the following example (fea.f95) with:
ftn95 fea /error_numbers
then
ftn95 fes /error_numbers /ignore 676
This compiles ok.
Note that 676 is only a warning and does not cause the compiler to fail.
Code: | real*8 aa(10000)
integer*4 n1,n2,n3,n4,nn,ne,neq
!
nn = 100
ne = 100
n1 = 1
n2 = n1 + nn*3
n3 = n2 + nn*3
n4 = n3 + ne*6
!
call dout (aa(n1), aa(n2), aa(n3), aa(n4), nn, ne, neq)
end
subroutine dout (cord, jteqn, elcon, eqband, nn, ne, neq)
!
integer*4 nn, ne, neq, n
integer*4 jteqn(6,nn), elcon(12,ne), eqband(*)
real*8 cord(3,nn)
!
do n = 1,nn
cord(:,n) = 0
end do
end |
john |
|
Back to top |
|
|
shah
Joined: 18 Oct 2011 Posts: 13
|
Posted: Mon Oct 24, 2011 7:54 am Post subject: Re: |
|
|
To remove the mixed mode error, use /error_numbers compilation option and then you can use /ignore nnn to ignore this warning. See the help for more info. You can place these compilation options in a file ftn95.cfg. I use
/ERROR_NUMBERS
/IMPLICIT_NONE
/INTL
/LOGL
hey i guess, ur explanation is good,but i didnt get ur above explanation on removal of mixed mode error.plz elaborately explain the above.specially how to create or input
You can place these compilation options in a file ftn95.cfg. I use
/ERROR_NUMBERS
/IMPLICIT_NONE
/INTL
/LOGL
[b]
plz do exlain this... |
|
Back to top |
|
|
jjgermis
Joined: 21 Jun 2006 Posts: 404 Location: Nürnberg, Germany
|
Posted: Mon Oct 24, 2011 3:17 pm Post subject: |
|
|
We also have (many lines of) legacy code where implicit statements are common. Since I prefer to use implicit none (as Wilfried suggests) I often use SPAG which has an option to explicitly defines variables. It is actualy a restructuring tool with a lot of useful options! |
|
Back to top |
|
|
|
|
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
|