Tools for converting legacy AquaCrop project files to the AquaCrop 7.3 project layout.
- Web interface: https://agrodt.github.io/aquacrop-converter/
- CLI package:
@agrodt/aquacrop-converter
- Reads AquaCrop projects from ZIP archives or a set of selected files.
- Detects the project version and inspects referenced climate, crop, soil, and other input files.
- Converts supported AquaCrop 5.x, 6.x, and 6.1 projects to the AquaCrop 7.3 layout.
- Generates the matching AquaCrop 7.3 program-parameter file.
- Packages existing AquaCrop 7.x projects without rewriting them.
- Reports structural errors, missing references, and conversion warnings before download.
- Supports strict validation and
annualorpreservecultivation-year modes.
Conversion and validation are structural. AquaCrop is not bundled or executed, so a successful conversion does not confirm that the project runs in AquaCrop 7.3.
The converter supports:
- AquaCrop 5.x projects that use the V6-style run layout;
- AquaCrop 6.x and 6.1
.PRMand.PROprojects; - AquaCrop 7.x projects for inspection and packaging without conversion.
Versions below 5 and projects with an unrecognized line layout are not supported. If an input contains more than one project file, select the project to inspect and convert.
The web interface processes project files in the browser. It does not upload them to a conversion service.
- Choose a ZIP archive or select the project files.
- Review the detected version, project file, references, warnings, and errors.
- Select the cultivation-year mode and, if needed, strict validation.
- Convert or package the project and download the ZIP archive.
The downloaded archive is named after the selected project. For example, maize.PRM produces
maize.zip.
The web archive contains:
AQUACROP_INPUT_V73/
README.txt
AQUACROP_INPUT_V73 contains the selected project, its referenced input files, and any generated
project or parameter file. README.txt records the source and target versions, inserted values,
and warnings.
Node.js 22.12 or newer is required. Run the published package with npx:
npx @agrodt/aquacrop-converter inspect project.zip
npx @agrodt/aquacrop-converter convert project.zip \
--output project-v73.zip \
--strict \
--cultivation-year-mode annualThe main options are:
--project <path>selects a project when the input contains multiple.PRMor.PROfiles.--stricttreats structural warnings covered by strict mode as errors.--cultivation-year-mode annual|preservecontrols converted cultivation-year values.--report=none|text|jsoncontrols stdout output; the default istext.--report-file <path>writes the full conversion report to a separate JSON file.
The CLI returns a nonzero exit code when inspection or conversion fails.
The converter preserves referenced input files and existing project values where the target format
allows it. It adds the AquaCrop 7.3 CAL and OBS references as (None), inserts the required
rainfall program-parameter defaults, and writes generated project and parameter files with CRLF
line endings.
Executables, temporary output, source maps, browser metadata, absolute local paths, and unrelated files are not copied into the converted archive.
packages/corecontains the format inspection, validation, and conversion logic.packages/clicontains the Node.js command-line interface.apps/webcontains the browser interface.fixturesandpackages/core/testscontain regression fixtures and tests.
Install dependencies from the repository root:
pnpm installCommon commands:
pnpm check
pnpm typecheck
pnpm test
pnpm build
pnpm devThe core regression tests compare generated project and parameter files byte-for-byte with the expected AquaCrop 7.3 fixtures.
- AquaCrop runtime validation is not performed.
- Existing AquaCrop 7.x projects are packaged without conversion.
- The
preservecultivation-year mode follows the reference converter's sequential run numbering.