Changeset 3528 for palm/trunk/SOURCE


Ignore:
Timestamp:
Nov 15, 2018 7:07:11 PM (5 years ago)
Author:
suehring
Message:

Bugfix in raytracing - add an epsilon value to overcome precision-related errors.

File:
1 edited

Legend:

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

    r3524 r3528  
    2828! -----------------
    2929! $Id$
     30! Add an epsilon value to compare values in if statement to fix possible
     31! precsion related errors in raytrace routines.
     32!
     33! 3524 2018-11-14 13:36:44Z raasch
    3034! missing cpp-directives added
    3135!
     
    70847088        INTEGER(iwp)                           :: ip           !< number of processor where gridbox reside
    70857089        INTEGER(iwp)                           :: ig           !< 1D index of gridbox in global 2D array
    7086         REAL(wp)                               :: lad_s_target !< recieved lad_s of particular grid box
     7090       
     7091        REAL(wp)                               :: eps = 1E-10_wp !< epsilon for value comparison
     7092        REAL(wp)                               :: lad_s_target   !< recieved lad_s of particular grid box
    70877093
    70887094!
     
    71677173            ENDIF
    71687174
    7169             IF ( nextdist >= distance ) EXIT
     7175            IF ( ABS(distance - nextdist) < eps ) EXIT
    71707176            lastdist = nextdist
    71717177            dimnext(seldim) = dimnext(seldim) + dimdelta(seldim)
     
    72867292      INTEGER(iwp)                           ::  nly          !< maximum  plant canopy height
    72877293      INTEGER(iwp)                           ::  ntrack
    7288       REAL(wp)                               ::  zbottom, ztop !< urban surface boundary in real numbers
    7289       REAL(wp)                               ::  zorig        !< z coordinate of ray column entry
    7290       REAL(wp)                               ::  zexit        !< z coordinate of ray column exit
    7291       REAL(wp)                               ::  qdist        !< ratio of real distance to z coord difference
    7292       REAL(wp)                               ::  dxxyy        !< square of real horizontal distance
    7293       REAL(wp)                               ::  curtrans     !< transparency of current PC box crossing
     7294     
    72947295      INTEGER(iwp)                           ::  zb0
    72957296      INTEGER(iwp)                           ::  zb1
     
    73047305      INTEGER(MPI_ADDRESS_KIND)              ::  wdisp        !< RMA window displacement
    73057306#endif
     7307     
     7308      REAL(wp)                               ::  eps = 1E-10_wp !< epsilon for value comparison
     7309      REAL(wp)                               ::  zbottom, ztop !< urban surface boundary in real numbers
     7310      REAL(wp)                               ::  zorig         !< z coordinate of ray column entry
     7311      REAL(wp)                               ::  zexit         !< z coordinate of ray column exit
     7312      REAL(wp)                               ::  qdist         !< ratio of real distance to z coord difference
     7313      REAL(wp)                               ::  dxxyy         !< square of real horizontal distance
     7314      REAL(wp)                               ::  curtrans      !< transparency of current PC box crossing
     7315     
     7316
    73067317     
    73077318      yxorigin(:) = origin(2:3)
     
    74227433         ENDIF
    74237434
    7424          IF ( nextdist >= distance )  EXIT
     7435         IF ( ABS(distance - nextdist) < eps )  EXIT
    74257436
    74267437         IF ( rad_angular_discretization  .AND.  calc_svf )  THEN
Note: See TracChangeset for help on using the changeset viewer.