c-h-david / rapid

Routing Application for Parallel computatIon of Discharge (RAPID)
http://rapid-hub.org/
Other
86 stars 35 forks source link

Fatal Error: Can't open module file 'rapid_var.mod' #19

Closed elyssac02 closed 3 years ago

elyssac02 commented 3 years ago

Hi,

I have installed rapid with docker and am trying to run the rapid_main.F90 code in optimization mode (which, from what I understand, is the script used to run the tool, correct?). When I first ran the tool, I received some errors regarding not being able to find header and module files (e.g., for "<petsc/finclude/petsctao.h>" and "petsctao.mod"). To fix these issues, I edited and created the following environmental variables:

# Edited "PETSC_DIR=/home/installz/petsc-3.13.0" to:
PETSC_DIR=/home/installz/petsc-3.13.0/include

# Created "PETSC_MOD"
PETSC_MOD=/home/installz/petsc-3.13.0/linux-gcc-c/include

For some reason, the program was unable to find the header and module files with only "PETSC_DIR=/home/installz/petsc-3.13.0." I then tried running the rapid_main.F90 code using the following command:

gfortran -o rapid_main /home/rapid/src/rapid_main.F90 -I $PETSC_DIR -J $PETSC_MOD -lnetcdff 

but receive the following error:

Fatal Error: Can't open module file 'rapid_var.mod' for reading at (1): No such file or directory

When I go to the home directory and input:

find . -name "rapid_var*"

The only file that appears is "./home/rapid/src/rapid_var.F90."

Is the rapid_var.mod file missing? Or am I possibly doing something wrong? Please let me know if my gfortran command is incorrect as well-- I've never used it before.

Thanks,

Elyssa

elyssac02 commented 3 years ago

I have actually figured out my issue and realized I was making it more complicated than it is! I'm going to close the issue.

c-h-david commented 3 years ago

@elyssac02, glad you figured it out! Indeed, if you're using the Docker image, the rapid executable should already be in both the ./src/ and the ./tst/ directory. That is the file that you want to run, not rapid_main.F90. If you were to build RAPID yourself (say if you do that from source code on an Ubuntu machine), you wouldn't execute gfortran on your own, but instead use make rapid.