5. Radiative transfer simulation
Examples
The user can easily learn how to use the RT simulation tools from a shell script, ./examples/job_test, and the example I/O files in ./examples.
Usage of the "mcarats" executable
The binary executable for MCARaTS RT simulator is "mcarats".
The usage is as follows:
% [COMMAND_PATH/]mcarats ptot solver inpfile outfile
ptot : Total number of incident photons. Integer or real (e.g., 1000000 or 1.0e+6)
solver : Radiative transfer solver
=0: F3D, Fully-3-Dimensional radiative transfer
=1: P3D, Partially-3-Dimensional radiative transfer
=2: ICA, Independent Column (or pixel) Approximation
inpfile : Namelist input file
outfile : Output file
For example, when the user operates the following: at "examples/" directory,
% ../bin/mcarats 1e5 0 conf_rs0067 test_rs0067
then the output data file, test_rs0067, will be generated. This output file is in a simple binary format. GrADS control file for the output will be automatically generated, with a filename "test_rs0067.ctl".
Computational speed
Here is an example for a case of radiance calculations:
Input namelist file: examples/conf_rs0067
Using a single CPU core
Radiance and LAMF calculation, visible wavelength, solar radiation
Speed is higher by about 20% if LAMF is not calculated. At absorbing wavelengths, the speed is higher.
Parallelization efficiency of the mcarats executable is very close to 100% for a large number of photons used, with 100 or more CPU cores. Therefore, the parallelizaed code has a good linearity in performance with number of CPU cores, for at least 100 or less CPU cores.
Possible problems
If you get some problem, please try to check the followings.
1) Invalid input format
The most frequent error is caused by invalid input format of the namelist file. If the code reported reading error of namelist input or external input files, then check the namelist file or the external input data files is written in valid format as described in Chapter 4. For binary data to be read in, Wld_mbswap should be properly set.
2) Invalid input data values
The other common error is from invalid input data values. In this case, diagnostics might be reported from the codes (in some cases). Change the values for the input variables in valid ranges. Especially, input values for a variable should be integer if the variable is declared as integer. In addition, some variables should be in specific ranges.
3) Bug?
In other cases, there is no advise from developers. Please feel free to ask any question to developers, who hope to reply to all questions as long as there is enough time. If you find any bug, please report to the developers.
Tips using tools
To simulate for several similar cases with small differences, there is a useful tool,
./shl/replconfig.awk
that is an awk script. This tool can replace one parameter value in the namelist input file. A limitation is that the variable to be replaced should be scalar (i.e., not array variable). For example, we can replace the value for variable Rad_the in ./examples/conf_rs0067 by
% awk -f ./shl/replconfig.awk Rad_the 180 < ./examples/conf_rs0067 > ./conf
Then the new ./conf file contains a line as "Rad_the = 180". This is useful to perform many simulations, as follows:
% awk -f ./shl/replconfig.awk Rad_the 180 < ./examples/conf_rs0067 > ./conf
% ./bin/mcarats 1e5 0 ./conf ./out_the180
% awk -f ./shl/replconfig.awk Rad_the 160 < ./examples/conf_rs0067 > ./conf
% ./bin/mcarats 1e5 0 ./conf ./out_the160
% awk -f ./shl/replconfig.awk Rad_the 140 < ./examples/conf_rs0067 > ./conf
% ./bin/mcarats 1e5 0 ./conf ./out_the140
% rm -f ./conf