- Timestamp:
- Jul 19, 2024, 5:41:58 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
r3491 r5082 84 84 do ilev=1,nlev 85 85 ! Define location of "layer top" 86 if(ilev .eq.1 .or. ilev.eq.nlev) then86 if(ilev==1 .or. ilev==nlev) then 87 87 ztest=zfull(j,ilev) 88 88 else … … 94 94 iMISR_ztop=2 95 95 do loop=2,numMISRHgtBins 96 if ( ztest .gt.1000*misr_histHgt(loop+1) ) then96 if ( ztest > 1000*misr_histHgt(loop+1) ) then 97 97 iMISR_ztop=loop+1 98 98 endif … … 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 == 0 .and. dtau(j,ibox,ilev) > 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 ) then119 if( dtau(j,ibox,ilev) .eq.0.) then118 if( thres_crossed_MISR < 99 .and. thres_crossed_MISR > 0 ) then 119 if( dtau(j,ibox,ilev) == 0.) then 120 120 ! We have come to the end of the current cloud layer without yet 121 121 ! selecting a CTH boundary. Restart cloud tau counter … … 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) then132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then131 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 133 133 ! MISR will likely penetrate to some point within this layer ... the middle 134 134 MISR_penetration_height=zfull(j,ilev) … … 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) > 1 .and. at(j,ilev) > 273 ) then 145 145 ! Must be a water cloud, take this as CTH level 146 146 thres_crossed_MISR=99 … … 149 149 ! If the total column optical depth is "large" than MISR can't see 150 150 ! anything else. Set current point as CTH level 151 if(sum(dtau(j,ibox,1:ilev)) .gt.5) then151 if(sum(dtau(j,ibox,1:ilev)) > 5) then 152 152 thres_crossed_MISR=99 153 153 endif … … 157 157 ! Check to see if there was a cloud for which we didn't 158 158 ! set a MISR cloud top boundary 159 if( thres_crossed_MISR .eq.1) then159 if( thres_crossed_MISR == 1) then 160 160 ! If the cloud has a total optical depth of greater 161 161 ! than ~ 0.5 MISR will still likely pick up this cloud 162 162 ! with a height near the true cloud top 163 163 ! otherwise there should be no CTH 164 if(sum(dtau(j,ibox,1:nlev)) .gt.0.5) then164 if(sum(dtau(j,ibox,1:nlev)) > 0.5) then 165 165 ! keep MISR detected CTH 166 elseif(sum(dtau(j,ibox,1:nlev)) .gt.0.2) then166 elseif(sum(dtau(j,ibox,1:nlev)) > 0.2) then 167 167 ! MISR may detect but wont likley have a good height 168 168 box_MISR_ztop(j,ibox)=-1 … … 215 215 ! Fill dark scenes 216 216 do j=1,numMISRHgtBins 217 where(sunlit .ne.1) dist_model_layertops(1:npoints,j) = R_UNDEF217 where(sunlit /= 1) dist_model_layertops(1:npoints,j) = R_UNDEF 218 218 enddo 219 219 … … 257 257 258 258 ! 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) 260 260 261 261 ! Fill optically thin clouds with fill value 262 262 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._wp263 where(box_MISR_ztopWRK(j,1:ncol) == 0) box_MISR_ztopWRK(j,1:ncol)=-999._wp 264 264 265 265 ! Compute joint histogram and column quantities for points that are sunlit and cloudy 266 if (sunlit(j) .eq. 1) then266 if (sunlit(j) == 1) then 267 267 ! Joint histogram 268 268 call hist2D(tauWRK(j,1:ncol),box_MISR_ztopWRK(j,1:ncol),ncol,misr_histTau,numMISRTauBins,& … … 272 272 273 273 ! Column cloud area 274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) .ne.-999.))/ncol274 MISR_cldarea(j)=real(count(box_MISR_ztopWRK(j,1:ncol) /= -999.))/ncol 275 275 276 276 ! Column cloud-top height 277 if ( count(box_MISR_ztopWRK(j,1:ncol) .ne. -999.) .ne.0 ) then278 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.) 280 280 else 281 281 MISR_mean_ztop(j) = R_UNDEF
Note: See TracChangeset
for help on using the changeset viewer.