Skip to content

Commit

Permalink
Merge branch 'oda_use_framework' of https://github.com/MJHarrison-GFD…
Browse files Browse the repository at this point in the history
…L/MOM6 into Harrison_ODA_use_framework
  • Loading branch information
Hallberg-NOAA committed Jan 19, 2021
2 parents b90ad5c + 776a815 commit 4d839aa
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 77 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -880,12 +880,12 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
enddo ; enddo ; endif

if (CS%ensemble_ocean) then
! update the time for the next analysis step if needed
call set_analysis_time(CS%Time,CS%odaCS)
! store ensemble vector in odaCS
call set_prior_tracer(CS%Time, G, GV, CS%h, CS%tv, CS%odaCS)
! call DA interface
call oda(CS%Time,CS%odaCS)
! update the time for the next analysis step if needed
call set_analysis_time(CS%Time,CS%odaCS)
endif

if (showCallTree) call callTree_waypoint("calling extract_surface_state (step_MOM)")
Expand Down
4 changes: 2 additions & 2 deletions src/framework/MOM_coms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module MOM_coms
! This file is part of MOM6. See LICENSE.md for the license.

use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING
use MOM_coms_wrapper, only : PE_here, root_PE, num_PEs, Set_PElist, Get_PElist
use MOM_coms_wrapper, only : PE_here, root_PE, num_PEs, set_rootPE, Set_PElist, Get_PElist
use MOM_coms_wrapper, only : broadcast, field_chksum, MOM_infra_init, MOM_infra_end
use MOM_coms_wrapper, only : sum_across_PEs, max_across_PEs, min_across_PEs

implicit none ; private

public :: PE_here, root_PE, num_PEs, MOM_infra_init, MOM_infra_end
public :: broadcast, sum_across_PEs, min_across_PEs, max_across_PEs, field_chksum
public :: Set_PElist, Get_PElist
public :: set_PElist, Get_PElist, Set_rootPE
public :: reproducing_sum, reproducing_sum_EFP, EFP_sum_across_PEs, EFP_list_sum_across_PEs
public :: EFP_plus, EFP_minus, EFP_to_real, real_to_EFP, EFP_real_diff
public :: operator(+), operator(-), assignment(=)
Expand Down
3 changes: 2 additions & 1 deletion src/framework/MOM_coms_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ module MOM_coms_wrapper
use fms_mod, only : fms_end, MOM_infra_init => fms_init
use memutils_mod, only : print_memuse_stats
use mpp_mod, only : PE_here => mpp_pe, root_PE => mpp_root_pe, num_PEs => mpp_npes
use mpp_mod, only : set_rootPE => mpp_set_root_pe
use mpp_mod, only : Set_PElist => mpp_set_current_pelist, Get_PElist => mpp_get_current_pelist
use mpp_mod, only : mpp_broadcast, mpp_sync, mpp_sync_self, field_chksum => mpp_chksum
use mpp_mod, only : sum_across_PEs => mpp_sum, max_across_PEs => mpp_max, min_across_PEs => mpp_min

implicit none ; private

public :: PE_here, root_PE, num_PEs, MOM_infra_init, MOM_infra_end, Set_PElist, Get_PElist
public :: broadcast, sum_across_PEs, min_across_PEs, max_across_PEs, field_chksum
public :: set_rootPE, broadcast, sum_across_PEs, min_across_PEs, max_across_PEs, field_chksum

! This module provides interfaces to the non-domain-oriented communication subroutines.

Expand Down
48 changes: 47 additions & 1 deletion src/framework/MOM_domains.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ module MOM_domains
use mpp_domains_mod, only : To_East => WUPDATE, To_West => EUPDATE, Omit_Corners => EDGEUPDATE
use mpp_domains_mod, only : To_North => SUPDATE, To_South => NUPDATE
use mpp_domains_mod, only : CENTER, CORNER, NORTH_FACE => NORTH, EAST_FACE => EAST
use mpp_domains_mod, only : global_field => mpp_global_field
use mpp_domains_mod, only : mpp_redistribute
use mpp_domains_mod, only : broadcast_domain => mpp_broadcast_domain
use fms_io_mod, only : file_exist, parse_mask_table
use fms_affinity_mod, only : fms_affinity_init, fms_affinity_set, fms_affinity_get

