Skip to content

Commit

Permalink
+(*)non-Boussinesq ALE_sponges work in Z units
Browse files Browse the repository at this point in the history
  Revised the ALE_sponge code to convert the model's thicknesses (in thickness
units of [H ~> m or kg m-2]) into layer vertical extents (in height units of
[Z ~> m]) to match how the input datasets vertical grids are specified and to
avoid using the Boussinesq reference density to do the opposite conversion when
in non-Boussinesq mode.  The internal conversion in apply_ALE_sponge between
layer thicknesses and layer vertical extents matches those in thickness_to_dz,
and uses the layer-averaged specific volumes when in non-Boussinesq mode.

  As a part of these changes, 12 internal variables in MOM_ALE_sponge were
renamed (e.g., from data_h to data_dz) to more clearly reflect that they are the
layer vertical extents instead of thicknesses, and there are new 3-d variables
dz_model, that is created from h when the sponges are applied to the velocities,
and data_dz to handle the conversion of the input thicknesses or vertical
extents in initialize_ALE_sponge_fixed.

  This commit includes adding a new thermo_var_type argument to
apply_ALE_sponge, a new unit_scale_type argument to rotate_ALE_sponge and
initialize_ALE_sponge_varying and the new optional argument data_h_is_Z to
initialize_ALE_sponge_fixed to indicate that the in thicknesses arguments are
vertical distances (in [Z ~> m]) and do not need to be rescaled inside of the
ALE_sponge code, and similarly for the new optional argument data_h_in_Z to
get_ALE_sponge_thicknesses.

  This commit also adds halo size and Omit_Corners arguments to the pass_var
calls in the ALE_sponge code.

  There are new optional arguments to 2 publicly visible routines, and new
mandatory arguments to 3 others, but by default the meaning and units of all
previous arguments are the same, and answers will be bitwise identical in any
Boussinesq cases.  However, answers will change in any non-Boussinesq cases that
use the ALE_sponges.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed Feb 14, 2024
1 parent c37a2f0 commit 0fb905f
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
endif

if (associated(ALE_sponge_in_CSp)) then
call rotate_ALE_sponge(ALE_sponge_in_CSp, G_in, CS%ALE_sponge_CSp, G, GV, turns, param_file)
call rotate_ALE_sponge(ALE_sponge_in_CSp, G_in, CS%ALE_sponge_CSp, G, GV, US, turns, param_file)
call update_ALE_sponge_field(CS%ALE_sponge_CSp, T_in, G, GV, CS%T)
call update_ALE_sponge_field(CS%ALE_sponge_CSp, S_in, G, GV, CS%S)
endif
Expand Down
14 changes: 8 additions & 6 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2074,9 +2074,9 @@ subroutine initialize_sponges_file(G, GV, US, use_temperature, tv, u, v, depth_t
! else
! Initialize sponges without supplying sponge grid
! if (sponge_uv) then
! call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, Idamp_u, Idamp_v)
! call initialize_ALE_sponge(Idamp, G, GV, US, param_file, ALE_CSp, Idamp_u, Idamp_v)
! else
! call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp)
! call initialize_ALE_sponge(Idamp, G, GV, US, param_file, ALE_CSp)
! endif
endif

Expand Down Expand Up @@ -2118,9 +2118,11 @@ subroutine initialize_sponges_file(G, GV, US, use_temperature, tv, u, v, depth_t
endif

if (sponge_uv) then
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, h, nz_data, Idamp_u, Idamp_v)
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, dz, nz_data, Idamp_u, Idamp_v, &
data_h_is_Z=.true.)
else
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, h, nz_data)
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, dz, nz_data, &
data_h_is_Z=.true.)
endif
if (use_temperature) then
call set_up_ALE_sponge_field(tmp_T, G, GV, tv%T, ALE_CSp, 'temp', &
Expand All @@ -2147,9 +2149,9 @@ subroutine initialize_sponges_file(G, GV, US, use_temperature, tv, u, v, depth_t
else
! Initialize sponges without supplying sponge grid
if (sponge_uv) then
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp, Idamp_u, Idamp_v)
call initialize_ALE_sponge(Idamp, G, GV, US, param_file, ALE_CSp, Idamp_u, Idamp_v)
else
call initialize_ALE_sponge(Idamp, G, GV, param_file, ALE_CSp)
call initialize_ALE_sponge(Idamp, G, GV, US, param_file, ALE_CSp)
endif
! The remaining calls to set_up_sponge_field can be in any order.
if ( use_temperature) then
Expand Down
Loading

0 comments on commit 0fb905f

Please sign in to comment.