wiki:addfield

Version 7 (modified by srebuffi, 10 years ago) ( diff )

--

Let's use an example to illustrate how to add a field in the model. I want to add a melting rate field to the calving parameters. This melting rate is given by the user so we add the field to the GUI interface.

Modify the GUI

Go to src/m/classes and modify all the classes concerned by the new field, here calving.m andcalvinglevermann.m and their associated Python versions. Declare the new field, add default values (if desired), add consistency checks, display descriptions and marshall instructions.

Add new Enums

Now, you have to add the Enum corresponding to your new field whose Enum name will be : ClassenameFieldnameEnum with Classename the name of the class with upper case for the first letter (here it will be Calving and Calvinglevermann for Classename) and Fieldname the name of your field you put in the previous files with upper case for the first letter (I put meltingrate in calving.m so Fieldname is Meltingrate). So I will add 2 Enums : CalvingMeltingrateEnum and CalvinglevermannMeltingrateEnum.

NB : don't forget to synchronize the Enums after it.

Implement the new field in the model

cd $ISSM_DIR/src/c/shared/Enum/
./Synchronize.sh
Note: See TracWiki for help on using the wiki.