Expand All @@ -52,7 +55,7 @@ module MOM_domains
public :: compute_block_extent, get_global_shape, get_layout_extents
public :: MOM_thread_affinity_set, set_MOM_thread_affinity
public :: get_simple_array_i_ind, get_simple_array_j_ind
public :: domain2D, domain1D
public :: domain2D, domain1D, global_field, redistribute_array, broadcast_domain

!> Do a halo update on an array
interface pass_var
Expand Down Expand Up @@ -104,6 +107,11 @@ module MOM_domains
module procedure clone_MD_to_MD, clone_MD_to_d2D
end interface clone_MOM_domain

!> Pass an array from one MOM domain to another
interface redistribute_array
module procedure redistribute_array_3d, redistribute_array_2d
end interface redistribute_array

!> Extract the 1-d domain components from a MOM_domain or domain2d
interface get_domain_components
module procedure get_domain_components_MD, get_domain_components_d2D
Expand Down Expand Up @@ -2110,6 +2118,44 @@ subroutine get_global_shape(domain, niglobal, njglobal)
njglobal = domain%njglobal
end subroutine get_global_shape

!> Returns various data that has been stored in a MOM_domain_type
subroutine redistribute_array_2d(Domain1, array1, Domain2, array2, complete)
type(domain2d), &
intent(in) :: Domain1 !< The MOM domain from which to extract information.
real, dimension(:,:), intent(in) :: array1 !< The array from which to extract information.
type(domain2d), &
intent(in) :: Domain2 !< The MOM domain receiving information.
real, dimension(:,:), intent(out) :: array2 !< The array receiving information.
logical, optional, intent(in) :: complete !< If true, finish communication before proceeding.

! Local variables
logical :: do_complete

do_complete=.true.;if (PRESENT(complete)) do_complete = complete

call mpp_redistribute(Domain1, array1, Domain2, array2, do_complete)

end subroutine redistribute_array_2d

!> Returns various data that has been stored in a MOM_domain_type
subroutine redistribute_array_3d(Domain1, array1, Domain2, array2, complete)
type(domain2d), &
intent(in) :: Domain1 !< The MOM domain from which to extract information.
real, dimension(:,:,:), intent(in) :: array1 !< The array from which to extract information.
type(domain2d), &
intent(in) :: Domain2 !< The MOM domain receiving information.
real, dimension(:,:,:), intent(out) :: array2 !< The array receiving information.
logical, optional, intent(in) :: complete !< If true, finish communication before proceeding.

! Local variables
logical :: do_complete

do_complete=.true.;if (PRESENT(complete)) do_complete = complete

call mpp_redistribute(Domain1, array1, Domain2, array2, do_complete)

end subroutine redistribute_array_3d

!> Returns arrays of the i- and j- sizes of the h-point computational domains for each
!! element of the grid layout. Any input values in the extent arrays are discarded, so
!! they are effectively intent out despite their declared intent of inout.
Expand Down
14 changes: 14 additions & 0 deletions src/framework/MOM_ensemble_manager.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
!> A simple (very thin) wrapper for managing ensemble member layout information
module MOM_ensemble_manager

! This file is part of MOM6. See LICENSE.md for the license.

use ensemble_manager_mod, only : get_ensemble_id, get_ensemble_size
use ensemble_manager_mod, only : get_ensemble_pelist, get_ensemble_filter_pelist

implicit none ; private

public get_ensemble_id, get_ensemble_size, get_ensemble_pelist, get_ensemble_filter_pelist


end module MOM_ensemble_manager
Loading

0 comments on commit 4d839aa

Please sign in to comment.