README for refactoring the use of clmtype.
PERTAINS to: renameClmType.pl
CWD: models/lnd/clm/tools/clm4_5/refactorTools/clmType

Contents:

I) What happened in clm4_5_10
II) suggestions for how to merge your current sandbox up to trunk

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

I) What happened in clm4_5_10

Mariana refactored clmtype.F90 and clmtypeInitMod.F90 so that the access of derived type variables is only
one level of indirection deep.

An example of the type of refactoring is seen here:

     call hist_addfld1d (fname='SNOOCFRCL', units='W/m^2', &
          avgflag='A', long_name='surface forcing of OC in snow (land) ', &
-         ptr_pft=clm3%g%l%c%p%pef%sfc_frc_oc, set_urb=spval)
+         ptr_pft=pef%sfc_frc_oc, set_urb=spval)

In order to convert code in a semi-automated way, we used a script, renameClmType.pl which parses a given 
piece of source code and does this conversion automatically.  There were a few areas where we had to 
modify things by hand.  After creating a branch from clm4_5_09, I applied the script to my code as follows:

cd models/lnd/clm/src/clm4_5/
find . -name "*.F90" -exec {addYourPathTo}/renameClmType.pl -file {} \;
find . -name "*.temp1" -exec rm -rf {} \;

At this point some hand modification was required mostly to fix the "use clmtype" statements as well as a few
other minor fixes that likely won't be encountered again.

pfttype.F90
clm_glclnd.F90.
mkarbinitMod.F90
VOCEmissionMod.F90
UrbanInitMod.F90
reweightMod.F90
clmtypeInitMod
initGridCellsMod.F90
BiogeophysRestMod.F90

Once this was complete, testing ran as expected.

II) suggestions for how to merge your current sandbox up to trunk

NOTE:  The clmtype modifications themselves are BFB.  Any changes you may see are due to your code modifications.

This is a work in progress and we will have to see how the process evolves in merging old with new code.  I recommend
checking any file by hand using a tool that allows you to view two files with visual delineation of code mods (gvimdiff,
eclipse, etc...)

There are two general categories of modifications:

    1) if you have modified clmtype.F90
    2) you didn't modify clmtype.F90

for case 1)

    - manually edit clmtype.F90 and clmtypeInitMod.F90 and make sure your additons are in line with the new scheme.
    - run the renameClmType.pl script on your code 
    - merge this sandbox up to trunk and resolve differences by hand.  be careful in this step and don't trust svn to
         get everything correct.
    - run tests as usual

for case 2) 

    - run the renameClmType.pl script on your code 
    - merge this sandbox up to trunk and resolve differences by hand.  be careful in this step and don't trust svn to
         get everything correct.
    - run tests as usual


