Skip to content

Commit 843d3b6

Browse files
committed
Fix units and dimensional consistency
1 parent ad7cf38 commit 843d3b6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/ALE/MOM_ALE.F90

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,12 @@ subroutine ALE_register_diags(Time, G, GV, US, diag, CS)
380380
'Rate of change in half rho0 times depth integral of squared zonal'//&
381381
' velocity by remapping. If REMAP_VEL_CONSERVE_KE is .true. then '//&
382382
' this measures the change before the KE-conserving correction is applied.', &
383-
'W m-2', conversion=US%RZ3_T3_to_W_m2 * US%L_to_Z**2)
383+
'W m-2', conversion=GV%H_to_kg_m2 * US%L_T_to_m_s**2 * US%s_to_T)
384384
CS%id_remap_delta_integ_v2 = register_diag_field('ocean_model', 'ale_v2', diag%axesCv1, Time, &
385385
'Rate of change in half rho0 times depth integral of squared meridional'//&
386386
' velocity by remapping. If REMAP_VEL_CONSERVE_KE is .true. then '//&
387387
' this measures the change before the KE-conserving correction is applied.', &
388-
'W m-2', conversion=US%RZ3_T3_to_W_m2 * US%L_to_Z**2)
388+
'W m-2', conversion=GV%H_to_kg_m2 * US%L_T_to_m_s**2 * US%s_to_T)
389389

390390
end subroutine ALE_register_diags
391391

@@ -1172,7 +1172,11 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
11721172
ke_c_tgt = ke_c_tgt + h2(k) * (u_tgt(k) - u_bt)**2
11731173
enddo
11741174
! Next rescale baroclinic component on target grid to conserve ke
1175-
rescale_coef = min(1.25, sqrt(ke_c_src / (ke_c_tgt + 1.E-19)))
1175+
if (ke_c_src < 1.5625 * ke_c_tgt) then
1176+
rescale_coef = sqrt(ke_c_src / ke_c_tgt)
1177+
else
1178+
rescale_coef = 1.25
1179+
endif
11761180
do k=1,nz
11771181
u_tgt(k) = u_bt + rescale_coef * (u_tgt(k) - u_bt)
11781182
enddo
@@ -1240,7 +1244,11 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
12401244
ke_c_tgt = ke_c_tgt + h2(k) * (v_tgt(k) - v_bt)**2
12411245
enddo
12421246
! Next rescale baroclinic component on target grid to conserve ke
1243-
rescale_coef = min(1.25, sqrt(ke_c_src / (ke_c_tgt + 1.E-19)))
1247+
if (ke_c_src < 1.5625 * ke_c_tgt) then
1248+
rescale_coef = sqrt(ke_c_src / ke_c_tgt)
1249+
else
1250+
rescale_coef = 1.25
1251+
endif
12441252
do k=1,nz
12451253
v_tgt(k) = v_bt + rescale_coef * (v_tgt(k) - v_bt)
12461254
enddo

0 commit comments

Comments
 (0)