-
Notifications
You must be signed in to change notification settings - Fork 237
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
Implement sea-ice freeboard cost #821
Open
owang01
wants to merge
1
commit into
MITgcm:master
Choose a base branch
from
owang01:freeboard_cost
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
#include "ECCO_OPTIONS.h" | ||
#ifdef ALLOW_SEAICE | ||
# include "SEAICE_OPTIONS.h" | ||
#endif | ||
#ifdef ALLOW_SHELFICE | ||
# include "SHELFICE_OPTIONS.h" | ||
#endif | ||
|
@@ -30,6 +33,11 @@ SUBROUTINE ECCO_PHYS( myTime, myIter, myThid ) | |
# include "ECCO_SIZE.h" | ||
# include "ECCO.h" | ||
#endif | ||
#ifdef ALLOW_SEAICE | ||
# include "SEAICE_SIZE.h" | ||
# include "SEAICE.h" | ||
# include "SEAICE_PARAMS.h" | ||
#endif | ||
#ifdef ALLOW_PTRACERS | ||
# include "PTRACERS_SIZE.h" | ||
# include "PTRACERS_FIELDS.h" | ||
|
@@ -82,16 +90,23 @@ SUBROUTINE ECCO_PHYS( myTime, myIter, myThid ) | |
#ifdef ALLOW_PSBAR_STERIC | ||
_RL VOLsumTile(nSx,nSy), RHOsumTile(nSx,nSy) | ||
_RL VOLsumGlob_1, RHOsumGlob_1 | ||
c CHARACTER*(MAX_LEN_MBUF) msgBuf | ||
C CHARACTER*(MAX_LEN_MBUF) msgBuf | ||
#endif | ||
C Mload :: total mass load (kg/m**2) | ||
c _RL Mload(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) | ||
C _RL Mload(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) | ||
#ifdef ALLOW_SEAICE | ||
_RL tmprecip_area, tmphsnowact, tmpheffact | ||
_RL area_reg_sq | ||
#endif | ||
#if ( defined ALLOW_AUTODIFF_TAMC && defined ALLOW_GENCOST_CONTRIBUTION ) | ||
C ikey :: tape key (depends on kgen) | ||
INTEGER ikey | ||
#endif | ||
CEOP | ||
|
||
#ifdef ALLOW_SEAICE | ||
area_reg_sq = SEAICE_area_reg * SEAICE_area_reg | ||
#endif | ||
tmpfac = recip_rhoConst*recip_gravity | ||
sIceLoadFacLoc = zeroRL | ||
IF ( useRealFreshWaterFlux ) sIceLoadFacLoc = recip_rhoConst | ||
|
@@ -345,6 +360,28 @@ SUBROUTINE ECCO_PHYS( myTime, myIter, myThid ) | |
ENDDO | ||
areavolGlob=0. _d 0 | ||
|
||
#ifdef ALLOW_SEAICE | ||
IF (gencost_barfile(kgen)(1:11).EQ.'m_freeboard') THEN | ||
DO bj=myByLo(myThid),myByHi(myThid) | ||
DO bi=myBxLo(myThid),myBxHi(myThid) | ||
DO j = 1,sNy | ||
DO i = 1,sNx | ||
tmprecip_area = 1. _d 0/SQRT(area(i,j,bi,bj)*area(i,j,bi,bj) | ||
& + area_reg_sq) | ||
tmphsnowact = hsnow(I,J,bi,bj) * tmprecip_area | ||
tmpheffact = heff(I,J,bi,bj) * tmprecip_area | ||
gencost_storefld(i,j,bi,bj,kgen) = | ||
& ( ( tmphsnowact + tmpheffact ) - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you add a comment somewhere to say what this equation says? it 's the full actual thickness of (ice+snow) minus the equivalent when converted to water? |
||
& ( tmphsnowact * SEAICE_rhoSnow + | ||
& tmpheffact * SEAICE_rhoIce ) * recip_rhoConst | ||
& ) * maskC(i,j,1,bi,bj) | ||
ENDDO | ||
ENDDO | ||
ENDDO | ||
ENDDO | ||
ENDIF | ||
#endif | ||
|
||
DO bj=myByLo(myThid),myByHi(myThid) | ||
DO bi=myBxLo(myThid),myBxHi(myThid) | ||
DO j = 1,sNy | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because SEAICE_area_reg can be a read-in param from data.seaice, it's possible some user might set it to zero, thus resulting in division by zero here?