-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent rank of spectral array #1208
Comments
I agree, it seems sensible to have the same 1D array in all the code to avoid fortran to decide by itself what to do |
In general I lean towards consistency, so I will likely think this is sensible too. I'd like to discuss with Jessica first though, when she's back early next week, just to make sure there isn't anything I've overlooked. I'll post back again then. One place I had previously noticed this same thing, is in Line 2012 in f66b6d4
which expects A (3D) and VA (2D)Line 2133 in f66b6d4
though in the call from W3WAVE , receives VA for both argumentsLine 1348 in f66b6d4
which I agree, it surprisingly seems to be OK with this! |
I concur with everyone - consistency is great! I cannot think of anything else to consider here or a reason why this change would be bad. |
Thanks for weighing in @JessicaMeixner-NOAA. Then all clear from me too. It's great you're taking this on @ukmo-ccbunney! |
Great- thanks for your input @MatthewMasarik-NOAA and @JessicaMeixner-NOAA . |
Describe the bug
[Not a bug per se, but more of an issue around consistency that does complicate things like subroutine overloading]
Most of the source term functions receive the spectral density (often
A
orSPEC
) as a rank 1 array with the dimensionsNSPEC
whereNSPEC = NK * NTH
However, there are several places, especially in the point output post-processors, where the array that is passed in is defined as rank 2 array with the dimensions
NTH, NK
, rather than a rank 1 array of sizeNSPEC
.Fortran (surprisingly) seems to allow this and is happy to quietly handle a 2D array as a flattened 1D array.
However, Fortran gets a lot more picky when you overload subroutines when using an INTERFACE block (something I have been looking into with the ST4 source package) which makes things more complicated.
Are there any objections to changing the use of 2D spectral arrays to 1D versions instead? This would mainly affect the point output processor programs. Apart from the issues it causes with subroutine overloading, it feels more aesthetically consistent with the internal 1D representation of spectral arrays in the rest of the model.
Example:
ww3_ounp calls W3SIN4:
WW3/model/src/ww3_ounp.F90
Line 2190 in f66b6d4
where
A
is defined as a 2D array:WW3/model/src/ww3_ounp.F90
Line 1630 in f66b6d4
but W3SIN4 expects a 1D array:
WW3/model/src/w3src4md.F90
Line 535 in f66b6d4
The text was updated successfully, but these errors were encountered: