Re: problem with "CHARACTER"

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 03 2011 - 16:07:46 MST

Dennis is right, you can't have an array of character strings when you're using WRAPIT. Please see the "Array of character strings" section in the following URL:

http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#SpecialConsiderations

I think his suggestion is a good one.

--Mary

On Mar 3, 2011, at 2:58 PM, Dennis Shea wrote:

> Not that I am aware of.
> Like I said it is a C<==>fortran issue.
>
> I do not see any
> C NCLFORTSTART
> C NCLEND
>
> Maybe you can create a fortran subroutine that call
> the routine beloe
>
> C NCLFORTSTART
> subroutine xregtest(NSITES,LEN,.....)
> ...
> C NCLEND
> character NAMES*12 NAMES(NSITES)
>
> NAMES(1) = "..."
> "
> NAMES(12)= "..."
> CALL REGTST(NSITES,NAMES,LEN,XMOM,A,B,SEED,NSIM,NPROB,PROB,
> * KPRINT,KOUT,RMOM,D,VOBS,VBAR,VSD,H,Z,PARA)
>
> You will have to WRAPIT
>
>
>
>
> On 3/3/11 2:48 PM, Debasish wrote:
>> Dear Dennis,
>>
>> Thanks for your prompt response.
>> So there is no way I can define a character in NCL with 2dimension and each has 12 character length?
>>
>> Thanks
>>
>> Debasish
>>
>> On 2011-03-03, at 16:32, Dennis Shea wrote:
>>
>>> I think you can only pass one string
>>> to the fortran code. This is a C<==>fortran thing.
>>>
>>> D
>>>
>>> On 3/3/11 2:06 PM, Debasish wrote:
>>>> Dear NCL Users,
>>>>
>>>> I have a fortran subroutine (Part of the subroutine are given below)
>>>>
>>>> C===================================================== REGTST.FOR
>>>> SUBROUTINE REGTST(NSITES,NAMES,LEN,XMOM,A,B,SEED,NSIM,NPROB,PROB,
>>>> * KPRINT,KOUT,RMOM,D,VOBS,VBAR,VSD,H,Z,PARA)
>>>> C***********************************************************************
>>>> IMPLICIT DOUBLE PRECISION (A-H,O-Z)
>>>> PARAMETER (MAXNS=200,MAXQ=30,MAXREC=200)
>>>> C
>>>> CHARACTER*1 BLANK,STAR,LOOK1,LOOK2
>>>> *CHARACTER*12 NAMES(NSITES)*
>>>> CHARACTER*18 DISTRI(6)
>>>> DOUBLE PRECISION D(NSITES),DC1(14),DC2(18),H(3),PARA(5,6),
>>>> * PROB(NPROB),Q(MAXQ),RMOM(5),RPARA(4),SMAT(3,3),TMOM(4),T4FIT(5),
>>>> * VBAR(3),VOBS(3),VSD(3),WORK(MAXNS,3),X(MAXREC),XMOM(5,NSITES),
>>>> * Z(5)
>>>> INTEGER LEN(NSITES)
>>>>
>>>> Iam trying to call the subroutine from my NCL script. In this subroutine
>>>> "NAMES (CHARACTER*12)" is the sites name. I have two arbitrary sites
>>>> (NSITES = 2) for example, "AAAAAAAAAAAA" (name of site 1) and
>>>> "BBBBBBBBBBBB" (name of site 2).
>>>>
>>>> I have tried two ways to store the site names in "NAMES" but it does not
>>>> work with the subroutine
>>>>
>>>> *TRAIL # 1*
>>>>
>>>> NAMES = (/"AAAAAAAAAAA","BBBBBBBBBBB"/)
>>>>
>>>> LMOM3::regtst(NSITE,NAMES,LEN,XMOM,A,B,SEED,NSIM,NPROB,PROB,KPRINT,KOUT,RMOM,D,VOBS,VBAR,VSD,H,Z,PARAN)
>>>>
>>>> */Error in line LMOM3::regtst(......) /*: fatal:Number of elements of
>>>> dimension (0) of argument (1) is (2) in function (regtst), expected (12)
>>>> elements
>>>>
>>>> *TRAIL # 2*
>>>>
>>>> NAME = (/"AAAAAAAAAAA","BBBBBBBBBBB"/)
>>>>
>>>> NAMES = stringtocharacter(NAME)
>>>>
>>>> LMOM3::regtst(NSITE,NAMES,LEN,XMOM,A,B,SEED,NSIM,NPROB,PROB,KPRINT,KOUT,RMOM,D,VOBS,VBAR,VSD,H,Z,PARAN)
>>>>
>>>> */Error in line LMOM3::regtst(......)/*: Number of dimensions in
>>>> parameter (1) of (regtst) is (2), (1) dimensions were expected
>>>>
>>>> Any suggestion in this regard will be appreciated
>>>>
>>>> Thanks
>>>>
>>>> Debasish
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 3 16:07:53 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 07 2011 - 15:20:58 MST