Changeset 3961


Ignore:
Timestamp:
May 8, 2019 4:12:31 PM (5 years ago)
Author:
suehring
Message:

Revise check

File:
1 edited

Legend:

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

    r3943 r3961  
    2525! -----------------
    2626! $Id$
     27! Revise checks for building IDs and types
     28!
     29! 3943 2019-05-02 09:50:41Z maronga
    2730! Temporarily disabled some (faulty) checks for static driver.
    2831!
     
    38443847
    38453848       USE indices,                                                            &
    3846            ONLY:  nxl, nxr, nyn, nys
     3849           ONLY:  nxl, nxr, nyn, nys, wall_flags_0
    38473850
    38483851       IMPLICIT NONE
     
    42584261             ENDIF
    42594262!
    4260 !--          Check if building_type is set at each building and vice versa.
    4261 !              IF ( building_type_f%from_file  .AND.  buildings_f%from_file )  THEN
    4262 !                 IF ( buildings_f%lod == 1 )  THEN
    4263 !                    IF ( buildings_f%var_2d(j,i)  /= buildings_f%fill1  .AND.   &
    4264 !                         building_type_f%var(j,i) == building_type_f%fill  .OR. &
    4265 !                         buildings_f%var_2d(j,i)  == buildings_f%fill1  .AND.   &
    4266 !                         building_type_f%var(j,i) /= building_type_f%fill )  THEN
    4267 !                       WRITE( message_string, * ) 'Each location where a ' //   &
    4268 !                                       '2D building is set requires a type ' // &
    4269 !                                       '( and vice versa ) in case the ' //     &
    4270 !                                       'urban-surface model is applied. ' //    &
    4271 !                                       'i, j = ', i, j
    4272 !                       CALL message( 'netcdf_data_input_mod', 'PA0573',         &
    4273 !                                      2, 2, myid, 6, 0 )
    4274 !                    ENDIF
    4275 !                 ENDIF
    4276 !                 IF ( buildings_f%lod == 2 )  THEN
    4277 !                    IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
    4278 !                         building_type_f%var(j,i) == building_type_f%fill  .OR. &
    4279 !                   .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
    4280 !                         building_type_f%var(j,i) /= building_type_f%fill )  THEN
    4281 !                       WRITE( message_string, * ) 'Each location where a ' //   &
    4282 !                                       '3D building is set requires a type ' // &
    4283 !                                       '( and vice versa ) in case the ' //     &
    4284 !                                       'urban-surface model is applied. ' //    &
    4285 !                                       'i, j = ', i, j
    4286 !                       CALL message( 'netcdf_data_input_mod', 'PA0573',         &
    4287 !                                      2, 2, myid, 6, 0 )
    4288 !                    ENDIF
    4289 !                 ENDIF
    4290 !              ENDIF
     4263!--          Check if building_type is set at each building and vice versa.
     4264!--          Please note, buildings are already processed and filtered.
     4265!--          For this reason, consistency checks are based on wall_flags_0
     4266!--          rather than buildings_f (buildings are represented by bit 6 in
     4267!--          wall_flags_0).
     4268             IF ( building_type_f%from_file  .AND.  buildings_f%from_file )  THEN
     4269                IF ( ANY( BTEST ( wall_flags_0(:,j,i), 6 ) )  .AND.            &
     4270                     building_type_f%var(j,i) == building_type_f%fill  .OR.    &
     4271               .NOT. ANY( BTEST ( wall_flags_0(:,j,i), 6 ) )  .AND.            &
     4272                     building_type_f%var(j,i) /= building_type_f%fill )  THEN
     4273                   WRITE( message_string, * ) 'Each location where a ' //      &
     4274                                   'building is set requires a type ' //       &
     4275                                   '( and vice versa ) in case the ' //        &
     4276                                   'urban-surface model is applied. ' //       &
     4277                                   'i, j = ', i, j
     4278                   CALL message( 'netcdf_data_input_mod', 'PA0573',            &
     4279                                  2, 2, myid, 6, 0 )
     4280                ENDIF
     4281             ENDIF
    42914282!
    42924283!--          Check if at each location where a building is present also an ID
    42934284!--          is set and vice versa.
    4294 !              IF ( buildings_f%from_file )  THEN
    4295 !                 IF ( buildings_f%lod == 1 )  THEN
    4296 !                    IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1  .AND.    &
    4297 !                         building_id_f%var(j,i)  == building_id_f%fill  .OR.    &
    4298 !                         buildings_f%var_2d(j,i) == buildings_f%fill1  .AND.    &
    4299 !                         building_id_f%var(j,i)  /= building_id_f%fill )  THEN
    4300 !                       WRITE( message_string, * ) 'Each location where a ' //   &
    4301 !                                       '2D building is set requires an ID ' //  &
    4302 !                                       '( and vice versa ). i, j = ', i, j
    4303 !                       CALL message( 'netcdf_data_input_mod', 'PA0574',         &
    4304 !                                      2, 2, myid, 6, 0 )
    4305 !                    ENDIF
    4306 !                 ELSEIF ( buildings_f%lod == 2 )  THEN
    4307 !                    IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
    4308 !                         building_id_f%var(j,i) == building_id_f%fill  .OR.     &
    4309 !                   .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
    4310 !                         building_id_f%var(j,i) /= building_id_f%fill )  THEN
    4311 !                       WRITE( message_string, * ) 'Each location where a ' //   &
    4312 !                                       '3D building is set requires an ID ' //  &
    4313 !                                       '( and vice versa ). i, j = ', i, j
    4314 !                       CALL message( 'netcdf_data_input_mod', 'PA0574',         &
    4315 !                                      2, 2, myid, 6, 0 )
    4316 !                    ENDIF
    4317 !                 ENDIF
    4318 !              ENDIF
     4285             IF ( buildings_f%from_file )  THEN
     4286                IF ( ANY( BTEST ( wall_flags_0(:,j,i), 6 ) )  .AND.           &
     4287                     building_id_f%var(j,i) == building_id_f%fill  .OR.       &
     4288               .NOT. ANY( BTEST ( wall_flags_0(:,j,i), 6 ) )  .AND.           &
     4289                     building_id_f%var(j,i) /= building_id_f%fill )  THEN
     4290                   WRITE( message_string, * ) 'Each location where a ' //     &
     4291                                   'building is set requires an ID ' //       &
     4292                                   '( and vice versa ). i, j = ', i, j
     4293                   CALL message( 'netcdf_data_input_mod', 'PA0574',           &
     4294                                  2, 2, myid, 6, 0 )
     4295                ENDIF
     4296             ENDIF
    43194297!
    43204298!--          Check if building ID is set where a bulding is defined.
    43214299             IF ( buildings_f%from_file )  THEN
    4322                 IF ( buildings_f%lod == 1 )  THEN
    4323                    IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1  .AND.   &
    4324                         building_id_f%var(j,i)  == building_id_f%fill )  THEN
    4325                       WRITE( message_string, * ) 'Each building grid point '// &
    4326                                                  'requires an ID.', i, j
    4327                       CALL message( 'netcdf_data_input_mod', 'PA0575',         &
    4328                                      2, 2, myid, 6, 0 )
    4329                    ENDIF
    4330                 ELSEIF ( buildings_f%lod == 2 )  THEN
    4331                    IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
    4332                         building_id_f%var(j,i) == building_id_f%fill )  THEN
    4333                       WRITE( message_string, * ) 'Each building grid point '// &
    4334                                                  'requires an ID.', i, j
    4335                       CALL message( 'netcdf_data_input_mod', 'PA0575',         &
    4336                                      2, 2, myid, 6, 0 )
    4337                    ENDIF
     4300                IF ( ANY( BTEST ( wall_flags_0(:,j,i), 6 ) )  .AND.           &
     4301                     building_id_f%var(j,i) == building_id_f%fill )  THEN
     4302                   WRITE( message_string, * ) 'Each building grid point '//   &
     4303                                              'requires an ID.', i, j
     4304                   CALL message( 'netcdf_data_input_mod', 'PA0575',           &
     4305                                  2, 2, myid, 6, 0 )
    43384306                ENDIF
    43394307             ENDIF
Note: See TracChangeset for help on using the changeset viewer.