Skip to content

Commit 792a061

Browse files
authored
Correct temperature and salinity mean diagnostics when using conservative/absolute (#860)
- Previously the global/area mean temperature and salinity outputs were the model prognostic temp/salt, but were always reported as potential temperature and practical salinity. - This gives the correction for those outputs so it is actually potential temperature and practical salinity, even when the model is conservative and absolute. - The option is also added to output the averaged conservative temperature and absolute salinity variables when those are the prognostic variables. - The option to output conservative temp and absolute salinity when model is potential temp and practical salinity is not added.
1 parent 47733ed commit 792a061

File tree

1 file changed

+112
-36
lines changed

1 file changed

+112
-36
lines changed

src/diagnostics/MOM_diagnostics.F90

Lines changed: 112 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ module MOM_diagnostics
100100
integer :: id_Tpot = -1, id_Sprac = -1
101101
integer :: id_tob = -1, id_sob = -1
102102
integer :: id_thetaoga = -1, id_soga = -1
103+
integer :: id_bigthetaoga = -1, id_abssoga = -1
103104
integer :: id_sosga = -1, id_tosga = -1
105+
integer :: id_abssosga = -1, id_bigtosga = -1
104106
integer :: id_temp_layer_ave = -1, id_salt_layer_ave = -1
107+
integer :: id_bigtemp_layer_ave = -1, id_abssalt_layer_ave = -1
105108
integer :: id_pbo = -1
106109
integer :: id_thkcello = -1, id_rhoinsitu = -1
107110
integer :: id_rhopot0 = -1, id_rhopot2 = -1
@@ -404,6 +407,36 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
404407
enddo ; enddo
405408
if (CS%id_Tpot > 0) call post_data(CS%id_Tpot, work_3d, CS%diag)
406409
if (CS%id_tob > 0) call post_data(CS%id_tob, work_3d(:,:,nz), CS%diag, mask=G%mask2dT)
410+
! volume mean potential temperature
411+
if (CS%id_thetaoga>0) then
412+
thetaoga = global_volume_mean(work_3d, h, G, GV, tmp_scale=US%C_to_degC)
413+
call post_data(CS%id_thetaoga, thetaoga, CS%diag)
414+
endif
415+
! volume mean conservative temperature
416+
if (CS%id_bigthetaoga>0) then
417+
thetaoga = global_volume_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
418+
call post_data(CS%id_bigthetaoga, thetaoga, CS%diag)
419+
endif
420+
! area mean potential SST
421+
if (CS%id_tosga > 0) then
422+
tosga = global_area_mean(work_3d(:,:,1), G, tmp_scale=US%C_to_degC)
423+
call post_data(CS%id_tosga, tosga, CS%diag)
424+
endif
425+
! area mean conservative SST
426+
if (CS%id_bigtosga > 0) then
427+
tosga = global_area_mean(tv%T(:,:,1), G, tmp_scale=US%C_to_degC)
428+
call post_data(CS%id_bigtosga, tosga, CS%diag)
429+
endif
430+
! layer mean potential temperature
431+
if (CS%id_temp_layer_ave>0) then
432+
temp_layer_ave = global_layer_mean(work_3d, h, G, GV, tmp_scale=US%C_to_degC)
433+
call post_data(CS%id_temp_layer_ave, temp_layer_ave, CS%diag)
434+
endif
435+
! layer mean conservative temperature
436+
if (CS%id_bigtemp_layer_ave>0) then
437+
temp_layer_ave = global_layer_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
438+
call post_data(CS%id_bigtemp_layer_ave, temp_layer_ave, CS%diag)
439+
endif
407440
if (CS%id_tosq > 0) then
408441
do k=1,nz ; do j=js,je ; do i=is,ie
409442
work_3d(i,j,k) = work_3d(i,j,k)*work_3d(i,j,k)
@@ -420,8 +453,24 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
420453
enddo ; enddo ; enddo
421454
call post_data(CS%id_tosq, work_3d, CS%diag)
422455
endif
456+
! volume mean potential temperature
457+
if (CS%id_thetaoga>0) then
458+
thetaoga = global_volume_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
459+
call post_data(CS%id_thetaoga, thetaoga, CS%diag)
460+
endif
461+
! area mean SST
462+
if (CS%id_tosga > 0) then
463+
tosga = global_area_mean(tv%T(:,:,1), G, tmp_scale=US%C_to_degC)
464+
call post_data(CS%id_tosga, tosga, CS%diag)
465+
endif
466+
! layer mean potential temperature
467+
if (CS%id_temp_layer_ave>0) then
468+
temp_layer_ave = global_layer_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
469+
call post_data(CS%id_temp_layer_ave, temp_layer_ave, CS%diag)
470+
endif
423471
endif
424472

473+
425474
! Calculate additional, potentially derived salinity diagnostics
426475
if (tv%S_is_absS) then
427476
! Internal T&S variables are conservative temperature & absolute salinity,
@@ -434,6 +483,36 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
434483
enddo ; enddo
435484
if (CS%id_Sprac > 0) call post_data(CS%id_Sprac, work_3d, CS%diag)
436485
if (CS%id_sob > 0) call post_data(CS%id_sob, work_3d(:,:,nz), CS%diag, mask=G%mask2dT)
486+
! volume mean salinity
487+
if (CS%id_soga>0) then
488+
soga = global_volume_mean(work_3d, h, G, GV, tmp_scale=US%S_to_ppt)
489+
call post_data(CS%id_soga, soga, CS%diag)
490+
endif
491+
! volume mean absolute salinity
492+
if (CS%id_abssoga>0) then
493+
soga = global_volume_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
494+
call post_data(CS%id_abssoga, soga, CS%diag)
495+
endif
496+
! area mean practical SSS
497+
if (CS%id_sosga > 0) then
498+
sosga = global_area_mean(work_3d(:,:,1), G, tmp_scale=US%S_to_ppt)
499+
call post_data(CS%id_sosga, sosga, CS%diag)
500+
endif
501+
! area mean absolute SSS
502+
if (CS%id_abssosga > 0) then
503+
sosga = global_area_mean(tv%S(:,:,1), G, tmp_scale=US%S_to_ppt)
504+
call post_data(CS%id_abssosga, sosga, CS%diag)
505+
endif
506+
! layer mean practical salinity
507+
if (CS%id_salt_layer_ave>0) then
508+
salt_layer_ave = global_layer_mean(work_3d, h, G, GV, tmp_scale=US%S_to_ppt)
509+
call post_data(CS%id_salt_layer_ave, salt_layer_ave, CS%diag)
510+
endif
511+
! layer mean absolute salinity
512+
if (CS%id_abssalt_layer_ave>0) then
513+
salt_layer_ave = global_layer_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
514+
call post_data(CS%id_abssalt_layer_ave, salt_layer_ave, CS%diag)
515+
endif
437516
if (CS%id_sosq > 0) then
438517
do k=1,nz ; do j=js,je ; do i=is,ie
439518
work_3d(i,j,k) = work_3d(i,j,k)*work_3d(i,j,k)
@@ -450,42 +529,21 @@ subroutine calculate_diagnostic_fields(u, v, h, uh, vh, tv, ADp, CDp, p_surf, &
450529
enddo ; enddo ; enddo
451530
call post_data(CS%id_sosq, work_3d, CS%diag)
452531
endif
453-
endif
454-
455-
! volume mean potential temperature
456-
if (CS%id_thetaoga>0) then
457-
thetaoga = global_volume_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
458-
call post_data(CS%id_thetaoga, thetaoga, CS%diag)
459-
endif
460-
461-
! area mean SST
462-
if (CS%id_tosga > 0) then
463-
tosga = global_area_mean(tv%T(:,:,1), G, tmp_scale=US%C_to_degC)
464-
call post_data(CS%id_tosga, tosga, CS%diag)
465-
endif
466-
467-
! volume mean salinity
468-
if (CS%id_soga>0) then
469-
soga = global_volume_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
470-
call post_data(CS%id_soga, soga, CS%diag)
471-
endif
472-
473-
! area mean SSS
474-
if (CS%id_sosga > 0) then
475-
sosga = global_area_mean(tv%S(:,:,1), G, tmp_scale=US%S_to_ppt)
476-
call post_data(CS%id_sosga, sosga, CS%diag)
477-
endif
478-
479-
! layer mean potential temperature
480-
if (CS%id_temp_layer_ave>0) then
481-
temp_layer_ave = global_layer_mean(tv%T, h, G, GV, tmp_scale=US%C_to_degC)
482-
call post_data(CS%id_temp_layer_ave, temp_layer_ave, CS%diag)
483-
endif
484-
485-
! layer mean salinity
486-
if (CS%id_salt_layer_ave>0) then
487-
salt_layer_ave = global_layer_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
488-
call post_data(CS%id_salt_layer_ave, salt_layer_ave, CS%diag)
532+
! volume mean salinity
533+
if (CS%id_soga>0) then
534+
soga = global_volume_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
535+
call post_data(CS%id_soga, soga, CS%diag)
536+
endif
537+
! area mean SSS
538+
if (CS%id_sosga > 0) then
539+
sosga = global_area_mean(tv%S(:,:,1), G, tmp_scale=US%S_to_ppt)
540+
call post_data(CS%id_sosga, sosga, CS%diag)
541+
endif
542+
! layer mean salinity
543+
if (CS%id_salt_layer_ave>0) then
544+
salt_layer_ave = global_layer_mean(tv%S, h, G, GV, tmp_scale=US%S_to_ppt)
545+
call post_data(CS%id_salt_layer_ave, salt_layer_ave, CS%diag)
546+
endif
489547
endif
490548

491549
call calculate_vertical_integrals(h, tv, p_surf, G, GV, US, CS)
@@ -1688,26 +1746,44 @@ subroutine MOM_diagnostics_init(MIS, ADp, CDp, Time, G, GV, US, param_file, diag
16881746

16891747
CS%id_temp_layer_ave = register_diag_field('ocean_model', 'temp_layer_ave', &
16901748
diag%axesZL, Time, 'Layer Average Ocean Temperature', units='degC', conversion=US%C_to_degC)
1749+
CS%id_bigtemp_layer_ave = register_diag_field('ocean_model', 'contemp_layer_ave', &
1750+
diag%axesZL, Time, 'Layer Average Ocean Conservative Temperature', units='Celsius', conversion=US%C_to_degC)
16911751
CS%id_salt_layer_ave = register_diag_field('ocean_model', 'salt_layer_ave', &
16921752
diag%axesZL, Time, 'Layer Average Ocean Salinity', units='psu', conversion=US%S_to_ppt)
1753+
CS%id_abssalt_layer_ave = register_diag_field('ocean_model', 'abssalt_layer_ave', &
1754+
diag%axesZL, Time, 'Layer Average Ocean Absolute Salinity', units='g kg-1', conversion=US%S_to_ppt)
16931755

16941756
CS%id_thetaoga = register_scalar_field('ocean_model', 'thetaoga', &
16951757
Time, diag, 'Global Mean Ocean Potential Temperature', units='degC', conversion=US%C_to_degC, &
16961758
standard_name='sea_water_potential_temperature')
1759+
CS%id_bigthetaoga = register_scalar_field('ocean_model', 'bigthetaoga', &
1760+
Time, diag, 'Global Mean Ocean Conservative Temperature', units='Celsius', conversion=US%C_to_degC, &
1761+
standard_name='sea_water_conservative_temperature')
16971762
CS%id_soga = register_scalar_field('ocean_model', 'soga', &
16981763
Time, diag, 'Global Mean Ocean Salinity', units='psu', conversion=US%S_to_ppt, &
16991764
standard_name='sea_water_salinity')
1765+
CS%id_abssoga = register_scalar_field('ocean_model', 'abssoga', &
1766+
Time, diag, 'Global Mean Ocean Absolute Salinity', units='g kg-1', conversion=US%S_to_ppt, &
1767+
standard_name='sea_water_absolute_salinity')
17001768

1769+
! The CMIP convention is potential temperature, but not indicated in the CMIP long name.
17011770
CS%id_tosga = register_scalar_field('ocean_model', 'sst_global', Time, diag, &
17021771
long_name='Global Area Average Sea Surface Temperature', &
17031772
units='degC', conversion=US%C_to_degC, standard_name='sea_surface_temperature', &
17041773
cmor_field_name='tosga', cmor_standard_name='sea_surface_temperature', &
17051774
cmor_long_name='Sea Surface Temperature')
1775+
CS%id_bigtosga = register_scalar_field('ocean_model', 'sscont_global', Time, diag, &
1776+
long_name='Global Area Average Sea Surface Conservative Temperature', &
1777+
units='Celsius', conversion=US%C_to_degC, standard_name='sea_surface_temperature')
1778+
! The CMIP convention is practical salinity, but not indicated in the CMIP long name.
17061779
CS%id_sosga = register_scalar_field('ocean_model', 'sss_global', Time, diag, &
17071780
long_name='Global Area Average Sea Surface Salinity', &
17081781
units='psu', conversion=US%S_to_ppt, standard_name='sea_surface_salinity', &
17091782
cmor_field_name='sosga', cmor_standard_name='sea_surface_salinity', &
17101783
cmor_long_name='Sea Surface Salinity')
1784+
CS%id_abssosga = register_scalar_field('ocean_model', 'ssabss_global', Time, diag, &
1785+
long_name='Global Area Average Sea Surface Absolute Salinity', &
1786+
units='psu', conversion=US%S_to_ppt, standard_name='sea_surface_absolute_salinity')
17111787
endif
17121788

17131789
CS%id_u = register_diag_field('ocean_model', 'u', diag%axesCuL, Time, &

0 commit comments

Comments
 (0)