I am doing my maser thesis on WIND turbine simulation On ANSYS CFX.To calculate a parameter I have to use a code written in FORTRAN. I am facing a very weird type of problem and need your help.The complete fortran code is quite long but I will only post the subroutine in the code that is causing problem.
I am using a subroutine to divide the blade in a no of radial elements.Two types of division is used and the radial positions of the elements are then stored in two 1-D arrays RI and RJ.
Later in the code, I got some error and I traced it back to this subroutine that it is not giving me correct values of RJ .The subroutine is giving correct values of RI. Then I displayed the results of RJ using the same loop in which it is calculated correct values of RJ. Fortunately the values of RJ were correct. Then in the same subroutine, immediately after that loop, I started another loop to display the values of RJ again and unfortunately this time they were not correct incorrect values of RJ even there is nothing between the two loops that could change the values of RJ. seemingly every element of RJ is replaced with the next element of RI. Hence I came to know that here is the error originating. I have rechecked the program and seemingly there is no error and the error is originating somewhere inside the subroutine. I am using another program on fortran without ANSYS CFX to calculate wind turbine performance using same subroutine and this problem is NOT coming in that program although the two subroutines in the two programs are exactly same. I need help in this matter as I am stuck in it for past few days. I am using Intel fortran compiler that comes with INTEL COMPOSER.
The subroutinea are as follows
CALL INIT(M,PI,PREC,R,HUBRAD,RI,RJ)
SUBROUTINE INIT(M,PI,PREC,R,HUBRAD,RI,RJ)
INTEGER:: M
REAL:: PI,PREC,R,HUBRAD
REAL:: RI(41),RJ(41)
!,RRI,RRJ)
CALL LLPOINTS (PI,PREC,R,HUBRAD,M,RI,RJ)
return
End Subroutine
SUBROUTINE LLPOINTS (PI,PREC,R,HUBRAD,M,RI,RJ)
!Input arguments: M,Pi, PREC, R, HUBRAD
!Output arguments : RI, RJ
INTEGER:: M
REAL::PREC,R,HUBRAD
REAL:: RI(41),RJ(41)
INTEGER :: J
character*100 ::string1, string2, string3
CALL MESAGE( 'WRITE', 'subroutine INIT START' )
CALL MESAGE( 'WRITE', "RI RJ DJ")
DO J=1,M+1
IF (J.LT.M+1) THEN
RI(J)=0.5E+00*(1.E+00+HUBRAD/R)-0.5E+00*(1.E+00-HUBRAD/R)
&*COS((J-0.5E+00)*PI/M)
RJ(J)=0.5E+00*(1.E+00+HUBRAD/R)-0.5E+00*(1.E+00-HUBRAD/R)
&*COS((J-1.E+00)*PI/M)
IF (ABS(RI(J)).LT.(1/PREC)) THEN
STOP
ENDIF
ELSE
RJ(J)=1.E+00
END IF
write (string1,*) RI(J)
write (string2,*) RJ(J)
CALL MESAGE( 'WRITE', string1//' '//string2)
END DO
CALL MESAGE( 'WRITE','ri rj')
do j =1,m
write (string1,*) RI(J)
write (string2,*) RJ(J)
CALL MESAGE( 'WRITE', string1//' '//string2 )
end do
CALL MESAGE( 'WRITE', 'subroutine LLINE OK' )
END SUBROUTINE
You would be wondering why LLPOINTS is INSIDE INIT subroutine without any reason. Actually in the original program the subroutine INIT has a lot of other subroutines. I used only LLPOINTS and discarded rest of them as I did not need them
I have checked that my program does not have implicit none in any of the subroutines which according to my limited knowledge should be present. When I added implicit none to all subroutines, a number of compilation errors have occurred and seemingly in those errors, I have found that there were problems related to the declarations of a number of variables . I have resolved these issues and now when all issues are resolved, I have got the following error in compilation which was not coming before implicit none.
Error:unresolved external symbol LLINE referenced in function ACD_Dp.
I dont know how to deal with this error
LLPOINTS) is called, and how the actual arguments forRIandRJare defined? The actual arguments may be incorrectly passed such that they point to memory regions with only a difference of by 1.LLINEsomewhere? And how isLLINEused in your routine? The compiler thinks thatLLINEis a function, while it cannot find its definition in any source code (at link time).