From 2d3856f811041ab88b5368872c3db9630064dead Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Mon, 13 Jun 2016 20:42:18 -0400 Subject: [PATCH] Split out OBC positions in USER_initialization - As for commit 83e50eb0dfe8454a0431a079bf716c1bac9a9b37 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. --- .../MOM_state_initialization.F90 | 6 +++-- src/user/user_initialization.F90 | 25 ++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index fe310f51a3..7bda870db3 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -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 @@ -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.") diff --git a/src/user/user_initialization.F90 b/src/user/user_initialization.F90 index 0364ef884c..33e1090617 100644 --- a/src/user/user_initialization.F90 +++ b/src/user/user_initialization.F90 @@ -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. @@ -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. @@ -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