Re: Map with Divergence

From: Prof. Mônica Senna <monicasenna_at_nyahnyahspammersnyahnyah>
Date: Mon May 27 2013 - 14:01:17 MDT

Hi Dennis,

My data is on global grid at a spectral resolution of T42 (~2.81 X 2.81
latitude–longitude grid), from CCM3. I want to make a figure like this
below (streamlines with divergence):

[image: Imagem inline 1]

I will start with the script below (that plots streamlines with omega, I
will change omega for divergence...), and I think I should use this
operator uv2dvG, but what will I plot? dv or uvd (
http://www.ncl.ucar.edu/Document/Functions/Built-in/uv2dvG.shtml)? I did
not understand the difference between these two...

Thanks a lot!!

Mônica

--------------------------
;================================================;
; stream_10.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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

; ================================================;
begin
;=================================================;
; open file and read in data
;=================================================;
 f1 = addfile("media12u.nc","r")
 u = f1->U(0,10,:,:) ; read in example data [2D only here]
 f2 = addfile("media12v.nc","r")
 v = f2->V(0,10,:,:)
 f3 = addfile("media12o.nc","r")
 o = f3->OMEGA(0,10,:,:)

;=================================================;
; Create plot

;=================================================;
; this data only has an missing_value, so we are
; copying this to _FillValue for plotting purposes
;
  ;assignFillValue(v,u)
  ;assignFillValue(u,v)

;---create plot
  wks = gsn_open_wks("pdf" ,"stream5") ; open a ps file
  gsn_define_colormap(wks,"gui_default") ; choose colormap

  res = True ; plot mods desired
  res@mpFillOn = False

  res@cnFillOn = True ; color fill
  ;res@cnLevelSpacingF = 3. ; interval spacing
  res@cnLinesOn = False ; no contour lines

  res@stLineColor = "white"
  res@stLineThicknessF = 2

  res@gsnSpreadColors = True ; use full colormap
  res@gsnSpreadColorStart = -1
  res@gsnSpreadColorEnd = 4

  res@stArrowLengthF = 0.008 ; default is dynamic
  res@stLengthCheckCount = 5 ; default is 35
  res@stArrowStride = 1
  res@stLineStartStride = 1 ; default is 2
  res@stMinArrowSpacingF = 0.03 ; default is 0.0

  res@stStepSizeF = 0.001 ; default is dynamic

  res@stMinDistanceF = 0.02 ; distance between lines
  res@stMinLineSpacingF = 0.009

; because this is ice data, which has a gap in the tropics, we need to
; explicitly pass the range of the data to plot. Since we are coloring
; the vectors, this range should also match the MinLatF above, since the
; range for the colors is chosen over the full data passed, and not the
; map limits.

res@mpDataSetName = "Earth..4" ; This new database contains
(inserir delimitações dos estados)
                                           ; divisions for other
countries.(inserir delimitações dos estados)
  res@mpDataBaseVersion = "MediumRes" ; Medium resolution database.
(inserir delimitações dos estados)
  res@mpOutlineBoundarySets = "allBoundaries"
  res@mpOutlineOn = True ; Turn on map outlines
  res@mpOutlineSpecifiers =(/"Brazil:states"/)
  ;res@mpOutBoundarySets = "National"

  res@mpFillOn = False ; Turn on map fill
  res@mpFillBoundarySets = "National"
  res@mpFillAreaSpecifiers = (/"Brazil:states"/) ; divisao dos paises

  ;res@cnFillMode = "RasterFill" ; nao interpolar..

  res@mpGridLineDashPattern = 2 ; lat/lon lines as dashed
  res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks

  ;res@tiMainString = "Teste"
  ;res@tiMainFontHeightF = 0.020 ; smaller title

  ;res@mpMaxLatF = 15 ; South America limits

  res@gsnAddCyclic = False ; regional data (Deve
ficar como falso, true altera as cores de cada estado)
  res@mpDataBaseVersion = "MediumRes"

  ;res@cnLevelSelectionMode = "ExplicitLevels"
  ;res@cnLevels = (/2.,4.,6.,8.,10.,12./)

  res@lbOrientation = "Vertical"
  res@pmLabelBarOrthogonalPosF = -0.01 ; move label bar closer
  ;res@lbLabelStride = 4

  res@mpMaxLatF = 15
  res@mpMinLatF = -60
  res@mpMaxLonF = -33
  res@mpMinLonF = -82

  plot = gsn_csm_streamline_contour_map(wks,u,v,o,res)

end
------------------------------------------

2013/5/23 Dennis Shea <shea@ucar.edu>

> You did not say what your data looked like!
>
> printVarSummary(u)
>
> If your data is on a *global* grid, the you can use spherical
> harmonic operators:
>
> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**uv2dvF.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/uv2dvF.shtml>
> or
> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**uv2dvG.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/uv2dvG.shtml>
>
>
> -------
>
> Otherwise, for rectilinear grids:
>
> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**uv2dv_cfd.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/uv2dv_cfd.shtml>
>
> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**uv2dvr_cfd.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/uv2dvr_cfd.shtml>
>
> Good luck
>
>
> On 5/23/13 9:37 AM, Prof. Mônica Senna wrote:
>
>> Hi NCL users,
>>
>> I want to make a map of streamlines with divergence (the divergence must
>> be
>> only colors), but I don´t know how. I did one with streamlines and omega
>> (figure below), the appeareance is similar of the map of divergence I want
>> to make. The script will be similar?
>>
>>
>> [image: Imagem inline 1]
>>
>>
>>
>> Thanks a lot for your attention!
>>
>>
>>
>> ______________________________**_________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>
>>

-- 
Profª. Mônica Carneiro Alves Senna
Departamento de Análise Geoambiental
Instituto de Geociências
Universidade Federal Fluminense - UFF
Tel. (21) 2629-5916; Cel. (21) 7611-4290
--

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

image.png
Received on Mon May 27 14:01:31 2013

This archive was generated by hypermail 2.1.8 : Thu May 30 2013 - 11:38:10 MDT