Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with socrates aerosol_model_pcf.f90 while compiling #94

Closed
mcthreems opened this issue Aug 13, 2019 · 16 comments
Closed

Issue with socrates aerosol_model_pcf.f90 while compiling #94

mcthreems opened this issue Aug 13, 2019 · 16 comments

Comments

@mcthreems
Copy link

While compiling the test case, I encountered the following error:
soc_error.txt

It seems like the model is expecting something else in that line of the file, which may be due to using a different version of socrates. If that is the case would it be best to try using the same version of socrates the Isca developers are using to avoid similar issues going forward?

@sit23
Copy link
Contributor

sit23 commented Aug 14, 2019

OK - thanks for highlighting this. Unfortunately it isn't possible for us to post the Socrates code on our github to standardise its use, as the UK Met Office specifically told us that we couldn't do that. These kinds of teething problems are, unfortunately, just part of the inevitable pain when external software is updated.

This looks like its an issue within socrates itself - could you let me know the version you're using, and perhaps pass me a link to where you downloaded it, and we'll go from there? I've just had a look in the latest version of Socrates that the Met Office have released (19.06) (https://www.dropbox.com/sh/ixefmrbg7c94jlj/AACekmIeWgjKMPqYxrdJGGP_a?dl=0&preview=socrates_1906.tar.xz) and I can't seem to find a reference to REAL_KIND_CON in that file.

@mcthreems
Copy link
Author

It looks like I'm using version 19.06. It's possible the issue is a simple syntax error in that part of the file, I can try editing it to see if it will fix it. I'll report back the result of my edit attempt.

@sit23
Copy link
Contributor

sit23 commented Aug 14, 2019

OK - that's good to know the version you're using. If I get chance I'll try and reproduce your result.

@mcthreems
Copy link
Author

I added commas to the array that the error message was pointing to, which seems to have cleared up the issue with that file. However I have encountered multiple issues with later files in the compilation, all seemingly due to various minor syntax errors. I will continue to see if I can make the necessary edits myself to get the compilation to finish.

@mcthreems
Copy link
Author

I got through several errors before reaching one I am unable to solve. It involves a file in a language I'm not familiar with, so I will post the error here and see if you reach the same point (I can also post a file with all encountered errors and how I got past them if you think that is useful). I know you are unable to post the socrates code you are using here, but do you know the version number? I could potentially just download the version you are using to see if that gets around the various errors I am encountering.
soc_error.txt

@sit23
Copy link
Contributor

sit23 commented Aug 15, 2019

OK - I'm now wondering if this might be a compiler issue. Could you send me your compiler list, and the compiler options you're using, and I'll try and reproduce the error? I will try and find my Socrates version number for you, yes.

@sit23
Copy link
Contributor

sit23 commented Aug 15, 2019

I've just downloaded Socrates v19.06, and have made the same changes to the include paths as you did, and mine compiles and runs fine. I'm therefore confident it's not an inherent problem with Socrates. I'm guessing that it's something in your compiler settings/options. I notice from the error message you sent that you're not using the -mcmodel large option that we use with Socrates in our mkmf.template file, which is here:
https://github.com/ExeClim/Isca/blob/master/src/extra/python/isca/templates/mkmf.template.ia64#L21
If you compare your version of this file to ours, I imagine that will be the only significant difference.
If it does turn out to be a compiler issue, then you may be best talking to your own system administrators to try and fix the problem. Let me know if that option helps.

@mcthreems
Copy link
Author

OK, it very much could be the compiler, since when I initially installed the pre-socrates Isca I had to work with one of the computer science professors involved with the cluster to get a new mkmf.template set up. This is the template I was using in the previous version, which I had simply carried over to this one. I can try adding the "-mcmodel large" option to it to see if that works with the unedited socrates files.

mkmf.template.ifc.hoff.txt

@mcthreems
Copy link
Author

Upon adding the -mcmodel large option and trying to compile with the unedited socrates scripts, I ran into the same error as the one for which I initiated this thread.

@mcthreems
Copy link
Author

To add to this, I also tried simply substituting the mkmf.template.ia64 file for the custom one we had developed, and still received the same error. It seems like it must be something very ingrained in the system if this compiles without issues on your end.

@mcthreems
Copy link
Author

I apologize for the several comments, but I made a breakthrough in compiling. I had previously replaced the path_names with all of the path names in the current version of socrates, but realized this could have been unnecessary. I tried instead to simply remove the path names from your original file that no longer existed, which bypassed the errors I had been encountering. Instead I got a few errors due to some referenced files missing from the path_names file, but once these were added there was only one final error. This error seems to be a conflict between two files that are both programs, but I'm not sure why this is an issue or how to deal with it. I've attached the error text below.
soc_error.txt

@sit23
Copy link
Contributor

sit23 commented Aug 16, 2019

OK - this sounds like progress. Yes, that last one is a familiar error. The socrates code comes with many pieces of fortran that allow you to run it offline. Therefore many of the fortran files have 'Main' sections, which cannot be used when compiling Isca. When I wrote the path_names file I initially started as you did, by adding all of the fortran files. Whenever I encountered one that contained 'Main', I removed it from path_names. If you also do this, then it should work. My advice to you would be to go back to the path_names supplied with Isca, and just update the files that have been added / taken away from the src/radiance_core/ folder. These are the files that are most important to have right, and these are the only ones I changed when getting 19.06 working on our machine.

On a separate note, I would advise you to keep the mcmodel large option in the template. Socrates is more memory hungry than other parts of Isca, and this option helps it run more efficiently when using Socrates. At least, that was our experience.

@mcthreems
Copy link
Author

OK, I removed the interp.f file that was causing the error, and socrates finally compiled without issue. I did keep the mcmodel option, and I had already reset the path_names file to your provided version before removing the paths that no longer existed and adding new paths from the radiance core.

@sit23
Copy link
Contributor

sit23 commented Aug 19, 2019

Ok - good. I'm glad we've got it working for you. Just to summarise where we got to, essentially the problems you were having in both #93 and #94 were fixed by ensuring that the path_names file was updated? And by that I mean you removed from the existing path_names files that no longer existed, and you added new files that had been created in src/radiance_core/?
If I've got that right, would you say that the new updates to the socrates readme that I've put in my latest pull request (#90) would have been sufficient for you to fix these issues? If you could let me know what you think on that, it would be great, as I'm sure other people will run into these same issues otherwise. Happy Socrates-ing!

@mcthreems
Copy link
Author

Yes, adjusting the path_names file was the solution. I made three changes to the provided file. The first two are as you described, I first removed the paths that no longer existed and added the new ones from the radiance_core directory. I also specifically removed atmos_param/socrates/src/trunk/src/aux/interp.f since it was causing an error due to the "Main" conflict.

@sit23
Copy link
Contributor

sit23 commented Aug 20, 2019

Cool - thanks for summarising. It's weird that my compilations didn't object to this as yours did. But that's a good thing to point out. I'll add instructions to that effect to the Socrates Readme, then I'll mark these two issues as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants