1 |
|
2 |
#include "CPP_OPTIONS.h" |
3 |
#include "DARWIN_OPTIONS.h" |
4 |
|
5 |
#ifdef ALLOW_PTRACERS |
6 |
#ifdef ALLOW_MONOD |
7 |
|
8 |
c ========================================================== |
9 |
c SUBROUTINE MONOD_CHECK_CHL() |
10 |
c initialize Chl is not set and check that not too much or too little |
11 |
c --- steph spring 2010 |
12 |
c ========================================================== |
13 |
c |
14 |
SUBROUTINE MONOD_CHECK_CHL(myThid) |
15 |
|
16 |
IMPLICIT NONE |
17 |
|
18 |
#include "SIZE.h" |
19 |
#include "GRID.h" |
20 |
#include "DYNVARS.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
#include "PTRACERS_SIZE.h" |
24 |
#include "PTRACERS_PARAMS.h" |
25 |
#include "PTRACERS_FIELDS.h" |
26 |
#include "MONOD_SIZE.h" |
27 |
#include "MONOD.h" |
28 |
#include "MONOD_FIELDS.h" |
29 |
#include "DARWIN_IO.h" |
30 |
#ifdef OASIM |
31 |
#include "SPECTRAL_SIZE.h" |
32 |
#include "SPECTRAL.h" |
33 |
#endif |
34 |
|
35 |
|
36 |
C !INPUT PARAMETERS: =================================================== |
37 |
C myThid :: thread number |
38 |
INTEGER myThid |
39 |
|
40 |
C !LOCAL VARIABLES: |
41 |
C === Local variables === |
42 |
C msgBuf - Informational/error meesage buffer |
43 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
44 |
INTEGER IniUnit1, IniUnit2 |
45 |
|
46 |
INTEGER bi, bj, k, i, j, iPAR |
47 |
|
48 |
INTEGER np |
49 |
|
50 |
INTEGER ilam |
51 |
|
52 |
_RL phytmp, chltmp, chl2ctmp, pcm |
53 |
_RL PARlocal, lite |
54 |
_RL atten |
55 |
CEOP |
56 |
|
57 |
#ifdef GEIDER |
58 |
|
59 |
WRITE(msgBuf,'(A)') |
60 |
& '// =======================================================' |
61 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
62 |
& SQUEEZE_RIGHT, myThid ) |
63 |
WRITE(msgBuf,'(A)') '// Darwin check Chl >>> START <<<' |
64 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
65 |
& SQUEEZE_RIGHT, myThid ) |
66 |
WRITE(msgBuf,'(A)') |
67 |
& '// =======================================================' |
68 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
69 |
& SQUEEZE_RIGHT, myThid ) |
70 |
|
71 |
C do not overwrite pickup |
72 |
IF (nIter0 .EQ. PTRACERS_Iter0) THEN |
73 |
|
74 |
call DARWIN_FIELDS_LOAD(0,0. _d 0,myThid) |
75 |
|
76 |
c check Chl fields are reasonable |
77 |
DO bj = myByLo(myThid), myByHi(myThid) |
78 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
79 |
DO j=1-Oly,sNy+Oly |
80 |
DO i=1-Olx,sNx+Olx |
81 |
atten= 0. _d 0 |
82 |
#if defined(WAVEBANDS) && defined(OASIM) |
83 |
c if spectral use wavebands to give a single surface PAR |
84 |
lite= 0. _d 0 |
85 |
DO ilam=1,tlam |
86 |
lite=lite+WtouEins(ilam)*(oasim_ed(i,j,ilam,bi,bj)+ |
87 |
& oasim_es(i,j,ilam,bi,bj)) |
88 |
ENDDO |
89 |
#else |
90 |
lite=sur_par(i,j,bi,bj) |
91 |
#endif |
92 |
|
93 |
DO k=1,nR |
94 |
if (HFacC(i,j,k,bi,bj).gt.0. _d 0) then |
95 |
atten= atten + (k0 )*5. _d -1*drF(k) |
96 |
if (k.gt.1)then |
97 |
atten = atten + (k0)*5. _d -1*drF(k-1) |
98 |
endif |
99 |
PARlocal = lite*exp(-atten) |
100 |
DO np=1,npmax |
101 |
#ifdef DYNAMIC_CHL |
102 |
chltmp=Ptracer(i,j,k,bi,bj,iChl+np-1) |
103 |
#else |
104 |
chltmp=0.0 |
105 |
#endif |
106 |
phytmp=Ptracer(i,j,k,bi,bj,iPhy+np-1) |
107 |
c if initialized to zero, set to balanced growth |
108 |
c with no nutrient or temperature limitation |
109 |
c (Eq. A15 Geider et al 1997) |
110 |
if (chltmp.eq.0. _d 0) then |
111 |
pcm=pcmax(np) !*limit(np)*phytoTempFunction(np) |
112 |
chl2ctmp=chl2cmax(np)/ |
113 |
& (1+(chl2cmax(np)*alphachl(np)*PARlocal)/ |
114 |
& (2*pcm)) |
115 |
chltmp=phytmp*R_PC(np)*chl2ctmp |
116 |
endif |
117 |
c check not too high or too low |
118 |
chltmp=max(chltmp, phytmp*R_PC(np)*chl2cmin(np)) |
119 |
chltmp=min(chltmp, phytmp*R_PC(np)*chl2cmax(np)) |
120 |
#ifdef DYNAMIC_CHL |
121 |
Ptracer(i,j,k,bi,bj,iChl+np-1)=chltmp |
122 |
#else |
123 |
Chl_phy(i,j,k,bi,bj,np)=chltmp |
124 |
#endif |
125 |
if (k.eq.1.and.i.eq.1.and.j.eq.1) print*,'initial Chl', |
126 |
& chltmp, phytmp |
127 |
ENDDO |
128 |
endif |
129 |
ENDDO |
130 |
ENDDO |
131 |
ENDDO |
132 |
ENDDO |
133 |
ENDDO |
134 |
|
135 |
C nIter0 |
136 |
ENDIF |
137 |
#endif |
138 |
|
139 |
WRITE(msgBuf,'(A)') |
140 |
& '// =======================================================' |
141 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
142 |
& SQUEEZE_RIGHT, myThid ) |
143 |
WRITE(msgBuf,'(A)') '// Darwin check chl >>> END <<<' |
144 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
145 |
& SQUEEZE_RIGHT, myThid ) |
146 |
WRITE(msgBuf,'(A)') |
147 |
& '// =======================================================' |
148 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
149 |
& SQUEEZE_RIGHT, myThid ) |
150 |
|
151 |
|
152 |
RETURN |
153 |
END |
154 |
#endif /*MONOD*/ |
155 |
#endif /*ALLOW_PTRACERS*/ |
156 |
c ========================================================== |
157 |
|