Skip to content

Commit

Permalink
Merge branch 'ocean/develop' into e3sm/develop
Browse files Browse the repository at this point in the history
Fixes limiting on redi k33 #684
Fixes surface buoyancy forcing calculation #690
Revert GM buoyancy gradient calculation to v1 form #687
  • Loading branch information
mark-petersen committed Sep 10, 2020
2 parents b61d423 + 554d986 commit 65699ce
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 119 deletions.
6 changes: 4 additions & 2 deletions src/core_ocean/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@
description="If true, use the Community Vertical MIXing routines to compute vertical diffusivity and viscosity"
possible_values="True or False"
/>
<nml_option name="config_cvmix_use_kpp_buoyancyForcing_fix" type="logical" default_value=".false." units="NA"
description="If true CVMix KPP buoyancy forcing fix for sea ice is enabled"
possible_values="True or False"
/>
<nml_option name="config_cvmix_prandtl_number" type="real" default_value="1.0" units="non-dimensional"
description="Prandtl number to be used within the CVMix parameterization suite"
possible_values="Any non-negative real value."
Expand Down Expand Up @@ -2894,11 +2898,9 @@
/>
<var name="seaIceFreshWaterFlux" type="real" dimensions="nCells Time" units="kg m^{-2} s^{-1}"
description="Fresh water flux from sea ice at cell centers from coupler. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="icebergFreshWaterFlux" type="real" dimensions="nCells Time" units="kg m^{-2} s^{-1}"
description="Fresh water flux from iceberg melt at cell centers from coupler. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="riverRunoffFlux" type="real" dimensions="nCells Time" units="kg m^{-2} s^{-1}"
description="Fresh water flux from river runoff at cell centers from coupler. Positive into the ocean."
Expand Down
18 changes: 13 additions & 5 deletions src/core_ocean/shared/mpas_ocn_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,8 @@ subroutine ocn_compute_KPP_input_fields(statePool, forcingPool, meshPool, diagno
real (kind=RKIND), dimension(:), pointer :: dcEdge, dvEdge, areaCell
real (kind=RKIND), dimension(:), pointer :: penetrativeTemperatureFlux, surfaceThicknessFlux, &
surfaceBuoyancyForcing, surfaceFrictionVelocity, penetrativeTemperatureFluxOBL, &
normalVelocitySurfaceLayer, surfaceThicknessFluxRunoff, rainFlux, evaporationFlux
normalVelocitySurfaceLayer, surfaceThicknessFluxRunoff, rainFlux, evaporationFlux, &
icebergFreshWaterFlux, seaIceFreshWaterFlux

real (kind=RKIND), dimension(:), pointer :: surfaceStress, surfaceStressMagnitude
real (kind=RKIND), dimension(:,:), pointer :: &
Expand Down Expand Up @@ -1479,7 +1480,8 @@ subroutine ocn_compute_KPP_input_fields(statePool, forcingPool, meshPool, diagno
call mpas_pool_get_array(forcingPool, 'surfaceStressMagnitude', surfaceStressMagnitude)
call mpas_pool_get_array(forcingPool, 'rainFlux', rainFlux)
call mpas_pool_get_array(forcingPool, 'evaporationFlux', evaporationFlux)

call mpas_pool_get_array(forcingPool, 'seaIceFreshWaterFlux', seaIceFreshWaterFlux)
call mpas_pool_get_array(forcingPool, 'icebergFreshWaterFlux', icebergFreshWaterFlux)
call mpas_pool_get_array(tracersPool, 'activeTracers', activeTracers, 1)
call mpas_pool_get_array(tracersSurfaceFluxPool, 'activeTracersSurfaceFlux', activeTracersSurfaceFlux)
call mpas_pool_get_array(tracersSurfaceFluxPool, 'activeTracersSurfaceFluxRunoff', activeTracersSurfaceFluxRunoff)
Expand Down Expand Up @@ -1531,9 +1533,15 @@ subroutine ocn_compute_KPP_input_fields(statePool, forcingPool, meshPool, diagno

nonLocalSurfaceTracerFlux(indexTempFlux, iCell) = activeTracersSurfaceFlux(indexTempFlux,iCell) &
+ penetrativeTemperatureFlux(iCell) - penetrativeTemperatureFluxOBL(iCell) &
- fracAbsorbed * (rainFlux(iCell) + evaporationFlux(iCell)) * activeTracers(indexTempFlux,1,iCell)/rho_sw &
- fracAbsorbedRunoff * surfaceThicknessFluxRunoff(iCell) &
* min(activeTracers(indexTempFlux,1,iCell),0.0_RKIND)/rho_sw
- fracAbsorbed * (rainFlux(iCell) + evaporationFlux(iCell)) * activeTracers(indexTempFlux,1,iCell)/rho_sw &
- fracAbsorbedRunoff * surfaceThicknessFluxRunoff(iCell)* min(activeTracers(indexTempFlux,1,iCell),0.0_RKIND)/rho_sw

if(config_cvmix_use_kpp_buoyancyForcing_fix) then
nonLocalSurfaceTracerFlux(indexTempFlux, iCell) = nonLocalSurfaceTracerFlux(indexTempFlux, iCell) &
- fracAbsorbed * (seaIceFreshWaterFlux(iCell) + icebergFreshWaterFlux(iCell)) * &
ocn_freezing_temperature( activeTracers(indexSaltFlux, 1, iCell), pressure=0.0_RKIND, inLandIceCavity=.false.)&
/ rho_sw
endif

nonLocalSurfaceTracerFlux(indexSaltFlux,iCell) = activeTracersSurfaceFlux(indexSaltFlux,iCell) &
- fracAbsorbed * surfaceThicknessFlux(iCell) * activeTracers(indexSaltFlux,1,iCell) &
Expand Down
Loading

0 comments on commit 65699ce

Please sign in to comment.