Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 4790)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 4791)
@@ -24,4 +24,7 @@
 ! -----------------
 ! $Id$
+! Add possibility to initialize surface flux of passive scalar via static driver
+!
+! 4783 2020-11-13 13:58:45Z raasch
 ! bugfix for reading restart data with MPI-I/O (does not work with blockwise I/O)
 !
@@ -1604,30 +1607,55 @@
        ENDIF
 !
-!--    Input surface sensible heat flux.
-       IF ( check_existence( vars_pids, 'qsws' ) )  THEN
-!
-!--       Read _FillValue attribute
-          CALL get_attribute( pids_id, char_fill, tmp_2d%fill,                 &
-                              .FALSE., 'qsws' )
-!
-!--       Read variable
-          CALL get_variable( pids_id, 'qsws', tmp_2d%var,                      &
-                             nxl, nxr, nys, nyn )
-!
-!--       Initialize latent heat flux. Note, qsws will be only initialized at default-type surfaces.
-!--       At natural or urban qsws is implicitly initialized by the respective parameter lists.
-!--       Initialize horizontal surface elements.
-          CALL init_single_surface_properties( surf_def_h(0)%qsws, tmp_2d%var, surf_def_h(0)%ns,   &
-                                               tmp_2d%fill, surf_def_h(0)%i, surf_def_h(0)%j )
-!
-!--       Initialize latent heat flux also at vertical surface elements.
-!--       Note, the actual 2D input arrays are only defined on the subdomain. Therefore, pass the
-!--       index arrays with their respective offset values.
-          DO  l = 0, 3
-             CALL init_single_surface_properties( surf_def_v(l)%qsws, tmp_2d%var, surf_def_v(l)%ns,&
-                                                  tmp_2d%fill, surf_def_v(l)%i+surf_def_v(l)%ioff, &
-                                                  surf_def_v(l)%j+surf_def_v(l)%joff )
-          ENDDO
-
+!--    Input surface latent heat flux.
+       IF ( humidity )  THEN
+          IF ( check_existence( vars_pids, 'qsws' ) )  THEN
+!
+!--          Read _FillValue attribute
+             CALL get_attribute( pids_id, char_fill, tmp_2d%fill, .FALSE., 'qsws' )
+!
+!--          Read variable
+             CALL get_variable( pids_id, 'qsws', tmp_2d%var, nxl, nxr, nys, nyn )
+!
+!--          Initialize latent heat flux. Note, qsws will be only initialized at default-type surfaces.
+!--          At natural or urban qsws is implicitly initialized by the respective parameter lists.
+!--          Initialize horizontal surface elements.
+             CALL init_single_surface_properties( surf_def_h(0)%qsws, tmp_2d%var, surf_def_h(0)%ns,&
+                                                  tmp_2d%fill, surf_def_h(0)%i, surf_def_h(0)%j )
+!
+!--          Initialize latent heat flux also at vertical surface elements.
+!--          Note, the actual 2D input arrays are only defined on the subdomain. Therefore, pass the
+!--          index arrays with their respective offset values.
+             DO  l = 0, 3
+                CALL init_single_surface_properties( surf_def_v(l)%qsws, tmp_2d%var,               &
+                                                     surf_def_v(l)%ns, tmp_2d%fill,                &
+                                                     surf_def_v(l)%i+surf_def_v(l)%ioff,           &
+                                                     surf_def_v(l)%j+surf_def_v(l)%joff )
+             ENDDO
+
+          ENDIF
+       ENDIF
+!
+!--    Input passive scalar flux.
+       IF ( passive_scalar )  THEN
+          IF ( check_existence( vars_pids, 'ssws' ) )  THEN
+!
+!--          Read _FillValue attribute
+             CALL get_attribute( pids_id, char_fill, tmp_2d%fill, .FALSE., 'ssws' )
+!
+!--          Read variable
+             CALL get_variable( pids_id, 'ssws', tmp_2d%var, nxl, nxr, nys, nyn )
+!
+!--          Initialize passive scalar flux. Initialize horizontal surface elements.
+             CALL init_single_surface_properties( surf_def_h(0)%ssws, tmp_2d%var, surf_def_h(0)%ns,&
+                                                  tmp_2d%fill, surf_def_h(0)%i, surf_def_h(0)%j )
+
+             DO  l = 0, 3
+                CALL init_single_surface_properties( surf_def_v(l)%ssws, tmp_2d%var,               &
+                                                     surf_def_v(l)%ns, tmp_2d%fill,                &
+                                                     surf_def_v(l)%i+surf_def_v(l)%ioff,           &
+                                                     surf_def_v(l)%j+surf_def_v(l)%joff )
+             ENDDO
+
+          ENDIF
        ENDIF
 !
