Skip to content

Commit

Permalink
+Added an optional halo argument to geothermal
Browse files Browse the repository at this point in the history
  Added an optional argument to geothermal that will cause it to work on an
extended region beyond the computational domain, along with a pass_var call on
the static geothermal heat flux to enable this to work properly.  All answers
are bitwise identical, but there is a new optional argument to a publicly
visible subroutines.
  • Loading branch information
Hallberg-NOAA committed Sep 10, 2018
1 parent 76a87b4 commit fd6fb2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/parameterizations/vertical/MOM_geothermal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module MOM_geothermal

use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
use MOM_diag_mediator, only : register_static_field, time_type, diag_ctrl
use MOM_domains, only : pass_var
use MOM_error_handler, only : MOM_error, FATAL, WARNING
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
use MOM_io, only : MOM_read_data, slasher
Expand Down Expand Up @@ -44,7 +45,7 @@ module MOM_geothermal
!! the partial derivative of the coordinate density with temperature is positive
!! or very small, the layers are simply heated in place. Any heat that can not
!! be applied to the ocean is returned (WHERE)?
subroutine geothermal(h, tv, dt, ea, eb, G, GV, CS)
subroutine geothermal(h, tv, dt, ea, eb, G, GV, CS, halo)
type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure.
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid
!! structure.
Expand All @@ -69,6 +70,7 @@ subroutine geothermal(h, tv, dt, ea, eb, G, GV, CS)
type(geothermal_CS), pointer :: CS !< The control structure returned by
!! a previous call to
!! geothermal_init.
integer, optional, intent(in) :: halo !< Halo width over which to work
! Local variables
real, dimension(SZI_(G)) :: &
heat_rem, & ! remaining heat (H * degC)
Expand Down Expand Up @@ -105,6 +107,9 @@ subroutine geothermal(h, tv, dt, ea, eb, G, GV, CS)


is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
if (present(halo)) then
is = G%isc-halo ; ie = G%iec+halo ; js = G%jsc-halo ; je = G%jec+halo
endif

if (.not. associated(CS)) call MOM_error(FATAL, "MOM_geothermal: "//&
"Module must be initialized before it is used.")
Expand Down Expand Up @@ -377,6 +382,7 @@ subroutine geothermal_init(Time, G, param_file, diag, CS)
CS%geo_heat(i,j) = G%mask2dT(i,j) * scale
enddo ; enddo
endif
call pass_var(CS%geo_heat, G%domain)

! post the static geothermal heating field
id = register_static_field('ocean_model', 'geo_heat', diag%axesT1, &
Expand Down

0 comments on commit fd6fb2e

Please sign in to comment.