do loop + if statement problems with CALIPSO data

From: Mike <mtosca_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 23 2010 - 15:02:22 MST

I am using 5km CALIPSO aerosol layer data and the aerosol
classification and layer top variables. What I want to do is assign a
value in the array called "layer_top_" from the array "layer_top"
which I read from the file. However, I only want this value to be
assigned to "layer_top_" if the aerosol is classified as "smoke",
that is when ftr_chk (the feature classification, unpacked integer
value) = 6. The code runs fine, but when I go back and check to see
if everywhere the aerosol was classified as smoke, the corresponding
"layer top" value has been put into the array "layer_top_" I notice
that it didn't work correctly. Namely, ftr_chk(k,m,l) = 6, but
layer_top_(k,m,l) = -9999 even though layer_top(k,m,l) = *value* (as
reported in the original dataset). I've attached the code below (the
latN_top and latN_btm are just there so I can just remove values for
the latitude range I'm interested in):

do k = 0,37
    if (.not.ismissing(latN_lgth(k)) .and. latN_lgth(k) .eq. 134) then
       ftr_flg(k,:,:) = ftr_flg_tst(k,latN_top(k):latN_btm(k),:)
       ftr_chk(k,:,:) = dim_gbits(ftr_flg(k,:,:),4,3,13,8)
       layer_top(k,:,:) = layer_top_tst(k, latN_top(k):latN_btm(k),:)
       lon1(k,:) = lonN(k, latN_top(k):latN_btm(k))
       do l = 0,3
       do m=0,134
                if (ftr_chk(k,m,l) .eq. 6) then
            layer_top_(k,m,l) = layer_top(k,m,l)
         else
            layer_top_(k,m,l) = -9999
         end if
        end do
        end do
    else
       ftr_flg(k,:,:) = -999
       layer_top(k,:,:) = -9999
    end if
end do

Thanks for your help!

-Mike

Michael Tosca
Ph.D. Candidate
Dept. Earth System Science
University of California, Irvine
Irvine, CA 92697
http://dust.ess.uci.edu/mtosca/web

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 23 15:02:13 2010

This archive was generated by hypermail 2.1.8 : Thu Feb 25 2010 - 09:38:32 MST