MCSclimate / MCT

Model Coupling Tookit
Other
43 stars 18 forks source link

Fix for building m_AttrVect.F90 using Cray compilers #59

Closed sarats closed 3 years ago

sarats commented 4 years ago

Remove 2 compiler directives that Cray compiler didn't like.

Fixes #68

sarats commented 4 years ago

Looking at the history for this file (https://github.com/MCSclimate/MCT/blame/master/mct/m_AttrVect.F90), I noticed @amametjanov replaced the earlier directives with these.

Update !CDIR COLLAPSE with !DIR$ COLLAPSE from https://github.com/MCSclimate/MCT/commit/9430d8271c000a8ae8df6751ab4188616bf62c99

I typically expect collapse directives before loops. Anyway, I hope these can be removed if they are no longer used/useful.

sarats commented 4 years ago

Digging a bit more, I found that these directives were initially added by @rljacob for vectorization using Fujitsu compilers 17 years ago! https://github.com/MCSclimate/MCT/commit/97f3ab00ca918f2d30c85edd7195e8391d3a32fb

rljacob commented 4 years ago

Ha! Those mods were given to me by someone at Fujitsu.

sarats commented 4 years ago

Please let me know if anything else is needed to merge this upstream.

rljacob commented 4 years ago

My MCT standalone testing is currently suffering because of some old MPI-1 features in the system test. If you need this quickly, make the same PR to CIME.

sarats commented 4 years ago

No rush, can wait till MCT testing is done.

naromero77 commented 4 years ago

@sarats Did you report this bug to Trey White from Cray?

Just coincidentally -- this is similar to a bug I see with the f18 compiler when compiling the PICSAR code. Some really old Intel-specific directives that should be completely ignored by f18 cause a compile-time failure. Here is an example of what I am talking about:

https://github.com/flang-compiler/f18/issues/948

sarats commented 4 years ago

Just a friendly reminder, still no rush.

naromero77 commented 4 years ago

Rob suggested that if you need this quickly, to make the PR into E3SM/CIME. But isn't this a bug in the Cray compiler -- it should just ignore directives that are specific to other vendors.

sarats commented 4 years ago

In this case, I'm not quite sure what the collapse directive is aiming to do in the absence of a loop.

If MCT testing is still an issue, I guess I can make a PR to CIME.

rljacob commented 3 years ago

Passed system test.