+io (input output)

This is a Matlab module => the folder starts with the ‘+’ sign and it should not be changed.

define_constants()
readStructFromExcel(filename, sheetName, headerIdx, dataIdx, data_is_char, data_in_rows)

Read data into a struct with names matching those found in the first column/row default is for data to be in columns (A and B); if data_in_rows = true, data are in rows 1 & 2 example:

readStructFromExcel(‘../input_data.xlsx’, ‘options’, 3, 1) readStructFromExcel(‘../input_data.xlsx’, ‘filenames’, 1, 2, true)

assignvarnames()
define_bands()

Define spectral regions for SCOPE v_1.40 All spectral regions are defined here as row vectors WV Jan. 2013

select_input(V, vi, canopy, options, xyt, soil)
load_timeseries(V, leafbio, soil, canopy, meteo, constants, F, xyt, path_input, options)
initialize_output_structures(spectral)
create_output_files(parameter_file, F, path_of_code, options, V, vmax, spectral)

Create DATA files author J.timmermans last modified 4 Aug 2008: Added the creation of log file (file with input parameters)

4 Aug 2008: j.timmermans: included variable output directories

31 Jul 2008: (CvdT) added layer_pn.dat 19 Sep 2008: (CvdT) added spectrum.dat 16 Apr 2009: (CvdT) added layer_rn.dat 18 Nov 2013: (CvdT) several updates.

output_data(Output_dir, options, k, iter, xyt, fluxes, rad, thermal, gap, meteo, spectral, V, vi, vmax, profiles, directional, angles)

OUTPUT DATA author C. Van der Tol modified: 31 Jun 2008: (CvdT) included Pntot in output fluxes.dat last modified: 04 Aug 2008: (JT) included variable output directories

31 Jul 2008: (CvdT) added layer_pn.dat 19 Sep 2008: (CvdT) spectrum of outgoing radiation 19 Sep 2008: (CvdT) Pntot added to fluxes.dat 15 Apr 2009: (CvdT) Rn added to vertical profiles 03 Oct 2012: (CvdT) included boolean variabel calcebal 04 Oct 2012: (CvdT) included reflectance and fPAR 10 Mar 2013: (CvdT) major revision: introduced structures 22 Nov 2013: (CvdT) added additional outputs

Standard output

output_verification(Output_dir)

Date: 07 August 2012 Author: Christiaan van der Tol (tol@itc.nl) output_verification.m (script) checks if the output of the latest run with SCOPE_v1.51 matches with a ‘standard’ output located in a directory called ‘verificationdata’. If it does not, warnings will appear in the Matlab command window. The following is tested:

  • does the number of output files match?

  • does the size of the files match (number of bytes)?

  • are all files that are in the verification dataset present with the

same file names? - is the content of the files exactly the same?

If the output is different, for example because different parameter values have been used in the simulations, then the variables that are different will be plotted: the verification data in blue, and the latest run in red. In this way the differences can be visually inspected.