diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java index 953e2454184d01dd85d66117f819811546ce0393..a06b6d87427dc4c669ffb016fcc9ab471ec0fa63 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java @@ -214,7 +214,7 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { abstract boolean adjust(); - private static final double calcMean( + private static double calcMean( Coefficients c, boolean slab, boolean basin, @@ -297,24 +297,24 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { } /* Eq. 3.1 */ - double 𜇠= c.a1 + + double μ = c.a1 + (c.a2 + c.a3 * (Mw - 7.0)) * lnRrupHff + c.a6 * rRup + fMag + fDepth + fSite + fSlab + fBasin; // + fAs * c.a15; no aftershock term if (adjust) { - 𜇠+= c.a1Adj; + μ += c.a1Adj; } - return ðœ‡; + return μ; } - private static final double getVsStar(double vs30) { + private static double getVsStar(double vs30) { return min(vs30, VSS_MAX); } - private static final double calcSigma( + private static double calcSigma( Coefficients c, Coefficients cPga, double pgaRock, diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java index 61e927dbe9b09e6eda0f02bad629361348b47612..6240c0414ef54c37e3a35786ea916fa9f1761325 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java @@ -381,11 +381,11 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { return GroundMotions.createTree(GroundMotions.EPI_IDS, μs, GroundMotions.EPI_WTS, σ); } - private static final double calcPgaRef( - final Coefficients c, - final double Mw, - final double rRup, - final double zTor) { + private static double calcPgaRef( + Coefficients c, + double Mw, + double rRup, + double zTor) { double fMag = getMagTerm(c, Mw); double fGeom = getGeomAttenTerm(c, Mw, rRup); @@ -408,7 +408,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { return c.θ1 + fMag + fGeom + fDepth + fAtten + fSite + fBasin; } - private static final double calcMean( + private static double calcMean( Coefficients c, boolean basin, double Mw, @@ -443,7 +443,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { /* * Eq. 4.3 used for mangitude and source-depth terms */ - private static final double loghinge(double x, double x0, double a, double b0, double b1, + private static double loghinge(double x, double x0, double a, double b0, double b1, double δ) { return a + b0 * (x - x0) + (b1 - b0) * δ * log(1 + exp((x - x0) / δ)); } @@ -451,8 +451,8 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { /* * Eq. 4.4 - magnitude term */ - private static final double getMagTerm( - final Coefficients c, + private static double getMagTerm( + Coefficients c, double Mw) { return loghinge(Mw, c.Mbreak, c.θ4 * (c.Mbreak - MREF), c.θ4, c.θ5, δM); } @@ -461,8 +461,8 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { * Eq. 4.5 - geometrical attenuation term Eq. 4.6 - finite fault term * ("pow(10,...)") */ - private static final double getGeomAttenTerm( - final Coefficients c, + private static double getGeomAttenTerm( + Coefficients c, double Mw, double rRup) { return (c.θ2 + c.θ3 * Mw) * log(rRup + pow(10, c.θnft1 + c.θnft2 * (Mw - 6.0))); @@ -490,8 +490,8 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { * * */ - private static final double getDepthTerm( - final Coefficients c, + private static double getDepthTerm( + Coefficients c, double zTor) { return loghinge(zTor, c.Zbreak, c.θ9 * (c.Zbreak - c.Zref), c.θ9, c.θ10, δZ); } @@ -499,7 +499,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { /* * Eq. 4.8 - site amplification term */ - private static final double getSiteAmpTerm(Coefficients c, double vs30, double pgaRef) { + private static double getSiteAmpTerm(Coefficients c, double vs30, double pgaRef) { double siteTerm; if (vs30 <= c.k1) { siteTerm = c.θ7 * log(vs30 / c.k1) + @@ -521,7 +521,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { * implemented and we will need to track Ri, the travel distance through * subregion i (of the arc) for a given geographic region. */ - private static final double getArcCrossingTerm(Coefficients c, double rRup) { + private static double getArcCrossingTerm(Coefficients c, double rRup) { // This is accurate for ALASKA, CASCADIA, NZ, and TW return c.θ6_2 * rRup; } @@ -536,8 +536,8 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { * TODO: This function follows the paper, it's not clear if it is consistent * with the official python. */ - private static final double getBasinTerm( - final Coefficients c, + private static double getBasinTerm( + Coefficients c, double vs30, double z2p5) { @@ -584,8 +584,8 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { /* * Eq. 4.11 */ - // private static final double getBasinZref(String region, double vs30) { - private static final double getBasinZref(double vs30) { + // private static double getBasinZref(String region, double vs30) { + private static double getBasinZref(double vs30) { /** * Eq. 4.11 - lnZref has regional coefs θz1 - θz4 for CASC, JP, NZ, and TW. * But then the text says "For CASC, estimating all parameters of Equation diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java index ace70b2478af60d4ea00f6d407f4d76fb82ba259..903a79d3b509c8577927af727ee728ec6a1d2c57 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java @@ -282,7 +282,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { abstract boolean basin(); /* calc median at 760 reference conditions */ - private static final double calcMean( + private static double calcMean( Coefficients c, boolean isSlab, double Mw, @@ -306,7 +306,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equation 4.1 */ - private static final double calcMean( + private static double calcMean( Coefficients c, boolean slab, boolean basin, @@ -346,14 +346,14 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equations 4.2 and 4.3 */ - private static final double getPathTerm(Coefficients c, double rRup, double Mw, double h) { + private static double getPathTerm(Coefficients c, double rRup, double Mw, double h) { double R = Maths.hypot(rRup, h); // PP The PEER report has just log(R) in middle term return c.c1 * log(R) + c.b4 * Mw * log(rRup / R) + c.a0 * R; } /* Equations 4.2 and 4.3, following official Python implementation */ - private static final double getPathTermPy(Coefficients c, double rRup, double Mw, + private static double getPathTermPy(Coefficients c, double rRup, double Mw, double h) { double Rref = Maths.hypot(1, h); double R = Maths.hypot(rRup, h); @@ -368,7 +368,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { return c.c1 * log(R) + c.b4 * Mw * log(R_Rref) + c.a0 * R; } - private static final double nearSourceSaturation(double Mw, double mc, boolean slab) { + private static double nearSourceSaturation(double Mw, double mc, boolean slab) { if (slab) { /* Equation 4.4b */ return (Mw <= mc) ? pow(10, (1.050 / (mc - 4.0)) * (Mw - mc) + 1.544) : 35; @@ -379,13 +379,13 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equation 4.5 */ - private static final double getMagnitudeTerm(Coefficients c, double Mw) { + private static double getMagnitudeTerm(Coefficients c, double Mw) { double dM = Mw - c.mc; return (Mw <= c.mc) ? c.c4 * dM + c.c5 * dM * dM : c.c6 * dM; } /* Equation 4.6 */ - private static final double getDepthTerm(Coefficients c, boolean slab, double zHyp) { + private static double getDepthTerm(Coefficients c, boolean slab, double zHyp) { if (!slab) { return 0.0; } @@ -403,7 +403,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equation 4.8 */ - private static final double getSiteTermLinear(Coefficients c, double vs30) { + private static double getSiteTermLinear(Coefficients c, double vs30) { double Flin; if (vs30 <= c.v1) { Flin = c.s1 * log(vs30 / c.v1) + c.s2 * log(c.v1 / c.vRef); @@ -416,7 +416,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equation 4.9 */ - private static final double getSiteTermNonLinear(Coefficients c, double pgaRef, + private static double getSiteTermNonLinear(Coefficients c, double pgaRef, double vs30) { double f3 = 0.05; double f2 = c.f4 * (exp(c.f5 * (min(vs30, 760) - 200)) - exp(c.f5 * (760 - 200))); @@ -424,7 +424,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Equations 4.11/5.5 - 4.13/5.7 */ - private static final double getSiteBasinTerm(Coefficients c, double vs30, double z2p5) { + private static double getSiteBasinTerm(Coefficients c, double vs30, double z2p5) { if (Double.isNaN(z2p5)) { return 0.0; @@ -476,7 +476,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Eqs. 6.3, 6.4, 6.5 */ - private static final double getÏ•Total(Coefficients c, double rRup, + private static double getÏ•Total(Coefficients c, double rRup, double vs30) { /* Eq. 6.5 */ @@ -518,7 +518,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } /* Eqs. 6.6, 6.7 */ - private static final double getÏ•S2S(Coefficients c, double rRup, double vs30) { + private static double getÏ•S2S(Coefficients c, double rRup, double vs30) { /* Eq. 6.7 */ double rPrime = max(R3, min(R4, rRup));