<div class="__aliyun_email_body_block"><div><div>Hi all,</div><div><br data-mce-bogus="1"></div><div>I have 3-hr netcdf data in 12 separated files (ie for 12 months). I'm trying to extract one grid preciptation for the whole year. I have the problem about how to define one variable with different dimensions when I read data from different files. Could you please help me with it? Thanks.</div><div><br data-mce-bogus="1"></div><div>As below are the data info, and my script:</div><div><div>dimensions:</div><div>lon = 700 ;</div><div>lat = 400 ;</div><div>time = UNLIMITED ;</div><div><div>short prec(time, lat, lon) ;</div><div>&nbsp; &nbsp; prec:scale_factor = 0.002f ;</div><div>&nbsp; &nbsp; prec:add_offset = 50.f ;</div><div>&nbsp; &nbsp; prec:_Fill_Value = -32767s ;</div><div>&nbsp; &nbsp; prec:missing_value = -32767s ;</div><div>&nbsp; &nbsp; prec:units = "mm hr-1" ;</div><div>&nbsp; &nbsp; prec:long_name = "Precipitation rate" ;</div><div><br data-mce-bogus="1"></div></div><div><br></div></div><div>&nbsp;year = 2008</div><div>&nbsp;mon = 12</div><div>&nbsp;nhour = new(mon,integer)</div><div><br></div><div>&nbsp; if(year .eq. 2008) then</div><div>&nbsp; &nbsp;day_leap &nbsp; &nbsp;= (/31,29,31,30,31,30,31,31,30,31,30,31/)</div><div>&nbsp; &nbsp;do i = 0,mon-1</div><div>&nbsp; &nbsp; &nbsp; nhour(i) = day_leap(i)*8</div><div>&nbsp; &nbsp;end do</div><div>&nbsp; else</div><div>&nbsp; &nbsp;day_nonleap = (/31,28,31,30,31,30,31,31,30,31,30,31/)</div><div>&nbsp; &nbsp;do i = 0,mon-1</div><div>&nbsp; &nbsp; &nbsp;nhour(i) = day_nonleap(i)*8</div><div>&nbsp; &nbsp;end do</div><div>&nbsp; end if</div><div><strong><br data-mce-bogus="1"></strong></div><div><strong>pp = &nbsp;new((/12,nhour/),float)</strong></div><div><div>do imon = 1,12</div><div>&nbsp; &nbsp; &nbsp;if(imon.lt.10) then</div><div>&nbsp; &nbsp; &nbsp; &nbsp;mon3 = "0"+imon</div><div>&nbsp; &nbsp; &nbsp;else</div><div>&nbsp; &nbsp; &nbsp; &nbsp;mon3 = ""+imon</div><div>&nbsp; &nbsp; &nbsp;end if</div><div>&nbsp; &nbsp; &nbsp;scrDir0 = "/d1/zhangg/prec/"</div><div>&nbsp; &nbsp;do ifl = 0,nhour(imon-1)-1</div><div>&nbsp; &nbsp; &nbsp;na &nbsp;= addfile(scrDir0+"prec_ITPCAS-CMFD_V0105_B-01_"+year+mon3+".nc","r")</div><div>&nbsp; &nbsp;<strong> pp(imon-1,ifl) &nbsp;= na-&gt;prec(:,107,302)</strong></div><div>&nbsp; &nbsp;end do</div><div>&nbsp; end do</div></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div><div class="__aliyun_signature_wrap"><br><br></div><div contenteditable="false" data-mce-bogus="1" style="position: absolute; top: 0px; left: 0; width: 1px; height: 1px; overflow: hidden"><div contenteditable="true" data-mce-bogus="1">X</div></div></div>