[Dart-dev] DART/branches Revision: 12497
dart at ucar.edu
dart at ucar.edu
Tue Apr 10 06:40:20 MDT 2018
thoar at ucar.edu
2018-04-10 06:40:20 -0600 (Tue, 10 Apr 2018)
138
Adding the SMAP observation converter.
This is identical to the one in branches/cesm_clm except that it uses the
'classic' file layout.
Modified: DART/branches/lanai_terrsysmp/common/types_mod.f90
===================================================================
--- DART/branches/lanai_terrsysmp/common/types_mod.f90 2018-04-10 10:08:42 UTC (rev 12496)
+++ DART/branches/lanai_terrsysmp/common/types_mod.f90 2018-04-10 12:40:20 UTC (rev 12497)
@@ -1,96 +1,129 @@
-! DART software - Copyright 2004 - 2013 UCAR. This open source software is
-! provided by UCAR, "as is", without charge, subject to all terms of use at
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
! http://www.image.ucar.edu/DAReS/DART/DART_download
!
! $Id$
-MODULE types_mod
+!> Should only have fortran "kinds". the constants should
+!> go into their own module, or this should be renamed 'constants'
+!> or something more descriptive than 'types' (which overlaps
+!> into our obs kinds and types).
+module types_mod
implicit none
private
-public :: i4, i8, r4, c4, r8, c8, digits12
+public :: i2, i4, i8, r4, c4, r8, c8, digits12
public :: PI, DEG2RAD, RAD2DEG, MISSING_R4, MISSING_R8
-public :: MISSING_I, MISSING_DATA
+public :: MISSING_I, MISSING_I8, MISSING_DATA
public :: SECPERDAY
public :: t_kelvin, es_alpha, es_beta, es_gamma, gas_constant_v, gas_constant
public :: L_over_Rv, ps0, earth_radius, gravity
-public :: metadatalength
-public :: obstypelength
+public :: metadatalength, obstypelength, varnamelength, vtablenamelength
+public :: MAX_NUM_DOMS, MAX_FILES
! version controlled file description for error handling, do not edit
-character(len=256), parameter :: source = &
+character(len=*), parameter :: source = &
"$URL$"
-character(len=32 ), parameter :: revision = "$Revision$"
-character(len=128), parameter :: revdate = "$Date$"
+character(len=*), parameter :: revision = "$Revision$"
+character(len=*), parameter :: revdate = "$Date$"
-SAVE
-
!----------------------------------------------------------------------------
! constants that need to be shared - really has nothing to do with types ...
!----------------------------------------------------------------------------
-integer, parameter :: metadatalength = 64 ! 75 is max w/out wrapping in ncdump
-integer, parameter :: obstypelength = 32 ! set by compiler/param limits
+integer, parameter :: metadatalength = 64 ! 75 is max w/out wrapping in ncdump
+integer, parameter :: varnamelength = 31 ! max name of any fortran variable
+ ! in F90/95. increased to 63 in F2003
+integer, parameter :: obstypelength = 31 ! because of variable name limits.
+ ! use this for obs types/kinds
+integer, parameter :: vtablenamelength = 64 ! use this for the model_mod variable table items
+
+integer, parameter :: MAX_NUM_DOMS = 10 ! max num domains. this is arbitrarily
+ ! based on WRF's maximum number of domains
+integer, parameter :: MAX_FILES = 1000 ! maximum number of files
+
!----------------------------------------------------------------------------
-! Attributes for variable kinds -- no need to rely on -r8 switch in compiler
-! all real variables are 64bit, ditto for all integer variables.
+! Attributes for variable kinds -- declaring sizes explicitly means we know
+! exactly what precision we are using and are not relying on compiler flags
+! to set the defaults for real and int.
+!
+! from the MPI documentation, they say:
+!
+! for reals, p and r values result in:
+! if (p > 33) or (r > 4931) then external32 representation
+! is undefined
+! else if (p > 15) or (r > 307) then external32_size = 16
+! else if (p > 6) or (r > 37) then external32_size = 8
+! else external32_size = 4
+!
+!
+! for integers, r results in:
+! if (r > 38) then external32 representation is undefined
+! else if (r > 18) then external32_size = 16
+! else if (r > 9) then external32_size = 8
+! else if (r > 4) then external32_size = 4
+! else if (r > 2) then external32_size = 2
+! else external32_size = 1
+!
!----------------------------------------------------------------------------
-! These are TJH's favorites
-! integer, parameter :: i4 = SELECTED_INT_KIND(8)
-! integer, parameter :: i8 = SELECTED_INT_KIND(17)
-! integer, parameter :: r4 = SELECTED_REAL_KIND(6,30)
-! integer, parameter :: c4 = SELECTED_REAL_KIND(6,30)
-! integer, parameter :: r8 = SELECTED_REAL_KIND(12,100)
-! integer, parameter :: c8 = SELECTED_REAL_KIND(12,100)
-! These comply with the CCM4 standard, as far as I can tell.
More information about the Dart-dev
mailing list