[Dart-dev] DART/branches Revision: 11991

dart at ucar.edu dart at ucar.edu
Tue Oct 17 15:01:05 MDT 2017

nancy at ucar.edu
2017-10-17 15:01:05 -0600 (Tue, 17 Oct 2017)
in the dart_obs_seq_mod, added a width to a write format
spec because gfortran forces 'i' formats to have a width.

added the -D_REAL8_ cpp flag in the mkmf_gsi_to_dart
makefile.  this now successfully compiles on cheyenne
with both intel and gfortran.  i left comments about
the older way of building this executable in which
it used cpp to preprocess the file.  on cheyenne with
gfortran this didn't work because c-style comments
were inserted at the top of the file which caused the
fortran compile to fail.

Modified: DART/branches/rma_trunk/observations/obs_converters/GSI2DART/dart_obs_seq_mod.f90
--- DART/branches/rma_trunk/observations/obs_converters/GSI2DART/dart_obs_seq_mod.f90	2017-10-17 20:59:40 UTC (rev 11990)
+++ DART/branches/rma_trunk/observations/obs_converters/GSI2DART/dart_obs_seq_mod.f90	2017-10-17 21:01:05 UTC (rev 11991)
@@ -368,7 +368,7 @@
    ! Make a string containing satellite,sensor,and channel to match obs_def_radiance_mod.f90 entries
-   write(str_channel,fmt='(i)') channel
+   write(str_channel,fmt='(i8)') channel
    this_string = trim(adjustl(obtype))//'_ch'//trim(adjustl(str_channel))
    call to_upper(this_string) ! Make uppercase to match the case in obs_def_radiance_mod.f90
    call replace_hyphen(this_string)  ! Bad things will happen in DART preprocess "obs_def" files if there are hyphens in names. Replace with underscores

Modified: DART/branches/rma_trunk/observations/obs_converters/GSI2DART/work/mkmf_gsi_to_dart
--- DART/branches/rma_trunk/observations/obs_converters/GSI2DART/work/mkmf_gsi_to_dart	2017-10-17 20:59:40 UTC (rev 11990)
+++ DART/branches/rma_trunk/observations/obs_converters/GSI2DART/work/mkmf_gsi_to_dart	2017-10-17 21:01:05 UTC (rev 11991)
@@ -6,11 +6,17 @@
 # DART $Id$
-rm -f ../enkf/kinds.f90
-/usr/bin/cpp -C -P -D_REAL8_ -traditional-cpp ../enkf/kinds.F90 > ../enkf/kinds.f90
+# we need to preprocess kinds.F90.   the following works on gfortran
+# but if it doesn't, you can try this to explicitly preprocess F90 -> f90 first,
+# and change the path_names file to include the .f90 file instead of .F90:
+# rm -f ../enkf/kinds.f90
+# /usr/bin/cpp -C -P -D_REAL8_ -traditional-cpp ../enkf/kinds.F90 > ../enkf/kinds.f90
 ../../../../build_templates/mkmf -p gsi_to_dart -t ../../../../build_templates/mkmf.template   \
- -a "../../../.." -w path_names_gsi_to_dart  # Note the "-w" for MPI build
+ -c " -D_REAL8_" -a "../../../.." -w path_names_gsi_to_dart  # Note the "-w" for MPI build
 exit $status

More information about the Dart-dev mailing list