35 |
#ifdef ALLOW_CD_CODE |
#ifdef ALLOW_CD_CODE |
36 |
#include "CD_CODE_VARS.h" |
#include "CD_CODE_VARS.h" |
37 |
#endif |
#endif |
|
#ifdef ALLOW_OBCS |
|
|
#include "OBCS.h" |
|
|
#endif |
|
38 |
|
|
39 |
C === Functions ==== |
C === Functions ==== |
40 |
LOGICAL DIFFERENT_MULTIPLE |
LOGICAL DIFFERENT_MULTIPLE |
226 |
ENDIF |
ENDIF |
227 |
|
|
228 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
229 |
|
C- Note: solver matrix is trivial outside OB region (main diagonal only) |
230 |
|
C => no real need to reset RHS (=cg2d_b) & cg2d_x, except that: |
231 |
|
C a) normalisation is fct of Max(RHS), which can be large ouside OB region |
232 |
|
C (would be different if we were solving for increment of eta/g |
233 |
|
C instead of directly for eta/g). |
234 |
|
C => need to reset RHS to ensure that interior solution does not depend |
235 |
|
C on ouside OB region. |
236 |
|
C b) provide directly the trivial solution cg2d_x == 0 for outside OB region |
237 |
|
C (=> no residual => no effect on solver convergence and interior solution) |
238 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
239 |
DO i=1,sNx |
DO j=1,sNy |
240 |
C Northern boundary |
DO i=1,sNx |
241 |
IF (OB_Jn(i,bi,bj).NE.0) THEN |
cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj)*maskInC(i,j,bi,bj) |
242 |
cg2d_b(i,OB_Jn(i,bi,bj),bi,bj)=0. |
cg2d_x(i,j,bi,bj) = cg2d_x(i,j,bi,bj)*maskInC(i,j,bi,bj) |
243 |
cg2d_x(i,OB_Jn(i,bi,bj),bi,bj)=0. |
ENDDO |
|
ENDIF |
|
|
C Southern boundary |
|
|
IF (OB_Js(i,bi,bj).NE.0) THEN |
|
|
cg2d_b(i,OB_Js(i,bi,bj),bi,bj)=0. |
|
|
cg2d_x(i,OB_Js(i,bi,bj),bi,bj)=0. |
|
|
ENDIF |
|
|
ENDDO |
|
|
#ifndef ALLOW_NEST_CHILD |
|
|
DO j=1,sNy |
|
|
C Eastern boundary |
|
|
IF (OB_Ie(j,bi,bj).NE.0) THEN |
|
|
cg2d_b(OB_Ie(j,bi,bj),j,bi,bj)=0. |
|
|
cg2d_x(OB_Ie(j,bi,bj),j,bi,bj)=0. |
|
|
ENDIF |
|
|
C Western boundary |
|
|
IF (OB_Iw(j,bi,bj).NE.0) THEN |
|
|
cg2d_b(OB_Iw(j,bi,bj),j,bi,bj)=0. |
|
|
cg2d_x(OB_Iw(j,bi,bj),j,bi,bj)=0. |
|
|
ENDIF |
|
244 |
ENDDO |
ENDDO |
|
#endif /* ALLOW_NEST_CHILD */ |
|
245 |
ENDIF |
ENDIF |
246 |
#endif /* ALLOW_OBCS */ |
#endif /* ALLOW_OBCS */ |
247 |
C- end bi,bj loops |
C- end bi,bj loops |