Changeset 1826 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Apr 7, 2016 12:01:39 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r1825 r1826 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 22 ! 21 ! Moved checks for radiation model to the respective module. 22 ! Moved checks for plant canopy model to the respective module. 23 ! Bugfix for check of too large roughness_length 24 ! 23 25 ! Former revisions: 24 26 ! ----------------- … … 349 351 USE land_surface_model_mod, & 350 352 ONLY: land_surface, lsm_check_data_output, lsm_check_data_output_pr, & 351 lsm_check_parameters, nzs, zs 353 lsm_check_parameters 354 352 355 USE kinds 353 356 USE model_1d … … 355 358 ONLY: dopr_unit, do2d_unit, do3d_unit, netcdf_data_format, & 356 359 netcdf_data_format_string 360 357 361 USE particle_attributes 358 362 USE pegrid 359 USE plant_canopy_model_mod 363 USE plant_canopy_model_mod, & 364 ONLY: pcm_check_parameters, plant_canopy 365 360 366 USE pmc_interface, & 361 367 ONLY: cpl_id, nested_run 368 362 369 USE profil_parameter 363 USE radiation_model_mod 370 USE radiation_model_mod, & 371 ONLY: radiation, radiation_check_data_output, & 372 radiation_check_data_output_pr, radiation_check_parameters 364 373 USE statistics 365 374 USE subsidence_mod … … 1022 1031 ENDIF 1023 1032 1024 IF ( plant_canopy ) THEN 1033 ! 1034 !-- When plant canopy model is used, peform addtional checks 1035 IF ( plant_canopy ) CALL pcm_check_parameters 1025 1036 1026 IF ( canopy_drag_coeff == 0.0_wp ) THEN1027 message_string = 'plant_canopy = .TRUE. requires a non-zero drag '// &1028 'coefficient & given value is canopy_drag_coeff = 0.0'1029 CALL message( 'check_parameters', 'PA0041', 1, 2, 0, 6, 0 )1030 ENDIF1031 1032 IF ( ( alpha_lad /= 9999999.9_wp .AND. beta_lad == 9999999.9_wp ) .OR.&1033 beta_lad /= 9999999.9_wp .AND. alpha_lad == 9999999.9_wp ) THEN1034 message_string = 'using the beta function for the construction ' // &1035 'of the leaf area density profile requires ' // &1036 'both alpha_lad and beta_lad to be /= 9999999.9'1037 CALL message( 'check_parameters', 'PA0118', 1, 2, 0, 6, 0 )1038 ENDIF1039 1040 IF ( calc_beta_lad_profile .AND. lai_beta == 0.0_wp ) THEN1041 message_string = 'using the beta function for the construction ' // &1042 'of the leaf area density profile requires ' // &1043 'a non-zero lai_beta, but given value is ' // &1044 'lai_beta = 0.0'1045 CALL message( 'check_parameters', 'PA0119', 1, 2, 0, 6, 0 )1046 ENDIF1047 1048 IF ( calc_beta_lad_profile .AND. lad_surface /= 0.0_wp ) THEN1049 message_string = 'simultaneous setting of alpha_lad /= 9999999.9' // &1050 'and lad_surface /= 0.0 is not possible, ' // &1051 'use either vertical gradients or the beta ' // &1052 'function for the construction of the leaf area '// &1053 'density profile'1054 CALL message( 'check_parameters', 'PA0120', 1, 2, 0, 6, 0 )1055 ENDIF1056 1057 IF ( cloud_physics .AND. microphysics_seifert ) THEN1058 message_string = 'plant_canopy = .TRUE. requires cloud_scheme /=' // &1059 ' seifert_beheng'1060 CALL message( 'check_parameters', 'PA0360', 1, 2, 0, 6, 0 )1061 ENDIF1062 1063 ENDIF1064 1065 1037 ! 1066 1038 !-- When land surface model is used, peform addtional checks 1067 1039 IF ( land_surface ) CALL lsm_check_parameters 1068 1040 1069 1070 IF ( radiation ) THEN 1071 IF ( radiation_scheme /= 'constant' .AND. & 1072 radiation_scheme /= 'clear-sky' .AND. & 1073 radiation_scheme /= 'rrtmg' ) THEN 1074 message_string = 'unknown radiation_scheme = '// & 1075 TRIM( radiation_scheme ) 1076 CALL message( 'check_parameters', 'PA0405', 1, 2, 0, 6, 0 ) 1077 ELSEIF ( radiation_scheme == 'rrtmg' ) THEN 1078 #if ! defined ( __rrtmg ) 1079 message_string = 'radiation_scheme = "rrtmg" requires ' // & 1080 'compilation of PALM with pre-processor ' // & 1081 'directive -D__rrtmg' 1082 CALL message( 'check_parameters', 'PA0407', 1, 2, 0, 6, 0 ) 1083 #endif 1084 #if defined ( __rrtmg ) && ! defined( __netcdf ) 1085 message_string = 'radiation_scheme = "rrtmg" requires ' // & 1086 'the use of NetCDF (preprocessor directive ' // & 1087 '-D__netcdf' 1088 CALL message( 'check_parameters', 'PA0412', 1, 2, 0, 6, 0 ) 1089 #endif 1090 1091 ENDIF 1092 IF ( albedo_type == 0 .AND. albedo == 9999999.9_wp .AND. & 1093 radiation_scheme == 'clear-sky') THEN 1094 message_string = 'radiation_scheme = "clear-sky" in combination' // & 1095 'with albedo_type = 0 requires setting of albedo'// & 1096 ' /= 9999999.9' 1097 CALL message( 'check_parameters', 'PA0410', 1, 2, 0, 6, 0 ) 1098 ENDIF 1099 IF ( albedo_type == 0 .AND. radiation_scheme == 'rrtmg' .AND. & 1100 ( albedo_lw_dif == 9999999.9_wp .OR. albedo_lw_dir == 9999999.9_wp& 1101 .OR. albedo_sw_dif == 9999999.9_wp .OR. albedo_sw_dir == 9999999.9_wp& 1102 ) ) THEN 1103 message_string = 'radiation_scheme = "rrtmg" in combination' // & 1104 'with albedo_type = 0 requires setting of ' // & 1105 'albedo_lw_dif /= 9999999.9' // & 1106 'albedo_lw_dir /= 9999999.9' // & 1107 'albedo_sw_dif /= 9999999.9 and' // & 1108 'albedo_sw_dir /= 9999999.9' 1109 CALL message( 'check_parameters', 'PA0411', 1, 2, 0, 6, 0 ) 1110 ENDIF 1111 IF ( topography /= 'flat' ) THEN 1112 message_string = 'radiation scheme cannot be used ' // & 1113 'in combination with topography /= "flat"' 1114 CALL message( 'check_parameters', 'PA0414', 1, 2, 0, 6, 0 ) 1115 ENDIF 1116 ENDIF 1041 ! 1042 !-- When radiation model is used, peform addtional checks 1043 IF ( radiation ) CALL radiation_check_parameters 1117 1044 1118 1045 IF ( .NOT. ( loop_optimization == 'cache' .OR. & … … 2980 2907 ENDIF 2981 2908 2982 CASE ( 'rad_net' ) 2983 IF ( ( .NOT. radiation ) .OR. radiation_scheme == 'constant' )& 2984 THEN 2985 message_string = 'data_output_pr = ' // & 2986 TRIM( data_output_pr(i) ) // ' is not ava' // & 2987 'lable for radiation = .FALSE. or ' // & 2988 'radiation_scheme = "constant"' 2989 CALL message( 'check_parameters', 'PA0408', 1, 2, 0, 6, 0 ) 2990 ELSE 2991 dopr_index(i) = 101 2992 dopr_unit(i) = 'W/m2' 2993 hom(:,2,101,:) = SPREAD( zw, 2, statistic_regions+1 ) 2994 ENDIF 2995 2996 CASE ( 'rad_lw_in' ) 2997 IF ( ( .NOT. radiation) .OR. radiation_scheme == 'constant' ) & 2998 THEN 2999 message_string = 'data_output_pr = ' // & 3000 TRIM( data_output_pr(i) ) // ' is not ava' // & 3001 'lable for radiation = .FALSE. or ' // & 3002 'radiation_scheme = "constant"' 3003 CALL message( 'check_parameters', 'PA0408', 1, 2, 0, 6, 0 ) 3004 ELSE 3005 dopr_index(i) = 102 3006 dopr_unit(i) = 'W/m2' 3007 hom(:,2,102,:) = SPREAD( zw, 2, statistic_regions+1 ) 3008 ENDIF 3009 3010 CASE ( 'rad_lw_out' ) 3011 IF ( ( .NOT. radiation ) .OR. radiation_scheme == 'constant' ) & 3012 THEN 3013 message_string = 'data_output_pr = ' // & 3014 TRIM( data_output_pr(i) ) // ' is not ava' // & 3015 'lable for radiation = .FALSE. or ' // & 3016 'radiation_scheme = "constant"' 3017 CALL message( 'check_parameters', 'PA0408', 1, 2, 0, 6, 0 ) 3018 ELSE 3019 dopr_index(i) = 103 3020 dopr_unit(i) = 'W/m2' 3021 hom(:,2,103,:) = SPREAD( zw, 2, statistic_regions+1 ) 3022 ENDIF 3023 3024 CASE ( 'rad_sw_in' ) 3025 IF ( ( .NOT. radiation ) .OR. radiation_scheme == 'constant' ) & 3026 THEN 3027 message_string = 'data_output_pr = ' // & 3028 TRIM( data_output_pr(i) ) // ' is not ava' // & 3029 'lable for radiation = .FALSE. or ' // & 3030 'radiation_scheme = "constant"' 3031 CALL message( 'check_parameters', 'PA0408', 1, 2, 0, 6, 0 ) 3032 ELSE 3033 dopr_index(i) = 104 3034 dopr_unit(i) = 'W/m2' 3035 hom(:,2,104,:) = SPREAD( zw, 2, statistic_regions+1 ) 3036 ENDIF 3037 3038 CASE ( 'rad_sw_out') 3039 IF ( ( .NOT. radiation ) .OR. radiation_scheme == 'constant' ) & 3040 THEN 3041 message_string = 'data_output_pr = ' // & 3042 TRIM( data_output_pr(i) ) // ' is not ava' // & 3043 'lable for radiation = .FALSE. or ' // & 3044 'radiation_scheme = "constant"' 3045 CALL message( 'check_parameters', 'PA0408', 1, 2, 0, 6, 0 ) 3046 ELSE 3047 dopr_index(i) = 105 3048 dopr_unit(i) = 'W/m2' 3049 hom(:,2,105,:) = SPREAD( zw, 2, statistic_regions+1 ) 3050 ENDIF 3051 3052 CASE ( 'rad_lw_cs_hr' ) 3053 IF ( ( .NOT. radiation ) .OR. radiation_scheme /= 'rrtmg' ) & 3054 THEN 3055 message_string = 'data_output_pr = ' // & 3056 TRIM( data_output_pr(i) ) // ' is not ava' // & 3057 'lable for radiation = .FALSE. or ' // & 3058 'radiation_scheme /= "rrtmg"' 3059 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3060 ELSE 3061 dopr_index(i) = 106 3062 dopr_unit(i) = 'K/h' 3063 hom(:,2,106,:) = SPREAD( zu, 2, statistic_regions+1 ) 3064 ENDIF 3065 3066 CASE ( 'rad_lw_hr' ) 3067 IF ( ( .NOT. radiation ) .OR. radiation_scheme /= 'rrtmg' ) & 3068 THEN 3069 message_string = 'data_output_pr = ' // & 3070 TRIM( data_output_pr(i) ) // ' is not ava' // & 3071 'lable for radiation = .FALSE. or ' // & 3072 'radiation_scheme /= "rrtmg"' 3073 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3074 ELSE 3075 dopr_index(i) = 107 3076 dopr_unit(i) = 'K/h' 3077 hom(:,2,107,:) = SPREAD( zu, 2, statistic_regions+1 ) 3078 ENDIF 3079 3080 CASE ( 'rad_sw_cs_hr' ) 3081 IF ( ( .NOT. radiation ) .OR. radiation_scheme /= 'rrtmg' ) & 3082 THEN 3083 message_string = 'data_output_pr = ' // & 3084 TRIM( data_output_pr(i) ) // ' is not ava' // & 3085 'lable for radiation = .FALSE. or ' // & 3086 'radiation_scheme /= "rrtmg"' 3087 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3088 ELSE 3089 dopr_index(i) = 108 3090 dopr_unit(i) = 'K/h' 3091 hom(:,2,108,:) = SPREAD( zu, 2, statistic_regions+1 ) 3092 ENDIF 3093 3094 CASE ( 'rad_sw_hr' ) 3095 IF ( ( .NOT. radiation ) .OR. radiation_scheme /= 'rrtmg' ) & 3096 THEN 3097 message_string = 'data_output_pr = ' // & 3098 TRIM( data_output_pr(i) ) // ' is not ava' // & 3099 'lable for radiation = .FALSE. or ' // & 3100 'radiation_scheme /= "rrtmg"' 3101 CALL message( 'check_parameters', 'PA0413', 1, 2, 0, 6, 0 ) 3102 ELSE 3103 dopr_index(i) = 109 3104 dopr_unit(i) = 'K/h' 3105 hom(:,2,109,:) = SPREAD( zu, 2, statistic_regions+1 ) 3106 ENDIF 2909 3107 2910 3108 2911 CASE DEFAULT 3109 2912 3110 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit, dopr_unit(i) ) 3111 2913 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit, & 2914 dopr_unit(i) ) 2915 2916 IF ( unit == 'illegal' ) THEN 2917 CALL radiation_check_data_output_pr( data_output_pr(i), i, & 2918 unit, dopr_unit(i) ) 2919 ENDIF 2920 3112 2921 IF ( unit == 'illegal' ) THEN 3113 2922 CALL user_check_data_output_pr( data_output_pr(i), i, unit ) … … 3288 3097 unit = 'kg/kg' 3289 3098 3290 CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_lw_cs_hr', 'rad_lw_hr', &3291 'rad_sw_in', 'rad_sw_out', 'rad_sw_cs_hr', 'rad_sw_hr' )3292 IF ( .NOT. radiation .OR. radiation_scheme /= 'rrtmg' ) THEN3293 message_string = '"output of "' // TRIM( var ) // '" requi' // &3294 'res radiation = .TRUE. and ' // &3295 'radiation_scheme = "rrtmg"'3296 CALL message( 'check_parameters', 'PA0406', 1, 2, 0, 6, 0 )3297 ENDIF3298 unit = 'W/m2'3299 3300 3099 CASE ( 'rho' ) 3301 3100 IF ( .NOT. ocean ) THEN … … 3330 3129 CONTINUE 3331 3130 3332 CASE ( 'lai*', 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'rad_net*', & 3333 'rrtm_aldif*', 'rrtm_aldir*', 'rrtm_asdif*', 'rrtm_asdir*', & 3334 'shf*', 't*', 'u*', 'z0*', 'z0h*', 'z0q*' ) 3131 CASE ( 'lai*', 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'shf*', 't*', & 3132 'u*', 'z0*', 'z0h*', 'z0q*' ) 3335 3133 IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN 3336 3134 message_string = 'illegal value for data_output: "' // & … … 3339 3137 CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) 3340 3138 ENDIF 3341 IF ( .NOT. radiation .OR. radiation_scheme /= "rrtmg" ) THEN 3342 IF ( TRIM( var ) == 'rrtm_aldif*' .OR. & 3343 TRIM( var ) == 'rrtm_aldir*' .OR. & 3344 TRIM( var ) == 'rrtm_asdif*' .OR. & 3345 TRIM( var ) == 'rrtm_asdir*' ) & 3346 THEN 3347 message_string = 'output of "' // TRIM( var ) // '" require'& 3348 // 's radiation = .TRUE. and radiation_sch'& 3349 // 'eme = "rrtmg"' 3350 CALL message( 'check_parameters', 'PA0409', 1, 2, 0, 6, 0 ) 3351 ENDIF 3352 ENDIF 3353 IF ( TRIM( var ) == 'lai*' .AND. .NOT. land_surface ) THEN 3354 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3355 'res land_surface = .TRUE.' 3356 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3357 ENDIF 3139 3358 3140 IF ( TRIM( var ) == 'lwp*' .AND. .NOT. cloud_physics ) THEN 3359 3141 message_string = 'output of "' // TRIM( var ) // '" requi' // & … … 3384 3166 ENDIF 3385 3167 3386 IF ( TRIM( var ) == 'lai*' ) unit = 'none'3387 3168 IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/m2' 3388 3169 IF ( TRIM( var ) == 'ol*' ) unit = 'm' … … 3390 3171 IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' 3391 3172 IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' 3392 IF ( TRIM( var ) == 'rad_net*' ) unit = 'W/m2'3393 IF ( TRIM( var ) == 'rrtm_aldif*' ) unit = ''3394 IF ( TRIM( var ) == 'rrtm_aldir*' ) unit = ''3395 IF ( TRIM( var ) == 'rrtm_asdif*' ) unit = ''3396 IF ( TRIM( var ) == 'rrtm_asdir*' ) unit = ''3397 3173 IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' 3398 3174 IF ( TRIM( var ) == 't*' ) unit = 'K' … … 3404 3180 3405 3181 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3406 3182 3183 IF ( unit == 'illegal' ) THEN 3184 CALL radiation_check_data_output( var, unit, i, ilen, k ) 3185 ENDIF 3186 3407 3187 IF ( unit == 'illegal' ) THEN 3408 3188 CALL user_check_data_output( var, unit ) … … 4073 3853 ENDIF 4074 3854 3855 CALL location_message( 'finished', .TRUE. ) 3856 4075 3857 ! 4076 3858 !-- Prevent empty time records in volume, cross-section and masked data in case of … … 4100 3882 IF ( ( constant_flux_layer .OR. & 4101 3883 INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) & 4102 .AND. roughness_length <=0.5 * dz ) THEN3884 .AND. roughness_length > 0.5 * dz ) THEN 4103 3885 message_string = 'roughness_length must be smaller than dz/2' 4104 3886 CALL message( 'check_parameters', 'PA0424', 1, 2, 0, 6, 0 )
Note: See TracChangeset
for help on using the changeset viewer.