1 | |
---|
2 | CCC $Header$ |
---|
3 | CCC TOP 1.0 , LOCEAN-IPSL (2005) |
---|
4 | C This software is governed by CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
5 | C --------------------------------------------------------------------------- |
---|
6 | CDIR$ LIST |
---|
7 | SUBROUTINE trcdit(kt,kindic) |
---|
8 | CCC--------------------------------------------------------------------- |
---|
9 | CCC |
---|
10 | CCC ROUTINE trcdit |
---|
11 | CCC ****************** |
---|
12 | CCC |
---|
13 | CCC Purpose : |
---|
14 | CCC --------- |
---|
15 | CCC Standard output of passive tracer : concentration fields |
---|
16 | CCC |
---|
17 | CCC |
---|
18 | CC Method : |
---|
19 | CC ------- |
---|
20 | CC |
---|
21 | CC At the beginning of the first time step (nit000), define all |
---|
22 | CC the NETCDF files and fields for concentration of passive tracer |
---|
23 | CC |
---|
24 | CC At each time step call histdef to compute the mean if necessary |
---|
25 | CC Each nwrite time step, output the instantaneous or mean fields |
---|
26 | CC |
---|
27 | CC IF kindic <0, output of fields before the model interruption. |
---|
28 | CC IF kindic =0, time step loop |
---|
29 | CC IF kindic >0, output of fields before the time step loop |
---|
30 | CC |
---|
31 | CC |
---|
32 | CC |
---|
33 | CC Input : |
---|
34 | CC ----- |
---|
35 | CC argument |
---|
36 | CC kt : time step |
---|
37 | CC kindic : indicator of abnormal termination |
---|
38 | CC COMMON |
---|
39 | CC /comcoh/ : orthogonal curvilinear coordinates |
---|
40 | CC and scale factors |
---|
41 | CC /comask/ : masks, bathymetry |
---|
42 | CC /cottrc/ : passive tracers fields (before,now |
---|
43 | CC ,after) |
---|
44 | CC /citcdf/ : NETCDF variables |
---|
45 | CC |
---|
46 | CC Output : |
---|
47 | CC ------ |
---|
48 | CC file |
---|
49 | CC "clhstnam" files : one for concentration |
---|
50 | CC |
---|
51 | CC |
---|
52 | CC Workspace : |
---|
53 | CC --------- |
---|
54 | CC local |
---|
55 | CC |
---|
56 | CC EXTERNAL : |
---|
57 | CC -------- |
---|
58 | CC prihre, hist..., dianam |
---|
59 | CC |
---|
60 | CC MODIFICATIONS: |
---|
61 | CC -------------- |
---|
62 | CC original : 95-01 passive tracers (M. Levy) |
---|
63 | CC additions : 98-01 (C. Levy) NETCDF format using ioipsl interface |
---|
64 | CC additions : 99-01 (M.A. Foujols) adapted for passive tracer |
---|
65 | CC additions : 99-09 (M.A. Foujols) split into three parts |
---|
66 | CC---------------------------------------------------------------------- |
---|
67 | CC parameters and commons |
---|
68 | CC ====================== |
---|
69 | USE ioipsl |
---|
70 | CDIR$ NOLIST |
---|
71 | USE oce_trc |
---|
72 | USE trc |
---|
73 | USE dianam ! build name of file (routine) |
---|
74 | IMPLICIT NONE |
---|
75 | CDIR$ LIST |
---|
76 | CC---------------------------------------------------------------------- |
---|
77 | CC local declarations |
---|
78 | CC ================== |
---|
79 | INTEGER kt, kindic |
---|
80 | REAL xjulian |
---|
81 | |
---|
82 | # if defined key_passivetrc |
---|
83 | |
---|
84 | INTEGER jn |
---|
85 | LOGICAL clp |
---|
86 | C |
---|
87 | CHARACTER*40 clhstnam |
---|
88 | CHARACTER*40 clop |
---|
89 | CHARACTER*20 cltra, cltrau |
---|
90 | CHARACTER*80 cltral |
---|
91 | |
---|
92 | REAL zsto, zout, zsec |
---|
93 | INTEGER iyear,imonth,iday,iimi, iima, ijmi, ijma, ipk |
---|
94 | C |
---|
95 | C |
---|
96 | C 0. Initialisation |
---|
97 | C ----------------- |
---|
98 | C |
---|
99 | C |
---|
100 | C local variable for debugging |
---|
101 | clp=.false. |
---|
102 | clp=clp.and.lwp |
---|
103 | C |
---|
104 | C Define frequency of output and means |
---|
105 | C |
---|
106 | # if defined key_diainstant |
---|
107 | zsto=nwritetrc*rdt |
---|
108 | clop='inst(only(x))' |
---|
109 | # else |
---|
110 | zsto=rdt |
---|
111 | clop='ave(only(x))' |
---|
112 | # endif |
---|
113 | zout=nwritetrc*rdt |
---|
114 | C |
---|
115 | C Define indexes of the horizontal output zoom |
---|
116 | iimi=1 |
---|
117 | iima=jpi |
---|
118 | ijmi=1 |
---|
119 | ijma=jpj |
---|
120 | c ipk limit storage in depth |
---|
121 | ipk = jpk |
---|
122 | |
---|
123 | C |
---|
124 | C |
---|
125 | C 1. Define NETCDF files and fields at beginning of first time step |
---|
126 | C ----------------------------------------------------------------- |
---|
127 | C |
---|
128 | IF(clp)WRITE(numout,*)'trcdit kt=',kt,' kindic ',kindic |
---|
129 | IF (kt.eq.nit000.and.kindic.eq.1) THEN |
---|
130 | |
---|
131 | WRITE(numout,*)" indexes of zoom = ", |
---|
132 | $ iimi, iima, ijmi, ijma |
---|
133 | WRITE(numout,*)" limit storage in depth = ", ipk |
---|
134 | c |
---|
135 | c choose calendar for ioipsl |
---|
136 | c |
---|
137 | IF (nleapy .eq. 1) THEN |
---|
138 | CALL ioconf_calendar('gregorian') |
---|
139 | ELSE IF (nleapy .eq. 0) THEN |
---|
140 | CALL ioconf_calendar('noleap') |
---|
141 | ELSE IF (nleapy .eq. 30) THEN |
---|
142 | CALL ioconf_calendar('360d') |
---|
143 | ENDIF |
---|
144 | C |
---|
145 | C Compute julian date from starting date of the run |
---|
146 | C |
---|
147 | iyear = ijulian/10000 |
---|
148 | imonth = ijulian/100 - iyear*100 |
---|
149 | iday = ijulian - imonth*100 - iyear*10000 |
---|
150 | iyear = ijulian/10000 |
---|
151 | zsec=0. |
---|
152 | CALL ymds2ju(iyear,imonth,iday,zsec,xjulian) |
---|
153 | |
---|
154 | iyear = ndastp/10000 |
---|
155 | imonth = ndastp/100 - iyear*100 |
---|
156 | iday = ndastp - imonth*100 - iyear*10000 |
---|
157 | iyear = ndastp/10000 |
---|
158 | zsec=0. |
---|
159 | CALL ymds2ju(iyear,imonth,iday,zsec,djulian) |
---|
160 | write(0,*) iyear,imonth,iday,zsec,djulian |
---|
161 | IF(lwp)WRITE(numout,*)' ' |
---|
162 | IF(lwp)WRITE(numout,*)' Date 0 used :',nit000 |
---|
163 | $ ,' YEAR ',iyear,' MONTH ',imonth,' DAY ',iday |
---|
164 | $ ,'Julian day : ',djulian |
---|
165 | $ ,'XJulian day : ',xjulian |
---|
166 | C |
---|
167 | C Define the NETCDF files for passive tracer concentration |
---|
168 | C |
---|
169 | CALL dia_nam(clhstnam,nwrite,'ptrc_T') |
---|
170 | |
---|
171 | IF(lwp)WRITE(numout,*)" Name of NETCDF file ", |
---|
172 | $ clhstnam |
---|
173 | C Horizontal grid : glamt and gphit |
---|
174 | C |
---|
175 | CALL histbeg(clhstnam, jpi, glamt, jpj, gphit, |
---|
176 | $ iimi, iima-iimi+1, ijmi, ijma-ijmi+1, |
---|
177 | c $ nit000-1, xjulian, rdt, nhorit5, nit5) |
---|
178 | $ nit000-1, djulian, rdt, nhorit5, nit5) |
---|
179 | C Vertical grid for tracer : gdept |
---|
180 | CALL histvert(nit5, 'deptht', 'Vertical T levels', |
---|
181 | $ 'm', ipk, gdept, ndepit5) |
---|
182 | |
---|
183 | C Index of ocean points in 3D and 2D (surface) |
---|
184 | CALL wheneq(jpi*jpj*ipk,tmask,1,1.,ndext50,ndimt50) |
---|
185 | CALL wheneq(jpi*jpj,tmask,1,1.,ndext51,ndimt51) |
---|
186 | C |
---|
187 | C Declare all the output fields as NETCDF variables |
---|
188 | C |
---|
189 | C tracer concentrations |
---|
190 | C |
---|
191 | DO jn=1,jptra |
---|
192 | cltra=ctrcnm(jn) ! short title for tracer |
---|
193 | cltral=ctrcnl(jn) ! long title for tracer |
---|
194 | cltrau=ctrcun(jn) ! UNIT for tracer |
---|
195 | CALL histdef(nit5, cltra, cltral, cltrau, jpi, jpj, nhorit5, |
---|
196 | $ ipk, 1, ipk, ndepit5, 32, clop, zsto, zout) |
---|
197 | END DO |
---|
198 | C |
---|
199 | C CLOSE netcdf Files |
---|
200 | C |
---|
201 | CALL histend(nit5) |
---|
202 | C |
---|
203 | C SOME diagnostics to DO first time |
---|
204 | C |
---|
205 | ELSE |
---|
206 | C |
---|
207 | C |
---|
208 | C 2. Start writing data |
---|
209 | C --------------------- |
---|
210 | C |
---|
211 | C tracer concentrations |
---|
212 | C |
---|
213 | DO jn=1,jptra |
---|
214 | cltra=ctrcnm(jn) ! short title for tracer |
---|
215 | CALL histwrite(nit5, cltra, kt,trn(:,:,:,jn), ndimt50, |
---|
216 | $ ndext50) |
---|
217 | END DO |
---|
218 | C |
---|
219 | C synchronise FILE |
---|
220 | C |
---|
221 | IF(lwp .and. mod( kt, nwritetrc ).EQ.0) THEN |
---|
222 | WRITE(numout,*) |
---|
223 | $ '**** trcdit : write NetCDF passive tracer concentration' |
---|
224 | CALL histsync(nit5) |
---|
225 | ENDIF |
---|
226 | ENDIF |
---|
227 | C |
---|
228 | C 3. Closing all files |
---|
229 | C -------------------- |
---|
230 | IF (kt.EQ.nitend.OR.kindic.LT.0) THEN |
---|
231 | CALL histclo(nit5) |
---|
232 | ENDIF |
---|
233 | |
---|
234 | # else |
---|
235 | C |
---|
236 | C no passive tracers |
---|
237 | C |
---|
238 | # endif |
---|
239 | |
---|
240 | C |
---|
241 | C |
---|
242 | RETURN |
---|
243 | END |
---|