-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add SAL updates and topographic wave drag schemes for barotropic tides #6310
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
67d16df
Update SAL and AMHarmonicAnalysis to respect initial SSH offsets
dengwirda 14e19d3
Update SAL and AMHarmonicAnalysis to respect initial SSH offsets
dengwirda 992db9b
Update SAL and AMHarmonicAnalysis to respect initial SSH offsets
dengwirda 3c32bd4
Update SAL and AMHarmonicAnalysis to respect initial SSH offsets
dengwirda 75ebe3d
Added two new topographic wave drag schemes.
knbarton d02d740
Added local generation formula topograhpic wave drag scheme
knbarton 687c935
Remove double multiplication by topographic wave drag coefficient
knbarton f5eaa4b
Fix issue where topographic wave drag was being multiplied by tendanc…
knbarton 987126d
Fix initialization of bottom depth in init mode
knbarton d0d376d
Adds 1/H term into the JSL and ZAE schemes in the topographic wave drag
knbarton b3dda60
Changed 1/H variable from layerThickness to bottomDepthEdge
knbarton 395f060
Fixed sign of bottom depth in topographic wave drag routine
knbarton bf001b1
Minor changes to ZAE topographic wave drag scheme
knbarton 9c588a8
updates to topographic wave drag routine to prevent NaNs
knbarton 0857b8c
Removed references to unused variable bottomDepthEdgeTWD
knbarton 617cef2
Fix rebase issues with ab2
sbrus89 d67e580
Topographic wave drag cleanup
sbrus89 ea270ea
Make ZAE the default wave drag scheme
sbrus89 6279764
Update bld files to match mpaso Registry changes
jonbob 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
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
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
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 |
---|---|---|
|
@@ -117,11 +117,12 @@ subroutine ocn_init_harmonic_analysis(domain, err)!{{{ | |
|
||
type (dm_info) :: dminfo | ||
type (block_type), pointer :: block | ||
type (mpas_pool_type), pointer :: harmonicAnalysisAMPool | ||
type (mpas_pool_type), pointer :: statePool, harmonicAnalysisAMPool | ||
|
||
integer, pointer :: nAnalysisConstituents | ||
integer, pointer :: nAnalysisConstituents, nCellsSolve | ||
real (kind=RKIND), pointer :: harmonicAnalysisStart | ||
real (kind=RKIND), pointer :: harmonicAnalysisEnd | ||
real (kind=RKIND), dimension(:), pointer :: ssh, sshInit | ||
real (kind=RKIND), dimension(:,:), pointer :: leastSquaresLHSMatrix | ||
real (kind=RKIND), dimension(:,:), pointer :: leastSquaresRHSVector | ||
real (kind=RKIND), dimension(:,:), pointer :: decomposedConstituentAmplitude | ||
|
@@ -135,7 +136,7 @@ subroutine ocn_init_harmonic_analysis(domain, err)!{{{ | |
integer, dimension(:), allocatable :: tidalConstituentType | ||
|
||
type (MPAS_Time_Type) :: refTime | ||
integer :: iCon | ||
integer :: iCon, iCell | ||
|
||
err = 0 | ||
|
||
|
@@ -145,8 +146,13 @@ subroutine ocn_init_harmonic_analysis(domain, err)!{{{ | |
|
||
block => domain % blocklist | ||
do while (associated(block)) | ||
call mpas_pool_get_subpool(block % structs, 'state', statePool) | ||
call mpas_pool_get_subpool(block % structs, 'harmonicAnalysisAM', harmonicAnalysisAMPool) | ||
|
||
call mpas_pool_get_dimension(block % dimensions, 'nCellsSolve', nCellsSolve) | ||
call mpas_pool_get_array(statePool, 'ssh', ssh, 1) | ||
|
||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'sshInit', sshInit) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'nAnalysisConstituents', nAnalysisConstituents) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'leastSquaresLHSMatrix', leastSquaresLHSMatrix) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'leastSquaresRHSVector', leastSquaresRHSVector) | ||
|
@@ -214,11 +220,14 @@ subroutine ocn_init_harmonic_analysis(domain, err)!{{{ | |
tidalConstituentType, & | ||
err) | ||
|
||
if (.not. config_do_restart) then | ||
leastSquaresRHSVector = 0.0_RKIND | ||
leastSquaresLHSMatrix = 0.0_RKIND | ||
end if | ||
if (.not. config_do_restart) then | ||
leastSquaresRHSVector = 0.0_RKIND | ||
leastSquaresLHSMatrix = 0.0_RKIND | ||
end if | ||
|
||
do iCell = 1,nCellSSolve | ||
sshInit(iCell) = ssh(iCell) | ||
end do | ||
|
||
do iCon = 1,nAnalysisConstituents | ||
call mpas_log_write('Constituent '//constituentList(iCon)%constituent) | ||
|
@@ -291,7 +300,8 @@ subroutine ocn_compute_harmonic_analysis(domain, timeLevel, err)!{{{ | |
|
||
integer, pointer :: nCellsSolve | ||
integer, pointer :: nAnalysisConstituents | ||
real (kind=RKIND), dimension(:), pointer :: ssh | ||
real (kind=RKIND), dimension(:), pointer :: ssh, sshInit | ||
real (kind=RKIND), dimension(:), allocatable :: sshDiff | ||
real (kind=RKIND), dimension(:,:), pointer :: leastSquaresLHSMatrix | ||
real (kind=RKIND), dimension(:,:), pointer :: leastSquaresRHSVector | ||
real (kind=RKIND), dimension(:), pointer :: analysisConstituentFrequency | ||
|
@@ -334,6 +344,7 @@ subroutine ocn_compute_harmonic_analysis(domain, timeLevel, err)!{{{ | |
|
||
call mpas_pool_get_dimension(block % dimensions, 'nCellsSolve', nCellsSolve) | ||
call mpas_pool_get_array(statePool, 'ssh', ssh, timeLevel) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'sshInit', sshInit) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'nAnalysisConstituents', nAnalysisConstituents) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'leastSquaresLHSMatrix', leastSquaresLHSMatrix) | ||
call mpas_pool_get_array(harmonicAnalysisAMPool, 'leastSquaresRHSVector', leastSquaresRHSVector) | ||
|
@@ -355,6 +366,12 @@ subroutine ocn_compute_harmonic_analysis(domain, timeLevel, err)!{{{ | |
|
||
! update if within harmonic analysis period | ||
if (daysSinceStartOfSim .le. harmonicAnalysisEnd) then | ||
allocate(sshDiff(nCellsSolve)) | ||
|
||
do iCell = 1,nCellsSolve | ||
sshDiff(iCell) = ssh(iCell) - sshInit(iCell) | ||
end do | ||
|
||
Comment on lines
+369
to
+374
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. This is the change that makes the harmonic analysis work on the ssh anomaly. |
||
CALL update_least_squares_LHS_matrix(nAnalysisConstituents, & | ||
time, & | ||
analysisConstituentFrequency, & | ||
|
@@ -364,8 +381,9 @@ subroutine ocn_compute_harmonic_analysis(domain, timeLevel, err)!{{{ | |
time, & | ||
nCellsSolve, & | ||
analysisConstituentFrequency, & | ||
ssh, & | ||
sshDiff, & | ||
leastSquaresRHSVector) | ||
deallocate(sshDiff) | ||
call mpas_log_write('harmonicAnalysisAM update') | ||
end if | ||
|
||
|
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.
Is the implementation/tuning for
LGF
well established? I know thatJSL
and especiallyZAE
are working well, but am less confident re:LGF
.Should
ZAE
be the default if it's typically the best performing?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.
Having ZAE as the default sounds good to me. I'm going to do a full tidal run with all three and I'll report back on the errors. I believe that
LGF
needs to be re-evaluated given the indexing issue I found above.