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

Fix for specified ice layout non repro issue #200

Merged

Conversation

nikizadehgfdl
Copy link
Contributor

- Closes issue NOAA-GFDL#199
- Fix ice_layout non-repro of amip using specified ice mode
@MJHarrison-GFDL
Copy link
Contributor

Approved.

@marshallward
Copy link
Member

marshallward commented Sep 14, 2023

There seem to be regressions in two of the tests:

coupled_AM2_LM3_SIS2/Concurrent_ice_1deg/ocean.stats.gnu: FAILED
coupled_AM2_LM3_SIS2/Intersperse_ice_1deg/ocean.stats.gnu: FAILED

Oddly some compilers and mem layouts seem to pass and others fail. (Nevermind, seems pretty consistent over compilers. The odd ordering on the page confused me.)

If you have access, you can see which ones here: https://gitlab.gfdl.noaa.gov/ogrp/SIS2/-/pipelines/20620

@uramirez8707
Copy link

Thanks @nikizadehgfdl

This fixed the issue for the AM5 amip experiment. It now reproduces across layouts.

@@ -1274,7 +1274,7 @@ subroutine set_fast_ocean_sfc_properties( Atmos_boundary, Ice, IST, Rad, FIA, &
! timestep. However, it is safe (if wasteful) to call it more frequently.
if (Rad%do_sun_angle_for_alb) then
call set_ocean_albedo_from_astronomy(Ice, G, Time_start, Time_end)
elseif (coszen_changed) then
elseif (coszen_changed .or. Ice%sCS%specified_ice) then
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something about this mod is troublesome. If this is to change anything at all, it must be that coszen_change is false but Ice%albedo(k=1) is changing inside set_ocean_albedo_from_coszen. Yet Ice%albedo(k=1) depends only on coszen and should not change if coszen does not!
One way out of this is if Rad%coszen_nextrad has changed since the previous time this sub was called but is still equal to Rad%coszen_lastrad. One way to test this is to set Rad%coszen_lastrad = Rad%coszen_nextrad before line 1258 above.

@uramirez8707
Copy link

@marshallward any idea when this is going to be merged?

@marshallward
Copy link
Member

marshallward commented Oct 2, 2023

@uramirez8707 We still need to address the regression raised above. AFAIK it is still happening. I will do this test again when I get some time.

@marshallward
Copy link
Member

marshallward commented Oct 2, 2023

I looked further into this. The Ice%sCS%specified_ice caused a segmentation fault in the two failing tests.

I am guessing that it was not properly allocated or associated. @nikizadehgfdl can you look into this and try to fix it?

@marshallward
Copy link
Member

marshallward commented Oct 2, 2023

Maybe you can fix this with an if (associated(Ice%sCS)) then ... but I will leave it to you all to decide.

@marshallward
Copy link
Member

@nikizadehgfdl I can merge this once the possibility of an unallocated Ice@sCS is handled. Do you still need this?

- Closes issue NOAA-GFDL#199
- Specified-Ice mode needs albedo update at every timestep because coszen changes every timestep
- Fix ice_layout non-repro of amip using specified ice mode
- Ensure Ice%sCS is associated before checking Ice%sCS%specified_ice
@marshallward
Copy link
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/SIS2/-/pipelines/21183 ✔️ 🟡

@marshallward marshallward merged commit 306bf18 into NOAA-GFDL:dev/gfdl Nov 1, 2023
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.

4 participants