MOM6
mom_domains::fill_symmetric_edges Interface Reference

Detailed Description

Definition at line 96 of file MOM_domains.F90.

Private functions

subroutine fill_vector_symmetric_edges_2d (u_cmpt, v_cmpt, MOM_dom, stagger, scalar)
 

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 
)
private
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.

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

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