Changeset 5185 for LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2
- Timestamp:
- Sep 11, 2024, 4:27:07 PM (3 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
r5159 r5185 110 110 DO ilev=1,nlev 111 111 ! If there a cloud, start the counter and store this height 112 if(thres_crossed_MISR .eq. 0 . and. dtau(j,ibox,ilev) .gt. 0.) then112 if(thres_crossed_MISR .eq. 0 .AND. dtau(j,ibox,ilev) .gt. 0.) then 113 113 ! First encountered a "cloud" 114 114 thres_crossed_MISR = 1 … … 116 116 endif 117 117 118 if( thres_crossed_MISR .lt. 99 . and. thres_crossed_MISR .gt. 0 ) then118 if( thres_crossed_MISR .lt. 99 .AND. thres_crossed_MISR .gt. 0 ) then 119 119 if( dtau(j,ibox,ilev) .eq. 0.) then 120 120 ! We have come to the end of the current cloud layer without yet … … 129 129 ! current layer cloud top to the current level then MISR will like 130 130 ! see a top below the top of the current layer. 131 if( dtau(j,ibox,ilev).gt.0 . and. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then131 if( dtau(j,ibox,ilev).gt.0 .AND. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then 132 132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then 133 133 ! MISR will likely penetrate to some point within this layer ... the middle … … 142 142 143 143 ! Check for a distinctive water layer 144 if(dtau(j,ibox,ilev) .gt. 1 . and. at(j,ilev) .gt. 273 ) then144 if(dtau(j,ibox,ilev) .gt. 1 .AND. at(j,ilev) .gt. 273 ) then 145 145 ! Must be a water cloud, take this as CTH level 146 146 thres_crossed_MISR=99 … … 191 191 ! ! Adjust based on neightboring points. 192 192 ! do j=2,npoints-1 193 ! if(box_MISR_ztop(j-1,1) .gt. 0 . and. &194 ! box_MISR_ztop(j+1,1) .gt. 0 . and. &195 ! abs(box_MISR_ztop(j-1,1)-box_MISR_ztop(j+1,1)) .lt. 500 . and. &193 ! if(box_MISR_ztop(j-1,1) .gt. 0 .AND. & 194 ! box_MISR_ztop(j+1,1) .gt. 0 .AND. & 195 ! abs(box_MISR_ztop(j-1,1)-box_MISR_ztop(j+1,1)) .lt. 500 .AND. & 196 196 ! box_MISR_ztop(j,1) .lt. box_MISR_ztop(j+1,1)) then 197 197 ! box_MISR_ztop(j,1) = box_MISR_ztop(j+1,1) … … 202 202 ! do j=1,npoints 203 203 ! do ibox=2,ncol-1 204 ! if(box_MISR_ztop(j,ibox-1) .gt. 0 . and. &205 ! box_MISR_ztop(j,ibox+1) .gt. 0 . and. &206 ! abs(box_MISR_ztop(j,ibox-1)-box_MISR_ztop(j,ibox+1)) .lt. 500 . and. &204 ! if(box_MISR_ztop(j,ibox-1) .gt. 0 .AND. & 205 ! box_MISR_ztop(j,ibox+1) .gt. 0 .AND. & 206 ! abs(box_MISR_ztop(j,ibox-1)-box_MISR_ztop(j,ibox+1)) .lt. 500 .AND. & 207 207 ! box_MISR_ztop(j,ibox) .lt. box_MISR_ztop(j,ibox+1)) then 208 208 ! box_MISR_ztop(j,ibox) = box_MISR_ztop(j,ibox+1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90
r5158 r5185 381 381 ! 1) Determine if using full inputs or subset 382 382 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 383 if (present(start_idx) . and. present(stop_idx)) then383 if (present(start_idx) .AND. present(stop_idx)) then 384 384 ij=start_idx 385 385 ik=stop_idx … … 932 932 933 933 ! Check if there is any value slightly greater than 1 934 where ((cospOUT%isccp_totalcldarea > 1.0-1.e-5) . and. &934 where ((cospOUT%isccp_totalcldarea > 1.0-1.e-5) .AND. & 935 935 (cospOUT%isccp_totalcldarea < 1.0+1.e-5)) 936 936 cospOUT%isccp_totalcldarea = 1.0 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90
r5158 r5185 306 306 ! Do we need to generate optical inputs for Parasol simulator? 307 307 lparasol = .false. 308 if (present(tautot_S_liq) . and. present(tautot_S_ice)) lparasol = .true.308 if (present(tautot_S_liq) .AND. present(tautot_S_ice)) lparasol = .true. 309 309 310 310 ! Are optical-depths and backscatter coefficients for ice and liquid requested? 311 311 lphaseoptics=.false. 312 if (present(betatot_ice) . and. present(betatot_liq) .and. present(tautot_liq) .and. &312 if (present(betatot_ice) .AND. present(betatot_liq) .AND. present(tautot_liq) .AND. & 313 313 present(tautot_ice)) lphaseoptics=.true. 314 314 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90
r5158 r5185 217 217 DO j=1,Nlevels 218 218 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 219 if ((sc_ratio .le. s_att) . and. (flag_sat .eq. 0)) flag_sat = j219 if ((sc_ratio .le. s_att) .AND. (flag_sat .eq. 0)) flag_sat = j 220 220 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 221 221 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud … … 267 267 268 268 DO ij=2,Nbins+1 269 hist1D(ij-1) = count(var .ge. bins(ij-1) . and. var .lt. bins(ij))269 hist1D(ij-1) = count(var .ge. bins(ij-1) .AND. var .lt. bins(ij)) 270 270 if (count(var .eq. R_GROUND) .ge. 1) hist1D(ij-1)=R_UNDEF 271 271 enddo … … 300 300 DO ij=2,nbin1+1 301 301 DO ik=2,nbin2+1 302 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) . and. var1 .lt. bin1(ij) .and. &303 var2 .ge. bin2(ik-1) . and. var2 .lt. bin2(ik))302 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .AND. var1 .lt. bin1(ij) .AND. & 303 var2 .ge. bin2(ik-1) .AND. var2 .lt. bin2(ik)) 304 304 enddo 305 305 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90
r5158 r5185 85 85 mxratio(i,j,k)=mxratio(i,j,k)/rho 86 86 ! Compute effective radius 87 ! if ((reff(i,j,k) <= 0._wp). and.(flux(i,k) /= 0._wp)) then88 if ((reff(i,j,k) <= 0._wp). and.(flux(i,k) > seuil)) then87 ! if ((reff(i,j,k) <= 0._wp).AND.(flux(i,k) /= 0._wp)) then 88 if ((reff(i,j,k) <= 0._wp).AND.(flux(i,k) > seuil)) then 89 89 lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1._wp/delta) 90 90 reff(i,j,k) = gamma_4_3_2/lambda_x -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90
r5159 r5185 232 232 233 233 DO ilev=1,nlev 234 where(pfull(1:npoints,ilev) .lt. 40000. . and. &235 pfull(1:npoints,ilev) .gt. 5000. . and. &234 where(pfull(1:npoints,ilev) .lt. 40000. .AND. & 235 pfull(1:npoints,ilev) .gt. 5000. .AND. & 236 236 at(1:npoints,ilev) .lt. attropmin(1:npoints)) 237 237 ptrop(1:npoints) = pfull(1:npoints,ilev) … … 244 244 DO ilev=1,nlev 245 245 atmax(1:npoints) = merge(at(1:npoints,ilev),atmax(1:npoints),& 246 at(1:npoints,ilev) .gt. atmax(1:npoints) . and. ilev .ge. itrop(1:npoints))246 at(1:npoints,ilev) .gt. atmax(1:npoints) .AND. ilev .ge. itrop(1:npoints)) 247 247 enddo 248 248 end if … … 350 350 if (isccp_top_height .eq. 1) then 351 351 DO j=1,npoints 352 if (transmax(j) .gt. 0.001 . and. transmax(j) .le. 0.9999999) then352 if (transmax(j) .gt. 0.001 .AND. transmax(j) .le. 0.9999999) then 353 353 fluxtopinit(j) = fluxtop(j,ibox) 354 354 tauir(j) = tau(j,ibox)/2.13_wp … … 358 358 DO j=1,npoints 359 359 if (tau(j,ibox) .gt. (tauchk)) then 360 if (transmax(j) .gt. 0.001 . and. transmax(j) .le. 0.9999999) then360 if (transmax(j) .gt. 0.001 .AND. transmax(j) .le. 0.9999999) then 361 361 emcld(j,ibox) = 1._wp - exp(-1._wp * tauir(j) ) 362 362 fluxtop(j,ibox) = fluxtopinit(j) - ((1.-emcld(j,ibox))*fluxtop_clrsky(j)) … … 375 375 where(tau(1:npoints,ibox) .gt. tauchk) 376 376 tb(1:npoints,ibox)= 1307.27_wp/ (log(1. + (1._wp/fluxtop(1:npoints,ibox)))) 377 where (isccp_top_height .eq. 1 . and. tauir(1:npoints) .lt. taumin(1:npoints))377 where (isccp_top_height .eq. 1 .AND. tauir(1:npoints) .lt. taumin(1:npoints)) 378 378 tb(1:npoints,ibox) = attrop(1:npoints) - 5._wp 379 379 tau(1:npoints,ibox) = 2.13_wp*taumin(1:npoints) … … 406 406 ilev = merge(nlev-k1,k1,isccp_top_height_direction .eq. 2) 407 407 DO j=1,npoints 408 if (ilev .ge. itrop(j) . and. &409 ((at(j,ilev) .ge. tb(j,ibox) . and. &408 if (ilev .ge. itrop(j) .AND. & 409 ((at(j,ilev) .ge. tb(j,ibox) .AND. & 410 410 at(j,ilev+1) .le. tb(j,ibox)) .or. & 411 (at(j,ilev) .le. tb(j,ibox) . and. &411 (at(j,ilev) .le. tb(j,ibox) .AND. & 412 412 at(j,ilev+1) .ge. tb(j,ibox)))) then 413 413 nmatch(j)=nmatch(j)+1 … … 441 441 ptop(1:npoints,ibox)=0. 442 442 DO ilev=1,nlev 443 where((ptop(1:npoints,ibox) .eq. 0. ) . and.(frac_out(1:npoints,ibox,ilev) .ne. 0))443 where((ptop(1:npoints,ibox) .eq. 0. ) .AND.(frac_out(1:npoints,ibox,ilev) .ne. 0)) 444 444 ptop(1:npoints,ibox)=phalf(1:npoints,ilev) 445 445 levmatch(1:npoints,ibox)=ilev … … 460 460 DO ibox=1,ncol 461 461 DO j=1,npoints 462 if (tau(j,ibox) .gt. (tauchk) . and. ptop(j,ibox) .gt. 0.) then462 if (tau(j,ibox) .gt. (tauchk) .AND. ptop(j,ibox) .gt. 0.) then 463 463 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 464 464 boxtau(j,ibox) = tau(j,ibox) … … 561 561 DO j=1,npoints 562 562 ! Subcolumns that are cloudy(true) and not(false) 563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk . and. boxptop(j,1:ncol) .gt. 0.)563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk .AND. boxptop(j,1:ncol) .gt. 0.) 564 564 565 565 ! Compute joint histogram and column quantities for points that are sunlit and cloudy … … 572 572 573 573 ! Column cloud area 574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol 575 575 576 576 ! Subcolumn cloud albedo 577 577 !albedocld(j,1:ncol) = merge((boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp),& 578 ! 0._wp,box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)579 where(box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)578 ! 0._wp,box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin) 579 where(box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin) 580 580 albedocld(j,1:ncol) = (boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp) 581 581 elsewhere … … 587 587 588 588 ! Column cloud top pressure 589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol 590 590 endif 591 591 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
r5160 r5185 152 152 ! Phase optics? 153 153 lphaseoptics=.false. 154 if (present(betatot_ice) . and. present(betatot_liq) .and. present(tautot_liq) .and. &154 if (present(betatot_ice) .AND. present(betatot_liq) .AND. present(tautot_liq) .AND. & 155 155 present(tautot_ice)) lphaseoptics=.true. 156 156 … … 400 400 DO ic = 1, ncol 401 401 pnorm_c = pnormFlip(:,ic,:) 402 where ((pnorm_c .lt. xmax) . and. (betamolFlip(:,1,:) .lt. xmax) .and. &402 where ((pnorm_c .lt. xmax) .AND. (betamolFlip(:,1,:) .lt. xmax) .AND. & 403 403 (betamolFlip(:,1,:) .gt. 0.0 )) 404 404 x3d_c = pnorm_c/betamolFlip(:,1,:) … … 429 429 DO ic = 1, ncol 430 430 pnorm_c = pnorm(:,ic,:) 431 where ((pnorm_c.lt.xmax) . and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 ))431 where ((pnorm_c.lt.xmax) .AND. (pmol.lt.xmax) .AND. (pmol.gt. 0.0 )) 432 432 x3d_c = pnorm_c/pmol 433 433 elsewhere … … 650 650 DO k=1,Nlevels 651 651 ! Cloud detection at subgrid-scale: 652 where ((x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )652 where ((x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 653 653 cldy(:,:,k)=1._wp 654 654 elsewhere … … 657 657 658 658 ! Number of usefull sub-columns: 659 where ((x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )659 where ((x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 660 660 srok(:,:,k)=1._wp 661 661 elsewhere … … 679 679 if(srok(ip,ic,k).gt.0.)then 680 680 DO itemp=1,Ntemp 681 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then681 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 682 682 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1._wp 683 683 endif … … 687 687 if(cldy(ip,ic,k).eq.1.)then 688 688 DO itemp=1,Ntemp 689 if( (tmp(ip,k) .ge. tempmod(itemp)). and.(tmp(ip,k) .lt. tempmod(itemp+1)) )then689 if( (tmp(ip,k) .ge. tempmod(itemp)).AND.(tmp(ip,k) .lt. tempmod(itemp+1)) )then 690 690 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1._wp 691 691 endif … … 695 695 iz=1 696 696 p1 = pplay(ip,k) 697 if ( p1.gt.0. . and. p1.lt.(440._wp*100._wp)) then ! high clouds697 if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds 698 698 iz=3 699 else if(p1.ge.(440._wp*100._wp) . and. p1.lt.(680._wp*100._wp)) then ! mid clouds699 else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds 700 700 iz=2 701 701 endif … … 748 748 749 749 ! Avoid zero values 750 if( (cldy(i,ncol,nlev).eq.1.) . and. (ATBperp(i,ncol,nlev).gt.0.) )then750 if( (cldy(i,ncol,nlev).eq.1.) .AND. (ATBperp(i,ncol,nlev).gt.0.) )then 751 751 ! Computation of the ATBperp along the phase discrimination line 752 752 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 767 767 ! to classify the phase cloud 768 768 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 769 if (p1 .gt. 0. . and. p1.lt.(440._wp*100._wp)) then ! high cloud769 if (p1 .gt. 0. .AND. p1.lt.(440._wp*100._wp)) then ! high cloud 770 770 cldlayphase(i,ncol,3,2) = 1._wp 771 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then ! mid cloud771 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then ! mid cloud 772 772 cldlayphase(i,ncol,2,2) = 1._wp 773 773 else ! low cloud … … 776 776 cldlayphase(i,ncol,4,5) = 1._wp ! tot cloud 777 777 ! High cloud 778 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then778 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 779 779 cldlayphase(i,ncol,3,5) = 1._wp 780 780 ! Middle cloud 781 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then781 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 782 782 cldlayphase(i,ncol,2,5) = 1._wp 783 783 ! Low cloud … … 791 791 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 792 792 ! High cloud 793 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then793 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 794 794 cldlayphase(i,ncol,3,1) = 1._wp 795 795 ! Middle cloud 796 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then796 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 797 797 cldlayphase(i,ncol,2,1) = 1._wp 798 798 ! Low cloud … … 811 811 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 812 812 ! High cloud 813 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then813 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 814 814 cldlayphase(i,ncol,3,2) = 1._wp 815 815 ! Middle cloud 816 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then816 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 817 817 cldlayphase(i,ncol,2,2) = 1._wp 818 818 ! Low cloud … … 827 827 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 828 828 ! High cloud 829 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then829 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 830 830 cldlayphase(i,ncol,3,4) = 1._wp 831 831 ! Middle cloud 832 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then832 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 833 833 cldlayphase(i,ncol,2,4) = 1._wp 834 834 ! Low cloud … … 838 838 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 839 839 ! High cloud 840 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then840 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 841 841 cldlayphase(i,ncol,3,1) = 1._wp 842 842 ! Middle cloud 843 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then843 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 844 844 cldlayphase(i,ncol,2,1) = 1._wp 845 845 ! Low cloud … … 859 859 p1 = pplay(i,nlev) 860 860 861 if((cldy(i,ncol,nlev) .eq. 1.) . and. (ATBperp(i,ncol,nlev) .gt. 0.) )then861 if((cldy(i,ncol,nlev) .eq. 1.) .AND. (ATBperp(i,ncol,nlev) .gt. 0.) )then 862 862 ! Computation of the ATBperp of the phase discrimination line 863 863 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 875 875 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 876 876 ! High cloud 877 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then877 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 878 878 cldlayphase(i,ncol,3,2) = 1._wp 879 879 ! Middle cloud 880 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then880 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 881 881 cldlayphase(i,ncol,2,2) = 1._wp 882 882 ! Low cloud … … 887 887 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 888 888 ! High cloud 889 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then889 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 890 890 cldlayphase(i,ncol,3,5) = 1._wp 891 891 ! Middle cloud 892 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then892 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 893 893 cldlayphase(i,ncol,2,5) = 1._wp 894 894 ! Low cloud … … 902 902 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 903 903 ! High cloud 904 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then904 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 905 905 cldlayphase(i,ncol,3,1) = 1._wp 906 906 ! Middle cloud 907 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt.(680._wp*100._wp)) then907 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt.(680._wp*100._wp)) then 908 908 cldlayphase(i,ncol,2,1) = 1._wp 909 909 ! Low cloud … … 923 923 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 924 924 ! High cloud 925 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then925 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 926 926 cldlayphase(i,ncol,3,2) = 1._wp 927 927 ! Middle cloud 928 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then928 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 929 929 cldlayphase(i,ncol,2,2) = 1._wp 930 930 ! Low cloud … … 939 939 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 940 940 ! High cloud 941 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then941 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 942 942 cldlayphase(i,ncol,3,4) = 1._wp 943 943 ! Middle 944 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then944 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 945 945 cldlayphase(i,ncol,2,4) = 1._wp 946 946 ! Low cloud … … 951 951 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 952 952 ! High cloud 953 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then953 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 954 954 cldlayphase(i,ncol,3,1) = 1._wp 955 955 ! Middle cloud 956 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then956 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 957 957 cldlayphase(i,ncol,2,1) = 1._wp 958 958 ! Low cloud … … 986 986 cldlayphase(i,ncol,4,3) = 1._wp ! tot cloud 987 987 ! High cloud 988 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then988 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 989 989 cldlayphase(i,ncol,3,3) = 1._wp 990 990 ! Middle cloud 991 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then991 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 992 992 cldlayphase(i,ncol,2,3) = 1._wp 993 993 ! Low cloud … … 1087 1087 DO itemp=1,Ntemp 1088 1088 if(tmpi(i,ncol,nlev).gt.0.)then 1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1090 1090 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1._wp 1091 1091 endif 1092 1092 elseif(tmpl(i,ncol,nlev) .gt. 0.)then 1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1094 1094 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1._wp 1095 1095 endif 1096 1096 elseif(tmpu(i,ncol,nlev) .gt. 0.)then 1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1098 1098 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1._wp 1099 1099 endif … … 1193 1193 DO k=1,Nlevels 1194 1194 ! Cloud detection at subgrid-scale: 1195 where ((x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )1195 where ((x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 1196 1196 cldy(:,:,k)=1._wp 1197 1197 elsewhere … … 1200 1200 1201 1201 ! Number of usefull sub-columns: 1202 where ((x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )1202 where ((x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 1203 1203 srok(:,:,k)=1._wp 1204 1204 elsewhere … … 1216 1216 iz=1 1217 1217 p1 = pplay(ip,k) 1218 if ( p1.gt.0. . and. p1.lt.(440._wp*100._wp)) then ! high clouds1218 if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds 1219 1219 iz=3 1220 else if(p1.ge.(440._wp*100._wp) . and. p1.lt.(680._wp*100._wp)) then ! mid clouds1220 else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds 1221 1221 iz=2 1222 1222 endif … … 1344 1344 DO k=1,Nlevels 1345 1345 ! Cloud detection at subgrid-scale: 1346 where ( (x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )1346 where ( (x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 1347 1347 cldy(:,:,k)=1._wp 1348 1348 elsewhere … … 1350 1350 endwhere 1351 1351 ! Fully attenuated layer detection at subgrid-scale: 1352 where ( (x(:,:,k) .lt. S_att_opaq) . and. (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG1352 where ( (x(:,:,k) .lt. S_att_opaq) .AND. (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG 1353 1353 cldyopaq(:,:,k)=1._wp 1354 1354 elsewhere … … 1358 1358 1359 1359 ! Number of usefull sub-column layers: 1360 where ( (x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )1360 where ( (x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 1361 1361 srok(:,:,k)=1._wp 1362 1362 elsewhere … … 1364 1364 endwhere 1365 1365 ! Number of usefull sub-columns layers for z_opaque 3D fraction: 1366 where ( (x(:,:,k) .ge. 0.) . and. (x(:,:,k) .ne. undef) ) !DEBUG1366 where ( (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG 1367 1367 srokopaq(:,:,k)=1._wp 1368 1368 elsewhere … … 1397 1397 1398 1398 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1399 if ( cldlay(ip,ic,4).gt. 0. . and. cldlay(ip,ic,1) .eq. 0. ) then1399 if ( cldlay(ip,ic,4).gt. 0. .AND. cldlay(ip,ic,1) .eq. 0. ) then 1400 1400 cldlay(ip,ic,2) = 1._wp 1401 1401 endif … … 1410 1410 ! Declaring z_opaque altitude and opaque cloud fraction for 3D and 2D variables 1411 1411 ! From SFC-2-TOA ( actually from vgrid_z(SFC+1) = vgrid_z(Nlevels-1) ) 1412 if ( cldy(ip,ic,Nlevels-k) .eq. 1. . and. zopac .eq. 0. ) then1412 if ( cldy(ip,ic,Nlevels-k) .eq. 1. .AND. zopac .eq. 0. ) then 1413 1413 lidarcldtype(ip,Nlevels-k + 1,3) = lidarcldtype(ip,Nlevels-k + 1,3) + 1._wp 1414 1414 cldlay(ip,ic,3) = vgrid_z(Nlevels-k+1) ! z_opaque altitude … … 1442 1442 ! Declaring thin cloud fraction for 3D variable 1443 1443 ! From TOA-2-SFC 1444 if ( cldy(ip,ic,k) .eq. 1. . and. topcloud .eq. 1. ) then1444 if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 1. ) then 1445 1445 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1446 1446 z_base = k ! bottom cloud layer 1447 1447 endif 1448 if ( cldy(ip,ic,k) .eq. 1. . and. topcloud .eq. 0. ) then1448 if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 0. ) then 1449 1449 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1450 1450 z_top = k ! top cloud layer … … 1458 1458 cloudemis = 0._wp 1459 1459 DO k=z_base+1,Nlevels 1460 if ( (x(ip,ic,k) .gt. S_att_opaq) . and. (x(ip,ic,k) .lt. 1.0) .and. (x(ip,ic,k) .ne. undef) ) then1460 if ( (x(ip,ic,k) .gt. S_att_opaq) .AND. (x(ip,ic,k) .lt. 1.0) .AND. (x(ip,ic,k) .ne. undef) ) then 1461 1461 srmean = srmean + x(ip,ic,k) 1462 1462 srcount = srcount + 1. … … 1502 1502 DO ip = 1, Npoints 1503 1503 DO k = 2, Nlevels 1504 if ( (lidarcldtype(ip,k,3) .ne. undef) . and. (lidarcldtype(ip,k-1,4) .ne. undef) ) then1504 if ( (lidarcldtype(ip,k,3) .ne. undef) .AND. (lidarcldtype(ip,k-1,4) .ne. undef) ) then 1505 1505 lidarcldtype(ip,k,4) = lidarcldtype(ip,k,3) + lidarcldtype(ip,k-1,4) 1506 1506 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r5160 r5185 311 311 312 312 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 313 if ((itap.ge.1). and.(first_write))then313 if ((itap.ge.1).AND.(first_write))then 314 314 IF (using_xios) call read_xiosfieldactive(cfg) 315 315 first_write=.false. … … 344 344 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov 345 345 346 endif !(itap.gt.1). and.(first_write)346 endif !(itap.gt.1).AND.(first_write) 347 347 348 348 time_bnds(1) = dtime-dtime/2. -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r5158 r5185 389 389 ! do k=1,PARASOL_NREFL 390 390 ! do ip=1, Npoints 391 ! if (stlidar%cldlayer(ip,4).gt.1. and.stlidar%parasolrefl(ip,k).ne.missing_val) then391 ! if (stlidar%cldlayer(ip,4).gt.1.AND.stlidar%parasolrefl(ip,k).ne.missing_val) then 392 392 ! parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)/100.))/ & 393 393 ! (stlidar%cldlayer(ip,4)/100.) … … 470 470 471 471 !!! Sorties combinees Cloudsat et Calipso 472 if (cfg%Lcalipso . and. cfg%Lcloudsat) then472 if (cfg%Lcalipso .AND. cfg%Lcloudsat) then 473 473 474 474 if (cfg%Lclcalipso2) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90
r5158 r5185 361 361 DO i=1,nPoints 362 362 DO j=1,nLevels 363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 . and. j .eq. 1)) then363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .AND. j .eq. 1)) then 364 364 g_vol(i,j) = gases(cospstateIN%pfull(i,j), cospstateIN%at(i,j),cospstateIN%qv(i,j),cospIN%rcfg_cloudsat%freq) 365 365 endif -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90
r5158 r5185 223 223 end if 224 224 end do 225 where((retrievedSize(1:nSubCols) < 0.). and.(retrievedSize(1:nSubCols) /= R_UNDEF)) &225 where((retrievedSize(1:nSubCols) < 0.).AND.(retrievedSize(1:nSubCols) /= R_UNDEF)) & 226 226 retrievedSize(1:nSubCols) = 1.0e-06_wp*re_fill 227 227 … … 229 229 ! mimics what MODIS does to first order. 230 230 ! Of course, ISCCP cloud top pressures are in mb. 231 where(cloudMask(1:nSubCols) . and. retrievedCloudTopPressure(1:nSubCols) > CO2Slicing_PressureLimit) &231 where(cloudMask(1:nSubCols) .AND. retrievedCloudTopPressure(1:nSubCols) > CO2Slicing_PressureLimit) & 232 232 retrievedCloudTopPressure(1:nSubCols) = isccpCloudTopPressure! * 100._wp 233 233 … … 297 297 ! ######################################################################################## 298 298 validRetrievalMask(1:nPoints,1:nSubCols) = particle_size(1:nPoints,1:nSubCols) > 0. 299 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone . and. &299 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone .AND. & 300 300 validRetrievalMask(1:nPoints,1:nSubCols) 301 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid . and. &301 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid .AND. & 302 302 validRetrievalMask(1:nPoints,1:nSubCols) 303 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce . and. &303 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce .AND. & 304 304 validRetrievalMask(1:nPoints,1:nSubCols) 305 305 … … 310 310 Cloud_Fraction_Water_Mean(1:nPoints) = real(count(waterCloudMask, dim = 2)) 311 311 Cloud_Fraction_Ice_Mean(1:nPoints) = real(count(iceCloudMask, dim = 2)) 312 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure <= &312 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure <= & 313 313 highCloudPressureLimit, dim = 2)) 314 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure > &314 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure > & 315 315 lowCloudPressureLimit, dim = 2)) 316 316 Cloud_Fraction_Mid_Mean(1:nPoints) = Cloud_Fraction_Total_Mean(1:nPoints) - Cloud_Fraction_High_Mean(1:nPoints)& -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90
r5158 r5185 118 118 DO it=1,PARASOL_NREFL 119 119 DO ny=1,PARASOL_NTAU-1 120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny). and. &120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny).AND. & 121 121 tautot_S(1:npoints) .le. PARASOL_TAU(ny+1)) 122 122 rlumA_mod(1:npoints,it) = aA(it,ny)*tautot_S(1:npoints) + bA(it,ny) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90
r5158 r5185 200 200 endif 201 201 enddo ! loop over ncol 202 if ((flag_ls .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE202 if ((flag_ls .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 203 203 DO ibox=1,ncol 204 204 if (frac_out(j,ibox,ilev+1) .eq. 1) then … … 236 236 endif 237 237 enddo ! loop over ncol 238 if ((flag_cv .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE238 if ((flag_cv .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 239 239 DO ibox=1,ncol 240 240 if (frac_out(j,ibox,ilev+1) .eq. 2) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90
r5158 r5185 179 179 180 180 ! Attenuation due to gaseous absorption between radar and volume 181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 . and. pr .eq. 1)) then181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .AND. pr .eq. 1)) then 182 182 if (d_gate==1) then 183 183 if (k>1) then … … 402 402 DO pr=1,Ncolumns 403 403 ! 1) Compute the PIA in all profiles containing hydrometeors 404 if ( (Ze_non_out(i,pr,cloudsat_preclvl).gt.-100) . and. (Ze_out(i,pr,cloudsat_preclvl).gt.-100) ) then405 if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) . and. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then404 if ( (Ze_non_out(i,pr,cloudsat_preclvl).gt.-100) .AND. (Ze_out(i,pr,cloudsat_preclvl).gt.-100) ) then 405 if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) .AND. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then 406 406 cloudsat_precip_pia(i,pr) = Ze_non_out(i,pr,cloudsat_preclvl) - Ze_out(i,pr,cloudsat_preclvl) 407 407 endif … … 419 419 cloudsat_pflag(i,pr) = pClass_Snow2 ! TSL: Snow certain 420 420 endif 421 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &421 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 422 422 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 423 423 cloudsat_pflag(i,pr) = pClass_Snow1 ! TSL: Snow possible … … 426 426 427 427 ! Mixed 428 if(fracPrecipIce(i,pr).gt.0.1. and.fracPrecipIce(i,pr).le.0.9) then428 if(fracPrecipIce(i,pr).gt.0.1.AND.fracPrecipIce(i,pr).le.0.9) then 429 429 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(2)) then 430 430 cloudsat_pflag(i,pr) = pClass_Mixed2 ! TSL: Mixed certain 431 431 endif 432 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &432 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 433 433 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 434 434 cloudsat_pflag(i,pr) = pClass_Mixed1 ! TSL: Mixed possible … … 441 441 cloudsat_pflag(i,pr) = pClass_Rain3 ! TSL: Rain certain 442 442 endif 443 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(3). and. &443 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(3).AND. & 444 444 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(1)) then 445 445 cloudsat_pflag(i,pr) = pClass_Rain2 ! TSL: Rain probable 446 446 endif 447 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &447 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 448 448 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(3)) then 449 449 cloudsat_pflag(i,pr) = pClass_Rain1 ! TSL: Rain possible … … 472 472 cloudsat_pflag(i,pr) = pClass_Snow2 ! JEK: Snow certain 473 473 endif 474 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) . and. &474 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .AND. & 475 475 Ze_out(i,pr,cloudsat_preclvl).le.Zbinvallnd(5)) then 476 476 cloudsat_pflag(i,pr) = pClass_Snow1 ! JEK: Snow possible … … 479 479 480 480 ! Mized phase (273<T<275) 481 if(t2m(i) .ge. 273._wp . and. t2m(i) .le. 275._wp) then482 if ((Zmax .gt. Zbinvallnd(1) . and. cloudsat_precip_pia(i,pr).gt.30) .or. &481 if(t2m(i) .ge. 273._wp .AND. t2m(i) .le. 275._wp) then 482 if ((Zmax .gt. Zbinvallnd(1) .AND. cloudsat_precip_pia(i,pr).gt.30) .or. & 483 483 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(4))) then 484 484 cloudsat_pflag(i,pr) = pClass_Mixed2 ! JEK: Mixed certain 485 485 endif 486 if ((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) . and. &487 Ze_out(i,pr,cloudsat_preclvl) .le. Zbinvallnd(4)) . and. &486 if ((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .AND. & 487 Ze_out(i,pr,cloudsat_preclvl) .le. Zbinvallnd(4)) .AND. & 488 488 (Zmax .gt. Zbinvallnd(5)) ) then 489 489 cloudsat_pflag(i,pr) = pClass_Mixed1 ! JEK: Mixed possible … … 493 493 ! Rain (T>275) 494 494 if(t2m(i) .gt. 275) then 495 if ((Zmax .gt. Zbinvallnd(1) . and. cloudsat_precip_pia(i,pr).gt.30) .or. &495 if ((Zmax .gt. Zbinvallnd(1) .AND. cloudsat_precip_pia(i,pr).gt.30) .or. & 496 496 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(2))) then 497 497 cloudsat_pflag(i,pr) = pClass_Rain3 ! JEK: Rain certain 498 498 endif 499 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) . and. &499 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .AND. & 500 500 (Zmax .gt. Zbinvallnd(3))) then 501 501 cloudsat_pflag(i,pr) = pClass_Rain2 ! JEK: Rain probable 502 502 endif 503 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) . and. &503 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .AND. & 504 504 (Zmax.lt.Zbinvallnd(3))) then 505 505 cloudsat_pflag(i,pr) = pClass_Rain1 ! JEK: Rain possible … … 536 536 537 537 ! Normalize by number of subcolumns 538 where ((cloudsat_precip_cover /= R_UNDEF). and.(cloudsat_precip_cover /= 0.0)) &538 where ((cloudsat_precip_cover /= R_UNDEF).AND.(cloudsat_precip_cover /= 0.0)) & 539 539 cloudsat_precip_cover = cloudsat_precip_cover / Ncolumns 540 where ((cloudsat_pia/= R_UNDEF). and.(cloudsat_pia/= 0.0)) &540 where ((cloudsat_pia/= R_UNDEF).AND.(cloudsat_pia/= 0.0)) & 541 541 cloudsat_pia = cloudsat_pia / Ncolumns 542 542 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90
r5158 r5185 145 145 hydro = .false. 146 146 DO j=1,rcfg%nhclass 147 if ((hm_matrix(pr,k,j) > 1E-12) . and. (sd%dtype(j) > 0)) then147 if ((hm_matrix(pr,k,j) > 1E-12) .AND. (sd%dtype(j) > 0)) then 148 148 hydro = .true. 149 149 exit … … 217 217 ! Use Ze_scaled, Zr_scaled, and kr_scaled ... if know them 218 218 ! if not we will calculate Ze, Zr, and Kr from the distribution parameters 219 ! if( rcfg%Z_scale_flag(tp,itt,iRe_type) . and. .not. DO_LUT_TEST) then219 ! if( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. .not. DO_LUT_TEST) then 220 220 ! ! can use z scaling 221 221 ! scale_factor=rho_a*hm_matrix(pr,k,tp) … … 272 272 else 273 273 ! I assume here that water phase droplets are spheres. 274 ! sd%rho should be ~ 1000 or sd%apm=524 . and. sd%bpm=3274 ! sd%rho should be ~ 1000 or sd%apm=524 .AND. sd%bpm=3 275 275 Deq = Di 276 276 endif … … 292 292 ! NOTE: if .not. DO_LUT_TEST, then you are checking the LUT approximation 293 293 ! not just the DSD representation given by Ni 294 if(Np_matrix(pr,k,tp)>0 . and. DO_NP_TEST ) then294 if(Np_matrix(pr,k,tp)>0 .AND. DO_NP_TEST ) then 295 295 Np = path_integral(Ni,Di,1,ns-1)/rho_a*1.E6_wp 296 296 ! Note: Representation is not great or small Re < 2 … … 305 305 ! LUT test code 306 306 ! This segment of code compares full calculation to scaling result 307 if ( rcfg%Z_scale_flag(tp,itt,iRe_type) . and. DO_LUT_TEST ) then307 if ( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. DO_LUT_TEST ) then 308 308 scale_factor=rho_a*hm_matrix(pr,k,tp) 309 309 ! if more than 2 dBZe difference print error message/parameters. … … 398 398 399 399 ! If density is constant, set equivalent values for apm and bpm 400 if ((rho_c > 0) . and. (apm < 0)) then400 if ((rho_c > 0) .AND. (apm < 0)) then 401 401 apm = (pi/6)*rho_c 402 402 bpm = 3._wp … … 405 405 ! Exponential is same as modified gamma with vu =1 406 406 ! if Np is specified then we will just treat as modified gamma 407 if(dtype .eq. 2 . and. Np .gt. 0) then407 if(dtype .eq. 2 .AND. Np .gt. 0) then 408 408 local_dtype = 1 409 409 local_p3 = 1 … … 441 441 endif 442 442 443 if( Np.eq.0 . and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default443 if( Np.eq.0 .AND. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 444 444 dm = p2 ! by definition, should have units of microns 445 445 D0 = gamma(vu)/gamma(vu+1)*dm … … 525 525 526 526 ! get rg ... 527 if( Np.eq.0 . and. (abs(p2+1) > 1E-8) ) then ! use default value of rg527 if( Np.eq.0 .AND. (abs(p2+1) > 1E-8) ) then ! use default value of rg 528 528 rg = p2 529 529 else … … 640 640 641 641 ! If density is constant, store equivalent values for apm and bpm 642 if ((rho_c > 0) . and. (apm < 0)) then642 if ((rho_c > 0) .AND. (apm < 0)) then 643 643 apm = (pi/6)*rho_c 644 644 bpm = 3._wp … … 648 648 ! if only Np given then calculate Re 649 649 ! if neigher than use other defaults (p1,p2,p3) following quickbeam documentation 650 if(Re==0 . and. Np>0) then650 if(Re==0 .AND. Np>0) then 651 651 call calc_Re(Q,Np,rho_a,dtype,apm,bpm,rho_c,p1,p2,p3,Re) 652 652 endif … … 754 754 if (tc < -30) then 755 755 bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp) 756 elseif ((tc >= -30) . and. (tc < -9)) then756 elseif ((tc >= -30) .AND. (tc < -9)) then 757 757 bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp) 758 758 else … … 764 764 if (tc < -35) then 765 765 bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp) 766 elseif ((tc >= -35) . and. (tc < -17.5)) then766 elseif ((tc >= -35) .AND. (tc < -17.5)) then 767 767 bhp = -2.65_wp+0.09_wp*((tc+273._wp)-255.66_wp) 768 elseif ((tc >= -17.5) . and. (tc < -9)) then768 elseif ((tc >= -17.5) .AND. (tc < -9)) then 769 769 bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp) 770 770 else … … 969 969 970 970 correct_for_rho = 0 971 if ((ice == 1) . and. (minval(rho_e) >= 0)) correct_for_rho = 1971 if ((ice == 1) .AND. (minval(rho_e) >= 0)) correct_for_rho = 1 972 972 973 973 ! Correct refractive index for ice density if needed -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90
r5158 r5185 75 75 76 76 ! Test for valid input overlap assumption 77 if (overlap .ne. 1 . and. overlap .ne. 2 .and. overlap .ne. 3) then77 if (overlap .ne. 1 .AND. overlap .ne. 2 .AND. overlap .ne. 3) then 78 78 overlap=default_overlap 79 79 call errorMessage('ERROR(scops): Invalid overlap assumption provided. Using default overlap assumption (max/ran)') … … 180 180 !threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 181 181 !maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) . and. &182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .AND. & 183 183 ! (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 184 184 if (ilev .ne. 1) then 185 185 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 186 186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) . and. &187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .AND. & 188 188 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 189 189 else 190 190 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(0._wp,tca(1:npoints,ilev))) 191 191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 192 min(0._wp,tca(1:npoints,ilev)) . and. &192 min(0._wp,tca(1:npoints,ilev)) .AND. & 193 193 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 194 194 endif … … 208 208 209 209 ! Code to partition boxes into startiform and convective parts goes here 210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) . and. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) .AND. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2 211 211 ENDDO ! ibox 212 212
Note: See TracChangeset
for help on using the changeset viewer.