Skip to content

Commit

Permalink
Fix SW_NC_read_inputs(): use correct units
Browse files Browse the repository at this point in the history
- SOILWAT2 uses radians as internal units of geographic latitude and longitude
- SW_NC_read_inputs() now converts values obtained from netCDF input file from degrees to radians; previously, this unit conversion was erroneously missing
  • Loading branch information
dschlaep committed Apr 19, 2024
1 parent c90512c commit e87af56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SW_netCDF.c
Original file line number Diff line number Diff line change
Expand Up @@ -3606,6 +3606,12 @@ void SW_NC_read_inputs(SW_ALL* sw, SW_DOMAIN* SW_Domain, size_t ncSUID[],
}
}
}


/* Convert units */
/* Convert latitude/longitude to radians */
sw->Model.latitude *= deg_to_rad;
sw->Model.longitude *= deg_to_rad;
}

/**
Expand Down

0 comments on commit e87af56

Please sign in to comment.