CLASSIC
Canadian Land Surface Scheme including Biogeochemical Cycles
prepareoutputs Module Reference

Central module that handles all CTEM preparation and writing of output files. More...

Functions/Subroutines

subroutine, public class_daily_aw (lonLocalIndex, latLocalIndex, iday, nltest, nmtest, ncount, nday, lastDOY, realyr)
 Accumlates and writes the daily physics variables. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce a daily value. The pointer to the daily data structures (in classStateVars) keeps the data between calls. More...
 
subroutine, public class_monthly_aw (lonLocalIndex, latLocalIndex, IDAY, realyr, NCOUNT, NDAY, nltest, nmtest, lastDOY)
 Accumulate and write out the monthly physics outputs. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce a monthly value. The pointer to the monthly data structures (in classStateVars) keeps the data between calls. More...
 
subroutine, public class_annual_aw (lonLocalIndex, latLocalIndex, IDAY, realyr, NCOUNT, NDAY, nltest, nmtest, lastDOY)
 Accumulate and write out the annual physics outputs. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce annuals values. The pointer to the annual data structures (in classStateVars) keeps the data between calls. More...
 
subroutine, public convertunitsctem (nltest, nmtest)
 Do some unit conversions for CTEM (biogeochemical processes) so they are ready to be written out. More...
 
subroutine, public ctem_daily_aw (lonLocalIndex, latLocalIndex, nltest, nmtest, iday, ncount, nday, realyr, grclarea, ipeatlandrow)
 Accumulate and write the daily biogeochemical outputs. More...
 
subroutine, public ctem_monthly_aw (lonLocalIndex, latLocalIndex, nltest, nmtest, iday, realyr, nday, lastDOY)
 Accumulate and write out the monthly CTEM outputs. These are kept in pointer structures as this subroutine is called daily and we increment the daily values to produce a monthly value. The pointer to the monthly data structures (in ctemStateVars) keeps the data between calls. More...
 
subroutine, public ctem_annual_aw (lonLocalIndex, latLocalIndex, iday, realyr, nltest, nmtest, lastDOY)
 Accumulate and write out the annual biogeochemical (CTEM) outputs. These are kept in pointer structures as this subroutine is called daily and we increment the daily values to produce annual values. The pointer to the annual data structures (in ctemStateVars) keeps the data between calls. More...
 
subroutine, public class_hh_w (lonLocalIndex, latLocalIndex, nltest, nmtest, ncount, nday, iday, realyr)
 Prepares and writes the CLASS (physics) half hourly file. More...
 

Detailed Description

Central module that handles all CTEM preparation and writing of output files.

Function/Subroutine Documentation

◆ class_annual_aw()

subroutine, public prepareoutputs::class_annual_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  IDAY,
integer, intent(in)  realyr,
integer, intent(in)  NCOUNT,
integer, intent(in)  NDAY,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  lastDOY 
)

Accumulate and write out the annual physics outputs. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce annuals values. The pointer to the annual data structures (in classStateVars) keeps the data between calls.

Author
J. Melton

Accumulate output data for yearly averaged fields for class grid-mean. for both parallel mode and stand alone mode

ADD INITIALIZTION FOR YEARLY ACCUMULATED ARRAYS

IDAY==365/366 .AND. NDAY

◆ class_daily_aw()

subroutine, public prepareoutputs::class_daily_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  iday,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  ncount,
integer, intent(in)  nday,
integer, intent(in)  lastDOY,
integer, intent(in)  realyr 
)

Accumlates and writes the daily physics variables. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce a daily value. The pointer to the daily data structures (in classStateVars) keeps the data between calls.

Author
J. Melton

◆ class_hh_w()

subroutine, public prepareoutputs::class_hh_w ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  ncount,
integer, intent(in)  nday,
integer, intent(in)  iday,
integer, intent(in)  realyr 
)

Prepares and writes the CLASS (physics) half hourly file.

Author
J. Melton

◆ class_monthly_aw()

subroutine, public prepareoutputs::class_monthly_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  IDAY,
integer, intent(in)  realyr,
integer, intent(in)  NCOUNT,
integer, intent(in)  NDAY,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  lastDOY 
)

Accumulate and write out the monthly physics outputs. These are kept in pointer structures as this subroutine is called each physics timestep and we increment the timestep values to produce a monthly value. The pointer to the monthly data structures (in classStateVars) keeps the data between calls.

Author
J. Melton

Accumulate output data for monthly averaged fields for class grid-mean. for both parallel mode and stand alone mode

◆ convertunitsctem()

subroutine, public prepareoutputs::convertunitsctem ( integer, intent(in)  nltest,
integer, intent(in)  nmtest 
)

Do some unit conversions for CTEM (biogeochemical processes) so they are ready to be written out.

Some unit conversions:

We want to go from umol CO2/m2/s to kg C/m2/s so: umolCO2/m2/s * mol/10^6umol * mol C/ molCO2 * 12.01 g C / mol C * 1 kg/ 1000g = kgC/m2/s umolCO2/m2/s * 1.201E-8 = kgC/m2/s convertkgC = 1.201E-8

Now for the bare fraction of the grid cell and the LUC products pool.

◆ ctem_annual_aw()

subroutine, public prepareoutputs::ctem_annual_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  iday,
integer, intent(in)  realyr,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  lastDOY 
)

Accumulate and write out the annual biogeochemical (CTEM) outputs. These are kept in pointer structures as this subroutine is called daily and we increment the daily values to produce annual values. The pointer to the annual data structures (in ctemStateVars) keeps the data between calls.

Author
J. Melton

Accumulate yearly outputs

Accumulate the variables at the per PFT level

Also do the bare fraction amounts

Accumulate the variables at the per tile level

The pools are looked at just at the end of the year.

Add values to the per tile vars

Add values to the per gridcell vars

Write to annual output files:

First write out the per gridcell values

Write out the per tile values

Reset all annual vars in preparation for next year

◆ ctem_daily_aw()

subroutine, public prepareoutputs::ctem_daily_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  iday,
integer, intent(in)  ncount,
integer, intent(in)  nday,
integer, intent(in)  realyr,
real, dimension(:), intent(in)  grclarea,
integer, dimension(:,:), intent(in)  ipeatlandrow 
)

Accumulate and write the daily biogeochemical outputs.

Author
J. Melton

Aggregate to the tile avg vars:

Do the bare ground also:

Calculation of grid averaged variables

Write grid average values

◆ ctem_monthly_aw()

subroutine, public prepareoutputs::ctem_monthly_aw ( integer, intent(in)  lonLocalIndex,
integer, intent(in)  latLocalIndex,
integer, intent(in)  nltest,
integer, intent(in)  nmtest,
integer, intent(in)  iday,
integer, intent(in)  realyr,
integer, intent(in)  nday,
integer, intent(in)  lastDOY 
)

Accumulate and write out the monthly CTEM outputs. These are kept in pointer structures as this subroutine is called daily and we increment the daily values to produce a monthly value. The pointer to the monthly data structures (in ctemStateVars) keeps the data between calls.

Author
J. Melton

Accumulate monthly outputs

Accumulate monthly outputs at the per PFT level.

Also do the bare ground

Accumulate monthly outputs at the per tile level.

Do the mid-month variables (these are not accumulated,we just keep the mid month value for printing in the monthly file)

Do the bare fraction too

Now find the per tile values:

Also add in the bare fraction contributions.

Now find the gridcell level values:

Do the end of month variables

Find the monthly outputs at the per tile level from the outputs at the per PFT level

Find the monthly outputs at the per grid cell level from the outputs at the per tile level

Reset all end of month accumulated arrays