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.
trcini_cfc.F90 in NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/CFC – NEMO

source: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/CFC/trcini_cfc.F90 @ 10345

Last change on this file since 10345 was 10068, checked in by nicolasmartin, 6 years ago

First part of modifications to have a common default header : fix typos and SVN keywords properties

  • Property svn:keywords set to Id
File size: 5.5 KB
Line 
1MODULE trcini_cfc
2   !!======================================================================
3   !!                         ***  MODULE trcini_cfc  ***
4   !! TOP :   initialisation of the CFC tracers
5   !!======================================================================
6   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec)
7   !!----------------------------------------------------------------------
8   !!----------------------------------------------------------------------
9   !! trc_ini_cfc      : CFC model initialisation
10   !!----------------------------------------------------------------------
11   USE oce_trc         ! Ocean variables
12   USE par_trc         ! TOP parameters
13   USE trc             ! TOP variables
14   USE trcnam_cfc      ! CFC SMS namelist
15   USE trcsms_cfc      ! CFC sms trends
16
17   IMPLICIT NONE
18   PRIVATE
19
20   PUBLIC   trc_ini_cfc   ! called by trcini.F90 module
21
22   INTEGER  ::   inum                   ! unit number
23   REAL(wp) ::   ylats = -10.           ! 10 degrees south
24   REAL(wp) ::   ylatn =  10.           ! 10 degrees north
25
26   !!----------------------------------------------------------------------
27   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
28   !! $Id$
29   !! Software governed by the CeCILL license (see ./LICENSE)
30   !!----------------------------------------------------------------------
31CONTAINS
32
33   SUBROUTINE trc_ini_cfc
34      !!----------------------------------------------------------------------
35      !!                     ***  trc_ini_cfc  *** 
36      !!
37      !! ** Purpose :   initialization for cfc model
38      !!
39      !! ** Method  : - Read the namcfc namelist and check the parameter values
40      !!----------------------------------------------------------------------
41      INTEGER  ::  ji, jj, jn, jl, jm, js, io, ierr
42      INTEGER  ::  iskip = 6   ! number of 1st descriptor lines
43      REAL(wp) ::  zyy, zyd
44      CHARACTER(len = 20)  ::  cltra
45      !!----------------------------------------------------------------------
46      !
47      CALL trc_nam_cfc
48      !
49      IF(lwp) WRITE(numout,*)
50      IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model'
51      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
52      !
53      IF(lwp) WRITE(numout,*) 'Read annual atmospheric concentratioins from formatted file : ' // TRIM(clname)
54     
55      CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
56      REWIND(inum)
57     
58      ! compute the number of year in the file
59      ! file starts in 1931 do jn represent the year in the century
60      jn = 31 
61      DO
62        READ(inum,'(1x)',END=100) 
63        jn = jn + 1
64      END DO
65 100  jpyear = jn - 1 - iskip
66      IF ( lwp) WRITE(numout,*) '   --->  ', jpyear ,' years read'
67      !                                ! Allocate CFC arrays
68
69      ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr )
70      IF( ierr > 0 ) THEN
71         CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' )   ;   RETURN
72      ENDIF
73      IF( trc_sms_cfc_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' )
74
75
76      ! Initialization of boundaries conditions
77      ! ---------------------------------------
78      xphem (:,:)    = 0._wp
79      p_cfc(:,:,:)   = 0._wp
80     
81      ! Initialization of qint in case of  no restart
82      !----------------------------------------------
83      qtr_cfc(:,:,:) = 0._wp
84      IF( .NOT. ln_rsttr ) THEN   
85         IF(lwp) THEN
86            WRITE(numout,*)
87            WRITE(numout,*) 'Initialisation of qint ; No restart : qint equal zero '
88         ENDIF
89         qint_cfc(:,:,:) = 0._wp
90         DO jl = 1, jp_cfc
91            jn = jp_cfc0 + jl - 1
92            trn(:,:,:,jn) = 0._wp
93         END DO
94      ENDIF
95
96      REWIND(inum)
97     
98      DO jm = 1, iskip        ! Skip over 1st six descriptor lines
99         READ(inum,'(1x)')
100      END DO
101      ! file starts in 1931 do jn represent the year in the century.jhh
102      ! Read file till the end
103      jn = 31
104      DO
105        READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3)
106        IF( io < 0 ) exit
107        jn = jn + 1
108      END DO
109
110      !p_cfc(32,1:2,1) = 5.e-4      ! modify the values of the first years
111      !p_cfc(33,1:2,1) = 8.e-4
112      !p_cfc(34,1:2,1) = 1.e-6
113      !p_cfc(35,1:2,1) = 2.e-3
114      !p_cfc(36,1:2,1) = 4.e-3
115      !p_cfc(37,1:2,1) = 6.e-3
116      !p_cfc(38,1:2,1) = 8.e-3
117      !p_cfc(39,1:2,1) = 1.e-2
118      IF(lwp) THEN        ! Control print
119         WRITE(numout,*)
120         WRITE(numout,*) ' Year   c11NH     c11SH     c12NH     c12SH     SF6NH     SF6SH'
121         DO jn = 30, jpyear
122            WRITE(numout, '( 1I4, 6F10.4)') jn, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3)
123         END DO
124      ENDIF
125
126
127      ! Interpolation factor of atmospheric partial pressure
128      ! Linear interpolation between 2 hemispheric function of latitud between ylats and ylatn
129      !---------------------------------------------------------------------------------------
130      zyd = ylatn - ylats     
131      DO jj = 1 , jpj
132         DO ji = 1 , jpi
133            IF(     gphit(ji,jj) >= ylatn ) THEN   ;   xphem(ji,jj) = 1.e0
134            ELSEIF( gphit(ji,jj) <= ylats ) THEN   ;   xphem(ji,jj) = 0.e0
135            ELSE                                   ;   xphem(ji,jj) = ( gphit(ji,jj) - ylats) / zyd
136            ENDIF
137         END DO
138      END DO
139      !
140      IF(lwp) WRITE(numout,*) 'Initialization of CFC tracers done'
141      IF(lwp) WRITE(numout,*) ' '
142      !
143   END SUBROUTINE trc_ini_cfc
144
145   !!======================================================================
146END MODULE trcini_cfc
Note: See TracBrowser for help on using the repository browser.