Skip to content

Commit

Permalink
Use MOM framework routines in MOM_open_boundary
Browse files Browse the repository at this point in the history
  Use MOM framework interfaces in MOM_open_boundary in place of direct calls to
mpp routines, to facilitate the migration to FMS2.  All answers are bitwise
identical.
  • Loading branch information
Hallberg-NOAA committed Jan 3, 2021
1 parent 1e6bdd6 commit 9b0b8db
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ module MOM_open_boundary

use MOM_array_transform, only : rotate_array, rotate_array_pair
use MOM_array_transform, only : allocate_rotated_array
use MOM_coms, only : sum_across_PEs
use MOM_coms, only : sum_across_PEs, Set_PElist, Get_PElist, PE_here, num_PEs
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : diag_ctrl, time_type
use MOM_domains, only : pass_var, pass_vector
use MOM_domains, only : To_All, SCALAR_PAIR, CGRID_NE, CORNER
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
use MOM_error_handler, only : NOTE
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, NOTE, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type, log_param
use MOM_grid, only : ocean_grid_type, hor_index_type
use MOM_dyn_horgrid, only : dyn_horgrid_type
Expand Down Expand Up @@ -651,13 +650,11 @@ end subroutine open_boundary_config
!> Allocate space for reading OBC data from files. It sets up the required vertical
!! remapping. In the process, it does funky stuff with the MPI processes.
subroutine initialize_segment_data(G, OBC, PF)
use mpp_mod, only : mpp_pe, mpp_set_current_pelist, mpp_get_current_pelist,mpp_npes

type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
type(ocean_OBC_type), intent(inout) :: OBC !< Open boundary control structure
type(param_file_type), intent(in) :: PF !< Parameter file handle
type(ocean_OBC_type), intent(inout) :: OBC !< Open boundary control structure
type(param_file_type), intent(in) :: PF !< Parameter file handle

integer :: n,m,num_fields
integer :: n, m, num_fields
character(len=1024) :: segstr
character(len=256) :: filename
character(len=20) :: segnam, suffix
Expand Down Expand Up @@ -697,11 +694,11 @@ subroutine initialize_segment_data(G, OBC, PF)

!< temporarily disable communication in order to read segment data independently

allocate(saved_pelist(0:mpp_npes()-1))
call mpp_get_current_pelist(saved_pelist)
current_pe = mpp_pe()
allocate(saved_pelist(0:num_PEs()-1))
call Get_PElist(saved_pelist)
current_pe = PE_here()
single_pelist(1) = current_pe
call mpp_set_current_pelist(single_pelist)
call Set_PElist(single_pelist)

do n=1, OBC%number_of_segments
segment => OBC%segment(n)
Expand Down Expand Up @@ -955,7 +952,7 @@ subroutine initialize_segment_data(G, OBC, PF)
endif
enddo

call mpp_set_current_pelist(saved_pelist)
call Set_PElist(saved_pelist)

end subroutine initialize_segment_data

Expand Down

0 comments on commit 9b0b8db

Please sign in to comment.