-
Notifications
You must be signed in to change notification settings - Fork 434
New spatially-variable horizontal upwind capability #7371
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
Changes from all commits
89e7410
2df3a12
6c67371
eae3237
d692dad
9778206
2fec412
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
config_time_integrator = 'split_explicit' | ||
config_thickness_flux_type = 'upwind' | ||
config_use_spatially_variable_upwind = .true. | ||
config_spatially_variable_upwind_hmin = 10.0 | ||
config_spatially_variable_upwind_hmax = 50.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -857,7 +857,7 @@ subroutine ocn_diagnostic_solve_layerThicknessEdge(normalVelocity, & | |
iEdge, k, &! edge and vertical loop indices | ||
cell1, cell2, &! neighbor cell indices across an edge | ||
kmin, kmax ! min,max active vertical levels | ||
|
||
real(kind=RKIND) :: columnThickness | ||
! End preamble | ||
!----------------------------------------------------------------- | ||
! Begin code | ||
|
@@ -985,7 +985,43 @@ subroutine ocn_diagnostic_solve_layerThicknessEdge(normalVelocity, & | |
#endif | ||
|
||
end if | ||
|
||
if (config_use_spatially_variable_upwind) then | ||
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. There should probably be a check to make sure in the init routine to require 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. Good point. I'll add that. 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. @sbrus89 This check is in 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. Ah, you're right; I missed that. Thanks! |
||
#ifdef MPAS_OPENACC | ||
!$acc parallel loop & | ||
!$acc present(layerThickEdgeMean, layerThickEdgeFlux, & | ||
!$acc minLevelEdgeBot, maxLevelEdgeTop, & | ||
!$acc upwindFactor) & | ||
!$acc private(k, kmin, kmax, columnThickness) | ||
#else | ||
!$omp parallel | ||
!$omp do schedule(runtime) private(k, kmin, kmax, cell1, cell2, columnThickness) | ||
#endif | ||
do iEdge = 1, nEdgesAll | ||
cell1 = cellsOnEdge(1,iEdge) | ||
cell2 = cellsOnEdge(2,iEdge) | ||
columnThickness = min(bottomDepth(cell1) + ssh(cell1), & | ||
bottomDepth(cell2) + ssh(cell2)) | ||
cbegeman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (columnThickness <= config_spatially_variable_upwind_hmin) then | ||
upwindFactor(iEdge) = 1.0_RKIND | ||
elseif (columnThickness >= config_spatially_variable_upwind_hmax) then | ||
upwindFactor(iEdge) = 0.0_RKIND | ||
else | ||
upwindFactor(iEdge) = 1.0_RKIND - & | ||
(columnThickness - config_spatially_variable_upwind_hmin) / & | ||
(config_spatially_variable_upwind_hmax - config_spatially_variable_upwind_hmin) | ||
end if | ||
kmin = minLevelEdgeBot(iEdge) | ||
kmax = maxLevelEdgeTop(iEdge) | ||
do k = kmin,kmax | ||
layerThickEdgeFlux(k,iEdge) = (1.0_RKIND - upwindFactor(iEdge)) * layerThickEdgeMean(k,iEdge) & | ||
+ upwindFactor(iEdge)* layerThickEdgeFlux(k,iEdge) | ||
end do | ||
end do | ||
#ifndef MPAS_OPENACC | ||
!$omp end do | ||
!$omp end parallel | ||
#endif | ||
endif | ||
case (thickEdgeFluxConstant) | ||
! Use linearized version H*u where H is constant in time | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.