1 |
edhill |
1.3 |
#include "DIC_OPTIONS.h" |
2 |
stephd |
1.1 |
#include "GCHEM_OPTIONS.h" |
3 |
|
|
|
4 |
stephd |
1.5 |
CBOP |
5 |
|
|
C !ROUTINE: BIO_EXPORT |
6 |
|
|
|
7 |
|
|
C !INTERFACE: ========================================================== |
8 |
stephd |
1.1 |
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 |
stephd |
1.5 |
c !DESCRIPTION: |
17 |
|
|
C Calculate biological activity and export |
18 |
|
|
|
19 |
|
|
C !USES: =============================================================== |
20 |
stephd |
1.1 |
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 |
stephd |
1.12 |
#ifdef USE_QSW |
29 |
stephd |
1.11 |
#include "FFIELDS.h" |
30 |
|
|
#endif |
31 |
stephd |
1.1 |
|
32 |
stephd |
1.5 |
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 |
stephd |
1.1 |
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 |
stephd |
1.5 |
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 |
stephd |
1.1 |
_RL bioac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR) |
52 |
|
|
|
53 |
|
|
#ifdef ALLOW_PTRACERS |
54 |
|
|
#ifdef DIC_BIOTIC |
55 |
stephd |
1.5 |
|
56 |
|
|
C !LOCAL VARIABLES: ==================================================== |
57 |
|
|
C i,j,k :: loop indices |
58 |
stephd |
1.1 |
INTEGER I,J,k |
59 |
stephd |
1.5 |
_RL sfac(1-OLy:sNy+OLy) |
60 |
|
|
_RL lit, atten |
61 |
stephd |
1.10 |
_RL nutlimit |
62 |
|
|
#ifdef AD_SAFE |
63 |
|
|
_RL thx, thy, theps |
64 |
|
|
#endif |
65 |
stephd |
1.5 |
CEOP |
66 |
stephd |
1.10 |
|
67 |
|
|
|
68 |
stephd |
1.8 |
#ifndef READ_PAR |
69 |
stephd |
1.12 |
#ifndef USE_QSW |
70 |
stephd |
1.1 |
call insol(myTime,sfac,bj) |
71 |
stephd |
1.8 |
#endif |
72 |
stephd |
1.11 |
#endif |
73 |
stephd |
1.9 |
DO j=jmin,jmax |
74 |
|
|
DO i=imin,imax |
75 |
stephd |
1.2 |
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 |
stephd |
1.8 |
#ifdef READ_PAR |
82 |
|
|
lit=PAR(i,j,bi,bj) |
83 |
|
|
#else |
84 |
stephd |
1.12 |
#ifdef USE_QSW |
85 |
stephd |
1.13 |
lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj) |
86 |
stephd |
1.11 |
#else |
87 |
stephd |
1.1 |
lit=sfac(j) |
88 |
stephd |
1.8 |
#endif |
89 |
stephd |
1.11 |
#endif |
90 |
stephd |
1.1 |
DO k=1,nlev |
91 |
stephd |
1.2 |
C$TAF STORE lit = bio_export |
92 |
stephd |
1.7 |
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 |
stephd |
1.1 |
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 |
stephd |
1.10 |
|
100 |
stephd |
1.1 |
#ifdef ALLOW_FE |
101 |
stephd |
1.10 |
#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 |
stephd |
1.5 |
#else |
108 |
stephd |
1.10 |
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 |
stephd |
1.1 |
#endif |
111 |
stephd |
1.10 |
#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 |
stephd |
1.1 |
ENDDO |
119 |
|
|
ENDDO |
120 |
|
|
ENDDO |
121 |
|
|
c |
122 |
|
|
#endif |
123 |
|
|
#endif |
124 |
|
|
RETURN |
125 |
|
|
END |