Re: problem of WRAPIT

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 26 2010 - 07:07:48 MST

Yuhua,

In just looking at your program, it looks like you are calling the
Fortran routine correctly. You appear to be passing in the arrays
correctly, you're using the right types, and you have the right order
of arguments. It also appears that you renamed all the functions in
rip_cape.f, which is very important so it doesn't clash with existing
functions already built into NCL.

Maybe Rick will see something I don't!

I'm unable to run your code because it depends on other NCL scripts
and a data file I don't have.

Can you narrow this program way down so that we can run it? The best
thing to do would be to write all the variables that this function
depends on to a temporary NetCDF file, and then all I'll need to run
this script is this file.

Here's how you might write the data to a NetCDF file:

    fout = addfile("mary.nc","c")
   fout->prs = prs
   fout->tmk = tmk
   fout->qvp = qvp

etc.

Do this for prs, tmk, qvp, zz, hgtt, and psfcd.

Then, I'll just be able to read in this file, and call your function
below:

      DCAPECALC3D2::DCAPECALC3D2
(prs,tmk,qvp,zz,hgtt,psfcd,cape,cin,mii,mjj,mkzh,0,1,filin)

THanks,

--Mary

On Jan 25, 2010, at 11:06 PM, Yuhua Yang wrote:

> Thanks Mary and Rick for your help very much!
>
> Now there are no problem on WRAPIT the rip_sub.f, but another
> problem coming. I got "Segmentation fault" when I calling the
> rip_sub.so, I have check my ncl script carefully but I can't find
> where s the error. I'm using the wrfout of WRFV2.2, and following
> is the information:
> ______________________________________________________________________
> ___
> [yangyh@gateway ncl]$ ncl cptp.ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> (0) DX,DY = 9000 9000
> (0) Working on time: 2010012505 3
> (0) llz=34
> (1) llz=264
> (2) llz=264
> (0) llz=34
> (1) llz=264
> (2) llz=264
> (0) llz=34
> (1) llz=264
> (2) llz=264
> (0) llz=34
> (1) llz=264
> (2) llz=264
> (0) llt=264
> (1) llt=264
> (0) ll=34
> (1) ll=264
> (2) ll=264
> (0) ll==34
> (1) ll==264
> (2) ll==264
> (0) UUUUUU UUU
> Segmentation fault
> ______________________________________________________________________
> ______________________
>
> Could you please check the attachment cptp.ncl for me?
>
> By the way,following is the purpose of Why I using rip_sub.f :
> The "wrf_cape_2d" works well on my machine, but I'd like to get
> the temperature of Equilibrium level,which doesn't output by
> wrf_cape_2d, so I have to call the rip_sub.f in order to get extra
> information. Does the function wrf_cape_2d is coming from rip_cape.f?
>
> Thanks again!!
>
> Yuhua
>
>
> ----- Original Message -----
> From: Mary Haley
> To: Rick Brownrigg
> Cc: Yuhua Yang ; ncl-talk@ucar.edu
> Sent: Tuesday, January 26, 2010 1:10 AM
> Subject: Re: problem of WRAPIT
>
> Thanks for catching this Rick! I was not aware of this restriction.
>
> I've added this to the "special considerations" section of the
> WRAPIT documentation, which is a good document to read if you are
> having problems with WRAPIT:
>
> http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml
>
> --Mary
>
> On Jan 25, 2010, at 9:43 AM, Rick Brownrigg wrote:
>
>> Hi,
>>
>> The root of this error is that you declare the types of your two
>> embedded functions as:
>>
>> FUNCTION TONPSADIABAT(THTE,PRS,...
>> DOUBLE PRECISION TONPSADIABAT
>> ...
>>
>> FUNCTION VIRTUAL(TEMP,RATMIX)
>> DOUBLE PRECISION VIRTUAL
>> ...
>>
>> While this is legitimate fortran code, its causing an error in the
>> WRAPIT parsing code. Try declaring the types of the functions with
>> one statement, as:
>>
>> DOUBLE PRECISION FUNCTION TONPSADIABAT(THTE,PRS,...
>> ...
>> DOUBLE PRECISION FUNCTION VIRTUAL(TEMP,RATMIX)
>>
>>
>> Rick
>>
>>
>> On Jan 25, 2010, at 3:12 AM, Yuhua Yang wrote:
>>
>>> Hi,
>>>
>>> When I WRAPIT the attachment file(rip_cape.f) which coming from
>>> Mary, I got the following problem:
>>> ______________________________________________________
>>> WRAPIT rip_cape.f
>>>
>>> WRAPIT Version: 090115
>>> A syntax error occurred while parsing: TONPSADIABAT
>>> COMPILING rip_cape.f
>>> LINKING
>>> END WRAPIT
>>> ________________________________________________________
>>>
>>> The rip_cape.so file is created, but when I try to call the
>>> routine by my NCL script , I get the warning:
>>> Could not find Init() in external file ./rip_cape.so, file not
>>> loaded .
>>>
>>> the enviroment of my machine is linux,64-bit.
>>>
>>> Could you give me some hint to solve this problem? Thanks very much!
>>>
>>> Yuhua
>>>
>>>
>>> <rip_cape.f>
>>> _______________________________________________
>>> 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
>
> <cptp.ncl><rip_cape.f><psadilookup.dat>
> _______________________________________________
> 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 Tue Jan 26 07:08:08 2010

This archive was generated by hypermail 2.1.8 : Mon Feb 01 2010 - 08:05:34 MST