Dear Gibies
Have you tried the function ³iscoord²?
http://ncl.ucar.edu/Document/Functions/Built-in/iscoord.shtml
I think it should do what you want.
Good luck
Andrea
-- Andrea N. Hahmann Senior Scientist Wind Energy Division Risų DTU Technical University of Denmark Risų National Laboratory for Sustainable Energy Frederikborgvej 399, P.O. Box 49 4000 Roskilde, Denmark Direct +45 4677 5471 Mobil: +45 2133 0550 ahah@risoe.dtu.dk www.risoe.dtu.dk From: gibies george <gibies@tropmet.res.in> Reply-To: <gibiesgeorge@gmail.com> Date: Mon, 07 Feb 2011 15:20:36 +0530 To: <ncl-talk@ucar.edu> Subject: Check the existence of coordinate variable for a dimension in a variable I would like to know about a way to check the existence of coordinate variable for a dimension in a variable. I tried this way. .............................. ............................. if(.not.isdefined(data&time)) print("Enter the file-variable representing time : ") data&time = file1[:]->$systemfunc("read var; echo $var")$ end if ............................ ......................... My plan is to assign coordinate variable only if it is not already assigned. But it end up with an error message : fatal:No coordinate variable exists for dimension (time) in variable (data) Error is pointed at : if(.not.isdefined(data&time)) The script is working if I remove the conditional statement. How can I do it in a better way ? -- Gibies George, CSIR-RF, 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/ Think about the environment. Save paper; Save Trees. Please 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 Feb 7 03:11:29 2011
This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 16:11:42 MST