Skip to content

Commit 3c34119

Browse files
committed
replace fracout_int assignment with analagous where statements
1 parent 6eb431a commit 3c34119

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/cosp_stats.F90

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,17 @@ SUBROUTINE COSP_DIAG_WARMRAIN( Npoints, Ncolumns, Nlevels, & !! in
333333
real(wp), dimension(Npoints,Ncolumns,Nlevels) :: icod !! in-cloud optical depth (ICOD)
334334
logical :: octop, ocbtm, oslwc
335335
integer, dimension(Npoints,Ncolumns,Nlevels) :: fracout_int !! fracout (decimal to integer)
336-
!fracout_int(:,:,:) = NINT( fracout(:,:,:) ) !! assign an integer subpixcel ID (0=clear-sky; 1=St; 2=Cu)
336+
!integer, dimension(Npoints,Ncolumns,Nlevels) :: fracout_int2 !! fracout (decimal to integer)
337+
fracout_int(:,:,:) = NINT( fracout(:,:,:) ) !! assign an integer subpixcel ID (0=clear-sky; 1=St; 2=Cu)
338+
print *, "fracout(5:10,5:10,5:10):", fracout(5:10,5:10,5:10)
339+
print *, "fracout_int(5:10,5:10,5:10):", fracout_int(5:10,5:10,5:10)
337340
fracout_int(:,:,:) = 0
338-
where (fracout(:,:,:) .eq. 1._wp) fracout_int(:,:,:) = 1
339-
where (fracout(:,:,:) .eq. 2._wp) fracout_int(:,:,:) = 2
341+
where ((fracout(:,:,:) .ge. 0.5_wp) .and. (fracout(:,:,:) .lt. 1.5_wp )) fracout_int(:,:,:) = 1
342+
where ((fracout(:,:,:) .ge. 1.5_wp) .and. (fracout(:,:,:) .lt. 2.5_wp )) fracout_int(:,:,:) = 2
343+
!where (fracout(:,:,:) .eq. 1._wp) fracout_int2(:,:,:) = 1
344+
!where (fracout(:,:,:) .eq. 2._wp) fracout_int2(:,:,:) = 2
345+
!print *, "fracout_int2(5:10,5:10,5:10):", fracout_int2(5:10,5:10,5:10)
346+
!where (fracout /= fracout2) print *, fracout
340347
!! initialize
341348
do i = 1, Npoints
342349
if ( lwp(i) .eq. R_UNDEF ) then ! for non-sunlit columns

0 commit comments

Comments
 (0)