-
Notifications
You must be signed in to change notification settings - Fork 96
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
Converting a regional 3D model to a specfem mesh (Addition to docs?) #811
Comments
Hi @lsawade, just saw this issue and wanted to chime in that this feature would be really beneficial to our group and is something we've had on our to-do list for a while, and is likely the last key piece that would enable us to fully migrate from Cartesian to Globe (in most cases). Our overall goal is to be able to take NetCDF models from IRIS EMC and use them directly in a one-chunk regional cut off mesh. But, even understanding the best way to implement external 3D models (in any format) into the code would be super useful. Have you made any progress on this or is this something you're working on currently? @thurinj spent some time on this problem. Adding in @carltape to the conversation as well |
Hi @bch0w , so far I have only chatted with @danielpeter, and for my solution the best way was going to be just following the standard procedure of making crust and mantle separately, and reading the model from text files. Do note that I'm still very interested in this because I think it would truly change the way people would use specfem, and reduce the hurdle of bringing your own model. The problem really is the meshing when it comes to land and Moho topography when velocities are first assigned. Maybe a focused meeting could be very helpful where we all chime in on what models need and what the easiest thing is read a model onto a mesh.
Should these things be completely customizable how are flags set etc. I'm totally willing to spend substantial time on this, but I need to know whether it's worthwhile, and what people want. |
Hi @lsawade, this is great, it's nice to know we have overlapping interests here. To provide context for our needs, we have an Alaska-based point velocity model with regular grid spacing in netCDF format that we are interested in using for regional-scale simulations. @thurinj has written some FORTRAN code to read netCDF format, but it seems like the difficult decision is how to handle parts of the background model not defined by the regional model, which I think is related to the problem of assigning parameters to topography (?). We had some discussion on the optimal way to drop the regional model into a background model, e.g., by providing perturbations to a 1D/3D background model (like PREM or s20rts), or by extrapolating the regional model into any gaps in the background, but this is as far as we got to my understanding. Just to clarify, are you also interested in bringing in external mesh attributes like topography and moho topography, or just point model values? We are mainly interested in the model values and will likely be okay with using one of the in-built topography files like ETOPO1. I think a focused discussion would be great to see if we have the same goals and could work together on this. I am also willing to dedicate some time to this as I can see it being a very useful feature for SPECFEM moving forward. Perhaps we can make this a discussion topic at the next monthly Zoom, and go from there. |
Hi @bch0w, yes totally. I'm happy to work on this together!
Is the
Exactly this is the main issue, for which it is so hard to come up with some default behavior in terms of parameters of an Earth model. For I think what we are really missing is a way to handle these things. Especially in a way that can take care of future changes, e.g., converting the model is in simple anisotropy (vpv, vph, etc.) to full anisotropy (c_{ij}) without losing generality on meshing. So that the models can be added to later for higher complexity, without losing generality in the file format. One way is to simply include important feature such as ETOPO as it is used in a model in the file, so that the mesher can refer to it later on. For the GF database with
I know this is very common in seismology to provide models in perturbations like that, but it becomes super weird the moment you add a different topography to your model. Say, your old model that you refer to is computed with
Yeah, so I think that ideally most decisions that were made should be stored in a single file especially when it comes to topographies -- impact can be large here. [but maybe flags like gravity, rotation, etc. as well] The question is how would we translate this to the mesher. Here, we definitely need to discuss with Daniel since we don't want to reinvent the wheel.
Sounds perfect. |
This is all great! Thanks for the details and happy to advance this further during the Zoom next week. The choice for Just wanted to throw in that I share the opinion that the perturbation is not the ideal way forward, I think our discussions were mainly focused on "how is specfem globe handling this right now?", which is how perturbations came up. We would definitely prefer to move away from this requirement to a more flexible framework for dropping in 3D models. Now excuse me while I revisit my childhood and re-watch The Road to El Dorado |
A must. |
Here is the bare-bones piece of code that @bch0w mentioned: It is not much, but I hope it might kickstart things. |
Thanks, everyone for addressing this. @thurinj the link you shared seems not to work. Probably I am well behind you on this but if this work it would be a huge leap in my career plan. So, more than happy to put my modest hands to help you with this. |
Kudos for pointing this out @SeismoFelix ! And now thanks to you the repo is even public haha 😅! |
as discussed in out last zoom developer meeting, i committed these two PRs that add an initial version to read in (isotropic) IRIS EMC models:
it's intended as a starting point on how to use such external models - and hopefully we can iterate more on this. one particular problem with these EMC models is that it was unclear if they were given with reference to a spherical earth. that is, SPECFEM3D GLOBE is used to read in mantle models defined for a spherical earth. once those model values are read in, the mesh will stretch out to accomodate topography and ellipticity. for these EMC models, i assumed the opposite in that they defined the grid points at actual depth positions - including topography, but without the ellipticity factor. ellipticity is probably less of an issue for local models, but spherical reference would be important to know. unfortunately, based on the EMC format alone, one doesn't obtain that info. so for now, any EMC model is read in for GLL mesh point positions that are stretched out already to accommodate surface topography in case that is turned on in the 'Par_file'. and, ellipticity is added afterwards if selected. |
do you think it is possible to read an EMC model different model values for the different regions. Say, the model has a parameter How hard would it be to implement meshing with crust[1,2] and topography and the external model? And, of course the population of the different regions with the model values? |
hi Lucas, having an EMC model with velocity arrays separated by crust/mantle regions would be possible to implement with probably a few changes. at the moment, the EMC_model implementation is really for simple models only, i.e., only supports isotropic models. the last question I didn't understand fully. you mean how to change the mesh with a Crust1.0 or Crust2.0 as crustal reference? at the moment, you can just add an ending
for now, there seems to be no EMC model with different velocity arrays defined for different crust/mantle regions. all EMC models come with some single arrays, defined for the whole model range: I couldn't find a model with a metadata entry like |
Hi Daniel, I was mainly thinking about what the best idea is to implement Moho topography from external models, and I forgot that meshing is just done with
Also, just FYI, I have embedded/meshed @clairdd 's model CANVAS into PREM. It is not in the EMC just yet, because they are finishing the manuscript (preliminary poster). I have not yet tried waveform modeling because we want to try to avoid as much as we possible can boundaries to isotropic PREM. Hence, @clairedd gave me a larger area of her model to work with, I just haven't gotten to it. What I wrote above is all due to the fact that her model is, in fact, transversely isotropic and does use |
hi Lucas, yes sure please go ahead! the model_EMC file is there to iterate on, so make any changes as you see fit. for this CANVAS model, I would use a model name like
CANVAS is using the SPiRaL model as an initial starting point. I'm not sure how they used this model in Salvus (topography, internal discontinuities, etc.?), but we have SPiRaL implemented as well, which comes with its own crust definition. so, to overimpose this new EMC model values onto the SPiRaL one, it might be easier to just use a new name like above and then have the same reference flags as SPiRaL set in the regarding the separate crust/mantle arrays, does CANVAS really need those or could it provide just the vpv,vph,.. velocities as single arrays for the whole model? separate arrays for crust/mantle only make sense, if you want to model a first-order discontinuity with a jump of velocities at an internal interface, like the Moho. at longer seismic periods (CANVAS goes down to ~20 s periods), this might also just be visible as a strong velocity gradient in the model, which can be specified by a single array. again, this might depend on how they implemented SPiRaL in Salvus and how it was updated for CANVAS - well, just see what representation is really needed. you might find that for separated arrays, you will need an additional element info (if it is located above/below the interface, i.e., in the crust or mantle) before overimposing the model velocities. at the moment, this is not done in the let me know how it goes with the implementation, happy to help out in case needed :) |
Ok, will work on it. I have so far only 'played' around with the mesher, even output some vtk files that all seem fine. At runtime however, I encountered an allocation issue even though I'm using a regional cutoff: At line 221 of file src/specfem3D/prepare_gpu.f90
Fortran runtime error: Allocatable actual argument 'abs_boundary_ispec_outer_core' is not allocated cutoff is at 400km. Am I overlooking something? |
After looking a lot at seismograms, I started looking more at the mesh, And it's mildly weird. I'm looking into what's happening, but it somehow looks like certain values are being misassigned: Note that this is very much exaggerated. I used the following line in the paraview calculator
wait, were you seeing lines like this, @bch0w ? |
Just to make sure that it's not just the vtk low-res plotting output, I also plotted a few high-res slices with all GLL points. This is looking really wonky. I think this is different from what you showed at the recent specfem meet, right, @bch0w ? |
Just an update, it looks as this is a bug, when I make the mesh very fine compared to the regional extent. |
Woops, sorry @lsawade, I though I had responded to this! This does not look like what I had showed at the last meeting, though. Seems like you've got a handle on what is causing this? |
HI! Thanks for all the effort you have put on implementing routines for reading NetCDF external 3D velocity models. I tried to run the Alaska example, but unfortunately is not working for me.
The output was:
I would appreciate any comment you may have about the origin of this failure. Thanks a lot! |
Felix, could you re-compile the code with debug flags added, also, the latest devel should fix an intel compiler issue with EMC models, make sure to have this latest devel version in case. |
Thanks for the suggestions @danielpeter . I added the debug flags when running configure for making the makefile: The make file was made without any issue including the debug flags:
and the make all instruction worked as well. However, the output when running the EMC example shows the same error I already posted. It does not show any additional information when crashes and I still get the same message:
I also downloaded the latest devel version. I got this directory: specfem3d_globe-devel Thanks for your help. |
do you have more infos to reproduce the error, like your OS & compiler versions? regarding the debugging options, you could also add the flag
maybe that triggers something readable. |
Hi @SeismoFelix, hi @ammcpherson, hi @danielpeter So I tried the recent updates and it seems to work for me for the Alaska model. @SeismoFelix, I have now tried again to input CANVAS (@clairedd's models), and got a @danielpeter, and @ammcpherson, a few notes and questions,
Thanks already! I think I'm starting to get somewhere! Waveforms still look pretty different, but I ran many tests now, and just turning on and off some of the flags in specfem (topography, rotation, attenuation, ocean, etc.) has such an enormous effect on the waveforms at 20-50s, some better some worse, that now it's a question of converging (hopefully). Cheers, Lucas |
Hi,
Opening this issue because I believe the documentation is lacking here and I would like to do this. @clairedd has an external regional, 3D model that is based on a different SEM mesh and can probably write an output routine that converts it to something else.
Questions
I would like to have answered before diving into writing my own routines:
@danielpeter do you have suggestions here?
Related
constants.h.in
should I look out for? For one model that I'm working with I'm using, e.g.,EARTH_REGIONAL_MOHO_MESH
@rdno do you have input on this?
The text was updated successfully, but these errors were encountered: