I am trying to run some calculations and have been told that Fortran is much much much faster at computations than matlab
As such, I am trying to use fortran to work on various netcdf files
I used macports to install the netcdf-fortran package
My question, as my searching online has been a bear, is how exactly do I run a fortran code with netcdf calls?
Here is a quick example I tried to run (aa.f) and the resulting output
Here is what terminal spits out
Any tips is great or a site that you know of that explains clearly how to use netcdf and fortran!
As such, I am trying to use fortran to work on various netcdf files
I used macports to install the netcdf-fortran package
My question, as my searching online has been a bear, is how exactly do I run a fortran code with netcdf calls?
Here is a quick example I tried to run (aa.f) and the resulting output
Code:
PROGRAM nc
USE netcdf
IMPLICIT NONE
INTEGER :: stat,id
stat=nf90_open(path="~/Desktop/temp_2011-12-31.nc",mode=nf90_write,ncid=id)
stat=nf90_close(id)
END PROGRAM nc
Here is what terminal spits out
Code:
gfortran-mp-4.7 aa.f
aa.f:1.2:
PROGRAM nc
1
Error: Non-numeric character in statement label at (1)
aa.f:1.2:
PROGRAM nc
1
Error: Unclassifiable statement at (1)
aa.f:3.11:
USE netcdf
1
Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory
Any tips is great or a site that you know of that explains clearly how to use netcdf and fortran!