Changeset 1053 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Nov 13, 2012 5:11:03 PM (12 years ago)
- Location:
- palm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk
- Property svn:mergeinfo changed
/palm/branches/hoffmann (added) merged: 989,994,999-1000,1005-1006,1012,1022,1048-1052
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE
- Property svn:mergeinfo changed
/palm/branches/hoffmann/SOURCE (added) merged: 994,999-1000,1005-1006,1012,1022,1048-1052
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE/check_parameters.f90
r1037 r1053 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! necessary changes for the new two-moment cloud physics scheme added: 23 ! - check cloud physics scheme (Kessler or Seifert and Beheng) 24 ! - plant_canopy is not allowed 25 ! - currently, only cache loop_optimization is allowed 26 ! - initial profiles of nr, qr 27 ! - boundary condition of nr, qr 28 ! - check output quantities (qr, nr, prr) 23 29 ! 24 30 ! Former revisions: … … 617 623 618 624 ENDIF 619 625 ! 626 !-- Check cloud scheme 627 IF ( cloud_scheme == 'seifert_beheng' ) THEN 628 icloud_scheme = 0 629 ELSEIF ( cloud_scheme == 'kessler' ) THEN 630 icloud_scheme = 1 631 ELSE 632 message_string = 'unknown cloud microphysics scheme cloud_scheme ="' // & 633 TRIM( cloud_scheme ) // '"' 634 CALL message( 'check_parameters', 'PA0357', 1, 2, 0, 6, 0 ) 635 ENDIF 620 636 ! 621 637 !-- Check whether there are any illegal values … … 853 869 ENDIF 854 870 871 IF ( plant_canopy .AND. cloud_physics .AND. icloud_scheme == 0 ) THEN 872 message_string = 'plant_canopy = .TRUE. requires cloud_scheme /=' // & 873 ' seifert_beheng' 874 CALL message( 'check_parameters', 'PA0360', 1, 2, 0, 6, 0 ) 875 ENDIF 876 877 IF ( loop_optimization /= 'cache' .AND. cloud_physics .AND. & 878 icloud_scheme == 0 ) THEN 879 message_string = 'cloud_scheme = seifert_beheng requires ' // & 880 'loop_optimization = cache' 881 CALL message( 'check_parameters', 'PA0362', 1, 2, 0, 6, 0 ) 882 ENDIF 883 855 884 ! 856 885 !-- In case of no model continuation run, check initialising parameters and … … 861 890 !-- Initial profiles for 1D and 3D model, respectively (u,v further below) 862 891 pt_init = pt_surface 863 IF ( humidity ) q_init = q_surface 892 IF ( humidity ) THEN 893 q_init = q_surface 894 ! 895 !-- It is not allowed to choose initial profiles of rain water content 896 !-- and rain drop concentration. They are set to 0.0. 897 IF ( cloud_physics .AND. icloud_scheme == 0 ) THEN 898 qr_init = 0.0 899 nr_init = 0.0 900 ENDIF 901 ENDIF 864 902 IF ( ocean ) sa_init = sa_surface 865 903 IF ( passive_scalar ) q_init = s_surface … … 1167 1205 ENDIF 1168 1206 1169 ! 1170 !-- Store humidity gradient at the top boundary for possile Neumann 1171 !-- boundary condition 1172 bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) 1207 IF ( cloud_physics .AND. icloud_scheme == 0 ) THEN 1208 1209 i = 1 1210 gradient = 0.0 1211 qr_vertical_gradient_level_ind(1) = 0 1212 DO k = 1, nzt+1 1213 IF ( i < 11 ) THEN 1214 IF ( qr_vertical_gradient_level(i) < zu(k) .AND. & 1215 qr_vertical_gradient_level(i) >= 0.0 ) THEN 1216 gradient = qr_vertical_gradient(i) / 100.0 1217 qr_vertical_gradient_level_ind(i) = k - 1 1218 i = i + 1 1219 ENDIF 1220 ENDIF 1221 IF ( gradient /= 0.0 ) THEN 1222 IF ( k /= 1 ) THEN 1223 qr_init(k) = qr_init(k-1) + dzu(k) * gradient 1224 ELSE 1225 qr_init(k) = qr_init(k-1) + 0.5 * dzu(k) * gradient 1226 ENDIF 1227 ELSE 1228 qr_init(k) = qr_init(k-1) 1229 ENDIF 1230 ! 1231 !-- Avoid negative rain water content 1232 IF ( qr_init(k) < 0.0 ) THEN 1233 qr_init(k) = 0.0 1234 ENDIF 1235 ENDDO 1236 ! 1237 !-- In case of no given rain water content gradients, choose zero gradient 1238 !-- conditions 1239 IF ( qr_vertical_gradient_level(1) == -1.0 ) THEN 1240 qr_vertical_gradient_level(1) = 0.0 1241 ENDIF 1242 1243 i = 1 1244 gradient = 0.0 1245 nr_vertical_gradient_level_ind(1) = 0 1246 DO k = 1, nzt+1 1247 IF ( i < 11 ) THEN 1248 IF ( nr_vertical_gradient_level(i) < zu(k) .AND. & 1249 nr_vertical_gradient_level(i) >= 0.0 ) THEN 1250 gradient = nr_vertical_gradient(i) / 100.0 1251 nr_vertical_gradient_level_ind(i) = k - 1 1252 i = i + 1 1253 ENDIF 1254 ENDIF 1255 IF ( gradient /= 0.0 ) THEN 1256 IF ( k /= 1 ) THEN 1257 nr_init(k) = nr_init(k-1) + dzu(k) * gradient 1258 ELSE 1259 nr_init(k) = nr_init(k-1) + 0.5 * dzu(k) * gradient 1260 ENDIF 1261 ELSE 1262 nr_init(k) = nr_init(k-1) 1263 ENDIF 1264 ! 1265 !-- Avoid negative rain water content 1266 IF ( nr_init(k) < 0.0 ) THEN 1267 nr_init(k) = 0.0 1268 ENDIF 1269 ENDDO 1270 ! 1271 !-- In case of no given rain water content gradients, choose zero gradient 1272 !-- conditions 1273 IF ( nr_vertical_gradient_level(1) == -1.0 ) THEN 1274 nr_vertical_gradient_level(1) = 0.0 1275 ENDIF 1276 1277 ENDIF 1278 ! 1279 !-- Store humidity, rain water content and rain drop concentration 1280 !-- gradient at the top boundary for possile Neumann boundary condition 1281 bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) 1282 1283 IF ( cloud_physics .AND. icloud_scheme == 0 ) THEN 1284 bc_qr_t_val = ( qr_init(nzt+1) - qr_init(nzt) ) / dzu(nzt+1) 1285 bc_nr_t_val = ( nr_init(nzt+1) - nr_init(nzt) ) / dzu(nzt+1) 1286 ENDIF 1173 1287 1174 1288 ENDIF … … 1344 1458 !-- Set wind speed in the Galilei-transformed system 1345 1459 IF ( galilei_transformation ) THEN 1346 IF ( use_ug_for_galilei_tr .AND. & 1347 ug_vertical_gradient_level(1) == 0.0 .AND. & 1348 vg_vertical_gradient_level(1) == 0.0 ) THEN 1460 IF ( use_ug_for_galilei_tr .AND. & 1461 ug_vertical_gradient_level(1) == 0.0 .AND. & 1462 ug_vertical_gradient(1) == 0.0 .AND. & 1463 vg_vertical_gradient_level(1) == 0.0 .AND. & 1464 vg_vertical_gradient(1) == 0.0 ) THEN 1349 1465 u_gtrans = ug_surface * 0.6 1350 1466 v_gtrans = vg_surface * 0.6 1351 ELSEIF ( use_ug_for_galilei_tr .AND. & 1352 ug_vertical_gradient_level(1) /= 0.0 ) THEN 1467 ELSEIF ( use_ug_for_galilei_tr .AND. & 1468 ( ug_vertical_gradient_level(1) /= 0.0 .OR. & 1469 ug_vertical_gradient(1) /= 0.0 ) ) THEN 1353 1470 message_string = 'baroclinicity (ug) not allowed simultaneously' // & 1354 1471 ' with galilei transformation' 1355 1472 CALL message( 'check_parameters', 'PA0046', 1, 2, 0, 6, 0 ) 1356 ELSEIF ( use_ug_for_galilei_tr .AND. & 1357 vg_vertical_gradient_level(1) /= 0.0 ) THEN 1473 ELSEIF ( use_ug_for_galilei_tr .AND. & 1474 ( vg_vertical_gradient_level(1) /= 0.0 .OR. & 1475 vg_vertical_gradient(1) /= 0.0 ) ) THEN 1358 1476 message_string = 'baroclinicity (vg) not allowed simultaneously' // & 1359 1477 ' with galilei transformation' … … 1650 1768 CALL message( 'check_parameters', 'PA0074', 1, 2, 0, 6, 0 ) 1651 1769 ENDIF 1652 1770 1771 IF ( cloud_physics .AND. icloud_scheme == 0 ) THEN 1772 IF ( bc_qr_b == 'dirichlet' ) THEN 1773 ibc_qr_b = 0 1774 ELSEIF ( bc_qr_b == 'neumann' ) THEN 1775 ibc_qr_b = 1 1776 ELSE 1777 message_string = 'unknown boundary condition: bc_qr_b ="' // & 1778 TRIM( bc_qr_b ) // '"' 1779 CALL message( 'check_parameters', 'PA0352', 1, 2, 0, 6, 0 ) 1780 ENDIF 1781 IF ( bc_qr_t == 'dirichlet' ) THEN 1782 ibc_qr_t = 0 1783 ELSEIF ( bc_qr_t == 'neumann' ) THEN 1784 ibc_qr_t = 1 1785 ELSE 1786 message_string = 'unknown boundary condition: bc_qr_t ="' // & 1787 TRIM( bc_qr_t ) // '"' 1788 CALL message( 'check_parameters', 'PA0353', 1, 2, 0, 6, 0 ) 1789 ENDIF 1790 IF ( bc_nr_b == 'dirichlet' ) THEN 1791 ibc_nr_b = 0 1792 ELSEIF ( bc_nr_b == 'neumann' ) THEN 1793 ibc_nr_b = 1 1794 ELSE 1795 message_string = 'unknown boundary condition: bc_nr_b ="' // & 1796 TRIM( bc_nr_b ) // '"' 1797 CALL message( 'check_parameters', 'PA0355', 1, 2, 0, 6, 0 ) 1798 ENDIF 1799 IF ( bc_nr_t == 'dirichlet' ) THEN 1800 ibc_nr_t = 0 1801 ELSEIF ( bc_nr_t == 'neumann' ) THEN 1802 ibc_nr_t = 1 1803 ELSE 1804 message_string = 'unknown boundary condition: bc_nr_t ="' // & 1805 TRIM( bc_nr_t ) // '"' 1806 CALL message( 'check_parameters', 'PA0356', 1, 2, 0, 6, 0 ) 1807 ENDIF 1808 ENDIF 1809 1653 1810 ENDIF 1654 1811 … … 2483 2640 hom(:,2,72,:) = SPREAD( zu, 2, statistic_regions+1 ) 2484 2641 2642 CASE ( 'nr' ) 2643 IF ( .NOT. cloud_physics ) THEN 2644 message_string = 'data_output_pr = ' // & 2645 TRIM( data_output_pr(i) ) // ' is not imp' // & 2646 'lemented for cloud_physics = .FALSE.' 2647 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2648 ELSEIF ( icloud_scheme /= 0 ) THEN 2649 message_string = 'data_output_pr = ' // & 2650 TRIM( data_output_pr(i) ) // ' is not imp' // & 2651 'lemented for cloud_scheme /= seifert_beheng' 2652 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2653 ELSE 2654 dopr_index(i) = 73 2655 dopr_unit(i) = '1/m3' 2656 hom(:,2,73,:) = SPREAD( zu, 2, statistic_regions+1 ) 2657 ENDIF 2658 2659 CASE ( 'qr' ) 2660 IF ( .NOT. cloud_physics ) THEN 2661 message_string = 'data_output_pr = ' // & 2662 TRIM( data_output_pr(i) ) // ' is not imp' // & 2663 'lemented for cloud_physics = .FALSE.' 2664 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2665 ELSEIF ( icloud_scheme /= 0 ) THEN 2666 message_string = 'data_output_pr = ' // & 2667 TRIM( data_output_pr(i) ) // ' is not imp' // & 2668 'lemented for cloud_scheme /= seifert_beheng' 2669 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2670 ELSE 2671 dopr_index(i) = 74 2672 dopr_unit(i) = 'kg/kg' 2673 hom(:,2,74,:) = SPREAD( zu, 2, statistic_regions+1 ) 2674 ENDIF 2675 2676 CASE ( 'qc' ) 2677 IF ( .NOT. cloud_physics ) THEN 2678 message_string = 'data_output_pr = ' // & 2679 TRIM( data_output_pr(i) ) // ' is not imp' // & 2680 'lemented for cloud_physics = .FALSE.' 2681 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2682 ELSEIF ( icloud_scheme /= 0 ) THEN 2683 message_string = 'data_output_pr = ' // & 2684 TRIM( data_output_pr(i) ) // ' is not imp' // & 2685 'lemented for cloud_scheme /= seifert_beheng' 2686 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2687 ELSE 2688 dopr_index(i) = 75 2689 dopr_unit(i) = 'kg/kg' 2690 hom(:,2,75,:) = SPREAD( zu, 2, statistic_regions+1 ) 2691 ENDIF 2692 2693 CASE ( 'prr' ) 2694 IF ( .NOT. cloud_physics ) THEN 2695 message_string = 'data_output_pr = ' // & 2696 TRIM( data_output_pr(i) ) // ' is not imp' // & 2697 'lemented for cloud_physics = .FALSE.' 2698 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2699 ELSEIF ( icloud_scheme /= 0 ) THEN 2700 message_string = 'data_output_pr = ' // & 2701 TRIM( data_output_pr(i) ) // ' is not imp' // & 2702 'lemented for cloud_scheme /= seifert_beheng' 2703 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2704 ELSEIF ( .NOT. precipitation ) THEN 2705 message_string = 'data_output_pr = ' // & 2706 TRIM( data_output_pr(i) ) // ' is not imp' // & 2707 'lemented for precipitation = .FALSE.' 2708 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) 2709 2710 ELSE 2711 dopr_index(i) = 76 2712 dopr_unit(i) = 'kg/kg m/s' 2713 hom(:,2,76,:) = SPREAD( zu, 2, statistic_regions+1 ) 2714 ENDIF 2715 2485 2716 CASE DEFAULT 2486 2717 … … 2572 2803 unit = 'K' 2573 2804 2805 CASE ( 'nr' ) 2806 IF ( .NOT. cloud_physics ) THEN 2807 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2808 'res cloud_physics = .TRUE.' 2809 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2810 ELSEIF ( icloud_scheme /= 0 ) THEN 2811 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2812 'res cloud_scheme = seifert_beheng' 2813 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 2814 ENDIF 2815 unit = '1/m3' 2816 2574 2817 CASE ( 'pc', 'pr' ) 2575 2818 IF ( .NOT. particle_advection ) THEN … … 2581 2824 IF ( TRIM( var ) == 'pr' ) unit = 'm' 2582 2825 2826 CASE ( 'prr' ) 2827 IF ( .NOT. cloud_physics ) THEN 2828 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2829 'res cloud_physics = .TRUE.' 2830 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2831 ELSEIF ( icloud_scheme /= 0 ) THEN 2832 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2833 'res cloud_scheme = seifert_beheng' 2834 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 2835 ELSEIF ( .NOT. precipitation ) THEN 2836 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2837 'res precipitation = .TRUE.' 2838 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) 2839 ENDIF 2840 unit = 'kg/kg m/s' 2841 2583 2842 CASE ( 'q', 'vpt' ) 2584 2843 IF ( .NOT. humidity ) THEN … … 2590 2849 IF ( TRIM( var ) == 'vpt' ) unit = 'K' 2591 2850 2851 CASE ( 'qc' ) 2852 IF ( .NOT. cloud_physics ) THEN 2853 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2854 'res cloud_physics = .TRUE.' 2855 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2856 ELSEIF ( icloud_scheme /= 0 ) THEN 2857 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2858 'res cloud_scheme = seifert_beheng' 2859 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 2860 ENDIF 2861 unit = 'kg/kg' 2862 2592 2863 CASE ( 'ql' ) 2593 2864 IF ( .NOT. ( cloud_physics .OR. cloud_droplets ) ) THEN … … 2607 2878 IF ( TRIM( var ) == 'ql_v' ) unit = 'm3' 2608 2879 IF ( TRIM( var ) == 'ql_vp' ) unit = 'none' 2880 2881 CASE ( 'qr' ) 2882 IF ( .NOT. cloud_physics ) THEN 2883 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2884 'res cloud_physics = .TRUE.' 2885 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2886 ELSEIF ( icloud_scheme /= 0 ) THEN 2887 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2888 'res cloud_scheme = seifert_beheng' 2889 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 2890 ENDIF 2891 unit = 'kg/kg' 2609 2892 2610 2893 CASE ( 'qv' )
Note: See TracChangeset
for help on using the changeset viewer.