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 NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/CFC – NEMO

source: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/CFC/trcsms_cfc.F90 @ 10975

Last change on this file since 10975 was 10975, checked in by acc, 5 years ago

2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : Finish converting all TOP routines and knock-on effects of these conversions. Fully SETTE tested (SETTE tests 1-6 and 9). This completes the first stage conversion of TRA and TOP but need to revisit and pass ts and tr arrays through the argument lists where appropriate.

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