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