| 1 |
C $Header$ |
| 2 |
C $Name$ |
| 3 |
|
| 4 |
c#include "DIC_OPTIONS.h" |
| 5 |
#include "DARWIN_OPTIONS.h" |
| 6 |
|
| 7 |
CStartOfInterFace |
| 8 |
SUBROUTINE DARWIN_Fe_CHEM( |
| 9 |
I bi,bj,iMin,iMax,jMin,jMax, |
| 10 |
U fe, |
| 11 |
O freefe, |
| 12 |
I myIter, myThid ) |
| 13 |
C /==========================================================\ |
| 14 |
C | SUBROUTINE Fe_chem | |
| 15 |
C | | |
| 16 |
C | o Calculate L,FeL,Fe concentration | |
| 17 |
C | Stephanie Dutkiewicz, 2004 |
| 18 |
C | following from code by Payal Parekh |
| 19 |
C |==========================================================| |
| 20 |
IMPLICIT NONE |
| 21 |
|
| 22 |
C == GLobal variables == |
| 23 |
#include "SIZE.h" |
| 24 |
#include "DYNVARS.h" |
| 25 |
#include "EEPARAMS.h" |
| 26 |
#include "PARAMS.h" |
| 27 |
#include "GRID.h" |
| 28 |
#include "DARWIN_PARAMS.h" |
| 29 |
|
| 30 |
C == Routine arguments == |
| 31 |
C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation |
| 32 |
C results will be set. |
| 33 |
C myThid - Instance number for this innvocation of CALC_GT |
| 34 |
_RL freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
| 35 |
_RL fe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
| 36 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
| 37 |
INTEGER myIter,myThid |
| 38 |
CEndOfInterface |
| 39 |
|
| 40 |
|
| 41 |
INTEGER I,J,K |
| 42 |
_RL lig, FeL |
| 43 |
|
| 44 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 45 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 46 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 47 |
CC |
| 48 |
CC ADAPTED FROM PAYAL |
| 49 |
CC |
| 50 |
CC |
| 51 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 52 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 53 |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCc |
| 54 |
|
| 55 |
C ligand balance in surface layer |
| 56 |
C in surface layer |
| 57 |
|
| 58 |
DO j=jmin,jmax |
| 59 |
DO i=imin,imax |
| 60 |
DO k=1,nR |
| 61 |
IF(hFacC(i,j,k,bi,bj) .gt. 0.0 _d 0)THEN |
| 62 |
|
| 63 |
C Ligand,FeL,Fe calculation |
| 64 |
|
| 65 |
lig=(-ligand_stab*fe (i,j,k)+ |
| 66 |
& ligand_stab*ligand_tot-1. _d 0 |
| 67 |
& +((ligand_stab*fe (i,j,k) |
| 68 |
& -ligand_stab*ligand_tot+1. _d 0)**2+4. _d 0 |
| 69 |
& *ligand_stab*ligand_tot)**0.5 _d 0) |
| 70 |
& /(2. _d 0*ligand_stab) |
| 71 |
|
| 72 |
FeL = ligand_tot-lig |
| 73 |
freefe(i,j,k) = fe (i,j,k)-FeL |
| 74 |
#ifdef MINFE |
| 75 |
freefe(i,j,k) = min(freefe(i,j,k),freefemax) |
| 76 |
fe(i,j,k) = FeL+freefe(i,j,k) |
| 77 |
#endif |
| 78 |
END IF |
| 79 |
ENDDO |
| 80 |
ENDDO |
| 81 |
ENDDO |
| 82 |
c |
| 83 |
RETURN |
| 84 |
END |