[Thread Prev][Thread Next][Index]

[las_users] Bug found in Las v8 animation



Dear Sir,

I have both las v8 and las v7, I could able to see animation in las v7 but for the same data set in las v8 I am getting error response for extracting the frame. kindly help me to solve the issue, from debug file Its convinced that its due to the script which does search for t_lo and t_hi in dataset but I am not able to solve the issue.

Thanks in advance.

- Akshay
 Cached data cleared from memory
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
 LISTing to file /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml

go "$1"
 !-> go "/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/WEB-INF/classes/resources/ferret/temp/ferret_operation_1375856482078.jnl"
! Symbols from the server
                        DEFINE SYMBOL data_0_ID = ADDEP-argo_clim
                                 DEFINE SYMBOL data_0_dataset_ID = argo_clim
                                 DEFINE SYMBOL data_0_dataset_doc = http://las.nio.org/las/UI/Argo.html
                                 DEFINE SYMBOL data_0_dataset_name = Argo 1x1 degree variationaly interpolated monthly Climatology
                                 DEFINE SYMBOL data_0_dataset_url = /las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc
                                 DEFINE SYMBOL data_0_dsid = argo_clim
                                 DEFINE SYMBOL data_0_dsname = Argo 1x1 degree variationaly interpolated monthly Climatology
                                 DEFINE SYMBOL data_0_ftds_url = http://las.nio.org/thredds/dodsC/las/argo_clim/data_las_server_LAS_Data_Global_Argo_Climatology_argo_CLIM_grd.nc.jnl
                                 DEFINE SYMBOL data_0_grid_type = regular
                                 DEFINE SYMBOL data_0_intervals = xyzt
                                 DEFINE SYMBOL data_0_name = Argo-Aviso Absolute Dynamic Depth Monthly Climatology
                                 DEFINE SYMBOL data_0_points = xyzt
                                 DEFINE SYMBOL data_0_region = region_0
                                 DEFINE SYMBOL data_0_title = Argo-Aviso Absolute Dynamic Depth Monthly Climatology
                                 DEFINE SYMBOL data_0_units = dynamic meters
                                 DEFINE SYMBOL data_0_url = /las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc
                                 DEFINE SYMBOL data_0_var = ADDEP
                                 DEFINE SYMBOL data_0_xpath = /lasdata/datasets/argo_clim/variables/ADDEP-argo_clim
                                 DEFINE SYMBOL data_count = 1
                                 DEFINE SYMBOL ferret_fill_type = fill
                                 DEFINE SYMBOL ferret_interpolate_data = false
                                 DEFINE SYMBOL ferret_land_type = contour
                                 DEFINE SYMBOL ferret_mark_grid = no
                                 DEFINE SYMBOL ferret_service_action = Data_Extract_Frames
                                 DEFINE SYMBOL ferret_size = 0.5
                                 DEFINE SYMBOL ferret_time_step = 1
                                 DEFINE SYMBOL ferret_view = xyt
                                 DEFINE SYMBOL las_debug = false
                                 DEFINE SYMBOL las_output_type = json
                                 DEFINE SYMBOL operation_ID = Animation_Frames_XY
                                 DEFINE SYMBOL operation_key = F8E09B64B82DC9A6269E62908E5DD923
                                 DEFINE SYMBOL operation_name = AnimationFrames
                                 DEFINE SYMBOL operation_service = ferret
                                 DEFINE SYMBOL operation_service_action = Data_Extract_Frames
                                 DEFINE SYMBOL product_server_default_dsid = ocean_atlas_subset
                                 DEFINE SYMBOL product_server_default_operation = Plot_2D_XY_zoom
                                 DEFINE SYMBOL product_server_default_option = Options_2D_image_contour_xy_7
                                 DEFINE SYMBOL product_server_default_varid = TEMP-ocean_atlas_subset
                                 DEFINE SYMBOL product_server_default_view = xy
                                 DEFINE SYMBOL product_server_ps_timeout = 9999999999
                                 DEFINE SYMBOL product_server_ui_timeout = 20
                                 DEFINE SYMBOL product_server_use_cache = true
                                 DEFINE SYMBOL product_server_version = 7.3
                                 DEFINE SYMBOL region_0_t_hi = 15-Dec-0000
                                 DEFINE SYMBOL region_0_t_lo = 15-Jan-0000
                                 DEFINE SYMBOL region_0_x_hi = 359.5
                                 DEFINE SYMBOL region_0_x_lo = 0.5
                                 DEFINE SYMBOL region_0_y_hi = 89.5
                                 DEFINE SYMBOL region_0_y_lo = -89.5
                                 DEFINE SYMBOL region_0_z_hi = 0
                                 DEFINE SYMBOL region_0_z_lo = 0
                                 DEFINE SYMBOL result_cancel_ID = cancel
                                 DEFINE SYMBOL result_cancel_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_cancel.txt
                                 DEFINE SYMBOL result_cancel_type = cancel
                                 DEFINE SYMBOL result_count = 4
                                 DEFINE SYMBOL result_debug_ID = debug
                                 DEFINE SYMBOL result_debug_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_debug.txt
                                 DEFINE SYMBOL result_debug_type = debug
                                 DEFINE SYMBOL result_ferret_listing_ID = ferret_listing
                                 DEFINE SYMBOL result_ferret_listing_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml
                                 DEFINE SYMBOL result_ferret_listing_type = xml
                                 DEFINE SYMBOL result_rss_ID = rss
                                 DEFINE SYMBOL result_rss_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/EC5168496C4923B7D21935E8F895E544_rss.rss
                                 DEFINE SYMBOL result_rss_type = rss
         GO ($operation_service_action)
 !-> GO Data_Extract_Frames
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! $Author: rhs $
!
! Extracting to a netCDF file and some text and table files have different
! options in the UI.  Need to separate them at this level to keep the UI
! happy.  All the Data_Extract* scripts launch the same list_data.jnl script.
GO list_frames
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: list_frames.jnl,v $
!
! $Author: Jing Y. Li $
! $Date: 2007/08/22
! 2007/11/27 ACM If the variable is a native curvilinear data variable, operate
!                on the data field not the var,xcoord,ycoord which has been
!                defined as the *plot variable*". Specify the XY region for the
!                variable using the i,j box limits previously computed.
!                Question: should the longitude/ latitude coordinates or other
!                informatino about the curvilinear grid be listed in the xml file?
!
! 4/28/2008 ACM refer always to ($data_var)[d=($data_num)] as there
!           may be other datasets open, e.g. for transformed variables.
! 4/28/2008 ACM Define tvar, used for getting time axis information, as
!           just t[gt=var] so that it isn't a huge variable to load in tax_datestring.
! 6/2010    ACM If its a vector plot, call LAS_auto_veclen_animate instead of
!           LAS_auto_levels_animate.
!
! list_frames.jnl creates a listing in XML format for animation
! Assumes symbol ferret_listing is the output file.
! The listing file includes:
! - fill_levels      for 2D plots
! - contour_levels   for 2D plots
! - dep_axis_scale   for 1D plots
! - vector_length    for vector plots
! - hasT             used to determine if the dataset has time axis
! - units            units of the time axis
! - frames           list of each individual time points
 
DEFINE SYMBOL its_autolev_animate = 1
 
GO LAS_initialize_region 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_region.jnl,v $
! $Revision: 1.1 $
!
! $Author: ansley $
! $Date: 2006/07/06 17:54:11 $
!
! The LAS_initialize_region.jnl script defines the following symbols
! based on the region associated with data_#:
!
! region_~_lo/hi   -- lo and hi points on a given axis
! region_~_range   -- numeric range on a given axis
! region_~         -- domain in 'lo:hi' notation
! region_full      -- synonym for 'region_xyzt'
!
! Incoming argument determines which region to use
! The default number is 0, and the default region is region_0.
! If we are making only a map, then there are no data_ symbols
! defined, so data_0_region is not set, but we can define region
! as region_0.
!
! ACM trac 267: Do not cancel any previously set limits or region symbols;
! The previous v6 UI as to how it worked in the old product server expects
! to inherit some or all region info from the first dataset for use by the
! second in comparisons etc. Keep this behavior.
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
DEFINE SYMBOL region_name data_($num)_region
 !-> DEFINE SYMBOL region_name data_0_region
DEFINE SYMBOL region ($($region_name)"region_0")
 !-> DEFINE SYMBOL region region_0
 
! NOTE:  Occasionally the LAS applet will send in a longitude or latitude
! NOTE:  that looks like "24.400000000000002".  Such long, numerically
! NOTE:  irrelevant numbers can overflow Ferret's maximum symbol length.
! NOTE:  Rounding longitudes and latitudes to the nearest .00001 seems
! NOTE:  reasonable for all but the most detailed datasets.
 
! NOTE:  'region_x_m360' and 'region_x_p360' are used for those visualizations
! NOTE:  where Ferret doesn't auomatically deal with the modulo nature of
! NOTE:  longitude and allow the script writer to deal with this manually.
 
