36 |
C bi,bj - Loop counters |
C bi,bj - Loop counters |
37 |
C faceArea - Temporary used to hold cell face areas. |
C faceArea - Temporary used to hold cell face areas. |
38 |
C I,J,K |
C I,J,K |
39 |
C myNorm - Work variable used in clculating normalisation factor |
C myNorm - Work variable used in calculating normalisation factor |
40 |
|
C sumArea - Work variable used to compute the total Domain Area |
41 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
42 |
INTEGER bi, bj |
INTEGER bi, bj |
43 |
INTEGER I, J, K |
INTEGER I, J, K |
44 |
_RL faceArea |
_RL faceArea |
45 |
_RS myNorm |
_RS myNorm |
46 |
|
_RL sumArea |
47 |
_RL aC, aCw, aCs |
_RL aC, aCw, aCs |
48 |
|
|
49 |
C-- Initialise -Boyancy at surface level : Bo_surf |
C-- Initialise -Boyancy at surface level : Bo_surf |
174 |
C CALL PLOT_FIELD_XYRS( aS2d, 'AS2D INI_CG2D.2' , 1, myThid ) |
C CALL PLOT_FIELD_XYRS( aS2d, 'AS2D INI_CG2D.2' , 1, myThid ) |
175 |
CcnhDebugEnds |
CcnhDebugEnds |
176 |
|
|
177 |
|
C-- Define the solver tolerance in the appropriate Unit : |
178 |
|
cg2dNormaliseRHS = cg2dTargetResWunit.LE.0 |
179 |
|
IF (cg2dNormaliseRHS) THEN |
180 |
|
C- when using a normalisation of RHS, tolerance has no unit => no conversion |
181 |
|
cg2dTolerance = cg2dTargetResidual |
182 |
|
ELSE |
183 |
|
C- compute the total Area of the domain : |
184 |
|
sumArea = 0. |
185 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
186 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
187 |
|
DO j=1,sNy |
188 |
|
DO i=1,sNx |
189 |
|
IF (Ro_surf(i,j,bi,bj).GT.R_low(i,j,bi,bj)) THEN |
190 |
|
sumArea = sumArea + rA(i,j,bi,bj) |
191 |
|
ENDIF |
192 |
|
ENDDO |
193 |
|
ENDDO |
194 |
|
ENDDO |
195 |
|
ENDDO |
196 |
|
c WRITE(0,*) ' mythid, sumArea = ', mythid, sumArea |
197 |
|
_GLOBAL_SUM_R8( sumArea, myThid ) |
198 |
|
C- convert Target-Residual (in W unit) to cg2d-solver residual unit [m^2/s^2] |
199 |
|
cg2dTolerance = cg2dNorm * cg2dTargetResWunit |
200 |
|
& * sumArea / deltaTMom |
201 |
|
WRITE(0,'(2A,1P2E22.14)') ' ini_cg2d: ', |
202 |
|
& 'sumArea,cg2dTolerance =', sumArea,cg2dTolerance |
203 |
|
ENDIF |
204 |
|
|
205 |
C-- Initialise preconditioner |
C-- Initialise preconditioner |
206 |
C Note. 20th May 1998 |
C Note. 20th May 1998 |
207 |
C I made a weird discovery! In the model paper we argue |
C I made a weird discovery! In the model paper we argue |