adtzlr / ttb

Tensor Toolbox for Modern Fortran
https://adtzlr.github.io/ttb
MIT License
97 stars 31 forks source link

cannot compile script_umat.f #13

Closed ylffan closed 3 years ago

ylffan commented 4 years ago

Hi, I am a new user of fortran trying to use the toolbox to help writing a umat in abaqus. I was trying to start running the example script_umat.f but it couldn't compile in gfortran 6.3.0. I got many errors saying "Derived type 'Tensor1' is being used before it is defined." I wonder if you can give some suggestions on how to fix these errors. Thank you!

jfriedlein commented 4 years ago

Hi @ylffan, Can you state the first few error messages, specifically the line numbers and files where the errors occur?

Try saving the file with uppercase file extension so script_umat.F (I think this is now necessary).

In case something got mixed up due to the last update incorporating LS-Dyna, you might test the previous version (without preprocessor flag, so 'include ...' instead of '#include ...', lower case file extension so script_umat.f) which should be this one: script_umat.f together with the previous ttb-scripts previous ttb.

ylffan commented 4 years ago

Hi @jfriedlein, Thank you for the response!

After changing to " include 'ttb/ttb_library.f' ", I am able to get it compile through windows cmd. I do get warnings regarding to the preprocessor flags:

ifndef NOR4

1 Warning: Illegal preprocessor directive ttb/ttb_library.f:76:2:

However, when i try to compile through Code::Blocks (using the same gfortran compiler), I still get the errors regarding the derived type, see the figure below. It seems that there is some issue with how Code::Blocks is linked to the compiler but i couldn't figure out what exactly this issue is. Have you used the toolbox in Code::Blocks?

image

adtzlr commented 4 years ago

@ylffan Thanks for reporting and @jfriedlein for helping out! Please download again, I added a commit which changed all example files from lowercase to uppercase file extensions.

And please do not change the include statement - this will raise other Errors/Warnings as you have already found out! I hope the uppercase file extension in your example file will also resolve your Errors in Code::Blocks.

Andreas

adtzlr commented 3 years ago

I'll close this issue as there were no further replies. Feel free to open again.