1 | MODULE 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 | !! ! 2017-04 (A. Yool) Add SF6 |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | #if defined key_cfc |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_cfc' CFC tracers |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! trc_ini_cfc : CFC model initialisation |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE oce_trc ! Ocean variables |
---|
16 | USE par_trc ! TOP parameters |
---|
17 | USE trc ! TOP variables |
---|
18 | USE trcsms_cfc ! CFC sms trends |
---|
19 | |
---|
20 | IMPLICIT NONE |
---|
21 | PRIVATE |
---|
22 | |
---|
23 | PUBLIC trc_ini_cfc ! called by trcini.F90 module |
---|
24 | |
---|
25 | CHARACTER (len=34) :: clname = 'cfc1112sf6.atm' ! ??? |
---|
26 | |
---|
27 | INTEGER :: inum ! unit number |
---|
28 | REAL(wp) :: ylats = -10. ! 10 degrees south |
---|
29 | REAL(wp) :: ylatn = 10. ! 10 degrees north |
---|
30 | |
---|
31 | !!---------------------------------------------------------------------- |
---|
32 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
33 | !! $Id$ |
---|
34 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
35 | !!---------------------------------------------------------------------- |
---|
36 | CONTAINS |
---|
37 | |
---|
38 | SUBROUTINE trc_ini_cfc |
---|
39 | !!---------------------------------------------------------------------- |
---|
40 | !! *** trc_ini_cfc *** |
---|
41 | !! |
---|
42 | !! ** Purpose : initialization for cfc model |
---|
43 | !! |
---|
44 | !! ** Method : - Read the namcfc namelist and check the parameter values |
---|
45 | !!---------------------------------------------------------------------- |
---|
46 | INTEGER :: ji, jj, jn, jl, jm, js, io, ierr |
---|
47 | INTEGER :: iskip = 7 ! number of 1st descriptor lines |
---|
48 | REAL(wp) :: zyy, zyd |
---|
49 | !!---------------------------------------------------------------------- |
---|
50 | |
---|
51 | IF(lwp) WRITE(numout,*) |
---|
52 | IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model' |
---|
53 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' |
---|
54 | |
---|
55 | |
---|
56 | IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112sf6.atm' |
---|
57 | |
---|
58 | CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) |
---|
59 | REWIND(inum) |
---|
60 | |
---|
61 | ! compute the number of year in the file |
---|
62 | ! file starts in 1931 do jn represent the year in the century |
---|
63 | jn = 31 |
---|
64 | DO |
---|
65 | READ(inum,'(1x)',END=100) |
---|
66 | jn = jn + 1 |
---|
67 | END DO |
---|
68 | 100 jpyear = jn - 1 - iskip |
---|
69 | IF ( lwp) WRITE(numout,*) ' ', jpyear ,' years read' |
---|
70 | ! ! Allocate CFC arrays |
---|
71 | |
---|
72 | ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr ) |
---|
73 | IF( ierr > 0 ) THEN |
---|
74 | CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN |
---|
75 | ENDIF |
---|
76 | IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) |
---|
77 | |
---|
78 | |
---|
79 | ! Initialization of boundaries conditions |
---|
80 | ! --------------------------------------- |
---|
81 | xphem (:,:) = 0._wp |
---|
82 | p_cfc(:,:,:) = 0._wp |
---|
83 | |
---|
84 | ! Initialization of qint in case of no restart |
---|
85 | !---------------------------------------------- |
---|
86 | qtr_cfc(:,:,:) = 0._wp |
---|
87 | IF( .NOT. ln_rsttr ) THEN |
---|
88 | IF(lwp) THEN |
---|
89 | WRITE(numout,*) |
---|
90 | WRITE(numout,*) 'Initialization de qint ; No restart : qint equal zero ' |
---|
91 | ENDIF |
---|
92 | qint_cfc(:,:,:) = 0._wp |
---|
93 | trn(:,:,:,jp_cfc0:jp_cfc1) = 0._wp |
---|
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,1), p_cfc(jn,1,2), & |
---|
106 | & p_cfc(jn,1,3), p_cfc(jn,2,1), & |
---|
107 | & p_cfc(jn,2,2), p_cfc(jn,2,3) |
---|
108 | IF( io < 0 ) exit |
---|
109 | jn = jn + 1 |
---|
110 | END DO |
---|
111 | |
---|
112 | ! AXY (25/04/17): do not adjust |
---|
113 | ! p_cfc(32,1:2,1) = 5.e-4 ! modify the values of the first years |
---|
114 | ! p_cfc(33,1:2,1) = 8.e-4 |
---|
115 | ! p_cfc(34,1:2,1) = 1.e-6 |
---|
116 | ! p_cfc(35,1:2,1) = 2.e-3 |
---|
117 | ! p_cfc(36,1:2,1) = 4.e-3 |
---|
118 | ! p_cfc(37,1:2,1) = 6.e-3 |
---|
119 | ! p_cfc(38,1:2,1) = 8.e-3 |
---|
120 | ! p_cfc(39,1:2,1) = 1.e-2 |
---|
121 | |
---|
122 | IF(lwp) THEN ! Control print |
---|
123 | WRITE(numout,*) |
---|
124 | WRITE(numout,*) ' Year p11HN p11HS p12HN p12HS pSF6N pSF6S ' |
---|
125 | DO jn = 30, jpyear |
---|
126 | WRITE(numout, '( 1I4, 6F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), & |
---|
127 | & p_cfc(jn,1,2), p_cfc(jn,2,2), & |
---|
128 | & p_cfc(jn,1,3), p_cfc(jn,2,3) |
---|
129 | END DO |
---|
130 | ENDIF |
---|
131 | |
---|
132 | ! Interpolation factor of atmospheric partial pressure |
---|
133 | ! Linear interpolation between 2 hemispheric function of latitud between ylats and ylatn |
---|
134 | !--------------------------------------------------------------------------------------- |
---|
135 | zyd = ylatn - ylats |
---|
136 | DO jj = 1 , jpj |
---|
137 | DO ji = 1 , jpi |
---|
138 | IF( gphit(ji,jj) >= ylatn ) THEN ; xphem(ji,jj) = 1.e0 |
---|
139 | ELSEIF( gphit(ji,jj) <= ylats ) THEN ; xphem(ji,jj) = 0.e0 |
---|
140 | ELSE ; xphem(ji,jj) = ( gphit(ji,jj) - ylats) / zyd |
---|
141 | ENDIF |
---|
142 | END DO |
---|
143 | END DO |
---|
144 | ! |
---|
145 | IF(lwp) WRITE(numout,*) 'Initialization of CFC tracers done' |
---|
146 | IF(lwp) WRITE(numout,*) ' ' |
---|
147 | ! |
---|
148 | END SUBROUTINE trc_ini_cfc |
---|
149 | |
---|
150 | #else |
---|
151 | !!---------------------------------------------------------------------- |
---|
152 | !! Dummy module No CFC tracers |
---|
153 | !!---------------------------------------------------------------------- |
---|
154 | CONTAINS |
---|
155 | SUBROUTINE trc_ini_cfc ! Empty routine |
---|
156 | END SUBROUTINE trc_ini_cfc |
---|
157 | #endif |
---|
158 | |
---|
159 | !!====================================================================== |
---|
160 | END MODULE trcini_cfc |
---|