You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GFLOW has been set up to run on DOS and Windows, which do not care about lower versus upper case for file names. Linux and macOS do care.
This creates trouble almost immediately, as the input argument is almost immediately changed into upper case. E.g. well_uflow.dat becomes WELL_UFLOW.DAT. Then, when this file is opened on Linux, it doesn't exist; then GFLOW seems to assume it's supposed to read input from the command line which never arrives. On Linux, it's erroring continuously which becomes apparent if you check fort.7.
Some approaches:
Require upper case file names. That way any transformation just results in the same file. However, this should be enforced: any entry point should check whether a file contains lower case letters, and if so, it should error. For a start though, we could just make sure the .dat file is upper case only.
Require lower case file names. Similar to the proposal above; with the note that lower case is basically superior to upper case letters because of better readability due to more variety in letter forms. This basically requires checking ALL filename interactions; pretty tedious.
Make it nice, make it robust: GFLOW does not alter the case of incoming file names. Unfortunately, this requires either checking for both lower and upper case forms, or ad hoc lowering before checking (which is what I'd do in Python).
It's worth noting that the first one is extremely simple to implement and that it provides really only a modicum of annoyance. In particular, if we assume that e.g. the QGIS plugin does the setting up of the input file, we can simply create upper case only there; no user will be much the wiser.
However, for backwards compatibility it's not very nice, since on Windows it would run.
Also pragmatically solving that: only check and error on Linux or macOS:
program main
implicit nonecharacter(len=256) :: filename
logical:: has_lowercase
! Get filename from command line
call get_command_argument(1, filename)
#if defined(__linux__) || defined(__APPLE__)
! Check for lowercase on Linux and macOS
if (has_lowercase(filename)) thenprint*, "Error: Lowercase characters are not allowed in the filename on this system."stopend if
#endif
! Rest of your program...
containsfunctionhas_lowercase(str) result(res)
character(len=*), intent(in) :: str
logical:: res
integer:: i
res =.false.do i =1, len_trim(str)
if (str(i:i) >='a'.and. str(i:i) <='z') then
res =.true.returnend ifend doendfunction has_lowercaseend program main
The text was updated successfully, but these errors were encountered:
This mostly comes up in relation with #7 and #10.
GFLOW has been set up to run on DOS and Windows, which do not care about lower versus upper case for file names. Linux and macOS do care.
This creates trouble almost immediately, as the input argument is almost immediately changed into upper case. E.g.
well_uflow.dat
becomesWELL_UFLOW.DAT
. Then, when this file is opened on Linux, it doesn't exist; then GFLOW seems to assume it's supposed to read input from the command line which never arrives. On Linux, it's erroring continuously which becomes apparent if you check fort.7.Some approaches:
It's worth noting that the first one is extremely simple to implement and that it provides really only a modicum of annoyance. In particular, if we assume that e.g. the QGIS plugin does the setting up of the input file, we can simply create upper case only there; no user will be much the wiser.
However, for backwards compatibility it's not very nice, since on Windows it would run.
Also pragmatically solving that: only check and error on Linux or macOS:
The text was updated successfully, but these errors were encountered: