1 | MODULE p4zflx |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE p4zflx *** |
---|
4 | !! TOP : PISCES CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE |
---|
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) Include total atm P correction |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | #if defined key_pisces |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | !! 'key_pisces' PISCES bio-model |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | !! p4z_flx : CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE |
---|
18 | !! p4z_flx_init : Read the namelist |
---|
19 | !! p4z_patm : Read sfc atm pressure [atm] for each grid cell |
---|
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 p4zche ! Chemical model |
---|
25 | USE prtctl_trc ! print control for debugging |
---|
26 | USE iom ! I/O manager |
---|
27 | USE fldread ! read input fields |
---|
28 | #if defined key_cpl_carbon_cycle |
---|
29 | USE sbc_oce, ONLY : atm_co2 ! atmospheric pCO2 |
---|
30 | #endif |
---|
31 | |
---|
32 | IMPLICIT NONE |
---|
33 | PRIVATE |
---|
34 | |
---|
35 | PUBLIC p4z_flx |
---|
36 | PUBLIC p4z_flx_init |
---|
37 | PUBLIC p4z_flx_alloc |
---|
38 | |
---|
39 | ! !!** Namelist nampisext ** |
---|
40 | REAL(wp) :: atcco2 !: pre-industrial atmospheric [co2] (ppm) |
---|
41 | LOGICAL :: ln_co2int !: flag to read in a file and interpolate atmospheric pco2 or not |
---|
42 | CHARACTER(len=34) :: clname !: filename of pco2 values |
---|
43 | INTEGER :: nn_offset !: Offset model-data start year (default = 0) |
---|
44 | |
---|
45 | !! Variables related to reading atmospheric CO2 time history |
---|
46 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: atcco2h, years |
---|
47 | INTEGER :: nmaxrec, numco2 |
---|
48 | |
---|
49 | ! !!* nampisatm namelist (Atmospheric PRessure) * |
---|
50 | LOGICAL, PUBLIC :: ln_presatm !: ref. pressure: global mean Patm (F) or a constant (F) |
---|
51 | |
---|
52 | REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: patm ! atmospheric pressure at kt [N/m2] |
---|
53 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_patm ! structure of input fields (file informations, fields read) |
---|
54 | |
---|
55 | |
---|
56 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: oce_co2 !: ocean carbon flux |
---|
57 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: satmco2 !: atmospheric pco2 |
---|
58 | |
---|
59 | REAL(wp) :: xconv = 0.01_wp / 3600._wp !: coefficients for conversion |
---|
60 | |
---|
61 | !!* Substitution |
---|
62 | # include "top_substitute.h90" |
---|
63 | !!---------------------------------------------------------------------- |
---|
64 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
65 | !! $Id$ |
---|
66 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
67 | !!---------------------------------------------------------------------- |
---|
68 | CONTAINS |
---|
69 | |
---|
70 | SUBROUTINE p4z_flx ( kt, knt ) |
---|
71 | !!--------------------------------------------------------------------- |
---|
72 | !! *** ROUTINE p4z_flx *** |
---|
73 | !! |
---|
74 | !! ** Purpose : CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE |
---|
75 | !! |
---|
76 | !! ** Method : |
---|
77 | !! - Include total atm P correction via Esbensen & Kushnir (1981) |
---|
78 | !! - Pressure correction NOT done for key_cpl_carbon_cycle |
---|
79 | !! - Remove Wanninkhof chemical enhancement; |
---|
80 | !! - Add option for time-interpolation of atcco2.txt |
---|
81 | !!--------------------------------------------------------------------- |
---|
82 | ! |
---|
83 | INTEGER, INTENT(in) :: kt, knt ! |
---|
84 | ! |
---|
85 | INTEGER :: ji, jj, jm, iind, iindm1 |
---|
86 | REAL(wp) :: ztc, ztc2, ztc3, ztc4, zws, zkgwan |
---|
87 | REAL(wp) :: zfld, zflu, zfld16, zflu16, zfact |
---|
88 | REAL(wp) :: zph, zah2, zbot, zdic, zalk, zsch_o2, zalka, zsch_co2 |
---|
89 | REAL(wp) :: zyr_dec, zdco2dt |
---|
90 | CHARACTER (len=25) :: charout |
---|
91 | REAL(wp), POINTER, DIMENSION(:,:) :: zkgco2, zkgo2, zh2co3, zoflx, zw2d |
---|
92 | !!--------------------------------------------------------------------- |
---|
93 | ! |
---|
94 | IF( nn_timing == 1 ) CALL timing_start('p4z_flx') |
---|
95 | ! |
---|
96 | CALL wrk_alloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx ) |
---|
97 | ! |
---|
98 | |
---|
99 | ! SURFACE CHEMISTRY (PCO2 AND [H+] IN |
---|
100 | ! SURFACE LAYER); THE RESULT OF THIS CALCULATION |
---|
101 | ! IS USED TO COMPUTE AIR-SEA FLUX OF CO2 |
---|
102 | |
---|
103 | IF( kt /= nit000 .AND. knt == 1 ) CALL p4z_patm( kt ) ! Get sea-level pressure (E&K [1981] climatology) for use in flux calcs |
---|
104 | |
---|
105 | IF( ln_co2int ) THEN |
---|
106 | ! Linear temporal interpolation of atmospheric pco2. atcco2.txt has annual values. |
---|
107 | ! Caveats: First column of .txt must be in years, decimal years preferably. |
---|
108 | ! For nn_offset, if your model year is iyy, nn_offset=(years(1)-iyy) |
---|
109 | ! then the first atmospheric CO2 record read is at years(1) |
---|
110 | zyr_dec = REAL( nyear + nn_offset, wp ) + REAL( nday_year, wp ) / REAL( nyear_len(1), wp ) |
---|
111 | jm = 1 |
---|
112 | DO WHILE( jm <= nmaxrec .AND. years(jm) < zyr_dec ) ; jm = jm + 1 ; END DO |
---|
113 | iind = jm ; iindm1 = jm - 1 |
---|
114 | zdco2dt = ( atcco2h(iind) - atcco2h(iindm1) ) / ( years(iind) - years(iindm1) + rtrn ) |
---|
115 | atcco2 = zdco2dt * ( zyr_dec - years(iindm1) ) + atcco2h(iindm1) |
---|
116 | satmco2(:,:) = atcco2 |
---|
117 | ENDIF |
---|
118 | |
---|
119 | #if defined key_cpl_carbon_cycle |
---|
120 | satmco2(:,:) = atm_co2(:,:) |
---|
121 | #endif |
---|
122 | |
---|
123 | DO jm = 1, 10 |
---|
124 | !CDIR NOVERRCHK |
---|
125 | DO jj = 1, jpj |
---|
126 | !CDIR NOVERRCHK |
---|
127 | DO ji = 1, jpi |
---|
128 | |
---|
129 | ! DUMMY VARIABLES FOR DIC, H+, AND BORATE |
---|
130 | zbot = borat(ji,jj,1) |
---|
131 | zfact = rhop(ji,jj,1) / 1000. + rtrn |
---|
132 | zdic = trb(ji,jj,1,jpdic) / zfact |
---|
133 | zph = MAX( hi(ji,jj,1), 1.e-10 ) / zfact |
---|
134 | zalka = trb(ji,jj,1,jptal) / zfact |
---|
135 | |
---|
136 | ! CALCULATE [ALK]([CO3--], [HCO3-]) |
---|
137 | zalk = zalka - ( akw3(ji,jj,1) / zph - zph / aphscale(ji,jj,1) & |
---|
138 | & + zbot / ( 1.+ zph / akb3(ji,jj,1) ) ) |
---|
139 | |
---|
140 | ! CALCULATE [H+] AND [H2CO3] |
---|
141 | zah2 = SQRT( (zdic-zalk)**2 + 4.* ( zalk * ak23(ji,jj,1) & |
---|
142 | & / ak13(ji,jj,1) ) * ( 2.* zdic - zalk ) ) |
---|
143 | zah2 = 0.5 * ak13(ji,jj,1) / zalk * ( ( zdic - zalk ) + zah2 ) |
---|
144 | zh2co3(ji,jj) = ( 2.* zdic - zalk ) / ( 2.+ ak13(ji,jj,1) / zah2 ) * zfact |
---|
145 | hi(ji,jj,1) = zah2 * zfact |
---|
146 | END DO |
---|
147 | END DO |
---|
148 | END DO |
---|
149 | |
---|
150 | |
---|
151 | ! -------------- |
---|
152 | ! COMPUTE FLUXES |
---|
153 | ! -------------- |
---|
154 | |
---|
155 | ! FIRST COMPUTE GAS EXCHANGE COEFFICIENTS |
---|
156 | ! ------------------------------------------- |
---|
157 | |
---|
158 | !CDIR NOVERRCHK |
---|
159 | DO jj = 1, jpj |
---|
160 | !CDIR NOVERRCHK |
---|
161 | DO ji = 1, jpi |
---|
162 | ztc = MIN( 35., tsn(ji,jj,1,jp_tem) ) |
---|
163 | ztc2 = ztc * ztc |
---|
164 | ztc3 = ztc * ztc2 |
---|
165 | ztc4 = ztc2 * ztc2 |
---|
166 | ! Compute the schmidt Number both O2 and CO2 |
---|
167 | zsch_co2 = 2116.8 - 136.25 * ztc + 4.7353 * ztc2 - 0.092307 * ztc3 + 0.0007555 * ztc4 |
---|
168 | zsch_o2 = 1920.4 - 135.6 * ztc + 5.2122 * ztc2 - 0.109390 * ztc3 + 0.0009377 * ztc4 |
---|
169 | ! wind speed |
---|
170 | zws = wndm(ji,jj) * wndm(ji,jj) |
---|
171 | ! Compute the piston velocity for O2 and CO2 |
---|
172 | zkgwan = 0.251 * zws |
---|
173 | zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) |
---|
174 | # if defined key_degrad |
---|
175 | zkgwan = zkgwan * facvol(ji,jj,1) |
---|
176 | #endif |
---|
177 | ! compute gas exchange for CO2 and O2 |
---|
178 | zkgco2(ji,jj) = zkgwan * SQRT( 660./ zsch_co2 ) |
---|
179 | zkgo2 (ji,jj) = zkgwan * SQRT( 660./ zsch_o2 ) |
---|
180 | END DO |
---|
181 | END DO |
---|
182 | |
---|
183 | DO jj = 1, jpj |
---|
184 | DO ji = 1, jpi |
---|
185 | ! Compute CO2 flux for the sea and air |
---|
186 | zfld = satmco2(ji,jj) * patm(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj) * zkgco2(ji,jj) ! (mol/L) * (m/s) |
---|
187 | zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj) ! (mol/L) (m/s) ? |
---|
188 | oce_co2(ji,jj) = ( zfld - zflu ) * rfact2 * e1e2t(ji,jj) * tmask(ji,jj,1) * 1000. |
---|
189 | ! compute the trend |
---|
190 | tra(ji,jj,1,jpdic) = tra(ji,jj,1,jpdic) + ( zfld - zflu ) * rfact2 / fse3t(ji,jj,1) |
---|
191 | |
---|
192 | ! Compute O2 flux |
---|
193 | zfld16 = patm(ji,jj) * chemo2(ji,jj,1) * tmask(ji,jj,1) * zkgo2(ji,jj) ! (mol/L) * (m/s) |
---|
194 | zflu16 = trb(ji,jj,1,jpoxy) * tmask(ji,jj,1) * zkgo2(ji,jj) |
---|
195 | zoflx(ji,jj) = zfld16 - zflu16 |
---|
196 | tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + zoflx(ji,jj) * rfact2 / fse3t(ji,jj,1) |
---|
197 | END DO |
---|
198 | END DO |
---|
199 | |
---|
200 | t_oce_co2_flx = glob_sum( oce_co2(:,:) ) ! Total Flux of Carbon |
---|
201 | t_oce_co2_flx_cum = t_oce_co2_flx_cum + t_oce_co2_flx ! Cumulative Total Flux of Carbon |
---|
202 | ! t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) ) ! Total atmospheric pCO2 |
---|
203 | t_atm_co2_flx = atcco2 ! Total atmospheric pCO2 |
---|
204 | |
---|
205 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
206 | WRITE(charout, FMT="('flx ')") |
---|
207 | CALL prt_ctl_trc_info(charout) |
---|
208 | CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) |
---|
209 | ENDIF |
---|
210 | |
---|
211 | IF( lk_iomput .AND. knt == nrdttrc ) THEN |
---|
212 | CALL wrk_alloc( jpi, jpj, zw2d ) |
---|
213 | IF( iom_use( "Cflx" ) ) THEN |
---|
214 | zw2d(:,:) = oce_co2(:,:) / e1e2t(:,:) * rfact2r |
---|
215 | CALL iom_put( "Cflx" , zw2d ) |
---|
216 | ENDIF |
---|
217 | IF( iom_use( "Oflx" ) ) THEN |
---|
218 | zw2d(:,:) = zoflx(:,:) * 1000 * tmask(:,:,1) |
---|
219 | CALL iom_put( "Oflx" , zw2d ) |
---|
220 | ENDIF |
---|
221 | IF( iom_use( "Kg" ) ) THEN |
---|
222 | zw2d(:,:) = zkgco2(:,:) * tmask(:,:,1) |
---|
223 | CALL iom_put( "Kg" , zw2d ) |
---|
224 | ENDIF |
---|
225 | IF( iom_use( "Dpco2" ) ) THEN |
---|
226 | zw2d(:,:) = ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:) + rtrn ) ) * tmask(:,:,1) |
---|
227 | CALL iom_put( "Dpco2" , zw2d ) |
---|
228 | ENDIF |
---|
229 | IF( iom_use( "Dpo2" ) ) THEN |
---|
230 | zw2d(:,:) = ( atcox * patm(:,:) - atcox * trn(:,:,1,jpoxy) / ( chemo2(:,:,1) + rtrn ) ) * tmask(:,:,1) |
---|
231 | CALL iom_put( "Dpo2" , zw2d ) |
---|
232 | ENDIF |
---|
233 | IF( iom_use( "tcflx" ) ) CALL iom_put( "tcflx" , t_oce_co2_flx * rfact2r ) ! molC/s |
---|
234 | CALL iom_put( "tcflxcum" , t_oce_co2_flx_cum ) ! molC |
---|
235 | ! |
---|
236 | CALL wrk_dealloc( jpi, jpj, zw2d ) |
---|
237 | ELSE |
---|
238 | IF( ln_diatrc ) THEN |
---|
239 | trc2d(:,:,jp_pcs0_2d ) = oce_co2(:,:) / e1e2t(:,:) * rfact2r |
---|
240 | trc2d(:,:,jp_pcs0_2d + 1) = zoflx(:,:) * 1000 * tmask(:,:,1) |
---|
241 | trc2d(:,:,jp_pcs0_2d + 2) = zkgco2(:,:) * tmask(:,:,1) |
---|
242 | trc2d(:,:,jp_pcs0_2d + 3) = ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:) + rtrn ) ) * tmask(:,:,1) |
---|
243 | ENDIF |
---|
244 | ENDIF |
---|
245 | ! |
---|
246 | CALL wrk_dealloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx ) |
---|
247 | ! |
---|
248 | IF( nn_timing == 1 ) CALL timing_stop('p4z_flx') |
---|
249 | ! |
---|
250 | END SUBROUTINE p4z_flx |
---|
251 | |
---|
252 | |
---|
253 | SUBROUTINE p4z_flx_init |
---|
254 | !!---------------------------------------------------------------------- |
---|
255 | !! *** ROUTINE p4z_flx_init *** |
---|
256 | !! |
---|
257 | !! ** Purpose : Initialization of atmospheric conditions |
---|
258 | !! |
---|
259 | !! ** Method : Read the nampisext namelist and check the parameters |
---|
260 | !! called at the first timestep (nittrc000) |
---|
261 | !! ** input : Namelist nampisext |
---|
262 | !!---------------------------------------------------------------------- |
---|
263 | NAMELIST/nampisext/ln_co2int, atcco2, clname, nn_offset |
---|
264 | INTEGER :: jm |
---|
265 | INTEGER :: ios ! Local integer output status for namelist read |
---|
266 | !!---------------------------------------------------------------------- |
---|
267 | ! |
---|
268 | |
---|
269 | REWIND( numnatp_ref ) ! Namelist nampisext in reference namelist : Pisces atm. conditions |
---|
270 | READ ( numnatp_ref, nampisext, IOSTAT = ios, ERR = 901) |
---|
271 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisext in reference namelist', lwp ) |
---|
272 | |
---|
273 | REWIND( numnatp_cfg ) ! Namelist nampisext in configuration namelist : Pisces atm. conditions |
---|
274 | READ ( numnatp_cfg, nampisext, IOSTAT = ios, ERR = 902 ) |
---|
275 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisext in configuration namelist', lwp ) |
---|
276 | IF(lwm) WRITE ( numonp, nampisext ) |
---|
277 | ! |
---|
278 | IF(lwp) THEN ! control print |
---|
279 | WRITE(numout,*) ' ' |
---|
280 | WRITE(numout,*) ' Namelist parameters for air-sea exchange, nampisext' |
---|
281 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
282 | WRITE(numout,*) ' Choice for reading in the atm pCO2 file or constant value, ln_co2int =', ln_co2int |
---|
283 | WRITE(numout,*) ' ' |
---|
284 | ENDIF |
---|
285 | IF( .NOT.ln_co2int ) THEN |
---|
286 | IF(lwp) THEN ! control print |
---|
287 | WRITE(numout,*) ' Constant Atmospheric pCO2 value atcco2 =', atcco2 |
---|
288 | WRITE(numout,*) ' ' |
---|
289 | ENDIF |
---|
290 | satmco2(:,:) = atcco2 ! Initialisation of atmospheric pco2 |
---|
291 | ELSE |
---|
292 | IF(lwp) THEN |
---|
293 | WRITE(numout,*) ' Atmospheric pCO2 value from file clname =', TRIM( clname ) |
---|
294 | WRITE(numout,*) ' Offset model-data start year nn_offset =', nn_offset |
---|
295 | WRITE(numout,*) ' ' |
---|
296 | ENDIF |
---|
297 | CALL ctl_opn( numco2, TRIM( clname) , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1 , numout, lwp ) |
---|
298 | jm = 0 ! Count the number of record in co2 file |
---|
299 | DO |
---|
300 | READ(numco2,*,END=100) |
---|
301 | jm = jm + 1 |
---|
302 | END DO |
---|
303 | 100 nmaxrec = jm - 1 |
---|
304 | ALLOCATE( years (nmaxrec) ) ; years (:) = 0._wp |
---|
305 | ALLOCATE( atcco2h(nmaxrec) ) ; atcco2h(:) = 0._wp |
---|
306 | |
---|
307 | REWIND(numco2) |
---|
308 | DO jm = 1, nmaxrec ! get xCO2 data |
---|
309 | READ(numco2, *) years(jm), atcco2h(jm) |
---|
310 | IF(lwp) WRITE(numout, '(f6.0,f7.2)') years(jm), atcco2h(jm) |
---|
311 | END DO |
---|
312 | CLOSE(numco2) |
---|
313 | ENDIF |
---|
314 | ! |
---|
315 | oce_co2(:,:) = 0._wp ! Initialization of Flux of Carbon |
---|
316 | t_oce_co2_flx = 0._wp |
---|
317 | t_atm_co2_flx = 0._wp |
---|
318 | ! |
---|
319 | CALL p4z_patm( nit000 ) |
---|
320 | ! |
---|
321 | END SUBROUTINE p4z_flx_init |
---|
322 | |
---|
323 | SUBROUTINE p4z_patm( kt ) |
---|
324 | |
---|
325 | !!---------------------------------------------------------------------- |
---|
326 | !! *** ROUTINE p4z_atm *** |
---|
327 | !! |
---|
328 | !! ** Purpose : Read and interpolate the external atmospheric sea-levl pressure |
---|
329 | !! ** Method : Read the files and interpolate the appropriate variables |
---|
330 | !! |
---|
331 | !!---------------------------------------------------------------------- |
---|
332 | !! * arguments |
---|
333 | INTEGER, INTENT( in ) :: kt ! ocean time step |
---|
334 | ! |
---|
335 | INTEGER :: ierr |
---|
336 | INTEGER :: ios ! Local integer output status for namelist read |
---|
337 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files |
---|
338 | TYPE(FLD_N) :: sn_patm ! informations about the fields to be read |
---|
339 | !! |
---|
340 | NAMELIST/nampisatm/ ln_presatm, sn_patm, cn_dir |
---|
341 | |
---|
342 | ! ! ----------------------- ! |
---|
343 | IF( kt == nit000 ) THEN ! First call kt=nittrc000 ! |
---|
344 | |
---|
345 | REWIND( numnatp_ref ) ! Namelist nampisatm in reference namelist : Pisces atm. sea level pressure file |
---|
346 | READ ( numnatp_ref, nampisatm, IOSTAT = ios, ERR = 901) |
---|
347 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisatm in reference namelist', lwp ) |
---|
348 | |
---|
349 | REWIND( numnatp_cfg ) ! Namelist nampisatm in configuration namelist : Pisces atm. sea level pressure file |
---|
350 | READ ( numnatp_cfg, nampisatm, IOSTAT = ios, ERR = 902 ) |
---|
351 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisatm in configuration namelist', lwp ) |
---|
352 | IF(lwm) WRITE ( numonp, nampisatm ) |
---|
353 | ! |
---|
354 | ! |
---|
355 | IF(lwp) THEN !* control print |
---|
356 | WRITE(numout,*) |
---|
357 | WRITE(numout,*) ' Namelist nampisatm : Atmospheric Pressure as external forcing' |
---|
358 | WRITE(numout,*) ' constant atmopsheric pressure (F) or from a file (T) ln_presatm = ', ln_presatm |
---|
359 | WRITE(numout,*) |
---|
360 | ENDIF |
---|
361 | ! |
---|
362 | IF( ln_presatm ) THEN |
---|
363 | ALLOCATE( sf_patm(1), STAT=ierr ) !* allocate and fill sf_patm (forcing structure) with sn_patm |
---|
364 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_flx: unable to allocate sf_patm structure' ) |
---|
365 | ! |
---|
366 | CALL fld_fill( sf_patm, (/ sn_patm /), cn_dir, 'p4z_flx', 'Atmospheric pressure ', 'nampisatm' ) |
---|
367 | ALLOCATE( sf_patm(1)%fnow(jpi,jpj,1) ) |
---|
368 | IF( sn_patm%ln_tint ) ALLOCATE( sf_patm(1)%fdta(jpi,jpj,1,2) ) |
---|
369 | ENDIF |
---|
370 | ! |
---|
371 | IF( .NOT.ln_presatm ) patm(:,:) = 1.e0 ! Initialize patm if no reading from a file |
---|
372 | ! |
---|
373 | ENDIF |
---|
374 | ! |
---|
375 | IF( ln_presatm ) THEN |
---|
376 | CALL fld_read( kt, 1, sf_patm ) !* input Patm provided at kt + 1/2 |
---|
377 | patm(:,:) = sf_patm(1)%fnow(:,:,1) ! atmospheric pressure |
---|
378 | ENDIF |
---|
379 | ! |
---|
380 | END SUBROUTINE p4z_patm |
---|
381 | |
---|
382 | INTEGER FUNCTION p4z_flx_alloc() |
---|
383 | !!---------------------------------------------------------------------- |
---|
384 | !! *** ROUTINE p4z_flx_alloc *** |
---|
385 | !!---------------------------------------------------------------------- |
---|
386 | ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), patm(jpi,jpj), STAT=p4z_flx_alloc ) |
---|
387 | ! |
---|
388 | IF( p4z_flx_alloc /= 0 ) CALL ctl_warn('p4z_flx_alloc : failed to allocate arrays') |
---|
389 | ! |
---|
390 | END FUNCTION p4z_flx_alloc |
---|
391 | |
---|
392 | #else |
---|
393 | !!====================================================================== |
---|
394 | !! Dummy module : No PISCES bio-model |
---|
395 | !!====================================================================== |
---|
396 | CONTAINS |
---|
397 | SUBROUTINE p4z_flx( kt ) ! Empty routine |
---|
398 | INTEGER, INTENT( in ) :: kt |
---|
399 | WRITE(*,*) 'p4z_flx: You should not have seen this print! error?', kt |
---|
400 | END SUBROUTINE p4z_flx |
---|
401 | #endif |
---|
402 | |
---|
403 | !!====================================================================== |
---|
404 | END MODULE p4zflx |
---|