/[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.18 - (show annotations) (download)
Fri Nov 30 17:47:41 2007 UTC (16 years, 6 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint59k
Changes since 1.17: +14 -1 lines
o change Qsw: if using seaice or thsice, ice fraction is already taken
  into account
o clean up seaice/thsice common blocks.

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

  ViewVC Help
Powered by ViewVC 1.1.22