I am using gfortran compiler. Also tell me if gfortran uses something other than the Fortran standard while performing automatic typecasting (type conversion).
How does automatic typecasting (type conversion) work in Fortran?
6k views Asked by Yogesh Yadav At
1
There are 1 answers
Related Questions in FORTRAN
- Writing code for River Section Coordinates in Fortran
- How to get size of array directly from Fortran to R?
- OpenMP multi-threading not working if OpenMPI set to use one or two MPI processor
- Problems with converting old Fortran code
- Why is my code crashing with "Illegal address during kernel execution" when I use subroutines to copy or deallocate members of derived type variables?
- Getting distances of points in 2D space in an array in Fortran using the concept of broadcasting (Python)
- Conflict between lexer rules in ANTLR4 for Fortran grammar
- how to automatically generate a Module from a project in Visual Studio
- I am encountering an f2py dimension error when passing numpy array to fortran
- Why is there an error with gfortran but ifort and pgf90 do not?
- Parallelize nested loop with running sum in Fortran
- Calling c++ from fortran
- Visual Studio Code Not Recognizing findent Installation for Modern Fortran Extension Despite Correct Python Interpreter and PATH Configuration
- Different floating point representations of identical 64 bit double precision numbers
- How to define a Function in Fortran
Related Questions in FORTRAN90
- Error: Unexpected data declaration statement AND symbol has no IMPLICIT type
- Fortran 95, How to read blank (letter space) character from the end of the line?
- How can I get MPI module to work with Fortran using Code:Blocks on Windows 10?
- Why is this simple Fortran matrix inversion code not returning the expected value with LAPACK?
- Does Fortran store values in an array differently than a non-array declared variable?
- Error: 'mask' argument of 'count' intrinsic at (1) must be a logical array
- find and modify highest n values in a 2D array in fortran
- Including/omitting write statement changes code output in Fortran
- How do I nest an array of strings inside another array in Fortran
- Difference in Matrix operations with very small values on Eigen (C++) vs Fortran 90
- Fortran rounding decimals to .0 from netcdf file
- How to find minimum of each column in Fortran and sum op all elements of that column?
- Bisection method in fortran with compilating error
- Fortran 90 to Fortran 2003 : pointer undefined reference
- 'Random' "Program received signal SIGABRT: Process abort signal." Error
Related Questions in GFORTRAN
- Writing code for River Section Coordinates in Fortran
- How to work around the "collect2: error: ld returned 1 exit status" error when running simple fortran files with the gfortran command?
- Why Gfortran fails to compile large file without any warning or errors
- gfortran not found; clang:error: linker command fialed wite exit code 1
- How do I uninstall gfortran and have the new installed version into the same file as my Xcode for Mac computer?
- How to define a Function in Fortran
- How can I install LAPACK for gfortran compiler in Visual studio code?
- How to avoid undefined reference when linking objects in cyclic dependencies in Gfortran
- A try to simulate a class in Fortran like in OOP-languages using gfortran
- Unable to `#define` in Fortran's program body
- How to set double precision for elements of an array in Fortran 90
- Compiling fortran program with archive library results in undefined reference state
- GNU Fortran - Function 'dcosd' has no IMPLICIT type
- is coverage reporting (gcov) with f2py possible? for a shared dll / python module
- Creating temporary array when declared in a module
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Assignment is defined by Fortran 2008 Section 7.2. Of note is Cl. 7.2.1.3 paragraph 8:
This means that any expression (
expr) will be implicitly converted to the type and kind of the variable it is being assigned to. For character types, derived types and anything else, please see the standard.Also note that Fortran only performs conversions like this during assignment and initialization but not contexts like procedure calls. For example, consider this procedure:
This procedure has a dummy argument of type integer. You cannot, for example, do this:
because this results in a mismatch of type between the actual and dummy arguments.
You can, however, do this:
because the implicit conversion is defined for the assignment.
The only documented extension to the standard for implicit type conversion in gfortran (5.1.0) is between logical and integer types during assignment.
See: https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gfortran/Implicitly-convert-LOGICAL-and-INTEGER-values.html#Implicitly-convert-LOGICAL-and-INTEGER-values
.true.is converted to integer1.false.is converted to integer00is converted to.false..true.Do note that if you can do without legacy extensions then don't use them. Using them means your program is not standard Fortran and thus any compiler is free to reject it for being incorrect. This extensions is meant to allow legacy code to compile with modern compilers and not for use in new code.