Skip to content

Commit

Permalink
Merge pull request #957 from marshallward/diag_keadv_oblorig
Browse files Browse the repository at this point in the history
Diagnostic fixes to KE_adv, KPP_OBLdepth_original
  • Loading branch information
adcroft authored Jul 22, 2019
2 parents 832c798 + ffe82ce commit 5358bca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/diagnostics/MOM_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,18 @@ subroutine calculate_energy_diagnostics(u, v, h, uh, vh, ADp, CDp, G, GV, US, CS
endif

if (associated(CS%KE_adv)) then
! NOTE: All terms in KE_adv are multipled by -1, which can easily produce
! negative zeros and may signal a reproducibility issue over land.
! We resolve this by re-initializing and only evaluating over water points.
KE_u(:,:) = 0. ; KE_v(:,:) = 0.
do k=1,nz
do j=js,je ; do I=Isq,Ieq
KE_u(I,j) = uh(I,j,k)*G%dxCu(I,j)*ADp%gradKEu(I,j,k)
if (G%mask2dCu(i,j) /= 0.) &
KE_u(I,j) = uh(I,j,k)*G%dxCu(I,j)*ADp%gradKEu(I,j,k)
enddo ; enddo
do J=Jsq,Jeq ; do i=is,ie
KE_v(i,J) = vh(i,J,k)*G%dyCv(i,J)*ADp%gradKEv(i,J,k)
if (G%mask2dCv(i,j) /= 0.) &
KE_v(i,J) = vh(i,J,k)*G%dyCv(i,J)*ADp%gradKEv(i,J,k)
enddo ; enddo
do j=js,je ; do i=is,ie
KE_h(i,j) = -CS%KE(i,j,k) * G%IareaT(i,j) * &
Expand Down
10 changes: 6 additions & 4 deletions src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,12 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive, Waves)
! CMOR names are placeholders; must be modified by time period
! for CMOR compliance. Diag manager will be used for omlmax and
! omldamax.
CS%id_OBLdepth_original = register_diag_field('ocean_model', 'KPP_OBLdepth_original', diag%axesT1, Time, &
'Thickness of the surface Ocean Boundary Layer without smoothing calculated by [CVMix] KPP', 'meter', &
cmor_field_name='oml', cmor_long_name='ocean_mixed_layer_thickness_defined_by_mixing_scheme', &
cmor_units='m', cmor_standard_name='Ocean Mixed Layer Thickness Defined by Mixing Scheme')
if (CS%n_smooth > 0) then
CS%id_OBLdepth_original = register_diag_field('ocean_model', 'KPP_OBLdepth_original', diag%axesT1, Time, &
'Thickness of the surface Ocean Boundary Layer without smoothing calculated by [CVMix] KPP', 'meter', &
cmor_field_name='oml', cmor_long_name='ocean_mixed_layer_thickness_defined_by_mixing_scheme', &
cmor_units='m', cmor_standard_name='Ocean Mixed Layer Thickness Defined by Mixing Scheme')
endif
CS%id_BulkDrho = register_diag_field('ocean_model', 'KPP_BulkDrho', diag%axesTL, Time, &
'Bulk difference in density used in Bulk Richardson number, as used by [CVMix] KPP', 'kg/m3')
CS%id_BulkUz2 = register_diag_field('ocean_model', 'KPP_BulkUz2', diag%axesTL, Time, &
Expand Down

0 comments on commit 5358bca

Please sign in to comment.