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

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

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


Revision 1.17 - (show annotations) (download)
Wed Aug 22 00:40:56 2012 UTC (12 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.16: +11 -2 lines
move full initialisation of freefe array from dic_biotic_forcing.F to fe_chem.F:
 - more logical (output arg. array of S/R FE_CHEM is defined everywhere)
 - prevents TAF to drop the initialisation in TLM code

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/fe_chem.F,v 1.16 2010/04/13 03:06:14 jmc Exp $
2 C $Name: $
3
4 #include "DIC_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: Fe_CHEM
8 C !INTERFACE:
9 SUBROUTINE Fe_CHEM(
10 I bi,bj, iMin,iMax,jMin,jMax,
11 I fe,
12 O freefe,
13 I myIter, myThid )
14
15 C !DESCRIPTION: \bv
16 C *==========================================================*
17 C | SUBROUTINE Fe_CHEM
18 C | o Calculate L,FeL,Fe concentration
19 C *==========================================================*
20 C \ev
21
22 C !USES:
23 IMPLICIT NONE
24
25 C == GLobal variables ==
26 #include "SIZE.h"
27 #include "EEPARAMS.h"
28 #include "PARAMS.h"
29 #include "GRID.h"
30 #include "DIC_VARS.h"
31
32 C !INPUT/OUTPUT PARAMETERS:
33 C == Routine arguments ==
34 C bi, bj :: current tile indices
35 C iMin,iMax,jMin,jMax :: Range of points for which calculation is performed.
36 C myThid :: my Thread Id number
37 INTEGER bi,bj
38 INTEGER iMin,iMax,jMin,jMax
39 _RL fe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
40 _RL freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
41 INTEGER myIter, myThid
42 CEOP
43
44 #ifdef ALLOW_FE
45 C !LOCAL VARIABLES:
46 INTEGER i,j,k
47 _RL lig, FeL
48 _RL tmpfe
49 #ifdef AD_SAFE
50 _RL thx, thy, theps
51 #endif
52
53 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
54 C
55 C ADAPTED FROM PAYAL
56 C
57 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
58
59 DO k=1,Nr
60 DO j=1-OLy,sNy+OLy
61 DO i=1-OLx,sNx+OLx
62 freefe(i,j,k) = 0. _d 0
63 ENDDO
64 ENDDO
65 ENDDO
66
67 C ligand balance in surface layer
68 C in surface layer
69
70 DO k=1,Nr
71 DO j=jMin,jMax
72 DO i=iMin,iMax
73 IF ( maskC(i,j,k,bi,bj).GT.0. ) THEN
74
75 #ifdef DIC_NO_NEG
76 tmpfe =MAX( 0. _d 0 , fe(i,j,k) )
77 #else
78 tmpfe = fe(i,j,k)
79 #endif
80
81 C Ligand,FeL,Fe calculation
82 lig=(-ligand_stab*tmpfe +
83 & ligand_stab*ligand_tot-1. _d 0
84 & +((ligand_stab*tmpfe
85 & -ligand_stab*ligand_tot+1. _d 0)**2
86 & +4. _d 0*ligand_stab*ligand_tot)**0.5 _d 0
87 & )/(2. _d 0*ligand_stab)
88
89 FeL = ligand_tot-lig
90 IF (tmpfe.NE.0. _d 0) THEN
91 freefe(i,j,k) = tmpfe -FeL
92 ELSE
93 freefe(i,j,k) = 0. _d 0
94 ENDIF
95 #ifdef MINFE
96 #ifdef AD_SAFE
97 thx=freefe(i,j,k)
98 thy=freefemax
99 theps=1. _d -8
100 freefe(i,j,k) =
101 & ( 1. _d 0 - tanh((thx-thy)/theps) ) * thx/2.+
102 & ( 1. _d 0 + tanh((thx-thy)/theps) ) * thy/2.
103
104 #else
105 freefe(i,j,k) = MIN(freefe(i,j,k),freefemax)
106 #endif
107 fe(i,j,k) = FeL+freefe(i,j,k)
108 #endif
109 ENDIF
110 ENDDO
111 ENDDO
112 ENDDO
113
114 #endif /* ALLOW_FE */
115 RETURN
116 END

  ViewVC Help
Powered by ViewVC 1.1.22