[ncl-talk] subtracting values of two different files
David Brown
dbrown at ucar.edu
Tue May 19 17:48:44 MDT 2015
Well as a matter of fact you can just subtract the two arrays. Note
the way I do it means the time coordinate of the result has the values
of the first array, but that is arbitrary:
f1 = addfile("tasmin_Amon_MPI-ESM-LR_decadal1980_r1i1p1_198101-201012_USA.nc","r")
f2 = addfile("tasmin_Amon_MPI-ESM-LR_rcp26_r1i1p1_201101-204012_USA.nc","r")
tasmin1 = f1->tasmin
tasmin2 = f2->tasmin
;printVarSummary(tasmin1)
;printVarSummary(tasmin2)
printMinMax(tasmin1,0)
printMinMax(tasmin2,0)
tasmin_diff = tasmin1 ; propagate the attributes to the result --
note some attributes may need editing after this.
tasmin_diff = tasmin1 - tasmin2
;printVarSummary(tasmin_diff)
printMinMax(tasmin_diff,0)
On Tue, May 19, 2015 at 3:00 PM, amit timilsina
<timilsinaamit87 at huskers.unl.edu> wrote:
> Hello all,
> I have two files which contains three dimensions; time, latitude and longitude. Latitude and longitude of both files are similar but time scale is different which are 1980 to 2010 in case of first file and 2011 to 2040 for second file. The variable here is minimum temperature (tasmin). I want to subtract tasmin value of one file with another. Is there easy way to use both the files at a time and get difference for tasmin value??
>
> I have attached two files as well.
>
>
> Regards,
> Amit
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
More information about the ncl-talk
mailing list