Re: depth of 20C Isotherm

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 02 Apr 2009 16:15:59 -0600

Hello,

The utility referenced in this example is not
available. It was not part of NCL.

The URL will be updated in the near future.

Attached is an NCL script that will
[a] calculate TEMP at user specified depths.
[b] calculate the depths at which user specified
     temperatures occur.

The test file used is at:

ftp ftp.cgd.ucar.edu
anonymous
email
binary
cd pub/shea/POP
get gx1v3.TEMP.nc
quit

Good luck

Cristiana Stan wrote:
>> Hi - I would like to use iso_1.ncl to plot the depth of the 20C
>> Isotherm produced by a POP run. http://www.ncl.ucar.edu/Applications/iso.shtml
>> specifies that interpolation to the isotherms requires another
>> utility, and there is no information where this utility can be
>> found. Can anyone point to me where I can find the iso utility?
>>
>> Thank you,
>>
>> Cristiana
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

;*************************************************
; NCL Graphics: iso_1.ncl
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************************
begin
;************************************************
; read POP netCDF file
;************************************************
 ;b = addfile("gx1v3.210.pop.h.0001-01.nc","r")
  b = addfile("gx1v3.TEMP.nc","r")

;************************************************
; oceanic data to plot
;************************************************
 x = b->TEMP ; (time,z_t,nlat,nlon) [deg C]
 z_t = b->z_t

;************************************************
; Interpolate to specific [constant] depths
; Note the order of the returned array and that
; the 'new' vertical coordinate is Z_T
;
; [time | 1] x [nlat | 118] x [nlon | 181] x [Z_T | 2]
;************************************************
 lev = (/ 735, 12580/) ; cm
 isox = linint1_Wrap(z_t, x(time|:,nlat|:,nlon|:,z_t|:), False, lev, 0)
 printVarSummary(isox)
 
;************************************************
; Associate 2-dimensional coordinates with variable
; lat2d and lon2d are reserved variable attributes
;************************************************
  isox_at_lat2d = b->TLAT
  isox_at_lon2d = b->TLONG

;************************************************
; Interpolate to specific [constant] TEMP levels
; Note the order of the returned array and that
; the 'new' vertical coordinate is Z_T
;
; [time | 1] x [nlat | 118] x [nlon | 181] x [Z_T | 2]
;************************************************
 tlev = (/ 18, 13.5/) ; same units as TEMP
 tlev!0 = "tlev"
 tlev_at_units = x_at_units

 work = x(time|:,nlat|:,nlon|:,z_t|:)
 depth = conform(work, z_t, 3)
 isot = int2p(work,depth, tlev, 0)
 copy_VarMeta(work(:,:,:,0), isot(:,:,:,0) )
 isot!3 = "tlev"
 isot&tlev = tlev

  isot_at_lat2d = b->TLAT ; for plotting
  isot_at_lon2d = b->TLONG

 printVarSummary(isot)

 
;************************************************
; Associate 2-dim coordinates with variable
; lat2d and lon2d are reserved variable attributes
;************************************************
  isox_at_lat2d = b->TLAT
  isox_at_lon2d = b->TLONG

;************************************************
; create plot
;************************************************
  plot = new( 2, "graphic")

  wks = gsn_open_wks("ps","iso") ; open a ps file
  gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose a colormap
  dum = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap

  res = True ; plot mods desired
  res_at_gsnDraw = False
  res_at_gsnFrame = False
  res_at_cnFillOn = True ; turn on color fill
  res_at_cnLinesOn = False ; turn off contour lines
  res_at_mpCenterLonF = 210 ; center map at 210
  res_at_lbLabelAutoStride = True
  res_at_lbOrientation = "vertical"
  res_at_gsnAddCyclic = True
  res_at_gsnSpreadColors = True ; use full colormap
 ;res_at_gsnSpreadColorStart = 6
  res_at_gsnSpreadColorEnd = -2 ; no gray for contours

  resP = True
  resP_at_gsnMaximize = True ; make as large as possible
  resP_at_gsnPaperOrientation = "portrait" ; force portrait

  do kl=0,dimsizes(lev)-1
     res_at_gsnCenterString = "lev="+lev(kl)
     plot(kl) = gsn_csm_contour_map_ce(wks,isox(0,:,:,kl),res) ; create plot
  end do
  resP_at_txString = "TEMP at Specific Depths"
  gsn_panel(wks, plot, (/2,1/), resP)

  do kt=0,dimsizes(tlev)-1
     res_at_gsnCenterString = "tlev="+tlev(kt)
     plot(kt) = gsn_csm_contour_map_ce(wks,isot(0,:,:,kt),res) ; create plot
  end do
  resP_at_txString = "DEPTH of Specified TEMP Levels"
  gsn_panel(wks, plot, (/2,1/), resP)
end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 02 2009 - 16:15:59 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 07 2009 - 10:01:36 MDT