\cancel mode verify
! focean.jnl - an ocean mask (overlay or "basemap")
! (default 60 minute resolution)
! 4/93
! 	 10/93 - updated for Ferret V3.01
! 	 2/94  - added [basemap]
! 	 11/94 - added transparent overlays and "detail" control
! 	  3/15 - add region improvements as in fland. Make the default
!                dataset etopo20.

! Description: Plot or overlay an area-filled map of the oceans

!		       arg1        arg2             arg3             arg4
! usage:  GO focean [resolution] [palette] [basemap or transparent] [detail]

! arg 1 - resolution - may be 120,60,40,20,10, or 5     default=60
!	  To use resolution "nnn" the file etoponnn must exist.
! arg 2 - palette - may be any palette on your system.  Normally solid colors
!		    like black, gray,red, etc. (see Fpalette '*') default=gray
! arg 3 - may be "basemap", "transparent", or "overlay" (default)
! arg 4 - detailed - may be "detailed", "all" or "solid"  default=solid
!	  Use "detailed" together with a spectrum like dark_terrestrial
!	  Use "all" to plot oceans as well as land.
 
! examples:
!	  GO focean 		! default - 60 minute resolution, color gray
!	  GO focean 120		!  120 minute resolution
!	  GO focean 5		! 5 minute resolution - caution! it's LARGE
!	  GO focean 40 red	! 20 minute resolution with palette red.spk
!	  GO focean 40 red basemap
!	  GO focean 40 ocean_blue basemap detailed
!	  GO focean 40 gray transparent
!	  GO focean " " red	! default (60) minute resolution in red
! or for a good time try
!	SET DATA monthly_navy_winds; VECTOR/l=1 uwnd,vwnd
!	GO focean  60 dark_terrestrial transparent detailed

! Note 1: To use resolution "nnn" the file etoponnn must exist.
! Note 2: If "basemap" is given then the current default region will determine
!	  the region to be plotted
! Note 3: The transparent option creates a see-through overlay land mask

! check the overlay/basemap/transparent option
query/ignore $3%overlay|overlay|basemap|transparent<3rd argument of GO focean must be "overlay", "basemap", or "transparent"%
query/ignore $4%not_required|detailed|solid|all> <4th argument of GO basemap may be "detailed", "solid" or "all" (ocean, too)%

set data/save

def sym xlo_hack ($xaxis_min%0%)
def sym xhi_hack ($xaxis_max%360%)
def sym map_reg = [$5%x=($xlo_hack):($xhi_hack)%]


set data etopo$1"20"

shade/nolab/nokey/lev=$4"(-10000,0,10000)|detailed>(-200,0,50)(-1000,-200,100)(-10000,0,1000)|solid>(-10000,0,10000)|all>(-200,200,50)(-1000,1000,200)(-8000,8000,1000)"/pal=$2"gray"$3"/overlay|basemap> |*>/overlay" $3"rose($map_reg)|transparent>if mod(i+j,2) eq 0 then rose($map_reg)|*>rose($map_reg)"

cancel data etopo$1"20"
set data/restore
set mode/last verify
