Made some changes for portability - replaced logicals with integers and redesigned some functions and classes. gfortran does not work yet, however.
Some more changes for portability to gnu compiler - apparently there is no support for tasks in gfortran?