Changeset 3941 for palm/trunk/SOURCE


Ignore:
Timestamp:
Apr 30, 2019 9:48:33 AM (5 years ago)
Author:
suehring
Message:

Move checks for correct dimensions in static input file; improve checks concerning buildings; check whether at least one surface type is set at a natural-type surface element

Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

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

    r3933 r3941  
    2525! -----------------
    2626! $Id$
     27! Check that at least one surface type is set at surface element.
     28!
     29! 3933 2019-04-25 12:33:20Z kanani
    2730! Remove unused subroutine and allocation of pt_2m, this is done in surface_mod
    2831! now (surfaces%pt_2m)
     
    22772280       ENDIF
    22782281
    2279 
    2280 !        pt(k+k_off,j+j_off,i+i_off) = surf_t_surface_p%var_1d(m) / exner(nzb)  !is actually no air temperature
    22812282       surf%pt_surface(m)          = surf_t_surface_p%var_1d(m) / exner(nzb)
    22822283
     
    28812882                IF ( water_type_f%var(j,i)      /= water_type_f%fill )         &
    28822883                   surf_lsm_h%water_surface(m) = .TRUE.
     2884!
     2885!--             Check if at least one type is set.
     2886                IF ( .NOT. surf_lsm_h%vegetation_surface(m)  .AND.             &
     2887                     .NOT. surf_lsm_h%pavement_surface(m)    .AND.             &
     2888                     .NOT. surf_lsm_h%water_surface(m) )  THEN
     2889                   WRITE( message_string, * ) 'Horizontal surface element ' // &
     2890                                       ' at i, j = ',  i, j,                   &
     2891                                       ' is neither a vegetation, ' //         &
     2892                                       'pavement, nor a water surface.'
     2893                   CALL message( 'land_surface_model_mod', 'PA0619',          &
     2894                                  2, 2, myid, 6, 0 )
     2895                ENDIF
     2896               
    28832897             ENDDO
    28842898!
     
    29592973                      surf_lsm_v(l)%water_surface(m) = .TRUE.
    29602974!
    2961 !--                Check if surface element has the flag %building_covered_all,
    2962 !--                this case, set vegetation_type appropriate
     2975!--                Check if at least one type is set.
     2976                   IF ( .NOT. surf_lsm_v(l)%vegetation_surface(m)  .AND.       &
     2977                        .NOT. surf_lsm_v(l)%pavement_surface(m)    .AND.       &
     2978                        .NOT. surf_lsm_v(l)%water_surface(m) )  THEN
     2979                      WRITE( message_string, * ) 'Vertical surface element ' //&
     2980                                       ' at i, j = ',  i, j,                   &
     2981                                       ' is neither a vegetation, ' //         &
     2982                                       'pavement, nor a water surface.'
     2983                      CALL message( 'land_surface_model_mod', 'PA0619',        &
     2984                                     2, 2, myid, 6, 0 )
     2985                   ENDIF
    29632986                ENDDO
    29642987             ENDDO
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r3885 r3941  
    2525! -----------------
    2626! $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
    2732! Changes related to global restructuring of location messages and introduction
    2833! of additional debug messages
     
    24982503           ONLY:  message_string, topography
    24992504
     2505       USE grid_variables,                                                     &
     2506           ONLY:  dx, dy   
     2507           
    25002508       USE indices,                                                            &
    2501            ONLY:  nbgp, nxl, nxr, ny, nyn, nys, nzb
     2509           ONLY:  nbgp, nx, nxl, nxr, ny, nyn, nys, nzb
    25022510
    25032511
     
    25442552          CALL get_variable( id_topo, 'x', dim_static%x )
    25452553          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
    25462572!
    25472573!--       Terrain height. First, get variable-related _FillValue attribute
     
    38103836           ONLY:  land_surface, message_string, urban_surface
    38113837
    3812        USE grid_variables,                                                     &
    3813            ONLY:  dx, dy
    3814 
    38153838       USE indices,                                                            &
    3816            ONLY:  nx, nxl, nxr, ny, nyn, nys
     3839           ONLY:  nxl, nxr, nyn, nys
    38173840
    38183841       IMPLICIT NONE
     
    38273850!--    Return if no static input file is available
    38283851       IF ( .NOT. input_pids_static )  RETURN
    3829 !
    3830 !--    Check whether dimension size in input file matches the model dimensions
    3831        IF ( dim_static%nx-1 /= nx  .OR.  dim_static%ny-1 /= ny )  THEN
    3832           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        ENDIF
    3837 !
    3838 !--    Check if grid spacing of provided input data matches the respective
    3839 !--    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 )  THEN
    3842           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        ENDIF
    38473852!
    38483853!--    Check for correct dimension of surface_fractions, should run from 0-2.
     
    42504255                IF ( buildings_f%lod == 1 )  THEN
    42514256                   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
    42534260                      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                                          'i, j = ', i, j
     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
    42584265                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
    42594266                                     2, 2, myid, 6, 0 )
     
    42624269                IF ( buildings_f%lod == 2 )  THEN
    42634270                   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
    42654274                      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                                          'i, j = ', i, j
     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
    42704279                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
    42714280                                     2, 2, myid, 6, 0 )
     
    42794288                IF ( buildings_f%lod == 1 )  THEN
    42804289                   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
    42824293                      WRITE( message_string, * ) 'Each location where a ' //   &
    4283                                          'building is set requires an ID ' //  &
    4284                                          '( and vice versa ). i, j = ', i, j
     4294                                      '2D building is set requires an ID ' //  &
     4295                                      '( and vice versa ). i, j = ', i, j
    42854296                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
    42864297                                     2, 2, myid, 6, 0 )
     
    42884299                ELSEIF ( buildings_f%lod == 2 )  THEN
    42894300                   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
    42914304                      WRITE( message_string, * ) 'Each location where a ' //   &
    4292                                          'building is set requires an ID ' //  &
    4293                                          '( and vice versa ). i, j = ', i, j
     4305                                      '3D building is set requires an ID ' //  &
     4306                                      '( and vice versa ). i, j = ', i, j
    42944307                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
    42954308                                     2, 2, myid, 6, 0 )
Note: See TracChangeset for help on using the changeset viewer.