<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 27, 2015 at 11:34 PM, Ed Bueler <span dir="ltr"><<a href="mailto:elbueler@alaska.edu" target="_blank">elbueler@alaska.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Petsc --<div><br></div><div>There is a "--download-netcdf" configure option that seems to work for me. The petscviewer.h (in petsc-maint) has a PetscViewerNetcdfOpen() declaration, but that seems to not be linkable, perhaps because it has no implementation of it:</div><div><br></div><div><div>$ make mahaffy</div><div>/home/ed/petsc-maint/linux-c-opt/bin/mpicc -o mahaffy.o -c -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -I/home/ed/petsc-maint/include -I/home/ed/petsc-maint/linux-c-opt/include `pwd`/mahaffy.c</div><div>/home/ed/petsc-maint/linux-c-opt/bin/mpicc -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -o mahaffy mahaffy.o -Wl,-rpath,/home/ed/petsc-maint/linux-c-opt/lib -L/home/ed/petsc-maint/linux-c-opt/lib -lpetsc -Wl,-rpath,/home/ed/petsc-maint/linux-c-opt/lib -lflapack -lfblas -lX11 -lpthread -lnetcdf -lm -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -lmpichf90 -lgfortran -lm -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -Wl,-rpath,/home/ed/petsc-maint/linux-c-opt/lib -L/home/ed/petsc-maint/linux-c-opt/lib -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -ldl -Wl,-rpath,/home/ed/petsc-maint/linux-c-opt/lib -lmpich -lopa -lmpl -lrt -lpthread -lgcc_s -ldl </div><div>mahaffy.o: In function `ReadThicknessFromNetCDF':</div><div>mahaffy.c:(.text+0x2cbb): undefined reference to `PetscViewerNetcdfOpen'</div><div>collect2: error: ld returned 1 exit status</div><div>make: [mahaffy] Error 1 (ignored)</div><div>/bin/rm -f mahaffy.o</div><div><br></div><div>In particular, src/sys/classes/viewer/impls/ does not have a netcdf/ case.</div><div><br></div><div>So what is the recommended way to read a netcdf file into a petsc vec? Should I go via python and netcdf4-python or something, using bin/pythonscripts/PetscBinaryIO.py to write a petsc binary, and then read that?</div></div></div></blockquote><div><br></div><div>I think a converter to binary in Python sounds great. However, do you want the data in the absence of a mesh?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Dump to ascii and read that?--yes, this is a taunt.</div></div></div></blockquote><div><br></div><div>I think we at one time had a NetCDF viewer which we abandoned because HDF5 turned out to be better (a damning judgment indeed). The --download-netcdf is there to support ExodusII, which we can load.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks for help!</div><div><br></div>Ed</div><div><br></div><div><br>--<br>Ed Bueler</div><div><div>Dept of Math and Stat and Geophysical Institute<br>University of Alaska Fairbanks<br>Fairbanks, AK 99775-6660<br>301C Chapman and 410D Elvey<br><a href="tel:907%20474-7693" value="+19074747693" target="_blank">907 474-7693</a> and <a href="tel:907%20474-7199" value="+19074747199" target="_blank">907 474-7199</a> (fax <a href="tel:907%20474-5394" value="+19074745394" target="_blank">907 474-5394</a>)</div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>