/[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.10 - (show annotations) (download)
Tue Nov 28 21:16:02 2006 UTC (17 years, 7 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58x_post, checkpoint58t_post, checkpoint59a, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.9: +22 -5 lines
o changes to make dic code more adjoint friendly:
      - standardize how tracers are passed from dic_biotic_forcing to
        other subroutines
      - add a tanh function to take the place of min(x,y) in bio_export.F
        and fe_chem.F.

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
29 C !INPUT PARAMETERS: ===================================================
30 C myThid :: thread number
31 C myIter :: current timestep
32 C myTime :: current time
33 C PTR_PO4 :: phosphate tracer field
34 C PTR_FE :: iron tracer field
35 INTEGER myIter
36 _RL myTime
37 INTEGER myThid
38 _RL PTR_PO4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
39 #ifdef ALLOW_FE
40 _RL PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
41 #endif
42 INTEGER imin, imax, jmin, jmax, bi, bj
43
44
45 C !OUTPUT PARAMETERS: ==================================================
46 C bioac :: biological productivity (will be split
47 C between export and dissolved pool)
48 _RL bioac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR)
49
50 #ifdef ALLOW_PTRACERS
51 #ifdef DIC_BIOTIC
52
53 C !LOCAL VARIABLES: ====================================================
54 C i,j,k :: loop indices
55 INTEGER I,J,k
56 _RL sfac(1-OLy:sNy+OLy)
57 _RL lit, atten
58 _RL nutlimit
59 #ifdef AD_SAFE
60 _RL thx, thy, theps
61 #endif
62 CEOP
63
64
65 #ifndef READ_PAR
66 call insol(myTime,sfac,bj)
67 #endif
68 DO j=jmin,jmax
69 DO i=imin,imax
70 C Fortran-90
71 CRG C$TAF INIT bio_export = static, nlev
72 C FORTRAN-77 dynamic memory uses adstore adresto
73 CRG C$TAF INIT bio_export = memory
74 C FORTRAN-77 with know max of nlev
75 C$TAF INIT bio_export = static, 10
76 #ifdef READ_PAR
77 lit=PAR(i,j,bi,bj)
78 #else
79 lit=sfac(j)
80 #endif
81 DO k=1,nlev
82 C$TAF STORE lit = bio_export
83 atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5)
84 if (k.gt.1) atten=atten+(k0*drF(k-1)
85 & *hFacC(i,j,k-1,bi,bj)*.5)
86 lit=lit*exp(-atten)*(1.d0-Fice(i,j,bi,bj))
87 if (lit.lt.0.d0.or.lit.gt.150) then
88 print*,'QQ lit', lit
89 endif
90
91 #ifdef ALLOW_FE
92 #ifdef AD_SAFE
93 thx = PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
94 thy = PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE)
95 theps = 1.d-6
96 nutlimit= ( 1.d0 - tanh((thx-thy)/theps) ) * thx/2 +
97 & ( 1.d0 + tanh((thx-thy)/theps) ) * thy/2
98 #else
99 nutlimit= min(PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4),
100 & PTR_FE(i,j,k)/(PTR_FE(i,j,k)+KFE) )
101 #endif
102 #else
103 nutlimit= PTR_PO4(i,j,k)/(PTR_PO4(i,j,k)+KPO4)
104 #endif
105
106 bioac(i,j,k)=alpha(i,j,bi,bj)*
107 & lit/(lit+lit0)*maskC(i,j,k,bi,bj)*
108 & nutlimit
109 ENDDO
110 ENDDO
111 ENDDO
112 c
113 #endif
114 #endif
115 RETURN
116 END

  ViewVC Help
Powered by ViewVC 1.1.22