# I faced difficulty in a fortran error

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 19, 2002, 06:35 I faced difficulty in a fortran error #1 J. Kim Guest   Posts: n/a Dear all, I faced an error in fortran compiler: Divide by zero I found out the casue of that. However, I did not know a way to solve it. Here is a error. ---------------- KmT=475.0e-6 KmD=155.0e-3 CDT=2.36e-10 CDD=2.57e-10 C RENEW ATP CONCENTRATION AT BOTTOM WALL DO 510 I=1,L1 F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT) F(I,1,5)=F(I,2,5)+F_ATP*YDIF(2) 510 CONTINUE C RENEW ADP CONCENTRATION AT BOTTOM WALL DO 520 I=1,L1 F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/(KmT*CDD) F(I,1,6)=F(I,2,6)+F_ADP*YDIF(2) 520 CONTINUE ---------------- As you can see, the values of KmT*CDT, CDT, KmD*CDD, and KmT*CDD is very small like the unit. How can I change them? I would be appreciated for this if you would help me.

 March 19, 2002, 06:59 Re: I faced difficulty in a fortran error #2 STN Guest   Posts: n/a Hi Kim.... Could you tell which, exactly, line is error ? Is it this line " F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT)" or "F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/(KmT*CDD)"? If yes, It may because KmT or KmD is not define as REAL or DOUBLEPRECISION parameter. Normaly, FORTRAN define all parameter which has I,J,K,L,M,N in the first letter is INTEGER.So your KmT or KmD is ZERO. Hope this help.. STN

 March 19, 2002, 09:36 Re: I faced difficulty in a fortran error #3 Seb Perron Guest   Posts: n/a 1) First to make sure that all you variables are declared with the appropriate type, add implicit none at the first line of your routine. 2) Compute both dtmp0=KmT*CDT and dtmp1=KmT*CDD and before making the division, do a simple check on their value. Good luck.

 March 19, 2002, 10:21 Re: I faced difficulty in a fortran error #4 J. Kim Guest   Posts: n/a Thanks really for your warm answer. Like you gave me comment, I already did so. There is still error: Divied by zero.... Are there any solution? I will post the problem again. --------------------- ..... KmT=475.0e-6 KmD=155.0e-3 CDT=2.36e-10 CDD=2.57e-10 ..... DO 510 I=1,L1 F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT) F(I,1,5)=F(I,2,5)+F_ATP*YDIF(2) 510 CONTINUE DO 520 I=1,L1 F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/KmT*CDD) F(I,1,6)=F(I,2,6)+F_ADP*YDIF(2) 520 CONTINUE ---------------- ----------------------

 March 19, 2002, 11:20 Re: I faced difficulty in a fortran error #5 Wen Long Guest   Posts: n/a Hi, Kim: Maybe your KmT, KmD and CDT are too small, and divition by a small number is apt to make errors. Can you normalize it first? Say, KmT_1=Kmt/1.0e-6, KmD=KmD/1.0e-3 ... Then you devide by (KmT_1*KmD) and times the result with 1.0e+9, hope this helps, wen

 March 19, 2002, 13:19 Re: I faced difficulty in a fortran error #6 Francisco Guest   Posts: n/a Dear J.Kim, I´ve pasted your piece of code into my Fortran compiler (F90 for Windows) and with slight modifications (which I hope did not change the divison operation), it seemed to work (no divison by zero). Here is the small code I used: program kim implicit none real*8 KmT, KmD,CDT,CDD,F_ATP,F_ADP,S,VmaxD,VmaxT KmT=475.0e-6 KmD=155.0e-3 CDT=2.36e-10 CDD=2.57e-10 F_ATP=VmaxT/(KmT*CDT)-S/(CDT) F_ADP=VmaxD/(KmD*CDD)-F_ATP*VmaxT/(KmT*CDD) write(*,*) F_ATP,F_ADP,CDT pause end Obviously, I might have removed the source of error, but try it yourself. Best regards, Francisco.

 March 19, 2002, 18:36 Re: Thanks for your good comment. #7 J. Kim Guest   Posts: n/a

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sebastian OpenFOAM Running, Solving & CFD 53 April 10, 2014 05:45 bkubicek OpenFOAM 13 May 26, 2011 05:48 Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42 piotka STAR-CD 4 June 12, 2009 08:43 CFDUSER CFX 2 December 9, 2006 07:31

All times are GMT -4. The time now is 13:09.