Re: ncl-talk Digest, Vol 92, Issue 24

From: Matthew Huber <huberm_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 18 2011 - 12:18:12 MDT

calculations that might benefit from parallelization that we do in my lab:

anything with "where" operating on a 4D grid;
poisson grid fill;
EOF analysis;
lancoz filtering;
uv2vrdvg;
any regridding of large data sets;
do loops of the form that a OMP-like $DO SHARED directive would be happy with, often performing similar operations on a 3D or 2D data set, looping over time. (or for some cases slicing the data in a different direction, but still with loop members being independent).

We run on nodes on a 1000 node (8-way shared memory) linux cluster with 64 GB ram, and also on macbooks/imacs. 8-way shared memory would be a nice reasonable minimum configuration for something that might benefit from parallelism. Note that IO is often the key bottleneck for the large calculations, so if pnetcdf is implemented hopefully that might speed things up, but that's beyond my expertise.

-matthew huber

On Jul 18, 2011, at 2:00 PM, ncl-talk-request@ucar.edu wrote:

> Send ncl-talk mailing list submissions to
> ncl-talk@ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. Re: Parallel NCL (Oliver.Fuhrer@meteoswiss.ch)
> 2. Re: time conversion (shinn wong)
> 3. Re: time conversion (Dennis Shea)
> 4. Re: help: WRAPIT (Mary Haley)
> 5. Re: help: WRAPIT (Sha Feng)
> 6. Re: help: WRAPIT (Dennis Shea)
> 7. Re: help: WRAPIT (Sha Feng)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 18 Jul 2011 06:37:00 +0000
> From: <Oliver.Fuhrer@meteoswiss.ch>
> Subject: Re: Parallel NCL
> To: <ncl-talk@ucar.edu>
> Message-ID:
> <412A326BDEE0D148A6784BE24955DCF101FCAF@zuemsg03.meteoswiss.ch>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear ParVis team,
>
> A lot of our very time intensive scripts are of the form...
>
> read constant data
> do i = 1, nplot
> read data
> process data
> make plot
> end do
>
> ...where the loop is over a number of timesteps or a number of different plots. Accelerating the processing step by parallelization surely will give these scripts a boost. But it usually also doesn't exploit the inherent parallelism that is very often present, namely that the work inside the loop body is independent and could be done in parallel. So having something like...
>
> read constant data
> parallel do i = 1, nplot
> read data
> process data
> make plot / write data
> end parallel do
>
> ...would be a much better way to parallelize. As several people have pointed out, this strategy is already implemented "by hand" by several people who run time critical stuff by splitting the script into several scripts and ncl instances.
>
> I see that this might be very tricky to implement depending on the internal runtime execution model of NCL. Also, one would probably need to specify scoping of variables. For example all variables outside of the loop body are "shared" and all variables inside the loop body (including the loop index) are "private".
>
> Kind regards,
> Oli
>
>> -----Original Message-----
>> From: ncl-talk-bounces@ucar.edu
>> [mailto:ncl-talk-bounces@ucar.edu] On Behalf Of Mary Haley
>> Sent: Dienstag, 12. Juli 2011 23:18
>> To: ncl-talk@ucar.edu forum
>> Subject: Parallel NCL
>>
>> Dear NCL Users,
>>
>> A new joint project (ParVis) between NCAR and DOE labs is
>> working on a parallel version of NCL! We will be
>> implementing parallel versions of NCL built-in functions.
>>
>> To help guide our effort, we'd like to hear which functions
>> you have found either are too slow or take too much memory
>> for the data sets you are applying them to. Please also let
>> us know how big the data is and what kind of machine you're
>> trying to run on (OS, processor, memory size) for those functions.
>>
>> Another goal is to support mathematical operations on native
>> grids so you do not have to convert to lat-lon. Please let
>> us know which functions/capabilities you would like to see
>> supported first on native grids.
>>
>> Finally, please let us know about any new functions you would
>> like to see implemented. What is your "wish list"?
>>
>> Send replies to ncl-talk.
>>
>> For more information, see http://trac.mcs.anl.gov/projects/parvis
>>
>> Regards,
>> ParVis team.
>>
>
>
> ________________________________________
>
> Oliver Fuhrer
> Numerical Models
>
> Federal Departement of Home Affairs FDHA
> Federal Office of Meteorology and Climatology MeteoSwiss
>
> Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland
>
> Tel. +41 44 256 93 59
> Fax +41 44 256 92 78
> oliver.fuhrer@meteoswiss.ch
> www.meteoswiss.ch - First-hand information
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 18 Jul 2011 09:58:17 +0200
> From: shinn wong <shinnshinnwong@gmail.com>
> Subject: Re: time conversion
> To: Dennis Shea <shea@ucar.edu>, ncl-talk@ucar.edu
> Message-ID:
> <CAFvJNsQn6Y+64EVXsibaf087ZwyFFxEn6212MaTK8c+8SSMrTQ@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear all,
> I still cannot figure out what?s wrong with my dataset that will lead to
> missing value after using ut_calendar. The dataset I used is
> mldinfo_varDT.nc downloaded from http://mixedlayer.ucsd.edu/. Could anyone
> help me with that? Thanks in advance for any help and suggestion.
> Shinn
>
> 2011/7/15 Dennis Shea <shea@ucar.edu>
>
>> Prior to using cd_calendar you should use a print
>>
>> print(time)
>>
>> date = ut_calendar(time,0)
>>
>> It is possible that time does not contain some valis values
>>
>>
>>
>> On 07/15/2011 10:33 AM, shinn wong wrote:
>>
>>> Dear Dennis,
>>> Thank you for your help. I am using version 5.5.1. But when I used date
>>> = ut_calendar(time,0), missing value was returned. The dataset is too
>>> large to be sent. I would be much appreciated for any help and suggestion.
>>> Shinn
>>>
>>> 2011/7/11 Dennis Shea <shea@ucar.edu <mailto:shea@ucar.edu>>
>>>
>>>
>>> I don't use Matlab but maybe ...
>>>
>>> time = (/730848.5, 730848.9/)
>>> time@units = "days since Jan-1-0000 00:00:00"
>>>
>>> date = cd_calendar(time,0) ; year,month,day,hour,minute,sec
>>> print(date)
>>>
>>> Due to the way 'cd_calendar' defines the initial day, you may
>>> need to subtract 1 day
>>>
>>> So ...
>>>
>>> time = (/730848.5, 730848.9/) - 1 ; ?? adjust for different start
>>> day
>>> date = cd_calendar(time,0)
>>> print(date)
>>>
>>> =====
>>> The inverse is true also
>>>
>>> t = cd_inv_calendar(2001,5,19,0,0,**__0,units,0) - 1 ; Matlab
>>> datenum
>>> print(t)
>>> ========
>>> cd_calendar is in v6.0.0
>>>
>>> if you have an older version of NCL use
>>>
>>> date = ut_calendar(time,0)
>>>
>>> BUT in ut_calendar year 0 is treated like year 1 ...
>>> so test to get the correct day
>>>
>>> # Year 0 is not treated as year 1, like it is with the ut_calendar
>>> and ut_inv_calendar functions.
>>>
>>> =======
>>>
>>>
>>> http://www.ncl.ucar.edu/__**Document/Functions/Built-in/__**
>>> cd_calendar.shtml<http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_calendar.shtml>
>>> <http://www.ncl.ucar.edu/**Document/Functions/Built-in/**
>>> cd_calendar.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>
>>>>
>>>
>>> http://www.ncl.ucar.edu/__**Document/Functions/Built-in/__**
>>> cd_inv_calendar.shtml<http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_inv_calendar.shtml>
>>> <http://www.ncl.ucar.edu/**Document/Functions/Built-in/**
>>> cd_inv_calendar.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml>
>>>>
>>>
>>> Good luck
>>>
>>>
>>> On 7/10/11 9:55 PM, shinn wong wrote:
>>>
>>> Dear all,
>>> I've got a netcdf file with time in the MATLAB datenum format (eg.
>>> 730848.5, 730848.9, etc). How can I convert it into a
>>> UT-referenced date
>>> using ncl? Thanks in advance for any help and suggestions.
>>> Regards,
>>> Shinn
>>>
>>>
>>>
>>
>> --
>> ==============================**========================
>> Dennis J. Shea tel: 303-497-1361 |
>> P.O. Box 3000 fax: 303-497-1333 |
>> Climate Analysis Section |
>> Climate & Global Dynamics Div. |
>> National Center for Atmospheric Research |
>> Boulder, CO 80307 |
>> USA email: shea 'at' ucar.edu |
>> ==============================**========================
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110718/7a23b716/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Mon, 18 Jul 2011 07:46:59 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: time conversion
> To: shinn wong <shinnshinnwong@gmail.com>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4E243953.5010004@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I speculate that the ut_calendar function printed a message
> saying that it encountered an invalid input string and that
> all values were being set to missing)_FillValue).
>
> ut_calendar (5.2.1) expects dates that are udunits-2 conformant.
> The documentation notes:
>
> =====
> Must have a units attribute in one of the formats
> recognized by the UDUNITS-2 library
>
> Caveats of UDUNITS-2:
>
> Year 0 is treated as year 1, because year 0 does not exist
> in the real world calendar.
>
> Udunits doesn't like uppercase values in the "units" string.
> For example, "HOURS since 1-1-1 00:00:0.0" is not a valid string,
> but "hours since 1-1-1 00:00:0.0" is.
> ========================================================
>
> The following is *not* udunits conformant:
>
> units : Days since Jan-1-0000 (MATLAB datenum format)
> =========================================================
> Try:
>
> f = addfile("mldinfo_consDT.nc", "r")
> date = f->date(:,0) ; (579611)
>
> date = date - 1 ; ??? Matlab vs udunits convention
>
> date@units = "days since 1-1-1 00:00:0.0" ; udunits conformant
> or
> date@units = "days since 0000-1-1 00:00:0.0"
>
> ymdhms = ut_calendar(date,0)
> print(ymdhms)
>
>
> On 7/18/11 1:58 AM, shinn wong wrote:
>> Dear all,
>> I still cannot figure out what?s wrong with my dataset that will lead to
>> missing value after using ut_calendar. The dataset I used is
>> mldinfo_varDT.nc downloaded from http://mixedlayer.ucsd.edu/. Could
>> anyone help me with that? Thanks in advance for any help and suggestion.
>> Shinn
>>
>> 2011/7/15 Dennis Shea <shea@ucar.edu <mailto:shea@ucar.edu>>
>>
>> Prior to using cd_calendar you should use a print
>>
>> print(time)
>>
>> date = ut_calendar(time,0)
>>
>> It is possible that time does not contain some valis values
>>
>>
>>
>> On 07/15/2011 10:33 AM, shinn wong wrote:
>>
>> Dear Dennis,
>> Thank you for your help. I am using version 5.5.1. But when I
>> used date
>> = ut_calendar(time,0), missing value was returned. The dataset
>> is too
>> large to be sent. I would be much appreciated for any help and
>> suggestion.
>> Shinn
>>
>> 2011/7/11 Dennis Shea <shea@ucar.edu <mailto:shea@ucar.edu>
>> <mailto:shea@ucar.edu <mailto:shea@ucar.edu>>>
>>
>>
>> I don't use Matlab but maybe ...
>>
>> time = (/730848.5, 730848.9/)
>> time@units = "days since Jan-1-0000 00:00:00"
>>
>> date = cd_calendar(time,0) ; year,month,day,hour,minute,sec
>> print(date)
>>
>> Due to the way 'cd_calendar' defines the initial day, you may
>> need to subtract 1 day
>>
>> So ...
>>
>> time = (/730848.5, 730848.9/) - 1 ; ?? adjust for
>> different start day
>> date = cd_calendar(time,0)
>> print(date)
>>
>> =====
>> The inverse is true also
>>
>> t = cd_inv_calendar(2001,5,19,0,0,____0,units,0) - 1 ;
>> Matlab datenum
>> print(t)
>> ========
>> cd_calendar is in v6.0.0
>>
>> if you have an older version of NCL use
>>
>> date = ut_calendar(time,0)
>>
>> BUT in ut_calendar year 0 is treated like year 1 ...
>> so test to get the correct day
>>
>> # Year 0 is not treated as year 1, like it is with the
>> ut_calendar
>> and ut_inv_calendar functions.
>>
>> =======
>>
>>
>> http://www.ncl.ucar.edu/____Document/Functions/Built-in/____cd_calendar.shtml
>> <http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_calendar.shtml>
>> <http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_calendar.shtml
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml>>
>>
>> http://www.ncl.ucar.edu/____Document/Functions/Built-in/____cd_inv_calendar.shtml
>> <http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_inv_calendar.shtml>
>> <http://www.ncl.ucar.edu/__Document/Functions/Built-in/__cd_inv_calendar.shtml
>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml>>
>>
>> Good luck
>>
>>
>> On 7/10/11 9:55 PM, shinn wong wrote:
>>
>> Dear all,
>> I've got a netcdf file with time in the MATLAB datenum
>> format (eg.
>> 730848.5, 730848.9, etc). How can I convert it into a
>> UT-referenced date
>> using ncl? Thanks in advance for any help and suggestions.
>> Regards,
>> Shinn
>>
>>
>>
>>
>> --
>> ==============================__========================
>> Dennis J. Shea tel: 303-497-1361 |
>> P.O. Box 3000 fax: 303-497-1333 |
>> Climate Analysis Section |
>> Climate & Global Dynamics Div. |
>> National Center for Atmospheric Research |
>> Boulder, CO 80307 |
>> USA email: shea 'at' ucar.edu <http://ucar.edu> |
>> ==============================__========================
>>
>>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 18 Jul 2011 08:38:03 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: help: WRAPIT
> To: Sha Feng <sfeng@marine.usf.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <8C5DC2EF-E29C-4129-AD60-07474B0B39D9@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Sha,
>
> The error:
>
> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>
> is indicating that it can't find "writeNCLascii" in your compiled file.
>
> When I do an "nm" on the *.so file:
>
> nm writeNCLascii.so
>
> I see this:
>
> 0000000000000000 T _writenclascii_
>
> Note that the "ncl" is lower case. This lead me to believe this was a case-insensitivity issue.
>
> So, instead of this:
>
> writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>
> Try:
>
> writeNCLascii::writenclascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>
>
> --Mary
>
> On Jul 15, 2011, at 2:03 PM, Sha Feng wrote:
>
>> Mary,
>>
>> This column problem had been fixed before I asked you about the syntax error. I also can created the wrapper without any problem. Now, the problem is in the NCL script, I think. So I attached the ncl script here, could you help me to fix it please?
>>
>> $ ncl test.ncl
>>
>> Copyright (C) 1995-2010 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 5.2.1
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>
>> fatal:error at line 145 in file test.ncl
>>
>> fatal:Syntax Error in block, block not executed
>> fatal:error at line 186 in file test.ncl
>> -----------------
>>
>> The code is a sort of long. Sorry for troubling you so much and Very appreciated your help,
>>
>> Sha
>>
>>
>>
>> <test.ncl>
>>
>>
>> On Jul 15, 2011, at 3:50 PM, Mary Haley wrote:
>>
>>> Sha,
>>>
>>> As Dennis mentioned before, you need to make sure that in your *stub file, the "subroutine", "integer", "dimension" lines all start in the 7th column. In the file you listed below, the lines all start in the 6th column.
>>>
>>> Once I made this fix, I was able to create the wrapper with no problem:
>>>
>>> % [389] cat writeNCLascii.stub
>>> C NCLFORTSTART
>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>> integer dim1, dim2
>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>> C NCLEND
>>>
>>> % [390] WRAPIT -m64 writeNCLascii.stub writeNCLascii.f90
>>>
>>> WRAPIT Version: 110125
>>> COMPILING writeNCLascii.f90
>>> LINKING
>>> END WRAPIT
>>>
>>> % [391] ncl
>>> Copyright (C) 1995-2011 - All Rights Reserved
>>> University Corporation for Atmospheric Research
>>> NCAR Command Language Version 6.1.0-15Jul2011_0149
>>> The use of this software is governed by a License Agreement.
>>> See http://www.ncl.ucar.edu/ for more details.
>>> ncl 0> external writeNCLascii "./writeNCLascii.so"
>>> ncl 1>
>>>
>>> --Mary
>>>
>>>
>>> On Jul 15, 2011, at 1:23 PM, Sha Feng wrote:
>>>
>>>> Mary,
>>>>
>>>> There are just several lines in my stub file
>>>>
>>>> C NCLFORTSTART
>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>> integer dim1, dim2
>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>> C NCLEND
>>>>
>>>> and I copied the word "writeNCLascii". It still did not work.
>>>>
>>>> Sha
>>>>
>>>> On Jul 15, 2011, at 3:17 PM, Mary Haley wrote:
>>>>
>>>>> Sha,
>>>>>
>>>>> Double-check your *.stub file to make sure you have "writeNCLascii" spelled correctly.
>>>>>
>>>>> It looks okay in the *.f90 file, but the stub file needs to have it spelled the exact same way.
>>>>>
>>>>> --Mary
>>>>>
>>>>> On Jul 15, 2011, at 12:21 PM, Sha Feng wrote:
>>>>>
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I tried to call a Fortran subroutine from NCL using WRAPIT. The pre-files are created:
>>>>>>
>>>>>> writeNCLascii.stub
>>>>>> writeNCLascii.so
>>>>>> writeNCLascii.f90
>>>>>>
>>>>>> $ ncl test.ncl
>>>>>>
>>>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>>>
>>>>>> fatal:error at line 145 in file test.ncl
>>>>>>
>>>>>> fatal:Syntax Error in block, block not executed
>>>>>> fatal:error at line 186 in file test.ncl
>>>>>>
>>>>>> ----------
>>>>>> In test.ncl script, I added external writeNCLascii "./writeNCLascii.so" before "begin".
>>>>>>
>>>>>> line 145: writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), 45, 45)
>>>>>> line 186: end
>>>>>> --------------
>>>>>>
>>>>>> Attached please find the fortran 90 subroutine.
>>>>>>
>>>>>> Any help is appreciated,
>>>>>>
>>>>>> Sha
>>>>>>
>>>>>>
>>>>>>
>>>>>> <writeNCLascii.f90>_______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 18 Jul 2011 10:56:31 -0400
> From: Sha Feng <sfeng@marine.usf.edu>
> Subject: Re: help: WRAPIT
> To: ncl-talk@ucar.edu
> Cc: Mary Haley <haley@ucar.edu>
> Message-ID: <877B200D-B117-4722-94A6-C1B1A6EFDAE7@marine.usf.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Mary,
>
> Syntax error is fixed, but new issue has been exposed.
>
> fatal:Argument type mismatch on argument (1) of (writenclascii) can not coerce
> fatal:Execute: Error occurred at or near line 145 in file test.ncl
>
> I checked the arguments, both are floats in the fortran subroutine and the ncl script. Details are shown below.
>
> NCL:
>
> writeNCLascii::writenclascii(CPTh_mon_ts(0,:), LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), dims, dims)
>
> Variable: dims
> Type: integer
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
>
> Variable: CPTh_mon_ts (subsection)
> Type: float
> Total Size: 180 bytes
> 45 values
> Number of Dimensions: 1
> Dimensions and sizes: [45]
> Coordinates:
> Number Of Attributes: 2
> _FillValue : -999
> runave_op_ncl : runave_n: nave=3
>
>
> Variable: LRTh_mon_ts (subsection)
> Type: float
> Total Size: 180 bytes
> 45 values
> Number of Dimensions: 1
> Dimensions and sizes: [45]
> Coordinates:
> Number Of Attributes: 2
> _FillValue : -999
> runave_op_ncl : runave_n: nave=3
> ----------------------
>
> writeNCLascii.f90:
>
> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
> implicit none
> integer, intent(in) :: dim1, dim2
> real, intent(in) :: cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
> integer :: i, dim
>
>
> Sha
>
>
>
> On Jul 18, 2011, at 10:38 AM, Mary Haley wrote:
>
>> Sha,
>>
>> The error:
>>
>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>
>> is indicating that it can't find "writeNCLascii" in your compiled file.
>>
>> When I do an "nm" on the *.so file:
>>
>> nm writeNCLascii.so
>>
>> I see this:
>>
>> 0000000000000000 T _writenclascii_
>>
>> Note that the "ncl" is lower case. This lead me to believe this was a case-insensitivity issue.
>>
>> So, instead of this:
>>
>> writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>
>> Try:
>>
>> writeNCLascii::writenclascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>
>>
>> --Mary
>>
>> On Jul 15, 2011, at 2:03 PM, Sha Feng wrote:
>>
>>> Mary,
>>>
>>> This column problem had been fixed before I asked you about the syntax error. I also can created the wrapper without any problem. Now, the problem is in the NCL script, I think. So I attached the ncl script here, could you help me to fix it please?
>>>
>>> $ ncl test.ncl
>>>
>>> Copyright (C) 1995-2010 - All Rights Reserved
>>> University Corporation for Atmospheric Research
>>> NCAR Command Language Version 5.2.1
>>> The use of this software is governed by a License Agreement.
>>> See http://www.ncl.ucar.edu/ for more details.
>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>
>>> fatal:error at line 145 in file test.ncl
>>>
>>> fatal:Syntax Error in block, block not executed
>>> fatal:error at line 186 in file test.ncl
>>> -----------------
>>>
>>> The code is a sort of long. Sorry for troubling you so much and Very appreciated your help,
>>>
>>> Sha
>>>
>>>
>>>
>>> <test.ncl>
>>>
>>>
>>> On Jul 15, 2011, at 3:50 PM, Mary Haley wrote:
>>>
>>>> Sha,
>>>>
>>>> As Dennis mentioned before, you need to make sure that in your *stub file, the "subroutine", "integer", "dimension" lines all start in the 7th column. In the file you listed below, the lines all start in the 6th column.
>>>>
>>>> Once I made this fix, I was able to create the wrapper with no problem:
>>>>
>>>> % [389] cat writeNCLascii.stub
>>>> C NCLFORTSTART
>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>> integer dim1, dim2
>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>> C NCLEND
>>>>
>>>> % [390] WRAPIT -m64 writeNCLascii.stub writeNCLascii.f90
>>>>
>>>> WRAPIT Version: 110125
>>>> COMPILING writeNCLascii.f90
>>>> LINKING
>>>> END WRAPIT
>>>>
>>>> % [391] ncl
>>>> Copyright (C) 1995-2011 - All Rights Reserved
>>>> University Corporation for Atmospheric Research
>>>> NCAR Command Language Version 6.1.0-15Jul2011_0149
>>>> The use of this software is governed by a License Agreement.
>>>> See http://www.ncl.ucar.edu/ for more details.
>>>> ncl 0> external writeNCLascii "./writeNCLascii.so"
>>>> ncl 1>
>>>>
>>>> --Mary
>>>>
>>>>
>>>> On Jul 15, 2011, at 1:23 PM, Sha Feng wrote:
>>>>
>>>>> Mary,
>>>>>
>>>>> There are just several lines in my stub file
>>>>>
>>>>> C NCLFORTSTART
>>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>>> integer dim1, dim2
>>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>>> C NCLEND
>>>>>
>>>>> and I copied the word "writeNCLascii". It still did not work.
>>>>>
>>>>> Sha
>>>>>
>>>>> On Jul 15, 2011, at 3:17 PM, Mary Haley wrote:
>>>>>
>>>>>> Sha,
>>>>>>
>>>>>> Double-check your *.stub file to make sure you have "writeNCLascii" spelled correctly.
>>>>>>
>>>>>> It looks okay in the *.f90 file, but the stub file needs to have it spelled the exact same way.
>>>>>>
>>>>>> --Mary
>>>>>>
>>>>>> On Jul 15, 2011, at 12:21 PM, Sha Feng wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I tried to call a Fortran subroutine from NCL using WRAPIT. The pre-files are created:
>>>>>>>
>>>>>>> writeNCLascii.stub
>>>>>>> writeNCLascii.so
>>>>>>> writeNCLascii.f90
>>>>>>>
>>>>>>> $ ncl test.ncl
>>>>>>>
>>>>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>>>>
>>>>>>> fatal:error at line 145 in file test.ncl
>>>>>>>
>>>>>>> fatal:Syntax Error in block, block not executed
>>>>>>> fatal:error at line 186 in file test.ncl
>>>>>>>
>>>>>>> ----------
>>>>>>> In test.ncl script, I added external writeNCLascii "./writeNCLascii.so" before "begin".
>>>>>>>
>>>>>>> line 145: writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), 45, 45)
>>>>>>> line 186: end
>>>>>>> --------------
>>>>>>>
>>>>>>> Attached please find the fortran 90 subroutine.
>>>>>>>
>>>>>>> Any help is appreciated,
>>>>>>>
>>>>>>> Sha
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> <writeNCLascii.f90>_______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 18 Jul 2011 09:07:24 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: help: WRAPIT
> To: Sha Feng <sfeng@marine.usf.edu>
> Cc: ncl-talk@ucar.edu, Mary Haley <haley@ucar.edu>
> Message-ID: <4E244C2C.3010906@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> In your f90 code you use 'implicit none' and you explicitly specify
> the type:
>
>> implicit none
>> integer, intent(in) :: dim1, dim2
>> real, intent(in) :: cptz1(dim1), lrtz1(dim1), cptz2(dim2),
> lrtz2(dim2)
>> integer :: i, dim
>
> However in your stub file, you do not do this
>
> % [389] cat writeNCLascii.stub
>> C NCLFORTSTART
>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>> integer dim1, dim2
>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>> C NCLEND
>
> As noted in the documentation, NCL's f77 parser understands fortran
> default typing. Hence, variables starting with i,j,k,l,m,n are type
> integer by default. When you pass a type float to a type integer,
> NCL explicitly acknowledges that it will not coerce a flot to an integer.
>
> Change your stub to
>
> C NCLFORTSTART
> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
> implicit none
> integer dim1, dim2
> real cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
> C NCLEND
>
>
>
>
> On 7/18/11 8:56 AM, Sha Feng wrote:
>> Mary,
>>
>> Syntax error is fixed, but new issue has been exposed.
>>
>> fatal:Argument type mismatch on argument (1) of (writenclascii) can not coerce
>> fatal:Execute: Error occurred at or near line 145 in file test.ncl
>>
>> I checked the arguments, both are floats in the fortran subroutine and the ncl script. Details are shown below.
>>
>> NCL:
>>
>> writeNCLascii::writenclascii(CPTh_mon_ts(0,:), LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), dims, dims)
>>
>> Variable: dims
>> Type: integer
>> Total Size: 4 bytes
>> 1 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [1]
>>
>> Variable: CPTh_mon_ts (subsection)
>> Type: float
>> Total Size: 180 bytes
>> 45 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [45]
>> Coordinates:
>> Number Of Attributes: 2
>> _FillValue : -999
>> runave_op_ncl : runave_n: nave=3
>>
>>
>> Variable: LRTh_mon_ts (subsection)
>> Type: float
>> Total Size: 180 bytes
>> 45 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [45]
>> Coordinates:
>> Number Of Attributes: 2
>> _FillValue : -999
>> runave_op_ncl : runave_n: nave=3
>> ----------------------
>>
>> writeNCLascii.f90:
>>
>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>> implicit none
>> integer, intent(in) :: dim1, dim2
>> real, intent(in) :: cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>> integer :: i, dim
>>
>>
>> Sha
>>
>>
>>
>> On Jul 18, 2011, at 10:38 AM, Mary Haley wrote:
>>
>>> Sha,
>>>
>>> The error:
>>>
>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>
>>> is indicating that it can't find "writeNCLascii" in your compiled file.
>>>
>>> When I do an "nm" on the *.so file:
>>>
>>> nm writeNCLascii.so
>>>
>>> I see this:
>>>
>>> 0000000000000000 T _writenclascii_
>>>
>>> Note that the "ncl" is lower case. This lead me to believe this was a case-insensitivity issue.
>>>
>>> So, instead of this:
>>>
>>> writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>>
>>> Try:
>>>
>>> writeNCLascii::writenclascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>>
>>>
>>> --Mary
>>>
>>> On Jul 15, 2011, at 2:03 PM, Sha Feng wrote:
>>>
>>>> Mary,
>>>>
>>>> This column problem had been fixed before I asked you about the syntax error. I also can created the wrapper without any problem. Now, the problem is in the NCL script, I think. So I attached the ncl script here, could you help me to fix it please?
>>>>
>>>> $ ncl test.ncl
>>>>
>>>> Copyright (C) 1995-2010 - All Rights Reserved
>>>> University Corporation for Atmospheric Research
>>>> NCAR Command Language Version 5.2.1
>>>> The use of this software is governed by a License Agreement.
>>>> See http://www.ncl.ucar.edu/ for more details.
>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>
>>>> fatal:error at line 145 in file test.ncl
>>>>
>>>> fatal:Syntax Error in block, block not executed
>>>> fatal:error at line 186 in file test.ncl
>>>> -----------------
>>>>
>>>> The code is a sort of long. Sorry for troubling you so much and Very appreciated your help,
>>>>
>>>> Sha
>>>>
>>>>
>>>>
>>>> <test.ncl>
>>>>
>>>>
>>>> On Jul 15, 2011, at 3:50 PM, Mary Haley wrote:
>>>>
>>>>> Sha,
>>>>>
>>>>> As Dennis mentioned before, you need to make sure that in your *stub file, the "subroutine", "integer", "dimension" lines all start in the 7th column. In the file you listed below, the lines all start in the 6th column.
>>>>>
>>>>> Once I made this fix, I was able to create the wrapper with no problem:
>>>>>
>>>>> % [389] cat writeNCLascii.stub
>>>>> C NCLFORTSTART
>>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>>> integer dim1, dim2
>>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>>> C NCLEND
>>>>>
>>>>> % [390] WRAPIT -m64 writeNCLascii.stub writeNCLascii.f90
>>>>>
>>>>> WRAPIT Version: 110125
>>>>> COMPILING writeNCLascii.f90
>>>>> LINKING
>>>>> END WRAPIT
>>>>>
>>>>> % [391] ncl
>>>>> Copyright (C) 1995-2011 - All Rights Reserved
>>>>> University Corporation for Atmospheric Research
>>>>> NCAR Command Language Version 6.1.0-15Jul2011_0149
>>>>> The use of this software is governed by a License Agreement.
>>>>> See http://www.ncl.ucar.edu/ for more details.
>>>>> ncl 0> external writeNCLascii "./writeNCLascii.so"
>>>>> ncl 1>
>>>>>
>>>>> --Mary
>>>>>
>>>>>
>>>>> On Jul 15, 2011, at 1:23 PM, Sha Feng wrote:
>>>>>
>>>>>> Mary,
>>>>>>
>>>>>> There are just several lines in my stub file
>>>>>>
>>>>>> C NCLFORTSTART
>>>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>>>> integer dim1, dim2
>>>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>>>> C NCLEND
>>>>>>
>>>>>> and I copied the word "writeNCLascii". It still did not work.
>>>>>>
>>>>>> Sha
>>>>>>
>>>>>> On Jul 15, 2011, at 3:17 PM, Mary Haley wrote:
>>>>>>
>>>>>>> Sha,
>>>>>>>
>>>>>>> Double-check your *.stub file to make sure you have "writeNCLascii" spelled correctly.
>>>>>>>
>>>>>>> It looks okay in the *.f90 file, but the stub file needs to have it spelled the exact same way.
>>>>>>>
>>>>>>> --Mary
>>>>>>>
>>>>>>> On Jul 15, 2011, at 12:21 PM, Sha Feng wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I tried to call a Fortran subroutine from NCL using WRAPIT. The pre-files are created:
>>>>>>>>
>>>>>>>> writeNCLascii.stub
>>>>>>>> writeNCLascii.so
>>>>>>>> writeNCLascii.f90
>>>>>>>>
>>>>>>>> $ ncl test.ncl
>>>>>>>>
>>>>>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>>>>>
>>>>>>>> fatal:error at line 145 in file test.ncl
>>>>>>>>
>>>>>>>> fatal:Syntax Error in block, block not executed
>>>>>>>> fatal:error at line 186 in file test.ncl
>>>>>>>>
>>>>>>>> ----------
>>>>>>>> In test.ncl script, I added external writeNCLascii "./writeNCLascii.so" before "begin".
>>>>>>>>
>>>>>>>> line 145: writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), 45, 45)
>>>>>>>> line 186: end
>>>>>>>> --------------
>>>>>>>>
>>>>>>>> Attached please find the fortran 90 subroutine.
>>>>>>>>
>>>>>>>> Any help is appreciated,
>>>>>>>>
>>>>>>>> Sha
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> <writeNCLascii.f90>_______________________________________________
>>>>>>>> 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
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 18 Jul 2011 11:29:07 -0400
> From: Sha Feng <sfeng@marine.usf.edu>
> Subject: Re: help: WRAPIT
> To: ncl-talk@ucar.edu
> Cc: Mary Haley <haley@ucar.edu>
> Message-ID: <AEBED2F7-331D-4DDF-831B-D52AB5E5CF1B@marine.usf.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Dennis and Mary,
>
> All issues are fixed. Very appreciated your help and thank you both.
>
> Regards,
>
> Sha
>
> On Jul 18, 2011, at 11:07 AM, Dennis Shea wrote:
>
>> In your f90 code you use 'implicit none' and you explicitly specify
>> the type:
>>
>>> implicit none
>>> integer, intent(in) :: dim1, dim2
>>> real, intent(in) :: cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>> integer :: i, dim
>>
>> However in your stub file, you do not do this
>>
>> % [389] cat writeNCLascii.stub
>>> C NCLFORTSTART
>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>> integer dim1, dim2
>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>> C NCLEND
>>
>> As noted in the documentation, NCL's f77 parser understands fortran
>> default typing. Hence, variables starting with i,j,k,l,m,n are type
>> integer by default. When you pass a type float to a type integer,
>> NCL explicitly acknowledges that it will not coerce a flot to an integer.
>>
>> Change your stub to
>>
>> C NCLFORTSTART
>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>> implicit none
>> integer dim1, dim2
>> real cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>> C NCLEND
>>
>>
>>
>>
>> On 7/18/11 8:56 AM, Sha Feng wrote:
>>> Mary,
>>>
>>> Syntax error is fixed, but new issue has been exposed.
>>>
>>> fatal:Argument type mismatch on argument (1) of (writenclascii) can not coerce
>>> fatal:Execute: Error occurred at or near line 145 in file test.ncl
>>>
>>> I checked the arguments, both are floats in the fortran subroutine and the ncl script. Details are shown below.
>>>
>>> NCL:
>>>
>>> writeNCLascii::writenclascii(CPTh_mon_ts(0,:), LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), dims, dims)
>>>
>>> Variable: dims
>>> Type: integer
>>> Total Size: 4 bytes
>>> 1 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [1]
>>>
>>> Variable: CPTh_mon_ts (subsection)
>>> Type: float
>>> Total Size: 180 bytes
>>> 45 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [45]
>>> Coordinates:
>>> Number Of Attributes: 2
>>> _FillValue : -999
>>> runave_op_ncl : runave_n: nave=3
>>>
>>>
>>> Variable: LRTh_mon_ts (subsection)
>>> Type: float
>>> Total Size: 180 bytes
>>> 45 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [45]
>>> Coordinates:
>>> Number Of Attributes: 2
>>> _FillValue : -999
>>> runave_op_ncl : runave_n: nave=3
>>> ----------------------
>>>
>>> writeNCLascii.f90:
>>>
>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>> implicit none
>>> integer, intent(in) :: dim1, dim2
>>> real, intent(in) :: cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>> integer :: i, dim
>>>
>>>
>>> Sha
>>>
>>>
>>>
>>> On Jul 18, 2011, at 10:38 AM, Mary Haley wrote:
>>>
>>>> Sha,
>>>>
>>>> The error:
>>>>
>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>
>>>> is indicating that it can't find "writeNCLascii" in your compiled file.
>>>>
>>>> When I do an "nm" on the *.so file:
>>>>
>>>> nm writeNCLascii.so
>>>>
>>>> I see this:
>>>>
>>>> 0000000000000000 T _writenclascii_
>>>>
>>>> Note that the "ncl" is lower case. This lead me to believe this was a case-insensitivity issue.
>>>>
>>>> So, instead of this:
>>>>
>>>> writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>>>
>>>> Try:
>>>>
>>>> writeNCLascii::writenclascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(\
>>>>
>>>>
>>>> --Mary
>>>>
>>>> On Jul 15, 2011, at 2:03 PM, Sha Feng wrote:
>>>>
>>>>> Mary,
>>>>>
>>>>> This column problem had been fixed before I asked you about the syntax error. I also can created the wrapper without any problem. Now, the problem is in the NCL script, I think. So I attached the ncl script here, could you help me to fix it please?
>>>>>
>>>>> $ ncl test.ncl
>>>>>
>>>>> Copyright (C) 1995-2010 - All Rights Reserved
>>>>> University Corporation for Atmospheric Research
>>>>> NCAR Command Language Version 5.2.1
>>>>> The use of this software is governed by a License Agreement.
>>>>> See http://www.ncl.ucar.edu/ for more details.
>>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>>
>>>>> fatal:error at line 145 in file test.ncl
>>>>>
>>>>> fatal:Syntax Error in block, block not executed
>>>>> fatal:error at line 186 in file test.ncl
>>>>> -----------------
>>>>>
>>>>> The code is a sort of long. Sorry for troubling you so much and Very appreciated your help,
>>>>>
>>>>> Sha
>>>>>
>>>>>
>>>>>
>>>>> <test.ncl>
>>>>>
>>>>>
>>>>> On Jul 15, 2011, at 3:50 PM, Mary Haley wrote:
>>>>>
>>>>>> Sha,
>>>>>>
>>>>>> As Dennis mentioned before, you need to make sure that in your *stub file, the "subroutine", "integer", "dimension" lines all start in the 7th column. In the file you listed below, the lines all start in the 6th column.
>>>>>>
>>>>>> Once I made this fix, I was able to create the wrapper with no problem:
>>>>>>
>>>>>> % [389] cat writeNCLascii.stub
>>>>>> C NCLFORTSTART
>>>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>>>> integer dim1, dim2
>>>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>>>> C NCLEND
>>>>>>
>>>>>> % [390] WRAPIT -m64 writeNCLascii.stub writeNCLascii.f90
>>>>>>
>>>>>> WRAPIT Version: 110125
>>>>>> COMPILING writeNCLascii.f90
>>>>>> LINKING
>>>>>> END WRAPIT
>>>>>>
>>>>>> % [391] ncl
>>>>>> Copyright (C) 1995-2011 - All Rights Reserved
>>>>>> University Corporation for Atmospheric Research
>>>>>> NCAR Command Language Version 6.1.0-15Jul2011_0149
>>>>>> The use of this software is governed by a License Agreement.
>>>>>> See http://www.ncl.ucar.edu/ for more details.
>>>>>> ncl 0> external writeNCLascii "./writeNCLascii.so"
>>>>>> ncl 1>
>>>>>>
>>>>>> --Mary
>>>>>>
>>>>>>
>>>>>> On Jul 15, 2011, at 1:23 PM, Sha Feng wrote:
>>>>>>
>>>>>>> Mary,
>>>>>>>
>>>>>>> There are just several lines in my stub file
>>>>>>>
>>>>>>> C NCLFORTSTART
>>>>>>> subroutine writeNCLascii(cptz1, lrtz1, cptz2, lrtz2, dim1, dim2)
>>>>>>> integer dim1, dim2
>>>>>>> dimension cptz1(dim1), lrtz1(dim1), cptz2(dim2), lrtz2(dim2)
>>>>>>> C NCLEND
>>>>>>>
>>>>>>> and I copied the word "writeNCLascii". It still did not work.
>>>>>>>
>>>>>>> Sha
>>>>>>>
>>>>>>> On Jul 15, 2011, at 3:17 PM, Mary Haley wrote:
>>>>>>>
>>>>>>>> Sha,
>>>>>>>>
>>>>>>>> Double-check your *.stub file to make sure you have "writeNCLascii" spelled correctly.
>>>>>>>>
>>>>>>>> It looks okay in the *.f90 file, but the stub file needs to have it spelled the exact same way.
>>>>>>>>
>>>>>>>> --Mary
>>>>>>>>
>>>>>>>> On Jul 15, 2011, at 12:21 PM, Sha Feng wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I tried to call a Fortran subroutine from NCL using WRAPIT. The pre-files are created:
>>>>>>>>>
>>>>>>>>> writeNCLascii.stub
>>>>>>>>> writeNCLascii.so
>>>>>>>>> writeNCLascii.f90
>>>>>>>>>
>>>>>>>>> $ ncl test.ncl
>>>>>>>>>
>>>>>>>>> fatal:syntax error: procedure writeNCLascii is not defined in package writeNCLascii
>>>>>>>>>
>>>>>>>>> fatal:error at line 145 in file test.ncl
>>>>>>>>>
>>>>>>>>> fatal:Syntax Error in block, block not executed
>>>>>>>>> fatal:error at line 186 in file test.ncl
>>>>>>>>>
>>>>>>>>> ----------
>>>>>>>>> In test.ncl script, I added external writeNCLascii "./writeNCLascii.so" before "begin".
>>>>>>>>>
>>>>>>>>> line 145: writeNCLascii::writeNCLascii(CPTh_mon_ts(0,:),LRTh_mon_ts(0,:), CPTh_mon_ts(1,:), LRTh_mon_ts(1,:), 45, 45)
>>>>>>>>> line 186: end
>>>>>>>>> --------------
>>>>>>>>>
>>>>>>>>> Attached please find the fortran 90 subroutine.
>>>>>>>>>
>>>>>>>>> Any help is appreciated,
>>>>>>>>>
>>>>>>>>> Sha
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <writeNCLascii.f90>_______________________________________________
>>>>>>>>> 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
>
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 92, Issue 24
> ****************************************

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 18 12:18:26 2011

This archive was generated by hypermail 2.1.8 : Fri Jul 29 2011 - 08:44:18 MDT