! jnl file that uses Argo data to make different vertical section temperature anomaly plots. The sections are either ! in a N-s direction or an E-W direction. This does not make arbitrary section plots. The anomaly is from the yearly ! mean. ! This file requires input arguments for the location of section, the time range, the depth range and the distance range. ! To run the program in ferret, you will need to type the following line with or without the various values ! filled in: ! go fer_temp_section_yearly_anom section_direction section_location time_start time_end depth_min depth_max xlo xhi con_lev ! If you choose not to give values for the various variables, default ones will be substituted for you. ! If you only want to choose some values, you can, but you cannot skip any values. This means you can ! fill in the first 2 and no others, or if you want to specify the time ranges, you must do the first 4. ! You can't choose to do the section_direction and the depth_min and depth_max without filling in the ! section_location and the time_start and time_end ! section direction can be "N" for N-S or "E" for E-W ! xlo corresponds to the lowest latitude limit ! xhi corresponds to the highest latitude limit ! ylo corresponds to the lowest longitude limit ! yhi corresponds to the highest longitude limit ! depth values are entered in the range of 0 - 2000dbar with the default being 0 - 1000dbar ! time values are entered corresponding to monthly values starting with Jan, 2004 ! con_lev sets the contour and fill levels of the plot. This is done in the following format: (lo,hi,delta). ! More than one can be chosen: (lo,mid,delta1),(mid,hi,delta2). See the Ferret Users Manual for more information. ! if no values are entered, the default is the year 2006 cancel/all data cancel/all var cancel/all sym set window/clear go set_pixel_size 1024 768 set mem/size=60 define viewport/xlim=.0,.95/ylim=0,1 top PPL DFLTFNT DR ppl conpre @P1@DR ppl axlsze 0.15,.15 ppl axset 1,1,1,1 ppl pen 0,7 ppl pen 1,7 ppl labset .15,.15,.15 use RG_ArgoClim_Full.nc let temp=ARGO_TEMPERATURE_MEAN[d=1]+ARGO_TEMPERATURE_ANOMALY[d=1] let psal=ARGO_SALINITY_MEAN[d=1]+ARGO_SALINITY_ANOMALY[d=1] let dyn_p=z[d=1,g=`temp, return=grid`] let depth_min=`$6%0%` let depth_max=`$7%1000%` let time_start=`$4%12%` let time_end=`$5%36%` ! setting the default values let xlo=`$8%130%` let xhi=`$9%180%` let ylo=`$2%-50%` let yhi=`$3%-45%` set mode interpolate ! start of plotting section. ! setting depth region set region/z=`depth_min`:`depth_max` ! a vertical section can only be made if the depths are different. ! depth is the same let a=if `depth_max` eq `depth_min` then 1 else 0 if `a` then say "depth is the same - cannot graph a section" endif ! time is the same - do not average let b=if `time_start` eq `time_end` then 1 else 0 let c=if (`xlo`) ne (`xhi`) then 1 else 0 let d=if (`ylo`) ne (`yhi`) then 1 else 0 let boundb=if (`xlo`) gt (`xhi`) then 1 else 0 if `b` then if ($1%TRUE|N>TRUE|E>FALSE|>TRUE%) then !checking whether it is a N-S or E-W section & assigning N-S as default if `c` then ! setting the default values let t_anom=temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`]-temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=@ave] let anom_max=t_anom[y=@max,z=@max] let anom_min=t_anom[z=@min,y=@min] else ! no averaging over x let t_anom=temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`]-temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=@ave] let anom_max=t_anom[y=@max,z=@max] let anom_min=t_anom[z=@min,y=@min] endif ! c loop else ! E-W section ! Ensuring longitudes are properly plotted if `boundb` then let xhi=`xhi`+360 endif if `d` then let t_anom=temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=`time_start`]-temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=@ave] let anom_max=t_anom[x=@max,z=@max] let anom_min=t_anom[z=@min,x=@min] else ! no averaging over y let t_anom=temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=`time_start`]-temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=@ave] let anom_max=t_anom[x=@max,z=@max] let anom_min=t_anom[z=@min,x=@min] endif ! d loop endif ! b loop endif ! n-s loop ! time is different let e= if `b` eq 0 then 1 else 0 if `e` then if ($1%TRUE|N>TRUE|E>FALSE|>TRUE%) then ! N-S section if `c` then let t_anom=temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=1:60@ave] let anom_max=t_anom[y=@max,z=@max] let anom_min=t_anom[z=@min,y=@min] else ! no averaging over x let t_anom=temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=1:60@ave] let anom_max=t_anom[y=@max,z=@max] let anom_min=t_anom[z=@min,y=@min] endif ! c loop else ! E-W section if `boundb` then let xhi=`xhi`+360 endif if `d` then let t_anom=temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=1:60@ave] let anom_max=t_anom[x=@max,z=@max] let anom_min=t_anom[z=@min,x=@min] else ! no averaging over y let t_anom=temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=1:60@ave] let anom_max=t_anom[x=@max,z=@max] let anom_min=t_anom[z=@min,x=@min] endif ! d loop endif ! e loop endif ! n-s loop ! creating an equal, centered key let abs_max=ABS(`anom_max`) let abs_min=ABS(`anom_min`) ! case where anom_max is bigger than anom_min let maxz=if `abs_max` gt `abs_min` and `abs_max` lt 1 then 1 else 0 if `maxz` then let lev_max = (int(10*abs_max)+1)/10 let lev_min = (int(-10*abs_max)-1)/10 endif let maxnz=if `abs_max` gt `abs_min` and `abs_max` gt 1 then 1 else 0 if `maxnz` then let lev_max=int(anom_max)+1 let lev_min=int((-1*anom_max))-1 endif let anom_diff=lev_max-lev_min let anom_delta=anom_diff/8 ! case where anom_min is bigger than anom_max let minz=if `abs_min` gt `abs_max` and `abs_min` lt 1 then 1 else 0 if `minz` then let lev_max = (int(10*abs_min)+1)/10 let lev_min = (int(10*anom_min)-1)/10 endif let minnz=if `abs_min` gt `abs_max` and `abs_min` gt 1 then 1 else 0 if `minnz` then let lev_max=int(abs_min)+1 let lev_min=int(anom_min)-1 endif let anom_diff=lev_max-lev_min let anom_delta=anom_diff/8 let con_lev= $10&"(`lev_min`,`lev_max`,`anom_delta`)"|*>"*"& ! plotting fill/set/nolab/pal=cofi_pot_centered/lev="`con_lev`" t_anom ppl shakey 1,,.08,,5,,,,,, ppl ylab Pressure (dbar) ppl fill ! adding contours con/set_up/over/nolab/lev="`con_lev`" t_anom ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay ! adding in etopo6 to give bathymetry use etopo6_grid.nc if ($1%TRUE|N>TRUE|E>FALSE|>TRUE%) then ! N-S section if `c` then let mskb if btdata*(-1) lt dyn_p then 1 repeat/x=`xlo`:`xhi` shad/over/nolab/nokey/pal=black mskb[y=`ylo`:`yhi`,z=`depth_min`:`depth_max`] else let mskb if btdata*(-1) lt dyn_p then 1 shad/over/nolab/nokey/pal=black mskb[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`] endif else ! E-W section if `d` then let mskb if btdata*(-1) lt dyn_p then 1 repeat/y=`ylo`:`yhi` shad/over/nolab/nokey/pal=black mskb[x=`xlo`:`xhi`,z=`depth_min`:`depth_max`] else let mskb if btdata*(-1) lt dyn_p then 1 shad/over/nolab/nokey/pal=black mskb[y=`ylo`,x=`xlo`:`xhi`,z=`depth_min`:`depth_max`] endif say Plot is finished say To adjust parameters, use the command line to pass arguments say For this file, the form to pass arguments is say go fer_temp_plot section_direction xlo xhi time_start time_end depth_min depth_max xlo xhi con_lev