<div dir="ltr"><div>Dear Wei-keng,</div><div><br></div>Thank you for your quick reply! Sorry if I'm replying via email but I can't find an option to reply to the ticket directly.<br><div><br></div><div>I followed your suggestion and modified the source code in the following way, in order to echo the value of emisa_times_varid before NCERR</div><div><br></div><div><pre class="gmail-wiki" style="background:rgb(247,247,247);border:1px solid rgb(215,215,215);margin:1em 1.75em;padding:0.25em;overflow:auto;color:rgb(0,0,0);font-size:13px">write(*,*) "EMISA_TIMES_VARID =",emisa_times_varid
ncstat = nfmpi_get_vara_text_all(emisa_nc%id, emisa_times_varid, &
& (/i2offset(1), i2offset(ihourrun+1)/), (/i2offset(dlen), i2offset(1)/), datebuf)
write(*,*) "EMISA_TIMES_VARID AFTER =",emisa_times_varid
NCERR(__LINE__)</pre></div><div class="gmail_extra"><br><div class="gmail_quote">In both cases, before and after the call to nfmpi, the value of emisa_times_varid is 0. </div><div class="gmail_quote"><br></div><div class="gmail_quote">As your links states that is effectively the NC_GLOBAL constant for Fortran. </div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">2017-05-25 18:46 GMT+02:00 parallel-netcdf <span dir="ltr"><<a href="mailto:parallel-netcdf@mcs.anl.gov" target="_blank">parallel-netcdf@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">#30: Action prohibited on NC_GLOBAL varid<br>
------------------------------<wbr>------------------------------<wbr>-----+----------<br>
</span> Reporter: Federico Carotenuto <carotenuto.federico@…> | Owner: wkliao<br>
Type: defect/bug | Status: assigned<br>
<span class=""> Priority: major | Milestone:<br>
Component: parallel-netcdf | Version: 1.8.1<br>
Keywords: |<br>
------------------------------<wbr>------------------------------<wbr>-----+----------<br>
</span>Changes (by wkliao):<br>
<br>
* owner: robl => wkliao<br>
* status: new => assigned<br>
<br>
<br>
Comment:<br>
<br>
Hi,<br>
<br>
The Fortran constant NF_GLOBAL is defined in both NetCDF and PnetCDF as<br>
value 0.<br>
Its corresponding constant in C library NC_GLOBAL is defined as value -1.<br>
The variable ID returned from the Fortran nfmpi_def_var API should have a<br>
value larger than 0.<br>
You might want to check the value of emisa_times_varid right after the<br>
call to nfmpi_def_var.<br>
Do let me know if you got 0 for emisa_times_varid.<br>
<br>
The MATLAB may return a value that is C based.<br>
<br>
See definition of nf_global in the NetCDF Fortran header file from this<br>
URL[[br]]<br>
<a href="https://github.com/Unidata/netcdf-" rel="noreferrer" target="_blank">https://github.com/Unidata/<wbr>netcdf-</a><br>
fortran/blob/master/fortran/<wbr>netcdf3.inc#L96<br>
<br>
and PnetCDF Fortran header files from[[br]]<br>
<a href="https://trac.mcs.anl.gov/projects/parallel-" rel="noreferrer" target="_blank">https://trac.mcs.anl.gov/<wbr>projects/parallel-</a><br>
netcdf/browser/trunk/src/libf/<a href="http://pnetcdf.inc.in#L161" rel="noreferrer" target="_blank"><wbr>pnetcdf.inc.in#L161</a><br>
<br>
Wei-keng<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ticket URL: <<a href="http://trac.mcs.anl.gov/projects/parallel-netcdf/ticket/30#comment:1" rel="noreferrer" target="_blank">http://trac.mcs.anl.gov/<wbr>projects/parallel-netcdf/<wbr>ticket/30#comment:1</a>><br>
parallel-netcdf <<a href="https://trac.mcs.anl.gov/projects/parallel-netcdf" rel="noreferrer" target="_blank">https://trac.mcs.anl.gov/<wbr>projects/parallel-netcdf</a>><br>
<br>
</font></span></blockquote></div><br></div></div>