From eb5da6007c50eeff57e6d31560aa47405f29d249 Mon Sep 17 00:00:00 2001 From: John Krasting Date: Thu, 27 Mar 2014 13:52:02 -0400 Subject: [PATCH] Added new scalar diagnostic, SSS_global Verified that timestats.intel did not change in the 0.25 deg MOM-SIS example. but did not run the full suite of tests. --- examples/ocean_SIS/MOM6z_SIS_025/diag_table | 7 +++++++ src/core/MOM.F90 | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/ocean_SIS/MOM6z_SIS_025/diag_table b/examples/ocean_SIS/MOM6z_SIS_025/diag_table index aa243bab91..51ce8dfec2 100644 --- a/examples/ocean_SIS/MOM6z_SIS_025/diag_table +++ b/examples/ocean_SIS/MOM6z_SIS_025/diag_table @@ -7,6 +7,7 @@ MOM_SIS_025_z "ocean_month", 1, "months", 1, "days", "time" "ocean_annual", 12, "months", 1, "days", "time" "ocean_static", -1, "months", 1, "days", "time" +"ocean_scalar_daily", 1, "days", 1, "days", "time" "_Drake_passage", 1, "days", 1, "days", "time" "_Denmark_Strait", 1, "days", 1, "days", "time" "_Iceland_Norway", 1, "days", 1, "days", "time" @@ -117,6 +118,12 @@ MOM_SIS_025_z "ocean_model", "wet_u", "wet_u", "ocean_static", "all", .false., "none", 2 "ocean_model", "wet_v", "wet_v", "ocean_static", "all", .false., "none", 2 + +# Scalar diagnostics + "ocean_model", "SST_global", "SST_global", "ocean_scalar_daily", "all", .true., "none", 2 + "ocean_model", "SSS_global", "SSS_global", "ocean_scalar_daily", "all", .true., "none", 2 + + #================ # ICE DIAGNOSTICS #================ diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index d1e6eb1cc1..a34457ac89 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -542,7 +542,7 @@ module MOM integer :: id_T = -1, id_S = -1, id_ssh = -1, id_fraz = -1 integer :: id_salt_deficit = -1, id_Heat_PmE = -1, id_intern_heat = -1 integer :: id_sst = -1, id_sst_sq = -1, id_sst_global = -1 - integer :: id_sss = -1, id_ssu = -1, id_ssv = -1 + integer :: id_sss = -1, id_sss_global = -1, id_ssu = -1, id_ssv = -1 integer :: id_speed = -1, id_ssh_inst = -1 integer :: id_Tadx = -1, id_Tady = -1, id_Tdiffx = -1, id_Tdiffy = -1 @@ -645,7 +645,8 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) v, & ! v : Meridional velocity, in m s-1. h ! h : Layer thickness, in m. real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)+1) :: eta_predia - real :: tot_wt_ssh, Itot_wt_ssh, I_time_int, SST_global + real :: tot_wt_ssh, Itot_wt_ssh, I_time_int + real :: SST_global, SSS_global type(time_type) :: Time_local integer :: pid_tau, pid_ustar, pid_psurf, pid_u, pid_h integer :: pid_T, pid_S @@ -1326,6 +1327,16 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS) call post_data(CS%id_sst_global, SST_global, CS%diag) endif + if (CS%id_sss_global > 0) then + SSS_global = 0.0 + do j=js,je ; do i=is, ie + SSS_global = SSS_global + ( state%SSS(i,j) * G%areaT(i,j) * G%mask2dT(i,j) ) + enddo ; enddo + call sum_across_PEs( SSS_global ) + SSS_global = SSS_global * G%IareaT_global + call post_data(CS%id_sss_global, SSS_global, CS%diag) + endif + if (CS%id_sss > 0) & call post_data(CS%id_sss, state%SSS, CS%diag, mask=G%mask2dT) if (CS%id_ssu > 0) & @@ -2023,6 +2034,8 @@ subroutine register_diags(Time, G, CS, ADp) 'Sea Surface Temperature Squared', 'Celsius**2', CS%missing) CS%id_sss = register_diag_field('ocean_model', 'SSS', diag%axesT1, Time, & 'Sea Surface Salinity', 'PSU', CS%missing) + CS%id_sss_global = register_scalar_field('ocean_model', 'SSS_global', Time, diag, & + 'Global Average Sea Surface Salinity', 'PSU', CS%missing) if (CS%id_sst_sq > 0) call safe_alloc_ptr(CS%SST_sq,isd,ied,jsd,jed) endif if (CS%use_temperature .and. CS%use_frazil) then