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

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

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

revision 1.12 by dimitri, Wed Sep 24 04:52:38 2003 UTC revision 1.20 by heimbach, Fri May 14 21:08:28 2004 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 27  C     === Global variables === Line 28  C     === Global variables ===
28  #include "DYNVARS.h"  #include "DYNVARS.h"
29  #include "GRID.h"  #include "GRID.h"
30  #include "SURFACE.h"  #include "SURFACE.h"
31    #ifdef ALLOW_SEAICE
32    #include "SEAICE.h"
33    #endif /* ALLOW_SEAICE */
34    
35  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
36  C     === Routine arguments ===  C     === Routine arguments ===
# Line 53  CEOP Line 57  CEOP
57         kSurface        = 1         kSurface        = 1
58        endif        endif
59    
60    C--   Surface Fluxes :
61    
62        DO j = jMin, jMax        DO j = jMin, jMax
63           DO i = iMin, iMax           DO i = iMin, iMax
64    
# Line 68  c     Net heat flux Qnet: Line 74  c     Net heat flux Qnet:
74            surfaceTendencyT(i,j,bi,bj) =            surfaceTendencyT(i,j,bi,bj) =
75       &      -Qnet(i,j,bi,bj)*recip_Cp*horiVertRatio*recip_rhoConst       &      -Qnet(i,j,bi,bj)*recip_Cp*horiVertRatio*recip_rhoConst
76       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
77       &      -lambdaThetaClimRelax  C     Net Salt Flux :
78       &         *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj))            surfaceTendencyS(i,j,bi,bj) =
79  C     Salt Flux (restoring term) :       &      -saltFlux(i,j,bi,bj)*horiVertRatio*recip_rhoConst
80  C         surfaceTendencyS(i,j,bi,bj) =       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
 C    &      -lambdaSaltClimRelax*(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))  
 C notes : because truncation is different when this tendency is splitted  
 C   in 2 parts, keep this salt flux with freshwater flux (see below)  
81    
82  #ifdef ALLOW_PASSIVE_TRACER  #ifdef ALLOW_PASSIVE_TRACER
83  c ***  define the tracer surface tendency here ***  c ***  define the tracer surface tendency here ***
# Line 82  c ***  define the tracer surface tendenc Line 85  c ***  define the tracer surface tendenc
85    
86           ENDDO           ENDDO
87        ENDDO        ENDDO
88            
89    C--   Surface restoring term :
90    
91  c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|        IF ( doThetaClimRelax .OR. doSaltClimRelax ) THEN
 C     Surface salinity tendency and freshwater flux EmPmR:  
   
 #ifdef NONLIN_FRSURF  
       IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP')  
      &     .AND. useRealFreshWaterFlux ) THEN  
   
 c     Salt Flux (restoring term) :  
92         DO j = jMin, jMax         DO j = jMin, jMax
93           DO i = iMin, iMax          DO i = iMin, iMax
94            surfaceTendencyS(i,j,bi,bj) =  #ifdef ALLOW_SEAICE
95    C     Don't restore under sea-ice
96    C     Heat Flux (restoring term) :
97              surfaceTendencyT(i,j,bi,bj) = surfaceTendencyT(i,j,bi,bj)
98         &      -lambdaThetaClimRelax * (1-AREA(i,j,1,bi,bj))
99         &         *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj))
100    C     Salt Flux (restoring term) :
101              surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj)
102         &      -lambdaSaltClimRelax * (1-AREA(i,j,1,bi,bj))
103         &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
104    #else /* ifndef ALLOW_SEAICE */
105    C     Heat Flux (restoring term) :
106             IF ( abs(yC(i,j,bi,bj)).LE.latBandClimRelax ) THEN
107              surfaceTendencyT(i,j,bi,bj) = surfaceTendencyT(i,j,bi,bj)
108         &      -lambdaThetaClimRelax
109         &         *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj))
110    C     Salt Flux (restoring term) :
111              surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj)
112       &      -lambdaSaltClimRelax       &      -lambdaSaltClimRelax
113       &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))       &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
114           ENDDO           ENDIF
115    #endif /* ALLOW_SEAICE */
116            ENDDO
117         ENDDO         ENDDO
118          ENDIF
119    
120    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
121    C--   Fresh-water flux
122    
123    #ifdef NONLIN_FRSURF
124          IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP')
125         &     .AND. useRealFreshWaterFlux ) THEN
126    
127  c-  NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes  c-  NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes
128  c   the water column height ; temp., salt, (tracer) flux associated  c   the water column height ; temp., salt, (tracer) flux associated
# Line 130  c     consitent with volume change (=d/d Line 155  c     consitent with volume change (=d/d
155          ENDDO          ENDDO
156         ENDIF         ENDIF
157    
 #ifdef ALLOW_PASSIVE_TRACER  
 c  *** add the tracer flux associated with P-E+R here ***  
 c      IF (trac_EvPrRn.NE.UNSET_RL) THEN  
 c    &      + PmEpR(i,j,bi,bj)*( trac_EvPrRn - tr1(i,j,kSurface,bi,bj) )  
 c    &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)  
 c      ENDIF  
 #endif /* ALLOW_PASSIVE_TRACER */  
   
