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 branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/CFC – NEMO

source: branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90 @ 7068

Last change on this file since 7068 was 7068, checked in by cetlod, 8 years ago

ROBUST5_CNRS : implementation of part I of new TOP interface - 1st step -, see ticket #1782

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