Changeset 2925 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
- Timestamp:
- Mar 23, 2018 2:54:11 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r2898 r2925 25 25 ! ----------------- 26 26 ! $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 27 31 ! Check if each building has a type. Further, check if dimensions in static 28 32 ! input file match the model dimensions. … … 1723 1727 ELSE 1724 1728 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', & 1727 1732 1, 2, 0, 6, 0 ) 1728 1733 ENDIF … … 1760 1765 ELSE 1761 1766 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', & 1764 1770 1, 2, 0, 6, 0 ) 1765 1771 ENDIF … … 1860 1866 message_string = 'If building heigths are prescribed in ' // & 1861 1867 '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 ) 1863 1869 ENDIF 1864 1870 ENDIF … … 1998 2004 message_string = 'Number of inifor grid points does not ' // & 1999 2005 '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 ) 2001 2007 ENDIF 2002 2008 ! … … 2290 2296 message_string = 'NetCDF input for u_init must not contain ' // & 2291 2297 '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 ) 2293 2299 ENDIF 2294 2300 ENDIF … … 2297 2303 message_string = 'NetCDF input for v_init must not contain ' // & 2298 2304 '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 ) 2300 2306 ENDIF 2301 2307 ENDIF … … 2304 2310 message_string = 'NetCDF input for w_init must not contain ' // & 2305 2311 '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 ) 2307 2313 ENDIF 2308 2314 ENDIF … … 2311 2317 message_string = 'NetCDF input for pt_init must not contain ' // & 2312 2318 '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 ) 2314 2320 ENDIF 2315 2321 ENDIF … … 2318 2324 message_string = 'NetCDF input for q_init must not contain ' // & 2319 2325 '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 ) 2321 2327 ENDIF 2322 2328 ENDIF … … 2741 2747 message_string = 'forcing = .TRUE. requires dynamic input file ' // & 2742 2748 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 ) 2744 2750 ENDIF 2745 2751 ! … … 2751 2757 'input file ' // TRIM( input_file_dynamic ) // & 2752 2758 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 ) 2754 2760 ENDIF 2755 2761 … … 2779 2785 INTEGER(iwp) :: i !< loop index along x-direction 2780 2786 INTEGER(iwp) :: j !< loop index along y-direction 2781 INTEGER(iwp) :: n_surf !< number of different surface types at given location2782 2787 2783 2788 LOGICAL :: check_passed !< flag indicating if a check passed … … 2792 2797 'x- and/or y-direction ' // & 2793 2798 '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 ) 2795 2800 ENDIF 2796 2801 ! … … 2802 2807 'in x- and/or y-direction ' // & 2803 2808 '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 ) 2805 2810 ENDIF 2806 2811 ! … … 2811 2816 message_string = 'NetCDF variable orography_2D is not ' // & 2812 2817 '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 ) 2814 2819 ENDIF 2815 2820 ! … … 2821 2826 message_string = 'Reading 3D building data - too much ' // & 2822 2827 '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 ) 2824 2829 ENDIF 2825 2830 … … 2828 2833 message_string = 'Reading 3D building data - vertical ' // & 2829 2834 '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 ) 2831 2836 ENDIF 2832 2837 ENDIF … … 2850 2855 'building_type, soil_type and water_type are '// & 2851 2856 '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 ) 2853 2858 ENDIF 2854 2859 ! … … 2861 2866 message_string = 'If vegegation_type = 0 at any location, ' // & 2862 2867 '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 ) 2864 2869 ENDIF 2865 2870 IF ( .NOT. root_area_density_lsm_f%from_file ) THEN 2866 2871 message_string = 'If vegegation_type = 0 at any location, ' // & 2867 2872 '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 ) 2869 2874 ENDIF 2870 2875 ENDIF … … 2886 2891 message_string = 'If soil_type = 0 at any location, ' // & 2887 2892 '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 ) 2889 2894 ENDIF 2890 2895 ENDIF … … 2896 2901 message_string = 'If building_type = 0 at any location, ' // & 2897 2902 '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 ) 2899 2904 ENDIF 2900 2905 ENDIF … … 2907 2912 message_string = 'If albedo_type = 0 at any location, ' // & 2908 2913 '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 ) 2910 2915 ENDIF 2911 2916 ENDIF … … 2918 2923 message_string = 'If pavement_type = 0 at any location, ' // & 2919 2924 '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 ) 2921 2926 ENDIF 2922 2927 ENDIF … … 2930 2935 message_string = 'If pavement_type = 0 at any location, ' // & 2931 2936 '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 ) 2933 2938 ENDIF 2934 2939 ENDIF … … 2941 2946 message_string = 'If water_type = 0 at any location, ' // & 2942 2947 '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 ) 2944 2949 ENDIF 2945 2950 ENDIF … … 2961 2966 'building_type, or water_type must be set '// & 2962 2967 '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 ) 2964 2969 ENDIF 2965 2970 ! … … 2981 2986 'location (y,x) where vegetation_type or ' // & 2982 2987 'pavement_type is a non-missing value.' 2983 CALL message( 'netcdf_data_input_mod', ' PA0999', &2988 CALL message( 'netcdf_data_input_mod', 'NDI026', & 2984 2989 2, 2, 0, 6, 0 ) 2985 2990 ENDIF 2986 2991 ENDIF 2987 2992 ! 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', & 3006 3001 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 ) 3013 3040 ENDIF 3014 3041 ! … … 3023 3050 'parameters of vegetation_pars at '// & 3024 3051 'this location must be set.' 3025 CALL message( 'netcdf_data_input_mod', ' PA0999', &3052 CALL message( 'netcdf_data_input_mod', 'NDI031', & 3026 3053 2, 2, 0, 6, 0 ) 3027 3054 ENDIF … … 3038 3065 'levels of root_area_density_lsm ' // & 3039 3066 'must be set at this location.' 3040 CALL message( 'netcdf_data_input_mod', ' PA0999', &3067 CALL message( 'netcdf_data_input_mod', 'NDI032', & 3041 3068 2, 2, 0, 6, 0 ) 3042 3069 ENDIF … … 3062 3089 message_string = 'If soil_type(y,x) = 0, all levels of ' //& 3063 3090 'soil_pars at this location must be set.' 3064 CALL message( 'netcdf_data_input_mod', ' PA0999', &3091 CALL message( 'netcdf_data_input_mod', 'NDI033', & 3065 3092 2, 2, 0, 6, 0 ) 3066 3093 ENDIF … … 3077 3104 'parameters of building_pars at this '//& 3078 3105 'location must be set.' 3079 CALL message( 'netcdf_data_input_mod', ' PA0999', &3106 CALL message( 'netcdf_data_input_mod', 'NDI034', & 3080 3107 2, 2, 0, 6, 0 ) 3081 3108 ENDIF … … 3092 3119 'urban-surface model is ' // & 3093 3120 'applied. i, j = ', i, j 3094 CALL message( 'netcdf_data_input_mod', ' PA0999', &3121 CALL message( 'netcdf_data_input_mod', 'NDI035', & 3095 3122 2, 2, 0, 6, 0 ) 3096 3123 ENDIF … … 3103 3130 'urban-surface model is ' // & 3104 3131 'applied. i, j = ', i, j 3105 CALL message( 'netcdf_data_input_mod', ' PA0999', &3132 CALL message( 'netcdf_data_input_mod', 'NDI036', & 3106 3133 2, 2, 0, 6, 0 ) 3107 3134 ENDIF … … 3118 3145 'parameters of albedo_pars at this ' // & 3119 3146 'location must be set.' 3120 CALL message( 'netcdf_data_input_mod', ' PA0999', &3147 CALL message( 'netcdf_data_input_mod', 'NDI037', & 3121 3148 2, 2, 0, 6, 0 ) 3122 3149 ENDIF … … 3134 3161 'parameters of pavement_pars at this '//& 3135 3162 'location must be set.' 3136 CALL message( 'netcdf_data_input_mod', ' PA0999', &3163 CALL message( 'netcdf_data_input_mod', 'NDI038', & 3137 3164 2, 2, 0, 6, 0 ) 3138 3165 ENDIF … … 3151 3178 'pavement_subsurface_pars at this '// & 3152 3179 'location must be set.' 3153 CALL message( 'netcdf_data_input_mod', ' PA0999', &3180 CALL message( 'netcdf_data_input_mod', 'NDI039', & 3154 3181 2, 2, 0, 6, 0 ) 3155 3182 ENDIF … … 3167 3194 'parameters of water_pars at this ' // & 3168 3195 'location must be set.' 3169 CALL message( 'netcdf_data_input_mod', ' PA0999', &3196 CALL message( 'netcdf_data_input_mod', 'NDI040', & 3170 3197 2, 2, 0, 6, 0 ) 3171 3198 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.