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

Adds icepack BGC #6457

Merged
merged 27 commits into from
Aug 6, 2024
Merged

Conversation

njeffery
Copy link
Contributor

@njeffery njeffery commented May 31, 2024

Updates the version of icepack to one that includes sea ice BGC. Also added capability to read from an input file atmospheric dust fluxes and dust-iron solubility maps. Added a namelist option to use a spatial field for dust-iron solubility rather than a constant.

Tested in ocean-sea ice BGC active simulations.

[NML]
[non-BFB] only for tests with biogeochemistry and/or sea ice aerosols active

Needs to be tested and merged with main icepack-integration branch
BFB in the physics.
Changed back to original formulation.
-bugfix in carbon conservation - Fluxes scaled by aicen not aicen_init
-puts snow aerosols into ice rather than ocean for small snow volumes
-Changes vertical z-tracer flags so that aerosols and bgc are turned on separately:
 1) config_use_column_biogeochemistry indicates biogeochemical tracers are on
 2) config_use_zaerosols indicates dust and black carbon are on

BFB in the default configuration.  nonBFB with zaerosols or column_biogeochemistry
This column_package subroutine was accidentally added during the merge.
BFB
Most of the updates are for use in init_zbgc which now
initializes many of the configs, indices and size declarations
for bgc

Contains updates to column package to make
puny and accuracy consistent with carbon conservation check

BFB with bgc and aerosols off
Removed zsalinity references
BFB
…ated-icepack-bgc

This version uses a branch of Icepack, not main  (see .gitmodules)
Modifications bring changes to enable Icepack bgc into master
BFB with physics only.
Added flag to turn off BGC coupling between the ocean and sea ice:
config_couple_bgc_fields=false

Added black carbon conservation analysis member
-track ocean black carbon flux

Added carbon conservation check options
in interfaces for both icepack and column

Bugfixes to column package version:
1. Bugfixes to lateral melt BGC snow flux and ice flux
2. Bugfix to add_new_ice_bgc
-replaces adjust_tracer_profile with simpler and
more accurate version update_vertical_bio_tracers

Define carbon molar mass in mpas constants
Commented out problematic omp directives in icepack interface

Corrections to some bgc Registry descriptions (still more to do)

NOTE: Changed submodule path for Icepack to a branch that works with the BGC interface.
nonBFB with BGC
-Cleans up some missing bgc info in Registry  (more to do)
-Adds some additional info to carbon conservation analysis member
-Saves bgc ocean fluxes weighted by ice area (for carbon conservation)
-Comments out $omp statements around step therm1 (code was crashing
-with seg fault)
-Removes and cleans up unnecessary write statements for carbon debugging

Tested with E3SM-Project/Icepack.git branch njeffery/merge-fixes-to-bgc
commit c090b4b20e4ec0317d2c7d742c5ab291ec7a2240
BFB except correcting a seg fault
Now consistent with E3SM master
BFB
Small error introduced in last commit - broke compile
BFB
Merge remote-tracking branch 'remotes/origin/njeffery/seaice/updated-icepack-bgc'
into origin/master
-First uses init_parameters to initialize bgc namelist parameters
-Second (icepack_init_zbgc_tracer_indices) calls bgc indexing and array definitions.
-Third defines parameter arrays for bgc (init_zbgc)

bfb  (round-off level in bgc)
Adds 2 namelist fields:
config_use_atm_dust_file - true, use monthly dust climatology
config_use_iron_solubility_file -- true, use dust-iron solubility map from file
(in icepack: use_atm_dust_sol = .not.config_use_iron_solubility_file)

New fields track atmospheric wet and dry dust separately from the coupler to compute the
iron contribution.

Fraction of iron in dust is also generalized and read from a file.
Dust/iron file is identical to the one used by mpas-o.

Corrects some units in Registry.

BFB with new namelist parameters = false and for all runs without zaerosols or without iron.
This field oceanDustIronFlux will be used by the ocean for
dust-iron consistency across the coupled system

Also corrects a bug in the calculation of iron from dust introduced
in the last commit

Works with E3SM-Project/Icepack.git origin/fixes-to-zaerosols-take3
BFB with zaerosols off
-adds subroutine in the icepack interface,
init_zbgc_tracer_indices, to replace icepack_init_zbgc_tracer_indices.

-moves icepack_init_bgc_trcr from icepack to
init_bgc_tracer_indices in  mpas_seaice_icepack

Tested in GCASE with ice-ocean bgc and aerosols active

works with njeffery/Icepack.git  branch: fixes-to-bgc-indices
@njeffery njeffery added BGC mpas-seaice non-BFB PR makes roundoff changes to answers. labels May 31, 2024
Copy link

