MOM6
mom_domains::fill_symmetric_edges Interface Reference

Detailed Description

Do a set of halo updates that fill in the values at the duplicated edges of a staggered symmetric memory domain.

Definition at line 93 of file MOM_domains.F90.

Private functions

subroutine fill_vector_symmetric_edges_2d (u_cmpt, v_cmpt, MOM_dom, stagger, scalar, clock)
 fill_vector_symmetric_edges_2d does an usual set of halo updates that only fill in the values at the edge of a pair of symmetric memory two-dimensional arrays representing the compontents of a two-dimensional horizontal vector. If symmetric memory is not being used, this subroutine does nothing except to possibly turn optional cpu clocks on or off. More...
 

Detailed Description

Do a set of halo updates that fill in the values at the duplicated edges of a staggered symmetric memory domain.

Definition at line 93 of file MOM_domains.F90.

Functions and subroutines

◆ fill_vector_symmetric_edges_2d()

subroutine mom_domains::fill_symmetric_edges::fill_vector_symmetric_edges_2d ( real, dimension(:,:), intent(inout)  u_cmpt,
real, dimension(:,:), intent(inout)  v_cmpt,
type(mom_domain_type), intent(inout)  MOM_dom,
integer, intent(in), optional  stagger,
logical, intent(in), optional  scalar,
integer, intent(in), optional  clock 
)
private

fill_vector_symmetric_edges_2d does an usual set of halo updates that only fill in the values at the edge of a pair of symmetric memory two-dimensional arrays representing the compontents of a two-dimensional horizontal vector. If symmetric memory is not being used, this subroutine does nothing except to possibly turn optional cpu clocks on or off.

Parameters
[in,out]u_cmptThe nominal zonal (u) component of the vector pair which is having its halos points exchanged.
[in,out]v_cmptThe nominal meridional (v) component of the vector pair which is having its halos points exchanged.
[in,out]mom_domThe MOM_domain_type containing the mpp_domain needed to determine where data should be sent.
[in]staggerAn optional flag, which may be one of A_GRID, BGRID_NE, or CGRID_NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to CGRID_NE.
[in]scalarAn optional argument indicating whether.
[in]clockThe handle for a cpu time clock that should be started then stopped to time this routine.

Definition at line 548 of file MOM_domains.F90.

548  real, dimension(:,:), intent(inout) :: u_cmpt !< The nominal zonal (u) component of the vector
549  !! pair which is having its halos points
550  !! exchanged.
551  real, dimension(:,:), intent(inout) :: v_cmpt !< The nominal meridional (v) component of the
552  !! vector pair which is having its halos points
553  !! exchanged.
554  type(MOM_domain_type), intent(inout) :: MOM_dom !< The MOM_domain_type containing the mpp_domain
555  !! needed to determine where data should be
556  !! sent.
557  integer, optional, intent(in) :: stagger !< An optional flag, which may be one of A_GRID,
558  !! BGRID_NE, or CGRID_NE, indicating where the two components of the vector are
559  !! discretized. Omitting stagger is the same as setting it to CGRID_NE.
560  logical, optional, intent(in) :: scalar !< An optional argument indicating whether.
561  integer, optional, intent(in) :: clock !< The handle for a cpu time clock that should be
562  !! started then stopped to time this routine.
563 
564  ! Local variables
565  integer :: stagger_local
566  integer :: dirflag
567  integer :: i, j, isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB
568  real, allocatable, dimension(:) :: sbuff_x, sbuff_y, wbuff_x, wbuff_y
569  logical :: block_til_complete
570 
571  if (.not. mom_dom%symmetric) then
572  return
573  endif
574 
575  if (present(clock)) then ; if (clock>0) call cpu_clock_begin(clock) ; endif
576 
577  stagger_local = cgrid_ne ! Default value for type of grid
578  if (present(stagger)) stagger_local = stagger
579 
580  if (.not.(stagger_local == cgrid_ne .or. stagger_local == bgrid_ne)) return
581 
582  call mpp_get_compute_domain(mom_dom%mpp_domain, isc, iec, jsc, jec)
583  call mpp_get_data_domain(mom_dom%mpp_domain, isd, ied, jsd, jed)
584 
585  ! Adjust isc, etc., to account for the fact that the input arrays indices all
586  ! start at 1 (and are effectively on a SW grid!).
587  isc = isc - (isd-1) ; iec = iec - (isd-1)
588  jsc = jsc - (jsd-1) ; jec = jec - (jsd-1)
589  iscb = isc ; iecb = iec+1 ; jscb = jsc ; jecb = jec+1
590 
591  dirflag = to_all ! 60
592  if (present(scalar)) then ; if (scalar) dirflag = to_all+scalar_pair ; endif
593 
594  if (stagger_local == cgrid_ne) then
595  allocate(wbuff_x(jsc:jec)) ; allocate(sbuff_y(isc:iec))
596  wbuff_x(:) = 0.0 ; sbuff_y(:) = 0.0
597  call mpp_get_boundary(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
598  wbufferx=wbuff_x, sbuffery=sbuff_y, &
599  gridtype=cgrid_ne)
600  do i=isc,iec
601  v_cmpt(i,jscb) = sbuff_y(i)
602  enddo
603  do j=jsc,jec
604  u_cmpt(iscb,j) = wbuff_x(j)
605  enddo
606  deallocate(wbuff_x) ; deallocate(sbuff_y)
607  elseif (stagger_local == bgrid_ne) then
608  allocate(wbuff_x(jscb:jecb)) ; allocate(sbuff_x(iscb:iecb))
609  allocate(wbuff_y(jscb:jecb)) ; allocate(sbuff_y(iscb:iecb))
610  wbuff_x(:) = 0.0 ; wbuff_y(:) = 0.0 ; sbuff_x(:) = 0.0 ; sbuff_y(:) = 0.0
611  call mpp_get_boundary(u_cmpt, v_cmpt, mom_dom%mpp_domain, flags=dirflag, &
612  wbufferx=wbuff_x, sbufferx=sbuff_x, &
613  wbuffery=wbuff_y, sbuffery=sbuff_y, &
614  gridtype=bgrid_ne)
615  do i=iscb,iecb
616  u_cmpt(i,jscb) = sbuff_x(i) ; v_cmpt(i,jscb) = sbuff_y(i)
617  enddo
618  do j=jscb,jecb
619  u_cmpt(iscb,j) = wbuff_x(j) ; v_cmpt(iscb,j) = wbuff_y(j)
620  enddo
621  deallocate(wbuff_x) ; deallocate(sbuff_x)
622  deallocate(wbuff_y) ; deallocate(sbuff_y)
623  endif
624 
625  if (present(clock)) then ; if (clock>0) call cpu_clock_end(clock) ; endif
626 

The documentation for this interface was generated from the following file: