Changeset 3259 for palm


Ignore:
Timestamp:
Sep 18, 2018 9:53:18 AM (6 years ago)
Author:
sward
Message:

Updated agent preprocessing to avoid gfortran warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/agent_preprocessing/agent_preprocessing.f90

    r3216 r3259  
    2525! -----------------!
    2626! $Id$
     27! Removed unused variables and fixed real to real comparisons
     28!
     29! 3216 2018-08-29 10:22:12Z sward
    2730! Bubfix for gfortran: reordering of type definitions
    2831!
     
    248251
    249252       INTEGER(iwp) ::  i            !< running index along x-direction
    250        INTEGER(iwp) ::  ii           !< running index for IO blocks
    251253       INTEGER(iwp) ::  k_head       !< minimum k index for agents to walk underneath overhanging buildings
    252254       INTEGER(iwp) ::  id_topo      !< NetCDF id of topograhy input file
    253255       INTEGER(iwp) ::  j            !< running index along y-direction
    254        INTEGER(iwp) ::  k            !< running index along z-direction
    255256       INTEGER(iwp) ::  num_vars     !< number of variables in netcdf input file
    256        INTEGER(iwp) ::  skip_n_rows  !< counting variable to skip rows while reading topography file
    257257
    258258       LOGICAL ::  netcdf_flag = .FALSE.     !< indicates whether netcdf file is used for input
    259259       LOGICAL ::  lod_flag = .FALSE.        !< true if 3d building data is used
    260260       LOGICAL ::  topo_file_flag = .FALSE.  !< true if 3d building data is used
    261 
    262        REAL(wp) ::  dum  !< dummy variable to skip columns while reading topography file   
    263261
    264262       WRITE(*,'((X,A,/))') 'Looking for topography/building information'
     
    514512       CHARACTER (LEN=*), INTENT(IN) ::  filename  !< filename
    515513       INTEGER(iwp), INTENT(INOUT)   ::  id        !< file id
    516        LOGICAL                       ::  file_open = .FALSE.
    517514
    518515       nc_stat = NF90_OPEN( filename, NF90_NOWRITE, id )
     
    803800       INTEGER(iwp), INTENT(IN)      ::  n3              !< number of data-points along 3rd dimension
    804801       INTEGER(iwp), INTENT(IN)      ::  n4              !< number of data-points along 4th dimension
    805 
    806        INTEGER(iwp), DIMENSION(3)    ::  id_dim
    807802
    808803       REAL(wp), DIMENSION(:,:), INTENT(INOUT) ::  var     !< variable to be read
     
    12421237       IMPLICIT NONE
    12431238
    1244        CHARACTER(LEN=20)  ::  FMT
    12451239       CHARACTER(LEN=200) ::  dirname
    12461240       CHARACTER(LEN=200) ::  rundir
     
    13551349!--    If tolerance_dp was not set, put in default values
    13561350       DO i = 0, 2
    1357           IF ( tolerance_dp(i) == 999999.0_wp ) THEN
     1351          IF ( tolerance_dp(i) > 999998.0_wp ) THEN
    13581352             tolerance_dp(i) = SQRT(dx*dy)*1.41/(2**i)
    13591353          ELSE
     
    13681362!
    13691363!--    Set null_vertex
    1370        CALL set_vertex(null_vertex,0_iwp,0.0_wp,0.0_wp)
     1364       CALL set_vertex(null_vertex,0.0_wp,0.0_wp)
    13711365!
    13721366!--    Some initializations
     
    15711565       IMPLICIT NONE
    15721566
    1573        INTEGER(iwp) ::  il    !< local counter
    15741567       INTEGER(iwp) ::  p_id  !< current polygon_id
    15751568!
     
    15881581                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    15891582                   nov = polygons(p_id)%nov
    1590                    CALL set_vertex(dummy_vertex, p_id, i*dx, j*dy)
     1583                   CALL set_vertex(dummy_vertex, i*dx, j*dy)
    15911584                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    15921585                ENDIF
     
    15991592                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16001593                   nov = polygons(p_id)%nov
    1601                    CALL set_vertex(dummy_vertex, p_id, i*dx, (j+1)*dy)
     1594                   CALL set_vertex(dummy_vertex, i*dx, (j+1)*dy)
    16021595                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16031596                ENDIF
     
    16101603                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16111604                   nov = polygons(p_id)%nov
    1612                    CALL set_vertex(dummy_vertex, p_id, (i+1)*dx, (j+1)*dy)
     1605                   CALL set_vertex(dummy_vertex, (i+1)*dx, (j+1)*dy)
    16131606                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16141607                ENDIF
     
    16211614                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16221615                   nov = polygons(p_id)%nov
    1623                    CALL set_vertex(dummy_vertex, p_id, (i+1)*dx, j*dy)
     1616                   CALL set_vertex(dummy_vertex, (i+1)*dx, j*dy)
    16241617                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16251618                ENDIF
     
    16361629                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16371630                   nov = polygons(p_id)%nov
    1638                    CALL set_vertex(dummy_vertex, p_id, i*dx, j*dy)
     1631                   CALL set_vertex(dummy_vertex, i*dx, j*dy)
    16391632                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16401633                ENDIF
     
    16481641                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16491642                   nov = polygons(p_id)%nov
    1650                    CALL set_vertex(dummy_vertex, p_id, i*dx, (j+1)*dy)
     1643                   CALL set_vertex(dummy_vertex, i*dx, (j+1)*dy)
    16511644                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16521645                ENDIF
     
    16601653                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16611654                   nov = polygons(p_id)%nov
    1662                    CALL set_vertex(dummy_vertex, p_id, (i+1)*dx, (j+1)*dy)
     1655                   CALL set_vertex(dummy_vertex, (i+1)*dx, (j+1)*dy)
    16631656                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16641657                ENDIF
     
    16721665                   polygons(p_id)%nov = polygons(p_id)%nov + 1
    16731666                   nov = polygons(p_id)%nov
    1674                    CALL set_vertex(dummy_vertex, p_id, (i+1)*dx, j*dy)
     1667                   CALL set_vertex(dummy_vertex, (i+1)*dx, j*dy)
    16751668                   CALL add_vertex_to_polygon(dummy_vertex, p_id, nov)
    16761669                ENDIF
     
    16861679!> Initializes a vertex
    16871680!------------------------------------------------------------------------------!
    1688     SUBROUTINE set_vertex (in_vertex, p_id, x, y)
    1689 
    1690        IMPLICIT NONE
    1691 
    1692        INTEGER(iwp) ::  p_id  !< polygon ID
     1681    SUBROUTINE set_vertex (in_vertex, x, y)
     1682
     1683       IMPLICIT NONE
    16931684
    16941685       REAL(wp) ::  x  !< x-coordinate of vertex position
     
    17981789       ENDIF
    17991790       DO il = 1, nov
    1800           IF ( sorted_p(il)%x == m_x ) THEN
     1791          IF ( ABS( sorted_p(il)%x - m_x ) < .01 * dx ) THEN
    18011792             counter = counter + 1
    18021793             dummy_vertex = sorted_p(il)
     
    18111802       ENDIF
    18121803       DO il = 1, counter
    1813           IF ( sorted_p(il)%y == m_y ) THEN
     1804          IF ( ABS(sorted_p(il)%y - m_y) < .01 * dy ) THEN
    18141805             dummy_vertex = sorted_p(il)
    18151806             sorted_p(il) = sorted_p(1)
     
    18601851             IF ( nosv < nov ) THEN
    18611852                DO il = nosv+1, nov
    1862                    IF ( current_v%x == sorted_p(il)%x .OR.                  &
    1863                         current_v%y == sorted_p(il)%y)                      &
     1853                   IF ( ABS( current_v%x - sorted_p(il)%x ) < .01 * dx .OR.    &
     1854                        ABS( current_v%y - sorted_p(il)%y ) < .01 * dy )       &
    18641855                   THEN
    18651856!
     
    18881879!--          all tests fail, is the candidate one of a maximum of two possible
    18891880!--          neighbors.
     1881             id_neighbor  = -999
    18901882             id_neighbor1 = -999
    18911883             id_neighbor2 = -999
     
    19071899                                     (candidates(il)%y - current_v%y)**2 )
    19081900                IF ( nosv > 1 ) THEN
    1909                    IF ( dist < .9*dx .OR.                                      &
    1910                         (sorted_p(nosv-1)%x == candidates(il)%x .AND.          &
    1911                          sorted_p(nosv-1)%y == candidates(il)%y) )             &
     1901                   IF ( dist < .9 * dx .OR.                                    &
     1902                        ( ( ABS( sorted_p(nosv-1)%x                            &
     1903                        - candidates(il)%x ) < .01 * dx ) .AND.                &
     1904                          ( ABS( sorted_p(nosv-1)%y                            &
     1905                        - candidates(il)%y ) < .01 * dy ) ) )                  &
    19121906                   THEN
    19131907                      CYCLE
     
    19191913!--             (4 cases)
    19201914!--             First: for vertical connection
    1921                 IF ( candidates(il)%x == current_v%x ) THEN
     1915                IF ( ABS( candidates(il)%x - current_v%x ) < .01 * dx ) THEN
    19221916                   xs = NINT(current_v%x*ddx)-1
    19231917                   xe = xs + 1
     
    19471941!
    19481942!--             Horizontal connection
    1949                 ELSEIF ( candidates(il)%y == current_v%y ) THEN
     1943                ELSEIF ( ABS( candidates(il)%y - current_v%y ) < .01 * dy ) THEN
    19501944
    19511945                   ys = NINT(current_v%y*ddy)-1
     
    19821976                   id_neighbor1 = candidate_id(il)
    19831977                ELSEIF ( id_neighbor1 /=  -999 .AND.                           &
    1984                        ( sorted_p(id_neighbor1)%x /= candidates(il)%x ) .OR.   &
    1985                        ( sorted_p(id_neighbor1)%y /= candidates(il)%y ) )      &
     1978                       ( ( ABS( sorted_p(id_neighbor1)%x - candidates(il)%x )  &
     1979                                > .01 * dx ) .OR.                              &
     1980                         ( ABS( sorted_p(id_neighbor1)%y - candidates(il)%y )  &
     1981                                > .01 * dy ) ) )                               &
    19861982                THEN
    19871983                   id_neighbor2 = candidate_id(il)
     
    23212317       INTEGER(iwp) ::  vid_t  !< vertex id of tested mesh point
    23222318       INTEGER(iwp) ::  vl     !< vertex counter
    2323        
    2324        REAL(wp) ::  left          !< counter: current mesh point
     2319
    23252320       REAL(wp) ::  v1x           !< x-coordinate of test vertex 1 for intersection test
    23262321       REAL(wp) ::  v1y           !< y-coordinate of test vertex 1 for intersection test
     
    26782673       IMPLICIT NONE
    26792674
    2680        INTEGER(iwp) ::  il  !< Local counter
    26812675       INTEGER(iwp) ::  noc !< Number of connections
    26822676
Note: See TracChangeset for help on using the changeset viewer.