Compilando Fortran con NETCDF en Ubuntu

Fortran es un super lenguaje y bueno... vamos directamente. Necesitaba compilar un programa
Fortran con las librerias NetCDF y me pase la tardeentera investigando. Yo no tengo mucho conocimiento con los flags, pero encontre esta respuesta en StackOverFlow

FORTRAN 77
$cat test_nc.f
PROGRAM TEST_NC
IMPLICIT NONE
include 'netcdf.inc'
INTEGER ncid, nc_err
nc_err = nf_open('test.nc', nf_nowrite, ncid)
nc_err = nf_close(ncid)
END PROGRAM TEST_NC
$gfortran test_nc.f -o test_nc `nf-config --fflags --flibs`
view raw netcdf.f77 hosted with ❤ by GitHub


FORTRAN 90
$ cat test_nc.f90
program test_nc
use netcdf
implicit none
integer :: ncid, nc_err
nc_err = nf90_open('test.nc', nf90_nowrite, ncid)
nc_err = nf90_close(ncid)
end program test_nc
$ gfortran test_nc.f90 -o test_nc `nf-config --fflags --flibs`
view raw netcdf.f90 hosted with ❤ by GitHub

Comentarios

Entradas populares de este blog

ERROR: Grib2 file or date problem, stopping in edition_num. Can't ungrib.exe SOLVED

ARCGIS: Cálculo de pendiente entre puntos en el espacio xyz

WRF open_aux_u : error opening auxinput5_d02_2013-12-31_00:00:00 for reading. 100