Science topic

Fortran - Science topic

Sharing FORTRAN knowledge
Questions related to Fortran
  • asked a question related to Fortran
Question
1 answer
I will work Aspen custom modeler, for which I need fortran compiler compatible with Aspen version 14
Relevant answer
Answer
Hello.
Did you find a solution for this problem?
  • asked a question related to Fortran
Question
2 answers
I defined a large matrix(400000,30) using the dimension function in the vumat subroutine, and the error would arise when this matrix was initized in the solving process.The error message is as followed:
*** Error: Runtime stack limit has been exceeded.
This may be caused by user subroutines with large data structures allocated on
the stack or recursion. For suggestions on how to resolve this problem, please
refer to the chapter "Ensuring thread safety" in the ABAQUS documentation.
*** ERROR CATEGORY: PACKAGE
Do you know how to deal with this problem?
Thanks!
Wushuai Liu
Relevant answer
Answer
Yeah, this problem has been addressed by introducing a global variable.
  • asked a question related to Fortran
Question
3 answers
Hi all,
Second question on the same or so topic.
I am working on subroutines (UMAT and others) for Abaqus to implement Tsai-Wu failure criteria for non-composite structures (I work on long bones such as the femur).
To my understanding, strains and stresses are calculated at each integration point and so is every other variable that I may use, such as state variables or my failure criteria.
To correctly define failure, I need to average the failure criteria values (that are at each integration point) over each whole element, and that is where I get stuck coding for. I would like to mimic an element deletion feature by setting Young modulus to a negligible value to avoid completely deleting an element.
I used an UEXTERNALDB subroutine to import the connectivity table hoping to use it to get element-scale values (averaged).
How should I implement that calculation ? Is there a way to calculate everything at the nodes ?
Thanks for your help.
Relevant answer
Answer
Thanks for your reply ; could you provide a bit more insight on the use of the calculator ?
I do have the value of my failure criteria stored in a state value for each integration point but since I would like to modify the mechanical properties of an element during the simulation if it exceeds the failure criteria and since, to my knowledge, the calculator is called at the end of the simulation, I still feel stuck on that issue.
I greatly appreciate your help
  • asked a question related to Fortran
Question
3 answers
I want to calculate the lattice thermal conductivity of Bi2Te2Se. I calculated second-order Force constants using phonopy and third order force constants using Third_order.py.v.1.1.1.
But when I run ShengBTE, I am getting the following error.
At line 116 of file config.f90 (unit = 1, file = 'CONTROL')
Fortran runtime error: Cannot match namelist object name 0705
Could anyone help me to figure out this error? I have successfully run the TEST-VASP example provided with ShengBTE.
The required files are attached herewith.
Any help is highly appreciated.
Relevant answer
Answer
I am trying to generate Phonon dispersion of GaAs using ShengBTE. While working on it I feel that something I am not understanding. Would you please help me to clear some of my confusion?
I have some questions regarding the file.
q1) Does scell mean a supercell size? For example: scell(:)= 5 5 5 means that 5*5*5 supercell?
q2) If scell means 5*5*5 supercell here, would I have to run pw.x considering 5*5*5 supercell to generate 2nd_order force constant by Quantum Espresso?
q3) How about 3rd order force constant using thirdorder_espresso.py? Should we use the same supercell (5*5*5)?
Thank you in advance for your time
  • asked a question related to Fortran
Question
3 answers
Hi,
I would like to download fortran on my pc to run subroutine in Abaqus.
I have seen several videos on you tube but unfortunately they didn’t help me a lot.
I downloaded Visual studio community 2022.1, oneAPI 2024 both base Toolkit and HPC, follow all indication creating environment variables, modify .bat and .env in Abaqus and give target in Abaqus CAE and Command but
when I run the commands verify, I get this an error about external symbol ueref that is unresolved.
Is there anyone who had the same issue ?
Thanks
Dario
Relevant answer
Answer
I solved the issue. OneAPI and fortran must be linked to Golden version of Abaqus first otherwise it gives an error like ueref...
  • asked a question related to Fortran
Question
5 answers
Hello
Does anyone know how to program in Fortran or any other language that uses advanced calculation libraries? I need help making an executable to obtain results from 2 equations that use the complement of the incomplete Gamma function.
Thanks for your attention
Relevant answer
Answer
  • asked a question related to Fortran
Question
3 answers
Let's compare FORTRAN compilers. Let's begin with Bijan Mohammadi-Stephane Lanteri's nsc2ke Navier-Stokes solver. Everything you need is inside the zip file, including the Windows executable compiled using Compaq Visual Fortran Optimizing Compiler Version 6.1 from 1999. The executable is 315,392 bytes and the time to run is 6.65625 seconds on W10-64 on a Dell laptop with Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz. Let's see how other machines and compilers stack up. I have included the output files as well as a layout file to display the results with Tecplot and TP2.
Relevant answer
Answer
Another CFD test case (ISAAC by Joseph H. Morrison). The elapsed times are 10.25 and 4.78 seconds.
  • asked a question related to Fortran
Question
3 answers
Install Abaqus 2022 User-Subroutines, Thank you
Relevant answer
Answer
Here's a breakdown on linking Abaqus 2022 with Intel oneAPI Fortran Compiler and Visual Studio:
Software Installation:
  1. Visual Studio 2019: Install this first. Microsoft recommends using the 2019 version with Abaqus 2022: [invalid URL removed]
  2. Intel oneAPI HPC Toolkit (Intel Fortran Compiler): Download and install the toolkit ensuring the Fortran compiler is included.
  3. Abaqus 2022 with CAA API: This component allows user-defined subroutines, install it at any point.
Environment Variable Configuration:
  • You'll need to configure two environment variables:vars.bat: This script sets up the environment for Abaqus. Locate it in your Abaqus installation directory and run it. vcvars64.bat: This script sets up the environment for Visual Studio. You'll typically find it under C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build (replace "Community" with your edition if different). Locate and run the appropriate version (32-bit or 64-bit) based on your Visual Studio installation.
Linking Abaqus with Fortran Compiler:
There are two main methods:
  1. Using Batch Files:Create a batch file (.bat) with commands specifying the Intel Fortran compiler and linker for Abaqus. This method offers more control over the linking process.
  2. Using Default Shortcuts (Alternative):Right-click on the Abaqus executable and go to "Properties". In the "Target" field, add the path to the Intel Fortran compiler and linker at the beginning of the existing command. This is a simpler approach but offers less customization.
Verification:
  • Run Abaqus and check the "abaqus info=system" command output.
  • Look for lines mentioning the Intel Fortran compiler version.
  • If unsuccessful, double-check your system configuration and software installations.
  • asked a question related to Fortran
Question
9 answers
I have three modules (in free form .f90 format) which are being called from inside of a UMAT subroutine in ABAQUS, in the following manner:
module module_A
use module_C
use module_B
....
end module_A
module module_B
use module_C
....
end module_B
module module_C
....
end module_C
subroutine UMAT(STRESS,...)
....
Here the subroutines from module_A and module_B are being called
...
end subroutine UMAT
Now, what is the appropriate format for writing these modules with UMAT subroutine? How to merge different module files into a single *.for file (free format)?
Relevant answer
Answer
there is a simple way to handle this, you can keep your module be an individual file, and then use `include 'model_file.f90'` before your umat definition.
  • asked a question related to Fortran
