double BCAL_tavg_res(double geometric_mean, int ilayer) { double &x = geometric_mean; switch(ilayer){ case 1: return -0.00217765+(14.8006/(pow(x,1.05879)+13.6799)); break; case 2: return 0.0252555+(2.08/(pow(x,0.807106)-10.1831)); break; case 3: return 0.0438743+(325.002/(pow(x,1.921)+359.283)); break; case 4: return 0.0407252+(2076.35/(pow(x,2.22197)+8289.99)); break; case 5: return 0.0168974+(12.9145/(pow(x,1.1017)-0.939082)); break; case 6: return 0.0458383+(58193.3/(pow(x,2.95717)+335175)); break; case 7: return 100.0; break; case 8: return 100.0; break; case 9: return 100.0; break; case 10: return 100.0; break; return 100.0; } return 1000.0; }