\cancel mode verify
! 2/94 - polar_grid.jnl
  

! NOTE: The map projection capabilities beginning with Ferret v5.0
! provide far more flexibility for making plots with curvilinear coordinates.
! Run the script  mp_demo  for an introduction


! Description: overlay "quick" radial logitude and curved latitude lines

! A higher quality (but slower) output is available in "polar_grid_fancy.jnl"

! The internal complexities that this routine minimizes are
!	o discontinuity at +/-180 (also causes trouble at Y=90)
!	o contour labels that don't overlap the intersecting grid lines

! usage:   GO polar_qgrid


message "NOTE: All of the *polar* journal files are superseded by the map projection capabilities of version 5.0.   Run the script  mp_demo  for an introduction."

! use a low resolution grid for speed
define axis/x=-1:1/npoints=51 x51
define axis/y=-1:1/npoints=51 y51
define grid/x=x51/y=y51 g51

! define polar equations for this grid
GO polar_map_inv_eqns g51

! latitude contour/pen=1s
contour/pen=1/over/nolab/lev=(-60,60,30,-1)/x=-1:1/y=-1:1 polar_ydeg

! longitude "contour/pen=1s" - need to bypass nasty discontinuity at date line
let/quiet polar_long = if (175-abs(polar_xdeg180) gt 0) and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180  ! avoid discontinuity
let/quiet polar_pacific   = if ABS(polar_xdeg180) gt 90 and abs(polar_ydeg) le 80 and signgr*polar_ydeg ge (-0.5) then polar_xdeg180
let/quiet polar_pac = if polar_pacific lt 0 then 360+polar_pacific else polar_pacific

! all longitudes except 180
contour/pen=1/over/nolab/lev=(-150,150,30,-1)line(-150,150,30)/x=-1:1/y=-1:1 polar_long

! dateline - must shift discontinuity to Greenwhich
contour/pen=1/over/nolab/lev=(180,180,1,-1)/x=-1:1/y=-1:1 polar_pac

set mode/last verify

message/continue "NOTE: The map projection capabilities beginning with Ferret v5.0"
message/continue "provide far more flexibility for plots with curvilinear coordinates."
message/continue "Run the script  mp_demo  for an introduction"

