I must add - the above program with the corresponding library linking worked perfectly fine in 32 bit environment Ubuntu.
Then why did you link the ilp64 libraries, when the lp64 libraries are the ones for 32-bit (default) integers? Did you check whether your chosen copy of the USE .mod files wants 32- or 64-bit integers?
Many thanks. I used the LP64 libraries and it worked. In reponse to the message on using ILP64 - I was actually confused since I had initially written and run the code in Ubuntu 32 bit machine, and then had to include it in a job to be run in a 64 bit machine - hence I ended up wrongly linking ILP64.