Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 3379)
+++ palm/trunk/SOURCE/Makefile	(revision 3381)
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# dependencies for ocean_mod fixed
+# 
+# 3355 2018-10-16 14:03:34Z knoop
 # Add module for offline nesting;
 # Add surface_mod to synthetic-turbulence generator;
@@ -1308,4 +1311,5 @@
 	modules.o \
 	pmc_interface_mod.o \
+	surface_mod.o \
 	user_actions.o
 outflow_turbulence.o: \
Index: palm/trunk/SOURCE/ocean_mod.f90
===================================================================
--- palm/trunk/SOURCE/ocean_mod.f90	(revision 3379)
+++ palm/trunk/SOURCE/ocean_mod.f90	(revision 3381)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! spin-up cooling for ocean surface implemented, see new parameter
+! surface_cooling_spinup_time
+! 
+! 3311 2018-10-05 12:34:56Z raasch
 ! check if ocean mode is used for invalid combinations
 ! 
@@ -79,4 +83,5 @@
     LOGICAL ::  stokes_force = .FALSE.        !< switch to switch on the Stokes force
     LOGICAL ::  wave_breaking = .FALSE.       !< switch to switch on wave breaking effects
+    LOGICAL ::  surface_cooling_switched_off = .FALSE.  !< variable to check if surface heat flux has been switched off
 
     REAL(wp) ::  alpha_wave_breaking = 3.0_wp !< coefficient for wave breaking generated turbulence from Noh et al. (2004), JPO
@@ -87,4 +92,5 @@
     REAL(wp) ::  stokes_waveheight = 0.0_wp  !< wave height assumed for Stokes drift velocity
     REAL(wp) ::  stokes_wavelength = 0.0_wp  !< wavelength assumed for Stokes drift velocity
+    REAL(wp) ::  surface_cooling_spinup_time = 999999.9_wp  !< time after which surface heat flux is switched off
     REAL(wp) ::  timescale_wave_breaking     !< time scale of random forcing
     REAL(wp) ::  u_star_wave_breaking        !< to store the absolute value of friction velocity at the ocean surface
@@ -509,6 +515,6 @@
     NAMELIST /ocean_parameters/  bc_sa_t, bottom_salinityflux, salinity,       &
              sa_surface, sa_vertical_gradient, sa_vertical_gradient_level,     &
-             stokes_waveheight, stokes_wavelength, top_salinityflux,           &
-             wall_salinityflux, wave_breaking
+             stokes_waveheight, stokes_wavelength, surface_cooling_spinup_time,&
+             top_salinityflux, wall_salinityflux, wave_breaking
 
 !
@@ -1131,4 +1137,7 @@
     ENDIF
     IF ( .NOT. salinity )  WRITE( io, 4 )
+    IF ( surface_cooling_spinup_time /= 999999.9_wp )  THEN
+       WRITE( io, 5 )  surface_cooling_spinup_time
+    ENDIF
 
 1   FORMAT (//' Ocean settings:'/                                              &
@@ -1141,4 +1150,5 @@
             '        timescale:',F5.1,' s')
 4   FORMAT ('    --> prognostic salinity equation is switched off' )
+5   FORMAT ('    --> surface heat flux is switched off after ',F8.1,' s')
 
  END SUBROUTINE ocean_header
@@ -1484,6 +1494,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  dt_3d, intermediate_timestep_count, intermediate_timestep_count_max,   &
-               scalar_advec, timestep_scheme, tsc, ws_scheme_sca
+        ONLY:  dt_3d, intermediate_timestep_count,                             &
+               intermediate_timestep_count_max, scalar_advec, simulated_time,  &
+               timestep_scheme, tsc, ws_scheme_sca
 
     USE cpulog,                                                                &
@@ -1510,4 +1521,16 @@
 
     REAL(wp)     ::  sbt     !< weighting factor for sub-time step
+
+!
+!-- Switch of the surface heat flux, if requested
+    IF ( surface_cooling_spinup_time /= 999999.9_wp )  THEN
+       IF ( .NOT. surface_cooling_switched_off  .AND.                          &
+            simulated_time >= surface_cooling_spinup_time )  THEN
+
+          surf_def_h(2)%shf = 0.0_wp
+          surface_cooling_switched_off = .TRUE.
+
+       ENDIF
+    ENDIF
 
 !
@@ -1636,6 +1659,6 @@
     USE control_parameters,                                                    &
         ONLY:  dt_3d, intermediate_timestep_count,                             &
-               intermediate_timestep_count_max, timestep_scheme, tsc,          &
-               ws_scheme_sca
+               intermediate_timestep_count_max, simulated_time,                &
+               timestep_scheme, tsc, ws_scheme_sca
 
     USE diffusion_s_mod,                                                       &
@@ -1660,4 +1683,17 @@
     INTEGER(iwp) ::  k             !< loop index z direction
     INTEGER(iwp) ::  tn            !< task number of openmp task
+
+
+!
+!-- Switch of the surface heat flux, if requested
+    IF ( surface_cooling_spinup_time /= 999999.9_wp )  THEN
+       IF ( .NOT. surface_cooling_switched_off  .AND.                          &
+            simulated_time >= surface_cooling_spinup_time )  THEN
+
+          surf_def_h(2)%shf = 0.0_wp
+          surface_cooling_switched_off = .TRUE.
+
+       ENDIF
+    ENDIF
 
 !
@@ -1813,4 +1849,7 @@
        CASE ( 'stokes_wavelength' )
           READ ( 13 )  stokes_wavelength
+
+       CASE ( 'surface_cooling_spinup_time' )
+          READ ( 13 )  surface_cooling_spinup_time
 
        CASE ( 'top_salinityflux' )
@@ -1945,4 +1984,7 @@
     CALL wrd_write_string( 'stokes_wavelength' )
     WRITE ( 14 )  stokes_wavelength
+
+    CALL wrd_write_string( 'surface_cooling_spinup_time' )
+    WRITE ( 14 )  surface_cooling_spinup_time
 
     CALL wrd_write_string( 'top_salinityflux' )
