; primitive function to select a model ; calls CTM_TYPE and returns the modelinfo structure ; shall be replaced by more fancy widget thing at some point ; (This could then also allow a better specification of model ; parameters) ; mgs, 13 Aug 1998 ; mgs, 21 Dec 1998: - added GEOS_STRAT 2x2.5 ; mgs, 25 Mar 1999: - changed FSU to 4x5 and added 'generic' function select_model,default=default selection = [ 'GEOS1 4x5', $ 'GEOS1 2x2.5', $ 'GEOS_STRAT 4x5', $ 'GEOS_STRAT 2x2.5', $ 'GISS_II 4x5', $ 'GISS_II_PRIME 4x5', $ 'FSU 4x5', $ 'generic grid' ] if (n_elements(default) eq 0) then default = '' ind = where(strpos(selection,strupcase(default)) eq 0) print,'Please select one of the following model types:' for i=0,n_elements(selection)-1 do begin extra = ' ' if (i eq ind[0]) then extra = '(*)' print,' ',extra,' ',strtrim(i+1,2),' : ',selection[i] endfor ch = '' choice = -1 while (choice lt 0 OR choice ge n_elements(selection)) do begin read,ch,prompt='---> ' if (ch eq '' AND ind[0] ge 0) then choice = ind[0] $ else choice = fix(ch)-1 endwhile ; return information ; (no else branch because this MUST NOT happen !) case (choice) of 0 : return,ctm_type('GEOS1',res=4) 1 : return,ctm_type('GEOS1',res=2) 2 : return,ctm_type('GEOS_STRAT',res=4) 3 : return,ctm_type('GEOS_STRAT',res=2) 4 : return,ctm_type('GISS_II',res=4) 5 : return,ctm_type('GISS_II_PRIME',res=4) 6 : return,ctm_type('FSU',res=4) 7 : begin res = fltarr(2) read,res,prompt='Resolution vector of generic grid ' return,ctm_type('generic',res=res) end endcase end