62 |
_RL sfac(1-OLy:sNy+OLy) |
_RL sfac(1-OLy:sNy+OLy) |
63 |
_RL lit, atten |
_RL lit, atten |
64 |
_RL nutlimit |
_RL nutlimit |
65 |
|
_RL tmpfe, tmppo4 |
66 |
#ifdef AD_SAFE |
#ifdef AD_SAFE |
67 |
_RL thx, thy, theps |
_RL thx, thy, theps |
68 |
#endif |
#endif |
84 |
C$TAF INIT bio_export = static, 10 |
C$TAF INIT bio_export = static, 10 |
85 |
#ifdef READ_PAR |
#ifdef READ_PAR |
86 |
lit=PAR(i,j,bi,bj) |
lit=PAR(i,j,bi,bj) |
87 |
#else |
#elif (defined USE_QSW) |
|
#ifdef USE_QSW |
|
88 |
lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj) |
lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj) |
89 |
#else |
#else |
90 |
lit=sfac(j) |
lit=sfac(j) |
91 |
#endif |
#endif |
92 |
#endif |
|
93 |
lit=lit*(1. _d 0 - FIce(i,j,bi,bj)) |
IF ( .NOT. QSW_underice ) THEN |
94 |
|
c if using Qsw but not seaice/thsice or coupled, then |
95 |
|
c ice fraction needs to be taken into account |
96 |
|
lit=lit*(1. _d 0 - FIce(i,j,bi,bj)) |
97 |
|
ENDIF |
98 |
|
c |
99 |
DO k=1,nlev |
DO k=1,nlev |
100 |
C$TAF STORE lit = bio_export |
C$TAF STORE lit = bio_export |
101 |
atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5) |
atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5 _d 0) |
102 |
if (k.gt.1) atten=atten+(k0*drF(k-1) |
if (k.gt.1) atten=atten+(k0*drF(k-1) |
103 |
& *hFacC(i,j,k-1,bi,bj)*.5) |
& *hFacC(i,j,k-1,bi,bj)*.5 _d 0) |
104 |
lit=lit*exp(-atten) |
lit=lit*exp(-atten) |
105 |
if (lit.lt.0.d0.or.lit.gt.150) then |
IF (lit.LT.0. _d 0.OR.lit.GT.350. _d 0) THEN |
106 |
print*,'QQ lit', lit |
print*,'QQ lit', lit |
107 |
endif |
ENDIF |
108 |
|
|
109 |
|
#ifdef DIC_NO_NEG |
110 |
|
tmppo4=max(0. _d 0, PTR_PO4(i,j,k)) |
111 |
|
lit=max(0. _d 0,lit) |
112 |
|
#else |
113 |
|
tmppo4=PTR_PO4(i,j,k) |
114 |
|
#endif |
115 |
|
|
116 |
#ifdef ALLOW_FE |
#ifdef ALLOW_FE |
117 |
|
#ifdef DIC_NO_NEG |
118 |
|
tmpfe=max(0. _d 0,PTR_FE(i,j,k)) |
119 |
|
#else |
120 |
|
tmpfe=PTR_FE(i,j,k) |
121 |
|
#endif |
122 |
#ifdef AD_SAFE |
#ifdef AD_SAFE |
123 |
thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
thx = tmppo4/(tmppo4+KPO4) |
124 |
thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) |
thy = tmpfe/(tmpfe+KFE) |
125 |
theps = 1.d-6 |
c thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
126 |
nutlimit= ( 1.d0 - tanh((thx-thy)/theps) ) * thx/2 + |
c thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) |
127 |
& ( 1.d0 + tanh((thx-thy)/theps) ) * thy/2 |
theps = 1. _d -6 |
128 |
|
nutlimit= ( 1. _d 0 - tanh((thx-thy)/theps) ) * thx/2. _d 0 |
129 |
|
& +( 1. _d 0 + tanh((thx-thy)/theps) ) * thy/2. _d 0 |
130 |
#else |
#else |
131 |
nutlimit= min(PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4), |
nutlimit= min(tmppo4/(tmppo4+KPO4), |
132 |
& PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) ) |
& tmpfe/(tmpfe+KFE) ) |
133 |
#endif |
#endif |
134 |
#else |
#else |
135 |
nutlimit= PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4) |
nutlimit= tmppo4/(tmppo4+KPO4) |
136 |
#endif |
#endif |
137 |
|
|
138 |
bioac(i,j,k)=alpha(i,j,bi,bj)* |
bioac(i,j,k)=alpha(i,j,bi,bj)* |