<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Soma,<br>
    <br>
    if the file example.nc already exists NCL can't create a new one
    with the same name. You have to remove the file, first.<br>
    <br>
    <font color="#3333ff"><tt>    filo = "example.nc"                   
        ; Output file</tt><tt><br>
      </tt><b><tt>    system("rm -rf "+filo)</tt></b><tt><br>
      </tt><tt>    fout  = addfile (filo, "c")            ; open output
        file</tt><tt><br>
      </tt></font><br>
    -Karin<br>
    <br>
    <div class="moz-cite-prefix">Am 17.07.18 um 12:22 schrieb Soma Roy:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAJRSQd2+bEnC-aekj9_yN4KnmDYOoH7OPTyWAWrgBH+vWbH3A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="auto">
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">I
          am trying to save the variable ZMT in NetCDF file following
          the instructions at the below-mentioned link;</div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><a
            href="http://www.ncl.ucar.edu/Applications/method_2.shtml"
            style="text-decoration-line:none;color:rgb(66,133,244)"
            moz-do-not-send="true">http://www.ncl.ucar.edu/Applications/method_2.shtml</a><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">Summary
          of the dataset is as follows;</div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">
          <div>Variable: <span style="background-color:rgb(243,243,243)"><font
                color="#ff0000">lat</font></span></div>
          <div>Type: float</div>
          <div>Total Size: 244 bytes</div>
          <div>            61 values</div>
          <div>Number of Dimensions: 1</div>
          <div>Dimensions and sizes:   [latitude | 61]</div>
          <div>Coordinates:</div>
          <div>            latitude: [ 5..20]</div>
          <div>Number Of Attributes: 2</div>
          <div>  units :       degrees_north</div>
          <div>  long_name :   latitude</div>
          <div><br>
          </div>
          <div>Variable: <font color="#ff0000">lon</font></div>
          <div>Type: float</div>
          <div>Total Size: 324 bytes</div>
          <div>            81 values</div>
          <div>Number of Dimensions: 1</div>
          <div>Dimensions and sizes:   [longitude | 81]</div>
          <div>Coordinates:</div>
          <div>            longitude: [70..90]</div>
          <div>Number Of Attributes: 2</div>
          <div>  units :       degrees_east</div>
          <div>  long_name :   longitude</div>
          <div><br>
          </div>
          <div>Variable: <font color="#ff0000">time</font></div>
          <div>Type: integer</div>
          <div>Total Size: 16 bytes</div>
          <div>            4 values</div>
          <div>Number of Dimensions: 1</div>
          <div>Dimensions and sizes:   [time | 4]</div>
          <div>Coordinates:</div>
          <div>            time: [1025088..1025160]</div>
          <div>Number Of Attributes: 3</div>
          <div>  units :       hours since 1900-01-01 00:00:0.0</div>
          <div>  long_name :   time</div>
          <div>  calendar :    gregorian</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>Variable: <font color="#ff0000">pnew</font></div>
          <div>Type: integer</div>
          <div>Total Size: 112 bytes</div>
          <div>            28 values</div>
          <div>Number of Dimensions: 1</div>
          <div>Dimensions and sizes:   [level | 28]</div>
          <div>Coordinates:</div>
          <div>            level: [70..1000]</div>
          <div>Number Of Attributes: 2</div>
          <div>  units :       Pa</div>
          <div>  long_name :   pressure_level</div>
          <div>(0)     7000</div>
          <div>(1)     10000</div>
          <div>(2)     12500</div>
          <div>(3)     15000</div>
          <div>..........</div>
          <div>(26)    97500</div>
          <div>(27)    100000</div>
          <div><br>
          </div>
          <div>Variable: <font color="#ff0000">ZMT</font></div>
          <div>Type: float</div>
          <div>Total Size: 2213568 bytes</div>
          <div>            553392 values</div>
          <div>Number of Dimensions: 4</div>
          <div>Dimensions and sizes:   [time | 4] x [level | 28] x
            [latitude | 61] x [longitude | 81]</div>
          <div>Coordinates:</div>
          <div>            time: [1025088..1025160]</div>
          <div>            level: [70..1000]</div>
          <div>            latitude: [ 5..20]</div>
          <div>            longitude: [70..90]</div>
          <div>Number Of Attributes: 3</div>
          <div>  units :       (m/s)(kg/kg)</div>
          <div>  long_name :   zonal moisture transport</div>
          <div>  _FillValue :  -32767</div>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">At
          run-time, I am getting the following error message;</div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">
          <div>fatal:Could not create (<a href="http://example.nc/"
              style="text-decoration-line:none;color:rgb(66,133,244)"
              moz-do-not-send="true">example.nc</a>)</div>
          <div>warning:FileSetFileOption: invalid file or format</div>
          <div>fatal:["Execute.c":8640]:Execute: Error occurred at or
            near line 65 in file TEST1.ncl</div>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">My
          script is attached below. </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">Please
          kindly inform me what is wrong with this code and how to fix
          it.</div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
        </div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">Thanking
          you,</div>
        <div style="font-family:sans-serif;font-size:12.8px" dir="auto">Soma</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>