source: palm/trunk/SOURCE/data_output_3d.f90 @ 2000

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 23.5 KB
Line 
1!> @file data_output_3d.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
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2016 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! ------------------
22! Forced header and separation lines into 80 columns
23!
24! Former revisions:
25! -----------------
26! $Id: data_output_3d.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1980 2016-07-29 15:51:57Z suehring
29! Bugfix, in order to steer user-defined output, setting flag found explicitly
30! to .F.
31!
32! 1976 2016-07-27 13:28:04Z maronga
33! Output of radiation quantities is now done directly in the respective module
34!
35! 1972 2016-07-26 07:52:02Z maronga
36! Output of land surface quantities is now done directly in the respective module.
37! Unnecessary directive __parallel removed.
38!
39! 1960 2016-07-12 16:34:24Z suehring
40! Scalar surface flux added
41!
42! 1849 2016-04-08 11:33:18Z hoffmann
43! prr moved to arrays_3d
44!
45! 1822 2016-04-07 07:49:42Z hoffmann
46! prr vertical dimensions set to nzb_do to nzt_do. Unused variables deleted.
47!
48! 1808 2016-04-05 19:44:00Z raasch
49! test output removed
50!
51! 1783 2016-03-06 18:36:17Z raasch
52! name change of netcdf routines and module + related changes
53!
54! 1745 2016-02-05 13:06:51Z gronemeier
55! Bugfix: test if time axis limit exceeds moved to point after call of check_open
56!
57! 1691 2015-10-26 16:17:44Z maronga
58! Added output of radiative heating rates for RRTMG
59!
60! 1682 2015-10-07 23:56:08Z knoop
61! Code annotations made doxygen readable
62!
63! 1585 2015-04-30 07:05:52Z maronga
64! Added support for RRTMG
65!
66! 1551 2015-03-03 14:18:16Z maronga
67! Added suppport for land surface model and radiation model output. In the course
68! of this action, the limits for vertical loops have been changed (from nzb and
69! nzt+1 to nzb_do and nzt_do, respectively in order to allow soil model output).
70! Moreover, a new vertical grid zs was introduced.
71!
72! 1359 2014-04-11 17:15:14Z hoffmann
73! New particle structure integrated.
74!
75! 1353 2014-04-08 15:21:23Z heinze
76! REAL constants provided with KIND-attribute
77!
78! 1327 2014-03-21 11:00:16Z raasch
79! parts concerning avs output removed,
80! -netcdf output queries
81!
82! 1320 2014-03-20 08:40:49Z raasch
83! ONLY-attribute added to USE-statements,
84! kind-parameters added to all INTEGER and REAL declaration statements,
85! kinds are defined in new module kinds,
86! old module precision_kind is removed,
87! revision history before 2012 removed,
88! comment fields (!:) to be used for variable explanations added to
89! all variable declaration statements
90!
91! 1318 2014-03-17 13:35:16Z raasch
92! barrier argument removed from cpu_log,
93! module interfaces removed
94!
95! 1308 2014-03-13 14:58:42Z fricke
96! Check, if the limit of the time dimension is exceeded for parallel output
97! To increase the performance for parallel output, the following is done:
98! - Update of time axis is only done by PE0
99!
100! 1244 2013-10-31 08:16:56Z raasch
101! Bugfix for index bounds in case of 3d-parallel output
102!
103! 1115 2013-03-26 18:16:16Z hoffmann
104! ql is calculated by calc_liquid_water_content
105!
106! 1106 2013-03-04 05:31:38Z raasch
107! array_kind renamed precision_kind
108!
109! 1076 2012-12-05 08:30:18Z hoffmann
110! Bugfix in output of ql
111!
112! 1053 2012-11-13 17:11:03Z hoffmann
113! +nr, qr, prr, qc and averaged quantities
114!
115! 1036 2012-10-22 13:43:42Z raasch
116! code put under GPL (PALM 3.9)
117!
118! 1031 2012-10-19 14:35:30Z raasch
119! netCDF4 without parallel file support implemented
120!
121! 1007 2012-09-19 14:30:36Z franke
122! Bugfix: missing calculation of ql_vp added
123!
124! Revision 1.1  1997/09/03 06:29:36  raasch
125! Initial revision
126!
127!
128! Description:
129! ------------
130!> Output of the 3D-arrays in netCDF and/or AVS format.
131!------------------------------------------------------------------------------!
132 SUBROUTINE data_output_3d( av )
133 
134
135    USE arrays_3d,                                                             &
136        ONLY:  e, nr, p, pt, prr, q, qc, ql, ql_c, ql_v, qr, rho, s, sa, tend, &
137               u, v, vpt, w
138       
139    USE averaging
140       
141    USE cloud_parameters,                                                      &
142        ONLY:  l_d_cp, pt_d_t
143       
144    USE control_parameters,                                                    &
145        ONLY:  cloud_physics, do3d, do3d_no, do3d_time_count, io_blocks,       &
146               io_group, message_string, ntdim_3d, nz_do3d, psolver,           &
147               simulated_time, time_since_reference_point
148       
149    USE cpulog,                                                                &
150        ONLY:  log_point, cpu_log
151       
152    USE indices,                                                               &
153        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb
154       
155    USE kinds
156   
157    USE land_surface_model_mod,                                                &
158        ONLY: land_surface, lsm_data_output_3d, nzb_soil, nzt_soil
159
160#if defined( __netcdf )
161    USE NETCDF
162#endif
163
164    USE netcdf_interface,                                                      &
165        ONLY:  id_set_3d, id_var_do3d, id_var_time_3d, nc_stat,                &
166               netcdf_data_format, netcdf_handle_error
167       
168    USE particle_attributes,                                                   &
169        ONLY:  grid_particles, number_of_particles, particles,                 &
170               particle_advection_start, prt_count
171       
172    USE pegrid
173
174    USE radiation_model_mod,                                                   &
175        ONLY:  radiation, radiation_data_output_3d
176
177
178    IMPLICIT NONE
179
180    INTEGER(iwp) ::  av        !<
181    INTEGER(iwp) ::  i         !<
182    INTEGER(iwp) ::  if        !<
183    INTEGER(iwp) ::  j         !<
184    INTEGER(iwp) ::  k         !<
185    INTEGER(iwp) ::  n         !<
186    INTEGER(iwp) ::  nzb_do    !< vertical lower limit for data output
187    INTEGER(iwp) ::  nzt_do    !< vertical upper limit for data output
188
189    LOGICAL      ::  found     !<
190    LOGICAL      ::  resorted  !<
191
192    REAL(wp)     ::  mean_r    !<
193    REAL(wp)     ::  s_r2      !<
194    REAL(wp)     ::  s_r3      !<
195
196    REAL(sp), DIMENSION(:,:,:), ALLOCATABLE ::  local_pf  !<
197
198    REAL(wp), DIMENSION(:,:,:), POINTER ::  to_be_resorted  !<
199
200!
201!-- Return, if nothing to output
202    IF ( do3d_no(av) == 0 )  RETURN
203
204    CALL cpu_log (log_point(14),'data_output_3d','start')
205
206!
207!-- Open output file.
208!-- Also creates coordinate and fld-file for AVS.
209!-- For classic or 64bit netCDF output or output of other (old) data formats,
210!-- for a run on more than one PE, each PE opens its own file and
211!-- writes the data of its subdomain in binary format (regardless of the format
212!-- the user has requested). After the run, these files are combined to one
213!-- file by combine_plot_fields in the format requested by the user (netcdf
214!-- and/or avs).
215!-- For netCDF4/HDF5 output, data is written in parallel into one file.
216    IF ( netcdf_data_format < 5 )  THEN
217       CALL check_open( 30 )
218       IF ( myid == 0 )  CALL check_open( 106+av*10 )
219    ELSE
220       CALL check_open( 106+av*10 )
221    ENDIF
222
223!
224!-- For parallel netcdf output the time axis must be limited. Return, if this
225!-- limit is exceeded. This could be the case, if the simulated time exceeds
226!-- the given end time by the length of the given output interval.
227    IF ( netcdf_data_format > 4 )  THEN
228       IF ( do3d_time_count(av) + 1 > ntdim_3d(av) )  THEN
229          WRITE ( message_string, * ) 'Output of 3d data is not given at t=',  &
230                                      simulated_time, '&because the maximum ', & 
231                                      'number of output time levels is ',      &
232                                      'exceeded.'
233          CALL message( 'data_output_3d', 'PA0387', 0, 1, 0, 6, 0 )
234          CALL cpu_log( log_point(14), 'data_output_3d', 'stop' )
235          RETURN
236       ENDIF
237    ENDIF
238
239!
240!-- Update the netCDF time axis
241!-- In case of parallel output, this is only done by PE0 to increase the
242!-- performance.
243#if defined( __netcdf )
244    do3d_time_count(av) = do3d_time_count(av) + 1
245    IF ( myid == 0 )  THEN
246       nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_time_3d(av),           &
247                               (/ time_since_reference_point /),            &
248                               start = (/ do3d_time_count(av) /),           &
249                               count = (/ 1 /) )
250       CALL netcdf_handle_error( 'data_output_3d', 376 )
251    ENDIF
252#endif
253
254!
255!-- Loop over all variables to be written.
256    if = 1
257
258    DO  WHILE ( do3d(av,if)(1:1) /= ' ' )
259!
260!--    Store the array chosen on the temporary array.
261       resorted = .FALSE.
262       nzb_do = nzb
263       nzt_do = nz_do3d
264!
265!--    Set flag to steer output of radiation, land-surface, or user-defined
266!--    quantities
267       found = .FALSE.
268!
269!--    Allocate a temporary array with the desired output dimensions.
270       ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) )
271
272       SELECT CASE ( TRIM( do3d(av,if) ) )
273
274          CASE ( 'e' )
275             IF ( av == 0 )  THEN
276                to_be_resorted => e
277             ELSE
278                to_be_resorted => e_av
279             ENDIF
280
281          CASE ( 'lpt' )
282             IF ( av == 0 )  THEN
283                to_be_resorted => pt
284             ELSE
285                to_be_resorted => lpt_av
286             ENDIF
287
288          CASE ( 'nr' )
289             IF ( av == 0 )  THEN
290                to_be_resorted => nr
291             ELSE
292                to_be_resorted => nr_av
293             ENDIF
294
295          CASE ( 'p' )
296             IF ( av == 0 )  THEN
297                IF ( psolver /= 'sor' )  CALL exchange_horiz( p, nbgp )
298                to_be_resorted => p
299             ELSE
300                IF ( psolver /= 'sor' )  CALL exchange_horiz( p_av, nbgp )
301                to_be_resorted => p_av
302             ENDIF
303
304          CASE ( 'pc' )  ! particle concentration (requires ghostpoint exchange)
305             IF ( av == 0 )  THEN
306                IF ( simulated_time >= particle_advection_start )  THEN
307                   tend = prt_count
308                   CALL exchange_horiz( tend, nbgp )
309                ELSE
310                   tend = 0.0_wp
311                ENDIF
312                DO  i = nxlg, nxrg
313                   DO  j = nysg, nyng
314                      DO  k = nzb_do, nzt_do
315                         local_pf(i,j,k) = tend(k,j,i)
316                      ENDDO
317                   ENDDO
318                ENDDO
319                resorted = .TRUE.
320             ELSE
321                CALL exchange_horiz( pc_av, nbgp )
322                to_be_resorted => pc_av
323             ENDIF
324
325          CASE ( 'pr' )  ! mean particle radius (effective radius)
326             IF ( av == 0 )  THEN
327                IF ( simulated_time >= particle_advection_start )  THEN
328                   DO  i = nxl, nxr
329                      DO  j = nys, nyn
330                         DO  k = nzb_do, nzt_do
331                            number_of_particles = prt_count(k,j,i)
332                            IF (number_of_particles <= 0)  CYCLE
333                            particles => grid_particles(k,j,i)%particles(1:number_of_particles)
334                            s_r2 = 0.0_wp
335                            s_r3 = 0.0_wp
336                            DO  n = 1, number_of_particles
337                               IF ( particles(n)%particle_mask )  THEN
338                                  s_r2 = s_r2 + particles(n)%radius**2 * &
339                                         particles(n)%weight_factor
340                                  s_r3 = s_r3 + particles(n)%radius**3 * &
341                                         particles(n)%weight_factor
342                               ENDIF
343                            ENDDO
344                            IF ( s_r2 > 0.0_wp )  THEN
345                               mean_r = s_r3 / s_r2
346                            ELSE
347                               mean_r = 0.0_wp
348                            ENDIF
349                            tend(k,j,i) = mean_r
350                         ENDDO
351                      ENDDO
352                   ENDDO
353                   CALL exchange_horiz( tend, nbgp )
354                ELSE
355                   tend = 0.0_wp
356                ENDIF
357                DO  i = nxlg, nxrg
358                   DO  j = nysg, nyng
359                      DO  k = nzb_do, nzt_do
360                         local_pf(i,j,k) = tend(k,j,i)
361                      ENDDO
362                   ENDDO
363                ENDDO
364                resorted = .TRUE.
365             ELSE
366                CALL exchange_horiz( pr_av, nbgp )
367                to_be_resorted => pr_av
368             ENDIF
369
370          CASE ( 'prr' )
371             IF ( av == 0 )  THEN
372                CALL exchange_horiz( prr, nbgp )
373                DO  i = nxlg, nxrg
374                   DO  j = nysg, nyng
375                      DO  k = nzb_do, nzt_do
376                         local_pf(i,j,k) = prr(k,j,i)
377                      ENDDO
378                   ENDDO
379                ENDDO
380             ELSE
381                CALL exchange_horiz( prr_av, nbgp )
382                DO  i = nxlg, nxrg
383                   DO  j = nysg, nyng
384                      DO  k = nzb_do, nzt_do
385                         local_pf(i,j,k) = prr_av(k,j,i)
386                      ENDDO
387                   ENDDO
388                ENDDO
389             ENDIF
390             resorted = .TRUE.
391
392          CASE ( 'pt' )
393             IF ( av == 0 )  THEN
394                IF ( .NOT. cloud_physics ) THEN
395                   to_be_resorted => pt
396                ELSE
397                   DO  i = nxlg, nxrg
398                      DO  j = nysg, nyng
399                         DO  k = nzb_do, nzt_do
400                            local_pf(i,j,k) = pt(k,j,i) + l_d_cp *             &
401                                                          pt_d_t(k) *          &
402                                                          ql(k,j,i)
403                         ENDDO
404                      ENDDO
405                   ENDDO
406                   resorted = .TRUE.
407                ENDIF
408             ELSE
409                to_be_resorted => pt_av
410             ENDIF
411
412          CASE ( 'q' )
413             IF ( av == 0 )  THEN
414                to_be_resorted => q
415             ELSE
416                to_be_resorted => q_av
417             ENDIF
418
419          CASE ( 'qc' )
420             IF ( av == 0 )  THEN
421                to_be_resorted => qc
422             ELSE
423                to_be_resorted => qc_av
424             ENDIF
425
426          CASE ( 'ql' )
427             IF ( av == 0 )  THEN
428                to_be_resorted => ql
429             ELSE
430                to_be_resorted => ql_av
431             ENDIF
432
433          CASE ( 'ql_c' )
434             IF ( av == 0 )  THEN
435                to_be_resorted => ql_c
436             ELSE
437                to_be_resorted => ql_c_av
438             ENDIF
439
440          CASE ( 'ql_v' )
441             IF ( av == 0 )  THEN
442                to_be_resorted => ql_v
443             ELSE
444                to_be_resorted => ql_v_av
445             ENDIF
446
447          CASE ( 'ql_vp' )
448             IF ( av == 0 )  THEN
449                IF ( simulated_time >= particle_advection_start )  THEN
450                   DO  i = nxl, nxr
451                      DO  j = nys, nyn
452                         DO  k = nzb_do, nzt_do
453                            number_of_particles = prt_count(k,j,i)
454                            IF (number_of_particles <= 0)  CYCLE
455                            particles => grid_particles(k,j,i)%particles(1:number_of_particles)
456                            DO  n = 1, number_of_particles
457                               IF ( particles(n)%particle_mask )  THEN
458                                  tend(k,j,i) =  tend(k,j,i) +                 &
459                                                 particles(n)%weight_factor /  &
460                                                 prt_count(k,j,i)
461                               ENDIF
462                            ENDDO
463                         ENDDO
464                      ENDDO
465                   ENDDO
466                   CALL exchange_horiz( tend, nbgp )
467                ELSE
468                   tend = 0.0_wp
469                ENDIF
470                DO  i = nxlg, nxrg
471                   DO  j = nysg, nyng
472                      DO  k = nzb_do, nzt_do
473                         local_pf(i,j,k) = tend(k,j,i)
474                      ENDDO
475                   ENDDO
476                ENDDO
477                resorted = .TRUE.
478             ELSE
479                CALL exchange_horiz( ql_vp_av, nbgp )
480                to_be_resorted => ql_vp_av
481             ENDIF
482
483          CASE ( 'qr' )
484             IF ( av == 0 )  THEN
485                to_be_resorted => qr
486             ELSE
487                to_be_resorted => qr_av
488             ENDIF
489
490          CASE ( 'qv' )
491             IF ( av == 0 )  THEN
492                DO  i = nxlg, nxrg
493                   DO  j = nysg, nyng
494                      DO  k = nzb_do, nzt_do
495                         local_pf(i,j,k) = q(k,j,i) - ql(k,j,i)
496                      ENDDO
497                   ENDDO
498                ENDDO
499                resorted = .TRUE.
500             ELSE
501                to_be_resorted => qv_av
502             ENDIF
503
504          CASE ( 'rho' )
505             IF ( av == 0 )  THEN
506                to_be_resorted => rho
507             ELSE
508                to_be_resorted => rho_av
509             ENDIF
510
511          CASE ( 's' )
512             IF ( av == 0 )  THEN
513                to_be_resorted => s
514             ELSE
515                to_be_resorted => s_av
516             ENDIF
517
518          CASE ( 'sa' )
519             IF ( av == 0 )  THEN
520                to_be_resorted => sa
521             ELSE
522                to_be_resorted => sa_av
523             ENDIF
524
525          CASE ( 'u' )
526             IF ( av == 0 )  THEN
527                to_be_resorted => u
528             ELSE
529                to_be_resorted => u_av
530             ENDIF
531
532          CASE ( 'v' )
533             IF ( av == 0 )  THEN
534                to_be_resorted => v
535             ELSE
536                to_be_resorted => v_av
537             ENDIF
538
539          CASE ( 'vpt' )
540             IF ( av == 0 )  THEN
541                to_be_resorted => vpt
542             ELSE
543                to_be_resorted => vpt_av
544             ENDIF
545
546          CASE ( 'w' )
547             IF ( av == 0 )  THEN
548                to_be_resorted => w
549             ELSE
550                to_be_resorted => w_av
551             ENDIF
552
553          CASE DEFAULT
554
555!
556!--          Land surface quantity
557             IF ( land_surface )  THEN
558!
559!--             For soil model quantities, it is required to re-allocate local_pf
560                nzb_do = nzb_soil
561                nzt_do = nzt_soil
562
563                DEALLOCATE ( local_pf )
564                ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) )
565
566                CALL lsm_data_output_3d( av, do3d(av,if), found, local_pf )
567                resorted = .TRUE.
568
569!
570!--             If no soil model variable was found, re-allocate local_pf
571                IF ( .NOT. found )  THEN
572                   nzb_do = nzb
573                   nzt_do = nz_do3d
574
575                   DEALLOCATE ( local_pf )
576                   ALLOCATE( local_pf(nxlg:nxrg,nysg:nyng,nzb_do:nzt_do) )                 
577                ENDIF
578
579             ENDIF
580
581!
582!--          Radiation quantity
583             IF ( .NOT. found  .AND.  radiation )  THEN
584                CALL radiation_data_output_3d( av, do3d(av,if), found,         &
585                                               local_pf )
586                resorted = .TRUE.
587             ENDIF
588
589!
590!--          User defined quantity
591             IF ( .NOT. found )  THEN
592                CALL user_data_output_3d( av, do3d(av,if), found, local_pf,    &
593                                          nzb_do, nzt_do )
594                resorted = .TRUE.
595             ENDIF
596
597             IF ( .NOT. found )  THEN
598                message_string =  'no output available for: ' //               &
599                                  TRIM( do3d(av,if) )
600                CALL message( 'data_output_3d', 'PA0182', 0, 0, 0, 6, 0 )
601             ENDIF
602
603       END SELECT
604
605!
606!--    Resort the array to be output, if not done above
607       IF ( .NOT. resorted )  THEN
608          DO  i = nxlg, nxrg
609             DO  j = nysg, nyng
610                DO  k = nzb_do, nzt_do
611                   local_pf(i,j,k) = to_be_resorted(k,j,i)
612                ENDDO
613             ENDDO
614          ENDDO
615       ENDIF
616
617!
618!--    Output of the 3D-array
619#if defined( __parallel )
620       IF ( netcdf_data_format < 5 )  THEN
621!
622!--       Non-parallel netCDF output. Data is output in parallel in
623!--       FORTRAN binary format here, and later collected into one file by
624!--       combine_plot_fields
625          IF ( myid == 0 )  THEN
626             WRITE ( 30 )  time_since_reference_point,                   &
627                           do3d_time_count(av), av
628          ENDIF
629          DO  i = 0, io_blocks-1
630             IF ( i == io_group )  THEN
631                WRITE ( 30 )  nxlg, nxrg, nysg, nyng, nzb_do, nzt_do
632                WRITE ( 30 )  local_pf(:,:,nzb_do:nzt_do)
633             ENDIF
634
635             CALL MPI_BARRIER( comm2d, ierr )
636
637          ENDDO
638
639       ELSE
640#if defined( __netcdf )
641!
642!--       Parallel output in netCDF4/HDF5 format.
643!--       Do not output redundant ghost point data except for the
644!--       boundaries of the total domain.
645          IF ( nxr == nx  .AND.  nyn /= ny )  THEN
646             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if),  &
647                               local_pf(nxl:nxr+1,nys:nyn,nzb_do:nzt_do),    &
648                start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /),  &
649                count = (/ nxr-nxl+2, nyn-nys+1, nzt_do-nzb_do+1, 1 /) )
650          ELSEIF ( nxr /= nx  .AND.  nyn == ny )  THEN
651             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if),  &
652                               local_pf(nxl:nxr,nys:nyn+1,nzb_do:nzt_do),    &
653                start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /),  &
654                count = (/ nxr-nxl+1, nyn-nys+2, nzt_do-nzb_do+1, 1 /) )
655          ELSEIF ( nxr == nx  .AND.  nyn == ny )  THEN
656             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if),  &
657                             local_pf(nxl:nxr+1,nys:nyn+1,nzb_do:nzt_do  ),  &
658                start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /),  &
659                count = (/ nxr-nxl+2, nyn-nys+2, nzt_do-nzb_do+1, 1 /) )
660          ELSE
661             nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if),  &
662                                 local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do),    &
663                start = (/ nxl+1, nys+1, nzb_do+1, do3d_time_count(av) /),  &
664                count = (/ nxr-nxl+1, nyn-nys+1, nzt_do-nzb_do+1, 1 /) )
665          ENDIF
666          CALL netcdf_handle_error( 'data_output_3d', 386 )
667#endif
668       ENDIF
669#else
670#if defined( __netcdf )
671       nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_do3d(av,if),        &
672                         local_pf(nxl:nxr+1,nys:nyn+1,nzb_do:nzt_do),        &
673                         start = (/ 1, 1, 1, do3d_time_count(av) /),     &
674                         count = (/ nx+2, ny+2, nzt_do-nzb_do+1, 1 /) )
675       CALL netcdf_handle_error( 'data_output_3d', 446 )
676#endif
677#endif
678
679       if = if + 1
680
681!
682!--    Deallocate temporary array
683       DEALLOCATE ( local_pf )
684
685    ENDDO
686
687    CALL cpu_log( log_point(14), 'data_output_3d', 'stop' )
688
689!
690!-- Formats.
6913300 FORMAT ('variable ',I4,'  file=',A,'  filetype=unformatted  skip=',I12/   &
692             'label = ',A,A)
693
694 END SUBROUTINE data_output_3d
Note: See TracBrowser for help on using the repository browser.