Function for initial composition model not working in ASPECT release mode

Hi (sorry for so many questions)
I am runnig the developer version of ASPECT with a parameter file that worked properly with ASPECT 2.0 version. However it is unable to recognize the four different compositional fields I am using. The same happens with the function used for the initial temperature. It only sees a unique compositional (0/0/0/0) field and constant temperature.
I think there is a problem with the syntax I’m using, but it seems the same as used in some cookbsoks as continental_extension.prm. Is this syntax not valid anymore? I plan to use wb for initial composition and temperature, but I wanted to know if I still can run old models that worked well with former aspect versions.
Many thanks for your help

The section to define the compositional fields is:

subsection Compositional fields
set Number of fields = 4
set Names of fields = upper_crust, lower_crust, lith_mantle, eclolower_crust
end

Spatial domain of different compositional fields

subsection Initial composition model
set Model name = function

subsection Function
set Variable names = x,y
set Function constants= y1uc=640e3, y2uc=640e3, y3uc=625e3, x1uc=380e3, x2uc=475e3, xp=500e3,
y1lc=630e3, y2lc=630e3, y3lc=620e3, x1lc=443.15e3, x2lc=466.66e3, x3lc=483.33e3,
y1m=600e3, y2m=550e3, y3m=580e3, x1m=450e3, yelc=610e3
set Function expression = if((y>=y1uc & x<x1uc)|(y>=((y1uc-y3uc)/(x1uc-x2uc)(x-x1uc)+y1uc)
& x>=x1uc & x<x2uc)|(y>=((y2uc-y3uc)/(xp-x2uc)
(x-xp)+y2uc) & x>=x2uc & x<xp)|
(y>=y2uc & x>=xp), 1, 0);
if((y>=y1lc & y<y1uc & y<((y1uc-y1lc)/(x1uc-x1lc)(x-x1uc)+y1uc) & x<x1lc)|
(y>=((y2lc-y3lc)/(xp-x3lc)
(x-xp)+y2lc) & y>y3lc & y<((y2uc-y3lc)/(xp-x2lc)(x-xp)+y2uc)
& x>=x2lc & x<xp)|(y>=y2lc & y<y2uc & x>=xp), 1, 0);
if((y>=((y3m-y2m)/(xp-x1m)
(x-xp)+y3m) & y<((y2lc-y1m)/(xp-x1m)(x-xp)+y2lc) & x>=x1m & x<xp)|
(y>=y3m & y<y2lc & x>=xp), 1, 0);
if((y>=((y3lc-y1m)/(x3lc-x1m)
(x-x3lc)+y3lc) & y<((y3lc-yelc)/(x2lc-x1m)*(x-x2lc)+y3lc) & y<y3lc & x>=x1m & x<x3lc), 1,0);

end
end

Ana:
The format for input files changes occasionally, but it is usually documented in the changelog files that you can find if you go to https://aspect.geodynamics.org/ and then click on “Development”. But before trying to figure out what might be wrong, let me ask whether you are running ASPECT in debug mode?
Best
W.

Hi, many thanks for your answer. Sorry I made a mistake in the subject of the topic, I didn’t mean ‘aspect release mode’ but aspect development version’. I am running the models in release mode (not debug).
The question is that I could use this function to define the 4 different compositional fields in aspect 2.0.0; but is doesn’t work in the development version (the one that I installed and used for other simulations) , in the sense that it doesn’t ‘understand’ the presence of different bodies and considers only a compositional field 0. The same happens for the initial temperature distribution (onle ‘sees’ homogeneous T)
I clicked on ‘Development’ and read across all the change log files from version 2.0 to 2.3 and I haven’t found any specific indication on the format of input files. Anyway I’am going to play a bit with the input format.
Thanks again for your help, you are very kind
Ana

Ana – My point was different: If the format changes, the ASPECT input file reader should have rejected your input file if you run in debug mode. In general, you should always start with running models in debug mode and only if you know that things work as expected should you switch to release mode.

As for the specific question: For sure there continues to be a way to specify four compositional fields. The syntax may have changed, but it must continue to be possible. I don’t know which specific part of the function expression doesn’t work. Feel free to post the whole input file for others to try, but my first suggestion would to try a simpler expression first and observe whether you can get that to work – say, choosing each compositional field to be a constant number, then introducing a step function, then … making it more complex in each step until you are back to what you want. This way you can find out which component of the complex formula is giving trouble.

But first try to run in debug mode! :slight_smile:

Best
W.

Hi Wolfgang
I started simplifying a lot my geometry, but still it didn’t work , and finally I realised that I made a mistake in the definition of the box, which was inconsistent with the distances I used to define the geometry of the different compositional fields and temperature distribution. Sorry for bothering you with this silly mistake.
Now it works perfectly, I didn’t have to change anything at all from the input parameter file. What I want to do now is to introduce this geometry in the World Builder, so that it will be easier to modify.
If someone is interested in trying delamination models (for which aspect works very well as AMR is very useful to thrack lower crustal deformation), just let me know and I am glad to share the parameters file (and soon the wb file, I hope).
Many thanks again
Cheers
Ana