<div dir="ltr"><div>Hi,<br><br>Please find here a program and other informations as well.<br><br></div><div>Thanks in advance.<br> <br></div><div>C NCLFORTSTART<br> subroutine ES (t,h,w,r,buio,ffmo,<br> 1 xisio,fwio,dmco,dco)<br>C integer tlen<br> dimension t(183),h(183)<br> dimension w(183),r(183)<br> dimension ffmo(183),xisio(183)<br> dimension fwio(183),dmco(183)<br> dimension buio(183),dco(183)<br>C integer indate,yr,mon,day,hr<br>C character*10 timez<br>C NCLEND<br>C write(timez,'(i10)') indate<br>C read(timez,'(i4,3i2)') yr,mon,day,hr<br><br><br> call canada(t,h,w,r,buio,ffmo,xisio,<br> 1 fwio,dmco,dco)<br><br> return<br> end<br><br>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccc<br> subroutine canada(t,h,w,r,buio,ffmo,xisio,<br> 1 fwio,dmco,dco)<br><br> dimension lmon(12), el(12), fl(12)<br> dimension t(183),h(183),w(183),r(183)<br> dimension tin(183),hin(183),win(183),rin(183)<br> dimension ffmc(183),dmc(183),dc(183)<br> 1 ,xisi(183),bui(183),fwi(183),dsr(183)<br> dimension ffmo(183),dmco(183),dco(183),buio(183)<br> dimension fwio(183),xisio(183)<br>c data statement<br> data lmon / 31,28,21,30,31,30,31,31,30,31,30,31/<br> data el /6.5,7.5,9.0,12.8,13.9,13.9,12.4,10.9,9.4,8.0,7.0,<br> 1 6.0/<br> data fl /-1.6,-1.6,-1.6,.9,3.8,5.8,6.4,5.0,2.4,.4,-1.6,<br> 1 -1.6/<br>c<br>c&& enter in the inital values here<br>c 3 fuel moisture codes, initialize<br> ffmo(1) =85.5<br> dmco(1)=6.0<br> dco(1)=15.0<br><br>c keep track of julian day<br> iday=90<br>c start on april 1 and go to september 30 <br> do im=4,9<br> do jday=1,lmon(im)<br> iday = iday +1<br>c move the data from the array to the variable for the calculation on a given day<br> t = tin(iday)<br> h = hin(iday)<br> w = win(iday)<br> r = rin(iday)<br>c<br>c convert m/s to km/hr<br>c w(i,j) = w(i,j)*3.6<br>c<br>c FINE FUEL MOISTURE CODE<br>c<br> wmo = 147.2*(101-ffmo(iday))/(59.5+ffmo(iday))<br> if(r(iday)>0.5) then<br> ra=r(iday)-0.5<br> if (ra.lt.0.1) ra = 0.1<br> if(wmo.gt.150) then<br> wmo= wmo+ 42.5*ra*exp(-100.0/(251-wmo))*(1.0-exp(-6.93/ra))<br> 1 +0.0015*(wmo-150)*(wmo-150)*sqrt(ra)<br> else<br> wmo=wmo+42.5*ra*exp(-100.0/(251-wmo))*(1.0-exp(-6.93/ra))<br> endif<br> endif<br> if (wmo.gt.250.) wmo = 250.<br> ed=0.942 * h(iday)**0.679 +<br> 1 (11.0*exp((h(iday)-100.0)/10.0)) +<br> 1 0.18 * (21.1-t(iday)) * (1.0-1.0/exp(h(iday)*0.115))<br> ew=0.618 * h(iday)**0.753 +<br> 1 (10.0*exp((h(iday)-100.0)/10.0)) +<br> 1 0.18 * (21.1-t(iday)) * (1.0-1.0/exp(h(iday)*0.115))<br> if(wmo.lt.ed.and.wmo.lt.ew) then<br> z = 0.424 * ( 1.0 - ((100.0-h(iday))/100.0)**1.7 ) +<br> 1 0.0694 * sqrt(w(iday)) * (1.0 -<br> 1 ((100.0-h(iday))/100.0)**8.0 )<br> x = z * 0.581 * exp(0.0365*t(iday))<br> wm = ew-(ew-wmo) / (10.0**x)<br> elseif (wmo.gt.ed) then<br> z = 0.424 * ( 1.0 - (h(iday)/100.)**1.7 ) + 0.0694 *<br> 1 sqrt(w(iday)) * ( 1 - (h(iday)/100)**8.0 )<br> x = z * 0.581 * exp(0.0365*t(iday))<br> wm = ed + ( wmo - ed) / (10.0**x)<br> else<br> wm = wmo<br> endif<br> if (wm.lt.0.) wm = 0.0<br> ffmc(iday) = 59.5 * (250.0 - wm) / (147.2 + wm)<br> if (ffmc(iday).gt.101.0) ffmc(iday) = 101.0<br> if (ffmc(iday).lt.0.) ffmc(iday) = 0.<br>c<br>c DUFF MOISTURE CODE<br>c<br> t1=t(iday)<br> if (t(iday).lt.-1.1) t1 = -1.1<br> rk = 1.894 * (t1 + 1.1) * (100.0 - h(iday)) * el(im) * 0.0001<br> if(r(iday).le.1.5) then<br> pr = dmco(iday)<br> else<br> ra = r(iday)<br> rw = 0.92 * ra - 1.27<br> wmi = 20.0 + 280.0 / exp(0.023 * dmco(iday))<br> if(dmco(iday).le.33) then<br> b = 100.0 / (0.5 + 0.3 * dmco(iday))<br> elseif (dmco(iday).le.65) then<br> b = 14.0 - 1.3 * log(dmco(iday))<br> else<br> b = 6.2 * log(dmco(iday)) - 17.2<br> endif<br> wmr = wmi + 1000.0 * rw / (48.77 + b * rw)<br> pr = 43.43 * (5.6348 - log(wmr-20))<br> endif<br> if (pr.lt.0.) pr = 0.<br> dmc(iday) = pr + rk<br> if (dmc(iday).lt.0.) dmc(iday) = 0.<br>c<br>c DROUGHT CODE<br><br> t2 = t(iday)<br> if (t(iday).lt.-2.8) t2 = -2.81<br> pe = (.36 * (t2 + 2.8) + fl(mon)) / 2.0<br> if (pe.lt.0.) pe = 0.0<br>c the fix for winter negative DC change<br> if(r(iday).le.2.801) then<br> dr = dco(iday)<br> else<br> ra = r(iday)<br> rw = 0.83 * ra - 1.27<br> smi = 800 * exp(-dco(iday) / 400)<br> qr = smi + 3.937 * rw<br> dr = 400 * log(800 / qr)<br> if (dr.lt.0.) dr = 0.<br> endif<br> v = 0.36 * (t2 + 2.8) + fl(im)<br> if (v.lt.0.) v = 0.<br> dc(iday) = dr + v * 0.5<br> if (dc(iday).lt.0.) dc(iday)=0.<br>c<br>c INITIAL SPREAD INDEX<br>c<br> fm = 147.2 * (101.0 - ffmc(iday)) / (59.5 + ffmc(iday))<br> sf = 19.115 * exp(-0.1386 * fm) * (1.0 + fm**5.31 / 4.93e07)<br> xisi(iday) = sf * exp(0.05039 * w(iday))<br>c<br>c BUILD UP INDEX<br>c<br> if(dmc(iday).eq.0.and.dc(iday).eq.0.) then<br> bui(iday)=0<br> elseif (dmc(iday).le.0.4*dc(iday)) then<br> bui(iday) = 0.8 * dc(iday) * dmc(iday)<br> 1 / (dmc(iday) + 0.4 * dc(iday))<br> else<br> bui(iday) = dmc(iday) - (1 - 0.8 * dc(iday)<br> 1 / (dmc(iday) + 0.4 *<br> 1 dc(iday))) * (0.92 + (0.0114 * dmc(iday))** 1.7)<br> endif<br> if (bui(iday).lt.0.) bui(iday) = 0.0<br>c<br>c FIRE WEATHER INDEX AND DSR<br>c<br> if(bui(iday).gt.80.) then<br> bb = 0.1 * xisi(iday) *<br> 1 (1000.0 / (25.0 + 108.64 / exp(0.023*bui(iday))))<br> else<br> bb = 0.1 * xisi(iday) * (0.626 * bui(iday)**0.809 + 2.0)<br> endif<br> if (bb.le.1.) then<br> fwi(iday) = bb<br> else<br> fwi(iday) = exp(2.72 * (0.434 * log(bb))**0.647 )<br> endif<br> dsr(iday) = 0.0272 * fwi(iday)**1.77<br>c<br> ffmo(iday)=ffmc(iday)<br> dmco(iday)=dmc(iday)<br> dco(iday)=dc(iday)<br> buio(iday)=bui(iday)<br> fwio(iday)=fwi(iday)<br> xisio(iday)=xisi(iday)<br>c<br> enddo<br><br><br>uname -av<br>Darwin Dale.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64<br></div>ncl -V<br><div><br>6.3.0<br>gxx --version<br>gxx: Command not found.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 12, 2017 at 6:02 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Well, I think you would have to send the fortran code: newcffi_singlegrid.f<br><br></div>Also, the output from the following.<br><br></div>%> ncl -V<br></div>%> gxx--version<br></div>%> uname -a<br><br>=====<br></div>Further, based on a previous email, where you wrote "new to NCL", I suggest that you invest looking at NCL tutorial at:<br> <a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Manuals/NCL_User_<wbr>Guide/</a><br><br></div>Yes, it will take some time BUT you will learn NCL.<br><br></div>Good luck<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Mar 11, 2017 at 7:21 PM, dale zuri <span dir="ltr"><<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hi,<br></div>WRAPIT didn't give any error. But, when I run ncl code, I get below printed warning. And also printed the WRAPIT -d output. <br><br></div><div>Please, help me to fix this bug?<br></div><div>Thank you,<br></div><div>Dale<br></div><div><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br>warning:An error occurred loading the external file ./newcffi_singlegrid.so, file not loaded<br>dlopen(./newcffi_singlegrid.so<wbr>, 2): Symbol not found: _hin_<br> Referenced from: ./newcffi_singlegrid.so<br> Expected in: flat namespace<br> in ./newcffi_singlegrid.so<br>warning:error at line 9 in file canadafire_FWItestZeikcomp.ncl<br><br>fatal:syntax error: line 43 in file canadafire_FWItestZeikcomp.ncl before or near : <br>EX:<br>--^<br><br>fatal:error in statement<br>fatal:Syntax Error in block, block not executed<br><br></div>Output of WRAPIT -d<br>COMPILING newcffi_singlegrid.f<br>gfortran -m64 -fPIC -v -c -fno-second-underscore newcffi_singlegrid.f<br>Using built-in specs.<br>COLLECT_GCC=gfortran<br>Target: x86_64-apple-darwin15.6.0<br>Configured with: ../gcc-6.2.0/configure --enable-languages=c++,fortran --with-gmp=/usr/local<br>Thread model: posix<br>gcc version 6.2.0 (GCC) <br>COLLECT_GCC_OPTIONS='-m64' '-fPIC' '-v' '-c' '-fno-second-underscore' '-mmacosx-version-min=10.12.3' '-mtune=core2'<br> /usr/local/libexec/gcc/x86_64<wbr>-apple-darwin15.6.0/6.2.0/f951 newcffi_singlegrid.f -ffixed-form -fPIC -quiet -dumpbase newcffi_singlegrid.f -m64 -mmacosx-version-min=10.12.3 -mtune=core2 -auxbase newcffi_singlegrid -version -fPIC -fno-second-underscore -fintrinsic-modules-path /usr/local/lib/gcc/x86_64-appl<wbr>e-darwin15.6.0/6.2.0/finclude -o /var/folders/60/qx8g2gvj169741<wbr>yy29b3h0hm0000gn/T//ccLtfHN9.s<br>GNU Fortran (GCC) version 6.2.0 (x86_64-apple-darwin15.6.0)<br> compiled by GNU C version 6.2.0, GMP version 6.0.0, MPFR version 3.1.2-p10, MPC version 1.0.2, isl version none<br>GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>GNU Fortran2008 (GCC) version 6.2.0 (x86_64-apple-darwin15.6.0)<br> compiled by GNU C version 6.2.0, GMP version 6.0.0, MPFR version 3.1.2-p10, MPC version 1.0.2, isl version none<br>GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>COLLECT_GCC_OPTIONS='-m64' '-fPIC' '-v' '-c' '-fno-second-underscore' '-mmacosx-version-min=10.12.3' '-mtune=core2'<br> as -arch x86_64 -force_cpusubtype_ALL -o newcffi_singlegrid.o /var/folders/60/qx8g2gvj169741<wbr>yy29b3h0hm0000gn/T//ccLtfHN9.s<br>COMPILER_PATH=/usr/local/libex<wbr>ec/gcc/x86_64-apple-darwin15.<wbr>6.0/6.2.0/:/usr/local/libexec/<wbr>gcc/x86_64-apple-darwin15.6.0/<wbr>6.2.0/:/usr/local/libexec/gcc/<wbr>x86_64-apple-darwin15.6.0/:/<wbr>usr/local/lib/gcc/x86_64-<wbr>apple-darwin15.6.0/6.2.0/:/<wbr>usr/local/lib/gcc/x86_64-<wbr>apple-darwin15.6.0/<br>LIBRARY_PATH=/usr/local/lib/gc<wbr>c/x86_64-apple-darwin15.6.0/6.<wbr>2.0/:/usr/local/lib/gcc/x86_64<wbr>-apple-darwin15.6.0/6.2.0/../.<wbr>./../<br>COLLECT_GCC_OPTIONS='-m64' '-fPIC' '-v' '-c' '-fno-second-underscore' '-mmacosx-version-min=10.12.3' '-mtune=core2'<br>SHARED OBJECT NAME (SharedObj): newcffi_singlegrid.so<br>LINKER SUFFIX (ld_suffix): WRAPIT.o newcffi_singlegrid.o -o newcffi_singlegrid.so<br> <br>LINKING<br>gcc -m64 -bundle -flat_namespace -undefined suppress WRAPIT.o newcffi_singlegrid.o -o newcffi_singlegrid.so -lgfortran<br>END WRAPIT<br><br><br><div>Thank you<br></div><div><br><br><br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>