Contrasting Behaviour in Reading bdydtav files between GNU and PGI Builds


I have been trying to build NEMO with the legacy Portland Group compilers (part of the Nvidia HPC SDK version 23.7). I found the issue three years ago documented in #2579 (PGI compiler does allow read values from namelist using buffers) – NEMO and, thanks to the work there, managed to build and avoid the namelist reading problems.

I, however, have run into inconsistent behaviour in reading open boundary condition (bdydta) files between my Portland Group and very functional GNU builds. With GNU, bdydta files (formatted as n x 1 x 1 matrices, where n is the number of boundary points) are read as n x 1 x 1 matrices. But with Portland Group, NEMO is trying to read them (using iom_get_123d) as i_m x j_m files where i_m and j_m are the domain sizes of an individual processor. This is the standard approach for reading restart, domain_cfg, and bulk forcing files etc., but GNU seems to compile properly some instruction that changes this for the bdydta files, that is, for variables like sossheight. (The tidal files are properly read by both the GNU and Portland Group builds.)

If anyone knows where the “count” variables for reading netCDF files are being set and how the program knows to read bdydta files in different way that other files, I would appreciate your insights.