Re: NCL Wrapit + memory question

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 18 2013 - 10:00:41 MST

I think

C NCLFORTSTART
       SUBROUTINE UGEO (N_T,N_LAT,LAT,N_LON,LAT_BDYN,LAT_BDYS,UGRAD,UG)
       REAL UGRAD(N_LON,N_LAT,N_T),UG(N_LON,N_LAT,N_T)
       REAL LAT(N_LAT)
       REAL F_PARAM(N_LON,N_LAT,N_T)
       REAL G_CONST, OMEGA, PI, LAT_BDYN, LAT_BDYS
C NCLEND

should be

C NCLFORTSTART
       SUBROUTINE UGEO (N_T,N_LAT,LAT,N_LON,LAT_BDYN,LAT_BDYS,UGRAD,UG)
       REAL UGRAD(N_LON,N_LAT,N_T),UG(N_LON,N_LAT,N_T)
       REAL LAT(N_LAT)
       REAL G_CONST, OMEGA, PI, LAT_BDYN, LAT_BDYS
C NCLEND
       REAL F_PARAM(N_LON,N_LAT,N_T)

================================

The variable 'F' is not an argument being passed from the NCL to
the fortran subroutine. Rather, it is an automatic array. It should
not be included between the the NCLFORTSTART/NCLEND delimeters.
Only arguments being passed should be included between the delimiters.

I speculate that is causing the issue.

Good Luck

On 11/15/13 2:15 PM, jonathan meyer wrote:
> Hi,
> I've been quite happy to learn how useful the wrapit functionality can be in NCL. While I've successfully gotten wrapit to work, I am seeing memory usage grow with each call to my subroutines.
> I've checked to make sure unused ncl variables are being deleted each time through my loop.
> Being rather green with the workings of fortran memory allocation, I'm wondering if there is something I'm missing in my fortran code that is allowing the arrays to remain in memory? I was under the impression that non-allocated memory in the subroutine would be removed at the 'end' command, but maybe this isn't the case for how I've coded mine.
> Attached is a code snippet of the NCL code for the loop the wrapit is being used, as well as the .f script containing my subroutines.
> As always, thanks in advance.
> Jon
>
>
>
> _______________________________________________
> 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 Mon Nov 18 10:00:48 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST