/[MITgcm]/MITgcm/pkg/longstep/longstep_forcing_surf.F
ViewVC logotype

Contents of /MITgcm/pkg/longstep/longstep_forcing_surf.F

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


Revision 1.1 - (show annotations) (download)
Tue Jan 12 23:55:48 2010 UTC (14 years, 10 months ago) by jahn
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, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, 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, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
longstep: fix tracer conservation with rstar/nonlinear free surface

1 C $Header$
2 C $Name$
3
4 #include "LONGSTEP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: LONGSTEP_FORCING_SURF
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE LONGSTEP_FORCING_SURF(
11 I bi, bj, iMin, iMax, jMin, jMax,
12 I myTime,myIter,myThid )
13
14 C !DESCRIPTION:
15 C Precomputes surface forcing term for pkg/ptracers.
16 C Precomputation is needed because of non-local KPP transport term,
17 C routine KPP_TRANSPORT_PTR.
18
19 C !USES: ===============================================================
20 IMPLICIT NONE
21 #include "SIZE.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "GRID.h"
25 #include "SURFACE.h"
26 #include "FFIELDS.h"
27 c #include "DYNVARS.h"
28 #include "PTRACERS_SIZE.h"
29 #include "PTRACERS_PARAMS.h"
30 #include "PTRACERS_FIELDS.h"
31 #include "LONGSTEP.h"
32
33 C !INPUT PARAMETERS: ===================================================
34 C bi,bj :: tile indices
35 C myTime :: model time
36 C myIter :: time-step number
37 C myThid :: thread number
38 INTEGER bi, bj, iMin, iMax, jMin, jMax
39 _RL myTime
40 INTEGER myIter
41 INTEGER myThid
42
43 #ifdef ALLOW_LONGSTEP
44
45 C !LOCAL VARIABLES: ====================================================
46 C i,j :: loop indices
47 C iTrc :: tracer index
48 C ks :: surface level index
49 INTEGER i, j
50 INTEGER iTrc, ks
51 CEOP
52
53 IF ( usingPCoords ) THEN
54 ks = Nr
55 ELSE
56 ks = 1
57 ENDIF
58
59 C Example of how to add forcing at the surface
60 DO iTrc=1,PTRACERS_numInUse
61 DO j = jMin, jMax
62 DO i = iMin, iMax
63 surfaceForcingPTr(i,j,bi,bj,iTrc) =
64 & 0. _d 0
65 c & surfaceForcingS(i,j,bi,bj)
66 ENDDO
67 ENDDO
68 ENDDO
69
70 #ifdef EXACT_CONSERV
71 IF ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
72 & .AND. useRealFreshWaterFlux ) THEN
73
74 DO iTrc=1,PTRACERS_numInUse
75
76 c- NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes
77 c the water column height ; temp., salt, (tracer) flux associated
78 c with this input/output of water is added here to the surface tendency.
79 c
80 c NB: LS_fwflux is PmEpR
81 c
82 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
83 DO j = jMin, jMax
84 DO i = iMin, iMax
85 surfaceForcingPTr(i,j,bi,bj,iTrc) =
86 & surfaceForcingPTr(i,j,bi,bj,iTrc)
87 & + LS_fwFlux(i,j,bi,bj)
88 & *( PTRACERS_EvPrRn(iTrc) - pTracer(i,j,ks,bi,bj,iTrc) )
89 & *mass2rUnit
90 ENDDO
91 ENDDO
92 ENDIF
93
94 ENDDO
95
96 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
97 ELSE
98 #else /* EXACT_CONSERV */
99 IF (.TRUE.) THEN
100 #endif /* EXACT_CONSERV */
101
102 C-- EmPmR does not really affect the water column height (for tracer budget)
103 C and is converted to a salt tendency.
104
105 IF (convertFW2Salt .EQ. -1.) THEN
106 C- use local surface tracer field to calculate forcing term:
107
108 DO iTrc=1,PTRACERS_numInUse
109
110 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
111 C account for Rain/Evap tracer content (PTRACERS_EvPrRn) using
112 C local surface tracer
113 c
114 c NB: LS_fwflux is EmPmR
115
116 DO j = jMin, jMax
117 DO i = iMin, iMax
118 surfaceForcingPTr(i,j,bi,bj,iTrc) =
119 & surfaceForcingPTr(i,j,bi,bj,iTrc)
120 & + LS_fwFlux(i,j,bi,bj)
121 & *( pTracer(i,j,ks,bi,bj,iTrc) - PTRACERS_EvPrRn(iTrc) )
122 & *mass2rUnit
123 ENDDO
124 ENDDO
125 ENDIF
126
127 ENDDO
128
129 ELSE
130 C- use uniform tracer value to calculate forcing term:
131
132 DO iTrc=1,PTRACERS_numInUse
133
134 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
135 C account for Rain/Evap tracer content (PTRACERS_EvPrRn) assuming uniform
136 C surface tracer (=PTRACERS_ref)
137 c
138 c NB: LS_fwflux is EmPmR
139
140 DO j = jMin, jMax
141 DO i = iMin, iMax
142 surfaceForcingPTr(i,j,bi,bj,iTrc) =
143 & surfaceForcingPTr(i,j,bi,bj,iTrc)
144 & + LS_fwFlux(i,j,bi,bj)
145 & *( PTRACERS_ref(ks,iTrc) - PTRACERS_EvPrRn(iTrc) )
146 & *mass2rUnit
147 ENDDO
148 ENDDO
149 ENDIF
150
151 ENDDO
152
153 C- end local-surface-tracer / uniform-value distinction
154 ENDIF
155
156 ENDIF
157
158 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
159
160 #endif /* ALLOW_LONGSTEP */
161
162 RETURN
163 END

  ViewVC Help
Powered by ViewVC 1.1.22