! jnl file that uses Argo data to make dynamic height anomaly plots. The anomaly is from the yearly mean. ! This file requires input arguments for the time range, dynamic height levels and lat/lon range ! to run the program in ferret, you will need to type the following line with the various values filled in: ! go fer_podens_yearly_anom time_start time_end depth_top_level depth_bottom_level lat_min lat_max lon_min lon_max iland 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 lat/lon ranges, you must fill in values ! for the first 4 variables as well as the lat/lon ranges. ! depth values are entered in the range of 0 to 2000dbar ! time values are entered in the range of 1-53 corresponding to monthly values starting with Jan, 2004 ! and ending with May, 2008 ! iland 0=hig res, 1=low res go fland ! 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 region is 50S to 25N and 130E to 250E with an average over the ! time region and 0 to 1000dbar cancel/all data cancel/all var cancel/all sym set mem/size=50 set window/clear go set_pixel_size 1024 768 ! assigning variables to arguments passed in the go command as well as default values let lat_min=`$5%-50%` let lat_max=`$6%25%` let lon_min=`$7%130%` let lon_max=`$8%250%` let depth_min=`$3%0%` let depth_max=`$4%1000%` let time_start=`$1%25%` let time_end=`$2%36%` let iland=`$9%0%` set mode interpolate set region/z=`depth_min`:`depth_max`/y=`lat_min`:`lat_max`/x=`lon_min`:`lon_max` 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,13 ppl pen 1,13 ppl labset .15,.15,.15 ! load data use argo_grid.nc let temp=temp_mean[d=1]+temp_anom[d=1] let psal=psal_mean[d=1]+psal_anom[d=1] ! setting map scales properly let bounda=if (`lon_min`) gt 180 and (`lon_max`) gt 180 then 1 else 0 if `bounda` then let lon_min=`lon_min`-360 let lon_max=`lon_max`-360 endif let bound=if (`lon_min`) gt 180 then 1 else 0 if `bound` then let lon_min=`lon_min`-360 endif define symbol xdeg `lon_max-lon_min` define symbol ydeg `lat_max-lat_min` define symbol alasp `($ydeg)/($xdeg)` set win/asp=($alasp):axis ! setting depth region set region/z=`depth_min`:`depth_max` ! calculate dynamic height let dyn_s=psal[d=1] let dyn_t=temp[d=1] let dyn_p=z[d=1,g=`temp, return=grid`] go dynamic_height let dens=rho_un(dyn_s,dyn_t,dyn_p) let potemp=THETA_FO(dyn_s,dyn_t,dyn_p,0) let podens=rho_un(dyn_s,potemp,0.)-1000 ! begin mapping process ! potential density can only be plotted if the depths are different. ! depth is the same let a=if `depth_min` eq `depth_max` then 1 else 0 if `a` then say "depth is the same - cannot graph dynamic height" !time is the same let b=if `time_start` eq `time_end` then 1 else 0 if `b` then let dyn_ht_anom=dyn_ht[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`,l=`time_start`,z=`depth_min`:`depth_max`]-dyn_ht[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`,l=1:60@ave,z=`depth_min`:`depth_max`] endif !time is different let d= if `a` eq 0 and `b` eq 0 then 1 else 0 if `d` then let dyn_ht_anom=dyn_ht[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`,l=`time_start`:`time_end`@ave,z=`depth_min`:`depth_max`]-dyn_ht[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`,l=1:60@ave,z=`depth_min`:`depth_max`] endif let anom_max=dyn_ht_anom[x=@max,y=@max] let anom_min=dyn_ht_anom[x=@min,y=@min] 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(100*abs_max)+1)/100 let lev_min = (int(-100*abs_max)-1)/100 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(10*anom_max)+1)/10 let lev_min=(int((-10*anom_max))-1)/10 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(100*abs_min)+1)/100 let lev_min = (int(100*anom_min)-1)/100 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(10*abs_min)+1)/10 let lev_min=(int(10*anom_min)-1)/10 endif let anom_diff=lev_max-lev_min let anom_delta=anom_diff/8 let con_lev= $10&"(`lev_min`,`lev_max`,`anom_delta`)"|*>"*"& fill/set/nolab/pal=centered/lev="`con_lev`" dyn_ht_anom ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/set_up/over/nolab/lev="`con_lev`" dyn_ht_anom ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay ! now use etopo6 to add bathymetry if `iland eq 0` then use etopo6_grid.nc fill/over/nokey/nolab/palette=black/hlim=`lon_min`:`lon_max`/vlim=`lat_min`:`lat_max`/levels=(0,10000,10000) btdata[y=`lat_min`:`lat_max`,x=`lon_min`:`lon_max`] fill/over/nokey/nolab/palette=lightgreyscale/over/hlim=`lon_min`:`lon_max`/vlim=`lat_min`:`lat_max`/levels=(-1000,0,1000) btdata[y=`lat_min`:`lat_max`,x=`lon_min`:`lon_max`] fill/over/nokey/nolab/palette=grey/over/hlim=`lon_min`:`lon_max`/vlim=`lat_min`:`lat_max`/levels=(-200,0,200) btdata[y=`lat_min`:`lat_max`,x=`lon_min`:`lon_max`] else use etopo6_grid.nc fill/over/nokey/nolab/palette=black/hlim=`lon_min`:`lon_max`/vlim=`lat_min`:`lat_max`/levels=(0,10000,10000) btdata[y=`lat_min`:`lat_max`,x=`lon_min`:`lon_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_dyn_ht_yearly_anom time_start time_end depth_top_level depth_bottom_level lat_min lat_max lon_min lon_max iland con_lev