APSIMInitiative / ApsimX

ApsimX is the next generation of APSIM
http://www.apsim.info
Other
132 stars 161 forks source link

APSIM cannot detect column headers in an Excel met file #3299

Closed BrianCollinss closed 5 years ago

BrianCollinss commented 5 years ago

When I use an Excel file for weather data (and this is my first time), I receive the following error and I cannot figure out what causes this.

System.NullReferenceException occurred
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=APSIM.Shared
  StackTrace:
   at APSIM.Shared.Utilities.ApsimTextFile.SeekToDate(DateTime date) in C:\Users\uqbababa\UQ\07_Repository\ApsimNextGen\APSIM.Shared\Utilities\ApsimTextFile.cs:line 746
   at Models.Weather.OnDoWeather(Object sender, EventArgs e) in C:\Users\uqbababa\UQ\07_Repository\ApsimNextGen\ApsimX\Models\Weather\Weather.cs:line 415
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at Models.Clock.OnDoCommence(Object sender, CommenceArgs e) in C:\Users\uqbababa\UQ\07_Repository\ApsimNextGen\ApsimX\Models\Clock.cs:line 220

I followed this instruction to create the met file. It seems APSIM cannot detect column headers:

image

I attach the met and APSIM file, in case someone could test it. ADAP.zip

hol430 commented 5 years ago

Looks like a bug - not user error. Will look into it.

BrianCollinss commented 5 years ago

Thanks Drew. I shifted back to text files. Cheers.