Skip to content

Commit

Permalink
Enhancements for adding land block elimination to NUOPC cap:
Browse files Browse the repository at this point in the history
 - Add sum_across_PEs_int4_2d to the sum_across_PEs interface
 - Allow mask_table file to be placed in run directory (now,
the first dir that is looked at).
  • Loading branch information
alperaltuntas committed Oct 22, 2023
1 parent d363034 commit c58aa8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 10 additions & 0 deletions config_src/infra/FMS2/MOM_coms_infra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module MOM_coms_infra
interface sum_across_PEs
module procedure sum_across_PEs_int4_0d
module procedure sum_across_PEs_int4_1d
module procedure sum_across_PEs_int4_2d
module procedure sum_across_PEs_int8_0d
module procedure sum_across_PEs_int8_1d
module procedure sum_across_PEs_int8_2d
Expand Down Expand Up @@ -357,6 +358,15 @@ subroutine sum_across_PEs_int4_1d(field, length, pelist)
call mpp_sum(field, length, pelist)
end subroutine sum_across_PEs_int4_1d

!> Find the sum of the values in corresponding positions of field across PEs, and return these sums in field.
subroutine sum_across_PEs_int4_2d(field, length, pelist)
integer(kind=int32), dimension(:,:), intent(inout) :: field !< The values to add, the sums upon return
integer, intent(in) :: length !< Number of elements in field to add
integer, optional, intent(in) :: pelist(:) !< List of PEs to work with

call mpp_sum(field, length, pelist)
end subroutine sum_across_PEs_int4_2d

!> Find the sum of field across PEs, and return this sum in field.
subroutine sum_across_PEs_int8_0d(field, pelist)
integer(kind=int64), intent(inout) :: field !< Value on this PE, and the sum across PEs upon return
Expand Down
10 changes: 8 additions & 2 deletions src/framework/MOM_domains.F90
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,14 @@ subroutine MOM_domains_init(MOM_dom, param_file, symmetric, static_memory, &
"example of mask_table masks out 2 processors, (1,2) and (3,6), out of the 24 "//&
"in a 4x6 layout: \n 2\n 4,6\n 1,2\n 3,6\n", default="MOM_mask_table", &
layoutParam=.true.)
mask_table = trim(inputdir)//trim(mask_table)
mask_table_exists = file_exists(mask_table)

! First, check the run directory for the mask_table input file.
mask_table_exists = file_exists(trim(mask_table))
! If not found, check the input directory
if (.not. mask_table_exists) then
mask_table = trim(inputdir)//trim(mask_table)
mask_table_exists = file_exists(mask_table)
endif

if (is_static) then
layout(1) = NIPROC ; layout(2) = NJPROC
Expand Down

0 comments on commit c58aa8d

Please sign in to comment.