Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 4195)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! 4172 2019-08-20 11:55:33Z oliver.maas
+! Overwrite rotation_angle from namelist by value from static driver
+! 
+! 11:55:33Z oliver.maas
 ! removed conversion from recycle_absolute_quantities to raq, added check and 
 ! error message for correct input of recycling_method_for_thermodynamic_quantities
@@ -1085,9 +1088,10 @@
 
 !
-!-- Overwrite latitude if necessary and compute Coriolis parameter. 
+!-- Overwrite parameters from namelist if necessary and compute Coriolis parameter. 
 !-- @todo - move initialization of f and fs to coriolis_mod.
     IF ( input_pids_static )  THEN
-       latitude  = init_model%latitude
-       longitude = init_model%longitude
+       latitude       = init_model%latitude
+       longitude      = init_model%longitude
+       rotation_angle = init_model%rotation_angle
     ENDIF
 
Index: palm/trunk/SOURCE/coriolis.f90
===================================================================
--- palm/trunk/SOURCE/coriolis.f90	(revision 4195)
+++ palm/trunk/SOURCE/coriolis.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Consider rotation of model domain
+! 
+! 4182 2019-08-22 15:20:23Z scharf
 ! Corrected "Former revisions" section
 ! 
@@ -65,7 +68,10 @@
        USE arrays_3d,                                                          &
            ONLY:  tend, u, ug, v, vg, w 
-           
+
+       USE basic_constants_and_equations_mod,                                  &
+           ONLY:  pi
+
        USE control_parameters,                                                 &
-           ONLY:  f, fs, message_string
+           ONLY:  f, fs, message_string, rotation_angle
            
        USE indices,                                                            &
@@ -76,10 +82,17 @@
        IMPLICIT NONE
 
-       INTEGER(iwp) ::  component  !< 
-       INTEGER(iwp) ::  i          !< running index x direction 
-       INTEGER(iwp) ::  j          !< running index y direction 
-       INTEGER(iwp) ::  k          !< running index z direction 
-
+       INTEGER(iwp) ::  component      !< component of momentum equation
+       INTEGER(iwp) ::  i              !< running index x direction 
+       INTEGER(iwp) ::  j              !< running index y direction 
+       INTEGER(iwp) ::  k              !< running index z direction 
+
+       REAL(wp)     ::  cos_rot_angle  !< cosine of model rotation angle
        REAL(wp)     ::  flag           !< flag to mask topography
+       REAL(wp)     ::  sin_rot_angle  !< sine of model rotation angle
+
+!
+!--    Precalculate cosine and sine of rotation angle
+       cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+       sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
 !
@@ -99,14 +112,13 @@
 !
 !--                   Predetermine flag to mask topography
-                      flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_0(k,j,i), 1 ) )
-
-                      tend(k,j,i) = tend(k,j,i) + f  *    ( 0.25_wp *          &
-                                   ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) +    &
-                                     v(k,j+1,i) ) - vg(k) ) * flag             &
-                                                - fs *    ( 0.25_wp *          &
-                                   ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) +  &
-                                     w(k,j,i)   )                              &
-                                                          ) * flag
+                      flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 1 ) )
+
+                      tend(k,j,i) = tend(k,j,i) + flag *                                           &
+                            ( f                                                                    &
+                              * ( 0.25_wp * ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + v(k,j+1,i) )  &
+                                - vg(k) )                                                          &
+                            - fs * cos_rot_angle                                                   &
+                              * 0.25_wp * ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) + w(k,j,i) )    &
+                            )
                    ENDDO
                 ENDDO
@@ -118,5 +130,5 @@
              !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k, flag) &
              !$ACC PRESENT(wall_flags_0) &
-             !$ACC PRESENT(u, ug) &
+             !$ACC PRESENT(u, w, ug) &
              !$ACC PRESENT(tend)
              DO  i = nxl, nxr
@@ -125,10 +137,13 @@
 !
 !--                   Predetermine flag to mask topography
-                      flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_0(k,j,i), 2 ) )
-
-                      tend(k,j,i) = tend(k,j,i) - f *     ( 0.25_wp *          &
-                                   ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) +    &
-                                     u(k,j,i+1) ) - ug(k) ) * flag
+                      flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 2 ) )
+
+                      tend(k,j,i) = tend(k,j,i) - flag *                                           &
+                            ( f                                                                    &
+                              * ( 0.25_wp * ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + u(k,j,i+1) )  &
+                                - ug(k) )                                                          &
+                            + fs * sin_rot_angle                                                   &
+                              * 0.25_wp * ( w(k,j,i) + w(k-1,j,i) + w(k,j-1,i) + w(k-1,j-1,i) )    &
+                            )
                    ENDDO
                 ENDDO
@@ -140,5 +155,5 @@
              !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k, flag) &
              !$ACC PRESENT(wall_flags_0) &
-             !$ACC PRESENT(u) &
+             !$ACC PRESENT(u, v) &
              !$ACC PRESENT(tend)
              DO  i = nxl, nxr
@@ -147,10 +162,13 @@
 !
 !--                   Predetermine flag to mask topography
-                      flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                    BTEST( wall_flags_0(k,j,i), 3 ) )
-
-                      tend(k,j,i) = tend(k,j,i) + fs * 0.25_wp *               &
-                                   ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) +      &
-                                     u(k+1,j,i+1) ) * flag
+                      flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 3 ) )
+
+                      tend(k,j,i) = tend(k,j,i)                                                 &
+                                  + fs * 0.25_wp * flag                                         &
+                                    * ( cos_rot_angle                                           &
+                                        * ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) + u(k+1,j,i+1) ) &
+                                      + sin_rot_angle                                           &
+                                        * ( v(k,j,i) + v(k+1,j,i) + v(k,j+1,i) + v(k+1,j+1,i) ) &
+                                      )
                    ENDDO
                 ENDDO
@@ -176,7 +194,10 @@
        USE arrays_3d,                                                          &
            ONLY:  tend, u, ug, v, vg, w 
-           
+
+       USE basic_constants_and_equations_mod,                                  &
+           ONLY:  pi
+
        USE control_parameters,                                                 &
-           ONLY:  f, fs, message_string
+           ONLY:  f, fs, message_string, rotation_angle
            
        USE indices,                                                            &
@@ -184,13 +205,20 @@
            
        USE kinds
-       
+
        IMPLICIT NONE
 
-       INTEGER(iwp) ::  component  !< 
+       INTEGER(iwp) ::  component  !< component of momentum equation
        INTEGER(iwp) ::  i          !< running index x direction 
        INTEGER(iwp) ::  j          !< running index y direction 
        INTEGER(iwp) ::  k          !< running index z direction 
 
-       REAL(wp)     ::  flag       !< flag to mask topography
+       REAL(wp)     ::  cos_rot_angle  !< cosine of model rotation angle
+       REAL(wp)     ::  flag           !< flag to mask topography
+       REAL(wp)     ::  sin_rot_angle  !< sine of model rotation angle
+
+!
+!--    Precalculate cosine and sine of rotation angle
+       cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+       sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
 !
@@ -206,11 +234,11 @@
                 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 1 ) )
 
-                tend(k,j,i) = tend(k,j,i) + f  *     ( 0.25_wp *               &
-                                ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) +       &
-                                  v(k,j+1,i) ) - vg(k)                         &
-                                                     ) * flag                  &
-                                          - fs *     ( 0.25_wp *               &
-                                ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) +     &
-                                  w(k,j,i)   )       ) * flag
+                tend(k,j,i) = tend(k,j,i) + flag *                                                 &
+                            ( f                                                                    &
+                              * ( 0.25_wp * ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + v(k,j+1,i) )  &
+                                - vg(k) )                                                          &
+                            - fs * cos_rot_angle                                                   &
+                              * 0.25_wp * ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) + w(k,j,i) )    &
+                            )
              ENDDO
 
@@ -223,7 +251,11 @@
                 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 2 ) )
 
-                tend(k,j,i) = tend(k,j,i) - f *        ( 0.25_wp *             &
-                                ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) +       &
-                                  u(k,j,i+1) ) - ug(k) ) * flag
+                tend(k,j,i) = tend(k,j,i) - flag *                                                 &
+                            ( f                                                                    &
+                              * ( 0.25_wp * ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + u(k,j,i+1) )  &
+                                - ug(k) )                                                          &
+                            + fs * sin_rot_angle                                                   &
+                              * 0.25_wp * ( w(k,j,i) + w(k-1,j,i) + w(k,j-1,i) + w(k-1,j-1,i) )    &
+                            )
              ENDDO
 
@@ -236,7 +268,11 @@
                 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 3 ) )
 
-                tend(k,j,i) = tend(k,j,i) + fs * 0.25_wp *                     &
-                                ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) +         &
-                                  u(k+1,j,i+1) ) * flag
+                tend(k,j,i) = tend(k,j,i)                                                 &
+                            + fs * 0.25_wp * flag                                         &
+                              * ( cos_rot_angle                                           &
+                                  * ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) + u(k+1,j,i+1) ) &
+                                + sin_rot_angle                                           &
+                                  * ( v(k,j,i) + v(k+1,j,i) + v(k,j+1,i) + v(k+1,j+1,i) ) &
+                                )
              ENDDO
 
Index: palm/trunk/SOURCE/header.f90
===================================================================
--- palm/trunk/SOURCE/header.f90	(revision 4195)
+++ palm/trunk/SOURCE/header.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Write information about rotation angle
+! 
+! 4182 2019-08-22 15:20:23Z scharf
 ! Corrected "Former revisions" section
 ! 
@@ -1466,5 +1469,5 @@
 !
 !-- Geostrophic parameters
-    WRITE ( io, 410 )  latitude, longitude, omega, f, fs
+    WRITE ( io, 410 )  latitude, longitude, rotation_angle, omega, f, fs
 
 !
@@ -1796,6 +1799,7 @@
 400 FORMAT (//' Physical quantities:'/ &
               ' -------------------'/)
-410 FORMAT ('    Geograph. latitude  :   latitude  = ',F4.1,' degr'/   &
-            '    Geograph. longitude :   longitude = ',F4.1,' degr'/   &
+410 FORMAT ('    Geograph. latitude  :   latitude  = ',F5.1,' degr'/   &
+            '    Geograph. longitude :   longitude = ',F5.1,' degr'/   &
+            '    Rotation angle      :   rotation_angle = ',F5.1,' degr'/   &
             '    Angular velocity    :   omega  =',E10.3,' rad/s'/  &
             '    Coriolis parameter  :   f      = ',F9.6,' 1/s'/    &
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 4195)
+++ palm/trunk/SOURCE/modules.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added rotation_angle
+! 
+! 4184 2019-08-23 08:07:40Z oliver.maas
 ! changed allocated length of recycling_method_for_thermodynamic_quantities 
 ! from 20 to 80 characters
@@ -867,4 +870,5 @@
     REAL(wp) ::  rho_reference                                 !< reference state of density
     REAL(wp) ::  rho_surface                                   !< surface value of density
+    REAL(wp) ::  rotation_angle = 0.0_wp                       !< angle between real North and model North (clockwise)
     REAL(wp) ::  roughness_length = 0.1_wp                     !< namelist parameter
     REAL(wp) ::  simulated_time = 0.0_wp                       !< elapsed simulated time
Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 4195)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 4196)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! replaced rotation angle from input-netCDF file
+! by namelist parameter 'rotation_angle'
+! 
+! 4182 2019-08-22 15:20:23Z scharf
 ! Corrected "Former revisions" section
 ! 
@@ -114,5 +118,7 @@
         ONLY:  biometeorology, fl_max,                                         &
                max_masks, multi_agent_system_end,                              &
-               multi_agent_system_start, var_fl_max, varnamelength
+               multi_agent_system_start,                                       &
+               rotation_angle,                                                 &
+               var_fl_max, varnamelength
     USE kinds
 #if defined( __netcdf )
@@ -544,10 +550,10 @@
     LOGICAL, SAVE ::  init_netcdf = .FALSE.                  !<
 
-    REAL(wp) ::  cos_ra                                      !< cosine of rotation_angle
+    REAL(wp) ::  cos_rot_angle                               !< cosine of rotation_angle
     REAL(wp) ::  eutm                                        !< easting (UTM)
     REAL(wp) ::  nutm                                        !< northing (UTM)
     REAL(wp) ::  shift_x                                     !< shift of x coordinate
     REAL(wp) ::  shift_y                                     !< shift of y coordinate
-    REAL(wp) ::  sin_ra                                      !< sine of rotation_angle
+    REAL(wp) ::  sin_rot_angle                               !< sine of rotation_angle
 
     REAL(wp), DIMENSION(1) ::  last_time_coordinate          !< last time value in file
@@ -1026,8 +1032,8 @@
 !
 !--       Write UTM coordinates
-          IF ( init_model%rotation_angle == 0.0_wp )  THEN
+          IF ( rotation_angle == 0.0_wp )  THEN
 !
 !--          1D in case of no rotation
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
 !
 !--          x coordinates
@@ -1048,5 +1054,5 @@
                 ENDIF
 
-                netcdf_data = init_model%origin_x + cos_ra                     &
+                netcdf_data = init_model%origin_x + cos_rot_angle              &
                        * ( mask_i_global(mid,:mask_size(mid,1)) + shift_x ) * dx
 
@@ -1077,5 +1083,5 @@
                 ENDIF
 
-                netcdf_data = init_model%origin_y + cos_ra                     &
+                netcdf_data = init_model%origin_y + cos_rot_angle              &
                        * ( mask_j_global(mid,:mask_size(mid,2)) + shift_y ) * dy
 
@@ -1093,6 +1099,6 @@
 !--          2D in case of rotation
              ALLOCATE( netcdf_data_2d(mask_size(mid,1),mask_size(mid,2)) )
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-             sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+             sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
              DO  k = 0, 2
@@ -1113,7 +1119,7 @@
                DO  j = 1, mask_size(mid,2)
                   DO  i = 1, mask_size(mid,1)
-                     netcdf_data_2d(i,j) = init_model%origin_x                 &
-                           + cos_ra * ( mask_i_global(mid,i) + shift_x ) * dx  &
-                           + sin_ra * ( mask_j_global(mid,j) + shift_y ) * dy
+                     netcdf_data_2d(i,j) = init_model%origin_x                        &
+                           + cos_rot_angle * ( mask_i_global(mid,i) + shift_x ) * dx  &
+                           + sin_rot_angle * ( mask_j_global(mid,j) + shift_y ) * dy
                   ENDDO
                ENDDO
@@ -1128,7 +1134,7 @@
                DO  j = 1, mask_size(mid,2)
                   DO  i = 1, mask_size(mid,1)
-                     netcdf_data_2d(i,j) = init_model%origin_y                 &
-                           - sin_ra * ( mask_i_global(mid,i) + shift_x ) * dx  &
-                           + cos_ra * ( mask_j_global(mid,j) + shift_y ) * dy
+                     netcdf_data_2d(i,j) = init_model%origin_y                        &
+                           - sin_rot_angle * ( mask_i_global(mid,i) + shift_x ) * dx  &
+                           + cos_rot_angle * ( mask_j_global(mid,j) + shift_y ) * dy
                   ENDDO
                ENDDO
@@ -1148,6 +1154,6 @@
           ALLOCATE( lat(mask_size(mid,1),mask_size(mid,2)) )
           ALLOCATE( lon(mask_size(mid,1),mask_size(mid,2)) )
-          cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-          sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+          cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+          sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
           DO  k = 0, 2
@@ -1168,10 +1174,10 @@
              DO  j = 1, mask_size(mid,2)
                 DO  i = 1, mask_size(mid,1)
-                   eutm = init_model%origin_x                               &
-                        + cos_ra * ( mask_i_global(mid,i) + shift_x ) * dx  &
-                        + sin_ra * ( mask_j_global(mid,j) + shift_y ) * dy
-                   nutm = init_model%origin_y                               &
-                        - sin_ra * ( mask_i_global(mid,i) + shift_x ) * dx  &
-                        + cos_ra * ( mask_j_global(mid,j) + shift_y ) * dy
+                   eutm = init_model%origin_x                                      &
+                        + cos_rot_angle * ( mask_i_global(mid,i) + shift_x ) * dx  &
+                        + sin_rot_angle * ( mask_j_global(mid,j) + shift_y ) * dy
+                   nutm = init_model%origin_y                                      &
+                        - sin_rot_angle * ( mask_i_global(mid,i) + shift_x ) * dx  &
+                        + cos_rot_angle * ( mask_j_global(mid,j) + shift_y ) * dy
 
                    CALL  convert_utm_to_geographic( crs_list,          &
@@ -1845,8 +1851,8 @@
 !
 !--          Write UTM coordinates
-             IF ( init_model%rotation_angle == 0.0_wp )  THEN
+             IF ( rotation_angle == 0.0_wp )  THEN
 !
 !--             1D in case of no rotation
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
 !
 !--             x coordinates
@@ -1868,10 +1874,10 @@
 
                    DO  i = 0, nx
-                     netcdf_data(i) = init_model%origin_x            &
-                                    + cos_ra * ( i + shift_x ) * dx
+                     netcdf_data(i) = init_model%origin_x                      &
+                                    + cos_rot_angle * ( i + shift_x ) * dx
                    ENDDO
 
                    nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_eutm_3d(k,av),&
-                                           netcdf_data, start = (/ 1 /),   &
+                                           netcdf_data, start = (/ 1 /),       &
                                            count = (/ nx+1 /) )
                    CALL netcdf_handle_error( 'netcdf_define_header', 555 )
@@ -1898,10 +1904,10 @@
 
                    DO  j = 0, ny
-                      netcdf_data(j) = init_model%origin_y            &
-                                     + cos_ra * ( j + shift_y ) * dy
+                      netcdf_data(j) = init_model%origin_y                     &
+                                     + cos_rot_angle * ( j + shift_y ) * dy
                    ENDDO
 
                    nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_nutm_3d(k,av),&
-                                           netcdf_data, start = (/ 1 /),   &
+                                           netcdf_data, start = (/ 1 /),       &
                                            count = (/ ny+1 /) )
                    CALL netcdf_handle_error( 'netcdf_define_header', 556 )
@@ -1914,6 +1920,6 @@
 !--             2D in case of rotation
                 ALLOCATE( netcdf_data_2d(0:nx,0:ny) )
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-                sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+                sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
                 DO  k = 0, 2
@@ -1934,7 +1940,7 @@
                   DO  j = 0, ny
                      DO  i = 0, nx
-                        netcdf_data_2d(i,j) = init_model%origin_x            &
-                                            + cos_ra * ( i + shift_x ) * dx  &
-                                            + sin_ra * ( j + shift_y ) * dy
+                        netcdf_data_2d(i,j) = init_model%origin_x                   &
+                                            + cos_rot_angle * ( i + shift_x ) * dx  &
+                                            + sin_rot_angle * ( j + shift_y ) * dy
                      ENDDO
                   ENDDO
@@ -1947,7 +1953,7 @@
                   DO  j = 0, ny
                      DO  i = 0, nx
-                        netcdf_data_2d(i,j) = init_model%origin_y            &
-                                            - sin_ra * ( i + shift_x ) * dx  &
-                                            + cos_ra * ( j + shift_y ) * dy
+                        netcdf_data_2d(i,j) = init_model%origin_y                   &
+                                            - sin_rot_angle * ( i + shift_x ) * dx  &
+                                            + cos_rot_angle * ( j + shift_y ) * dy
                      ENDDO
                   ENDDO
@@ -1999,6 +2005,6 @@
              ALLOCATE( lat(nxl:nxr,nys:nyn) )
              ALLOCATE( lon(nxl:nxr,nys:nyn) )
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-             sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+             sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
              DO  k = 0, 2
@@ -2019,10 +2025,10 @@
                 DO  j = nys, nyn
                    DO  i = nxl, nxr
-                      eutm = init_model%origin_x            &
-                           + cos_ra * ( i + shift_x ) * dx  &
-                           + sin_ra * ( j + shift_y ) * dy
-                      nutm = init_model%origin_y            &
-                           - sin_ra * ( i + shift_x ) * dx  &
-                           + cos_ra * ( j + shift_y ) * dy
+                      eutm = init_model%origin_x                   &
+                           + cos_rot_angle * ( i + shift_x ) * dx  &
+                           + sin_rot_angle * ( j + shift_y ) * dy
+                      nutm = init_model%origin_y                   &
+                           - sin_rot_angle * ( i + shift_x ) * dx  &
+                           + cos_rot_angle * ( j + shift_y ) * dy
 
                       CALL  convert_utm_to_geographic( crs_list,          &
@@ -2913,8 +2919,8 @@
 !
 !--          Write UTM coordinates
-             IF ( init_model%rotation_angle == 0.0_wp )  THEN
+             IF ( rotation_angle == 0.0_wp )  THEN
 !
 !--             1D in case of no rotation
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
 !
 !--             x coordinates
@@ -2936,10 +2942,10 @@
 
                    DO  i = 0, nx
-                     netcdf_data(i) = init_model%origin_x            &
-                                    + cos_ra * ( i + shift_x ) * dx
+                     netcdf_data(i) = init_model%origin_x                      &
+                                    + cos_rot_angle * ( i + shift_x ) * dx
                    ENDDO
 
                    nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_eutm_xy(k,av),&
-                                           netcdf_data, start = (/ 1 /),   &
+                                           netcdf_data, start = (/ 1 /),       &
                                            count = (/ nx+1 /) )
                    CALL netcdf_handle_error( 'netcdf_define_header', 555 )
@@ -2966,10 +2972,10 @@
 
                    DO  j = 0, ny
-                      netcdf_data(j) = init_model%origin_y            &
-                                     + cos_ra * ( j + shift_y ) * dy
+                      netcdf_data(j) = init_model%origin_y                     &
+                                     + cos_rot_angle * ( j + shift_y ) * dy
                    ENDDO
 
                    nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_nutm_xy(k,av),&
-                                           netcdf_data, start = (/ 1 /),   &
+                                           netcdf_data, start = (/ 1 /),       &
                                            count = (/ ny+1 /) )
                    CALL netcdf_handle_error( 'netcdf_define_header', 556 )
@@ -2982,6 +2988,6 @@
 !--             2D in case of rotation
                 ALLOCATE( netcdf_data_2d(0:nx,0:ny) )
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-                sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+                sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
                 DO  k = 0, 2
@@ -3002,7 +3008,7 @@
                   DO  j = 0, ny
                      DO  i = 0, nx
-                        netcdf_data_2d(i,j) = init_model%origin_x            &
-                                            + cos_ra * ( i + shift_x ) * dx  &
-                                            + sin_ra * ( j + shift_y ) * dy
+                        netcdf_data_2d(i,j) = init_model%origin_x                   &
+                                            + cos_rot_angle * ( i + shift_x ) * dx  &
+                                            + sin_rot_angle * ( j + shift_y ) * dy
                      ENDDO
                   ENDDO
@@ -3015,7 +3021,7 @@
                   DO  j = 0, ny
                      DO  i = 0, nx
-                        netcdf_data_2d(i,j) = init_model%origin_y            &
-                                            - sin_ra * ( i + shift_x ) * dx  &
-                                            + cos_ra * ( j + shift_y ) * dy
+                        netcdf_data_2d(i,j) = init_model%origin_y                   &
+                                            - sin_rot_angle * ( i + shift_x ) * dx  &
+                                            + cos_rot_angle * ( j + shift_y ) * dy
                      ENDDO
                   ENDDO
@@ -3037,6 +3043,6 @@
              ALLOCATE( lat(nxl:nxr,nys:nyn) )
              ALLOCATE( lon(nxl:nxr,nys:nyn) )
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-             sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+             sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
              DO  k = 0, 2
@@ -3057,10 +3063,10 @@
                 DO  j = nys, nyn
                    DO  i = nxl, nxr
-                      eutm = init_model%origin_x            &
-                           + cos_ra * ( i + shift_x ) * dx  &
-                           + sin_ra * ( j + shift_y ) * dy
-                      nutm = init_model%origin_y            &
-                           - sin_ra * ( i + shift_x ) * dx  &
-                           + cos_ra * ( j + shift_y ) * dy
+                      eutm = init_model%origin_x                   &
+                           + cos_rot_angle * ( i + shift_x ) * dx  &
+                           + sin_rot_angle * ( j + shift_y ) * dy
+                      nutm = init_model%origin_y                   &
+                           - sin_rot_angle * ( i + shift_x ) * dx  &
+                           + cos_rot_angle * ( j + shift_y ) * dy
 
                       CALL  convert_utm_to_geographic( crs_list,          &
@@ -3798,8 +3804,8 @@
 !
 !--          Write UTM coordinates
-             IF ( init_model%rotation_angle == 0.0_wp )  THEN
+             IF ( rotation_angle == 0.0_wp )  THEN
 !
 !--             1D in case of no rotation
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
 !
 !--             x coordinates
@@ -3821,10 +3827,10 @@
 
                    DO  i = 0, nx
-                     netcdf_data(i) = init_model%origin_x            &
-                                    + cos_ra * ( i + shift_x ) * dx
+                     netcdf_data(i) = init_model%origin_x                      &
+                                    + cos_rot_angle * ( i + shift_x ) * dx
                    ENDDO
 
                    nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_eutm_xz(k,av),&
-                                           netcdf_data, start = (/ 1 /),   &
+                                           netcdf_data, start = (/ 1 /),       &
                                            count = (/ nx+1 /) )
                    CALL netcdf_handle_error( 'netcdf_define_header', 555 )
@@ -3855,5 +3861,5 @@
                       ELSE
                          netcdf_data(i) = init_model%origin_y &
-                                     + cos_ra * ( section(i,2) + shift_y ) * dy
+                                     + cos_rot_angle * ( section(i,2) + shift_y ) * dy
                       ENDIF
                    ENDDO
@@ -3871,6 +3877,6 @@
 !--             2D in case of rotation
                 ALLOCATE( netcdf_data_2d(0:nx,1:ns) )
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-                sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+                sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
                 DO  k = 0, 2
@@ -3894,7 +3900,7 @@
                       ELSE
                          DO  i = 0, nx
-                            netcdf_data_2d(i,j) = init_model%origin_x          &
-                                    + cos_ra * ( i + shift_x ) * dx            &
-                                    + sin_ra * ( section(j,2) + shift_y ) * dy
+                            netcdf_data_2d(i,j) = init_model%origin_x                 &
+                                    + cos_rot_angle * ( i + shift_x ) * dx            &
+                                    + sin_rot_angle * ( section(j,2) + shift_y ) * dy
                          ENDDO
                       ENDIF
@@ -3911,7 +3917,7 @@
                       ELSE
                          DO  i = 0, nx
-                            netcdf_data_2d(i,j) = init_model%origin_y          &
-                                    - sin_ra * ( i + shift_x ) * dx            &
-                                    + cos_ra * ( section(j,2) + shift_y ) * dy
+                            netcdf_data_2d(i,j) = init_model%origin_y                 &
+                                    - sin_rot_angle * ( i + shift_x ) * dx            &
+                                    + cos_rot_angle * ( section(j,2) + shift_y ) * dy
                          ENDDO
                       ENDIF
@@ -3930,6 +3936,6 @@
              ALLOCATE( lat(0:nx,1:ns) )
              ALLOCATE( lon(0:nx,1:ns) )
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-             sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+             sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
              DO  k = 0, 2
@@ -3954,10 +3960,10 @@
                    ELSE
                       DO  i = 0, nx
-                         eutm = init_model%origin_x            &
-                              + cos_ra * ( i + shift_x ) * dx  &
-                              + sin_ra * ( section(j,2) + shift_y ) * dy
-                         nutm = init_model%origin_y            &
-                              - sin_ra * ( i + shift_x ) * dx  &
-                              + cos_ra * ( section(j,2) + shift_y ) * dy
+                         eutm = init_model%origin_x                   &
+                              + cos_rot_angle * ( i + shift_x ) * dx  &
+                              + sin_rot_angle * ( section(j,2) + shift_y ) * dy
+                         nutm = init_model%origin_y                   &
+                              - sin_rot_angle * ( i + shift_x ) * dx  &
+                              + cos_rot_angle * ( section(j,2) + shift_y ) * dy
 
                          CALL  convert_utm_to_geographic( crs_list,          &
@@ -4648,8 +4654,8 @@
 !
 !--          Write UTM coordinates
-             IF ( init_model%rotation_angle == 0.0_wp )  THEN
+             IF ( rotation_angle == 0.0_wp )  THEN
 !
 !--             1D in case of no rotation
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
 !
 !--             x coordinates
@@ -4675,5 +4681,5 @@
                       ELSE
                          netcdf_data(i) = init_model%origin_x &
-                                     + cos_ra * ( section(i,3) + shift_x ) * dx
+                                     + cos_rot_angle * ( section(i,3) + shift_x ) * dx
                       ENDIF
                    ENDDO
@@ -4705,6 +4711,6 @@
 
                    DO  i = 0, ny
-                     netcdf_data(i) = init_model%origin_y            &
-                                    + cos_ra * ( i + shift_y ) * dy
+                     netcdf_data(i) = init_model%origin_y                      &
+                                    + cos_rot_angle * ( i + shift_y ) * dy
                    ENDDO
 
@@ -4721,6 +4727,6 @@
 !--             2D in case of rotation
                 ALLOCATE( netcdf_data_2d(1:ns,0:ny) )
-                cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-                sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+                cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+                sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
                 DO  k = 0, 2
@@ -4744,7 +4750,7 @@
                             netcdf_data_2d(i,:) = -1.0_wp !section averaged along x
                          ELSE
-                            netcdf_data_2d(i,j) = init_model%origin_x          &
-                                    + cos_ra * ( section(i,3) + shift_x ) * dx &
-                                    + sin_ra * ( j + shift_y ) * dy
+                            netcdf_data_2d(i,j) = init_model%origin_x                 &
+                                    + cos_rot_angle * ( section(i,3) + shift_x ) * dx &
+                                    + sin_rot_angle * ( j + shift_y ) * dy
                          ENDIF
                       ENDDO
@@ -4761,7 +4767,7 @@
                             netcdf_data_2d(i,:) = -1.0_wp !section averaged along x
                          ELSE
-                            netcdf_data_2d(i,j) = init_model%origin_y          &
-                                    - sin_ra * ( section(i,3) + shift_x ) * dx &
-                                    + cos_ra * ( j + shift_y ) * dy
+                            netcdf_data_2d(i,j) = init_model%origin_y                 &
+                                    - sin_rot_angle * ( section(i,3) + shift_x ) * dx &
+                                    + cos_rot_angle * ( j + shift_y ) * dy
                          ENDIF
                       ENDDO
@@ -4780,6 +4786,6 @@
              ALLOCATE( lat(1:ns,0:ny) )
              ALLOCATE( lon(1:ns,0:ny) )
-             cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp )
-             sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp )
+             cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+             sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
 
              DO  k = 0, 2
@@ -4804,10 +4810,10 @@
                          lon(i,:) = -180.0_wp  ! section averaged along x
                       ELSE
-                         eutm = init_model%origin_x            &
-                              + cos_ra * ( section(i,3) + shift_x ) * dx  &
-                              + sin_ra * ( j + shift_y ) * dy
-                         nutm = init_model%origin_y            &
-                              - sin_ra * ( section(i,3) + shift_x ) * dx  &
-                              + cos_ra * ( j + shift_y ) * dy
+                         eutm = init_model%origin_x                              &
+                              + cos_rot_angle * ( section(i,3) + shift_x ) * dx  &
+                              + sin_rot_angle * ( j + shift_y ) * dy
+                         nutm = init_model%origin_y                              &
+                              - sin_rot_angle * ( section(i,3) + shift_x ) * dx  &
+                              + cos_rot_angle * ( j + shift_y ) * dy
 
                          CALL  convert_utm_to_geographic( crs_list,          &
@@ -6906,5 +6912,5 @@
     nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', init_model%origin_z )
     CALL netcdf_handle_error( 'netcdf_create_global_atts 11', error_no )
-    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', init_model%rotation_angle )
+    nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', rotation_angle )
     CALL netcdf_handle_error( 'netcdf_create_global_atts 12', error_no )
 
@@ -7047,5 +7053,5 @@
 !
 !-- Define UTM coordinates
-    IF ( init_model%rotation_angle == 0.0_wp )  THEN
+    IF ( rotation_angle == 0.0_wp )  THEN
        CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 )
        CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 )
Index: palm/trunk/SOURCE/ocean_mod.f90
===================================================================
--- palm/trunk/SOURCE/ocean_mod.f90	(revision 4195)
+++ palm/trunk/SOURCE/ocean_mod.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Consider rotation of model domain for calculating the Stokes drift
+! 
+! 4182 2019-08-22 15:20:23Z scharf
 ! Corrected "Former revisions" section
 ! 
@@ -2126,6 +2129,9 @@
                v_stokes_zw, w, tend
 
+    USE basic_constants_and_equations_mod,                                     &
+        ONLY:  pi
+
     USE control_parameters,                                                    &
-        ONLY:  f, fs, message_string
+        ONLY:  f, fs, message_string, rotation_angle
 
     USE grid_variables,                                                        &
@@ -2137,9 +2143,11 @@
     IMPLICIT NONE
 
-    INTEGER(iwp) ::  component  !< component of momentum equation
-    INTEGER(iwp) ::  i          !< loop index along x
-    INTEGER(iwp) ::  j          !< loop index along y
-    INTEGER(iwp) ::  k          !< loop index along z
-
+    INTEGER(iwp) ::  component      !< component of momentum equation
+    INTEGER(iwp) ::  i              !< loop index along x
+    INTEGER(iwp) ::  j              !< loop index along y
+    INTEGER(iwp) ::  k              !< loop index along z
+
+    REAL(wp)     ::  cos_rot_angle  !< cosine of model rotation angle
+    REAL(wp)     ::  sin_rot_angle  !< sine of model rotation angle
 
 !
@@ -2182,4 +2190,10 @@
 !--    w-component
        CASE ( 3 )
+
+!
+!--       Precalculate cosine and sine of rotation angle
+          cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+          sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
+
           DO  i = nxl, nxr
              DO  j = nys, nyn
@@ -2197,5 +2211,8 @@
                                                    + v(k+1,j+1,i) - v(k,j+1,i) &
                                                    ) * ddzu(k)  )              &
-                                           + fs * u_stokes_zw(k)
+                                           + fs * (                            &
+                                               sin_rot_angle * v_stokes_zw(k)  &
+                                             + cos_rot_angle * u_stokes_zw(k)  &
+                                                  )
                 ENDDO
              ENDDO
@@ -2226,6 +2243,9 @@
                v_stokes_zw, w, tend
 
+    USE basic_constants_and_equations_mod,                                     &
+        ONLY:  pi
+
     USE control_parameters,                                                    &
-        ONLY:  f, fs, message_string
+        ONLY:  f, fs, message_string, rotation_angle
 
     USE grid_variables,                                                        &
@@ -2237,9 +2257,11 @@
     IMPLICIT NONE
 
-    INTEGER(iwp) ::  component  !< component of momentum equation
-    INTEGER(iwp) ::  i          !< loop index along x
-    INTEGER(iwp) ::  j          !< loop index along y
-    INTEGER(iwp) ::  k          !< loop incex along z
-
+    INTEGER(iwp) ::  component      !< component of momentum equation
+    INTEGER(iwp) ::  i              !< loop index along x
+    INTEGER(iwp) ::  j              !< loop index along y
+    INTEGER(iwp) ::  k              !< loop incex along z
+
+    REAL(wp)     ::  cos_rot_angle  !< cosine of model rotation angle
+    REAL(wp)     ::  sin_rot_angle  !< sine of model rotation angle
 
 !
@@ -2273,4 +2295,10 @@
 !--    w-component
        CASE ( 3 )
+
+!
+!--       Precalculate cosine and sine of rotation angle
+          cos_rot_angle = COS( rotation_angle * pi / 180.0_wp )
+          sin_rot_angle = SIN( rotation_angle * pi / 180.0_wp )
+
           DO  k = nzb+1, nzt
              tend(k,j,i) = tend(k,j,i) + u_stokes_zw(k) * (              &
@@ -2286,5 +2314,7 @@
                                                    + v(k+1,j+1,i) - v(k,j+1,i) &
                                                    ) * ddzu(k)  )              &
-                                       + fs * u_stokes_zw(k)
+                                       + fs * ( sin_rot_angle * v_stokes_zw(k) &
+                                              + cos_rot_angle * u_stokes_zw(k) &
+                                              )
           ENDDO
 
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 4195)
+++ palm/trunk/SOURCE/parin.f90	(revision 4196)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! added rotation_angle to initialization_parameters
+! 
+! 4191 2019-08-27 15:45:07Z gronemeier
 ! bugfix: add recycling_method_for_thermodynamic_quantities to inipar namelist
 ! 
@@ -191,4 +194,5 @@
              recycling_width, recycling_yshift,                                &
              reference_state, residual_limit,                                  &
+             rotation_angle,                                                   &
              roughness_length,                                                 &
              scalar_advec,   &
@@ -264,4 +268,5 @@
              recycling_width, recycling_yshift,                                &
              reference_state, residual_limit,                                  &
+             rotation_angle,                                                   &
              roughness_length, scalar_advec,                                   &
              scalar_rayleigh_damping,                                          &
