Re: error in passing a string

From: Mingxuan Chen <chen_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 22 2010 - 12:30:52 MDT

Hi Mary,
    Now it works. Using string is much better than using character array.
     Thank you very much for your help!
Mingxuan

On Sep 21, 2010, at 1:30 PM, Mary Haley wrote:

> If you explicitly define the length of the character array with something like "character*16" then you need to pass a character array to this routine, and not an NCL string.
>
> Please see:
>
> http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#Example_4
>
> for an example of handling strings with WRAPIT.
>
> --Mary
>
> On Sep 21, 2010, at 12:00 PM, Mingxuan Chen wrote:
>
>>
>> Hello,
>> I use WRAPIT calling a fortran subroutine.
>> In the code I will pass a file name,
>> ------------------------------------------------
>> subroutine prt_snd(z,......,ouf)
>> character(len=16),intent(in) :: outf
>> .......
>> end subroutine prt_snd
>>
>> C NCLFORTSTART
>> subroutine prt_snd(z,.....,outf)
>> ......
>> character*16 outf
>> ........
>> C NCLEND
>> ------------------------------------
>> No error for using WRAPIT to get the .so file.
>>
>> In my ncl code define
>> outf="ARM_0003_snd.dat"
>>
>> When callin subroutine
>> prt_snd90::prt_snd(z,......,outf)
>>
>> I have error
>> fatal:Number of elements of dimension (0) of argument (21) is (1) in function (prt_snd), expected (16) elements
>> Where is wrong?
>> Thanks for your help!
>> Mingxuan
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
Received on Wed Sep 22 12:31:07 2010

This archive was generated by hypermail 2.1.8 : Mon Oct 04 2010 - 08:55:55 MDT