Skip to content

Commit

Permalink
Update diagnostic P_REF description
Browse files Browse the repository at this point in the history
As pointed out by @adcroft, the hybrid coordinate should not
generally be used for diagnostic purposes. The description
for P_REF when initializing a diagnostic coordinate has
been updated to reflect this.
  • Loading branch information
ashao authored and adcroft committed Dec 21, 2022
1 parent ced34c5 commit 053752d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 14 additions & 6 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,19 @@ subroutine initialize_regridding(CS, GV, US, max_depth, param_file, mdl, coord_m
call initCoord(CS, GV, US, coord_mode, param_file)

if (coord_is_state_dependent) then
call get_param(param_file, mdl, create_coord_param(param_prefix, "P_REF", param_suffix), P_Ref, &
"The pressure that is used for calculating the coordinate "//&
"density. (1 Pa = 1e4 dbar, so 2e7 is commonly used.) "//&
"This is only used if USE_EOS and ENABLE_THERMODYNAMICS are true.", &
units="Pa", default=2.0e7, scale=US%kg_m3_to_R*US%m_s_to_L_T**2)
if (main_parameters) then
call get_param(param_file, mdl, create_coord_param(param_prefix, "P_REF", param_suffix), P_Ref, &
"The pressure that is used for calculating the coordinate "//&
"density. (1 Pa = 1e4 dbar, so 2e7 is commonly used.) "//&
"This is only used if USE_EOS and ENABLE_THERMODYNAMICS are true.", &
units="Pa", default=2.0e7, scale=US%kg_m3_to_R*US%m_s_to_L_T**2)
else
call get_param(param_file, mdl, create_coord_param(param_prefix, "P_REF", param_suffix), P_Ref, &
"The pressure that is used for calculating the diagnostic coordinate "//&
"density. (1 Pa = 1e4 dbar, so 2e7 is commonly used.) "//&
"This is only used for the RHO coordinate.", &
units="Pa", default=2.0e7, scale=US%kg_m3_to_R*US%m_s_to_L_T**2)
endif
call get_param(param_file, mdl, create_coord_param(param_prefix, "REGRID_COMPRESSIBILITY_FRACTION", param_suffix), &
tmpReal, &
"When interpolating potential density profiles we can add "//&
Expand Down Expand Up @@ -2444,7 +2452,7 @@ subroutine set_regrid_params( CS, boundary_extrapolation, min_thickness, old_gri
call set_rho_params(CS%rho_CS, interp_CS=CS%interp_CS)
case (REGRIDDING_HYCOM1)
if (associated(CS%hycom_CS) .and. (present(interp_scheme) .or. present(boundary_extrapolation))) &
call set_hycom_params(CS%hycom_CS, interp_CS=CS%interp_CS, ref_pressure=ref_pressure)
call set_hycom_params(CS%hycom_CS, interp_CS=CS%interp_CS)
case (REGRIDDING_HYBGEN)
! Do nothing for now.
case (REGRIDDING_SLIGHT)
Expand Down
4 changes: 1 addition & 3 deletions src/ALE/coord_hycom.F90
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ subroutine end_coord_hycom(CS)
end subroutine end_coord_hycom

!> This subroutine can be used to set the parameters for the coord_hycom module
subroutine set_hycom_params(CS, max_interface_depths, max_layer_thickness, interp_CS, ref_pressure)
subroutine set_hycom_params(CS, max_interface_depths, max_layer_thickness, interp_CS)
type(hycom_CS), pointer :: CS !< Coordinate control structure
real, dimension(:), optional, intent(in) :: max_interface_depths !< Maximum depths of interfaces [H ~> m or kg m-2]
real, dimension(:), optional, intent(in) :: max_layer_thickness !< Maximum thicknesses of layers [H ~> m or kg m-2]
type(interp_CS_type), optional, intent(in) :: interp_CS !< Controls for interpolation
real, optional, intent(in) :: ref_pressure !< The reference pressure for density-dependent
!! coordinates [R L2 T-2 ~> Pa]

if (.not. associated(CS)) call MOM_error(FATAL, "set_hycom_params: CS not associated")

Expand Down

0 comments on commit 053752d

Please sign in to comment.