;+
; NAME:
;	TASK_OS
; PURPOSE:
;	Converts F77 "task" name into system dependant name
; CALLING SEQUENCE:  
;	newname = TASK_OS(name)
; INPUTS:
;	name		name of the F77 task
; OUTPUTS:
;	newname		name with a postfix 
;			(e.g. on Sun bsdcal => bsdcal_s)
; RESTRICTIONS:
;
; PROCEDURE:
;	Uses !version.os to determine operating system
; MODIFICATION HISTORY:
;	RDB  02-Jul-92	Written
;	RDB  17-Jul-92	Changed MIPS suffix to _m
;	RDB  11-Feb-94  Added OSF (_o) and vms on Alpha (_a)
;
;-
function  task_os,task,print=print,os=os

opsys = !version.os
if keyword_set(os) then opsys = os

types = ['vms','vms','ultrix','sunos','RISC/os','OSF']
types = strupcase(types)
post_fix = ['','_a','_u','_s','_m','_o']

jt = where(types eq strupcase(opsys))
;	OpenVMS on Alpha needs a bit of fiddeling
if n_elements(jt) gt 1 and !version.arch eq 'alpha' then jt = 1
jt = jt(0)

new_task = task+post_fix(jt)

if keyword_set(print) then begin
   print,' '
   print,'Operating system is:  ',opsys
   print,'Architecture is:      ',!version.arch
   print,'New Task name =       ',new_task
   print,' '
endif

return,new_task
end
