MOM6
mom_debugging::check_redundant_c Interface Reference

Detailed Description

Definition at line 55 of file MOM_debugging.F90.

Private functions

subroutine check_redundant_vc3d (mesg, u_comp, v_comp, G, is, ie, js, je, direction)
 
subroutine check_redundant_vc2d (mesg, u_comp, v_comp, G, is, ie, js, je, direction)
 

Functions and subroutines

◆ check_redundant_vc2d()

subroutine mom_debugging::check_redundant_c::check_redundant_vc2d ( character(len=*), intent(in)  mesg,
real, dimension(g%isdb:,g%jsd:), intent(in)  u_comp,
real, dimension(g%isd:,g%jsdb:), intent(in)  v_comp,
type(ocean_grid_type), intent(inout)  G,
integer, intent(in), optional  is,
integer, intent(in), optional  ie,
integer, intent(in), optional  js,
integer, intent(in), optional  je,
integer, intent(in), optional  direction 
)
private
Parameters
[in,out]gThe ocean's grid structure

Definition at line 143 of file MOM_debugging.F90.

143  character(len=*), intent(in) :: mesg
144  type(ocean_grid_type), intent(inout) :: g !< The ocean's grid structure
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
149 ! Arguments: u_comp - The u-component of the vector being checked.
150 ! (in) v_comp - The v-component of the vector being checked.
151 ! (in) mesg - A message indicating what is being checked.
152 ! (in) G - The ocean's grid structure.
153 ! (in/opt) is, ie, js, je - the i- and j- range of indices to check.
154 ! (in/opt) direction - the direction flag to be passed to pass_vector.
155 
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
161 
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
167 
168  if (.not.(present(is) .or. present(ie) .or. present(js) .or. present(je))) then
169  ! This only works with symmetric memory, so otherwise return.
170  if ((isd == isdb) .and. (jsd == jsdb)) return
171  endif
172 
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)
175  enddo ; enddo
176 
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)
180 
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)
185  enddo ; enddo
186  call pass_vector(u_resym, v_resym, g%Domain, direction)
187 
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
191 
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
200  endif
201  enddo ; enddo
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
211  endif
212  enddo ; enddo
213 

◆ check_redundant_vc3d()

subroutine mom_debugging::check_redundant_c::check_redundant_vc3d ( character(len=*), intent(in)  mesg,
real, dimension(g%isdb:,g%jsd:,:), intent(in)  u_comp,
real, dimension(g%isd:,g%jsdb:,:), intent(in)  v_comp,
type(ocean_grid_type), intent(inout)  G,
integer, intent(in), optional  is,
integer, intent(in), optional  ie,
integer, intent(in), optional  js,
integer, intent(in), optional  je,
integer, intent(in), optional  direction 
)
private
Parameters
[in,out]gThe ocean's grid structure

Definition at line 114 of file MOM_debugging.F90.

114  character(len=*), intent(in) :: mesg
115  type(ocean_grid_type), intent(inout) :: g !< The ocean's grid structure
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
120 ! Arguments: u_comp - The u-component of the vector being checked.
121 ! (in) v_comp - The v-component of the vector being checked.
122 ! (in) mesg - A message indicating what is being checked.
123 ! (in) G - The ocean's grid structure.
124 ! (in/opt) is, ie, js, je - the i- and j- range of indices to check.
125 ! (in/opt) direction - the direction flag to be passed to pass_vector.
126 
127  character(len=24) :: mesg_k
128  integer :: k
129 
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
135 
136  call check_redundant_vc2d(trim(mesg)//trim(mesg_k), u_comp(:,:,k), &
137  v_comp(:,:,k), g, is, ie, js, je, direction)
138  enddo

The documentation for this interface was generated from the following file: