2.2.1. The ModelUnit element¶
The top-level element information item in a Crop2ML model unit infoset MUST be referred to as the ModelUnit element.
<?xml version="1.0" encoding= ?> (1)
<!DOCTYPE ModelUnit PUBLIC " " "https://raw.githubusercontent.com/AgriculturalModelExchangeInitiative/crop2ml/master/ModelUnit.dtd"> (2)
<ModelUnit modelid=" " timestep=" " name=" " version=""> (3)
....
</ModelUnit>
(1) XML header with version 1.0 and “utf-8” encoding(2) External DTD declaration in the file
A
ModelUnitelement MUST contain aname, amodelid, aversionattributes. (3)The value of the
nameattribute must obey a number of constraints
See the constraints
The ModelUnit is the highest level in the Crop2ML model file, not including the opening xml tags.
A Crop2ML name attribute must obey some constraints:
it starts by a letter
It is a single word
Only alphanumeric characters and underscore characters
eg: name: CropHeatFlux or crop_heat_flux (valid names),
name: crop-heat-flux or 1cropheatflux (not valid names)
It MUST NOT be a keyword of any programming language
These are valid Crop2ML name attributes:
myNameis valid (both cases are permitted),
my_other_valid_nameis valid (underscores are permitted), and
this1toois valid (numerals 0-9 are permitted).
These are not valid Crop2ML name attributes:
my invalid nameis not valid (spaces are not permitted),
thisIsInvalidToo!is not valid (special characters other than the underscore_are not permitted),
1amNotValidEitheris not valid (must not begin with a number), and
" "empty string is not valid (a name must be present).
lambdais not valid (language keyword not permitted).
The value of the
modelidattribute MUST ensure the provenance of the model. It is composed by an identifier of the platform and model package that provides the model and the name of the model unit separated by a dot. It is used to reference the model elsewhere and must be an unique identifier.Eg. SQ.EnergyBalance.CropHeatFlux where SQ.EnergyBalance means that it is a strategy of Energy Balance component of SiriusQuality (SQ) model and CropHeatFlux the name of the model unit
The value of the
versioncorresponds to a state of evolution of the model unit. It is defined by numbering.
A
ModelUnitelement MAY contain atimestepattribute. Without this attribute, a time step of one day is considered.A
ModelUnitelement MUST contain one additional specific element child:
A
Descriptionelement;An
Inputselement;An
Outputselement;A
ParameterSetselement;A
TestSetselementA
ModelUnitelement MUST contain one or moreAlgorithmelement childrenA
ModelUnitelement MAY contain oneInitializationelement childrenA
ModelUnitelement MAY contain one or moreFunctionelement children