#include #include #include #include /* NOTE: Now totalGrids is 70, from 144e-78w */ /* the model of forced Rossby waves and their reflected Kelvin waves. Please see documentation in Kelvin.c */ #define Boolean {True = 1; False = 0} #define dx 220000.0 #define dt 86400 #define climSteps 365*86400/dt #define totalSteps 5020*86400/dt /* the number of days in this run */ #define totalGrids 70 #define const 0.0000000003675 #define drag0 1./(12.*2635200.) /* month number of drag friction */ #define initStep -9999 #define maxVerModes 8 float C[maxVerModes]= {2.73, 1.74, 1.06, 0.76, 0.59, 0.50, 0.42, 0.37}; float Chi[maxVerModes] = {4.29, 3.90, 1.70, 1.25, 1.83, 2.20, 1.57, 1.38}; float phaseSpeed() {} int effectMomentClim(float end, float origin, int currentStep, float cc) { int steps, effectStep; steps = (int) (end - origin)/(dt*cc); /* printf("%10.0f%10.0f%4d \n", end, origin, steps); */ effectStep = currentStep - steps; while (effectStep < 0) effectStep = climSteps + effectStep; return effectStep; } int effectMoment(float end, float origin, int currentStep, float cc) { int steps, effectStep; steps = (int) (end - origin)/(dt*cc); /* printf("%10.0f%10.0f%4d \n", end, origin, steps); */ effectStep = currentStep - steps; /* if the wave message has not got the current location, effect should be none, so set effectStep = -9999 */ if (effectStep < 0) effectStep = initStep; return effectStep; } void integral(FILE *ofp, int meriMode, int ii, float tauxc[totalGrids][climSteps], float taux[totalGrids][totalSteps], float westbound[totalSteps]) { int i, k, l, effectStep; float drag, response, damp; drag = drag0*(C[0]/C[ii])*(C[0]/C[ii]); k = 0; while (k < totalSteps) { for (i=0; i