Changeset 1817 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Apr 6, 2016 3:44:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r1812 r1817 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Moved checks for land_surface model to the respective module 22 22 ! 23 23 ! Former revisions: … … 330 330 USE grid_variables 331 331 USE indices 332 USE land_surface_model_mod 332 USE land_surface_model_mod, & 333 ONLY: land_surface, lsm_check_data_output, lsm_check_data_output_pr, & 334 lsm_check_parameters, nzs, zs 333 335 USE kinds 334 336 USE model_1d … … 1035 1037 ENDIF 1036 1038 1037 1038 IF ( land_surface ) THEN 1039 1040 ! 1041 !-- Dirichlet boundary conditions are required as the surface fluxes are 1042 !-- calculated from the temperature/humidity gradients in the land surface 1043 !-- model 1044 IF ( bc_pt_b == 'neumann' .OR. bc_q_b == 'neumann' ) THEN 1045 message_string = 'lsm requires setting of'// & 1046 'bc_pt_b = "dirichlet" and '// & 1047 'bc_q_b = "dirichlet"' 1048 CALL message( 'check_parameters', 'PA0399', 1, 2, 0, 6, 0 ) 1049 ENDIF 1050 1051 IF ( .NOT. constant_flux_layer ) THEN 1052 message_string = 'lsm requires '// & 1053 'constant_flux_layer = .T.' 1054 CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 ) 1055 ENDIF 1056 1057 IF ( topography /= 'flat' ) THEN 1058 message_string = 'lsm cannot be used ' // & 1059 'in combination with topography /= "flat"' 1060 CALL message( 'check_parameters', 'PA0415', 1, 2, 0, 6, 0 ) 1061 ENDIF 1062 1063 IF ( ( veg_type == 14 .OR. veg_type == 15 ) .AND. & 1064 most_method == 'lookup' ) THEN 1065 WRITE( message_string, * ) 'veg_type = ', veg_type, ' is not ', & 1066 'allowed in combination with ', & 1067 'most_method = ', most_method 1068 CALL message( 'check_parameters', 'PA0417', 1, 2, 0, 6, 0 ) 1069 ENDIF 1070 1071 IF ( veg_type == 0 ) THEN 1072 IF ( SUM( root_fraction ) /= 1.0_wp ) THEN 1073 message_string = 'veg_type = 0 (user_defined)'// & 1074 'requires setting of root_fraction(0:3)'// & 1075 '/= 9999999.9 and SUM(root_fraction) = 1' 1076 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1077 ENDIF 1078 1079 IF ( min_canopy_resistance == 9999999.9_wp ) THEN 1080 message_string = 'veg_type = 0 (user defined)'// & 1081 'requires setting of min_canopy_resistance'// & 1082 '/= 9999999.9' 1083 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1084 ENDIF 1085 1086 IF ( leaf_area_index == 9999999.9_wp ) THEN 1087 message_string = 'veg_type = 0 (user_defined)'// & 1088 'requires setting of leaf_area_index'// & 1089 '/= 9999999.9' 1090 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1091 ENDIF 1092 1093 IF ( vegetation_coverage == 9999999.9_wp ) THEN 1094 message_string = 'veg_type = 0 (user_defined)'// & 1095 'requires setting of vegetation_coverage'// & 1096 '/= 9999999.9' 1097 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1098 ENDIF 1099 1100 IF ( canopy_resistance_coefficient == 9999999.9_wp) THEN 1101 message_string = 'veg_type = 0 (user_defined)'// & 1102 'requires setting of'// & 1103 'canopy_resistance_coefficient /= 9999999.9' 1104 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1105 ENDIF 1106 1107 IF ( lambda_surface_stable == 9999999.9_wp ) THEN 1108 message_string = 'veg_type = 0 (user_defined)'// & 1109 'requires setting of lambda_surface_stable'// & 1110 '/= 9999999.9' 1111 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1112 ENDIF 1113 1114 IF ( lambda_surface_unstable == 9999999.9_wp ) THEN 1115 message_string = 'veg_type = 0 (user_defined)'// & 1116 'requires setting of lambda_surface_unstable'// & 1117 '/= 9999999.9' 1118 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1119 ENDIF 1120 1121 IF ( f_shortwave_incoming == 9999999.9_wp ) THEN 1122 message_string = 'veg_type = 0 (user_defined)'// & 1123 'requires setting of f_shortwave_incoming'// & 1124 '/= 9999999.9' 1125 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1126 ENDIF 1127 1128 IF ( z0_eb == 9999999.9_wp ) THEN 1129 message_string = 'veg_type = 0 (user_defined)'// & 1130 'requires setting of z0_eb'// & 1131 '/= 9999999.9' 1132 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1133 ENDIF 1134 1135 IF ( z0h_eb == 9999999.9_wp ) THEN 1136 message_string = 'veg_type = 0 (user_defined)'// & 1137 'requires setting of z0h_eb'// & 1138 '/= 9999999.9' 1139 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) 1140 ENDIF 1141 1142 1143 ENDIF 1144 1145 IF ( soil_type == 0 ) THEN 1146 1147 IF ( alpha_vangenuchten == 9999999.9_wp ) THEN 1148 message_string = 'soil_type = 0 (user_defined)'// & 1149 'requires setting of alpha_vangenuchten'// & 1150 '/= 9999999.9' 1151 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1152 ENDIF 1153 1154 IF ( l_vangenuchten == 9999999.9_wp ) THEN 1155 message_string = 'soil_type = 0 (user_defined)'// & 1156 'requires setting of l_vangenuchten'// & 1157 '/= 9999999.9' 1158 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1159 ENDIF 1160 1161 IF ( n_vangenuchten == 9999999.9_wp ) THEN 1162 message_string = 'soil_type = 0 (user_defined)'// & 1163 'requires setting of n_vangenuchten'// & 1164 '/= 9999999.9' 1165 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1166 ENDIF 1167 1168 IF ( hydraulic_conductivity == 9999999.9_wp ) THEN 1169 message_string = 'soil_type = 0 (user_defined)'// & 1170 'requires setting of hydraulic_conductivity'// & 1171 '/= 9999999.9' 1172 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1173 ENDIF 1174 1175 IF ( saturation_moisture == 9999999.9_wp ) THEN 1176 message_string = 'soil_type = 0 (user_defined)'// & 1177 'requires setting of saturation_moisture'// & 1178 '/= 9999999.9' 1179 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1180 ENDIF 1181 1182 IF ( field_capacity == 9999999.9_wp ) THEN 1183 message_string = 'soil_type = 0 (user_defined)'// & 1184 'requires setting of field_capacity'// & 1185 '/= 9999999.9' 1186 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1187 ENDIF 1188 1189 IF ( wilting_point == 9999999.9_wp ) THEN 1190 message_string = 'soil_type = 0 (user_defined)'// & 1191 'requires setting of wilting_point'// & 1192 '/= 9999999.9' 1193 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1194 ENDIF 1195 1196 IF ( residual_moisture == 9999999.9_wp ) THEN 1197 message_string = 'soil_type = 0 (user_defined)'// & 1198 'requires setting of residual_moisture'// & 1199 '/= 9999999.9' 1200 CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) 1201 ENDIF 1202 1203 ENDIF 1204 1205 IF ( .NOT. radiation ) THEN 1206 message_string = 'lsm requires '// & 1207 'radiation = .T.' 1208 CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 ) 1209 ENDIF 1210 1211 END IF 1039 ! 1040 !-- When land surface model is used, peform addtional checks 1041 IF ( land_surface ) CALL lsm_check_parameters 1042 1212 1043 1213 1044 IF ( radiation ) THEN … … 3144 2975 ENDIF 3145 2976 3146 CASE ( 't_soil', '#t_soil' )3147 IF ( .NOT. land_surface ) THEN3148 message_string = 'data_output_pr = ' // &3149 TRIM( data_output_pr(i) ) // ' is not imp' // &3150 'lemented for land_surface = .FALSE.'3151 CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 )3152 ELSE3153 dopr_index(i) = 893154 dopr_unit(i) = 'K'3155 hom(0:nzs-1,2,89,:) = SPREAD( - zs, 2, statistic_regions+1 )3156 IF ( data_output_pr(i)(1:1) == '#' ) THEN3157 dopr_initial_index(i) = 903158 hom(0:nzs-1,2,90,:) = SPREAD( - zs, 2, statistic_regions+1 )3159 data_output_pr(i) = data_output_pr(i)(2:)3160 ENDIF3161 ENDIF3162 3163 CASE ( 'm_soil', '#m_soil' )3164 IF ( .NOT. land_surface ) THEN3165 message_string = 'data_output_pr = ' // &3166 TRIM( data_output_pr(i) ) // ' is not imp' // &3167 'lemented for land_surface = .FALSE.'3168 CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 )3169 ELSE3170 dopr_index(i) = 913171 dopr_unit(i) = 'm3/m3'3172 hom(0:nzs-1,2,91,:) = SPREAD( - zs, 2, statistic_regions+1 )3173 IF ( data_output_pr(i)(1:1) == '#' ) THEN3174 dopr_initial_index(i) = 923175 hom(0:nzs-1,2,92,:) = SPREAD( - zs, 2, statistic_regions+1 )3176 data_output_pr(i) = data_output_pr(i)(2:)3177 ENDIF3178 ENDIF3179 3180 2977 CASE ( 'rad_net' ) 3181 2978 IF ( ( .NOT. radiation ) .OR. radiation_scheme == 'constant' )& … … 3306 3103 CASE DEFAULT 3307 3104 3308 CALL user_check_data_output_pr( data_output_pr(i), i, unit ) 3105 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit, dopr_unit(i) ) 3106 3107 IF ( unit == 'illegal' ) THEN 3108 CALL user_check_data_output_pr( data_output_pr(i), i, unit ) 3109 ENDIF 3309 3110 3310 3111 IF ( unit == 'illegal' ) THEN … … 3394 3195 unit = 'K' 3395 3196 3396 CASE ( 'm_soil' )3397 IF ( .NOT. land_surface ) THEN3398 message_string = 'output of "' // TRIM( var ) // '" requi' // &3399 'land_surface = .TRUE.'3400 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )3401 ENDIF3402 unit = 'm3/m3'3403 3404 3197 CASE ( 'nr' ) 3405 3198 IF ( .NOT. cloud_physics ) THEN … … 3536 3329 unit = 'psu' 3537 3330 3538 CASE ( 't_soil' ) 3539 IF ( .NOT. land_surface ) THEN 3540 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3541 'land_surface = .TRUE.' 3542 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3543 ENDIF 3544 unit = 'K' 3545 3546 3547 CASE ( 'c_liq*', 'c_soil*', 'c_veg*', 'ghf_eb*', 'lai*', 'lwp*', & 3548 'm_liq_eb*', 'ol*', 'pra*', 'prr*', 'qsws*', 'qsws_eb*', & 3549 'qsws_liq_eb*', 'qsws_soil_eb*', 'qsws_veg_eb*', 'rad_net*', & 3331 CASE ( 'p', 'pt', 'u', 'v', 'w' ) 3332 IF ( TRIM( var ) == 'p' ) unit = 'Pa' 3333 IF ( TRIM( var ) == 'pt' ) unit = 'K' 3334 IF ( TRIM( var ) == 'u' ) unit = 'm/s' 3335 IF ( TRIM( var ) == 'v' ) unit = 'm/s' 3336 IF ( TRIM( var ) == 'w' ) unit = 'm/s' 3337 CONTINUE 3338 3339 CASE ( 'lai*', 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'rad_net*', & 3550 3340 'rrtm_aldif*', 'rrtm_aldir*', 'rrtm_asdif*', 'rrtm_asdir*', & 3551 'r_a*', 'r_s*', 'shf*', 'shf_eb*', 't*', 'u*', 'z0*', 'z0h*', & 3552 'z0q*' ) 3341 'shf*', 't*', 'u*', 'z0*', 'z0h*', 'z0q*' ) 3553 3342 IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN 3554 3343 message_string = 'illegal value for data_output: "' // & … … 3569 3358 ENDIF 3570 3359 ENDIF 3571 3572 IF ( TRIM( var ) == 'c_liq*' .AND. .NOT. land_surface ) THEN3573 message_string = 'output of "' // TRIM( var ) // '" requi' // &3574 'res land_surface = .TRUE.'3575 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )3576 ENDIF3577 IF ( TRIM( var ) == 'c_soil*' .AND. .NOT. land_surface ) THEN3578 message_string = 'output of "' // TRIM( var ) // '" requi' // &3579 'res land_surface = .TRUE.'3580 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )3581 ENDIF3582 IF ( TRIM( var ) == 'c_veg*' .AND. .NOT. land_surface ) THEN3583 message_string = 'output of "' // TRIM( var ) // '" requi' // &3584 'res land_surface = .TRUE.'3585 CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 )3586 ENDIF3587 IF ( TRIM( var ) == 'ghf_eb*' .AND. .NOT. land_surface ) THEN3588 message_string = 'output of "' // TRIM( var ) // '" requi' // &3589 'res land_surface = .TRUE.'3590 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )3591 ENDIF3592 3360 IF ( TRIM( var ) == 'lai*' .AND. .NOT. land_surface ) THEN 3593 3361 message_string = 'output of "' // TRIM( var ) // '" requi' // & … … 3600 3368 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3601 3369 ENDIF 3602 IF ( TRIM( var ) == 'm_liq_eb*' .AND. .NOT. land_surface ) THEN3603 message_string = 'output of "' // TRIM( var ) // '" requi' // &3604 'res land_surface = .TRUE.'3605 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )3606 ENDIF3607 3370 IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN 3608 3371 message_string = 'output of "' // TRIM( var ) // '" requi' // & … … 3625 3388 CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 ) 3626 3389 ENDIF 3627 IF ( TRIM( var ) == 'qsws_eb*' .AND. .NOT. land_surface ) THEN 3628 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3629 'res land_surface = .TRUE.' 3630 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3631 ENDIF 3632 IF ( TRIM( var ) == 'qsws_liq_eb*' .AND. .NOT. land_surface ) & 3633 THEN 3634 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3635 'res land_surface = .TRUE.' 3636 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3637 ENDIF 3638 IF ( TRIM( var ) == 'qsws_soil_eb*' .AND. .NOT. land_surface ) & 3639 THEN 3640 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3641 'res land_surface = .TRUE.' 3642 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3643 ENDIF 3644 IF ( TRIM( var ) == 'qsws_veg_eb*' .AND. .NOT. land_surface ) & 3645 THEN 3646 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3647 'res land_surface = .TRUE.' 3648 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3649 ENDIF 3650 IF ( TRIM( var ) == 'r_a*' .AND. .NOT. land_surface ) & 3651 THEN 3652 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3653 'res land_surface = .TRUE.' 3654 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3655 ENDIF 3656 IF ( TRIM( var ) == 'r_s*' .AND. .NOT. land_surface ) & 3657 THEN 3658 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3659 'res land_surface = .TRUE.' 3660 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 3661 ENDIF 3662 3663 IF ( TRIM( var ) == 'c_liq*' ) unit = 'none' 3664 IF ( TRIM( var ) == 'c_soil*') unit = 'none' 3665 IF ( TRIM( var ) == 'c_veg*' ) unit = 'none' 3666 IF ( TRIM( var ) == 'ghf_eb*') unit = 'W/m2' 3390 3667 3391 IF ( TRIM( var ) == 'lai*' ) unit = 'none' 3668 3392 IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/m2' 3669 IF ( TRIM( var ) == 'm_liq_eb*' ) unit = 'm'3670 3393 IF ( TRIM( var ) == 'ol*' ) unit = 'm' 3671 3394 IF ( TRIM( var ) == 'pra*' ) unit = 'mm' 3672 3395 IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' 3673 3396 IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' 3674 IF ( TRIM( var ) == 'qsws_eb*' ) unit = 'W/m2'3675 IF ( TRIM( var ) == 'qsws_liq_eb*' ) unit = 'W/m2'3676 IF ( TRIM( var ) == 'qsws_soil_eb*' ) unit = 'W/m2'3677 IF ( TRIM( var ) == 'qsws_veg_eb*' ) unit = 'W/m2'3678 3397 IF ( TRIM( var ) == 'rad_net*' ) unit = 'W/m2' 3679 3398 IF ( TRIM( var ) == 'rrtm_aldif*' ) unit = '' … … 3681 3400 IF ( TRIM( var ) == 'rrtm_asdif*' ) unit = '' 3682 3401 IF ( TRIM( var ) == 'rrtm_asdir*' ) unit = '' 3683 IF ( TRIM( var ) == 'r_a*') unit = 's/m'3684 IF ( TRIM( var ) == 'r_s*') unit = 's/m'3685 3402 IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' 3686 IF ( TRIM( var ) == 'shf_eb*') unit = 'W/m2'3687 3403 IF ( TRIM( var ) == 't*' ) unit = 'K' 3688 3404 IF ( TRIM( var ) == 'u*' ) unit = 'm/s' 3689 3405 IF ( TRIM( var ) == 'z0*' ) unit = 'm' 3690 IF ( TRIM( var ) == 'z0h*' ) unit = 'm' 3691 3692 3693 CASE ( 'p', 'pt', 'u', 'v', 'w' ) 3694 IF ( TRIM( var ) == 'p' ) unit = 'Pa' 3695 IF ( TRIM( var ) == 'pt' ) unit = 'K' 3696 IF ( TRIM( var ) == 'u' ) unit = 'm/s' 3697 IF ( TRIM( var ) == 'v' ) unit = 'm/s' 3698 IF ( TRIM( var ) == 'w' ) unit = 'm/s' 3699 CONTINUE 3700 3406 IF ( TRIM( var ) == 'z0h*' ) unit = 'm' 3407 3701 3408 CASE DEFAULT 3702 3409 3703 CALL user_check_data_output( var, unit ) 3410 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3411 3412 IF ( unit == 'illegal' ) THEN 3413 CALL user_check_data_output( var, unit ) 3414 ENDIF 3704 3415 3705 3416 IF ( unit == 'illegal' ) THEN
Note: See TracChangeset
for help on using the changeset viewer.