I compiled ROMS 3.3 with gfortran 4.4.1 and tried to compute the error covariance normalization
factors using the randomization method. It fails with the following error message:
Computing initial conditions 2D normalization factors at RHO-points
RAN_INIT: arith assump 3 fails
ran_state.F relies on overflow of integer arithmetics, which is assumed not to happen with the -O3 optimization flag (and even -O2). Luckily, you can easily disable optimization based on this assumption with -fno-strict-overflow. Below is the change I made to Linux-gfortran.mk. Maybe it would be useful to include it in the svn version?
Cheers,
Alex
Code: Select all
Index: Linux-gfortran.mk
===================================================================
--- Linux-gfortran.mk (revision 433)
+++ Linux-gfortran.mk (working copy)
@@ -106,6 +106,11 @@
$(SCRATCH_DIR)/def_var.o: FFLAGS += -fno-bounds-check
+# Prevent gfortran from assuming that no overflow occurs in ran_state
+
+$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
+
+
#
# Set free form format in source files to allow long string for
# local directory and compilation flags inside the code.