Comments (7)
Hi,
I might need a little more information to help you. What exactly is your use case and the issue you are seeing?
Are you trying to run with the python control interface or something else? If possible, use quotes in your paths and try to simplify it.
Best, Dan
from rosco.
Hi Dan,
Thank you for your reply.
We maintain our own wrapper/interface to the ROSCO DLL. When we pass the input file path to this, currently we encode using ASCII. However, having seen your interface encoding using UTF-8, I wondered if that was supported. However, when I tried to do that and then pass a path with Unicode characters to ROSCO, it failed to find the input file.
So I was just wondering if you could confirm what encoding should be used when calling the DLL?
Thanks,
James
from rosco.
Thanks for the context, James!
I can't confirm any specific encoding. That may just be what is needed for the dynamic library set up in python. It's been a while since that was developed and no one I've asked seems to recall the specifics.
Is this discrepancy causing you issues? If not, I'm inclined to let it go and note that the DISCON.IN file path should be encoded in ASCII.
from rosco.
It feels uncomfortable to restrict users to ASCII in the modern day. This was something that happened in pre Unicode days, but for 2023 it's really awkward for any real word usage. Perhaps in English speaking parts of the world it won't give anyone any trouble, but the majority of the world routinely uses characters outside ASCII.
Fundamentally what seems to be needed is a way for the code which opens files, to handle non ASCII characters in some way. I'm no Fortran expert. Does Fortran have support Unicode file names?
from rosco.
My best guess is that, at least on typical Windows Fortran environments, OPEN expects filenames to be encoded with the active code page. So probably the best that you can do is try to encode any file names that way. In Python you'd using this encoding:
f"cp{ctypes.windll.kernel32.GetACP()}"
I think! But that will only get you so far. You are still in trouble if your file name / path has characters from outside the active code page. This is of course why Unicode exists.
from rosco.
Thanks for the feedback. These are valid points.
The type of the input file is determined here:
Line 49 in e3b7db7
I'm not sure we currently have the bandwidth to support this, but input is welcome from the community.
ROSCO also reads in several strings, which might require updates, too.
from rosco.
It's not the format of the file itself that is the issue. It's just the handling of the file names. So when DISCON is called and the file name is passed in by the host, that file name, which for my usage needs to be a complete absolute path, can often have non ASCII characters. That file name gets passed as the first argument to OPEN. So to resolve this there'd need to be a way to open a file whose name can come from arbitrary set of characters, i.e. Unicode.
What I don't know, as I'm not a Fortran programmer, is how Unicode is typically handled for such scenarios. It would astound me though if there wasn't a clean way to do this in 2023 in Fortran, although I guess you never know with Fortran!
from rosco.
Related Issues (20)
- ZeroMQ client not properly installed | Example 17 HOT 25
- AWC doesn't check PtchControl in OpenFAST
- Wind/Rotor misalignment and estimated wind speed
- Why does the 5MW FOWTs not have nacelle velocity proportional feedback (Fl_Kp) ? HOT 1
- Update installation instructions for Windows HOT 4
- Individual pitch control (IPC) tuning, example "12_tune_ipc.py" HOT 3
- IEA-15MW model requires update HOT 1
- ROSCO wind speed estimation differs from the input by a significant amount HOT 1
- Error while installing ROSCO complitly on Windows 11 HOT 5
- read beamdyn? HOT 8
- Inconsistent behaviour of the yaw module HOT 2
- pip install -e . not working as intended on Windows HOT 2
- Output timestep in wfc_controller HOT 3
- K omega**2 control, definition of K HOT 1
- Additional Measurement Outputs from OpenFAST via zeromq HOT 1
- Invalid tag on 2.9.1? HOT 2
- The acquisition of PI parameters in torque control HOT 2
- Missing 32-bit Windows Libraries
- Is ROSCO safe for multiprocessing? HOT 2
- add wintypes to the ctypes import HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosco.