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

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

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

revision 1.7 by jmc, Wed Apr 6 18:29:53 2005 UTC revision 1.8 by jmc, Tue Jul 25 22:22:08 2006 UTC
# Line 48  C     I,J,K Line 48  C     I,J,K
48        _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
49        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
50        _RL oldPhi  (1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL oldPhi  (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
51        _RL count, rmspp, rmsppold        _RL count, rmspp, rmsppold
52    
53        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
54  CEOP  CEOP
# Line 56  CEOP Line 56  CEOP
56        iMax = sNx+OLx        iMax = sNx+OLx
57        jMin = 1-OLy        jMin = 1-OLy
58        jMax = sNy+OLy        jMax = sNy+OLy
59          
60        WRITE(msgBuf,'(a)')        WRITE(msgBuf,'(a)')
61       &     'Start initial hydrostatic pressure computation'       &     'Start initial hydrostatic pressure computation'
62        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
63       &     SQUEEZE_RIGHT , 1)       &     SQUEEZE_RIGHT , myThid)
64        DO bj = myByLo(myThid), myByHi(myThid)        DO bj = myByLo(myThid), myByHi(myThid)
65         DO bi = myBxLo(myThid), myBxHi(myThid)         DO bi = myBxLo(myThid), myBxHi(myThid)
66          DO k = 1,Nr          DO k = 1,Nr
# Line 105  C     for each level save old pressure a Line 105  C     for each level save old pressure a
105             ENDDO             ENDDO
106             CALL CALC_PHI_HYD(             CALL CALC_PHI_HYD(
107       I          bi, bj, iMin, iMax, jMin, jMax, k,       I          bi, bj, iMin, iMax, jMin, jMax, k,
108       I          theta, salt,       I          theta, salt,
109       U          phiHydF,       U          phiHydF,
110       O          phiHydC, dPhiHydX, dPhiHydY,       O          phiHydC, dPhiHydX, dPhiHydY,
111       I          startTime, nIter0, myThid)       I          startTime, nIter0, myThid)
112  C     compute convergence criterion  C     compute convergence criterion
113             DO j=jMin,jMax             DO j=jMin,jMax
114              DO i=iMin,iMax              DO i=iMin,iMax
115               rmspp = rmspp               rmspp = rmspp
116       &            + (totPhiHyd(i,j,k,bi,bj)-oldPhi(i,j))**2       &            + (totPhiHyd(i,j,k,bi,bj)-oldPhi(i,j))**2
117               count = count + maskC(i,j,k,bi,bj)               count = count + maskC(i,j,k,bi,bj)
118              ENDDO              ENDDO
# Line 125  Cml        WRITE(msgBuf,'(I10.10)') npit Line 125  Cml        WRITE(msgBuf,'(I10.10)') npit
125  Cml        CALL WRITE_FLD_XYZ_RL( 'POLD.',msgBuf,pold,npiter,myThid)  Cml        CALL WRITE_FLD_XYZ_RL( 'POLD.',msgBuf,pold,npiter,myThid)
126  Cml        CALL WRITE_FLD_XYZ_RL( 'PINI.',msgBuf,pressure,npiter,myThid)  Cml        CALL WRITE_FLD_XYZ_RL( 'PINI.',msgBuf,pressure,npiter,myThid)
127          _GLOBAL_SUM_R8( rmspp, myThid )          _GLOBAL_SUM_R8( rmspp, myThid )
128          _GLOBAL_SUM_R8( count, myThid )            _GLOBAL_SUM_R8( count, myThid )
129          IF ( count .EQ. 0. ) THEN          IF ( count .EQ. 0. ) THEN
130             rmspp = 0. _d 0             rmspp = 0. _d 0
131          ELSE          ELSE
# Line 133  Cml        CALL WRITE_FLD_XYZ_RL( 'PINI. Line 133  Cml        CALL WRITE_FLD_XYZ_RL( 'PINI.
133          ENDIF          ENDIF
134          WRITE(msgBuf,'(a,i2,a,e20.13)')          WRITE(msgBuf,'(a,i2,a,e20.13)')
135       &       'Iteration ', npiter, ', RMS-difference = ', rmspp       &       'Iteration ', npiter, ', RMS-difference = ', rmspp
136          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
137       &       SQUEEZE_RIGHT , 1)       &       SQUEEZE_RIGHT , myThid)
138    
139  C --   end npiter loop  C --   end npiter loop
140         ENDDO         ENDDO
# Line 142  C     print some diagnostics Line 142  C     print some diagnostics
142         IF ( rmspp .ne. 0. ) THEN         IF ( rmspp .ne. 0. ) THEN
143          IF ( rmspp .EQ. rmsppold ) THEN          IF ( rmspp .EQ. rmsppold ) THEN
144           WRITE(msgBuf,'(A)')           WRITE(msgBuf,'(A)')
145       &      'Initial hydrostatic pressure did not converge perfectly,'       &      'Initial hydrostatic pressure did not converge perfectly,'
146           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
147       &        SQUEEZE_RIGHT , 1)       &        SQUEEZE_RIGHT , myThid)
148           WRITE(msgBuf,'(A)')           WRITE(msgBuf,'(A)')
149       &      'but the RMS-difference is constant, indicating that the'       &      'but the RMS-difference is constant, indicating that the'
150           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
151       &        SQUEEZE_RIGHT , 1)       &        SQUEEZE_RIGHT , myThid)
152           WRITE(msgBuf,'(A)')           WRITE(msgBuf,'(A)')
153       &      'algorithm converged within machine precision.'           &      'algorithm converged within machine precision.'
154           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
155       &        SQUEEZE_RIGHT , 1)       &        SQUEEZE_RIGHT , myThid)
156          ELSE          ELSE
157           WRITE(msgBuf,'(A,I2,A)')           WRITE(msgBuf,'(A,I2,A)')
158       &       'Initial hydrostatic pressure did not converge after ',       &       'Initial hydrostatic pressure did not converge after ',
159       &          npiter-1, ' steps'       &          npiter-1, ' steps'
160           CALL PRINT_ERROR( msgBuf, myThid )           CALL PRINT_ERROR( msgBuf, myThid )
161           STOP 'ABNORMAL END: S/R INI_PRESSURE'           STOP 'ABNORMAL END: S/R INI_PRESSURE'
162          ENDIF          ENDIF
163         ENDIF         ENDIF
164         WRITE(msgBuf,'(A)')         WRITE(msgBuf,'(A)')
165       &     'Initial hydrostatic pressure converged.'       &     'Initial hydrostatic pressure converged.'
166         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
167       &      SQUEEZE_RIGHT , 1)       &      SQUEEZE_RIGHT , myThid)
168    
169  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
170    
# Line 174  C     print a message and DO nothing Line 174  C     print a message and DO nothing
174         WRITE(msgBuf,'(A,A)')         WRITE(msgBuf,'(A,A)')
175       &        'Pressure is predetermined for buoyancyRelation ',       &        'Pressure is predetermined for buoyancyRelation ',
176       &        buoyancyRelation(1:11)       &        buoyancyRelation(1:11)
177         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
178       &      SQUEEZE_RIGHT , 1)       &      SQUEEZE_RIGHT , myThid)
179    
180        ENDIF        ENDIF
181    
182        WRITE(msgBuf,'(A)') ' '        WRITE(msgBuf,'(A)') ' '
183        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
184       &     SQUEEZE_RIGHT , 1)       &     SQUEEZE_RIGHT , myThid)
185    
186        RETURN        RETURN
187        END        END

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22