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

Bug fix that causes MPAS to crash with frac_seaice=false. #1278

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tanyasmirnova
Copy link

The title above should be a 1 line short summary of the pull request (i.e. what the project the PR represents is intended to do).

Enter a description of this PR. This should include why this PR was created, and what it does.
Changes to the code related to fractional sea ice in
mpas_atmphys_driver_seaice.F, mpas_atmphys_driver_sfclayer.F,
mpas_atmphys_lsm_shared.F:
1. Fixed bug that caused MPAS to crash with frac_seaice=false. It is
fixed with adding 'if(config_frac_seaice) then' around the code in seaice
driver that uses *_sea variables, which are not allocated. For example,
in the line:
chs_p(i,j) = xice_p(i,j)*chs_p(i,j) + (1._RKIND-xice_p(i,j))*chs_sea(i,j)
2. We've seen a computational problem with the current use of cpm
variable in seaice driver:
cpm(i) = xice_p(i,j)*cpm(i) + (1._RKIND-xice_p(i,j))*cpm_sea(i,j)
which is fixed by treating cpm as all other variables:
cpm_p(i,j) = xice_p(i,j)*cpm_p(i,j) + (1._RKIND-xice_p(i,j))*cpm_sea(i,j)
3. We recommend to replace
if(xice_p(i,j).ge.xice_threshold .and. xice_p(i,j).le.1._RKIND)
with
if(xice_p(i,j).ge.xice_threshold .and. xice_p(i,j).lt.1._RKIND) then
to avoid unnecessary computations over vast areas in Arctic covered with
sea ice where xice_p(i,j) = 1.

Testing and relations to other Pull Requests should be added as subsequent comments.
This code is tested in the MPAS runs at GSL.
This PR will fix the issue #1275.

See the below examples for more information.
MPAS-Dev/MPAS#930
MPAS-Dev/MPAS#931

mpas_atmphys_driver_seaice.F, mpas_atmphys_driver_sfclayer.F,
mpas_atmphys_lsm_shared.F:
1. Fixed bug that caused MPAS to crash with frac_seaice=false. It is
fixed with adding 'if(config_frac_seaice) then' around the code in seaice
driver that uses *_sea variables, which are not allocated. For example,
in the line:
chs_p(i,j)  = xice_p(i,j)*chs_p(i,j)  + (1._RKIND-xice_p(i,j))*chs_sea(i,j)
2. We've seen a computational problem with the current use of cpm
variable in seaice driver:
cpm(i) = xice_p(i,j)*cpm(i) + (1._RKIND-xice_p(i,j))*cpm_sea(i,j)
which is fixed by treating cpm as all other variables:
cpm_p(i,j)  = xice_p(i,j)*cpm_p(i,j)  + (1._RKIND-xice_p(i,j))*cpm_sea(i,j)
3. We recomment to replace
if(xice_p(i,j).ge.xice_threshold .and. xice_p(i,j).le.1._RKIND)
with
if(xice_p(i,j).ge.xice_threshold .and. xice_p(i,j).lt.1._RKIND) then
to avoid unnecessary computations over vast areas in Arctic covered with
sea ice where xice_p(i,j) = 1.
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.

1 participant