gms-bbg / gamess-issues

GAMESS issue tracking
7 stars 1 forks source link

Time to introduce .F03 as MODULE_F extension #38

Open ivr900 opened 3 years ago

ivr900 commented 3 years ago

Source code files for recently introduced methods and functionalities like LIBXC, RI-MP2GRD or RI-CC use extensively Fortran 2003 syntax, e.g., allocatable assignments. As such, these source code files require proper treatment by Fortran compilers, so the compiler recognize them as Fortran 2003 code.

As result, I see people adding script support for various platforms and compilers trying to deal with such files. This is either adding specific computer flags, or using compiler alias that force compiler to treat $MODULE.F90 as the Fortran 2003 code.

I suggest much neater solution, which could 1) help avoid complications in future and 2) eliminate these many platform or compiler specific lines, as specified above. This could be an introduction of yet another MODULE_F extension, namely .F03. Most, if not all, modern Fortran compilers should automatically turn on all necessary flags for Fortran 2003 code if the file extension .F03 used.

I suggest to make changes in the "comp" switch setting the extension for MODULE_F. It could start as below

switch ($MODULE)
   case mod_dft_gridint:
   case mod_dft_molgrid:
   case mod_grid_storage:
   case mod_nosp_basis:
   case mod_nameio:
   case functionals:
   case riccutils:
   case riccrhf:
   case rimp2grd:
   case rimp2omp:
   case libxc:
   case libxc_empty:
      set MODULE_F=$MODULE.F03
      breaksw
....
other  cases as before
....
switch ($MODULE_F:e)
   case f:
   case F:
      sed -e "s/^$MACHIN/    /" $SRCIN > $CODEOUT
      breaksw
   case f90:
   case F90:
   case F03:
      cp $SRCIN $CODEOUT
      breaksw
endsw

Ivan Rostov NCI Australia, Canberra