Re: [netcdf-java] Writing a netcdf4 nc file

  • To: "Lacoste Pierre (DAVIDSON)" <PLacoste@xxxxxx>
  • Subject: Re: [netcdf-java] Writing a netcdf4 nc file
  • From: Sean Arms <sarms@xxxxxxxx>
  • Date: Mon, 25 Jul 2016 16:31:30 -0600
Greetings Pierre,

Which version of netcdf-java are you using, and have you successfully
installed the netCDF-C library?

https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/netcdf4Clibrary.html

If yes, are you using the latest released version of the C library?

Cheers,

Sean


On Tue, Jul 19, 2016 at 3:17 AM, Lacoste Pierre (DAVIDSON) <PLacoste@xxxxxx>
wrote:

> Hello,
>
>
>
> I try to use the Netcdf-java to create a netcdf4 file.
>
> I tried the example
> https://www.unidata.ucar.edu/software/netcdf/examples/programs/Sfc_pres_temp_wr.java
> and It’s well running.
>
> But I need to generate a netcdf4 and the example is in netcdf3. So, I
> change the line
>
>                 “dataFile =
> NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf3, filename);”
>
> By
>
> “dataFile = NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf4,
> filename);”
>
>
>
> But when I execute the test, I got the following error:
>
>
>
> Exception in thread "main" java.lang.NullPointerException
>
>                 at ucar.nc2.jni.netcdf.Nc4Iosp.flush(Nc4Iosp.java:3270)
>
>                 at
> ucar.nc2.NetcdfFileWriter.rewrite(NetcdfFileWriter.java:842)
>
>                 at
> ucar.nc2.NetcdfFileWriter.setRedefineMode(NetcdfFileWriter.java:832)
>
>                 at
> ucar.nc2.NetcdfFileWriter.close(NetcdfFileWriter.java:1019)
>
>                 at
> com.tests.Sfc_pres_temp_wr.main(Sfc_pres_temp_wr.java:131)
>
>
>
> Could you tell me how can I solve this problem?
>
>
>
> Thank for your help,
>
>
>
> Pierre
> ------------------------------
>
> *Ce message et toutes les pièces jointes (ci-après le "message") sont
> établis à l'intention exclusive de ses destinataires et sont confidentiels.
> Si vous recevez ce message par erreur ou s'il ne vous est pas destiné,
> merci de le détruire ainsi que toute copie de votre système et d'en avertir
> immédiatement l'expéditeur. Toute lecture non autorisée, toute utilisation
> de ce message qui n'est pas conforme à sa destination, toute diffusion ou
> toute publication, totale ou partielle, est interdite. L'Internet ne
> permettant pas d'assurer l'intégrité de ce message électronique susceptible
> d'altération, l’expéditeur (et ses filiales) décline(nt) toute
> responsabilité au titre de ce message dans l'hypothèse où il aurait été
> modifié ou falsifié.*
>
> *This message and any attachments (the "message") is intended solely for
> the intended recipient(s) and is confidential. If you receive this message
> in error, or are not the intended recipient(s), please delete it and any
> copies from your systems and immediately notify the sender. Any
> unauthorized view, use that does not comply with its purpose, dissemination
> or disclosure, either whole or partial, is prohibited. Since the internet
> cannot guarantee the integrity of this message which may not be reliable,
> the sender (and its subsidiaries) shall not be liable for the message if
> modified or falsified.  *
>
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web.  Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> netcdf-java mailing list
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
  • 2016 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: