Package {cropwatMUL}


Title: Crop Water Requirement and Irrigation Scheduling Across Multiple Locations
Version: 0.1.0
Description: Estimates reference evapotranspiration, crop evapotranspiration, effective rainfall, crop water requirements, root-zone water balance, and irrigation schedules across multiple locations. The calculations use temperature-based procedures described in Food and Agriculture Organization Irrigation and Drainage Paper No. 56 and a workflow inspired by the 'CROPWAT' software for monthly-to-daily interpolation, aggregation into 10-day periods, and irrigation scheduling. Further details of the evapotranspiration calculations are provided by Allen, R.G., Pereira, L.S., Raes, D. and Smith, M. (1998, ISBN:92-5-104219-5) "Crop Evapotranspiration: Guidelines for Computing Crop Water Requirements" https://www.fao.org/4/X0490E/X0490E00.htm. The package is an independent implementation and is not affiliated with or endorsed by the Food and Agriculture Organization of the United Nations.
License: GPL (≥ 3)
Encoding: UTF-8
LazyData: true
Depends: R (≥ 4.2.0)
Imports: dplyr, lubridate, openxlsx, purrr, readxl, stats, tibble, tidyr, utils
Suggests: knitr, rmarkdown, spelling, testthat (≥ 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
Config/roxygen2/version: 8.0.0
Language: en-US
NeedsCompilation: no
Packaged: 2026-08-20 13:35:11 UTC; win11
Author: Manish Naskar ORCID iD [aut, cre, cph], Debasish Chakraborty ORCID iD [aut], Koushik Bag ORCID iD [aut], Shariti Syiem ORCID iD [aut], Akmaul Hoque ORCID iD [aut]
Maintainer: Manish Naskar <manishkumarnaskar@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-24 14:30:02 UTC

cropwatMUL: Multilocation Crop Water Requirement and Irrigation Scheduling

Description

cropwatMUL provides an independent, transparent implementation of temperature-based FAO-56 reference evapotranspiration, effective rainfall, crop-water requirement, root-zone water balance, and irrigation scheduling across multiple locations.

Details

The package is not affiliated with or endorsed by the Food and Agriculture Organization of the United Nations and does not reproduce every function of the official CROPWAT software.

Author(s)

Maintainer: Manish Naskar manishkumarnaskar@gmail.com (ORCID) [copyright holder]

Authors:


Representative multilocation input data

Description

A synthetic example generated with rnorm() for demonstrating the required input structure. The object is a named list containing climate, soil, and crop data frames.

Usage

cropwat_example_data

Format

A list with three components:

climate

Monthly maximum and minimum temperature, rainfall, coordinates, altitude, wind speed, and radiation coefficient for three fictional locations.

soil

Soil texture and available water capacity for each location.

crop

Planting date, growth-stage duration, crop coefficients, and maximum rooting depth for potato.

Source

Simulated specifically for cropwatMUL; not observed data.


Estimate reference evapotranspiration from temperature

Description

Estimates daily reference evapotranspiration using the FAO-56 Penman–Monteith equation with vapour pressure and solar radiation inferred from minimum and maximum air temperature.

Usage

pm_temp_estimated(
  tmax,
  tmin,
  lat,
  doy,
  altitude_m = 0,
  u2 = 2,
  krs = 0.16,
  albedo = 0.23
)

Arguments

tmax

Numeric maximum air temperature in degrees Celsius.

tmin

Numeric minimum air temperature in degrees Celsius.

lat

Numeric latitude in decimal degrees.

doy

Integer day of year, from 1 to 365 or 366.

altitude_m

Numeric elevation above mean sea level in metres.

u2

Numeric wind speed at 2 m height in m s-1.

krs

Numeric temperature-based radiation adjustment coefficient.

albedo

Numeric surface albedo.

Value

A numeric vector of reference evapotranspiration in mm day-1.

Examples

pm_temp_estimated(25, 15, 25.7, 15, altitude_m = 1000)

Run a CROPWAT-inspired multilocation simulation

Description

Reads climate, soil, and crop worksheets from an Excel workbook and calculates daily, dekadal, monthly, and seasonal crop-water and irrigation indicators for one crop across multiple locations.

Usage

run_cropwat_one_crop_multilocation(
  input_file,
  crop_name = "Potato",
  output_year = NULL,
  irrigation_efficiency = 0.7,
  critical_depletion = 0.35,
  root_initial_m = 0.15,
  u2 = 2,
  krs = 0.16,
  altitude_m = 0,
  initial_depletion_mm = 0
)

Arguments

input_file

Path to an Excel workbook containing the required sheets.

crop_name

Crop name appearing in the crop worksheet.

output_year

Optional simulation year. Defaults to the planting year.

irrigation_efficiency

Fractional field application efficiency.

critical_depletion

Fraction of total available water that triggers irrigation.

root_initial_m

Initial effective rooting depth in metres.

u2

Wind speed at 2 m height in m s-1 when not supplied in the workbook.

krs

Radiation adjustment coefficient when not supplied in the workbook.

altitude_m

Elevation in metres when not supplied in the workbook.

initial_depletion_mm

Initial root-zone water depletion in millimetres.

Value

A named list containing input data, settings, and simulation outputs.

Examples

input <- system.file("extdata", "cropwat_example.xlsx", package = "cropwatMUL")
if (nzchar(input)) {
  result <- run_cropwat_one_crop_multilocation(input, crop_name = "Potato")
  result$summaries
}

Estimate monthly effective rainfall

Description

Applies the USDA Soil Conservation Service monthly effective rainfall relationship used in CROPWAT-style calculations.

Usage

usda_scs_effective_rain(P)

Arguments

P

Numeric monthly rainfall in millimetres.

Value

Numeric effective rainfall in millimetres.

Examples

usda_scs_effective_rain(c(50, 150, 300))

Validate a cropwatMUL input workbook

Description

Checks worksheet names, required columns, monthly completeness, location matching, crop-stage parameters, and the principal numeric constraints required by the simulation.

Usage

validate_cropwat_input(input_file, crop_name = NULL)

Arguments

input_file

Path to the input Excel workbook.

crop_name

Optional crop to validate.

Value

Invisibly returns TRUE; otherwise stops with an informative error.

Examples

input <- system.file("extdata", "cropwat_example.xlsx", package = "cropwatMUL")
if (nzchar(input)) validate_cropwat_input(input, "Potato")

Export cropwatMUL results

Description

Writes one Excel workbook and location-specific text files from an object returned by run_cropwat_one_crop_multilocation().

Usage

write_cropwat_outputs(
  results,
  output_dir,
  prefix = "CROPWAT_one_crop_multiple_locations"
)

Arguments

results

A cropwatMUL result object.

output_dir

Character path to the directory in which outputs will be written. This argument must be supplied explicitly. The directory is created recursively when it does not already exist.

prefix

File-name prefix.

Value

Invisibly returns paths to the Excel workbook and text directory.

Examples

input <- system.file(
  "extdata",
  "cropwat_example.xlsx",
  package = "cropwatMUL"
)

if (nzchar(input)) {
  result <- run_cropwat_one_crop_multilocation(
    input_file = input,
    crop_name = "Potato"
  )

  output_dir <- tempfile("cropwatMUL-example-")
  dir.create(output_dir)

  output_files <- write_cropwat_outputs(
    results = result,
    output_dir = output_dir,
    prefix = "potato_example"
  )

  output_files

  
}