edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
23 stars 5 forks source link

Compatability with Intel compilers #185

Open edoddridge opened 6 years ago

edoddridge commented 6 years ago

Currently the model doesn't compile when using Intel compilers, as shown by the log files attached to https://github.com/edoddridge/aronnax/issues/183#issuecomment-377116631

Attempting to compile results in a number of errors like

src/adams_bashforth.f90(19): error #6415: This name cannot be assigned this data type because it conflicts with prior uses of the name.   [AB_ORDER]
    integer,          intent(in) :: nx, ny, layers, AB_order

and then stops without trying to compile any source files after adams_bashforth.f90.

This appears to be due to ifort being picky about the size variables being declared before they are used, see here for a discussion. Changing the order of the declarations allows the code to compile. Doing this without also changing the order of arguments in the subroutine call breaks our coding style that requires all subroutine arguments be be declared in the order they appear in the subroutine call. Not a big deal, but is kind of fiddly to fix since every subroutine call will need to be changed.

I've pushed a branch, ifort_compatability, that contains a quick and dirty fix for this, but it is far from ready to merge.

Given that the Intel compilers generally produce faster binaries, it would be nice to be able to use them when they are available.

Other issues I identified while playing with this: