! jnl file that uses Argo data to make temperature - salinity 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_psal type_plot 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 values are for T vs. S (1) or T vs. depth overlaid with S vs. depth (2) ! 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%170%` 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 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] ! 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 ! type 1 plot - T vs. S let ts=if `type_plot` eq 1 then 1 else 0 if `ts` then say T vs. S ! 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` 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`,l=`time_start`:`time_end`@ave] let psal_plot= psal[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] endif ! only lon is the same !let b=if `time_start` ne `time_end` and (`lat_min`) ne (`lat_max`) and (`lon_min`) eq (`lon_max`) then 1 else 0 let b=if `time_start` ne `time_end` and (`lat_min`) ne (`lat_max`) and (`lon_min`) eq (`lon_max`) 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`,l=`time_start`:`time_end`@ave] let psal_plot= psal[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] 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` then 1 else 0 if `c` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] let psal_plot= psal[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] 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` 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`,l=`time_start`:`time_end`@ave] let psal_plot= psal[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`:`time_end`@ave] 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`) then 1 else 0 if `e` then let temp_plot= temp[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`] let psal_plot= psal[x=`lon_min`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`] 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`) then 1 else 0 if `f` then let temp_plot= temp[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] let psal_plot= psal[x=`lon_min`:`lon_max`@ave,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] 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` 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`:`depth_max`,l=`time_start`] let psal_plot= psal[x=`lon_min`:`lon_max`@ave,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`,l=`time_start`] 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` then 1 else 0 if `h` then let temp_plot= temp[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] let psal_plot= psal[x=`lon_min`,y=`lat_min`,z=`depth_min`:`depth_max`,l=`time_start`] endif if `ts` then plot/nolab/line=13/set/vs psal_plot,temp_plot ppl xlab Argo Salinity (psu) ppl ylab Argo Temperature (^oC) 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 - T vs. D and S vs. D let tsd = if `type_plot` eq 2 then 1 else 0 if `tsd` then say T vs. D and S vs. D if `tsd` then plot/nolab/line=13/set temp_plot ppl ylab Argo Pressure (dbar) ppl xlab Argo Temperature (^oC) ppl axlabp 1,-1,0,0 ppl labset 0.2 0.2 0.2 0.2 ppl axlsze,0.15,0.15 ppl axset 1,0,1,1 ppl plot plot/nolab/set/line=15/axes=0,1,0,1 psal_plot ppl xlab @p3@drArgo Salinity (psu) ppl axlabp -1,1 !ppl axlabp -1,1,0,0 ! lay on the new axis ppl %range 'PPL$xMIN1','PPL$xMAX1',10 ppl %xaxis/nouser, 'ppl$range_low','ppl$range_high','ppl$range_inc' let range_high='ppl$range_high'+.1 ! draw the plot ppl window off ppl plot/over ppl origin ,($orig_yorg) !restore y origin endif