Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake build system and Pkgconf pc file #17

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Conversation

harshula
Copy link

No description provided.

Pearse Buchanan and others added 4 commits November 12, 2024 11:26
* Variable remineralisation rate (reminr) that increases as phytoplankton biomass increases and decreases with depth (emulating variable sinking rate of detritus)
* Fixed a bug in the calculation of the minimum Fe quota of phytoplankton that reduced their dFe limitation
* Added new diagnostics, particularly for terms contributing to the calculation of nutrient limitations
* Zooplankton grazing of detritus, now we have additional diagnostics
* Bug fix of zooplankton excretion on Fe having the Fe2C quota of Zoo, not Phy
* spatially variable sinking of detritus via "move_vertical" option
* hence, removed the spatially complex variations in remineralisation rates
* moved DIC and aDIC source/sink calculations into the nested timestep
…My changes are:

* new light diagnostics and chlorophyll light limitation diagnostic
* made zooplankton epsilon (prey capture coefficient) variable from zooepsmin to zooepsmax
* slowed dFe uptake by phytoplankton to min of 20% under darkness and nitrogen limitation
* made remineralisation of detritus quadratic rather than linear to allow more detrital aggregation in gyres
@harshula harshula self-assigned this Nov 19, 2024
@harshula harshula marked this pull request as draft November 19, 2024 02:46
@harshula harshula changed the title Add CMake build system and Add CMake build system and Pkgconf pc file Nov 19, 2024
Copy link
Member

@micaeljtoliveira micaeljtoliveira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshula Here are some comments plus a couple of questions.

CMakeLists.txt Outdated
find_package(MPI REQUIRED COMPONENTS Fortran)
find_package(PkgConfig REQUIRED)
pkg_check_modules(NETCDF REQUIRED IMPORTED_TARGET "netcdf-fortran")
pkg_check_modules(FMS REQUIRED IMPORTED_TARGET "FMS")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FMS provides CMake exports, which seem to be correctly generated and installed in the ACCESS-NRI FMS fork. That means you can replace this with the following:

Suggested change
pkg_check_modules(FMS REQUIRED IMPORTED_TARGET "FMS")
find_package(FMS COMPONENTS R8 REQUIRED)

This will define a FMS::fms_r8 target that should be used instead of PkgConfig::FMS.

Doing it this way will ensure that the double precision enabled FMS is used and throw a meaningful error early on if someone made a mistake in specifying the dependencies in spack. It will also properly propagate the target dependencies to other packages like OM3 and should allow CMake to correctly handle the situation where FMS is both a direct dependency of OM3 and an indirect dependency via GFDL-generic-tracers.

gfdl-generic-tracers.pc.in Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated
PkgConfig::MOCSY
PkgConfig::NETCDF)

install(TARGETS gtracers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to also exports the targets here.

CMakeLists.txt Show resolved Hide resolved
Pearse Buchanan and others added 2 commits November 26, 2024 13:31
* Missed the retuning of dFe back to a minimum concentration at every timestep. This happens under "Additional operations on dissolved iron"

Also took the opportunity to:

* Add N and C conservation of mass checks
* remove some unnecessary print statements
* reduce dFe scavenging rates
* Apply limitations to dFe uptake at night and when N is limiting
* increase zooplankton quadratic mortality but halve their linear mortality
* also reduced phytoplankton linear and quadratic mortality
* Adjustment of zooepsmin and zooepsmax values from 0.025 - 0.5 to 0.01 - 0.1
Pearse Buchanan added 2 commits December 4, 2024 08:30
* Explicit ALK source and sink terms within nested tilmestep
* Using GOLDtridiag with vertical_movement for consistency with MOM6
* Variable epsilon of zooplankton with phy biomass and temp dependencies
Pearse Buchanan and others added 4 commits December 9, 2024 11:59
…wer bounds on the DIC concentration that feeds into the omip2_co2calc subroutine. Setting upper and lower limits of the DIC that is fed into the subroutine does not preclude DIC concentrations from going higher or lower than those limits, but only ensures that the air-sea fluxes are reasonable.
…n the interior, and also added a max to Alk in the CO2 flux calculations
@harshula harshula force-pushed the development branch 5 times, most recently from 41acfb1 to 4a79dc7 Compare December 12, 2024 09:41
Pearse Buchanan and others added 3 commits December 13, 2024 14:39
* Dissolution of CaCO3 based on detrital remin and saturation states of aragonite and calcite (Kwon et al., 2024)
* Precipation of CaCO3 based on HCO3- to H+ ratio (Lehmann et al., in prep)
* Sinking rate of material affected by ballasting, specifically CaCO3/Det ratio (Bach et al., 2016)

These feedbacks can be turned on and off using the "caco3_dynamics" logical
Removed adic as a tracer because CaCO3 dynamics mean that it is not appropriate
Also altered some of the parameters.
@harshula
Copy link
Author

Update

The Spack interaction with upstream netcdf-fortran (autotools), ACCESS-NRI's FMS (CMake) and ACCESS-NRI's GFDL-generic-tracers (CMake) is complicated if we don't use pkgconf and use CMake's native find_package().

Spack's netcdf-fortran SPR builds via autotools. i.e. No CMake exports. Spack's FMS SPR builds via CMake and uses the FindNetCDF.cmake file that resides within FMS. I've modified ACCESS-NRI's FMS to do the same instead of using pkgconf. When I made the changes, that were recommended above, and switched ACCESS-NRI's GFDL-generic-tracers from using pkgconf to CMake's find_package to find FMS, CMake looks for a FindNetCDF.cmake in GFDL-generic-tracers too. Adding a file to accommodate a dependency's dependency is bad practice.

I had a chat with @micaeljtoliveira about this on Friday. He suggested trying to export the FindNetCDF.cmake in FMS. So this PR will be paused till ACCESS-NRI's FMS is updated.

Pearse Buchanan and others added 4 commits January 9, 2025 11:45
…CaCO3 via saturation states (cal and ara) and detrius remin
…ing when vertical_movement==.true.

Also:
* Added "zooexcr" as an input parameter
* Added "fbury" as a diagnostic, rathern than outputting det_sed_bury, detfe_sed_bury and caco3_sed_bury
* Fixed a minor bug in the "fbury" array, which involved the wrong units
…de small edits to:

* remove background dissolution of CaCO3 in absence of detritus
Pearse Buchanan added 2 commits January 21, 2025 11:40
…ns that any NO3 and Alkalinity that is lost through burial is added back to the ocean budget via a surface flux in exactly the same location.
…estion, rather than at the same exact lon,lat location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Status: No status
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants