Changeset 4575 for palm


Ignore:
Timestamp:
Jun 24, 2020 4:58:40 PM (4 months ago)
Author:
pavelkrc
Message:

Allow the use of rotation_angle in RTM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/radiation_model_mod.f90

    r4574 r4575  
    2828! -----------------
    2929! $Id$
     30! Allow the use of rotation_angle in RTM
     31!
     32! 4574 2020-06-24 16:33:32Z pavelkrc
    3033! - Restructure code in radiation_check_data_output
    3134! - Move calculation of MPI global array offsets to a subroutine
     
    14851488
    14861489       USE control_parameters,                                                 &
    1487            ONLY: land_surface, message_string, rotation_angle, urban_surface
     1490           ONLY: land_surface, message_string, urban_surface
    14881491
    14891492       USE netcdf_data_input_mod,                                              &
     
    15851588          message_string = 'dt_radiation must be > 0.0'
    15861589          CALL message( 'check_parameters', 'PA0591', 1, 2, 0, 6, 0 )
    1587        ENDIF
    1588 !
    1589 !--    Check rotation angle
    1590        !> @todo Remove this limitation
    1591        IF ( rotation_angle /= 0.0 )  THEN
    1592           message_string = 'rotation of the model domain is not considered in the radiation ' //   &
    1593                            'model.&Using rotation_angle /= 0.0 is not allowed in combination ' //  &
    1594                            'with the radiation model at the moment!'
    1595           CALL message( 'check_parameters', 'PA0675', 1, 2, 0, 6, 0 )
    15961590       ENDIF
    15971591
     
    58475841
    58485842     REAL(wp)                          ::  sun_direct_factor  !< factor for direct normal radiation from direct horizontal
     5843     REAL(wp)                          ::  sin_rot            !< sine of rotation_angle
     5844     REAL(wp)                          ::  cos_rot            !< cosine of rotation_angle
     5845     REAL(wp)                          ::  solar_azim         !< solar azimuth in rotated model coordinates
    58495846#if defined( __parallel )
    58505847     REAL(wp), DIMENSION(1:7)          ::  combine_allreduce   !< dummy array used to combine several MPI_ALLREDUCE calls
     
    58665863
    58675864!
    5868 !--     prepare rotated normal vectors and irradiance factor
     5865!--  prepare rotated normal vectors and irradiance factor
     5866     sin_rot = SIN( rotation_angle * pi / 180.0_wp )
     5867     cos_rot = COS( rotation_angle * pi / 180.0_wp )
    58695868     vnorm(1,:) = kdir(:)
    58705869     vnorm(2,:) = jdir(:)
    58715870     vnorm(3,:) = idir(:)
    5872      mrot(1, :) = (/ 1._wp,  0._wp,      0._wp      /)
    5873      mrot(2, :) = (/ 0._wp,  COS(rotation_angle), SIN(rotation_angle) /)
    5874      mrot(3, :) = (/ 0._wp, -SIN(rotation_angle), COS(rotation_angle) /)
     5871     mrot(1, :) = (/ 1._wp,  0._wp,   0._wp   /)
     5872     mrot(2, :) = (/ 0._wp,  cos_rot, sin_rot /)
     5873     mrot(3, :) = (/ 0._wp, -sin_rot, cos_rot /)
    58755874     sunorig = (/ cos_zenith, sun_dir_lat, sun_dir_lon /)
    58765875     sunorig = MATMUL(mrot, sunorig)
     
    60886087!
    60896088!--     Identify solar direction vector (discretized number) (1)
     6089        solar_azim = ATAN2(sun_dir_lon, sun_dir_lat) * (180.0_wp/pi) - rotation_angle
    60906090        j = FLOOR(ACOS(cos_zenith) / pi * raytrace_discrete_elevs)
    6091         i = MODULO(NINT(ATAN2(sun_dir_lon, sun_dir_lat)               &
    6092                         / (2.0_wp*pi) * raytrace_discrete_azims-0.5_wp, iwp), &
     6091        i = MODULO(NINT(solar_azim / 360.0_wp *                 &
     6092                        raytrace_discrete_azims - 0.5_wp, iwp), &
    60936093                   raytrace_discrete_azims)
    60946094        isd = dsidir_rev(j, i)
     
    91699169   SUBROUTINE radiation_presimulate_solar_pos
    91709170
     9171      USE control_parameters,                                              &
     9172         ONLY:  rotation_angle
     9173
    91719174      IMPLICIT NONE
    91729175
     
    92209223
    92219224         REAL(wp), INTENT(IN) ::  time_since_reference_local  !< local time since reference
     9225         REAL(wp)             ::  solar_azim                  !< solar azimuth in rotated model coordinates
    92229226!
    92239227!--      Update apparent solar position based on modified t_s_r_p
     
    92299233!--
    92309234!--         Identify solar direction vector (discretized number) 1)
    9231             i = MODULO(NINT(ATAN2(sun_dir_lon, sun_dir_lat)               &
    9232                             / (2._wp*pi) * raytrace_discrete_azims-.5_wp, iwp), &
     9235            solar_azim = ATAN2(sun_dir_lon, sun_dir_lat) * (180.0_wp/pi) - rotation_angle
     9236            i = MODULO(NINT(solar_azim / 360.0_wp *                &
     9237                            raytrace_discrete_azims - .5_wp, iwp), &
    92339238                       raytrace_discrete_azims)
    92349239            j = FLOOR(ACOS(cos_zenith) / pi * raytrace_discrete_elevs)
Note: See TracChangeset for help on using the changeset viewer.