Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KPP nonlocal term to passive tracers #202

Merged
merged 35 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
420a0e6
Add KPP nonlocal term to passive tracers
mnlevy1981 Nov 30, 2021
c0f6f81
Shorten long lines
mnlevy1981 Nov 30, 2021
eaaaa07
Fix build error in OpenMP test
mnlevy1981 Nov 30, 2021
af095e0
Add KPP nonlocal diags for passive tracers
mnlevy1981 Dec 1, 2021
cecb61d
Cleanup to pass doxygen CI test
mnlevy1981 Dec 1, 2021
bd1089a
Refactor MOM_CFC_cap
mnlevy1981 Dec 6, 2021
eb8dfd7
Refactor MOM_CVMix_KPP.F90
mnlevy1981 Dec 7, 2021
80508d9
Add NLT budget contibution to Tr diags
mnlevy1981 Dec 7, 2021
f11f12c
Only define KPP tracer diags when using KPP
mnlevy1981 Dec 7, 2021
882e173
Commit to pass OpenMP tests
mnlevy1981 Dec 7, 2021
f51681b
Can pass tr_ptr to KPP_NonLocalTransport()
mnlevy1981 Dec 8, 2021
fec61e0
Refactor MOM_tracer_registry.F90
mnlevy1981 Dec 9, 2021
301ed51
register_tracer() can return tracer_type pointer
mnlevy1981 Dec 10, 2021
c435aad
Remove declaration of unused variable
mnlevy1981 Dec 10, 2021
9b1f46b
Add KPP nonlocal terms to pseudo-salt tracer
mnlevy1981 Dec 13, 2021
cfe90aa
Tracers call KPP nonlocal before tracer_vertdiff
mnlevy1981 Dec 14, 2021
312743d
pseudo-salt was using wrong salt flux
mnlevy1981 Dec 14, 2021
f9d6247
Rearrange some code computing nonlocal transport
mnlevy1981 Dec 15, 2021
9c9860c
Clean up diagnostics
mnlevy1981 Dec 16, 2021
8aad2c3
Remove use_KPP from tracer_flow_control_CS
mnlevy1981 Dec 16, 2021
45c6b76
Change id_net_surfflux longname
mnlevy1981 Dec 16, 2021
3913856
Let register_tracer set more diag metadata
mnlevy1981 Dec 16, 2021
44885df
Remove use_KPP from MOM control structure
mnlevy1981 Dec 17, 2021
4f7621f
Clean up diag names and scale factors
mnlevy1981 Dec 17, 2021
a7eeab4
Code cleanup following review
mnlevy1981 Dec 20, 2021
59423ac
APPLY_NONLOCAL_TRANSPORT applies to all tracers
mnlevy1981 Jan 14, 2022
124ef06
Remove matrix multiplication from post_data call
mnlevy1981 Jan 20, 2022
ba5d8c4
Cleanup following more code review
mnlevy1981 Jan 25, 2022
89e0746
Break up long lines
mnlevy1981 Jan 25, 2022
d5e9629
Merge branch 'dev/ncar' into extend_KPP_nonlocal
mnlevy1981 Feb 27, 2022
900f6cf
shorten line length to pass CI test
mnlevy1981 Mar 2, 2022
3e4f827
Clean up two comments
mnlevy1981 Mar 2, 2022
728fe16
Remove unused variable from MOM_forcing_type.F90
mnlevy1981 Mar 3, 2022
9fb0643
Rename CFC_tracer_metadata -> CFC_tracer_data
mnlevy1981 Mar 7, 2022
e3d278e
Fix inaccurate comments
mnlevy1981 Mar 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
integer :: first_direction ! An integer that indicates which direction is to be
! updated first in directionally split parts of the
! calculation.
logical :: use_KPP ! If true, diabatic is using KPP vertical mixing
integer :: nkml, nkbl, verbosity, write_geom
integer :: dynamics_stencil ! The computational stencil for the calculations
! in the dynamic core.
Expand Down Expand Up @@ -2360,13 +2361,18 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
call register_tracer(CS%tv%T, CS%tracer_Reg, param_file, HI, GV, &
tr_desc=vd_T, registry_diags=.true., flux_nameroot='T', &
flux_units='W', flux_longname='Heat', &
net_surfflux_name='KPP_QminusSW', NLT_budget_name='KPP_NLT_temp_budget', &
net_surfflux_longname='Net temperature flux ignoring short-wave, as used by [CVMix] KPP', &
flux_scale=conv2watt, convergence_units='W m-2', &
convergence_scale=conv2watt, CMOR_tendprefix="opottemp", diag_form=2)
convergence_scale=conv2watt, CMOR_tendprefix="opottemp", diag_form=2, &
Tr_out=CS%tv%tr_T)
call register_tracer(CS%tv%S, CS%tracer_Reg, param_file, HI, GV, &
tr_desc=vd_S, registry_diags=.true., flux_nameroot='S', &
flux_units=S_flux_units, flux_longname='Salt', &
net_surfflux_name='KPP_netSalt', NLT_budget_name='KPP_NLT_saln_budget', &
flux_scale=conv2salt, convergence_units='kg m-2 s-1', &
convergence_scale=0.001*GV%H_to_kg_m2, CMOR_tendprefix="osalt", diag_form=2)
convergence_scale=0.001*GV%H_to_kg_m2, CMOR_tendprefix="osalt", diag_form=2, &
Tr_out=CS%tv%tr_S)
endif
endif

Expand Down Expand Up @@ -2840,8 +2846,9 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
call register_surface_diags(Time, G, US, CS%sfc_IDs, CS%diag, CS%tv)
call register_diags(Time, G, GV, US, CS%IDs, CS%diag)
call register_transport_diags(Time, G, GV, US, CS%transport_IDs, CS%diag)
call extract_diabatic_member(CS%diabatic_CSp, use_KPP=use_KPP)
call register_tracer_diagnostics(CS%tracer_Reg, CS%h, Time, diag, G, GV, US, &
CS%use_ALE_algorithm)
CS%use_ALE_algorithm, use_KPP)
if (CS%use_ALE_algorithm) then
call ALE_register_diags(Time, G, GV, US, diag, CS%ALE_CSp)
endif
Expand Down
29 changes: 14 additions & 15 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,21 @@ module MOM_forcing_type

! water mass fluxes into the ocean [R Z T-1 ~> kg m-2 s-1]; these fluxes impact the ocean mass
real, pointer, dimension(:,:) :: &
evap => NULL(), & !< (-1)*fresh water flux evaporated out of the ocean [R Z T-1 ~> kg m-2 s-1]
lprec => NULL(), & !< precipitating liquid water into the ocean [R Z T-1 ~> kg m-2 s-1]
fprec => NULL(), & !< precipitating frozen water into the ocean [R Z T-1 ~> kg m-2 s-1]
vprec => NULL(), & !< virtual liquid precip associated w/ SSS restoring [R Z T-1 ~> kg m-2 s-1]
lrunoff => NULL(), & !< liquid river runoff entering ocean [R Z T-1 ~> kg m-2 s-1]
frunoff => NULL(), & !< frozen river runoff (calving) entering ocean [R Z T-1 ~> kg m-2 s-1]
seaice_melt => NULL() !< snow/seaice melt (positive) or formation (negative) [R Z T-1 ~> kg m-2 s-1]
evap => NULL(), & !< (-1)*fresh water flux evaporated out of the ocean [R Z T-1 ~> kg m-2 s-1]
lprec => NULL(), & !< precipitating liquid water into the ocean [R Z T-1 ~> kg m-2 s-1]
fprec => NULL(), & !< precipitating frozen water into the ocean [R Z T-1 ~> kg m-2 s-1]
vprec => NULL(), & !< virtual liquid precip associated w/ SSS restoring [R Z T-1 ~> kg m-2 s-1]
lrunoff => NULL(), & !< liquid river runoff entering ocean [R Z T-1 ~> kg m-2 s-1]
frunoff => NULL(), & !< frozen river runoff (calving) entering ocean [R Z T-1 ~> kg m-2 s-1]
seaice_melt => NULL() !< snow/seaice melt (positive) or formation (negative) [R Z T-1 ~> kg m-2 s-1]

! Integrated water mass fluxes into the ocean, used for passive tracer sources [H ~> m or kg m-2]
real, pointer, dimension(:,:) :: &
netMassIn => NULL(), & !< Sum of water mass fluxes into the ocean integrated over a
!! forcing timestep [H ~> m or kg m-2]
netMassOut => NULL() !< Net water mass flux out of the ocean integrated over a forcing timestep,
!! with negative values for water leaving the ocean [H ~> m or kg m-2]
netMassIn => NULL(), & !< Sum of water mass fluxes into the ocean integrated over a
!! forcing timestep [H ~> m or kg m-2]
netMassOut => NULL(), & !< Net water mass flux out of the ocean integrated over a forcing timestep,
!! with negative values for water leaving the ocean [H ~> m or kg m-2]
KPP_salt_flux => NULL() !< KPP effective salt flux [ppt m s-1]

! heat associated with water crossing ocean surface
real, pointer, dimension(:,:) :: &
Expand Down Expand Up @@ -191,8 +192,8 @@ module MOM_forcing_type

! CFC-related arrays needed in the MOM_CFC_cap module
real, pointer, dimension(:,:) :: &
cfc11_flux => NULL(), & !< flux of cfc_11 into the ocean [CU R Z T-1 kg m-3 ~> mol m-2 s-1]
cfc12_flux => NULL(), & !< flux of cfc_12 into the ocean [CU R Z T-1 kg m-3 ~> mol m-2 s-1]
cfc11_flux => NULL(), & !< flux of cfc_11 into the ocean [CU R Z T-1 ~> mol m-2 s-1]
cfc12_flux => NULL(), & !< flux of cfc_12 into the ocean [CU R Z T-1 ~> mol m-2 s-1]
ice_fraction => NULL(), & !< fraction of sea ice coverage at h-cells, from 0 to 1 [nondim].
u10_sqr => NULL() !< wind magnitude at 10 m squared [L2 T-2 ~> m2 s-2]

Expand Down Expand Up @@ -3554,8 +3555,6 @@ subroutine homogenize_forcing(fluxes, G)
call homogenize_field_t(fluxes%seaice_melt, G)
call homogenize_field_t(fluxes%netMassOut, G)
call homogenize_field_t(fluxes%netMassIn, G)
!This was removed and I don't think replaced. Not needed?
!call homogenize_field_t(fluxes%netSalt, G)
endif

if (do_heat) then
Expand Down
3 changes: 3 additions & 0 deletions src/core/MOM_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module MOM_variables
use MOM_grid, only : ocean_grid_type
use MOM_unit_scaling, only : unit_scale_type
use MOM_verticalGrid, only : verticalGrid_type
use MOM_tracer_types, only : tracer_type

implicit none ; private

Expand Down Expand Up @@ -124,6 +125,8 @@ module MOM_variables
real, pointer :: varS(:,:,:) => NULL() !< SGS variance of salinity [ppt2].
real, pointer :: covarTS(:,:,:) => NULL() !< SGS covariance of salinity and potential
!! temperature [degC ppt].
type(tracer_type), pointer :: tr_T => NULL() !< pointer to temp in tracer registry
type(tracer_type), pointer :: tr_S => NULL() !< pointer to salinty in tracer registry
end type thermo_var_ptrs

!> Pointers to all of the prognostic variables allocated in MOM_variables.F90 and MOM.F90.
Expand Down
Loading