----> Emergency: Need Help with fortran prog 
Author Message
 ----> Emergency: Need Help with fortran prog

Hello everyone,
   Could some fortran programming genius please help me out with a simple
program. I am completely new to fortran and I need to have an equation
programmed before the end of this week. Heres the problem. I have an
equation Y which depends on X. I need a prog that will loop thru values of
x from say -1000 to 1000 and write out the corresponding values of Y (and
x) to a file so I can plot the data. In the loop where the prog evalates Y
however it needs to call a subroutine called "erf(x)" which is fed the x
value and this subroutine (alre ady made) spits out the value which is also
used in the y=f(x) equation. The prog needs to keep going thru the loop
until it reaches x=1000 upon which it should stop. Could someone please
please help me with the code as I am completely lost. TIA. Salman Saeed.



Tue, 30 Mar 1999 03:00:00 GMT  
 ----> Emergency: Need Help with fortran prog

Quote:

> Hello everyone,
>    Could some fortran programming genius please help me out with a simple
> program. I am completely new to fortran and I need to have an equation
> programmed before the end of this week. Heres the problem. I have an
> equation Y which depends on X. I need a prog that will loop thru values of
> x from say -1000 to 1000 and write out the corresponding values of Y (and
> x) to a file so I can plot the data. In the loop where the prog evalates Y
> however it needs to call a subroutine called "erf(x)" which is fed the x
> value and this subroutine (alre ady made) spits out the value which is also
> used in the y=f(x) equation. The prog needs to keep going thru the loop
> until it reaches x=1000 upon which it should stop. Could someone please
> please help me with the code as I am completely lost. TIA. Salman Saeed.

Looks easy.
I assume the following;
        "erf "is a real function
        you already have the function "F", which is real
        you are kidding about needing this by the end of the week
Any assumption except the last can be changed easily

        integer x
        real y, f
        real e, erf

        open (1, file='output.dat', status='new')
        do x = -1000, +1000
          e = erf (y)
          y = f (x,e)
          write (1,900) y, x
        end do
900     format (f10.2, i5)
        end

--
Dominic Olivastro                    CHI Research, Inc

visit our web site at http://www.chiResearch.com



Tue, 30 Mar 1999 03:00:00 GMT  
 ----> Emergency: Need Help with fortran prog

        integer x
        real y, f
        real e, erf

        open (1, file='output.dat', status='new')
        do x = -1000, +1000
          e = erf (y)
          y = f (x,e)
          write (1,900) y, x
        end do
900     format (f10.2, i5)
        end

OK but I think it should be erf(x) - otherwise
you are in trouble because y has not been defined
for the current x value???

- Loren Meissner



Tue, 30 Mar 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP>>>>>>>Fortran-Pascal Linking

2. EMERGENCY HELP: need DB3 and Clipper Programmer ASAP

3. *** EMERGENCY *** EMERGENCY ***

4. Need a parser prog in Fortran

5. need hints to improve fortran prog.!!!!!!!!!!!!!!

6. help w/fortran prog

7. need help for a _very_ short prog.

8. Desparately need help to solve a prog Question !!

9. HELP needed on simple concat prog

10. simple f77 prog - need help

11. Need help with simple expect prog.

12. Need help porting MacLisp prog to CL

 

 
Powered by phpBB® Forum Software