Question
5 answers
The Visual Fortran is always available on previous years but I found that no option to have previous One API Base Fortran Tool Kits (whereby the website are always promote the latest year).
Relevant answer
Answer
If i understood your question properly, you can use this procedure:
  • asked a question related to Fortran
Question
3 answers
mpi.mod is the error
#funwave
#linux
#gfortran
Relevant answer
Answer
To resolve this issue:
1. Double-check the file or directory path: Verify that the file or directory in the error message actually exists in the specified location. Make sure there are no typos or missing files.
2. Check the working directory
3. Include search paths
4. Verify file permissions
5. Check dependencies
Good luck
  • asked a question related to Fortran
Question
2 answers
I'am trying to do a Heat transfer simulation in abaqus.
I have sucessfully passed the verification check and the link between fortran compiler and abaqus is established, and further verified as the UMAT subroutine is working.
Has anyone experinces that only the DFLUX is causing compilation errors?
Relevant answer
Answer
Depending on the source from which you got the DFLUX subroutine header, there may be a typo. The one from Washington University has an extra comma in the dimensioning:
"SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS, 1 JLTYP,TEMP,PRESS,SNAME) C INCLUDE 'ABA_PARAM.INC' C DIMENSION FLUX(2), TIME(2), COORDS(3), CHARACTER*80 SNAME"
Note the extra comma after COORDS(3). There is no line continuation for this comma to make sense, just delete it and your subroutine might work.
  • asked a question related to Fortran
Question
4 answers
I would like to simulate multiple heat fluxes moving simultaneously on a model in Abaqus using a user defined subroutine. As far as I know, the DFLUX subroutine limits the user to only one heat flux source, whereas multiple heat sources can be modelled simultaneously using the UMDFLUX. However, I cannot seem to find useful information on how to set up such a FORTRAN script. Please would someone assist me.
The best information I could find regarding this subroutine is through this link.
Relevant answer
Answer
hi Carlo Olivier I am trying to do the same and to use UMDFLUX, but I havenot found a good video or a detailed example on how to use it yet. were you able to find anything ? will appreciate it if you share the knowladge with me :). Thank you in advance
  • asked a question related to Fortran
Question
10 answers
You are trying to call a function written in C++ from inside an Abaqus User subroutine.
I've looked for related material, but most of it was done in a Linux environment. Is it possible to implement this in a Window environment?
Relevant answer
Answer
The error message "can't open test16.lib file" indicates that the linker cannot find the test16.lib file in the specified location. Let's try to troubleshoot this issue step by step:
Check File Location:
Ensure that test16.lib is indeed located in the directory D:/KEB/01.k9/02.present/22.vuamp/01.test1/vuamp_vdload_C5.
Verify the spelling of the file name; ensure there's no typo like "teset16.lib" instead of "test16.lib".
Absolute vs. Relative Paths:
It's always a good practice to use absolute paths in configuration files, especially when linking libraries. The path you've provided seems to be absolute, but double-check to ensure it's correct.
File Permissions:
Ensure that you have the necessary permissions to access test16.lib. It's possible that the file is in the correct location, but the user or process trying to access it doesn't have the required permissions.
Check the Library File:
Verify that test16.lib is not corrupted. If you have a backup or another version, try linking against that to see if the issue persists.
LIBPATH Syntax:
The /LIBPATH argument specifies a directory to search for libraries. Ensure there's no typo or syntax error in this line: '/LIBPATH:"D:/KEB/01.k9/02.present/22.vuamp/01.test1/vuamp_vdload_C5"'.
Other Directories:
Check if there are other directories in the abaqus_v6.env file that are also being searched for libraries. It's possible that the linker is looking in another directory that has an older or different version of test16.lib.
Environment Variables:
Sometimes, paths and library locations can be set using environment variables. Ensure that no environment variable is overriding the settings in your abaqus_v6.env file.
Clean and Rebuild:
If you're building a project, sometimes old build artifacts can cause issues. Clean or delete any old build files and try building/linking again.
Linker Version:
Ensure that the linker version is compatible with the library you're trying to link. If test16.lib was built with a different compiler version or settings, it might not be compatible.
Consult Documentation:
Check Abaqus documentation or any guidelines you're following to ensure you've set up the abaqus_v6.env file correctly.
If you've tried the above steps and the problem persists, consider reaching out to Dassault Systèmes' support or any relevant forums where other Abaqus users might have faced similar issues.
Thats all i could think . Regards and all the best sir .
  • asked a question related to Fortran
