Changeset 3053 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
 Timestamp:
 Jun 1, 2018 12:59:07 PM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/netcdf_data_input_mod.f90
r3051 r3053 25 25 !  26 26 ! $Id$ 27 ! Revise checks for variable surface_fraction 28 ! 29 ! 3051 20180530 17:43:55Z suehring 27 30 !  Speedup NetCDF input 28 31 !  Revise input routines and remove NetCDF input via IOblocks since this is … … 955 958 ENDIF 956 959 ! 957 ! Read surface fractions and related information960 ! Read relative surface fractions of vegetation, pavement and water. 958 961 IF ( check_existence( var_names, 'surface_fraction' ) ) THEN 959 962 surface_fraction_f%from_file = .TRUE. … … 3061 3064 3062 3065 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 3065 3074 message_string = 'If more than one surface type is ' // & 3066 3075 'given at a location, surface_fraction ' // & … … 3069 3078 2, 2, 0, 6, 0 ) 3070 3079 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. 3071 3088 IF ( SUM ( surface_fraction_f%frac(:,j,i) ) > 1.0_wp ) THEN 3072 3089 message_string = 'surface_fraction must not exceed 1' … … 3074 3091 2, 2, 0, 6, 0 ) 3075 3092 ENDIF 3076 ENDIF 3077 ! 3078 ! Check for further mismatches, e.g. vegetation_type is set but3079 ! 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.& 3081 3098 ( surface_fraction_f%frac(ind_veg_wall,j,i) == 0.0_wp .OR. & 3082 3099 surface_fraction_f%frac(ind_veg_wall,j,i) == & … … 3093 3110 surface_fraction_f%fill ) & 3094 3111 ) ) THEN 3095 WRITE( message_string, * ) 'Mismatch in setting of ' //&3112 WRITE( message_string, * ) 'Mismatch in setting of ' // & 3096 3113 'surface_fraction. Vegetation, pavement, or '// & 3097 3114 'water surface is given at (i,j) = ( ', i, j, & 3098 3115 ' ), 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 nonzero. 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 nonzero values 3121 ! if this type is not set. 3122 IF ( & 3123 ( vegetation_type_f%var(j,i) == vegetation_type_f%fill .AND.& 3106 3124 ( surface_fraction_f%frac(ind_veg_wall,j,i) /= 0.0_wp .AND. & 3107 3125 surface_fraction_f%frac(ind_veg_wall,j,i) /= & … … 3118 3136 surface_fraction_f%fill ) & 3119 3137 ) ) THEN 3120 WRITE( message_string, * ) 'Mismatch in setting of ' //&3138 WRITE( message_string, * ) 'Mismatch in setting of ' // & 3121 3139 'surface_fraction. Vegetation, pavement, or '// & 3122 3140 'water surface is not given at (i,j) = ( ', i, j, & 3123 3141 ' ), but surface fraction is not 0 for the ' // & 3124 3142 '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 3127 3146 ENDIF 3128 3147 !
Note: See TracChangeset
for help on using the changeset viewer.