/[MITgcm]/MITgcm/pkg/ptracers/ptracers_forcing_surf.F
ViewVC logotype

Annotation of /MITgcm/pkg/ptracers/ptracers_forcing_surf.F

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


Revision 1.11 - (hide annotations) (download)
Thu Mar 8 17:13:31 2012 UTC (12 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63k, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.10: +12 -7 lines
-only step forward tracer if PTRACERS_StepFwd(iTr)=T

1 jmc 1.11 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_forcing_surf.F,v 1.10 2010/09/05 22:28:14 jmc Exp $
2 dimitri 1.1 C $Name: $
3    
4     #include "PTRACERS_OPTIONS.h"
5    
6     CBOP
7 jmc 1.2 C !ROUTINE: PTRACERS_FORCING_SURF
8 dimitri 1.1
9     C !INTERFACE: ==========================================================
10     SUBROUTINE PTRACERS_FORCING_SURF(
11 jmc 1.10 I relaxForcingS,
12 dimitri 1.1 I bi, bj, iMin, iMax, jMin, jMax,
13     I myTime,myIter,myThid )
14    
15     C !DESCRIPTION:
16     C Precomputes surface forcing term for pkg/ptracers.
17     C Precomputation is needed because of non-local KPP transport term,
18     C routine KPP_TRANSPORT_PTR.
19    
20     C !USES: ===============================================================
21     IMPLICIT NONE
22     #include "SIZE.h"
23     #include "EEPARAMS.h"
24     #include "PARAMS.h"
25 jmc 1.5 #include "GRID.h"
26     #include "SURFACE.h"
27 jmc 1.10 #include "DYNVARS.h"
28 dimitri 1.1 #include "FFIELDS.h"
29 jmc 1.5 #include "PTRACERS_SIZE.h"
30 jmc 1.9 #include "PTRACERS_PARAMS.h"
31 jmc 1.11 #include "PTRACERS_START.h"
32 jmc 1.9 #include "PTRACERS_FIELDS.h"
33 dimitri 1.1
34     C !INPUT PARAMETERS: ===================================================
35 jmc 1.10 C relaxForcingS :: Salt forcing due to surface relaxation
36 dimitri 1.1 C bi,bj :: tile indices
37     C myTime :: model time
38     C myIter :: time-step number
39     C myThid :: thread number
40 jmc 1.10 _RL relaxForcingS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41 dimitri 1.1 INTEGER bi, bj, iMin, iMax, jMin, jMax
42     _RL myTime
43     INTEGER myIter
44     INTEGER myThid
45    
46     #ifdef ALLOW_PTRACERS
47    
48     C !LOCAL VARIABLES: ====================================================
49     C i,j :: loop indices
50 jmc 1.5 C iTrc :: tracer index
51     C ks :: surface level index
52     INTEGER i, j
53     INTEGER iTrc, ks
54 jmc 1.10 _RL add2EmP(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55     _RL epsil, cutoff, tmpVar
56 dimitri 1.1 CEOP
57    
58 jmc 1.5 IF ( usingPCoords ) THEN
59     ks = Nr
60     ELSE
61     ks = 1
62     ENDIF
63    
64 dimitri 1.1 C Example of how to add forcing at the surface
65 jmc 1.5 DO iTrc=1,PTRACERS_numInUse
66 jmc 1.11 c IF ( PTRACERS_StepFwd(iTrc) ) THEN
67 dimitri 1.1 DO j = jMin, jMax
68 jmc 1.4 DO i = iMin, iMax
69 jmc 1.11 surfaceForcingPTr(i,j,bi,bj,iTrc) = 0. _d 0
70     c & + surfaceForcingS(i,j,bi,bj)
71 jmc 1.4 ENDDO
72 dimitri 1.1 ENDDO
73 jmc 1.11 c ENDIF
74 jmc 1.5 ENDDO
75    
76 jmc 1.10 C-- Option to convert Salt-relaxation into additional EmP contribution
77     IF ( PTRACERS_addSrelax2EmP ) THEN
78     C- here we assume that salt_EvPrRn = 0
79     C set cutoff value to prevent too large additional EmP:
80     C current limit is set to 0.1 CFL
81     epsil = 1. _d -10
82     cutoff = 0.1 _d 0 *drF(ks)/PTRACERS_dTLev(ks)
83     IF ( ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
84     & .AND. useRealFreshWaterFlux )
85     & .OR.convertFW2Salt .EQ. -1. ) THEN
86     DO j = jMin, jMax
87     DO i = iMin, iMax
88     tmpVar = MAX( salt(i,j,ks,bi,bj), epsil )
89     add2EmP(i,j) = relaxForcingS(i,j)/tmpVar
90     add2EmP(i,j) = rUnit2mass
91     & *MAX( -cutoff, MIN( add2EmP(i,j), cutoff ) )
92     ENDDO
93     ENDDO
94     ELSE
95     DO j = jMin, jMax
96     DO i = iMin, iMax
97     add2EmP(i,j) = relaxForcingS(i,j)/convertFW2Salt
98     add2EmP(i,j) = rUnit2mass
99     & *MAX( -cutoff, MIN( add2EmP(i,j), cutoff ) )
100     ENDDO
101     ENDDO
102     ENDIF
103     #ifdef ALLOW_DIAGNOSTICS
104     IF ( useDiagnostics ) THEN
105     CALL DIAGNOSTICS_FILL(add2EmP,'Add2EmP ',0,1,2,bi,bj,myThid)
106     ENDIF
107     #endif /* ALLOW_DIAGNOSTICS */
108     ELSE
109     DO j = jMin, jMax
110     DO i = iMin, iMax
111     add2EmP(i,j) = 0. _d 0
112     ENDDO
113     ENDDO
114     ENDIF
115     C-- end of "addEmP" setting
116    
117 jmc 1.5 #ifdef EXACT_CONSERV
118     IF ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
119     & .AND. useRealFreshWaterFlux ) THEN
120    
121     DO iTrc=1,PTRACERS_numInUse
122    
123     c- NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes
124     c the water column height ; temp., salt, (tracer) flux associated
125     c with this input/output of water is added here to the surface tendency.
126     c
127 jmc 1.11 IF ( PTRACERS_StepFwd(iTrc) .AND.
128     & PTRACERS_EvPrRn(iTrc).NE.UNSET_RL ) THEN
129 jmc 1.5 DO j = jMin, jMax
130     DO i = iMin, iMax
131 jmc 1.9 surfaceForcingPTr(i,j,bi,bj,iTrc) =
132     & surfaceForcingPTr(i,j,bi,bj,iTrc)
133 jmc 1.10 & + ( PmEpR(i,j,bi,bj) - add2EmP(i,j) )
134 jmc 1.5 & *( PTRACERS_EvPrRn(iTrc) - pTracer(i,j,ks,bi,bj,iTrc) )
135 jmc 1.6 & *mass2rUnit
136 jmc 1.5 ENDDO
137     ENDDO
138     ENDIF
139    
140 dimitri 1.1 ENDDO
141 dfer 1.7
142     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
143     ELSE
144     #else /* EXACT_CONSERV */
145     IF (.TRUE.) THEN
146     #endif /* EXACT_CONSERV */
147    
148     C-- EmPmR does not really affect the water column height (for tracer budget)
149     C and is converted to a salt tendency.
150    
151     IF (convertFW2Salt .EQ. -1.) THEN
152     C- use local surface tracer field to calculate forcing term:
153    
154     DO iTrc=1,PTRACERS_numInUse
155    
156 jmc 1.11 IF ( PTRACERS_StepFwd(iTrc) .AND.
157     & PTRACERS_EvPrRn(iTrc).NE.UNSET_RL ) THEN
158 jmc 1.9 C account for Rain/Evap tracer content (PTRACERS_EvPrRn) using
159 dfer 1.7 C local surface tracer
160     DO j = jMin, jMax
161     DO i = iMin, iMax
162 jmc 1.9 surfaceForcingPTr(i,j,bi,bj,iTrc) =
163     & surfaceForcingPTr(i,j,bi,bj,iTrc)
164 jmc 1.10 & + ( EmPmR(i,j,bi,bj) + add2EmP(i,j) )
165 jmc 1.9 & *( pTracer(i,j,ks,bi,bj,iTrc) - PTRACERS_EvPrRn(iTrc) )
166 mlosch 1.8 & *mass2rUnit
167 dfer 1.7 ENDDO
168     ENDDO
169     ENDIF
170    
171     ENDDO
172    
173     ELSE
174     C- use uniform tracer value to calculate forcing term:
175    
176     DO iTrc=1,PTRACERS_numInUse
177    
178 jmc 1.11 IF ( PTRACERS_StepFwd(iTrc) .AND.
179     & PTRACERS_EvPrRn(iTrc).NE.UNSET_RL ) THEN
180 jmc 1.9 C account for Rain/Evap tracer content (PTRACERS_EvPrRn) assuming uniform
181 dfer 1.7 C surface tracer (=PTRACERS_ref)
182     DO j = jMin, jMax
183     DO i = iMin, iMax
184 jmc 1.9 surfaceForcingPTr(i,j,bi,bj,iTrc) =
185     & surfaceForcingPTr(i,j,bi,bj,iTrc)
186 jmc 1.10 & + ( EmPmR(i,j,bi,bj) + add2EmP(i,j) )
187 jmc 1.9 & *( PTRACERS_ref(ks,iTrc) - PTRACERS_EvPrRn(iTrc) )
188 dfer 1.7 & *mass2rUnit
189     ENDDO
190     ENDDO
191     ENDIF
192    
193     ENDDO
194    
195     C- end local-surface-tracer / uniform-value distinction
196     ENDIF
197    
198 jmc 1.5 ENDIF
199 dfer 1.7
200     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
201 dimitri 1.1
202     #endif /* ALLOW_PTRACERS */
203    
204     RETURN
205     END

  ViewVC Help
Powered by ViewVC 1.1.22