Recipe: Fortran program as OPeNDAP client: Difference between revisions

Pchakrab (talk | contribs)
Pchakrab (talk | contribs)
Line 87: Line 87:
</syntaxhighlight>
</syntaxhighlight>


==== Compile and link with the NetCDF library ====
==== Compile and link with the NetCDF-4 library ====
The above code, <code>g5nr_reader.f90</code> is compiled as
 
We use the utility <code>nf-config</code> (again, included in the NetCDF-4 installation) to identify the linker rules
 
For a typical NetCDF-4 installation, the above code, <code>g5nr_reader.f90</code> can be compiled and linked to the NetCDF-4 library via


  <nowiki>
  <nowiki>
  gfortran  
  gfortran -o g5nr_reader.x `nf-config --fflags` g5nr_reader.f90 `$BASEDIR/Linux/bin/nf-config --flibs`
</nowiki>
</nowiki>