1 | MODULE limdia |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE limdia *** |
---|
4 | !! diagnostics of ice model |
---|
5 | !!====================================================================== |
---|
6 | #if defined key_ice_lim |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! 'key_ice_lim' : LIM sea-ice model |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | !! lim_dia : computation of the time evolution of keys var. |
---|
11 | !! lim_dia_init : initialization and namelist read |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! * Modules used |
---|
14 | USE phycst |
---|
15 | USE in_out_manager |
---|
16 | USE ice_oce ! ice variables |
---|
17 | USE daymod |
---|
18 | USE dom_ice |
---|
19 | USE ice |
---|
20 | USE iceini |
---|
21 | USE limistate |
---|
22 | |
---|
23 | IMPLICIT NONE |
---|
24 | PRIVATE |
---|
25 | |
---|
26 | !! * Routine accessibility |
---|
27 | PUBLIC lim_dia ! called by ice_step |
---|
28 | |
---|
29 | !! * Shared module variables |
---|
30 | INTEGER, PUBLIC :: & |
---|
31 | ntmoy = 1 , & !: instantaneous values of ice evolution or averaging ntmoy |
---|
32 | ninfo = 1 !: frequency of ouputs on file ice_evolu in case of averaging |
---|
33 | |
---|
34 | !! * Module variables |
---|
35 | INTEGER :: & |
---|
36 | nfrinf = 4 ! number of variables written in one line |
---|
37 | |
---|
38 | INTEGER :: & |
---|
39 | nferme , & ! last time step at which the var. are written on file |
---|
40 | nvinfo , & ! number of total variables |
---|
41 | nbvt , & ! number of time variables |
---|
42 | naveg ! number of step for accumulation before averaging |
---|
43 | |
---|
44 | REAL(wp), DIMENSION(ninfmx) :: & |
---|
45 | vinfom ! temporary working space |
---|
46 | |
---|
47 | CHARACTER(len=8) :: & |
---|
48 | fmtinf = '1PE13.5 ' ! format of the output values |
---|
49 | |
---|
50 | CHARACTER(len=30) :: & |
---|
51 | fmtw , & ! formats |
---|
52 | fmtr , & ! ??? |
---|
53 | fmtitr ! ??? |
---|
54 | |
---|
55 | CHARACTER(len=nchsep), DIMENSION(ninfmx) :: & |
---|
56 | titvar ! title of key variables |
---|
57 | |
---|
58 | REAL(wp) :: & |
---|
59 | epsi06 = 1.e-06 |
---|
60 | |
---|
61 | !! * Substitutions |
---|
62 | # include "vectopt_loop_substitute.h90" |
---|
63 | !!---------------------------------------------------------------------- |
---|
64 | !! LIM 2.0 , UCL-LODYC-IPSL (2003) |
---|
65 | !!---------------------------------------------------------------------- |
---|
66 | |
---|
67 | CONTAINS |
---|
68 | |
---|
69 | SUBROUTINE lim_dia |
---|
70 | !!-------------------------------------------------------------------- |
---|
71 | !! *** ROUTINE lim_dia *** |
---|
72 | !! |
---|
73 | !! ** Purpose : Computation and outputs on file ice.evolu |
---|
74 | !! the temporal evolution of some key variables |
---|
75 | !! |
---|
76 | !! History : |
---|
77 | !! 8.0 ! 97-06 (Louvain-La-Neuve) Original code |
---|
78 | !! 8.5 ! 02-09 (C. Ethe , G. Madec ) F90: Free form and module |
---|
79 | !!------------------------------------------------------------------- |
---|
80 | !! * Local variables |
---|
81 | INTEGER :: jv,ji, jj ! dummy loop indices |
---|
82 | INTEGER :: nv ! indice of variable |
---|
83 | REAL(wp), DIMENSION(ninfmx) :: & |
---|
84 | vinfor ! temporary working space |
---|
85 | REAL(wp) :: & |
---|
86 | zarea , & ! sea ice area |
---|
87 | zldarea , & ! leads area |
---|
88 | zextent15, & ! sea ice extent (15%) |
---|
89 | zextent85, & ! sea ice extent (85%) |
---|
90 | zicevol , & ! sea ice volume |
---|
91 | zsnwvol , & ! snow volume over sea ice |
---|
92 | zicespd ! sea ice velocity |
---|
93 | !!------------------------------------------------------------------- |
---|
94 | |
---|
95 | IF( numit == nstart ) CALL lim_dia_init ! initialisation of ice_evolu file |
---|
96 | |
---|
97 | ! computation of key variables at each time step |
---|
98 | |
---|
99 | nv = 1 |
---|
100 | vinfor(nv) = REAL(numit) |
---|
101 | nv = nv + 1 |
---|
102 | vinfor(nv) = nyear |
---|
103 | |
---|
104 | DO jv = nbvt + 1, nvinfo |
---|
105 | vinfor(jv) = 0.0 |
---|
106 | END DO |
---|
107 | |
---|
108 | zextent15 = 0.e0 |
---|
109 | zextent85 = 0.e0 |
---|
110 | ! variables in northern Hemis |
---|
111 | DO jj = jeq, jpjm1 |
---|
112 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
113 | IF( tms(ji,jj) == 1 ) THEN |
---|
114 | zarea = ( 1.0 - frld(ji,jj) ) * aire(ji,jj) |
---|
115 | IF (frld(ji,jj) <= 0.15 ) zextent15 = aire(ji,jj) |
---|
116 | IF (frld(ji,jj) <= 0.85 ) zextent85 = aire(ji,jj) |
---|
117 | zldarea = zarea / MAX( ( 1 - frld(ji,jj) ) , epsi06 ) |
---|
118 | zicevol = zarea * hicif(ji,jj) |
---|
119 | zsnwvol = zarea * hsnif(ji,jj) |
---|
120 | zicespd = zicevol * ( u_ice(ji,jj) * u_ice(ji,jj) & |
---|
121 | & + v_ice(ji,jj) * v_ice(ji,jj) ) |
---|
122 | vinfor(nv+ 1) = vinfor(nv+ 1) + zarea |
---|
123 | vinfor(nv+ 3) = vinfor(nv+ 3) + zextent15 |
---|
124 | vinfor(nv+ 5) = vinfor(nv+ 5) + zextent85 |
---|
125 | vinfor(nv+ 7) = vinfor(nv+ 7) + zldarea |
---|
126 | vinfor(nv+ 9) = vinfor(nv+ 9) + zicevol |
---|
127 | vinfor(nv+11) = vinfor(nv+11) + zsnwvol |
---|
128 | vinfor(nv+13) = vinfor(nv+13) + zicespd |
---|
129 | ENDIF |
---|
130 | END DO |
---|
131 | END DO |
---|
132 | vinfor(nv+13) = SQRT( vinfor(nv+13) / MAX( vinfor(nv+9) , epsi06 ) ) |
---|
133 | |
---|
134 | |
---|
135 | ! variables in southern Hemis |
---|
136 | nv = nv + 1 |
---|
137 | DO jj = 2, jeqm1 |
---|
138 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
139 | IF( tms(ji,jj) == 1 ) THEN |
---|
140 | zarea = ( 1.0 - frld(ji,jj) ) * aire(ji,jj) |
---|
141 | IF (frld(ji,jj) <= 0.15 ) zextent15 = aire(ji,jj) |
---|
142 | IF (frld(ji,jj) <= 0.85 ) zextent85 = aire(ji,jj) |
---|
143 | zldarea = zarea / MAX( ( 1 - frld(ji,jj) ) , epsi06 ) |
---|
144 | zicevol = zarea * hicif(ji,jj) |
---|
145 | zsnwvol = zarea * hsnif(ji,jj) |
---|
146 | zicespd = zicevol * ( u_ice(ji,jj) * u_ice(ji,jj) & |
---|
147 | & + v_ice(ji,jj) * v_ice(ji,jj) ) |
---|
148 | vinfor(nv+ 1) = vinfor(nv+ 1) + zarea |
---|
149 | vinfor(nv+ 3) = vinfor(nv+ 3) + zextent15 |
---|
150 | vinfor(nv+ 5) = vinfor(nv+ 5) + zextent85 |
---|
151 | vinfor(nv+ 7) = vinfor(nv+ 7) + zldarea |
---|
152 | vinfor(nv+ 9) = vinfor(nv+ 9) + zicevol |
---|
153 | vinfor(nv+11) = vinfor(nv+11) + zsnwvol |
---|
154 | vinfor(nv+13) = vinfor(nv+13) + zicespd |
---|
155 | ENDIF |
---|
156 | END DO |
---|
157 | END DO |
---|
158 | vinfor(nv+13) = SQRT( vinfor(nv+13) / MAX( vinfor(nv+9) , epsi06 ) ) |
---|
159 | |
---|
160 | ! Accumulation before averaging |
---|
161 | DO jv = 1, nvinfo |
---|
162 | vinfom(jv) = vinfom(jv) + vinfor(jv) |
---|
163 | END DO |
---|
164 | naveg = naveg + 1 |
---|
165 | |
---|
166 | ! oututs on file ice_evolu |
---|
167 | IF( MOD( numit , ninfo ) == 0 ) THEN |
---|
168 | WRITE(90,fmtw) ( titvar(jv), vinfom(jv)/naveg, jv = 1, nvinfo ) |
---|
169 | naveg = 0 |
---|
170 | DO jv = 1, nvinfo |
---|
171 | vinfom(jv)=0.0 |
---|
172 | END DO |
---|
173 | ENDIF |
---|
174 | |
---|
175 | END SUBROUTINE lim_dia |
---|
176 | |
---|
177 | |
---|
178 | SUBROUTINE lim_dia_init |
---|
179 | !!------------------------------------------------------------------- |
---|
180 | !! *** ROUTINE lim_dia_init *** |
---|
181 | !! |
---|
182 | !! ** Purpose : Preparation of the file ice_evolu for the output of |
---|
183 | !! the temporal evolution of key variables |
---|
184 | !! |
---|
185 | !! ** input : Namelist namicedia |
---|
186 | !! |
---|
187 | !! history : |
---|
188 | !! 8.5 ! 03-08 (C. Ethe) original code |
---|
189 | !!------------------------------------------------------------------- |
---|
190 | NAMELIST/namicedia/fmtinf, nfrinf, ninfo, ntmoy |
---|
191 | |
---|
192 | INTEGER :: jv , & ! dummy loop indice |
---|
193 | & ntot , & |
---|
194 | & ndeb , & |
---|
195 | & irecl |
---|
196 | |
---|
197 | INTEGER :: nv ! indice of variable |
---|
198 | |
---|
199 | REAL(wp) :: zxx0, zxx1 ! temporary scalars |
---|
200 | |
---|
201 | CHARACTER(len=nchinf) :: titinf |
---|
202 | !!------------------------------------------------------------------- |
---|
203 | |
---|
204 | |
---|
205 | ! Read Namelist namicedia |
---|
206 | REWIND ( numnam_ice ) |
---|
207 | READ ( numnam_ice , namicedia ) |
---|
208 | IF(lwp) THEN |
---|
209 | WRITE(numout,*) |
---|
210 | WRITE(numout,*) 'lim_dia_init : ice parameters for ice diagnostics ' |
---|
211 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
212 | WRITE(numout,*) ' format of the output values fmtinf = ', fmtinf |
---|
213 | WRITE(numout,*) ' number of variables written in one line nfrinf = ', nfrinf |
---|
214 | WRITE(numout,*) ' Instantaneous values of ice evolution or averaging ntmoy = ', ntmoy |
---|
215 | WRITE(numout,*) ' frequency of ouputs on file ice_evolu in case of averaging ninfo = ', ninfo |
---|
216 | ENDIF |
---|
217 | |
---|
218 | ! Titles of ice key variables : |
---|
219 | nv = 1 |
---|
220 | titvar(nv) = 'NoIt' ! iteration number |
---|
221 | nv = nv + 1 |
---|
222 | titvar(nv) = 'T yr' ! time step in years |
---|
223 | nv = nv + 1 |
---|
224 | |
---|
225 | nbvt = nv - 1 |
---|
226 | |
---|
227 | titvar(nv) = 'AEFN' ! sea ice area in the northern Hemisp.(10^12 km2) |
---|
228 | nv = nv + 1 |
---|
229 | titvar(nv) = 'AEFS' ! sea ice area in the southern Hemisp.(10^12 km2) |
---|
230 | nv = nv + 1 |
---|
231 | titvar(nv) = 'A15N' ! sea ice extent (15%) in the northern Hemisp.(10^12 km2) |
---|
232 | nv = nv + 1 |
---|
233 | titvar(nv) = 'A15S' ! sea ice extent (15%) in the southern Hemisp.(10^12 km2) |
---|
234 | nv = nv + 1 |
---|
235 | titvar(nv) = 'A85N' ! sea ice extent (85%) in the northern Hemisp.(10^12 km2) |
---|
236 | nv = nv + 1 |
---|
237 | titvar(nv) = 'A85S' ! sea ice extent (85%) in the southern Hemisp.(10^12 km2) |
---|
238 | nv = nv + 1 |
---|
239 | titvar(nv) = 'ALEN' ! leads area in the northern Hemisp.(10^12 km2) |
---|
240 | nv = nv + 1 |
---|
241 | titvar(nv) = 'ALES' ! leads area in the southern Hemisp.(10^12 km2) |
---|
242 | nv = nv + 1 |
---|
243 | titvar(nv) = 'VOLN' ! sea ice volume in the northern Hemisp.(10^3 km3) |
---|
244 | nv = nv + 1 |
---|
245 | titvar(nv) = 'VOLS' ! sea ice volume in the southern Hemisp.(10^3 km3) |
---|
246 | nv = nv + 1 |
---|
247 | titvar(nv) = 'VONN' ! snow volume over sea ice in the northern Hemisp.(10^3 km3) |
---|
248 | nv = nv + 1 |
---|
249 | titvar(nv) = 'VONS' ! snow volume over sea ice in the southern Hemisp.(10^3 km3) |
---|
250 | nv = nv + 1 |
---|
251 | titvar(nv) = 'ECGN' ! mean sea ice velocity in the northern Hemisp.(m/s) |
---|
252 | nv = nv + 1 |
---|
253 | titvar(nv) = 'ECGS' ! mean sea ice velocity in the southern Hemisp.(m/s) |
---|
254 | |
---|
255 | nvinfo = nv |
---|
256 | |
---|
257 | ! Definition et Ecriture de l'entete : nombre d'enregistrements |
---|
258 | ndeb = ( nstart - 1 ) / ninfo |
---|
259 | IF( nstart == 1 ) ndeb = -1 |
---|
260 | |
---|
261 | nferme = ( nstart - 1 + nitrun) / ninfo |
---|
262 | ntot = nferme - ndeb |
---|
263 | ndeb = ninfo * ( 1 + ndeb ) |
---|
264 | nferme = ninfo * nferme |
---|
265 | |
---|
266 | ! definition of formats |
---|
267 | WRITE( fmtw , '(A,I3,A2,I1,A)' ) '(', nfrinf, '(A', nchsep, ','//fmtinf//'))' |
---|
268 | WRITE( fmtr , '(A,I3,A,I1,A)' ) '(', nfrinf, '(', nchsep, 'X,'//fmtinf//'))' |
---|
269 | WRITE( fmtitr, '(A,I3,A,I1,A)' ) '(', nvinfo, 'A', nchinf, ')' |
---|
270 | |
---|
271 | ! opening "ice_evolu" file |
---|
272 | irecl = ( nchinf + 1 ) * nvinfo |
---|
273 | OPEN( numevo_ice, file='ice.evolu', status='unknown', RECL = irecl) |
---|
274 | OPEN( numevo_ice, file='ice.evolu', status='unknown') |
---|
275 | |
---|
276 | !- ecriture de 2 lignes d''entete : |
---|
277 | WRITE(numevo_ice,1000) fmtr, fmtw, fmtitr, nvinfo, ntot, 0, nfrinf |
---|
278 | zxx0 = 0.001 * REAL(ninfo) |
---|
279 | zxx1 = 0.001 * REAL(ndeb) |
---|
280 | WRITE(numevo_ice,1111) REAL(nchinf), 0., zxx1, zxx0, 0., 0., 0 |
---|
281 | |
---|
282 | !- ecriture de 2 lignes de titre : |
---|
283 | WRITE(numevo_ice,'(A,I8,A,I8,A,I5)') & |
---|
284 | 'Evolution chronologique - Experience '//cexper & |
---|
285 | //' de', ndeb, ' a', nferme, ' pas', ninfo |
---|
286 | WRITE(numevo_ice,fmtitr) ( titvar(jv), jv = 1, nvinfo ) |
---|
287 | |
---|
288 | |
---|
289 | !--preparation de "titvar" pour l''ecriture parmi les valeurs numeriques : |
---|
290 | DO jv = 2 , nvinfo |
---|
291 | titinf = titvar(jv)(:nchinf) |
---|
292 | titvar(jv) = ' '//titinf |
---|
293 | END DO |
---|
294 | |
---|
295 | !--Initialisation of the arrays for the accumulation |
---|
296 | DO jv = 1, nvinfo |
---|
297 | vinfom(jv) = 0. |
---|
298 | END DO |
---|
299 | naveg = 0 |
---|
300 | |
---|
301 | 1000 FORMAT( 3(A20),4(1x,I6) ) |
---|
302 | 1111 FORMAT( 3(F7.1,1X,F7.3,1X),I3,A ) |
---|
303 | |
---|
304 | END SUBROUTINE lim_dia_init |
---|
305 | |
---|
306 | #else |
---|
307 | !!---------------------------------------------------------------------- |
---|
308 | !! Default option : NO LIM sea-ice model |
---|
309 | !!---------------------------------------------------------------------- |
---|
310 | CONTAINS |
---|
311 | SUBROUTINE lim_dia ! Empty routine |
---|
312 | END SUBROUTINE lim_dia |
---|
313 | #endif |
---|
314 | |
---|
315 | !!====================================================================== |
---|
316 | END MODULE limdia |
---|