Ignore:
Timestamp:
Mar 23, 2018 2:54:11 PM (6 years ago)
Author:
suehring
Message:

Check for further inconsistent settings of surface_fractions; error messages slightly rephrased and error numbers changed.

File:
1 edited

Legend:

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

    r2898 r2925  
    2525! -----------------
    2626! $Id$
     27! Check for further inconsistent settings of surface_fractions.
     28! Some messages slightly rephrased and error numbers renamed.
     29!
     30! 2898 2018-03-15 13:03:01Z suehring
    2731! Check if each building has a type. Further, check if dimensions in static
    2832! input file match the model dimensions.
     
    17231727                   ELSE
    17241728                      message_string = 'NetCDF attribute lod ' //              &
    1725                                        '(level of detail) is not set properly.'
    1726                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     1729                                       '(level of detail) is not set ' //      &
     1730                                       'properly for buildings_2D.'
     1731                      CALL message( 'netcdf_data_input_mod', 'NDI000',         &
    17271732                                     1, 2, 0, 6, 0 )
    17281733                   ENDIF
     
    17601765                   ELSE
    17611766                      message_string = 'NetCDF attribute lod ' //              &
    1762                                        '(level of detail) is not set properly.'
    1763                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     1767                                       '(level of detail) is not set ' //      &
     1768                                       'properly for buildings_3D.'
     1769                      CALL message( 'netcdf_data_input_mod', 'NDI001',         &
    17641770                                     1, 2, 0, 6, 0 )
    17651771                   ENDIF
     
    18601866             message_string = 'If building heigths are prescribed in ' //      &
    18611867                              'static input file, also an ID is required.'
    1862              CALL message( 'netcdf_data_input_mod', 'PA0999', 1, 2, 0, 6, 0 )
     1868             CALL message( 'netcdf_data_input_mod', 'NDI002', 1, 2, 0, 6, 0 )
    18631869          ENDIF
    18641870       ENDIF
     
    19982004                message_string = 'Number of inifor grid points does not '  //  &
    19992005                                 'match the number of numeric grid points.'
    2000                 CALL message( 'netcdf_data_input_mod', 'PA0999', 1, 2, 0, 6, 0 )
     2006                CALL message( 'netcdf_data_input_mod', 'NDI003', 1, 2, 0, 6, 0 )
    20012007             ENDIF
    20022008!
     
    22902296             message_string = 'NetCDF input for u_init must not contain ' //   &
    22912297                              'any _FillValues'
    2292              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2298             CALL message( 'netcdf_data_input_mod', 'NDI004', 2, 2, 0, 6, 0 )
    22932299          ENDIF
    22942300       ENDIF
     
    22972303             message_string = 'NetCDF input for v_init must not contain ' //   &
    22982304                              'any _FillValues'
    2299              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2305             CALL message( 'netcdf_data_input_mod', 'NDI005', 2, 2, 0, 6, 0 )
    23002306          ENDIF
    23012307       ENDIF
     
    23042310             message_string = 'NetCDF input for w_init must not contain ' //   &
    23052311                              'any _FillValues'
    2306              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2312             CALL message( 'netcdf_data_input_mod', 'NDI006', 2, 2, 0, 6, 0 )
    23072313          ENDIF
    23082314       ENDIF
     
    23112317             message_string = 'NetCDF input for pt_init must not contain ' //  &
    23122318                              'any _FillValues'
    2313              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2319             CALL message( 'netcdf_data_input_mod', 'NDI007', 2, 2, 0, 6, 0 )
    23142320          ENDIF
    23152321       ENDIF
     
    23182324             message_string = 'NetCDF input for q_init must not contain ' //   &
    23192325                              'any _FillValues'
    2320              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2326             CALL message( 'netcdf_data_input_mod', 'NDI008', 2, 2, 0, 6, 0 )
    23212327          ENDIF
    23222328       ENDIF
     
    27412747          message_string = 'forcing = .TRUE. requires dynamic input file ' //  &
    27422748                            TRIM( input_file_dynamic ) // TRIM( coupling_char )
    2743           CALL message( 'netcdf_data_input_mod', 'PA0430', 1, 2, 0, 6, 0 )
     2749          CALL message( 'netcdf_data_input_mod', 'NDI009', 1, 2, 0, 6, 0 )
    27442750       ENDIF
    27452751!
     
    27512757                           'input file ' // TRIM( input_file_dynamic ) //      &
    27522758                           TRIM( coupling_char )
    2753           CALL message( 'netcdf_data_input_mod', 'PA0430', 1, 2, 0, 6, 0 )
     2759          CALL message( 'netcdf_data_input_mod', 'NDI010', 1, 2, 0, 6, 0 )
    27542760       ENDIF
    27552761
     
    27792785       INTEGER(iwp) ::  i      !< loop index along x-direction
    27802786       INTEGER(iwp) ::  j      !< loop index along y-direction
    2781        INTEGER(iwp) ::  n_surf !< number of different surface types at given location
    27822787
    27832788       LOGICAL      ::  check_passed !< flag indicating if a check passed
     
    27922797                           'x- and/or y-direction ' //                         &
    27932798                           'do not match the respective model dimension'
    2794           CALL message( 'netcdf_data_input_mod', 'PA0999', 1, 2, 0, 6, 0 )
     2799          CALL message( 'netcdf_data_input_mod', 'NDI011', 1, 2, 0, 6, 0 )
    27952800       ENDIF
    27962801!
     
    28022807                           'in x- and/or y-direction ' //                      &
    28032808                           'do not match the respective model grid spacing.'
    2804           CALL message( 'netcdf_data_input_mod', 'PA0999', 1, 2, 0, 6, 0 )
     2809          CALL message( 'netcdf_data_input_mod', 'NDI012', 1, 2, 0, 6, 0 )
    28052810       ENDIF
    28062811!
     
    28112816          message_string = 'NetCDF variable orography_2D is not ' //           &
    28122817                           'allowed to have missing data'
    2813           CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2818          CALL message( 'netcdf_data_input_mod', 'NDI013', 2, 2, 0, 6, 0 )
    28142819       ENDIF
    28152820!
     
    28212826                message_string = 'Reading 3D building data - too much ' //     &
    28222827                                 'data points along the vertical coordinate.'
    2823                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2828                CALL message( 'netcdf_data_input_mod', 'NDI014', 2, 2, 0, 6, 0 )
    28242829             ENDIF
    28252830
     
    28282833                message_string = 'Reading 3D building data - vertical ' //     &
    28292834                                 'coordinate do not match numeric grid.'
    2830                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2835                CALL message( 'netcdf_data_input_mod', 'NDI015', 2, 2, 0, 6, 0 )
    28312836             ENDIF
    28322837          ENDIF
     
    28502855                           'building_type, soil_type and water_type are '//    &
    28512856                           'required.'
    2852           CALL message( 'netcdf_data_input_mod', 'PA0999', 1, 2, 0, 6, 0 )
     2857          CALL message( 'netcdf_data_input_mod', 'NDI016', 1, 2, 0, 6, 0 )
    28532858       ENDIF
    28542859!
     
    28612866                message_string = 'If vegegation_type = 0 at any location, ' // &
    28622867                                 'vegetation_pars is required'
    2863                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2868                CALL message( 'netcdf_data_input_mod', 'NDI017', 2, 2, 0, 6, 0 )
    28642869             ENDIF
    28652870             IF ( .NOT. root_area_density_lsm_f%from_file )  THEN
    28662871                message_string = 'If vegegation_type = 0 at any location, ' // &
    28672872                                 'root_area_density_lsm is required'
    2868                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2873                CALL message( 'netcdf_data_input_mod', 'NDI018', 2, 2, 0, 6, 0 )
    28692874             ENDIF
    28702875          ENDIF
     
    28862891             message_string = 'If soil_type = 0 at any location, ' //          &
    28872892                              'soil_pars is required'
    2888              CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )         
     2893             CALL message( 'netcdf_data_input_mod', 'NDI019', 2, 2, 0, 6, 0 )         
    28892894          ENDIF
    28902895       ENDIF
     
    28962901                message_string = 'If building_type = 0 at any location, ' //   &
    28972902                                 'building_pars is required'
    2898                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )         
     2903                CALL message( 'netcdf_data_input_mod', 'NDI020', 2, 2, 0, 6, 0 )         
    28992904             ENDIF
    29002905          ENDIF
     
    29072912                message_string = 'If albedo_type = 0 at any location, ' //     &
    29082913                                 'albedo_pars is required'
    2909                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )     
     2914                CALL message( 'netcdf_data_input_mod', 'NDI021', 2, 2, 0, 6, 0 )     
    29102915             ENDIF     
    29112916          ENDIF
     
    29182923                message_string = 'If pavement_type = 0 at any location, ' //   &
    29192924                                 'pavement_pars is required'
    2920                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )     
     2925                CALL message( 'netcdf_data_input_mod', 'NDI022', 2, 2, 0, 6, 0 )     
    29212926             ENDIF     
    29222927          ENDIF
     
    29302935                message_string = 'If pavement_type = 0 at any location, ' //   &
    29312936                                 'pavement_subsurface_pars is required'
    2932                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )     
     2937                CALL message( 'netcdf_data_input_mod', 'NDI023', 2, 2, 0, 6, 0 )     
    29332938             ENDIF     
    29342939          ENDIF
     
    29412946                message_string = 'If water_type = 0 at any location, ' //      &
    29422947                                 'water_pars is required'
    2943                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )     
     2948                CALL message( 'netcdf_data_input_mod', 'NDI024', 2, 2, 0, 6, 0 )     
    29442949             ENDIF     
    29452950          ENDIF
     
    29612966                                 'building_type, or water_type must be set '// &
    29622967                                 'to a non-missing value'
    2963                 CALL message( 'netcdf_data_input_mod', 'PA0999', 2, 2, 0, 6, 0 )
     2968                CALL message( 'netcdf_data_input_mod', 'NDI025', 2, 2, 0, 6, 0 )
    29642969             ENDIF
    29652970!
     
    29812986                                 'location (y,x) where vegetation_type or ' // &
    29822987                                 'pavement_type is a non-missing value.'
    2983                    CALL message( 'netcdf_data_input_mod', 'PA0999',            &
     2988                   CALL message( 'netcdf_data_input_mod', 'NDI026',            &
    29842989                                  2, 2, 0, 6, 0 )
    29852990                ENDIF
    29862991             ENDIF
    29872992!
    2988 !--          Check for consistency of surface fraction. If more than one type
    2989 !--          is set, surface fraction need to be given and the sum must not
    2990 !--          be larger than 1.
    2991              n_surf = 0
    2992              IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )       &
    2993                 n_surf = n_surf + 1
    2994              IF ( water_type_f%var(j,i)      /= water_type_f%fill )            &
    2995                 n_surf = n_surf + 1
    2996              IF ( pavement_type_f%var(j,i)   /= pavement_type_f%fill )         &
    2997                 n_surf = n_surf + 1
    2998              
    2999              IF ( n_surf > 1 )  THEN
    3000                 IF ( ANY ( surface_fraction_f%frac(:,j,i) ==                   &
    3001                      surface_fraction_f%fill ) )  THEN
    3002                    message_string = 'If more than one surface type is ' //     &
    3003                                  'given at a location, surface_fraction ' //   &
    3004                                  'must be provided.'
    3005                    CALL message( 'netcdf_data_input_mod', 'PA0999',            &
     2993!--          Check for consistency of surface fraction.
     2994!--          Sum of surface fractions must not exceed one.
     2995             IF ( ANY ( surface_fraction_f%frac(:,j,i) ==                      &
     2996                        surface_fraction_f%fill ) )  THEN
     2997                message_string = 'If more than one natural surface type is ' //&
     2998                              'given at a location, surface_fraction ' //      &
     2999                              'must be provided.'
     3000                CALL message( 'netcdf_data_input_mod', 'NDI027',               &
    30063001                                  2, 2, 0, 6, 0 )
    3007                 ENDIF
    3008                 IF ( SUM ( surface_fraction_f%frac(:,j,i) ) > 1.0_wp )  THEN
    3009                    message_string = 'surface_fraction must not exceed 1'
    3010                    CALL message( 'netcdf_data_input_mod', 'PA0999',            &
    3011                                   2, 2, 0, 6, 0 )
    3012                 ENDIF
     3002             ENDIF
     3003             IF ( SUM ( surface_fraction_f%frac(:,j,i) ) > 1.0_wp )  THEN
     3004                message_string = 'surface_fraction must not exceed 1'
     3005                CALL message( 'netcdf_data_input_mod', 'NDI028',               &
     3006                               2, 2, 0, 6, 0 )
     3007             ENDIF
     3008!
     3009!--          Check for further mismatches, e.g. vegetation_type is set but
     3010!--          surface vegetation fraction is zero.
     3011             IF ( ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill  .AND.  &
     3012                    surface_fraction_f%frac(0,j,i) == 0.0_wp )  .OR.             &
     3013                  ( pavement_type_f%var(j,i) /= pavement_type_f%fill     .AND.   &
     3014                    surface_fraction_f%frac(1,j,i) == 0.0_wp )  .OR.             &
     3015                  ( water_type_f%var(j,i) /= water_type_f%fill           .AND.   &
     3016                    surface_fraction_f%frac(2,j,i) == 0.0_wp ) )  THEN
     3017                WRITE( message_string, * ) 'Mismatch in setting of '     //      &
     3018                               'surface_fraction. Vegetation-, pavement-, or '// &
     3019                               'water surface is given at (i,j) = ( ', i, j,     &
     3020                               ' ), but surface fraction is 0 for the given type.'
     3021                CALL message( 'netcdf_data_input_mod', 'NDI029',                 &
     3022                               2, 2, 0, 6, 0 )
     3023             ENDIF
     3024!
     3025!--          Check for further mismatches, e.g. vegetation_type is not set       
     3026!--          surface vegetation fraction is non-zero.
     3027             IF ( ( vegetation_type_f%var(j,i) == vegetation_type_f%fill  .AND.  &
     3028                    surface_fraction_f%frac(0,j,i) /= 0.0_wp )  .OR.             &
     3029                  ( pavement_type_f%var(j,i) == pavement_type_f%fill     .AND.   &
     3030                    surface_fraction_f%frac(1,j,i) /= 0.0_wp )  .OR.             &
     3031                  ( water_type_f%var(j,i) == water_type_f%fill           .AND.   &
     3032                    surface_fraction_f%frac(2,j,i) /= 0.0_wp ) )  THEN
     3033                WRITE( message_string, * ) 'Mismatch in setting of '     //      &
     3034                               'surface_fraction. Vegetation-, pavement-, or '// &
     3035                               'water surface is not given at (i,j) = ( ', i, j, &
     3036                               ' ), but surface fraction is not 0 for the ' //   &
     3037                               'given type.'
     3038                CALL message( 'netcdf_data_input_mod', 'NDI030',                 &
     3039                               2, 2, 0, 6, 0 )
    30133040             ENDIF
    30143041!
     
    30233050                                       'parameters of vegetation_pars at '//   & 
    30243051                                       'this location must be set.'
    3025                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3052                      CALL message( 'netcdf_data_input_mod', 'NDI031',         &
    30263053                                     2, 2, 0, 6, 0 )
    30273054                   ENDIF
     
    30383065                                       'levels of root_area_density_lsm ' //   &
    30393066                                       'must be set at this location.'
    3040                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3067                      CALL message( 'netcdf_data_input_mod', 'NDI032',         &
    30413068                                     2, 2, 0, 6, 0 )
    30423069                   ENDIF
     
    30623089                   message_string = 'If soil_type(y,x) = 0, all levels of '  //& 
    30633090                                    'soil_pars at this location must be set.'
    3064                    CALL message( 'netcdf_data_input_mod', 'PA0999',            &
     3091                   CALL message( 'netcdf_data_input_mod', 'NDI033',            &
    30653092                                  2, 2, 0, 6, 0 )
    30663093                ENDIF
     
    30773104                                       'parameters of building_pars at this '//&
    30783105                                       'location must be set.'
    3079                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3106                      CALL message( 'netcdf_data_input_mod', 'NDI034',         &
    30803107                                     2, 2, 0, 6, 0 )
    30813108                   ENDIF
     
    30923119                                                 'urban-surface model is ' //  &
    30933120                                                 'applied. i, j = ', i, j
    3094                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3121                      CALL message( 'netcdf_data_input_mod', 'NDI035',         &
    30953122                                     2, 2, 0, 6, 0 )
    30963123                   ENDIF
     
    31033130                                                 'urban-surface model is ' //  &
    31043131                                                 'applied. i, j = ', i, j
    3105                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3132                      CALL message( 'netcdf_data_input_mod', 'NDI036',         &
    31063133                                     2, 2, 0, 6, 0 )
    31073134                   ENDIF
     
    31183145                                       'parameters of albedo_pars at this ' // &
    31193146                                       'location must be set.'
    3120                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3147                      CALL message( 'netcdf_data_input_mod', 'NDI037',         &
    31213148                                     2, 2, 0, 6, 0 )
    31223149                   ENDIF
     
    31343161                                       'parameters of pavement_pars at this '//&
    31353162                                       'location must be set.'
    3136                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3163                      CALL message( 'netcdf_data_input_mod', 'NDI038',         &
    31373164                                     2, 2, 0, 6, 0 )
    31383165                   ENDIF
     
    31513178                                       'pavement_subsurface_pars at this '//   &
    31523179                                       'location must be set.'
    3153                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3180                      CALL message( 'netcdf_data_input_mod', 'NDI039',         &
    31543181                                     2, 2, 0, 6, 0 )
    31553182                   ENDIF
     
    31673194                                       'parameters of water_pars at this ' //  &
    31683195                                       'location must be set.'
    3169                       CALL message( 'netcdf_data_input_mod', 'PA0999',         &
     3196                      CALL message( 'netcdf_data_input_mod', 'NDI040',         &
    31703197                                     2, 2, 0, 6, 0 )
    31713198                   ENDIF
Note: See TracChangeset for help on using the changeset viewer.