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

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

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

revision 1.1 by jmc, Mon Oct 7 16:17:09 2002 UTC revision 1.7 by jmc, Fri Nov 4 01:19:24 2005 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7  CBOP  CBOP
# Line 40  C     !LOCAL VARIABLES: Line 41  C     !LOCAL VARIABLES:
41  C     Local variables in common block  C     Local variables in common block
42    
43  C     Local variables  C     Local variables
44  C     i,j,k,bi,bj  :: Loop counters  C     i,j,bi,bj  :: Loop counters
45        INTEGER i,j,k,bi,bj        INTEGER i,j,bi,bj
46  CEOP  CEOP
47    
48    
49        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
50         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
51    
52  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
53    
54  #ifdef NONLIN_FRSURF  C--   before updating etaH, save current etaH field in etaHnm1
55         IF (useRealFreshWaterFlux .AND. nonlinFreeSurf.GT.0) THEN           DO j=1-Oly,sNy+Oly
56               DO i=1-Olx,sNx+Olx
57                 etaHnm1(i,j,bi,bj) = etaH(i,j,bi,bj)
58               ENDDO
59             ENDDO
60    
61  C-- Called at the beginning of the time step :  C--   Update etaH at the end of the time step :
62  C-  keep present time EmPmR to compute later (S/R EXTERNAL_FORCING_SURF)  C     Incorporate the Explicit part of -Divergence(Barotropic_Flow)
 C   tracers and momentum flux associated with fresh water input.  
63    
64          IF ( myTime.NE.startTime ) THEN          IF (implicDiv2Dflow.EQ. 1. _d 0) THEN
65           DO j=1-Oly,sNy+Oly           DO j=1-Oly,sNy+Oly
66            DO i=1-Olx,sNx+Olx            DO i=1-Olx,sNx+Olx
67              PmEpR(i,j,bi,bj) = -EmPmR(i,j,bi,bj)              etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
68            ENDDO            ENDDO
69           ENDDO           ENDDO
70    
         ELSEIF( myTime .EQ. 0. _d 0 ) THEN  
           DO j=1-Oly,sNy+Oly  
            DO i=1-Olx,sNx+Olx  
             PmEpR(i,j,bi,bj) = 0. _d 0  
            ENDDO  
           ENDDO  
   
71          ELSE          ELSE
72  C     needs previous time-step value of E-P-R, that has not been loaded           DO j=1,sNy
73  C     and was not in pickup-file ; try to use etaN & etaH instead.            DO i=1,sNx
74            DO j=1,sNy              etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
75             DO i=1,sNx       &       + (1. - implicDiv2Dflow)*dEtaHdt(i,j,bi,bj)
76              PmEpR(i,j,bi,bj) =       &                               *deltaTfreesurf
      &        hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)  
      &      + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))  
      &       /(implicDiv2Dflow*deltaTfreesurf)  
            ENDDO  
77            ENDDO            ENDDO
         ENDIF  
   
        ENDIF  
 #endif /* NONLIN_FRSURF */  
   
 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  
   
 C--   Update etaH at the beginning of the time step :  
 C     Incorporate the Explicit part of -Divergence(Barotropic_Flow)  
   
        IF ( useRealFreshWaterFlux .AND. myTime.EQ.startTime ) THEN  
 C     needs previous time-step value of E-P-R, that has not been loaded  
 C     and was not in pickup-file ; try to use etaN & etaH instead.  
         DO j=1-Oly,sNy+Oly  
          DO i=1-Olx,sNx+Olx  
            etaH(i,j,bi,bj) = etaN(i,j,bi,bj)  
      &        + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))  
      &             *(1. - implicDiv2Dflow)/implicDiv2Dflow  
          ENDDO  
         ENDDO  
   
        ELSEIF (implicDiv2Dflow.EQ. 1. _d 0) THEN  
         DO j=1-Oly,sNy+Oly  
          DO i=1-Olx,sNx+Olx  
            etaH(i,j,bi,bj) = etaN(i,j,bi,bj)  
          ENDDO  
         ENDDO  
   
        ELSEIF (useRealFreshWaterFlux) THEN  
         DO j=1,sNy  
          DO i=1,sNx  
            etaH(i,j,bi,bj) = etaN(i,j,bi,bj)  
      &      - (1. - implicDiv2Dflow)*( convertEmP2rUnit*EmPmR(i,j,bi,bj)  
      &                    +hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)  
      &                               )*deltaTfreesurf  
78           ENDDO           ENDDO
79          ENDDO          ENDIF
   
        ELSE  
         DO j=1,sNy  
          DO i=1,sNx  
            etaH(i,j,bi,bj) = etaN(i,j,bi,bj)  
      &      - (1. - implicDiv2Dflow)*hDivFlow(i,j,bi,bj)  
      &                              *recip_rA(i,j,bi,bj)*deltaTfreesurf  
          ENDDO  
         ENDDO  
        ENDIF  
80    
81  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
82  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
# Line 150  C- end bi,bj loop. Line 99  C- end bi,bj loop.
99        ENDDO        ENDDO
100    
101        IF (implicDiv2Dflow .NE. 1. _d 0 .OR. useOBCS )        IF (implicDiv2Dflow .NE. 1. _d 0 .OR. useOBCS )
102       &    _EXCH_XY_R8(etaH, myThid )       &    _EXCH_XY_RL( etaH, myThid )
103    
104    c     IF (useRealFreshWaterFlux .AND. myTime.EQ.startTime)
105    c    &    _EXCH_XY_R4( PmEpR, myThid )
106    
107  #endif /* EXACT_CONSERV */  #endif /* EXACT_CONSERV */
108    

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

  ViewVC Help
Powered by ViewVC 1.1.22