Check for consistency between the duplicated points of a 2-D A-grid vector.
501 character(len=*),
intent(in) :: mesg
502 type(ocean_grid_type),
intent(inout) :: G
503 real,
dimension(G%isd:,G%jsd:),
intent(in) :: u_comp
505 real,
dimension(G%isd:,G%jsd:),
intent(in) :: v_comp
507 integer,
optional,
intent(in) :: is
508 integer,
optional,
intent(in) :: ie
509 integer,
optional,
intent(in) :: js
510 integer,
optional,
intent(in) :: je
511 integer,
optional,
intent(in) :: direction
514 real :: u_nonsym(G%isd:G%ied,G%jsd:G%jed)
515 real :: v_nonsym(G%isd:G%ied,G%jsd:G%jed)
516 character(len=128) :: mesg2
518 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
519 integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
520 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
521 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
522 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
524 is_ch = g%isc ; ie_ch = g%iec ; js_ch = g%jsc ; je_ch = g%jec
525 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
526 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
529 if ((is_ch == g%isc) .and. (ie_ch == g%iec) .and. &
530 (js_ch == g%jsc) .and. (je_ch == g%jec))
return
532 do i=isd,ied ;
do j=jsd,jed
533 u_nonsym(i,j) = u_comp(i,j) ; v_nonsym(i,j) = v_comp(i,j)
536 call pass_vector(u_nonsym, v_nonsym, g%Domain, direction, stagger=agrid)
538 do i=is_ch,ie_ch ;
do j=js_ch+1,je_ch
539 if (u_nonsym(i,j) /= u_comp(i,j) .and. &
540 redundant_prints(1) < max_redundant_prints)
then
541 write(mesg2,
'(" redundant u-components",2(1pe12.4)," differ by ", &
542 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
543 u_comp(i,j), u_nonsym(i,j),u_comp(i,j)-u_nonsym(i,j),i,j,pe_here()
544 write(0,
'(A130)') trim(mesg)//trim(mesg2)
545 redundant_prints(1) = redundant_prints(1) + 1
548 do i=is_ch+1,ie_ch ;
do j=js_ch,je_ch
549 if (v_nonsym(i,j) /= v_comp(i,j) .and. &
550 redundant_prints(1) < max_redundant_prints)
then
551 write(mesg2,
'(" redundant v-comps",2(1pe12.4)," differ by ", &
552 & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)') &
553 v_comp(i,j), v_nonsym(i,j),v_comp(i,j)-v_nonsym(i,j),i,j, &
554 g%geoLonBu(i,j), g%geoLatBu(i,j), pe_here()
555 write(0,
'(A155)') trim(mesg)//trim(mesg2)
556 redundant_prints(1) = redundant_prints(1) + 1