github-actions bot commented May 31, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://E3SM-Project.github.io/E3SM/pr-preview/pr-6457/
on branch gh-pages at 2024-07-10 20:32 UTC

@eclare108213
Copy link
Contributor

I am still getting a bgc skl array bounds error in this version of the model with build debug flags on ... Any thoughts about how this should be fixed?

@njeffery pointed out that the problem code has a loop over nblyr, but skl should only be a single layer. E3SM doesn't run skl and so we'll need to decide what to do about it in the Consortium, independent of E3SM.

@jonbob
Copy link
Contributor

jonbob commented Jul 10, 2024

@njeffery -- I pushed a couple of commits back to your branch:

  1. Update the bld files to match Registry -- very minor but I did add back the logic for which column physics to use, as we discussed
  2. added support for the file related to the new DustIronMonthlyForcing stream be mesh-dependent and more generalized

I tested the DustIron part in a couple of cases, one where it showed up in the streams.seaice as expected and one where it did not, also expected. But please feel free to rename the variable I added. I also made sure the new file is on the inputdata repo

Copy link
Contributor Author

@njeffery njeffery left a comment

Choose a reason for hiding this comment

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

Great. Thanks @jonbob.

Copy link
Contributor Author

@njeffery njeffery left a comment

Choose a reason for hiding this comment

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

Perfect.

@apcraig
Copy link
Contributor

apcraig commented Jul 11, 2024

Is the Icepack version that goes with this commit still https://github.com/E3SM-Project/Icepack/tree/njeffery/fixes-to-bgc? It looks like there are no updates to that branch in the last 3 weeks, is that correct? Also, just FYI, this E3SM PR looks to me like it's not pointing to that version of Icepack. I understand that update may still need to be done and/or there may be other E3SM processes to do so, just wanted to point it out. Thanks.

@njeffery
Copy link
Contributor Author

@apcraig : It's pointing to #31ce422.

@apcraig
Copy link
Contributor

apcraig commented Jul 11, 2024

@njeffery, I see it now, sorry about my confusion. I needed to "see more commits" on the Icepack diffs link. Thanks. Looks good.

@njeffery
Copy link
Contributor Author

@apcraig : Whew! I had a little panic there for a moment...

@proteanplanet
Copy link
Contributor

proteanplanet commented Jul 11, 2024

Can I proceed with the BFB B-case No-BGC test now? I will be merging this branch into a branch from the current E3SM master, and then running a 12-month test of both with BGC switched off.

@njeffery
Copy link
Contributor Author

Yes. Thanks @proteanplanet

@rljacob
Copy link
Member

rljacob commented Jul 25, 2024

status: still getting tested with long comparisons.

@njeffery
Copy link
Contributor Author

@proteanplanet : Let me know if you have any concerns with this PR. It would be great if we could get this through this week. Thanks.

@proteanplanet
Copy link
Contributor

B-case tests are in progress on Chrysalis.

Copy link
Contributor

@proteanplanet proteanplanet left a comment

Choose a reason for hiding this comment

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

Additions and changes in this branch were cherry picked and tested in a branch from master on July 29, 2024 with BGC switched off. This test was to confirm that when sea ice BGC is switched off and brought into the code as a stealth feature, default B-case simulations using master are unaffected. Two parallel 12-month B-cases were integrated at standard V3 resolution from startup - one forked from master current to 466fa81, the second using the same fork, but with all commits particular to this branch out to cf6f75b. The results are that sea ice is unaffected across 10 metrics, indicating the model climate as a whole is unaffected:

    iceAreaCell 	BFB
    iceVolumeCell 	BFB
    icePressure 	BFB
    uVelocityGeo 	BFB
    vVelocityGeo 	BFB

    totalIceExtent 	BFB
    totalIceVolume 	BFB
    totalSnowVolume 	BFB
    totalKineticEnergy 	BFB
    averageAlbedo 	BFB

Therefore I approve this PR.

@njeffery
Copy link
Contributor Author

@proteanplanet : Great! thank you!

@jonbob
Copy link
Contributor

jonbob commented Jul 31, 2024

@eclare108213 -- can you sign off on this?

@jonbob jonbob added the NML label Jul 31, 2024
Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

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

Approved based on extensive testing by @njeffery and @proteanplanet. @apcraig is also testing the icepack changes in CICE, where problems appear to be related to configuration choices rather than to the BGC code itself. If we turn up changes needed in Icepack, we will submit them separately. Kudos to @njeffery -- this has been a HUGE amount of work!

@jonbob
Copy link
Contributor

jonbob commented Jul 31, 2024

