Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time to introduce .F03 as MODULE_F extension #38

Open
ivr900 opened this issue Dec 8, 2020 · 0 comments
Open

Time to introduce .F03 as MODULE_F extension #38

ivr900 opened this issue Dec 8, 2020 · 0 comments

Comments

@ivr900
Copy link

ivr900 commented Dec 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant