Capacities (CP)

Embed Size (px)

Citation preview

  • 7/30/2019 Capacities (CP)

    1/40 1992-2009 Napa Ltd. All rights reserved.

    NAPA Online Manuals 2009.1

    Capacities (CP)

  • 7/30/2019 Capacities (CP)

    2/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    1992-2009 Napa Ltd. All rights reserved.

    Table of Contents

    1 Tank tables (CP). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.2 Connection to old CP tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.3 Quantities available. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.4 Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.4.1 Depth Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.4.2 Trim and heel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.4.3 Other arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.4.4 Adaption of arguments when changing compartment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.5 Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    1.6 Listing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    1.6.1 LQ qualifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    1.6.2 Standard lists commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.6.3 Selecting sets of compartments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    1.6.4 Presentation of undefined values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    1.6.5 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    1.7 Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    2 Sounding devices and steel reductions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.1 Sounding devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.1.1 Device types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.1.2 Identification of sounding devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.3 Defining sounding devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.4 Selecting the sounding device for calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    2.1.5 Auxiliary functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.6 Drawing of sounding devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    2.1.7 Old and new definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.1.8 Using sounding values with the calculator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.2 Steel reduction as a function of filling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    2.2.1 Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    2.2.2 Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.3 Alternative definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.4 Storing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.5 Updating. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.6 Connection to SM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.7 Auxiliary functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.8 Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    2.3 Other definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    3 Examples of output macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    3.1 Sounding table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    3.2 Listing groups of compartments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.3 Example macro for LIST .macro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    3.4 Example of plotting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    4 Commands and service functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    4.1 Main task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    4.1.1 Subtask PAR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    4.2 Service functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

  • 7/30/2019 Capacities (CP)

    3/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    1 (38)

    1992-2009 Napa Ltd. All rights reserved.

    1 Tank tables (CP)

    1.1 Introduction

    The capacities task CP handles sounding tables and devices and produces output as a function of depth, sounding, ullage,

    draught, trim and heel.

    Tank geometry is derived mainly from the geometry task GM with some parameters from Ship Model SM.

    The sounding devices and steel reductions for individual compartments are defined in the subtask PAR.

    The results are derived from the volume or the surface of the liquid in a tank filled to a given level. The tank fillings are

    given in different methods including volumes, heights or sounding device readings.

    1.2 Connection to old CP tasks

    The current CP task replaces a number of separate tasks, of which the definition task was taken out of use in rel. 90.1 and

    the output tasks (CHYD,SOUND,RFS,TANK) in rel. 93.2.

    For the case that an old project (before 90.1) should be used, the difference between defining sounding devices in this

    task or in the old task SDEV is presented below.

    1.3 Quantities available

    The following quantities are available for output:Quantities in LQ CP

    Quantity Explanation

    AWP area of waterplane

    AZIMAX azimuth angle of Imax

    AZIMIN azimuth angle of Imin

    CGX cgx of volume

    CGXA cgx of area

    CGY cgy of volume

    CGYA cgy of area

    CGZ cgz of volume

    GAUGE sounding device reading

    H height from tank bottom

    FILL filling degree (% of max volume)

    FSM free surface moment

    IMIN min. moment of inertia of surface

    IMAX max. moment of inertia of surface

    LMA longit moment of surfaceLMV longit. moment of volume

    SCORRH sounding correction for heel

  • 7/30/2019 Capacities (CP)

    4/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    2 (38)

    1992-2009 Napa Ltd. All rights reserved.

    SCORRT sounding correction for trim

    T draught

    TMA transv moment of surface

    TMV transv. moment of volume

    TMX long. moment of inertia

    TMY transv moment of inertia

    VCORRH volume correction for heel

    VCORRT volume correction for trim

    VMV vert. moment of volume

    VNET net volume

    VOLM volume moulded

    WL weight of load

    The net volume is the moulded volume minus steel reduction, while the weight of load is the net volume multiplied by

    the density of the contents. A normal, fixed steel reduction is obtained from SM. A steel reduction that varies with height

    can be defined in the subtask PAR, and used under CP only.

    H and GAUGE can be both arguments and result quantities, depending on which one is given (see paragraph about

    arguments).

    VCORRT gives a volume correction (net volume), defined as the volume at a given trim minus the volume at zero trim.

    VCORRH does the analogous function for heel. SCORRT gives the trim correction in the form of an increment to the

    sounding value. SCORRH gives the analogous correction for heel.

    FSM (free surface moment) is the real moment caused by shifting of the liquid at a given heeling. The basic quantities

    should be calculated for heel=0 (argument HEEL), while the heel for which the moment is printed is given as qualifier

    in the LQ command.

    1.4 Arguments

    The arguments controlling the calculation can be listed with command ARGS. The function of the arguments is presented

    in the following paragraphs.

    1.4.1 Depth Arguments

    The calculation depths can be specified directly as depths, or indirectly as sounding values, volumes or fillings. Thearguments can further be given directly as a set of values or by a step. The corresponding arguments H, STEP, GAUGE,

    GSTEP, VOL, VSTEP and FILL, FSTEP are alternatives that replace each other. (The volume argument is thenet volume).

    If H is given and GAUGE is among the list quantities, the former is listed as given while the latter one is calculated and

    vice versa.

    When the GAUGE quantity is calculated, the calculation is done with the argument trim and heel, and therefore in

    line with those quantities only that are calculated with the same arguments, not volumes with a trim or heel changed

    by a qualifier.

    When applying the step arguments, the range is selected so that the maximum volume at zero trim is included in the

    result list.

    For the gauge step, there are the following additional options. With the argument TRRANGE, it is possible to define a

    trim range to be taken into account when deciding the range of gauge values needed. With the following options, special

  • 7/30/2019 Capacities (CP)

    5/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    3 (38)

    1992-2009 Napa Ltd. All rights reserved.

    values can be added if not already in the series: Command ADD TE (tube end) adds the end of the sounding tube and

    ADD MAX adds the gauge corresponding to the maximum filling at the trim and heel defined by the arguments.

    The listing order in the table is from lower to higher values of the given argument. If the argument is ullages, this meansthat the volumes will be listed in descending order. With the table output option REV the order can be reversed.

    The heights are measured from a reference height, that is selected as the lowest coordinate of the tank, but can be changed

    by the argument REFZ. A permanent reference height can be defined as part of the tank oriented definitions (subtask PAR).

    The meaning of the argument H is obvious at zero trim and heel only: the height differs from the draught (T) by the

    constant REFZ, and with a non-zero trim (and to a less extent heel), the natural meaning of height is lost. In order to get

    an argument with a well defined interpretation, a formal, vertical sounding tube can be defined.

    The result quantity T is the one used as draught argument in the basic volume calculations. It is not intended for ordinary

    result lists, but it can be useful if one wants to compare results with values obtained by other means (e.g. calculator

    function VOL). It can also be used if one wants to define the plane representing the upper surface (e.g. command PLANE

    under task DR).

    The T values listed correspond to the current arguments (TRIM, HEEL) and are not valid for quantities with differing

    arguments provided in the LQ.

    When selecting a new compartment, this may cause a change of the depth arguments as presented below.

    For more flexibility, isolated argument values, not following from the step or not contained in a series can be added

    separately with command ADD. Values given in the ADD command are interpreted as arguments of the type presently

    valid, and added to the current set. Redefining the argument cancels the ADD command. Volume arguments are not

    supported.

    For height arguments (H or STEP), there is the alternative ADD STEPS, adding values where there is a step in the waterline

    area function. The values are added doubled, causing the waterline area to be calculated separately above and below thediscontinuity. The same effect is obtained if a double argument is added manually.

    The number of depths resulting from the current combination of depth argument and compartment can be inquired with

    command NARG. The result is also stored in variable NARG, in order to support decisions regarding page feeds or similar

    in listing macros. Note: without the NARG command, the variable is not updated.

    1.4.2 Trim and heel

    In a given table, the calculations are made for a fixed trim and heeling, the values of which can be set with the corresponding

    arguments (TR, HEEL).

    Values calculated for several trims and heelings can be added into a single table the following ways:

    The volume and quantities derived from the volume (VNET, WL) can be equipped with a qualifier in the quantity selection(LQ command), which will be interpreted as trim. For example,

    LQ H VNET('even keel') VNET('trim -1')/-1 VNET('trim 1')/1

    gives the net volume for three trims in the same table (-1,0 and 1). The volume without qualifier is calculated as specified

    by the trim argument (assumed 0 in the example).

    Alternatively, a heel can be given as qualifier, which is distinguished from a trim by adding prefix H, for example VNET/

    H10, denoting heel 10 (degrees). For symmetry, a T can be added in front of a trim (e.g. VNET/T-2). Both a heel and a

    trim can be combined, for example VNET/H5T1 for heel=5, trim=1.

    Another possibility is to use the correction quantities VCORRT, VCORRH, SCORRT and SCORRH. The two first ones

    give a correction to the net volume, and the two latter ones to the sounding value. The last letter T or H tells whether the

    correction is for trim or heeling. The argument for which the correction is calculated is given as qualifier, for example

    LQ GAUGE VNET VCORRT('trim -1')/-1 VCORRT('trim 1')/1,

  • 7/30/2019 Capacities (CP)

    6/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    4 (38)

    1992-2009 Napa Ltd. All rights reserved.

    VCORRH('heel-5')/-5 VCORRH('heel=5')/5

    This selection gives the net volume and a volume correction for trims -1 and 1 and heelings 5 and -5.

    The sounding correction gives the same information in the form of a correction of the sounding value, so that the volume

    table, read at the corrected sounding value gives the corrected volume. For the sounding correction to be exact, the spacing

    between the calculation draughts should be small enough to allow linear interpolation.

    For the correction quantities (VCORRT, VCORRH, SCORRT, SCORRH) to be meaningful, they must be calculated with

    fixed gauge (not height), using GAUGE or GSTEP as argument.

    1.4.3 Other arguments

    In addition to those presented above, the following arguments are defined:

    ARR - arrangement

    The arrangement has its normal function of providing parameters for the compartments and a set from which selectionsare made. The current arrangement is selected as default, either as such or as the subset prefixed with LD (e.g. LDA)

    as in loading conditions. A tank need not belong to the arrangement, but some parameters (mainly RED) may then need

    assigning manually.

    COMP - current compartment

    When a new compartment is selected, arguments are adapted as presented below.

    SDEV - current sounding device

    When a new compartment is selected, the first device defined is selected as default. Without a sounding device, the

    arguments GAUGE, GSTEP and the list quantity GAUGE cannot be used. The sounding device is expressed as type/id,

    where '/id' is optional. If no id is given, a device with the given type and empty id is selected, if found, otherwise the

    first one with the given type.

    RHO - density of contents

    This parameter is relevant for quantities WL (weight of load) and FSM (free surface moment) only. The default is fetched

    from the arrangement.

    RED - steel reduction

    This parameter is relevant for quantities VNET (net volume), WL and FSM, and for the argument quantities VOL and

    VSTEP. The default is fetched from the arrangement, unless a special definition has been made under CP (see below).

    DMODE - control for dummy values

    This argument controls the listing of undefined centers of gravity or redundant volumes, as presented below.

    WLS - waterline section for waterline oriented quantities

    This option may improve the accuracy of quantities derived from the surface (AWP etc), provided that the sections are

    obtained reliably.

    1.4.4 Adaption of arguments when changing compartment

    Most of the arguments are to some degree dependent on the compartment, and may need correction after changing

    compartment. This paragraph presents the changes made by the system, when reading a new compartment.

    For RHO and RED, new values are always assigned after reading a new compartment. If a variable steel reduction has

    been defined, it will be used. A non-standard value to be applied on many compartments must therefore be repeated.

    REFZ is normally handled as RHO and RED, i.e. the given value is supposed to be relevant for the current compartment,

    and new values are assigned when a new compartment is read. With the option *, e.g.

    REFZ 0 *

  • 7/30/2019 Capacities (CP)

    7/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    5 (38)

    1992-2009 Napa Ltd. All rights reserved.

    the given value will be kept fixed when changing compartments. Command

    REFZ -

    has the (only) effect that the fixing of the reference height is cancelled.

    When the compartment s changed, a sounding device is automatically selected. If no other instructions have been given,

    the first one encountered is selected. The argument SDEV selects a sounding device for the current compartment, and

    does not affect subsequent compartments. In the same way as for the reference height, this can be changed with the option

    *, with the effect that the device for a new compartment is selected so that the given one is matched as closely as possible.

    The value shown by command ARGS is the one currently active, and if the * option has been given, this selection is

    listed separately.

    SDEV -

    cancels the * option.

    If no sounding device matching the default is found when fetching a compartment, a message is printed, provided that asounding argument is active (otherwise the sounding device is assumed not relevant).

    Of the depth arguments, H, STEP, GSTEP and VSTEP are treated as useful regardless of compartment, and keep their

    value when reading a new one. The other ones are supposed to need redefining, but in order to have some arguments,

    defaults are assigned as follows: Fixed gauges are replaced bay GSTEP=0.1, and fixed volumes are replaced by STEP=0.5.

    If the new compartment does not have a sounding device, gauge arguments are replaced by STEP 0.5. If a gauge step is

    replaced because the compartment does not have a sounding device, the value is saved and applied again when possible.

    1.5 Variables

    A number of calculator variables are assigned in order to support programming of macros:

    The variable COMP is assigned the name of the current compartment. If the compartment is a part of an arrangement,the following variables are set from SM-task:

    SMCAP capacity (filling)

    SMCCOD alternative name (tank code)

    SMCGX,SMCGY,SMCGZ center of gravity of volume

    SMCLAS class

    SMDES descriptive text

    SMPDES description of purpose

    SMPURP purpose

    SMRED steel reduction

    SMRHO density of contents

    SMTYPE type

    SMVNET net volume

    SMVOLM moulded volume

    SMWLMX loading capacity (max weight)

    SMXMIN...SMZMAX: extreme coordinates

    If a selection has been made with command SELECT, the list of compartments is available in the calculator array CPLIST.

    The identifier of the current sounding device is stored in variable SDEV. If none is available, value 'NONE' is assigned.

    At separate request (command NARG), the number calculation depths is stored in variable NARG.

  • 7/30/2019 Capacities (CP)

    8/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    6 (38)

    1992-2009 Napa Ltd. All rights reserved.

    The variable LTUBE is assigned the length of the sounding tube (if any).

    1.6 Listing

    1.6.1 LQ qualifiers

    In the LQ command, a so-called qualifier can be added to the symbol of the quantity, separated by a slash, e.g. VOL/2.

    The effect of the qualifiers is dependent on the application, and in this case, the following alternatives are available:

    s Volumes and weight:

    The qualifier modifies the trim or heel argument as presented under 'Arguments'.

    s Quantity GAUGE:

    The qualifier R (reverse) converts soundings to ullages and vice versa. Only when argument=gauge or gstep and the

    current device is a tube.

    s Quantity FSM (free surface moment):

    The qualifier gives the heeling for which the the moment is calculated. The default is 0, giving zero moment.

    s Centers of gravity:

    The qualifier gives a reference point (default=0).

    1.6.2 Standard lists commands

    The standard list commands NL (new list), NP (new page), LF (line feed), TYPE (print arbitrary text), FIG (add figure)

    are all available, as are commands !FORM and !PAGE.

    In designing layouts, the parameterless calculator function CLINE may be useful, telling the line number of the last line

    printed on the current page (headers not counted).

    The TYPE command, possibly with variable components can be used for adding headers not belonging to the table.

    Note the calculator function FMT, by which a fixed format and field length can be given to a numeric variable. For string

    data, function SBS has the same effect. Note also that the syntax of the TYPE command allows fixed starting columns to

    be given. A (tilde) at the end of the line allows the TYPE command to be input on several lines (the tilde character may

    be changed in the installation parameters). The following are two examples of the TYPE command:

    TYPE Compartment @SBS(COMP,12) contents @SMPDES

    TYPE Location #@FR(SMXMIN) to #@FR(SMXMAX)

    1.6.3 Selecting sets of compartments

    In order to help printing tables over many compartments, commands SELECT and SORT are available. CommandSELECT selects a subset of compartments from the current arrangement, using a criterion based on the standard SM

    quantities. The following example selects all compartments with liquid contents except ballast water:

    SELECT TYPE=L -PURP=BW

    The result of the selection is a calculator array named CPLIST, which can be used for controlling loops in macros or the !

    DO command, as in the following example:

    !DO LIST-MACRO NAME=CPLIST

    where LIST-MACRO is the name of a macro containing listing commands, including a command COMP @NAME. The

    array itself can be listed with !VAR LIST CPLIST. Another way of using the array is presented below in the example

    list for LISTCP.STD.

    Command SORT controls the order within the set selected by defining a parameter (e.g. NAME, XMIN) as sorting

    criterion. NOTE: Must be given before SELECT.

  • 7/30/2019 Capacities (CP)

    9/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    7 (38)

    1992-2009 Napa Ltd. All rights reserved.

    A selection made with SELECT can be further restricted on the basis of a criterion concerning sounding devices. This

    selection is given as a separate SELECT command after the initial one, in the form

    SELECT DEV=type

    SELECT DEV=type/id

    SELECT DEV>type or

    SELECT DEV

  • 7/30/2019 Capacities (CP)

    10/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    8 (38)

    1992-2009 Napa Ltd. All rights reserved.

    400 145.8 65.49 4.56 1.80 19.7 64.34 5.77 26

    500 165.5 65.37 4.70 2.09 20.1 64.48 5.78 7

    600 185.6 65.28 4.82 2.43 20.4 64.58 5.79 2

    700 205.9 65.21 4.91 2.81 20.7 64.65 5.79 2

    -----------------------------------------------------------------

    The following example illustrates combination of different trims in the same list:

    LQ GAUGE('sounding'), VNET('trim=-2')/-2, VNET('trim=-1')/-1,

    VNET('even keel'), VNET('trim=1')/1, VNET('trim=2')/2

    TOO CP HD=(UL, S, U, UL, -, UL)

    ----------------------------------------------------------------

    sounding trim=-2 trim=-1 even keel trim=1 trim=2

    cm m3 m3 m3 m3 m3----------------------------------------------------------------

    0 1.7 1.3 1.5 2.1 3.1

    100 39.6 39.3 39.0 38.8 38.6

    200 75.8 75.5 75.2 75.0 74.7

    300 114.0 113.7 113.3 113.0 112.7

    400 145.3 145.5 145.8 146.0 146.3

    500 165.1 165.3 165.5 165.7 165.9

    600 185.2 185.4 185.6 185.8 185.9

    700 205.5 205.7 205.9 206.1 206.3

    ----------------------------------------------------------------

    The following example illustrates the effect of DMODE. The first example is listed with the default behaviour. The LQ

    is the same as above, but the tank is different.

    ----------------------------------------------------------------

    sounding trim=-2 trim=-1 even keel trim=1 trim=2

    cm m3 m3 m3 m3 m3

    ----------------------------------------------------------------

    760 2092.5 2087.1 2082.0 2077.1 2072.6

    770 2118.5 2113.1 2108.0 2103.2 2098.7

    780 2144.6 2139.2 2134.1 2129.3 2124.8

    790 2170.7 2165.3 2160.2 2155.4 2150.9

    800 2196.8 2191.4 2186.2 2181.4 2176.9

    810 2222.3 2217.4 2212.3 2207.5 2203.0

    820 2244.1 2243.5 2238.4 2233.6 2227.9830 2261.7 2267.2 2264.5 2259.1 2248.7

    840 2275.1 2282.8 2290.5 2277.8 2265.3

    850 2284.4 2290.0 2290.5 2288.2 2277.7

    860 2289.5 2290.5 2290.5 2290.5 2286.0

    870 2290.5 2290.5 2290.5 2290.5 2290.1

    880 2290.5 2290.5 2290.5 2290.5 2290.5

    ----------------------------------------------------------------

    The following example is otherwise the same, but adding

    DMODE V

    ----------------------------------------------------------------

    sounding trim=-2 trim=-1 even keel trim=1 trim=2

  • 7/30/2019 Capacities (CP)

    11/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    9 (38)

    1992-2009 Napa Ltd. All rights reserved.

    cm m3 m3 m3 m3 m3

    ----------------------------------------------------------------

    760 2092.5 2087.1 2082.0 2077.1 2072.6

    770 2118.5 2113.1 2108.0 2103.2 2098.7

    780 2144.6 2139.2 2134.1 2129.3 2124.8

    790 2170.7 2165.3 2160.2 2155.4 2150.9

    800 2196.8 2191.4 2186.2 2181.4 2176.9

    810 2222.3 2217.4 2212.3 2207.5 2203.0

    820 2244.1 2243.5 2238.4 2233.6 2227.9

    830 2261.7 2267.2 2264.5 2259.1 2248.7

    840 2275.1 2282.8 2290.5 2277.8 2265.3

    850 2284.4 2290.0 - 2288.2 2277.7

    860 2289.5 2290.5 - 2290.5 2286.0

    870 2290.5 - - - 2290.1

    880 - - - - 2290.5

    ----------------------------------------------------------------

    1.7 Diagrams

    The standard commands PQ, POO and PLD are available. The subject identifier is CP, but being the only alternative, it

    is not needed in the commands.

    The PQ command (plot quantities) has the same alternatives as the LQ command.

    With command

    PLOT .macro options

    predefined plots can be run in a similar way as with the LIST command. The macros are named PLOTCP.macro in this

    case.

    The following example concerns the tank shown in the figure below:

    Tank in the PLD example

    This is a typical case where the ADD STEPS option is essential for getting a good plot of surface quantities (there is

    second discontinuity not visible in this section). The plot was made with the following options:

    PQ CP, H, VOLM, AWP, (GAUGE)

    POO CP, BOX, VA, LGTEXT=LH, LEGEND, LGH=*1.1, NET=P1021, SMOOTH,

    ARG: AXIS=LB, NOM=GAUGE, NAXIS=LA,

    F1: AXIS=LB, PEN=A1, RANGE=(0,250),

    F2: AXIS=UA, PEN=A2, SCALE=(F1)

  • 7/30/2019 Capacities (CP)

    12/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    10 (38)

    1992-2009 Napa Ltd. All rights reserved.

    Example of graphic presentation

    2 Sounding devices and steel reductions

    This chapter presents the definitions supporting the tank capacity calculations:

    s sounding devices

    s variable steel reductions

    s reference heights

    These are installed as the subtask PAR under the main CP task. In addition, there is the possibility to define a referenceheight.

    2.1 Sounding devices

    2.1.1 Device types

    The sounding devices can be manual sounding devices or remote sounding devices, and both types can show soundings

    or ullages. The types are designated by two-character symbols as follows:

    MS, MU manual device

    RS, RU remote device

    LS, LU same device type as RS,RU, but with installed with local reading device.

    DS 'dip' sounding device for measuring a remainder at the tank bottom

    From the calculation point of view, types LU,LS are equivalent with RU,RS, and the difference has been introduced for

    administrative purposes only.

    A manual sounding device is formed by a tube, along which a distance is measured, either from the zero point up to the

    liquid level (sounding) or from the upper end down (ullage). The zero point is by default at the end of the tube, but can

    be redefined by explicit definition.

    The following figure shows an example, where straight sounding tubes are placed in the corners of a box shaped tank.

    Soundings are shown to an inclined liquid level.

  • 7/30/2019 Capacities (CP)

    13/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    11 (38)

    1992-2009 Napa Ltd. All rights reserved.

    Illustration of manual soundings and ullages

    A remote sounding device in one way or another senses the orthogonal distance from the device to the liquid surface,

    either from below (sounding) or from above (ullage). Such a device is defined by the location of the probe and an optional

    correction, added by the device.

    Illustration of remote soundings and ullages

    The dip sounding device is formed by a weight dropped from a given position until it touches the bottom. The sounding

    the value is the length of the immersed part:

    This device is presently implemented for tanks with horizontal bottom only (at least in the region where the device may

    touch it).

    The quantity ' gauge' is used to denote device readings, regardless of whether they represent soundings or ullages.

  • 7/30/2019 Capacities (CP)

    14/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    12 (38)

    1992-2009 Napa Ltd. All rights reserved.

    The usage of the words 'manual' and 'remote' in this context has historical reasons, and the relevant aspect is the geometric

    behaviour. For example, a device that senses the upper level of the surface by using a directed radar beam must be defined

    as an MU device.

    2.1.2 Identification of sounding devices

    A sounding device is always attached to a specific compartment. A compartment may have several devices, which usually

    can be distinguished by their type only, but when needed, an additional identifier can be added. Thus, the identification

    of a device is formed by

    type/id

    where 'type' is MS, MU, RS, RU, LS, LU or DS. '/id' is optional, and can be selected freely.

    2.1.3 Defining sounding devices

    Sounding devices are defined with command DEV in subtask PAR under CP. This command either redefines a device or

    adds a new one, depending on whether there is already a device with the given identification.

    For a manual device, the form of the command is

    DEV comp type/id curve h

    where 'comp' is the name of the compartment, 'type/id' is the identification, 'curve' the definition the geometry of the tube

    and 'h' the (optional) height of the zero point.

    'curve' can be represented by a directly given set of points in space or by the name of a separately defined curve.

    Examples:

    DEV T110 MU (#BH1+1 #LBH2-0.2 #DECK1+0.05),(#BH1+1 #LBH2-0.2

    DEV T112 MS TUBE-T112 0.7

    The first example shows usage of reference to surfaces. Note however, that there is no automatic updating, in case the

    geometry is changed. In the second example, the sounding tube is defined as the curve named TUBE-T112, and the zero

    point is at height 0.7.

    The definition of a remote device has the following form:

    DEV comp type/id (x,y,z) h

    where (x,y,z) is the location of the probe and 'h' the optional reading correction.

    Example:

    DEV T110 RS (#BH1+1 #LBH2-0.2 #DECK1+0.05)

    The definition of a dip device has the same form:

    DEV comp type/id (x,y,z) h

    (x,y,z) is the point from which the device is lowered and h the height (z-coordinate) of the tank bottom.

    2.1.4 Selecting the sounding device for calculation

    When a new compartment is selected with the COMP command, the first device (if any) will be selected as default. Other

    selections can be made with the SDEV argument. Arguments GAUGE and GSTEP and result quantity GAUGE require

    that there is a device available.

  • 7/30/2019 Capacities (CP)

    15/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    13 (38)

    1992-2009 Napa Ltd. All rights reserved.

    2.1.5 Auxiliary functions

    A catalog of stored devices is obtained by command CAT. A list of compartments having devices is stored in a calculator

    array DEVLIST.

    The DES command lists definitions of sounding devices:

    DES DEV comp

    (The keyword DEV is optional). This command lists the devices defined for the given compartment. In order to list a set

    of compartments in a single command, the name of a specific compartment can be replaced by the syntax *LIST or *:

    DES *list

    DES *

    'list' is the name of calculator array, and the operation will be repeated for all names in the list. The bare * refers to the

    list DEVLIST, created by the CAT command.

    Command DELETE DEV deletes sounding devices:

    DELETE DEV comp type/id

    A list of sounding devices is also available formally as a property of the arrangement, quantity SDE. For example, SDE

    can be added to the LQ of SM or inquired with the CPP function.

    2.1.6 Drawing of sounding devices

    In the drawing task, graphic check of sounding devices can be done with commands

    PLOT SDEV name options (single compartment)

    DRW SDEV options (from current arrangement)

    A manual sounding device is drawn as a curve, adding symbol at the high end. The default for the name of the figure used

    for the symbol is MSDEVICE. A remote sounding device is represented by a symbol only (RSDEVICE). A dip device is

    represented by a symbol showing the attach point and a figure (DSDEVICE) showing the weight.

    The following options are provided

    type R,M,L given main type only, RS,MS,RU,MU,LS,LU: specified type, type/id:

    specific device.

    D=d: size of figure (drawing scale), default twice the standard text height (as set with

    TH)

    FIG=fig name of figure to represent the device

    NAME=name name of compartment. Relevant for DRW only.

    If ID NAME is set, and the figure has a text field 1, the name of the compartment (DRW) or name of device (PLOT)

    is written into the text field.

    The drawing task can be entered from CP with command DR.

    The following figure shows an example of ID NAME +DRW SDEV:

  • 7/30/2019 Capacities (CP)

    16/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    14 (38)

    1992-2009 Napa Ltd. All rights reserved.

    Example of DRW SDEV

    The original way of plotting the devices was to use figures. With the 3d mode of the view (!view 3d), the figures are

    replaced by markers as follows:

    Markers designating different devices

    2.1.7 Old and new definitions

    This information is relevant for sounding devices created before rel. 90.1. The storage format initially defined for sounding

    devices was suitable for fixed sets of devices only, and in order to support a more flexible handling of devices, the storage

    has been revised.

    Definitions according to the new format are done in subtask PAR under task CP, and can only be used in this task, inPLOT SDEV and in the inclining test task. In order to make definitions in the old format fully available, command GET

    OLD must be given, otherwise old formats are taken into account only when explicitly selected by the SDEV command.

    Command CNV OLD fetches old definitions permanently.

    If definitions of both types have been made for a given device, the new definition is used.

    If GET OLD or CNV OLD has been given, command DES under PAR will show both new and old definitions, with a

    comment #** o preceding a definition in old format. Otherwise, DES OLD comp must be used.

    When any definition is changed under PAR, the whole set of valid definitions will be stored in the new format.

    2.1.8 Using sounding values with the calculator

    Calculations involving sounding device readings can be done by the calculator using the following service functionsprovided by CP.

  • 7/30/2019 Capacities (CP)

    17/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    15 (38)

    1992-2009 Napa Ltd. All rights reserved.

    The functions CP.T and CP.GAUGE convert gauge values to draughts and vice versa:

    t=CP.T(comp,device,gauge,trim,heel)

    gauge=CP.GAUGE(comp,device,t,trim,heel)

    comp=name of compartment, device=name of device, e.g. MS, MS/V1. trim and heel are optional, default=0. NOTE: as

    in the VOL function, these are given in the external form: trims in m and heel in degrees.

    The draught t is the same as used when expressing the filling in volume oriented calculator functions, for example VOL:

    vol=VOL(comp,t,trim,heel)

    The function CP.VOLG (volume from gauge) provides a shortcut:

    vol=CP.VOLG(comp,device,gauge,trim,heel)

    while CP.GVOL (gauge from volume) does the reverse function:

    gauge=CP.GVOL(comp,device,vol,trim,heel)In all these functions, the same conventions for trim and heel are valid.

    A list of devices defined for a given tank is obtained by the function CP.DEVICES. The user must reserve a string array

    to receive the result:

    @devlist=ARR(3)

    @n=CP.DEVICES(comp,devlist)

    where comp=name of compartment and n=number of devices. The devices are stored using the normal conventions, e.g.

    MS, MS/V1.

    2.2 Steel reduction as a function of filling

    The steel reduction for an individual compartment can be defined as a function of filling degree.

    Normally, the original input is given as a function of filling height, which is converted to a function of filling degree. The

    correction is defined for zero trim and heel, for non-zero trim or heel the meaning of height is lost.

    The steel reduction defined this way replaces the fixed one defined under SM in the CP task. The argument FILL is

    not supported for variable steel reductions (works inexactly). The variable steel reduction is also available in the table

    interface of LD.

    2.2.1 Function

    The reduction is stored as a function of uncorrected relative volume as follows:

    q=vol/volmred=f(q)

    vnet=(1-red)*vol

    where

    volm=total moulded volume

    vol=volume at the current filling, as obtained from the geom

    vnet=corrected volume at then current filling

    f(q)=the variable steel reduction.

    This principle is adopted as being the most convenient when applying the correction, especially when trim or heel is non-

    zero. The result is likely to remain useful even if minor changes are made to the geometry. This is the way the steel

    reduction is handled internally. It can be defined directly this way or by giving a local reduction as function of height.

  • 7/30/2019 Capacities (CP)

    18/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    16 (38)

    1992-2009 Napa Ltd. All rights reserved.

    2.2.2 Definition

    The steel reduction is defined in the PAR subtask using command RED. The basic form gives the local reduction as a

    function of z:

    RED comp (z1,red1) ... (zn, redn)

    'comp' is the name of the compartment. z1,z2... are the z-values where the reduction is defined. red1,red2, etc. designate

    the reduction at the given z. Note: the reduction is always given as a fraction (range 0...1). The parentheses are optional.

    The internal form can be given directly this way:

    RED comp I (q1,red1) ... (qn, redn)

    qi=fraction of volume (range=0...1) and 'red' the reduction for the part of the volume in question.

    The 'I' can be read as 'internal' or 'integral'. The function defined this way can be thought of as the integral of the local

    steel reduction defined by the basic form. When given the first form, the integral is generated and the result is stored in

    the latter form. In order to represent the integral with sufficient accuracy, the number of arguments is increased at need

    so that the spacing is at most 1/20 of the height of the compartment.

    If the range given does not cover the whole compartment, it is extrapolated, and a warning is given.

    2.2.3 Alternative definitions

    Alternatively, the definition can be taken from a table containing at least the quantities VOLM and VNET, with VOLM

    increasing. Such a table can be made by the normal LIST command of CP, after which new values for VNET can be

    entered under the TAB task. The command is then

    RED comp TAB*table

    The result is stored as if the reductions had been defined the normal way.

    2.2.4 Storing

    The result is stored under the name RED*comp. It has the form of a table and can be used under table calculation (set

    prefix=RED*). This way it is possible to draw the curve. The steel reduction can be defined initially as a table, provided

    that it has the column VREL (quantity 5344) and RED (quantity 1520).

    2.2.5 Updating

    A steel reduction given in the internal form is independent of the compartment geometry and useful even if the geometry

    is changed. When given a local reduction, the geometry is needed for generating the integral, and there is no automatic

    updating in case of changes in the geometry, therefore the definition must be re-entered under PAR.

    2.2.6 Connection to SM

    The overall steel reduction defined under SM is supposed to coincide with the varying steel reduction at maximum filling.

    There are no automatic transfers between CP and SM, but a warning is given when a compartment is used under CP and

    there is a conflict. The values obtained from SM and CP are shown. At any time, the total reduction from CP can be

    inquired with the service function CP.VARRED, e.g. !CAL CP.VARRED('T10',1).

    In order to restore a fixed reduction, the variable one must be deleted.

    2.2.7 Auxiliary functions

    A catalog of stored steel reduction definitions is obtained with command

  • 7/30/2019 Capacities (CP)

    19/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    17 (38)

    1992-2009 Napa Ltd. All rights reserved.

    CAT RED

    The command obeys the options defined for the general CAT command (see !EXPL CAT/GEN).

    The DES command lists definitions:

    DES RED comp

    This command lists the definition of the reduction defined for the given compartment.

    2.2.8 Example

    The example shows a compartment (R601 of Napaship), where a steel reduction is defined as follows

    RED R601 (1 0.5) (4 0.5) (4 0) (7.2 0)

    In the lower half, the local steel reduction if 50 % (exaggerated for purposes of illustration) and in the upper half it is zero.

    The following figure shows the local steel reduction and the integrated one:

    Local and integrated steel reduction

    From the figure it can be seen that the overall effect is 22 %. This value should be given in SM.

    2.3 Other definitions

    A reference height can be defined in subtask PAR by command

    REFZ comp h

    The default for the reference height is the lowest z-coordinate of the compartment. The reference height defines the

    meaning of argument quantity and result quantity H.

    3 Examples of output macros

    3.1 Sounding table

    The following macro shows a number of possibilities available for handling options and decisions regarding sounding

    tables. The macro is here presented as one text, in practice one might prefer to collect parts of the macro into independent

    parts, allowing these parts to be used in other combinations also.

    Comment: this macro was made before some features of NAPA BASIC were introduced.

  • 7/30/2019 Capacities (CP)

    20/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    18 (38)

    1992-2009 Napa Ltd. All rights reserved.

    100 ** PROG OUTPUT OF SOUNDING TABLE FOR SINGLE COMPARTMENT

    110 !CDE 0120

    130 &ONERR 99999 (finish if error)

    140 ** ----------- various initial assignments ----------

    150 ** store list of sounding devices and corr. headers

    160 &TYPELIST=ARR(3,1111) (string array, 'named' 1111)

    170 &TYPELIST(1)='MS'

    180 &TYPELIST(2)='MU'

    190 &TYPELIST(3)='RS'

    200 &TYPELIST(4)='RU'

    210 &TYPELIST(5)='LS'

    220 &TYPELIST(6)='LU'

    230 &HEADER=ARR(3,1112)240 &HEADER(1)='MANUAL SOUNDING TABLE'

    250 &HEADER(2)='MANUAL ULLAGE TABLE'

    260 &HEADER(3)='REMOTE SOUNDING TABLE'

    270 &HEADER(4)='REMOTE ULLAGE TABLE'

    280 &HEADER(5)='LOCAL SOUNDING TABLE'

    290 &HEADER(6)='LOCAL ULLAGE TABLE'

    300 ** (could be saved as a table under task TAB)

    310

    320 !FORM GSTEP 7.0 CM

    330 !FORM GAUGE 7.0 CM

    340 !FORM H 7.2

    350 !FORM VNET 9.1

    360 !FORM VCORRH 9.2

    370 !FORM MASS 9.1

    380 !FORM CGX 9.2

    390 !FORM CGY 9.2

    400 !FORM CGZ 9.2

    410 !FORM TMY 9.1

    420 !FORM TMX 9.1

    430

    440

    450 &ONERR 970 (restart if error)

    460

    470 ** ------------- get sounding device -----------------

    480 &ADEV=.... sounding device (MS,RS,MU,RU,lS or LU)490 &I=LOCS(TYPELIST,ADEV) identify device

    500 &IF I>0 530

    510 !TYPE Unknown device - give again

    520 &GOTO 480

    530 &GARG='SND'

    540 &IF SBS(ADEV,2,2)='U' &GARG='ULLAGE'

    550

    560 LQ GAUGE(&GARG),

    570 VNET('Trim +1')/1 VNET('Even keel'), VNET('Trim -1')/-1,

    580 VCORRH('Heel S')/-1, VCORRH('Heel P')/1

    590 TOO HD=(S,U, '-', ' ') LMIN=18, SPACE=5,

    600 LNP=(' COMPARTMENT IDENT: %COMP',

    610 ' COMPARTMENT NAME: %SMDES',

    620 ' CONTENTS: %SMPDES', ' ')

    622 ** LNP option: headers for additional pages

  • 7/30/2019 Capacities (CP)

    21/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    19 (38)

    1992-2009 Napa Ltd. All rights reserved.

    630

    640 ** ----------------------------------------------------

    650 &NAME=.... name of compartment, E=end

    660 &IF NAME='E' 1000

    670

    680 COMP &NAME

    690 SDEV &ADEV

    700 &IF SBS(SDEV,2)=ADEV 730

    710 !TYPE device &ADEV not defined for &COMP

    720 &GOTO 470

    730

    740 NL '&HEADER(I)'

    750

    760 ** select GSTEP so that the list fits into two pages

    770 GSTEP 10 -1 1 ;** note the trim range

    780 NARG ;** get number of arguments790 &IF NARG

  • 7/30/2019 Capacities (CP)

    22/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    20 (38)

    1992-2009 Napa Ltd. All rights reserved.

    50 31.9 30.4 28.9 1.16 -1.15

    100 60.6 59.1 57.5 1.21 -1.21

    150 89.4 87.8 86.3 1.21 -1.21

    200 118.1 116.6 115.1 1.21 -1.21

    250 146.9 145.4 143.9 1.21 -1.21

    300 175.7 174.2 172.7 1.21 -1.21

    350 190.6 190.6 190.6 0.00 0.00

    3.2 Listing groups of compartments

    The following example shows the same list as in the first example, repeated for a group of compartments.

    Main macro:

    100 ** PROG - OUTPUT OF SOUNDING TABLE - GROUP

    110 ** This macro makes a sounding table for all compartments

    120 ** with a given type sounding device

    130 !CDE 0

    140

    150 &ONERR 99999

    160 !ADD CP.SND-I

    170 ** (assignments, formats etc. as in the preceding example)

    180

    190 &ADEV=.... sounding device (MS,RS,MU,RU,lS or LU)

    200 &I=LOCS(TYPELIST,ADEV) identify device

    210 &IF I>0 250

    220 !TYPE Unknown device - give again

    230 &GOTO 190240

    250 &GARG='SND'

    260 &IF SBS(ADEV,2,2)='U' &GARG='ULLAGE'

    270

    280 LQ GAUGE(&GARG),

    290 VNET('Trim +1')/1 VNET('Even keel'), VNET('Trim -1')/-1,

    300 VCORRH('Heel S')/-1, VCORRH('Heel P')/1

    310 TOO HD=(S,U, '-', ' ') LMIN=18, SPACE=5,

    320 LNP=(' COMPARTMENT IDENT: %COMP',

    330 ' COMPARTMENT NAME: %SMDES',

    340 ' CONTENTS: %SMPDES', ' ')

    350360 SDEV &ADEV * ;** select device with permanent effect

    370 NL '&HEADER'

    380

    390 SORT CCODE ;** sort according to CCODE

    400 SELECT TYPE=L ;** all compartments with liquid contents

    410 SELECT SDEV>&ADEV ;** subset with device of the given type

    410 ** array CPLIST contains list of selected compartments

    420

    430 ** do the listing for all compartments selected

    440 !DO CP.SND.L NAME=CPLIST

    END OF TEXT

    The macro CP.SND.L, run in the DO command above, contains the following:

    100 ** PROG LISTING COMMANDS FOR SINGLE COMPARTMENT

  • 7/30/2019 Capacities (CP)

    23/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    21 (38)

    1992-2009 Napa Ltd. All rights reserved.

    110

    120 &ONERR 730 (allows main loop to continue if error)

    130

    140 COMP &NAME

    150

    160 ** select GSTEP so that the list fits into two pages

    170 GSTEP 10 -1 1 ;** note the trim range

    180 NARG ;** get number of arguments

    190 &IF NARG0 THEN

    @ONERR NEXT

    COMP @CPLIST(1)

    @ELSE

    @VT=VTYP('COMP')

    @IF VT=0 THEN

    !TYPE No compartment has been selected

    !TYPE Use SELECT crit to select many or COMP to select one

    @GOTO END@ENDIF

    @N=1

    @ENDIF

  • 7/30/2019 Capacities (CP)

    24/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    22 (38)

    1992-2009 Napa Ltd. All rights reserved.

    @IR=LOCS(LISTPAR,'C') @@ Check for argument C

    @IF IR=0 NL 'Compartment tables'

    @LABEL LIST

    NP

    TYPE

    TYPE Compartment ident: @COMP

    TYPE Compartment descr: @SMDES

    TYPE Contents : @SMPDES (@SMPURP, RHO = @SMRHO)

    TYPE

    TYPE Extreme points of comp: Aft end at frame @FMT(FR(SMXMIN),1,7))

    TYPE Fore end at frame @FMT(FR(SMXMAX)),1,7)

    TYPE Lowest point ~

    @FMT((LL(COMP,3)),2,7) m above BL

    TYPE Highest point ~

    @FMT((UL(COMP,3)),2,7) m above BL

    TYPELIST

    @LABEL NEXT

    @IF I=N @GOTO END

    @I=I+1

    COMP @CPLIST(I)

    @GOTO LIST

    @GOTO END

    @LABEL HELP

    !TYPE

    !TYPE Instructions for command LIST .STD

    !TYPE

    !TYPE The listing gives a short header and the basic list for each!TYPE compartment. The contents of the list is controlled by the

    !TYPE arguments and the LQ and TOO. A new list named

    !TYPE 'Compartment tables' is opened unless option C (continue)

    !TYPE is given.

    !TYPE If a selection has been given (command SELECT) all

    !TYPE compartments are listed, else the current one only.

    !TYPE A selection can be cancelled with command SELECT OFF.

    !TYPE

    @LABEL END

    !VAR STD @@ Reset variables and tilde

    Output example.

    Compartment ident: R10

    Compartment descr: Front peak tank

    Contents : DAY TANK (DT, RHO = 0.8)

    Extreme points of comp: Aft end at frame 139.9

    Fore end at frame 152.6

    Lowest point 0.00 m above BL

    Highest point 7.20 m above BL

    ---------------------------------------------------------

    H VNET CGX CGY CGZ AWP CGXA CGYA

    M M3 M M M M2 M M

    ---------------------------------------------------------

    0.00 0.0 95.52 0.00 0.00 2.6 95.61 0.000.50 5.3 97.12 0.00 0.31 17.5 97.47 0.00

    1.00 16.8 97.59 0.00 0.62 26.8 97.75 0.00

  • 7/30/2019 Capacities (CP)

    25/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    23 (38)

    1992-2009 Napa Ltd. All rights reserved.

    1.50 31.7 97.78 0.00 0.92 31.9 97.86 0.00

    2.00 48.8 97.87 0.00 1.20 34.7 97.92 0.00

    2.50 67.1 97.94 0.00 1.48 35.8 97.96 0.00

    3.00 84.7 97.96 0.00 1.75 33.7 97.67 0.00

    3.50 99.8 97.85 0.00 2.00 29.6 97.34 0.00

    4.00 112.6 97.75 0.00 2.20 23.1 96.87 0.00

    4.50 122.8 97.62 0.00 2.36 18.5 96.34 0.00

    5.00 132.5 97.53 0.00 2.53 20.6 96.37 0.00

    5.50 144.0 97.44 0.00 2.76 27.1 96.54 0.00

    6.00 159.7 97.42 0.00 3.07 34.8 96.71 0.00

    6.50 180.0 97.38 0.00 3.43 43.1 96.86 0.00

    7.00 203.8 97.34 0.00 3.82 51.3 96.96 0.00

    7.20 214.8 97.33 0.00 3.94 0.0 96.96 0.00

    ---------------------------------------------------------

    3.4 Example of plotting

    This example is a macro intended to be used with the PLOT .macro command. It uses a figure named PLD1, containing

    a number of text fields. After the listing, an example of output and the corresponding PQ/POO are given.

    @@ Basic plotting, use 'PLOT .STD ?' for help

    @ECHO OFF

    !VAR @

    !VAR TILDE ~

    @I=1

    @IR=LOCS(LISTPAR,'?')

    @IF IR>0 @GOTO HELP@ONERR END

    @VT=VTYP('CPLIST')

    @N=0

    @IF VT>0 @N=RSIZE(CPLIST)

    @IF N>0 THEN

    @N=RSIZE(CPLIST)

    @ONERR NEXT

    COMP @CPLIST(1)

    @ELSE

    @VT=VTYP('COMP')

    @IF VT=0 THEN

    !TYPE no compartment has been selected

    !TYPE Use SELECT to select many or GET name to select one

    @GOTO END

    @ENDIF

    @N=1

    @ENDIF

    @IR=LOCS(LISTPAR,'C')

    @IF IR=0 DR;DRAWING 'TANK_DIAG';END;

    @LABEL LIST

    PLD POO SUB, NAME=@COMP, FIG=PLD1,

    T2='Compartment ident: @COMP',

    T3='Compartment descr: @SMDES',

    T4='Contents : @SMPDES (@SMPURP, RHO = @SMRHO)',

    T11='TANK DIAGRAM',T14=' @DTX(DT)',

    T15=' @DTX(TM)',

    T16=' @DTX(YCN)',

  • 7/30/2019 Capacities (CP)

    26/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    24 (38)

    1992-2009 Napa Ltd. All rights reserved.

    T17=' @DTX(SGN)',

    T18=' @DTX(PRV)'

    @LABEL NEXT

    @IF I=N @GOTO END

    @I=I+1

    COMP @CPLIST(I)

    @GOTO LIST

    @LABEL HELP

    !TYPE Instructions for command PLOT .STD

    !TYPE

    !TYPE The command creates a PLD drawing for each tank selected,

    !TYPE as subdrawings to the main drawing TANK_DIAG. An option C

    !TYPE (as in continue) causes the macro not to create a new drawing

    !TYPE but continue to add subdrawings to the current one.

    !TYPE

    !TYPE If a selection has been given (SELECT) all compartments!TYPE are plotted, else the current one only.

    !TYPE A selection can be cancelled with command SELECT OFF.

    @LABEL END

    !VAR STD

    Output example:

    Tank diagram

    The example was made with the following plot quantities (PQ) and plot options (POO):

    PQ CP, H, VOLM, CGX, TMY, (CGZ)

    POO CP, BOX, VA, LGTEXT=S, LEGEND, LGTYPE=IL, LGH=*1.1,

    NET=P2021, SMOOTH,

    ARG: AXIS=LB,

  • 7/30/2019 Capacities (CP)

    27/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    25 (38)

    1992-2009 Napa Ltd. All rights reserved.

    F1: AXIS=LB, PEN=A1,

    F2: AXIS=UA, PEN=A2, SCALE=(F1),

    F3: AXIS=UL, PEN=A3, SCALE=(F1),

    F4: AXIS=LA, PEN=A4, SCALE=(F1),

    CGX: SCALE=OFF, RMARG=1,

    ARG: NOM=CGZ, NAXIS=UA

    This set of options is designed to produce a reasonable plot with up to four freely selected quantities in the PQ.

    4 Commands and service functions

    4.1 Main task

    ADD additional argument values

    This command adds depth arguments to those obtained from the main argument (STEP,H,GAUGE

    or GSTEP, not VOL or VSTEP).

    ADD value, value, ...

    Directly given values. These are cancelled when giving a new main argument or changing

    compartment.

    value: additional depth argument values, interpreted as the same quantity as the current main argument,

    and in the same unit. An asterisk as prefix means a discontinuity, and two values are added, one on

    either side of the given one.

    ADD TE

    'Tube end', add the end of the sounding tube when generating gauges from the GSTEP argument.

    ADD GMAX

    Add the value corresponding to maximum fill to the gauges obtained from GSTEP, taking into

    account current trim and heel.

    ADD STEPS

    Add steps in the volume=f(depth) curve to the arguments. This alternative is available for H and

    STEP arguments only.

    ADD OFF

    Cancels previous ADD commands.

    If many different types of ADD's are given, they have

    to be given in different ADD commands. An ADD

    command of a different type will not make the previous ones

    inactive.

    ARGS list arguments

    This command lists the current calculation arguments in the form used for input. A short

    explanation is added as comment.

    ARR select arrangement

  • 7/30/2019 Capacities (CP)

    28/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    26 (38)

    1992-2009 Napa Ltd. All rights reserved.

    This command selects the arrangement to be used as source of compartment data. Default is the

    one registered as permanent or (if defined) a subset named by adding prefix LD (as under LOAD).

    ARR id

    id: name of arrangement

    CNV convert old device definitions

    This command permanently converts sounding device definitions from the old format to the new

    one. Old=older than rel. 87.

    CNV OLD

    COMP select compartment

    This command selects the compartment to be calculated. If the compartment belongs to the currentarrangement, the density of the contents (argument RHO) and the steel reduction (RED) are

    assigned. A sounding devices is selected, if any (first one or as spec. with command SDEV ... *).

    The compartment name is stored in the variable 'COMP'. If it belongs to the current arrangement,

    the main parameters are stored in variables SMPURP=purpose, SMVOL=volume etc. (see

    documents).

    COMP name

    name: name of compartment

    DMODE control listing of dummy values

    This argument controls the way undefined or redundant values are listed.

    DMODE option

    option: string containing one or several of the following characters (other characters ignored):

    V: replace redundant volumes (and areas) with space or minus

    G: replace undefined centers of gravities with space or minus

    S: use space (instead of minus) for dummy values

    EXAMPLE

    DMODE VGS

    DR -> enter drawing task

    The standard drawing task is entered. Return to CP is done with command CP or OK.

    EDIT -> enter editor

    END finish the task

    FIG add figure to the list

    See !EXPL FIG/GEN

    FILL depth argument as filling

  • 7/30/2019 Capacities (CP)

    29/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    27 (38)

    1992-2009 Napa Ltd. All rights reserved.

    The calculation depths are expressed as filling i.e. fraction of total volume. Effect of varying steel

    reduction not taken into account.

    FILL values

    FSTEP depth argument as filling. equal spacing

    As FILL, but the values are selected as a multiple of the given step.

    FSTEP step

    GAUGE sounding device readings (argument)

    This command defines the calculation heights by sounding values. A subsequent COMP or SDEV

    command will cancel the values set with this command (assumed no longer relevant).

    GAUGE values

    values: sounding values in the standard form

    GET get compartment

    Synonym for COMP. With parameter OLD, device definitions in the old format are converted to

    the new one for the duration of this task (see also CNV OLD).

    GSTEP step for sounding device argument

    This command defines sounding arguments by a step. The arguments will be selected in the range

    covered by the heights of the tank and the sounding device. See also argument TRRANGE.

    GSTEP step trimrange

    step: value of step

    trimrange: (opt) old form of giving the trim range, replaced by argument TRRANGE.

    H calculation heights

    This command specifies calculation depths by heights measured from the reference height (see

    command REFZ). The H quantity is well defined only when the ship is upright (trim=0, heel=0).

    H values

    values: set of values in the standard form

    HEEL calculation heel

    This command defines the calculation heel. Default=zero. NOTE: quantities FSM and VCORRH

    should normally be calculated with initial heel 0 (=the HEEL argument), while the additional heel

    argument needed is given as qualifier in the LQ (see !EXPL LQ).

    HEEL heel

    LF add line feeds

    This command adds empty lines, either a specified number or until a specified position on the

    page, see !EXPL LF/GEN.

    LIST start listing

  • 7/30/2019 Capacities (CP)

    30/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    28 (38)

    1992-2009 Napa Ltd. All rights reserved.

    This command starts various listings.

    LIST CP t-options

    This gives the basic list. The quantities to be listed are specified by command LQ. CP is default if

    no argument is given in the command.

    t-options: standard table output options, see !EXPL TOO/GEN

    LIST REF/OBJ/EXP

    List various background data, REF=referenc system, OBJ=current hull object, EXP=explanations

    of quantities.

    LIST .id

    List according to standard macro. For alternatives, use LIST .CAT.

    LQ select output quantities

    This command selects the quantities included in output started with LIST CP (or bare LIST). For

    full instructions on the LQ command, use !EXPL LQ/GEN.

    A numeric qualifier (not zero) is taken into account

    in the following cases: Centers of gravity:

    reference coordinate (default 0) Volumes

    and weight: trim value, e.g. VOLM/1

    SCORRT,VCORRT: trim SCORRH,VCORRH:

    heeling FSM: heeling

    The following string qualifiers can be used:

    Volumes and weight: trim and/or heel, using

    symbols T and H,

    followed by a value, e.g.

    VOLM/T1 VOLM/T1H5 VOLM/H1 GAUGE:

    R=reverse, convert sounding to ullage or vice

    versa. Only when argument=gauge or

    gstep and the current

    device is a tube. With subject SM (i.e. LQ SM ...)

    the LQ command concerns the listing with SML.

    NARG number of depth arguments

    The number of depths (=data lines in the table) is listed and stored in variable NARG.

    NL new list

    This command can be used to start a new list or specify parameters of the list. See !EXPL NL/

    GEN. Default for the list name is 'TANK TABLES'.

    NP new page

    This command causes the result listing to continue on a new page.

    PAR -> definition of sounding devices ao

    In this subtask, various permanent definitions related to NCP are made, e.g. sounding devices aredefined in this task.

  • 7/30/2019 Capacities (CP)

    31/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    29 (38)

    1992-2009 Napa Ltd. All rights reserved.

    PLD draw diagram

    This command draws a diagram showing the quantities selected with command PQ and using the

    options set by command POO.

    PLD POO plot-options

    plot-options: (opt) standard plot options, see !EXP PLD/GEN. If this part is given, the keyword POO must be

    added.

    PLOT run plot macro

    This command runs plot created as a macro,

    PLOT .macro options

    macro: name of macro (complete name PLOTCP.macro). .CAT gives catalog.

    POO set plot output options

    This command handles plot output options for diagrams drawn with command PLD. For the

    syntax of the POO command, see !EXPL POO/GEN.

    PQ select quantities for diagram

    This command selects the quantities to be output graphically using command PLD. The first

    quantity in the list is used as the argument. The available quantities and the meaning of qualifiers

    are the same is in command LQ. For the general syntax of the PQ command, see !EXPL LQ/GEN.

    RED set steel reduction

    The steel reduction is used for calculating net volume and weight of contents. When selecting a

    compartment, the steel reduction is set to the value defined in the arrangement, if any, otherwise 0.

    RED value

    REFZ reference height for calculation heights

    This command defines the reference height from which the calculation heights given by H are

    counted. When a new compartment is read, REFZ is set to the reference height defined for it, if

    any, otherwise the lowest z-coordinate of the tank.

    REFZ h *

    h: new ref. height

    *: (opt) makes the height valid for subsequent comppartments also. This option is cancelled with

    REFZ -.

    RHO set density of contents

    The density of contents is used if weights or free surface moments are calculated. When selecting

    a compartment, the density is set to the value defined in the arrangement, if any, otherwise 1.

    RHO rho

    SCAN -> enter list scanner

  • 7/30/2019 Capacities (CP)

    32/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    30 (38)

    1992-2009 Napa Ltd. All rights reserved.

    For more details, see !EXPL SCAN/GEN. SCAN SEND just sends the current result list to the

    printer. Note: the current result list closed.

    SDEV select sounding device

    This command selects the sounding device for the current compartment or a default for subsequent

    compartments.

    SDEV type/id *

    type: type of device (MS,MU,RS,RU,LS or LU)

    /id: (opt) additional identifier

    *: (opt) this option makes the selection default for subsequent COMP selections. Without this option,

    the effect concerns the current compartment only.

    SELECT select compartments

    This command selects a subset of compartments using the a selection criterion based on the

    compartment parameters (e.g. NAME, PURP, TYPE, CLASS, XMIN etc). The selection is stored

    in the calculator array CPLIST, which can be listed with !VAR LIST CPLIST. A preceding SORT

    command controls the order in the list. See also the second form.

    SELECT criterion

    criterion: selection criterion in the standard form (see !EXPL SEL/GEN), based on compartment parameters.

    EXAMPLES

    SELECT PURP=HFO

    SELECT NAME>T TYPE=L

    SELECT device-crit

    This form selects a subset based on sounding devices. A select from the arrangement (previous

    form) must first be made. The preceding selection is restricted to those compartments having a

    sounding device of the specified type.

    device-crit: criterion concerning sounding devices

    SDEV=type: select with given type and empty id. 'type'=MS,RS, RS,RU,LR,LU or

    only M, R or L.

    SDEV=type/id: select with given type and id.

    SDEV>type: select with given type and unspecified id.

    SDEV

  • 7/30/2019 Capacities (CP)

    33/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    31 (38)

    1992-2009 Napa Ltd. All rights reserved.

    This command specifies sorting that affects the result of the SELECT command. For sorting the

    output of SML, use TOO SM ...

    SORT qnt -

    qnt: quantity to be sorted, e.g. NAME, PURP, XMIN.

    -: (opt) make the sorting is descending order

    STEP calculation step

    This command defines the calculation heights by specifying a step. The calculation heights are

    selected at multiples of the step within the range covered by the compartment.

    STEP step

    TABLE -> enter table calulation

    The command gives access to the table calculation task, to which CP data can be transferred by

    generating a table with the table output option TABLE.

    TOO set table output options

    This is the standard command for setting table output options for controlling the layout of the

    listing with LIST (subject CP) or SML (subject SM). See !EXPL TOO/GEN.

    TR calculation trim

    See !EXPL TRI.

    TRIM calculation trim

    This command defines the calculation trim. Default is zero trim. Note that the trim argument can

    be overridden for given quantities by qualifiers in the LQ.

    TRRANGE trimrange for applying GSTEP

    The command defines a trim range, taken into account when deciding the range from which gauge

    readings are selected when applying the GSTEP argument.

    TRRANGE trmin trmax

    trmin,trmax: lowest,highest trim in the range

    TRRANGE OFF

    Cancel the TRRANGE argument.

    (The old syntax GSTEP trmin trmax is still available).

    TYPE print line

    This is the standard TYPE command for adding arbitrary text to the list, see !EXPL TYPE/GEN.

    VOL depth argument via volume

    This command selects the depth argument so that specified (net) volumes are obtained.

    VOL volumes

  • 7/30/2019 Capacities (CP)

    34/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    32 (38)

    1992-2009 Napa Ltd. All rights reserved.

    volumes: set of volumes

    VSTEP depth argument as volume step

    This command selects the depth argument so that (net) volumes are obtained as multiples of the

    given step.

    VSTEP step

    vstep: volume step

    WLS waterline section mode on/off

    The command specifies whether quantities related to the surface area should be calculated by

    doing sections from the object or by using the calculation sections.

    WLS ON/OFF

    ON: waterline section mode ON: generate sections for calculating the area related quantities. This

    alternative is more accurate, but is slower and involves the risk for failed sections.

    OFF: standard method, use the calculation sections.

    4.1.1 Subtask PAR

    CATALOG catalog of sounding devices

    A list of sounding devices of the project is produced. The names listed are stored in an array

    named DEVLIST. CAT RED gives a catalog of all tanks having a variable steel reduction defined.

    DELETE deleting from the data base.

    This command deletes a sounding device or a steel reduction definition.

    DELETE DEV comp type/id

    comp: identification of compartment

    type/id: identifier of the sounding device as in command DEV

    DELETE RED comp

    Delete the steel reduction defined for the compartment.

    EXAMPLE

    DELETE DEV T120 MS/NN

    DES a description of definition data

    DES DEV comp type

    A definition list of sounding devices of the given compartment

    comp: name of compartment

    type: (opt) list only devices of the given type (MS...RU).

    DES DEV array() type

  • 7/30/2019 Capacities (CP)

    35/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    33 (38)

    1992-2009 Napa Ltd. All rights reserved.

    Repeat the operation for all names in the given array. DES DEV *; is shorthand for CAT;DES

    DEV DEVLIST() and gives the result for all tanks in the arrangement.

    type: (opt) list only devices of the given type (MS...RU).

    DES OLD comp

    A definition list of old sounding devices of the given compartment.

    comp: identification of compartment

    DES RED comp

    Display the definition of the steel reduction for the given compartment.

    DEVICE entering or updating of sounding devices

    This command redefines or adds a sounding device for a given tank.

    DEVICE comp id/name curve h

    This form defines a manual sounding device, where the soundings are formed by lengths measured

    along a tube.

    comp: name of tank to which it belongs

    id: type of device: MS=manual sounding or MU=manual ullage.

    /name: (opt) name of device. Must be given when there are several devices of the same type in one

    compartment.

    curve: definition of the geometry of the tube, either directly or by reference to a space curve:

    name: name of space curve

    (x1,y1,z1),

    (x2,y2,z2)...:

    curve defined by points in space

    h: (opt) height of zero point (MS only). Defines the point from which soundings are measured,

    default=startpoint of curve. h is measured in meters from the baseline, and has to be above the

    lower end of the pipe.

    EXAMPLES

    DEV T102 MS (#BH1+0.2 2 #TTOP) (#BH1+0.2 4 #TTOP+5),

    (#BH1+.02 4 #DECK1+0.4)

    DEV T102 MS/F MS-T102 4.5

    DEVICE comp id/name (x,y,z) h

    Defines a remote sounding device, i.e. device measuring the orthogonal distance to the liquid

    surface.

    comp: as above

    id: type of device, RS=remote sounding, RU=remote ullage. For administrative purposes, the symbols

    LS and LU can be used instead of RS,RU.

    /name: (opt) as above

    (x,y,z): location of probe (point in space).

  • 7/30/2019 Capacities (CP)

    36/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    34 (38)

    1992-2009 Napa Ltd. All rights reserved.

    h: (opt) height correction, actual value-displayed value, default=0.

    EXAMPLE

    DEV T102 RS (#BH1+2, 0, #TTOP+0.1) 0.1

    DEVICE comp DS/name (x,y,z) h

    Defines a dip sounding device, i.e device measuring the immersed part of a line lowered from a

    fixed point to the tank bottom.

    comp: as above

    name: as above

    (x,y,z): point from which the line is lowered

    h: height of tank bottom (or place where the dip touches the bottom)

    EDIT enter editor

    This command is in all respects equivalent with DES, except that the result is stored in the editor

    work area and the editor is started. Within the editor, all editor commands are available, including

    SAVE and REPLACE. Exit from the editor can take place the normal way (END, OMIT), or by

    using the command ADD, in which case the contents of the work area will be run as in *ADD.

    When EDIT is given without parameters, the editor is entered using the current contents of the

    work area.

    EDIT DEV comp

    comp: identification of compartment

    END end of device definition

    END

    This record finishes the task and returns control to CP

    OK end of device definition

    OK

    This record finishes the task and returns control to CP

    REDUCTION define variable steel reduction

    This command defines a steel reduction that varies with the filling. It is applied in the CP task

    only. See also commands DEL, DES and CAT.

    RED name (z1,r1) (z2,r2), ...

    Defines local reduction as function of height

    name: name of compartment

    z1,z2: heights from the baseline

    r1,r2: corresponding LOCAL steel reduction, i.e. fraction of the area at the given height.

    RED name I (f1,r1) (f1,r2), ...

    Defines integrated reduction as function of filling degree.

  • 7/30/2019 Capacities (CP)

    37/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    35 (38)

    1992-2009 Napa Ltd. All rights reserved.

    name: name of compartment

    f1,f2: filling degree (0...1)

    r1,r2: corresponding steel reduction, as fraction of VOLUME

    RED name TAB*table

    Use the given table as source for the steel reduction. The table must contain at least columns

    VOLM and VNET, and the volumes must be sorted in increasing order.

    ZREF bottom reference height of tank

    ZREF t

    t: height from baseline

    4.2 Service functions

    CP.DEVICES() sounding devices of compartment

    The function stores the sounding devices defined for a compartment in an array. The function

    value is the number of devices defined.

    CP.DEVICES(comp,array,filter)

    comp: name of compartment

    array: array for storing the result. Previous contents are removed.

    filter: (opt) restricts the devices returned by a criterion expressed by a filter (see !EXP WILD/GEN)

    list=CP.DEVICES(comp,filter)

    As above, but the result array is reserved internally. it will be reused at the next call.

    EXAMPLES

    @DEVLIST=ARR(3)

    @N=CP.DEVICES('R10',DEVLIST)

    The contents of DEVLIST could be 'MS', 'MS/V1', 'RS'.

    CP.GAUGE() convert draught to gauge reading

    The function returns the gauge reading corresponding to a filling height expressed by draught. The

    reverse function is done by CP.T.

    CP.GAUGE(comp,device,t,trim,heel)

    comp: name of compartment

    device: sounding device (MS, RS etc). For local definition, see CP.VOLG.

    T: draught

    trim: (opt) trim (m), default=0

    heel: (opt) heel,degrees, default 0

    EXAMPLE

  • 7/30/2019 Capacities (CP)

    38/40

  • 7/30/2019 Capacities (CP)

    39/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    37 (38)

    1992-2009 Napa Ltd. All rights reserved.

    CP.VOLG() convert gauge reading to volume

    The function returns the volume corresponding to a gauge reading. The reverse function is done by

    CP.GVOL.

    CP.VOLG(comp,device,gauge,trim,heel,red,opt)

    Parameters can be omitted from the end.

    comp: name of compartment

    device:

    id: sounding device, given by its name (MS, RS etc)

    arr: real array containing the elements type, h, x, y, z [x y z ...] where H and

    the coordianates correspond to the parameters given in PAR/CP and 'type'

    gives the type: 1=MS, 2=MU, 3=RS, 4=RU, 5=DS.

    gauge: gauge reading, m

    trim: (opt) trim, m, default=0

    heel: (opt) heel, degrees, default 0

    red: (opt) steel reduction, default=no steel reduction

    value: explicit value as a fraction (0...1), default=0

    SM: the value defined in SM. 0 if not defined.

    V: the value obtained from the varying steel reduction (as defined by RED in

    subtask PAR of CP). Same as SM if not defined.

    opt: options

    I: trim, heel in internal units

    S: silent, make no error messages for missing devices

    EXAMPLE

    CP.VOLG('R10','MS',0.52)

    Return the moulded volume when the reading of MS is 0.52.

    CP.VOLG('R10','MS',0.52,0,0,'V')

    Return the net volume when the reading of MS is 0.52, applying the varible steel reduction.

    CP.GEOM() device geometry

    This function returns the geometry of a sounding device as a curve or point object or as three

    coordinates only. The result is returned as the function value (reference number to a curve, point

    object or calculator array).

    p=CP.GEOM(comp,device)

    Return coordinates of the device (endpoint if manual one) in the array p. NOTE: if the call is

    repeated, the same array is reused.

    comp: name of compartment

    device: sounding device (MS, RS, MS/id etc)

  • 7/30/2019 Capacities (CP)

    40/40

    NAPA Online Manuals 2009.1

    Capacities (CP)

    38 (38)

    obj=CP.GEOM(comp,device,name)

    A above, but return a curve or point object.

    name: name of the result. A curve is returned for a manual device (RU,RS) and a point object for others.

    NOTE: the curve is not stored in the data base (can be done with the DB.WRITE function).

    EXAMPLES

    @p=cp.geom('T10','RS/D1')

    !type Device RS/D1 located at x=@p(1) y=@p(2) z=@p(3)

    @cur=cp.geom('T10','MS','TUBE')

    PLOT TUBE

    @l=length(cur)

    CP.VARRED() get variable steel reduction

    The function returns the steel reduction valid for a specified filling of a given tank, when applying

    the definition given by RED in subtask PAR of CP. If there is no variable steel reduction defined,

    the fixed one from SM is returned with a warning,

    red=CP.VARRED(comp,fill)

    comp: name of compartment

    fill: (opt) filling degree, either as a fraction (value1). Default=1.

    CP.PARCOMMAND()run command of subtask PAR

    This function runs any command available in the subtask PAR of CP, mainly definitions related to

    sounding devices.

    CP.PARCOMMAND(command)

    command: string representing the command to be run. Double apostrophes are converted to single ones and

    upper case conversion done as in normal commands.

    CP.PARCOMMAND(id,parameters)

    As above, but the command identifier is given separately.

    id: command identifier

    parameters: string containing the parameters.

    CP.PARCOMMAND(id,arr)

    As above, but the parameters are fed by an array.