1 |
jmc |
1.24 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/bio_export.F,v 1.23 2008/04/07 20:31:16 dfer Exp $ |
2 |
jmc |
1.15 |
C $Name: $ |
3 |
|
|
|
4 |
edhill |
1.3 |
#include "DIC_OPTIONS.h" |
5 |
stephd |
1.1 |
|
6 |
stephd |
1.5 |
CBOP |
7 |
|
|
C !ROUTINE: BIO_EXPORT |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
jmc |
1.15 |
SUBROUTINE BIO_EXPORT( PTR_PO4 , |
11 |
stephd |
1.1 |
#ifdef ALLOW_FE |
12 |
jmc |
1.15 |
I PTR_FE, |
13 |
|
|
#endif |
14 |
stephd |
1.1 |
I bioac, |
15 |
|
|
I bi,bj,imin,imax,jmin,jmax, |
16 |
|
|
I myIter,myTime,myThid) |
17 |
|
|
|
18 |
stephd |
1.5 |
c !DESCRIPTION: |
19 |
jmc |
1.15 |
C Calculate biological activity and export |
20 |
stephd |
1.5 |
|
21 |
|
|
C !USES: =============================================================== |
22 |
stephd |
1.1 |
IMPLICIT NONE |
23 |
|
|
#include "SIZE.h" |
24 |
|
|
#include "DYNVARS.h" |
25 |
|
|
#include "EEPARAMS.h" |
26 |
|
|
#include "PARAMS.h" |
27 |
|
|
#include "GRID.h" |
28 |
dfer |
1.22 |
#include "DIC_VARS.h" |
29 |
stephd |
1.12 |
#ifdef USE_QSW |
30 |
stephd |
1.11 |
#include "FFIELDS.h" |
31 |
|
|
#endif |
32 |
stephd |
1.1 |
|
33 |
stephd |
1.5 |
C !INPUT PARAMETERS: =================================================== |
34 |
|
|
C myThid :: thread number |
35 |
|
|
C myIter :: current timestep |
36 |
|
|
C myTime :: current time |
37 |
|
|
C PTR_PO4 :: phosphate tracer field |
38 |
|
|
C PTR_FE :: iron tracer field |
39 |
stephd |
1.1 |
INTEGER myIter |
40 |
|
|
_RL myTime |
41 |
|
|
INTEGER myThid |
42 |
|
|
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
43 |
|
|
#ifdef ALLOW_FE |
44 |
|
|
_RL PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
45 |
|
|
#endif |
46 |
stephd |
1.5 |
INTEGER imin, imax, jmin, jmax, bi, bj |
47 |
|
|
|
48 |
|
|
|
49 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
50 |
|
|
C bioac :: biological productivity (will be split |
51 |
|
|
C between export and dissolved pool) |
52 |
stephd |
1.1 |
_RL bioac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR) |
53 |
|
|
|
54 |
|
|
#ifdef ALLOW_PTRACERS |
55 |
|
|
#ifdef DIC_BIOTIC |
56 |
stephd |
1.5 |
|
57 |
|
|
C !LOCAL VARIABLES: ==================================================== |
58 |
|
|
C i,j,k :: loop indices |
59 |
stephd |
1.1 |
INTEGER I,J,k |
60 |
stephd |
1.5 |
_RL sfac(1-OLy:sNy+OLy) |
61 |
|
|
_RL lit, atten |
62 |
stephd |
1.10 |
_RL nutlimit |
63 |
stephd |
1.21 |
_RL tmpfe, tmppo4 |
64 |
stephd |
1.10 |
#ifdef AD_SAFE |
65 |
|
|
_RL thx, thy, theps |
66 |
|
|
#endif |
67 |
stephd |
1.5 |
CEOP |
68 |
stephd |
1.10 |
|
69 |
|
|
|
70 |
stephd |
1.8 |
#ifndef READ_PAR |
71 |
stephd |
1.12 |
#ifndef USE_QSW |
72 |
jmc |
1.24 |
CALL INSOL(myTime,sfac,bi,bj,myThid) |
73 |
stephd |
1.8 |
#endif |
74 |
stephd |
1.11 |
#endif |
75 |
stephd |
1.9 |
DO j=jmin,jmax |
76 |
|
|
DO i=imin,imax |
77 |
stephd |
1.2 |
C Fortran-90 |
78 |
|
|
CRG C$TAF INIT bio_export = static, nlev |
79 |
|
|
C FORTRAN-77 dynamic memory uses adstore adresto |
80 |
|
|
CRG C$TAF INIT bio_export = memory |
81 |
|
|
C FORTRAN-77 with know max of nlev |
82 |
|
|
C$TAF INIT bio_export = static, 10 |
83 |
stephd |
1.8 |
#ifdef READ_PAR |
84 |
|
|
lit=PAR(i,j,bi,bj) |
85 |
dfer |
1.20 |
#elif (defined USE_QSW) |
86 |
stephd |
1.13 |
lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj) |
87 |
stephd |
1.11 |
#else |
88 |
stephd |
1.1 |
lit=sfac(j) |
89 |
stephd |
1.8 |
#endif |
90 |
stephd |
1.18 |
|
91 |
dfer |
1.20 |
IF ( .NOT. QSW_underice ) THEN |
92 |
|
|
c if using Qsw but not seaice/thsice or coupled, then |
93 |
|
|
c ice fraction needs to be taken into account |
94 |
stephd |
1.19 |
lit=lit*(1. _d 0 - FIce(i,j,bi,bj)) |
95 |
dfer |
1.20 |
ENDIF |
96 |
stephd |
1.19 |
c |
97 |
stephd |
1.1 |
DO k=1,nlev |
98 |
stephd |
1.2 |
C$TAF STORE lit = bio_export |
99 |
dfer |
1.17 |
atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5 _d 0) |
100 |
stephd |
1.7 |
if (k.gt.1) atten=atten+(k0*drF(k-1) |
101 |
dfer |
1.17 |
& *hFacC(i,j,k-1,bi,bj)*.5 _d 0) |
102 |
dfer |
1.14 |
lit=lit*exp(-atten) |
103 |
dfer |
1.17 |
IF (lit.LT.0. _d 0.OR.lit.GT.350. _d 0) THEN |
104 |
stephd |
1.1 |
print*,'QQ lit', lit |
105 |
dfer |
1.17 |
ENDIF |
106 |
stephd |
1.10 |
|
107 |
stephd |
1.21 |
#ifdef DIC_NO_NEG |
108 |
|
|
tmppo4=max(0. _d 0, PTR_PO4(i,j,k)) |
109 |
|
|
lit=max(0. _d 0,lit) |
110 |
|
|
#else |
111 |
|
|
tmppo4=PTR_PO4(i,j,k) |
112 |
|
|
#endif |
113 |
|
|
|
114 |
stephd |
1.1 |
#ifdef ALLOW_FE |
115 |
stephd |
1.21 |
#ifdef DIC_NO_NEG |
116 |
|
|
tmpfe=max(0. _d 0,PTR_FE(i,j,k)) |
117 |
|
|
#else |
118 |
|
|
tmpfe=PTR_FE(i,j,k) |
119 |
|
|
#endif |
120 |
stephd |
1.10 |
#ifdef AD_SAFE |
121 |
stephd |
1.21 |
thx = tmppo4/(tmppo4+KPO4) |
122 |
|
|
thy = tmpfe/(tmpfe+KFE) |
123 |
|
|
c thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
124 |
|
|
c thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) |
125 |
dfer |
1.17 |
theps = 1. _d -6 |
126 |
|
|
nutlimit= ( 1. _d 0 - tanh((thx-thy)/theps) ) * thx/2. _d 0 |
127 |
|
|
& +( 1. _d 0 + tanh((thx-thy)/theps) ) * thy/2. _d 0 |
128 |
stephd |
1.5 |
#else |
129 |
stephd |
1.21 |
nutlimit= min(tmppo4/(tmppo4+KPO4), |
130 |
|
|
& tmpfe/(tmpfe+KFE) ) |
131 |
stephd |
1.1 |
#endif |
132 |
stephd |
1.10 |
#else |
133 |
stephd |
1.21 |
nutlimit= tmppo4/(tmppo4+KPO4) |
134 |
stephd |
1.10 |
#endif |
135 |
|
|
|
136 |
|
|
bioac(i,j,k)=alpha(i,j,bi,bj)* |
137 |
|
|
& lit/(lit+lit0)*maskC(i,j,k,bi,bj)* |
138 |
|
|
& nutlimit |
139 |
stephd |
1.1 |
ENDDO |
140 |
|
|
ENDDO |
141 |
|
|
ENDDO |
142 |
|
|
c |
143 |
|
|
#endif |
144 |
|
|
#endif |
145 |
|
|
RETURN |
146 |
|
|
END |