Changeset 2930 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
- Timestamp:
- Mar 23, 2018 4:30:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r2925 r2930 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Revise checks for surface_fraction. 28 ! 29 ! 2925 2018-03-23 14:54:11Z suehring 27 30 ! Check for further inconsistent settings of surface_fractions. 28 31 ! Some messages slightly rephrased and error numbers renamed. … … 2785 2788 INTEGER(iwp) :: i !< loop index along x-direction 2786 2789 INTEGER(iwp) :: j !< loop index along y-direction 2790 INTEGER(iwp) :: n_surf !< number of different surface types at given location 2787 2791 2788 2792 LOGICAL :: check_passed !< flag indicating if a check passed … … 2991 2995 ENDIF 2992 2996 ! 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', & 2997 !-- Check for consistency of surface fraction. If more than one type 2998 !-- is set, surface fraction need to be given and the sum must not 2999 !-- be larger than 1. 3000 n_surf = 0 3001 IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill ) & 3002 n_surf = n_surf + 1 3003 IF ( water_type_f%var(j,i) /= water_type_f%fill ) & 3004 n_surf = n_surf + 1 3005 IF ( pavement_type_f%var(j,i) /= pavement_type_f%fill ) & 3006 n_surf = n_surf + 1 3007 3008 IF ( n_surf > 1 ) THEN 3009 IF ( ANY ( surface_fraction_f%frac(:,j,i) == & 3010 surface_fraction_f%fill ) ) THEN 3011 message_string = 'If more than one surface type is ' // & 3012 'given at a location, surface_fraction ' // & 3013 'must be provided.' 3014 CALL message( 'netcdf_data_input_mod', 'NDI027', & 3001 3015 2, 2, 0, 6, 0 ) 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 ) 3016 ENDIF 3017 IF ( SUM ( surface_fraction_f%frac(:,j,i) ) > 1.0_wp ) THEN 3018 message_string = 'surface_fraction must not exceed 1' 3019 CALL message( 'netcdf_data_input_mod', 'NDI028', & 3020 2, 2, 0, 6, 0 ) 3021 ENDIF 3007 3022 ENDIF 3008 3023 ! 3009 3024 !-- Check for further mismatches, e.g. vegetation_type is set but 3010 3025 !-- 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', & 3026 IF ( ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill .AND.& 3027 ( surface_fraction_f%frac(0,j,i) == 0.0_wp .OR. & 3028 surface_fraction_f%frac(0,j,i) == surface_fraction_f%fill ) & 3029 ) .OR. & 3030 ( pavement_type_f%var(j,i) /= pavement_type_f%fill .AND. & 3031 ( surface_fraction_f%frac(1,j,i) == 0.0_wp .OR. & 3032 surface_fraction_f%frac(1,j,i) == surface_fraction_f%fill ) & 3033 ) .OR. & 3034 ( water_type_f%var(j,i) /= water_type_f%fill .AND. & 3035 ( surface_fraction_f%frac(2,j,i) == 0.0_wp .OR. & 3036 surface_fraction_f%frac(2,j,i) == surface_fraction_f%fill ) & 3037 ) ) THEN 3038 WRITE( message_string, * ) 'Mismatch in setting of ' // & 3039 'surface_fraction. Vegetation-, pavement-, or '// & 3040 'water surface is given at (i,j) = ( ', i, j, & 3041 ' ), but surface fraction is 0 for the given type.' 3042 CALL message( 'netcdf_data_input_mod', 'NDI029', & 3022 3043 2, 2, 0, 6, 0 ) 3023 3044 ENDIF … … 3025 3046 !-- Check for further mismatches, e.g. vegetation_type is not set 3026 3047 !-- 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', & 3048 IF ( ( vegetation_type_f%var(j,i) == vegetation_type_f%fill .AND.& 3049 ( surface_fraction_f%frac(0,j,i) /= 0.0_wp .AND. & 3050 surface_fraction_f%frac(0,j,i) /= surface_fraction_f%fill ) & 3051 ) .OR. & 3052 ( pavement_type_f%var(j,i) == pavement_type_f%fill .AND. & 3053 ( surface_fraction_f%frac(1,j,i) /= 0.0_wp .AND. & 3054 surface_fraction_f%frac(1,j,i) /= surface_fraction_f%fill ) & 3055 ) .OR. & 3056 ( water_type_f%var(j,i) == water_type_f%fill .AND. & 3057 ( surface_fraction_f%frac(2,j,i) /= 0.0_wp .AND. & 3058 surface_fraction_f%frac(2,j,i) /= surface_fraction_f%fill ) & 3059 ) ) THEN 3060 WRITE( message_string, * ) 'Mismatch in setting of ' // & 3061 'surface_fraction. Vegetation-, pavement-, or '// & 3062 'water surface is not given at (i,j) = ( ', i, j, & 3063 ' ), but surface fraction is not 0 for the ' // & 3064 'given type.' 3065 CALL message( 'netcdf_data_input_mod', 'NDI030', & 3039 3066 2, 2, 0, 6, 0 ) 3040 3067 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.