Re: unloading a dlm... [message #26598] |
Wed, 12 September 2001 07:52  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
Randall Skelton wrote:
>
> Rats!
>
> \begin{rant}
>
> My *real* problem here is with this Fortran 77 model, which is still
> being actively developed using F77!? Fortran 77 if fine for algorithms,
> but for writing large applications, use Fortran 90 at the very least!
>
> \end{rant}
>
> My problem is that I've been told to use a particular atmospheric
> radiative transfer model written in F77. The program reads a bunch of
> input cards/files (shutter), and outputs some rather large files (data is
> in 2-3 2 dimensional arrays). I need to run this model numerous times in
> an optimization/fitting process and a significant portion of the
> processing time is in the reading/writing of the files. My thought was
> that I would write a DLM that copies (or memory maps) between the Fortran
> data and IDL. This proved to be much easier than I thought it would be;
> however, the F77 routines don't pass around variables between subroutines
> (with the exception of error flags and the odd logical type). Rather,
> they use 30+ common blocks and, this being Fortran 77, each array in a
> block is fixed to a maximum size which makes the program rather bloated in
> memory. What I would like to be able to do is use a DLM to run the model,
> use mem-copy to copy the relevant portions of the data into IDL arrays
> (created in C), and then drop the bloated model from memory! I have a few
> objections to using a 'reset-session' as a programming call, not the least
> of which is that it will also destroy my newly created data arrays as
> well.
>
> Thanks for all the suggestions and sorry about the rant... It looks as if
> I am back to using shell scripts and 'spawn.'
Why a DLM? Why can't you run the LBL code as a regular executable in a shell script and then
process the data in IDL via runtime use? I do exactly the same thing you do but avoided the
soul-destroying task of trying to "join" the fortran and IDL. Once I processed about 10000
LBLRTM (which produced terabytes of output [not all at once]) runs using my (standalone) IDL
code in ~ 6 days. Since your email address is in the UK you're probably using GENLN2, right?
paulv
> PS: If anyone has a radiative transfer model capable of producing
> high-resolution, atmospheric absorption, transmission, and emission
> spectra for occultation, nadir, and limb geometries from HITRAN data that
> is written in F90, C, C++, or IDL, please drop me an email...
The current crop of admittedly arcane f77 LBL RTE code may give you a headache to look at, but
it has been verified up the wazoo. The task of rewriting that sort of code in F90 or, heaven
forbid, C/C++/IDL/Matlab, would be a monumental task. Don't get me wrong, I would love a well
designed f90 version of LBLRTM (for e.g. - I can't follow all the common block stuff
neither...) but I wouldn't use it for operational tasks until it had been verified multiple
times by various folks.
--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
|
|
|