1 |
#include "CPP_OPTIONS.h" |
C $Header$ |
2 |
#include "PTRACERS_OPTIONS.h" |
C $Name$ |
3 |
|
|
4 |
#include "GCHEM_OPTIONS.h" |
#include "GCHEM_OPTIONS.h" |
5 |
|
#ifdef ALLOW_DIC |
6 |
|
#include "DIC_OPTIONS.h" |
7 |
|
#endif |
8 |
|
#ifdef ALLOW_DARWIN |
9 |
|
#include "DARWIN_OPTIONS.h" |
10 |
|
#endif |
11 |
|
|
12 |
|
|
13 |
|
CBOP |
14 |
|
C !ROUTINE: GCHEM_FORCING_SEP |
15 |
C !INTERFACE: ========================================================== |
C !INTERFACE: ========================================================== |
16 |
SUBROUTINE GCHEM_FORCING_SEP(myTime,myIter, myThid ) |
SUBROUTINE GCHEM_FORCING_SEP(myTime,myIter, myThid ) |
17 |
|
|
18 |
|
C !DESCRIPTION: |
19 |
|
C calls subroutine that will update passive tracers values |
20 |
|
C with a separate timestep. Since GCHEM_FORCING_SEP is now |
21 |
|
C called before DO_FIELDS_BLOCKING_EXCHANGES, the passive |
22 |
|
C tracer values in the halo regions are not up to date and |
23 |
|
C must not be used. |
24 |
|
|
25 |
|
C !USES: =============================================================== |
26 |
IMPLICIT NONE |
IMPLICIT NONE |
27 |
#include "SIZE.h" |
#include "SIZE.h" |
28 |
#include "GRID.h" |
#include "GRID.h" |
29 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
30 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
31 |
#include "PARAMS.h" |
#include "PARAMS.h" |
32 |
#ifdef ALLOW_PTRACERS |
#include "PTRACERS_SIZE.h" |
33 |
#include "PTRACERS.h" |
#include "PTRACERS_FIELDS.h" |
34 |
#endif |
#include "GCHEM.h" |
35 |
#ifdef DIC_BIOTIC |
#ifdef ALLOW_DIC |
36 |
#include "DIC_BIOTIC.h" |
#include "DIC_VARS.h" |
37 |
#include "DIC_ABIOTIC.h" |
#endif /* ALLOW_DIC */ |
38 |
|
#ifdef ALLOW_DARWIN |
39 |
|
#include "DARWIN_FLUX.h" |
40 |
|
#include "DARWIN_SIZE.h" |
41 |
#endif |
#endif |
42 |
|
|
43 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
44 |
C myThid :: thread number |
C myThid :: thread number |
45 |
INTEGER myThid, myIter |
INTEGER myThid, myIter |
46 |
_RL myTime |
_RL myTime |
47 |
|
|
48 |
|
c!LOCAL VARIABLES: ==================================================== |
49 |
|
C i,j :: loop indices |
50 |
|
C bi,bj :: tile indices |
51 |
|
C k :: vertical level |
52 |
INTEGER bi,bj,imin,imax,jmin,jmax |
INTEGER bi,bj,imin,imax,jmin,jmax |
53 |
INTEGER i,j |
INTEGER i,j |
54 |
INTEGER niter |
INTEGER niter |
55 |
|
CEOP |
56 |
|
|
|
#ifdef ALLOW_PTRACERS |
|
57 |
#ifdef ALLOW_GCHEM |
#ifdef ALLOW_GCHEM |
58 |
|
#ifdef GCHEM_SEPARATE_FORCING |
|
_BARRIER |
|
|
_BEGIN_MASTER( mythid ) |
|
59 |
|
|
60 |
ccccccccccccccccccccccccc |
ccccccccccccccccccccccccc |
61 |
c global calculations c |
c global calculations c |
62 |
ccccccccccccccccccccccccc |
ccccccccccccccccccccccccc |
63 |
#ifdef DIC_BIOTIC |
#ifdef ALLOW_OLD_VIRTUALFLUX |
64 |
|
#ifdef ALLOW_DIC |
65 |
c find global surface averages |
c find global surface averages |
66 |
call tracer_meanarea(myThid,salt, 1,gsm_s) |
gsm_s = 0. _d 0 |
67 |
call tracer_meanarea(myThid, |
gsm_dic = 0. _d 0 |
68 |
& ptracer(1-Olx,1-Oly,1,1,1,1), 1, gsm_dic) |
gsm_alk = 0. _d 0 |
69 |
|
call tracer_meanarea(salt, 1,gsm_s,myThid) |
70 |
|
call tracer_meanarea( |
71 |
|
& ptracer(1-Olx,1-Oly,1,1,1,1), 1, gsm_dic, myThid ) |
72 |
print*,'mean surface dic', gsm_dic,gsm_s |
print*,'mean surface dic', gsm_dic,gsm_s |
73 |
call tracer_meanarea(myThid, |
call tracer_meanarea( |
74 |
& ptracer(1-Olx,1-Oly,1,1,1,2), 1, gsm_alk) |
& ptracer(1-Olx,1-Oly,1,1,1,2), 1, gsm_alk, myThid ) |
75 |
|
#endif |
76 |
|
#ifdef ALLOW_DARWIN |
77 |
|
c find global surface averages |
78 |
|
gsm_s = 0. _d 0 |
79 |
|
gsm_dic = 0. _d 0 |
80 |
|
gsm_alk = 0. _d 0 |
81 |
|
call tracer_meanarea(salt, 1,gsm_s,myThid) |
82 |
|
call tracer_meanarea( |
83 |
|
& ptracer(1-Olx,1-Oly,1,1,1,iDIC), 1, gsm_dic, myThid ) |
84 |
|
print*,'mean surface dic', gsm_dic,gsm_s |
85 |
|
call tracer_meanarea( |
86 |
|
& ptracer(1-Olx,1-Oly,1,1,1,iALK), 1, gsm_alk, myThid ) |
87 |
#endif |
#endif |
88 |
|
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
89 |
ccccccccccccccccccccccccccccccccccccccccccc |
ccccccccccccccccccccccccccccccccccccccccccc |
90 |
|
|
|
_END_MASTER( mythid ) |
|
|
_BARRIER |
|
|
|
|
91 |
|
|
92 |
ccccccccccccccccccccccccc |
ccccccccccccccccccccccccc |
93 |
c chemical forcing c |
c chemical forcing c |
94 |
ccccccccccccccccccccccccc |
ccccccccccccccccccccccccc |
95 |
C$TAF loop = parallel |
C$taf loop = parallel |
96 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
97 |
C$TAF loop = parallel |
C$taf loop = parallel |
98 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |
99 |
|
|
100 |
jMin=1-OLy |
jMin=1 |
101 |
jMax=sNy+OLy |
jMax=sNy |
102 |
iMin=1-OLx |
iMin=1 |
103 |
iMax=sNx+OLx |
iMax=sNx |
104 |
c |
c |
105 |
ccccccccccccccccccccccccccc DIC cccccccccccccccccccccccccccccccc |
ccccccccccccccccccccccccccc DIC cccccccccccccccccccccccccccccccc |
106 |
c |
|
107 |
#ifdef DIC_BIOTIC |
#ifdef ALLOW_DIC |
108 |
#ifdef ALLOW_FE |
#ifdef ALLOW_FE |
109 |
call DIC_BIOTIC_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
call DIC_BIOTIC_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
110 |
& Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
& Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
115 |
& bi,bj,imin,imax,jmin,jmax, |
& bi,bj,imin,imax,jmin,jmax, |
116 |
& myIter,myTime,myThid) |
& myIter,myTime,myThid) |
117 |
#else |
#else |
118 |
|
#ifdef ALLOW_O2 |
119 |
call DIC_BIOTIC_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
call DIC_BIOTIC_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
120 |
& Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
& Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
121 |
& Ptracer(1-Olx,1-Oly,1,bi,bj,3), |
& Ptracer(1-Olx,1-Oly,1,bi,bj,3), |
123 |
& Ptracer(1-Olx,1-Oly,1,bi,bj,5), |
& Ptracer(1-Olx,1-Oly,1,bi,bj,5), |
124 |
& bi,bj,imin,imax,jmin,jmax, |
& bi,bj,imin,imax,jmin,jmax, |
125 |
& myIter,myTime,myThid) |
& myIter,myTime,myThid) |
126 |
|
#else |
127 |
|
call DIC_BIOTIC_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
128 |
|
& Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
129 |
|
& Ptracer(1-Olx,1-Oly,1,bi,bj,3), |
130 |
|
& Ptracer(1-Olx,1-Oly,1,bi,bj,4), |
131 |
|
& bi,bj,imin,imax,jmin,jmax, |
132 |
|
& myIter,myTime,myThid) |
133 |
#endif |
#endif |
134 |
#endif |
#endif |
|
cccccccccccccccccccccccccc END DIC cccccccccccccccccccccccccccccccccc |
|
135 |
|
|
136 |
#ifdef PTRACERS_SEPARATE_FORCING |
#endif |
137 |
C time averaging directly, here otherwise in the_correction_step |
cccccccccccccccccccccccccc END DIC cccccccccccccccccccccccccccccccccc |
138 |
CALL PTRACERS_STATVARS(myTime, myIter, bi, bj, myThid) |
#ifdef ALLOW_DARWIN |
139 |
#endif /* PTRACERS_SEPARATE_FORCING */ |
IF ( useDARWIN ) THEN |
140 |
|
#ifdef NUT_SUPPLY |
141 |
|
c articficial supply of nutrients |
142 |
|
call DARWIN_Nut_Supply( Ptracer(1-Olx,1-Oly,1,bi,bj,1), |
143 |
|
& bi,bj,imin,imax,jmin,jmax, |
144 |
|
& myIter,myTime,myThid) |
145 |
|
call DARWIN_Nut_Supply( Ptracer(1-Olx,1-Oly,1,bi,bj,2), |
146 |
|
& bi,bj,imin,imax,jmin,jmax, |
147 |
|
& myIter,myTime,myThid) |
148 |
|
call DARWIN_Nut_Supply( Ptracer(1-Olx,1-Oly,1,bi,bj,3), |
149 |
|
& bi,bj,imin,imax,jmin,jmax, |
150 |
|
& myIter,myTime,myThid) |
151 |
|
call DARWIN_Nut_Supply( Ptracer(1-Olx,1-Oly,1,bi,bj,4), |
152 |
|
& bi,bj,imin,imax,jmin,jmax, |
153 |
|
& myIter,myTime,myThid) |
154 |
|
#endif |
155 |
|
ccccccccccccccc |
156 |
|
call DARWIN_cons(myIter,myTime,myThid) |
157 |
|
C darwin_forcing operates on bi,bj part only, but needs to get full |
158 |
|
C array because of last (iPtr) index |
159 |
|
call DARWIN_Forcing( Ptracer(1-Olx,1-Oly,1,1,1,1), |
160 |
|
& bi,bj,imin,imax,jmin,jmax, |
161 |
|
& myIter,myTime,myThid) |
162 |
|
call DARWIN_cons(myIter,myTime,myThid) |
163 |
|
#ifdef ALLOW_CARBON |
164 |
|
CALL DIC_ATMOS( 1, myTime, myIter, myThid ) |
165 |
|
#endif |
166 |
|
ENDIF |
167 |
|
#endif |
168 |
|
|
|
c |
|
169 |
ENDDO |
ENDDO |
170 |
ENDDO |
ENDDO |
171 |
|
|
172 |
|
#ifdef ALLOW_DIC |
173 |
|
CALL DIC_ATMOS( 1, myTime, myIter, myThid ) |
174 |
|
CALL DIC_STORE_FLUXCO2( myTime, myIter, myThid ) |
175 |
|
#endif |
176 |
|
|
177 |
|
#ifdef ALLOW_COST |
178 |
|
CALL DIC_COST( myTime, myIter, myThid ) |
179 |
|
#endif |
180 |
|
|
181 |
|
#endif /* GCHEM_SEPARATE_FORCING */ |
182 |
#endif /* ALLOW_GCHEM */ |
#endif /* ALLOW_GCHEM */ |
|
#endif /* ALLOW_PTRACERS */ |
|
183 |
|
|
184 |
RETURN |
RETURN |
185 |
END |
END |