Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 3574)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 3575)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix for output time levels in parallel NetCDF output with spinup
+! 
+! 3569 2018-11-27 17:03:40Z kanani
 ! Sort chemistry routine calls into list.
 ! dom_dwd_user, Schrempf:
@@ -3436,28 +3439,38 @@
 !--    Set needed time levels (ntdim) to 
 !--    saved time levels + to be saved time levels.
-       ntdim_3d(0) = do3d_time_count(0) + CEILING(                             &
-                     ( end_time - MAX( skip_time_do3d,                         &
-                                       simulated_time_at_begin )               &
+       ntdim_3d(0) = do3d_time_count(0) + CEILING(                                    &
+                     ( end_time - MAX(                                                &
+                         MERGE(skip_time_do3d, skip_time_do3d + spinup_time,          &
+                               data_output_during_spinup ),                           &
+                         simulated_time_at_begin )                                    &
                      ) / dt_do3d )
        IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1
 
-       ntdim_3d(1) = do3d_time_count(1) + CEILING(                             &
-                     ( end_time - MAX( skip_time_data_output_av,               &
-                                       simulated_time_at_begin )               &
+       ntdim_3d(1) = do3d_time_count(1) + CEILING(                                    &
+                     ( end_time - MAX(                                                &
+                         MERGE(skip_time_data_output_av, skip_time_data_output_av     &
+                              + spinup_time, data_output_during_spinup ),             &
+                         simulated_time_at_begin )                                    &
                      ) / dt_data_output_av )
 
-       ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING(                       &
-                        ( end_time - MAX( skip_time_do2d_xy,                   &
-                                          simulated_time_at_begin )            &
+       ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING(                              &
+                        ( end_time - MAX(                                             &
+                           MERGE(skip_time_do2d_xy, skip_time_do2d_xy + spinup_time,  &
+                               data_output_during_spinup ),                           &
+                                          simulated_time_at_begin )                   &
                         ) / dt_do2d_xy )
 
-       ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING(                       &
-                        ( end_time - MAX( skip_time_do2d_xz,                   &
-                                          simulated_time_at_begin )            &
+       ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING(                              &
+                        ( end_time - MAX(                                             &
+                         MERGE(skip_time_do2d_xz, skip_time_do2d_xz + spinup_time,    &
+                               data_output_during_spinup ),                           &
+                         simulated_time_at_begin )                                    &
                         ) / dt_do2d_xz )
 
-       ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING(                       &
-                        ( end_time - MAX( skip_time_do2d_yz,                   &
-                                          simulated_time_at_begin )            &
+       ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING(                              &
+                        ( end_time - MAX(                                             &
+                         MERGE(skip_time_do2d_yz, skip_time_do2d_yz + spinup_time,    &
+                               data_output_during_spinup ),                           &
+                         simulated_time_at_begin )                                    &
                         ) / dt_do2d_yz )
 
