143 character(len=*),
intent(in) :: mesg
144 type(ocean_grid_type),
intent(inout) :: g
145 real,
dimension(G%IsdB:,G%jsd:),
intent(in) :: u_comp
146 real,
dimension(G%isd:,G%JsdB:),
intent(in) :: v_comp
147 integer,
optional,
intent(in) :: is, ie, js, je
148 integer,
optional,
intent(in) :: direction
156 real :: u_nonsym(g%isd:g%ied,g%jsd:g%jed)
157 real :: v_nonsym(g%isd:g%ied,g%jsd:g%jed)
158 real :: u_resym(g%isdb:g%iedb,g%jsd:g%jed)
159 real :: v_resym(g%isd:g%ied,g%jsdb:g%jedb)
160 character(len=128) :: mesg2
162 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
163 integer :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
164 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
165 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
166 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
168 if (.not.(
present(is) .or.
present(ie) .or.
present(js) .or.
present(je)))
then 170 if ((isd == isdb) .and. (jsd == jsdb))
return 173 do i=isd,ied ;
do j=jsd,jed
174 u_nonsym(i,j) = u_comp(i,j) ; v_nonsym(i,j) = v_comp(i,j)
177 if (.not.
associated(g%Domain_aux))
call mom_error(fatal,
" check_redundant"//&
178 " called with a non-associated auxiliary domain the grid type.")
179 call pass_vector(u_nonsym, v_nonsym, g%Domain_aux, direction)
181 do i=isdb,iedb ;
do j=jsd,jed ; u_resym(i,j) = u_comp(i,j) ;
enddo ;
enddo 182 do i=isd,ied ;
do j=jsdb,jedb ; v_resym(i,j) = v_comp(i,j) ;
enddo ;
enddo 183 do i=isd,ied ;
do j=jsd,jed
184 u_resym(i,j) = u_nonsym(i,j) ; v_resym(i,j) = v_nonsym(i,j)
186 call pass_vector(u_resym, v_resym, g%Domain, direction)
188 is_ch = isq ; ie_ch = ieq ; js_ch = jsq ; je_ch = jeq
189 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
190 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
192 do i=is_ch,ie_ch ;
do j=js_ch+1,je_ch
193 if (u_resym(i,j) /= u_comp(i,j) .and. &
194 redundant_prints(3) < max_redundant_prints)
then 195 write(mesg2,
'(" redundant u-components",2(1pe12.4)," differ by ", & 196 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
197 u_comp(i,j), u_resym(i,j),u_comp(i,j)-u_resym(i,j),i,j,pe_here()
198 write(0,
'(A130)') trim(mesg)//trim(mesg2)
199 redundant_prints(3) = redundant_prints(3) + 1
202 do i=is_ch+1,ie_ch ;
do j=js_ch,je_ch
203 if (v_resym(i,j) /= v_comp(i,j) .and. &
204 redundant_prints(3) < max_redundant_prints)
then 205 write(mesg2,
'(" redundant v-comps",2(1pe12.4)," differ by ", & 206 & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)') &
207 v_comp(i,j), v_resym(i,j),v_comp(i,j)-v_resym(i,j),i,j, &
208 g%geoLonBu(i,j), g%geoLatBu(i,j), pe_here()
209 write(0,
'(A155)') trim(mesg)//trim(mesg2)
210 redundant_prints(3) = redundant_prints(3) + 1