Opened 4 years ago

Last modified 8 months ago

#269 accepted Defect

Compilation without netCDF not properly implemented, grib_api -> eccodes

Reported by: pesei Owned by: pesei
Priority: major Milestone: FLEXPART 10.4.1
Component: FP coding/compilation Version: FLEXPART 10.4
Keywords: Cc:


The makefile distributed with FLEXPART 10.4 contains netcdf-related objects without enclosing them in a proper if block. Therefore, it is not possible to compile the code using this makefile on a machine where netcdf is not available (or not available in the expected place / version).

Change History (7)

comment:1 Changed 4 years ago by pesei

  • Summary changed from Compilation without netCDF not properly implemented to Compilation without netCDF not properly implemented, grib_api -> eccodes

Makefile is fixed in changeset:5cbd51b/flexpart.git, also some code cosmetics on verttransform_ecmwf.f90

In changeset:fe118c0/flexpart.git, grib_api has been updated to eccodes in the makefile.

comment:2 Changed 4 years ago by pesei

Please close the ticket when this has been merged into master!

comment:3 Changed 3 years ago by pesei

  • Status changed from new to accepted

comment:4 Changed 2 years ago by donaldjmorton

I would just like to comment on the seriousness of this problem, as I've struggled for a little while with the issue. Here is the ticket that I was going to submit, but then I noticed Petra had made this comment 14 months ago:

No easy way to compile FPv10.4 without having NetCDF libraries installed

Although the documentation and the makefile suggest that NetCDF support can be disabled, and that libraries are not required, I don't think this is accurate, at least with respect to the "makefile" that's provided in the source code. In my attempts to compile on a system without NetCDF installed, I was blocked by the makefile dependency of the following on netcdf_output_mod.o


In fact, as written, if NetCDF support is not enabled (via ncf=yes), it looks like the makefile will not include the $(OBJECTS_NCF) value, and so compilation of the above four files will fail because of no netcdf_output_mod.o, but due to the makefile construction, there will be an attempt to compile netcdf_output_mod.f90. And, since netcdf_output_mod.f90 has a "use netcdf" statement, it's compilation will fail unless the compiler can find a netcdf.mod

I understand that one can easily remove the netcdf_output_mod.o dependency from the four above files and it "should" all work, but it's not immediately obvious and I think a new user could really struggle with this (I struggled for a while, trying to understand why compile was failing, even with the -UUSE_NCF flags being included).

Last edited 2 years ago by donaldjmorton (previous) (diff)

comment:5 follow-up: Changed 2 years ago by pesei

Don, are you referring to the `official' makefile, or my corrected one pointed to above?

comment:6 in reply to: ↑ 5 Changed 2 years ago by donaldjmorton

Replying to pesei:

Don, are you referring to the `official' makefile, or my corrected one pointed to above?

I was referring to the "official" makefile. I hadn't realised that you had posted a new makefile until I had already written up my problem report.

My primary purpose for posting my own report, even though you had already done so, was to reinforce the idea that this is something that will cause problems for unsuspecting users, especially those who aren't very literate in makefiles.

comment:7 Changed 8 months ago by pesei

  • Milestone changed from FLEXPART 10 to FLEXPART 10.4.1
Note: See TracTickets for help on using tickets.
hosted by ZAMG