/[MITgcm]/MITgcm/pkg/ctrl/ctrl_getobcsw.F
ViewVC logotype

Diff of /MITgcm/pkg/ctrl/ctrl_getobcsw.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by heimbach, Fri Jul 18 21:10:16 2003 UTC revision 1.6 by mlosch, Fri Dec 3 00:48:57 2004 UTC
# Line 125  c--   Get the counters, flags, and the i Line 125  c--   Get the counters, flags, and the i
125       &                         doglobalread, ladinit, optimcycle,       &                         doglobalread, ladinit, optimcycle,
126       &                         mythid, xx_obcsw_dummy )       &                         mythid, xx_obcsw_dummy )
127    
128    #ifdef ALLOW_CTRL_OBCS_BALANCE
129    
130            if ( optimcycle .gt. 0) then                      if ( optimcycle .gt. 0) then          
131              if (iobcs .eq. 3) then              if (iobcs .eq. 3) then
132  cgg         Special attention is needed for the normal velocity.  cgg         Special attention is needed for the normal velocity.
# Line 148  cgg    surface level. This velocity is n Line 150  cgg    surface level. This velocity is n
150  cgg    exactly balance the volume flux, since we are dealing with  cgg    exactly balance the volume flux, since we are dealing with
151  cgg    the baroclinic velocity structure..  cgg    the baroclinic velocity structure..
152                        utop = tmpfldyz(j,k,bi,bj)*                        utop = tmpfldyz(j,k,bi,bj)*
153       &                maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop       &                maskW(i+ip1,j,k,bi,bj) * delR(k) + utop
154  cgg    Add the barotropic velocity component.  cgg    Add the barotropic velocity component.
155                        if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then                        if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then
156                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro
# Line 156  cgg    Add the barotropic velocity compo Line 158  cgg    Add the barotropic velocity compo
158                      enddo                      enddo
159  cgg    Compute the baroclinic velocity at level 1. Should balance flux.  cgg    Compute the baroclinic velocity at level 1. Should balance flux.
160                    tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)                    tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)
161       &                                      - utop / delZ(1)       &                                      - utop / delR(1)
162                    enddo                    enddo
163                  enddo                  enddo
164                enddo                enddo
# Line 183  cgg    surface level. This velocity is n Line 185  cgg    surface level. This velocity is n
185  cgg    exactly balance the volume flux, since we are dealing with  cgg    exactly balance the volume flux, since we are dealing with
186  cgg    the baroclinic velocity structure..  cgg    the baroclinic velocity structure..
187                        utop = tmpfldyz(j,k,bi,bj)*                        utop = tmpfldyz(j,k,bi,bj)*
188       &                maskS(i,j,k,bi,bj) * delZ(k) + utop       &                maskS(i,j,k,bi,bj) * delR(k) + utop
189  cgg    Add the barotropic velocity component.  cgg    Add the barotropic velocity component.
190                        if (maskS(i,j,k,bi,bj) .ne. 0.) then                        if (maskS(i,j,k,bi,bj) .ne. 0.) then
191                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro
# Line 191  cgg    Add the barotropic velocity compo Line 193  cgg    Add the barotropic velocity compo
193                      enddo                      enddo
194  cgg    Compute the baroclinic velocity at level 1. Should balance flux.  cgg    Compute the baroclinic velocity at level 1. Should balance flux.
195                    tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)                    tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)
196       &                                      - utop / delZ(1)       &                                      - utop / delR(1)
197                    enddo                    enddo
198                  enddo                  enddo
199                enddo                enddo
200              endif              endif
201            endif            endif
202    
203    #endif /* ALLOW_CTRL_OBCS_BALANCE */
204    
205            do bj = jtlo,jthi            do bj = jtlo,jthi
206              do bi = itlo,ithi              do bi = itlo,ithi
207                do k = 1,nr                do k = 1,nr
# Line 212  cgg     & Line 216  cgg     &
216    
217          if ( (obcswfirst) .or. (obcswchanged)) then          if ( (obcswfirst) .or. (obcswchanged)) then
218                        
219  cgg(    This is a terribly long way to do it. However, the dimensions don't exactly  cgg(    This is a terribly long way to do it. However, the dimensions do not exactly
220  cgg     match up. I will blame Fortran for the ugliness.  cgg     match up. I will blame Fortran for the ugliness.
221    
222            do bj = jtlo,jthi            do bj = jtlo,jthi
# Line 242  cgg     match up. I will blame Fortran f Line 246  cgg     match up. I will blame Fortran f
246       &                         doglobalread, ladinit, optimcycle,       &                         doglobalread, ladinit, optimcycle,
247       &                         mythid, xx_obcsw_dummy )       &                         mythid, xx_obcsw_dummy )
248    
249    #ifdef ALLOW_CTRL_OBCS_BALANCE
250    
251            if ( optimcycle .gt. 0) then                      if ( optimcycle .gt. 0) then          
252              if (iobcs .eq. 3) then              if (iobcs .eq. 3) then
253  cgg         Special attention is needed for the normal velocity.  cgg         Special attention is needed for the normal velocity.
# Line 265  cgg    surface level. This velocity is n Line 271  cgg    surface level. This velocity is n
271  cgg    exactly balance the volume flux, since we are dealing with  cgg    exactly balance the volume flux, since we are dealing with
272  cgg    the baroclinic velocity structure..  cgg    the baroclinic velocity structure..
273                        utop = tmpfldyz(j,k,bi,bj)*                        utop = tmpfldyz(j,k,bi,bj)*
274       &                maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop       &                maskW(i+ip1,j,k,bi,bj) * delR(k) + utop
275  cgg    Add the barotropic velocity component.  cgg    Add the barotropic velocity component.
276                        if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then                        if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then
277                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro
# Line 273  cgg    Add the barotropic velocity compo Line 279  cgg    Add the barotropic velocity compo
279                      enddo                      enddo
280  cgg    Compute the baroclinic velocity at level 1. Should balance flux.  cgg    Compute the baroclinic velocity at level 1. Should balance flux.
281                      tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)                      tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)
282       &                                      - utop / delZ(1)       &                                      - utop / delR(1)
283                    enddo                    enddo
284                  enddo                  enddo
285                enddo                enddo
# Line 300  cgg    surface level. This velocity is n Line 306  cgg    surface level. This velocity is n
306  cgg    exactly balance the volume flux, since we are dealing with  cgg    exactly balance the volume flux, since we are dealing with
307  cgg    the baroclinic velocity structure..  cgg    the baroclinic velocity structure..
308                        utop = tmpfldyz(j,k,bi,bj)*                        utop = tmpfldyz(j,k,bi,bj)*
309       &                maskS(i,j,k,bi,bj) * delZ(k) + utop       &                maskS(i,j,k,bi,bj) * delR(k) + utop
310  cgg    Add the barotropic velocity component.  cgg    Add the barotropic velocity component.
311                        if (maskS(i,j,k,bi,bj) .ne. 0.) then                        if (maskS(i,j,k,bi,bj) .ne. 0.) then
312                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro                          tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro
# Line 308  cgg    Add the barotropic velocity compo Line 314  cgg    Add the barotropic velocity compo
314                      enddo                      enddo
315  cgg    Compute the baroclinic velocity at level 1. Should balance flux.  cgg    Compute the baroclinic velocity at level 1. Should balance flux.
316                      tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)                      tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj)
317       &                                      - utop / delZ(1)       &                                      - utop / delR(1)
318                    enddo                    enddo
319                  enddo                  enddo
320                enddo                enddo
321              endif              endif
322            endif            endif
323    
324    #endif /* ALLOW_CTRL_OBCS_BALANCE */
325    
326            do bj = jtlo,jthi            do bj = jtlo,jthi
327              do bi = itlo,ithi              do bi = itlo,ithi
328                do k = 1,nr                do k = 1,nr

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22