158  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
159        ELSE        ELSE
160  #else /* NONLIN_FRSURF */  #else /* NONLIN_FRSURF */
# Line 151  c   and is converted to a salt tendency. Line 168  c   and is converted to a salt tendency.
168  c- converts EmPmR to salinity tendency using surface local salinity  c- converts EmPmR to salinity tendency using surface local salinity
169          DO j = jMin, jMax          DO j = jMin, jMax
170           DO i = iMin, iMax           DO i = iMin, iMax
171            surfaceTendencyS(i,j,bi,bj) =            surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj)
172       &      + EmPmR(i,j,bi,bj)*salt(i,j,kSurface,bi,bj)       &      + EmPmR(i,j,bi,bj)*salt(i,j,kSurface,bi,bj)
173       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
174       &         *convertEmP2rUnit       &         *convertEmP2rUnit
      &      -lambdaSaltClimRelax  
      &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))  
175           ENDDO           ENDDO
176          ENDDO          ENDDO
177         ELSE         ELSE
178  c- converts EmPmR to virtual salt flux using uniform salinity (default=35)  c- converts EmPmR to virtual salt flux using uniform salinity (default=35)
179          DO j = jMin, jMax          DO j = jMin, jMax
180           DO i = iMin, iMax           DO i = iMin, iMax
181            surfaceTendencyS(i,j,bi,bj) =            surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj)
182       &      + EmPmR(i,j,bi,bj)*convertFW2Salt       &      + EmPmR(i,j,bi,bj)*convertFW2Salt
183       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
184       &         *convertEmP2rUnit       &         *convertEmP2rUnit
      &      -lambdaSaltClimRelax  
      &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))  
185           ENDDO           ENDDO
186          ENDDO          ENDDO
187         ENDIF         ENDIF
188    
189        ENDIF        ENDIF
190    
191  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
192    
193  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_PTRACERS
194        IF ( usePTRACERS ) THEN        IF ( usePTRACERS ) THEN
195           CALL PTRACERS_FORCING_SURF(           CALL PTRACERS_FORCING_SURF(
196       I                              bi, bj, iMin, iMax, jMin, jMax,       I        bi, bj, iMin, iMax, jMin, jMax,
197       I                              myTime,myIter,myThid )       I        myTime,myIter,myThid )
198        ENDIF        ENDIF
199  #endif /* ALLOW_PTRACERS */  #endif /* ALLOW_PTRACERS */
200    
# Line 207  C   (requires time varying dP(Nr) like d Line 222  C   (requires time varying dP(Nr) like d
222    
223  #endif /* ATMOSPHERIC_LOADING */  #endif /* ATMOSPHERIC_LOADING */
224    
225    #ifdef ALLOW_EBM
226    c--    Values for surfaceTendencyT, surfaceTendencyS
227    c      are overwritten by those produced by EBM
228          IF ( useEBM ) THEN
229           CALL EBM_FORCING_SURF(
230         I        bi, bj, iMin, iMax, jMin, jMax,
231         I        myTime,myIter,myThid )
232          ENDIF
233    #endif
234    
235    #ifdef ALLOW_TIMEAVE
236          IF ( taveFreq .NE. 0. _d 0 ) THEN
237            CALL TIMEAVE_SURF_FLUX( bi, bj, myTime, myIter, myThid)
238          ENDIF
239    #endif /* ALLOW_TIMEAVE */
240    
241        RETURN        RETURN
242        END        END

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22