Rank: 44191 based on 0 downloads (last 30 days) and 0 file submitted
photo

Md mahbub Mishu

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Md mahbub
Updated File Comments Rating
28 Mar 2011 f2matlab Converts basic fortran90 source code to MATLAB source code. Author: Ben Barrowes

I am using this f2matlab file but when I call the function to convert my fortran90 code to .m file, it says "bad cell reference"
I am giving my fortran code below:
C
C RANKINE SOURCE WAVES TRANSFERRED TO FORM KELVIN ANGLE
C (UNIT STRENGTH, UNIT VOLUME)
DIMENSION FSPANL(20,40), FSP2(30,50),
+ A(40,20),B(40,20),H(40,20),
+ AK(40,20),BK(40,20),HK(40,20)
DATA IR,DEPTH/20,20.0/
C
C
C
DO 100 I=1,20
DO 100 J=1,40
100 FSPANL(I,J)=0.0
C
C
C
DELTAR=20.0/FLOAT(IR)
DO 200 I1=1,IR
R=DELTAR*FLOAT(I1)
RK=DELTAR*FLOAT(I1)+0.5
THETA=2.0*3.141592/FLOAT(I1*4)
ITHETA=I1*4
DO 300 I2=1,ITHETA
ANGLE=THETA*FLOAT(I2-1)
A(I2,I1)=R*COS(ANGLE)
AK(I2,I1)=RK*COS(ANGLE)
B(I2,I1)=R*SIN(ANGLE)
BK(I2,I1)=RK*SIN(ANGLE)
300 CONTINUE
C
DO 350 I2=1,ITHETA
R3D=SQRT((A(I2,I1)-A(1,I1))**2+(B(I2,I1)-B(1,I1))**2+DEPTH**2)
R3DK=SQRT((AK(I2,I1)-AK(1,I1))**2
+ +(BK(I2,I1)-BK(1,I1))**2+DEPTH**2)
H(I2,I1)=R3D**2/(2.0*9.81*(R3D**3))
HK(I2,I1)=-R3DK**2/(2.0*9.81*(R3DK**3))
350 CONTINUE
C
DO 360 I2=1,ITHETA
A(I2,I1)=A(I2,I1)+3.0*R
AK(I2,I1)=AK(I2,I1)+3.0*R
B(I2,I1)=B(I2,I1)+10.0
BK(I2,I1)=BK(I2,I1)+10.0
360 CONTINUE
C
C
C
DO 1000 I2=1,ITHETA
C
I=1
J=1
ICOUNT=1
COL=1.0
IF (A(I2,I1).GT.40.0) GO TO 910
400 IF (A(I2,I1).GT.COL) GO TO 500
J=ICOUNT
GO TO 600
500 COL=COL+1.0
ICOUNT=ICOUNT+1
GO TO 400
600 CONTINUE
C
ICOUNT=1
ROW=1.0
IF (B(I2,I1).GT.20.0) GO TO 910
IF (B(I2,I1).LT.0.0) GO TO 910
700 IF (B(I2,I1).GT.ROW) GO TO 800
I=ICOUNT
GO TO 900
800 ROW=ROW+1.0
ICOUNT=ICOUNT+1
GO TO 700
C
910 H(I2,I1)=0.0
900 FSPANL(I,J)=FSPANL(I,J)+H(I2,I1)
C
I=1
J=1
ICOUNT=1
COL=1.0
IF (AK(I2,I1).GT.40.0) GO TO 915
405 IF (AK(I2,I1).GT.COL) GO TO 505
J=ICOUNT
GO TO 605
505 COL=COL+1.0
ICOUNT=ICOUNT+1
GO TO 405
605 CONTINUE
C
ICOUNT=1
ROW=1.0
IF (BK(I2,I1).GT.20.0) GO TO 915
IF (BK(I2,I1).LT.0.0) GO TO 915
705 IF (BK(I2,I1).GT.ROW) GO TO 805
I=ICOUNT
GO TO 905
805 ROW=ROW+1.0
ICOUNT=ICOUNT+1
GO TO 705
C
915 HK(I2,I1)=0.0
905 FSPANL(I,J)=FSPANL(I,J)+HK(I2,I1)
C
1000 CONTINUE
200 CONTINUE
C
C
C
DO 3000 I=1,30
DO 3000 J=1,50
3000 FSP2(I,J)=0.0
C
DO 4000 I=1,20
DO 4000 J=1,40
IP5=I+5
JP10=J+10
4000 FSP2(IP5,JP10)=FSPANL(I,J)
C
C
C
DO 1100 I=1,30
DO 1100 J=1,50
X=0.5+1.0*(J-1)
Y=0.5+1.0*(I-1)
Z=FSP2(I,J)
WRITE(15,5000) X,Y,Z
5000 FORMAT(1X,3F10.6)
1100 CONTINUE

C
C
STOP
END
if anybody can help me to convert this into .m file, I will appreciate his or her effort.
Thanks
Mishu

Contact us