/[MITgcm]/MITgcm_contrib/darwin2/pkg/darwin/dic_surfforcing.F
ViewVC logotype

Diff of /MITgcm_contrib/darwin2/pkg/darwin/dic_surfforcing.F

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

revision 1.4 by stephd, Wed Oct 9 15:37:05 2013 UTC revision 1.5 by stephd, Wed Oct 9 17:14:37 2013 UTC
# Line 42  C  myTime               :: current time Line 42  C  myTime               :: current time
42  c  PTR_DIC              :: DIC tracer field  c  PTR_DIC              :: DIC tracer field
43        INTEGER myIter, myThid        INTEGER myIter, myThid
44        _RL myTime        _RL myTime
45    #ifdef pH_3D
46          _RL  PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
47          _RL  PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
48          _RL  PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
49          _RL  PTR_SIL(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
50    #else
51        _RL  PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  PTR_DIC(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52        _RL  PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53        _RL  PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
54        _RL  PTR_SIL(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  PTR_SIL(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55    #endif
56        INTEGER iMin,iMax,jMin,jMax, bi, bj        INTEGER iMin,iMax,jMin,jMax, bi, bj
57    
58  C !OUTPUT PARAMETERS: ===================================================  C !OUTPUT PARAMETERS: ===================================================
# Line 89  c       ENDDO Line 96  c       ENDDO
96  c#endif  c#endif
97  C =================================================================  C =================================================================
98  C determine inorganic carbon chem coefficients  C determine inorganic carbon chem coefficients
99    #ifdef pH_3D
100           DO kLev=1,Nr
101    #endif
102          DO j=jmin,jmax          DO j=jmin,jmax
103           DO i=imin,imax           DO i=imin,imax
104  c put bounds on tracers so pH solver doesn't blow up  c put bounds on tracers so pH solver doesn't blow up
105    #ifdef pH_3D
106                 surfdic(i,j) =
107         &           max(400. _d 0 , min(4000. _d 0, PTR_DIC(i,j,kLev)))*1e-3
108         &                          * maskC(i,j,kLev,bi,bj)
109                 surfalk(i,j) =
110         &           max(400. _d 0 , min(4000. _d 0, PTR_ALK(i,j,kLev)))*1e-3
111         &                          * maskC(i,j,kLev,bi,bj)
112                 surfphos(i,j)  =
113         &           max(1. _d -10, min(10. _d 0, PTR_PO4(i,j,kLev)))*1e-3
114         &                          * maskC(i,j,kLev,bi,bj)
115                 surfsi(i,j)   =
116         &           max(1. _d -8, min(500. _d 0, PTR_SIL(i,j,kLev)))*1e-3
117         &                          * maskC(i,j,kLev,bi,bj)
118    #else
119               surfdic(i,j) =               surfdic(i,j) =
120       &           max(400. _d 0 , min(4000. _d 0, PTR_DIC(i,j)))*1e-3       &           max(400. _d 0 , min(4000. _d 0, PTR_DIC(i,j)))*1e-3
121       &                          * maskC(i,j,kLev,bi,bj)       &                          * maskC(i,j,kLev,bi,bj)
# Line 104  c put bounds on tracers so pH solver doe Line 128  c put bounds on tracers so pH solver doe
128               surfsi(i,j)   =               surfsi(i,j)   =
129       &           max(1. _d -8, min(500. _d 0, PTR_SIL(i,j)))*1e-3       &           max(1. _d -8, min(500. _d 0, PTR_SIL(i,j)))*1e-3
130       &                          * maskC(i,j,kLev,bi,bj)       &                          * maskC(i,j,kLev,bi,bj)
131    #endif
132               surfsalt(i,j) =               surfsalt(i,j) =
133       &           max(4. _d 0, min(50. _d 0, salt(i,j,kLev,bi,bj)))       &           max(4. _d 0, min(50. _d 0, salt(i,j,kLev,bi,bj)))
134               surftemp(i,j) =               surftemp(i,j) =
# Line 117  c put bounds on tracers so pH solver doe Line 142  c put bounds on tracers so pH solver doe
142       I                       kLev,myThid)       I                       kLev,myThid)
143  C====================================================================  C====================================================================
144    
145           if (kLev.eq.1) then
146         DO j=jmin,jmax         DO j=jmin,jmax
147          DO i=imin,imax          DO i=imin,imax
148  C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2  C Compute AtmosP and Kwexch_Pre which are re-used for flux of O2
# Line 142  C Schmidt number is accounted for later Line 168  C Schmidt number is accounted for later
168    
169          ENDDO          ENDDO
170         ENDDO         ENDDO
171           ENDIF
172    
173  c pCO2 solver...  c pCO2 solver...
174  C$TAF LOOP = parallel  C$TAF LOOP = parallel
# Line 161  C$TAF LOOP = parallel Line 188  C$TAF LOOP = parallel
188       I        ak0(i,j,bi,bj), fugf(i,j,bi,bj),       I        ak0(i,j,bi,bj), fugf(i,j,bi,bj),
189       I        ff(i,j,bi,bj),       I        ff(i,j,bi,bj),
190       I        bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),       I        bt(i,j,bi,bj),st(i,j,bi,bj),ft(i,j,bi,bj),
191    #ifdef pH_3D
192         U        pH(i,j,kLev,bi,bj),pCO2(i,j,kLev,bi,bj),
193    #else
194       U        pH(i,j,bi,bj),pCO2(i,j,bi,bj),       U        pH(i,j,bi,bj),pCO2(i,j,bi,bj),
195    #endif
196       I        myThid )       I        myThid )
197            ELSE            ELSE
198    #ifdef pH_3D
199                pCO2(i,j,kLev,bi,bj)=0. _d 0
200    #else
201              pCO2(i,j,bi,bj)=0. _d 0              pCO2(i,j,bi,bj)=0. _d 0
202    #endif
203            ENDIF            ENDIF
204          ENDDO          ENDDO
205         ENDDO         ENDDO
206    
207    
208           if (kLev.eq.1) then
209         DO j=jmin,jmax         DO j=jmin,jmax
210          DO i=imin,imax          DO i=imin,imax
211    
# Line 201  C Converting pCO2 to [CO2] using ff, as Line 237  C Converting pCO2 to [CO2] using ff, as
237                FluxCO2(i,j,bi,bj) =                FluxCO2(i,j,bi,bj) =
238       &         Kwexch(i,j)*(       &         Kwexch(i,j)*(
239       &         ak0(i,j,bi,bj)*pCO2sat(i,j) -       &         ak0(i,j,bi,bj)*pCO2sat(i,j) -
240    #ifdef pH_3D
241         &         ff(i,j,bi,bj)*pCO2(i,j,1,bi,bj)
242    #else
243       &         ff(i,j,bi,bj)*pCO2(i,j,bi,bj)       &         ff(i,j,bi,bj)*pCO2(i,j,bi,bj)
244    #endif
245       &         )       &         )
246  #else  #else
247  C Corrected by Val Bennington Nov 2010 per G.A. McKinley's finding  C Corrected by Val Bennington Nov 2010 per G.A. McKinley's finding
# Line 210  c Flux = kw*rho*(ff*pCO2atm-k0*FugFac*pC Line 250  c Flux = kw*rho*(ff*pCO2atm-k0*FugFac*pC
250                 FluxCO2(i,j,bi,bj) =                 FluxCO2(i,j,bi,bj) =
251       &          Kwexch(i,j)*(       &          Kwexch(i,j)*(
252       &            ff(i,j,bi,bj)*pCO2sat(i,j) -       &            ff(i,j,bi,bj)*pCO2sat(i,j) -
253    #ifdef pH_3D
254         &            pCO2(i,j,1,bi,bj)*fugf(i,j,bi,bj)
255    #else
256       &            pCO2(i,j,bi,bj)*fugf(i,j,bi,bj)       &            pCO2(i,j,bi,bj)*fugf(i,j,bi,bj)
257    #endif
258       &            *ak0(i,j,bi,bj) )       &            *ak0(i,j,bi,bj) )
259       &       &
260  #endif  #endif
# Line 255  C update tendency Line 299  C update tendency
299       &               )       &               )
300            ENDDO            ENDDO
301           ENDDO           ENDDO
302            ENDIF
303    #ifdef pH_3D
304            ENDDO
305    #endif
306    
307          RETURN          RETURN
308          END          END

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

  ViewVC Help
Powered by ViewVC 1.1.22