[ncl-talk] NCL with systemfunc

时光足迹 1072752133 at qq.com
Sun Jan 17 20:22:33 MST 2021


Hi, 

  I have trouble writing formatted string using NCL. 



  As I typed: system("printf "+dq+"%-40s"+dq+" "+ dq+"DENVER/STAPLETON INT., CO. / U.S.A."+dq), output showed DENVER/STAPLETON INT., CO. / U.S.A. ;


  I wanted to store the output to a variable, so I changed the command to: print(systemfunc("printf "+dq+"%-40s"+dq+" "+ dq+"DENVER/STAPLETON INT., CO. / U.S.A."+dq)), however, I got missing. 



  What the matter with 'systemfunc' here?  



 ---------------------------------------------------------------------


  Here are Fortran codes to write formatted string: 

 
       WRITE(fout, '(2f20.5,A40)') longi, lati, STRING1


  I tried write_table to write, but spaces will be automaticlly inserted between different kind of varibles.


  Is there any efficient way to write formatted string the same as Fortran? 


  Thanks,


  HUANG

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210118/756141c4/attachment.html>


More information about the ncl-talk mailing list