| | 1 | == Introduction == |
| | 2 | |
| | 3 | Each model input is assigned an Enum in order to be found quickly (integers are easier to compare than strings). |
| | 4 | |
| | 5 | == Add a new Enum == |
| | 6 | |
| | 7 | If you want to add a new Enum, the ONLY file that needs to be changed is src/c/shared/Enum/EnumDefinitions.h`. Open it with you favorite editor (vim) and add your new Enum. Make sure that: |
| | 8 | - It does not already exist (the compiler will tell you anyway) |
| | 9 | - It finishes with `Enum,` |
| | 10 | |
| | 11 | Then you can run a synchronization script that will update the matlab and python Enum, StringToEnum and EnumToString automatically: |
| | 12 | |
| | 13 | {{{ |
| | 14 | !bash |
| | 15 | cd $ISSM_DIR/src/c/shared/Enum/EnumDefinitions.h |
| | 16 | ./Synchronize.sh |
| | 17 | }}} |
| | 18 | |
| | 19 | You will then need to recompile the entire trunk (not just src/c), and there is no need to reconfigure: |
| | 20 | |
| | 21 | {{{ |
| | 22 | !bash |
| | 23 | cd $ISSM_DIR/ |
| | 24 | make install |
| | 25 | }}} |
| | 26 | |
| | 27 | == Checking in the changes == |
| | 28 | |
| | 29 | In order to commit the new Enum, you will need to `svn add` the new matlab file in `$ISSM_DIR/src/m/enum`, and then commit all the files in `$ISSM_DIR/src/m/enum` and `$ISSM_DIR/src/c/shared/Enum` |