Executing UMAT subroutine in .f90 form through ABAQUS? - fortran

I am using 'Abaqus standard 6.14-4' with 'Microsoft Visual Studio Ultimate 2012' and 'Intel composer XE 2013 for windows'. I have written a UMAT subroutine in free form .f90 format. Now when I try to provide this UMAT subroutine in ABAQUS, it gives me an error message, 'User subroutine file name must have a .for or .obj extension'.
I have tried to change the following lines in 'abaqus_v6.env' file:
compile_fortran=['ifort', '/c','/DABQ_WIN86_64', '/extend-source', '/fpp', '/iface:cref', '/recursive', '/Qauto-scalar', '/QxSSE3', '/QaxAVX', '/heap-arrays:1', # '/Od', '/Ob0', # <-- Optimization Debugging # '/Zi', # <-- Debugging '/include:%I']
But, may be I had made some mistake or some thing, I don't know... my problem still persist. Then, I have tried to add the following line at the top of UMAT subroutine: !DIR$ FREEFORM and tried to feed this to ABAQUS. But, again failed as the same error message displayed again.
Please suggest me a solution so that I can feed my .f90 subroutine to ABAQUS job.

Related

I can't knit my rmarkdown files - pandoc error

My university provided laptop was recently replaced and now when I try to knit my Rmd files if get the following error:
pandoc.exe: \\: openBinaryFile: invalid argument (Invalid argument)
Error: pandoc document conversion failed with error 1
Execution halted
These files used to knit perfectly on my old laptop and all of the code blocks within the file still run without errors.
The pandoc_available() function returns TRUE
The answers to similar questions that I have searched suggest it is something to do with the file paths but I am not familiar enough with this to make sense of what I should do. I tried mapping a network drive (Z:) to the folder where the Rmd file is stored and then changing the working directory in RStudio to that drive but it hasn't helped (and now I don't know how to change it back to ~ or what that referred to in the first place)
I have also tried downloading the latest version of Pandoc and a search on Windows Explorer shows that has installed in my user directory but I also have a version in C:\Program Files\RStudio\bin. That has also not helped.
I'm not sure if this is relevant but here is the information on the R version that I am running:
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
Can you tell me what other information is required to diagnose the problem and I will edit to include.
I am sorry this question is so poorly specified and would appreciate any help to improve it.
**** UPDATE ****
I have found that if I
(i) specify that I want a .md file in the YAML header,
(ii) create an .md file by knitting the markdown file,
(iii) copy that .md file manually to the Pandoc directory
(iv) run pandoc.exe -s -o test.knit.md test.html from the MSDOS command prompt within the Pandoc directory,
then I can create the html output file.
However, changing the working directory for RStudio to the Pandoc directory and running
x <- rmarkdown::render("test.Rmd", run_pandoc = FALSE, clean = FALSE)
knit_meta <- attr(x, "knit_meta")
rmarkdown::render( input = 'test.knit.md' , knit_meta = knit_meta )
as per https://stackoverflow.com/questions/38908766/how-to-generate-an-md-file-from-a-rmarkdown-file-containing-an-htmlwidget gives the same error as shown in my original post.
Does this prompt any thoughts that might lead to a solution to my problem?
The university IT people were able to solve my problem by uninstalling R and RStudio from the network drive and installing it on the C: drive and I am now able to knit successfully.

Fortran error: "end of file" while reading character in namelist

I am writing a Fortran application, and I get this problem. When I define a namelist as following:
CHARACTER(100) :: INPUT_DIR, OUTPUT_DIR, ROOT_DIR
NAMELIST /IODIR/ INPUT_DIR, OUTPUT_DIR
and then I read IODIR from file as:
READ(FUNIT,IODIR, ERR=99)
The data in file is:
&IODIR INPUT_DIR="Input", OUTPUT_DIR="Output" /
But it get error
"End of file".
It seems like the length of variables is longer than their defined in file. I don't know how to set delimiter for the character variable, or read an unknown character in namelist. I use GNU Fortran to build.
I had the same problem with the online gfortan compiler, same result from an installed version. This problem is all over the web, so on the basis of using reliable sources I:
Installed gfortran in Windows 10 Bash - all good.
Installed gfortran in Cygwin - all good.

