/[MITgcm]/MITgcm/pkg/dic/bio_export.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/bio_export.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Sun Aug 26 23:05:48 2007 UTC (16 years, 9 months ago) by dfer
Branch: MAIN
CVS Tags: checkpoint59g, checkpoint59h
Changes since 1.13: +2 -1 lines
bug: move the (1-fice) factor out of the k-loop

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 lit=lit*(1. _d 0 - FIce(i,j,bi,bj))
91 DO k=1,nlev
92 C$TAF STORE lit = bio_export
93 atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5)
94 if (k.gt.1) atten=atten+(k0*drF(k-1)
95 & *hFacC(i,j,k-1,bi,bj)*.5)
96 lit=lit*exp(-atten)
97 if (lit.lt.0.d0.or.lit.gt.150) then
98 print*,'QQ lit', lit
99 endif
100
101 #ifdef ALLOW_FE
102 #ifdef AD_SAFE
103 thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
104 thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE)
105 theps = 1.d-6
106 nutlimit= ( 1.d0 - tanh((thx-thy)/theps) ) * thx/2 +
107 & ( 1.d0 + tanh((thx-thy)/theps) ) * thy/2
108 #else
109 nutlimit= min(PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4),
110 & PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) )
111 #endif
112 #else
113 nutlimit= PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
114 #endif
115
116 bioac(i,j,k)=alpha(i,j,bi,bj)*
117 & lit/(lit+lit0)*maskC(i,j,k,bi,bj)*
118 & nutlimit
119 ENDDO
120 ENDDO
121 ENDDO
122 c
123 #endif
124 #endif
125 RETURN
126 END

  ViewVC Help
Powered by ViewVC 1.1.22