Beginner cudafortran questions

Hi, I apologize for how trivial some of my questions will be, I foresee myself asking alot of them here but hopefully I’ll be able to find some help! I’ve programmed in CUDA before, and understand it pretty well. I don’t have much experience with FORTRAN although I’m not completely useless with it. Anyways, I’m trying to convert a routine that’s already written in FORTRAN to run in cudafortran.

I have made my first runthrough at coding it and can’t seem to get it to debug. When I try to compile/run it I get these errors:

PGF90-S-0070-Incorrect sequence of statements (rieman.F90: 97)
PGF90-F-0004-Corrupt or Old Module file ./hydro_data.mod (rieman.F90: 118)

The lines listed here are the first lines of code in the file and they consist of simply:

use cudafor

subroutine rieman (numIntCells, numCells, &
rhoav, uav, utav, uttav, pav, &
urell, ugrdl, game, gameav, xnav, x)

Since this routine is part of a much larger module, I have to make the whole thing with the command gmake --jobs=8

in the makefile.h i’ve tried changing the compiler and linker to use pgf90 as opposed to mpif90 but this didnt work. Any idea what I’m doing wrong here?


There is not much information in your post, but we can guess.

  1. Incorrect sequence of stmts - you probably need the
    ‘use cudafor’

stmt after others like
implicit none
or some parameter declarations.

  1. Corrupt or old modfile. You need to re-compile the files containing the source
    of ‘hydro_data.mod’ in order to create a modfile with a newer format supported
    by the current compilers.

For a better programming discussion, look at
for some insight on how to program in CUDA fortran and using
the Accelerator model.