Changeset 3941 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
- Timestamp:
- Apr 30, 2019 9:48:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r3885 r3941 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Move check for grid dimension to an earlier point in time when first array 28 ! is read. 29 ! Improve checks for building types / IDs with respect to 2D/3D buildings. 30 ! 31 ! 3885 2019-04-11 11:29:34Z kanani 27 32 ! Changes related to global restructuring of location messages and introduction 28 33 ! of additional debug messages … … 2498 2503 ONLY: message_string, topography 2499 2504 2505 USE grid_variables, & 2506 ONLY: dx, dy 2507 2500 2508 USE indices, & 2501 ONLY: nbgp, nx l, nxr, ny, nyn, nys, nzb2509 ONLY: nbgp, nx, nxl, nxr, ny, nyn, nys, nzb 2502 2510 2503 2511 … … 2544 2552 CALL get_variable( id_topo, 'x', dim_static%x ) 2545 2553 CALL get_variable( id_topo, 'y', dim_static%y ) 2554 ! 2555 !-- Check whether dimension size in input file matches the model dimensions 2556 IF ( dim_static%nx-1 /= nx .OR. dim_static%ny-1 /= ny ) THEN 2557 message_string = 'Static input file: horizontal dimension in ' // & 2558 'x- and/or y-direction ' // & 2559 'do not match the respective model dimension' 2560 CALL message( 'netcdf_data_input_mod', 'PA0548', 1, 2, 0, 6, 0 ) 2561 ENDIF 2562 ! 2563 !-- Check if grid spacing of provided input data matches the respective 2564 !-- grid spacing in the model. 2565 IF ( ABS( dim_static%x(1) - dim_static%x(0) - dx ) > 10E-6_wp .OR. & 2566 ABS( dim_static%y(1) - dim_static%y(0) - dy ) > 10E-6_wp ) THEN 2567 message_string = 'Static input file: horizontal grid spacing ' // & 2568 'in x- and/or y-direction ' // & 2569 'do not match the respective model grid spacing.' 2570 CALL message( 'netcdf_data_input_mod', 'PA0549', 1, 2, 0, 6, 0 ) 2571 ENDIF 2546 2572 ! 2547 2573 !-- Terrain height. First, get variable-related _FillValue attribute … … 3810 3836 ONLY: land_surface, message_string, urban_surface 3811 3837 3812 USE grid_variables, &3813 ONLY: dx, dy3814 3815 3838 USE indices, & 3816 ONLY: nx , nxl, nxr, ny, nyn, nys3839 ONLY: nxl, nxr, nyn, nys 3817 3840 3818 3841 IMPLICIT NONE … … 3827 3850 !-- Return if no static input file is available 3828 3851 IF ( .NOT. input_pids_static ) RETURN 3829 !3830 !-- Check whether dimension size in input file matches the model dimensions3831 IF ( dim_static%nx-1 /= nx .OR. dim_static%ny-1 /= ny ) THEN3832 message_string = 'Static input file: horizontal dimension in ' // &3833 'x- and/or y-direction ' // &3834 'do not match the respective model dimension'3835 CALL message( 'netcdf_data_input_mod', 'PA0548', 1, 2, 0, 6, 0 )3836 ENDIF3837 !3838 !-- Check if grid spacing of provided input data matches the respective3839 !-- grid spacing in the model.3840 IF ( ABS( dim_static%x(1) - dim_static%x(0) - dx ) > 10E-6_wp .OR. &3841 ABS( dim_static%y(1) - dim_static%y(0) - dy ) > 10E-6_wp ) THEN3842 message_string = 'Static input file: horizontal grid spacing ' // &3843 'in x- and/or y-direction ' // &3844 'do not match the respective model grid spacing.'3845 CALL message( 'netcdf_data_input_mod', 'PA0549', 1, 2, 0, 6, 0 )3846 ENDIF3847 3852 ! 3848 3853 !-- Check for correct dimension of surface_fractions, should run from 0-2. … … 4250 4255 IF ( buildings_f%lod == 1 ) THEN 4251 4256 IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1 .AND. & 4252 building_type_f%var(j,i) == building_type_f%fill ) THEN 4257 building_type_f%var(j,i) == building_type_f%fill .OR. & 4258 buildings_f%var_2d(j,i) == buildings_f%fill1 .AND. & 4259 building_type_f%var(j,i) /= building_type_f%fill ) THEN 4253 4260 WRITE( message_string, * ) 'Each location where a ' // & 4254 'building is set requires a type ' // &4255 '( and vice versa ) in case the ' //&4256 'urban-surface model is applied. ' //&4257 4261 '2D building is set requires a type ' // & 4262 '( and vice versa ) in case the ' // & 4263 'urban-surface model is applied. ' // & 4264 'i, j = ', i, j 4258 4265 CALL message( 'netcdf_data_input_mod', 'PA0573', & 4259 4266 2, 2, myid, 6, 0 ) … … 4262 4269 IF ( buildings_f%lod == 2 ) THEN 4263 4270 IF ( ANY( buildings_f%var_3d(:,j,i) == 1 ) .AND. & 4264 building_type_f%var(j,i) == building_type_f%fill ) THEN 4271 building_type_f%var(j,i) == building_type_f%fill .OR. & 4272 .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 ) .AND. & 4273 building_type_f%var(j,i) /= building_type_f%fill ) THEN 4265 4274 WRITE( message_string, * ) 'Each location where a ' // & 4266 'building is set requires a type ' // &4267 '( and vice versa ) in case the ' //&4268 'urban-surface model is applied. ' //&4269 4275 '3D building is set requires a type ' // & 4276 '( and vice versa ) in case the ' // & 4277 'urban-surface model is applied. ' // & 4278 'i, j = ', i, j 4270 4279 CALL message( 'netcdf_data_input_mod', 'PA0573', & 4271 4280 2, 2, myid, 6, 0 ) … … 4279 4288 IF ( buildings_f%lod == 1 ) THEN 4280 4289 IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1 .AND. & 4281 building_id_f%var(j,i) == building_id_f%fill ) THEN 4290 building_id_f%var(j,i) == building_id_f%fill .OR. & 4291 buildings_f%var_2d(j,i) == buildings_f%fill1 .AND. & 4292 building_id_f%var(j,i) /= building_id_f%fill ) THEN 4282 4293 WRITE( message_string, * ) 'Each location where a ' // & 4283 'building is set requires an ID ' // &4284 4294 '2D building is set requires an ID ' // & 4295 '( and vice versa ). i, j = ', i, j 4285 4296 CALL message( 'netcdf_data_input_mod', 'PA0574', & 4286 4297 2, 2, myid, 6, 0 ) … … 4288 4299 ELSEIF ( buildings_f%lod == 2 ) THEN 4289 4300 IF ( ANY( buildings_f%var_3d(:,j,i) == 1 ) .AND. & 4290 building_id_f%var(j,i) == building_id_f%fill ) THEN 4301 building_id_f%var(j,i) == building_id_f%fill .OR. & 4302 .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 ) .AND. & 4303 building_id_f%var(j,i) /= building_id_f%fill ) THEN 4291 4304 WRITE( message_string, * ) 'Each location where a ' // & 4292 'building is set requires an ID ' // &4293 4305 '3D building is set requires an ID ' // & 4306 '( and vice versa ). i, j = ', i, j 4294 4307 CALL message( 'netcdf_data_input_mod', 'PA0574', & 4295 4308 2, 2, myid, 6, 0 )
Note: See TracChangeset
for help on using the changeset viewer.