Question
1 answer
Hello all,
I am learning to write an ABAQUS VUMAT subroutine for Deshpande Evans (DE)/ Preston-Tonks-Wallace Material (PTW)constitutive model. I didn't write a subroutine before. I would appreciate any guidance toward the development of a subroutine. If anyone can share a VUMAT subroutine for DE/PTW model it would be of great help!
Thank you!
Best Regards,
Arif
Relevant answer
Answer
Hello,
I'm really not familiar with your model but for visco elastoplastic models we usually do as following :
Parameters reading.
Elastic stress for the first check and the first time step. Then make the assumption of elastic stress increment, compute your yield function and if your result is not coherent you have to define a solver to satify all your model equations. I hope for you you have only one variable to control your whole model, either it will be tricky.
You can define your own algorithm (Newton Raphson or Line Step if I'm right) or you can also find one on the web for the problem resolution.
Don't forget to save your internal variables at the end of each step once you reached equations equilibrium.
  • asked a question related to Fortran
Question
6 answers
FORTRAN in CFD Solvers
Relevant answer
Answer
FORTRAN is still being used to write CFD codes for a number of reasons, including:
  1. Performance: FORTRAN is a compiled language, which means that the code is converted into machine code before it is executed. This makes FORTRAN programs very fast and efficient.
  2. Maturity: FORTRAN is a mature language that has been used for decades to write scientific and engineering software. This means that there is a large body of knowledge and experience available to FORTRAN programmers.
  3. Portability: FORTRAN compilers are available for a wide range of platforms, including workstations, mainframes, and supercomputers. This makes it easy to port FORTRAN CFD codes to different computing platforms.
  4. Libraries: There are a number of well-established FORTRAN libraries available for CFD, such as PETSc and FEniCS. These libraries provide a wide range of functionality for solving CFD problems, such as mesh generation, linear solvers, and flow visualization.
While FORTRAN is a powerful language for writing CFD codes, it is also a relatively old language. It can be more difficult to learn and use than newer languages, such as Python and C++. However, for many CFD researchers and practitioners, the performance, maturity, portability, and libraries available for FORTRAN make it the best choice for writing CFD codes.
  • asked a question related to Fortran
Question
2 answers
Hello everyone.
I am trying to do an analysis with abaqus and I define my material properties using a UMAT file. The analysis used to be perfectly done using older versions of abaqus (2016). But since I upgraded my abaqus to 2021 and liked that to Fortran through Intel OneAPI 2021 (successfully), I can't run the analysis anymore. In the log file, it shows that compilation is succesful, but right after " Analysis Input File Processor completed successfully." I receive an error "Abaqus/Standard Analysis exited with an error - Please see the message file for possible error messages if the file exists. Job Job-1 aborted due to errors." The annoying part is that no message file is generated and the no specific details are recorded on the log file.
PS. I can successfully run other simulations with umat files such as the ones in Abaqus documentation.
Thanks very much for any feedback.
Relevant answer
Answer
I was running into a similar issue and this forum post helped me:
  • asked a question related to Fortran
Question
1 answer
I am seeking assistance on ResearchGate for debugging a Fortran program using gdb. The program consists of multiple subroutines written in different modules. Whenever I attempt to step into one of the subroutines to examine the underlying calculations, gdb encounters the following error: "Thread 1 hit Breakpoint 1, hardening::hardmodel10 (iphase=1, nslip=12, temp=298, dtime=0.0099999997764825821, g12=79800, burgerv=..., totgammasum=8.3999999999999995e-05, gammadot=..., pdot=0, gammadot_slip=..., gammadot_climb=..., absrss=..., signrss=..., rss=..., nidot_climb=..., didot_climb=..., climbmodel=1, climbparam=..., hardeningmodel=1, hardeningparam=..., hintmat1=..., hintmat2=..., tauc_t=..., loop_t=..., rhomobile_t=..., rhoimmobile_t=..., rhototal_t=..., ni_t=..., di_t=..., drhomobile=..., drhoimmobile=..., dni=..., ddi=..., dloop=...) at ../UMAT/hardening.f:795" The following error message is displayed: "../../gdb-10.2/gdb/gdbtypes.h:527: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) [answered Y; input not from terminal] ../../gdb-10.2/gdb/gdbtypes.h:527: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) [answered Y; input not from terminal]." I would greatly appreciate any assistance in resolving this issue.
Relevant answer
Answer
This might be your problem... FORTRAN is different from most other programming languages in that all parameters are passed by reference (pointers). This includes constants (e.g., pi or 298° and even 0.0). To prevent changing the value of pi or zero (yes, it is possible in FORTRAN to change zero) modern compilers have the option to place constraints on some variables passed by reference. If you try to pass something like T=298 call sub1(T) and it croaks, try call sub1(298.) Check the documentation for the library you are using. This would be consistent with the message, "Assertion `m_kind == PROP_CONST' failed"
  • asked a question related to Fortran
Question
2 answers
I am currently working on improving one of my code and considering transforming my Fortran code to Julia. In your experience, what are the potential benefits of converting Fortran code to Julia? Are there any specific challenges or considerations that I should be aware of when converting Fortran code to Julia?
Thanks
Relevant answer
Answer
I have written 141,910 lines of assembler, 461,900 lines of FORTRAN, and 2,589,546 lines of C, for a total of 4202 code modules and over a thousand programs; so I speak from considerable experience. Forget Julia. Translate the FORTRAN into C. I have converted hundreds of thousands of lines of my own code and that of others from FORTRAN to C. There are tools to help. Cobalt Blue is good. Any of these will require considerable editing before the code is ready to compile. FORTRAN and C are both very fast and efficient. Silly novice languages like Julia and Python are pathetic and inefficient. You can find free library functions to do most anything in C online. Digital Mars is a wonderful free C compiler written by coding pioneer Walter Bright. You can use MS Visual Studio free too. If you're stuck with LINUX you'll have to use GNU.
  • asked a question related to Fortran
Question
1 answer
The error is Cannot read module file ‘yaml_output.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
Relevant answer
Answer
  • asked a question related to Fortran
Question
2 answers
Hi, I have a Fortran Code and in there is a variable which I have to change every time when I run the code. For this I created a Makefile. How can I run the code from Makefile using a loop for different values of this variable. I have uploaded the Makefile, the variable is KE in line 31.
Relevant answer
Answer
To run your Fortran code with different values of a variable using a loop in your Makefile, you can utilize a target that runs the code with each desired value. Here's an example of how you can modify your Makefile:
# Compiler settings
FC = gfortran
FFLAGS = -O2
# List of values for the variable
KE_VALUES = 1 2 3 4 5
# Target to run the code with different values
run: $(foreach ke,$(KE_VALUES),run_$(ke))
run_%:
$(FC) $(FFLAGS) -DKE=$* -o your_executable your_code.f90 ./your_executable
.PHONY: run $(foreach ke,$(KE_VALUES),run_$(ke))
In the above example, the variable KE_VALUES contains the different values you want to assign to the variable KE. Each value corresponds to a separate target (run_1, run_2, etc.), and the run target is defined to depend on all of these targets.
The run_% target compiles your Fortran code with the specific value of KE defined by the % placeholder. It uses the -D flag to define a preprocessor macro (KE) with the corresponding value, compiles the code, and then executes the resulting executable. You will need to replace your_executable and your_code.f90 with the appropriate names for your code and executable file.
To run the code with all the values of KE, you can simply execute make run in your terminal. Each value of KE will be used in turn to compile and run the code.
Make sure to adjust the compiler settings (FC and FFLAGS) according to your Fortran compiler.
  • asked a question related to Fortran
Question
3 answers
here is my program:
real a(2,240)
integer i,j
if (TIME(2).EQ.0) then
!读入温度数据
open(12,file='temperature.txt')
do i=1,240
read(12,*) a(:,i)
print*, a(:,i)
end do
close(12)
end if
! 对应时间步长
do j = 1,240
if (TIME(2).EQ.a(1,j)) then
SINK = a(2,j)
exit
else
SINK = 0
end if
end do
but in the job.log i find the result of print is all zero. why!?
here is my txt:
0 28.7100000000000
0.500000000000000 28.3600000000000
1 28.0300000000000
1.50000000000000 27.6100000000000
2 27.4900000000000
2.50000000000000 27.0800000000000
3 26.7400000000000
3.50000000000000 26.7200000000000
....
119.500000000000 24.3700000000000
120 24.3300000000000
Relevant answer
Answer
I copied the data plus filled in the missing range (4 to 119) with something reasonable. The data are in temperature.txt Then I pasted the code into PROG.FOR, compiled it with Digital FORTRAN, and ran it. The compiler messages and program output are in output.txt. I included the program (PROG.FOR) and the compiled Windows 32-bit executable (PROG.exe) in the attached archive. Also, if I interpreted the data correctly, there are 241 values, not 240.
  • asked a question related to Fortran
Question
1 answer
I want to install arpack-ng(https://github.com/opencollab/arpack-ng). I am using open PBS Linux cluster without sudo permission. All of my libraries are installed in non-default directory, like g++, gfortran, openmpi, eigen, anaconda, python almost everything is in non-default directory. In this case how to install arpack-ng?
I have tried to install Using autotools(uses ./configure), but it always failed in every possible way I have tried in the cluster. The problem mainly arises at time when I run ./configure command. Whereas when I have tried in my local machine where most of the things are installed in default directory, then I was able to install arpack-ng in non-default directory
Relevant answer
Answer
Hi, Debamalya Dutta, If you have anaconda installed, you can install it to your virtual environment from the conda-forge channel:
This may not be the latest release, or the most optimized, but a good place to start.
  • asked a question related to Fortran
Question
5 answers
I am seeking to solve a first-order complex matrix differential equation of the form dy/dt=c.H.y, where H is a complex matrix with complex elements, and c is a complex number. Python and cpp offer built-in libraries like 'odeint', 'solve ivp', and 'boost odeint' that can tackle this problem with ease. However, I am facing a challenge finding a suitable package in Fortran that can handle complex numbers and solve this type of ODE effectively. I have explored options such as 'odepack', but it can't handle complex numbers.
Your assistance will be much appreciated.
Relevant answer
Answer
I highly recommend the subroutine 'zvode.f' (https://www.netlib.org/ode/zvode.f).
  • asked a question related to Fortran
Question
2 answers
Hello Researchers
I would like to perform the 2D simulation of a PVT system with fins using FORTRAN. I therefore ask for help for anyone who has it or who knows a website where I can find it. The code can also be in PYTHON or MATLAB.
Thank you
Relevant answer
Answer
Hello Researchers
Can you help me find a FORTRAN code that simulates a PV module with fins or PVT sensor with fins?
I would like to perform the 2D simulation of a PVT system with fins using FORTRAN. I therefore ask for help for anyone who has it or who knows a website where I can find it. The code can also be in PYTHON or
I’m going to use this to write my own code. Thank you again
  • asked a question related to Fortran
Question
4 answers
I made this question because the sum with reduction(+...) is made in a different order of threads and the results are not exactly the same each time I run the code.
Relevant answer
Answer
There is an entire field of mathematics regarding error accumulation during automated iterative operations employing floating-point numbers. It is a huge issue, to be sure.
Let me brainstorm a bit .....
If the results MUST be EXACTLY the same then some means is needed, as you originally said, to ensure parameter summation takes place in exactly the same sequence. Also implied is that sub-iterations and calculations also occur in the same order. That is a matter of programming and communication between processes and will be expensive in terms of runtime and message interchange.
Not being familiar with the calculation you are carrying out, I am wondering if "the same" can be defined as "within a given tolerance". If the result is within a given tolerance then it is said to be "the same". Why must the result be EXACTLY the same? Would it be "the same" if the result were rounded to a smaller number of decimal places? What is the smallest number of decimal places within the model's input data and parameter initialization? That is the number of valid decimal places in the result.
A small bit of mitigation might be to consider "floating point numbers". It has been a very long time since I worked with Fortran and I am not equipped for it here. Does Fortran have various word sizes for floating point? In C there is float and double, for instance. Both are floating point but double will accommodate larger numbers and more decimal places. Be aware that the word sizes for float and double are the same under certain compilers. In that case, there would be no change in accuracy.
How long does a run take on one core? Are you doing multiple runs using different initializations and data? Is it possible that the multiple runs could be done using one core, the results saved, and a report on results produced after all runs are finished? In that way, multiple arrangements of data and configuration parameters are assured of all being done in the same sequence of operations, as the model adapts to the data and initialization.
  • asked a question related to Fortran
Question
2 answers
Abaqus is a popular finite element analysis software used for simulating a wide range of engineering problems. One of the unique features of Abaqus is the ability to incorporate user-defined subroutines into the simulation process, allowing for more customized and specialized analyses. However, not all versions of Fortran may be compatible with Abaqus for running these user subroutines.
This research question seeks to determine which versions of Fortran are supported by Abaqus for running user subroutines. Specifically, the focus will be on whether Abaqus supports Fortran77, Fortran90, or Fortran95. The answer to this question will be valuable for researchers and engineers who wish to use Abaqus and develop user subroutines using Fortran, as it will inform their choice of programming language and ensure that their code is compatible with the software.
Relevant answer
Answer
@Yunda Dong How to change the environment file
  • asked a question related to Fortran
Question
6 answers
Hi everybody,
I have a problem about applying Thikonov regularisation: Is there a program addressing this issue (Fortran or Mathematica)
Regardswith
Abdelmalek
Relevant answer
Answer
Here are the answers generated by ChatGPT:
My request is:
"
I have a problem about applying Thikonov regularisation: Is there a program addressing this issue (Fortran or Mathematica).
"
The answer by ChatGPT:
"
Yes, both Fortran and Mathematica have built-in functions that can be used to apply Tikhonov regularization.
In Fortran, you can use the LAPACK library which includes routines for solving linear systems with Tikhonov regularization. The specific routine you would use depends on the type of matrix you are working with. For example, if you have a dense matrix, you could use the DGELS routine, while if you have a sparse matrix, you could use the LSQR routine. You would need to set the regularization parameter and the type of regularization matrix you want to use.
In Mathematica, you can use the built-in function Regularization to apply Tikhonov regularization. The function takes as input the data matrix, the target vector, and the regularization parameter, and returns the regularized solution. You can also specify the type of regularization matrix you want to use.
Here's an example of using the Regularization function in Mathematica:
Mathematica example code:
data = {{1, 2}, {3, 4}, {5, 6}};
target = {7, 8, 9};
regParam = 0.1;
regMatrix = IdentityMatrix[2];
Regularization[data, target, regParam, regMatrix]
This would apply Tikhonov regularization with the identity matrix as the regularization matrix and a regularization parameter of 0.1 to the data and target vectors.
"
Another request by Me:
"
according to the pervious question, give me a Fortran program for Tikhonov regularization.
"
The answer produced by ChatGPT:
"
Sure, here is an example Fortran program that uses LAPACK's DGELS routine to solve a linear system with Tikhonov regularization:
Fortran example code:
program tikhonov
implicit none
integer, parameter :: n = 3 ! size of the linear system
real :: a(n,n), b(n), alpha ! data matrix, target vector, regularization parameter
integer :: i, j, info
real :: work(2*n), rcond
! initialize the data matrix and target vector
a = reshape((/1, 2, 3, 4, 5, 6, 7, 8, 9/), [n,n])
b = (/10, 11, 12/)
! set the regularization parameter and regularization matrix
alpha = 0.1
do i = 1, n
do j = 1, n
if (i == j) then
a(i,j) = a(i,j) + alpha
end if
end do
end do
! solve the regularized linear system using DGELS
call dgels('N', n, n, 1, a, n, b, n, work, 2*n, info)
! check for errors
if (info /= 0) then
print *, 'Error: DGELS returned info =', info
stop
end if
! print the regularized solution
print *, 'Regularized solution:'
do i = 1, n
print *, b(i)
end do
end program tikhonov
In this example program, we set the data matrix and target vector to some sample values, and then set the regularization parameter alpha and regularization matrix by adding alpha to the diagonal of the data matrix. We then use the LAPACK routine DGELS to solve the regularized linear system. Finally, we print the regularized solution. Note that this program assumes a dense matrix, but you could use a different LAPACK routine for sparse matrices.
"
May it be helpful.
  • asked a question related to Fortran
Question
1 answer
Greetings to all.
I have a fortran program that changes the mass diffusion result ,i.e- It reads the record key of the mass diffusion results database and changes it from normalized concentration (key 221) to nodal temperature(key 201). So that I can use that data as predefined field for new simulation.
But, I am not getting any idea on how to use that fortran file(ABQMAIN), as it doesn't work similar to other user-defined program (UTEMP,UMAT,UEL etc) files.
Any tips will be appreciated.
Relevant answer
Answer
Load the shared library or DLL into Abaqus by adding a "user subroutine" to your input file. This is done by adding a *USER subroutine_name statement to your input file, where "subroutine_name" is the name of your subroutine.
Use the output from your Fortran program in your simulation by specifying it in the appropriate section of the Abaqus input file.
  • asked a question related to Fortran
Question
2 answers
I have been trying to model a reaction using LHHW kinetics in radfrac column but found that Radfrac does not recognize the LHHW kinetics. Please guide how I can incorporate (maybe using Fortran) or any other way.
Thanks
Relevant answer
Answer
Thank you for your feedback!
However, I did not find any options you mentioned "User Kinetics" for LHHW it only has the kinetic term provision, not for the adsorption and driving force term.
Could you please share the image if possible?
Thanks a lot!!
  • asked a question related to Fortran
Question
6 answers
Could someone suggest a free, easy-to-install Fortran compiler that I may use to execute an F90/F77 Fortran program?
Relevant answer
Answer
It’s the computer’s fault, nothing wrong with you ;!) But seriously, if you are using Windows and VS, it looks like only the Intel oneAPI Fortran compiler will work easily. These links may help clarify:
you need the Intel oneAPI base and HPC toolkits.
Good luck. Windows is probably not the easiest environment in which to do Fortran programming.
Now, that having been said, if you have and can use Linux it could be a better environment for working with older Fortran code. There is a world class set of development tools and widely used practices for Fortran development on Linux. Again, these folks have a good intro to compiling and linking programs on Linux: https://fortran-lang.org/en/learn/building_programs/compiling_source/
Cheers
  • asked a question related to Fortran
Question
1 answer
In vmf data server https://vmf.geo.tuwien.ac.at/, there is fortran and matlab source code to interpolate vmf1 at given location using 2.5o x 2o grid data. I needed that source code in python scripting.
Relevant answer
Answer
Shanker KC The Vienna Mapping Function 1 (VMF1) is a model for explaining the atmospheric mapping function used in the placement of Global Navigation Satellite Systems (GNSS). It is used to compensate for atmospheric refraction in GNSS signals. Typically, the VMF1 is provided as a grid of coefficients that may be used to interpolate the mapping function at a particular position and time.
There is no Python version of the VMF1 grid interpolation technique that is directly similar to the fortran or matlab code you cited. However, the old code may be converted to Python. To encapsulate Fortran or C code as a Python module, use tools like f2py or cython. You may then call the Fortran code from Python.
You might also attempt manually translating the Fortran or Matlab code to Python. This may take a little longer, but it will give you more control over the final implementation.
It's also worth noting that various Python packages, such as Scipy's interpolation routines (e.g., Rbf, interp2d) or other more specialized programs like PyInterp, might be used to interpolate the grid data and give a comparable solution.
If you are unfamiliar with fortran or matlab and are having problems translating the code, you may consider seeking assistance from someone who is acquainted with both languages and can assist you with translating and optimizing the code.
You might also attempt manually translating the Fortran or Matlab code to Python. This may take a little more time, but it will be worth it. Keep in mind that the performance of the Python implementation may differ from that of the Fortran or Matlab implementations, necessitating some optimization and tuning.
  • asked a question related to Fortran
Question
1 answer
Hello
I am having issues with the fundamentals of uel subroutine. So the FORTRAN code I developed was for the plane stress problem but when I use that same subroutine for a plane strain problem by just changing the constitutive matrix (C matrix), it is not giving the correct results as compared to ABAQUS. I am sorry this problem is bugging me for some days! If you can give me your insights I will be really really grateful to you. Thank you very very much I am sorry again this is the zip file where I added the FORTRAN file and input file both for Abaqus and for the subroutine, I am surely doing some mistakes if you can let me know I will be very grateful to you.
Relevant answer
Answer
i SEE NOW SOW i SUGEST TO SEE DIFRENCY BETVEN DESPLASMENTS AND SAME MATRIX IF YOU CAN FIND MY FRATELLO ANOTHER COMP PROGRAM TRY TO START AGAIN SEE ADVANCE FORTRAN OR MAT LAB OR PLAXIS, HOPE THAT THI WILL HELP YOU AND MUCH LUCK TOMOROW I WILL SEE TO START AND TO FIND MISTAKE IN DETAIL!
  • asked a question related to Fortran
Question
2 answers
Hi,
I am trying to installing CHARMM in Ubuntu 18.04. After providing with make command, I am getting the following error:
/usr/bin/ld: libcharmm_c.a(cstuff.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: libcharmm_cxx.a(uninf.cpp.o): relocation R_X86_64_32 against symbol `_ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/charmm.dir/build.make:103: recipe for target 'charmm' failed
make[2]: *** [charmm] Error 1
CMakeFiles/Makefile2:219: recipe for target 'CMakeFiles/charmm.dir/all' failed
make[1]: *** [CMakeFiles/charmm.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
What will be the solution to this?
  • asked a question related to Fortran
Question
2 answers
Hello all,
I am struggling with correcting my Fortran code for the USDFLD subroutine. From the log file it does seem like there is an issue with the line continuation. However, I am not able to solve the same. Any help will be appretiated.
I am attaching the log and .for files for your reference.
Cheers!
Ahaan
Relevant answer
Answer
Turns out removing the Tabs solved the compilation issues. Thanks a lot!
I really did not know that Fortran has an issue with using tabs instead of spaces!
Regards,
Ahaan
  • asked a question related to Fortran
Question
3 answers
I am trying to use Fortran code to solve flow fields inside a 3d nozzle, but I currently just have 2d codes. I found it difficult generating 3d mesh using Fortran codes and want to find a way to transform the mesh format of ICEM or Pointwise or Gambit mesh into mesh format that can be read by Fortran. Can any of you provide some suggestions in how to do that?
Relevant answer
Answer
I can see one problem:
OPEN(UNIT=7,FILE=FILGRD,FORM='binary')
You should never use binary for something like this. If you're stuck with the file, write a small FORTRAN program to read binary and write text, as shown in the figures above. If you have the vertices and need the centroids, a small FORTRAN code with two loops can easily do that. I expect that reading and writing the boundary conditions will be more involved than the nodes and elements, but that too can be accomplished in FORTRAN.
  • asked a question related to Fortran
Question
3 answers
I have a code for the analytical potential energy of a system written in Julia. I want to convert this to FORTRAN. I searched a bit but couldn't find much. I got a lot of sources to convert Julia to Fortran, but not the other way around.
  • asked a question related to Fortran
Question
4 answers
Hello, I need help getting a code in python or Fortran for elastic stiffness to calculate the shear modulus at varying mean effective stress by the Hardin formula in Abaqus. Can anyone help regarding this, or else from where I can learn to code?
Regards,
Manisha
Relevant answer
Answer
  • asked a question related to Fortran
Question
3 answers
Update:
I found the correct file that correctly compiles but I am still confused on how to "Read" in values to the program from the given text file. Attached below is the correct fortran file. I noticed that every READ command has a * where the filename is supposed to be. Should I replace each of these stars with the location of the sample data before compiling? Or is there some command I can use after compiling to use this text file as input data?
I recently downloaded the LEVEL16 Fortran program posted on Bob LeRoy's website (http://scienide2.uwaterloo.ca/~rleroy/LEVEL16/) and is also accessible in the following github repo (https://github.com/HPQC-LABS/LEVEL), and after reading the program guide, I am still confused on how to actually use the program.
I understand that I need to compile and somehow run it with a Fortran Compiler. I have never used Fortran before and I am not sure if I need to first compile the helper functions. It would be helpful if someone who is experienced in fortran or has previously used this program could walk me through the setup up to running the program on the sample input files. The guide says that it begins by "reading in the values" however, how can I read in values that are in a separate text file? Right now, I am trying to compile 2016LEVEL.f and I do not really know how to do it.
A copy of the sample data is attached below.
Relevant answer
Answer
I found the correct file that correctly compiles but I am still confused on how to "Read" in values to the program from the given text file. Attached below is the correct fortran file.
  • asked a question related to Fortran
Question
2 answers
I want to open, read and write dat files during the simulation in abaqus subroutine code. I need to open the file in Direct Access mode. But when I do format labeling in subroutine code written in Fortran, the code prodiuces the labeling error. Please look the attached screenshot for code the produced error. Appriciate for a help!!
Relevant answer
Answer
Hello. As mentioned by David, the error message does seem to point to a Fortran syntax error in your code. Are you using a ".f" extension on your source code file?
Your Fortran code appears to be written in free-format source form. However, the compiler expects your code to be written in fixed-format source form. This relies on very specific formatting: statement numbers in columns 1-5, continuation characters in column 6, and statement text in columns 7-72. From the snippet of code you posted, it does appear that your Fortran code is being written under the assumption that statements are written in free-format source form. In your case, the FORMAT statement begins before column 7. When free-format code statements are interpreted in the fixed-format source form, they will generally result in quite cryptic-looking syntax error messages.
I am unsure what sort of Fortran source form Abaqus expects, if any. If you wish to continue to write code in free-format source form, then you can usually specify a compile-time option on the command line to explicitly instruct your particular compiler that the file is using free-format source form. Changing the file extension to something like ".f90" or ".f95" may also trigger automatic handling of the file in free-source format.
In any case, take a closer look at the guidance offered by the compiler vendor in the Fortran users manual. That should explain what's going on in greater detail.
  • asked a question related to Fortran
Question
3 answers
Greetings to all.
I am new to UMAT in Abaqus and want to create UMAT for "shell" elements for an isotropic and anisotropic material, can anyone suggest any reference material, book, or website link which can help me.
Thank You
  • asked a question related to Fortran
Question
4 answers
Anybody knows how to change the density of materiel during a deformation process in a specific strain range, for example (when strain raise from 0.1 to 0.2) using VUMAT ABAQUS subroutine?
Relevant answer
Answer
Martin Veidt : Thank you for your comment, but there is no density dimension in the VUSDFLD subroutine nor Strain.
Based on what dimension density can be changed or assumed?
Can you please explain a bit specifically?
  • asked a question related to Fortran
Question
1 answer
I need the .for file for numerical analysis
Relevant answer
Answer
Dear Sandy J. Chaaban,
You can find the files you are looking for and the tutorials with them in the links below:
Best wishes.
  • asked a question related to Fortran
Question
1 answer
Hello everyone
Hope you're doing great.
I'm trying to learn and implement Abaqus subroutines (particularly USFLD) and am struggling with the following Abaqus terms' meanings and applications:
1. field variables
2. material point (and material point quantities)
would please help me out here with the definitions and examples of the above-mentioned terms since I haven't found any useful website links online.
Best regards,
Yunus.
Relevant answer
Answer
Field variables in abaqus are quantities that are used to perform calculations when running user subroutines. They do not describe a specific
physical quantity but are often used to describe solution dependent material properties.
Integration points are referred as material points to distinguish between the
Langragian and Eulerian approach.
  • asked a question related to Fortran
Question
4 answers
Hello dear Professors, Doctors, Programmers, ...
I am a PhD student and I am working on a hybrid photovoltaic/thermal (PVT) solar collector tilted at a given angle. I'm writing python (or possibly fortran) code that solves equations for heat, vorticity, turbulent energy and dissipation rate in two-dimensional transient, laminar and turbulent regime under python (or possibly Fortran ).
Indeed, the work consists in simulating the conjugate thermal transfers (conduction and convection) and the two-dimensional transitory air flow inside the sensor channel. I would like to ask for your help. If any of you have a copy of this code or a website where I can get this code, help me. Thanks.
Relevant answer
Answer
Here is a neat python recipe regarding solving 2D heat equation numerically:
  • asked a question related to Fortran
Question
4 answers
What are the existing frameworks ?
How do you integrate with existing models trained in TensorFlow / Keras Python ?
Relevant answer
Answer
Fortran is a statically and strongly typed language, making it easier to write correct programs
  • asked a question related to Fortran
Question
1 answer
I'm working in relativistic waves and instabilities in anisotropic MHD plasmas but most of the time I'm facing the numerical aspects of the plotting of the analytical findings. so is there anyone helping me with helpinghow can I get the free source codes in FORTRAN or phyton or is interested to work with me and helps in computational aspects?
Relevant answer
Answer
go to github
  • asked a question related to Fortran
Question
3 answers
In the case of simulation of an iterative process (Let's say we have 30 iterations) in which elements' material properties need to be changed after each iteration based on the results (eg. strain field) of the previous iteration, which method is preferred and why?
linking Abaqus & MATLAB or Abaqus scripting and UMAT subroutines.
Regards,
Yunus.
Relevant answer
Answer
In this case, I highly recommend you use ABAQUS scripting. Because it's more convenient than linking ABAQUS with Matlab, and your run time decreases significantly. In this regard, I suggest you use Micro Manger in ABAQUS to write an ABAQUS script.
  • asked a question related to Fortran
Question
4 answers
Hi
I am trying to use built-in user material subroutine using ABQ_PLY_FABRIC in abaqus. upon running it I get the following message:
"Material ABQ_PLY_FABRIC is not supported as a built-in user material. Please use the correct character string for the name of the user material."
Any ideas why I am getting this message please?
My Abaqus version is 2018 and is also successfully linked with Fortran compiler 2017 and visual studio 2015. In fact all verification process is a PASS.
Relevant answer
Answer
It is a built-in subroutine and everything you need to know is in the attached. Also for full understanding of the process read article below where you will find all the details on how it is done.
Regards
  • asked a question related to Fortran
Question
4 answers
Hey Everyone,
I am running an Abaqus simulation with a subroutine and it terminated itself because of "floating point error". I tried after that running the simulation without the subroutine by giving it a material property, that doesn't require any subroutine. (In my case, the subroutine is for viscosity definition that is dependent on temperature and shear stress). With material property that independent to temperature and shear stress (no subroutine required), the simulation runs smoothly. That's why I think the problem has to be in my subroutine. That's why I would like to run a debugger to my subroutine by following the manual from https://www.ichec.ie/support/tutorials/abaqusdebug.pdf .
Following are my questions:
1. What could be gone wrong in subroutine that leads to "floating point error"? Excuse me, if the answer is obvious, because I have no or less experience with fortran. Following is the subroutine:
subroutine vuviscosity (
C Read only -
* nblock,
* jElem, kIntPt, kLayer, kSecPt,
* stepTime, totalTime, dt, cmname,
* nstatev, nfieldv, nprops,
* props, tempOld, tempNew, fieldOld, fieldNew,
* stateOld,
* shrRate,
C Write only -
* viscosity,
* stateNew )
C
include 'vaba_param.inc'
C
dimension props(nprops),
* tempOld(nblock),
* fieldOld(nblock,nfieldv),
* stateOld(nblock,nstatev),
* shrRate(nblock),
* tempNew(nblock),
* fieldNew(nblock,nfieldv),
* viscosity(nblock),
* stateNew(nblock,nstatev)
C
character*80 cmname
C
parameter ( one = 1.d0)
REAL, DIMENSION(nblock) :: n0, T
C
C VARIABLES
n = 0.2647
Tau = 309343
D1 = 1.68413e+13
D2 = 323.15
A1 = 31.206
A2 = 51.6
C
C Cross-WLF viscosity model
C
do k = 1, nblock
T(k) = tempOld(k) + 273.15
n0(k) = D1 * exp (-(A1 * (T(k) - D2)) / (A2 + T(k) - D2))
viscosity(k) = n0(k) / (one + ((n0(k) * shrRate(k)) / Tau)**(one-n))
end do
C
return
end
2. How could I link the subroutine with a debugger? I don't understand the 2nd step of the manual (login to stokes or stoney on two seperate termials). It would be ideal for debugging purpose, if I could read the values stored in variables for the subroutine.
I really appreciate for any input or advice from Everyone :)
Many regards,
Gunardi
Relevant answer
  • asked a question related to Fortran
Question
6 answers
HI everyone .please if can someone help me I need a Fortran program to minimize an expression as a function of two parameters variational
Relevant answer
Answer
complete PDF of FORTRAN Function minimizing expression
  • asked a question related to Fortran
Question
1 answer
If the proximate analysis on a dry basis is equal to 100 then how to put the moisture content in our calculations in the FORTRAN calculator because when I convert the dry basis moisture content into wet basis moisture content then the proximate analysis is not equal to 100. it exceeds 100 value.
the following statement is taken from a research article and proximate and ultimate analysis is given in the pic on dry basis. how to describe the moisture content in my FORTRAN calculator.
when the moisture content of MSS increased from 87 wt% to 95 wt%
Relevant answer
Answer
Zeeshan Ul Haq In general, FORTRAN syntax is comparable to that of other programming languages. To enter a code in Aspen Plus, leave 6 spaces before the first character (the first space is left for the letter "C" which indicates a comment line, and the next 5 is used to give the line an identifying number).
  • asked a question related to Fortran
Question
2 answers
I have the proximate and ultimate analysis of biomass and using this, I want to convert it into conventional components using a reactor like Ryield but I'm not able to do this calculation. Can anyone please help me with how to do it?
Thanks & Regards,
Hari Kiran
Relevant answer
Answer
Hello Hari,
In my experience, unfortunatelly, this is a non-straightforward task. You need to implement a subroutine (i.e. calculator block) which performs the mass balance for the "translation" from the nonconventional compound to the biochemical composition (hemicellulose, cellulose and lignin). In any case, such balance is hardly impossible to be perfectly closed, so the problem should more likely be defined as an optimization which minimizes the difference between the elemental contents of the input and output compounds. As this is quite complicated to explain, I suggest that you check the following paper, which I utilized myself to perform the mentioned task.
  • asked a question related to Fortran
Question
1 answer
I'm currently working on "ammonia.apwz" file, from Aspen Plus examples.
In the Rplug reactor used to simulate an ammonia synthesis reactor, two Fortran subroutines are used to compute the raection rates.
When I try to export the file into Aspen Dynamics, the following error i generated:
"TRANSLATING BLOCK R001-A of TYPE RPLUG:
FATAL ERROR: Referenced reaction object NH3SYN uses Subroutine Type=RPlug-Only. This option is not supported in Aspen Plus Dynamics. Modify the subroutine to conform to conventions recommended for Subroutine Type = General."
How should I have to modify the Subroutine to fix the problem?
Thanks.
Relevant answer
Answer
These articles might be helpful, have a look:
Kind Regards
Qamar Ul Islam
  • asked a question related to Fortran
Question
17 answers
Which programming language is best for Mathematical simulation- Matlab or Fortran?
Relevant answer
Answer
Matlab is very good, a program with very great possibilities and for scientific applications.
  • asked a question related to Fortran
Question
3 answers
For the Fortran program that I build for my fatigue problem, I need to modify the compliance matrix C at each iteration. For that I have on one hand a subroutine UMAT which models the mechanical behavior of the material with the matrix C (implementation of DDSDDE) and on the other hand a subroutine USDFLD which calculates at each iteration the damage D. According to the value of D, the matrix C can change and that at each iteration. For this I have to call the matrix C (or DDSDDE) in the subroutine USDFLD, however DDSDDE is a variable defined only in the subroutine UMAT. How can two subroutines communicate with each other?
Anyone, please help me with that?
Relevant answer
Answer
Camille Le Goff Why do you need to use the USDFLD subroutine? You can access the stiffness and change it in damaged material in UMAT. You can find some examples of how to change the stiffness in damaged material in the following link:
  • asked a question related to Fortran
Question
2 answers
I need to implement a Fortran code using user subroutine in Abaqus for moving heat source model implementing volumetric gaussian laser heat source for multi-track laser scanning. I wrote code for a single track(bead) on a single layer for laser, Even it stopped working for 1 element. Now I need to write code for multi-track on a single layer. I need help regarding this. I didn't even find many resources for it.
AND ONE MORE THING IS SINCE I AM USING A VOLUMETRIC HEAT SOURCE, I SHOULD GIVE THE NAME OF THE VOLUME AS INPUT IN SYNTAX. WHAT SYNTAX IS USED FOR IT(for mentioning surface we use .SNAME=......... so for volume what should we use?)
Relevant answer
Answer
Jack Leonard , Yes Sir
  • asked a question related to Fortran
Question
4 answers
a fortran code with ARPACK library
this is error
Error with _neupd, info= -14 check the documentation of _neupd.
Relevant answer
Answer
When you want an advance search for online forums that have as well elections on Fortran. Stackoverflow would be one of those. There are coders willing to help others with any language and coding problem.
  • asked a question related to Fortran
Question
2 answers
I am writing an UEL subroutine and I also need to write input file for abaqus.u,c,ρ are unknowns variables.
How can I define these boundary conditions in the input file?
Relevant answer
Answer
Please guide me in both cases, I am going to write these boundary conditions in the input file but I do not know how?
For example, I know for uz=0, the displacement is zero and I found the keyword to write in the input file;
*Boundary
peripheral,3,3,0.0
Please help me with ∇c=0 , c∂u/∂t=0.
  • asked a question related to Fortran
Question
8 answers
I have multiple files in a folder which has similar names but with different numerical labelling. For example, the files are named as phi=1_theta=1, phi=1_theta=2, phi=2_theta=1 and so on. The labelling of the file is attached in this question as well. How to write a suitable Fortran code to open these files using loop?
There are overall 16 phis' x 16 thetas' files in the folder.
Relevant answer
Answer
I had the same problem but if you close each file after opening
then it will read all files
  • asked a question related to Fortran
Question
19 answers
I am interested in recovering my knowledge in FORTRAN, but I want to know if it is worth investing the time or better to dedicate myself to another language such as PYTHON
Relevant answer
The question is: many old and yet super-valuable scientific codes were written in FORTRAN. If one wants to use or introduce changes in these codes, this one has to learn FORTRAN. This language also evoluted along the time; do you know FORTRAN 90, for example?
  • asked a question related to Fortran
Question
2 answers
I want to make further study about the material point method in Geotechnical Engineering (such as earthquake), but I don't know which software to choose. I contacted anura3d first, but I still need secondary development to realize the loaded seismic wave boundary conditions(versus time). I just knew the CB-Geo MPM and found that this software seems to meet the requirements. This is my first time learning FORTRAN and C + + , so I want to ask which one is a better choice.
Relevant answer
Answer
Anura3D is easier to use due to the use of the GID interface and its documentation with some examples. On the other hand, CB-GEO is a command line program designed to perform high performance calculations. If you want to run large scale simulations (large number of material points), the answer is CB-GEO. I'm not totally sure the status of these implementations, but I think CB-GEO has seismic and also absorbent boundary conditions working on.
  • asked a question related to Fortran
Question
5 answers
hello guys im kinda new to the unconventional components thus i obtained the ultimate and proximate analysis of my feed , and will enter an Ryield reactor where it will be decomposed based on it's proximate and ultimate analysis components while using fortran. I am stuck here i dont know how to continue and how to make my streem decompose in the Ryield
thank you for your help and guidance
Relevant answer
Answer
i want to simulate aspen plus model for rice husk there is some error in the Ryield. can someone help me.
  • asked a question related to Fortran
Question
3 answers
Dear all,
I’m a PhD Student and I work on a finite-element solver (LS-Dyna). It features user-defined subroutines with Fortran programming. In order to use my own subroutine, I need to compile the solver again with their pre-compiled libraries and my added Fortran code.
I need to use a specific compiler version ex : ifort130/ifort170 pgi165... If I don’t use the correct version, I get errors :
"error #7614: A common block name may appear in an OpenMP THREADPRIVATE directive only after the last COMMON statement which specifies the same common block name."
I don’t fully comprehend the issue and I don’t have the background knowledge on THREADPRIVATE behavior nor the time to investigate.
Basically I use their pre-coded Fortran file (made for a specific Fortran compiler version) files and I add my code and it work perfectly. I fear that changing some part of this file might lead to issues with the rest of the code.
The issue I got is that with the new Intel license policy I only get the latest Fortran Compiler version with the new OneAPI software.
I would like to know if Intel gives access to the previous older ifort version, when I get a proper paid license? This would be the easiest way, as LS-Dyna didn’t update their files to the latest versions.
Relevant answer
Answer
Here is my final solution to the problem as I replied in Intel Forum:
-------------------------------------------------------------------------------------------
Dear all,
Thanks you for your time. But unfortunately, I don't have access to the rest of the code to make it compatible with the latest compiler version.
However, I managed to compile both MPP and SMP version of the solver. If someone else have the same issues here are the steps with a virtual machine (Ubuntu 20.04.02) :
As of now, LSTC released "sharedlib" version of the MPP solver. Meaning, we only need to compile the FORTRAN subroutines with any compiler.
I managed to do it with the latest OneAPI version. Here are the steps :
For MPP ls-dyna version : ls-dyna_mpp_d_r10_1_123355_x64_centos65_ifort160_avx2_openmpi1.10.7 (sharedlib version)
1) Install MPI library and define the correct path eg : openmpi-1.10.7 (build tar from ftp lstc : https://ftp.lstc.com/user/mpp-dyna/Tools/OPEN-MPI/openmpi-1.10.7_build.tgz ) eg : put openmpi-1.10.7 folder in /opt/
add openMPI folders to PATH and LD_LIBRARY_PATH temporarily (run command each time ) or permanently in starting bash file eg /.bash.sh  export PATH=$/opt//openmpi-1.10.7/bin:$PATH  export LD_LIBRARY_PATH=$/opt/openmpi-1.10.7/lib:$LD_LIBRARY_PATH
2) install FORTRAN compiler eg oneapi base + oneapi HPC
5) compile make
6) install ls-dyna mpp sharelib (sh extractor from lSTC or DynaS+) 6.1) put umat.so in a folder and add to the library path (REAMDME_howtosetup.so.txt): export LD_LIBRARY_PATH /path/to/my_own/usermat/lib:$LD_LIBRARY_PATH
However, as I have a still running Parallel Studio XE licence for Linux, I tried with the oldest version I had in my archives : PSXE 2017 Update 8
In this version, there is the ifort 2017. The latest files from LS-Dyna are for the ifort160. By changing just the way INTEGER*8 is declared in the UMAT code, I managed to compile a working version of the SMP solver (ls-dyna_smp_d_R12_0_0_x64_redhat65_ifort160).
1) install Parallel XE 2017 (Parallel XE has been replaced by oneAPI 2) Each time you need to compile, you have to add environment variables : source opt/intel/parallel_studio_XE_2017.8.066/bin/psxevars.sh
3) Install libX11-dev sudo apt-get install libx11-dev
4) change makefile paths as : #FC=/opt/intel/compilers_and_libraries_2016/linux/bin/intel64/ifort -qopenmp FC=/opt/intel/compilers_and_libraries_2017.8.262/linux/bin/intel64/ifort -qopenmp
#LD=/opt/intel/compilers_and_libraries_2016/linux/bin/intel64/ifort -qopenmp -sox LD=//opt/intel/compilers_and_libraries_2017.8.262/linux/bin/intel64/ifort -qopenmp -sox
#LF= -static-intel -L/usr/X11R6/lib64 -lX11 -qopenmp -lrt -lstdc++ -lpthread -lstdc++ -lpthread LF= -static-intel -L/usr/lib64 -lX11 -qopenmp -lrt -lstdc++ -lpthread -lstdc++ -lpthread
It is important to note that most of these steps are described in the README files in LSTC ftp server.
Mohamed Maamir
  • asked a question related to Fortran
Question
5 answers
Does anyone know where I can get any free 3-D smoothing spline code for irregular data in fortran?
I've used 1-D and 2-D code from Inoue, H., 1986: A least-squares smooth fitting for irregularly spaced data: Finite-element approach using the cubic B-spline basis. Geophysics, 5, 2051–2066.
cheers, arthur
Relevant answer
Answer
Thanks for raising such an interesting question. Probably some people would be interested in the following special issue.
"Modern Geometric Modeling: Theory and Applications II" (IF=2.258) (Deadline: February 28, 2022)
The scope of the Special Issue includes but is not limited to original research works within the subject of geometric modeling and its applications in engineering, arts, physics, biology, medicine, computer graphics, architecture, etc., as well as theoretical mathematics and geometry which can be applied to problems of geometric modeling. For this Special Issue, we plan to accept the following types of manuscripts:
  • Overviews;
  • Research manuscripts;
  • Short manuscripts which discuss open problems in geometric modeling.
  • asked a question related to Fortran
Question
4 answers
I am trying to calculate the mean squared displacement and had written a code in fortran. I wrote this code using a reference book by Daan Frenkel and Berend Smit on Molecular Dynamics Simulation. I am having a hard time in getting the exact plot as proposed for a particular system. Can anybody have a look at it and suggest me where I am doing wrong in calculating the Mean Squared displacement as function of time.
Also, I would like to mention a little detail of the code. I used Origin shift method here in code where "i1" is for origin shift and calculating particles displacement over (total_time - 1) for all the particles present in a simulation cell. First, I am averaging over the number of data points (tau) accumulated (due to the shift of origin) for each atom for a particular origin (i1) in loop and finally after accumulating it over total number of particles (ntotal) and averaging it(ensemble_avg).
Relevant answer
Answer
I would like to share an article that helped me with the code for mean squared displacement calculation. Hope this will help others who are facing issue with the concept.