Skip to content

Commit

Permalink
+Eliminate forcing%netSalt
Browse files Browse the repository at this point in the history
  Eliminated the no-longer used and previously improperly rescaled netSalt
element from the forcing type.  Also added the missing deallocate statements
for fluxes%netMassOut and fluxes%netMassIn in deallocate_forcing_type().  All
answers and output are bitwise identical, although an element has been removed
from a transparent type.
  • Loading branch information
Hallberg-NOAA committed Nov 28, 2021
1 parent 6c01c8d commit 111b3e7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ module MOM_forcing_type
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]
seaice_melt => NULL() !< snow/seaice melt (positive) or formation (negative) [R Z T-1 ~> kg m-2 s-1]

! Aggregated water mass fluxes into the ocean, used for passive tracer sources [R Z T-1 ~> kg m-2 s-1]
real, pointer, dimension(:,:) :: &
netMassIn => NULL(), & !< Sum of water mass flux out of the ocean [kg m-2 s-1]
netMassOut => NULL(), & !< Net water mass flux into of the ocean [kg m-2 s-1]
netSalt => NULL() !< Net salt entering the ocean [kgSalt m-2 s-1]
netMassOut => NULL() !< Net water mass flux into of the ocean [kg m-2 s-1]

! heat associated with water crossing ocean surface
real, pointer, dimension(:,:) :: &
Expand Down Expand Up @@ -730,12 +732,6 @@ subroutine extractFluxes1d(G, GV, US, fluxes, optics, nsw, j, dt, &
! Diagnostics follow...
if (calculate_diags) then

! Store Net_salt for unknown reason?
if (associated(fluxes%salt_flux)) then
! This seems like a bad idea to me. -RWH
if (calculate_diags) fluxes%netSalt(i,j) = US%kg_m2s_to_RZ_T*Net_salt(i)
endif

! Initialize heat_content_massin that is diagnosed in mixedlayer_convection or
! applyBoundaryFluxes such that the meaning is as the sum of all incoming components.
if (associated(fluxes%heat_content_massin)) then
Expand Down Expand Up @@ -2976,7 +2972,6 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
call myAlloc(fluxes%seaice_melt,isd,ied,jsd,jed, water)
call myAlloc(fluxes%netMassOut,isd,ied,jsd,jed, water)
call myAlloc(fluxes%netMassIn,isd,ied,jsd,jed, water)
call myAlloc(fluxes%netSalt,isd,ied,jsd,jed, water)
call myAlloc(fluxes%seaice_melt_heat,isd,ied,jsd,jed, heat)
call myAlloc(fluxes%sw,isd,ied,jsd,jed, heat)
call myAlloc(fluxes%lw,isd,ied,jsd,jed, heat)
Expand Down Expand Up @@ -3263,6 +3258,8 @@ subroutine deallocate_forcing_type(fluxes)
if (associated(fluxes%lrunoff)) deallocate(fluxes%lrunoff)
if (associated(fluxes%frunoff)) deallocate(fluxes%frunoff)
if (associated(fluxes%seaice_melt)) deallocate(fluxes%seaice_melt)
if (associated(fluxes%netMassOut)) deallocate(fluxes%netMassOut)
if (associated(fluxes%netMassIn)) deallocate(fluxes%netMassIn)
if (associated(fluxes%salt_flux)) deallocate(fluxes%salt_flux)
if (associated(fluxes%p_surf_full)) deallocate(fluxes%p_surf_full)
if (associated(fluxes%p_surf)) deallocate(fluxes%p_surf)
Expand Down Expand Up @@ -3331,7 +3328,6 @@ subroutine rotate_forcing(fluxes_in, fluxes, turns)
call rotate_array(fluxes_in%seaice_melt, turns, fluxes%seaice_melt)
call rotate_array(fluxes_in%netMassOut, turns, fluxes%netMassOut)
call rotate_array(fluxes_in%netMassIn, turns, fluxes%netMassIn)
call rotate_array(fluxes_in%netSalt, turns, fluxes%netSalt)
endif

if (do_heat) then
Expand Down

0 comments on commit 111b3e7

Please sign in to comment.