! jnl file that uses Argo or Reynolds SST data to make Nino-3 and Nino-3.4 indices maps ! requires input arguments for time range ! to run the program in ferret, you will need to type the following line with the various values filled in: ! go fer_nino_ind type_plot time_start time_end ! 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_plot=1 is Argo Nino-3 index, type_plot=2 is Argo Nino-3.4 index, type_plot=3 is Reynolds Nino-3 index, ! type_plot=4 is Reynolds Nino-3.4 index ! time values are entered corresponding to monthly values starting with Jan, 2004 cancel/all data cancel/all var cancel/all sym cancel region set window/clear go set_pixel_size 1024 768 set mem/size=200 ! assigning variables to arguments passed in the go command as well as default values let time_start=`$2%1%` let time_end=`$3%56%` let type_plot=`$1%1%` set mode interpolate PPL DFLTFNT DR ppl conpre @P1@DR ppl axlsze 0.15,.12 ppl axset 1,1,1,1 ppl pen 0,7 ppl pen 1,7 ppl pen 2,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 dyn_t = if mskt1 eq 1 then t_b1 else t_b2 let dyn_s = if mskt1 eq 1 then s_b1 else s_b2 use climatological_axes.cdf let clim_temp=dyn_t[gt=month_irreg@mod] let t_anom=dyn_t-clim_temp use reynolds_sst_grid.nc let clim_sst=sst[d=reynolds_sst_grid.nc,gt=month_irreg@mod] let sst_anom=sst-clim_sst define viewport/xlim=.0,.95/ylim=0,1 top let athree= if `type_plot` eq 1 then 1 else 0 if `athree` then define region/z=0/y=-5:5/x=210:270 mreg set region mreg ! begin mapping process let nino= t_anom[x=@ave,y=@ave,l=`time_start`:`time_end`] endif let afour= if `type_plot` eq 2 then 1 else 0 if `afour` then define region/z=0/y=-5:5/x=190:240 mreg set region mreg ! begin mapping process let nino= t_anom[d=RG_ArgoClim_Temp.nc,x=@ave,y=@ave,l=`time_start`:`time_end`] endif let rthree= if `type_plot` eq 3 then 1 else 0 if `rthree` then define region/z=0/y=-5:5/x=210:270 mreg set region mreg ! begin mapping process let nino= sst_anom[d=reynolds_sst_grid.nc,x=@ave,y=@ave,l=`time_start`:`time_end`] endif let rfour= if `type_plot` eq 4 then 1 else 0 if `rfour` then define region/z=0/y=-5:5/x=190:240 mreg set region mreg ! begin mapping process let nino= sst_anom[d=reynolds_sst_grid.nc,x=@ave,y=@ave,l=`time_start`:`time_end`] endif ! set axes equal above and below zero line let anom_max=nino[l=@max] let anom_min=nino[l=@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 plot/nolab/line=13/vlim=`lev_min`:`lev_max`:0.25/set nino if `athree` then ppl ylab Argo SST Nino-3 Anomaly endif if `afour` then ppl ylab Argo SST Nino-3.4 Anomaly endif if `rthree` then ppl ylab Reynolds SSt Nino-3 Anomaly endif if `rfour` then ppl ylab Reynolds SST Nino-3.4 Anomaly endif ppl cross,2 (l=`time_start`:`time_end`,y=0) ppl plot 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_nino_ind type time_start time_end