Ignore:
Timestamp:
Jul 19, 2024, 5:41:58 PM (4 months ago)
Author:
abarral
Message:

(lint) Fix obsolete boolean operators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90

    r3491 r5082  
    8484       do ilev=1,nlev
    8585          ! Define location of "layer top"
    86           if(ilev.eq.1 .or. ilev.eq.nlev) then
     86          if(ilev==1 .or. ilev==nlev) then
    8787             ztest=zfull(j,ilev)
    8888          else
     
    9494          iMISR_ztop=2
    9595          do loop=2,numMISRHgtBins
    96              if ( ztest .gt. 1000*misr_histHgt(loop+1) ) then
     96             if ( ztest > 1000*misr_histHgt(loop+1) ) then
    9797                iMISR_ztop=loop+1
    9898             endif
     
    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 == 0 .and. dtau(j,ibox,ilev) > 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
    119                 if( dtau(j,ibox,ilev) .eq. 0.) then
     118             if( thres_crossed_MISR < 99 .and. thres_crossed_MISR > 0 ) then
     119                if( dtau(j,ibox,ilev) == 0.) then
    120120                   ! We have come to the end of the current cloud layer without yet
    121121                   ! selecting a CTH boundary. Restart cloud tau counter
     
    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
    132                    if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then
     131                if( dtau(j,ibox,ilev)>0 .and. (cloud_dtau-dtau(j,ibox,ilev)) < 1) then
     132                   if(dtau(j,ibox,ilev) < 1 .or. ilev==1 .or. ilev==nlev) then
    133133                      ! MISR will likely penetrate to some point within this layer ... the middle
    134134                      MISR_penetration_height=zfull(j,ilev)
     
    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) > 1 .and. at(j,ilev) > 273 ) then
    145145                   ! Must be a water cloud, take this as CTH level
    146146                   thres_crossed_MISR=99
     
    149149                ! If the total column optical depth is "large" than MISR can't see
    150150                ! anything else. Set current point as CTH level
    151                 if(sum(dtau(j,ibox,1:ilev)) .gt. 5) then
     151                if(sum(dtau(j,ibox,1:ilev)) > 5) then
    152152                   thres_crossed_MISR=99           
    153153                endif
     
    157157          ! Check to see if there was a cloud for which we didn't
    158158          ! set a MISR cloud top boundary
    159           if( thres_crossed_MISR .eq. 1) then
     159          if( thres_crossed_MISR == 1) then
    160160             ! If the cloud has a total optical depth of greater
    161161             ! than ~ 0.5 MISR will still likely pick up this cloud
    162162             ! with a height near the true cloud top
    163163             ! otherwise there should be no CTH
    164              if(sum(dtau(j,ibox,1:nlev)) .gt. 0.5) then
     164             if(sum(dtau(j,ibox,1:nlev)) > 0.5) then
    165165                ! keep MISR detected CTH
    166              elseif(sum(dtau(j,ibox,1:nlev)) .gt. 0.2) then
     166             elseif(sum(dtau(j,ibox,1:nlev)) > 0.2) then
    167167                ! MISR may detect but wont likley have a good height
    168168                box_MISR_ztop(j,ibox)=-1
     
    215215    ! Fill dark scenes
    216216    do j=1,numMISRHgtBins
    217        where(sunlit .ne. 1) dist_model_layertops(1:npoints,j) = R_UNDEF
     217       where(sunlit /= 1) dist_model_layertops(1:npoints,j) = R_UNDEF
    218218    enddo
    219219
     
    257257
    258258       ! Subcolumns that are cloudy(true) and not(false)
    259        box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) .gt. tauchk)
     259       box_cloudy(1:ncol) = merge(.true.,.false.,tau(j,1:ncol) > tauchk)
    260260
    261261       ! Fill optically thin clouds with fill value
    262262       where(.not. box_cloudy(1:ncol)) tauWRK(j,1:ncol)  = -999._wp
    263        where(box_MISR_ztopWRK(j,1:ncol) .eq. 0) box_MISR_ztopWRK(j,1:ncol)=-999._wp
     263       where(box_MISR_ztopWRK(j,1:ncol) == 0) box_MISR_ztopWRK(j,1:ncol)=-999._wp
    264264
    265265       ! Compute joint histogram and column quantities for points that are sunlit and cloudy
    266        if (sunlit(j) .eq. 1) then
     266       if (sunlit(j) == 1) then
    267267          ! Joint histogram
    268268          call hist2D(tauWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol),ncol,misr_histTau,numMISRTauBins,&
     
    272272
    273273          ! Column cloud area
    274           MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.))/ncol
     274          MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) /= -999.))/ncol
    275275
    276276          ! Column cloud-top height
    277           if ( count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) .ne. 0 ) then
    278              MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) .ne. -999.)/ &
    279                   count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.)
     277          if ( count(box_MISR_ztopWRK(j,1:ncol) /= -999.) /= 0 ) then
     278             MISR_mean_ztop(j) = sum(box_MISR_ztopWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol) /= -999.)/ &
     279                  count(box_MISR_ztopWRK(j,1:ncol) /= -999.)
    280280          else
    281281             MISR_mean_ztop(j) = R_UNDEF
Note: See TracChangeset for help on using the changeset viewer.