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

Ensure non-negative tracer values and conservation by virtual flux correction #485

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

matsbn
Copy link
Contributor

@matsbn matsbn commented Feb 9, 2025

Tracers are enforced to be non-negative and and any tracer quantity added to ensure non-negative values are compensation for by a global virtual flux correction.

The simulation n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250204 was started as a hybrid simulation from year 29 of NorESMhub/noresm3_dev_simulations#68 to test the impact of this PR. Diagnostics can be found here: https://ns2345k.web.sigma2.no/datalake/diagnostics/noresm/matsbn/n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250204/

Some erratic biogeochemistry global flux time-series (net downward CO2 flux) and global averages (DIC and alkalinity) seems to be mitigated in the new simulation. It should be noted that recent changes to iHAMOCC included in the code base used for 1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250204 could also contribute to this improvement. Then there are difference to the evolution of global averages of oxygen, phosphate and nitrate that would be useful with comments on.

Global average salinity has a stronger increase in n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250204 compared to NorESMhub/noresm3_dev_simulations#68. Apparently and unintentionally, CICE started from the initial condition set in user_nl_cice, and not the year 29 restart of NorESMhub/noresm3_dev_simulations#68. The resulting sea-ice volume build-up might explain the salinity evolution. A new simulation is underway to make sure CICE starts from the year 29 restart of NorESMhub/noresm3_dev_simulations#68.

…ve values can typically occur after application of virtual surface fluxes, and any tracer quantity added to ensure non-negative values are compensation for by a global virtual flux correction. Also made the tracer virtual flux computation in standalone "ben02" mode consistent with the computation when coupled to NorESM.
@matsbn matsbn mentioned this pull request Feb 7, 2025
4 tasks
Copy link
Contributor

@JorgSchwinger JorgSchwinger left a comment

Choose a reason for hiding this comment

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

A general question about the time-stepping: Now the salt and tracer correction is calculated but applied one time-step later, correct? This is why it has to be saved in the restart files. When in this sequence is HAMOCC called? Is this after the correction has been applied? HAMOCC cannot be called with negative tracer values. In fact we have the routine trc_limitc, which is called before HAMOCC and makes sure no negative values occur. Assuming that the virtual fluxes are the only potential source of negative values, this routine should then be removed?

@matsbn
Copy link
Contributor Author

matsbn commented Feb 10, 2025

A general question about the time-stepping: Now the salt and tracer correction is calculated but applied one time-step later, correct? This is why it has to be saved in the restart files. When in this sequence is HAMOCC called? Is this after the correction has been applied? HAMOCC cannot be called with negative tracer values. In fact we have the routine trc_limitc, which is called before HAMOCC and makes sure no negative values occur. Assuming that the virtual fluxes are the only potential source of negative values, this routine should then be removed?

Yes, the tracer added to ensure non-negative values is compensated as a correction of the virtual tracer flux applied the next time-level. Ensuring non-negative tracer values (of the 'k+nn' time-level) happens in routine 'mxlayr' when isopycnic coordinate is used and in routine 'ale_vdifft' otherwise. These routines are called before routine 'updtrc' is called, so there should be no negative tracer values entering HAMOCC (assuming 'k+nn' time-level is used). So I think the limiting in 'trc_limitc' can now be skipped.

@matsbn matsbn added this to the BLOM v1.7.1 tag milestone Feb 10, 2025
@JorgSchwinger
Copy link
Contributor

Regarding the trc_limitc routine, I would suggest merging this now and then removing the routine later (we can first issue an error if negative tracer values are encountered to make sure everything works as expected). I can do this in a subsequent PR.

@matsbn
Copy link
Contributor Author

matsbn commented Feb 12, 2025

Regarding the trc_limitc routine, I would suggest merging this now and then removing the routine later (we can first issue an error if negative tracer values are encountered to make sure everything works as expected). I can do this in a subsequent PR.

Sounds like a good plan. A simulation NorESMhub/noresm3_dev_simulations#86 with correct CICE restart file for a hybrid run of NorESMhub/noresm3_dev_simulations#68 has soon completed 7+7 years. After the first 7 years, the salinity evolution is very close to the reference case: https://ns2345k.web.sigma2.no/datalake/diagnostics/noresm/matsbn/n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250205/BLOM_DIAG/yrs29to35-n1850.ne30_tn14.hybrid_wavparam_fatessp.20241226/set1/set1_ann_salnga_2models.png.

Let me verify that the last 7 years also look reasonable, then I'll merge.

@matsbn
Copy link
Contributor Author

matsbn commented Feb 12, 2025

The simulation n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250205 (NorESMhub/noresm3_dev_simulations#86) completed 13 years (crash in final year that seems unrelated to the code changes).

Diagnostics can be found here: https://ns2345k.web.sigma2.no/datalake/diagnostics/noresm/matsbn/n1850.ne30_tn14.hybrid_wavparam_vfcor_fatessp.20250205/

Time series of global average salinity and iHAMOCC fields are shown below. Salinity evolution seems fine and also iHAMOCC averaged variables with the additional iHAMOCC changes taken into account.

image
image

@matsbn matsbn merged commit b84bbf7 into NorESMhub:master Feb 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants