CMT Command Line Tools: Difference between revisions
m (Add some more documentation about RC file commands.) |
m (Link to some sample CMT RC files) |
||
Line 29: | Line 29: | ||
where <tt>my_resource_file.rc</tt> is described in the next section. Usually this file is prepared by the CMT graphical user interface, however, it is a fairly simple format and can be created by-hand without too much effort. It is much easier to start with a template though so I will provide links to some sample resource files. | where <tt>my_resource_file.rc</tt> is described in the next section. Usually this file is prepared by the CMT graphical user interface, however, it is a fairly simple format and can be created by-hand without too much effort. It is much easier to start with a template though so I will provide links to some sample resource files. | ||
Some sample resource files that run the Child model: | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/child_00.rc Child by itself] | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/child_01.rc Child connected to some input topography] | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/child_02.rc Child connected to some input topography and base level changes] | |||
Some sample resource files that run the Sedflux3D model: | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/sedflux_00.rc Sedflux by itself] | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/sedflux_01.rc sedflux connected to some input topography] | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/sedflux_02.rc sedflux connected to some input topography and base level changes] | |||
A connect Child-Sedflux simulation: | |||
* [https://csdms.colorado.edu/~huttone/cmt_sample_rc_files/child_sedflux_00.rc Child coupled to Sedflux] | |||
== The CMT Resource File == | == The CMT Resource File == |
Revision as of 18:26, 2 May 2013
The CMT Command Line Tools
Before beginning, you will need to have:
|
Load the CMT environment
Once logged into the CSDMS High Performance Computing Cluster, beach.colorado.edu, you will need to set up your environment to use the CMT command line tools. This is most easily done using modules.
$ module purge
$ module load cmtcl
This clears any previously loaded modules and then adds the cmt command to your path. If you have done this successfully, the following should print out a brief help message that describes some of the options for the cmt command,
$ cmt --help
Running a simple example
To run an example we first must prepare a CMT resource file. The resource file will tell CMT what components to use and how to connect them. The most basic way to run CMT on the command line is,
$ cmt my_resource_file.rc
where my_resource_file.rc is described in the next section. Usually this file is prepared by the CMT graphical user interface, however, it is a fairly simple format and can be created by-hand without too much effort. It is much easier to start with a template though so I will provide links to some sample resource files.
Some sample resource files that run the Child model:
- Child by itself
- Child connected to some input topography
- Child connected to some input topography and base level changes
Some sample resource files that run the Sedflux3D model:
- Sedflux by itself
- sedflux connected to some input topography
- sedflux connected to some input topography and base level changes
A connect Child-Sedflux simulation:
The CMT Resource File
The CMT resource file tells the CMT what to do through three main commands:
- instantiate. Create an instance of a component.
- connect. Connect two components.
- parameters. Set a model parameter
There are other too, but these are the main ones.
instantiate
Instantiate a component of type class_name and call it instance_name. Later on in the file we will use the instance name when referring to this component.
instantiate <class_name> <instance_name>
Examples of instance names are edu.csdms.models.Child and edu.csdms.models.Sedflux3D. Instance names can be pretty much any old string. So, an example instantiate command would be,
instantiate edu.csdms.models.Child Child
connect
Connect the component instances user_name and provider_name. The two components will be connected through their named ports. All most always the user and provider port names will be the same but the need not be.
connect <user_name> <user_port> <provider_name> <provider_port>
As an example, the Child component provides information about its subaerial delta through a provider port called SubaerialDelta. The Sedflux3D component is able to (optionally) use data provided by such a port. Thus, these two components can be connected through this port with the following command,
connect Sedflux3D SubaerialDelta Child SubaerialDelta
In this case, the Child component provides the Sedflux3D component with information about sediment erosion and deposition rates on land.
parameters
For the component <instance_name>, set the configuration parameter <param_key> to be <param_value>.
parameters <instance_name> Configure <param_key> <param_value>