! jnl file that uses Argo data to make different vertical section temperature plots. The sections are either ! in a N-s direction or an E-W direction. This does not make arbitrary section plots. ! 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 section_direction ylo yhi 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 ! ylo, yhi, 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. ! The default is the entire time range. ! 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 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 dyn_t=ARGO_TEMPERATURE_MEAN[d=1]+ARGO_TEMPERATURE_ANOMALY[d=1] let dyn_p=ARGO_SALINITY_MEAN[d=1]+ARGO_SALINITY_ANOMALY[d=1] let dyn_p=z[d=1,g=`dyn_t, return=grid`] let depth_min=`$6%1000%` let depth_max=`$7%2000%` let time_start=`$4%37%` let time_end=`$5%37%` ! setting the default values let xlo=`$8%180%` let xhi=`$9%180%` let ylo=`$2%-50%` let yhi=`$3%10%` let depth_axis=`$1%1%` set mode interpolate ! start of plotting section. if `depth_axis` then ! you want meters instead of db as the depth axis unit ! first need to change to depth from pressure let xo=sin(y[g=`dyn_t, return=grid`]*3.1415926/180) let xxo=xo*xo let bot_line=9.780318*(1.0+(5.2788*10^-3+2.36*10^-5*xxo)*xxo) + 1.092*10^-6*dyn_p let top_line=(((-1.82*10^-15*dyn_p+2.279*10^-10)*dyn_p-2.2512*10^-5)*dyn_p+9.72659)*dyn_p let dep=top_line/bot_line ! then regrid onto original pressure grid spacing let temp=zaxreplace(dyn_t,dep,z[gz=`dyn_p, return=grid`]) elseif ! you want db instead of m as the depth axis unit let temp=dyn_t endif ! 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" ! 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 ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,l=`time_start`,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over x ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`,y=`ylo`:`yhi`,l=`time_start`,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`] 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= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,l=`time_start`,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=`time_start`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over y ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`,l=`time_start`,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=`time_start`] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay endif ! d loop endif !b endif !n-s ! time is different let e=if `time_start` ne `time_end` then 1 else 0 if `e` 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 ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,l=`time_start`:`time_end`@ave,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over x ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`,y=`ylo`:`yhi`,l=`time_start`:`time_end`@ave,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay endif ! c loop else ! E-W section if `boundb` then let xhi=`xhi`+360 endif if `d` then ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,l=`time_start`:`time_end`@ave,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay else ! no averaging over y ! plotting let con_lev= $10&"()"|*>"*"& fill/nolab/set/pal=cofi_pot/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`,l=`time_start`:`time_end`@ave,z=`depth_min`:`depth_max`] ppl ylab Pressure (dbar) ppl shakey 1,,.08,,5,,,,,, ppl fill ! adding contours con/over/nolab/set/lev="`con_lev`" temp[x=`xlo`:`xhi`,y=`ylo`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] ppl conset .11,,,,,,,5.7,1.,1 ppl contour/overlay endif ! d loop endif !b 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 !let msk= if temp[y=-50:25,x=130:250,z=0:2000,l=1:36@ave] then 0 else 1 !shade/pal=grey/over/lev=(1)/nolab/nokey msk[x=`xlo`:`xhi`@ave,y=`ylo`:`yhi`,z=`depth_min`:`depth_max`] 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 ! making a mask to put in bathymetry only where there is land !let msk= if temp[y=-50:25,x=130:250,z=0:2000,l=1:36@ave] then 0 else 1 !shade/pal=grey/over/lev=(1)/nolab/nokey msk[x=`xlo`:`xhi`,y=`ylo`:`yhi`@ave,z=`depth_min`:`depth_max`] 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_section section_direction ylo yhi time_start time_end depth_min depth_max xlo xhi con_lev