Skip to content

Remove W3_IS2 compile guard from IC5 floe diameter update in w3wavemd - #15

Merged
ezhilsabareesh8 merged 1 commit into
dev/2026.03from
fix_ic5_update_for_ic4
Jun 25, 2026
Merged

ezhilsabareesh8 merged 1 commit into
dev/2026.03from
fix_ic5_update_for_ic4

Conversation

@ezhilsabareesh8

Copy link
Copy Markdown
Collaborator

This PR fixes the missing W3UIC5 update in IC4 builds by removing incorrect #ifdef W3_IS2 guards in w3wavemd.F90.

In ACCESS-OM3 IC4 IS0 configurations, CICE correctly exports floe diameter as Si_floediam, and WW3 imports it into ICEP5, but the W3UIC5 call that copies ICEP5 into ICEF was not compiled because W3_IS2 is not defined. As a result, ICEF stayed at its hard-coded initial value of 1000 m throughout the run.

The fix removes the unnecessary compile guards while keeping the existing runtime check, refer here:

IF ( FLIC5 .AND. DTI50.NE.0. ) THEN
  CALL W3UIC5( FLFRST )
END IF

Validation with access-om3/pr242-1 confirms the fix: ICEF is no longer constant 1000 m, but varies from the CICE FSD floor value of 5.4 m up to ~1255 m, consistent with 2 × fsdrad.

This restores the intended CICE → CMEPS → WW3 floe-diameter coupling path for IC4 wave-ice scattering.

The fixed build produces spatially varying ICEF values instead of the constant 1000 m initialisation value:

Day Ice cells ICEF min ICEF mean ICEF max
2 Jan 1958 7,907 5.4 m 20.8 m 830.8 m
3 Jan 1958 8,174 5.4 m 41.3 m 839.8 m
4 Jan 1958 8,356 5.4 m 62.0 m 1101.6 m
5 Jan 1958 8,478 5.4 m 75.3 m 1239.9 m
6 Jan 1958 8,534 5.4 m 84.9 m 1255.2 m
Buggy build 17,016 1000.0 m 1000.0 m 1000.0 m

Comment thread model/src/w3wavemd.F90
!
! 1.e Ice floe interval
!
#ifdef W3_IS2

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.

Are there cases where this code shouldn't be included ?

should this say

#if defined(W3_IS2) || defined(W3_IS0) or something ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @anton-seaice, I checked this, and I don’t think this should be changed to:

#if defined(W3_IS2) || defined(W3_IS0)

The reason is that this update is not really specific to either "IS2" or "IS0". "W3UIC5" is the generic updater for the IC5 floe-diameter input field: it copies the imported forcing field "ICEP5" into the internal WW3 fields "ICEF" / "ICEDMAX".

So the correct gate is the existing runtime condition:

IF ( FLIC5 .AND. DTI50.NE.0. ) THEN
CALL W3UIC5( FLFRST )
END IF

"FLIC5" is set from "INFLAGS1(-3)", i.e. whether the IC5/floe-diameter input is actually active. In ACCESS-OM3 this is enabled by "wav_coupling_to_cice = .true." / "ICE_PARAM5 = C". If IC5 forcing is not active, "FLIC5" is false and this block does not run.

So there are cases where the code should not execute, but that is already handled by "FLIC5". I don’t think there are cases where it needs to be compiled out based on the selected sea-ice source/scattering switch.

Using "#if defined(W3_IS2) || defined(W3_IS0)" would fix the current "IC4 IS0" case, but it would still couple a generic forcing-field update to particular ice physics switches. That seems more fragile than using the existing runtime forcing flag.

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.

Ok thanks

@ezhilsabareesh8
ezhilsabareesh8 merged commit 3372234 into dev/2026.03 Jun 25, 2026
6 checks passed
@ezhilsabareesh8
ezhilsabareesh8 deleted the fix_ic5_update_for_ic4 branch June 25, 2026 04:01
ezhilsabareesh8 added a commit to ACCESS-NRI/access-om3-configs that referenced this pull request Aug 10, 2026
**1. Summary**:

This build updates the component versions to MOM6 `2026.05.002`, CICE6
`CICE6.6.3-2`, and WW3 `2026.03.001`. It includes MOM6 diagnostic and
numerical fixes, a CICE supergrid fix, and WW3 memory leak and floe size
output fixes.

**2. Issues Addressed:**

- Add a minimum-thickness clamp in `mixedlayer_restrat_Bodner` ([MOM6
#61](ACCESS-NRI/MOM6#61)).
- Add the `FILE_DYE_TRACER_ACCUMULATE` parameter for file-based dye
tracers ([MOM6 #67](ACCESS-NRI/MOM6#67)).
- Save the correct thickness for the `vert_remap_h` diagnostic ([MOM6
#66](ACCESS-NRI/MOM6#66)).
- Add a numerical-mixing diagnostic ([MOM6
#57](ACCESS-NRI/MOM6#57)).
- Fix `ANGLE` and tripole closure in the MOM supergrid ([CICE
#50](ACCESS-NRI/CICE#50)). This is
answer-changing.
- Remove the `W3_IS2` compile guard from the IC5 floe-diameter update
([WW3 #15](ACCESS-NRI/WW3#15)).
- Avoid ST6 `IRANGE` heap allocations in source loops ([WW3
#16](ACCESS-NRI/WW3#16)).

**3. Dependencies (e.g. on payu, model or om3-scripts)**

This change requires changes to (note required version where true):
- [ ] payu:
- [x] access-om3: 2026.05.003
- [ ] om3-scripts:

**5. CI Testing**

- [x] `!test repro` or `!test repro commit` has been run

The determinism tests pass for the new build.

**6. Reproducibility**

Is this reproducible with the previous commit? (If not, why not?)
- [ ] Yes
- [x] No

The CICE supergrid fix is answer-changing

**7. Documentation**

The docs folder has been updated with output from running the model?
- [ ] Yes
- [x] N/A

A PR has been created for updating the documentation?
- [ ] Yes: <!--link-->
- [x] N/A

**8. Formatting**

Changes to MOM_input have been copied from model output in
docs/MOM_parameter_docs.short?
- [ ] Yes
- [x] N/A

**9. Merge Strategy**

- [ ] Merge commit
- [ ] Rebase and merge
- [x] Squash

---------

Co-authored-by: access-bot <113399144+access-bot@users.noreply.github.com>
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.

2 participants