E3SM-Project / scream

Fork of E3SM used to develop exascale global atmosphere model written in C++
https://e3sm-project.github.io/scream/
Other
76 stars 54 forks source link

rrtmgp cmake is looking for netcdf #2692

Open oksanaguba opened 8 months ago

oksanaguba commented 8 months ago

https://github.com/E3SM-Project/scream/blob/3005a4b8ef245c06f0a769a87c3c85bf0c29e519/components/eamxx/src/physics/rrtmgp/CMakeLists.txt#L127

the issue is that netcdf is already processed at the top level in cime, but then rrtmgp is trying to find it, too (also, not in the optimal way).

on aurora, for example, it leads to symbol -lNETCDF_C-NOTFOUND in link line because of

CMakeCache.txt:NETCDF_C:FILEPATH=NETCDF_C-NOTFOUND
bartgol commented 8 months ago

This should be easy to fix.

bartgol commented 8 months ago

Actually, I'm not sure the "easy fix" would cover all cases. I was thinking of simply make rrtmgp link against pioc, but I think it's technically possible for pioc to build without netcdf (e.g., only pnetcdf). Perhaps the real fix would be to have rrtmgp use pioc rather than the stuff in simple_netcdf.hpp.

@brhillman Is there a peculiar reason to use raw nc, rather than scorpio hooks? If not, I can simply migrate to pioc...

oksanaguba commented 8 months ago

no rush, i have a way around this

brhillman commented 3 months ago

Is there a peculiar reason to use raw nc, rather than scorpio hooks?

Because it was easier and makes the build consistent with RRTMGP standalone/external if I remember correctly.