Hybrid Car – More Fun with Less Gas

Ported pvwatts results - Page 3

register ::  Login Password  :: Lost Password?
Posted by BobG on May 27, 2009, 4:13 am
Thanks for the link. I looked at the pvwatts.c file for a while. One
thing that seemed sloppy was they defined DTOR  (degrees to radians)
in 3 or 4 different functions, and I think one place it was float and
another it was double. Same with pi. The place where its declared as a
float its initialized with 7 or 8 digits which is plenty for a float,
but once again, they have it defined as a double in another function,
BUT ITS STILL INITALIZED the same way!. I'd also make 273.15 a const
and give it a name and a few other picky little OCD style preferences.
Hopefully your conversion doesnt do these same sloppy things, so it
might actually be more accurate. Wonder who should know about that at
NREL? Maybe that's why opensource stuff is robust... lots of eyballs
checking it.

Posted by Curbie on May 27, 2009, 5:48 am

No problem, all that stuff is supposed to be for the benefit of every
one, after all U.S. taxpayers paid for it.

I agree with your queasiness about some of the programming, one thing
I've learned from all the ports I've done over the years is to port
exactly bug and all, once I get matching results and ONLY when (and
if) I've learned enough about the program do I implement fixes.

I get the impression that whoever wrote pvwatts was more of a
scientist capable of and more worried the complex math, than a
programmer worried about clean coding. But I just don't know why
pvwatts was written the way it was, and the math is complex enough
where it going to take a lot reading before attempt to implement a

Solpos.c was well written, commented, and documented (packet with
references) and was a dream to port, pvwatts was a nightmare to port.

Are you a lunix guy?
If so what distribution do you recommend for home users (GUI)?

I'm thinking about setting up lunix on one of my machines for the
Internet, and dropping my Windows machines back to Win 2000 pro which
I have on CD.

Thanks for the light.


This Thread
Bookmark this thread:
  • Subject
  • Author
  • Date
please rate this thread