/[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.5 by cnh, Wed Sep 26 18:09:14 2001 UTC revision 1.9 by mlosch, Wed Oct 2 17:59:57 2002 UTC
# Line 26  C     === Global variables === Line 26  C     === Global variables ===
26  #include "FFIELDS.h"  #include "FFIELDS.h"
27  #include "DYNVARS.h"  #include "DYNVARS.h"
28  #include "GRID.h"  #include "GRID.h"
29    #ifdef NONLIN_FRSURF
30    #include "SURFACE.h"
31    #endif
32    
33  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
34  C     === Routine arguments ===  C     === Routine arguments ===
# Line 38  C     myThid :: Thread no. that called t Line 41  C     myThid :: Thread no. that called t
41  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
42  C     === Local variables ===  C     === Local variables ===
43        INTEGER i,j        INTEGER i,j
44    C     number of surface interface layer
45          INTEGER kSurface
46          _RL convertVol2Mass
47  CEOP  CEOP
48    
49          if ( buoyancyRelation .eq. 'OCEANICP' ) then
50           kSurface        = Nr
51           convertVol2Mass = gravity*rhoConstFresh
52          else
53           kSurface        = 1
54           convertVol2Mass = 1. _d 0
55          endif
56    
57        DO j = jMin, jMax        DO j = jMin, jMax
58           DO i = iMin, iMax           DO i = iMin, iMax
59    
60  c     Zonal wind stress fu:  c     Zonal wind stress fu:
61            surfaceTendencyU(i,j,bi,bj) = fu(i,j,bi,bj)            surfaceTendencyU(i,j,bi,bj) =
62       &         *horiVertRatio*recip_rhoNil*recip_dRf(1)       &      fu(i,j,bi,bj)*horiVertRatio*recip_rhoConst
63         &           *recip_drF(kSurface)*recip_hFacW(i,j,kSurface,bi,bj)
64  c     Meridional wind stress fv:  c     Meridional wind stress fv:
65            surfaceTendencyV(i,j,bi,bj) = fV(i,j,bi,bj)            surfaceTendencyV(i,j,bi,bj) =
66       &         *horiVertRatio*recip_rhoNil*recip_dRf(1)       &      fv(i,j,bi,bj)*horiVertRatio*recip_rhoConst
67         &           *recip_drF(kSurface)*recip_hFacS(i,j,kSurface,bi,bj)
68  c     Net heat flux Qnet:  c     Net heat flux Qnet:
69            surfaceTendencyT(i,j,bi,bj) = -Qnet(i,j,bi,bj)            surfaceTendencyT(i,j,bi,bj) =
70       &        *recip_Cp*recip_rhoNil*recip_dRf(1)       &      -Qnet(i,j,bi,bj)*recip_Cp*horiVertRatio*recip_rhoConst
71       &         - lambdaThetaClimRelax*       &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
72       &           (theta(i,j,1,bi,bj)-SST(i,j,bi,bj))       &      -lambdaThetaClimRelax
73         &         *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj))
74  #ifdef USE_NATURAL_BCS  C     Salt Flux (restoring term) :
75  c     Freshwater flux EmPmR:  C         surfaceTendencyS(i,j,bi,bj) =
76            surfaceTendencyS(i,j,bi,bj) = EmPmR(i,j,bi,bj)  C    &      -lambdaSaltClimRelax*(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
77       &         *recip_dRf(1)*salt(i,j,1,bi,bj)  C notes : because truncation is different when this tendency is splitted
78       &         - lambdaSaltClimRelax*  C   in 2 parts, keep this salt flux with freshwater flux (see below)
79       &           (salt(i,j,1,bi,bj)-SSS(i,j,bi,bj))  
80  #else  #ifdef ALLOW_PASSIVE_TRACER
81  c     Freshwater flux EmPmR:  c ***  define the tracer surface tendency here ***
82            surfaceTendencyS(i,j,bi,bj) = EmPmR(i,j,bi,bj)  #endif /* ALLOW_PASSIVE_TRACER */
      &         *recip_dRf(1)*35.  
      &         - lambdaSaltClimRelax*  
      &           (salt(i,j,1,bi,bj)-SSS(i,j,bi,bj))  
 #endif            
83    
84           ENDDO           ENDDO
85        ENDDO        ENDDO
86    
87    c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
88    C     Surface salinity tendency and freshwater flux EmPmR:
89    
90          IF (.NOT.useRealFreshWaterFlux .OR. nonlinFreeSurf .LE. 0 ) THEN
91    
92    c- EmPmR does not really affect the water column height (for tracer budget)
93    c   and is converted to a salt tendency.
94    
95           IF (convertFW2Salt .EQ. -1.) THEN
96    c- converts EmPmR to salinity tendency using surface local salinity
97            DO j = jMin, jMax
98             DO i = iMin, iMax
99              surfaceTendencyS(i,j,bi,bj) =
100         &      + EmPmR(i,j,bi,bj)*salt(i,j,kSurface,bi,bj)
101         &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
102         &         *convertVol2Mass
103         &      -lambdaSaltClimRelax
104         &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
105             ENDDO
106            ENDDO
107           ELSE
108    c- converts EmPmR to virtual salt flux using uniform salinity (default=35)
109            DO j = jMin, jMax
110             DO i = iMin, iMax
111              surfaceTendencyS(i,j,bi,bj) =
112         &      + EmPmR(i,j,bi,bj)*convertFW2Salt
113         &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
114         &         *convertVol2Mass
115         &      -lambdaSaltClimRelax
116         &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
117             ENDDO
118            ENDDO
119           ENDIF
120    
121    #ifdef NONLIN_FRSURF
122    c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
123          ELSE
124    
125    c     Salt Flux (restoring term) :
126           DO j = jMin, jMax
127             DO i = iMin, iMax
128              surfaceTendencyS(i,j,bi,bj) =
129         &      -lambdaSaltClimRelax
130         &         *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj))
131             ENDDO
132           ENDDO
133    
134    c-  NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes
135    c   the water column height ; temp., salt, (tracer) flux associated
136    c   with this input/output of water is added here to the surface tendency.
137    c
138    c NB: PmEpR lag 1 time step behind EmPmR ( PmEpR_n = - EmPmR_n-1 ) to stay
139    c     consitent with volume change (=d/dt etaN).
140    
141           IF (temp_EvPrRn.NE.UNSET_RL) THEN
142            DO j = jMin, jMax
143             DO i = iMin, iMax
144              surfaceTendencyT(i,j,bi,bj) = surfaceTendencyT(i,j,bi,bj)
145         &      + PmEpR(i,j,bi,bj)
146         &         *( temp_EvPrRn - theta(i,j,kSurface,bi,bj) )
147         &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
148         &         *convertVol2Mass
149             ENDDO
150            ENDDO
151           ENDIF
152    
153           IF (salt_EvPrRn.NE.UNSET_RL) THEN
154            DO j = jMin, jMax
155             DO i = iMin, iMax
156              surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj)
157         &      + PmEpR(i,j,bi,bj)
158         &         *( salt_EvPrRn - salt(i,j,kSurface,bi,bj) )
159         &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
160         &         *convertVol2Mass
161             ENDDO
162            ENDDO
163           ENDIF
164    
165    #ifdef ALLOW_PASSIVE_TRACER
166    c  *** add the tracer flux associated with P-E+R here ***
167    c      IF (trac_EvPrRn.NE.UNSET_RL) THEN
168    c    &      + PmEpR(i,j,bi,bj)*( trac_EvPrRn - tr1(i,j,kSurface,bi,bj) )
169    c    &           *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj)
170    c      ENDIF
171    #endif /* ALLOW_PASSIVE_TRACER */
172    
173    #endif /* NONLIN_FRSURF */
174          ENDIF
175    
176        RETURN        RETURN
177        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22