Ignore:
Timestamp:
Oct 30, 2019 4:01:14 PM (4 years ago)
Author:
resler
Message:

Merge branch resler into trunk

Location:
palm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk

  • palm/trunk/SOURCE

  • palm/trunk/SOURCE/radiation_model_mod.f90

    r4271 r4286  
    2828! -----------------
    2929! $Id$
     30! - Fix wrong treating of time_rad during interpolation in radiation_model_mod
     31! - Fix wrong checks of time_rad from dynamic driver in radiation_model_mod
     32! - Add new directional model of human body for MRT: ellipsoid
     33!
     34! 4271 2019-10-23 10:46:41Z maronga
    3035! Bugfix: missing parentheses in calculation of snow albedo
    3136!
     
    670675    LOGICAL                                        ::  mrt_skip_roof = .TRUE.             !< do not calculate MRT above roof surfaces
    671676    LOGICAL                                        ::  mrt_include_sw = .TRUE.            !< should MRT calculation include SW radiation as well?
    672     LOGICAL                                        ::  mrt_geom_human = .TRUE.            !< MRT direction weights simulate human body instead of a sphere
     677    INTEGER(wp)                                    ::  mrt_geom = 1                       !< method for MRT direction weights simulating a sphere or a human body
     678    REAL(wp), DIMENSION(2)                         ::  mrt_geom_params = (/ .12_wp, .88_wp /)   !< parameters for the selected method
    673679    INTEGER(iwp)                                   ::  nrefsteps = 3                      !< number of reflection steps to perform
    674680    REAL(wp), PARAMETER                            ::  ext_coef = 0.6_wp                  !< extinction coefficient (a.k.a. alpha)
     
    967973!-- Public variables and constants / NEEDS SORTING
    968974    PUBLIC albedo, albedo_type, decl_1, decl_2, decl_3, dots_rad, dt_radiation,&
    969            emissivity, force_radiation_call, lat, lon, mrt_geom_human,         &
     975           emissivity, force_radiation_call, lat, lon, mrt_geom,               &
     976           mrt_geom_params,                                                    &
    970977           mrt_include_sw, mrt_nlevels, mrtbl, mrtinsw, mrtinlw, nmrtbl,       &
    971978           rad_net_av, radiation, radiation_scheme, rad_lw_in,                 &
     
    29492956          CALL get_date_time( 0.0_wp, second_of_day=second_of_day )
    29502957
    2951           IF ( ABS( time_rad_f%var1d(0) - second_of_day ) > 1E-6_wp )  THEN
    2952              message_string = 'External radiation forcing: first point in ' // &
    2953                               'time is /= origin_date_time.'
    2954              CALL message( 'radiation_init', 'PA0313', 1, 2, 0, 6, 0 )
    2955           ENDIF
    2956          
    2957           IF ( end_time - spinup_time > time_rad_f%var1d(ntime-1)              &
    2958                                       - second_of_day )  THEN
     2958          IF ( end_time - spinup_time > time_rad_f%var1d(ntime-1) )  THEN
    29592959             message_string = 'External radiation forcing does not cover ' //  &
    29602960                              'the entire simulation time.'
     
    31473147          CALL get_date_time( 0.0_wp, second_of_day=second_of_day_init )
    31483148          t = 0
    3149           DO WHILE ( time_rad_f%var1d(t) <=                                    &
    3150                      time_since_reference_point + second_of_day_init )
     3149          DO WHILE ( time_rad_f%var1d(t) <= time_since_reference_point )
    31513150             t = t + 1
    31523151          ENDDO
     
    31543153          tm = MAX( t-1, 0 )
    31553154         
    3156           fac_dt = ( time_since_reference_point + second_of_day_init           &
     3155          fac_dt = ( time_since_reference_point                                &
    31573156                   - time_rad_f%var1d(tm) + dt_3d )                            &
    31583157                 / ( time_rad_f%var1d(t)  - time_rad_f%var1d(tm) )
     
    38443843                                  constant_albedo, dt_radiation, emissivity,    &
    38453844                                  lw_radiation, max_raytracing_dist,            &
    3846                                   min_irrf_value, mrt_geom_human,               &
     3845                                  min_irrf_value, mrt_geom, mrt_geom_params,    &
    38473846                                  mrt_include_sw, mrt_nlevels,                  &
    38483847                                  mrt_skip_roof, net_radiation, nrefsteps,      &
     
    38603859                                  constant_albedo, dt_radiation, emissivity,    &
    38613860                                  lw_radiation, max_raytracing_dist,            &
    3862                                   min_irrf_value, mrt_geom_human,               &
     3861                                  min_irrf_value, mrt_geom, mrt_geom_params,    &
    38633862                                  mrt_include_sw, mrt_nlevels,                  &
    38643863                                  mrt_skip_roof, net_radiation, nrefsteps,      &
     
    77207719           zbdry(:) = (/( zn0+REAL(izn,wp)*zns, izn=0, nzn )/)
    77217720           vffrac0(:) = (COS(zbdry(0:nzn-1)) - COS(zbdry(1:nzn))) / 2._wp / REAL(naz, wp)
    7722            !
    7723            !--Modify direction weights to simulate human body (lower weight for top-down)
    7724            IF ( mrt_geom_human )  THEN
    7725               vffrac0(:) = vffrac0(:) * MAX(0._wp, SIN(zcent(:))*0.88_wp + COS(zcent(:))*0.12_wp)
     7721!
     7722!--        Modify direction weights to simulate human body (lower weight for
     7723!--        irradiance from zenith, higher from sides) depending on selection.
     7724!--        For mrt_geom=0, no weighting is done (simulates spherical globe
     7725!--        thermometer).
     7726           SELECT CASE ( mrt_geom )
     7727
     7728           CASE ( 1 )
     7729              vffrac0(:) = vffrac0(:) * MAX(0._wp, SIN(zcent(:))*mrt_geom_params(2) &
     7730                                                   + COS(zcent(:))*mrt_geom_params(1))
    77267731              vffrac0(:) = vffrac0(:) / (SUM(vffrac0) * REAL(naz, wp))
    7727            ENDIF
     7732
     7733           CASE ( 2 )
     7734              vffrac0(:) = vffrac0(:)                                          &
     7735                           * SQRT( ( mrt_geom_params(1) * COS(zcent(:)) ) ** 2 &
     7736                                 + ( mrt_geom_params(2) * SIN(zcent(:)) ) ** 2 )
     7737              vffrac0(:) = vffrac0(:) / (SUM(vffrac0) * REAL(naz, wp))
     7738
     7739           END SELECT
    77287740
    77297741           DO  imrt = 1, nmrtbl
Note: See TracChangeset for help on using the changeset viewer.