Skip to content
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

Using Findloc in SubDyn #356

Merged
merged 10 commits into from
Jan 14, 2020
Merged

Using Findloc in SubDyn #356

merged 10 commits into from
Jan 14, 2020

Conversation

ebranlard
Copy link
Contributor

THIS PULL REQUEST IS READY TO MERGE

Feature or improvement description

An important part of the discretization routine SD_Discrt is used to reindex the user inputs from "IDs" to indices. This involved several lookup of indexes in arrays. This was previously done by copying pasting several time the same code ("while loops").

I've added a function findloci, which is a simplified version of the fortran intrisinc findloc (which is not yet available on all compilers), and used this instead of the copy-pasted while loops.

I've also isolated the code that performs the reindexing since it doesn't really belong to the discretization routine.

I'm committing this now to limit the differencess with my other branch f/flexsub2

Related issue, if one exists

Follow up of #351

Impacted areas of the software

SubDyn module

@andrew-platt
Copy link
Collaborator

There is a subroutine interface LocateStp that does essentially the same thing as the FindLoci.

However, given that FindLoci is a function, I say let's keep it rather than try converting to the LocateStp routine. I think this makes the code more readable.

@ebranlard
Copy link
Contributor Author

Thanks for the feedback, I'll try to see if I can use LocateStp in the future

@ebranlard
Copy link
Contributor Author

ebranlard commented Jan 13, 2020

I'd like to use findloci to fix #378. This PR can be safely merged. (Note: I will move findloci to nwtc_lib later, together with a larger SubDyn pull request)

@rafmudaf rafmudaf merged commit a51fffa into OpenFAST:dev Jan 14, 2020
@ebranlard ebranlard deleted the f/flexsub branch January 16, 2020 23:12
bjonkman added a commit to bjonkman/openfast that referenced this pull request Feb 12, 2020
@rafmudaf rafmudaf mentioned this pull request Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants