pro mtraj_selectdata,start,ndays,dayfracs,forward=forward ;+ ; NAME: ; mtraj_selectdata ; PURPOSE: ; select files to be used by the trajectory model (see trajmain2) ; CATEGORY: ; trajectory ; CALLING SEQUENCE: ; mtraj_selectdata,start,ndays,datearray,$ ; forward=forward,dir=direc ; ; INPUTS: ; start = start day number from the year 1900, fractions of ; the day are included ; ndays = number of days of integration ; OPTIONAL INPUT PARAMETERS: ; KEYWORD PARAMETERS: ; OUTPUTS: ; OPTIONAL OUTPUT PARAMETERS: ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; PROCEDURE: ; REQUIRED ROUTINES: ; df_bestfile, day1900, date1900 ; MODIFICATION HISTORY: ; created mrs, 2/19/92, converted to use ; date1900 5/25/92 ; 1999-11-29:nash:added avespec ; $Header: /science/trajectory/programs/traj_selectdata.pro,v 1.25 1996/11/26 13:53:30 schom Exp $ ;- err=0 s=size(start) if s(n_elements(s)-2) eq 7 then dayni=day1900(start) else dayni=start f=forward if f eq -1 then daystart=long(dayni)+1 else daystart=long(dayni)-1 ; daystart is the starting date for data from the year 1900 dayend=long(dayni)+long(f*ndays)+f ; this is the maximum ending date ; dayend is the ending date for data from the year 1900, note for backward trajectories ; dayend is before daystart ; get data string arrays icyce=0 icycf=0 xtend: n=abs(daystart-dayend) dayfracs=fltarr(n+1) j=-1 if daystart lt dayend then begin for val=daystart,dayend do begin j=j+1 dayfracs(j)=val endfor endif else begin for val=dayend,daystart do begin j=j+1 dayfracs(j)=val endfor endelse return end