525 real,
dimension(:,:),
intent(inout) :: u_cmpt
528 real,
dimension(:,:),
intent(inout) :: v_cmpt
531 type(mom_domain_type),
intent(inout) :: mom_dom
534 integer,
optional,
intent(in) :: stagger
537 logical,
optional,
intent(in) :: scalar
550 integer :: stagger_local
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
556 if (.not. mom_dom%symmetric)
return 558 stagger_local = cgrid_ne
559 if (
present(stagger)) stagger_local = stagger
561 if (.not.(stagger_local == cgrid_ne .or. stagger_local == bgrid_ne))
return 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)
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
573 if (
present(scalar))
then ;
if (scalar) dirflag = to_all+scalar_pair ;
endif 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, &
582 v_cmpt(i,jscb) = sbuff_y(i)
585 u_cmpt(iscb,j) = wbuff_x(j)
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, &
597 u_cmpt(i,jscb) = sbuff_x(i) ; v_cmpt(i,jscb) = sbuff_y(i)
600 u_cmpt(iscb,j) = wbuff_x(j) ; v_cmpt(iscb,j) = wbuff_y(j)
602 deallocate(wbuff_x) ;
deallocate(sbuff_x)
603 deallocate(wbuff_y) ;
deallocate(sbuff_y)