Changeset 1127 for LMDZ4/branches/LMDZ4-dev/libf/phylmd/wake.F
- Timestamp:
- Mar 19, 2009, 11:38:04 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/LMDZ4-dev/libf/phylmd/wake.F
r1059 r1127 12 12 o ,Cstar,d_deltat_gw 13 13 o ,d_deltatw2,d_deltaqw2) 14 14 15 15 16 *************************************************************** … … 157 158 REAL alpk 158 159 REAL delta_t_min 159 REAL Pupper160 160 INTEGER nsub 161 161 REAL dtimesub 162 162 REAL sigmad, hwmin 163 REAL :: sigmaw_max 163 164 cIM 080208 164 165 LOGICAL, dimension(klon) :: gwake … … 183 184 INTEGER, DIMENSION(klon) :: ktop, kupper 184 185 186 c Sub-timestep tendencies and related variables 187 REAL d_deltatw(klon,klev),d_deltaqw(klon,klev) 188 REAL d_te(klon,klev),d_qe(klon,klev) 189 REAL d_sigmaw(klon),alpha(klon) 190 REAL q0_min(klon),q1_min(klon) 191 LOGICAL wk_adv(klon), OK_qx_qw(klon) 192 REAL epsilon 193 DATA epsilon/1.e-9/ 194 185 195 c Autres variables internes 186 196 INTEGER isubstep, k, i … … 202 212 REAL, DIMENSION(klon,klev) :: the, thu 203 213 204 REAL, DIMENSION(klon,klev) :: d_deltatw, d_deltaqw214 ! REAL, DIMENSION(klon,klev) :: d_deltatw, d_deltaqw 205 215 206 216 REAL, DIMENSION(klon,klev+1) :: omgbw 217 REAL, DIMENSION(klon) :: pupper 207 218 REAL, DIMENSION(klon) :: omgtop 208 219 REAL, DIMENSION(klon,klev) :: dp_omgbw … … 279 290 dqls(i,k) = 0. 280 291 d_deltat_gw(i,k)=0. 292 d_te(i,k) = 0. 293 d_qe(i,k) = 0. 294 d_deltatw(i,k) = 0. 295 d_deltaqw(i,k) = 0. 281 296 !IM 060508 beg 282 297 d_deltatw2(i,k)=0. … … 294 309 sigmaw(i) = amin1(sigmaw(i),0.99) 295 310 sigmaw0(i) = sigmaw(i) 311 wape(i) = 0. 312 wape2(i) = 0. 313 d_sigmaw(i) = 0. 314 ktopw(i) = 0 296 315 ENDDO 297 316 C … … 406 425 c 407 426 C Pupper = 50000. ! melting level 408 Pupper = 60000.427 c Pupper = 60000. 409 428 c Pupper = 80000. ! essais pour case_e 429 DO i = 1,klon 430 ccc Pupper(i) = 0.6*ph(i,1) 431 Pupper(i) = 60000. 432 ENDDO 433 410 434 C 411 435 C Determine Wake top pressure (Ptop) from buoyancy integral … … 481 505 DO i=1,klon 482 506 IF (ph(i,k+1) .lt. ptop(i)) ktop(i)=k 483 IF (ph(i,k+1) .lt. pupper ) kupper(i)=k507 IF (ph(i,k+1) .lt. pupper(i)) kupper(i)=k 484 508 ENDDO 485 509 ENDDO … … 622 646 ENDIF 623 647 ENDDO 624 c 625 C 648 649 c 650 c Check qx and qw positivity 651 c -------------------------- 652 DO i = 1,klon 653 q0_min(i)=min( (qe(i,1)-sigmaw(i)*deltaqw(i,1)), 654 $ (qe(i,1)+(1.-sigmaw(i))*deltaqw(i,1)) ) 655 ENDDO 656 DO k = 2,klev 657 DO i = 1,klon 658 q1_min(i)=min( (qe(i,k)-sigmaw(i)*deltaqw(i,k)), 659 $ (qe(i,k)+(1.-sigmaw(i))*deltaqw(i,k)) ) 660 IF (q1_min(i).le.q0_min(i)) THEN 661 q0_min(i)=q1_min(i) 662 ENDIF 663 ENDDO 664 ENDDO 665 c 666 DO i = 1,klon 667 OK_qx_qw(i) = q0_min(i) .GE. 0. 668 alpha(i) = 1. 669 ENDDO 670 c 626 671 CC ----------------------------------------------------------------- 627 672 C Sub-time-stepping … … 634 679 DO isubstep = 1,nsub 635 680 c------------------------------------------------------------ 636 DO i=1,klon 681 c 682 c wk_adv is the logical flag enabling wake evolution in the time advance loop 683 DO i = 1,klon 684 wk_adv(i) = OK_qx_qw(i) .AND. alpha(i) .GE. 1. 685 ENDDO 686 c 687 DO i=1,klon 688 IF (wk_adv(i)) THEN 637 689 gfl(i) = 2.*sqrt(3.14*wdens*sigmaw(i)) 638 ENDDO 639 DO i=1,klon 640 sigmaw(i) =sigmaw(i) + gfl(i)*Cstar(i)*dtimesub 641 sigmaw(i) =amin1(sigmaw(i),0.99) !!!!!!!! 690 ENDIF 691 ENDDO 692 DO i=1,klon 693 IF (wk_adv(i)) THEN 694 d_sigmaw(i) = gfl(i)*Cstar(i)*dtimesub 695 c sigmaw(i) =sigmaw(i) + gfl(i)*Cstar(i)*dtimesub 696 c sigmaw(i) =min(sigmaw(i),0.99) !!!!!!!! 642 697 c wdens = wdens0/(10.*sigmaw) 643 698 c sigmaw =max(sigmaw,sigd_con) 644 699 c sigmaw =max(sigmaw,sigmad) 700 ENDIF 645 701 ENDDO 646 702 C … … 650 706 cIM 060208 et omg sur les niveaux de 1 a klev+1, alors que avant l'on definit 651 707 cIM 060208 au niveau k=1..? 652 dp_deltomg(1:klon,1:klev)=0. 708 DO k= 1,klev 709 DO i = 1,klon 710 dp_deltomg(i,k)=0. 711 ENDDO 712 ENDDO 653 713 DO k= 1,klev+1 654 714 DO i = 1,klon … … 658 718 c 659 719 DO i=1,klon 720 IF (wk_adv(i)) THEN 660 721 z(i)= 0. 661 722 omg(i,1) = 0. 662 723 dp_deltomg(i,1) = -(gfl(i)*Cstar(i))/(sigmaw(i) * (1-sigmaw(i))) 724 ENDIF 663 725 ENDDO 664 726 c 665 727 DO k= 2,klev 666 728 DO i = 1,klon 667 IF( k .LE. ktop(i)) THEN729 IF( wk_adv(i) .AND. k .LE. ktop(i)) THEN 668 730 dz(i) = -(ph(i,k)-ph(i,k-1))/(rho(i,k-1)*rg) 669 731 z(i) = z(i)+dz(i) … … 675 737 c 676 738 DO i = 1,klon 739 IF (wk_adv(i)) THEN 677 740 dztop(i)=-(ptop(i)-ph(i,ktop(i)))/(rho(i,ktop(i))*rg) 678 741 ztop(i) = z(i)+dztop(i) 679 742 omgtop(i)=dp_deltomg(i,1)*ztop(i) 743 ENDIF 680 744 ENDDO 681 745 c … … 685 749 c 686 750 DO i=1,klon 751 IF (wk_adv(i)) THEN 687 752 omgtop(i) = -rho(i,ktop(i))*rg*omgtop(i) 688 753 dp_deltomg(i,1) = omgtop(i)/(ptop(i)-ph(i,1)) 754 ENDIF 689 755 ENDDO 690 756 c 691 757 DO k= 1,klev 692 758 DO i = 1,klon 693 IF( k .LE. ktop(i)) THEN759 IF( wk_adv(i) .AND. k .LE. ktop(i)) THEN 694 760 omg(i,k) = - rho(i,k)*rg*omg(i,k) 695 761 dp_deltomg(i,k) = dp_deltomg(i,1) … … 701 767 702 768 DO i=1,klon 703 IF ( kupper(i) .GT. ktop(i)) THEN769 IF ( wk_adv(i) .AND. kupper(i) .GT. ktop(i)) THEN 704 770 omg(i,kupper(i)+1) = - Rg*amdwn(i,kupper(i)+1)/sigmaw(i) 705 771 $ + Rg*amup(i,kupper(i)+1)/(1.-sigmaw(i)) 706 772 dp_deltomg(i,kupper(i)) = (omgtop(i)-omg(i,kupper(i)+1))/ 707 $ (ptop(i)-pupper )773 $ (ptop(i)-pupper(i)) 708 774 ENDIF 709 775 ENDDO … … 711 777 DO k= 1,klev 712 778 DO i = 1,klon 713 IF( k .GT. ktop(i) .AND. k .LE. kupper(i)) THEN779 IF( wk_adv(i) .AND. k .GT. ktop(i) .AND. k .LE. kupper(i)) THEN 714 780 dp_deltomg(i,k) = dp_deltomg(i,kupper(i)) 715 781 omg(i,k) = omgtop(i)+(ph(i,k)-ptop(i))*dp_deltomg(i,kupper(i)) … … 718 784 ENDDO 719 785 c 786 c 720 787 c-- Compute wake average vertical velocity omgbw 721 788 c … … 723 790 DO k = 1,klev+1 724 791 DO i=1,klon 792 IF ( wk_adv(i)) THEN 725 793 omgbw(i,k) = omgb(i,k)+(1.-sigmaw(i))*omg(i,k) 794 ENDIF 726 795 ENDDO 727 796 ENDDO … … 730 799 DO k = 1,klev 731 800 DO i=1,klon 801 IF ( wk_adv(i)) THEN 732 802 dp_omgbw(i,k) = (omgbw(i,k+1)-omgbw(i,k))/(ph(i,k+1)-ph(i,k)) 803 ENDIF 733 804 ENDDO 734 805 ENDDO … … 739 810 DO k = 1,klev 740 811 DO i=1,klon 741 alpha_up(i,k) = 0. 742 IF (omgb(i,k) .GT. 0.) alpha_up(i,k) = 1. 812 IF ( wk_adv(i)) THEN 813 alpha_up(i,k) = 0. 814 IF (omgb(i,k) .GT. 0.) alpha_up(i,k) = 1. 815 ENDIF 743 816 ENDDO 744 817 ENDDO … … 747 820 748 821 DO i=1,klon 749 RRe1(i) = 1.-sigmaw(i) 750 RRe2(i) = sigmaw(i) 822 IF ( wk_adv(i)) THEN 823 RRe1(i) = 1.-sigmaw(i) 824 RRe2(i) = sigmaw(i) 825 ENDIF 751 826 ENDDO 752 827 RRd1 = -1. … … 757 832 DO k= 1,klev 758 833 DO i = 1,klon 759 IF( k .LE. kupper(i)+1) THEN834 IF( wk_adv(i) .AND. k .LE. kupper(i)+1) THEN 760 835 dth(i,k) = deltatw(i,k)/ppi(i,k) 761 836 Th1(i,k) = the(i,k) - sigmaw(i) *dth(i,k) ! undisturbed area … … 778 853 DO k= 2,klev 779 854 DO i = 1,klon 780 IF( k .LE. kupper(i)+1) THEN855 IF( wk_adv(i) .AND. k .LE. kupper(i)+1) THEN 781 856 D_Th1(i,k) = Th1(i,k-1)-Th1(i,k) 782 857 D_Th2(i,k) = Th2(i,k-1)-Th2(i,k) … … 790 865 791 866 DO i=1,klon 792 omgbdth(i,1) = 0. 793 omgbdq(i,1) = 0. 867 IF( wk_adv(i)) THEN 868 omgbdth(i,1) = 0. 869 omgbdq(i,1) = 0. 870 ENDIF 794 871 ENDDO 795 872 796 873 DO k= 2,klev 797 874 DO i = 1,klon 798 IF( k .LE. kupper(i)+1) THEN ! loop on interfaces875 IF( wk_adv(i) .AND. k .LE. kupper(i)+1) THEN ! loop on interfaces 799 876 omgbdth(i,k) = omgb(i,k)*( dth(i,k-1) - dth(i,k)) 800 877 omgbdq(i,k) = omgb(i,k)*(deltaqw(i,k-1) - deltaqw(i,k)) … … 806 883 DO k= 1,klev 807 884 DO i = 1,klon 808 IF( k .LE. kupper(i)-1) THEN885 IF( wk_adv(i) .AND. k .LE. kupper(i)-1) THEN 809 886 c----------------------------------------------------------------- 810 887 c … … 829 906 c and increment large scale tendencies 830 907 c 831 dtls(i,k) = dtls(i,k) + 832 $ dtimesub*( 908 909 c 910 C 911 CC ----------------------------------------------------------------- 912 d_te(i,k) = dtimesub*( 833 913 $ ( RRe1(i)*omg(i,k )*sigmaw(i) *D_Th1(i,k) 834 914 $ -RRe2(i)*omg(i,k+1)*(1.-sigmaw(i))*D_Th2(i,k+1) ) … … 836 916 $ -sigmaw(i)*(1.-sigmaw(i))*dth(i,k)*dp_deltomg(i,k) 837 917 $ )*ppi(i,k) 838 c print*,'dtls=',dtls(i,k) 839 c 840 dqls(i,k) = dqls(i,k) + 841 $ dtimesub*( 918 c 919 d_qe(i,k) = dtimesub*( 842 920 $ ( RRe1(i)*omg(i,k )*sigmaw(i) *D_q1(i,k) 843 921 $ -RRe2(i)*omg(i,k+1)*(1.-sigmaw(i))*D_q2(i,k+1) ) … … 845 923 $ -sigmaw(i)*(1.-sigmaw(i))*deltaqw(i,k)*dp_deltomg(i,k) 846 924 $ ) 847 c print*,'dqls=',dqls(k) 848 ENDIF 925 ENDIF 926 849 927 c------------------------------------------------------------------- 850 928 ENDDO … … 856 934 DO k= 1,klev 857 935 DO i = 1,klon 858 IF( k .LE. kupper(i)-1) THEN936 IF( wk_adv(i) .AND. k .LE. kupper(i)-1) THEN 859 937 c 860 938 c Coefficient de répartition … … 912 990 913 991 IF (dtimesub*Tgw(i,k).lt.1.e-10) THEN 914 d eltatw(i,k) = deltatw(i,k)+dtimesub*915 $ (ff(i)+dtKE(i,k)+dtPBL(i,k) 992 d_deltatw(i,k) = dtimesub* 993 $ (ff(i)+dtKE(i,k)+dtPBL(i,k) 916 994 $ - spread(i,k)*deltatw(i,k)-Tgw(i,k)*deltatw(i,k)) 917 995 ELSE 918 d eltatw(i,k) = deltatw(i,k)+1/Tgw(i,k)*(1-exp(-dtimesub*996 d_deltatw(i,k) = 1/Tgw(i,k)*(1-exp(-dtimesub* 919 997 $ Tgw(i,k)))* 920 998 $ (ff(i)+dtKE(i,k)+dtPBL(i,k) 921 999 $ - spread(i,k)*deltatw(i,k)-Tgw(i,k)*deltatw(i,k)) 922 1000 ENDIF 923 1001 924 1002 dth(i,k) = deltatw(i,k)/ppi(i,k) 925 1003 926 1004 gg(i)=d_deltaqw(i,k)/dtimesub 927 1005 928 deltaqw(i,k) = deltaqw(i,k) + 929 $ dtimesub*(gg(i)+ dqKE(i,k)+dqPBL(i,k) - spread(i,k)* 930 $ deltaqw(i,k)) 1006 d_deltaqw(i,k) = dtimesub*(gg(i)+ dqKE(i,k)+dqPBL(i,k) 1007 $ - spread(i,k)*deltaqw(i,k)) 931 1008 932 1009 d_deltatw2(i,k)=d_deltatw2(i,k)+d_deltatw(i,k) … … 936 1013 ENDDO 937 1014 938 C And update large scale variables 1015 C 1016 C Scale tendencies so that water vapour remains positive in w and x. 1017 C 1018 call wake_vec_modulation(klon,klev,wk_adv,epsilon,qe,d_qe,deltaqw, 1019 $ d_deltaqw,sigmaw,d_sigmaw,alpha) 1020 c 1021 DO k = 1,klev 1022 DO i = 1,klon 1023 IF( wk_adv(i) .AND. k .LE. kupper(i)) THEN 1024 d_te(i,k)=alpha(i)*d_te(i,k) 1025 d_qe(i,k)=alpha(i)*d_qe(i,k) 1026 d_deltatw(i,k)=alpha(i)*d_deltatw(i,k) 1027 d_deltaqw(i,k)=alpha(i)*d_deltaqw(i,k) 1028 d_deltat_gw(i,k)=alpha(i)*d_deltat_gw(i,k) 1029 ENDIF 1030 ENDDO 1031 ENDDO 1032 DO i = 1,klon 1033 IF( wk_adv(i)) THEN 1034 d_sigmaw(i)=alpha(i)*d_sigmaw(i) 1035 ENDIF 1036 ENDDO 1037 1038 C Update large scale variables and wake variables 939 1039 cIM 060208 manque DO i + remplace DO k=1,kupper(i) 940 1040 cIM 060208 DO k = 1,kupper(i) 941 1041 DO k= 1,klev 942 1042 DO i = 1,klon 943 IF(k .LE. kupper(i)) THEN 1043 IF( wk_adv(i) .AND. k .LE. kupper(i)) THEN 1044 dtls(i,k)=dtls(i,k)+d_te(i,k) 1045 dqls(i,k)=dqls(i,k)+d_qe(i,k) 1046 ENDIF 1047 ENDDO 1048 ENDDO 1049 DO k= 1,klev 1050 DO i = 1,klon 1051 IF( wk_adv(i) .AND. k .LE. kupper(i)) THEN 944 1052 te(i,k) = te0(i,k) + dtls(i,k) 945 1053 qe(i,k) = qe0(i,k) + dqls(i,k) 946 1054 the(i,k) = te(i,k)/ppi(i,k) 947 ENDIF 948 ENDDO 1055 deltatw(i,k) = deltatw(i,k)+d_deltatw(i,k) 1056 deltaqw(i,k) = deltaqw(i,k)+d_deltaqw(i,k) 1057 dth(i,k) = deltatw(i,k)/ppi(i,k) 1058 ENDIF 1059 ENDDO 1060 ENDDO 1061 DO i = 1,klon 1062 IF( wk_adv(i)) THEN 1063 sigmaw(i) = sigmaw(i)+d_sigmaw(i) 1064 ENDIF 949 1065 ENDDO 950 1066 c … … 956 1072 c 957 1073 DO i=1,klon 958 Ptop_provis(i)=ph(i,1) 1074 IF ( wk_adv(i)) THEN 1075 Ptop_provis(i)=ph(i,1) 1076 ENDIF 959 1077 ENDDO 960 1078 c 961 1079 DO k= 2,klev 962 1080 DO i=1,klon 963 IF (Ptop_provis(i) .EQ. ph(i,1) .AND. 1081 IF ( wk_adv(i) .AND. 1082 $ Ptop_provis(i) .EQ. ph(i,1) .AND. 964 1083 $ dth(i,k) .GT. -delta_t_min .and. 965 1084 $ dth(i,k-1).LT. -delta_t_min) THEN … … 981 1100 DO k = 1,klev 982 1101 DO i=1,klon 1102 IF ( wk_adv(i)) THEN 983 1103 dz(i) = -(amax1(ph(i,k+1),Ptop_provis(i))-Ph(i,k))/(rho(i,k)*rg) 984 1104 IF (dz(i) .gt. 0) THEN … … 987 1107 dthmin(i) = amin1(dthmin(i),dth(i,k)) 988 1108 ENDIF 1109 ENDIF 989 1110 ENDDO 990 1111 ENDDO … … 993 1114 994 1115 DO i=1,klon 995 hw(i) = 2.*sum_dth(i)/amin1(dthmin(i),-0.5) 996 hw(i) = amax1(hwmin,hw(i)) 1116 IF ( wk_adv(i)) THEN 1117 hw(i) = 2.*sum_dth(i)/amin1(dthmin(i),-0.5) 1118 hw(i) = amax1(hwmin,hw(i)) 1119 ENDIF 997 1120 ENDDO 998 1121 c … … 1006 1129 DO k = 1,klev 1007 1130 DO i=1,klon 1131 IF ( wk_adv(i)) THEN 1008 1132 dz(i) = amin1(-(ph(i,k+1)-Ph(i,k))/(rho(i,k)*rg),hw(i)-z(i)) 1009 1133 IF (dz(i) .gt. 0) THEN … … 1012 1136 ktop(i) = k 1013 1137 ENDIF 1138 ENDIF 1014 1139 ENDDO 1015 1140 ENDDO … … 1018 1143 c 1019 1144 DO i=1,klon 1145 IF ( wk_adv(i)) THEN 1020 1146 Ptop_new(i)=ptop(i) 1147 ENDIF 1021 1148 ENDDO 1022 1149 c … … 1024 1151 DO i=1,klon 1025 1152 cIM v3JYG; IF (k .GE. ktop(i) 1026 IF (k .LE. ktop(i) .AND. 1153 IF ( wk_adv(i) .AND. 1154 $ k .LE. ktop(i) .AND. 1027 1155 $ ptop_new(i) .EQ. ptop(i) .AND. 1028 1156 $ dth(i,k) .GT. -delta_t_min .and. … … 1037 1165 c 1038 1166 DO i=1,klon 1039 ptop(i) = ptop_new(i) 1167 IF ( wk_adv(i)) THEN 1168 ptop(i) = ptop_new(i) 1169 ENDIF 1040 1170 ENDDO 1041 1171 … … 1050 1180 DO k = 1,klev 1051 1181 DO i=1,klon 1052 IF ( k .GE. kupper(i)) THEN1182 IF ( wk_adv(i) .AND. k .GE. kupper(i)) THEN 1053 1183 deltatw(i,k) = 0. 1054 1184 deltaqw(i,k) = 0. … … 1058 1188 c 1059 1189 C 1190 c-------------Cstar computation--------------------------------- 1191 DO i=1, klon 1192 sum_thu(i) = 0. 1193 sum_tu(i) = 0. 1194 sum_qu(i) = 0. 1195 sum_thvu(i) = 0. 1196 sum_dth(i) = 0. 1197 sum_dq(i) = 0. 1198 sum_rho(i) = 0. 1199 sum_dtdwn(i) = 0. 1200 sum_dqdwn(i) = 0. 1201 1202 av_thu(i) = 0. 1203 av_tu(i) =0. 1204 av_qu(i) =0. 1205 av_thvu(i) = 0. 1206 av_dth(i) = 0. 1207 av_dq(i) = 0. 1208 av_rho(i) =0. 1209 av_dtdwn(i) =0. 1210 av_dqdwn(i) = 0. 1211 ENDDO 1212 C 1213 C Integrals (and wake top level number) 1214 C -------------------------------------- 1215 C 1216 C Initialize sum_thvu to 1st level virt. pot. temp. 1217 1218 DO i=1,klon 1219 z(i) = 1. 1220 dz(i) = 1. 1221 sum_thvu(i) = thu(i,1)*(1.+eps*qu(i,1))*dz(i) 1222 sum_dth(i) = 0. 1223 ENDDO 1224 1225 DO k = 1,klev 1226 DO i=1,klon 1227 dz(i) = -(max(ph(i,k+1),ptop(i))-ph(i,k))/(rho(i,k)*rg) 1228 IF (dz(i) .GT. 0) THEN 1229 z(i) = z(i)+dz(i) 1230 sum_thu(i) = sum_thu(i) + thu(i,k)*dz(i) 1231 sum_tu(i) = sum_tu(i) + tu(i,k)*dz(i) 1232 sum_qu(i) = sum_qu(i) + qu(i,k)*dz(i) 1233 sum_thvu(i) = sum_thvu(i) + thu(i,k)*(1.+eps*qu(i,k))*dz(i) 1234 sum_dth(i) = sum_dth(i) + dth(i,k)*dz(i) 1235 sum_dq(i) = sum_dq(i) + deltaqw(i,k)*dz(i) 1236 sum_rho(i) = sum_rho(i) + rhow(i,k)*dz(i) 1237 sum_dtdwn(i) = sum_dtdwn(i) + dtdwn(i,k)*dz(i) 1238 sum_dqdwn(i) = sum_dqdwn(i) + dqdwn(i,k)*dz(i) 1239 ENDIF 1240 ENDDO 1241 ENDDO 1242 c 1243 DO i=1,klon 1244 hw0(i) = z(i) 1245 ENDDO 1246 c 1247 C 1248 C - WAPE and mean forcing computation 1249 C --------------------------------------- 1250 C 1251 C --------------------------------------- 1252 C 1253 C Means 1254 1255 DO i=1,klon 1256 av_thu(i) = sum_thu(i)/hw0(i) 1257 av_tu(i) = sum_tu(i)/hw0(i) 1258 av_qu(i) = sum_qu(i)/hw0(i) 1259 av_thvu(i) = sum_thvu(i)/hw0(i) 1260 av_dth(i) = sum_dth(i)/hw0(i) 1261 av_dq(i) = sum_dq(i)/hw0(i) 1262 av_rho(i) = sum_rho(i)/hw0(i) 1263 av_dtdwn(i) = sum_dtdwn(i)/hw0(i) 1264 av_dqdwn(i) = sum_dqdwn(i)/hw0(i) 1265 c 1266 wape(i) = - rg*hw0(i)*(av_dth(i) 1267 $ + eps*(av_thu(i)*av_dq(i)+av_dth(i)*av_qu(i)+av_dth(i)* 1268 $ av_dq(i) ))/av_thvu(i) 1269 ENDDO 1270 C 1271 C Filter out bad wakes 1272 1273 DO k = 1,klev 1274 DO i=1,klon 1275 IF ( wape(i) .LT. 0.) THEN 1276 deltatw(i,k) = 0. 1277 deltaqw(i,k) = 0. 1278 dth(i,k) = 0. 1279 ENDIF 1280 ENDDO 1281 ENDDO 1282 c 1283 DO i=1,klon 1284 IF ( wape(i) .LT. 0.) THEN 1285 wape(i) = 0. 1286 Cstar(i) = 0. 1287 hw(i) = hwmin 1288 sigmaw(i) = max(sigmad,sigd_con(i)) 1289 fip(i) = 0. 1290 gwake(i) = .FALSE. 1291 ELSE 1292 Cstar(i) = stark*sqrt(2.*wape(i)) 1293 gwake(i) = .TRUE. 1294 ENDIF 1295 ENDDO 1296 1060 1297 ENDDO ! end sub-timestep loop 1061 1298 C … … 1065 1302 DO k = 1,klev 1066 1303 DO i=1,klon 1067 IF ( k .LE. kupper(i)-1) THEN1304 IF ( wk_adv(i) .AND. k .LE. kupper(i)-1) THEN 1068 1305 dtls(i,k) = dtls(i,k)/dtime 1069 1306 dqls(i,k) = dqls(i,k)/dtime … … 1111 1348 DO k =1,klev 1112 1349 DO i=1,klon 1350 IF ( wk_adv(i)) THEN 1113 1351 rho(i,k) = p(i,k)/(rd*te(i,k)) 1114 1352 IF(k .eq. 1) THEN … … 1125 1363 rhow(i,k) = p(i,k)/(rd*(te(i,k)+deltatw(i,k))) 1126 1364 dth(i,k) = deltatw(i,k)/ppi(i,k) 1365 ENDIF 1127 1366 ENDDO 1128 1367 ENDDO … … 1134 1373 1135 1374 DO i=1,klon 1375 IF ( wk_adv(i)) THEN 1136 1376 z(i) = 1. 1137 1377 dz(i) = 1. 1138 1378 sum_thvu(i) = thu(i,1)*(1.+eps*qu(i,1))*dz(i) 1139 1379 sum_dth(i) = 0. 1380 ENDIF 1140 1381 ENDDO 1141 1382 1142 1383 DO k = 1,klev 1143 1384 DO i=1,klon 1385 IF ( wk_adv(i)) THEN 1144 1386 dz(i) = -(amax1(ph(i,k+1),ptop(i))-ph(i,k))/(rho(i,k)*rg) 1145 1387 IF (dz(i) .GT. 0) THEN … … 1155 1397 sum_dqdwn(i) = sum_dqdwn(i) + dqdwn(i,k)*dz(i) 1156 1398 ENDIF 1157 ENDDO 1158 ENDDO 1159 c 1160 DO i=1,klon 1399 ENDIF 1400 ENDDO 1401 ENDDO 1402 c 1403 DO i=1,klon 1404 IF ( wk_adv(i)) THEN 1161 1405 hw0(i) = z(i) 1162 ENDDO 1163 c 1164 C 2.1 - WAPE and mean forcing computation 1406 ENDIF 1407 ENDDO 1408 c 1409 C - WAPE and mean forcing computation 1165 1410 C------------------------------------------------------------- 1166 1411 … … 1168 1413 1169 1414 DO i=1, klon 1415 IF ( wk_adv(i)) THEN 1170 1416 av_thu(i) = sum_thu(i)/hw0(i) 1171 1417 av_tu(i) = sum_tu(i)/hw0(i) … … 1181 1427 $ + eps*(av_thu(i)*av_dq(i)+av_dth(i)*av_qu(i)+ 1182 1428 $ av_dth(i)*av_dq(i) ))/av_thvu(i) 1183 ENDDO 1184 1185 C 2.2 Prognostic variable update 1429 ENDIF 1430 ENDDO 1431 1432 C Prognostic variable update 1186 1433 C ------------------------------------------------------------ 1187 1434 … … 1190 1437 DO k = 1,klev 1191 1438 DO i=1,klon 1192 IF ( w ape2(i) .LT. 0.) THEN1439 IF ( wk_adv(i) .AND. wape2(i) .LT. 0.) THEN 1193 1440 deltatw(i,k) = 0. 1194 1441 deltaqw(i,k) = 0. … … 1200 1447 1201 1448 DO i=1, klon 1202 IF ( wape2(i) .LT. 0.) THEN 1449 IF ( wk_adv(i)) THEN 1450 IF ( wape2(i) .LT. 0.) THEN 1203 1451 wape2(i) = 0. 1204 1452 Cstar2(i) = 0. … … 1212 1460 gwake(i) = .TRUE. 1213 1461 ENDIF 1462 ENDIF 1214 1463 ENDDO 1215 1464 c 1216 1465 DO i=1, klon 1466 IF ( wk_adv(i)) THEN 1217 1467 ktopw(i) = ktop(i) 1468 ENDIF 1218 1469 ENDDO 1219 1470 c 1220 1471 DO i=1, klon 1221 IF (ktopw(i) .gt. 0 .and. gwake(i)) then 1472 IF ( wk_adv(i)) THEN 1473 IF (ktopw(i) .gt. 0 .and. gwake(i)) then 1222 1474 1223 1475 Cjyg1 Utilisation d'un h_efficace constant ( ~ feeding layer) … … 1234 1486 FIP(i) = 0. 1235 1487 ENDIF 1488 ENDIF 1236 1489 ENDDO 1237 1490 c … … 1241 1494 C alors il disparait en se mélangeant à la partie undisturbed 1242 1495 c 1496 sigmaw_max = 0.9 1243 1497 DO k = 1,klev 1244 1498 DO i=1, klon 1245 IF ((sigmaw(i).GT.0.9).or. 1499 c correction NICOLAS $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0))) THEN 1500 ! print*,'wape wape2 ktopw OK_qx_qw =', 1501 ! $ wape(i),wape2(i),ktopw(i),OK_qx_qw(i) 1502 IF ((sigmaw(i).GT.sigmaw_max).or. 1246 1503 $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0)).or. 1247 $ (ktopw(i).le.2)) THEN 1504 $ (ktopw(i).le.2) .OR. 1505 $ .not. OK_qx_qw(i)) THEN 1248 1506 cIM cf NR/JYG 251108 $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0))) THEN 1249 1507 ccc IF (sigmaw(i).GT.0.9) THEN … … 1257 1515 c 1258 1516 DO i=1, klon 1259 IF ((sigmaw(i).GT.0.9).or. 1260 $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0))) THEN 1517 IF ( (sigmaw(i).GT.sigmaw_max).or. 1518 $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0)).or. 1519 $ (ktopw(i).le.2) .OR. 1520 $ .not. OK_qx_qw(i)) THEN 1521 ! correction NICOLAS $ ((wape(i).ge.wape2(i)).and.(wape2(i).le.1.0))) THEN 1261 1522 ccc IF (sigmaw(i).GT.0.9) THEN 1262 1523 wape(i) = 0. … … 1272 1533 RETURN 1273 1534 END 1535 1536 SUBROUTINE wake_vec_modulation(nlon,nl,wk_adv,epsilon,qe,d_qe, 1537 $ deltaqw,d_deltaqw,sigmaw,d_sigmaw,alpha) 1538 c------------------------------------------------------ 1539 cDtermination du coefficient alpha tel que les tendances 1540 c corriges alpha*d_G, pour toutes les grandeurs G, correspondent 1541 c a une humidite positive dans la zone (x) et dans la zone (w). 1542 c------------------------------------------------------ 1543 c 1544 1545 c Input 1546 REAL qe(nlon,nl),d_qe(nlon,nl) 1547 REAL deltaqw(nlon,nl),d_deltaqw(nlon,nl) 1548 REAL sigmaw(nlon),d_sigmaw(nlon) 1549 LOGICAL wk_adv(nlon) 1550 INTEGER nl,nlon 1551 c Output 1552 REAL alpha(nlon) 1553 c Internal variables 1554 REAL alpha1(nlon) 1555 REAL x,a,b,c,discrim,zeta(nlon) 1556 REAL epsilon 1557 ! DATA epsilon/1.e-9/ 1558 c 1559 DO k=1,nl 1560 DO i = 1,nlon 1561 IF (wk_adv(i)) THEN 1562 IF ((deltaqw(i,k)+d_deltaqw(i,k)).ge.0.) then 1563 zeta(i)=0. 1564 ELSE 1565 zeta(i)=1. 1566 END IF 1567 ENDIF 1568 ENDDO 1569 DO i = 1,nlon 1570 IF (wk_adv(i)) THEN 1571 x = qe(i,k)+(zeta(i)-sigmaw(i))*deltaqw(i,k) 1572 $ +d_qe(i,k)+(zeta(i)-sigmaw(i))*d_deltaqw(i,k) 1573 $ -d_sigmaw(i)*(deltaqw(i,k)+d_deltaqw(i,k)) 1574 a=-d_sigmaw(i)*d_deltaqw(i,k) 1575 b=d_qe(i,k)+(zeta(i)-sigmaw(i))*d_deltaqw(i,k) 1576 $ -deltaqw(i,k)*d_sigmaw(i) 1577 ! c=qe(i,k)+(zeta(i)-sigmaw(i))*deltaqw(i,k)-epsilon 1578 c=qe(i,k)+(zeta(i)-sigmaw(i))*deltaqw(i,k) 1579 1580 discrim=b*b-4.*a*c 1581 ! print*,'ZETA *********************' 1582 ! print*,'zeta sigmaw ',zeta(:) 1583 ! print*,'SIGMA *********************' 1584 ! print*,'sigmaw ',sigmaw(:) 1585 1586 ! print*,' x ************************' 1587 ! print*,'x ',x 1588 ! print*,' a+b ************************' 1589 ! print*,'a+b ',a+b 1590 1591 ! print*,'a b c delta zeta ',a,b,c,discrim 1592 IF (a+b .GE. 0.) THEN 1593 alpha1(i)=1. 1594 ELSE 1595 IF (x .GE. 0.) THEN 1596 alpha1(i)=1. 1597 ELSE 1598 ! IF (a .GE. 0.) THEN 1599 IF (a .GT. 0.) THEN 1600 ! print*,'a b c delta zeta ',a,b,c,discrim,zeta(i) 1601 ! print*,'-b+sqrt(discrim) ',-b+sqrt(discrim) 1602 alpha1(i)=0.9*min( (2.*c)/(-b+sqrt(discrim)), 1603 $ (-b+sqrt(discrim))/(2.*a) ) 1604 ELSE IF (a.eq.0.) THEN 1605 alpha1(i)=0.9*(-c/b) 1606 ELSE 1607 ! print*,'a b c delta zeta ',a,b,c,discrim,zeta(i) 1608 ! print*,'-b+sqrt(discrim) ',-b+sqrt(discrim) 1609 alpha1(i)=0.9*max( (2.*c)/(-b+sqrt(discrim)), 1610 $ (-b+sqrt(discrim))/(2.*a) ) 1611 ENDIF 1612 ENDIF 1613 ENDIF 1614 ENDIF 1615 ENDDO 1616 ENDDO 1617 c 1618 DO i = 1,nlon 1619 IF (wk_adv(i)) THEN 1620 alpha(i) = min(alpha(i),alpha1(i)) 1621 ENDIF 1622 ENDDO 1623 c 1624 return 1625 end 1626 1274 1627 Subroutine WAKE_scal (p,ph,ppi,dtime,sigd_con 1275 1628 : ,te0,qe0,omgb … … 2315 2668 C alors il disparait en se mélangeant à la partie undisturbed 2316 2669 2670 ! correction NICOLAS . ((wape.ge.wape2).and.(wape2.le.1.0))) THEN 2317 2671 IF ((sigmaw.GT.0.9).or. 2318 2672 . ((wape.ge.wape2).and.(wape2.le.1.0)).or.(ktopw.le.2)) THEN
Note: See TracChangeset
for help on using the changeset viewer.