-
Notifications
You must be signed in to change notification settings - Fork 0
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 cryo terms to coupler budget #74
Changes from 5 commits
efbd115
10691dd
4e16416
8295de2
d42b9cb
6cc7a1e
947d2fb
23624db
6ca4e69
842cc37
d46f9b2
4951935
dbe3477
e68e422
5d3f8c1
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 |
---|---|---|
|
@@ -53,7 +53,9 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ | |
real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, avgSSHGradient, & | ||
avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities | ||
|
||
real (kind=RKIND), dimension(:), pointer :: avgEffectiveDensityInLandIce, avgTotalFreshWaterTemperatureFlux | ||
real (kind=RKIND), dimension(:), pointer :: avgEffectiveDensityInLandIce, avgTotalFreshWaterTemperatureFlux, & | ||
avgLandIceFreshwaterFlux, & | ||
avgRemovedRiverRunoffFlux, avgRemovedIceRunoffFlux | ||
|
||
integer :: iCell | ||
integer, pointer :: nAccumulatedCoupled, nCells | ||
|
@@ -116,6 +118,33 @@ subroutine ocn_time_average_coupled_init(forcingPool)!{{{ | |
!$omp end parallel | ||
end if | ||
|
||
! Set up polar fields if necessary | ||
if(trim(config_land_ice_flux_mode)=='standalone' .or. 'data') 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. @darincomeau, same issue here as below. This may explain why you still were having trouble with 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. Yeah this is fixed locally, I just hadn't pushed it yet since I was still getting 0s. |
||
call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) | ||
|
||
!$omp parallel | ||
!$omp do schedule(runtime) | ||
do iCell = 1, nCells | ||
avgLandIceFreshwaterFlux(iCell) = 0.0_RKIND | ||
end do | ||
!$omp end do | ||
!$omp end parallel | ||
end if | ||
|
||
if(config_remove_AIS_coupler_runoff) then | ||
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) | ||
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) | ||
|
||
!$omp parallel | ||
!$omp do schedule(runtime) | ||
do iCell = 1, nCells | ||
avgRemovedRiverRunoffFlux(iCell) = 0.0_RKIND | ||
avgRemovedIceRunoffFlux(iCell) = 0.0_RKIND | ||
end do | ||
!$omp end do | ||
!$omp end parallel | ||
end if | ||
|
||
! set up BGC coupling fields if necessary | ||
if (config_use_ecosysTracers) then | ||
|
||
|
@@ -215,7 +244,10 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel | |
real (kind=RKIND), dimension(:,:), pointer :: & | ||
avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities | ||
real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & | ||
totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux | ||
totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & | ||
landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & | ||
removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & | ||
removedIceRunoffFlux, avgRemovedIceRunoffFlux | ||
|
||
type (mpas_pool_type), pointer :: tracersPool | ||
|
||
|
@@ -311,6 +343,48 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel | |
!$omp end parallel | ||
end if | ||
|
||
! Accumulate polar fields if necessary | ||
if(trim(config_land_ice_flux_mode) == 'standalone' .or. 'data') then | ||
xylar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) | ||
|
||
if(trim(config_land_ice_flux_mode) == 'standalone') then | ||
call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) | ||
endif | ||
|
||
! load data melt rates if used | ||
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 didn't work, stays 0 when data ISMF is used. 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. You should be able to use |
||
if(trim(config_land_ice_flux_mode) == 'data') then | ||
call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', landIceFreshwaterFlux) | ||
endif | ||
|
||
!$omp parallel | ||
!$omp do schedule(runtime) | ||
do iCell = 1, nCells | ||
avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & | ||
+ landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) | ||
end do | ||
!$omp end do | ||
!$omp end parallel | ||
end if | ||
|
||
if (config_remove_AIS_coupler_runoff) then | ||
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux) | ||
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux) | ||
call mpas_pool_get_array(forcingPool, 'removedRiverRunoffFlux', removedRiverRunoffFlux) | ||
call mpas_pool_get_array(forcingPool, 'removedIceRunoffFlux', removedIceRunoffFlux) | ||
|
||
!$omp parallel | ||
!$omp do schedule(runtime) | ||
do iCell = 1, nCells | ||
avgRemovedRiverRunoffFlux(iCell) = ( avgRemovedRiverRunoffFlux(iCell) * nAccumulatedCoupled & | ||
+ removedRiverRunoffFlux(iCell) ) / ( nAccumulatedCoupled + 1) | ||
avgRemovedIceRunoffFlux(iCell) = ( avgRemovedIceRunoffFlux(iCell) * nAccumulatedCoupled & | ||
+ removedIceRunoffFlux(iCell) ) / ( nAccumulatedCoupled + 1) | ||
end do | ||
!$omp end do | ||
!$omp end parallel | ||
|
||
end if | ||
|
||
! accumulate BGC coupling fields if necessary | ||
if (config_use_ecosysTracers) then | ||
|
||
|
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.
Noting I added 'P' for the ice-shelf melt term; I'm not sure if this matters with the way I did the scaling below. The removed runoff terms do not have P.
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.
I just tested without the 'P' and get the same answers, so I'm removing this.