! jnl file that uses Argo data to make different temperature line yearly anomaly plots ! requires input arguments for time range, depth range 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_temp_line_yearly_anom type time_start time_end depth_min depth_max lat_min lat_max lon_min lon_max ! 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. ! type means T vs. time(1), T vs. depth (2), T vs. latitude (3), or T vs. longitude (4) ! depth values are entered in the range of 0 - 2000dbar ! time values are entered corresponding to monthly values starting with Jan, 2004 ! if no values are entered, the default region is 50S to 25N and 130E to 250E with an average over the ! entire depth and time region cancel/all data cancel/all var cancel/all sym set window/clear go set_pixel_size 1024 768 set mem/size=80 ! assigning variables to arguments passed in the go command as well as default values let lat_min=`$6%-30%` let lat_max=`$7%-30%` let lon_min=`$8%10%` let lon_max=`$9%170%` let depth_min=`$4%0%` let depth_max=`$5%100%` let time_start=`$2%1%` let time_end=`$3%48%` let type_plot=`$1%2%` 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,7 ppl pen 1,7 ppl labset .15,.15,.15 ! Ensuring longitudes are properly plotted let boundb=if (`lon_min`) gt (`lon_max`) then 1 else 0 if `boundb` then let lon_max=`lon_max`+360 endif 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] ! type 1 plot - line of T vs. time let ltime=if `type_plot` eq 1 then 1 else 0 if `ltime` then say temp vs time ! only lat is the same let a=if (`lat_min`) eq (`lat_max`) and (`lon_min`) ne (`lon_max`) and `depth_min` ne `depth_max` and `time_start` ne `time_end` then 1 else 0 if `a` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`]- temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif ! only lon is the same let b=if (`lon_min`) eq (`lon_max`) and (`lat_min`) ne (`lat_max`) and `depth_min` ne `depth_max` and `time_start` ne `time_end` then 1 else 0 if `b` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`]-temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif ! lat and lon are the same, depth different let c=if (`lon_min`) eq (`lon_max`) and (`lat_min`) eq (`lat_max`) and `depth_min` ne `depth_max` and `time_start` ne `time_end` then 1 else 0 if `c` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`] - temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif ! all three are different let d=if (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) and `depth_min` ne `depth_max` and `time_start` ne `time_end` then 1 else 0 if `d` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`] - temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif ! lon and depth are the same let e=if (`lon_min`) eq (`lon_max`) and `depth_min` eq `depth_max` and (`lat_min`) ne (`lat_max`) and `time_start` ne `time_end` then 1 else 0 if `e` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=`time_start`:`time_end`] - temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=1:60@ave] endif ! lat and depth are the same let f=if (`lat_min`) eq (`lat_max`) and `depth_min` eq `depth_max` and (`lon_min`) ne (`lon_max`) and `time_start` ne `time_end` then 1 else 0 if `f` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`,l=`time_start`:`time_end`] -temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`,l=1:60@ave] endif ! depth is the same let g=if (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) and `depth_min` eq `depth_max` and `time_start` ne `time_end` then 1 else 0 if `g` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=`time_start`:`time_end`] -temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=1:60@ave] endif ! all three are the same let h=if (`lon_min`) eq (`lon_max`) and (`lat_min`) eq (`lat_max`) and `depth_min` eq `depth_max` and `time_start` ne `time_end` then 1 else 0 if `h` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`,l=`time_start`:`time_end`] - temp[x=`lon_min`,y=`lat_min`,z=`depth_min`,l=1:60@ave] endif if `ltime` then plot/nolab/line=13/set temp_plot !LL ppl ylab Argo Temperature (^o) ppl axlabp -1,-1 ppl labset 0.15 0.15 0.15 0.15 ppl axlsze,0.15,0.15 ppl plot ppl origin ,($orig_yorg) !restore y origin endif ! type 2 plot - line of T vs. depth let ldepth=if `type_plot` eq 2 then 1 else 0 if `ldepth` then say temp vs. depth ! only lat is the same let a=if (`lat_min`) eq (`lat_max`) and (`lon_min`) ne (`lon_max`) and `time_start` ne `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `a` then if `ldepth` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! only lon is the same let b=if (`lon_min`) eq (`lon_max`) and (`lat_min`) ne (`lat_max`) and `time_start` ne `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `b` then if `ldepth` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave]-temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! lat and lon are the same, time different let c=if (`lon_min`) eq (`lon_max`) and (`lat_min`) eq (`lat_max`) and `time_start` ne `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `c` then if `ldepth` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] -temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! all three are different let d=if (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) and `time_start` ne `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `d` then if `ldepth` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] -temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! lon and time are the same let e=if (`lon_min`) eq (`lon_max`) and `time_start` eq `time_end` and (`lat_min`) ne (`lat_max`) and `depth_min` ne `depth_max` then 1 else 0 if `e` then if `ldepth` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`] -temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! lat and time are the same let f=if (`lat_min`) eq (`lat_max`) and `time_start` eq `time_end` and (`lon_min`) ne (`lon_max`) and `depth_min` ne `depth_max` then 1 else 0 if `f` then if `ldepth` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] -temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! time is the same let g=if (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) and `time_start` eq `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `g` then if `ldepth` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`] -temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif ! all three are the same let h=if (`lon_min`) eq (`lon_max`) and (`lat_min`) eq (`lat_max`) and `time_start` eq `time_end` and `depth_min` ne `depth_max` then 1 else 0 if `h` then if `ldepth` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] -temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=1:60@ave] endif endif if `ldepth` then plot/nolab/line=13 temp_plot ppl ylab Pressure (dbar) !LL ppl xlab Argo Temperature (^o) ppl axlabp 1,-1 ppl labset 0.2 0.2 0.2 0.2 ppl axlsze,0.15,0.15 ppl plot ppl origin ,($orig_yorg) !restore y origin endif ! type 3 plot - line of T vs. latitude let llat=if `type_plot` eq 3 then 1 else 0 if `llat` then say temp vs. latitude if `llat` then ! only depth is the same let a=if (`lon_min`) ne (`lon_max`) and (`time_start`) ne (`time_end`) and `depth_min` eq `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `a` then if `llat` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`,l=`time_start`:`time_end`@ave]-temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`,l=1:60@ave] endif endif ! only lon is the same let b=if (`lon_min`) eq (`lon_max`) and (`time_start`) ne (`time_end`) and `depth_min` ne `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `b` then if `llat` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`@ave]-temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! time and lon are the same, depth different let c=if (`lon_min`) eq (`lon_max`) and (`time_start`) eq `time_end` and `depth_min` ne `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `c` then if `llat` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=`time_start`] -temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! all three are different let d=if (`lon_min`) ne (`lon_max`) and (`time_start`) ne `time_end` and `depth_min` ne `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `d` then if `llat` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`@ave] - temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! lon and depth are the same let e=if (`lon_min`) eq (`lon_max`) and `depth_min` eq `depth_max` and (`time_start`) ne `time_end` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `e` then if `llat` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`,l=`time_start`:`time_end`@ave] - temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`,l=1:60@ave] endif endif ! time and depth are the same let f=if (`time_start`) eq (`time_end`) and `depth_min` eq `depth_max` and (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) then 1 else 0 if `f` then if `llat` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`,l=`time_start`] - temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`,l=1:60@ave] endif endif ! time is the same let g=if (`lon_min`) ne (`lon_max`) and (`time_start`) eq (`time_end`) and `depth_min` ne `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `g` then if `llat` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=`time_start`] - temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! all three are the same let h=if (`lon_min`) eq (`lon_max`) and (`time_start`) eq (`time_end`) and `depth_min` eq `depth_max` and (`lat_min`) ne (`lat_max`) then 1 else 0 if `h` then if `llat` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`,l=`time_start`] - temp[x=`lon_min`,y=`lat_min`:`lat_max`,z=`depth_min`,l=1:60@ave] endif endif endif !let n= `llat` eq 1 and `ls` ne 1 !if `n` then if `llat` then plot/nolab/line=13/set temp_plot !LL ppl ylab Temperature Difference !LL ppl xlab Argo Temperature (^o) ppl axlabp -1,-1 ppl labset 0.15 0.15 0.15 0.15 ppl axlsze,0.15,0.15 ppl plot ppl origin ,($orig_yorg) !restore y origin endif ! type 4 plot - line of T vs. longitude let llon=if `type_plot` eq 4 then 1 else 0 if `llon` then say temp vs. longitude if `llon` then ! only depth is the same let a=if (`lat_min`) ne (`lat_max`) and (`time_start`) ne (`time_end`) and `depth_min` eq `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `a` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=`time_start`:`time_end`@ave]- temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=1:60@ave] endif endif ! only lat is the same let b=if (`lat_min`) eq (`lat_max`) and (`time_start`) ne (`time_end`) and `depth_min` ne `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `b` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`@ave]- temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! time and lat are the same, depth different let c=if (`lat_min`) eq (`lat_max`) and (`time_start`) eq `time_end` and `depth_min` ne `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `c` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=`time_start`] -temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! all three are different let d=if (`lat_min`) ne (`lat_max`) and (`time_start`) ne `time_end` and `depth_min` ne `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `d` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`@ave] - temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! lat and depth are the same let e=if (`lat_min`) eq (`lat_max`) and `depth_min` eq `depth_max` and (`time_start`) ne `time_end` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `e` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=`time_start`:`time_end`@ave] - temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=1:60@ave] endif endif ! time and depth are the same let f=if (`time_start`) eq (`time_end`) and `depth_min` eq `depth_max` and (`lat_min`) ne (`lat_max`) and (`lon_min`) ne (`lon_max`) then 1 else 0 if `f` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=`time_start`] - temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=1:60@ave] endif endif ! time is the same let g=if (`lat_min`) ne (`lat_max`) and (`time_start`) eq (`time_end`) and `depth_min` ne `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `g` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=`time_start`] - temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=1:60@ave] endif endif ! all three are the same let h=if (`lat_min`) eq (`lat_max`) and (`time_start`) eq (`time_end`) and `depth_min` eq `depth_max` and (`lon_min`) ne (`lon_max`) then 1 else 0 if `h` then if `llon` then let temp_plot= temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=`time_start`] - temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=1:60@ave] endif endif endif !let m= `llon` eq 1 and `b` ne 1 !if `m` then if `llon` then plot/nolab/line=13/set temp_plot !LL ppl ylab Argo Temperature (^o) ppl axlabp -1,-1 ppl labset 0.15 0.15 0.15 0.15 ppl axlsze,0.15,0.15 ppl plot ppl origin ,($orig_yorg) !restore y origin endif