331 character(len=*),
intent(in) :: mesg
332 type(ocean_grid_type),
intent(inout) :: g
333 real,
dimension(G%IsdB:,G%JsdB:),
intent(in) :: u_comp
334 real,
dimension(G%IsdB:,G%JsdB:),
intent(in) :: v_comp
335 integer,
optional,
intent(in) :: is, ie, js, je
336 integer,
optional,
intent(in) :: direction
344 real :: u_nonsym(g%isd:g%ied,g%jsd:g%jed)
345 real :: v_nonsym(g%isd:g%ied,g%jsd:g%jed)
346 real :: u_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
347 real :: v_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
348 character(len=128) :: mesg2
350 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
351 integer :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
352 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
353 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
354 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
356 if (.not.(
present(is) .or.
present(ie) .or.
present(js) .or.
present(je)))
then 358 if ((isd == isdb) .and. (jsd == jsdb))
return 361 do i=isd,ied ;
do j=jsd,jed
362 u_nonsym(i,j) = u_comp(i,j) ; v_nonsym(i,j) = v_comp(i,j)
365 if (.not.
associated(g%Domain_aux))
call mom_error(fatal,
" check_redundant"//&
366 " called with a non-associated auxiliary domain the grid type.")
367 call pass_vector(u_nonsym, v_nonsym, g%Domain_aux, direction, stagger=bgrid_ne)
369 do i=isdb,iedb ;
do j=jsdb,jedb
370 u_resym(i,j) = u_comp(i,j) ; v_resym(i,j) = v_comp(i,j)
372 do i=isd,ied ;
do j=jsd,jed
373 u_resym(i,j) = u_nonsym(i,j) ; v_resym(i,j) = v_nonsym(i,j)
375 call pass_vector(u_resym, v_resym, g%Domain, direction, stagger=bgrid_ne)
377 is_ch = isq ; ie_ch = ieq ; js_ch = jsq ; je_ch = jeq
378 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
379 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
381 do i=is_ch,ie_ch ;
do j=js_ch,je_ch
382 if (u_resym(i,j) /= u_comp(i,j) .and. &
383 redundant_prints(2) < max_redundant_prints)
then 384 write(mesg2,
'(" redundant u-components",2(1pe12.4)," differ by ", & 385 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
386 u_comp(i,j), u_resym(i,j),u_comp(i,j)-u_resym(i,j),i,j,pe_here()
387 write(0,
'(A130)') trim(mesg)//trim(mesg2)
388 redundant_prints(2) = redundant_prints(2) + 1
391 do i=is_ch,ie_ch ;
do j=js_ch,je_ch
392 if (v_resym(i,j) /= v_comp(i,j) .and. &
393 redundant_prints(2) < max_redundant_prints)
then 394 write(mesg2,
'(" redundant v-comps",2(1pe12.4)," differ by ", & 395 & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)') &
396 v_comp(i,j), v_resym(i,j),v_comp(i,j)-v_resym(i,j),i,j, &
397 g%geoLonBu(i,j), g%geoLatBu(i,j), pe_here()
398 write(0,
'(A155)') trim(mesg)//trim(mesg2)
399 redundant_prints(2) = redundant_prints(2) + 1