Dear Jorn et al,
I noticed that for a host with _FABM_MASK_TYPE_ logical, the gfortran
compiler complains about using '==' instead of '.eqv.', and fails to
compile entirely.
$ mpifort --version
GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
$ make
[ 97%] Building Fortran object CMakeFiles/fabm.dir/src/fabm.F90.o
../code/src/fabm.F90:2982.31:
environment%mask (l__) = self%mask (i__,j__,l__)==.false.
1
Error: Logicals at (1) must be compared with .eqv. instead of ==
I locally fixed this by applying the patch below. Please consider
testing and adding this to FABM.
Cheers,
Carsten
-bash-4.2$ git diff include/fabm_private.h
diff --git a/include/fabm_private.h b/include/fabm_private.h
index 38af8f6..61489bc 100644
--- a/include/fabm_private.h
+++ b/include/fabm_private.h
@@ -180,9 +180,17 @@
# ifdef _FABM_IS_UNMASKED_
# define _IS_UNMASKED_(maskvalue) _FABM_IS_UNMASKED_(maskvalue)
# elif defined(_FABM_MASKED_VALUE_)
-# define _IS_UNMASKED_(maskvalue) maskvalue/=_FABM_MASKED_VALUE_
+# if _FABM_MASK_TYPE_ == logical
+# define _IS_UNMASKED_(maskvalue) maskvalue.neqv._FABM_MASKED_VALUE_
+# else
+# define _IS_UNMASKED_(maskvalue) maskvalue/=_FABM_MASKED_VALUE_
+# endif
# elif defined(_FABM_UNMASKED_VALUE_)
-# define _IS_UNMASKED_(maskvalue) maskvalue==_FABM_UNMASKED_VALUE_
+# if _FABM_MASK_TYPE_ == logical
+# define _IS_UNMASKED_(maskvalue) maskvalue.eqv._FABM_UNMASKED_VALUE_
+# else
+# define _IS_UNMASKED_(maskvalue) maskvalue==_FABM_UNMASKED_VALUE_
+# endif
# else
# error If _FABM_MASK_TYPE_ is set, _FABM_MASKED_VALUE_,
_FABM_UNMASKED_VALUE_ or _FABM_IS_UNMASKED_ must be set as well.
# endif
--
Dr. rer. nat. Carsten Lemmen
Environmental Scientist
Helmholtz Zentrum Geesthacht
Centre for Materials and Coastal Research GmbH
Institute for Coastal Research - System Analysis & Modeling
Ecosystem Modeling (KSE)
Max-Planck-Str.1, 21502 Geesthacht, Germany
Tel.:
+49 4152 87-2013 / Fax: -2020 / Secretary: -1526
Building 11, 1st floor, room 131
Email:
carsten...@hzg.de
Internet:
http://www.hzg.de
Messaging: skype://platipodium or aim://platipodium
My email is as private as regular mail, please 'put it in an envelope'
by GPG encryption with my public key id 9249e2e0.
Geschäftsführer: Prof. Dr. W. A. Kaysser, S. Simon Vors. d.
Aufsichtsrats: Min.-Dir. Dr. H. Zeisel, Amtsgericht Lübeck HRB 285 GE,
USt.IDNr.: DE 135 131 669
Helmholtz-Zentrum Geesthacht
Zentrum für Material- und Küstenforschung GmbH
Max-Planck-Straße 1 I 21502 Geesthacht I Deutschland/Germany
Geschäftsführung/Board of Management: Prof. Dr. Wolfgang Kaysser, Silke Simon
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Ministerialdirigent Dr. Herbert Zeisel
Amtsgericht Lübeck HRB 285 GE (Register Court)
Internet:
http://www.hzg.de