Difference between revisions of "For developers"

From ccrmwiki
Jump to: navigation, search
(Created page with "All svn account holders need to familiarize themselves with the following rules. Sharing I/O channels in SELFE You need to exercise caution when dealing with parallel I/O esp...")
(No difference)

Revision as of 09:31, 5 March 2013

All svn account holders need to familiarize themselves with the following rules. Sharing I/O channels in SELFE

You need to exercise caution when dealing with parallel I/O especially for writing. For writing outputs, you’d generally let only 1 process do the job, e.g.

if(myrank==0) write(10,*)…..

If you do need to have all processes write e.g. debug messages, you’d then use channel 12 (see below).

Here are all I/O channel numbers used in different sub-models of SELFE (red numbers mean they have been used by other sub-models and you’d avoid using them):

1. Hydro/ Channels between 8 and 200 are used by various codes for I/O. In particular: a) 101 to 100+noutputs (inclusive of both): reserved for global outputs (including from tracers from sediment, EcoSim, ICM, as well as WWM); b) 201-250: non-standard outputs (e.g. at sidecenters, prism centers); c) 251 to 259: reserved for station outputs d) 301 to 300+ntracers: reading channels for non-point source inputs for ICM e) 10, 31, 32: used for one-off I/O – can be used by other sub-models as long as you close them immediately after use f) 12: this channel is initialized by different processes to point to files outputs/nonfatal_xxxx, where “xxxx” are the process IDs. Therefore it’s very useful for debugging purpose; you can use it anywhere in your part of the code to dump messages to these files g) 16: this channel points to mirror.out (on rank 0), the main message output for info about the run. You should use it with if(myrank==0) 2. WWM a) 1100 to 1200: handles for inputs/outputs etc 3. EcoSim a) 600: outputting some messages 4. Sediment a) 26, 2626

 B. Rules for contributing your code to be included in the SELFE package

Here are some rules for preparing your own code: 1) No spaces between “#” (pre-processor) and if/else/end; 2) Don’t use “!” inside write/print or any other non-comment portion;