! jnl file that uses Argo data to make different temperature hovmoller anomaly plots. The anomaly is from the ! 2004-2007 mean. ! 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_hovmoller_yearly_anom time_start time_end depth_min depth_max lat_min lat_max lon_min lon_max 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 - 2000dbar ! time values are entered in a range starting with Jan, 2004 ! 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=200 ! set the aspect ratio SET WINDOW/ASPECT=.75 ! assigning variables to arguments passed in the go command as well as default values let lat_min=`$5%-2%` let lat_max=`$6%-2%` let lon_min=`$7%130%` let lon_max=`$8%250%` let depth_min=`$3%0%` let depth_max=`$4%0%` let time_start=`$1%1%` let time_end=`$2%53%` set mode interpolate 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 ! load in first file use RG_ArgoClim_Temp_2014.nc let t1=ARGO_TEMPERATURE_MEAN[d=1]+ARGO_TEMPERATURE_ANOMALY[d=1] ! now set up grid for entire time range define axis/x=20.5E:19.5E:1/unit=degree xlong define axis/y=64.5S:79.5N:1/unit=degree ylat define axis/t="16-Jan-2004":"16-Dec-2023":1/units=months tclim let dyn_p=z[d=1,g=`t1, return=grid`] define grid/x=xlong/y=ylat/z=dyn_p/t=tclim RG_grid ! now load in second temp file use RG_ArgoClim_Temp_2024.nc let t2=ARGO_TEMPERATURE_MEAN[d=2]+ARGO_TEMPERATURE_ANOMALY[d=2] ! now try to put all data onto same grid let t_b1 = t1[gt=RG_grid@asn] let t_b2 = t2[gt=RG_grid@nrst] ! load in first salinity file use RG_ArgoClim_Psal_2014.nc let s1=ARGO_SALINITY_MEAN[d=3]+ARGO_SALINITY_ANOMALY[d=3] ! now load in second psal file use RG_ArgoClim_Psal_2024.nc let s2=ARGO_SALINITY_MEAN[d=4]+ARGO_SALINITY_ANOMALY[d=4] ! now try to put all data onto same grid let s_b1 = s1[gt=RG_grid@asn] let s_b2 = s2[gt=RG_grid@nrst] ! mask out the current data let mskt1 = if t_b1 then 1 else 0 ! define new full time scale data let temp = if mskt1 eq 1 then t_b1 else t_b2 let psal = if mskt1 eq 1 then s_b1 else s_b2 ! 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 ! only map an average if the two depths/times are different. otherwise, map at that depth/time only ! only plot averaged points if there is data down at the deepest layer let mskd=if temp[z=`depth_max`] then 1 let msk_temp=mskd*temp ! 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` then 1 else 0 ! only depth is the same let b=if (`lat_min`) ne (`lat_max`) and (`lon_min`) ne (`lon_max`) and `depth_min` eq `depth_max` then 1 else 0 ! both are the same let c=if (`lon_min`) ne (`lon_max`) and (`lat_min`) eq (`lat_max`) and `depth_min` eq `depth_max` then 1 else 0 ! all 3 are different let d=if (`lon_min`) ne (`lon_max`) and (`lat_min`) ne (`lat_max`) and `depth_min` ne `depth_max` then 1 else 0 if `a` then let temp_time_anom= msk_temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`]- msk_temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`:`depth_max`@ave,l=1:156@ave] endif if `b` then let temp_time_anom= temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=`time_start`:`time_end`]-temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`,l=1:156@ave] endif if `c` then let temp_time_anom= temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=`time_start`:`time_end`] -temp[x=`lon_min`:`lon_max`,y=`lat_min`,z=`depth_min`,l=1:156@ave] endif if `d` then let temp_time_anom= msk_temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=`time_start`:`time_end`] -msk_temp[x=`lon_min`:`lon_max`,y=`lat_min`:`lat_max`@ave,z=`depth_min`:`depth_max`@ave,l=1:156@ave] endif let anom_max=temp_time_anom[l=@max,x=@max] let anom_min=temp_time_anom[l=@min,x=@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(10*abs_max)+1)/10 let lev_min = (int(-10*abs_max)-1)/10 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(anom_max)+1) let lev_min=(int((-1*anom_max))-1) 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(10*abs_min)+1)/10 let lev_min = (int(10*anom_min)-1)/10 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(abs_min)+1) let lev_min=(int(anom_min)-1) endif let anom_diff=lev_max-lev_min let anom_delta=anom_diff/8 let con_lev= $9&"(`lev_min`,`lev_max`,`anom_delta`)"|*>"*"& fill/nolab/pal=cofi_pot_centered/set/lev="`con_lev`" temp_time_anom ppl ylab Pressure(dbar) ppl shakey 1,1,.08,0,5,9,,,, ppl fill ! adding contours con/set_up/over/nolab/lev="`con_lev`" temp_time_anom ppl conset .08,,,,,,,5.7,1.,1 ppl contour/overlay 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_hovmoller_yearly_anom time_start time_end depth_min depth_max lat_min lat_max lon_min lon_max con_lev