Re: Re: Re: [ncl-talk] where to find the original script of rip_cape_3d andrip_cape_2d

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 20 Oct 2008 11:14:56 -0600 (MDT)

Yuhua,

Yes, you can modify the rip_cape.f code directly to make the
modifications you need, and then you can wrap it yourself using
WRAPIT.

I recommend first renaming the subroutines in this file, so they don't
clash with the ones built into NCL. That is, rename:

       SUBROUTINE DCAPECALC3D
       SUBROUTINE DLOOKUP_TABLE
       SUBROUTINE DPFCALC

For example:

       SUBROUTINE DCAPECALC3D2
       SUBROUTINE DLOOKUP_TABLE2
       SUBROUTINE DPFCALC2

Once you have renamed the subroutines and made your modifications,
type:

    WRAPIT rip_cape.f

This should create a "rip_cape.so" file, which you can then load in an
NCL script with the line:

external RIP "./rip_cape.so"

You can then call the new code with:

     RIP::DCAPECALC3D2(..., ..., ...)

You will need to preallocate all of the variables before
you pass them to this subroutine. For an example, see the examples
in:

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

If you have trouble with this, email me offline. WRAPIT code is
sometimes tricky to deal with, especially in trying to get it to work
with your Fortran/C compiler.

--Mary

On Tue, 21 Oct 2008, [utf-8] Yuhua wrote:

> Hi, Mary,
>
> It's exactly what I want. And I have another question,Could I just change the maximum vertical levels from 150 to 310 in the rip_cape.f and wrap it again due to the vertical levels of my model output is 301.
>
> Thanks a lot!
>
> Yuhua
>
>
>
> ----On Mon, 20 Oct 2008 10:17:53 -0600 (MDT) wrote: ----
>
>
>>
>> I'm not sure what you mean by the "original script". These two
>> functions were originally Fortran routines, and we wrapped them so
>> you can call them from NCL.
>>
>> I've attached the Fortran file so you can see the subroutines
>> used.
>>
>> --Mary
>>
>>
>> On Mon, 20 Oct 2008, [utf-8] Yuhua wrote:
>>
>>>
>> Hi all,
>> Could you please tell me where to find the original script of rip_cape_3d and rip_cape_2d, I can use this function but can't find them in the directory NCL5.0.
>> Thanks very much!
>> Yuhua
>>
>> 中国气象局上海台风研究所
>>> -----------------------------------------
>>> Shanghai Typhoon Instutite of China Meteorological Administration
>>>
>>

中国气象局上海台风研究所
> -----------------------------------------
> Shanghai Typhoon Instutite of China Meteorological Administration
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 20 2008 - 11:14:56 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 22 2008 - 13:49:07 MDT