Thanks for the extremely fast response, Ed!
Line 1333 in PDL:NetCDF says:
my @dimlens = reverse $pdl->dims;
Hernán
On 2021-01-04 09:43, Ed . wrote:
Dear Hernán,
My instant response: don’t give up!
What does line 1333 of your PDL/NetCDF.pm say? I’ve just been working
on the Graph module, and such errors say to me that I have got the
arguments wrong on some function.
I would imagine that numpy would be less reliable after 8-10 years
than Perl stuff, since a major goal of Perl is to be backwards
compatible, and PDL has followed that. But let us find out if that
applies here, by solving your problem!
Best regards,
Ed
*From: *Hernán De Angelis <mailto:[email protected]>
*Sent: *04 January 2021 08:39
*To: *[email protected]
<mailto:[email protected]>
*Subject: *[Pdl-general] Status of PDL:NetCDF?
Dear PDL:ers,
I am revisiting an old project and need to reuse bits of code I wrote
nearly a decade ago. The code uses PDL:NetCDF to write piddles with the
results of some modelling to netCDF for use in other software.
The part of the code that writes NetCDF is this:
# write NetCDF
my $ncobjout;
$ncobjout = PDL::NetCDF->new("matrix.grd",'w','y','x',{MODE =>
O_CREAT|O_RDWR,REVERSE_DIMS => 1, NC_FORMAT =>
PDL::NetCDF::NC_FORMAT_NETCDF4});
$ncobjout->putatt('COARDS/CF-1.0','Conventions');
$ncobjout->put('y',['y'],$y);
$ncobjout->put('x',['x'],$x);
$ncobjout->put('w',['y','x'],$matrix(:,:));
$ncobjout->close;
It fails with a strange message:
Can't locate object method "dims" via package "100" (perhaps you forgot
to load "100"?) at
/usr/local/perls/perl-5.32.0/lib/site_perl/5.32.0/x86_64-linux/PDL/NetCDF.pm
line 1333
But it worked fine 8-10 yrs ago. Also there is no reference to a package
called "100"(?) in the code for PDL::NetCDF.
Now, on CPAN PDL:NetCDF is v 4.2 från 2013 (!) and although it compiles
fine, 17/21 tests fail on HDF5 conflicts. That may explain something. My
netCDF is version 4.7.4.
A part of me tells me that I should not reuse old PDL code but just
rewrite everything needed in numpy and move on. Another part of me would
prefer not to and believes (perhaps naively?) that there is an easy
solution. Any ideas?
Thanks in advance
Hernán
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general
<https://lists.sourceforge.net/lists/listinfo/pdl-general>
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general