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

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

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


Revision 1.16 - (hide annotations) (download)
Tue Apr 13 03:06:14 2010 UTC (14 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.15: +59 -57 lines
fix for multi-tile (nSx*nSy > 1) set-up.

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

  ViewVC Help
Powered by ViewVC 1.1.22