-
Notifications
You must be signed in to change notification settings - Fork 3
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 flux-corrected transport scheme to MALI #70
Changes from 1 commit
119cfd9
7532330
aac672a
47d6154
5dd26c6
e549c55
f97dd56
ab8ec14
494d092
d9f9317
9518f49
30d387c
414eac6
83f5168
79edb95
3c42538
a364f7a
e85d3fd
6da1573
8734303
8d08525
36ea0a4
12981f5
2c66078
ab87706
0f66471
7e3d897
0e6fbb9
697f7f9
dae96e7
4c87809
aa85232
70ec7bb
4104681
4f313f1
5889ba6
fd6792b
8d2f023
38f3f2b
7cff4b7
9530ad5
aa2999a
35a89ae
f43c26b
8f218c3
52d9a0b
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 |
---|---|---|
|
@@ -184,8 +184,8 @@ subroutine li_advection_thickness_tracers(& | |
thermalCellMaskField | ||
|
||
! Allocatable arrays need for flux-corrected transport advection | ||
real (kind=RKIND), dimension(:,:), allocatable :: tendLayerThickness | ||
real (kind=RKIND), dimension(:,:,:), allocatable :: tend | ||
real (kind=RKIND), dimension(:,:,:), allocatable :: activeTracerHorizontalAdvectionEdgeFlux | ||
|
||
integer, dimension(:), pointer :: & | ||
cellMask, & ! integer bitmask for cells | ||
|
@@ -403,10 +403,10 @@ subroutine li_advection_thickness_tracers(& | |
|
||
if ((trim(config_thickness_advection) .eq. 'fct') .or. & | ||
(trim(config_tracer_advection) .eq. 'fct' ) ) then | ||
allocate(tendLayerThickness(nVertLevels,nCells+1)) | ||
tendLayerThickness(:,:) = 0.0_RKIND | ||
allocate(tend(nTracers,nVertLevels,nCells+1)) | ||
tend(:,:,:) = 0.0_RKIND | ||
allocate(activeTracerHorizontalAdvectionEdgeFlux(nTracers,nVertLevels+1,nEdges+1)) | ||
activeTracerHorizontalAdvectionEdgeFlux(:,:,:) = 0.0_RKIND | ||
endif | ||
|
||
! Transport thickness and tracers using a first-order upwind scheme | ||
|
@@ -469,16 +469,20 @@ subroutine li_advection_thickness_tracers(& | |
! Reset tracers after fo advection for fct advection | ||
advectedTracers(:,:,:) = advectedTracersOld(:,:,:) | ||
|
||
! Pass FO upwind normalThicknessFlux (layerThicknessEdge * layerNormalVelocity) | ||
! to fct tracer routine | ||
call li_tracer_advection_fct_tend(& | ||
tend, advectedTracers, layerThicknessOld, & | ||
layerThicknessEdge * layerNormalVelocity, 0 * normalVelocity, dt, & | ||
nTracers, computeBudgets=.false.)!{{{ | ||
nTracers, activeTracerHorizontalAdvectionEdgeFlux, computeBudgets=.false.)!{{{ | ||
elseif ((trim(config_thickness_advection) .eq. 'fct') .and. & | ||
trim(config_tracer_advection) .eq. 'fct') then | ||
! Call fct routine for thickness first, and use activeTracerHorizontalAdvectionEdgeFlux | ||
! returned by that call as normalThicknessFlux for call to tracer fct | ||
call li_tracer_advection_fct_tend(& | ||
tend, advectedTracers, layerThicknessOld * 0.0_RKIND + 1.0_RKIND, & | ||
matthewhoffman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
layerNormalVelocity, 0 * normalVelocity, dt, & | ||
nTracers, computeBudgets=.false.) | ||
nTracers, activeTracerHorizontalAdvectionEdgeFlux, computeBudgets=.false.) | ||
! layerThickness is last tracer. However, for some reason | ||
! this: layerThickness(:,:) = advectedTracers(nTracers,:,:) does not conserve mass! | ||
! This does conserve mass: | ||
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. @dengwirda, do you have any ideas why this might be? We could meet with you to explain the details if no explanation is obvious. |
||
|
@@ -487,10 +491,13 @@ subroutine li_advection_thickness_tracers(& | |
! TODO: determine whether we need to treat other tracer tendencies | ||
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. @trhille , have you looked into this question? 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. Yes, it doesn't work for tracers, for some reason. |
||
! the same as layerThickness for conservation. | ||
advectedTracers(:,:,:) = advectedTracersOld(:,:,:) | ||
tend(:,:,:) = 0.0_RKIND | ||
! Call fct for tracers, using activeTracerHorizontalAdvectionEdgeFlux | ||
! from fct thickness advection as normalThicknessFlux | ||
call li_tracer_advection_fct_tend(& | ||
tend, advectedTracers, layerThicknessOld, & | ||
layerThicknessEdge * layerNormalVelocity, 0 * normalVelocity, dt, & | ||
nTracers, computeBudgets=.false.) | ||
activeTracerHorizontalAdvectionEdgeFlux(nTracers,:,:), 0 * normalVelocity, dt, & | ||
trhille marked this conversation as resolved.
Show resolved
Hide resolved
|
||
nTracers, activeTracerHorizontalAdvectionEdgeFlux, computeBudgets=.false.) | ||
matthewhoffman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
endif | ||
trhille marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (config_print_thickness_advection_info) then | ||
|
@@ -690,7 +697,9 @@ subroutine li_advection_thickness_tracers(& | |
advCoefs, & | ||
advCoefs3rd, & | ||
advMaskHighOrder, & | ||
advMask2ndOrder) | ||
advMask2ndOrder, & | ||
tend, & | ||
activeTracerHorizontalAdvectionEdgeFlux) | ||
endif | ||
|
||
! clean up | ||
|
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.
We may want to move
activeTracerHorizontalAdvectionEdgeFlux
to Registry so it could be output given its importance in the algorithm. But we'd want to refactor things to avoid it beingnTracers
big first. So let's wait until we encounter a need to visualize it before worrying about that.