Problem with double precision function

From: Micha steck (micha.steck_at_gmx.de)
Date: 09/22/04


Date: Wed, 22 Sep 2004 14:54:42 +0200

hi folks,
i am a fortran newbie. i use Compaq Visual Fortran Professional 6.6A (to
create TrnSys-Types). i have made one file called "common.for" that
contains common functions, for example:

DOUBLE PERCISION FUNCTION cp_air()
cp_air=1007.0d0
END FUNCTION cp_air

(i knowit doesn't make sense to use a function like that, but later the
thermal capazity will by calculated more exactly depending on
temperature etc)

when i use this function in an other subroutine like

double percision cap
cap=cp_air()

cap hasn't the value 1007 but something else.
How can this be?
Thanks a lot,
Michael Steck