From 22640381a670f72bc38787a113915a9fe62b9f03 Mon Sep 17 00:00:00 2001
From: Peter Powers <pmpowers@usgs.gov>
Date: Tue, 10 Dec 2024 11:14:51 -0700
Subject: [PATCH] inlining locals

---
 .../earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
index 0bc376f0..e2f5ba9b 100644
--- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
+++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
@@ -305,20 +305,17 @@ public class AbrahamsonEtAl_2014 implements GroundMotionModel {
 
     // Site term -- Equation 7
     double saRock = 0.0; // calc Sa1180 (rock reference) if necessary
-    double c_Vlin = c.Vlin;
-    double c_b = c.b;
-    double c_c = c.c;
-    if (vs30 < c_Vlin) {
+    if (vs30 < c.Vlin) {
       // soil term (f10) for Sa1180 is zero per R. Kamai's code where
       // Z1 < 0 for Sa1180 loop
       double vs30s_rk = (VS_RK < v1) ? VS_RK : v1;
       // use this f5 form for Sa1180 Vlin is always < 1180
-      double f5_rk = (c.a10 + c_b * N) * log(vs30s_rk / c_Vlin);
+      double f5_rk = (c.a10 + c.b * N) * log(vs30s_rk / c.Vlin);
       saRock = exp(f1 + f78 + f5_rk + f4 + f6);
-      f5 = c.a10 * log(vs30s / c_Vlin) - c_b * log(saRock + c_c) + c_b *
-          log(saRock + c_c * pow(vs30s / c_Vlin, N));
+      f5 = c.a10 * log(vs30s / c.Vlin) - c.b * log(saRock + c.c) + c.b *
+          log(saRock + c.c * pow(vs30s / c.Vlin, N));
     } else {
-      f5 = (c.a10 + c_b * N) * log(vs30s / c_Vlin);
+      f5 = (c.a10 + c.b * N) * log(vs30s / c.Vlin);
     }
 
     // total model (no aftershock f11) -- Equation 1
@@ -338,7 +335,7 @@ public class AbrahamsonEtAl_2014 implements GroundMotionModel {
 
     // Parital deriv. of ln(soil amp) w.r.t. ln(SA1180) -- Equation 30
     // saRock subject to same vs30 < Vlin test as in mean model
-    double dAmp_p1 = get_dAmp(c_b, c_c, c_Vlin, vs30, saRock) + 1.0;
+    double dAmp_p1 = get_dAmp(c.b, c.c, c.Vlin, vs30, saRock) + 1.0;
 
     // phi squared, with non-linear effects -- Equation 28
     double phiSq = phiBsq * dAmp_p1 * dAmp_p1 + PHI_AMP_SQ;
-- 
GitLab