! jnl file that uses Argo data to make dynamic height section plots ! 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_dyn_ht_avg_section_real_time section_direction ylo yhi depth_min depth_max xlo xhi geo_vel 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. ! 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 ! 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. cancel/all data cancel/all var cancel/all sym set mem/size=70 set window/clear go set_pixel_size 1024 768 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_Real_Time.nc let temp=argo_temperature_mean[d=1] let psal=ARGO_SALINITY_MEAN[d=1] let dyn_p=z[d=1,g=`temp, return=grid`] let depth_min=`$4%0%` let depth_max=`$5%600%` ! setting the default values let xlo=`$6%180%` let xhi=`$7%180%` let ylo=`$2%-30%` let yhi=`$3%30%` let geo_vel=`$8%0%` set mode interpolate ! 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`] 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 go dynamic_height ! begin mapping process ! dynamic height 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 velocity" 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 ! now can start plotting dynamic height over 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 ! plotting let con_lev= $9&"()"|*>"*"& fill/nolab/set/pal=default/lev="`con_lev`" dyn_htz[y=`ylo`:`yhi`,x=`xlo`:`xhi`@ave] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! can add contours over the dynamic height plot con/over/nolab/set/lev="`con_lev`" dyn_htz[y=`ylo`:`yhi`,x=`xlo`:`xhi`@ave] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over x ! plotting let con_lev= $9&"()"|*>"*"& fill/nolab/pal=default/set/lev="`con_lev`" dyn_htz[y=`ylo`:`yhi`,x=`xlo`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! can add contours over the dynamic height plot con/over/nolab/lev="`con_lev`"/set dyn_htz[y=`ylo`:`yhi`,x=`xlo`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay endif ! c loop else ! E-W section ! Ensuring longitudes are properly plotted if `boundb` then let xhi=`xhi`+360 endif if `d` then ! plotting let con_lev= $9&"()"|*>"*"& fill/nolab/pal=default/set/lev="`con_lev`" dyn_htz[y=`ylo`:`yhi`@ave,x=`xlo`:`xhi`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! can add contours over the dynamic height plot con/over/nolab/set/lev="`con_lev`" dyn_htz[y=`ylo`:`yhi`@ave,x=`xlo`:`xhi`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over y ! plotting let con_lev= $9&"()"|*>"*"& fill/nolab/pal=default/set/lev="`con_lev`" dyn_htz[y=`ylo`,x=`xlo`:`xhi`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! can add contours over the dynamic height plot con/over/nolab/set/lev="`con_lev`" dyn_htz[y=`ylo`,x=`xlo`:`xhi`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay endif ! d loop endif !n-s ! adding in etopo6 to give bathymetry use etopo6_grid.nc if ($1%TRUE|N>TRUE|E>FALSE|>TRUE%) then ! N-S section ! making a mask to put in bathymetry only where there is land if `c` then let mskb if btdata*(-1) lt dyn_p then 1 repeat/x=`xlo`:`xhi` shad/nolab/over/nokey/pal=black mskb[y=`ylo`:`yhi`,z=`depth_min`:`depth_max`] else let mskb if btdata*(-1) lt dyn_p then 1 shad/nolab/nokey/over/pal=black mskb[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`] endif else ! E-W section ! making a mask to put in bathymetry only where there is land if `d` then let mskb if btdata*(-1) lt dyn_p then 1 repeat/y=`ylo`:`yhi` shad/nolab/nokey/over/pal=black mskb[x=`xlo`:`xhi`,z=`depth_min`:`depth_max`] else let mskb if btdata*(-1) lt dyn_p then 1 shad/nolab/over/nokey/pal=black mskb[y=`ylo`,x=`xlo`:`xhi`,z=`depth_min`:`depth_max`] endif endif ! ns loop if `geo_vel eq 1` then if ($1%TRUE|N>TRUE|E>FALSE|>TRUE%) then ! N-S section go fer_geo_vel_section_overlay N else go fer_geo_vel_section_overlay E endif 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_avg_section_real_time section_direction ylo yhi depth_min depth_max xlo xhi geo_vel con_lev