Skip to content

Commit

Permalink
Added new scalar diagnostic, SSS_global
Browse files Browse the repository at this point in the history
Verified that timestats.intel did not change in the 0.25 deg MOM-SIS example. but did not run the full suite of tests.
  • Loading branch information
jkrasting committed Mar 27, 2014
1 parent 5c17844 commit eb5da60
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions examples/ocean_SIS/MOM6z_SIS_025/diag_table
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
#================
Expand Down
17 changes: 15 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) &
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb5da60

Please sign in to comment.