1 | MODULE p4zlys |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE p4zlys *** |
---|
4 | !! TOP : PISCES |
---|
5 | !!====================================================================== |
---|
6 | !! History : - ! 1988-07 (E. MAIER-REIMER) Original code |
---|
7 | !! - ! 1998 (O. Aumont) additions |
---|
8 | !! - ! 1999 (C. Le Quere) modifications |
---|
9 | !! 1.0 ! 2004 (O. Aumont) modifications |
---|
10 | !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 |
---|
11 | !! ! 2011-02 (J. Simeon, J. Orr) Calcon salinity dependence |
---|
12 | !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Improvment of calcite dissolution |
---|
13 | !!---------------------------------------------------------------------- |
---|
14 | #if defined key_pisces |
---|
15 | !!---------------------------------------------------------------------- |
---|
16 | !! 'key_pisces' PISCES bio-model |
---|
17 | !!---------------------------------------------------------------------- |
---|
18 | !! p4z_lys : Compute the CaCO3 dissolution |
---|
19 | !! p4z_lys_init : Read the namelist parameters |
---|
20 | !!---------------------------------------------------------------------- |
---|
21 | USE oce_trc ! shared variables between ocean and passive tracers |
---|
22 | USE trc ! passive tracers common variables |
---|
23 | USE sms_pisces ! PISCES Source Minus Sink variables |
---|
24 | USE prtctl_trc ! print control for debugging |
---|
25 | USE iom ! I/O manager |
---|
26 | |
---|
27 | IMPLICIT NONE |
---|
28 | PRIVATE |
---|
29 | |
---|
30 | PUBLIC p4z_lys ! called in trcsms_pisces.F90 |
---|
31 | PUBLIC p4z_lys_init ! called in trcsms_pisces.F90 |
---|
32 | |
---|
33 | !! * Shared module variables |
---|
34 | REAL(wp), PUBLIC :: kdca !: diss. rate constant calcite |
---|
35 | REAL(wp), PUBLIC :: nca !: order of reaction for calcite dissolution |
---|
36 | |
---|
37 | !! * Module variables |
---|
38 | REAL(wp) :: calcon = 1.03E-2 !: mean calcite concentration [Ca2+] in sea water [mole/kg solution] |
---|
39 | |
---|
40 | INTEGER :: rmtss !: number of seconds per month |
---|
41 | |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
44 | !! $Id: p4zlys.F90 3321 2012-03-05 17:10:55Z cetlod $ |
---|
45 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
46 | !!---------------------------------------------------------------------- |
---|
47 | |
---|
48 | CONTAINS |
---|
49 | |
---|
50 | SUBROUTINE p4z_lys( kt, knt ) |
---|
51 | !!--------------------------------------------------------------------- |
---|
52 | !! *** ROUTINE p4z_lys *** |
---|
53 | !! |
---|
54 | !! ** Purpose : CALCULATES DEGREE OF CACO3 SATURATION IN THE WATER |
---|
55 | !! COLUMN, DISSOLUTION/PRECIPITATION OF CACO3 AND LOSS |
---|
56 | !! OF CACO3 TO THE CACO3 SEDIMENT POOL. |
---|
57 | !! |
---|
58 | !! ** Method : - ??? |
---|
59 | !!--------------------------------------------------------------------- |
---|
60 | ! |
---|
61 | INTEGER, INTENT(in) :: kt, knt ! ocean time step |
---|
62 | INTEGER :: ji, jj, jk, jn |
---|
63 | REAL(wp) :: zalk, zdic, zph, zah2 |
---|
64 | REAL(wp) :: zdispot, zfact, zcalcon, zalka, zaldi |
---|
65 | REAL(wp) :: zomegaca, zexcess, zexcess0 |
---|
66 | CHARACTER (len=25) :: charout |
---|
67 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zco3, zco3sat, zcaldiss |
---|
68 | !!--------------------------------------------------------------------- |
---|
69 | ! |
---|
70 | IF( nn_timing == 1 ) CALL timing_start('p4z_lys') |
---|
71 | ! |
---|
72 | CALL wrk_alloc( jpi, jpj, jpk, zco3, zco3sat, zcaldiss ) |
---|
73 | ! |
---|
74 | zco3 (:,:,:) = 0. |
---|
75 | zcaldiss(:,:,:) = 0. |
---|
76 | ! ------------------------------------------- |
---|
77 | ! COMPUTE [CO3--] and [H+] CONCENTRATIONS |
---|
78 | ! ------------------------------------------- |
---|
79 | |
---|
80 | DO jn = 1, 5 ! BEGIN OF ITERATION |
---|
81 | ! |
---|
82 | !CDIR NOVERRCHK |
---|
83 | DO jk = 1, jpkm1 |
---|
84 | !CDIR NOVERRCHK |
---|
85 | DO jj = 1, jpj |
---|
86 | !CDIR NOVERRCHK |
---|
87 | DO ji = 1, jpi |
---|
88 | zfact = rhop(ji,jj,jk) / 1000. + rtrn |
---|
89 | zph = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9 ! [H+] |
---|
90 | zdic = trb(ji,jj,jk,jpdic) / zfact |
---|
91 | zalka = trb(ji,jj,jk,jptal) / zfact |
---|
92 | ! CALCULATE [ALK]([CO3--], [HCO3-]) |
---|
93 | zalk = zalka - ( akw3(ji,jj,jk) / zph - zph / ( aphscale(ji,jj,jk) + rtrn ) & |
---|
94 | & + borat(ji,jj,jk) / ( 1. + zph / akb3(ji,jj,jk) ) ) |
---|
95 | ! CALCULATE [H+] and [CO3--] |
---|
96 | zaldi = zdic - zalk |
---|
97 | zah2 = SQRT( zaldi * zaldi + 4.* ( zalk * ak23(ji,jj,jk) / ak13(ji,jj,jk) ) * ( zdic + zaldi ) ) |
---|
98 | zah2 = 0.5 * ak13(ji,jj,jk) / zalk * ( zaldi + zah2 ) |
---|
99 | ! |
---|
100 | zco3(ji,jj,jk) = zalk / ( 2. + zah2 / ak23(ji,jj,jk) ) * zfact |
---|
101 | hi(ji,jj,jk) = zah2 * zfact |
---|
102 | END DO |
---|
103 | END DO |
---|
104 | END DO |
---|
105 | ! |
---|
106 | END DO |
---|
107 | |
---|
108 | ! --------------------------------------------------------- |
---|
109 | ! CALCULATE DEGREE OF CACO3 SATURATION AND CORRESPONDING |
---|
110 | ! DISSOLOUTION AND PRECIPITATION OF CACO3 (BE AWARE OF |
---|
111 | ! MGCO3) |
---|
112 | ! --------------------------------------------------------- |
---|
113 | |
---|
114 | DO jk = 1, jpkm1 |
---|
115 | DO jj = 1, jpj |
---|
116 | DO ji = 1, jpi |
---|
117 | |
---|
118 | ! DEVIATION OF [CO3--] FROM SATURATION VALUE |
---|
119 | ! Salinity dependance in zomegaca and divide by rhop/1000 to have good units |
---|
120 | zcalcon = calcon * ( tsn(ji,jj,jk,jp_sal) / 35._wp ) |
---|
121 | zfact = rhop(ji,jj,jk) / 1000._wp |
---|
122 | zomegaca = ( zcalcon * zco3(ji,jj,jk) ) / ( aksp(ji,jj,jk) * zfact + rtrn ) |
---|
123 | zco3sat(ji,jj,jk) = aksp(ji,jj,jk) * zfact / ( zcalcon + rtrn ) |
---|
124 | |
---|
125 | ! SET DEGREE OF UNDER-/SUPERSATURATION |
---|
126 | excess(ji,jj,jk) = 1._wp - zomegaca |
---|
127 | zexcess0 = MAX( 0., excess(ji,jj,jk) ) |
---|
128 | zexcess = zexcess0**nca |
---|
129 | |
---|
130 | ! AMOUNT CACO3 (12C) THAT RE-ENTERS SOLUTION |
---|
131 | ! (ACCORDING TO THIS FORMULATION ALSO SOME PARTICULATE |
---|
132 | ! CACO3 GETS DISSOLVED EVEN IN THE CASE OF OVERSATURATION) |
---|
133 | zdispot = kdca * zexcess * trb(ji,jj,jk,jpcal) |
---|
134 | # if defined key_degrad |
---|
135 | zdispot = zdispot * facvol(ji,jj,jk) |
---|
136 | # endif |
---|
137 | ! CHANGE OF [CO3--] , [ALK], PARTICULATE [CACO3], |
---|
138 | ! AND [SUM(CO2)] DUE TO CACO3 DISSOLUTION/PRECIPITATION |
---|
139 | zcaldiss(ji,jj,jk) = zdispot * rfact2 / rmtss ! calcite dissolution |
---|
140 | zco3(ji,jj,jk) = zco3(ji,jj,jk) + zcaldiss(ji,jj,jk) |
---|
141 | ! |
---|
142 | tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + 2. * zcaldiss(ji,jj,jk) |
---|
143 | tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) - zcaldiss(ji,jj,jk) |
---|
144 | tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zcaldiss(ji,jj,jk) |
---|
145 | END DO |
---|
146 | END DO |
---|
147 | END DO |
---|
148 | ! |
---|
149 | |
---|
150 | IF( lk_iomput .AND. knt == nrdttrc ) THEN |
---|
151 | IF( iom_use( "PH" ) ) CALL iom_put( "PH" , -1. * LOG10( hi(:,:,:) ) * tmask(:,:,:) ) |
---|
152 | IF( iom_use( "CO3" ) ) CALL iom_put( "CO3" , zco3(:,:,:) * 1.e+3 * tmask(:,:,:) ) |
---|
153 | IF( iom_use( "CO3sat" ) ) CALL iom_put( "CO3sat", zco3sat(:,:,:) * 1.e+3 * tmask(:,:,:) ) |
---|
154 | IF( iom_use( "DCAL" ) ) CALL iom_put( "DCAL" , zcaldiss(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:) ) |
---|
155 | ELSE |
---|
156 | IF( ln_diatrc ) THEN |
---|
157 | trc3d(:,:,:,jp_pcs0_3d ) = -1. * LOG10( hi(:,:,:) ) * tmask(:,:,:) |
---|
158 | trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:) * tmask(:,:,:) |
---|
159 | trc3d(:,:,:,jp_pcs0_3d + 2) = zco3sat(:,:,:) * tmask(:,:,:) |
---|
160 | ENDIF |
---|
161 | ENDIF |
---|
162 | ! |
---|
163 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
164 | WRITE(charout, FMT="('lys ')") |
---|
165 | CALL prt_ctl_trc_info(charout) |
---|
166 | CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) |
---|
167 | ENDIF |
---|
168 | ! |
---|
169 | CALL wrk_dealloc( jpi, jpj, jpk, zco3, zco3sat, zcaldiss ) |
---|
170 | ! |
---|
171 | IF( nn_timing == 1 ) CALL timing_stop('p4z_lys') |
---|
172 | ! |
---|
173 | END SUBROUTINE p4z_lys |
---|
174 | |
---|
175 | SUBROUTINE p4z_lys_init |
---|
176 | |
---|
177 | !!---------------------------------------------------------------------- |
---|
178 | !! *** ROUTINE p4z_lys_init *** |
---|
179 | !! |
---|
180 | !! ** Purpose : Initialization of CaCO3 dissolution parameters |
---|
181 | !! |
---|
182 | !! ** Method : Read the nampiscal namelist and check the parameters |
---|
183 | !! called at the first timestep (nittrc000) |
---|
184 | !! |
---|
185 | !! ** input : Namelist nampiscal |
---|
186 | !! |
---|
187 | !!---------------------------------------------------------------------- |
---|
188 | INTEGER :: ji, jj, jk |
---|
189 | INTEGER :: ios ! Local integer output status for namelist read |
---|
190 | REAL(wp) :: zcaralk, zbicarb, zco3 |
---|
191 | REAL(wp) :: ztmas, ztmas1 |
---|
192 | |
---|
193 | NAMELIST/nampiscal/ kdca, nca |
---|
194 | !!---------------------------------------------------------------------- |
---|
195 | |
---|
196 | REWIND( numnatp_ref ) ! Namelist nampiscal in reference namelist : Pisces CaCO3 dissolution |
---|
197 | READ ( numnatp_ref, nampiscal, IOSTAT = ios, ERR = 901) |
---|
198 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampiscal in reference namelist', lwp ) |
---|
199 | |
---|
200 | REWIND( numnatp_cfg ) ! Namelist nampiscal in configuration namelist : Pisces CaCO3 dissolution |
---|
201 | READ ( numnatp_cfg, nampiscal, IOSTAT = ios, ERR = 902 ) |
---|
202 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampiscal in configuration namelist', lwp ) |
---|
203 | IF(lwm) WRITE ( numonp, nampiscal ) |
---|
204 | |
---|
205 | IF(lwp) THEN ! control print |
---|
206 | WRITE(numout,*) ' ' |
---|
207 | WRITE(numout,*) ' Namelist parameters for CaCO3 dissolution, nampiscal' |
---|
208 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
209 | WRITE(numout,*) ' diss. rate constant calcite (per month) kdca =', kdca |
---|
210 | WRITE(numout,*) ' order of reaction for calcite dissolution nca =', nca |
---|
211 | ENDIF |
---|
212 | |
---|
213 | ! Number of seconds per month |
---|
214 | rmtss = nyear_len(1) * rday / raamo |
---|
215 | ! |
---|
216 | END SUBROUTINE p4z_lys_init |
---|
217 | |
---|
218 | #else |
---|
219 | !!====================================================================== |
---|
220 | !! Dummy module : No PISCES bio-model |
---|
221 | !!====================================================================== |
---|
222 | CONTAINS |
---|
223 | SUBROUTINE p4z_lys( kt ) ! Empty routine |
---|
224 | INTEGER, INTENT( in ) :: kt |
---|
225 | WRITE(*,*) 'p4z_lys: You should not have seen this print! error?', kt |
---|
226 | END SUBROUTINE p4z_lys |
---|
227 | #endif |
---|
228 | !!====================================================================== |
---|
229 | END MODULE p4zlys |
---|