Changeset 3294 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Oct 1, 2018 2:37:10 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r3274 r3294 25 25 ! ----------------- 26 26 ! $Id: check_parameters.f90 2520 2017-10-05 13:50:26Z gronemeier & 27 ! changes concerning modularization of ocean option, 28 ! init_vertical_profiles moved to separate file to avoid circular dependency 29 ! 30 ! 2520 2017-10-05 13:50:26Z gronemeier 27 31 ! Modularization of all bulk cloud physics code components 28 32 ! … … 669 673 USE arrays_3d 670 674 675 USE basic_constants_and_equations_mod 676 671 677 USE bulk_cloud_model_mod, & 672 678 ONLY: bulk_cloud_model, bcm_check_parameters, bcm_check_data_output, & … … 676 682 ONLY: chem_boundary_conds, chem_check_data_output, & 677 683 chem_check_data_output_pr, chem_species 684 678 685 USE chem_modules 679 USE basic_constants_and_equations_mod 686 680 687 USE control_parameters 688 681 689 USE dvrp_variables 690 682 691 USE grid_variables 692 683 693 USE gust_mod, & 684 694 ONLY: gust_check_data_output, gust_check_data_output_pr, & 685 695 gust_check_parameters, gust_module_enabled 696 697 USE kinds 698 686 699 USE indices 700 687 701 USE land_surface_model_mod, & 688 702 ONLY: lsm_check_data_output, lsm_check_data_output_pr, & … … 691 705 USE lsf_nudging_mod, & 692 706 ONLY: lsf_nudging_check_parameters, lsf_nudging_check_data_output_pr 693 694 USE kinds695 707 696 708 USE model_1d_mod, & … … 706 718 waterflux_output_unit, momentumflux_output_unit 707 719 720 USE ocean_mod, & 721 ONLY: ocean_check_data_output, ocean_check_data_output_pr, & 722 ocean_check_parameters 723 708 724 USE particle_attributes 725 709 726 USE pegrid 727 710 728 USE plant_canopy_model_mod, & 711 729 ONLY: pcm_check_data_output, pcm_check_parameters … … 715 733 716 734 USE profil_parameter 735 717 736 USE radiation_model_mod, & 718 737 ONLY: radiation, radiation_check_data_output, & 719 738 radiation_check_data_output_pr, radiation_check_parameters 739 720 740 USE spectra_mod, & 721 741 ONLY: calculate_spectra, spectra_check_parameters 742 722 743 USE statistics 744 723 745 USE subsidence_mod 746 724 747 USE statistics 748 725 749 USE synthetic_turbulence_generator_mod, & 726 750 ONLY: stg_check_parameters 751 727 752 USE transpose_indices 753 728 754 USE turbulence_closure_mod, & 729 755 ONLY: tcm_check_data_output, tcm_check_parameters 756 730 757 USE urban_surface_mod, & 731 758 ONLY: usm_check_data_output, usm_check_parameters 759 732 760 USE uv_exposure_model_mod, & 733 761 ONLY: uvem_check_data_output 762 734 763 USE wind_turbine_model_mod, & 735 764 ONLY: wtm_check_parameters 765 736 766 USE vertical_nesting_mod, & 737 767 ONLY: vnested, vnest_check_parameters … … 1083 1113 1084 1114 ! 1085 !-- Check turbulence closure setup1086 CALL tcm_check_parameters1087 1088 !1089 1115 !-- Check approximation 1090 1116 IF ( TRIM( approximation ) /= 'boussinesq' .AND. & … … 1127 1153 CALL message( 'check_parameters', 'PA0450', 1, 2, 0, 6, 0 ) 1128 1154 ENDIF 1155 ! 1129 1156 !-- Set flux input mode according to approximation if applicable 1130 1157 IF ( TRIM( flux_input_mode ) == 'approximation-specific' ) THEN … … 1145 1172 CALL message( 'check_parameters', 'PA0451', 1, 2, 0, 6, 0 ) 1146 1173 ENDIF 1174 ! 1147 1175 !-- Set flux output mode according to approximation if applicable 1148 1176 IF ( TRIM( flux_output_mode ) == 'approximation-specific' ) THEN … … 1163 1191 1164 1192 ! 1165 !-- set the flux output units according to flux_output_mode1193 !-- Set the flux output units according to flux_output_mode 1166 1194 IF ( TRIM( flux_output_mode ) == 'kinematic' ) THEN 1167 1195 heatflux_output_unit = 'K m/s' … … 1174 1202 ENDIF 1175 1203 1204 ! 1176 1205 !-- set time series output units for fluxes 1177 1206 dots_unit(14:16) = heatflux_output_unit 1178 1207 dots_unit(21) = waterflux_output_unit 1179 1208 dots_unit(19:20) = momentumflux_output_unit 1180 1181 !1182 !-- Check ocean setting1183 IF ( TRIM( coupling_mode ) == 'uncoupled' .AND. &1184 TRIM( coupling_char ) == '_O' .AND. &1185 .NOT. ocean ) THEN1186 1187 !1188 !-- Check whether an (uncoupled) atmospheric run has been declared as an1189 !-- ocean run (this setting is done via palmrun-option -y)1190 message_string = 'ocean = .F. does not allow coupling_char = "' // &1191 TRIM( coupling_char ) // '" set by palmrun-option "-y"'1192 CALL message( 'check_parameters', 'PA0317', 1, 2, 0, 6, 0 )1193 1194 ENDIF1195 1209 1196 1210 ! … … 1430 1444 1431 1445 ! 1432 !-- Check for synthetic turbulence generator settings 1446 !-- Check the module settings 1447 IF ( ocean_mode ) CALL ocean_check_parameters 1448 CALL tcm_check_parameters 1433 1449 CALL stg_check_parameters 1434 ! 1435 !-- When plant canopy model is used, peform addtional checks 1436 IF ( plant_canopy ) CALL pcm_check_parameters 1437 1438 ! 1439 !-- Additional checks for spectra 1440 IF ( calculate_spectra ) CALL spectra_check_parameters 1441 ! 1442 !-- When land surface model is used, perform additional checks 1443 IF ( land_surface ) CALL lsm_check_parameters 1444 ! 1445 !-- When microphysics module is used, perform additional checks 1446 IF ( bulk_cloud_model ) CALL bcm_check_parameters 1447 1448 ! 1449 !-- When urban surface model is used, perform additional checks 1450 IF ( urban_surface ) CALL usm_check_parameters 1451 1452 ! 1453 !-- If wind turbine model is used, perform additional checks 1454 IF ( wind_turbine ) CALL wtm_check_parameters 1455 ! 1456 !-- When radiation model is used, peform addtional checks 1457 IF ( radiation ) CALL radiation_check_parameters 1458 ! 1459 !-- When gust module is used, perform additional checks 1450 IF ( plant_canopy ) CALL pcm_check_parameters 1451 IF ( calculate_spectra ) CALL spectra_check_parameters 1452 IF ( land_surface ) CALL lsm_check_parameters 1453 IF ( bulk_cloud_model ) CALL bcm_check_parameters 1454 IF ( urban_surface ) CALL usm_check_parameters 1455 IF ( wind_turbine ) CALL wtm_check_parameters 1456 IF ( radiation ) CALL radiation_check_parameters 1460 1457 IF ( gust_module_enabled ) CALL gust_check_parameters 1461 !1462 !-- When large-scale forcing or nudging is used, peform addtional checks1463 1458 IF ( large_scale_forcing .OR. nudging ) CALL lsf_nudging_check_parameters 1464 1459 1465 1460 ! 1466 !-- In case of no model continuation run, check initialising parameters and1467 !-- deducefurther quantities1461 !-- In case of no restart run, check initialising parameters and calculate 1462 !-- further quantities 1468 1463 IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN 1469 1464 … … 1472 1467 pt_init = pt_surface 1473 1468 IF ( humidity ) q_init = q_surface 1474 IF ( ocean ) sa_init = sa_surface1475 1469 IF ( passive_scalar ) s_init = s_surface 1476 1470 IF ( air_chemistry ) THEN … … 1486 1480 gradient = 0.0_wp 1487 1481 1488 IF ( .NOT. ocean) THEN1482 IF ( .NOT. ocean_mode ) THEN 1489 1483 1490 1484 ug_vertical_gradient_level_ind(1) = 0 … … 1550 1544 gradient = 0.0_wp 1551 1545 1552 IF ( .NOT. ocean) THEN1546 IF ( .NOT. ocean_mode ) THEN 1553 1547 1554 1548 vg_vertical_gradient_level_ind(1) = 0 … … 1691 1685 !-- Compute initial chemistry profile using the given chemical species gradients 1692 1686 IF ( air_chemistry ) THEN 1693 DO lsp = 1, nvar 1694 CALL init_vertical_profiles( cs_vertical_gradient_level_ind(lsp,:), & 1695 cs_vertical_gradient_level(lsp,:), & 1696 cs_vertical_gradient(lsp,:), & 1697 chem_species(lsp)%conc_pr_init, & 1698 cs_surface(lsp), bc_cs_t_val(lsp) ) 1699 ENDDO 1700 ENDIF 1701 ! 1702 ! 1703 !-- If required, compute initial salinity profile using the given salinity 1704 !-- gradients 1705 IF ( ocean ) THEN 1706 CALL init_vertical_profiles( sa_vertical_gradient_level_ind, & 1707 sa_vertical_gradient_level, & 1708 sa_vertical_gradient, sa_init, & 1709 sa_surface, dum ) 1710 ENDIF 1711 1687 DO lsp = 1, nvar 1688 CALL init_vertical_profiles( cs_vertical_gradient_level_ind(lsp,:),& 1689 cs_vertical_gradient_level(lsp,:), & 1690 cs_vertical_gradient(lsp,:), & 1691 chem_species(lsp)%conc_pr_init, & 1692 cs_surface(lsp), bc_cs_t_val(lsp) ) 1693 ENDDO 1694 ENDIF 1712 1695 1713 1696 ENDIF … … 1777 1760 TRIM( reference_state ) // '"' 1778 1761 CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) 1779 ENDIF1780 1781 !1782 !-- Sign of buoyancy/stability terms1783 IF ( ocean ) atmos_ocean_sign = -1.0_wp1784 1785 !1786 !-- Ocean version must use flux boundary conditions at the top1787 IF ( ocean .AND. .NOT. use_top_fluxes ) THEN1788 message_string = 'use_top_fluxes must be .TRUE. in ocean mode'1789 CALL message( 'check_parameters', 'PA0042', 1, 2, 0, 6, 0 )1790 1762 ENDIF 1791 1763 … … 2067 2039 2068 2040 ! 2069 !-- Boundary conditions for salinity2070 IF ( ocean ) THEN2071 IF ( bc_sa_t == 'dirichlet' ) THEN2072 ibc_sa_t = 02073 ELSEIF ( bc_sa_t == 'neumann' ) THEN2074 ibc_sa_t = 12075 ELSE2076 message_string = 'unknown boundary condition: bc_sa_t = "' // &2077 TRIM( bc_sa_t ) // '"'2078 CALL message( 'check_parameters', 'PA0068', 1, 2, 0, 6, 0 )2079 ENDIF2080 2081 IF ( top_salinityflux == 9999999.9_wp ) constant_top_salinityflux = .FALSE.2082 IF ( ibc_sa_t == 1 .AND. top_salinityflux == 9999999.9_wp ) THEN2083 message_string = 'boundary condition: bc_sa_t = "' // &2084 TRIM( bc_sa_t ) // '" requires to set ' // &2085 'top_salinityflux'2086 CALL message( 'check_parameters', 'PA0069', 1, 2, 0, 6, 0 )2087 ENDIF2088 2089 !2090 !-- A fixed salinity at the top implies Dirichlet boundary condition for2091 !-- salinity. In this case specification of a constant salinity flux is2092 !-- forbidden.2093 IF ( ibc_sa_t == 0 .AND. constant_top_salinityflux .AND. &2094 top_salinityflux /= 0.0_wp ) THEN2095 message_string = 'boundary condition: bc_sa_t = "' // &2096 TRIM( bc_sa_t ) // '" is not allowed with ' // &2097 'top_salinityflux /= 0.0'2098 CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 )2099 ENDIF2100 2101 ENDIF2102 2103 !2104 2041 !-- Set boundary conditions for total water content 2105 2042 IF ( humidity ) THEN … … 2158 2095 .AND. top_scalarflux /= 0.0_wp ) THEN 2159 2096 message_string = 'boundary condition: bc_s_t = "' // & 2160 TRIM( bc_s a_t ) // '" is not allowed with ' //&2097 TRIM( bc_s_t ) // '" is not allowed with ' // & 2161 2098 'top_scalarflux /= 0.0' 2162 2099 CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 ) … … 2230 2167 2231 2168 IF ( rayleigh_damping_height == -1.0_wp ) THEN 2232 IF ( .NOT. ocean ) THEN2169 IF ( .NOT. ocean_mode ) THEN 2233 2170 rayleigh_damping_height = 0.66666666666_wp * zu(nzt) 2234 2171 ELSE … … 2236 2173 ENDIF 2237 2174 ELSE 2238 IF ( .NOT. ocean ) THEN2175 IF ( .NOT. ocean_mode ) THEN 2239 2176 IF ( rayleigh_damping_height < 0.0_wp .OR. & 2240 2177 rayleigh_damping_height > zu(nzt) ) THEN … … 2519 2456 hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) 2520 2457 2521 CASE ( 'sa', '#sa' )2522 IF ( .NOT. ocean ) THEN2523 message_string = 'data_output_pr = ' // &2524 TRIM( data_output_pr(i) ) // ' is not imp' // &2525 'lemented for ocean = .FALSE.'2526 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2527 ELSE2528 dopr_index(i) = 232529 dopr_unit(i) = 'psu'2530 hom(:,2,23,:) = SPREAD( zu, 2, statistic_regions+1 )2531 IF ( data_output_pr(i)(1:1) == '#' ) THEN2532 dopr_initial_index(i) = 262533 hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 )2534 hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative2535 data_output_pr(i) = data_output_pr(i)(2:)2536 ENDIF2537 ENDIF2538 2539 2458 CASE ( 'u*2' ) 2540 2459 dopr_index(i) = 30 … … 2846 2765 hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) 2847 2766 2848 2849 2767 CASE ( 'u"pt"' ) 2850 2768 dopr_index(i) = 58 … … 2876 2794 dopr_unit(i) = TRIM ( heatflux_output_unit ) 2877 2795 hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) 2878 2879 CASE ( 'rho_ocean' )2880 IF ( .NOT. ocean ) THEN2881 message_string = 'data_output_pr = ' // &2882 TRIM( data_output_pr(i) ) // ' is not imp' // &2883 'lemented for ocean = .FALSE.'2884 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2885 ELSE2886 dopr_index(i) = 642887 dopr_unit(i) = 'kg/m3'2888 hom(:,2,64,:) = SPREAD( zu, 2, statistic_regions+1 )2889 IF ( data_output_pr(i)(1:1) == '#' ) THEN2890 dopr_initial_index(i) = 772891 hom(:,2,77,:) = SPREAD( zu, 2, statistic_regions+1 )2892 hom(nzb,2,77,:) = 0.0_wp ! because zu(nzb) is negative2893 data_output_pr(i) = data_output_pr(i)(2:)2894 ENDIF2895 ENDIF2896 2897 CASE ( 'w"sa"' )2898 IF ( .NOT. ocean ) THEN2899 message_string = 'data_output_pr = ' // &2900 TRIM( data_output_pr(i) ) // ' is not imp' // &2901 'lemented for ocean = .FALSE.'2902 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2903 ELSE2904 dopr_index(i) = 652905 dopr_unit(i) = 'psu m/s'2906 hom(:,2,65,:) = SPREAD( zw, 2, statistic_regions+1 )2907 ENDIF2908 2909 CASE ( 'w*sa*' )2910 IF ( .NOT. ocean ) THEN2911 message_string = 'data_output_pr = ' // &2912 TRIM( data_output_pr(i) ) // ' is not imp' // &2913 'lemented for ocean = .FALSE.'2914 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2915 ELSE2916 dopr_index(i) = 662917 dopr_unit(i) = 'psu m/s'2918 hom(:,2,66,:) = SPREAD( zw, 2, statistic_regions+1 )2919 ENDIF2920 2921 CASE ( 'wsa' )2922 IF ( .NOT. ocean ) THEN2923 message_string = 'data_output_pr = ' // &2924 TRIM( data_output_pr(i) ) // ' is not imp' // &2925 'lemented for ocean = .FALSE.'2926 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2927 ELSE2928 dopr_index(i) = 672929 dopr_unit(i) = 'psu m/s'2930 hom(:,2,67,:) = SPREAD( zw, 2, statistic_regions+1 )2931 ENDIF2932 2796 2933 2797 CASE ( 'w*p*' ) … … 2953 2817 ENDIF 2954 2818 2955 CASE ( 'prho' )2956 IF ( .NOT. ocean ) THEN2957 message_string = 'data_output_pr = ' // &2958 TRIM( data_output_pr(i) ) // ' is not imp' // &2959 'lemented for ocean = .FALSE.'2960 CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 )2961 ELSE2962 dopr_index(i) = 712963 dopr_unit(i) = 'kg/m3'2964 hom(:,2,71,:) = SPREAD( zu, 2, statistic_regions+1 )2965 ENDIF2966 2967 2819 CASE ( 'hyp' ) 2968 2820 dopr_index(i) = 72 … … 3014 2866 ENDIF 3015 2867 3016 3017 3018 2868 CASE DEFAULT 2869 2870 ! 2871 !-- Check for other modules 2872 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 2873 CALL bcm_check_data_output_pr( data_output_pr(i), i, unit, & 2874 dopr_unit(i) ) 2875 ENDIF 2876 2877 IF ( unit == 'illegal' ) THEN 2878 CALL chem_check_data_output_pr( data_output_pr(i), i, unit, & 2879 dopr_unit(i) ) 2880 ENDIF 2881 2882 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 2883 CALL gust_check_data_output_pr( data_output_pr(i), i, unit, & 2884 dopr_unit(i) ) 2885 ENDIF 2886 2887 IF ( unit == 'illegal' ) THEN 2888 CALL lsf_nudging_check_data_output_pr( data_output_pr(i), i, & 2889 unit, dopr_unit(i) ) 2890 ENDIF 3019 2891 3020 2892 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit, & 3021 2893 dopr_unit(i) ) 3022 ! 3023 !-- Block of microphysics module profile outputs 3024 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 3025 CALL bcm_check_data_output_pr(data_output_pr(i), i, unit, & 2894 2895 IF ( unit == 'illegal' ) THEN 2896 CALL ocean_check_data_output_pr( data_output_pr(i), i, unit, & 3026 2897 dopr_unit(i) ) 3027 ENDIF3028 3029 IF ( unit == 'illegal' ) THEN3030 CALL lsf_nudging_check_data_output_pr( data_output_pr(i), i, &3031 unit, dopr_unit(i) )3032 2898 ENDIF 3033 2899 … … 3036 2902 unit, dopr_unit(i) ) 3037 2903 ENDIF 3038 ! 3039 !-- Block of gust module profile outputs 3040 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3041 CALL gust_check_data_output_pr( data_output_pr(i), i, unit, & 3042 dopr_unit(i) ) 3043 ENDIF 3044 3045 IF ( unit == 'illegal' ) THEN 3046 CALL chem_check_data_output_pr( data_output_pr(i), i, & 3047 unit, dopr_unit(i) ) 3048 ENDIF 3049 2904 2905 ! 2906 !-- Finally, check for user defined quantities 3050 2907 IF ( unit == 'illegal' ) THEN 3051 2908 unit = '' … … 3053 2910 ENDIF 3054 2911 2912 ! 2913 !-- No valid quantity found 3055 2914 IF ( unit == 'illegal' ) THEN 3056 2915 IF ( data_output_pr_user(1) /= ' ' ) THEN … … 3184 3043 unit = 'kg/kg' 3185 3044 3186 CASE ( 'rho_ocean' )3187 IF ( .NOT. ocean ) THEN3188 message_string = 'output of "' // TRIM( var ) // '" requi' // &3189 'res ocean = .TRUE.'3190 CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 )3191 ENDIF3192 unit = 'kg/m3'3193 3194 3045 CASE ( 's' ) 3195 3046 IF ( .NOT. passive_scalar ) THEN … … 3199 3050 ENDIF 3200 3051 unit = 'kg/m3' 3201 3202 CASE ( 'sa' )3203 IF ( .NOT. ocean ) THEN3204 message_string = 'output of "' // TRIM( var ) // '" requi' // &3205 'res ocean = .TRUE.'3206 CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 )3207 ENDIF3208 unit = 'psu'3209 3052 3210 3053 CASE ( 'p', 'pt', 'u', 'v', 'w' ) … … 3279 3122 CASE DEFAULT 3280 3123 3281 CALL tcm_check_data_output 3282 3283 ! 3284 !-- Block of microphysics module outputs3124 CALL tcm_check_data_output( var, unit ) 3125 3126 ! 3127 !-- Check for other modules 3285 3128 IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN 3286 CALL bcm_check_data_output ( var, unit ) 3287 ENDIF 3288 3289 IF ( unit == 'illegal' ) THEN 3290 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3291 ENDIF 3292 3293 IF ( unit == 'illegal' ) THEN 3294 CALL radiation_check_data_output( var, unit, i, ilen, k ) 3295 ENDIF 3296 3297 ! 3298 !-- Block of gust module outputs 3299 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3300 CALL gust_check_data_output ( var, unit ) 3301 ENDIF 3302 3303 ! 3304 !-- Block of chemistry model outputs 3129 CALL bcm_check_data_output( var, unit ) 3130 ENDIF 3131 3305 3132 IF ( unit == 'illegal' .AND. air_chemistry & 3306 3133 .AND. var(1:3) == 'kc_' ) THEN … … 3308 3135 ENDIF 3309 3136 3310 ! 3311 !-- Block of urban surface model outputs 3312 IF ( unit == 'illegal' .AND. urban_surface .AND. var(1:4) == 'usm_' ) THEN 3137 IF ( unit == 'illegal' ) THEN 3138 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3139 ENDIF 3140 3141 IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN 3142 CALL gust_check_data_output ( var, unit ) 3143 ENDIF 3144 3145 IF ( unit == 'illegal' .AND. ocean_mode ) THEN 3146 CALL ocean_check_data_output( var, unit ) 3147 ENDIF 3148 3149 IF ( unit == 'illegal' .AND. plant_canopy & 3150 .AND. var(1:4) == 'pcm_' ) THEN 3151 CALL pcm_check_data_output( var, unit ) 3152 ENDIF 3153 3154 IF ( unit == 'illegal' ) THEN 3155 CALL radiation_check_data_output( var, unit, i, ilen, k ) 3156 ENDIF 3157 3158 IF ( unit == 'illegal' .AND. urban_surface & 3159 .AND. var(1:4) == 'usm_' ) THEN 3313 3160 CALL usm_check_data_output( var, unit ) 3314 3161 ENDIF 3315 3162 3316 ! 3317 !-- Block of plant canopy model outputs 3318 IF ( unit == 'illegal' .AND. plant_canopy .AND. var(1:4) == 'pcm_' ) THEN 3319 CALL pcm_check_data_output( var, unit ) 3320 ENDIF 3321 3322 ! 3323 !-- Block of uv exposure model outputs 3324 IF ( unit == 'illegal' .AND. uv_exposure .AND. var(1:5) == 'uvem_' ) THEN 3163 IF ( unit == 'illegal' .AND. uv_exposure & 3164 .AND. var(1:5) == 'uvem_' ) THEN 3325 3165 CALL uvem_check_data_output( var, unit, i, ilen, k ) 3326 3166 ENDIF 3327 3167 3168 ! 3169 !-- Finally, check for user-defined quantities 3328 3170 IF ( unit == 'illegal' ) THEN 3329 3171 unit = '' … … 3628 3470 !-- Determine upper and lower hight level indices for random perturbations 3629 3471 IF ( disturbance_level_b == -9999999.9_wp ) THEN 3630 IF ( ocean ) THEN3472 IF ( ocean_mode ) THEN 3631 3473 disturbance_level_b = zu((nzt*2)/3) 3632 3474 disturbance_level_ind_b = ( nzt * 2 ) / 3 … … 3653 3495 3654 3496 IF ( disturbance_level_t == -9999999.9_wp ) THEN 3655 IF ( ocean ) THEN3497 IF ( ocean_mode ) THEN 3656 3498 disturbance_level_t = zu(nzt-3) 3657 3499 disturbance_level_ind_t = nzt - 3 … … 4074 3916 4075 3917 4076 4077 !------------------------------------------------------------------------------!4078 ! Description:4079 ! ------------4080 !> Inititalizes the vertical profiles of scalar quantities.4081 !------------------------------------------------------------------------------!4082 4083 SUBROUTINE init_vertical_profiles( vertical_gradient_level_ind, &4084 vertical_gradient_level, &4085 vertical_gradient, &4086 pr_init, surface_value, bc_t_val )4087 4088 4089 IMPLICIT NONE4090 4091 INTEGER(iwp) :: i !< counter4092 INTEGER(iwp), DIMENSION(1:10) :: vertical_gradient_level_ind !< vertical grid indices for gradient levels4093 4094 REAL(wp) :: bc_t_val !< model top gradient4095 REAL(wp) :: gradient !< vertica gradient of the respective quantity4096 REAL(wp) :: surface_value !< surface value of the respecitve quantity4097 4098 4099 REAL(wp), DIMENSION(0:nz+1) :: pr_init !< initialisation profile4100 REAL(wp), DIMENSION(1:10) :: vertical_gradient !< given vertical gradient4101 REAL(wp), DIMENSION(1:10) :: vertical_gradient_level !< given vertical gradient level4102 4103 i = 14104 gradient = 0.0_wp4105 4106 IF ( .NOT. ocean ) THEN4107 4108 vertical_gradient_level_ind(1) = 04109 DO k = 1, nzt+14110 IF ( i < 11 ) THEN4111 IF ( vertical_gradient_level(i) < zu(k) .AND. &4112 vertical_gradient_level(i) >= 0.0_wp ) THEN4113 gradient = vertical_gradient(i) / 100.0_wp4114 vertical_gradient_level_ind(i) = k - 14115 i = i + 14116 ENDIF4117 ENDIF4118 IF ( gradient /= 0.0_wp ) THEN4119 IF ( k /= 1 ) THEN4120 pr_init(k) = pr_init(k-1) + dzu(k) * gradient4121 ELSE4122 pr_init(k) = pr_init(k-1) + dzu(k) * gradient4123 ENDIF4124 ELSE4125 pr_init(k) = pr_init(k-1)4126 ENDIF4127 !4128 !-- Avoid negative values4129 IF ( pr_init(k) < 0.0_wp ) THEN4130 pr_init(k) = 0.0_wp4131 ENDIF4132 ENDDO4133 4134 ELSE4135 4136 vertical_gradient_level_ind(1) = nzt+14137 DO k = nzt, 0, -14138 IF ( i < 11 ) THEN4139 IF ( vertical_gradient_level(i) > zu(k) .AND. &4140 vertical_gradient_level(i) <= 0.0_wp ) THEN4141 gradient = vertical_gradient(i) / 100.0_wp4142 vertical_gradient_level_ind(i) = k + 14143 i = i + 14144 ENDIF4145 ENDIF4146 IF ( gradient /= 0.0_wp ) THEN4147 IF ( k /= nzt ) THEN4148 pr_init(k) = pr_init(k+1) - dzu(k+1) * gradient4149 ELSE4150 pr_init(k) = surface_value - 0.5_wp * dzu(k+1) * gradient4151 pr_init(k+1) = surface_value + 0.5_wp * dzu(k+1) * gradient4152 ENDIF4153 ELSE4154 pr_init(k) = pr_init(k+1)4155 ENDIF4156 !4157 !-- Avoid negative humidities4158 IF ( pr_init(k) < 0.0_wp ) THEN4159 pr_init(k) = 0.0_wp4160 ENDIF4161 ENDDO4162 4163 ENDIF4164 4165 !4166 !-- In case of no given gradients, choose zero gradient conditions4167 IF ( vertical_gradient_level(1) == -999999.9_wp ) THEN4168 vertical_gradient_level(1) = 0.0_wp4169 ENDIF4170 !4171 !-- Store gradient at the top boundary for possible Neumann boundary condition4172 bc_t_val = ( pr_init(nzt+1) - pr_init(nzt) ) / dzu(nzt+1)4173 4174 END SUBROUTINE init_vertical_profiles4175 4176 4177 4178 3918 !------------------------------------------------------------------------------! 4179 3919 ! Description:
Note: See TracChangeset
for help on using the changeset viewer.