| 87 |
#ifdef ALLOW_NONHYDROSTATIC |
#ifdef ALLOW_NONHYDROSTATIC |
| 88 |
|
|
| 89 |
C-- Initialise inverter |
C-- Initialise inverter |
|
etaNcg3Buf(1,myThid) = 0. D0 |
|
|
errcg3Buf(1,myThid) = 0. D0 |
|
|
sumRHScg3Buf(1,myThid) = 0. D0 |
|
| 90 |
etaNM1 = 1. D0 |
etaNM1 = 1. D0 |
| 91 |
|
|
| 92 |
C-- Normalise RHS |
C-- Normalise RHS |
| 103 |
ENDDO |
ENDDO |
| 104 |
ENDDO |
ENDDO |
| 105 |
ENDDO |
ENDDO |
| 106 |
rhsMaxcg3Buf(1,myThid) = rhsMax |
_GLOBAL_MAX_R8( rhsMax, myThid ) |
|
_GLOBAL_MAX_R8( rhsMaxcg3Buf, rhsMax, myThid ) |
|
|
rhsMax = rhsMaxcg3Buf(1,1) |
|
| 107 |
rhsNorm = 1. _d 0 |
rhsNorm = 1. _d 0 |
| 108 |
IF ( rhsMax .NE. 0. ) rhsNorm = 1. _d 0 / rhsMax |
IF ( rhsMax .NE. 0. ) rhsNorm = 1. _d 0 / rhsMax |
| 109 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
| 162 |
ENDDO |
ENDDO |
| 163 |
ENDDO |
ENDDO |
| 164 |
ENDDO |
ENDDO |
|
errcg3Buf(1,myThid) = err |
|
| 165 |
WRITE(6,*) 'DEBUG mythid, err = ', mythid, SQRT(err) |
WRITE(6,*) 'DEBUG mythid, err = ', mythid, SQRT(err) |
| 166 |
_GLOBAL_SUM_R8( errcg3Buf , err , myThid ) |
_GLOBAL_SUM_R8( err , myThid ) |
| 167 |
err = errcg3Buf(1,1) |
_GLOBAL_SUM_R8( sumRHS , myThid ) |
|
errcg3Buf(1,myThid) = sumRHS |
|
|
_GLOBAL_SUM_R8( errcg3Buf , err , myThid ) |
|
|
sumRHS = errcg3Buf(1,1) |
|
| 168 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
| 169 |
write(0,*) 'DEBUG cg3d: Sum(rhs) = ',sumRHS |
write(0,*) 'DEBUG cg3d: Sum(rhs) = ',sumRHS |
| 170 |
_END_MASTER( ) |
_END_MASTER( ) |
| 243 |
I OLw, OLe, OLs, OLn, myNz, |
I OLw, OLe, OLs, OLn, myNz, |
| 244 |
I exchWidthX, exchWidthY, |
I exchWidthX, exchWidthY, |
| 245 |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
I FORWARD_SIMULATION, EXCH_IGNORE_CORNERS, myThid ) |
| 246 |
sumRHScg3Buf(1,myThid) = sumRHS |
_GLOBAL_SUM_R8( sumRHS, myThid ) |
| 247 |
_GLOBAL_SUM_R8( sumRHScg3Buf , sumRHS, myThid ) |
_GLOBAL_SUM_R8( err , myThid ) |
|
sumRHS = sumRHScg3Buf(1,1) |
|
|
errcg3Buf(1,myThid) = err |
|
|
_GLOBAL_SUM_R8( errcg3Buf , err , myThid ) |
|
|
err = errcg3Buf(1,1) |
|
| 248 |
|
|
| 249 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
| 250 |
write(0,'(A,1PE30.14)') ' cg3d: Sum(rhs) = ',sumRHS |
write(0,'(A,1PE30.14)') ' cg3d: Sum(rhs) = ',sumRHS |
| 345 |
caja ENDDO |
caja ENDDO |
| 346 |
caja |
caja |
| 347 |
|
|
| 348 |
etaNcg3Buf(1,myThid) = etaN |
_GLOBAL_SUM_R8(etaN, myThid) |
|
_GLOBAL_SUM_R8(etaNcg3Buf,etaN, myThid) |
|
|
etaN = etaNcg3Buf(1,1) |
|
| 349 |
CcnhDebugStarts |
CcnhDebugStarts |
| 350 |
C WRITE(0,*) ' CG3D: Iteration ',it3d-1,' etaN = ',etaN |
C WRITE(0,*) ' CG3D: Iteration ',it3d-1,' etaN = ',etaN |
| 351 |
CcnhDebugEnds |
CcnhDebugEnds |
| 456 |
ENDIF |
ENDIF |
| 457 |
ENDDO |
ENDDO |
| 458 |
ENDDO |
ENDDO |
| 459 |
alphacg3Buf(1,myThid) = alpha |
_GLOBAL_SUM_R8(alpha,myThid) |
|
_GLOBAL_SUM_R8(alphacg3Buf,alpha,myThid) |
|
|
alpha = alphacg3Buf(1,1) |
|
| 460 |
CcnhDebugStarts |
CcnhDebugStarts |
| 461 |
C WRITE(0,*) ' CG3D: Iteration ',it3d-1,' SUM(s*q)= ',alpha |
C WRITE(0,*) ' CG3D: Iteration ',it3d-1,' SUM(s*q)= ',alpha |
| 462 |
CcnhDebugEnds |
CcnhDebugEnds |
| 484 |
ENDDO |
ENDDO |
| 485 |
ENDDO |
ENDDO |
| 486 |
|
|
| 487 |
errcg3Buf(1,myThid) = err |
_GLOBAL_SUM_R8( err , myThid ) |
|
_GLOBAL_SUM_R8( errcg3Buf , err , myThid ) |
|
|
err = errcg3Buf(1,1) |
|
| 488 |
err = SQRT(err) |
err = SQRT(err) |
| 489 |
actualIts = it3d |
actualIts = it3d |
| 490 |
actualResidual = err |
actualResidual = err |
| 546 |
C ENDDO |
C ENDDO |
| 547 |
C ENDDO |
C ENDDO |
| 548 |
C ENDDO |
C ENDDO |
| 549 |
C errcg3Buf(1,myThid) = err |
C _GLOBAL_SUM_R8( err , myThid ) |
|
C _GLOBAL_SUM_R8( errcg3Buf , err , myThid ) |
|
|
C err = errcg3Buf(1,1) |
|
| 550 |
C write(0,*) 'cg2d: Ax - b = ',SQRT(err) |
C write(0,*) 'cg2d: Ax - b = ',SQRT(err) |
| 551 |
CcnhDebugEnds |
CcnhDebugEnds |
| 552 |
|
|