Skip to content

Commit

Permalink
Merge pull request #136 from bandre-ucar/andre-fates-constants
Browse files Browse the repository at this point in the history
Create FatesConstantMod to hold global constants
  • Loading branch information
rgknox authored Oct 13, 2016
2 parents 49733e8 + a6aaaa4 commit 44aac42
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
17 changes: 17 additions & 0 deletions components/clm/src/ED/main/FatesConstantsMod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module FatesConstantsMod
! This module is used to define global _immutable_ data. Everything in
! this module must have the parameter attribute.

implicit none

public

! kinds
integer, parameter :: fates_r8 = selected_real_kind(12) ! 8 byte real

! string lengths
integer, parameter :: fates_avg_flag_length = 3
integer, parameter :: fates_short_string_length = 32
integer, parameter :: fates_long_string_length = 199

end module FatesConstantsMod
19 changes: 10 additions & 9 deletions components/clm/src/ED/main/HistoryIOMod.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Module HistoryIOMod


use shr_kind_mod , only : r8 => shr_kind_r8
use FatesConstantsMod, only : r8 => fates_r8
use FatesConstantsMod, only : fates_avg_flag_length, fates_short_string_length, fates_long_string_length
use FatesGlobals , only : fates_log
use EDTypesMod , only : cp_hio_ignore_val
use pftconMod , only : pftcon
Expand Down Expand Up @@ -127,7 +128,7 @@ Module HistoryIOMod
! This structure is not allocated by thread, but the upper and lower boundaries
! of the dimension for each thread is saved in the clump_ entry
type iovar_dim_type
character(len=32) :: name ! This should match the name of the dimension
character(fates_short_string_length) :: name ! This should match the name of the dimension
integer :: lb ! lower bound
integer :: ub ! upper bound
integer,allocatable :: clump_lb(:) ! lower bound of thread's portion of HIO array
Expand All @@ -150,7 +151,7 @@ Module HistoryIOMod

! This structure is not multi-threaded
type iovar_dimkind_type
character(len=32) :: name ! String labelling this IO type
character(fates_short_string_length) :: name ! String labelling this IO type
integer :: ndims ! number of dimensions in this IO type
integer, allocatable :: dimsize(:) ! The size of each dimension
logical :: active
Expand All @@ -162,15 +163,15 @@ Module HistoryIOMod

! This type is instanteated in the HLM-FATES interface (clmfates_interfaceMod.F90)
type iovar_def_type
character(len=32) :: vname
character(len=24) :: units
character(len=128) :: long
character(len=24) :: use_default ! States whether a variable should be turned
character(len=fates_short_string_length) :: vname
character(len=fates_short_string_length) :: units
character(len=fates_long_string_length) :: long
character(len=fates_short_string_length) :: use_default ! States whether a variable should be turned
! on the output files by default (active/inactive)
! It is a good idea to set inactive for very large
! or infrequently used output datasets
character(len=24) :: vtype
character(len=1) :: avgflag
character(len=fates_short_string_length) :: vtype
character(len=fates_avg_flag_length) :: avgflag
integer :: upfreq ! Update frequency (this is for checks and flushing)
! 1 = dynamics "dyn" (daily)
! 2 = production "prod" (prob model tstep)
Expand Down

0 comments on commit 44aac42

Please sign in to comment.