1 |
heimbach |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/obcs/obcs_init_fixed.F,v 1.2 2001/02/02 21:36:30 adcroft Exp $ |
2 |
|
|
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
|
|
#include "OBCS_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
SUBROUTINE OBCS_INIT_FIXED( myThid ) |
7 |
|
|
C /==========================================================\ |
8 |
|
|
C | SUBROUTINE OBCS_INIT_FIXED | |
9 |
|
|
C | o Initialise OBCs fixed arrays | |
10 |
|
|
C |==========================================================| |
11 |
|
|
C | | |
12 |
|
|
C \==========================================================/ |
13 |
|
|
IMPLICIT NONE |
14 |
|
|
|
15 |
|
|
C === Global variables === |
16 |
|
|
#include "SIZE.h" |
17 |
|
|
#include "EEPARAMS.h" |
18 |
|
|
#include "PARAMS.h" |
19 |
|
|
#include "OBCS.h" |
20 |
|
|
|
21 |
|
|
C == Routine arguments == |
22 |
|
|
C myThid - Number of this instance of INI_DEPTHS |
23 |
|
|
INTEGER myThid |
24 |
|
|
|
25 |
|
|
#ifdef ALLOW_OBCS |
26 |
|
|
|
27 |
|
|
C == Local variables == |
28 |
|
|
INTEGER iG, jG, iGm, jGm |
29 |
|
|
INTEGER bi, bj |
30 |
|
|
INTEGER I, J, K |
31 |
|
|
|
32 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
33 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
34 |
|
|
|
35 |
|
|
DO I=1-Olx,sNx+Olx |
36 |
|
|
OB_Jn(I,bi,bj)=0 |
37 |
|
|
OB_Js(I,bi,bj)=0 |
38 |
|
|
ENDDO |
39 |
|
|
|
40 |
|
|
DO J=1-Oly,sNy+Oly |
41 |
|
|
OB_Ie(J,bi,bj)=0 |
42 |
|
|
OB_Iw(J,bi,bj)=0 |
43 |
|
|
ENDDO |
44 |
|
|
|
45 |
|
|
DO J=1-Oly,sNy+Oly |
46 |
heimbach |
1.3 |
C convert from local y index J to global y index jG |
47 |
adcroft |
1.2 |
jG = myYGlobalLo-1+(bj-1)*sNy+J |
48 |
heimbach |
1.3 |
C use periodicity to deal with out of range points caused by the overlaps. |
49 |
|
|
C they will be excluded by the mask in any case, but this saves array |
50 |
|
|
C out-of-bounds errors here. |
51 |
adcroft |
1.2 |
jGm = 1+mod( jG-1+Ny , Ny ) |
52 |
heimbach |
1.3 |
C loop over local x index I |
53 |
adcroft |
1.2 |
DO I=1,sNx |
54 |
|
|
iG = myXGlobalLo-1+(bi-1)*sNx+I |
55 |
|
|
iGm = 1+mod( iG-1+Nx , Nx ) |
56 |
heimbach |
1.3 |
C OB_Ieast(jGm) allows for the eastern boundary to be at variable x locations |
57 |
adcroft |
1.2 |
IF (iG.EQ.OB_Ieast(jGm)) OB_Ie(J,bi,bj)=I |
58 |
|
|
IF (iG.EQ.OB_Iwest(jGm)) OB_Iw(J,bi,bj)=I |
59 |
|
|
ENDDO |
60 |
|
|
ENDDO |
61 |
|
|
DO J=1,sNy |
62 |
|
|
jG = myYGlobalLo-1+(bj-1)*sNy+J |
63 |
|
|
jGm = 1+mod( jG-1+Ny , Ny ) |
64 |
|
|
DO I=1-Olx,sNx+Olx |
65 |
|
|
iG = myXGlobalLo-1+(bi-1)*sNx+I |
66 |
|
|
iGm = 1+mod( iG-1+Nx , Nx ) |
67 |
heimbach |
1.3 |
C OB_Jnorth(iGm) allows for the northern boundary to be at variable y locations |
68 |
adcroft |
1.2 |
IF (jG.EQ.OB_Jnorth(iGm)) OB_Jn(I,bi,bj)=J |
69 |
|
|
IF (jG.EQ.OB_Jsouth(iGm)) OB_Js(I,bi,bj)=J |
70 |
|
|
ENDDO |
71 |
|
|
ENDDO |
72 |
|
|
|
73 |
|
|
ENDDO |
74 |
|
|
ENDDO |
75 |
|
|
|
76 |
|
|
#endif /* ALLOW_OBCS */ |
77 |
|
|
RETURN |
78 |
|
|
END |