libsim Versione 7.2.4
missing_values.f90
1! Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
2! authors:
3! Davide Cesari <dcesari@arpa.emr.it>
4! Paolo Patruno <ppatruno@arpa.emr.it>
5
6! This program is free software; you can redistribute it and/or
7! modify it under the terms of the GNU General Public License as
8! published by the Free Software Foundation; either version 2 of
9! the License, or (at your option) any later version.
10
11! This program is distributed in the hope that it will be useful,
12! but WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14! GNU General Public License for more details.
15
16! You should have received a copy of the GNU General Public License
17! along with this program. If not, see <http://www.gnu.org/licenses/>.
18
51USE kinds
52IMPLICIT NONE
53
54REAL, PARAMETER :: rmiss = huge(1.0)
55DOUBLE PRECISION, PARAMETER :: dmiss = huge(1.0d0)
56REAL(kind=fp_s), PARAMETER :: rsmiss = huge(1.0_fp_s)
57REAL(kind=fp_d), PARAMETER :: rdmiss = huge(1.0_fp_d)
58INTEGER, PARAMETER :: imiss = huge(0)
59INTEGER(kind=int_b), PARAMETER :: ibmiss = huge(0_int_b)
60INTEGER(kind=int_b), PARAMETER :: bmiss = ibmiss
61INTEGER(kind=int_s), PARAMETER :: ismiss = huge(0_int_s)
62INTEGER(kind=int_l), PARAMETER :: ilmiss = huge(0_int_l)
63INTEGER(kind=int_ll), PARAMETER :: illmiss = huge(0_int_ll)
64CHARACTER(len=1), PARAMETER :: cmiss = char(0)
65
66
72INTERFACE c_e
73 MODULE PROCEDURE c_e_b, c_e_s, c_e_l,c_e_ll, c_e_r, c_e_d, c_e_c
74END INTERFACE
75
76PRIVATE c_e_b, c_e_s, c_e_l,c_e_ll, c_e_r, c_e_d, c_e_c
77
78CONTAINS
79
81ELEMENTAL LOGICAL FUNCTION c_e_b(var)
82INTEGER(kind=int_b),INTENT(in) :: var
83
84c_e_b = var /= ibmiss
85
86END FUNCTION c_e_b
87
88
90ELEMENTAL LOGICAL FUNCTION c_e_s(var)
91INTEGER(kind=int_s),INTENT(in) :: var
92
93c_e_s = var /= ismiss
94
95END FUNCTION c_e_s
96
97
99ELEMENTAL LOGICAL FUNCTION c_e_l(var)
100INTEGER(kind=int_l),INTENT(in) :: var
101
102c_e_l = var /= ilmiss
103
104END FUNCTION c_e_l
105
106
107! This may not compile if long long is as long as long
109ELEMENTAL LOGICAL FUNCTION c_e_ll(var)
110INTEGER(kind=int_ll),INTENT(in) :: var
111
112c_e_ll = var /= illmiss
113
114END FUNCTION c_e_ll
115
116
118ELEMENTAL LOGICAL FUNCTION c_e_r(var)
119REAL,INTENT(in) :: var
120
121c_e_r = var /= rmiss
122
123END FUNCTION c_e_r
124
125
127ELEMENTAL LOGICAL FUNCTION c_e_d(var)
128DOUBLE PRECISION,INTENT(in) :: var
129
130c_e_d = var /= dmiss
131
132END FUNCTION c_e_d
133! cannot implement quad precision otherwise it may not compile if missing
134
136ELEMENTAL LOGICAL FUNCTION c_e_c(var)
137CHARACTER(len=*),INTENT(in) :: var
138
139c_e_c = var /= cmiss
140
141END FUNCTION c_e_c
142
143
144END MODULE missing_values
Function to check whether a value is missing or not.
Definition of constants to be used for declaring variables of a desired type.
Definition kinds.F90:245
Definitions of constants and functions for working with missing values.

Generated with Doxygen.