pro grpmenu28,menufile, menuparm, spname, sizevec,flagvec ; read menu options and allow user to make changes parnum=40 menuname=strarr(parnum) ; first 20 are for running operations, second 20 are for foraging model menuname(0)='Processing mode' ; 0=single map 1 = batch menuname(1)=''; acoustics processing mode not needed menuname(2)='window X dim' ; menuname(3)='window Y dim' menuname(4)='graph X zoom' menuname(5)='graph Y zoom' menuname(6)='graph Y spacing' menuname(7)='graph color table' menuname(8)='graph window # ' case flagvec(0) of 0 : menuname(9)='display GRP max' 1 : menuname(9)='display Cons max' 2 : menuname(9)='display Gmax max' endcase menuname(10)='display biomass max' menuname(11)='display fish density max ' menuname(12)='display lux max' menuname(13)='character font ' menuname(20)='predator length' menuname(21)='predator weight' menuname(22)='target l-w a' menuname(23)='target l-w b' menuname(24)='hours of foraging' menuname(25)='Cmax available ' menuname(26)='forage efficiency' menuname(27)='swim speed' menuname(28)='target size class' menuname(29)='surface light (lux)' menuname(30)='Epar (lux extinction)' menuname(31)='RD vs lux eqn' menuname(32)='prey energy density' menuparm=fltarr(parnum) ;print,'reading menu options in file ',menufile close,9 openr,9,menufile readf,9,menuparm close,9 PRINTMENU: print,' ',spname print,' operations foraging' print,'' for i=0,((parnum/2)-1) do begin j=i+20 if((menuname(i) ne '') or (menuname(j) ne '')) then $ print,format='(2(i2,2x,a20,2x,g11.4E5,5x))',$ i,menuname(i),menuparm(i),$ j,menuname(j),menuparm(j) endfor ASK: print,' ' print,' enter id of parameter to change or ' print,' 97: reprint menu option values' read, ' 99: finish, save new defaults ', menuid okid=0 if (menuid le parnum) then okid=1 if ((menuid ge 97) and (menuid le 99)) then okid=1 if (okid eq 0) then begin print,'' print,'' print,'menu choice not valid, please choose again ' goto, ASK endif if (menuid eq 97) then goto, PRINTMENU if (menuid eq 99) then goto, SAVEFINISH ; operations sub-menus if (menuid eq 0) then begin print,' ' print,' to run batch mode processing the .grplist file must contain: ' print,'' print,' output directory ' print,' bioenergetics parameter file ' print,' acoustic data transect #1 ' print,' temperature data transect #1 ' print,' acoustic data transect #2 ' print,' temperature data transect #2 ' print,' ' print,' . ' print,' . ' print,' acoustic data transect #last ' print,' temperature data transect #last ' print,' done' print,' ' print,' batch mode saves data with extension .idlgrp print,' ' print,' 0 : process single file' print,' 1 : batch mode ' print,'' endif ; foraging sub-menus if ((menuid eq 22) or (menuid eq 23)) then begin SELECTLW: print,'' print,'l (mm), w (g)' print,'pre-defined options: ' print,'' print,' A : smelt (L.Erie): a=1.30e-7, b=3.82 ' print,' B : alewife (L.Ontario): a=8.288e-6, b=2.98 a' print,' C : bloater (L.Mich): a=2.086e-6, b=3.25 b' print,' D : alewife-smelt avg: a=1.038e-6, b=3.40' print,' E : smelt-alewife-bloater: a=1.310e-6, b=3.35' print,' F : lavnun (L.Kinneret): a=1.047e-6, b=3.43 c' print,' G : anchovy (Ches. Bay): a=5.0e-7, b=3.57 d' print,'' ; print,'footnotes/citations:' ; print,'a : J.M.Jech pers.com.' ; print,'b : Rudstam 1994 Trans.Am.Fish.Soc 123:344' ; print,'c : P.Walline pers com.' ; print,'d : Hartman & Brandt 1995 Can.J.Fish.Aquat.Sci. 52:1667' ; print,'' print,' U : User defined values ' print,' Z : citations ' tans='' print,'' read,'Enter selection : ',tans tans=strupcase(tans) case tans of 'A' : begin menuparm(22)=1.3e-7 menuparm(23)=3.82 end 'B' : begin menuparm(22)=8.288e-6 menuparm(23)=2.98 end 'C' : begin menuparm(22)=2.086e-6 menuparm(23)=3.25 end 'D' : begin menuparm(22)=1.038e-6 menuparm(23)=3.40 end 'E' : begin menuparm(22)=1.31e-6 menuparm(23)=3.35 end 'F' : begin menuparm(22)=1.047e-6 menuparm(23)=3.43 end 'G' : begin menuparm(22)=5.0e-7 menuparm(23)=3.57 end 'U' : begin read,'enter target l-w a ',t1 menuparm(22)=t1 read,'enter target l-w b ',t1 menuparm(23)=t1 end 'Z' : begin print,'' print,'footnotes/citations:' print,'a : J.M.Jech pers.com.' print,'b : Rudstam 1994 Trans.Am.Fish.Soc 123:344' print,'c : P.Walline pers com.' print,'d : Hartman & Brandt 1995 Can.J.Fish.Aquat.Sci. 52:1667' end else : goto, SELECTLW endcase endif if (menuid eq 25) then begin ; Cmax available print,' fraction of Cmax available to forager ' print,' -1 : same as hours spent foraging ' print,' 0-1 : fraction available (.042=1/24) ' print,'' endif if (menuid eq 28) then begin ; fish/target size class ntt1=n_elements(sizevec) if (ntt1 eq 1) then begin ; no sizevec from acoustics data print,'Number of size classes in fish data are: ',sizevec print,'' print,' typical separations: ' print,' 0 : smallest, < 25 mm ' print,' 1 : middle, planktivores 30-200 mm' print,' 2 : largest, piscivores >200 mm ' print,'' endif if (ntt1 gt 1) then begin ; sizevec from acoustics data print,'' print,'number of size classes: ',ntt1 print,' 0= smallest, 1= next largest ... largest class is ',ntt1 print,'' print,'size class separators for fish targets are: ' print,sizevec print,'' endif print,'options for combined fish size classes: ' print,' 11 : size classes 0 & 1 (two smallest) ' print,' 12 : size classes 1 & 2 ' print,'' print,' 21 : three size classes: 0 & 1 & 2 ' print,'' print,' 31 : four size classes: 0 & 1 & 2 & 3' print,'' endif if (menuid eq 31) then begin ; foraging vs light equations ; intermediate peak equation for walleye, tyler & terra ; sigmoid equation from Howick & O'brien, smb tyler print,'equation driving RD scaling factor: ' print,' RD computed with mean fish size from whole transect ' print,' 0 : sigmoid, monotonic decrease with lux ' print,' 1 : intermediate-peak ' print,' ' print,' RD computed with fish size in each cell' print,' 10 : sigmoid, monotonic decrease with lux ' print,' 11 : intermediate-peak ' print,' ' endif if(menuid ne 22 and menuid ne 23) then begin print,menuname(menuid),menuparm(menuid) read,'enter new value for parameter ',t1 menuparm(menuid)=t1 endif if(menuid eq 25) then if (t1 eq -1) then menuparm(25)=menuparm(24)/24.0 goto, ASK SAVEFINISH: openw,9,menufile for i=0,parnum-1 do begin ; printf,9,format='(g15.10E10)',menuparm(i) printf,9,menuparm(i) endfor close,9 print,'' print,'' print,'new values written to ',menufile print,'' menuparm(24)=menuparm(24)/24.0 ;convert hours of day to fraction of day if(menuparm(0) eq 1) then begin tans='' print,' You have selected BATCH processing mode.' read,' Is this what you want? (yY/nN) ',tans if(strlowcase(tans) eq 'n') then goto, ASK endif if(menuparm(32) le 0) then begin print,'Energy density parameters must have a positive value ' print,' Check: ' print,'parameter 32, prey energy density ',menuparm(32) goto, PRINTMENU endif end ; grpmenu26