`RUN FILE BY S.DARDEL/ NDAR AUG 2015:

`ILLUSTRATING THE USE OF IF:

`ASSIGNS DIFFERENT LIMIT CRITERIA SETS

`DEPENDING ON STATE OF INTACT/ FLOODED (VARIABLE DAMSTATE)

 

clear

 

proj IFDAMAG

 

VARIABLE DSTATE

 

MACRO INTACT

limit off

LIM title IMO MSC(85)26 INTACT

LIM AREA FROM EQUIL TO 30  > 0.055       `m.radians

LIM AREA FROM EQUIL TO 40 OR FLD > 0.09  `m.radians

LIM AREA FROM 30 TO 40 OR FLD > 0.03

LIM RA AT 30 > 0.2     `m

LIM ANGLE FROM EQUIL TO MAX > 25    `deg

LIM GM UPRIGHT > 0.15   `m

/

 

MACRO DAMAG

limit off

LIM title DAMAGED CRITERIA

lim absolute angle at equil       <  7   'deg

lim angle from EQUIL to fld or ra0    > 15   'deg

lim RA                            > 0.1   'm

lim area from EQUIL to fld or ra0     > 0.015 'm.rad

/

 

READ TANKER.GF

DRAFT 5

SO WEIGHT LCG

VCG 5.5

 

MACRO CHECKRA

STATUS

IF {DAMSTATE} = 0 THEN SET DSTATE = "INTACT" ELSE SET DSTATE = "DAMAGED"

IF {DAMSTATE} = 0 THEN .INTACT ELSE .DAMAG

RAH /LIM:ATT

\\\REMARK:\

\Ship is in {2}{DSTATE}{7} state\

\and variable DAMSTATE = {4}{DAMSTATE}{7}\

/

 

KEY OFF

KEY 8 "load (*) edit|" "LOAD EDIT"

KEY 9 .CHECKRA| "CHECK RA"

key