From 0fe7bddc97d14be8fc91f4dec2958ea93ed1023c Mon Sep 17 00:00:00 2001 From: Kate Hedstrom Date: Mon, 29 Apr 2024 10:42:24 -0800 Subject: [PATCH] Add diags for east, north velocity components. - This is required for our BOEM-funded Arctic project. It needs something similar for SIS2 as well. --- src/diagnostics/MOM_diagnostics.F90 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90 index aeb25bc351..2eecdf77fa 100644 --- a/src/diagnostics/MOM_diagnostics.F90 +++ b/src/diagnostics/MOM_diagnostics.F90 @@ -136,6 +136,7 @@ module MOM_diagnostics integer :: id_sst = -1, id_sst_sq = -1, id_sstcon = -1 integer :: id_sss = -1, id_sss_sq = -1, id_sssabs = -1 integer :: id_ssu = -1, id_ssv = -1 + integer :: id_ssu_east = -1, id_ssv_north = -1 ! Diagnostic IDs for heat and salt flux fields integer :: id_fraz = -1 @@ -1283,6 +1284,8 @@ subroutine post_surface_dyn_diags(IDs, G, diag, sfc_state, ssh) ! Local variables real, dimension(SZI_(G),SZJ_(G)) :: speed ! The surface speed [L T-1 ~> m s-1] + real :: ssu_east(SZI_(G),SZJ_(G)) ! Surface velocity due east component [L T-1 ~> m s-1] + real :: ssv_north(SZI_(G),SZJ_(G)) ! Surface velocity due norht component [L T-1 ~> m s-1] integer :: i, j, is, ie, js, je is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec @@ -1304,6 +1307,17 @@ subroutine post_surface_dyn_diags(IDs, G, diag, sfc_state, ssh) call post_data(IDs%id_speed, speed, diag, mask=G%mask2dT) endif + if (IDs%id_ssu_east > 0 .or. IDs%id_ssv_north > 0) then + do j=js,je ; do i=is,ie + ssu_east(i,j) = (0.5*(sfc_state%u(I-1,j) + sfc_state%u(I,j))) * G%cos_rot(i,j) + & + (0.5*(sfc_state%v(i,J-1) + sfc_state%v(i,J))) * G%sin_rot(i,j) + ssv_north(i,j) = - (0.5*(sfc_state%u(I-1,j) + sfc_state%u(I,j))) * G%sin_rot(i,j) + & + (0.5*(sfc_state%v(i,J-1) + sfc_state%v(i,J))) * G%cos_rot(i,j) + enddo ; enddo + if (IDs%id_ssu_east > 0 ) call post_data(IDs%id_ssu_east, ssu_east, diag, mask=G%mask2dT) + if (IDs%id_ssv_north > 0 ) call post_data(IDs%id_ssv_north, ssv_north, diag, mask=G%mask2dT) + endif + end subroutine post_surface_dyn_diags @@ -1912,6 +1926,10 @@ subroutine register_surface_diags(Time, G, US, IDs, diag, tv) 'Sea Surface Meridional Velocity', 'm s-1', conversion=US%L_T_to_m_s) IDs%id_speed = register_diag_field('ocean_model', 'speed', diag%axesT1, Time, & 'Sea Surface Speed', 'm s-1', conversion=US%L_T_to_m_s) + IDs%id_ssu_east = register_diag_field('ocean_model', 'ssu_east', diag%axesT1, Time, & + 'Eastward velocity', 'm s-1', conversion=US%L_T_to_m_s) + IDs%id_ssv_north = register_diag_field('ocean_model', 'ssv_north', diag%axesCvL, Time, & + 'Northward velocity', 'm s-1', conversion=US%L_T_to_m_s) if (associated(tv%T)) then IDs%id_sst = register_diag_field('ocean_model', 'SST', diag%axesT1, Time, &