Write a RothC .dat file in the official v2.1.x layout
f.rothc.dataframe.2.dat.v2.RdImplementation behind f.rothc.dataframe.2.dat(vers = 2) – see there
for the column requirements. Kept separate only to keep each layout's
header/body writing readable; call the vers argument rather than
this function directly.
Usage
f.rothc.dataframe.2.dat.v2(
df.fixed.values,
df.simul.values,
output.dat.file = "./data_out/RothC_input.dat",
opt_RMmoist = 1,
opt_SMDbare = 1,
pan_coefficient = 0.75
)Arguments
- df.fixed.values
One-row data frame of fixed soil parameters. For
vers = 1:clay,depth,iom,nsteps. Forvers = 2:clay,depth,IOM,nsteps,silt,BD,OC,min_RMmoist(any order; reordered internally).silt/BD/OC/min_RMmoistonly affect the run whenopt_RMmoistis 2 or 3, but the layout always carries them.- df.simul.values
Data frame of monthly driving data. For
vers = 1, written as supplied. Forvers = 2, must holdyear,month,modern,Tmp,Rain,Evap,Pl_inp,OA_inp,PC,Pl_DPM_f,Pl_RPM_f,OA_DPM_f,OA_RPM_f,OA_Bio_f,OA_Hum_f(any order; reordered internally).Pl_DPM_f/Pl_RPM_fmust sum to 1 per row, as must the fourOA_*_f; for EOM categories with no established Bio-pool fraction useOA_Bio_f = 0(seedata_in/eom_params.csv).- output.dat.file
Path to write the
.datfile to.- opt_RMmoist
Only used when
vers = 2.1(default) = classic RothC moisture function;2/3= van Genuchten/Wosten-based function (Farina et al. 2013).- opt_SMDbare
Only used when
vers = 2.1(default) = bare soil moisture deficit threshold as in classic RothC;2= threshold set to -1500 kPa.- pan_coefficient
Pan coefficient used by the destination engine's moisture function to convert open-pan evaporation to potential evapotranspiration (
0.75in the official RothC_R v2.1.xRMF_Moist).df.simul.values$Evap(assumed to already be true PET) is divided by this value before writing, so the official engine'span_coefficient * Evaprecovers the real PET.
Details
The official moisture function (RMF_Moist/RMF_Moist_official)
expects Evap to be open-pan evaporation and converts it to potential
evapotranspiration internally via DF <- RAIN - pan_coefficient*PEVAP.
Our own climate data already is potential evapotranspiration (that's
why the "classic"/legacy engine's RMF_Moist() was patched to drop
that factor – see RothC_R_fork_FrdVnW history). To feed the
unmodified official formula a value it will itself multiply by
pan_coefficient, we must pre-divide: Evap_written = Evap / pan_coefficient, so that pan_coefficient * Evap_written == Evap
(the real PET) once the model applies its own conversion.