public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { VerticalCT ct = new VerticalCT (ctv.getShortName(), getTransformName(), VerticalCT.Type.Existing3DField, this); String fieldName = ds.findAttValueIgnoreCase(ctv, VTfromExistingData.existingDataField, null); if (null == fieldName) throw new IllegalArgumentException("ExplicitField Vertical Transform must have attribute "+VTfromExistingData.existingDataField); ct.addParameter(new Parameter("standard_name", getTransformName())); ct.addParameter(new Parameter(VTfromExistingData.existingDataField, fieldName)); return ct; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { VerticalCT ct = new VerticalCT (ctv.getName(), getTransformName(), VerticalCT.Type.Existing3DField, this); String fieldName = ctv.findAttValueIgnoreCase(VTfromExistingData.existingDataField, null); if (null == fieldName) throw new IllegalArgumentException("ExplicitField Vertical Transform must have attribute "+VTfromExistingData.existingDataField); ct.addParameter(new Parameter("standard_name", getTransformName())); ct.addParameter(new Parameter(VTfromExistingData.existingDataField, fieldName)); return ct; }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { VerticalCT ct = new VerticalCT (ctv.getShortName(), getTransformName(), VerticalCT.Type.Existing3DField, this); String fieldName = ds.findAttValueIgnoreCase(ctv, VTfromExistingData.existingDataField, null); if (null == fieldName) throw new IllegalArgumentException("ExplicitField Vertical Transform must have attribute "+VTfromExistingData.existingDataField); ct.addParameter(new Parameter("standard_name", getTransformName())); ct.addParameter(new Parameter(VTfromExistingData.existingDataField, fieldName)); return ct; }
public CoordinateTransform makeCoordinateTransform (NetcdfDataset ds, Variable v) { VerticalCT.Type type = VerticalCT.Type.WRFEta; VerticalCT ct = new VerticalCT(type.toString(), getTransformName(), type, this); ct.addParameter(new Parameter("height formula", "height(x,y,z) = (PH(x,y,z) + PHB(x,y,z)) / 9.81")); ct.addParameter(new Parameter(WRFEta.PerturbationGeopotentialVariable, "PH")); ct.addParameter(new Parameter(WRFEta.BaseGeopotentialVariable, "PHB")); ct.addParameter(new Parameter("pressure formula", "pressure(x,y,z) = P(x,y,z) + PB(x,y,z)")); ct.addParameter(new Parameter(WRFEta.PerturbationPressureVariable, "P")); ct.addParameter(new Parameter(WRFEta.BasePressureVariable, "PB")); if (cs.getXaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredX, ""+isStaggered(cs.getXaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredX, ""+isStaggered2(cs.getLonAxis(), 1))); if (cs.getYaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredY, ""+isStaggered(cs.getYaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredY, ""+isStaggered2(cs.getLonAxis(), 0))); ct.addParameter(new Parameter(WRFEta.IsStaggeredZ, ""+isStaggered(cs.getZaxis()))); ct.addParameter(new Parameter("eta", ""+cs.getZaxis().getFullName())); return ct; }
public CoordinateTransform makeCoordinateTransform (NetcdfDataset ds, Variable v) { VerticalCT.Type type = VerticalCT.Type.WRFEta; VerticalCT ct = new VerticalCT(type.toString(), getTransformName(), type, this); ct.addParameter(new Parameter("height formula", "height(x,y,z) = (PH(x,y,z) + PHB(x,y,z)) / 9.81")); ct.addParameter(new Parameter(WRFEta.PerturbationGeopotentialVariable, "PH")); ct.addParameter(new Parameter(WRFEta.BaseGeopotentialVariable, "PHB")); ct.addParameter(new Parameter("pressure formula", "pressure(x,y,z) = P(x,y,z) + PB(x,y,z)")); ct.addParameter(new Parameter(WRFEta.PerturbationPressureVariable, "P")); ct.addParameter(new Parameter(WRFEta.BasePressureVariable, "PB")); if (cs.getXaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredX, ""+isStaggered(cs.getXaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredX, ""+isStaggered2(cs.getLonAxis(), 1))); if (cs.getYaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredY, ""+isStaggered(cs.getYaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredY, ""+isStaggered2(cs.getLonAxis(), 0))); ct.addParameter(new Parameter(WRFEta.IsStaggeredZ, ""+isStaggered(cs.getZaxis()))); ct.addParameter(new Parameter("eta", ""+cs.getZaxis().getFullName())); return ct; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer v) { VerticalCT.Type type = VerticalCT.Type.WRFEta; VerticalCT ct = new VerticalCT(type.toString(), getTransformName(), type, this); ct.addParameter(new Parameter("height formula", "height(x,y,z) = (PH(x,y,z) + PHB(x,y,z)) / 9.81")); ct.addParameter(new Parameter(WRFEta.PerturbationGeopotentialVariable, "PH")); ct.addParameter(new Parameter(WRFEta.BaseGeopotentialVariable, "PHB")); ct.addParameter(new Parameter("pressure formula", "pressure(x,y,z) = P(x,y,z) + PB(x,y,z)")); ct.addParameter(new Parameter(WRFEta.PerturbationPressureVariable, "P")); ct.addParameter(new Parameter(WRFEta.BasePressureVariable, "PB")); if (cs.getXaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredX, "" + isStaggered(cs.getXaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredX, "" + isStaggered2(cs.getLonAxis(), 1))); if (cs.getYaxis() != null) ct.addParameter(new Parameter(WRFEta.IsStaggeredY, "" + isStaggered(cs.getYaxis()))); else ct.addParameter(new Parameter(WRFEta.IsStaggeredY, "" + isStaggered2(cs.getLonAxis(), 0))); ct.addParameter(new Parameter(WRFEta.IsStaggeredZ, "" + isStaggered(cs.getZaxis()))); ct.addParameter(new Parameter("eta", "" + cs.getZaxis().getFullName())); return ct; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; // parse the formula string String[] values = parseFormula(formula_terms, "p0 lev"); if (values == null) return null; p0 = values[0]; lev = values[1]; VerticalCT rs = new VerticalCT("AtmSigma_Transform_"+ctv.getName(), getTransformName(), VerticalCT.Type.LnPressure, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter(new Parameter("formula", "pressure(z) = p0 * exp(-lev(k))")); if (!addParameter( rs, AtmosLnPressure.P0, ds, p0)) return null; if (!addParameter( rs, AtmosLnPressure.LEV, ds, lev)) return null; return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; String[] values = parseFormula(formula_terms, "sigma eta depth"); if (values == null) return null; sigma = values[0]; eta = values[1]; depth = values[2]; VerticalCT rs = new VerticalCT("OceanSigma_Transform_"+ctv.getName(), getTransformName(), VerticalCT.Type.OceanSigma, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter((new Parameter("height_formula", "height(x,y,z) = eta(n,j,i) + sigma(k)*(depth(j,i)+eta(n,j,i))"))); if (!addParameter(rs, OceanSigma.SIGMA, ds, sigma)) return null; if (!addParameter(rs, OceanSigma.ETA, ds, eta)) return null; if (!addParameter(rs, OceanSigma.DEPTH, ds, depth)) return null; return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { VerticalCT rs = new VerticalCT("sigma-" + ctv.getName(), conventionName, VerticalCT.Type.Sigma, this); rs.addParameter(new Parameter("formula", "pressure(x,y,z) = ptop + sigma(z)*(surfacePressure(x,y)-ptop)")); if (!addParameter2(rs, AtmosSigma.PS, ds, ctv, "PS_var", false)) return null; if (!addParameter2(rs, AtmosSigma.SIGMA, ds, ctv, "B_var", false)) return null; if (!addParameter2(rs, AtmosSigma.PTOP, ds, ctv, "P0_var", false)) return null; parseInfo.format("CSMConvention made SigmaCT %s%n", ctv.getName()); return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; // parse the formula string String[] values = parseFormula(formula_terms, "sigma ps ptop"); if (values == null) return null; sigma = values[0]; ps = values[1]; ptop = values[2]; VerticalCT rs = new VerticalCT("AtmSigma_Transform_"+ctv.getName(), getTransformName(), VerticalCT.Type.Sigma, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter(new Parameter("formula", "pressure(x,y,z) = ptop + sigma(z)*(surfacePressure(x,y)-ptop)")); if (!addParameter( rs, AtmosSigma.PS, ds, ps)) return null; if (!addParameter( rs, AtmosSigma.SIGMA, ds, sigma)) return null; if (!addParameter( rs, AtmosSigma.PTOP, ds, ptop)) return null; return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; // parse the formula string String[] values = parseFormula(formula_terms, "s eta depth a b depth_c"); if (values == null) return null; s = values[0]; eta = values[1]; depth = values[2]; a = values[3]; b = values[4]; depth_c = values[5]; VerticalCT rs = new VerticalCT("OceanS_Transform_"+ctv.getName(), getTransformName(), VerticalCT.Type.OceanS, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); // rs.addParameter((new Parameter("height_formula", "height(x,y,z) = eta(x,y)*(1+s(z)) + depth_c*s(z) + (depth(x,y)-depth_c)*C(z)"))); //-sachin 03/25/09 modify formula according to Hernan Arango rs.addParameter((new Parameter("height_formula", "height(x,y,z) = depth_c*s(z) + (depth(x,y)-depth_c)*C(z) + eta(x,y) * (1 + (depth_c*s(z) + (depth(x,y)-depth_c)*C(z))/depth(x,y) "))); rs.addParameter((new Parameter("C_formula", "C(z) = (1-b)*sinh(a*s(z))/sinh(a) + b*(tanh(a*(s(z)+0.5))/(2*tanh(0.5*a))-0.5)"))); if (!addParameter(rs, OceanS.ETA, ds, eta)) return null; if (!addParameter(rs, OceanS.S, ds, s)) return null; if (!addParameter(rs, OceanS.DEPTH, ds, depth)) return null; if (!addParameter(rs, OceanS.DEPTH_C, ds, depth_c)) return null; if (!addParameter(rs, OceanS.A, ds, a)) return null; if (!addParameter(rs, OceanS.B, ds, b)) return null; return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; // :formula_terms = "s: s_rho eta: zeta depth: h c: Cs_r depth_c: hc"; String[] values = parseFormula(formula_terms, "s C eta depth depth_c"); if (values == null) return null; s = values[0]; c = values[1]; eta = values[2]; depth = values[3]; depth_c = values[4]; VerticalCT rs = new VerticalCT("OceanSG1_Transform_" + ctv.getName(), getTransformName(), VerticalCT.Type.OceanSG1, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter((new Parameter("height_formula", "height(x,y,z) = depth_c*s(z) + (depth([n],x,y)-depth_c)*C(z) + eta(x,y)*(1+(depth_c*s(z) + (depth([n],x,y)-depth_c)*C(z))/depth([n],x,y))"))); if (!addParameter(rs, OceanSG1.ETA, ds, eta)) return null; if (!addParameter(rs, OceanSG1.S, ds, s)) return null; if (!addParameter(rs, OceanSG1.DEPTH, ds, depth)) return null; if (!addParameter(rs, OceanSG1.DEPTH_C, ds, depth_c)) return null; if (!addParameter(rs, OceanSG1.C, ds, c)) return null; return rs; }
rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter(new Parameter("formula", "height(x,y,z) = a(z) + b(z)*orog(x,y)")); if (!addParameter(rs, HybridHeight.A, ds, a)) { return null;
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { VerticalCT rs = new VerticalCT(ctv.getName(), getTransformName(), VerticalCT.Type.HybridSigmaPressure, this); rs.addParameter(new Parameter("formula", "pressure(x,y,z) = a(z)*p0 + b(z)*surfacePressure(x,y)")); if (!addParameter2(rs, HybridSigmaPressure.PS, ds, ctv, "PS_var", false)) return null; if (!addParameter2(rs, HybridSigmaPressure.A, ds, ctv, "A_var", false)) return null; if (!addParameter2(rs, HybridSigmaPressure.B, ds, ctv, "B_var", false)) return null; if (!addParameter2(rs, HybridSigmaPressure.P0, ds, ctv, "P0_var", false)) return null; parseInfo.format("CSMConvention made SigmaPressureCT %s%n",ctv.getName()); return rs; }
public VerticalCT makeCoordinateTransform(NetcdfDataset ds, AttributeContainer ctv) { String formula_terms = getFormula(ctv); if (null == formula_terms) return null; // :formula_terms = "s: s_rho c: Cs_r eta: zeta depth: h depth_c: hc"; String[] values = parseFormula(formula_terms, "s C eta depth depth_c"); if (values == null) return null; s = values[0]; c = values[1]; eta = values[2]; depth = values[3]; depth_c = values[4]; VerticalCT rs = new VerticalCT("OceanSG2_Transform_" + ctv.getName(), getTransformName(), VerticalCT.Type.OceanSG2, this); rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); rs.addParameter((new Parameter("height_formula", "height(x,y,z) = eta(x,y) + (eta(x,y) + depth([n],x,y)) * ((depth_c*s(z) + depth([n],x,y)*C(z))/(depth_c+depth([n],x,y)))"))); if (!addParameter(rs, OceanSG2.ETA, ds, eta)) return null; if (!addParameter(rs, OceanSG2.S, ds, s)) return null; if (!addParameter(rs, OceanSG2.DEPTH, ds, depth)) return null; if (!addParameter(rs, OceanSG2.DEPTH_C, ds, depth_c)) return null; if (!addParameter(rs, OceanSG2.C, ds, c)) return null; return rs; }
rs.addParameter(new Parameter("standard_name", getTransformName())); rs.addParameter(new Parameter("formula_terms", formula_terms)); ps = values[2]; rs.addParameter(new Parameter("formula", "pressure(x,y,z) = ap(z) + b(z)*surfacePressure(x,y)")); if (!addParameter(rs, HybridSigmaPressure.PS, ds, ps)) return null; if (!addParameter(rs, HybridSigmaPressure.AP, ds, ap)) return null; p0 = values[3]; rs.addParameter(new Parameter("formula", "pressure(x,y,z) = a(z)*p0 + b(z)*surfacePressure(x,y)")); if (!addParameter(rs, HybridSigmaPressure.PS, ds, ps)) return null; if (!addParameter(rs, HybridSigmaPressure.A, ds, a)) return null;