Apparent "bug in the software"


I have a bug. Im possibly just doing something stupid in the file set up. But it may also be down top my use of the double exponential.

The message I get after -e is:

Source File: C:\apps\swarm\workspace\workspace\casal2-windows-installer\CASAL2\source\Selectivities\Selectivity.cpp(line: 55)
Source Method: Validate

The current partition_type is not recognized for this selectivity. It is not length or age
NOTE: This error is a bug in the software. Please contact the application developers at

NOTE: 164 other errors have been logged above

Any ideas?

It looks like the error is related to how the model is defined or how the selectivity is defined in the “@selectivity” block. See the file and line number specified in the error..

Can you paste the “@model” and “@selectivity” blocks of your model specification files into a comment as Discourse allows attaching image files only?

After looking at the input files, there are several sets of errors. Most of the errors are generated by having observations with length bins and not specifying length bins for the population in the “@model” block.

Other errors have information on where to look, e.g. “At line 179 in population.csl2 the following required parameters for the block @selectivity are required but have not been defined: x1 x2” and “At line 133 in observation.csl2 the table obs : obs sum total (1.003) for year (1997) exceeds tolerance (0.001) from 1.0”.

Please post any further errors after editing your model input files.

Thanks Teresa,

The need for specifying model length bins wasnt apparent from the manual, although there were included in the example, and the orange roughy test case.

Can I suggest that the manual be changed, at least on page 92, or in section 4 on the partition, which says length_bins needs to be added under @model if length composition data are used. It should also note that (I assume?) the length_bins under @model have to cover at least the length ranges seen across all observations. Will post more as I investigate further.

Perhaps add to the manual, on page 61, what reasonable defaults for the non-estimable x1 and x2 parameters on the double exponential might be? I would assume the min and max ages in the partition would be the “default”. I dont know what would happen if x1>min age and x2<max age, any idea? What would the model do outside of that range (assume zero selectivity?). I may test this when I get a chance.

Ok, Im getting closer.
I dont know if you can see the screen grab i tried to attach?

I am getting NaN gradients. I have made an error somewhere, I assume.
Any ideas?