LI-COR-Environmental / eddypro-engine

EddyPro Engine
GNU General Public License v3.0
40 stars 20 forks source link

Compilation error with EddyPro v7.0.6 and gfortran v10.x on macOS v10.15.7 (Catalina) #4

Open geryatejina opened 3 years ago

geryatejina commented 3 years ago

From Matthias Cuntz: Compilation fails with EP v7.0.6 and gfortran v10.2.0 on macOS 10.15.7. Error messages below.

cd eddypro-engine/ cd prj/ make rp Compiling for Mac OS gfortran -Wall -pedantic -fall-intrinsics -fbounds-check -Wextra -Wcharacter-truncation -Wunderflow -Wno-compare-reals -std=f2008 -O3 -I ../obj/mac/ -c ../src/src_common/m_libdate.f90 -o ../obj/mac/m_libdate.o ... gfortran -Wall -pedantic -fall-intrinsics -fbounds-check -Wextra -Wcharacter-truncation -Wunderflow -Wno-compare-reals -std=f2008 -O3 -I ../obj/mac/ -c ../src/src_rp/eddypro-rp_main.f90 -o ../obj/mac/eddypro-rp_main.o ../src/src_rp/eddypro-rp_main.f90:1557:92:

1557 | if (EddYProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1608:92:

1608 | if (EddyProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1624:92:

1624 | if (EddYProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1640:92:

1640 | if (EddYProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1733:92:

1733 | if (EddYProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1806:92:

1806 | if (EddYProProj%out_fluxnet) call WriteOutFluxnetOnlyBiomet(suffixOutString) | 1 Error: More actual than formal arguments in procedure call at (1) ../src/src_rp/eddypro-rp_main.f90:1928:42:

710 | call TiltCorrection('double_rotation', .false., E2Set, & | 2 ...... 1928 | call TiltCorrection(Meth%rot, GoPlanarFit, E2Set, & | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) make: *** [eddypro-rp_main.o] Error 1

kebasaa commented 2 years ago

I confirm this error on Linux too, with gfortran. I'm not sure how much LI-COR still maintains the EddyPro source code... @LI-COR please update the repo to a working version! I'm just trying to run EP on Linux... Thanks

kebasaa commented 2 years ago

Note: This is using Gfortran 11.2.0 on Ubuntu 21.10. OS and compiler versions don't seem to be the issue though, I've tried multiple tags of the repo with the same error

mcuntz commented 2 years ago

@kebasaa It works with gfortran version 8 (I am using version 8.5.0, Gerardo apprently used version 8.1.0) but newer gfortran versions complain.

geryatejina commented 2 years ago

@mcuntz @kebasaa Sorry for the long silence. As mentioned elsewhere, LI-COR uses this repo to distribute EddyPro's source code, but this isn't our development repo: here we only release the master/tagged branch of the code released with public EddyPro versions. Also, LI-COR, while routinely deploying Linux versions of EddyPro (in SmartFlux), does not distribute a Linux version. This all means that I can't publish a version that compiles on later version of gfortran, until that version is released with the Win/Mac installers.

That said:

  1. Replace call WriteOutFluxnetOnlyBiomet(suffixOutString) with call WriteOutFluxnetOnlyBiomet()
  2. In eddypro-rp_main.f90 define a variable logical :: FakeGoPlanarFit(1), then replace call TiltCorrection('double_rotation', .false., E2Set, size(E2Set, 1), size(E2Set, 2), 1, Essentials%yaw, Essentials%pitch, Essentials%roll, .false.) with:
                FakeGoPlanarFit = .false.
                call TiltCorrection('double_rotation', FakeGoPlanarFit, E2Set, &
                    size(E2Set, 1), size(E2Set, 2), 1, Essentials%yaw, &
                    Essentials%pitch, Essentials%roll, .false.)
kebasaa commented 2 years ago

Thanks, that indeed compiles eddypro-rp, but not the fcc...

geryatejina commented 2 years ago

Can you please post here the error you get?

kebasaa commented 2 years ago

Here is the error when trying to compile it:

gfortran -Wall -pedantic -fall-intrinsics -fbounds-check -Wextra -Wcharacter-truncation -Wunderflow -Wno-compare-reals -std=f2008 -O3 -I ../obj/linux/ -c ../src/src_fcc/output_spectral_assessment_results.f90 -o ../obj/linux/output_spectral_assessment_results.o ../src/src_fcc/output_spectral_assessment_results.f90:687:90:

648 | call WriteDatumFloat(kaimal(MeanStabilityCosp(i, unstable)%fn(gas), 1, 'unstable'), & | 2 ...... 687 | call WriteDatumFloat(kaimal(MeanStabilityCosp(i, stable)%fn(gas), 1d-2, 'stable'), & | 1 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)). ../src/src_fcc/output_spectral_assessment_results.f90:690:90:

648 | call WriteDatumFloat(kaimal(MeanStabilityCosp(i, unstable)%fn(gas), 1, 'unstable'), & | 2 ...... 690 | call WriteDatumFloat(kaimal(MeanStabilityCosp(i, stable)%fn(gas), 1d1 , 'stable'), & | 1 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/INTEGER(4)). make: *** [Makefile:116: output_spectral_assessment_results.o] Error 1

geryatejina commented 2 years ago

Replace , 1, with , 1d0, at line 648. That should do it.

mcuntz commented 2 years ago

@geryatejina @kebasaa Worked for me with gfortran v 11.2.0 on MacOS 10.15.7

kebasaa commented 2 years ago

Same here on Linux. Thanks @geryatejina