source: palm/trunk/SOURCE/data_output_mask.f90 @ 1980

Last change on this file since 1980 was 1980, checked in by suehring, 8 years ago

Bugfix, in order to steer user-defined output, setting flag found explicitly

  • Property svn:keywords set to Id
File size: 23.4 KB
Line 
1!> @file data_output_mask.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2016 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! Bugfix, in order to steer user-defined output, setting flag found explicitly
22! to .F.
23!
24! Former revisions:
25! -----------------
26! $Id: data_output_mask.f90 1980 2016-07-29 15:51:57Z suehring $
27!
28! 1976 2016-07-27 13:28:04Z maronga
29! Output of radiation quantities is now done directly in the respective module
30!
31! 1960 2016-07-12 16:34:24Z suehring
32! Separate humidity and passive scalar
33!
34! 2016-03-06 18:36:17Z raasch
35! name change of netcdf routines and module + related changes,
36! switch back of netcdf data format moved from time integration routine to here
37!
38! 1691 2015-10-26 16:17:44Z maronga
39! Added output of radiative heating rates for RRTMG
40!
41! 1682 2015-10-07 23:56:08Z knoop
42! Code annotations made doxygen readable
43!
44! 1585 2015-04-30 07:05:52Z maronga
45! Added support for RRTMG
46!
47! 1438 2014-07-22 14:14:06Z heinze
48! +nr, qc, qr
49!
50! 1359 2014-04-11 17:15:14Z hoffmann
51! New particle structure integrated.
52!
53! 1353 2014-04-08 15:21:23Z heinze
54! REAL constants provided with KIND-attribute
55!
56! 1327 2014-03-21 11:00:16Z raasch
57!
58!
59! 1320 2014-03-20 08:40:49Z raasch
60! ONLY-attribute added to USE-statements,
61! kind-parameters added to all INTEGER and REAL declaration statements,
62! kinds are defined in new module kinds,
63! revision history before 2012 removed,
64! comment fields (!:) to be used for variable explanations added to
65! all variable declaration statements
66!
67! 1318 2014-03-17 13:35:16Z raasch
68! barrier argument removed from cpu_log,
69! module interfaces removed
70!
71! 1092 2013-02-02 11:24:22Z raasch
72! unused variables removed
73!
74! 1036 2012-10-22 13:43:42Z raasch
75! code put under GPL (PALM 3.9)
76!
77! 1031 2012-10-19 14:35:30Z raasch
78! netCDF4 without parallel file support implemented
79!
80! 1007 2012-09-19 14:30:36Z franke
81! Bugfix: calculation of pr must depend on the particle weighting factor,
82! missing calculation of ql_vp added
83!
84! 410 2009-12-04 17:05:40Z letzel
85! Initial version
86!
87! Description:
88! ------------
89!> Masked data output in netCDF format for current mask (current value of mid).
90!------------------------------------------------------------------------------!
91 SUBROUTINE data_output_mask( av )
92
93 
94
95#if defined( __netcdf )
96    USE arrays_3d,                                                             &
97        ONLY:  e, nr, p, pt, q, qc, ql, ql_c, ql_v, qr, rho, s, sa, tend, u,   &
98               v, vpt, w
99   
100    USE averaging,                                                             &
101        ONLY:  e_av, lpt_av, nr_av, p_av, pc_av, pr_av, pt_av, q_av, qc_av,    &
102               ql_av, ql_c_av, ql_v_av, ql_vp_av, qv_av, qr_av, rho_av, s_av,  &
103               sa_av, u_av, v_av, vpt_av, w_av 
104   
105    USE cloud_parameters,                                                      &
106        ONLY:  l_d_cp, pt_d_t
107   
108    USE control_parameters,                                                    &
109        ONLY:  cloud_physics, domask, domask_no, domask_time_count, mask_i,    &
110               mask_j, mask_k, mask_size, mask_size_l, mask_start_l,           &
111               max_masks, message_string, mid, nz_do3d, simulated_time
112    USE cpulog,                                                                &
113        ONLY:  cpu_log, log_point
114
115    USE indices,                                                               &
116        ONLY:  nbgp, nxl, nxr, nyn, nys, nzb, nzt
117       
118    USE kinds
119   
120    USE NETCDF
121   
122    USE netcdf_interface,                                                      &
123        ONLY:  id_set_mask, id_var_domask, id_var_time_mask, nc_stat,          &
124               netcdf_data_format, netcdf_handle_error
125   
126    USE particle_attributes,                                                   &
127        ONLY:  grid_particles, number_of_particles, particles,                 &
128               particle_advection_start, prt_count
129   
130    USE pegrid
131
132    USE radiation_model_mod,                                                   &
133        ONLY:  radiation, radiation_data_output_mask
134
135    IMPLICIT NONE
136
137    INTEGER(iwp) ::  av       !<
138    INTEGER(iwp) ::  ngp      !<
139    INTEGER(iwp) ::  i        !<
140    INTEGER(iwp) ::  if       !<
141    INTEGER(iwp) ::  j        !<
142    INTEGER(iwp) ::  k        !<
143    INTEGER(iwp) ::  n        !<
144    INTEGER(iwp) ::  netcdf_data_format_save !<
145    INTEGER(iwp) ::  psi      !<
146    INTEGER(iwp) ::  sender   !<
147    INTEGER(iwp) ::  ind(6)   !<
148   
149    LOGICAL ::  found         !<
150    LOGICAL ::  resorted      !<
151   
152    REAL(wp) ::  mean_r       !<
153    REAL(wp) ::  s_r2         !<
154    REAL(wp) ::  s_r3         !<
155   
156    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  local_pf    !<
157#if defined( __parallel )
158    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  total_pf    !<
159#endif
160    REAL(wp), DIMENSION(:,:,:), POINTER ::  to_be_resorted  !<
161
162!
163!-- Return, if nothing to output
164    IF ( domask_no(mid,av) == 0 )  RETURN
165
166    CALL cpu_log (log_point(49),'data_output_mask','start')
167
168!
169!-- Parallel netcdf output is not tested so far for masked data, hence
170!-- netcdf_data_format is switched back to non-paralell output.
171    netcdf_data_format_save = netcdf_data_format
172    IF ( netcdf_data_format == 5 ) netcdf_data_format = 3
173    IF ( netcdf_data_format == 6 ) netcdf_data_format = 4
174
175!
176!-- Open output file.
177    IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
178       CALL check_open( 200+mid+av*max_masks )
179    ENDIF 
180
181!
182!-- Allocate total and local output arrays.
183#if defined( __parallel )
184    IF ( myid == 0 )  THEN
185       ALLOCATE( total_pf(mask_size(mid,1),mask_size(mid,2),mask_size(mid,3)) )
186    ENDIF
187#endif
188    ALLOCATE( local_pf(mask_size_l(mid,1),mask_size_l(mid,2), &
189                       mask_size_l(mid,3)) )
190
191!
192!-- Update the netCDF time axis.
193    domask_time_count(mid,av) = domask_time_count(mid,av) + 1
194    IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
195       nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_time_mask(mid,av), &
196                               (/ simulated_time /),                          &
197                               start = (/ domask_time_count(mid,av) /),       &
198                               count = (/ 1 /) )
199       CALL netcdf_handle_error( 'data_output_mask', 460 )
200    ENDIF
201
202!
203!-- Loop over all variables to be written.
204    if = 1
205
206    DO  WHILE ( domask(mid,av,if)(1:1) /= ' ' )
207!
208!--    Reallocate local_pf on PE 0 since its shape changes during MPI exchange
209       IF ( netcdf_data_format < 5   .AND.  myid == 0  .AND.  if > 1 )  THEN
210          DEALLOCATE( local_pf )
211          ALLOCATE( local_pf(mask_size_l(mid,1),mask_size_l(mid,2), &
212                             mask_size_l(mid,3)) )
213       ENDIF
214!
215!--    Set flag to steer output of radiation, land-surface, or user-defined
216!--    quantities
217       found = .FALSE.
218!
219!--    Store the variable chosen.
220       resorted = .FALSE.
221       SELECT CASE ( TRIM( domask(mid,av,if) ) )
222
223          CASE ( 'e' )
224             IF ( av == 0 )  THEN
225                to_be_resorted => e
226             ELSE
227                to_be_resorted => e_av
228             ENDIF
229
230          CASE ( 'lpt' )
231             IF ( av == 0 )  THEN
232                to_be_resorted => pt
233             ELSE
234                to_be_resorted => lpt_av
235             ENDIF
236
237          CASE ( 'nr' )
238             IF ( av == 0 )  THEN
239                to_be_resorted => nr
240             ELSE
241                to_be_resorted => nr_av
242             ENDIF
243
244          CASE ( 'p' )
245             IF ( av == 0 )  THEN
246                to_be_resorted => p
247             ELSE
248                to_be_resorted => p_av
249             ENDIF
250
251          CASE ( 'pc' )  ! particle concentration (requires ghostpoint exchange)
252             IF ( av == 0 )  THEN
253                tend = prt_count
254                CALL exchange_horiz( tend, nbgp )
255                DO  i = 1, mask_size_l(mid,1)
256                   DO  j = 1, mask_size_l(mid,2)
257                      DO  k = 1, mask_size_l(mid,3)
258                         local_pf(i,j,k) =  tend(mask_k(mid,k), &
259                                   mask_j(mid,j),mask_i(mid,i))
260                      ENDDO
261                   ENDDO
262                ENDDO
263                resorted = .TRUE.
264             ELSE
265                CALL exchange_horiz( pc_av, nbgp )
266                to_be_resorted => pc_av
267             ENDIF
268
269          CASE ( 'pr' )  ! mean particle radius (effective radius)
270             IF ( av == 0 )  THEN
271                IF ( simulated_time >= particle_advection_start )  THEN
272                   DO  i = nxl, nxr
273                      DO  j = nys, nyn
274                         DO  k = nzb, nz_do3d
275                            number_of_particles = prt_count(k,j,i)
276                            IF (number_of_particles <= 0)  CYCLE
277                            particles => grid_particles(k,j,i)%particles(1:number_of_particles)
278                            s_r2 = 0.0_wp
279                            s_r3 = 0.0_wp
280                            DO  n = 1, number_of_particles
281                               IF ( particles(n)%particle_mask )  THEN
282                                  s_r2 = s_r2 + grid_particles(k,j,i)%particles(n)%radius**2 * &
283                                         grid_particles(k,j,i)%particles(n)%weight_factor
284                                  s_r3 = s_r3 + grid_particles(k,j,i)%particles(n)%radius**3 * &
285                                         grid_particles(k,j,i)%particles(n)%weight_factor
286                               ENDIF
287                            ENDDO
288                            IF ( s_r2 > 0.0_wp )  THEN
289                               mean_r = s_r3 / s_r2
290                            ELSE
291                               mean_r = 0.0_wp
292                            ENDIF
293                            tend(k,j,i) = mean_r
294                         ENDDO
295                      ENDDO
296                   ENDDO
297                   CALL exchange_horiz( tend, nbgp )
298                ELSE
299                   tend = 0.0_wp
300                ENDIF
301                DO  i = 1, mask_size_l(mid,1)
302                   DO  j = 1, mask_size_l(mid,2)
303                      DO  k = 1, mask_size_l(mid,3)
304                         local_pf(i,j,k) =  tend(mask_k(mid,k), &
305                                   mask_j(mid,j),mask_i(mid,i))
306                      ENDDO
307                   ENDDO
308                ENDDO
309                resorted = .TRUE.
310             ELSE
311                CALL exchange_horiz( pr_av, nbgp )
312                to_be_resorted => pr_av
313             ENDIF
314
315          CASE ( 'pt' )
316             IF ( av == 0 )  THEN
317                IF ( .NOT. cloud_physics ) THEN
318                   to_be_resorted => pt
319                ELSE
320                   DO  i = 1, mask_size_l(mid,1)
321                      DO  j = 1, mask_size_l(mid,2)
322                         DO  k = 1, mask_size_l(mid,3)
323                            local_pf(i,j,k) =  &
324                                 pt(mask_k(mid,k),mask_j(mid,j),mask_i(mid,i)) &
325                                 + l_d_cp * pt_d_t(mask_k(mid,k)) * &
326                                   ql(mask_k(mid,k),mask_j(mid,j),mask_i(mid,i))
327                         ENDDO
328                      ENDDO
329                   ENDDO
330                   resorted = .TRUE.
331                ENDIF
332             ELSE
333                to_be_resorted => pt_av
334             ENDIF
335
336          CASE ( 'q' )
337             IF ( av == 0 )  THEN
338                to_be_resorted => q
339             ELSE
340                to_be_resorted => q_av
341             ENDIF
342
343          CASE ( 'qc' )
344             IF ( av == 0 )  THEN
345                to_be_resorted => qc
346             ELSE
347                to_be_resorted => qc_av
348             ENDIF
349
350          CASE ( 'ql' )
351             IF ( av == 0 )  THEN
352                to_be_resorted => ql
353             ELSE
354                to_be_resorted => ql_av
355             ENDIF
356
357          CASE ( 'ql_c' )
358             IF ( av == 0 )  THEN
359                to_be_resorted => ql_c
360             ELSE
361                to_be_resorted => ql_c_av
362             ENDIF
363
364          CASE ( 'ql_v' )
365             IF ( av == 0 )  THEN
366                to_be_resorted => ql_v
367             ELSE
368                to_be_resorted => ql_v_av
369             ENDIF
370
371          CASE ( 'ql_vp' )
372             IF ( av == 0 )  THEN
373                IF ( simulated_time >= particle_advection_start )  THEN
374                   DO  i = nxl, nxr
375                      DO  j = nys, nyn
376                         DO  k = nzb, nz_do3d
377                            number_of_particles = prt_count(k,j,i)
378                            IF (number_of_particles <= 0)  CYCLE
379                            particles => grid_particles(k,j,i)%particles(1:number_of_particles)
380                            DO  n = 1, number_of_particles
381                               IF ( particles(n)%particle_mask )  THEN
382                                  tend(k,j,i) = tend(k,j,i) + &
383                                          particles(n)%weight_factor / &
384                                          prt_count(k,j,i)
385                               ENDIF
386                            ENDDO
387                         ENDDO
388                      ENDDO
389                   ENDDO
390                   CALL exchange_horiz( tend, nbgp )
391                ELSE
392                   tend = 0.0_wp
393                ENDIF
394                DO  i = 1, mask_size_l(mid,1)
395                   DO  j = 1, mask_size_l(mid,2)
396                      DO  k = 1, mask_size_l(mid,3)
397                         local_pf(i,j,k) =  tend(mask_k(mid,k), &
398                                   mask_j(mid,j),mask_i(mid,i))
399                      ENDDO
400                   ENDDO
401                ENDDO
402                resorted = .TRUE.
403             ELSE
404                CALL exchange_horiz( ql_vp_av, nbgp )
405                to_be_resorted => ql_vp_av
406             ENDIF
407
408          CASE ( 'qv' )
409             IF ( av == 0 )  THEN
410                DO  i = 1, mask_size_l(mid,1)
411                   DO  j = 1, mask_size_l(mid,2)
412                      DO  k = 1, mask_size_l(mid,3)
413                         local_pf(i,j,k) =  &
414                              q(mask_k(mid,k),mask_j(mid,j),mask_i(mid,i)) -  &
415                              ql(mask_k(mid,k),mask_j(mid,j),mask_i(mid,i))
416                      ENDDO
417                   ENDDO
418                ENDDO
419                resorted = .TRUE.
420             ELSE
421                to_be_resorted => qv_av
422             ENDIF
423
424          CASE ( 'qr' )
425             IF ( av == 0 )  THEN
426                to_be_resorted => qr
427             ELSE
428                to_be_resorted => qr_av
429             ENDIF
430
431          CASE ( 'rho' )
432             IF ( av == 0 )  THEN
433                to_be_resorted => rho
434             ELSE
435                to_be_resorted => rho_av
436             ENDIF
437
438          CASE ( 's' )
439             IF ( av == 0 )  THEN
440                to_be_resorted => s
441             ELSE
442                to_be_resorted => s_av
443             ENDIF
444
445          CASE ( 'sa' )
446             IF ( av == 0 )  THEN
447                to_be_resorted => sa
448             ELSE
449                to_be_resorted => sa_av
450             ENDIF
451
452          CASE ( 'u' )
453             IF ( av == 0 )  THEN
454                to_be_resorted => u
455             ELSE
456                to_be_resorted => u_av
457             ENDIF
458
459          CASE ( 'v' )
460             IF ( av == 0 )  THEN
461                to_be_resorted => v
462             ELSE
463                to_be_resorted => v_av
464             ENDIF
465
466          CASE ( 'vpt' )
467             IF ( av == 0 )  THEN
468                to_be_resorted => vpt
469             ELSE
470                to_be_resorted => vpt_av
471             ENDIF
472
473          CASE ( 'w' )
474             IF ( av == 0 )  THEN
475                to_be_resorted => w
476             ELSE
477                to_be_resorted => w_av
478             ENDIF
479
480          CASE DEFAULT
481
482!
483!--          Radiation quantity
484             IF ( radiation )  THEN
485                CALL radiation_data_output_mask(av, domask(mid,av,if), found,  &
486                                                local_pf )
487             ENDIF
488
489!
490!--          User defined quantity
491             IF ( .NOT. found )  THEN
492                CALL user_data_output_mask(av, domask(mid,av,if), found,       &
493                                           local_pf )
494             ENDIF
495
496             resorted = .TRUE.
497
498             IF ( .NOT. found )  THEN
499                WRITE ( message_string, * ) 'no output available for: ', &
500                                            TRIM( domask(mid,av,if) )
501                CALL message( 'data_output_mask', 'PA0327', 0, 0, 0, 6, 0 )
502             ENDIF
503
504       END SELECT
505
506!
507!--    Resort the array to be output, if not done above
508       IF ( .NOT. resorted )  THEN
509          DO  i = 1, mask_size_l(mid,1)
510             DO  j = 1, mask_size_l(mid,2)
511                DO  k = 1, mask_size_l(mid,3)
512                   local_pf(i,j,k) =  to_be_resorted(mask_k(mid,k), &
513                                      mask_j(mid,j),mask_i(mid,i))
514                ENDDO
515             ENDDO
516          ENDDO
517       ENDIF
518
519!
520!--    I/O block. I/O methods are implemented
521!--    (1) for parallel execution
522!--     a. with netCDF 4 parallel I/O-enabled library
523!--     b. with netCDF 3 library
524!--    (2) for serial execution.
525!--    The choice of method depends on the correct setting of preprocessor
526!--    directives __parallel and __netcdf4_parallel as well as on the parameter
527!--    netcdf_data_format.
528#if defined( __parallel )
529#if defined( __netcdf4_parallel )
530       IF ( netcdf_data_format > 4 )  THEN
531!
532!--       (1) a. Parallel I/O using netCDF 4 (not yet tested)
533          nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),  &
534               id_var_domask(mid,av,if),  &
535               local_pf,  &
536               start = (/ mask_start_l(mid,1), mask_start_l(mid,2),  &
537                          mask_start_l(mid,3), domask_time_count(mid,av) /),  &
538               count = (/ mask_size_l(mid,1), mask_size_l(mid,2),  &
539                          mask_size_l(mid,3), 1 /) )
540          CALL netcdf_handle_error( 'data_output_mask', 461 )
541       ELSE
542#endif
543!
544!--       (1) b. Conventional I/O only through PE0
545!--       PE0 receives partial arrays from all processors of the respective mask
546!--       and outputs them. Here a barrier has to be set, because otherwise
547!--       "-MPI- FATAL: Remote protocol queue full" may occur.
548          CALL MPI_BARRIER( comm2d, ierr )
549
550          ngp = mask_size_l(mid,1) * mask_size_l(mid,2) * mask_size_l(mid,3)
551          IF ( myid == 0 )  THEN
552!
553!--          Local array can be relocated directly.
554             total_pf( &
555               mask_start_l(mid,1):mask_start_l(mid,1)+mask_size_l(mid,1)-1, &
556               mask_start_l(mid,2):mask_start_l(mid,2)+mask_size_l(mid,2)-1, &
557               mask_start_l(mid,3):mask_start_l(mid,3)+mask_size_l(mid,3)-1 ) &
558               = local_pf
559!
560!--          Receive data from all other PEs.
561             DO  n = 1, numprocs-1
562!
563!--             Receive index limits first, then array.
564!--             Index limits are received in arbitrary order from the PEs.
565                CALL MPI_RECV( ind(1), 6, MPI_INTEGER, MPI_ANY_SOURCE, 0,  &
566                     comm2d, status, ierr )
567!
568!--             Not all PEs have data for the mask
569                IF ( ind(1) /= -9999 )  THEN
570                   ngp = ( ind(2)-ind(1)+1 ) * (ind(4)-ind(3)+1 ) *  &
571                         ( ind(6)-ind(5)+1 )
572                   sender = status(MPI_SOURCE)
573                   DEALLOCATE( local_pf )
574                   ALLOCATE(local_pf(ind(1):ind(2),ind(3):ind(4),ind(5):ind(6)))
575                   CALL MPI_RECV( local_pf(ind(1),ind(3),ind(5)), ngp,  &
576                        MPI_REAL, sender, 1, comm2d, status, ierr )
577                   total_pf(ind(1):ind(2),ind(3):ind(4),ind(5):ind(6)) &
578                        = local_pf
579                ENDIF
580             ENDDO
581
582             nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),  &
583                  id_var_domask(mid,av,if), total_pf, &
584                  start = (/ 1, 1, 1, domask_time_count(mid,av) /), &
585                  count = (/ mask_size(mid,1), mask_size(mid,2), &
586                             mask_size(mid,3), 1 /) )
587             CALL netcdf_handle_error( 'data_output_mask', 462 )
588
589          ELSE
590!
591!--          If at least part of the mask resides on the PE, send the index
592!--          limits for the target array, otherwise send -9999 to PE0.
593             IF ( mask_size_l(mid,1) > 0 .AND.  mask_size_l(mid,2) > 0 .AND. &
594                  mask_size_l(mid,3) > 0  ) &
595                  THEN
596                ind(1) = mask_start_l(mid,1)
597                ind(2) = mask_start_l(mid,1) + mask_size_l(mid,1) - 1
598                ind(3) = mask_start_l(mid,2)
599                ind(4) = mask_start_l(mid,2) + mask_size_l(mid,2) - 1
600                ind(5) = mask_start_l(mid,3)
601                ind(6) = mask_start_l(mid,3) + mask_size_l(mid,3) - 1
602             ELSE
603                ind(1) = -9999; ind(2) = -9999
604                ind(3) = -9999; ind(4) = -9999
605                ind(5) = -9999; ind(6) = -9999
606             ENDIF
607             CALL MPI_SEND( ind(1), 6, MPI_INTEGER, 0, 0, comm2d, ierr )
608!
609!--          If applicable, send data to PE0.
610             IF ( ind(1) /= -9999 )  THEN
611                CALL MPI_SEND( local_pf(1,1,1), ngp, MPI_REAL, 0, 1, comm2d, &
612                     ierr )
613             ENDIF
614          ENDIF
615!
616!--       A barrier has to be set, because otherwise some PEs may proceed too
617!--       fast so that PE0 may receive wrong data on tag 0.
618          CALL MPI_BARRIER( comm2d, ierr )
619#if defined( __netcdf4_parallel )
620       ENDIF
621#endif
622#else
623!
624!--    (2) For serial execution of PALM, the single processor (PE0) holds all
625!--    data and writes them directly to file.
626       nc_stat = NF90_PUT_VAR( id_set_mask(mid,av),  &
627            id_var_domask(mid,av,if),       &
628            local_pf, &
629            start = (/ 1, 1, 1, domask_time_count(mid,av) /), &
630            count = (/ mask_size_l(mid,1), mask_size_l(mid,2), &
631                       mask_size_l(mid,3), 1 /) )
632       CALL netcdf_handle_error( 'data_output_mask', 463 )
633#endif
634
635       if = if + 1
636
637    ENDDO
638
639!
640!-- Deallocate temporary arrays.
641    DEALLOCATE( local_pf )
642#if defined( __parallel )
643    IF ( myid == 0 )  THEN
644       DEALLOCATE( total_pf )
645    ENDIF
646#endif
647
648!
649!-- Switch back to original format given by user (see beginning of this routine)
650    netcdf_data_format = netcdf_data_format_save
651
652    CALL cpu_log( log_point(49), 'data_output_mask', 'stop' )
653#endif
654
655 END SUBROUTINE data_output_mask
Note: See TracBrowser for help on using the repository browser.