passes e3sm_ice_developer suite on chrysalis with expected NML DIFFs

@njeffery
Copy link
Contributor Author

Yay! Thank you Everyone!

jonbob added a commit that referenced this pull request Jul 31, 2024
…t (PR #6457)

Adds icepack BGC

Updates the version of icepack to one that includes sea ice BGC

Tested in ocean-sea ice BGC active simulations.

[NML]
[non-BFB] only for tests with biogeochemistry and/or sea ice aerosols
          active
@jonbob
Copy link
Contributor

jonbob commented Jul 31, 2024

merged to next

@jonbob jonbob merged commit ebb7301 into master Aug 6, 2024
21 checks passed
@jonbob jonbob deleted the njeffery/seaice/update-icepack-bgc-v3-indices branch August 6, 2024 15:51
@jonbob
Copy link
Contributor

jonbob commented Aug 6, 2024

merged to master and expected DIFFs blessed -- except for one test that is still running on pm-cpu

@apcraig apcraig mentioned this pull request Aug 9, 2024
22 tasks
apcraig added a commit to CICE-Consortium/Icepack that referenced this pull request Sep 15, 2024
This is a significant update in the BGC including refactoring Icepack interfaces.

Deprecate skl BGC but leave code alone for now hoping we get help from the community to validate the latest code.

Add BGC parameters to icepack_parameters.F90

Update BGC physics, consistent with E3SM-Project/E3SM#6457.  Remove redundant arguments in BGC interfaces.

    icepack_aerosol.F90
        revised subroutine update_snow_bgc
    icepack_algae.F90
        revised subroutine zbio
        revised subroutine z_biogeochemistry
        revised subroutine algal_dyn
        add subroutine bgc_carbon_sum
    icepack_brine.F90
        revise subroutine prepare_hbrine
        revise subroutine update_hbrine
    icepack_mechred.F90
        add mbio calculation to subroutine ridge_shift
        add flux_bio calculation to subroutine ridge_ice
    icepack_therm_itd.F90
        update calculation of dvssl and dvint in subroutine lateral_melt
    icepack_zbgc.F90
        lots of stuff
    icepack_zbgc_shared.F90
        lots of stuff

Remove redundant arguments in non-BGC interfaces.

    icepack_atmo.F90
    icepack_fsd.F90
    icepack_isotope.F90
    icepack_itd.F90
    icepack_meltpond_topo.F90
    icepack_mushy_physics.F90
    icepack_snow.F90
    icepack_therm_bl99.F90
    icepack_therm_mushy.F90
    icepack_therm_shared.F90
    icepack_therm_vertical.F90
    icepack_tracers.F90
    icepack_wavefracspec.F90

Generalize merge_fluxes to make all arguments optional

Fix bug in subroutine snow_redist computation of hsn_new when nslyr=1

Update the Icepack driver consistent with Icepack interface changes

Update zbgc initialization in the Icepack driver, move bgc parameter intiialization to icepack_init_parameters, update icepack_init_zbgc call.

Update some calls to icepack_warnings_setabort to add file and line number.

Update warning package to improve OpenMP robustness. Fixes potential race conditions that show up when lots of output is produced.

Modified congel implementation in subroutine thickness_changes in icepack_therm_vertical.F90 to recover bit-for-bit results. New congel and new bgc implementation were bit-for-bit independently, but when combining the changes, the intel compiler (with -O2) introduces non bit-for-bit changes (roundoff).

Update bgc namelist defaults and settings in icepack_in

Update bgc tracer sizing in set_env files

Update testing, remove skl tests, add zaero tests.

---------

Co-authored-by: Elizabeth Hunke <[email protected]>
Co-authored-by: David Bailey <[email protected]>
Co-authored-by: Nicole Jeffery <[email protected]>
dabail10 added a commit to ESCOMP/Icepack that referenced this pull request Sep 20, 2024
This is a significant update in the BGC including refactoring Icepack interfaces.

Deprecate skl BGC but leave code alone for now hoping we get help from the community to validate the latest code.

Add BGC parameters to icepack_parameters.F90

Update BGC physics, consistent with E3SM-Project/E3SM#6457.  Remove redundant arguments in BGC interfaces.

    icepack_aerosol.F90
        revised subroutine update_snow_bgc
    icepack_algae.F90
        revised subroutine zbio
        revised subroutine z_biogeochemistry
        revised subroutine algal_dyn
        add subroutine bgc_carbon_sum
    icepack_brine.F90
        revise subroutine prepare_hbrine
        revise subroutine update_hbrine
    icepack_mechred.F90
        add mbio calculation to subroutine ridge_shift
        add flux_bio calculation to subroutine ridge_ice
    icepack_therm_itd.F90
        update calculation of dvssl and dvint in subroutine lateral_melt
    icepack_zbgc.F90
        lots of stuff
    icepack_zbgc_shared.F90
        lots of stuff

Remove redundant arguments in non-BGC interfaces.

    icepack_atmo.F90
    icepack_fsd.F90
    icepack_isotope.F90
    icepack_itd.F90
    icepack_meltpond_topo.F90
    icepack_mushy_physics.F90
    icepack_snow.F90
    icepack_therm_bl99.F90
    icepack_therm_mushy.F90
    icepack_therm_shared.F90
    icepack_therm_vertical.F90
    icepack_tracers.F90
    icepack_wavefracspec.F90

Generalize merge_fluxes to make all arguments optional

Fix bug in subroutine snow_redist computation of hsn_new when nslyr=1

Update the Icepack driver consistent with Icepack interface changes

Update zbgc initialization in the Icepack driver, move bgc parameter intiialization to icepack_init_parameters, update icepack_init_zbgc call.

Update some calls to icepack_warnings_setabort to add file and line number.

Update warning package to improve OpenMP robustness. Fixes potential race conditions that show up when lots of output is produced.

Modified congel implementation in subroutine thickness_changes in icepack_therm_vertical.F90 to recover bit-for-bit results. New congel and new bgc implementation were bit-for-bit independently, but when combining the changes, the intel compiler (with -O2) introduces non bit-for-bit changes (roundoff).

Update bgc namelist defaults and settings in icepack_in

Update bgc tracer sizing in set_env files

Update testing, remove skl tests, add zaero tests.

---------

Co-authored-by: Elizabeth Hunke <[email protected]>
Co-authored-by: David Bailey <[email protected]>
Co-authored-by: Nicole Jeffery <[email protected]>
dabail10 added a commit to ESCOMP/Icepack that referenced this pull request Oct 25, 2024
This is a significant update in the BGC including refactoring Icepack interfaces.

Deprecate skl BGC but leave code alone for now hoping we get help from the community to validate the latest code.

Add BGC parameters to icepack_parameters.F90

Update BGC physics, consistent with E3SM-Project/E3SM#6457.  Remove redundant arguments in BGC interfaces.

    icepack_aerosol.F90
        revised subroutine update_snow_bgc
    icepack_algae.F90
        revised subroutine zbio
        revised subroutine z_biogeochemistry
        revised subroutine algal_dyn
        add subroutine bgc_carbon_sum
    icepack_brine.F90
        revise subroutine prepare_hbrine
        revise subroutine update_hbrine
    icepack_mechred.F90
        add mbio calculation to subroutine ridge_shift
        add flux_bio calculation to subroutine ridge_ice
    icepack_therm_itd.F90
        update calculation of dvssl and dvint in subroutine lateral_melt
    icepack_zbgc.F90
        lots of stuff
    icepack_zbgc_shared.F90
        lots of stuff

Remove redundant arguments in non-BGC interfaces.

    icepack_atmo.F90
    icepack_fsd.F90
    icepack_isotope.F90
    icepack_itd.F90
    icepack_meltpond_topo.F90
    icepack_mushy_physics.F90
    icepack_snow.F90
    icepack_therm_bl99.F90
    icepack_therm_mushy.F90
    icepack_therm_shared.F90
    icepack_therm_vertical.F90
    icepack_tracers.F90
    icepack_wavefracspec.F90

Generalize merge_fluxes to make all arguments optional

Fix bug in subroutine snow_redist computation of hsn_new when nslyr=1

Update the Icepack driver consistent with Icepack interface changes

Update zbgc initialization in the Icepack driver, move bgc parameter intiialization to icepack_init_parameters, update icepack_init_zbgc call.

Update some calls to icepack_warnings_setabort to add file and line number.

Update warning package to improve OpenMP robustness. Fixes potential race conditions that show up when lots of output is produced.

Modified congel implementation in subroutine thickness_changes in icepack_therm_vertical.F90 to recover bit-for-bit results. New congel and new bgc implementation were bit-for-bit independently, but when combining the changes, the intel compiler (with -O2) introduces non bit-for-bit changes (roundoff).

Update bgc namelist defaults and settings in icepack_in

Update bgc tracer sizing in set_env files

Update testing, remove skl tests, add zaero tests.

---------

Co-authored-by: Elizabeth Hunke <[email protected]>
Co-authored-by: David Bailey <[email protected]>
Co-authored-by: Nicole Jeffery <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BGC mpas-seaice NML non-BFB PR makes roundoff changes to answers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants