Skip to content

Commit

Permalink
Split out OBC positions in USER_initialization
Browse files Browse the repository at this point in the history
- As for commit 83e50eb
  the setting OBC masks and inflow data are now separated.
- This commit is mostly a no-op since the USER_initialization
  module is blank and only provides example APIs.
- This is one step in a larger re-factor of OBC code.
  • Loading branch information
adcroft committed Jun 14, 2016
1 parent 83e50eb commit 2d3856f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module MOM_state_initialization
use MOM_EOS, only : int_specific_vol_dp
use user_initialization, only : user_initialize_thickness, user_initialize_velocity
use user_initialization, only : user_init_temperature_salinity
use user_initialization, only : user_set_Open_Bdry_Conds, user_initialize_sponges
use user_initialization, only : user_set_OBC_positions, user_set_OBC_data
use user_initialization, only : user_initialize_sponges
use DOME_initialization, only : DOME_initialize_thickness
use DOME_initialization, only : DOME_set_OBC_positions, DOME_set_OBC_data
use DOME_initialization, only : DOME_initialize_sponges
Expand Down Expand Up @@ -443,7 +444,8 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
call DOME_set_OBC_positions(G, PF, OBC)
call DOME_set_OBC_data(OBC, tv, G, GV, PF, tracer_Reg)
elseif (trim(config) == "USER") then
call user_set_Open_Bdry_Conds(OBC, tv, G, PF, tracer_Reg)
call user_set_OBC_positions(G, PF, OBC)
call user_set_OBC_data(OBC, tv, G, PF, tracer_Reg)
else
call MOM_error(FATAL, "The open boundary conditions specified by "//&
"OBC_CONFIG = "//trim(config)//" have not been fully implemented.")
Expand Down
25 changes: 21 additions & 4 deletions src/user/user_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module user_initialization
public USER_set_coord, USER_initialize_topography, USER_initialize_thickness
public USER_initialize_velocity, USER_init_temperature_salinity
public USER_init_mixed_layer_density, USER_initialize_sponges
public USER_set_Open_Bdry_Conds, USER_set_rotation
public USER_set_OBC_positions, USER_set_OBC_data, USER_set_rotation

logical :: first_call = .true.

Expand Down Expand Up @@ -197,8 +197,25 @@ subroutine USER_initialize_sponges(G, use_temperature, tv, param_file, CSp, h)

end subroutine USER_initialize_sponges

!> This subroutine sets the location of open boundaries.
subroutine USER_set_OBC_positions(G, param_file, OBC)
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
type(param_file_type), intent(in) :: param_file !< A structure indicating the
!! open file to parse for model
!! parameter values.
type(ocean_OBC_type), pointer :: OBC !< This open boundary condition type specifies
!! whether, where, and what open boundary
!! conditions are used.
! call MOM_error(FATAL, &
! "USER_initialization.F90, USER_set_OBC_positions: " // &
! "Unmodified user routine called - you must edit the routine to use it")

if (first_call) call write_user_log(param_file)

end subroutine USER_set_OBC_positions

!> This subroutine sets the properties of flow at open boundary conditions.
subroutine USER_set_Open_Bdry_Conds(OBC, tv, G, param_file, tr_Reg)
subroutine USER_set_OBC_data(OBC, tv, G, param_file, tr_Reg)
type(ocean_OBC_type), pointer :: OBC !< This open boundary condition type specifies
!! whether, where, and what open boundary
!! conditions are used.
Expand All @@ -212,12 +229,12 @@ subroutine USER_set_Open_Bdry_Conds(OBC, tv, G, param_file, tr_Reg)
!! parameter values.
type(tracer_registry_type), pointer :: tr_Reg !< Tracer registry.
! call MOM_error(FATAL, &
! "USER_initialization.F90, USER_set_Open_Bdry_Conds: " // &
! "USER_initialization.F90, USER_set_OBC_data: " // &
! "Unmodified user routine called - you must edit the routine to use it")

if (first_call) call write_user_log(param_file)

end subroutine USER_set_Open_Bdry_Conds
end subroutine USER_set_OBC_data

subroutine USER_set_rotation(G, param_file)
type(ocean_grid_type), intent(inout) :: G
Expand Down

0 comments on commit 2d3856f

Please sign in to comment.