Changeset 3053


Ignore:
Timestamp:
Jun 1, 2018 12:59:07 PM (6 years ago)
Author:
suehring
Message:

Revise checks for relative surface fractions of vegetation, pavement and water surfaces

File:
1 edited

Legend:

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

    r3051 r3053  
    2525! -----------------
    2626! $Id$
     27! Revise checks for variable surface_fraction
     28!
     29! 3051 2018-05-30 17:43:55Z suehring
    2730! - Speed-up NetCDF input
    2831! - Revise input routines and remove NetCDF input via IO-blocks since this is
     
    955958       ENDIF
    956959!
    957 !--    Read surface fractions and related information
     960!--    Read relative surface fractions of vegetation, pavement and water.
    958961       IF ( check_existence( var_names, 'surface_fraction' ) )  THEN
    959962          surface_fraction_f%from_file = .TRUE.
     
    30613064
    30623065             IF ( n_surf > 1 )  THEN
    3063                 IF ( ANY ( surface_fraction_f%frac(:,j,i) ==                   &
    3064                      surface_fraction_f%fill ) )  THEN
     3066                IF ( .NOT. surface_fraction_f%from_file )  THEN
     3067                   message_string = 'If more than one surface type is ' //     &
     3068                                 'given at a location, surface_fraction ' //   &
     3069                                 'must be provided.'
     3070                   CALL message( 'netcdf_data_input_mod', 'NDI027',            &
     3071                                  2, 2, 0, 6, 0 )
     3072                ELSEIF ( ANY ( surface_fraction_f%frac(:,j,i) ==               &
     3073                               surface_fraction_f%fill ) )  THEN
    30653074                   message_string = 'If more than one surface type is ' //     &
    30663075                                 'given at a location, surface_fraction ' //   &
     
    30693078                                  2, 2, 0, 6, 0 )
    30703079                ENDIF
     3080             ENDIF
     3081!
     3082!--          Check for further mismatches. e.g. relative fractions exceed 1 or
     3083!--          vegetation_type is set but surface vegetation fraction is zero,
     3084!--          etc..
     3085             IF ( surface_fraction_f%from_file )  THEN
     3086!
     3087!--             Sum of relative fractions must not exceed 1.
    30713088                IF ( SUM ( surface_fraction_f%frac(:,j,i) ) > 1.0_wp )  THEN
    30723089                   message_string = 'surface_fraction must not exceed 1'
     
    30743091                                  2, 2, 0, 6, 0 )
    30753092                ENDIF
    3076              ENDIF
    3077 !
    3078 !--          Check for further mismatches, e.g. vegetation_type is set but
    3079 !--          surface vegetation fraction is zero.
    3080              IF ( ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill  .AND.&
     3093!
     3094!--             Relative fraction for a type must not be zero at locations where
     3095!--             this type is set.
     3096                IF (                                                           &
     3097                 ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill  .AND.&
    30813098                 ( surface_fraction_f%frac(ind_veg_wall,j,i) == 0.0_wp .OR.    &
    30823099                   surface_fraction_f%frac(ind_veg_wall,j,i) ==                &
     
    30933110                                                     surface_fraction_f%fill ) &
    30943111                  ) )  THEN
    3095                 WRITE( message_string, * ) 'Mismatch in setting of '     //    &
     3112                   WRITE( message_string, * ) 'Mismatch in setting of '     // &
    30963113                             'surface_fraction. Vegetation-, pavement-, or '// &
    30973114                             'water surface is given at (i,j) = ( ', i, j,     &
    30983115                             ' ), but surface fraction is 0 for the given type.'
    3099                 CALL message( 'netcdf_data_input_mod', 'NDI029',               &
    3100                                2, 2, 0, 6, 0 )
    3101              ENDIF
    3102 !
    3103 !--          Check for further mismatches, e.g. vegetation_type is not set
    3104 !--          surface vegetation fraction is non-zero.
    3105              IF ( ( vegetation_type_f%var(j,i) == vegetation_type_f%fill  .AND.&
     3116                   CALL message( 'netcdf_data_input_mod', 'NDI029',            &
     3117                                  2, 2, 0, 6, 0 )
     3118                ENDIF
     3119!
     3120!--             Relative fraction for a type must not contain non-zero values
     3121!--             if this type is not set.
     3122                IF (                                                           &
     3123                  ( vegetation_type_f%var(j,i) == vegetation_type_f%fill  .AND.&
    31063124                 ( surface_fraction_f%frac(ind_veg_wall,j,i) /= 0.0_wp .AND.   &
    31073125                   surface_fraction_f%frac(ind_veg_wall,j,i) /=                &
     
    31183136                                                     surface_fraction_f%fill ) &
    31193137                  ) )  THEN
    3120                 WRITE( message_string, * ) 'Mismatch in setting of '     //    &
     3138                   WRITE( message_string, * ) 'Mismatch in setting of '     // &
    31213139                             'surface_fraction. Vegetation-, pavement-, or '// &
    31223140                             'water surface is not given at (i,j) = ( ', i, j, &
    31233141                             ' ), but surface fraction is not 0 for the ' //   &
    31243142                             'given type.'
    3125                 CALL message( 'netcdf_data_input_mod', 'NDI030',               &
    3126                                2, 2, 0, 6, 0 )
     3143                   CALL message( 'netcdf_data_input_mod', 'NDI030',            &
     3144                                  2, 2, 0, 6, 0 )
     3145                ENDIF
    31273146             ENDIF
    31283147!
Note: See TracChangeset for help on using the changeset viewer.