1st commit for rebuild branch including the rebuild_nemo.f90 code and accompanying shell script. see ticket:#871