Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran 77 commands expg,dexp

  1. Apr 15, 2013 #1
    Hi!

    I have the next expression and I don't know what exactly mean the commands

    a= dexp ((const1)* (b-298) / (b*298))

    This one, I guess it's to calculate the exponential value of the expression giving a double precission.

    But i didn't find any info about the command expg,

    i.e: a = const1 + const2 * expg( const3 * b(2+const4,j) / const1)

    Is it expg other form of exponential or it's a variable that i'm missunderstanding?

    Thanks in advance
     
  2. jcsd
  3. Apr 15, 2013 #2

    DrClaude

    User Avatar

    Staff: Mentor

    Correct.

    expg is not part of the Fortran standard. My guess would be that it is a user-defined function, but it could also be part of a specific computer manufacturer's version of Fortran.
     
  4. Apr 15, 2013 #3
    Thanks, now I understand why I didn't find information about the function.

    How could I figure it out the exact meaning? Using debugging options?
     
  5. Apr 15, 2013 #4

    DrClaude

    User Avatar

    Staff: Mentor

    You have to find where the function is coded if it is user-defined, or what computer the program was originally written for, depending on where the function is defined. Is expg declared "external" in the subroutine (or main program) where it is used?
     
  6. Apr 16, 2013 #5

    In the main program the first time expg appears is already as a function " e1=expg(-arg)", it isn't declare and i don't find the computer the program was written for, though i have a lot of info about it.

    I don't understand where could it be defined if it's out of the program, how can it be used?
     
  7. Apr 16, 2013 #6

    DrClaude

    User Avatar

    Staff: Mentor

    Is it possible for me to see a copy of the program?

    If it is not in the program, it is in one of the libraries that the linker links to during compilation. Fortran is special in that many manufacturers (IBM, Cray, etc.) came up with their own extensions to the language, supplementing what was considered to be missing in the Fortran 77 standard. It is not uncommon in legacy programs to find things that are specific to an old machine, an extinct dinosaur of which the fossilized remains are all that are left :smile:
     
  8. Apr 16, 2013 #7

    DrClaude

    User Avatar

    Staff: Mentor

    I've had a look at the program, and it is indeed a user-defined function. If you look in the code, you will find

    double precision function expg(x)
    implicit real*8 (a-h,o-z)
    expg=0.d0
    if(x.gt.-700.d0) expg=dexp(x)
    return
    end

    It is just the exponential function with a truncation for very small values of the exponential (probably to prevent underflow).
     
  9. Apr 16, 2013 #8
    My bad, I had presumed it should be at the beginning of the code.

    Thanks again for the quickness.

    Doubt solved!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Fortran 77 commands expg,dexp
  1. Fortran 77 (Replies: 1)

Loading...