Help writing a new temperature plugin that reads seafloor ages from ASCII file to make geotherm


I’m in the process of writing a new temperature plugin that would generate temperature at depth using the plate cooling model where the seafloor ages are read in from an ASCII file. I was able to get the plate cooling model working as a standalone temperature plugin where the user inputs a uniform seafloor age, but when trying to include the code to allow ASCII files to be read is where I’m having a lot of trouble.

My thought process behind extending what I had to allow for ASCII file compatibility was to use what was already available in boundary_temperature/ I put my plate cooling code inside the existing function AsciiData::boundary_temperature which I thought would allow the ages loaded from the ASCII file to be plugged directly into my temperature function. However, when I try to compile the first error I get (there are many) is related to the empty constructor AsciiData ():

initial_temperature/plate_cooling.h(54): error #303: explicit type is missing (“int” assumed)
AsciiData ();

Following this error there are many more errors about how function are no longer explicitly typed. I’ve attached the two files that I’ve been working with in hopes that somehow easily fixable can be found. Looking forward to hearing about ways to fix this/other ways to approach this problem that would be less troublesome.

Thanks so much in advance,plate_cooling_cc.txt (9.9 KB) plate_cooling_h.txt (4.1 KB)

Hey Daniel,

The error you are talking about is because you forgot to change the name of the constructor. The name of the constructor has to match the name the class.

I also see that while ascii_data.h uses AsciiDataInitial, you use AsciiDataBoundary. Is this intentional? I would advice you to start again, and step by step change the file and compile every time. So only first change the class names, and make sure it compiles before you take the next step. This way you can catch mistakes early and you know where the problem is.

I hope this helps!



Hi Menno,

Thanks for the reply! Yes I didn’t realize that it was a requirement to name the constructor after the class, so after that error was fixed I was able to fix the rest of the minor bugs and get the code compiled and working. Using AsciiDataBoundary is intentional as I am trying to prescribe the temperature everywhere in the model using only values of seafloor age given at the top boundary of the model.

Thanks so much for the help!