[mpas-developers] keeping around .f90 files

Michael Duda duda at ucar.edu
Fri May 7 11:48:52 MDT 2010


Yes, I've certainly been tripped up making edits to the .f90 files
in the past. What typically happens is that either a compile-time
or run-time error (e.g., from Fortran bounds checking) provides a
line number and a .f90 file name, I open the .f90 file to see what
might have caused the error, I decide to make a couple of changes
(forgetting to close the file and open the .F version), and I
re-issue the make command, losing my changes as a result. So, in
these situations, having the .f90 files in a different directory
might not help -- at least for me, it's more a matter of starting
out with the intention of spotting an error based on a line
number, then forgetting to close the file and make changes to the
.F version.

As Phil described, though, having all of the pre-processed source
in a single directory could certainly help if we decided to
determine module dependencies automatically. I'd not object if
someone wanted to experiment with other build systems if they
offer concrete advantages.

Cheers,
Michael


On Fri, May 07, 2010 at 03:57:44AM -0600, Xylar S. Asay-Davis wrote:
> I've been away from email for a while because of travel.  Sorry for the
> slow response.
> 
> I think it's a good idea to have the .f90 files around but I think there's
> a real danger of accidentally editing the .f90 instead of the .F files. 
> One way that POP deals with this is by putting the .f90 files in a
> different directory than the .F files.  This may be an option worth
> considering for MPAS.
> 
> -Xylar
> 
> 
> > Hi, All.
> >
> > Thanks to everyone for the feedback! I'll go ahead and commit
> > the Makefile changes to the trunk.
> >
> > Cheers,
> > Michael
> >
> >
> > On Wed, May 05, 2010 at 11:21:08AM -0600, Mark Petersen wrote:
> >> Michael,
> >>
> >> I like the idea of keeping the .f90 files around.  It is often nice to
> >> look at the post-parsed code to debug or understand how the registry
> >> works.
> >>
> >> Mark
> >>
> >>
> >> On Wed, 5 May 2010, Michael Duda wrote:
> >>
> >> >Hi, Developers.
> >> >
> >> >I have in mind a change to the makefiles that would keep
> >> >the pre-processed Fortran source files (i.e., the .f90
> >> >files) when building the MPAS code, and only remove them
> >> >when 'make clean' is run. The major benefit that I see
> >> >would be in debugging code, where compile-time errors are
> >> >reported with respect to line numbers in .f90 files and
> >> >debuggers generally need the .f90 files when displaying
> >> >source. What opinions do you all have on making this change
> >> >to the repository trunk? The changes are essentially those
> >> >made in revision 250 to a branch, and are summarized below.
> >> >Is this something that we'd like to do in the trunk as well?
> >> >
> >> >Cheers,
> >> >Michael
> >> >
> >> >
> >> >Change all Makefiles to keep the pre-processed Fortran<br>
> >> >source files (i.e., the .f90 files), and to remove these <br>
> >> >files under the 'clean' target.<br>
> >> ><br>
> >> ><br>
> >> >M    src/core_hyd_atmos/Makefile<br>
> >> >M    src/core_sw/Makefile<br>
> >> >M    src/driver/Makefile<br>
> >> >M    src/driver_cam_interface/Makefile<br>
> >> >M    src/core_ocean/Makefile<br>
> >> >M    src/framework/Makefile<br>
> >> >M    src/operators/Makefile<br>
> >> ></p><hr noshade><pre><font color="gray">Modified:
> >> >branches/mpas_cam_coupling/src/core_hyd_atmos/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/core_hyd_atmos/Makefile
> >> 2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/core_hyd_atmos/Makefile
> >> 2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -19,10 +19,9 @@
> >> >mpas_interface.o: module_advection.o module_test_cases.o
> >> >module_time_integration.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod libdycore.a
> >> >+       $(RM) *.o *.mod *.f90 libdycore.a
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >       -I../operators
> >> >-       $(RM) $*.f90
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/core_ocean/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/core_ocean/Makefile  2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/core_ocean/Makefile  2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -19,10 +19,9 @@
> >> >mpas_interface.o: module_global_diagnostics.o module_test_cases.o
> >> >module_time_integration.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod libdycore.a
> >> >+       $(RM) *.o *.mod *.f90 libdycore.a
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >       -I../operators
> >> >-       $(RM) $*.f90
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/core_sw/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/core_sw/Makefile     2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/core_sw/Makefile     2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -16,10 +16,9 @@
> >> >mpas_interface.o: module_test_cases.o module_time_integration.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod libdycore.a
> >> >+       $(RM) *.o *.mod *.f90 libdycore.a
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >       -I../operators
> >> >-       $(RM) $*.f90
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/driver/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/driver/Makefile      2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/driver/Makefile      2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -10,10 +10,9 @@
> >> >mpas.o: module_subdriver.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod
> >> >+       $(RM) *.o *.mod *.f90
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >       -I../core_$(CORE)
> >> >-       $(RM) $*.f90
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/driver_cam_interface/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/driver_cam_interface/Makefile
> >> >2010-05-05 09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/driver_cam_interface/Makefile
> >> >2010-05-05 16:59:19 UTC (rev 250)
> >> >@@ -13,10 +13,9 @@
> >> >test_driver.o: module_mpas_cam_interface.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod
> >> >+       $(RM) *.o *.mod *.f90
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >       -I../core_$(CORE)
> >> >-       $(RM) $*.f90
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/framework/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/framework/Makefile   2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/framework/Makefile   2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -35,13 +35,12 @@
> >> >module_io_output.o: module_grid_types.o module_dmpar.o module_sort.o
> >> >module_configure.o
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod libframework.a
> >> >+       $(RM) *.o *.mod *.f90 libframework.a
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES)
> >> >-       $(RM) $*.f90
> >> >
> >> >.c.o:
> >> >       $(CC) $(CFLAGS) $(CPPFLAGS) $(CPPINCLUDES) -c $&lt;
> >> >
> >> >Modified: branches/mpas_cam_coupling/src/operators/Makefile
> >> >===================================================================
> >> >--- branches/mpas_cam_coupling/src/operators/Makefile   2010-05-05
> >> >09:41:20 UTC (rev 249)
> >> >+++ branches/mpas_cam_coupling/src/operators/Makefile   2010-05-05
> >> >16:59:19 UTC (rev 250)
> >> >@@ -10,10 +10,9 @@
> >> >module_vector_reconstruction.o:
> >> >
> >> >clean:
> >> >-       $(RM) *.o *.mod libops.a
> >> >+       $(RM) *.o *.mod *.f90 libops.a
> >> >
> >> >.F.o:
> >> >       $(RM) $@ $*.mod
> >> >       $(CPP) $(CPPFLAGS) $(CPPINCLUDES) $&lt; &gt; $*.f90
> >> >       $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework
> >> >-       $(RM) $*.f90
> >> >
> >> >_______________________________________________
> >> >mpas-developers mailing list
> >> >mpas-developers at mailman.ucar.edu
> >> >http://mailman.ucar.edu/mailman/listinfo/mpas-developers
> >> >
> > _______________________________________________
> > mpas-developers mailing list
> > mpas-developers at mailman.ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/mpas-developers
> >
> 
> 
> ***********************
> Xylar S. Asay-Davis
> E-mail: xylar at lanl.gov
> Phone: (505) 606-0025
> Fax: (505) 665-2659
> CNLS, MS B258
> Los Alamos National Laboratory
> Los Alamos, NM 87545
> ***********************
> 


More information about the mpas-developers mailing list