Skip to content

Make internal_heat optional so it works when geothermal heating is disable in MOM6#34

Open
yichengt900 wants to merge 1 commit intoNOAA-GFDL:mainfrom
yichengt900:bug/internal_heat
Open

Make internal_heat optional so it works when geothermal heating is disable in MOM6#34
yichengt900 wants to merge 1 commit intoNOAA-GFDL:mainfrom
yichengt900:bug/internal_heat

Conversation

@yichengt900
Copy link
Copy Markdown

As @andrew-c-ross originally reported here, COBALT uses the internal (geothermal) heat argument to calculate an iron flux:

cobalt%ffe_geotherm(i,j) = cobalt%ffe_geotherm_ratio*internal_heat(i,j)*4184.0/dt

However, the internal_heat is a null pointer by default in MOM6 and is only allocated when DO_GEOTHERMAL = True is set in MOM_input/MOM_override:
https://github.com/NOAA-GFDL/MOM6/blob/2c1a9d32fce72828b7091e6f623c0ec20069e637/src/core/MOM.F90#L2812

We will encounter a segmentation fault in COBALT if the user accidentally sets DO_GEOTHERMAL = false. This PR, proposed by @andrew-c-ross, addresses this issue by checking if internal_heat is a null pointer (by making it an optional argument in generic_COBALT_update_from_source subroutine and checking if it is present) and assuming zero internal heating/iron flux if it is null.

@andrew-c-ross
Copy link
Copy Markdown
Contributor

Thanks Yi-Cheng!

@charliestock
Copy link
Copy Markdown
Contributor

Looks good Yi-Cheng. Thank you!

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