Additive; do not touch save_arrays_solver.f90.
- New writer
src/meshfem3D/save_database_specfempp.F90, exposing
save_database_specfempp(). Hook it in create_regions_mesh.F90 pass 2, at the
same site as save_arrays_solver (~src/meshfem3D/create_regions_mesh.F90:397),
gated by a new Par_file flag (e.g. SPECFEMPP_DATABASE = .true.). Register in
rules.mk/Makefile.
- Merge regions per rank. Accumulate per-rank element/node/boundary/adjacency
data across the region loop and emit one file at the end, or write region blocks
and merge in the reader. Prefer accumulate-then-emit for a clean single-mesh file.
- Anchor extraction. Globe uses
NGNOD = 27. Extract the 27 anchor nodes from
the corner/edge/centre GLL positions of ibool (the inverse of
hex_nodes/add_missing_nodes). Emit a deduplicated node list per rank
(final geometry) and — when topo/ellip on — the reference-spherical anchors.
To obtain reference anchors, capture the anchor coordinates before the
topography/ellipticity calls in compute_element_properties (they are available
as xelm/yelm/zelm right after Moho stretching + GLL interpolation).
- Per-element context. Emit
idoubling, rmin, rmax, elem_in_crust,
region, medium_tag, property_tag. rmin/rmax are the rmins/rmaxs shell
bounds already in scope; elem_in_crust is computed in
compute_element_properties — thread it out to the writer.
- Boundaries. Free surface (top of crust/mantle), CMB (bottom of crust/mantle
/ top of outer core), ICB (bottom of outer core / top of inner core), ocean-load
faces. Source: ibelm_top/bottom per region + region adjacency.
- Adjacency. Translate globe MPI interfaces (
create_MPI_interfaces,
my_neighbors_*, iboolleft/right_*) into the local CSR + MPI-neighbor format.
Globe-native representation — no Cartesian re-encoding.
- Dimensionalize coordinates (×
R_PLANET) and write header constants.
- Write
MODEL_CONFIG. After read_compute_parameters the mesher already
holds the resolved model selection (MODEL name, REFERENCE_1D_MODEL,
THREE_D_MODEL, THREE_D_MODEL_IC, REFERENCE_CRUSTAL_MODEL) and the model
flags in shared_parameters/meshfem_models_par. Serialize them into the
header's MODEL_CONFIG block (§4.2) so SPECFEM++ can replay them into
models_init without ever reading the globe Par_file.
- Optional BAKED block. Reuse the values
get_model already computes in
pass 2 to append per-GLL material when material_mode == BAKED.
Additive; do not touch
save_arrays_solver.f90.src/meshfem3D/save_database_specfempp.F90, exposingsave_database_specfempp(). Hook it increate_regions_mesh.F90pass 2, at thesame site as
save_arrays_solver(~src/meshfem3D/create_regions_mesh.F90:397),gated by a new
Par_fileflag (e.g.SPECFEMPP_DATABASE = .true.). Register inrules.mk/Makefile.data across the region loop and emit one file at the end, or write region blocks
and merge in the reader. Prefer accumulate-then-emit for a clean single-mesh file.
NGNOD = 27. Extract the 27 anchor nodes fromthe corner/edge/centre GLL positions of
ibool(the inverse ofhex_nodes/add_missing_nodes). Emit a deduplicated node list per rank(final geometry) and — when topo/ellip on — the reference-spherical anchors.
To obtain reference anchors, capture the anchor coordinates before the
topography/ellipticity calls in
compute_element_properties(they are availableas
xelm/yelm/zelmright after Moho stretching + GLL interpolation).idoubling,rmin,rmax,elem_in_crust,region,medium_tag,property_tag.rmin/rmaxare thermins/rmaxsshellbounds already in scope;
elem_in_crustis computed incompute_element_properties— thread it out to the writer./ top of outer core), ICB (bottom of outer core / top of inner core), ocean-load
faces. Source:
ibelm_top/bottomper region + region adjacency.create_MPI_interfaces,my_neighbors_*,iboolleft/right_*) into the local CSR + MPI-neighbor format.Globe-native representation — no Cartesian re-encoding.
R_PLANET) and write header constants.MODEL_CONFIG. Afterread_compute_parametersthe mesher alreadyholds the resolved model selection (
MODELname,REFERENCE_1D_MODEL,THREE_D_MODEL,THREE_D_MODEL_IC,REFERENCE_CRUSTAL_MODEL) and the modelflags in
shared_parameters/meshfem_models_par. Serialize them into theheader's
MODEL_CONFIGblock (§4.2) so SPECFEM++ can replay them intomodels_initwithout ever reading the globePar_file.get_modelalready computes inpass 2 to append per-GLL material when
material_mode == BAKED.