/[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.3 by edhill, Thu Oct 9 04:19:18 2003 UTC revision 1.5 by jmc, Tue Jul 6 01:05:53 2004 UTC
# Line 48  CEOP Line 48  CEOP
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)
 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  
51    
52  #ifdef NONLIN_FRSURF  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
 c      IF (useRealFreshWaterFlux .AND. nonlinFreeSurf.GT.0) THEN  
        IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP')  
      &      .AND. useRealFreshWaterFlux ) THEN  
   
 C-- Called at the beginning of the time step :  
 C-  keep present time EmPmR to compute later (S/R EXTERNAL_FORCING_SURF)  
 C   tracers and momentum flux associated with fresh water input.  
53    
54          IF ( myTime.NE.startTime ) THEN  C--   before updating etaH, save current etaH field in etaHnm1
55           DO j=1-Oly,sNy+Oly           DO j=1-Oly,sNy+Oly
           DO i=1-Olx,sNx+Olx  
             PmEpR(i,j,bi,bj) = -EmPmR(i,j,bi,bj)  
           ENDDO  
          ENDDO  
   
         ELSE  
           DO j=1-Oly,sNy+Oly  
56             DO i=1-Olx,sNx+Olx             DO i=1-Olx,sNx+Olx
57              PmEpR(i,j,bi,bj) = 0. _d 0               etaHnm1(i,j,bi,bj) = etaH(i,j,bi,bj)
58             ENDDO             ENDDO
           ENDDO  
   
           IF( myTime .NE. 0. _d 0 .AND. nonlinFreeSurf.GE.0 ) 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,sNy  
            DO i=1,sNx  
             PmEpR(i,j,bi,bj) =  
      &        hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)  
      &      + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))  
      &       /(implicDiv2Dflow*deltaTfreesurf)  
             PmEpR(i,j,bi,bj) = PmEpR(i,j,bi,bj)/convertEmP2rUnit  
            ENDDO  
           ENDDO  
           ENDIF  
         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  
59           ENDDO           ENDDO
         ENDDO  
60    
61         ELSEIF (implicDiv2Dflow.EQ. 1. _d 0) THEN  C--   Update etaH at the end of the time step :
62          DO j=1-Oly,sNy+Oly  C     Incorporate the Explicit part of -Divergence(Barotropic_Flow)
          DO i=1-Olx,sNx+Olx  
            etaH(i,j,bi,bj) = etaN(i,j,bi,bj)  
          ENDDO  
         ENDDO  
63    
64         ELSEIF (useRealFreshWaterFlux) THEN          IF (implicDiv2Dflow.EQ. 1. _d 0) THEN
65          DO j=1,sNy           DO j=1-Oly,sNy+Oly
66           DO i=1,sNx            DO i=1-Olx,sNx+Olx
67             etaH(i,j,bi,bj) = etaN(i,j,bi,bj)              etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
68       &      - (1. - implicDiv2Dflow)*( convertEmP2rUnit*EmPmR(i,j,bi,bj)            ENDDO
      &                    +hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)  
      &                               )*deltaTfreesurf  
69           ENDDO           ENDDO
         ENDDO  
70    
71         ELSE          ELSE
72          DO j=1,sNy           DO j=1,sNy
73           DO i=1,sNx            DO i=1,sNx
74             etaH(i,j,bi,bj) = etaN(i,j,bi,bj)              etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
75       &      - (1. - implicDiv2Dflow)*hDivFlow(i,j,bi,bj)       &       + (1. - implicDiv2Dflow)*dEtaHdt(i,j,bi,bj)
76       &                              *recip_rA(i,j,bi,bj)*deltaTfreesurf       &                               *deltaTfreesurf
77              ENDDO
78           ENDDO           ENDDO
79          ENDDO          ENDIF
        ENDIF  
80    
81  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
82  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
# Line 155  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_RL(etaH, myThid )       &    _EXCH_XY_RL( etaH, myThid )
103    
104  #endif /* EXACT_CONSERV */        IF (useRealFreshWaterFlux .AND. myTime.EQ.startTime)
105         &    _EXCH_XY_R4( PmEpR, myThid )
106    
107  #ifdef NONLIN_FRSURF  #endif /* EXACT_CONSERV */
       IF ( buoyancyRelation.EQ.'OCEANICP'  
      &     .AND. useRealFreshWaterFlux  
      &     .AND. myTime.EQ.startTime ) THEN  
           _EXCH_XY_RS(PmEpR, myThid )  
       ENDIF  
 #endif /* NONLIN_FRSURF */  
108    
109        RETURN        RETURN
110        END        END

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22