___________________________________________________________________________________________ In Calendar.c Problem: function "rint" not part of math.c for microsoft. Called in this section of code. /* The following four lines are added so that we round to the whole seconds, Bart Nijssen Wed Feb 3 08:31:50 1999 */ if (rint(frac * SECPDAY) != floor(frac * SECPDAY)) { jd += 1. / SECPDAY; j = jd; frac = jd - j; } /* end of added code */ Solution: Charlie added the rint function to Calendar.c declared with headers (double) rint (double) At bottom of file added the code for rint /******************************************* Rint (not in microsoft c++ math library) ********************************************/ double rint(double x) { return ( (x<0.)? -floor(-x+.5):floor(x+.5) ); } ___________________________________________________________________________ In evapotranspiration.c Problem: function "cbrt" not in math library for microsoft c++ Original code /* WetArea = pow(*Int/VType->MaxInt[Layer], (double) 2.0/3.0); */ WetArea = cbrt(*Int / VType->MaxInt[Layer]); WetArea = WetArea * WetArea; DryArea = 1 - WetArea; Solution: changed the cbrt function call to pow(xx,1/3) New code /* WetArea = cbrt(*Int / VType->MaxInt[Layer]); */ WetArea = pow(*Int/VType->MaxInt[Layer], (double) 1.0/3.0); WetArea = WetArea * WetArea; DryArea = 1 - WetArea; _______________________________________________________________________________ In MainDHSVM.c and MainMWM.c Problem: srand48(0) and drand48() are not ansi c. I replaced calls to these functions with calls to srand() and rand(). Rand returns an integer, and one must divide by the maximum random integer produced by the function MAX_RAND, a constant defined in stdlib.h in MainDHSVM.c replaced srand48 (0); with srand (0); and in MainMWM.c replaced for(m=0; m<4; m++){ temp[m] = drand48(); temp2[m] = drand48();} with for(m=0; m<4; m++){ temp[m] = ((float) rand())/((float) RAND_MAX); temp2[m] = ((float) rand())/((float) RAND_MAX);} and commented /* double drand48(void); void srand48 (long); */ in declarations ________________________________________________________________________________ in InitFileIO.c added #include for strcpy function in FindValue.c added #include for strcpy function in EvalExponentIntegral.c added #include for exit function in InitMetMaps.c and InitNewMonth.c added #includ "varid.h" for GetVarName and GetVarNumberType functions ___________________________________________________________________________________ ___________________________________________________________________________________ Support programs in DHSVM Tutorial In aat.java (a component of addaat2.exe Added the following line because of a compiling error stating that teh variable itemfile was not initialized before it was used. In the program branch where it was not initialized, the program closes before it would be used, so I inserted this line to convince the program that it was initialized. itemFile = teststring; //dummy entry to avoid compile error for no initialization for itemfile CHL