1 |
#include "DIC_OPTIONS.h" |
2 |
#include "GCHEM_OPTIONS.h" |
3 |
|
4 |
CBOP |
5 |
C !ROUTINE: BIO_EXPORT |
6 |
|
7 |
C !INTERFACE: ========================================================== |
8 |
SUBROUTINE BIO_EXPORT( PTR_PO4 , |
9 |
#ifdef ALLOW_FE |
10 |
I PTR_FE, |
11 |
#endif |
12 |
I bioac, |
13 |
I bi,bj,imin,imax,jmin,jmax, |
14 |
I myIter,myTime,myThid) |
15 |
|
16 |
c !DESCRIPTION: |
17 |
C Calculate biological activity and export |
18 |
|
19 |
C !USES: =============================================================== |
20 |
IMPLICIT NONE |
21 |
#include "SIZE.h" |
22 |
#include "DYNVARS.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "GRID.h" |
26 |
#include "DIC_ABIOTIC.h" |
27 |
#include "DIC_BIOTIC.h" |
28 |
#ifdef USE_QSW |
29 |
#include "FFIELDS.h" |
30 |
#endif |
31 |
|
32 |
C !INPUT PARAMETERS: =================================================== |
33 |
C myThid :: thread number |
34 |
C myIter :: current timestep |
35 |
C myTime :: current time |
36 |
C PTR_PO4 :: phosphate tracer field |
37 |
C PTR_FE :: iron tracer field |
38 |
INTEGER myIter |
39 |
_RL myTime |
40 |
INTEGER myThid |
41 |
_RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
42 |
#ifdef ALLOW_FE |
43 |
_RL PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
44 |
#endif |
45 |
INTEGER imin, imax, jmin, jmax, bi, bj |
46 |
|
47 |
|
48 |
C !OUTPUT PARAMETERS: ================================================== |
49 |
C bioac :: biological productivity (will be split |
50 |
C between export and dissolved pool) |
51 |
_RL bioac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR) |
52 |
|
53 |
#ifdef ALLOW_PTRACERS |
54 |
#ifdef DIC_BIOTIC |
55 |
|
56 |
C !LOCAL VARIABLES: ==================================================== |
57 |
C i,j,k :: loop indices |
58 |
INTEGER I,J,k |
59 |
_RL sfac(1-OLy:sNy+OLy) |
60 |
_RL lit, atten |
61 |
_RL nutlimit |
62 |
#ifdef AD_SAFE |
63 |
_RL thx, thy, theps |
64 |
#endif |
65 |
CEOP |
66 |
|
67 |
|
68 |
#ifndef READ_PAR |
69 |
#ifndef USE_QSW |
70 |
call insol(myTime,sfac,bj) |
71 |
#endif |
72 |
#endif |
73 |
DO j=jmin,jmax |
74 |
DO i=imin,imax |
75 |
C Fortran-90 |
76 |
CRG C$TAF INIT bio_export = static, nlev |
77 |
C FORTRAN-77 dynamic memory uses adstore adresto |
78 |
CRG C$TAF INIT bio_export = memory |
79 |
C FORTRAN-77 with know max of nlev |
80 |
C$TAF INIT bio_export = static, 10 |
81 |
#ifdef READ_PAR |
82 |
lit=PAR(i,j,bi,bj) |
83 |
#else |
84 |
#ifdef USE_QSW |
85 |
lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj) |
86 |
#else |
87 |
lit=sfac(j) |
88 |
#endif |
89 |
#endif |
90 |
DO k=1,nlev |
91 |
C$TAF STORE lit = bio_export |
92 |
atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5) |
93 |
if (k.gt.1) atten=atten+(k0*drF(k-1) |
94 |
& *hFacC(i,j,k-1,bi,bj)*.5) |
95 |
lit=lit*exp(-atten)*(1.d0-Fice(i,j,bi,bj)) |
96 |
if (lit.lt.0.d0.or.lit.gt.150) then |
97 |
print*,'QQ lit', lit |
98 |
endif |
99 |
|
100 |
#ifdef ALLOW_FE |
101 |
#ifdef AD_SAFE |
102 |
thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
103 |
thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) |
104 |
theps = 1.d-6 |
105 |
nutlimit= ( 1.d0 - tanh((thx-thy)/theps) ) * thx/2 + |
106 |
& ( 1.d0 + tanh((thx-thy)/theps) ) * thy/2 |
107 |
#else |
108 |
nutlimit= min(PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4), |
109 |
& PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) ) |
110 |
#endif |
111 |
#else |
112 |
nutlimit= PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
113 |
#endif |
114 |
|
115 |
bioac(i,j,k)=alpha(i,j,bi,bj)* |
116 |
& lit/(lit+lit0)*maskC(i,j,k,bi,bj)* |
117 |
& nutlimit |
118 |
ENDDO |
119 |
ENDDO |
120 |
ENDDO |
121 |
c |
122 |
#endif |
123 |
#endif |
124 |
RETURN |
125 |
END |