[Dart-dev] DART/branches Revision: 13194
dart at ucar.edu
dart at ucar.edu
Tue Jul 16 11:40:27 MDT 2019
nancy at ucar.edu
2019-07-16 11:40:27 -0600 (Tue, 16 Jul 2019)
259
for the types_mod, add some more info to comments to clarify
what p and r mean when looking at how to specify fortran kinds
(r4, r8, etc).
for the obs_kind_mod, add an accessor function for querying
whether a quantity has limits, and what those limits are.
Modified: DART/branches/preprocess/assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90
===================================================================
--- DART/branches/preprocess/assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90 2019-07-11 22:04:07 UTC (rev 13193)
+++ DART/branches/preprocess/assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90 2019-07-16 17:40:27 UTC (rev 13194)
@@ -453,13 +453,16 @@
!----------------------------------------------------------------------------
! Get bounds values for quantity by index
+! Returns .false. for 'hasbounds' if both min and max are missing_r8
+! (hopefully a shortcut for calling code to skip additional tests.)
-subroutine get_bounds_for_quantity(obs_qty_ind, minbounds, maxbounds)
+subroutine get_bounds_for_quantity(obs_qty_ind, hasbounds, minbounds, maxbounds)
! Returns the min/max bounds, if any, for this quantity index
! Returns MISSING_R8 if no bounds
integer, intent(in) :: obs_qty_ind
+logical, intent(out) :: hasbounds
real(r8), intent(out) :: minbounds
real(r8), intent(out) :: maxbounds
@@ -472,6 +475,8 @@
minbounds = obs_qty_names(obs_qty_ind)%minbound
maxbounds = obs_qty_names(obs_qty_ind)%maxbound
+hasbounds = .not. (minbounds == MISSING_R8 .and. maxbounds == MISSING_R8)
+
end subroutine get_bounds_for_quantity
!----------------------------------------------------------------------------
Modified: DART/branches/preprocess/assimilation_code/modules/utilities/types_mod.f90
===================================================================
--- DART/branches/preprocess/assimilation_code/modules/utilities/types_mod.f90 2019-07-11 22:04:07 UTC (rev 13193)
+++ DART/branches/preprocess/assimilation_code/modules/utilities/types_mod.f90 2019-07-16 17:40:27 UTC (rev 13194)
@@ -4,10 +4,10 @@
!
! $Id$
-!> 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).
+!> Should only have fortran "kinds" - number of bytes/precision - for
+!> integer, real, etc. the constants should go into their own module,
+!> or this should be renamed 'constants' or something more descriptive
+!> than 'types' (which overlaps with dart's use of kinds and types).
module types_mod
@@ -37,7 +37,7 @@
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
+ ! use this for obs types/state quantities
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
@@ -50,6 +50,12 @@
! exactly what precision we are using and are not relying on compiler flags
! to set the defaults for real and int.
!
+! the call is: selected_int_kind(p, r)
+! where p = decimal_precision, and r = decimal_exponent_range
+!
+! below, "external32_size" = number of bytes
+!
+!
! from the MPI documentation, they say:
!
! for reals, p and r values result in:
More information about the Dart-dev
mailing list