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