Skip to content

Wombatlite april2026#99

Merged
pearseb merged 22 commits into
mainfrom
wombatlite-April2026
Apr 20, 2026
Merged

Wombatlite april2026#99
pearseb merged 22 commits into
mainfrom
wombatlite-April2026

Conversation

@pearseb

@pearseb pearseb commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Hey @dougiesquire

These are small additions to WOMBAT-lite. Since I have been working on WOMBAT-mid a lot, some of the advances in WOMBAT-mid are transferable to WOMBAT-lite and probably should be the same. these include:

  1. two ligand complexation with iron, not just one
  2. dynamic prey switching by zooplankton
  3. a control of colloidal shunt and two ligand complexation as logicals in the input.nml
  4. a control of the dFe floor in the field_table

Sorry to add to your mountain of work but this should be quite simple and easy to merge with main.

pearseb added 2 commits April 10, 2026 09:30
- added logicals for `do_colloidal_shunt` and `do_two_ligands` in iron chemistry
- added routine for two ligand complexation of iron and updated conditional stability constant in line with Ye et al. (2020)
- added prey switching dynamic for zooplankton grazing
- ensured minimum iron concentration is 50 pM
Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
removed unnecessary variable `zno3`
@pearseb pearseb marked this pull request as draft April 10, 2026 01:18

@dougiesquire dougiesquire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @pearseb. Some comments/questions below.

I was worried about the cost impact of doing 30 iterations for the two ligand bisection at every grid cell.

I ran 2 x 1 year runs of this configuration with do_two_ligands set to .true. and .false..

do_two_ligands = .false.

$ grep -r "payu_model_run_duration_seconds" payu_jobs/
payu_jobs/0/run/165895773.gadi-pbs.json:        "payu_model_run_duration_seconds": 1450.404177219607,
payu_jobs/1/run/165902070.gadi-pbs.json:        "payu_model_run_duration_seconds": 1430.7093261787668,

do_two_ligands = .true.

$ grep -r "payu_model_run_duration_seconds" payu_jobs/
payu_jobs/0/run/165895774.gadi-pbs.json:        "payu_model_run_duration_seconds": 1625.5848535923287,
payu_jobs/1/run/165903936.gadi-pbs.json:        "payu_model_run_duration_seconds": 1521.5471708243713,

So there is a pretty significant cost (~10%).

I think we could improve this using the Newton-Raphson method which I think suits the problem and will require much fewer iterations. I'll try to implement and test while you address my comments below.

Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
Comment thread documentation/docs/pages/Model_description/WOMBATlite_model_description.md Outdated
Comment thread generic_tracers/generic_WOMBATlite.F90
Comment thread generic_tracers/generic_WOMBATlite.F90
Comment thread generic_tracers/generic_WOMBATlite.F90
Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
Comment thread documentation/docs/pages/Model_description/WOMBATlite_model_description.md Outdated
@dougiesquire

Copy link
Copy Markdown
Collaborator

I rewrote and tested the two ligand bisection code to use Newton-Raphson. I tested across 10,000 sets of parameters across the ranges:

fe_sfe : 0.001  - 100  umol Fe/m3
K1     : 10  -  10000  m3/umol
K2     : K1 * 10^-1.5
L1     : 0.1   -  1.0  umol/m3
L2     : 0.5   -  3.0  umol/m3

where 

- K1/K2 = strong/weak ligand stability constants
- L1/L2 = strong/weak ligand concentrations

With 8 Newton-Raphson iterations, the solution for all sets of parameters produces a relative residual less than 1e-6, or an absolute residual that is less than that from 30 bisection iterations.

The timings (as above) for 8 Newton-Raphson iterations are:

do_two_ligands = .false.

$ grep -r "payu_model_run_duration_seconds" payu_jobs/
payu_jobs/0/run/165956251.gadi-pbs.json:        "payu_model_run_duration_seconds": 1425.3137839641422,

do_two_ligands = .true.

grep -r "payu_model_run_duration_seconds" payu_jobs/
payu_jobs/0/run/165956257.gadi-pbs.json:        "payu_model_run_duration_seconds": 1477.0212698340038,

So ~3% slower (as expected). As we discussed, let's make this change and default to do_two_ligands = .false..

I'll push these changes now.

dougiesquire added a commit that referenced this pull request Apr 16, 2026
Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
Comment thread generic_tracers/generic_WOMBATlite.F90
Comment thread generic_tracers/generic_WOMBATlite.F90 Outdated
pearseb and others added 4 commits April 17, 2026 15:28
Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
Co-authored-by: Pearse J Buchanan <pearseb@users.noreply.github.com>
When `do_two_ligands` == FALSE, made the bulk ligand binding strength a weight average of strong and weak ligand binding
Updated docs to refelct above changes, and also including new tables at the start for logicals, diagnostics and tracers
@pearseb pearseb requested a review from dougiesquire April 20, 2026 04:25
@dougiesquire dougiesquire marked this pull request as ready for review April 20, 2026 06:21

@dougiesquire dougiesquire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One small correction, and some formatting inconsistencies

Comment thread documentation/docs/pages/Model_description/WOMBATlite_model_description.md Outdated
Comment thread documentation/docs/pages/Model_description/WOMBATlite_model_description.md Outdated
pearseb and others added 2 commits April 20, 2026 17:36
…scription.md

Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
…scription.md

Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
@ACCESS-NRI ACCESS-NRI deleted a comment from dougiesquire Apr 20, 2026
Comment thread documentation/docs/pages/Model_description/WOMBATlite_model_description.md Outdated
Co-authored-by: Pearse J Buchanan <pearseb@users.noreply.github.com>

@dougiesquire dougiesquire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @pearseb!

@pearseb pearseb merged commit af22b42 into main Apr 20, 2026
6 checks passed
@pearseb pearseb deleted the wombatlite-April2026 branch April 20, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants