0001 function theResult = functiontemplate(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 idLog = fopen(theLogFileName,'w');
0022 write_to_logfile(fidLog,['integrate_heat_budget log file']);
0023 write_to_logfile(fidLog,['%%%%%%%%%%%%%%%%%%%%%%']);
0024 write_to_logfile(fidLog,'');
0025 write_to_logfile(fidLog,['theStartDateTime: ',datestr(clock)]);
0026 write_to_logfile(fidLog,['theCurrentDirectory: ',pwd]);
0027 write_to_logfile(fidLog,['theInputDirectory: ',inDir]);
0028 write_to_logfile(fidLog,['theOutputFile: ',theOutFileName]);
0029
0030 function count = write_to_logfile(fid,msg);
0031
0032 count = fprintf(fid,'%s\n',msg);
0033 return
0034
0035 function nxt = next_month(this)
0036
0037 if isequal(mod(this,12),0)
0038 nxt = 1;
0039 else
0040 nxt = this + 1;
0041 end
0042 return
0043