Closed jvo203 closed 1 year ago
An improvement: in the top file nf_network_submodule.f90
, the subroutine get_parameters(self, params)
, it makes sense to add
if (allocated(params)) deallocate(params)
right before the loop
do n = 1, size(self%layers)
Some users might repeatedly call get_parameters
(for whatever reason), the fix makes sure the params
array is emptied / deallocated prior to any 2nd-time use. Otherwise parameters would keep getting appended to the end of the existing params
array instead of being written starting at the beginning of params
.
Regarding the indenting, in the macOS vscode I have already been using the "Modern Fortran" extension as recommended by you. The "fprettify" vscode extension is not installed. Searching the installed extensions for "fortran" only returns "Modern Fortran", no other stuff is installed. In the vscode I have just set "Editor: Tab Size" to 2 and disabled automatic tab size recognition from existing files. Then I touched and saved all the modified .f90 files, triggering automatic re-formatting upon save with the tab size set to 2. Hopefully the files now look more like what you expect them to be.
Please let me know if there are any more settings that might need changing in vscode. If this PR does not fix indenting then it might have to be "over to you" upon your return to work. No worries, this stuff can wait!