Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 13 additions & 0 deletions config_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module g_tracer_utils
character(len=fm_string_len) :: src_var_name !< Tracer source variable name
character(len=fm_string_len) :: src_var_unit !< Tracer source variable units
character(len=fm_string_len) :: src_var_gridspec !< Tracer source grid file name
character(len=fm_string_len) :: obc_src_file_name !< Boundary condition tracer source filename
character(len=fm_string_len) :: obc_src_field_name !< Boundary condition tracer source fieldname
integer :: src_var_record !< Unknown
logical :: requires_src_info = .false. !< Unknown
real :: src_var_unit_conversion = 1.0 !< This factor depends on the tracer. Ask Jasmin
Expand Down Expand Up @@ -61,6 +63,7 @@ module g_tracer_utils
public :: g_tracer_get_next
public :: g_tracer_is_prog
public :: g_diag_type
public :: g_tracer_get_obc_segment_props

!> Set the values of various (array) members of the tracer node g_tracer_type
!!
Expand Down Expand Up @@ -284,6 +287,16 @@ subroutine g_tracer_get_next(g_tracer,g_tracer_next)
type(g_tracer_type), pointer :: g_tracer_next !< Pointer to the next tracer node in the list
end subroutine g_tracer_get_next

!> get obc segment properties for each tracer
subroutine g_tracer_get_obc_segment_props(g_tracer_list, name, obc_has, src_file, src_var_name,lfac_in,lfac_out)
type(g_tracer_type), pointer :: g_tracer_list !< pointer to the head of the generic tracer list
type(g_tracer_type), pointer :: g_tracer !< Pointer to tracer node
character(len=*), intent(in) :: name !< tracer name
logical, intent(out):: obc_has !< .true. if This tracer has OBC
real, optional,intent(out):: lfac_in,lfac_out !< OBC reservoir inverse lengthscale factor
character(len=*),optional,intent(out):: src_file, src_var_name !< OBC source file and variable in file
end subroutine g_tracer_get_obc_segment_props

!>Vertical Diffusion of a tracer node
!!
!! This subroutine solves a tridiagonal equation to find and set values of vertically diffused field
Expand Down
4 changes: 3 additions & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module MOM
use MOM_tracer_registry, only : lock_tracer_registry, tracer_registry_end
use MOM_tracer_flow_control, only : call_tracer_register, tracer_flow_control_CS
use MOM_tracer_flow_control, only : tracer_flow_control_init, call_tracer_surface_state
use MOM_tracer_flow_control, only : tracer_flow_control_end
use MOM_tracer_flow_control, only : tracer_flow_control_end, call_tracer_register_obc_segments
use MOM_transcribe_grid, only : copy_dyngrid_to_MOM_grid, copy_MOM_grid_to_dyngrid
use MOM_unit_scaling, only : unit_scale_type, unit_scaling_init
use MOM_unit_scaling, only : unit_scaling_end, fix_restart_unit_scaling
Expand Down Expand Up @@ -2547,6 +2547,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
! could occur with the call to update_OBC_data or after the main initialization.
if (use_temperature) &
call register_temp_salt_segments(GV, US, CS%OBC, CS%tracer_Reg, param_file)
!This is the equivalent call to register_temp_salt_segments for external tracers with OBC
call call_tracer_register_obc_segments(GV, param_file, CS%tracer_flow_CSp, CS%tracer_Reg, CS%OBC)

! This needs the number of tracers and to have called any code that sets whether
! reservoirs are used.
Expand Down
Loading