[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: co2calc.f and ta_iter_1.f



Richard,

You are correct that the co2 codes as they appear on the OCMIP site do not
work. They seem to have taken a difficult route through the revision
process by different people. I have attached to this email the version
which I am using. It is a revision of Jim's most recent version.

The changes that I made were to restore the common block species to its
original form and to change the names of the offending arguments of
co2calc by appending _in to them. I initialize the common block variables
with these renamed arguments. I do the same for xco2 to avoid roundoff
induced drift from its unit conversion and reconversion. These changes are
documented in the code.

If you have questions about these changes, please feel free to ask me.

Keith

***********************************************************************
Keith Lindsay                              phone: 303-497-1722
Climate and Global Dynamics                fax:   303-497-1700
National Center for Atmospheric Research   email: klindsay@cgd.ucar.edu
P.O. Box 3000
Boulder, CO  80307-3000

On Thu, 15 Jul 1999, Richard D. Slater wrote:

> In setting up the abiotic runs, I recently downloaded the two routines: 
> co2calc.f and ta_iter_1.f. There seems to be an error in the codes, however. I 
> believe I know why the error was introduced and what the solution is, but 
> wanted to doublecheck and possibly alert others to the error. The versions are 
> 1.7 (1999/04/26) and 1.1 (1999/04/03), respectively.
> 
> In co2calc.f, there is a common block named species which has had 4 of its 
> variables commented out. However, file ta_iter_1.f has the same common block 
> but with the variables *not* commented out. These variables are used in the 
> subroutine, but are never initialized. Because they occur in a common block, 
> the compiler would not complain about their being uninitialized, and the 
> routine would go merrily along using whatever values happened to be at those 
> memory locations.
> 
> I assume that the reason that the variables were commented out was that a 
> variable cannot occur in both an argument list and a common block, and that a 
> fix would be to call the variables in the common block something else (after 
> uncommenting them) and copy the appropriate values into them. (Of course, 
> these common blocks should be defined in an include file in the first place.)
> 
> Cheers,
> 
> Rick Slater
> 
> P.S. I have also noticed that the links to the output routines on the Abiotic 
> HOWTO web page don't point to anything (except for the first one).
>