[Thread Prev][Thread Next][Index]

[las_users] Increasing ferret's memory



Hi all,

I'm using an init script in LAS server v7.2 to convert data from model levels to pressure levels.
The server is complaining about insufficient memory for the ferret script (see attachment for debug output).
I tried to set the ferret properties in las.xml and also changed the hard-coded memsize in "FerretTool.java", but both didn't give me any change in memsize (see attachment --> say `($FERRET_MEMORY"6.4")` in init script).

How can I increase the memory for ferret?

This is what I have in las.xml:

   <properties>

      <product_server>
         <ui_timeout>20</ui_timeout>
         <ps_timeout>3600</ps_timeout>
         <use_cache>true</use_cache>
      </product_server>

      <ferret>
         <memsize>1024</memsize>
         <land_type>contour</land_type>
         <fill_type>fill</fill_type>
      </ferret>

   </properties>


Thanks,
Bastian Kern

--
---------------------------------------------------------------
Bastian Kern
Max Planck Institute for Chemistry, Mainz

c/o DLR - IPA, Oberpfaffenhofen
Muenchner Strasse 20
D-82234 Wessling, Germany

phone: +49-8153-28-2569
fax:   +49-8153-28-1841
mailto:bastian.kern@xxxxxxx

  **Please note the new address / phone number / fax number!**
---------------------------------------------------------------
Server at Revision r11623M

STOP -script mode, ERROR RUNNING SCRIPT
 *** NOTE: If no missing_value or _FillValue attribute on variables, will use NaN
 *** NOTE: (fyi) units are not subject to auto-conversion: HPA
 **ERROR: request exceeds memory setting: 683261952 words were requested.
DEFINE SYMBOL data_num = `'NO2',RETURN=dsetnum`
Command file, command group, or REPEAT execution aborted

go "$1"
 !-> go "/var/opt/apache-tomcat-6.0.32/webapps/las/WEB-INF/classes/resources/ferret/temp/ferret_operation_1312793544550.jnl"
! Symbols from the server
                        DEFINE SYMBOL data_0_ID = NO2
                                 DEFINE SYMBOL data_0_dataset_ID = M2E23_exp07_tr_NOx_NOy
                                 DEFINE SYMBOL data_0_dataset_doc = http://mpc-data.rzg.mpg.de/docs/M2E23_exp07.html
                                 DEFINE SYMBOL data_0_dataset_name = M2E23_exp07_tr_NOx_NOy
                                 DEFINE SYMBOL data_0_dataset_url = file:/usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des
                                 DEFINE SYMBOL data_0_dsid = M2E23_exp07_tr_NOx_NOy
                                 DEFINE SYMBOL data_0_ftds_url = http://mpc-data.rzg.mpg.de/thredds/dodsC/las/M2E23_exp07_tr_NOx_NOy/data_usr_local_tomcat_content_las_conf_server_des_M2E23_exp07_tr_NOx_NOy.des.jnl
                                 DEFINE SYMBOL data_0_grid_type = regular
                                 DEFINE SYMBOL data_0_intervals = xyzt
                                 DEFINE SYMBOL data_0_name = NO2 (NO2) [mol/mol]
                                 DEFINE SYMBOL data_0_points = xyzt
                                 DEFINE SYMBOL data_0_region = region_0
                                 DEFINE SYMBOL data_0_title = NO2 (NO2) [mol/mol]
                                 DEFINE SYMBOL data_0_units = mol/mol
                                 DEFINE SYMBOL data_0_url = /usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des
                                 DEFINE SYMBOL data_0_var = NO2
                                 DEFINE SYMBOL data_0_xpath = /lasdata/datasets/M2E23_exp07_tr_NOx_NOy/variables/NO2
                                 DEFINE SYMBOL data_count = 1
                                 DEFINE SYMBOL ferret_fill_type = fill
                                 DEFINE SYMBOL ferret_init_script = hybrid2pressinit
                                 DEFINE SYMBOL ferret_interpolate_data = false
                                 DEFINE SYMBOL ferret_land_type = contour
                                 DEFINE SYMBOL ferret_mark_grid = no
                                 DEFINE SYMBOL ferret_memsize = 1024
                                 DEFINE SYMBOL ferret_service_action = Plot_2D_XY
                                 DEFINE SYMBOL ferret_size = 0.5
                                 DEFINE SYMBOL ferret_view = xy
                                 DEFINE SYMBOL las_debug = true
                                 DEFINE SYMBOL operation_ID = Plot_2D_XY_zoom
                                 DEFINE SYMBOL operation_key = 269155D8B545DEC0F180D27A41F96FB1
                                 DEFINE SYMBOL operation_name = Color plot
                                 DEFINE SYMBOL operation_service = ferret
                                 DEFINE SYMBOL operation_service_action = Plot_2D_XY
                                 DEFINE SYMBOL product_server_ps_timeout = 3600
                                 DEFINE SYMBOL product_server_ui_timeout = 20
                                 DEFINE SYMBOL product_server_use_cache = false
                                 DEFINE SYMBOL region_0_t_hi = 01-Jan-1998 15:00:00
                                 DEFINE SYMBOL region_0_t_lo = 01-Jan-1998 15:00:00
                                 DEFINE SYMBOL region_0_x_hi = 358.59375
                                 DEFINE SYMBOL region_0_x_lo = -1.40625
                                 DEFINE SYMBOL region_0_y_hi = 87.862101160767
                                 DEFINE SYMBOL region_0_y_lo = -87.863798839233
                                 DEFINE SYMBOL region_0_z_hi = 500
                                 DEFINE SYMBOL region_0_z_lo = 500
                                 DEFINE SYMBOL result_cancel_ID = cancel
                                 DEFINE SYMBOL result_cancel_filename = /usr/local/tomcat/webapps/las/output/269155D8B545DEC0F180D27A41F96FB1_cancel.txt
                                 DEFINE SYMBOL result_cancel_type = cancel
                                 DEFINE SYMBOL result_count = 6
                                 DEFINE SYMBOL result_debug_ID = debug
                                 DEFINE SYMBOL result_debug_filename = /usr/local/tomcat/webapps/las/output/269155D8B545DEC0F180D27A41F96FB1_debug.txt
                                 DEFINE SYMBOL result_debug_type = debug
                                 DEFINE SYMBOL result_map_scale_ID = map_scale
                                 DEFINE SYMBOL result_map_scale_filename = /usr/local/tomcat/webapps/las/output/269155D8B545DEC0F180D27A41F96FB1_map_scale.xml
                                 DEFINE SYMBOL result_map_scale_type = map_scale
                                 DEFINE SYMBOL result_plot_image_ID = plot_image
                                 DEFINE SYMBOL result_plot_image_filename = /usr/local/tomcat/webapps/las/output/269155D8B545DEC0F180D27A41F96FB1_plot_image.gif
                                 DEFINE SYMBOL result_plot_image_type = image
                                 DEFINE SYMBOL result_ref_map_ID = ref_map
                                 DEFINE SYMBOL result_ref_map_filename = /usr/local/tomcat/webapps/las/output/269155D8B545DEC0F180D27A41F96FB1_ref_map.gif
                                 DEFINE SYMBOL result_ref_map_type = image
                                 DEFINE SYMBOL result_rss_ID = rss
                                 DEFINE SYMBOL result_rss_filename = /usr/local/tomcat/webapps/las/output/90E9E1E6CEC18B6A1601B1C2A3B2B68A_rss.rss
                                 DEFINE SYMBOL result_rss_type = rss
         GO ($operation_service_action)
 !-> GO Plot_2D_XY
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! $Author: rhs $
!
! Plot_2d_XY.jnl decides which script to call to make a 2D plot.
! In the "old" LAS UI a 2D plot has for XY has different options and other
! UI characteristics than other 2D plots so it needs its own script.
!
IF ($ferret_view"|xy>1|*>0") THEN
 !-> IF 1 THEN
 
   !! Make a plot in XY...
   go xy_plot_2D
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! $RCSfile: xy_plot_2D.jnl,v $
! $Revision: 1.12 $
!
! $Author: ansley $
! $Date: 2006/08/11 16:45:54 $
! 2006/07/19 Fix test of ($ferret_contour_levels"0|*>1")
! 3/7/2007: ACM. Put code to check that the region was not too small, resulting
!           in degenerate plot into LAS_initialize_data.jnl rather than in the
!           individual plot scripts.
! 3/29/2007 ACM Fix logic interpreting contents of ferret_interpolate_data
! 7/15/2007 ACM Add lines to remove labels when a degenerate 2D plot is made
!               This happens when the region chosen is smaller than a grid cell.
! 3/2008 ACM Use SHADE/TRIM for shade underlays of FILL plots (Ferret v6.1)
! 3/2008 ACM For native curvilinear plots use MODULO qualifier only on SHADE plots
 
! XY_plot.jnl creates an XY plot for use with the Back End Server
! code that sits behind a Live Access Server (LAS).
!
! NOTE:  This code handles overlays but not differencing.
!
! TODO:  We should support user choice of the 'base layer' variable.
! TODO:  From the Ferret script writers' perspective it would be nice
! TODO:  if this were handled in the UI so that ($data_0_...) always
! TODO:  referred to the base layer.
 
 
! Set any Ferret modes
!
! NOTE:  Should we support any of the following Ferrt modes?
! NOTE:    ASCII_FONT, CALENDAR, DEPTH_LABEL, LABELS, LATIT_LABEL, LONG_LABEL
 
IF ($ferret_interpolate_data%0|false>0|true>1|1|0|*>1%) THEN SET MODE INTERPOLATE
 !-> IF 0 THEN SET MODE INTERPOLATE
 
DEFINE SYMBOL fview = `UPCASE("($ferret_view)")`
 !-> DEFINE SYMBOL fview = XY
 
! Define symbols associated with the regign and data and perform any
! initialization needed for this dataset.
!
! NOTE:  Adding support for a 'base layer' variable would mean passing
! NOTE:  some other argument.  For now, though, we always use 'data_0'
! NOTE:  for the base layer and region.
 
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 = -1.40625
  DEFINE SYMBOL region_x_hi = `INT(100000 * ($($region)_x_hi)) / 100000`
 !-> DEFINE SYMBOL region_x_hi = 358.5938
  DEFINE SYMBOL limits_x = ($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL limits_x = -1.40625:358.5938
  DEFINE SYMBOL limits_x_m360 = `($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL limits_x_m360 = -361.4063:-1.406189
  DEFINE SYMBOL limits_x_p360 = `($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL limits_x_p360 = 358.5938:718.5938
  DEFINE SYMBOL region_x = X=($region_x_lo):($region_x_hi)
 !-> DEFINE SYMBOL region_x = X=-1.40625:358.5938
  DEFINE SYMBOL region_x_m360 X=`($region_x_lo)-360`:`($region_x_hi)-360`
 !-> DEFINE SYMBOL region_x_m360 X=-361.4063:-1.406189
  DEFINE SYMBOL region_x_p360 X=`($region_x_lo)+360`:`($region_x_hi)+360`
 !-> DEFINE SYMBOL region_x_p360 X=358.5938:718.5938
  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.0001
  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 = -87.863
  DEFINE SYMBOL region_y_hi = `INT(1000 * ($($region)_y_hi)) / 1000`
 !-> DEFINE SYMBOL region_y_hi = 87.862
  DEFINE SYMBOL limits_y = ($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL limits_y = -87.863:87.862
  DEFINE SYMBOL region_y = Y=($region_y_lo):($region_y_hi)
 !-> DEFINE SYMBOL region_y = Y=-87.863:87.862
  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 = 175.725
  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 = 500
  DEFINE SYMBOL region_z_hi = ($($region)_z_hi)
 !-> DEFINE SYMBOL region_z_hi = 500
  DEFINE SYMBOL limits_z = ($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL limits_z = 500:500
  DEFINE SYMBOL region_z = Z=($region_z_lo):($region_z_hi)
 !-> DEFINE SYMBOL region_z = Z=500:500
  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 = 01-Jan-1998 15:00:00
  DEFINE SYMBOL region_t_hi = ($($region)_t_hi)
 !-> DEFINE SYMBOL region_t_hi = 01-Jan-1998 15:00:00
  DEFINE SYMBOL limits_t \"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL limits_t \"01-Jan-1998 15:00:00\":\"01-Jan-1998 15:00:00\"
  DEFINE SYMBOL region_t T=\"($region_t_lo)\":\"($region_t_hi)\"
 !-> DEFINE SYMBOL region_t T=\"01-Jan-1998 15:00:00\":\"01-Jan-1998 15:00:00\"
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=-1.40625:358.5938,Y=-87.863:87.862
  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=-1.40625:358.5938,Z=500:500
  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=-1.40625:358.5938,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  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=-87.863:87.862,Z=500:500
  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=-87.863:87.862,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  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=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  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=-1.40625:358.5938,Y=-87.863:87.862,Z=500:500
  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=-1.40625:358.5938,Y=-87.863:87.862,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  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=-87.863:87.862,Z=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  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=-1.40625:358.5938,Y=-87.863:87.862,Z=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
  ELSE
  ENDIF
ELSE
  ENDIF
ENDIF
 
DEFINE SYMBOL region_full = ($region_xyzt)
 !-> DEFINE SYMBOL region_full = X=-1.40625:358.5938,Y=-87.863:87.862,Z=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 
 
! 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=-1.40625:358.5938
 !-> DEFINE SYMBOL region_0_x = X=-1.40625:358.5938
IF ($region_y"0|*>1") THEN DEFINE SYMBOL region_($num)_y = ($region_y)
 !-> IF 1 THEN DEFINE SYMBOL region_0_y = Y=-87.863:87.862
 !-> DEFINE SYMBOL region_0_y = Y=-87.863:87.862
IF ($region_z"0|*>1") THEN DEFINE SYMBOL region_($num)_z = ($region_z)
 !-> IF 1 THEN DEFINE SYMBOL region_0_z = Z=500:500
 !-> DEFINE SYMBOL region_0_z = Z=500:500
IF ($region_t"0|*>1") THEN DEFINE SYMBOL region_($num)_t = ($region_t)
 !-> IF 1 THEN DEFINE SYMBOL region_0_t = T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 !-> DEFINE SYMBOL region_0_t = T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
IF ($region_xt"0|*>1") THEN DEFINE SYMBOL region_($num)_xt = ($region_xt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xt = X=-1.40625:358.5938,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 !-> DEFINE SYMBOL region_0_xt = X=-1.40625:358.5938,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
IF ($region_xy"0|*>1") THEN DEFINE SYMBOL region_($num)_xy = ($region_xy)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xy = X=-1.40625:358.5938,Y=-87.863:87.862
 !-> DEFINE SYMBOL region_0_xy = X=-1.40625:358.5938,Y=-87.863:87.862
IF ($region_xz"0|*>1") THEN DEFINE SYMBOL region_($num)_xz = ($region_xz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_xz = X=-1.40625:358.5938,Z=500:500
 !-> DEFINE SYMBOL region_0_xz = X=-1.40625:358.5938,Z=500:500
IF ($region_yt"0|*>1") THEN DEFINE SYMBOL region_($num)_yt = ($region_yt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yt = Y=-87.863:87.862,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 !-> DEFINE SYMBOL region_0_yt = Y=-87.863:87.862,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
IF ($region_yz"0|*>1") THEN DEFINE SYMBOL region_($num)_yz = ($region_yz)
 !-> IF 1 THEN DEFINE SYMBOL region_0_yz = Y=-87.863:87.862,Z=500:500
 !-> DEFINE SYMBOL region_0_yz = Y=-87.863:87.862,Z=500:500
IF ($region_zt"0|*>1") THEN DEFINE SYMBOL region_($num)_zt = ($region_zt)
 !-> IF 1 THEN DEFINE SYMBOL region_0_zt = Z=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 !-> DEFINE SYMBOL region_0_zt = Z=500:500,T="01-Jan-1998 15:00:00":"01-Jan-1998 15:00:00"
 
! 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 = 01-Jan-1998 15:00:00
   LET iz = STRINDEX("($region_0_t_lo)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("01-Jan-1998 15:00:00", " 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("01-Jan-1998 15:00:00", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("($region_0_t_lo)", 1, iz-1)`
 !-> IF 1 THEN DEFINE SYMBOL t_lab_lo = `SUBSTRING("01-Jan-1998 15:00:00", 1, iz-1)`
 !-> DEFINE SYMBOL t_lab_lo = `SUBSTRING("01-Jan-1998 15:00:00", 1, iz-1)`
 !-> DEFINE SYMBOL t_lab_lo = 01-Jan-1998 15
   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 = 01-Jan-1998 15:00:00
   LET iz = STRINDEX("($region_0_t_hi)", " 00:00:00")
 !-> DEFINE VARIABLE iz = STRINDEX("01-Jan-1998 15:00:00", " 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("01-Jan-1998 15:00:00", ":00:00")
      IF `iz GT 0` THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("($region_0_t_hi)", 1, iz-1)`
 !-> IF 1 THEN DEFINE SYMBOL t_lab_hi = `SUBSTRING("01-Jan-1998 15:00:00", 1, iz-1)`
 !-> DEFINE SYMBOL t_lab_hi = `SUBSTRING("01-Jan-1998 15:00:00", 1, iz-1)`
 !-> DEFINE SYMBOL t_lab_hi = 01-Jan-1998 15
   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 \"/usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des\"
ENDIF
 
IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var ($data_($num)_var)
 !-> IF 1 THEN DEFINE SYMBOL data_var NO2
 !-> DEFINE SYMBOL data_var NO2
DEFINE SYMBOL data_name ($data_($num)_name)
 !-> DEFINE SYMBOL data_name NO2 (NO2) [mol/mol]
IF `($data_($num)_name"0|*>1") EQ 0` THEN DEFINE SYMBOL data_name ($data_var)
 !-> IF 0 THEN DEFINE SYMBOL data_name NO2
 
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("NO2")`
 !-> DEFINE SYMBOL data_var = `UPCASE("NO2")`
 !-> DEFINE SYMBOL data_var = NO2
LET varlen = `STRLEN("($data_var)")`
 !-> DEFINE VARIABLE varlen = 3
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 = NO2
 !-> DEFINE SYMBOL data_var_nq = NO2
   IF ($data_($num)_var"0|*>1") THEN DEFINE SYMBOL data_var = '($data_var)'
 !-> IF 1 THEN DEFINE SYMBOL data_var = 'NO2'
 !-> DEFINE SYMBOL data_var = 'NO2'
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 mol/mol
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 (mol/mol)
   IF `STRINDEX("($data_units)", "((") GT 0` THEN \
     DEFINE SYMBOL data_units ($data_($num)_units)
 !-> IF 0 THEN      DEFINE SYMBOL data_units mol/mol
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 NO2 (NO2) [mol/mol]
 !-> DEFINE SYMBOL data_title NO2 (NO2) [mol/mol]
ELSE
ENDIF
 
DEFINE SYMBOL ferret_plot_title "($data_title) ($data_units)"
 !-> DEFINE SYMBOL ferret_plot_title "NO2 (NO2) [mol/mol] (mol/mol)"
 
! SET DATA and check for errors
 
SET DATA ($data_url)
 !-> SET DATA "/usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des"
 
! 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 ("mol/mol")
   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("mol/mol", 2, ulen-2)`
ENDIF
 
 
IF ($fer_last_error"0|0|1|*>1") THEN
 !-> IF 0 THEN
ENDIF
 
SET DATA "($data_($num)_url)"
 !-> SET DATA "/usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des"
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 1 THEN GO hybrid2pressinit 0
 !-> GO hybrid2pressinit 0
! hybrid2press.jnl
! for use as init script with las server
!
! Calculate a pressure z-axis from hybrid coefficients HYAM, HYBM and surface
! pressure ASP and set pressure z-axis in the pressure based dataset (output
! dataset).
!
! Corresponding xml file should look something like this (datasets section)
! (here: CO test dataset):
!
! 
!   
!     
!       
!         
!         
!           
!             CO
!             hybrid2press
!           
!         
!       
!     
!   
! 
!
! Access of init script:
! $data_url --> 
! $data_var_nq -->  no quotes
! $ferret_hz_var --> ...
!
! (30.07.2008) Bastian Kern
!
say `($FERRET_MEMORY"6.4")`
 !-> MESSAGE/CONTINUE 16
16
 
! getting the url of netcdf file of variable (here: mc-file)
set data ($data_url)
 !-> set data "/usr/local/tomcat/content/las/conf/server/des/M2E23_exp07_tr_NOx_NOy.des"
 
DEFINE SYMBOL LEVELS = `($data_var_nq), return=KAXIS`
 !-> DEFINE SYMBOL LEVELS = LEV
DEFINE SYMBOL RESULT = `STRCMP("($LEVELS)","ILEV")`
 !-> DEFINE SYMBOL RESULT = 3
IF `($RESULT) EQ 0` THEN
 !-> IF 0 THEN
ENDIF
 
! calculate pressure levels
LET/D APS = g3b_aps
LET PRESS = (HYAM + HYBM * APS[k=1])/100
 
! define new z-axis of pressure levels
DEFINE AXIS/Z/FROM_DATA/NAME=PAX/depth/units=hPa ((HYAM[d=1] + HYBM[d=1] * 101325.)/100)
 
set var/name=temp ($data_var_nq)
 !-> set var/name=temp NO2
! output variable is variable from input with new z-axis
let ($data_var_nq) = ZAXREPLACE(temp, press[d=1], Z[gz=pax])
 !-> DEFINE VARIABLE NO2 = ZAXREPLACE(temp, press[d=1], Z[gz=pax])
!define symbol data_var_nq = ($data_var_nq)_P
!IF ($ferret_view"|xy>1|*>0") THEN
  define symbol data_var = '($data_var_nq)'
 !-> define symbol data_var = 'NO2'
!ENDIF
 
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
 
! 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`

[Thread Prev][Thread Next][Index]


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

Privacy Policy | Disclaimer | Accessibility Statement