$
$*********************************************      set devices
$
&title Test of Basic Compartment Commands
&dimen -dimen feet kips
&device   -oecho no  -g_default device
$
$*********************************************      read model
$
inmodel
&instate -loc 10 10 -10
$
$*********************************************      compart picture
$
&pict top -type compart
$
$*********************************************      piece summary
$
&summ
    compart prop pie e_piece
end
$
$*********************************************      test draft marks
$
&status draft
$
$*********************************************      test d_compartment
$
&status d_compartment
$
$*********************************************      downflooding
$
&cutype Testing Down-Flooding
&type Body MIN_DOWN       &body(MIN_WT_DOWN       barge  )
&type Body MIN_NWT_DOWN   &body(MIN_NWT_DOWN       barge )
&type Comp MIN_DOWN       &compartment(@ -MIN_WT_DOWN    )
&type Comp MIN_NWT_DOWN   &compartment(@ -MIN_NWT_DOWN   )
&status down
&compart -flood @
&type Body Flooded MIN_DOWN       &body(MIN_WT_DOWN       barge )
&type Body Flooded MIN_NWT_DOWN   &body(MIN_NWT_DOWN       barge)
&type Comp Flooded MIN_DOWN       &compartment(@ -MIN_WT_DOWN   )
&type Comp Flooded MIN_NWT_DOWN   &compartment(@ -MIN_NWT_DOWN  )
&compart -no_flood @
&status down -compartment barge
&status nwt_down -compartmentar @
$
$*********************************************      test string function
$
&weight  -define 10000 200 0 20 22 50 50
st_cmp
&type defwt string funct &body(defwt barge) &body(defwt_cg barge)
&weight -compute 20 32 97  97
st_cmp
&compartment -app_none -percent @ 50
&status compartment
&cutype Testing String Function
&type func -PART         &compart(@ -PART       )
&type func -HOLES        &compart(@ -HOLES      )
&type func -PIECES       &compart(@ -PIECES     )
&type func -F_TYPE       &compart(@ -F_TYPE     )
&type func -MIN_WT_      &compart(@ -MIN_WT_    )
&type func -MIN_NWT      &compart(@ -MIN_NWT    )
&type func -MIN_DOW      &compart(@ -MIN_DOW    )
&type func -PERCENT      &compart(@ -PERCENT    )
&type func -MAX_PERCENT  &compart(@ -MAX_PERCENT)
&type func -AMOUNT       &compart(@ -AMOUNT     )
&type func -MAX_AMOUNT   &compart(@ -MAX_AMOUNT )
&type func -SOUNDIN      &compart(@ -SOUNDIN    )
&type func -ULLAGE       &compart(@ -ULLAGE     )
&type func -MAX_AMO      &compart(@ -MAX_AMO    )
&type func -CG           &compart(@ -CG         )
&type func -FULL_CG      &compart(@ -FULL_CG    )
&type func -CG_DERI      &compart(@ -CG_DERI    )
&type func -FS_MOME      &compart(@ -FS_MOME    )
&type func -MAX_DHE      &compart(@ -MAX_DHE    )
&type func -PRESSUR      &compart(@ -PRESSUR    )
&type func -FLOW_RA      &compart(@ -FLOW_RA    )
&status note
&names dmark
st_cmp
$
$*********************************************      test changing type
$
&compartment -approximate @
st_cmp
$
$*********************************************      test basic ballasting
$
&instate -con 10 0 1
&weight -compute
&compartment -fraction @ .25
st_cmp
$
$*********************************************      test &cmp_bal
$
&cmp_bal barge @
st_cmp
&compart -perc @ 000 
&cmp_bal barge -limits 0 45 tanks1 tankp2 -limits 55 100 tanks2 tankp1
st_cmp
$
$*********************************************      test sounding
$
$&compartment -sounding @ 10
$st_cmp
$&compartment -sounding @ 20
$st_cmp
$&compartment -sounding @ 00
$st_cmp
$
$*********************************************      test -open_valve
$
&instate -con 10 0 0
&compartment -open_valve -percent @ 100 .75*1.028
st_cmp
&compartment -open_valve -percent @ 100 1.028
st_cmp
$
$*********************************************      test -correct
$
&instate -con 10 0 1.5
&compartment -correct -percent tank@1 100 -percent tank@2 50
st_cmp -f
&compartment -correct -percent @ 50
st_cmp  -f
&cmp_bal barge @
st_cmp -f
$
$*********************************************      test -flood
$
&compartment -flood @
st_cmp -f
&compartment -no_flood @
st_cmp -f
$
$*********************************************      &weight  -compute
$
&instate -con 10 0 1
&compartment -fraction @ 1. -flood tank@1
&weight -compute
st_cmp
$
$*********************************************      &weight  -total
$
&weight -total 34542.0  217.35 0.00 0.94 1 1 1
st_cmp
$
$*********************************************      test -addit
$
&compartment -approximate -percen @ 25
st_cmp
&compartment -approximate tankp1 tankp2 tanks1 tanks2 \
             -additional -percen tankp1 25 1.028*2    \
             -additional -percen tankp2 25 1.028*2    \
             -additional -percen tanks1 25 1.028*2    \
             -additional -percen tanks2 25 1.028*2
st_cmp
$
$*********************************************      tide
$
&instate -con 0
&pict side -type default
&env -tide 25
&pict side
$
$*********************************************      test full
$
&env -tide 00
&instate -con 10
&compartment -correct -percen @ 5.99
&weight -compute 10
st_cmp
&compartment -correct -percen @ 6.01
&weight -compute 10
st_cmp
$
$*********************************************      all done
$
&fini
