/[MITgcm]/MITgcm/pkg/obcs/obcs_readparms.F
ViewVC logotype

Diff of /MITgcm/pkg/obcs/obcs_readparms.F

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

revision 1.19 by dimitri, Wed Apr 23 16:34:05 2008 UTC revision 1.20 by mlosch, Thu Apr 24 07:42:37 2008 UTC
# Line 35  C     iUnit       - Work variable for IO Line 35  C     iUnit       - Work variable for IO
35        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
36        INTEGER iUnit        INTEGER iUnit
37        INTEGER I,J,iTracer        INTEGER I,J,iTracer
38          INTEGER bi, bj, iG, jG, iGm, jGm
39    
40        NAMELIST /OBCS_PARM01/        NAMELIST /OBCS_PARM01/
41       &          OB_Jnorth,OB_Jsouth,OB_Ieast,OB_Iwest,       &          OB_Jnorth,OB_Jsouth,OB_Ieast,OB_Iwest,
# Line 213  C--   Close the open data file Line 214  C--   Close the open data file
214  C--   Everyone else must wait for the parameters to be loaded  C--   Everyone else must wait for the parameters to be loaded
215        _BARRIER        _BARRIER
216    
217    C--   Calculate the tiled index arrays OB_Jn/Js/Ie/Iw here from the
218    C     global arrays OB_Jnorth/Jsouth/Ieast/Iwest.
219    C     Note: This part of the code has been moved from obcs_init_fixed to
220    C     routine routine because the OB_Jn/Js/Ie/Iw index arrays are
221    C     required by ini_depth which is called befoer obcs_init_fixed
222          DO bj = myByLo(myThid), myByHi(myThid)
223           DO bi = myBxLo(myThid), myBxHi(myThid)
224    
225            DO I=1-Olx,sNx+Olx
226             OB_Jn(I,bi,bj)=0
227             OB_Js(I,bi,bj)=0
228            ENDDO
229    
230            DO J=1-Oly,sNy+Oly
231             OB_Ie(J,bi,bj)=0
232             OB_Iw(J,bi,bj)=0
233            ENDDO
234    
235            DO J=1-Oly,sNy+Oly
236    C convert from local y index J to global y index jG
237             jG = myYGlobalLo-1+(bj-1)*sNy+J
238    C use periodicity to deal with out of range points caused by the overlaps.
239    C they will be excluded by the mask in any case, but this saves array
240    C out-of-bounds errors here.
241             jGm = 1+mod( jG-1+Ny , Ny )
242    C loop over local x index I
243             DO I=1,sNx
244              iG = myXGlobalLo-1+(bi-1)*sNx+I
245              iGm = 1+mod( iG-1+Nx , Nx )
246    C OB_Ieast(jGm) allows for the eastern boundary to be at variable x locations
247              IF (iG.EQ.OB_Ieast(jGm))  OB_Ie(J,bi,bj)=I
248              IF (iG.EQ.OB_Iwest(jGm))  OB_Iw(J,bi,bj)=I
249             ENDDO
250            ENDDO
251            DO J=1,sNy
252             jG = myYGlobalLo-1+(bj-1)*sNy+J
253             jGm = 1+mod( jG-1+Ny , Ny )
254             DO I=1-Olx,sNx+Olx
255              iG = myXGlobalLo-1+(bi-1)*sNx+I
256              iGm = 1+mod( iG-1+Nx , Nx )
257    C OB_Jnorth(iGm) allows for the northern boundary to be at variable y locations
258              IF (jG.EQ.OB_Jnorth(iGm)) OB_Jn(I,bi,bj)=J
259              IF (jG.EQ.OB_Jsouth(iGm)) OB_Js(I,bi,bj)=J
260             ENDDO
261            ENDDO
262    C     bi,bj-loops
263           ENDDO
264          ENDDO
265    
266  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
267        RETURN        RETURN
268        END        END

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22