REVIEW 4 major objections 6 minor 36 references
OkadaTorch: A Differentiable Programming of Okada Model to Calculate Displacements and Strains from Fault Parameters
T0 review · 4 major / 6 minor · reviewed 2026-08-06 · deepseek-v4-flash
Pith's one-line read OkadaTorch makes the Okada dislocation model differentiable, with exact gradients and Hessians of displacements and strains available by automatic differentiation.
desk verdict A useful, well-engineered PyTorch AD port of Okada's model with public code, but the central correctness claim rests on qualitative checks and a self-referential inversion; add quantitative validation before relying on it. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The machinery is automatic differentiation applied to a line-by-line translation of Okada's four subroutines. SPOINT and SRECTF handle surface deformation for point and rectangular sources, DC3D0 and DC3D handle internal deformation; the translation turns the original scalar arithmetic into tensor operations while keeping its structure, including the return flag that reports whether a computation succeeded. On top of that, the OkadaWrapper class provides compute, gradient, and hessian methods, using forward-mode Jacobian evaluation to differentiate outputs with respect to any single argument or pair of arguments from the same category. Two added flags, compute_strain and is_degree, control whether the nine strain components are evaluated and whether angular parameters are read in degrees.
What would settle it
Run the translated routines on parameter sets that exercise each branch—point source and rectangular fault, surface and subsurface stations, dip angles of 0, 45, and 90 degrees, and stations near fault edges—and compare the displacements, strains, first derivatives, and second derivatives against the original program's outputs and against high-precision finite differences; any mismatch beyond floating-point round-off in any branch would falsify the claim.
Extended reading notes
Core claim
The central claim is that the Okada model—point and rectangular dislocation sources in a 3D elastic half-space, at the surface and below—survives direct translation into a differentiable tensor program without losing its analytical character. The package translates the four core routines, SPOINT, SRECTF, DC3D0, and DC3D, into vectorized tensor form, and wraps them in an OkadaWrapper class whose three methods compute forward displacements and strains, first derivatives with respect to a chosen coordinate or fault parameter, and second derivatives with respect to two inputs. Because the forward program records every elementary operation, the chain rule supplies exact derivatives automatically, which the authors argue makes hand-coded gradients obsolete. The accompanying synthetic experiment shows the resulting derivatives are ready for off-the-shelf gradient-based parameter estimation.
Load-bearing premise
The load-bearing premise is that the step-by-step rewrite of the original subroutines preserves their exact numerical behavior in every branch—surface and subsurface, point and rectangular source—so that the displacements, strains, and all automatic derivatives are correct wherever the original code is correct.
Editorial extensions
If this is right
- Fault-parameter inversion becomes a standard gradient loop: define a misfit loss on the computed displacements, call the automatic backward pass, and update parameters with an off-the-shelf optimizer.
- Exact first and second derivatives with respect to coordinates or fault parameters are available on demand, enabling sensitivity analysis and curvature-based uncertainty estimation.
- All observation stations are processed in one vectorized call rather than a loop, which the paper argues improves efficiency and allows GPU acceleration.
- Because the whole model is differentiable, it can be composed with other differentiable components, such as tsunami solvers or neural-network models, to build end-to-end differentiable chains from fault mechanics to surface deformation.
- The same forward code supports gradient-informed Bayesian inference, since exact model derivatives replace finite-difference approximations inside sampling algorithms.
Reading between the lines
- If the translation is exact in every branch, then existing hand-derived or symbolically generated gradient code for the Okada model becomes redundant, and future modifications to the forward model would update all derivatives automatically.
- The paper does not quantitatively validate its outputs or derivatives against the original program, finite differences, or published benchmarks; adding such tests would convert the correctness claim from a structural one into a verified one.
- Automatic differentiation through the original branch structure gives derivatives only where the forward function is smooth; near fault-edge singularities and at the free surface the gradients may be undefined or unstable, so users should treat derivative values in those regions with caution.
- The same translation recipe could be applied to other analytical geophysical Green's-function solutions, such as layered half-space or viscoelastic dislocation models, to give each one an automatically differentiable version.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper presents OkadaTorch, a PyTorch implementation of Okada's analytical solutions for displacements and strains caused by point and rectangular dislocation sources in an elastic half-space. The core is a direct translation of the original FORTRAN subroutines SPOINT, SRECTF, DC3D0, and DC3D into vectorized PyTorch tensor operations, together with a wrapper class OkadaWrapper that exposes compute, gradient, and hessian methods. The authors demonstrate forward modeling, derivative fields, diagonal Hessians, and a synthetic fault-parameter inversion using Adam. The central claim is that the entire code is differentiable, so gradients and Hessians with respect to station coordinates or fault parameters can be obtained by automatic differentiation without hand-derived formulas.
Significance. If the implementation is numerically faithful to the original Okada solution, this is a genuinely useful software contribution: it removes the need to derive and code gradients by hand, enables GPU-accelerated vectorized forward modeling, and plugs directly into PyTorch-based optimization, Bayesian inference, and scientific machine learning workflows. The public repository, the explicit permission from NIED to publish the translated code, and the clean wrapper interface are concrete strengths. However, the significance is contingent on correctness of the translation, and the manuscript currently offers no quantitative evidence for that correctness: the central claim is unsupported by numerical validation.
major comments (4)
- The central claim that OkadaTorch is a direct translation of the original Okada subroutines is not quantitatively validated. Figures 1 and 2 are described only as 'physically consistent deformation patterns' from visual inspection, and no comparison is made against the original FORTRAN code [11], an independent implementation [13-19], or published benchmark values. Because the paper's core value proposition is exactness of the translation, a quantitative comparison table is load-bearing: for a set of representative configurations, report maximum absolute and relative errors for all displacement components and all nine strain components, and the IRET status, comparing OkadaTorch against the original FORTRAN or a trusted reference over both surface (z=0) and subsurface (z<0) points. Without this, a translation error in any branch would invalidate the computed displacements, strains, and all derived gradients.
- Gradients and Hessians are never checked against finite differences or analytic derivatives. The code uses PyTorch's jacfwd, so the returned derivatives are exact derivatives of the implemented program, but they are exact derivatives of the physical model only if the program itself is correct. The manuscript should include a finite-difference convergence test, for example comparing gradient and hessian outputs to central differences with decreasing epsilon for at least one rectangular-fault configuration, and report the achieved agreement for derivatives with respect to both coordinates and fault parameters. This is particularly important because the is_degree flag changes derivative scaling, and because the second derivative with respect to slip being zero (Figure 4) is a trivial linearity property that does not test the implementation.
- The inversion example is self-referential as a validation: the synthetic observations are produced by the same OkadaTorch forward model, so the successful recovery of parameters can detect optimizer or gradient bugs, but it cannot detect a systematic error shared by the forward and inverse calculations. The manuscript should explicitly state this limitation. In addition, the final parameters in Table 1 are not particularly close to the true values: depth is recovered as 0.604 km versus 0.100 km and slip as 6.14 m versus 5.62 m, and no convergence criterion or uncertainty measure is given, so the statement that 'all estimated fault parameters are reasonably close to their true values' is overstated. This example is fine as a software demonstration, but it should not be presented as evidence of physical correctness.
- The manuscript does not address how vectorized tensor operations handle the scalar conditional branches and singular limits present in the original FORTRAN subroutines. Specific edge cases that need explicit tests include dip=90 degrees, strike at 0 or 180 degrees, stations on the free surface z=0, stations near fault edges and corners, negative z, and the point-source limit with potency-based slip. The difference between scalar control flow and PyTorch tensor operations can change behavior in exactly these branches, so a dedicated set of edge-case validation tests, with numerical comparisons to the original implementation or known analytical limits, is required to support the claim that the translation preserves exact numerical behavior in every branch.
minor comments (6)
- The affiliation contains a typo: 'Earthquake Reseach Institute' should be 'Earthquake Research Institute'.
- The units of strain are given as 'm/km' in Figure 2, while displacements are in m and station coordinates are not assigned explicit units in the text. Please state the assumed unit convention for coordinates and clarify how the strain components scale if coordinates are provided in kilometers or meters.
- When is_degree=True (the default), gradients with respect to strike, dip, and rake are per degree rather than per radian, and Hessians inherit the corresponding mixed scaling. This should be documented explicitly, because it affects numerical values used in optimization and uncertainty quantification.
- The manuscript says that IRET has the same shape as the input coordinate tensors, but the original subroutines return a scalar status flag. Please clarify how the per-element IRET is defined for vectorized calls and which values indicate failure in the tensor case.
- For point sources, the parameter 'slip' is said to represent potency, but potency is never defined and its units are not given. Please define it and state the expected units to avoid confusion with the rectangular-fault slip.
- The caption 'Units are km from x_fault to width' is confusing; it should be rephrased to list the units for each column separately. Also, the source of the true parameters, 'model 10 of Table S1 in [32]', is not self-contained in the manuscript; please provide the values in a way the reader can verify.
Circularity Check
No significant circularity; the paper is an implementation of an external analytical solution, and the only self-referential test is explicitly labeled as illustrative.
full rationale
OkadaTorch is a software-implementation paper: the forward model is Okada's published analytical solution, cited to external references [1,2,11] rather than to the authors' own prior work. The code is described as 'a direct translation of the original FORTRAN subroutines' (Section 2), and the paper makes no claim to derive new geophysical predictions or to fit a parameter and then present a dependent quantity as an independent prediction. The gradient and Hessian outputs are exact derivatives of the implemented program by construction of PyTorch's automatic differentiation, which is a property of the computing framework rather than a derived result that could reduce to its own inputs. The inversion demonstration in Section 3.4 generates synthetic observations using the same forward model and then recovers parameters from them; however, the paper explicitly states, 'The purpose of this example is not to propose a robust inversion framework, but rather to illustrate that gradient-based parameter optimization is straightforward when using a fully differentiable implementation.' This makes it a self-consistency check, not a claimed external validation or a prediction that is forced by definition. The absence of quantitative comparisons against the original FORTRAN implementation, finite differences, or published benchmarks is a correctness and validation gap, not circularity, because no step in the paper's derivation chain is equivalent, by construction or by self-citation, to the claim it is used to support. Self-citations such as references [36,37] appear only as examples of possible SciML integrations and are not load-bearing for the central implementation claim. Consequently, no circular step satisfying the quoting requirement is present.
Assumptions & free parameters
assumptions (3)
- domain assumption Okada's analytical solutions correctly describe displacements and strains in a homogeneous elastic half-space.
- domain assumption PyTorch's automatic differentiation computes exact derivatives of the translated program.
- ad hoc to paper The FORTRAN-to-PyTorch translation preserves the original subroutines' numerical behavior in all branches and edge cases.
Cite this review
Pith. "Pith review of OkadaTorch: A Differentiable Programming of Okada Model to Calculate Displacements and Strains from Fault Parameters." pith.science (2026). https://pith.science/paper/CU2L3BL4
@misc{pith2026250717126,
author = {Pith},
title = {Pith review of: OkadaTorch: A Differentiable Programming of Okada Model to Calculate Displacements and Strains from Fault Parameters},
year = {2026},
howpublished = {\url{https://pith.science/paper/CU2L3BL4}},
note = {Machine review of arXiv:2507.17126}
}
read the original abstract
The Okada model is a widely used analytical solution for displacements and strains caused by a point or rectangular dislocation source in a 3D elastic half-space. We present OkadaTorch, a PyTorch implementation of the Okada model, where the entire code is differentiable; gradients with respect to input can be easily computed using automatic differentiation (AD). Our work consists of two components: a direct translation of the original Okada model into PyTorch, and a convenient wrapper interface for efficiently computing gradients and Hessians with respect to either observation station coordinates or fault parameters. This differentiable framework is well suited for fault parameter inversion, including gradient-based optimization, Bayesian inference, and integration with scientific machine learning (SciML) models. Our code is available here: https://github.com/msomeya1/OkadaTorch
Figures
Figures from the paper (5 more)
Reference graph
Works this paper leans on
-
[11]
Y . Okada, National Research Institute for Earth Science and Disaster Resilience, Program to calculate deforma- tion due to a fault model DC3D0 / DC3D, (last visit on 2025/07/01). URL https://www.bosai.go.jp/information/dc3d_e.html
work page 2025
-
[1]
Y . Okada, Surface deformation due to shear and tensile faults in a half-space, Bulletin of the seismological society of America 75 (4) (1985) 1135–1154. doi:10.1785/BSSA0750041135
-
[2]
Y . Okada, Internal deformation due to shear and tensile faults in a half-space, Bulletin of the seismological society of America 82 (2) (1992) 1018–1040. doi:10.1785/BSSA0820021018
-
[3]
Y . Ohta, T. Kobayashi, H. Tsushima, S. Miura, R. Hino, T. Takasu, H. Fujimoto, T. Iinuma, K. Tachibana, T. Demachi, et al., Quasi real-time fault model estimation for near-field tsunami forecasting based on RTK-GPS analysis: Application to the 2011 Tohoku-Oki earthquake (Mw 9.0), Journal of Geophysical Research: Solid Earth 117 (B2) (2012). doi:10.1029/2...
-
[4]
T. Nishimura, T. Matsuzawa, K. Obara, Detection of short-term slow slip events along the Nankai Trough, southwest Japan, using GNSS data, Journal of Geophysical Research: Solid Earth 118 (6) (2013) 3112–3125. doi:10.1002/jgrb.50222
-
[6]
S. Kawamoto, Y . Ohta, Y . Hiyama, M. Todoriki, T. Nishimura, T. Furuya, Y . Sato, T. Yahagi, K. Miyagawa, REGARD: A new GNSS-based real-time finite fault modeling system for GEONET, Journal of Geophysical Research: Solid Earth 122 (2) (2017) 1324–1349. doi:10.1002/2016JB013485
-
[7]
M. Bagnardi, A. Hooper, Inversion of surface deformation data for rapid estimates of source parameters and uncertainties: A Bayesian approach, Geochemistry, Geophysics, Geosystems 19 (7) (2018) 2194–2211. doi: 10.1029/2018GC007585
-
[8]
K. Satake, Mechanism of the 1992 Nicaragua tsunami earthquake, geophysical research letters 21 (23) (1994) 2519–2522. doi:10.1029/94GL02338
Show all 36 references
-
[9]
Tanioka, K
Y . Tanioka, K. Sataka, Fault parameters of the 1896 Sanriku tsunami earthquake estimated from tsunami numer- ical modeling, Geophysical research letters 23 (13) (1996) 1549–1552. doi:10.1029/96GL01479
1996 doi
-
[10]
Fujii, K
Y . Fujii, K. Satake, S. Sakai, M. Shinohara, T. Kanazawa, Tsunami source of the 2011 off the Pacific coast of Tohoku Earthquake, Earth, planets and space 63 (2011) 815–820. doi:10.5047/eps.2011.06.010
2011 doi
-
[12]
Miyashita, DC3D.f90, (last visit on 2025/07/01)
T. Miyashita, DC3D.f90, (last visit on 2025/07/01). URL https://github.com/hydrocoast/DC3D.f90
2025
-
[13]
Dutykh, Okada solution, (last visit on 2025/07/01)
D. Dutykh, Okada solution, (last visit on 2025/07/01). URL https://www.mathworks.com/matlabcentral/fileexchange/39819-okada-solution
2025
-
[14]
Beauducel, Okada: Surface deformation due to a finite rectangular source, (last visit on 2025/07/01)
F. Beauducel, Okada: Surface deformation due to a finite rectangular source, (last visit on 2025/07/01). URL https://www.mathworks.com/matlabcentral/fileexchange/25982-okada-surface- deformation-due-to-a-finite-rectangular-source
2025
-
[15]
URL https://github.com/cutde-org/okada_wrapper
cutde-org, okada wrapper, (last visit on 2025/07/01). URL https://github.com/cutde-org/okada_wrapper
2025
-
[16]
Jolivet, okada4py, (last visit on 2025/07/01)
R. Jolivet, okada4py, (last visit on 2025/07/01). doi:10.5281/zenodo.14170827. URL https://github.com/jolivetr/okada4py 11
2025 doi
-
[17]
doi:10.17605/osf.io/kmw6h
Clawpack Development Team, Clawpack, (last visit on 2025/07/01). doi:10.17605/osf.io/kmw6h. URL https://www.clawpack.org/okada.html
2025 doi
-
[18]
Bacon, OkadaPy, (last visit on 2025/07/01)
C. Bacon, OkadaPy, (last visit on 2025/07/01). doi:10.5281/zenodo.14257565. URL https://github.com/hemmelig/OkadaPy
2025 doi
-
[19]
Bosserelle, Tsunami.jl, (last visit on 2025/07/01)
C. Bosserelle, Tsunami.jl, (last visit on 2025/07/01). URL https://github.com/CyprienBosserelle/Tsunami.jl
2025
-
[20]
Matsu’ura, Inversion of geodetic data Part I
M. Matsu’ura, Inversion of geodetic data Part I. mathematical formulation, Journal of Physics of the Earth 25 (1) (1977) 69–90. doi:10.4294/jpe1952.25.69
1977 doi
-
[21]
Matsu’ura, Y
M. Matsu’ura, Y . Hasegawa, A maximum likelihood approach to nonlinear inversion under constraints, Physics of the Earth and planetary interiors 47 (1987) 179–187. doi:10.1016/0031-9201(87)90076-8
1987 doi
-
[22]
Pires, P
C. Pires, P. M. Miranda, Tsunami waveform inversion by adjoint methods, Journal of Geophysical Research: Oceans 106 (C9) (2001) 19773–19796. doi:10.1029/2000JC000334
2001 doi
-
[23]
Paszke, S
A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. K ¨opf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, S. Chintala, Pytorch: An imperative style, high-perfo...
-
[24]
Ansel, E
J. Ansel, E. Yang, H. He, N. Gimelshein, A. Jain, M. V oznesensky, B. Bao, P. Bell, D. Berard, E. Burovski, et al., Pytorch 2: Faster machine learning through dynamic python bytecode transformation and graph compilation, in: Proceedings of the 29th ACM International Conference...
2024
-
[25]
Abadi, P
M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, et al., TensorFlow: A system for Large-Scale machine learning, in: 12th USENIX symposium on operating systems design and implementation (OSDI 16), 2016, pp. 265–283
2016
-
[26]
Frostig, M
R. Frostig, M. J. Johnson, C. Leary, Compiling machine learning programs via high-level tracing, Systems for Machine Learning 4 (9) (2018)
2018
-
[27]
Bradbury, R
J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, Q. Zhang, JAX: composable transformations of Python+NumPy programs (2018). URL http://github.com/jax-ml/jax
2018
-
[28]
Sambridge, P
M. Sambridge, P. Rickwood, N. Rawlinson, S. Sommacal, Automatic differentiation in geophysical inverse prob- lems, Geophysical Journal International 170 (1) (2007) 1–8. doi:10.1111/j.1365-246X.2007.03400.x
2007 arXiv
-
[29]
W. Zhu, K. Xu, E. Darve, G. C. Beroza, A general approach to seismic inversion with automatic differentiation, Computers & Geosciences 151 (2021) 104751. doi:10.1016/j.cageo.2021.104751
2021
-
[30]
Rasht-Behesht, C
M. Rasht-Behesht, C. Huber, K. Shukla, G. E. Karniadakis, Physics-informed neural networks (PINNs) for wave propagation and full waveform inversions, Journal of Geophysical Research: Solid Earth 127 (5) (2022) e2021JB023120. doi:10.1029/2021JB023120
2022 doi
-
[31]
Y . Yang, A. F. Gao, K. Azizzadenesheli, R. W. Clayton, Z. E. Ross, Rapid seismic waveform modeling and inversion with neural operators, IEEE Transactions on Geoscience and Remote Sensing 61 (2023) 1–12. doi: 10.1109/TGRS.2023.3264210
2023
-
[32]
T. Baba, N. Chikasada, K. Imai, Y . Tanioka, S. Kodaira, Frequency dispersion amplifies tsunamis caused by outer-rise normal faults, Scientific Reports 11 (1) (2021) 20064. doi:10.1038/s41598-021-99536-x
2021 doi
-
[33]
K. Ohno, Y . Ohta, S. Kawamoto, S. Abe, R. Hino, S. Koshimura, A. Musa, H. Kobayashi, Real-time automatic uncertainty estimation of coseismic single rectangular fault model using GNSS data, Earth, Planets and Space 73 (2021) 1–18. doi:10.1186/s40623-021-01425-0
2021 doi
-
[34]
K. Ohno, Y . Ohta, R. Hino, S. Koshimura, A. Musa, T. Abe, H. Kobayashi, Rapid and quantitative uncertainty estimation of coseismic slip distribution for large interplate earthquakes using real-time GNSS data and its ap- plication to tsunami inundation prediction, Earth, Plane...
2022 doi
-
[35]
Yamada, K
T. Yamada, K. Ohno, Y . Ohta, Comparison between the Hamiltonian Monte Carlo method and the Metropolis– Hastings method for coseismic fault model estimation, Earth, Planets and Space 74 (1) (2022) 86. doi:10. 1186/s40623-022-01645-y
2022
-
[36]
Okazaki, T
T. Okazaki, T. Ito, K. Hirahara, N. Ueda, Physics-informed deep learning approach for modeling crustal defor- mation, Nature Communications 13 (1) (2022) 7092. doi:10.1038/s41467-022-34922-1 . 12
2022 doi
-
[37]
Okazaki, K
T. Okazaki, K. Hirahara, T. Ito, M. Kano, N. Ueda, Physics-informed deep learning for forward and inverse modeling of inplane crustal deformation, Journal of Geophysical Research: Machine Learning and Computation 2 (1) (2025) e2024JH000474. doi:10.1029/2024JH000474. 13
2025 doi
Reviewed August 6, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.