[ncl-talk] subtracting values of two different files

amit timilsina timilsinaamit87 at huskers.unl.edu
Tue May 19 22:36:06 MDT 2015


This works perfectly but I could not retrieve the lat, lon and month information. What changes do I need to make? Any link which can help me?
Thank yo very much for your support.
Regards,
Amit

On Tue, May 19, 2015 at 6:48 PM, David Brown <dbrown at ucar.edu> wrote:
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150520/9742f79f/attachment.html 


More information about the ncl-talk mailing list