Opened 6 years ago
Closed 6 years ago
#186 closed Defect (duplicate)
Compile fails using gfortran due to error in erf.f90
Reported by: | hcpxvi | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | FP other | Version: | FLEXPART 9.0.2 |
Keywords: | compile fail | Cc: |
Description
I have built Flexpart from source on a couple of Linux machines and I always get a compile error due to a problem in erf.f90. The error message is:
gfortran -c -O2 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I/usr/lib64/gfortran/modules erf.f90
erf.f90:106.26:
- real, external
- gammln 1
Error: Return type mismatch of function 'gammln' at (1) (REAL(4)/REAL(8))
erf.f90:111.13:
gln=gammln(a)
1
Warning: Type mismatch in argument 'xx' at (1); passed REAL(4) to REAL(8)
The same error happens at line 140. The following patch allows Flexpart to compile although it may not be the best way of achieving this:
aurora.hcp>diff baderf.f90 erf.f90
106c106
< real, external :: gammln
---
- double precision, external
- gammln
111c111
< gln=gammln(a)
---
gln=gammln(DBLE(a))
140c140
< real, external :: gammln
---
- double precision, external
- gammln
145c145
< gln=gammln(a)
---
gln=gammln(DBLE(a))
The version of gfortran used does not appear to be important; the same thing happens with gfortran 4.8.5 on Scientific Linux 7 and with gfortran 6.3.0 on Debian 9.2.
Change History (2)
comment:1 Changed 6 years ago by hcpxvi
comment:2 Changed 6 years ago by pesei
- Resolution set to duplicate
- Status changed from new to closed
Apologies: I have just spotted that this is a duplicate of ticket #49. Feel free to mark it as such or delete it; it does not appear that I as submitter have the ability to do that.