Re: what is wrong with this code?can someone walk me through this?
- From: e p chandler <epc8@xxxxxxxx>
- Date: Sat, 29 Mar 2008 19:31:31 -0700 (PDT)
On Mar 28, 3:09 pm, madhu0...@xxxxxxxxx wrote:
On Mar 29, 12:03 am, madhu0...@xxxxxxxxx wrote:
On Mar 28, 12:34 pm, "Gerry Ford" <ge...@xxxxxxxxxxxx> wrote:
"Steven G. Kargl" <ka...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in messagenews:fsesmg$8a6$1@xxxxxxxxxxxxxxxxxxxxxxxxxx
In article
<2536c6bf-4017-43c3-aa00-5d9eb8dd3...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
madhu0...@xxxxxxxxx writes:
Heres a fortran code to solve....
source code:
IMPLICIT NONE
REAL*8 DERIV_FX,
DERIV_FY,N,RP,RF,RHO,UF,alpha,K,R0,U
REAL*8
Nu,x,y,y0,THETA,DT,T0,UT0,PI,T,THETA0,Stokes
REAL*8
UR0,b,x1,VX,VY,R,UT_K,UR_K,THETA2,MP,R2,x_i
INTEGER t_max, time
REAL*8 n_t
EXTERNAL FX, FY, DERIV_FX, DERIV_FY
COMMON Nu, RP, RF, MP, UF, alpha, K,
PI, Stokes, x_i
CALL read_parameters (t_max, alpha,
RHO, RP, RF, UF)
PI = 3.1415
Nu = 0.0000181
The problems in this code are too numerous to expend
the effort until you actual post code that has a just
to compile with any compiler.
You probably want that sentence back for a tune-up.
I swear I've seen the same content and coding style before, so I don't think
that the supplicant is the author.
A question for OP: what does stokes represent? What are you doing for the
next eighteen days?
--
"I am waiting for them to prove that God is really American."
~~ Lawrence Ferlinghetti
I am not the original author and I am just trying to improve upon
someone's else code so that it works for stokes number between 0.1 and
2.0.
I am currently working full time as well as trying to finish school
simultaneously. I am trying my best to recompile the code taking into
consideration all the suggestions given by all of you and am trying to
figure how to proceed ahead (without much success) to make the program
work for stokes number between 0.1 and 2.0 within the next few days.
Stokes number is calculated using the formula (just giving a very
basic info for now)
Stokes = (2.0*RP)**2*RHO*UF/(6*PI*Nu*2.0*RF)
It varies according to the values of the input given.
Stokes number is defined in the program. The actual definition for
stokes is, it is ratio of the stopping distance of a particle to a
characteristic dimension of the obstacle.
In basic terms, its a way of measuring how good the program is..say
for example instead of saying that the code doesnt work for a certain
particle radius, we say it doesnt work for this particular stokes
number and we do this by putting the radius in the formula for stokes
number, calculate the stokes number (given the radius) and say that it
is not working (the program) for this particular stokes number..its
like a standard..in viscous flows
In program terms, i should be getting output of stokes between 0.1 and
2.0 for certain values of input but unfortunately i am not getting
that, am trying to figure out why. [Baffled]- Hide quoted text -
- Show quoted text -
Looking at your program listing, I think I've found the "smoking gun".
Your very long expressions for UT0, UR0, UT_K, UR_K, UT_K and UR_K
again look similar, but have different structures. You've used
parentheses where you don't need them and the rest of your parentheses
get confusing.
Long ago I was taught this trick for figuring out precedence in a
complicated expression with many levels of parentheses.
For each statement
1. start a counter at 0
2. for each left parenthesis add 1 to the counter
3. for each right parenthesis subtract 1 from the counter
Things at the same level are part of the same expression.
Notice that in your code the levels are not consistent between
statements. Often programs have parallel structure. Even though you
may interchange variables and multiply by different constants, the
general form tends to be similar but not so in your program.
Confusing the reader with un-needed REAL exponents and NOT using
SQRT() where it should apply makes this possible problem LESS obvious.
I hope this helps.
--- e
.
- References:
- what is wrong with this code?can someone walk me through this?
- From: madhu0319
- Re: what is wrong with this code?can someone walk me through this?
- From: Steven G. Kargl
- Re: what is wrong with this code?can someone walk me through this?
- From: Gerry Ford
- Re: what is wrong with this code?can someone walk me through this?
- From: madhu0319
- Re: what is wrong with this code?can someone walk me through this?
- From: madhu0319
- what is wrong with this code?can someone walk me through this?
- Prev by Date: Re: Reference to derived type element by index?
- Next by Date: Re: LAPACK string orchestra
- Previous by thread: Re: what is wrong with this code?can someone walk me through this?
- Next by thread: Re: what is wrong with this code?can someone walk me through this?
- Index(es):
Relevant Pages
|