Re: problem with "CHARACTER"

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 03 2011 - 14:32:11 MST

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
Received on Thu Mar 3 14:32:17 2011

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