Re: how to incorporate NCL into fortran

From: Dennis Shea (shea AT XXXXXX)
Date: Tue Nov 26 2002 - 10:08:01 MST


>> Hi All, We have a model written in Fortran 90, fortran 77 and C
>> language. And the model calls subroutines in the subroutines. It's
>> really a complex model. I want to use this model as the main model,
>> the main program. I just want to call the NCL written scripts I have
>> written as the subroutines in the model.

Maru Haley responded earlier. She outlined how to call
fortran [77 or 90/95] routines from NCL.

However, I think you want to call NCL from fortran.

The only way this could be implemented is if the
fortran compiler has some (common, but non-standard)
extension such as

      character*120 syscmd

      call system (syscmd)
      
The character variable 'syscmd' would contain some
shell script to execute:

      syscmd = "/path/to/ncl/script/plotTemp.scr"
      
where 'plotTemp.scr' is some shell script. Presumably, this
shell script would read some file created by the fortran code.
For example, a C-shell might look like:

#!/bin/csh -f

  ncl < plotTemp.ncl
  
exit

In this type of scenario, the file may be hardwired into the
NCL code. Alternatively, the user may want to pass the name
of the file to be processed to the NCL code in some 'dynamic'
fashion. In this case, the user would likely have to invoke
a separate 'system' command to set some environment variable
which would contain the name of the file which the NCL script
can access via NCL's 'getenv' function.

Currently, there is no direct way to pass an array existing
in fortran to an NCL function.

Dennis Shea

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Tue Nov 26 2002 - 11:34:17 MST