<div dir="ltr"><div><div>Hi,<br><br></div><div>I'm not certain, but I suspect the declaration for mpr be:<br><br></div><div> real mpr(IM, JM, 24)<br><br></div><div>rather than using "dimension"?<br><br><br></div>With your use of "implicit none", I'm a bit confused as to why you aren't getting a compile time error.<br><br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 2:30 PM, xiaoming Hu <span dir="ltr"><<a href="mailto:yuanfangcan@hotmail.com" target="_blank">yuanfangcan@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"> In my NCL I have <div><br></div><div><div> printVarSummary(mpr)</div><div> print(dimlc(0))</div><div> print(dimlc(1))</div><div> printVarSummary(Time_mpr)</div><div> EX:: get_maxind(mpr,Time_mpr, dimlc(0),dimlc(1))</div></div><div><br></div><div><br></div><div>When I run it, I got </div><div>"fatal:Argument type mismatch on argument (0) of (get_maxind) can not coerce</div><div>fatal:Execute: Error occurred at or near line 59 in file plot_stageIV_precip.HourlyMean_peakTime_Fortran.ncl</div><div>"</div><div>The type of mpr is float. </div><div><br></div><div>In my Fortran code </div><div><div> SUBROUTINE get_maxind (mpr,Time_mpr,JM, IM)</div><div> implicit none</div><div> integer,intent(in) :: JM, IM</div><div> real,intent(in) :: mpr(IM,JM,24)</div><div> integer :: Time_mpr(IM,JM)</div><div> integer :: J, I</div><div>! do J = 1, JM</div><div>! do I=1,IM</div><div>! Time_mpr(j,i) = MAXLOC(mpr, 1) </div><div> Time_mpr = MAXLOC(mpr, 1)</div><div>! enddo</div><div>! enddo </div><div> RETURN</div><div> END SUBROUTINE get_maxind</div></div><div><br></div><div>In my stub</div><div><div>C NCLFORTSTART</div><div> SUBROUTINE get_maxind (mpr,Time_mpr,JM, IM)</div><div> implicit none</div><div> integer JM, IM</div><div> dimension mpr(IM,JM, 24)</div><div> dimension Time_mpr(IM,JM)</div><div>C NCLEND</div></div><div><br></div><div>Could anybody tell what is wrong? </div><div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div>Xiaoming </div><div><br></div>                                            </font></span></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>