New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
trcsms_cfc.F90 in branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/CFC – NEMO

source: branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90 @ 8353

Last change on this file since 8353 was 8353, checked in by lovato, 7 years ago

3.6 stable: update TOP modules and shared configuraton files for CMIP6 (#1925)

  • Property svn:keywords set to Id
File size: 14.2 KB
Line 
1MODULE trcsms_cfc
2   !!======================================================================
3   !!                      ***  MODULE trcsms_cfc  ***
4   !! TOP : CFC main model
5   !!======================================================================
6   !! History :  OPA  !  1999-10  (JC. Dutay)  original code
7   !!  NEMO      1.0  !  2004-03  (C. Ethe) free form + modularity
8   !!            2.0  !  2007-12  (C. Ethe, G. Madec)  reorganisation
9   !!----------------------------------------------------------------------
10#if defined key_cfc
11   !!----------------------------------------------------------------------
12   !!   'key_cfc'                                               CFC tracers
13   !!----------------------------------------------------------------------
14   !!   trc_sms_cfc  :  compute and add CFC suface forcing to CFC trends
15   !!   cfc_init     :  sets constants for CFC surface forcing computation
16   !!----------------------------------------------------------------------
17   USE oce_trc       ! Ocean variables
18   USE par_trc       ! TOP parameters
19   USE trc           ! TOP variables
20   USE trd_oce
21   USE trdtrc
22   USE iom           ! I/O library
23
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   trc_sms_cfc         ! called in ???   
28   PUBLIC   trc_sms_cfc_alloc   ! called in trcini_cfc.F90
29
30   INTEGER , PUBLIC, PARAMETER ::   jphem  =   2   ! parameter for the 2 hemispheres
31   INTEGER , PUBLIC            ::   jpyear         ! Number of years read in input data file (in trcini_cfc)
32   INTEGER , PUBLIC            ::   ndate_beg      ! initial calendar date (aammjj) for CFC
33   INTEGER , PUBLIC            ::   nyear_res      ! restoring time constant (year)
34   INTEGER , PUBLIC            ::   nyear_beg      ! initial year (aa)
35   CHARACTER(len=200), PUBLIC  ::   clnamecfc      ! Input filename of CFCs atm. concentrations
36   
37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   p_cfc    ! partial hemispheric pressure for CFC
38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   xphem    ! spatial interpolation factor for patm
39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qtr_cfc  ! flux at surface
40   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qint_cfc ! cumulative flux
41   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   atm_cfc  ! partial hemispheric pressure for used CFC
42   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   patm     ! atmospheric function
43
44   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   soa      ! coefficient for solubility of CFC [mol/l/atm]
45   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sob      !    "               "
46   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   sca      ! coefficients for schmidt number in degrees Celsius
47   !                          ! coefficients for conversion
48   REAL(wp) ::   xconv1 = 1.0          ! conversion from to
49   REAL(wp) ::   xconv2 = 0.01/3600.   ! conversion from cm/h to m/s:
50   REAL(wp) ::   xconv3 = 1.0e+3       ! conversion from mol/l/atm to mol/m3/atm
51   REAL(wp) ::   xconv4 = 1.0e-12      ! conversion from mol/m3/atm to mol/m3/pptv
52
53   !! * Substitutions
54#  include "top_substitute.h90"
55   !!----------------------------------------------------------------------
56   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
57   !! $Id$
58   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
59   !!----------------------------------------------------------------------
60CONTAINS
61
62   SUBROUTINE trc_sms_cfc( kt )
63      !!----------------------------------------------------------------------
64      !!                     ***  ROUTINE trc_sms_cfc  ***
65      !!
66      !! ** Purpose :   Compute the surface boundary contition on CFC 11
67      !!             passive tracer associated with air-mer fluxes and add it
68      !!             to the general trend of tracers equations.
69      !!
70      !! ** Method  : - get the atmospheric partial pressure - given in pico -
71      !!              - computation of solubility ( in 1.e-12 mol/l then in 1.e-9 mol/m3)
72      !!              - computation of transfert speed ( given in cm/hour ----> cm/s )
73      !!              - the input function is given by :
74      !!                speed * ( concentration at equilibrium - concentration at surface )
75      !!              - the input function is in pico-mol/m3/s and the
76      !!                CFC concentration in pico-mol/m3
77      !!----------------------------------------------------------------------
78      !
79      INTEGER, INTENT(in) ::   kt    ! ocean time-step index
80      !
81      INTEGER  ::   ji, jj, jn, jl, jm, js
82      INTEGER  ::   iyear_beg, iyear_end
83      INTEGER  ::   im1, im2, ierr
84      REAL(wp) ::   ztap, zdtap       
85      REAL(wp) ::   zt1, zt2, zt3, zt4, zv2
86      REAL(wp) ::   zsol      ! solubility
87      REAL(wp) ::   zsch      ! schmidt number
88      REAL(wp) ::   zpp_cfc   ! atmospheric partial pressure of CFC
89      REAL(wp) ::   zca_cfc   ! concentration at equilibrium
90      REAL(wp) ::   zak_cfc   ! transfert coefficients
91      REAL(wp), ALLOCATABLE, DIMENSION(:,:)  ::   zpatm     ! atmospheric function
92      !!----------------------------------------------------------------------
93      !
94      !
95      IF( nn_timing == 1 )  CALL timing_start('trc_sms_cfc')
96      !
97      ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr )
98      IF( ierr > 0 ) THEN
99         CALL ctl_stop( 'trc_sms_cfc: unable to allocate zpatm array' )   ;   RETURN
100      ENDIF
101
102      IF( kt == nittrc000 )   CALL cfc_init
103
104      ! Temporal interpolation
105      ! ----------------------
106      iyear_beg = nyear - 1900
107      IF ( nmonth <= 6 ) THEN
108         iyear_beg = iyear_beg - 1
109         im1       =  6 - nmonth + 1
110         im2       =  6 + nmonth - 1
111      ELSE
112         im1       = 12 - nmonth + 7
113         im2       =      nmonth - 7
114      ENDIF
115      iyear_end = iyear_beg + 1
116
117      !                                                  !------------!
118      DO jl = 1, jp_cfc                                  !  CFC loop  !
119         !                                               !------------!
120         jn = jp_cfc0 + jl - 1
121         ! time interpolation at time kt
122         DO jm = 1, jphem
123            zpatm(jm,jl) = (  atm_cfc(iyear_beg, jm, jl) * REAL(im1, wp)  &
124               &           +  atm_cfc(iyear_end, jm, jl) * REAL(im2, wp) ) / 12.
125         END DO
126         
127         !                                                         !------------!
128         DO jj = 1, jpj                                            !  i-j loop  !
129            DO ji = 1, jpi                                         !------------!
130 
131               ! space interpolation
132               zpp_cfc  =       xphem(ji,jj)   * zpatm(1,jl)   &
133                  &     + ( 1.- xphem(ji,jj) ) * zpatm(2,jl)
134
135               ! Computation of concentration at equilibrium : in picomol/l
136               ! coefficient for solubility for CFC-11/12 in  mol/l/atm
137               IF( tmask(ji,jj,1) .GE. 0.5 ) THEN
138                  ztap  = ( tsn(ji,jj,1,jp_tem) + 273.16 ) * 0.01
139                  zdtap = sob(1,jl) + ztap * ( sob(2,jl) + ztap * sob(3,jl) ) 
140                  zsol  =  EXP( soa(1,jl) + soa(2,jl) / ztap + soa(3,jl) * LOG( ztap )   &
141                     &                    + soa(4,jl) * ztap * ztap + tsn(ji,jj,1,jp_sal) * zdtap ) 
142               ELSE
143                  zsol  = 0.e0
144               ENDIF
145               ! conversion from mol/l/atm to mol/m3/atm and from mol/m3/atm to mol/m3/pptv   
146               zsol = xconv4 * xconv3 * zsol * tmask(ji,jj,1) 
147               ! concentration at equilibrium
148               zca_cfc = xconv1 * zpp_cfc * zsol * tmask(ji,jj,1)             
149 
150               ! Computation of speed transfert
151               !    Schmidt number revised in Wanninkhof (2014)
152               zt1  = tsn(ji,jj,1,jp_tem)
153               zt2  = zt1 * zt1 
154               zt3  = zt1 * zt2
155               zt4  = zt2 * zt2
156               zsch = sca(1,jl) + sca(2,jl) * zt1 + sca(3,jl) * zt2 + sca(4,jl) * zt3 + sca(5,jl) * zt4
157
158               !    speed transfert : formulae revised in Wanninkhof (2014)
159               zv2     = wndm(ji,jj) * wndm(ji,jj)
160               zsch    = zsch / 660.
161               zak_cfc = ( 0.31 * xconv2 * zv2 / SQRT(zsch) ) * tmask(ji,jj,1)
162
163               ! Input function  : speed *( conc. at equil - concen at surface )
164               ! trn in pico-mol/l idem qtr; ak in en m/a
165               qtr_cfc(ji,jj,jl) = -zak_cfc * ( trb(ji,jj,1,jn) - zca_cfc )   &
166#if defined key_degrad
167                  &                         * facvol(ji,jj,1)                           &
168#endif
169                  &                         * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) )
170               ! Add the surface flux to the trend
171               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + qtr_cfc(ji,jj,jl) / fse3t(ji,jj,1) 
172
173               ! cumulation of surface flux at each time step
174               qint_cfc(ji,jj,jl) = qint_cfc(ji,jj,jl) + qtr_cfc(ji,jj,jl) * rdt
175               !                                               !----------------!
176            END DO                                             !  end i-j loop  !
177         END DO                                                !----------------!
178         !                                                  !----------------!
179      END DO                                                !  end CFC loop  !
180      !
181      IF( lrst_trc ) THEN
182         IF(lwp) WRITE(numout,*)
183         IF(lwp) WRITE(numout,*) 'trc_sms_cfc : cumulated input function fields written in ocean restart file ',   &
184            &                    'at it= ', kt,' date= ', ndastp
185         IF(lwp) WRITE(numout,*) '~~~~'
186         DO jn = jp_cfc0, jp_cfc1
187            CALL iom_rstput( kt, nitrst, numrtw, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) )
188         END DO
189      ENDIF                                           
190      !
191      IF( lk_iomput ) THEN
192         DO jn = jp_cfc0, jp_cfc1
193            CALL iom_put( 'qtr_'//TRIM(ctrcnm(jn)) , qtr_cfc (:,:,jn) )
194            CALL iom_put( 'qint_'//TRIM(ctrcnm(jn)), qint_cfc(:,:,jn) )
195         ENDDO
196      ELSE
197         IF( ln_diatrc ) THEN
198            jl = 0
199            DO jn = jp_cfc0_2d, jp_cfc1_2d, 2
200               jl = jl + 1
201               trc2d(:,:,jn    ) = qtr_cfc (:,:,jl)
202               trc2d(:,:,jn + 1) = qint_cfc(:,:,jl)
203            ENDDO
204         END IF
205      END IF
206      !
207      IF( l_trdtrc ) THEN
208          DO jn = jp_cfc0, jp_cfc1
209            CALL trd_trc( tra(:,:,:,jn), jn, jptra_sms, kt )   ! save trends
210          END DO
211      END IF
212      !
213      IF( nn_timing == 1 )  CALL timing_stop('trc_sms_cfc')
214      !
215   END SUBROUTINE trc_sms_cfc
216
217
218   SUBROUTINE cfc_init
219      !!---------------------------------------------------------------------
220      !!                     ***  cfc_init  *** 
221      !!
222      !! ** Purpose : sets constants for CFC model
223      !!---------------------------------------------------------------------
224      INTEGER :: jn
225      !!----------------------------------------------------------------------
226      !
227      jn = 0 
228      ! coefficient for CFC11
229      !----------------------
230      if ( lp_cfc11 ) then
231         jn = jn + 1
232         ! Solubility
233         soa(1,jn) = -229.9261 
234         soa(2,jn) =  319.6552
235         soa(3,jn) =  119.4471
236         soa(4,jn) =  -1.39165
237
238         sob(1,jn) =  -0.142382
239         sob(2,jn) =   0.091459
240         sob(3,jn) =  -0.0157274
241
242         ! Schmidt number
243         sca(1,jn) = 3579.2
244         sca(2,jn) = -222.63
245         sca(3,jn) = 7.5749
246         sca(4,jn) = -0.14595
247         sca(5,jn) = 0.0011874
248
249         ! atm. concentration
250         atm_cfc(:,:,jn) = p_cfc(:,:,1)
251      endif
252
253      ! coefficient for CFC12
254      !----------------------
255      if ( lp_cfc12 ) then
256         jn = jn + 1
257         ! Solubility
258         soa(1,jn) = -218.0971
259         soa(2,jn) =  298.9702
260         soa(3,jn) =  113.8049
261         soa(4,jn) =  -1.39165
262
263         sob(1,jn) =  -0.143566
264         sob(2,jn) =   0.091015
265         sob(3,jn) =  -0.0153924
266
267         ! schmidt number
268         sca(1,jn) = 3828.1
269         sca(2,jn) = -249.86
270         sca(3,jn) = 8.7603
271         sca(4,jn) = -0.1716
272         sca(5,jn) = 0.001408
273
274         ! atm. concentration
275         atm_cfc(:,:,jn) = p_cfc(:,:,2)
276      endif
277
278      ! coefficient for SF6
279      !----------------------
280      if ( lp_sf6 ) then
281         jn = jn + 1
282         ! Solubility
283         soa(1,jn) = -80.0343
284         soa(2,jn) = 117.232
285         soa(3,jn) =  29.5817
286         soa(4,jn) =   0.0
287
288         sob(1,jn) =  0.0335183 
289         sob(2,jn) = -0.0373942 
290         sob(3,jn) =  0.00774862
291
292         ! schmidt number
293         sca(1,jn) = 3177.5
294         sca(2,jn) = -200.57
295         sca(3,jn) = 6.8865
296         sca(4,jn) = -0.13335
297         sca(5,jn) = 0.0010877
298 
299         ! atm. concentration
300         atm_cfc(:,:,jn) = p_cfc(:,:,3)
301       endif
302
303      IF( ln_rsttr ) THEN
304         IF(lwp) WRITE(numout,*)
305         IF(lwp) WRITE(numout,*) ' Read specific variables from CFC model '
306         IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
307         !
308         DO jn = jp_cfc0, jp_cfc1
309            CALL iom_get( numrtr, jpdom_autoglo, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 
310         END DO
311      ENDIF
312      IF(lwp) WRITE(numout,*)
313      !
314   END SUBROUTINE cfc_init
315
316
317   INTEGER FUNCTION trc_sms_cfc_alloc()
318      !!----------------------------------------------------------------------
319      !!                     ***  ROUTINE trc_sms_cfc_alloc  ***
320      !!----------------------------------------------------------------------
321      ALLOCATE( xphem   (jpi,jpj)        , atm_cfc(jpyear,jphem,jp_cfc)  ,    &
322         &      qtr_cfc (jpi,jpj,jp_cfc) , qint_cfc(jpi,jpj,jp_cfc)      ,    &
323         &      soa(4,jp_cfc)    ,  sob(3,jp_cfc)   ,  sca(5,jp_cfc)     ,    &
324         &      STAT=trc_sms_cfc_alloc )
325         !
326      IF( trc_sms_cfc_alloc /= 0 ) CALL ctl_warn('trc_sms_cfc_alloc : failed to allocate arrays.')
327      !
328   END FUNCTION trc_sms_cfc_alloc
329
330#else
331   !!----------------------------------------------------------------------
332   !!   Dummy module                                         No CFC tracers
333   !!----------------------------------------------------------------------
334CONTAINS
335   SUBROUTINE trc_sms_cfc( kt )       ! Empty routine
336      WRITE(*,*) 'trc_sms_cfc: You should not have seen this print! error?', kt
337   END SUBROUTINE trc_sms_cfc
338#endif
339
340   !!======================================================================
341END MODULE trcsms_cfc
Note: See TracBrowser for help on using the repository browser.