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 88 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...
 

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 525 of file MOM_domains.F90.

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

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