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

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

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


Revision 1.16 - (hide annotations) (download)
Mon Oct 15 16:02:58 2007 UTC (16 years, 8 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint59i
Changes since 1.15: +2 -2 lines
o change check for Qsw too high, to be consistent with daily varying
  shortwave radiation (rather than 24hr averaged)

1 stephd 1.16 C $Header: /u/gcmpack/MITgcm/pkg/dic/bio_export.F,v 1.15 2007/10/09 00:01:42 jmc Exp $
2 jmc 1.15 C $Name: $
3    
4 edhill 1.3 #include "DIC_OPTIONS.h"
5 stephd 1.1 #include "GCHEM_OPTIONS.h"
6    
7 stephd 1.5 CBOP
8     C !ROUTINE: BIO_EXPORT
9    
10     C !INTERFACE: ==========================================================
11 jmc 1.15 SUBROUTINE BIO_EXPORT( PTR_PO4 ,
12 stephd 1.1 #ifdef ALLOW_FE
13 jmc 1.15 I PTR_FE,
14     #endif
15 stephd 1.1 I bioac,
16     I bi,bj,imin,imax,jmin,jmax,
17     I myIter,myTime,myThid)
18    
19 stephd 1.5 c !DESCRIPTION:
20 jmc 1.15 C Calculate biological activity and export
21 stephd 1.5
22     C !USES: ===============================================================
23 stephd 1.1 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 stephd 1.12 #ifdef USE_QSW
32 stephd 1.11 #include "FFIELDS.h"
33     #endif
34 stephd 1.1
35 stephd 1.5 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 stephd 1.1 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 stephd 1.5 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 stephd 1.1 _RL bioac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR)
55    
56     #ifdef ALLOW_PTRACERS
57     #ifdef DIC_BIOTIC
58 stephd 1.5
59     C !LOCAL VARIABLES: ====================================================
60     C i,j,k :: loop indices
61 stephd 1.1 INTEGER I,J,k
62 stephd 1.5 _RL sfac(1-OLy:sNy+OLy)
63     _RL lit, atten
64 stephd 1.10 _RL nutlimit
65     #ifdef AD_SAFE
66     _RL thx, thy, theps
67     #endif
68 stephd 1.5 CEOP
69 stephd 1.10
70    
71 stephd 1.8 #ifndef READ_PAR
72 stephd 1.12 #ifndef USE_QSW
73 stephd 1.1 call insol(myTime,sfac,bj)
74 stephd 1.8 #endif
75 stephd 1.11 #endif
76 stephd 1.9 DO j=jmin,jmax
77     DO i=imin,imax
78 stephd 1.2 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 stephd 1.8 #ifdef READ_PAR
85     lit=PAR(i,j,bi,bj)
86     #else
87 stephd 1.12 #ifdef USE_QSW
88 stephd 1.13 lit=-parfrac*Qsw(i,j,bi,bj)*maskC(i,j,1,bi,bj)
89 stephd 1.11 #else
90 stephd 1.1 lit=sfac(j)
91 stephd 1.8 #endif
92 stephd 1.11 #endif
93 dfer 1.14 lit=lit*(1. _d 0 - FIce(i,j,bi,bj))
94 stephd 1.1 DO k=1,nlev
95 stephd 1.2 C$TAF STORE lit = bio_export
96 stephd 1.7 atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5)
97     if (k.gt.1) atten=atten+(k0*drF(k-1)
98     & *hFacC(i,j,k-1,bi,bj)*.5)
99 dfer 1.14 lit=lit*exp(-atten)
100 stephd 1.16 if (lit.lt.0.d0.or.lit.gt.350) then
101 stephd 1.1 print*,'QQ lit', lit
102     endif
103 stephd 1.10
104 stephd 1.1 #ifdef ALLOW_FE
105 stephd 1.10 #ifdef AD_SAFE
106     thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
107     thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE)
108     theps = 1.d-6
109 jmc 1.15 nutlimit= ( 1.d0 - tanh((thx-thy)/theps) ) * thx/2 +
110 stephd 1.10 & ( 1.d0 + tanh((thx-thy)/theps) ) * thy/2
111 stephd 1.5 #else
112 stephd 1.10 nutlimit= min(PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4),
113     & PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) )
114 stephd 1.1 #endif
115 stephd 1.10 #else
116     nutlimit= PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
117     #endif
118    
119     bioac(i,j,k)=alpha(i,j,bi,bj)*
120     & lit/(lit+lit0)*maskC(i,j,k,bi,bj)*
121     & nutlimit
122 stephd 1.1 ENDDO
123     ENDDO
124     ENDDO
125     c
126     #endif
127     #endif
128     RETURN
129     END

  ViewVC Help
Powered by ViewVC 1.1.22