Science topic

Fortran 90 - Science topic

Explore the latest questions and answers in Fortran 90, and find Fortran 90 experts.
Questions related to Fortran 90
  • asked a question related to Fortran 90
Question
8 answers
I need to know what's going on inside a Fortran code which is not originally mine. I have a linux system and I tried the gdb debugger with some breakpoints but it didn't work( the compiler didn't compile it with -g).
I also tired using print for my variables in order to use them for plotting but after adding some lines of "print*, " syntax, the compiler again showed some errors and didn't show me any results.
I would be grateful if anyone can help me on this problem.
Relevant answer
Answer
Thanks a lot. I'll try it and see if it works.
  • asked a question related to Fortran 90
Question
1 answer
I am trying to develop a UELMAT for a steady heat transfer analysis. My problem is that my element doesn't work when convection interaction is applied to it. I have tried both to apply this concentrated interaction in the nodes (since superficially it does not work in user-defined elements) and trying to add the FILM subroutine inside the UELMAT subroutine. In all it returns me the nodal temperature as 0 in all the nodes.
Relevant answer
Answer
Umat to script load and interaction film conditions
  • asked a question related to Fortran 90
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 90
Question
4 answers
How we can read HDF-files in f90?
Relevant answer
Answer
F90 seems to require a link library to read the HDF or NetCDF
  • asked a question related to Fortran 90
Question
4 answers
Recently I have wrote a UMAT to deal with relately large arrays(nearly 500*500 double precision) I/O, and I have also appointed the property Depvar as 1000.
However, I encounted the error code 1073741571.
I have searched and found that the heap array size could be adjusted by /heap-arrays:[size].
I have tried but only failures. Could anyone familiar with this give some useful advice? I will owe my gratitude.
Relevant answer
Answer
Dear Fen Fam,
Rename the mkl_avx2.dll in (C: \SI MU L I A\Abaqus\6.14 – 5 (your Abaqus version may be different\code\bin) to mkl_avx2.dll.11.0.0.1.
If the issue is not resolved contact Abaqus support.
Best regards,
Hamed
  • asked a question related to Fortran 90
Question
9 answers
I am writing a new plasticity model in Ansys Explicit Dynamics using AUTODYN as solver for Bilinear Isotropic Hardening model but any how unable to add this particular material model code, as I need MATDEF code for above model.
It will be a great help if anyone can help me to write that particular code. So as to define my model and get in continuation with my research.
Relevant answer
Answer
Hi Karan,
Aside from the suggested answers, you can also use AceGen in Mathematica.
Best,
Romik
  • asked a question related to Fortran 90
Question
1 answer
Hello All,
I am interested to write finite element code to solve the Cyclic Symmetric Modal Analysis of a disk. I want to understand the Cyclic Symmetric Modal Analysis in details and want to write FE code to solve the modal analysis problem.
Please share any suitable reference paper or fortran/matlab/python code which would help me in this.
Thanks a lot
Best Reagrds,
Ravi
Relevant answer
Answer
If I remember correctly, the textbook "Concepts and applications of finite element analysis" by Cook et al. contains a concise section on cyclic symmetries that may help you.
  • asked a question related to Fortran 90
Question
10 answers
The ANN with a backpropagation algorithm is enough, this ANN will be used under the Fortran 95 and Python languages.
Best regards,
Ender Araujo.
Relevant answer
Answer
It is worth checking out the language Julia. It is as easy as python, and so far at least for my atomistic Monte Carlo and Molecular Dynamics codes, is as fast as Fortran. When it is slower than Fortran the difference is measurable in percentage, never order of magnitudes. Also, I find it to be significantly faster than python + numba. However, a skilled user in python can make it much faster. The thing I like about Julia is it starts out fast, and a skilled user can make it even faster :)
As for ANN, this is out of my field but there seems to be more and more options for it in Julia.
to link a couple of possibly useful sources
Just my 2 cents
  • asked a question related to Fortran 90
Question
6 answers
I need to generate a Makefile for Linux compilation with gfortran.
Relevant answer
Answer
I think it is a no-brainer, just moving to the text editor and choosing the g++ or whatever compiler and following the syntax-defining variables and following implicit rules, makefiles aren't long enough to confuse. The syntax lines are usually very easy to follow.
Assuming:
Idontknowhowtomakefiles: Idontknowhowtomakefiles.o g++ -o Idontknowhowtomakefiles Idontknowhowtomakefiles.o Idontknowhowtomakefiles.o: Idontknowhowtomakefiles.cpp g++ -c Idontknowhowtomakefiles.cpp
Substitute Idontknowhowtomakefiles with x and life should get better.
Compile:
Run: make
  • asked a question related to Fortran 90
Question
2 answers
Hello,
I can't compile WIMSD5B source code from NEA Data Bank both with g95 compiler (Windows) and gcc/gfortran (Linux). Compiler gives me a lot of different warnings, e.g.
  • Warning: Type mismatch in argument ‘a’ at (1); passed INTEGER(4) to REAL(4) [-Wargument-mismatch] Wimsd5b.for:1063:13:
  • Warning: Label 42 at (1) defined but not used [-Wunused-label] Wimsd5b.for:27707:5:
etc.
Any advices or instructions on how to compile WIMSD5?
Thanks,
-Igor
Relevant answer
Answer
Hello Dr. Vanagas,
I found an error in the NEA DB loadsrcnea.bat file... And after I fixed it, I compiled the code in Windows 10 x64 using Lahey/Fujitsu Fortran compiler trial version.
The error is on line 359. One should replace cd /prog with cd prog
  • asked a question related to Fortran 90
Question
3 answers
Need to replace MINPACK ODE solver in an old Fortran code of Nuclesythesis in Supernovae II. What could be the best choice for sparse matrices?
Thanks for your suggestion.
Relevant answer
Answer
I was looking for something less generic, to avoid lot of work i customization and to have good performances. It was a long time ago since I used Numerical Recipes, I'll refresh my memory and take a look at it anyhow.
  • asked a question related to Fortran 90
Question
3 answers
I would like to write data in fortran (90 and onwards including 2008) binary format to get the result much quickly and convert into text file so that data can be visualized using Matlab or R.
Relevant answer
Answer
Dear Marcus,
thank for the answer. I had gone through those link. I would like to if ask is there way to convert fortran binary file into text file without any alteration ?
  • asked a question related to Fortran 90
Question
9 answers
I want to make a water ON for 1 minutes and OFF for desirable minutes depending on temperature and relative humidity. The OFF interval will vary with the weather.
Relevant answer
Answer
@ Ishara
If you want to make flow of conditions time dependent, you need to use the subroutine as follows, for example to pause the execution of commands for 1 minute. I am copy-pasting the code and its output too. Hope that is what looking for.
program rg
implicit none
real(kind=16) :: time_t1, time_t2
real(kind=16), parameter :: time_off = 60.d0 ! pause for a minute.
call cpu_time(time_t1)
call cpu_time(time_t2)
print*, 'time begins = ', time_t2
do while ( time_t2 - time_t1 < time_off )
call cpu_time(time_t2)
end do
print*, 'time ends = ', time_t2
print*, 'time elapsed= ', time_t2 - time_t1
end program rg
_________________________
vikash@atman ~ $ cd Desktop/
vikash@atman ~/Desktop $ gfortran test.f95 -o vikash
vikash@atman ~/Desktop $ ./vikash
time begins = 1.84099999999999999999999999999999991E-0003
time ends = 60.0018250000000000000000000000000010
time elapsed= 60.0000000000000000000000000000000000
vikash@atman ~/Desktop $
  • asked a question related to Fortran 90
Question
6 answers
i want to write a CFD code solving N-S eqautions with finite difference method  with fortran . my problem is how to use fortran to create a staggered mesh  for 3D curved pipe .
can any one help me ? 
thanks
Relevant answer
Answer
Hi 
did you know how to implement it using Fortran?
did you know any good practical refrences about grid generation in Fortran?
thank you for your Answer
  • asked a question related to Fortran 90
Question
2 answers
I use mountain lion as OS.
Thank you.
Relevant answer
Answer
Really I just use gfortran under Mountain Lion with the command line from a simple xterminal, never tried Xcode.
  • asked a question related to Fortran 90
Question
12 answers
I am new to Fortran 90. I intend to define the "Sign(x)" function and it's "derivative" in Fortran 90, which will later be used by AUTO-07p(Bifurcation Analysis Software). In addition, the variables used in my subroutines (the variables inside Sign function), are not "x". For instance, in some sections of a specific subroutine, it is "i", in another section of the same subroutine it is "f", and so on and on. I need to define the "Sign" function that it could be used for all my variables. Also, there are no specific values assigned to my variables in the Fortran code, they are computed by AUTO. Thanks in advance for your attention.
I am transferring my equations from Maple, in which the derivative of signum(x), is signum(1,x). The derivative of signum(x), is 2 times Dirac delta function (as mentioned by Professor Mittal). It is described in Maple that this function, is always zero except for x=0, in which it's not defined (Which gives the less precise description of Dirac Delta function). I don't know how to write a function in Fortran for the derivative function.
My code is limited to definition of equations, which will later be used by program AUTO, for bifurcation analysis. Which means, my code is not quite a program, it is simply consisted of specific subroutines which contain my equations and conditions of ODEs. Is it possible to define a FUNTION structure inside a SUBROUTINE, if not how should I implement the functions suggested below for signum(x) into my codes, so that in each subroutine the appropriate variables are used instead of the locally defined x variable. 
Relevant answer
Answer
Are you referring to the signum function as described in the link below or the sign transfer function, which is more common in FORTRAN? The former has a derivative (Dirac delta) and the latter does not.
  • asked a question related to Fortran 90
Question
9 answers
I would like to know if a function/subroutine/system call exists to output the amount of physical memory used by my Fortran code.
I'm currently facing some memory leaks and I would like to understand exactly where they are coming from.
I am using ifort compiler on windows (Intel Inspector is not an option for the moment).
Relevant answer
Answer
As far as I know there is no function directly available in Fortran. The easiest way to do this is to write a function in C which uses according functions from the operating system and computes the information that you need. Then, you call this C function from within Fortran. For this you need an interface written in Fortran which will fit the interface of the C function (the Fortran keyword BIND(C) is very helpful for this).
What Hamidreza mentioned about unintentional copies being made there is a way to figure out where this occurs. The compiler will not tell you directly. But, when you compile with ifort using the flag '-check all' you will get runtime warnings when copies occur. You should be aware, though, that this compiler flag turns off all optimizations. Because of this your software will run up to 10 or 20 times slower.
  • asked a question related to Fortran 90
Question
2 answers
e.g in order to make program for linear chain of five or more equally separated spheroidal nanoparticles.
what is the algorithm for it .
plz suggest me.
Relevant answer
Answer
Hi, do you mean to modify the shape.dat file in linux? There is a tough solution that consists of editing the file by yourself (in an usual program like qtiplot): Just change the dimension of the periodicity (for instance, Y turns into Y+delta) export the data as ascii and add them to the end of the shape.dat file (you may change also the total number of dipoles and the dipole índex -first column-). Other solution may be to run a periodic calculation (DDSCAT 7.2 and 7.3 can do it). Finally, If you are self-confident, you can modify the fortran file. If so, you may look for the section ellipsoid in the code and add as many ellipsoids as you want. Good luck!
  • asked a question related to Fortran 90
Question
4 answers
Hi,
I run the WRF-NMM model for 2 years from 01/01/2012 to 01/01/2014. But while I look at number of time steps (hourly data output), it's showing the number as 10,000 instead of 17,500 approximately. But I go through wrfrst files (file for each day) created properly, what is the problem for this.
I attached namelist.input and namelist.wps.
Thanks & Regards,
Relevant answer
Answer
Hi,
   Thanks Brian. The problem is due to,  The maximum number of times in one file is currently set to 10000 in WRF. Since the restart files are written one file per time, this is not an issue, but by trying to put all of the output time steps into one file, you are hitting this limit.
  • asked a question related to Fortran 90
Question
22 answers
I would now like to extract wind speeds at particular vertical heights (50m,80m and 100m etc) which correspond to exact station altitudes (used for a comparative analysis). Is there a way how to interpolate the output data and then read the exact height required?
Relevant answer
Answer
Another possible way for getting WRF wind at specific heights is also using NCL. This allows for using directly the WRF output files (netCDF), instead of converting them using either UPP or ARWpost.
The built-in NCL function for doing this is wrf_user_intrp_3d (https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_intrp3d.shtml)
  • asked a question related to Fortran 90
Question
2 answers
What should be the configuration which supports NIVIDA-CUDA GPU or NIVIDA GeForrce GPU? Also, which operating system is better for GPU computing? I use Linux (Ubuntu). What are the possibilities for this?
Relevant answer
Answer
hi
you can go for NVIDIA -CUDA GPU. but then for your software you need to get an additional license for gpu as well.
as per as operating system, these days companies are going for windows based platforms, but you can use Linux.
  • asked a question related to Fortran 90
Question
2 answers
Used in giant magnitoresistance, for example Fe/Cr/Fe. Thanks.
Relevant answer
Answer
Thank you very much Dr. Lopez for this information
we are are trying to find the variation of resistance in terms of magnetic field, so if you encountered this problem could you give us an idea what to use, "how far is it " or even other possible software other than Oommf that can do the job.
Regards.
  • asked a question related to Fortran 90
Question
32 answers
Hi,
I know that FORTAN is fast, whereas one of disadvantages of MATLAB is the problem of speed. Matlab code is interpreted during runtime. Languages like C and Fortran are faster because they are first compiled into the computer's native language.
How can I develop a fast MATLAB code?
Thanks for taking a look.
Relevant answer
Answer
One basic approach to writing fast MATLAB (or R) code is to understand vectorized operations. Take a look at this PDF, which addresses this particular problem and I guess will be incredibly helpful:
Best,
José.