IF ($($region)_x_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_x_lo = `INT(100000 * ($($region)_x_lo)) / 100000`
 !-> DEFINE SYMBOL region_x_lo = 0.5
  DEFINE SYMBOL region_x_hi = `INT(100000 * ($($region)_x_hi)) / 100000`
 !-> DEFINE SYMBOL region_x_hi = 359.5
  DEFINE SYMBOL limits_x = ($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL limits_x = 0.5:359.5
  DEFINE SYMBOL limits_x_m360 = `($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL limits_x_m360 = -359.5:-0.5
  DEFINE SYMBOL limits_x_p360 = `($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL limits_x_p360 = 360.5:719.5
  DEFINE SYMBOL region_x = X=($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL region_x = X=0.5:359.5
  DEFINE SYMBOL region_x_m360 X=`($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL region_x_m360 X=-359.5:-0.5
  DEFINE SYMBOL region_x_p360 X=`($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL region_x_p360 X=360.5:719.5
  IF `($region_x_hi) GE ($region_x_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_x_range = `($region_x_hi) - ($region_x_lo)`
 !-> DEFINE SYMBOL region_x_range = 359
  ELSE
  ENDIF
ENDIF
 
IF ($($region)_y_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_y_lo = `INT(1000 * ($($region)_y_lo)) / 1000`
 !-> DEFINE SYMBOL region_y_lo = -89.5
  DEFINE SYMBOL region_y_hi = `INT(1000 * ($($region)_y_hi)) / 1000`
 !-> DEFINE SYMBOL region_y_hi = 89.5
  DEFINE SYMBOL limits_y = ($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL limits_y = -89.5:89.5
  DEFINE SYMBOL region_y = Y=($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL region_y = Y=-89.5:89.5
  IF `($region_y_hi) GE ($region_y_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_y_range = `($region_y_hi) - ($region_y_lo)`
 !-> DEFINE SYMBOL region_y_range = 179
  ELSE
  ENDIF
ENDIF
 
IF ($($region)_z_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_z_lo = ($($region)_z_lo)
 !-> DEFINE SYMBOL region_z_lo = 0
  DEFINE SYMBOL region_z_hi = ($($region)_z_hi)
 !-> DEFINE SYMBOL region_z_hi = 0
  DEFINE SYMBOL limits_z = ($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL limits_z = 0:0
  DEFINE SYMBOL region_z = Z=($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL region_z = Z=0:0
  IF `($region_z_hi) GE ($region_z_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_z_range = `($region_z_hi) - ($region_z_lo)`
 !-> DEFINE SYMBOL region_z_range = 0
  ELSE
  ENDIF
ENDIF
IF ($add_region_z"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
! NOTE:  Normally we use 'DEFINE SYMBOL ~ = ...'
! NOTE:  For the time axis we use 'DEFINE SYMBOL ~ ...' because the Ferret
! NOTE:  parser complains about unmatched quotes if we do it the other way.
 
IF ($($region)_t_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_t_lo = ($($region)_t_lo)
 !-> DEFINE SYMBOL region_t_lo = 15-Jan-0000
  DEFINE SYMBOL region_t_hi = ($($region)_t_hi)
 !-> DEFINE SYMBOL region_t_hi = 15-Dec-0000
  DEFINE SYMBOL limits_t \"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL limits_t \"15-Jan-0000\":\"15-Dec-0000\"
  DEFINE SYMBOL region_t T=\"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL region_t T=\"15-Jan-0000\":\"15-Dec-0000\"
ENDIF
IF ($add_region_t"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
! Now build up all possible multi-axis regions, being careful not to use
! commas when a region is missing
 
! region_xy
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xy = ($region_x),($region_y)
 !-> DEFINE SYMBOL region_xy = X=0.5:359.5,Y=-89.5:89.5
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xz
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xz = ($region_x),($region_z)
 !-> DEFINE SYMBOL region_xz = X=0.5:359.5,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xt
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xt = ($region_x),($region_t)
 !-> DEFINE SYMBOL region_xt = X=0.5:359.5,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yz
IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yz = ($region_y),($region_z)
 !-> DEFINE SYMBOL region_yz = Y=-89.5:89.5,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yt
IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yt = ($region_y),($region_t)
 !-> DEFINE SYMBOL region_yt = Y=-89.5:89.5,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_zt
IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_zt = ($region_z),($region_t)
 !-> DEFINE SYMBOL region_zt = Z=0:0,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyz
IF ($region_xy"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyz = ($region_xy),($region_z)
 !-> DEFINE SYMBOL region_xyz = X=0.5:359.5,Y=-89.5:89.5,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyt
IF ($region_xy"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyt = ($region_xy),($region_t)
 !-> DEFINE SYMBOL region_xyt = X=0.5:359.5,Y=-89.5:89.5,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yzt
IF ($region_yz"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yzt = ($region_yz),($region_t)
 !-> DEFINE SYMBOL region_yzt = Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyzt
IF ($region_xyz"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyzt = ($region_xyz),($region_t)
 !-> DEFINE SYMBOL region_xyzt = X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
DEFINE SYMBOL region_full = ($region_xyzt)
 !-> DEFINE SYMBOL region_full = X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"
 
 
! For sampling from a curvilinear variable, save the region definitions with
! the variable number.
IF ($region_x"0|*>1") THEN DEFINE SYMBOL region_($num)_x = ($region_x)
 !-> IF 1 THEN DEFINE SYMBOL region_0_x = X=0.5:359.5
 !-> DEFINE SYMBOL region_0_x = X=0.5:359.5
IF ($region_y"0|*>1") THEN DEFINE SYMBOL region_($num)_y = ($region_y)
 !-> IF 1 THEN DEFINE SYMBOL region_0_y = Y=-89.5:89.5
 !-> DEFINE SYMBOL region_0_y = Y=-89.5:89.5
IF ($region_z"0|*>1") THEN DEFINE SYMBOL region_($num)_z = ($region_z)
 !-> IF 1 THEN DEFINE SYMBOL region_0_z = Z=0:0
 !-> DEFINE SYMBOL region_0_z = Z=0:0
IF ($region_t"0|*>1") THEN DEFINE SYMBOL region_($num)_t = ($region_t)
 !-> IF 1 THEN DEFINE SYMBOL region_0_t = T="15-Jan-0000":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_t = T="15-Jan-0000":"15-Dec-0000"
IF ($region_xt"0|*>1") THEN DEFINE SYMBOL region_($num)_xt = ($region_xt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xt = X=0.5:359.5,T="15-Jan-0000":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_xt = X=0.5:359.5,T="15-Jan-0000":"15-Dec-0000"
IF ($region_xy"0|*>1") THEN DEFINE SYMBOL region_($num)_xy = ($region_xy)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xy = X=0.5:359.5,Y=-89.5:89.5
 !-> DEFINE SYMBOL region_0_xy = X=0.5:359.5,Y=-89.5:89.5
IF ($region_xz"0|*>1") THEN DEFINE SYMBOL region_($num)_xz = ($region_xz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xz = X=0.5:359.5,Z=0:0
 !-> DEFINE SYMBOL region_0_xz = X=0.5:359.5,Z=0:0
IF ($region_yt"0|*>1") THEN DEFINE SYMBOL region_($num)_yt = ($region_yt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yt = Y=-89.5:89.5,T="15-Jan-0000":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_yt = Y=-89.5:89.5,T="15-Jan-0000":"15-Dec-0000"
IF ($region_yz"0|*>1") THEN DEFINE SYMBOL region_($num)_yz = ($region_yz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yz = Y=-89.5:89.5,Z=0:0
 !-> DEFINE SYMBOL region_0_yz = Y=-89.5:89.5,Z=0:0
IF ($region_zt"0|*>1") THEN DEFINE SYMBOL region_($num)_zt = ($region_zt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_zt = Z=0:0,T="15-Jan-0000":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_zt = Z=0:0,T="15-Jan-0000":"15-Dec-0000"
 
! For SOCAT server labels, make time symbols w/o the trailing 00:00:00
 
IF ($region_0_t_lo"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL t_lab_lo = ($region_0_t_lo)
 !-> DEFINE SYMBOL t_lab_lo = 15-Jan-0000
   LET iz = STRINDEX("($region_0_t_lo)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Jan-0000", " 00:00:00")
   IF `iz GT 0` THEN
 !-> IF 0 THEN
   ELSE
      LET iz = STRINDEX("($region_0_t_lo)", ":00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Jan-0000", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("($region_0_t_lo)", 1, iz-1)`
 !-> IF 0 THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("15-Jan-0000", 1, iz-1)`
   ENDIF
ENDIF
 
IF ($region_0_t_hi"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL t_lab_hi = ($region_0_t_hi)
 !-> DEFINE SYMBOL t_lab_hi = 15-Dec-0000
   LET iz = STRINDEX("($region_0_t_hi)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Dec-0000", " 00:00:00")
   IF `iz GT 0` THEN
 !-> IF 0 THEN
   ELSE
      LET iz = STRINDEX("($region_0_t_hi)", ":00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Dec-0000", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("($region_0_t_hi)", 1, iz-1)`
 !-> IF 0 THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("15-Dec-0000", 1, iz-1)`
   ENDIF
ENDIF
 
! If no regions have been defined then we have an error.
 
IF ($region_full"1|*>0")  THEN
 !-> IF 0  THEN
ENDIF
 
! End of LAS_initialize_region.jnl ------------------------------------------------------
GO LAS_initialize_data 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_data.jnl,v $
! $Revision: 1.2 $
!
! $Author: ansley $
! $Date: 2007/29/2007
!
! The LAS_initialize_data.jnl script takes care of everything having to
! do with initializing a datset for later use.
!
! LAS_initialize_data.jnl takes an argument that specifies which data
! item [0|1|2|3|...] to create symbols for.
!
! 3/2007:
! split up previous version of LAS_initialize_data.jnl into two;
! initialize the dataset and define the plot (or output listing) variable.
! This allows the custom init scripts to call LAS_initialize_dataset, then
! issue commands for the customization, then call LAS_initialize_variable
!
! 8/2007:
! The custom init scripts now consist of only SET DATA and the custom commands.
! This lets F-TDS run first and call the init script to create the data set
! that will be used by the Ferret product script. When F-TDS is done it will
! not send the symbol ferret_init_script to the product scripts so we will just skip
! that step.
!
! 8/2007:
! Some of the custom init scripts previously contained commands like SET MEMORY
! or SET MODE which are intended to be executed by the product script These need
! to be separated from commands for fixing grids or regridding which are executed
! prior to the product script being run by F-TDS. These commands are to be specified
! in the dataset configuration as ferret_init_commands, whose the value is a set
! of Ferret commands separated by semicolons.
!
GO LAS_initialize_dataset ($1"0")
 !-> GO LAS_initialize_dataset 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_dataset.jnl
 
! This is the first part of LAS_initialize_data.jnl used for standard and
! customized init scripts
 
! $Author: ansley, jing
! $Date: 2007/29/2007
 
! 6/29/2007
! Allow for data_0_units or data_1_units etc to be defined a null string or a
! string containing a single space. If data_0_units is either undefined or is
! one of these blank strings, then use the attnames syntax to see if the dataset
! variable has units defined, and if so define the data_units symbol from that.
 
 
! The LAS_initialize_data.jnl script takes care of everything having to
! do with initializing a datset for later use.
!
! LAS_initialize_data.jnl takes an argument that specifies which data
! item [0|1|2|3|...] to create symbols for.
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
 
IF `($num) EQ 0 AND ($data_count) GT 1 and ($check_multi_regions_done"0|*>1) EQ 0` THEN
 !-> IF 0 THEN
ENDIF
 
! TODO:  It would be nice if the java code removed this dependency upon
! TODO:  whether an operation was 'chained' or not.
 
! Check whether the source data was part of a 'chained' operation.
!ACM note: How does this jibe with what I do below changing data_url to data_num??
 
IF ($data_($num)_chained"0|1|*>1) THEN
 !-> IF 0 THEN
ELSE
  DEFINE SYMBOL data_url \"($data_($num)_url)\"
 !-> DEFINE SYMBOL data_url \"/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc\"
ENDIF
 
IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var ($data_($num)_var)
 !-> IF 1 THEN DEFINE SYMBOL data_var ADDEP
 !-> DEFINE SYMBOL data_var ADDEP
DEFINE SYMBOL data_name ($data_($num)_name)
 !-> DEFINE SYMBOL data_name Argo-Aviso Absolute Dynamic Depth Monthly Climatology
IF `($data_($num)_name"0|*>1") EQ 0` THEN DEFINE SYMBOL data_name ($data_var)
 !-> IF 0 THEN DEFINE SYMBOL data_name ADDEP
 
DEFINE SYM var_num ($num)
 !-> DEFINE SYM var_num 0
 
! Put quotes around variable name in case its a Ferret reserved name like Z
! (Apparently addXML now does this automatically, so check for it already being in ' ')
 
IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var = `UPCASE("($data_var)")`
 !-> IF 1 THEN DEFINE SYMBOL data_var = `UPCASE("ADDEP")`
 !-> DEFINE SYMBOL data_var = `UPCASE("ADDEP")`
 !-> DEFINE SYMBOL data_var = ADDEP
LET varlen = `STRLEN("($data_var)")`
 !-> DEFINE VARIABLE varlen = 5
IF `STRINDEX("($data_var)", "'") EQ 1 AND STRRINDEX("($data_var)", "'") EQ varlen` THEN
 !-> IF 0 THEN
ELSE
   IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var_nq = ($data_var)
 !-> IF 1 THEN DEFINE SYMBOL data_var_nq = ADDEP
 !-> DEFINE SYMBOL data_var_nq = ADDEP
   IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var = '($data_var)'
 !-> IF 1 THEN DEFINE SYMBOL data_var = 'ADDEP'
 !-> DEFINE SYMBOL data_var = 'ADDEP'
ENDIF
 
! If the grids werent the same but were reconciled with an add_var, add that.
! The variables must be the same size. Check and set up a nice message if not.
 
IF ($add_to_var($num)"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
! Use the units passed in from the XML unless they are null;
! in that case try to get from the dataset
 
! Do not define data_units with an empty string
IF ($data_($num)_units%1|"">1|*>0%) THEN
 !-> IF 0 THEN
ELIF ($data_($num)_units%1|" ">1|*>0%) THEN
 !-> ELIF 0 THEN
ELSE
   DEFINE SYMBOL data_units ($data_($num)_units)
 !-> DEFINE SYMBOL data_units dynamic meters
ENDIF
 
! Check for single quotes and remove them. They are
! not needed on units strings
 
LET inquote = `STRINDEX("($data_($num)_units)", "'")`
 !-> DEFINE VARIABLE inquote = 0
IF `inquote GT 0` THEN
 !-> IF 0 THEN
ENDIF
 
IF ($data_units"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL data_units (($data_($num)_units))
 !-> DEFINE SYMBOL data_units (dynamic meters)
   IF `STRINDEX("($data_units)", "((") GT 0` THEN \
     DEFINE SYMBOL data_units ($data_($num)_units)
 !-> IF 0 THEN      DEFINE SYMBOL data_units dynamic meters
ENDIF
 
IF ($data_($num)_name"0|1|*>1) THEN
 !-> IF 1 THEN
   IF ($data_($num)_title"0|*>1") THEN DEFINE SYMBOL data_title ($data_($num)_title)
 !-> IF 1 THEN DEFINE SYMBOL data_title Argo-Aviso Absolute Dynamic Depth Monthly Climatology
 !-> DEFINE SYMBOL data_title Argo-Aviso Absolute Dynamic Depth Monthly Climatology
ELSE
ENDIF
 
DEFINE SYMBOL variable_lab = ($data_title)
 !-> DEFINE SYMBOL variable_lab = Argo-Aviso Absolute Dynamic Depth Monthly Climatology
IF `($num) GT 0` THEN DEFINE SYMBOL variable_($num)_lab = ($data_title)
 !-> IF 0 THEN DEFINE SYMBOL variable_0_lab = Argo-Aviso Absolute Dynamic Depth Monthly Climatology
DEFINE SYMBOL units_lab = ($data_units)
 !-> DEFINE SYMBOL units_lab = (dynamic meters)
IF `($num) GT 0` THEN DEFINE SYMBOL units_($num)_lab = ($data_units)
 !-> IF 0 THEN DEFINE SYMBOL units_0_lab = (dynamic meters)
 
DEFINE SYMBOL ferret_plot_title "($data_title) ($data_units)"
 !-> DEFINE SYMBOL ferret_plot_title "Argo-Aviso Absolute Dynamic Depth Monthly Climatology (dynamic meters)"
 
! SET DATA and check for errors
 
SET DATA ($data_url)
 !-> SET DATA "/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc"
 
! Use PPLUS symbol editing to check for units sent in as ""
PPL SET ulen $LENGTH(data_($num)_units)
 !-> PPL SET ulen $LENGTH(data_0_units)
IF `($ulen) LE 2` THEN
 !-> IF 0 THEN
ENDIF
 
IF `($units_double_quotes"0|*>1") EQ 0` THEN
 !-> IF 1 THEN
   LET ulen = STRLEN ("($data_($num)_units)")
 !-> DEFINE VARIABLE ulen = STRLEN ("dynamic meters")
   IF `(STRINDEX("($data_($num)_units)", "'") EQ 1) AND \
    (STRRINDEX("($data_($num)_units)", "'") EQ ulen)` THEN \
      DEFINE SYMBOL data_units `SUBSTRING("($data_($num)_units)", 2, ulen-2)`
 !-> IF 0 THEN       DEFINE SYMBOL data_units `SUBSTRING("dynamic meters", 2, ulen-2)`
ENDIF
 
 
IF ($fer_last_error"0|0|1|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
SET DATA "($data_($num)_url)"
 !-> SET DATA "/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc"
DEFINE SYMBOL dset($num) = `($data_($num)_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL dset0 = 1
 
! Here do sanity checks on Ferret properties, such as dep_axis_scale
 
GO LAS_check_fer_properties
! LAS_check_fer_properties.jnl
!
! Author: ansley
! $Date: 2010/10/13
!
! Sanity check on Ferret properties.
! Add to this as needed
!
 
IF ($ferret_dep_axis_scale"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
  ENDIF
  ENDIF
  ENDIF
     ENDIF
  ENDIF
ENDIF ! Checks on ferret_dep_axis_scale
 
! End of file ------------ LAS_check_fer_properties.jnl-------------------------------
 
 
! End of $RCSfile ------------LAS_initialize_dataset.jnl--------------------------
 
IF ($ferret_init_script"0|*>1") THEN GO ($ferret_init_script) ($1"0")
 !-> IF 0 THEN GO   0
 
IF ($ferret_init_commands"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
GO LAS_initialize_variable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_variable.jnl
! $Revision: 1.1
!
! $Author: Ansley, Jing $
! $Date: 2007/29/2007
! ACM 4/2007 apply ferret_expression2 to second plot of comparisons.
! ACM 8/2007 Call LAS_auto_levels to set up auto contour/fill levels.
! 3/2008 ACM Use SHADE/TRIM for shade underlays of FILL plots (Ferret v6.1),
!            so no need to call LAS_define_region_plus_1.jnl
! 10-Jul-2008 ACM Define ferret_x_var, needed for listing data to files
!  3-Jun-2011 ACM Allow configuration to send in ferret_factor and
!             ferret_factor_label to apply factor to variables and to add
!             a nice label to the title/units string.
 
! this is the second part of LAS_initialize_data.jnl
 
! Define the plot variable. For comparison plots, we want to save the dataset number
! for each dataset.
 
 
DEFINE SYMBOL data_num = `($data_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL data_num = 1
DEFINE SYMBOL data_($num)_num = `($data_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL data_0_num = 1
 
! If a factor has been passed in, apply it
IF ($ferret_factor"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
LET attlist = ($data_var).attnames
 !-> DEFINE VARIABLE attlist = 'ADDEP'.attnames
IF ($data_var_nq"0|*>1") THEN LET attlist = ($data_var_nq).attnames
 !-> IF 1 THEN LET attlist = ADDEP.attnames
 !-> LET attlist = ADDEP.attnames
DEFINE SYMBOL data_var_only = `UPCASE("($data_var)")`
 !-> DEFINE SYMBOL data_var_only = 'ADDEP'
 
IF ($ferret_bad_flag"0|*>1") THEN SET VAR/BAD=($ferret_bad_flag) ($data_var)
 !-> IF 0 THEN SET VAR/BAD=  'ADDEP'
 
IF ($ferret_timelab_res"0|*>1") THEN SET MODE CALENDAR:($ferret_timelab_res)
 !-> IF 0 THEN SET MODE CALENDAR:
 
! setup for analysis ops on curvilinear grids
IF `IS_ELEMENT_OF_STR (attlist, "ferret_definition") GT 0 AND\
    ($ferret_curvi_coord_lon"0|*>1")` THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
! Be sure units and title are defined.
! If units are not defined, try to get units from the data variable.
! If the variable in the file has no units, leave data_units symbol undefined.
 
! data_units should have been defined in LAS_initialize_dataset
 
IF ($data_units"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL has_units = 1
ELSE
      ENDIF
   ENDIF
ENDIF
 
IF ($check_for_pseudonames"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
DEFINE SYMBOL ferret_plot_title "($data_title) ($data_units)"
 !-> DEFINE SYMBOL ferret_plot_title "Argo-Aviso Absolute Dynamic Depth Monthly Climatology (dynamic meters)"
IF ($ferret_factor_label"0|*>1") THEN
 !-> IF 0 THEN
ELIF ($ferret_factor"0|*>1") THEN
 !-> ELIF 0 THEN
ENDIF
 
IF `($data_title"0|*>1") EQ 0` THEN
 !-> IF 0 THEN
  ENDIF
ENDIF
 
 
DEFINE SYMBOL ferret_plot_var = ($data_var)[d=($data_num),($region_full)]
 !-> DEFINE SYMBOL ferret_plot_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
IF ($analysis_def"0|*>1") THEN  ! analysis_def from curvi data or transform
 !-> IF 0 THEN
ENDIF
 
DEFINE SYMBOL ferret_plot_var_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_var_noregion = 'ADDEP'[d=1]
DEFINE SYMBOL ferret_plot_var_($num)_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_var_0_noregion = 'ADDEP'[d=1]
 
DEFINE SYMBOL ferret_plot_base_var = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_plot_base_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
DEFINE SYMBOL ferret_plot_base_var_($num) = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_plot_base_var_0 = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
DEFINE SYMBOL ferret_plot_base_var_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_base_var_noregion = 'ADDEP'[d=1]
 
! Needed for transform_seasonal, save variable definition without any
! time-region information that may be added, and also with the time region only
 
DEFINE SYMBOL ferret_xyz_var = ($data_var)[d=($data_num),($region_xyz)]
 !-> DEFINE SYMBOL ferret_xyz_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0]
DEFINE SYMBOL ferret_t_var = ($data_var)[d=($data_num),($region_t)]
 !-> DEFINE SYMBOL ferret_t_var = 'ADDEP'[d=1,T="15-Jan-0000":"15-Dec-0000"]
 
! ferret_x_var needed for listing data to files
DEFINE SYMBOL ferret_x_var = ($data_var)[d=($data_num),($region_x)]
 !-> DEFINE SYMBOL ferret_x_var = 'ADDEP'[d=1,X=0.5:359.5]
IF `($region_x"0|*>1) EQ 0` THEN DEFINE SYMBOL ferret_x_var = ($data_var)[d=($data_num)]
 !-> IF 0 THEN DEFINE SYMBOL ferret_x_var = 'ADDEP'[d=1]
 
! Apply any transforms that may have been specified.
GO LAS_transforms ($num)
 !-> GO LAS_transforms 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LAS_transforms.jnl
!
! $Author: ansley $
! $Date: 2006/09/27  $
! 2007/3/13 ACM changes for all slices of curvilinear data.
! 4/2007    ACM Apply Ferret symbols for any expression that may have been defined
 
!
! LAS_transforms.jnl applies one or more transforms to $ferret_plot_var
 
! This script is called from LAS_initialize_data after the region and
! data have been initialized.
! Argument is the variable number (0 or 1 if this is a comparison)
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
 
!  Transform to 3-month seasonal averages, with desired centering
IF `($constraint_0_lhs"0|Seasonal_Regridding>1|*>0")` THEN
 !-> IF 0 THEN
ENDIF
 
! Transform to 1-season per year, centered on any month, with season being 1, 3, or 5 months long.
IF `STRINDEX("($constraint_0_lhs"0")", "Season_length") GT 0` THEN
 !-> IF 0 THEN
ENDIF
 
! See if the grid is curvilinear in XY, Hybrid Z or both
 
DEFINE SYMBOL do_curvi_xy = 0
DEFINE SYMBOL do_hybrid_z = 0
DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 0
 
IF ($ferret_curvi_coord_lat"0|*>1") THEN DEFINE SYMBOL do_curvi_xy = 1
 !-> IF 0 THEN DEFINE SYMBOL do_curvi_xy = 1
IF ($ferret_thk_var"0|*>1") THEN  DEFINE SYMBOL do_hybrid_z = 1
 !-> IF 0 THEN  DEFINE SYMBOL do_hybrid_z = 1
IF `($do_curvi_xy) + ($do_hybrid_z) EQ 2` THEN DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 1
 !-> IF 0 THEN DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 1
 
IF ($do_curvi_xy_and_hybrid_z) THEN GO transform_hybrid_z_curvi_xy
 !-> IF 0 THEN GO transform_hybrid_z_curvi_xy
 
! Set up to deal with hybrid-Z data.
IF `($do_hybrid_z) AND ($do_curvi_xy_and_hybrid_z"0") EQ 0` THEN \
   GO transform_hybrid_z.jnl
 !-> IF 0 THEN    GO transform_hybrid_z.jnl
 
! Set up to deal with curvilinear XY data
IF ($do_curvi_xy) THEN GO transform_curvi_xy.jnl
 !-> IF 0 THEN GO transform_curvi_xy.jnl
 
! End of $RCSfile ------------LAS_transforms.jnl-------------------------------
 
 
! Get any DEFINE VARIABLE analysis definitions
! This renames the data variable, and so redefines the symbol data_var
! and sets up the analysis: e.g. ,z=0:2000@ave
 
! unComment this for testing.
 
IF ($data_0_analysis_label"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
! 2D fill style
IF `STRLEN("($ferret_view)") EQ 2` THEN
 !-> IF 0 THEN
ENDIF
ENDIF
ENDIF
   ENDIF
ENDIF
DEFINE SYMBOL variable_($1"0")_lab = ($ferret_plot_title)
 !-> DEFINE SYMBOL variable_0_lab = Argo-Aviso Absolute Dynamic Depth Monthly Climatology (dynamic meters)
IF `($1"0") EQ 0` THEN DEFINE SYMBOL variable_lab = ($ferret_plot_title)
 !-> IF 1 THEN DEFINE SYMBOL variable_lab = Argo-Aviso Absolute Dynamic Depth Monthly Climatology (dynamic meters)
 !-> DEFINE SYMBOL variable_lab = Argo-Aviso Absolute Dynamic Depth Monthly Climatology (dynamic meters)
 
IF `STRLEN("($ferret_view)") GT 1 AND ($its_prop_prop_plot"0|*>1") EQ 0 AND \
($itsa_vector_plot"0|*>1") EQ 0` THEN DEFINE SYMBOL qualifiers = ($qualifiers)/KEY=CONT
 !-> IF 1 THEN DEFINE SYMBOL qualifiers =  /KEY=CONT
 !-> DEFINE SYMBOL qualifiers =  /KEY=CONT
 
IF ($ferret_expression"0|*>1") THEN GO LAS_expression
 !-> IF 0 THEN GO LAS_expression
 
! End of $RCSfile ------------LAS_initialize_data.jnl--------------------------
 
IF `($FERRET_MEMORY"25") LT 100` THEN SET MEM/SIZ=100
 !-> IF 1 THEN SET MEM/SIZ=100
 !-> SET MEM/SIZ=100
 
! Here is the variable we will list out, with the region specified.
DEFINE SYMBOL ferret_list_var = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_list_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
 
IF ($do_curvi_xy"0") THEN
 !-> IF 0 THEN
ELSE
   LET the_var = ($ferret_plot_var)
 !-> DEFINE VARIABLE the_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
   DEFINE SYMBOL imin `the_var,return=xstart`
 !-> DEFINE SYMBOL imin 0.5E
   DEFINE SYMBOL imax `the_var,return=iend`
 !-> DEFINE SYMBOL imax 360
   DEFINE SYMBOL isize `the_var,return=isize`
 !-> DEFINE SYMBOL isize 360
   DEFINE SYMBOL jmin `the_var,return=jstart`
 !-> DEFINE SYMBOL jmin 1
   DEFINE SYMBOL jmax `the_var,return=jend`
 !-> DEFINE SYMBOL jmax 180
   DEFINE SYMBOL jsize `the_var,return=jsize`
 !-> DEFINE SYMBOL jsize 180
ENDIF
 
DEFINE SYMBOL kmin `the_var,return=kstart`
 !-> DEFINE SYMBOL kmin 1
DEFINE SYMBOL kmax `the_var,return=kend`
 !-> DEFINE SYMBOL kmax 1
DEFINE SYMBOL ksize `the_var,return=ksize`
 !-> DEFINE SYMBOL ksize 1
DEFINE SYMBOL lmin `the_var,return=lstart`
 !-> DEFINE SYMBOL lmin 1
DEFINE SYMBOL lmax `the_var,return=lend`
 !-> DEFINE SYMBOL lmax 12
DEFINE SYMBOL lsize `the_var,return=lsize`
 !-> DEFINE SYMBOL lsize 12
 
! For vector plots, compute consistent vector length for the
! animation.
 
! For color or contour plots, LAS_auto_levels_animate checks whether
! symbols for color levels have been set, and if not, sets them for
! the variable at all time steps.
 
IF `($data_count"1") EQ 2` THEN
 !-> IF 0 THEN
ELSE
   GO LAS_auto_levels_animate
! LAS_auto_levels_animate.jnl
! ACM 8/22/2007
!
! acm 9/11/07 If its a descriptor file Ferret wont allow striding.
!             check for that case and just set num levels.
! acm* 2/2010 Set up a few things and then Use Ferret-s open-ended levels
!             if the levs havent been set by the user or configuration.
!             Allow for old algorithm if older Ferret is in place.
 
! Based on a variables value over its entire range, set strides
! if needed to quickly get stats on the variable. Use this to set levels.
 
! Argument: the variable to use in setting the levels.
 
! The symbol ferret_center_levels, if set to 1, forces the levels
! to be 2 std above and below zero. Otherwise use 2 std above
! and below the data mean
 
! This script should be done BEFORE any other striding is done.
! It operates on the variable on its entire native unstrided grid.
 
! input_fill_levels and input_contour_levels are symbols that are defined in
! LAS_initialize_variable.jnl, telling whether settings for levels were
! made
 
! Determine striding for speed in operating the STAT command
LET memsize = 0.5* 1.e6
 
! Make sure its a 2D plot operation.
 
DEFINE SYMBOL op = `UPCASE("($operation_ID)")`
 !-> DEFINE SYMBOL op = ANIMATION_FRAMES_XY
 
!IF `($ferret_view"|xy>1|*>0") NE 1` THEN EXIT/SCRIPT
IF `STRINDEX("($op)", "VECTOR") GT 0` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
IF `STRINDEX("($op)", "ANIMATION") EQ 0` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
! NOTE: animations have not been implemented for difference plots.
! If its a compare plot, and if the ($ferret_diff_var) is not yet defined,
! just return.
 
IF `($ferret_diff_var"1|*>0") AND STRINDEX("($op)", "COMPARE_PLOT") NE 0` THEN
 !-> IF 0 THEN
ENDIF
 
! Remove any previous native striding
 
IF ($xstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=xaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'ADDEP'[d=1],RETURN=xaxis`
IF ($ystride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=yaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'ADDEP'[d=1],RETURN=yaxis`
IF ($tstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=taxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'ADDEP'[d=1],RETURN=taxis`
IF ($zstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=zaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'ADDEP'[d=1],RETURN=zaxis`
CANCEL SYMBOL xstride
CANCEL SYMBOL ystride
CANCEL SYMBOL tstride
CANCEL SYMBOL zstride
 
DEFINE SYMBOL ferret_center_levels ($ferret_center_levels"0|1|TRUE>1|*>0")
 !-> DEFINE SYMBOL ferret_center_levels 0
 
! See if centered levels were requested, either by setting the symbol ferret_center_levels
! or with a contour_levels or fill_levels that is centered.
 
! See if centered levels were requested, either by setting the symbol ferret_center_levels
! or with a contour_levels or fill_levels that is centered.
 
! If contour levels requested with levels of nC, e.g. 20C, then get the value to
! set num_fine_levels in the %RANGE command below
 
! In general if other levels spec is given, return. However if it is a simple number,
! use that to set the number of fine levels.
 
IF ($ferret_contour_levels"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
   ENDIF
ENDIF
 
 
IF ($ferret_fill_levels"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
   ENDIF
ENDIF
 
! Apply to the variable on the requested region in x, y, z and all time.
 
IF `($ferret_plot_var"0|*>1") EQ 0` THEN EXIT/SCRIPT  !e.g. for insitu plots may not have a plot_var
 !-> IF 0 THEN EXIT/SCRIPT
 
 
LET max_size = 50
IF `($do_curvi_xy"0|0|*>1") EQ 0` THEN
 !-> IF 1 THEN
 
   LET pvar = ($ferret_plot_var)
 !-> DEFINE VARIABLE pvar = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
   LET var_size = ABS( `pvar,RETURN=size`)
 !-> DEFINE VARIABLE var_size = ABS( 777600)
   DEFINE SYMBOL var_dim = `pvar,RETURN=shape`
 !-> DEFINE SYMBOL var_dim = XYT
   LET ndims = STRLEN("($var_dim)")
 !-> DEFINE VARIABLE ndims = STRLEN("XYT")
 
   IF `var_size GT memsize` THEN \
   LET max_size = `INT( 1+ ((var_size/memsize))/ndims )`
 !-> IF 1 THEN    LET max_size = `INT( 1+ ((var_size/memsize))/ndims )`
 !-> LET max_size = `INT( 1+ ((var_size/memsize))/ndims )`
 !-> DEFINE VARIABLE max_size = 1
ELSE
ENDIF
 
! Apply native striding if possible
 
IF ($regrid_fcn"0|*>1") THEN
 !-> IF 0 THEN
ELSE  !!! regrid_fcn
 
! region syms dont apply to native curv grid directly
 
IF `($do_curvi_xy"0")` THEN
 !-> IF 0 THEN
ELSE
   LET xsize = `pvar,RETURN=isize`
 !-> DEFINE VARIABLE xsize = 360
   DEFINE SYMBOL xstride = `INT(xsize/10)`
 !-> DEFINE SYMBOL xstride = 36
   IF `($xstride) LT 2` THEN CANCEL SYMBOL xstride
 !-> IF 0 THEN CANCEL SYMBOL xstride
 
   LET ysize = `pvar,RETURN=jsize`
 !-> DEFINE VARIABLE ysize = 180
   DEFINE SYMBOL ystride = `INT(ysize/10)`
 !-> DEFINE SYMBOL ystride = 18
   IF `($ystride) LT 2` THEN CANCEL SYMBOL ystride
 !-> IF 0 THEN CANCEL SYMBOL ystride
 
ENDIF ! do_curvi_xy
 
ENDIF  !!! regrid_fcn
 
 
IF ($index_strides"0|*>1") THEN
 !-> IF 0 THEN
ELSE
   DEFINE SYMBOL ppvar = pvar
ENDIF
 
! Can always use native strides in z and t
 
! Should be only one Z anyway for xy animations, but this wont hurt,
LET zsize  `pvar,RETURN=ksize`
 !-> DEFINE VARIABLE zsize  1
DEFINE SYMBOL zstride = `INT(zsize/10)`
 !-> DEFINE SYMBOL zstride = 0
IF `($zstride) LT 2` THEN CANCEL SYMBOL zstride
 !-> IF 1 THEN CANCEL SYMBOL zstride
 !-> CANCEL SYMBOL zstride
 
! The time range specifies the whole t region.
LET tsize  `($ppvar),RETURN=lsize`
 !-> DEFINE VARIABLE tsize  12
 
LET strd_lo = 1
LET anim_timevar = ($ppvar)
 !-> DEFINE VARIABLE anim_timevar = pvar
LET tt = t[gt=anim_timevar]
 
LET strd_hi = `tt,return=lsize`
 !-> DEFINE VARIABLE strd_hi = 12
 
! The incoming t region is the region over which to animate...
LET LL = L[gt=($data_var)[d=($data_num)]]
 !-> DEFINE VARIABLE LL = L[gt='ADDEP'[d=1]]
LET strd_lo = `LL[t="($region_t_lo)"]`
 !-> DEFINE VARIABLE strd_lo = 1
LET strd_hi = `LL[t="($region_t_hi)"]`
 !-> DEFINE VARIABLE strd_hi = 12
LET tsize = `strd_hi - strd_lo + 1`
 !-> DEFINE VARIABLE tsize = 12
 
IF ($ferret_time_step"0|*>1") THEN
 !-> IF 1 THEN
   LET strd_del = ($ferret_time_step)
 !-> DEFINE VARIABLE strd_del = 1
   IF `(tsize/strd_del) GT max_size` THEN
 !-> IF 1 THEN
      LET strd_test = tsize/max_size
      LET strd_fact = INT(strd_test/($ferret_time_step))
 !-> DEFINE VARIABLE strd_fact = INT(strd_test/1)
      LET strd_del = ($ferret_time_step)* strd_fact
 !-> DEFINE VARIABLE strd_del = 1* strd_fact
      IF `strd_del LE 2` THEN LET strd_del = 2
 !-> IF 0 THEN LET strd_del = 2
   ENDIF
 
   IF `strd_del LT 10` THEN
 !-> IF 0 THEN
   ENDIF
ELSE
   ENDIF
ENDIF
 
DEFINE SYMBOL tstride = `strd_del`
 !-> DEFINE SYMBOL tstride = 12
 
 
IF ($index_strides"0|*>1") THEN
 !-> IF 0 THEN
ELSE
   DEFINE SYMBOL ppvar = pvar
ENDIF
 
IF `($index_strides"0|*>1") EQ 0` THEN
 !-> IF 1 THEN
   IF `($xstride"0") GT 1` THEN SET AXIS/STRIDE=($xstride) `pvar,RETURN=xaxis`
 !-> IF 1 THEN SET AXIS/STRIDE=36 `pvar,RETURN=xaxis`
 !-> SET AXIS/STRIDE=36 `pvar,RETURN=xaxis`
 !-> SET AXIS/STRIDE=36 LONGITUDE
   IF `($ystride"0") GT 1` THEN SET AXIS/STRIDE=($ystride) `pvar,RETURN=yaxis`
 !-> IF 1 THEN SET AXIS/STRIDE=18 `pvar,RETURN=yaxis`
 !-> SET AXIS/STRIDE=18 `pvar,RETURN=yaxis`
 !-> SET AXIS/STRIDE=18 LATITUDE
   DEFINE SYMBOL ppvar = pvar
ENDIF
IF `($zstride"0") GT 1` THEN SET AXIS/STRIDE=($zstride) `pvar,RETURN=zaxis`
 !-> IF 0 THEN SET AXIS/STRIDE=  `pvar,RETURN=zaxis`
IF `($tstride"0") GT 1` THEN SET AXIS/STRIDE=($tstride) `pvar,RETURN=taxis`
 !-> IF 1 THEN SET AXIS/STRIDE=12 `pvar,RETURN=taxis`
 !-> SET AXIS/STRIDE=12 `pvar,RETURN=taxis`
 !-> SET AXIS/STRIDE=12 TIME
 
! Use Ferrets variance-based levels.
LET varxd = ($ppvar)
 !-> DEFINE VARIABLE varxd = pvar
DEFINE SYMBOL shapevar = `varxd,RETURN=shape`
 !-> DEFINE SYMBOL shapevar = XY
 
! When we have used striding, RETURN=size doesnt work well
LET csiz = 1
DEFINE SYMBOL vsiz = 1
IF `STRINDEX("($shapevar)", "X") GT 0` THEN
 !-> IF 1 THEN
   LET cvar = x[gx=varxd]
   IF `($do_curvi_xy"0|*>1") EQ 0` THEN LET cvar = x[gx=varxd,($region_x)]
 !-> IF 0 THEN LET cvar = x[gx=varxd,X=0.5:359.5]
   LET csiz = `cvar,RETURN=isize`
 !-> DEFINE VARIABLE csiz = 10
   DEFINE SYMBOL vsiz = `csiz * ($vsiz) `
 !-> DEFINE SYMBOL vsiz = 10
ENDIF
IF `STRINDEX("($shapevar)", "Y") GT 0` THEN
 !-> IF 1 THEN
   LET cvar = y[gy=varxd]
   IF `($do_curvi_xy"0|*>1") EQ 0` THEN LET cvar = y[gy=varxd,($region_y)]
 !-> IF 0 THEN LET cvar = y[gy=varxd,Y=-89.5:89.5]
   LET csiz = `cvar,RETURN=jsize`
 !-> DEFINE VARIABLE csiz = 10
   DEFINE SYMBOL vsiz = `csiz * ($vsiz)`
 !-> DEFINE SYMBOL vsiz = 100
ENDIF
IF `STRINDEX("($shapevar)", "Z") GT 0` THEN
 !-> IF 0 THEN
ENDIF
IF `STRINDEX("($shapevar)", "T") GT 0` THEN
 !-> IF 0 THEN
ENDIF
 
LET isqr = INT(($vsiz)^0.5)
 !-> DEFINE VARIABLE isqr = INT(100^0.5)
 
DEFINE AXIS/y=1:`isqr`:1 yshortaxis
 !-> DEFINE AXIS/y=1:10:1 yshortaxis
DEFINE AXIS/x=1:`INT(($vsiz)/isqr)`:1 xhalfaxis
 !-> DEFINE AXIS/x=1:10:1 xhalfaxis
LET varshape = x[gx=xhalfaxis] + y[gy=yshortaxis]
LET var1d = XSEQUENCE(($ppvar))
 !-> DEFINE VARIABLE var1d = XSEQUENCE(pvar)
LET var2d = RESHAPE(var1d, varshape)
IF ($ferret_center_levels) THEN
 !-> IF 0 THEN
ELSE
 
  SHADE/LEV=($num_fine_levels)v var2d
 !-> SHADE/LEV= v var2d
ENDIF
 
IF ($LEV_OPNLEVS"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL ferret_fill_levels = ($LEV_OPNLEVS)
 !-> DEFINE SYMBOL ferret_fill_levels = (-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)
   DEFINE SYMBOL ferret_contour_levels = ($LEV_OPNLEVS)
 !-> DEFINE SYMBOL ferret_contour_levels = (-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)
ENDIF
 
! Restore original axes
IF `($index_strides"0|*>1") EQ 0` THEN
 !-> IF 1 THEN
 
IF `($xstride"0") GT 1` THEN
 !-> IF 1 THEN
  CANCEL AXIS/STRIDE `pvar,RETURN=xaxis`
 !-> CANCEL AXIS/STRIDE (AX006)
  CANCEL SYMBOL xstride
ENDIF
IF `($ystride"0") GT 1` THEN
 !-> IF 1 THEN
  CANCEL AXIS/STRIDE `pvar,RETURN=yaxis`
 !-> CANCEL AXIS/STRIDE (AX007)
  CANCEL SYMBOL ystride
ENDIF
IF `($zstride"0") GT 1` THEN
 !-> IF 0 THEN
ENDIF
IF `($tstride"0") GT 1` THEN
 !-> IF 1 THEN
  CANCEL AXIS/STRIDE `pvar,RETURN=taxis`
 !-> CANCEL AXIS/STRIDE (AX008)
  CANCEL SYMBOL tstride
ENDIF
 
ENDIF
! End of file ------------LAS_auto_levels_animate.jnl--------------------------
ENDIF
 
!for animation of 1D plots
 
DEFINE SYMBOL ndim = STRLEN("($ferret_view)")
 !-> DEFINE SYMBOL ndim = STRLEN("xyt")
 
!x, xt, y, yt, z, or zt view
IF `(($ndim) EQ 1) OR ( (($ndim) EQ 2) AND (STRINDEX("($ferret_view)", "t") GT 0) )` THEN
 !-> IF 0 THEN
   ENDIF
 ENDIF
 ENDIF
ENDIF  ! ndim = 1
 
SET LIST/FILE="($result_ferret_listing_filename)"
 !-> SET LIST/FILE="/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las_v7/output/F8E09B64B82DC9A6269E62908E5DD923_ferret_listing.xml"
 
 
IF ($do_curvi_xy"0") THEN
 !-> IF 0 THEN
ENDIF
 
DEFINE SYMBOL hasT = 1
 
!-----------------------------------------
! compute time range for animation on XY view
!-----------------------------------------
!- only a single time ponit was selected
!- or, there is not time axis at all
 
! max_tpoints is the arbitrary size limit of the time range
! 21 might be a good value for an animation
! 251 might be a good value for a time series plot
!DEFINE SYMBOL max_tpoints 7   ! should be an odd number
 
! Determine a new time range if just a single point requested
IF ($do_curvi_xy"0") THEN
 !-> IF 0 THEN
ELSE
   DEFINE SYMBOL nt = `the_var,return=lsize`   ! no. of time points requested
 !-> DEFINE SYMBOL nt = 12   ! no. of time points requested
ENDIF
 
IF `($nt) eq 1` THEN
 !-> IF 0 THEN
    ENDIF
     ENDIF
     ENDIF
ENDIF
 
IF ($do_curvi_xy"0") THEN
 !-> IF 0 THEN
ELSE
   DEFINE SYMBOL ferret_list_var = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_list_var = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
ENDIF
 
!----------------------------------------
! start writing to the file
!----------------------------------------
LET xmlhead = "<?xml version='1.0' encoding='UTF-8'?>"
define variable len = STRLEN(xmlhead)
define symbol fmt = A`len`
 !-> define symbol fmt = A38
list/nohead/clobber/format=(($fmt))/FILE xmlhead
 !-> list/nohead/clobber/format=(A38)/FILE xmlhead
 
LET framesStart = "<lasAnimation>"
define variable len = STRLEN(framesStart)
define symbol fmt = A`len`
 !-> define symbol fmt = A14
list/nohead/format=(($fmt))/FILE/append framesStart
 !-> list/nohead/format=(A14)/FILE/append framesStart
 
!------------
! fill_levels  ! see the note under ferret_contour_levels
!------------
IF `($ferret_fill_levels"0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_fill_levels 10
 !-> IF 0 THEN DEFINE SYMBOL ferret_fill_levels 10
 
LET f = "<fill_levels>"
list/norowhead/nohead/format=(A13)/FILE/append f
 
let nlen = strlen ("($ferret_fill_levels)")
 !-> DEFINE VARIABLE nlen = strlen ("(-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)")
let a = "($ferret_fill_levels)"
 !-> DEFINE VARIABLE a = "(-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)"
list/norowhead/nohead/format=(A`nlen`)/FILE/append a
 !-> list/norowhead/nohead/format=(A61)/FILE/append a
 
LET f = "</fill_levels>"
list/norowhead/nohead/format=(A14)/FILE/append f
 
!---------------
! contour_levels
! If there is no ferret_contour_levels then send a value
! anyway - the xml file apparently needs it to be set. It
! will not be used in the plot unless the plot style draws lines.
! Just skipping this block and writing no contour_levels fails.
!---------------
IF `($ferret_contour_levels"0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_contour_levels 10
 !-> IF 0 THEN DEFINE SYMBOL ferret_contour_levels 10
LET f = "<contour_levels>"
list/norowhead/nohead/format=(A16)/FILE/append f
 
let nlen = strlen ("($ferret_contour_levels)")
 !-> DEFINE VARIABLE nlen = strlen ("(-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)")
let a = "($ferret_contour_levels)"
 !-> DEFINE VARIABLE a = "(-inf)(-1,-0.283,0.102)(-0.2,1.05,0.05)(1.03,1.03,0.102)(inf)"
list/norowhead/nohead/format=(A`nlen`)/FILE/append a
 !-> list/norowhead/nohead/format=(A61)/FILE/append a
 
LET f = "</contour_levels>"
list/norowhead/nohead/format=(A17)/FILE/append f
 
!---------------
! dep_axis_scale
!---------------
LET f = "<dep_axis_scale>"
list/norowhead/nohead/format=(A16)/FILE/append f
 
let nlen = strlen ("($ferret_dep_axis_scale)")
 !-> DEFINE VARIABLE nlen = strlen (" ")
let a = "($ferret_dep_axis_scale)"
 !-> DEFINE VARIABLE a = " "
list/norowhead/nohead/format=(A`nlen`)/FILE/append a
 !-> list/norowhead/nohead/format=(A1)/FILE/append a
 
LET f = "</dep_axis_scale>"
list/norowhead/nohead/format=(A17)/FILE/append f
 
 
!------------
! vector_length  ! see the note under ferret_contour_levels
!------------
IF `($ferret_vector_length"0|*>1") EQ 0` THEN DEFINE SYMBOL ferret_vector_length 10
 !-> IF 1 THEN DEFINE SYMBOL ferret_vector_length 10
 !-> DEFINE SYMBOL ferret_vector_length 10
 
LET f = "<vector_length>"
list/norowhead/nohead/format=(A15)/FILE/append f
 
let nlen = strlen ("($ferret_vector_length)")
 !-> DEFINE VARIABLE nlen = strlen ("10")
let a = "($ferret_vector_length)"
 !-> DEFINE VARIABLE a = "10"
list/norowhead/nohead/format=(A`nlen`)/FILE/append a
 !-> list/norowhead/nohead/format=(A2)/FILE/append a
 
LET f = "</vector_length>"
list/norowhead/nohead/format=(A16)/FILE/append f
 
 
!------------
! hasT
!------------
LET f = "<hasT>"
list/norowhead/nohead/format=(A6)/FILE/append f
 
let nlen = strlen ("($hasT)")
 !-> DEFINE VARIABLE nlen = strlen ("1")
let a = "($hasT)"
 !-> DEFINE VARIABLE a = "1"
list/norowhead/nohead/format=(A`nlen`)/FILE/append a
 !-> list/norowhead/nohead/format=(A1)/FILE/append a
 
LET f = "</hasT>"
list/norowhead/nohead/format=(A7)/FILE/append f
 
! ouput individual time points
LET f = "<frames>"
list/norowhead/nohead/format=(A8)/FILE/append f
 
!====>output time frames
let lvar = ($ferret_list_var)  ! if ferret_list_var contains an expression, cant just do t[gt=(symbol)]
 !-> DEFINE VARIABLE lvar = 'ADDEP'[d=1,X=0.5:359.5,Y=-89.5:89.5,Z=0:0,T="15-Jan-0000":"15-Dec-0000"]
let tvar = t[gt=lvar]
define symbol first_time = `tax_datestring(t[gt=tvar,L=1], t[gt=tvar], "seconds")`
 !-> define symbol first_time = 15-JAN-0000 00:00:00
let nlen = strlen ("($first_time)")
 !-> DEFINE VARIABLE nlen = strlen ("15-JAN-0000 00:00:00")
 
IF ($ferret_time_step"1|*>0") THEN
 !-> IF 0 THEN
ELSE
    list/norowhead/nohead/format=("<frame>",A`nlen`,"</frame>")/FILE/append tax_datestring(t[gt=tvar,L=($lmin):($lmax):($ferret_time_step)], t[gt=tvar], "seconds")
 !-> list/norowhead/nohead/format=("<frame>",A20,"</frame>")/FILE/append tax_datestring(t[gt=tvar,L=1:12:1], t[gt=tvar], "seconds")
ENDIF
 
LET f = "</frames>"
list/norowhead/nohead/format=(A9)/FILE/append f
 
DEFINE SYMBOL time_units = `tax_units(tvar)`
 !-> DEFINE SYMBOL time_units = 2629800
 
!---------------------
! time unit in months
!--------------------
!IF `strcmp("($time_units)", "2629746") EQ 0` THEN
!    LET f = "<units>months</units>"
!    list/norowhead/nohead/format=(A21)/FILE/append f
!------------------
!time unit in years
!------------------
!ELIF `strcmp("($time_units)", "31536000") EQ 0` THEN
!    LET f = "<units>years</units>"
!    list/norowhead/nohead/format=(A20)/FILE/append f
!--------------------
!time unit in seconds
!--------------------
!ELSE
    LET f = "<units>seconds</units>"
    list/norowhead/nohead/format=(A22)/FILE/append f
!ENDIF
 
LET framesEnd = "</lasAnimation>"
list/nohead/format=(A15)/FILE/append framesEnd
 
 
 !->  EXIT/PROGRAM

 Cached data cleared from memory
 **ERROR: illegal limits: LL does not exist at T=15-JAN-0001 00:00
          Axis extremes are T=01-JAN-0000 00:00:30-DEC-0000 00:34
DEFINE VARIABLE strd_lo = `LL[t="15-Jan-0001"]`
Command file, command group, or REPEAT execution aborted
ERROR RUNNING SCRIPT

go "$1"
 !-> go "/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/WEB-INF/classes/resources/ferret/temp/ferret_operation_61185_1375858631773.jnl"
! Symbols from the server
                        DEFINE SYMBOL data_0_ID = TEMP-id-argo_clim
                                 DEFINE SYMBOL data_0_catid = id-argo_clim
                                 DEFINE SYMBOL data_0_dataset_ID = id-argo_clim
                                 DEFINE SYMBOL data_0_dataset_name = Argo 1x1 degree variationaly interpolated monthly Climatology
                                 DEFINE SYMBOL data_0_dataset_url = /las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc
                                 DEFINE SYMBOL data_0_dsid = id-argo_clim
                                 DEFINE SYMBOL data_0_dsname = Argo 1x1 degree variationaly interpolated monthly Climatology
                                 DEFINE SYMBOL data_0_ftds_url = http://las.nio.org/thredds/dodsC/las/id-argo_clim/data_las_server_LAS_Data_Global_Argo_Climatology_argo_CLIM_grd.nc.jnl
                                 DEFINE SYMBOL data_0_grid_type = regular
                                 DEFINE SYMBOL data_0_intervals = xyzt
                                 DEFINE SYMBOL data_0_name = Argo Temperature Monthly Climatology
                                 DEFINE SYMBOL data_0_points = xyzt
                                 DEFINE SYMBOL data_0_region = region_0
                                 DEFINE SYMBOL data_0_title = Argo Temperature Monthly Climatology
                                 DEFINE SYMBOL data_0_units = degC
                                 DEFINE SYMBOL data_0_url = /las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc
                                 DEFINE SYMBOL data_0_var = TEMP
                                 DEFINE SYMBOL data_0_xpath = /lasdata/datasets/id-argo_clim/variables/TEMP-id-argo_clim
                                 DEFINE SYMBOL data_count = 1
                                 DEFINE SYMBOL ferret_annotations = file
                                 DEFINE SYMBOL ferret_fill_type = fill
                                 DEFINE SYMBOL ferret_image_format = gif
                                 DEFINE SYMBOL ferret_land_type = contour
                                 DEFINE SYMBOL ferret_memsize = 2048
                                 DEFINE SYMBOL ferret_service_action = Data_Extract_Frames
                                 DEFINE SYMBOL ferret_size = .8333
                                 DEFINE SYMBOL ferret_time_step = 1
                                 DEFINE SYMBOL ferret_view = xyt
                                 DEFINE SYMBOL las_debug = false
                                 DEFINE SYMBOL las_output_type = json
                                 DEFINE SYMBOL operation_ID = Animation_Frames_XY
                                 DEFINE SYMBOL operation_key = 985765ABADE04C7EA6888FEBF2CB2494
                                 DEFINE SYMBOL operation_name = AnimationFrames
                                 DEFINE SYMBOL operation_service = ferret
                                 DEFINE SYMBOL operation_service_action = Data_Extract_Frames
                                 DEFINE SYMBOL product_server_default_dsid = ocean_atlas_subset
                                 DEFINE SYMBOL product_server_default_operation = Plot_2D_XY_zoom
                                 DEFINE SYMBOL product_server_default_option = Options_2D_image_contour_xy_7
                                 DEFINE SYMBOL product_server_default_varid = TEMP-ocean_atlas_subset
                                 DEFINE SYMBOL product_server_default_view = xy
                                 DEFINE SYMBOL product_server_ps_timeout = 9999999999
                                 DEFINE SYMBOL product_server_ui_timeout = 20
                                 DEFINE SYMBOL product_server_use_cache = true
                                 DEFINE SYMBOL product_server_version = 7.3
                                 DEFINE SYMBOL region_0_t_hi = 15-Dec-0000
                                 DEFINE SYMBOL region_0_t_lo = 15-Jan-0001
                                 DEFINE SYMBOL region_0_x_hi = 360
                                 DEFINE SYMBOL region_0_x_lo = 0
                                 DEFINE SYMBOL region_0_y_hi = 90
                                 DEFINE SYMBOL region_0_y_lo = -90
                                 DEFINE SYMBOL region_0_z_hi = 0
                                 DEFINE SYMBOL region_0_z_lo = 0
                                 DEFINE SYMBOL result_annotations_ID = annotations
                                 DEFINE SYMBOL result_annotations_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_annotations.xml
                                 DEFINE SYMBOL result_annotations_type = annotations
                                 DEFINE SYMBOL result_cancel_ID = cancel
                                 DEFINE SYMBOL result_cancel_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_cancel.txt
                                 DEFINE SYMBOL result_cancel_type = cancel
                                 DEFINE SYMBOL result_count = 5
                                 DEFINE SYMBOL result_debug_ID = debug
                                 DEFINE SYMBOL result_debug_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt
                                 DEFINE SYMBOL result_debug_type = debug
                                 DEFINE SYMBOL result_ferret_listing_ID = ferret_listing
                                 DEFINE SYMBOL result_ferret_listing_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_ferret_listing.xml
                                 DEFINE SYMBOL result_ferret_listing_type = xml
                                 DEFINE SYMBOL result_rss_ID = rss
                                 DEFINE SYMBOL result_rss_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/68E45B081627E4473E465B634DCC9612_rss.rss
                                 DEFINE SYMBOL result_rss_type = rss
         GO ($operation_service_action)
 !-> GO Data_Extract_Frames
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! $Author: rhs $
!
! Extracting to a netCDF file and some text and table files have different
! options in the UI.  Need to separate them at this level to keep the UI
! happy.  All the Data_Extract* scripts launch the same list_data.jnl script.
 
! Reset .gif filename. The auto-levels script makes a test plot.
 
IF `($result_plot_image_filename%0|*>1%) EQ 0` THEN DEFINE SYMBOL \
result_plot_image_filename = ($result_debug_filename).gif
 !-> IF 1 THEN DEFINE SYMBOL result_plot_image_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt.gif
 !-> DEFINE SYMBOL result_plot_image_filename = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt.gif
GO LAS_reset_gifname
! LAS_reset_gifname.jnl
!
! Reset the default gif filename used internally by Ferret.
! This must be done before PPLUS is opened.  Some of the scripts use PPL
! symbol editing, so even before any plot commands are issued, pplus is
! started.
!
! Define the gif filename (preventing collisions of file named ".gif" in VizGal)
 
! When a colorbar is also made, the colorbar image overwrites the main plot in
! V6.8. Add characters to the GIFFILE setting here, the correct images will
! be set when the image is saved with FRAME.
 
! Some google earth plots scripts come in without a result image filename.
! Just make up a name here. (A gif file with this name will be written in the
! temp directory.)
IF `($result_plot_image_filename%0|*>1%) EQ 0` THEN
 !-> IF 0 THEN
ENDIF
 
DEFINE SYMBOL gifplot_name = ($result_plot_image_filename)
 !-> DEFINE SYMBOL gifplot_name = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt.gif
IF ($result_colorbar_filename%0|*>1%) THEN \
DEFINE SYMBOL gifplot_name = ($result_plot_image_filename)_($session_pid)
 !-> IF 0 THEN DEFINE SYMBOL gifplot_name = /usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt.gif_573
 
IF `(($reset_gifname"0|*>1") EQ 0) AND ($FERRET_VERSION"0") GE 6.721` THEN
 !-> IF 1 THEN
   IF `STRINDEX("($gifplot_name)", "gif") GT 0` THEN
 !-> IF 1 THEN
      SET GIFFILE "($gifplot_name)"
 !-> SET GIFFILE "/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/las/output/985765ABADE04C7EA6888FEBF2CB2494_debug.txt.gif"
      DEFINE SYMBOL reset_gifname = 1
   ENDIF
ENDIF
 
GO list_frames
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: list_frames.jnl,v $
!
! $Author: Jing Y. Li $
! $Date: 2007/08/22
! 2007/11/27 ACM If the variable is a native curvilinear data variable, operate
!                on the data field not the var,xcoord,ycoord which has been
!                defined as the *plot variable*". Specify the XY region for the
!                variable using the i,j box limits previously computed.
!                Question: should the longitude/ latitude coordinates or other
!                informatino about the curvilinear grid be listed in the xml file?
!
! 4/28/2008 ACM refer always to ($data_var)[d=($data_num)] as there
!           may be other datasets open, e.g. for transformed variables.
! 4/28/2008 ACM Define tvar, used for getting time axis information, as
!           just t[gt=var] so that it isn't a huge variable to load in tax_datestring.
! 6/2010    ACM If its a vector plot, call LAS_auto_veclen_animate instead of
!           LAS_auto_levels_animate.
!
! list_frames.jnl creates a listing in XML format for animation
! Assumes symbol ferret_listing is the output file.
! The listing file includes:
! - fill_levels      for 2D plots
! - contour_levels   for 2D plots
! - dep_axis_scale   for 1D plots
! - vector_length    for vector plots
! - hasT             used to determine if the dataset has time axis
! - units            units of the time axis
! - frames           list of each individual time points
 
DEFINE SYMBOL its_autolev_animate = 1
 
GO LAS_initialize_region 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_region.jnl,v $
! $Revision: 1.1 $
!
! $Author: ansley $
! $Date: 2006/07/06 17:54:11 $
!
! The LAS_initialize_region.jnl script defines the following symbols
! based on the region associated with data_#:
!
! region_~_lo/hi   -- lo and hi points on a given axis
! region_~_range   -- numeric range on a given axis
! region_~         -- domain in 'lo:hi' notation
! region_full      -- synonym for 'region_xyzt'
!
! Incoming argument determines which region to use
! The default number is 0, and the default region is region_0.
! If we are making only a map, then there are no data_ symbols
! defined, so data_0_region is not set, but we can define region
! as region_0.
!
! ACM trac 267: Do not cancel any previously set limits or region symbols;
! The previous v6 UI as to how it worked in the old product server expects
! to inherit some or all region info from the first dataset for use by the
! second in comparisons etc. Keep this behavior.
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
DEFINE SYMBOL region_name data_($num)_region
 !-> DEFINE SYMBOL region_name data_0_region
DEFINE SYMBOL region ($($region_name)"region_0")
 !-> DEFINE SYMBOL region region_0
 
! Dont use the data_n_region symbol coming in. The info for the region of each
! variable matches the variable number so that region_0_t_lo is the region for
! data_0_var, etc.
 
DEFINE SYMBOL region region_($num)
 !-> DEFINE SYMBOL region region_0
 
! NOTE:  Occasionally the LAS applet will send in a longitude or latitude
! NOTE:  that looks like "24.400000000000002".  Such long, numerically
! NOTE:  irrelevant numbers can overflow Ferret's maximum symbol length.
! NOTE:  Rounding longitudes and latitudes to the nearest .00001 seems
! NOTE:  reasonable for all but the most detailed datasets.
 
! NOTE:  'region_x_m360' and 'region_x_p360' are used for those visualizations
! NOTE:  where Ferret doesn't auomatically deal with the modulo nature of
! NOTE:  longitude and allow the script writer to deal with this manually.
 
IF ($($region)_x_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_x_lo = `INT(100000 * ($($region)_x_lo)) / 100000`
 !-> DEFINE SYMBOL region_x_lo = 0
  DEFINE SYMBOL region_x_hi = `INT(100000 * ($($region)_x_hi)) / 100000`
 !-> DEFINE SYMBOL region_x_hi = 360
  DEFINE SYMBOL limits_x = ($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL limits_x = 0:360
  DEFINE SYMBOL limits_x_m360 = `($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL limits_x_m360 = -360:0
  DEFINE SYMBOL limits_x_p360 = `($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL limits_x_p360 = 360:720
  DEFINE SYMBOL region_x = X=($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL region_x = X=0:360
  DEFINE SYMBOL region_x_m360 X=`($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL region_x_m360 X=-360:0
  DEFINE SYMBOL region_x_p360 X=`($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL region_x_p360 X=360:720
  IF `($region_x_hi) GE ($region_x_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_x_range = `($region_x_hi) - ($region_x_lo)`
 !-> DEFINE SYMBOL region_x_range = 360
  ELSE
  ENDIF
ENDIF
 
IF ($($region)_y_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_y_lo = `INT(1000 * ($($region)_y_lo)) / 1000`
 !-> DEFINE SYMBOL region_y_lo = -90
  DEFINE SYMBOL region_y_hi = `INT(1000 * ($($region)_y_hi)) / 1000`
 !-> DEFINE SYMBOL region_y_hi = 90
  DEFINE SYMBOL limits_y = ($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL limits_y = -90:90
  DEFINE SYMBOL region_y = Y=($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL region_y = Y=-90:90
  IF `($region_y_hi) GE ($region_y_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_y_range = `($region_y_hi) - ($region_y_lo)`
 !-> DEFINE SYMBOL region_y_range = 180
  ELSE
  ENDIF
ENDIF
 
IF ($($region)_z_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_z_lo = ($($region)_z_lo)
 !-> DEFINE SYMBOL region_z_lo = 0
  DEFINE SYMBOL region_z_hi = ($($region)_z_hi)
 !-> DEFINE SYMBOL region_z_hi = 0
  DEFINE SYMBOL limits_z = ($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL limits_z = 0:0
  DEFINE SYMBOL region_z = Z=($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL region_z = Z=0:0
  IF `($region_z_hi) GE ($region_z_lo)` THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_z_range = `($region_z_hi) - ($region_z_lo)`
 !-> DEFINE SYMBOL region_z_range = 0
  ELSE
  ENDIF
ENDIF
IF ($add_region_z"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
! NOTE:  Normally we use 'DEFINE SYMBOL ~ = ...'
! NOTE:  For the time axis we use 'DEFINE SYMBOL ~ ...' because the Ferret
! NOTE:  parser complains about unmatched quotes if we do it the other way.
 
IF ($($region)_t_lo"0|*>1") THEN
 !-> IF 1 THEN
  DEFINE SYMBOL region_t_lo = ($($region)_t_lo)
 !-> DEFINE SYMBOL region_t_lo = 15-Jan-0001
  DEFINE SYMBOL region_t_hi = ($($region)_t_hi)
 !-> DEFINE SYMBOL region_t_hi = 15-Dec-0000
  DEFINE SYMBOL limits_t \"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL limits_t \"15-Jan-0001\":\"15-Dec-0000\"
  DEFINE SYMBOL region_t T=\"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL region_t T=\"15-Jan-0001\":\"15-Dec-0000\"
ENDIF
IF ($add_region_t"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
! Now build up all possible multi-axis regions, being careful not to use
! commas when a region is missing
 
! region_xy
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xy = ($region_x),($region_y)
 !-> DEFINE SYMBOL region_xy = X=0:360,Y=-90:90
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xz
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xz = ($region_x),($region_z)
 !-> DEFINE SYMBOL region_xz = X=0:360,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xt
IF ($region_x"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xt = ($region_x),($region_t)
 !-> DEFINE SYMBOL region_xt = X=0:360,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yz
IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yz = ($region_y),($region_z)
 !-> DEFINE SYMBOL region_yz = Y=-90:90,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yt
IF ($region_y"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yt = ($region_y),($region_t)
 !-> DEFINE SYMBOL region_yt = Y=-90:90,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_zt
IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_zt = ($region_z),($region_t)
 !-> DEFINE SYMBOL region_zt = Z=0:0,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyz
IF ($region_xy"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_z"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyz = ($region_xy),($region_z)
 !-> DEFINE SYMBOL region_xyz = X=0:360,Y=-90:90,Z=0:0
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyt
IF ($region_xy"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyt = ($region_xy),($region_t)
 !-> DEFINE SYMBOL region_xyt = X=0:360,Y=-90:90,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_yzt
IF ($region_yz"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_yzt = ($region_yz),($region_t)
 !-> DEFINE SYMBOL region_yzt = Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
! region_xyzt
IF ($region_xyz"0|*>1") THEN
 !-> IF 1 THEN
  IF ($region_t"0|*>1") THEN
 !-> IF 1 THEN
    DEFINE SYMBOL region_xyzt = ($region_xyz),($region_t)
 !-> DEFINE SYMBOL region_xyzt = X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
DEFINE SYMBOL region_full = ($region_xyzt)
 !-> DEFINE SYMBOL region_full = X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"
 
 
! For sampling from a curvilinear variable, save the region definitions with
! the variable number.
IF ($region_x"0|*>1") THEN DEFINE SYMBOL region_($num)_x = ($region_x)
 !-> IF 1 THEN DEFINE SYMBOL region_0_x = X=0:360
 !-> DEFINE SYMBOL region_0_x = X=0:360
IF ($region_y"0|*>1") THEN DEFINE SYMBOL region_($num)_y = ($region_y)
 !-> IF 1 THEN DEFINE SYMBOL region_0_y = Y=-90:90
 !-> DEFINE SYMBOL region_0_y = Y=-90:90
IF ($region_z"0|*>1") THEN DEFINE SYMBOL region_($num)_z = ($region_z)
 !-> IF 1 THEN DEFINE SYMBOL region_0_z = Z=0:0
 !-> DEFINE SYMBOL region_0_z = Z=0:0
IF ($region_t"0|*>1") THEN DEFINE SYMBOL region_($num)_t = ($region_t)
 !-> IF 1 THEN DEFINE SYMBOL region_0_t = T="15-Jan-0001":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_t = T="15-Jan-0001":"15-Dec-0000"
IF ($region_xt"0|*>1") THEN DEFINE SYMBOL region_($num)_xt = ($region_xt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xt = X=0:360,T="15-Jan-0001":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_xt = X=0:360,T="15-Jan-0001":"15-Dec-0000"
IF ($region_xy"0|*>1") THEN DEFINE SYMBOL region_($num)_xy = ($region_xy)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xy = X=0:360,Y=-90:90
 !-> DEFINE SYMBOL region_0_xy = X=0:360,Y=-90:90
IF ($region_xz"0|*>1") THEN DEFINE SYMBOL region_($num)_xz = ($region_xz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xz = X=0:360,Z=0:0
 !-> DEFINE SYMBOL region_0_xz = X=0:360,Z=0:0
IF ($region_yt"0|*>1") THEN DEFINE SYMBOL region_($num)_yt = ($region_yt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yt = Y=-90:90,T="15-Jan-0001":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_yt = Y=-90:90,T="15-Jan-0001":"15-Dec-0000"
IF ($region_yz"0|*>1") THEN DEFINE SYMBOL region_($num)_yz = ($region_yz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yz = Y=-90:90,Z=0:0
 !-> DEFINE SYMBOL region_0_yz = Y=-90:90,Z=0:0
IF ($region_zt"0|*>1") THEN DEFINE SYMBOL region_($num)_zt = ($region_zt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_zt = Z=0:0,T="15-Jan-0001":"15-Dec-0000"
 !-> DEFINE SYMBOL region_0_zt = Z=0:0,T="15-Jan-0001":"15-Dec-0000"
 
! For SOCAT server labels, make time symbols w/o the trailing 00:00:00
 
IF ($region_0_t_lo"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL t_lab_lo = ($region_0_t_lo)
 !-> DEFINE SYMBOL t_lab_lo = 15-Jan-0001
   LET iz = STRINDEX("($region_0_t_lo)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Jan-0001", " 00:00:00")
   IF `iz GT 0` THEN
 !-> IF 0 THEN
   ELSE
      LET iz = STRINDEX("($region_0_t_lo)", ":00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Jan-0001", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("($region_0_t_lo)", 1, iz-1)`
 !-> IF 0 THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("15-Jan-0001", 1, iz-1)`
   ENDIF
ENDIF
 
IF ($region_0_t_hi"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL t_lab_hi = ($region_0_t_hi)
 !-> DEFINE SYMBOL t_lab_hi = 15-Dec-0000
   LET iz = STRINDEX("($region_0_t_hi)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Dec-0000", " 00:00:00")
   IF `iz GT 0` THEN
 !-> IF 0 THEN
   ELSE
      LET iz = STRINDEX("($region_0_t_hi)", ":00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("15-Dec-0000", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("($region_0_t_hi)", 1, iz-1)`
 !-> IF 0 THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("15-Dec-0000", 1, iz-1)`
   ENDIF
ENDIF
 
! If no regions have been defined then we have an error.
 
IF ($region_full"1|*>0")  THEN
 !-> IF 0  THEN
ENDIF
 
! End of LAS_initialize_region.jnl ------------------------------------------------------
GO LAS_initialize_data 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LAS_initialize_data.jnl
!
! Author: ansley manke
! 11/2011
!
! The LAS_initialize_data.jnl script takes care of everything having to
! do with initializing a datset for later use.
! It calls the specific initialize-data script for the product.
!
! The products that use a specialized data initialization, such as insitu
! data, have already defined this symbol.  If undefined, use the std one.
 
IF `($data_initialization_script"0|*>1") EQ 0` THEN \
 DEFINE SYMBOL data_initialization_script LAS_initialize_data_std
 !-> IF 1 THEN  DEFINE SYMBOL data_initialization_script LAS_initialize_data_std
 !-> DEFINE SYMBOL data_initialization_script LAS_initialize_data_std
GO ($data_initialization_script) ($1)
 !-> GO LAS_initialize_data_std 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LAS_initialize_data_std.jnl
!
! Author: ansley
!
! The LAS_initialize_data.jnl script takes care of everything having to
! do with initializing a datset for later use.
!
! LAS_initialize_data.jnl takes an argument that specifies which data
! item [0|1|2|3|...] to create symbols for.
!
! 3/2007:
! split up previous version of LAS_initialize_data.jnl into two;
! initialize the dataset and define the plot (or output listing) variable.
! This allows the custom init scripts to call LAS_initialize_dataset, then
! issue commands for the customization, then call LAS_initialize_variable
!
! 8/2007:
! The custom init scripts now consist of only SET DATA and the custom commands.
! This lets F-TDS run first and call the init script to create the data set
! that will be used by the Ferret product script. When F-TDS is done it will
! not send the symbol ferret_init_script to the product scripts so we will just skip
! that step.
!
! 8/2007:
! Some of the custom init scripts previously contained commands like SET MEMORY
! or SET MODE which are intended to be executed by the product script These need
! to be separated from commands for fixing grids or regridding which are executed
! prior to the product script being run by F-TDS. These commands are to be specified
! in the dataset configuration as ferret_init_commands, whose the value is a set
! of Ferret commands separated by semicolons.
!
GO LAS_initialize_dataset ($1"0")
 !-> GO LAS_initialize_dataset 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_dataset.jnl
 
! This is the first part of LAS_initialize_data.jnl used for standard and
! customized init scripts
 
! $Author: ansley, jing
! $Date: 2007/29/2007
 
! 6/29/2007
! Allow for data_0_units or data_1_units etc to be defined a null string or a
! string containing a single space. If data_0_units is either undefined or is
! one of these blank strings, then use the attnames syntax to see if the dataset
! variable has units defined, and if so define the data_units symbol from that.
 
 
! The LAS_initialize_data.jnl script takes care of everything having to
! do with initializing a datset for later use.
!
! LAS_initialize_data.jnl takes an argument that specifies which data
! item [0|1|2|3|...] to create symbols for.
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
 
IF `($num) EQ 0 AND ($data_count) GT 1 and ($check_multi_regions_done"0|*>1) EQ 0` THEN
 !-> IF 0 THEN
ENDIF
 
! TODO:  It would be nice if the java code removed this dependency upon
! TODO:  whether an operation was 'chained' or not.
 
! Check whether the source data was part of a 'chained' operation.
!ACM note: How does this jibe with what I do below changing data_url to data_num??
 
IF ($data_($num)_chained"0|1|*>1) THEN
 !-> IF 0 THEN
ELSE
  DEFINE SYMBOL data_url \"($data_($num)_url)\"
 !-> DEFINE SYMBOL data_url \"/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc\"
ENDIF
 
IF ($data_($num)_var"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL data_var ($data_($num)_var)
 !-> DEFINE SYMBOL data_var TEMP
   DEFINE SYMBOL data_orig_var ($data_($num)_var)
 !-> DEFINE SYMBOL data_orig_var TEMP
ENDIF
 
DEFINE SYMBOL data_name ($data_($num)_name)
 !-> DEFINE SYMBOL data_name Argo Temperature Monthly Climatology
IF `($data_($num)_name"0|*>1") EQ 0` THEN DEFINE SYMBOL data_name ($data_var)
 !-> IF 0 THEN DEFINE SYMBOL data_name TEMP
 
DEFINE SYM var_num ($num)
 !-> DEFINE SYM var_num 0
 
! Put quotes around variable name in case its a Ferret reserved name like Z
! (Apparently addXML now does this automatically, so check for it already being in ' ')
 
IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var = `UPCASE("($data_var)")`
 !-> IF 1 THEN DEFINE SYMBOL data_var = `UPCASE("TEMP")`
 !-> DEFINE SYMBOL data_var = `UPCASE("TEMP")`
 !-> DEFINE SYMBOL data_var = TEMP
LET varlen = `STRLEN("($data_var)")`
 !-> DEFINE VARIABLE varlen = 4
IF `STRINDEX("($data_var)", "'") EQ 1 AND STRRINDEX("($data_var)", "'") EQ varlen` THEN
 !-> IF 0 THEN
ELSE
   IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var_nq = ($data_var)
 !-> IF 1 THEN DEFINE SYMBOL data_var_nq = TEMP
 !-> DEFINE SYMBOL data_var_nq = TEMP
   IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var = '($data_var)'
 !-> IF 1 THEN DEFINE SYMBOL data_var = 'TEMP'
 !-> DEFINE SYMBOL data_var = 'TEMP'
ENDIF
 
! Do the same for curvilinear coordinate variables if they are defined
IF ($ferret_curvi_coord_lon"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
IF ($ferret_curvi_coord_lat"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
! If the grids werent the same but were reconciled with an add_var, add that.
! The variables must be the same size. Check and set up a nice message if not.
 
IF ($add_to_var($num)"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
!IF `($ferret_is_socat"0|0|1|*>0") AND (($data_count) EQ 1)` THEN GO LAS_socat_format_title_units
 
 
! Use the units passed in from the XML unless they are null;
! in that case try to get from the dataset
 
! Do not define data_units with an empty string
IF ($data_($num)_units%1|"">1|*>0%) THEN
 !-> IF 0 THEN
ELIF ($data_($num)_units%1|" ">1|*>0%) THEN
 !-> ELIF 0 THEN
ELSE
   DEFINE SYMBOL data_units ($data_($num)_units)
 !-> DEFINE SYMBOL data_units degC
ENDIF
 
! Check for single quotes and remove them. They are
! not needed on units strings
 
LET inquote = `STRINDEX("($data_($num)_units)", "'")`
 !-> DEFINE VARIABLE inquote = 0
IF `inquote GT 0` THEN
 !-> IF 0 THEN
ENDIF
 
IF ($data_units"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL data_units (($data_($num)_units))
 !-> DEFINE SYMBOL data_units (degC)
   IF `STRINDEX("($data_units)", "((") GT 0` THEN \
     DEFINE SYMBOL data_units ($data_($num)_units)
 !-> IF 0 THEN      DEFINE SYMBOL data_units degC
ENDIF
 
IF ($data_($num)_name"0|1|*>1) THEN
 !-> IF 1 THEN
   IF ($data_($num)_title"0|*>1") THEN DEFINE SYMBOL data_title ($data_($num)_title)
 !-> IF 1 THEN DEFINE SYMBOL data_title Argo Temperature Monthly Climatology
 !-> DEFINE SYMBOL data_title Argo Temperature Monthly Climatology
ELSE
ENDIF
 
IF `($num) GT 0` THEN DEFINE SYMBOL variable_($num)_lab = ($data_title)
 !-> IF 0 THEN DEFINE SYMBOL variable_0_lab = Argo Temperature Monthly Climatology
DEFINE SYMBOL units_lab = ($data_units)
 !-> DEFINE SYMBOL units_lab = (degC)
IF `($num) GT 0` THEN DEFINE SYMBOL units_($num)_lab = ($data_units)
 !-> IF 0 THEN DEFINE SYMBOL units_0_lab = (degC)
 
DEFINE SYMBOL ferret_plot_title ($data_title) ($data_units)
 !-> DEFINE SYMBOL ferret_plot_title Argo Temperature Monthly Climatology (degC)
IF `($ferret_is_socat"0|0|1|*>0") AND (($data_count) EQ 1)` THEN \
  DEFINE SYMBOL ferret_plot_title = @CR($data_title_fmt) ($data_units_fmt)
 !-> IF 0 THEN   DEFINE SYMBOL ferret_plot_title = @CR
 
! SET DATA and check for errors
 
SET DATA ($data_url)
 !-> SET DATA "/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc"
 
! Check for units sent in as ""
DEFINE SYMBOL ulen `STRLEN("(data_($num)_units)")`
 !-> DEFINE SYMBOL ulen 14
IF `($ulen) LE 2` THEN
 !-> IF 0 THEN
ENDIF
 
IF `($units_double_quotes"0|*>1") EQ 0` THEN
 !-> IF 1 THEN
   LET ulen = STRLEN ("($data_($num)_units)")
 !-> DEFINE VARIABLE ulen = STRLEN ("degC")
   IF `(STRINDEX("($data_($num)_units)", "'") EQ 1) AND \
    (STRRINDEX("($data_($num)_units)", "'") EQ ulen)` THEN \
      DEFINE SYMBOL data_units `SUBSTRING("($data_($num)_units)", 2, ulen-2)`
 !-> IF 0 THEN       DEFINE SYMBOL data_units `SUBSTRING("degC", 2, ulen-2)`
ENDIF
 
 
IF ($fer_last_error"0|0|1|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
SET DATA "($data_($num)_url)"
 !-> SET DATA "/las_server/LAS_Data/Global/Argo/Climatology/argo_CLIM_grd.nc"
DEFINE SYMBOL dset($num) = `($data_($num)_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL dset0 = 1
 
! Here do sanity checks on Ferret properties, such as dep_axis_scale
 
GO LAS_check_fer_properties
! LAS_check_fer_properties.jnl
!
! Author: ansley
! $Date: 2010/10/13
!
! Sanity check on Ferret properties.
! Add to this as needed
!
 
IF ($ferret_dep_axis_scale"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
  ENDIF
  ENDIF
  ENDIF
     ENDIF
  ENDIF
ENDIF ! Checks on ferret_dep_axis_scale
 
! End of file ------------ LAS_check_fer_properties.jnl-------------------------------
 
 
! End of $RCSfile ------------LAS_initialize_dataset.jnl--------------------------
 
IF ($ferret_init_script"0|*>1") THEN GO ($ferret_init_script) ($1"0")
 !-> IF 0 THEN GO   0
 
IF ($ferret_init_commands"0|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
GO LAS_initialize_variable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: LAS_initialize_variable.jnl
! $Revision: 1.1
!
! $Author: Ansley, Jing $
! $Date: 2007/29/2007
! ACM 4/2007 apply ferret_expression2 to second plot of comparisons.
! ACM 8/2007 Call LAS_auto_levels to set up auto contour/fill levels.
! 3/2008 ACM Use SHADE/TRIM for shade underlays of FILL plots (Ferret v6.1),
!            so no need to call LAS_define_region_plus_1.jnl
! 10-Jul-2008 ACM Define ferret_x_var, needed for listing data to files
!  3-Jun-2011 ACM Allow configuration to send in ferret_factor and
!             ferret_factor_label to apply factor to variables and to add
!             a nice label to the title/units string.
 
! this is the second part of LAS_initialize_data.jnl
 
! Define the plot variable. For comparison plots, we want to save the dataset number
! for each dataset.
 
 
DEFINE SYMBOL data_num = `($data_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL data_num = 1
DEFINE SYMBOL data_($num)_num = `($data_var),RETURN=dsetnum`
 !-> DEFINE SYMBOL data_0_num = 1
 
! If a factor has been passed in, apply it
IF ($ferret_factor"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
LET attlist = ($data_var).attnames
 !-> DEFINE VARIABLE attlist = 'TEMP'.attnames
IF ($data_var_nq"0|*>1") THEN LET attlist = ($data_var_nq).attnames
 !-> IF 1 THEN LET attlist = TEMP.attnames
 !-> LET attlist = TEMP.attnames
DEFINE SYMBOL data_var_only = `UPCASE("($data_var)")`
 !-> DEFINE SYMBOL data_var_only = 'TEMP'
 
IF ($ferret_bad_flag"0|*>1") THEN SET VAR/BAD=($ferret_bad_flag) ($data_var)
 !-> IF 0 THEN SET VAR/BAD=  'TEMP'
 
IF ($ferret_timelab_res"0|*>1") THEN SET MODE CALENDAR:($ferret_timelab_res)
 !-> IF 0 THEN SET MODE CALENDAR:
 
! setup for analysis ops on curvilinear grids
IF `IS_ELEMENT_OF_STR (attlist, "ferret_definition") GT 0 AND\
    ($ferret_curvi_coord_lon"0|*>1")` THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
! Be sure units and title are defined.
! If units are not defined, try to get units from the data variable.
! If the variable in the file has no units, leave data_units symbol undefined.
 
! data_units should have been defined in LAS_initialize_dataset
 
IF ($data_units"0|*>1") THEN
 !-> IF 1 THEN
   DEFINE SYMBOL has_units = 1
ELSE
      ENDIF
   ENDIF
ENDIF
 
IF ($check_for_pseudonames"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
IF ($ferret_factor_label"0|*>1") THEN
 !-> IF 0 THEN
ELIF ($ferret_factor"0|*>1") THEN
 !-> ELIF 0 THEN
ENDIF
 
IF `($data_title"0|*>1") EQ 0` THEN
 !-> IF 0 THEN
  ENDIF
ENDIF
 
 
DEFINE SYMBOL ferret_plot_var = ($data_var)[d=($data_num),($region_full)]
 !-> DEFINE SYMBOL ferret_plot_var = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
IF ($analysis_def"0|*>1") THEN  ! analysis_def from curvi data or transform
 !-> IF 0 THEN
ENDIF
 
DEFINE SYMBOL ferret_plot_var_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_var_noregion = 'TEMP'[d=1]
DEFINE SYMBOL ferret_plot_var_($num)_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_var_0_noregion = 'TEMP'[d=1]
 
DEFINE SYMBOL ferret_plot_base_var = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_plot_base_var = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
DEFINE SYMBOL ferret_plot_base_var_($num) = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_plot_base_var_0 = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
DEFINE SYMBOL ferret_plot_base_var_noregion = ($data_var)[d=($data_num)]
 !-> DEFINE SYMBOL ferret_plot_base_var_noregion = 'TEMP'[d=1]
 
! Needed for transform_seasonal, save variable definition without any
! time-region information that may be added, and also with the time region only
 
DEFINE SYMBOL ferret_xyz_var = ($data_var)[d=($data_num),($region_xyz)]
 !-> DEFINE SYMBOL ferret_xyz_var = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0]
DEFINE SYMBOL ferret_t_var = ($data_var)[d=($data_num),($region_t)]
 !-> DEFINE SYMBOL ferret_t_var = 'TEMP'[d=1,T="15-Jan-0001":"15-Dec-0000"]
 
! ferret_x_var needed for listing data to files
DEFINE SYMBOL ferret_x_var = ($data_var)[d=($data_num),($region_x)]
 !-> DEFINE SYMBOL ferret_x_var = 'TEMP'[d=1,X=0:360]
IF `($region_x"0|*>1) EQ 0` THEN DEFINE SYMBOL ferret_x_var = ($data_var)[d=($data_num)]
 !-> IF 0 THEN DEFINE SYMBOL ferret_x_var = 'TEMP'[d=1]
 
! Apply any transforms that may have been specified.
GO LAS_transforms ($num)
 !-> GO LAS_transforms 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LAS_transforms.jnl
!
! $Author: ansley $
! $Date: 2006/09/27  $
! 2007/3/13 ACM changes for all slices of curvilinear data.
! 4/2007    ACM Apply Ferret symbols for any expression that may have been defined
 
!
! LAS_transforms.jnl applies one or more transforms to $ferret_plot_var
 
! This script is called from LAS_initialize_data after the region and
! data have been initialized.
! Argument is the variable number (0 or 1 if this is a comparison)
 
DEFINE SYMBOL num ($1"0")
 !-> DEFINE SYMBOL num 0
 
!  Transform to 3-month seasonal averages, with desired centering
IF `($constraint_0_lhs"0|Seasonal_Regridding>1|*>0")` THEN
 !-> IF 0 THEN
ENDIF
 
! Transform to 1-season per year, centered on any month, with season being 1, 3, or 5 months long.
IF `STRINDEX("($constraint_0_lhs"0")", "Season_length") GT 0` THEN
 !-> IF 0 THEN
ENDIF
 
! See if the grid is curvilinear in XY, Hybrid Z or both
 
DEFINE SYMBOL do_curvi_xy = 0
DEFINE SYMBOL do_hybrid_z = 0
DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 0
 
GO LAS_get_coords_att
! LAS_get_coords_att.jnl
! If there are no curvilinear coordinates properties for the variable,
! then check for a coordinates attribute. If one exits, check the
! coordinates listed for 2D coordinates having units of degrees
! longitude or latitude, and set the properties accordingly
 
! If the configuratino has the properties already, use those.
 
IF ($ferret_curvi_coord_lon"0|*>1") THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
IF ($ferret_curvi_coord_lat"0|*>1") THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
 
! Get the coordinates attribute for a variable. IF it exists
! then parse it up and see if there are 2D lon and lat coordinate
! variables in the dataset.  IF so, use them.
 
 
LET allvars = ..varnames
LET varatts = ($data_orig_var).attnames
 !-> DEFINE VARIABLE varatts = TEMP.attnames
 
! Check for a coordinates attribute.
LET has_coord = IS_ELEMENT_OF_STR(varatts, "coordinates")
IF `has_coord EQ 0` THEN exit/script
 !-> IF 1 THEN exit/script
 !-> exit/script
 
IF ($ferret_curvi_coord_lat"0|*>1") THEN DEFINE SYMBOL do_curvi_xy = 1
 !-> IF 0 THEN DEFINE SYMBOL do_curvi_xy = 1
IF ($ferret_thk_var"0|*>1") THEN  DEFINE SYMBOL do_hybrid_z = 1
 !-> IF 0 THEN  DEFINE SYMBOL do_hybrid_z = 1
IF `($do_curvi_xy) + ($do_hybrid_z) EQ 2` THEN DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 1
 !-> IF 0 THEN DEFINE SYMBOL do_curvi_xy_and_hybrid_z = 1
 
IF ($do_curvi_xy_and_hybrid_z) THEN GO transform_hybrid_z_curvi_xy
 !-> IF 0 THEN GO transform_hybrid_z_curvi_xy
 
! Set up to deal with hybrid-Z data.
IF `($do_hybrid_z) AND ($do_curvi_xy_and_hybrid_z"0") EQ 0` THEN \
   GO transform_hybrid_z.jnl
 !-> IF 0 THEN    GO transform_hybrid_z.jnl
 
! Set up to deal with curvilinear XY data
 
IF ($do_curvi_xy) THEN GO transform_curvi_xy.jnl
 !-> IF 0 THEN GO transform_curvi_xy.jnl
 
! End of $RCSfile ------------LAS_transforms.jnl-------------------------------
 
 
! Get any DEFINE VARIABLE analysis definitions
! This renames the data variable, and so redefines the symbol data_var
! and sets up the analysis: e.g. ,z=0:2000@ave
 
! unComment this for testing.
 
IF ($data_0_analysis_label"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
 
! (check for Google Earth plots is inside LAS_set_strides)
IF `($num)+1 EQ ($data_count)` THEN GO LAS_set_strides.jnl
 !-> IF 1 THEN GO LAS_set_strides.jnl
 !-> GO LAS_set_strides.jnl
! LAS_set_strides.jnl
! ACM
 
! From the region and the grid we can define striding. Compute strides
! based first on Ferret memory and then if it is a graphics product, on
! pixel size.
! ACM 8/312/2007 Do not issue the SET AXIS/STRIDE= command if the stride is 1
!                This partially works around TRAC #224.
! ACM 3/2008  If the transform-to-1-season per year has been set then do not
!             stride in t
! ACM 4/2008  For descriptor data or for data whose axes are replaced cant
!             do native strides. In these cases set up index strides with
!             a call to LAS_set_strides_nonative
! 10-Jul-2008 ACM  Fixes for Google Earth placemark strides
 
! TODO: When there's going to be a transformation or something, then these
! calculations may not be sufficient. Might be better done by the transform script.
 
 
! Ferret property subsample_t can be set to zero or false and
! prevent subsampling in time.
 
IF `($ferret_subsample_t"1|0|1|true>1|false>0|*>1") EQ 0 AND ($ferret_view"|t>1|T>1|*>0")` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
! If the operation is writing a netCDF file, that is done in chunks. Do not use strides
 
IF `(STRINDEX( "($operation_ID)", "Data_Extract" ) NE 0) AND \
    (STRINDEX( "($result_ferret_listing_type)", "netcdf" ) NE 0)` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
! If we are computing auto-levels for an animation, striding is done in that script.
! no need for it here.
 
IF ($its_autolev_animate"0|*>1") THEN EXIT/SCRIPT
 !-> IF 1 THEN EXIT/SCRIPT
 !-> EXIT/SCRIPT
 
! to set non-native strides for dataset 1 on a difference plot.
IF `($no_native_strides_xy"0|*>1") AND ($set_ndx_strides"0|*>1") EQ 0` THEN
 !-> IF 0 THEN
ENDIF
 
! Mark whether there are contour levels set on first entry.
! Compute automatic open-ended levels.
 
! consolidate here so that all 2D plots use only ferret_fill_levels.
! Allow for config that may have used ferret_contour levels instead or also.
 
IF ($ferret_fill_levels"0|*>1") THEN
 !-> IF 0 THEN
ELSE
   IF ($ferret_contour_levels"0|*>1") THEN DEFINE SYMBOL ferret_fill_levels ($ferret_contour_levels)
 !-> IF 0 THEN DEFINE SYMBOL ferret_fill_levels
ENDIF
 
IF `($data_num) EQ 1` THEN
 !-> IF 1 THEN
   IF ($ferret_fill_levels"0|*>1") THEN DEFINE SYMBOL input_fill_levels = 1
 !-> IF 0 THEN DEFINE SYMBOL input_fill_levels = 1
 
   IF `STRLEN("($ferret_view)") EQ 2` THEN
 !-> IF 0 THEN
   ENDIF
ENDIF
 
! End of $RCSfile ------------LAS_initialize_variable.jnl--------------------------
DEFINE SYMBOL variable_($1"0")_lab = ($data_title) ($data_units)
 !-> DEFINE SYMBOL variable_0_lab = Argo Temperature Monthly Climatology (degC)
IF `($its_prop_prop_plot"0|*>1") EQ 0` THEN
 !-> IF 1 THEN
   IF ($variable_lab"0|*>1") THEN
 !-> IF 0 THEN
   ELSE
      DEFINE SYMBOL variable_lab = ($data_title) ($data_units)
 !-> DEFINE SYMBOL variable_lab = Argo Temperature Monthly Climatology (degC)
   ENDIF
ENDIF
IF `($its_prop_prop_plot"0|*>1")` THEN DEFINE SYMBOL variable_lab = ($data_title) ($data_units)
 !-> IF 0 THEN DEFINE SYMBOL variable_lab = Argo Temperature Monthly Climatology (degC)
 
 
IF `STRLEN("($ferret_view)") GT 1 AND ($its_prop_prop_plot"0|*>1") EQ 0 AND \
($itsa_vector_plot"0|*>1") EQ 0` THEN DEFINE SYMBOL qualifiers = ($qualifiers)/KEY=CONT
 !-> IF 1 THEN DEFINE SYMBOL qualifiers =  /KEY=CONT
 !-> DEFINE SYMBOL qualifiers =  /KEY=CONT
 
IF ($ferret_expression"0|*>1") THEN GO LAS_expression
 !-> IF 0 THEN GO LAS_expression
 
! End of $RCSfile ------------LAS_initialize_data.jnl--------------------------
 
! End of ------------LAS_initialize_data.jnl--------------------------
 
IF `($FERRET_MEMORY"25") LT 100` THEN SET MEM/SIZ=100
 !-> IF 1 THEN SET MEM/SIZ=100
 !-> SET MEM/SIZ=100
 
! Here is the variable we will list out, with the region specified.
DEFINE SYMBOL ferret_list_var = ($ferret_plot_var)
 !-> DEFINE SYMBOL ferret_list_var = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
 
IF ($do_curvi_xy"0") THEN
 !-> IF 0 THEN
ELSE
   LET the_var = ($ferret_plot_var)
 !-> DEFINE VARIABLE the_var = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
   DEFINE SYMBOL imin `the_var,return=xstart`
 !-> DEFINE SYMBOL imin 0.5E
   DEFINE SYMBOL imax `the_var,return=iend`
 !-> DEFINE SYMBOL imax 360
   DEFINE SYMBOL isize `the_var,return=isize`
 !-> DEFINE SYMBOL isize 360
   DEFINE SYMBOL jmin `the_var,return=jstart`
 !-> DEFINE SYMBOL jmin 1
   DEFINE SYMBOL jmax `the_var,return=jend`
 !-> DEFINE SYMBOL jmax 180
   DEFINE SYMBOL jsize `the_var,return=jsize`
 !-> DEFINE SYMBOL jsize 180
ENDIF
 
DEFINE SYMBOL kmin `the_var,return=kstart`
 !-> DEFINE SYMBOL kmin 1
DEFINE SYMBOL kmax `the_var,return=kend`
 !-> DEFINE SYMBOL kmax 1
DEFINE SYMBOL ksize `the_var,return=ksize`
 !-> DEFINE SYMBOL ksize 1
DEFINE SYMBOL lmin `the_var,return=lstart`
 !-> DEFINE SYMBOL lmin 12
DEFINE SYMBOL lmax `the_var,return=lend`
 !-> DEFINE SYMBOL lmax 12
DEFINE SYMBOL lsize `the_var,return=lsize`
 !-> DEFINE SYMBOL lsize 1
 
! For vector plots, compute consistent vector length for the
! animation.
 
! For color or contour plots, LAS_auto_levels_animate checks whether
! symbols for color levels have been set, and if not, sets them for
! the variable at all time steps.
 
IF `($data_count"1") EQ 2` THEN
 !-> IF 0 THEN
ELSE
   GO LAS_auto_levels_animate
! LAS_auto_levels_animate.jnl
! ACM 8/22/2007
!
! acm 9/11/07 If its a descriptor file Ferret wont allow striding.
!             check for that case and just set num levels.
! acm* 2/2010 Set up a few things and then Use Ferret-s open-ended levels
!             if the levs havent been set by the user or configuration.
!             Allow for old algorithm if older Ferret is in place.
 
! Based on a variables value over its entire range, set strides
! if needed to quickly get stats on the variable. Use this to set levels.
 
! Argument: the variable to use in setting the levels.
 
! The symbol ferret_center_levels, if set to 1, forces the levels
! to be 2 std above and below zero. Otherwise use 2 std above
! and below the data mean
 
! This script should be done BEFORE any other striding is done.
! It operates on the variable on its entire native unstrided grid.
 
! input_fill_levels and input_contour_levels are symbols that are defined in
! LAS_initialize_variable.jnl, telling whether settings for levels were
! made
 
! Determine striding for speed in operating the STAT command
LET memsize = 0.5* 1.e6
 
! Make sure its a 2D plot operation.
 
DEFINE SYMBOL op = `UPCASE("($operation_ID)")`
 !-> DEFINE SYMBOL op = ANIMATION_FRAMES_XY
 
!IF `($ferret_view"|xy>1|*>0") NE 1` THEN EXIT/SCRIPT
IF `STRINDEX("($op)", "VECTOR") GT 0` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
IF `STRINDEX("($op)", "ANIMATION") EQ 0` THEN EXIT/SCRIPT
 !-> IF 0 THEN EXIT/SCRIPT
 
! NOTE: animations have not been implemented for difference plots.
! If its a compare plot, and if the ($ferret_diff_var) is not yet defined,
! just return.
 
IF `($ferret_diff_var"1|*>0") AND STRINDEX("($op)", "COMPARE_PLOT") NE 0` THEN
 !-> IF 0 THEN
ENDIF
 
! Remove any previous native striding
 
IF ($xstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=xaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'TEMP'[d=1],RETURN=xaxis`
IF ($ystride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=yaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'TEMP'[d=1],RETURN=yaxis`
IF ($tstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=taxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'TEMP'[d=1],RETURN=taxis`
IF ($zstride"0|1>0|*>1") THEN CANCEL AXIS/STRIDE `($data_var)[d=($data_num)],RETURN=zaxis`
 !-> IF 0 THEN CANCEL AXIS/STRIDE `'TEMP'[d=1],RETURN=zaxis`
CANCEL SYMBOL xstride
CANCEL SYMBOL ystride
CANCEL SYMBOL tstride
CANCEL SYMBOL zstride
 
DEFINE SYMBOL ferret_center_levels ($ferret_center_levels"0|1|TRUE>1|*>0")
 !-> DEFINE SYMBOL ferret_center_levels 0
 
! See if centered levels were requested, either by setting the symbol ferret_center_levels
! or with a contour_levels or fill_levels that is centered.
 
! See if centered levels were requested, either by setting the symbol ferret_center_levels
! or with a contour_levels or fill_levels that is centered.
 
! If contour levels requested with levels of nC, e.g. 20C, then get the value to
! set num_fine_levels in the %RANGE command below
 
! In general if other levels spec is given, return. However if it is a simple number,
! use that to set the number of fine levels.
 
IF ($ferret_contour_levels"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
   ENDIF
ENDIF
 
 
IF ($ferret_fill_levels"0|*>1") THEN
 !-> IF 0 THEN
   ENDIF
   ENDIF
ENDIF
 
! Apply to the variable on the requested region in x, y, z and all time.
 
IF `($ferret_plot_var"0|*>1") EQ 0` THEN EXIT/SCRIPT  !e.g. for insitu plots may not have a plot_var
 !-> IF 0 THEN EXIT/SCRIPT
 
 
LET max_size = 50
IF `($do_curvi_xy"0|0|*>1") EQ 0` THEN
 !-> IF 1 THEN
 
   LET pvar = ($ferret_plot_var)
 !-> DEFINE VARIABLE pvar = 'TEMP'[d=1,X=0:360,Y=-90:90,Z=0:0,T="15-Jan-0001":"15-Dec-0000"]
   LET var_size = ABS( `pvar,RETURN=size`)
 !-> DEFINE VARIABLE var_size = ABS( 64800)
   DEFINE SYMBOL var_dim = `pvar,RETURN=shape`
 !-> DEFINE SYMBOL var_dim = XY
   LET ndims = STRLEN("($var_dim)")
 !-> DEFINE VARIABLE ndims = STRLEN("XY")
 
   IF `var_size GT memsize` THEN \
   LET max_size = `INT( 1+ ((var_size/memsize))/ndims )`
 !-> IF 0 THEN    LET max_size = `INT( 1+ ((var_size/memsize))/ndims )`
ELSE
ENDIF
 
! Apply native striding if possible
 
IF ($regrid_fcn"0|*>1") THEN
 !-> IF 0 THEN
ELSE  !!! regrid_fcn
 
! region syms dont apply to native curv grid directly
 
IF `($do_curvi_xy"0")` THEN
 !-> IF 0 THEN
ELSE
   LET xsize = `pvar,RETURN=isize`
 !-> DEFINE VARIABLE xsize = 360
   DEFINE SYMBOL xstride = `INT(xsize/10)`
 !-> DEFINE SYMBOL xstride = 36
   IF `($xstride) LT 2` THEN CANCEL SYMBOL xstride
 !-> IF 0 THEN CANCEL SYMBOL xstride
 
   LET ysize = `pvar,RETURN=jsize`
 !-> DEFINE VARIABLE ysize = 180
   DEFINE SYMBOL ystride = `INT(ysize/10)`
 !-> DEFINE SYMBOL ystride = 18
   IF `($ystride) LT 2` THEN CANCEL SYMBOL ystride
 !-> IF 0 THEN CANCEL SYMBOL ystride
 
ENDIF ! do_curvi_xy
 
ENDIF  !!! regrid_fcn
 
 
IF ($index_strides"0|*>1") THEN
 !-> IF 0 THEN
ELSE
   DEFINE SYMBOL ppvar = pvar
ENDIF
 
! Can always use native strides in z and t
 
! Should be only one Z anyway for xy animations, but this wont hurt,
LET zsize  `pvar,RETURN=ksize`
 !-> DEFINE VARIABLE zsize  1
DEFINE SYMBOL zstride = `INT(zsize/10)`
 !-> DEFINE SYMBOL zstride = 0
IF `($zstride) LT 2` THEN CANCEL SYMBOL zstride
 !-> IF 1 THEN CANCEL SYMBOL zstride
 !-> CANCEL SYMBOL zstride
 
! The time range specifies the whole t region.
LET tsize  `($ppvar),RETURN=lsize`
 !-> DEFINE VARIABLE tsize  1
 
LET strd_lo = 1
LET anim_timevar = ($ppvar)
 !-> DEFINE VARIABLE anim_timevar = pvar
LET tt = t[gt=anim_timevar]
 
LET strd_hi = `tt,return=lsize`
 !-> DEFINE VARIABLE strd_hi = 12
 
! The incoming t region is the region over which to animate...
LET LL = L[gt=($data_var)[d=($data_num)]]
 !-> DEFINE VARIABLE LL = L[gt='TEMP'[d=1]]
LET strd_lo = `LL[t="($region_t_lo)"]`

Attachment: las_v8_animation_respone
Description: Binary data


[Thread Prev][Thread Next][Index]


Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement