next up previous contents
Next: 19 Merging Up: 2 Modules used in Previous: 17 Time Coordination   Contents

Subsections

18 Diagnostics

18.1 Module diag_mod - computes spatial & time averages of fluxed quatities (Source File: diag_mod.F90)

The coupler is required to do certain diagnostics, those calculations are located in this module.


REMARKS:

      Sign convention:
         positive value <=> the model is gaining water, heat, momentum, etc.
      Unit convention:
         heat flux     ~ W/m^2 
         momentum flux ~ N/m^2
         water flux    ~ (kg/s)/m^2
         salt  flux    ~ (kg/s)/m^2
REVISION HISTORY:
      199x-mmm-dd - B. Kauffman - original cpl5 version
      2002-nov-21 - R. Jacob - initial port to cpl6. Does atm and lnd
      2002-nov-27 - R. Jacob - add ocean
      2002-dec-03 - R. Jacob - add solar diagnostics
      2002-dec-15 - R. Jacob - time average diagnostics
      2003-Feb-10 - R. Jacob - calculate sums locally
INTERFACE:
 
 module diag_mod
USES:
 
    use shr_date_mod    ! shared date module
    use shr_sys_mod     ! shared system routines
    use shr_timer_mod   ! shared timers
    use shr_mpi_mod     ! shared mpi layer
    use cpl_kind_mod    ! kinds
    use cpl_const_mod   ! physical constants
    use cpl_mct_mod     ! mct library
    use cpl_comm_mod    ! communicator module
    use cpl_fields_mod  ! index to fields in bundles
    use cpl_domain_mod  ! domain data types
    use cpl_bundle_mod  ! bundle data types
    use cpl_control_mod ! cpl control flags & methods
 
    implicit none
 
    private ! except
PUBLIC TYPES:
 
   ! none
PUBLIC MEMBER FUNCTIONS:
 
    public :: diag_doDiag   ! coordinates all diagnostic subroutines
    public :: diag_solar    ! verifies net-solar coordination
PUBLIC DATA MEMBERS:
 
    !--- note: this partial-sum data needs to be saved in a restart file ---
    real(R8),save,public        :: diag_eday0        ! partial sum: start date
    real(R8),save,public        :: diag_eday1        ! partial sum: end   date
    real(R8),save,public        :: diag_ns           ! partial sum: number of samples
    real(R8),save,public,target :: diag_datas(8,6,3) ! partial sum: the p-sum data

18.1.1 diag_doDiag - coordinates calculation of diagnostic data

Calculate global diagnostics.


REMARKS:

      if (cpl_control_diagNow  ) then print instantaneous diagnostics
      if (cpl_control_avDiagNow) then print time-avg diagnostics
      This is hard-coded to print/reset the t-avg data at the end of every year.
REVISION HISTORY:
     199x-mmm-dd - B. Kauffman original cpl5 version, called diagnos in diag_mod
INTERFACE:
 
 subroutine diag_doDiag(date,bun_a2c,bun_c2a ,bun_l2c ,bun_c2l ,bun_r2c  , &
            &                bun_i2c,bun_c2i ,bun_o2c ,bun_c2o ,bun_a2c_o, &
            &                bun_alb,bun_lfrac,bun_ifrac,bun_ofrac)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(shr_date)  ,intent(in) :: date       ! current model date
    type(cpl_bundle),intent(in) :: bun_a2c    ! atm->cpl bundle
    type(cpl_bundle),intent(in) :: bun_c2a    ! cpl->atm bundle
    type(cpl_bundle),intent(in) :: bun_l2c    ! lnd->cpl bundle
    type(cpl_bundle),intent(in) :: bun_c2l    ! cpl->lnd bundle
    type(cpl_bundle),intent(in) :: bun_r2c    ! rof->cpl bundle
    type(cpl_bundle),intent(in) :: bun_i2c    ! ice->cpl bundle
    type(cpl_bundle),intent(in) :: bun_c2i    ! cpl->ice bundle
    type(cpl_bundle),intent(in) :: bun_o2c    ! ocn->cpl bundle
    type(cpl_bundle),intent(in) :: bun_c2o    ! cpl->ocn bundle
    type(cpl_bundle),intent(in) :: bun_a2c_o  ! atm->cpl bundle
    type(cpl_bundle),intent(in) :: bun_alb    ! albedo   bundle
 
    type(cpl_bundle),intent(in) :: bun_lfrac  ! surface fractions on lnd domain
    type(cpl_bundle),intent(in) :: bun_ifrac  ! surface fractions on ice domain
    type(cpl_bundle),intent(in) :: bun_ofrac  ! surface fractions on ocn domain

18.1.2 diag_atm - compute atmosphere diagnostics

Compute atmosphere diagnostics (instantaneous global averages)


REMARKS:

      Area averages are relative to the entire unit sphere, area = 4*pi rad^2
REVISION HISTORY:
INTERFACE:
 
 SUBROUTINE diag_atm(bun_a2c,bun_c2a)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(cpl_bundle),intent(in ) :: bun_a2c ! atm->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_c2a ! cpl->atm bundle

18.1.3 diag_lnd - compute land diagnostics

Compute land diagnostics (instantaneous global averages)


REMARKS:

      Area averages are relative to the entire unit sphere, area = 4*pi rad^2
REVISION HISTORY:
INTERFACE:
 
 SUBROUTINE diag_lnd(bun_l2c,bun_c2l,bun_r2c,bun_lfrac)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(cpl_bundle),intent(in) :: bun_l2c   ! lnd->cpl bundle
    type(cpl_bundle),intent(in) :: bun_c2l   ! cpl->lnd bundle
    type(cpl_bundle),intent(in) :: bun_r2c   ! rof->cpl bundle
    type(cpl_bundle),intent(in) :: bun_lfrac ! surface fractions on lnd domain

18.1.4 diag_ice - compute atmosphere diagnostics

Compute ice model diagnostics (instantaneous global averages)


REMARKS:

      Area averages are relative to the entire unit sphere, area = 4*pi rad^2
      This routine assumes ice and ocean are on the same grid.
REVISION HISTORY:
INTERFACE:
 
 SUBROUTINE diag_ice(bun_i2c,bun_c2i,bun_o2c,bun_ifrac)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(cpl_bundle),intent(in ) :: bun_i2c   ! ice->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_c2i   ! cpl->ice bundle
    type(cpl_bundle),intent(in ) :: bun_o2c   ! ocn->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_ifrac ! surface fractions on ice domain

18.1.5 diag_ocn - compute ocean diagnostics

Compute ocean diagnostics (instantaneous global averages)


REMARKS:

      Area averages are relative to the entire unit sphere, area = 4*pi rad^2
REVISION HISTORY:
INTERFACE:
 
 SUBROUTINE diag_ocn(bun_o2c,bun_c2o,bun_a2c,bun_i2c,bun_alb,bun_ofrac)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(cpl_bundle),intent(in ) :: bun_o2c    ! ocn->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_c2o    ! cpl->ocn bundle
    type(cpl_bundle),intent(in ) :: bun_a2c    ! atm->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_i2c    ! ice->cpl bundle
    type(cpl_bundle),intent(in ) :: bun_alb    ! albedo   bundle
    type(cpl_bundle),intent(in ) :: bun_ofrac  ! surface fractions on ocn domain

18.1.6 diag_print - print out diagnostics

Print the diagnostics and their sum in each category


REVISION HISTORY:

INTERFACE:
 
 SUBROUTINE diag_print(date)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(shr_date),intent(in)  :: date ! current model date

18.1.7 diag_printAvg - print out diagnostics for time-avg data

Print the diagnostics and their sum in each category


REVISION HISTORY:

INTERFACE:
 
 SUBROUTINE diag_printAvg(date)
USES:
 
    implicit none
INPUT PARAMETERS:
 
    type(shr_date),intent(in)  :: date ! current model date

18.1.8 diag_solar - compares expected vs. actual short-wave radiation

Compare expected vs. actual short-wave net (absorbed solar)


REVISION HISTORY:

INTERFACE:
 
 SUBROUTINE diag_solar(bun_a2c,bun_l2c,bun_i2c,bun_lfrac,bun_ifrac)
INPUT PARAMETERS:
 
    implicit none
 
    type(cpl_bundle),intent(in) :: bun_a2c   !  atm->cpl bundle
    type(cpl_bundle),intent(in) :: bun_l2c   !  lnd->cpl bundleand data
    type(cpl_bundle),intent(in) :: bun_i2c   !  ice->cpl bundlece data
    type(cpl_bundle),intent(in) :: bun_lfrac !  surface fractions on lnd domain
    type(cpl_bundle),intent(in) :: bun_ifrac !  surface fractions on ice domain



next up previous contents
Next: 19 Merging Up: 2 Modules used in Previous: 17 Time Coordination   Contents
cesm.ucar.edu