module problems



Hi,

I'm trying to put a collection of subroutines and functions in a
module, but this results in a number of "undefined reference". These
are the errors and code for a lightweight version of the file.

Thanks

G95 -shared -o test.so test.f90
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x18):
undefined re
ference to `kbdoe_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x29):
undefined re
ference to `btdoe_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x42):
undefined re
ference to `kbdoe_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x65):
undefined re
ference to `kwdoe_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x8c):
undefined re
ference to `k1mehrbach_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0xa7):
undefined re
ference to `k1mehrbach_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0xbb):
undefined re
ference to `k2mehrbach_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0xff):
undefined re
ference to `htadic_'
C:\DOCUME~1\pieterp\LOCALS~1\Temp/cco3caaa.o:test.f90:(.text+0x123):
undefined r
eference to `co2hta_'

module carblib
implicit none
contains

double precision function kh(t, s)

implicit none

double precision :: tk, t, s
tk = t + 273.15d0
kh = exp(-60.2409d0 + 93.4517d0 * (100.d0 / tk) + 23.3585d0 * log(tk /
100.d0) + &
s * (0.023517d0 - 0.023656d0 * (tk / 100.d0) + 0.0047036d0 * ((tk /
100.d0) ** 2)))
return
end function kh

double precision function hph (ph)

implicit none

double precision :: ph
hph = 10.d0 ** (- ph)
return
end function hph

double precision function kwdoe (t, s)

implicit none

double precision :: tk, t, s
double precision :: lnkw
tk = t + 273.15d0
lnkw = 148.96502d0 - 13847.26d0 / tk - 23.6521d0 * log(tk) &
+ (118.67d0/tk - 5.977d0 + 1.0495d0 * log(tk)) * (sqrt(s)) &
- 0.01615d0 * s
kwdoe = exp(lnkw)
return
end function kwdoe

double precision function kbdoe (t, s)

implicit none

double precision :: tk, t, s
double precision :: lnkb
tk = t + 273.15d0
lnkb = (- 8966.90d0 - 2890.53d0*(sqrt(s)) - 77.942d0*s +
1.728d0*(s**(3.d0/2.d0)) - 0.0996d0*(s**2)) / tk &
+ 148.0248d0 + 137.1942d0*(sqrt(s)) + 1.62142d0*s &
- (24.4344d0 + 25.085d0*(sqrt(s)) + 0.2474d0*s) * log(tk) &
+ 0.053105d0*(sqrt(s))*tk
kbdoe = exp(lnkb)
return
end function kbdoe

double precision function k1mehrbach (t, s)

implicit none

double precision :: tk, t, s
double precision :: pk1
tk = t + 273.15d0
pk1 = 3670.7d0/tk - 62.008d0 + 9.7944d0*log(tk) - 0.0118d0*s +
0.000116d0*(s**2)
k1mehrbach = 10.d0 ** (- pk1)
return
end function k1mehrbach

double precision function k2mehrbach (t, s)

implicit none

double precision :: tk, t, s
double precision :: pk2
tk = t + 273.15d0
pk2 = 1394.7d0/tk + 4.777d0 - 0.0184d0*s + 0.000118d0*(s**2)
k2mehrbach = 10.d0 ** (- pk2)
return
end function k2mehrbach

double precision function btdoe (s)

implicit none

double precision :: s
btdoe = 4.16d0 * (10.d0**(-4)) * (s / 35.d0)
return
end function btdoe

double precision function co2tadic (ta, dic, t, s)

implicit none
double precision :: ta, dic, t, s, h
double precision :: htadic, co2hta

h = htadic(ta, dic, t, s)
co2tadic = co2hta(h, ta, t, s)

return
end function co2tadic

double precision function co2hta (h, ta, t, s)
implicit none
double precision :: h, ta, t, s
double precision :: kbdoe, btdoe, kwdoe, k1mehrbach, k2mehrbach

co2hta = (ta - ((kbdoe(t, s) * btdoe(s))/(kbdoe(t, s) + h)) -
(kwdoe(t, s) / h) + h) / &
((k1mehrbach(t, s) / h) + 2.d0 * ((k1mehrbach(t, s) * k2mehrbach(t,
s))/h**2))

end function co2hta

end module carblib

.



Relevant Pages