/[MITgcm]/MITgcm/model/src/ini_cg2d.F
ViewVC logotype

Diff of /MITgcm/model/src/ini_cg2d.F

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

revision 1.42 by edhill, Thu Oct 9 04:19:18 2003 UTC revision 1.43 by jmc, Wed Jul 20 22:33:02 2005 UTC
# Line 26  C     === Global variables === Line 26  C     === Global variables ===
26  #include "EEPARAMS.h"  #include "EEPARAMS.h"
27  #include "PARAMS.h"  #include "PARAMS.h"
28  #include "GRID.h"  #include "GRID.h"
 c#include "DYNVARS.h"  
29  #include "SURFACE.h"  #include "SURFACE.h"
30  #include "CG2D.h"  #include "CG2D.h"
31  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
# Line 53  C     sumArea - Work variable used to co Line 52  C     sumArea - Work variable used to co
52        INTEGER I,  J, K        INTEGER I,  J, K
53        _RL     faceArea        _RL     faceArea
54        _RS     myNorm        _RS     myNorm
       _RL     sumArea  
55        _RL     aC, aCw, aCs        _RL     aC, aCw, aCs
56  CEOP  CEOP
57    
# Line 139  C     aS2d: integral in Z Ay/dY Line 137  C     aS2d: integral in Z Ay/dY
137         myNorm = 1. _d 0         myNorm = 1. _d 0
138        ENDIF        ENDIF
139         cg2dNorm = myNorm         cg2dNorm = myNorm
       _BEGIN_MASTER( myThid )  
 CcnhDebugStarts  
        WRITE(msgBuf,'(A,E40.25)') '// CG2D normalisation factor = ',  
      &               cg2dNorm  
        CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)  
        WRITE(msgBuf,*) '                               '  
        CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)  
 CcnhDebugEnds  
       _END_MASTER( myThid )  
140        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
141         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
142          DO J=1,sNy          DO J=1,sNy
# Line 173  C     CALL PLOT_FIELD_XYRS( aS2d, 'AS2D Line 162  C     CALL PLOT_FIELD_XYRS( aS2d, 'AS2D
162  CcnhDebugEnds  CcnhDebugEnds
163    
164  C-- Define the solver tolerance in the appropriate Unit :  C-- Define the solver tolerance in the appropriate Unit :
165        cg2dNormaliseRHS = cg2dTargetResWunit.LE.0        cg2dNormaliseRHS = cg2dTargetResWunit.LE.0.
166        IF (cg2dNormaliseRHS) THEN        IF (cg2dNormaliseRHS) THEN
167  C-  when using a normalisation of RHS, tolerance has no unit => no conversion  C-  when using a normalisation of RHS, tolerance has no unit => no conversion
168          cg2dTolerance = cg2dTargetResidual          cg2dTolerance = cg2dTargetResidual
169        ELSE        ELSE
 C-  compute the total Area of the domain :  
         sumArea = 0.  
         DO bj=myByLo(myThid),myByHi(myThid)  
          DO bi=myBxLo(myThid),myBxHi(myThid)  
           DO j=1,sNy  
            DO i=1,sNx  
              IF (Ro_surf(i,j,bi,bj).GT.R_low(i,j,bi,bj)) THEN  
                sumArea = sumArea + rA(i,j,bi,bj)  
              ENDIF  
            ENDDO  
           ENDDO  
          ENDDO  
         ENDDO  
 c       WRITE(*,*) ' mythid, sumArea = ', mythid, sumArea  
         _GLOBAL_SUM_R8( sumArea, myThid )  
170  C-  convert Target-Residual (in W unit) to cg2d-solver residual unit [m^2/s^2]  C-  convert Target-Residual (in W unit) to cg2d-solver residual unit [m^2/s^2]
171          cg2dTolerance = cg2dNorm * cg2dTargetResWunit          cg2dTolerance = cg2dNorm * cg2dTargetResWunit
172       &                           * sumArea / deltaTmom       &                           * globalArea / deltaTmom
         _BEGIN_MASTER( myThid )  
         WRITE(standardMessageUnit,'(2A,1P2E22.14)') ' ini_cg2d: ',  
      &          'sumArea,cg2dTolerance =', sumArea,cg2dTolerance  
         _END_MASTER( myThid )  
173        ENDIF        ENDIF
174    
175    CcnhDebugStarts
176          _BEGIN_MASTER( myThid )
177           WRITE(msgBuf,'(2A,1PE23.16)') 'INI_CG2D: ',
178         &      'CG2D normalisation factor = ', cg2dNorm
179           CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
180           IF (.NOT.cg2dNormaliseRHS) THEN
181            WRITE(msgBuf,'(2A,1PE22.15,A,1PE16.10,A)') 'INI_CG2D: ',
182         &      'cg2dTolerance =', cg2dTolerance, ' (Area=',globalArea,')'
183            CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
184           ENDIF
185           WRITE(msgBuf,*) ' '
186           CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
187          _END_MASTER( myThid )
188    CcnhDebugEnds
189            
190  C--   Initialise preconditioner  C--   Initialise preconditioner
191  C     Note. 20th May 1998  C     Note. 20th May 1998

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.22