<p style="font-size: 12.0pt;font-family: Arial;">Dear NCLers,</p><p style="font-size: 12.0pt;font-family: Arial;"><br></p><p style="font-size: 12.0pt;font-family: Arial;">I have a time,lat,lon monthly-mean SST field and I want to compute the 70th percentile month by month. <span style="font-size: 12.0pt;font-family: Arial;">I'm trying to adapt Dennis's suggestion </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">given here </span><span style="font-size: 12.0pt;">(</span><span style="font-size: 12.0pt;font-family: arial , sans-serif;">https://www.ncl.ucar.edu/Support/talk_archives/2013/0954.html), but I'm ending up with a single 2-D percentile field, calculated across the entire time period. </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">The problem is that, since it's historical SST, most of the spatial domain is above the threshold </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">at the end of the time period, </span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">because of global warming. <br><br>I'd like to have something similar to stat_dispersion (</span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">https://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml</span><span style="font-family: arial , sans-serif;font-size: 12.0pt;">), but for a custom percentile and without detrending the data. </span><span style="font-family: arial, sans-serif; font-size: 12pt;">Is there a way to do that? </span><span style="font-family: arial, sans-serif; font-size: 12pt;">Here is a snippet of my code:</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;"><br></span></p><p style="font-size: 12.0pt;font-family: Arial;">temp_sort = dim_pqsort_n(temp,2,0)          ; (time, lat, lon) -> (time, lat, lon)<span style="font-family: arial , sans-serif;font-size: 12.0pt;"><br></span></p><p style="font-size: 12.0pt;font-family: Arial;">temp_num = dim_num_n(.not.ismissing(temp_sort),0)           ; (time, lat, lon) -> (lat, lon)</p><p style="font-size: 12.0pt;font-family: Arial;">do n = 0, ntim-1</p><p style="font-size: 12.0pt;font-family: Arial;"> temp_warmest30(n,:,:) = where(temp_sort(n,:,:).gt.floor(0.7*temp_num),temp(n,:,:),temp@_FillValue)            ; (time, lat, lon) -> (time, lat, lon)</p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-size: 12pt; font-family: Arial;">end do</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;"><br></span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;">Thanks,</span></p><p style="font-size: 12.0pt;font-family: Arial;"><span style="font-family: arial , sans-serif;font-size: 12.0pt;">Giorgio</span></p>