Re: systemfunc: cannot create child process:[errno=12]

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 13 2011 - 09:32:55 MDT

If you do "read var ; echo $var" then the command is going to wait for you to type something in order for the NCL script to continue.

It worked for me when I ran it interactively and from a script, but I had to type someting (I used "hello"):

 % ncl
 Copyright (C) 1995-2011 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.0.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
ncl 0> averegion = systemfunc("read var; echo $var")
hello
ncl 1> print(averegion)

Variable: averegion
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) hello
ncl 2>

There's a better way for you to do this. You can set "averegion" when you run NCL:

    % ncl 'averegion="some_region"' your_script.ncl

This will cause your NCL script to have a string variable called "averegion" which has the string "some_region".

You can set other types as well

   % ncl 'averegion="some_region"' pi=3.14 'x=(/1,2,3,4/)' your_script.ncl

To try this, create a simple 3-line script called "t.ncl" with just 2 lines:

print(x)
print(pi)
print(averegion)

Run this script with:

ncl 'averegion="some_region"' pi=3.14 'x=(/1,2,3,4/)' t.ncl

You should get:

Variable: x
Type: integer
Total Size: 16 bytes
            4 values
Number of Dimensions: 1
Dimensions and sizes: [4]
Coordinates:
(0) 1
(1) 2
(2) 3
(3) 4

Variable: pi
Type: float
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 3.14

Variable: averegion
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) some_region

--Mary

On Jun 11, 2011, at 9:40 AM, gibies george wrote:

> Can anybody tell the reason for this error
>
> fatal:systemfunc: cannot create child process:[errno=12]
> fatal:Execute: Error occurred at or near line 2662 in file /home/gibies/ncl/mylib/lib_gibies_analysis_module.ncl
>
> fatal:Execute: Error occurred at or near line 22 in file /home/gibies/ncl/myscripts/skillanal.ncl
>
>
> The indicated line of the script is
>
> averegion = systemfunc("read var; echo $var")
>
> --
> Gibies George, CSIR-RF,
> Monsoon Seasonal Prediction Group,
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.
>
> http://sites.google.com/site/gibiesge/
>
> Please Think about the environment. Save paper; Save Trees; and don't print this e-mail unless it is necessary.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 13 09:33:05 2011

This archive was generated by hypermail 2.1.8 : Mon Jun 13 2011 - 09:37:43 MDT