calling fortran subroutine from NCL

From: sangeeta maharjan <sangeetamaharjan_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 28 2013 - 02:27:36 MDT

Hi all,
I am planning to write variable of wrf output file into text file. For
this I wrote subroutine in Fortran 90 format and ncl script too. They
are write_fil.f90, write_fil stub and write_fil.ncl.

write_fil.f90

SUBROUTINE WFILE(A)

        IMPLICIT NONE
        REAL,DIMENSION(51,51),INTENT(IN)::A
        INTEGER::I,J
        OPEN(UNIT=12,FILE="STORE.TXT",STATUS="NEW",FORM="FORMATTED")
        WRITE(12,'(51F15.4)')((A(I,J),I=1,51),J=51,1,-1)

END SUBROUTINE WFILE

write_fil.stub

C NCLFORTSTART

        SUBROUTINE WFILE(A)
        REAL, DIMENSION(51,51),INTENT(IN) ::A
        INTEGER:I,J
C NCLEND

write_fil.ncl

external WRITE_FIL "./write_fil.so"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

  f = addfile("/root/Desktop/TWAS/KTM_OUT/wrfout_d03_2012-04-26_00:00:00.nc",
"r")

   Zter = wrf_user_getvar(f,"ter",1)

  WRITE_FIL::WFILE(Zter)
end

On giving command,I got
[root@nepal WRF]# WRAPIT write_fil.stub write_fil.f90

WRAPIT Version: 120209
A syntax error occurred while parsing: ,
COMPILING write_fil.f90
LINKING
END WRAPIT

I would appreciate any help on this.

Sangeeta Maharjan.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 28 02:27:51 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT