author | Forrest Hoffman <forrest@climatemodeling.org> |
Thu, 26 Mar 2009 14:02:21 -0400 | |
changeset 1 | 4be95183fbcd |
permissions | -rw-r--r-- |
forrest@0 | 1 |
; *********************************************** |
forrest@0 | 2 |
; xy_4.ncl |
forrest@0 | 3 |
; *********************************************** |
forrest@0 | 4 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" |
forrest@0 | 5 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" |
forrest@0 | 6 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" |
forrest@0 | 7 |
;************************************************ |
forrest@0 | 8 |
begin |
forrest@0 | 9 |
;************************************************ |
forrest@0 | 10 |
; read in data: observed |
forrest@0 | 11 |
;************************************************ |
forrest@0 | 12 |
diri = "/fis/cgd/cseg/people/jeff/clamp_data/co2/" |
forrest@0 | 13 |
fili = "co2_globalView_222.nc" |
forrest@0 | 14 |
g = addfile (diri+fili,"r") |
forrest@0 | 15 |
a = g->CO2_SEAS |
forrest@0 | 16 |
lon = g->LON |
forrest@0 | 17 |
lat = g->LAT |
forrest@0 | 18 |
|
forrest@0 | 19 |
ncase = dimsizes(lat) |
forrest@0 | 20 |
print (ncase) |
forrest@0 | 21 |
|
forrest@0 | 22 |
lat_tmp = lat |
forrest@0 | 23 |
lat_tmp@_FillValue = 1.e+36 |
forrest@0 | 24 |
|
forrest@0 | 25 |
do n = 0,ncase-1 |
forrest@0 | 26 |
if (.not. ismissing(lat_tmp(n))) then |
forrest@0 | 27 |
indexes = ind(lat(n) .eq. lat .and. lon(n) .eq. lon) |
forrest@0 | 28 |
if (dimsizes(indexes) .gt. 1) then |
forrest@0 | 29 |
lat_tmp(indexes(1:)) = lat_tmp@_FillValue |
forrest@0 | 30 |
end if |
forrest@0 | 31 |
delete (indexes) |
forrest@0 | 32 |
end if |
forrest@0 | 33 |
end do |
forrest@0 | 34 |
|
forrest@0 | 35 |
indexes = ind(.not. ismissing(lat_tmp)) |
forrest@0 | 36 |
print (indexes) |
forrest@0 | 37 |
|
forrest@0 | 38 |
lat_new = lat(indexes) |
forrest@0 | 39 |
lon_new = lon(indexes) |
forrest@0 | 40 |
print (lat_new +"/"+lon_new) |
forrest@0 | 41 |
|
forrest@0 | 42 |
exit |
forrest@0 | 43 |
|
forrest@0 | 44 |
end |