Ignore:
Timestamp:
Sep 11, 2024, 4:27:07 PM (9 days ago)
Author:
abarral
Message:

Replace REPROBUS CPP KEY by logical using handmade wonky wrapper

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  
    110110          DO ilev=1,nlev
    111111             ! 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.) then
     112             if(thres_crossed_MISR .eq. 0 .AND. dtau(j,ibox,ilev) .gt. 0.) then
    113113                ! First encountered a "cloud"
    114114                thres_crossed_MISR = 1 
     
    116116             endif
    117117
    118              if( thres_crossed_MISR .lt. 99 .and. thres_crossed_MISR .gt. 0 ) then
     118             if( thres_crossed_MISR .lt. 99 .AND. thres_crossed_MISR .gt. 0 ) then
    119119                if( dtau(j,ibox,ilev) .eq. 0.) then
    120120                   ! We have come to the end of the current cloud layer without yet
     
    129129                ! current layer cloud top to the current level then MISR will like
    130130                ! 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) then
     131                if( dtau(j,ibox,ilev).gt.0 .AND. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then
    132132                   if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then
    133133                      ! MISR will likely penetrate to some point within this layer ... the middle
     
    142142               
    143143                ! Check for a distinctive water layer
    144                 if(dtau(j,ibox,ilev) .gt. 1 .and. at(j,ilev) .gt. 273 ) then
     144                if(dtau(j,ibox,ilev) .gt. 1 .AND. at(j,ilev) .gt. 273 ) then
    145145                   ! Must be a water cloud, take this as CTH level
    146146                   thres_crossed_MISR=99
     
    191191!       ! Adjust based on neightboring points.
    192192!       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. &
    196196!             box_MISR_ztop(j,1) .lt. box_MISR_ztop(j+1,1)) then
    197197!             box_MISR_ztop(j,1) = box_MISR_ztop(j+1,1)   
     
    202202!       do j=1,npoints
    203203!          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. &
    207207!                 box_MISR_ztop(j,ibox) .lt. box_MISR_ztop(j,ibox+1)) then
    208208!                 box_MISR_ztop(j,ibox) = box_MISR_ztop(j,ibox+1)   
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90

    r5158 r5185  
    381381    ! 1) Determine if using full inputs or subset
    382382    !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    383     if (present(start_idx) .and. present(stop_idx)) then
     383    if (present(start_idx) .AND. present(stop_idx)) then
    384384       ij=start_idx
    385385       ik=stop_idx
     
    932932
    933933       ! 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.                             &
    935935              (cospOUT%isccp_totalcldarea < 1.0+1.e-5))
    936936              cospOUT%isccp_totalcldarea = 1.0
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90

    r5158 r5185  
    306306    ! Do we need to generate optical inputs for Parasol simulator?
    307307    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.
    309309   
    310310    ! Are optical-depths and backscatter coefficients for ice and liquid requested?
    311311    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. &
    313313         present(tautot_ice)) lphaseoptics=.true.
    314314
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90

    r5158 r5185  
    217217          DO j=1,Nlevels
    218218             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 = j
     219             if ((sc_ratio .le. s_att) .AND. (flag_sat .eq. 0)) flag_sat = j
    220220             if (Ze_tot(pr,i,j) .lt. -30.) then  !radar can't detect cloud
    221221                if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then  !lidar sense cloud
     
    267267   
    268268    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))
    270270       if (count(var .eq. R_GROUND) .ge. 1) hist1D(ij-1)=R_UNDEF
    271271    enddo
     
    300300    DO ij=2,nbin1+1
    301301       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))
    304304       enddo
    305305    enddo
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90

    r5158 r5185  
    8585                        mxratio(i,j,k)=mxratio(i,j,k)/rho
    8686                        ! Compute effective radius
    87 !                        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
     87!                        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
    8989                           lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1._wp/delta)
    9090                           reff(i,j,k) = gamma_4_3_2/lambda_x
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90

    r5159 r5185  
    232232
    233233       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. &
    236236                at(1:npoints,ilev)    .lt. attropmin(1:npoints))
    237237             ptrop(1:npoints)     = pfull(1:npoints,ilev)
     
    244244       DO ilev=1,nlev
    245245          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))
    247247       enddo
    248248    end if
     
    350350          if (isccp_top_height .eq. 1) then
    351351             DO j=1,npoints
    352                 if (transmax(j) .gt. 0.001 .and.  transmax(j) .le. 0.9999999) then
     352                if (transmax(j) .gt. 0.001 .AND.  transmax(j) .le. 0.9999999) then
    353353                   fluxtopinit(j) = fluxtop(j,ibox)
    354354                   tauir(j) = tau(j,ibox)/2.13_wp
     
    358358                DO j=1,npoints
    359359                   if (tau(j,ibox) .gt. (tauchk)) then
    360                       if (transmax(j) .gt. 0.001 .and.  transmax(j) .le. 0.9999999) then
     360                      if (transmax(j) .gt. 0.001 .AND.  transmax(j) .le. 0.9999999) then
    361361                         emcld(j,ibox) = 1._wp - exp(-1._wp * tauir(j)  )
    362362                         fluxtop(j,ibox) = fluxtopinit(j) - ((1.-emcld(j,ibox))*fluxtop_clrsky(j))
     
    375375          where(tau(1:npoints,ibox) .gt. tauchk)
    376376             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))
    378378                tb(1:npoints,ibox) = attrop(1:npoints) - 5._wp
    379379                tau(1:npoints,ibox) = 2.13_wp*taumin(1:npoints)
     
    406406             ilev = merge(nlev-k1,k1,isccp_top_height_direction .eq. 2)       
    407407             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. &
    410410                      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. &
    412412                      at(j,ilev+1) .ge. tb(j,ibox)))) then
    413413                   nmatch(j)=nmatch(j)+1
     
    441441          ptop(1:npoints,ibox)=0.
    442442          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))
    444444                ptop(1:npoints,ibox)=phalf(1:npoints,ilev)
    445445                levmatch(1:npoints,ibox)=ilev
     
    460460    DO ibox=1,ncol
    461461       DO j=1,npoints
    462           if (tau(j,ibox) .gt. (tauchk) .and. ptop(j,ibox) .gt. 0.) then
     462          if (tau(j,ibox) .gt. (tauchk) .AND. ptop(j,ibox) .gt. 0.) then
    463463             if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then
    464464                boxtau(j,ibox) = tau(j,ibox)
     
    561561    DO j=1,npoints
    562562       ! 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.)
    564564
    565565       ! Compute joint histogram and column quantities for points that are sunlit and cloudy
     
    572572         
    573573          ! Column cloud area
    574           totalcldarea(j) = real(count(box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol
     574          totalcldarea(j) = real(count(box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol
    575575             
    576576          ! Subcolumn cloud albedo
    577577          !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)
    580580             albedocld(j,1:ncol) = (boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp)
    581581          elsewhere
     
    587587         
    588588          ! Column cloud top pressure
    589           meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .and. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol
     589          meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol
    590590       endif
    591591    enddo
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90

    r5160 r5185  
    152152    ! Phase optics?
    153153    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. &
    155155         present(tautot_ice)) lphaseoptics=.true.
    156156   
     
    400400       DO ic = 1, ncol
    401401          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.          &
    403403                (betamolFlip(:,1,:) .gt. 0.0 ))
    404404             x3d_c = pnorm_c/betamolFlip(:,1,:)
     
    429429       DO ic = 1, ncol
    430430          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 ))
    432432             x3d_c = pnorm_c/pmol
    433433          elsewhere
     
    650650    DO k=1,Nlevels
    651651       ! 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) )
    653653          cldy(:,:,k)=1._wp
    654654       elsewhere
     
    657657       
    658658       ! 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) )
    660660          srok(:,:,k)=1._wp
    661661       elsewhere
     
    679679             if(srok(ip,ic,k).gt.0.)then
    680680                DO itemp=1,Ntemp
    681                    if( (tmp(ip,k).ge.tempmod(itemp)).and.(tmp(ip,k).lt.tempmod(itemp+1)) )then
     681                   if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then
    682682                      lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1._wp
    683683                   endif
     
    687687             if(cldy(ip,ic,k).eq.1.)then
    688688                DO itemp=1,Ntemp
    689                    if( (tmp(ip,k) .ge. tempmod(itemp)).and.(tmp(ip,k) .lt. tempmod(itemp+1)) )then
     689                   if( (tmp(ip,k) .ge. tempmod(itemp)).AND.(tmp(ip,k) .lt. tempmod(itemp+1)) )then
    690690                      lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1._wp
    691691                   endif
     
    695695             iz=1
    696696             p1 = pplay(ip,k)
    697              if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds
     697             if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds
    698698                iz=3
    699              else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds
     699             else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds
    700700                iz=2
    701701             endif
     
    748748
    749749             ! Avoid zero values
    750              if( (cldy(i,ncol,nlev).eq.1.) .and. (ATBperp(i,ncol,nlev).gt.0.) )then
     750             if( (cldy(i,ncol,nlev).eq.1.) .AND. (ATBperp(i,ncol,nlev).gt.0.) )then
    751751                ! Computation of the ATBperp along the phase discrimination line
    752752                ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + &
     
    767767                                                                              ! to classify the phase cloud
    768768                      cldlayphase(i,ncol,4,2) = 1. ! tot cloud
    769                       if (p1 .gt. 0. .and. p1.lt.(440._wp*100._wp)) then ! high cloud
     769                      if (p1 .gt. 0. .AND. p1.lt.(440._wp*100._wp)) then ! high cloud
    770770                         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 cloud
     771                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then ! mid cloud
    772772                         cldlayphase(i,ncol,2,2) = 1._wp
    773773                      else ! low cloud
     
    776776                      cldlayphase(i,ncol,4,5) = 1._wp ! tot cloud
    777777                      ! High cloud
    778                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     778                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    779779                         cldlayphase(i,ncol,3,5) = 1._wp
    780780                      ! Middle cloud
    781                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     781                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    782782                         cldlayphase(i,ncol,2,5) = 1._wp
    783783                      ! Low cloud
     
    791791                      cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud
    792792                      ! High cloud
    793                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     793                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    794794                         cldlayphase(i,ncol,3,1) = 1._wp
    795795                      ! Middle cloud   
    796                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     796                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    797797                         cldlayphase(i,ncol,2,1) = 1._wp
    798798                      ! Low cloud
     
    811811                      cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud
    812812                      ! High cloud
    813                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     813                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    814814                         cldlayphase(i,ncol,3,2) = 1._wp
    815815                      ! Middle cloud   
    816                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     816                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    817817                         cldlayphase(i,ncol,2,2) = 1._wp
    818818                      ! Low cloud   
     
    827827                      cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud
    828828                      ! High cloud
    829                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     829                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    830830                         cldlayphase(i,ncol,3,4) = 1._wp
    831831                      ! Middle cloud   
    832                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     832                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    833833                         cldlayphase(i,ncol,2,4) = 1._wp
    834834                      ! Low cloud
     
    838838                      cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud
    839839                      ! High cloud
    840                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     840                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    841841                         cldlayphase(i,ncol,3,1) = 1._wp
    842842                      ! Middle cloud   
    843                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     843                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    844844                         cldlayphase(i,ncol,2,1) = 1._wp
    845845                      ! Low cloud   
     
    859859             p1 = pplay(i,nlev)
    860860
    861              if((cldy(i,ncol,nlev) .eq. 1.) .and. (ATBperp(i,ncol,nlev) .gt. 0.) )then
     861             if((cldy(i,ncol,nlev) .eq. 1.) .AND. (ATBperp(i,ncol,nlev) .gt. 0.) )then
    862862                ! Computation of the ATBperp of the phase discrimination line
    863863                ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + &
     
    875875                      cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud
    876876                      ! High cloud
    877                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     877                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    878878                         cldlayphase(i,ncol,3,2) = 1._wp
    879879                      ! Middle cloud   
    880                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     880                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    881881                         cldlayphase(i,ncol,2,2) = 1._wp
    882882                      ! Low cloud
     
    887887                      cldlayphase(i,ncol,4,5) = 1. ! tot cloud
    888888                      ! High cloud
    889                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     889                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    890890                         cldlayphase(i,ncol,3,5) = 1._wp
    891891                      ! Middle cloud   
    892                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     892                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    893893                         cldlayphase(i,ncol,2,5) = 1._wp
    894894                      ! Low cloud   
     
    902902                      cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud
    903903                      ! High cloud
    904                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     904                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    905905                         cldlayphase(i,ncol,3,1) = 1._wp
    906906                      ! Middle cloud   
    907                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt.(680._wp*100._wp)) then
     907                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt.(680._wp*100._wp)) then
    908908                         cldlayphase(i,ncol,2,1) = 1._wp
    909909                      ! Low cloud   
     
    923923                      cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud
    924924                      ! High cloud
    925                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     925                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    926926                         cldlayphase(i,ncol,3,2) = 1._wp
    927927                      ! Middle cloud   
    928                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     928                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    929929                         cldlayphase(i,ncol,2,2) = 1._wp
    930930                      ! Low cloud   
     
    939939                      cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud
    940940                      ! High cloud
    941                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     941                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    942942                         cldlayphase(i,ncol,3,4) = 1._wp
    943943                      ! Middle   
    944                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     944                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    945945                         cldlayphase(i,ncol,2,4) = 1._wp
    946946                      ! Low cloud   
     
    951951                      cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud
    952952                      ! High cloud
    953                       if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     953                      if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    954954                         cldlayphase(i,ncol,3,1) = 1._wp
    955955                      ! Middle cloud   
    956                       else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     956                      else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    957957                         cldlayphase(i,ncol,2,1) = 1._wp
    958958                      ! Low cloud   
     
    986986                   cldlayphase(i,ncol,4,3) = 1._wp ! tot cloud
    987987                   ! High cloud
    988                    if (p1 .gt. 0. .and. p1 .lt. (440._wp*100._wp)) then
     988                   if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then
    989989                      cldlayphase(i,ncol,3,3) = 1._wp
    990990                   ! Middle cloud   
    991                    else if(p1 .ge. (440._wp*100._wp) .and. p1 .lt. (680._wp*100._wp)) then
     991                   else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then
    992992                      cldlayphase(i,ncol,2,3) = 1._wp
    993993                   ! Low cloud   
     
    10871087             DO itemp=1,Ntemp
    10881088                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)) )then
     1089                   if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then
    10901090                      lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1._wp
    10911091                   endif
    10921092                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)) )then
     1093                   if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then
    10941094                      lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1._wp
    10951095                   endif
    10961096                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)) )then
     1097                   if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then
    10981098                      lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1._wp
    10991099                   endif
     
    11931193    DO k=1,Nlevels
    11941194       ! 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) )
    11961196          cldy(:,:,k)=1._wp
    11971197       elsewhere
     
    12001200       
    12011201       ! 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) )
    12031203          srok(:,:,k)=1._wp
    12041204       elsewhere
     
    12161216             iz=1
    12171217             p1 = pplay(ip,k)
    1218              if ( p1.gt.0. .and. p1.lt.(440._wp*100._wp)) then ! high clouds
     1218             if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds
    12191219                iz=3
    1220              else if(p1.ge.(440._wp*100._wp) .and. p1.lt.(680._wp*100._wp)) then ! mid clouds
     1220             else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds
    12211221                iz=2
    12221222             endif
     
    13441344    DO k=1,Nlevels
    13451345       ! 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) )
    13471347          cldy(:,:,k)=1._wp
    13481348       elsewhere
     
    13501350       endwhere
    13511351       ! 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) ) !DEBUG
     1352       where ( (x(:,:,k) .lt. S_att_opaq) .AND. (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG
    13531353          cldyopaq(:,:,k)=1._wp
    13541354       elsewhere
     
    13581358
    13591359       ! 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) )
    13611361          srok(:,:,k)=1._wp
    13621362       elsewhere
     
    13641364       endwhere
    13651365       ! Number of usefull sub-columns layers for z_opaque 3D fraction:
    1366        where ( (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG
     1366       where ( (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG
    13671367          srokopaq(:,:,k)=1._wp
    13681368       elsewhere
     
    13971397
    13981398     ! Declaring non-opaque cloudy profiles as thin cloud profiles
    1399        if ( cldlay(ip,ic,4).gt. 0. .and. cldlay(ip,ic,1) .eq. 0. ) then
     1399       if ( cldlay(ip,ic,4).gt. 0. .AND. cldlay(ip,ic,1) .eq. 0. ) then
    14001400          cldlay(ip,ic,2)  =  1._wp
    14011401        endif
     
    14101410     ! Declaring z_opaque altitude and opaque cloud fraction for 3D and 2D variables
    14111411     ! 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. ) then
     1412             if ( cldy(ip,ic,Nlevels-k) .eq. 1. .AND. zopac .eq. 0. ) then
    14131413            lidarcldtype(ip,Nlevels-k + 1,3) = lidarcldtype(ip,Nlevels-k + 1,3) + 1._wp
    14141414            cldlay(ip,ic,3)                  = vgrid_z(Nlevels-k+1)      ! z_opaque altitude
     
    14421442     ! Declaring thin cloud fraction for 3D variable
    14431443     ! From TOA-2-SFC
    1444                  if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 1. ) then
     1444                 if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 1. ) then
    14451445                    lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp
    14461446            z_base = k ! bottom cloud layer
    14471447                 endif
    1448              if ( cldy(ip,ic,k) .eq. 1. .and. topcloud .eq. 0. ) then
     1448             if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 0. ) then
    14491449                    lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp
    14501450            z_top = k  ! top cloud layer
     
    14581458          cloudemis = 0._wp
    14591459               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)  ) then
     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)  ) then
    14611461            srmean = srmean + x(ip,ic,k)
    14621462            srcount = srcount + 1.
     
    15021502    DO ip = 1, Npoints
    15031503         DO k = 2, Nlevels
    1504             if ( (lidarcldtype(ip,k,3) .ne. undef) .and. (lidarcldtype(ip,k-1,4) .ne. undef) ) then
     1504            if ( (lidarcldtype(ip,k,3) .ne. undef) .AND. (lidarcldtype(ip,k-1,4) .ne. undef) ) then
    15051505            lidarcldtype(ip,k,4) = lidarcldtype(ip,k,3) + lidarcldtype(ip,k-1,4)
    15061506        else
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90

    r5160 r5185  
    311311
    312312!!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml
    313   if ((itap.ge.1).and.(first_write))then
     313  if ((itap.ge.1).AND.(first_write))then
    314314    IF (using_xios) call read_xiosfieldactive(cfg)
    315315    first_write=.false.
     
    344344    cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov
    345345
    346   endif !(itap.gt.1).and.(first_write)
     346  endif !(itap.gt.1).AND.(first_write)
    347347
    348348  time_bnds(1) = dtime-dtime/2.
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90

    r5158 r5185  
    389389!    do k=1,PARASOL_NREFL
    390390!     do ip=1, Npoints
    391 !      if (stlidar%cldlayer(ip,4).gt.1.and.stlidar%parasolrefl(ip,k).ne.missing_val) then
     391!      if (stlidar%cldlayer(ip,4).gt.1.AND.stlidar%parasolrefl(ip,k).ne.missing_val) then
    392392!        parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)/100.))/ &
    393393!                             (stlidar%cldlayer(ip,4)/100.)
     
    470470
    471471!!! Sorties combinees Cloudsat et Calipso
    472  if (cfg%Lcalipso .and. cfg%Lcloudsat) then
     472 if (cfg%Lcalipso .AND. cfg%Lcloudsat) then
    473473
    474474   if (cfg%Lclcalipso2) then
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90

    r5158 r5185  
    361361       DO i=1,nPoints
    362362          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)) then
     363             if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .AND. j .eq. 1)) then
    364364                g_vol(i,j) = gases(cospstateIN%pfull(i,j), cospstateIN%at(i,j),cospstateIN%qv(i,j),cospIN%rcfg_cloudsat%freq)
    365365             endif
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90

    r5158 r5185  
    223223       end if
    224224    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)) &
    226226         retrievedSize(1:nSubCols) = 1.0e-06_wp*re_fill
    227227
     
    229229    ! mimics what MODIS does to first order.
    230230    ! 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) &
    232232         retrievedCloudTopPressure(1:nSubCols) = isccpCloudTopPressure! * 100._wp
    233233   
     
    297297    ! ########################################################################################
    298298    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.       &
    300300         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. &
    302302         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.    &
    304304         validRetrievalMask(1:nPoints,1:nSubCols)
    305305   
     
    310310    Cloud_Fraction_Water_Mean(1:nPoints) = real(count(waterCloudMask, dim = 2))
    311311    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 <=          &
    313313                                           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 >           &
    315315                                           lowCloudPressureLimit,  dim = 2))
    316316    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  
    118118    DO it=1,PARASOL_NREFL
    119119       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. &
    121121                 tautot_S(1:npoints) .le. PARASOL_TAU(ny+1))
    122122             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  
    200200          endif
    201201        enddo ! loop over ncol
    202         if ((flag_ls .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE
     202        if ((flag_ls .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE
    203203        DO ibox=1,ncol
    204204        if (frac_out(j,ibox,ilev+1) .eq. 1) then
     
    236236        endif
    237237       enddo ! loop over ncol
    238         if ((flag_cv .eq. 0) .and. (ilev .lt. nlev)) then ! possibility THREE
     238        if ((flag_cv .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE
    239239        DO ibox=1,ncol
    240240        if (frac_out(j,ibox,ilev+1) .eq. 2) then
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90

    r5158 r5185  
    179179         
    180180          ! 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)) then
     181          if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .AND. pr .eq. 1)) then
    182182             if (d_gate==1) then
    183183                if (k>1) then
     
    402402       DO pr=1,Ncolumns
    403403          ! 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) ) then
    405              if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) .and. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then
     404          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
    406406                cloudsat_precip_pia(i,pr) = Ze_non_out(i,pr,cloudsat_preclvl) - Ze_out(i,pr,cloudsat_preclvl)
    407407             endif
     
    419419                   cloudsat_pflag(i,pr) = pClass_Snow2                   ! TSL: Snow certain
    420420                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. &
    422422                     Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then
    423423                   cloudsat_pflag(i,pr) = pClass_Snow1                   ! TSL: Snow possible
     
    426426             
    427427             ! Mixed
    428              if(fracPrecipIce(i,pr).gt.0.1.and.fracPrecipIce(i,pr).le.0.9) then
     428             if(fracPrecipIce(i,pr).gt.0.1.AND.fracPrecipIce(i,pr).le.0.9) then
    429429                if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(2)) then
    430430                   cloudsat_pflag(i,pr) = pClass_Mixed2                  ! TSL: Mixed certain
    431431                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. &
    433433                     Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then
    434434                   cloudsat_pflag(i,pr) = pClass_Mixed1                  ! TSL: Mixed possible
     
    441441                   cloudsat_pflag(i,pr) = pClass_Rain3                   ! TSL: Rain certain
    442442                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. &
    444444                     Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(1)) then
    445445                   cloudsat_pflag(i,pr) = pClass_Rain2                   ! TSL: Rain probable
    446446                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. &
    448448                     Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(3)) then
    449449                   cloudsat_pflag(i,pr) = pClass_Rain1                   ! TSL: Rain possible
     
    472472                   cloudsat_pflag(i,pr) = pClass_Snow2                      ! JEK: Snow certain
    473473                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. &
    475475                     Ze_out(i,pr,cloudsat_preclvl).le.Zbinvallnd(5)) then
    476476                   cloudsat_pflag(i,pr) = pClass_Snow1                      ! JEK: Snow possible
     
    479479             
    480480             ! Mized phase (273<T<275)
    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. &
     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. &
    483483                     (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(4))) then
    484484                   cloudsat_pflag(i,pr) = pClass_Mixed2                     ! JEK: Mixed certain
    485485                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. &
    488488                     (Zmax .gt. Zbinvallnd(5)) ) then
    489489                   cloudsat_pflag(i,pr) = pClass_Mixed1                     ! JEK: Mixed possible
     
    493493             ! Rain (T>275)
    494494             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. &
    496496                     (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(2))) then
    497497                   cloudsat_pflag(i,pr) = pClass_Rain3                      ! JEK: Rain certain
    498498                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. &
    500500                     (Zmax .gt. Zbinvallnd(3))) then
    501501                   cloudsat_pflag(i,pr) = pClass_Rain2                      ! JEK: Rain probable
    502502                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. &
    504504                     (Zmax.lt.Zbinvallnd(3))) then
    505505                   cloudsat_pflag(i,pr) = pClass_Rain1                      ! JEK: Rain possible
     
    536536 
    537537    ! 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)) &
    539539         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)) &
    541541         cloudsat_pia = cloudsat_pia / Ncolumns
    542542
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90

    r5158 r5185  
    145145          hydro = .false.
    146146          DO j=1,rcfg%nhclass
    147              if ((hm_matrix(pr,k,j) > 1E-12) .and. (sd%dtype(j) > 0)) then
     147             if ((hm_matrix(pr,k,j) > 1E-12) .AND. (sd%dtype(j) > 0)) then
    148148                hydro = .true.
    149149                exit
     
    217217                ! Use Ze_scaled, Zr_scaled, and kr_scaled ... if know them
    218218                ! 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)  then
     219!                if( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. .not. DO_LUT_TEST)  then
    220220!                   ! can use z scaling
    221221!                   scale_factor=rho_a*hm_matrix(pr,k,tp)
     
    272272                   else
    273273                      ! I assume here that water phase droplets are spheres.
    274                       ! sd%rho should be ~ 1000  or sd%apm=524 .and. sd%bpm=3
     274                      ! sd%rho should be ~ 1000  or sd%apm=524 .AND. sd%bpm=3
    275275                      Deq = Di
    276276                   endif
     
    292292                   ! NOTE: if .not. DO_LUT_TEST, then you are checking the LUT approximation
    293293                   ! not just the DSD representation given by Ni
    294                    if(Np_matrix(pr,k,tp)>0 .and. DO_NP_TEST ) then
     294                   if(Np_matrix(pr,k,tp)>0 .AND. DO_NP_TEST ) then
    295295                      Np = path_integral(Ni,Di,1,ns-1)/rho_a*1.E6_wp
    296296                      ! Note: Representation is not great or small Re < 2
     
    305305                   ! LUT test code
    306306                   ! This segment of code compares full calculation to scaling result
    307                    if ( rcfg%Z_scale_flag(tp,itt,iRe_type) .and. DO_LUT_TEST )  then
     307                   if ( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. DO_LUT_TEST )  then
    308308                      scale_factor=rho_a*hm_matrix(pr,k,tp)
    309309                      ! if more than 2 dBZe difference print error message/parameters.
     
    398398   
    399399    ! If density is constant, set equivalent values for apm and bpm
    400     if ((rho_c > 0) .and. (apm < 0)) then
     400    if ((rho_c > 0) .AND. (apm < 0)) then
    401401       apm = (pi/6)*rho_c
    402402       bpm = 3._wp
     
    405405    ! Exponential is same as modified gamma with vu =1
    406406    ! if Np is specified then we will just treat as modified gamma
    407     if(dtype .eq. 2 .and. Np .gt. 0) then
     407    if(dtype .eq. 2 .AND. Np .gt. 0) then
    408408       local_dtype = 1
    409409       local_p3    = 1
     
    441441       endif
    442442       
    443        if( Np.eq.0 .and. p2+1 > 1E-8) then     ! use default value for MEAN diameter as first default 
     443       if( Np.eq.0 .AND. p2+1 > 1E-8) then     ! use default value for MEAN diameter as first default
    444444          dm = p2             ! by definition, should have units of microns
    445445          D0 = gamma(vu)/gamma(vu+1)*dm
     
    525525       
    526526       ! get rg ...
    527        if( Np.eq.0 .and. (abs(p2+1) > 1E-8) ) then ! use default value of rg
     527       if( Np.eq.0 .AND. (abs(p2+1) > 1E-8) ) then ! use default value of rg
    528528          rg = p2     
    529529       else
     
    640640   
    641641    ! If density is constant, store equivalent values for apm and bpm
    642     if ((rho_c > 0) .and. (apm < 0)) then
     642    if ((rho_c > 0) .AND. (apm < 0)) then
    643643       apm = (pi/6)*rho_c
    644644       bpm = 3._wp
     
    648648    ! if only Np given then calculate Re
    649649    ! if neigher than use other defaults (p1,p2,p3) following quickbeam documentation
    650     if(Re==0 .and. Np>0) then
     650    if(Re==0 .AND. Np>0) then
    651651       call calc_Re(Q,Np,rho_a,dtype,apm,bpm,rho_c,p1,p2,p3,Re)
    652652    endif
     
    754754          if (tc < -30) then
    755755             bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp)
    756           elseif ((tc >= -30) .and. (tc < -9)) then
     756          elseif ((tc >= -30) .AND. (tc < -9)) then
    757757             bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp)
    758758          else
     
    764764          if (tc < -35) then
    765765             bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp)
    766           elseif ((tc >= -35) .and. (tc < -17.5)) then
     766          elseif ((tc >= -35) .AND. (tc < -17.5)) then
    767767             bhp = -2.65_wp+0.09_wp*((tc+273._wp)-255.66_wp)
    768           elseif ((tc >= -17.5) .and. (tc < -9)) then
     768          elseif ((tc >= -17.5) .AND. (tc < -9)) then
    769769             bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp)
    770770          else
     
    969969       
    970970       correct_for_rho = 0
    971        if ((ice == 1) .and. (minval(rho_e) >= 0)) correct_for_rho = 1
     971       if ((ice == 1) .AND. (minval(rho_e) >= 0)) correct_for_rho = 1
    972972       
    973973       ! Correct refractive index for ice density if needed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90

    r5158 r5185  
    7575
    7676    ! Test for valid input overlap assumption
    77     if (overlap .ne. 1 .and. overlap .ne. 2 .and. overlap .ne. 3) then
     77    if (overlap .ne. 1 .AND. overlap .ne. 2 .AND. overlap .ne. 3) then
    7878       overlap=default_overlap
    7979       call errorMessage('ERROR(scops): Invalid overlap assumption provided. Using default overlap assumption (max/ran)')
     
    180180             !threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)))
    181181             !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. &
    183183             !     (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev)))
    184184             if (ilev .ne. 1) then
    185185                threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)))
    186186                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. &
    188188                     (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev)))
    189189             else
    190190                threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(0._wp,tca(1:npoints,ilev)))
    191191                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. &
    193193                     (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev)))
    194194             endif
     
    208208         
    209209          ! 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)=2
     210          where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) .AND. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2
    211211       ENDDO ! ibox
    212212       
Note: See TracChangeset for help on using the changeset viewer.