checkCudaErrors is not printing error information

I have included helper_cuda.h and I am using the checkCudaErrors macro on every CUDA call in my code. I have forced an error through the following code:
checkCudaErrors(cudaMalloc(&GPUCameraData, sizeof(float) /*<-- Should be HCameraData */ ));
checkCudaErrors(cudaMemcpy(GPUCameraData, CPUCameraData, sizeof(HCameraData)
, cudaMemcpyHostToDevice));
The application simply exits with error code 1, as it should, but no information is printed. If I break on the first line and step into the second line, I see that _cudaGetErrorEnum() in helper_cuda.h does return "cudaErrorInvalidValue", but no information is printed in the output.
The development environment I use is Visual Studio 2013 and I have tested this both in Debug and Release mode.
Note: I have the same issue with OpenGL and glGetError. It seems as if any fprintf(stderr, ...); calls from code that is not directly inside my own file structure will not print anything.
The reason might be that you are creating some other type of application than default C++ application(regrading CUDA and OpenGL in your case) i.e. are you compiling this code to a library to be used in another project which is not c++, or some kind of linking issues(which type of project do you have...need information!). I had the same problem when i compiled cuda code to Matlab-Mex file which would print with the command "mexPrintf" not "fprintf" used inside "checkCudaErrors". You might test changing the print command inside helper_cuda.h from fprintf to a command which DOES print info incase you call it from your program.

Changing the status of a temporary file with the open statement in gfortran

I am using an old Fortran code and I have running it using g77-3.3 in an old OS. Since this version of the compiler no longer comes with most Linux distributions I tried using gfortran (4.9.2), and I am facing this small problem.
This codes uses temporary files. It writes to this file and then at a certain point it changes the status of the file to scratch, like in the following example:
PROGRAM testopenfile
IMPLICIT NONE
WRITE(8,*)'fdsasfd'
OPEN(8,STATUS='SCRATCH')
CLOSE(8)
END PROGRAM
This piece of code works with the g77 compiler, but when I run it with gfortran I get the message:
At line 4 of file testopenfile.f (unit = 8, file = 'fort.8')
Fortran runtime error: Cannot change STATUS paramter in OPEN statement.
Has this way of setting temporary files changed in gfortran? Am I doing something wrong? Could this be a bug in this version of gfortran?
If you write to unit 8 before opening the file, you are in fact writing to a file called fort.8, see here. Apparently, this file is still open at unit 8 when you try to attach the scratch file to it.
You can solve this by opening the scratch file before writing to the unit:
PROGRAM testopenfile
IMPLICIT NONE
OPEN(8,STATUS='SCRATCH')
WRITE(8,*)'fdsasfd'
CLOSE(8)
END PROGRAM
or by using a different unit.
Chapter C.6.3 ("OPEN statement (9.5.6)") in the Fortran 2008 Standard treats this case and has an example which looks just like your code. It states that this "example is invalid because it attempts to change the value of the STATUS= specifier."
If you want to delete the file on closing, you can also do
PROGRAM testopenfile
IMPLICIT NONE
WRITE(8,*)'fdsasfd'
CLOSE(8,status='DELETE')
END PROGRAM

How can I solve Fortran runtime error: End of file?

I am using Codeblock 13.12. My file is not readable. and getting the runtime error
program asd
implicit none
integer :: x
open(unit = 2, file = "text.txt")
read(2,*)x
write(*,*)x
end program
and my text.txt file is :
1
I've seen many answers, but none of them worked for my code
Your program is just fine. As a matter of fact, even if the first line is not properly terminated, gfortran will take the EOF as the EOL and still work.
Your problem is you are working in the IDE CodeBlock. The IDE does not run the program in your working directory so the file text.txt is not where the program is running, hence the end of file error.
Check out this post Codeblock working directory which will guide you to solving your problem.