Pacthing old and new versions of ROMS

Instructions and hints for beginners

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Pacthing old and new versions of ROMS

#1 Unread post by arango »

It is very easy to patch a new version of ROMS with your customized old version of the code. I always use the GNU patch to update the old with the version of the code. It is recommend to save your adapted version of ROMS in case the something goes wrong during the patching process.

Creating a Patch File:

Use the following command to create a patch file (MyPatch) between two directories (old and new) containing different versions of ROMS:

diff -c old new > MyPatch

Applying a Patch file:

To apply a path file, simpy copy you old customized version to a tmp directiory and then execute:

cd tmp
patch -p1 < MyPatchFile

Sometimes the patch utility rejects the patching because no location is found to append a particular text hunk. In such cases, a .rej file is created with the unresolved text hunk.

Checking Patched Files:

Once that the patch is applied you can use standard Unix commands to check the old and new directories. I usually type the following comands:

% date > log
% foreach f (*.F *.h *.in *.dat M* I*)
foreach? echo "ooooooooooooooooooooooooooooooooooooooooooooo" >> log
foreach? echo $f >> log
foreach? diff new/$f old/$f >> & log
foreach? end

After a sucessful patching, both directories new and old should be identical with no differences.
Good luck
Last edited by arango on Thu Mar 24, 2005 1:53 am, edited 1 time in total.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

#2 Unread post by kate »

I usually do something along the lines of this diff/patch solution. There are other ways:

1. Get better at CVS and use its merge capability.

2. Various codes that act like the old xdiff command:
xemacs in some mode or other
gvimdiff
mgdiff
xxdiff
Anyone have experience with these? Favorites? I'm building xxdiff because it does directories while it looks like gvimdiff only does a pair of files at a time.

Much as I hate extra clutter in code, I'm thinking I need to label all my changes because I can't remember which modification came from where or why it was done.

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

#3 Unread post by arango »

Good point. For ROMS and TOMS I have two codes: the official released version and my own research version. The official version is maintained with CVS in a web directory. The inteface for this CVS repository is very nice and allows you to compare the different versions of the code. This repository is only open to subscribed users for browsing purposes only. Users can check this repository to track the evolution of the model.

I maintain my reseach version in a very different way. I have dozens of different directories and versions for testing. Once that a particular new code tested, I load it into my personal RCS directory. Then, when I am ready to release a new community version, I just use a script to load my latest RCS into the web repository.

My favorite tool to compare files is still xemacs. I have become an expert using the two file difference tool in xemacs. The new version of the model has been restructured a little to allow comparsions between nonlinear, tangent linear and representer models. Since the new codes are quite complex, having a nice difference tool allow me to propage changes to all codes: nonlinear => tangent linear => representers tangent linear => adjoint.

I still targeting for a new realease of the model sometime in June, if not earlier. This new release will include nonlinear, tangent linear, representers, and adjoint models.

Post Reply