32 use mom_coms, only : pe_here, root_pe, num_pes, sum_across_pes
41 implicit none ;
private 95 #include "version_variable.h" 96 character(len=40) :: mdl =
"MOM_debugging" 100 "If true, write out verbose debugging data.", default=.false.)
102 "If true, checksums are performed on arrays in the \n"//&
103 "various vec_chksum routines.", default=
debug)
105 "If true, debug redundant data points during calls to \n"//&
106 "the various vec_chksum routines.", default=
debug)
114 character(len=*),
intent(in) :: mesg
116 real,
dimension(G%IsdB:,G%jsd:,:),
intent(in) :: u_comp
117 real,
dimension(G%isd:,G%JsdB:,:),
intent(in) :: v_comp
118 integer,
optional,
intent(in) :: is, ie, js, je
119 integer,
optional,
intent(in) :: direction
127 character(len=24) :: mesg_k
130 do k=1,
size(u_comp,3)
131 if (k < 10)
then ;
write(mesg_k,
'(" Layer",i2," ")') k
132 elseif (k < 100)
then ;
write(mesg_k,
'(" Layer",i3," ")') k
133 elseif (k < 1000)
then ;
write(mesg_k,
'(" Layer",i4," ")') k
134 else ;
write(mesg_k,
'(" Layer",i9," ")') k ;
endif 137 v_comp(:,:,k), g, is, ie, js, je, direction)
143 character(len=*),
intent(in) :: mesg
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. &
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)
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. &
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)
217 character(len=*),
intent(in) :: mesg
219 real,
dimension(G%IsdB:,G%JsdB:,:),
intent(in) :: array
220 integer,
optional,
intent(in) :: is, ie, js, je
226 character(len=24) :: mesg_k
230 if (k < 10)
then ;
write(mesg_k,
'(" Layer",i2," ")') k
231 elseif (k < 100)
then ;
write(mesg_k,
'(" Layer",i3," ")') k
232 elseif (k < 1000)
then ;
write(mesg_k,
'(" Layer",i4," ")') k
233 else ;
write(mesg_k,
'(" Layer",i9," ")') k ;
endif 242 character(len=*),
intent(in) :: mesg
244 real,
dimension(G%IsdB:,G%JsdB:),
intent(in) :: array
245 integer,
optional,
intent(in) :: is, ie, js, je
251 real :: a_nonsym(g%isd:g%ied,g%jsd:g%jed)
252 real :: a_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
253 character(len=128) :: mesg2
255 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
256 integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
257 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
258 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
259 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
261 if (.not.(
present(is) .or.
present(ie) .or.
present(js) .or.
present(je)))
then 263 if ((isd == isdb) .and. (jsd == jsdb))
return 266 do i=isd,ied ;
do j=jsd,jed
267 a_nonsym(i,j) = array(i,j)
270 if (.not.
associated(g%Domain_aux))
call mom_error(fatal,
" check_redundant"//&
271 " called with a non-associated auxiliary domain the grid type.")
272 call pass_vector(a_nonsym, a_nonsym, g%Domain_aux, &
273 direction=
to_all+scalar_pair, stagger=bgrid_ne)
275 do i=isdb,iedb ;
do j=jsdb,jedb ; a_resym(i,j) = array(i,j) ;
enddo ;
enddo 276 do i=isd,ied ;
do j=jsd,jed
277 a_resym(i,j) = a_nonsym(i,j)
282 is_ch = isq ; ie_ch = ieq ; js_ch = jsq ; je_ch = jeq
283 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
284 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
286 do i=is_ch,ie_ch ;
do j=js_ch,je_ch
287 if (a_resym(i,j) /= array(i,j) .and. &
289 write(mesg2,
'(" Redundant points",2(1pe12.4)," differ by ", & 290 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
291 array(i,j), a_resym(i,j),array(i,j)-a_resym(i,j),i,j,pe_here()
292 write(0,
'(A130)') trim(mesg)//trim(mesg2)
302 character(len=*),
intent(in) :: mesg
304 real,
dimension(G%IsdB:,G%JsdB:,:),
intent(in) :: u_comp
305 real,
dimension(G%IsdB:,G%JsdB:,:),
intent(in) :: v_comp
306 integer,
optional,
intent(in) :: is, ie, js, je
307 integer,
optional,
intent(in) :: direction
315 character(len=24) :: mesg_k
318 do k=1,
size(u_comp,3)
319 if (k < 10)
then ;
write(mesg_k,
'(" Layer",i2," ")') k
320 elseif (k < 100)
then ;
write(mesg_k,
'(" Layer",i3," ")') k
321 elseif (k < 1000)
then ;
write(mesg_k,
'(" Layer",i4," ")') k
322 else ;
write(mesg_k,
'(" Layer",i9," ")') k ;
endif 325 v_comp(:,:,k), g, is, ie, js, je, direction)
331 character(len=*),
intent(in) :: mesg
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. &
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)
391 do i=is_ch,ie_ch ;
do j=js_ch,je_ch
392 if (v_resym(i,j) /= v_comp(i,j) .and. &
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)
406 character(len=*),
intent(in) :: mesg
408 real,
dimension(G%isd:,G%jsd:,:),
intent(in) :: array
409 integer,
optional,
intent(in) :: is, ie, js, je
415 character(len=24) :: mesg_k
419 if (k < 10)
then ;
write(mesg_k,
'(" Layer",i2," ")') k
420 elseif (k < 100)
then ;
write(mesg_k,
'(" Layer",i3," ")') k
421 elseif (k < 1000)
then ;
write(mesg_k,
'(" Layer",i4," ")') k
422 else ;
write(mesg_k,
'(" Layer",i9," ")') k ;
endif 431 character(len=*),
intent(in) :: mesg
433 real,
dimension(G%isd:,G%jsd:),
intent(in) :: array
434 integer,
optional,
intent(in) :: is, ie, js, je
440 real :: a_nonsym(g%isd:g%ied,g%jsd:g%jed)
441 character(len=128) :: mesg2
443 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
444 integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed
445 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
447 is_ch = g%isc ; ie_ch = g%iec ; js_ch = g%jsc ; je_ch = g%jec
448 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
449 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
452 if ((is_ch == g%isc) .and. (ie_ch == g%iec) .and. &
453 (js_ch == g%jsc) .and. (je_ch == g%jec))
return 455 do i=isd,ied ;
do j=jsd,jed
456 a_nonsym(i,j) = array(i,j)
461 do i=is_ch,ie_ch ;
do j=js_ch,je_ch
462 if (a_nonsym(i,j) /= array(i,j) .and. &
464 write(mesg2,
'(" Redundant points",2(1pe12.4)," differ by ", & 465 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
466 array(i,j), a_nonsym(i,j),array(i,j)-a_nonsym(i,j),i,j,pe_here()
467 write(0,
'(A130)') trim(mesg)//trim(mesg2)
477 character(len=*),
intent(in) :: mesg
479 real,
dimension(G%isd:,G%jsd:,:),
intent(in) :: u_comp
480 real,
dimension(G%isd:,G%jsd:,:),
intent(in) :: v_comp
481 integer,
optional,
intent(in) :: is, ie, js, je
482 integer,
optional,
intent(in) :: direction
490 character(len=24) :: mesg_k
493 do k=1,
size(u_comp,3)
494 if (k < 10)
then ;
write(mesg_k,
'(" Layer",i2," ")') k
495 elseif (k < 100)
then ;
write(mesg_k,
'(" Layer",i3," ")') k
496 elseif (k < 1000)
then ;
write(mesg_k,
'(" Layer",i4," ")') k
497 else ;
write(mesg_k,
'(" Layer",i9," ")') k ;
endif 500 v_comp(:,:,k), g, is, ie, js, je, direction)
506 character(len=*),
intent(in) :: mesg
508 real,
dimension(G%isd:,G%jsd:),
intent(in) :: u_comp
509 real,
dimension(G%isd:,G%jsd:),
intent(in) :: v_comp
510 integer,
optional,
intent(in) :: is, ie, js, je
511 integer,
optional,
intent(in) :: direction
519 real :: u_nonsym(g%isd:g%ied,g%jsd:g%jed)
520 real :: v_nonsym(g%isd:g%ied,g%jsd:g%jed)
521 character(len=128) :: mesg2
523 integer :: i, j, is_ch, ie_ch, js_ch, je_ch
524 integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
525 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
526 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
527 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
529 is_ch = g%isc ; ie_ch = g%iec ; js_ch = g%jsc ; je_ch = g%jec
530 if (
present(is)) is_ch = is ;
if (
present(ie)) ie_ch = ie
531 if (
present(js)) js_ch = js ;
if (
present(js)) je_ch = je
534 if ((is_ch == g%isc) .and. (ie_ch == g%iec) .and. &
535 (js_ch == g%jsc) .and. (je_ch == g%jec))
return 537 do i=isd,ied ;
do j=jsd,jed
538 u_nonsym(i,j) = u_comp(i,j) ; v_nonsym(i,j) = v_comp(i,j)
541 call pass_vector(u_nonsym, v_nonsym, g%Domain, direction, stagger=agrid)
543 do i=is_ch,ie_ch ;
do j=js_ch+1,je_ch
544 if (u_nonsym(i,j) /= u_comp(i,j) .and. &
546 write(mesg2,
'(" redundant u-components",2(1pe12.4)," differ by ", & 547 & 1pe12.4," at i,j = ",2i4," on pe ",i4)') &
548 u_comp(i,j), u_nonsym(i,j),u_comp(i,j)-u_nonsym(i,j),i,j,pe_here()
549 write(0,
'(A130)') trim(mesg)//trim(mesg2)
553 do i=is_ch+1,ie_ch ;
do j=js_ch,je_ch
554 if (v_nonsym(i,j) /= v_comp(i,j) .and. &
556 write(mesg2,
'(" redundant v-comps",2(1pe12.4)," differ by ", & 557 & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)') &
558 v_comp(i,j), v_nonsym(i,j),v_comp(i,j)-v_nonsym(i,j),i,j, &
559 g%geoLonBu(i,j), g%geoLatBu(i,j), pe_here()
560 write(0,
'(A155)') trim(mesg)//trim(mesg2)
570 subroutine chksum_vec_c3d(mesg, u_comp, v_comp, G, halos, scalars)
571 character(len=*),
intent(in) :: mesg
573 real,
dimension(G%IsdB:,G%jsd:,:),
intent(in) :: u_comp
574 real,
dimension(G%isd:,G%JsdB:,:),
intent(in) :: v_comp
575 integer,
optional,
intent(in) :: halos
576 logical,
optional,
intent(in) :: scalars
579 logical :: are_scalars
580 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
583 call uvchksum(mesg, u_comp, v_comp, g%HI, halos)
586 if (are_scalars)
then 596 subroutine chksum_vec_c2d(mesg, u_comp, v_comp, G, halos, scalars)
597 character(len=*),
intent(in) :: mesg
599 real,
dimension(G%IsdB:,G%jsd:),
intent(in) :: u_comp
600 real,
dimension(G%isd:,G%JsdB:),
intent(in) :: v_comp
601 integer,
optional,
intent(in) :: halos
602 logical,
optional,
intent(in) :: scalars
605 logical :: are_scalars
606 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
609 call uvchksum(mesg, u_comp, v_comp, g%HI, halos)
612 if (are_scalars)
then 622 subroutine chksum_vec_b3d(mesg, u_comp, v_comp, G, halos, scalars)
623 character(len=*),
intent(in) :: mesg
625 real,
dimension(G%IsdB:,G%JsdB:,:),
intent(in) :: u_comp
626 real,
dimension(G%IsdB:,G%JsdB:,:),
intent(in) :: v_comp
627 integer,
optional,
intent(in) :: halos
628 logical,
optional,
intent(in) :: scalars
631 logical :: are_scalars
632 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
635 call bchksum(u_comp, mesg//
"(u)", g%HI, halos)
636 call bchksum(v_comp, mesg//
"(v)", g%HI, halos)
639 if (are_scalars)
then 649 subroutine chksum_vec_b2d(mesg, u_comp, v_comp, G, halos, scalars, symmetric)
650 character(len=*),
intent(in) :: mesg
652 real,
dimension(G%IsdB:,G%JsdB:),
intent(in) :: u_comp
653 real,
dimension(G%IsdB:,G%JsdB:),
intent(in) :: v_comp
654 integer,
optional,
intent(in) :: halos
655 logical,
optional,
intent(in) :: scalars
657 logical,
optional,
intent(in) :: symmetric
660 logical :: are_scalars
661 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
664 call bchksum(u_comp, mesg//
"(u)", g%HI, halos, symmetric=symmetric)
665 call bchksum(v_comp, mesg//
"(v)", g%HI, halos, symmetric=symmetric)
668 if (are_scalars)
then 678 subroutine chksum_vec_a3d(mesg, u_comp, v_comp, G, halos, scalars)
679 character(len=*),
intent(in) :: mesg
681 real,
dimension(G%isd:,G%jsd:,:),
intent(in) :: u_comp
682 real,
dimension(G%isd:,G%jsd:,:),
intent(in) :: v_comp
683 integer,
optional,
intent(in) :: halos
684 logical,
optional,
intent(in) :: scalars
687 logical :: are_scalars
688 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
691 call hchksum(u_comp, mesg//
"(u)", g%HI, halos)
692 call hchksum(v_comp, mesg//
"(v)", g%HI, halos)
695 if (are_scalars)
then 706 subroutine chksum_vec_a2d(mesg, u_comp, v_comp, G, halos, scalars)
707 character(len=*),
intent(in) :: mesg
709 real,
dimension(G%isd:,G%jsd:),
intent(in) :: u_comp
710 real,
dimension(G%isd:,G%jsd:),
intent(in) :: v_comp
711 integer,
optional,
intent(in) :: halos
712 logical,
optional,
intent(in) :: scalars
715 logical :: are_scalars
716 are_scalars = .false. ;
if (
present(scalars)) are_scalars = scalars
719 call hchksum(u_comp, mesg//
"(u)", g%HI, halos)
720 call hchksum(v_comp, mesg//
"(v)", g%HI, halos)
723 if (are_scalars)
then 739 real,
dimension(HI%isd:,HI%jsd:,:),
intent(in) :: hThick
740 real,
dimension(HI%isd:,HI%jsd:),
intent(in) :: areaT
741 real,
dimension(HI%isd:,HI%jsd:,:),
intent(in) :: stuff
743 integer :: i, j, k, nz
747 do k = 1, nz ;
do j = hi%jsc, hi%jec ;
do i = hi%isc, hi%iec
748 totalstuff = totalstuff + hthick(i,j,k) * stuff(i,j,k) * areat(i,j)
749 enddo ;
enddo ;
enddo 750 call sum_across_pes(totalstuff)
760 subroutine totaltands(HI, hThick, areaT, temperature, salinity, mesg)
762 real,
dimension(HI%isd:,HI%jsd:,:),
intent(in) :: hThick
763 real,
dimension(HI%isd:,HI%jsd:),
intent(in) :: areaT
764 real,
dimension(HI%isd:,HI%jsd:,:),
intent(in) :: temperature
765 real,
dimension(HI%isd:,HI%jsd:,:),
intent(in) :: salinity
766 character(len=*),
intent(in) :: mesg
770 real,
save :: totalH = 0., totalt = 0., totals = 0.
772 logical,
save :: firstCall = .true.
773 real :: thisH, thisT, thisS, delH, delT, delS
774 integer :: i, j, k, nz
778 do k = 1, nz ;
do j = hi%jsc, hi%jec ;
do i = hi%isc, hi%iec
779 thish = thish + hthick(i,j,k) * areat(i,j)
780 enddo ;
enddo ;
enddo 781 call sum_across_pes(thish)
782 thist =
totalstuff(hi, hthick, areat, temperature)
783 thiss =
totalstuff(hi, hthick, areat, salinity)
787 totalh = thish ; totalt = thist ; totals = thiss
788 write(0,*)
'Totals H,T,S:',thish,thist,thiss,
' ',mesg
791 delh = thish - totalh
792 delt = thist - totalt
793 dels = thiss - totals
794 totalh = thish ; totalt = thist ; totals = thiss
795 write(0,*)
'Tot/del H,T,S:',thish,thist,thiss,delh,delt,dels,
' ',mesg
803 integer,
intent(in) :: nk
804 real,
dimension(nk),
intent(in) :: field
805 real,
optional,
intent(in) :: known_answer
808 real :: u_sum, error, expected
816 u_sum = u_sum + field(k)
817 error = error + epsilon(u_sum)*max(abs(u_sum),abs(field(k)))
821 if (
present(known_answer))
then 822 expected = known_answer
828 if (abs(u_sum-expected) > error)
then 838 integer,
intent(in) :: nk_1
839 integer,
intent(in) :: nk_2
840 real,
dimension(nk_1),
intent(in) :: field_1
841 real,
dimension(nk_2),
intent(in) :: field_2
842 real,
optional,
intent(in) :: missing_value
847 real :: u1_sum, error1, u2_sum, error2, misval
851 if (
present(missing_value))
then 852 misval = missing_value
862 if (field_1(k)/=misval)
then 863 u1_sum = u1_sum + field_1(k)
864 error1 = error1 + epsilon(u1_sum)*max(abs(u1_sum),abs(field_1(k)))
873 if (field_2(k)/=misval)
then 874 u2_sum = u2_sum + field_2(k)
875 error2 = error2 + epsilon(u2_sum)*max(abs(u2_sum),abs(field_2(k)))
880 if (abs(u1_sum-u2_sum) > (error1+error2))
then subroutine chksum_vec_b3d(mesg, u_comp, v_comp, G, halos, scalars)
subroutine check_redundant_sb3d(mesg, array, G, is, ie, js, je)
subroutine chksum_vec_b2d(mesg, u_comp, v_comp, G, halos, scalars, symmetric)
real function, public totalstuff(HI, hThick, areaT, stuff)
This function returns the sum over computational domain of all processors of hThick*stuff, where stuff is a 3-d array at tracer points.
logical function, public check_column_integrals(nk_1, field_1, nk_2, field_2, missing_value)
Returns false if the column integrals of two given quantities are within roundoff of each other...
subroutine, public totaltands(HI, hThick, areaT, temperature, salinity, mesg)
This subroutine display the total thickness, temperature and salinity as well as the change since the...
subroutine check_redundant_vb3d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)
integer, parameter, public to_all
subroutine check_redundant_st2d(mesg, array, G, is, ie, js, je)
subroutine check_redundant_vc2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)
Ocean grid type. See mom_grid for details.
Provides the ocean grid type.
integer max_redundant_prints
subroutine chksum_vec_c2d(mesg, u_comp, v_comp, G, halos, scalars)
Defines the horizontal index type (hor_index_type) used for providing index ranges.
Container for horizontal index ranges for data, computational and global domains. ...
logical function, public check_column_integral(nk, field, known_answer)
Returns false if the column integral of a given quantity is within roundoff.
subroutine chksum_vec_a3d(mesg, u_comp, v_comp, G, halos, scalars)
subroutine check_redundant_vt3d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)
subroutine check_redundant_vb2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)
subroutine check_redundant_st3d(mesg, array, G, is, ie, js, je)
logical function, public is_root_pe()
subroutine check_redundant_sb2d(mesg, array, G, is, ie, js, je)
subroutine, public mom_checksums_init(param_file)
MOM_checksums_init initializes the MOM_checksums module. As it happens, the only thing that it does i...
subroutine chksum_vec_a2d(mesg, u_comp, v_comp, G, halos, scalars)
subroutine check_redundant_vc3d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)
subroutine, public mom_debugging_init(param_file)
MOM_debugging_init initializes the MOM_debugging module, and sets the parameterts that control which ...
integer, dimension(3) redundant_prints
subroutine, public mom_error(level, message, all_print)
subroutine chksum_vec_c3d(mesg, u_comp, v_comp, G, halos, scalars)
subroutine check_redundant_vt2d(mesg, u_comp, v_comp, G, is, ie, js, je, direction)