Closed nancycollins closed 6 months ago
i made this change on the fix_parse branch.
related #231
Here is the relevant code change (fix_parse has airs_obs_mod.f90 changes on also)
character(len=*), parameter :: source = 'parse_args_mod.f90'
! the ascii code for the backslash character is 92.
character(len=1), parameter :: BACKSLASH = ACHAR(92)
contains
!------------------------------------------------------------------------------
@@ -135,7 +138,7 @@ subroutine get_args_from_string(inline, argcount, argwords)
inword, '"'//endword//'"', ' ', '"'//thisc//'"'
! escaped chars - backslash prevents interpretation of next char
if (thisc == BACKSLASH) then
! move the remainder of the string over, overwriting the \ and
! skipping the next char.
do i=thisoff, finaloff-1
@@ -309,7 +312,7 @@ subroutine get_name_val_pairs_from_string(inline, argcount, argnames, argvals, c
! escaped chars - backslash prevents interpretation of next char
! shift remainder of line 1 char to the left.
if (thisc == BACKSLASH) then
do i=thisoff, finaloff-1
argline(i:i) = argline(i+1:i+1)
enddo
@@ -492,7 +495,7 @@ subroutine get_next_arg(inline, startoff, argword, endoff)
inword, '"'//endword//'"', ' ', '"'//thisc//'"'
! escaped chars - backslash prevents interpretation of next char
if (thisc == BACKSLASH) then
! move the remainder of the string over, overwriting the \ and
! skipping the next char.
do i=thisoff, finaloff-1
Files that use this flag: mkmf.template.nvhpv, mkmf.template.pgi.linux, mkmf.template.pgi.osx
if this does go into the repo as part of the 'fortran cleanup' effort, i've made a 'fix_parse' branch on my fork of the repo, and it only has the parse file changes without the unintended AIRS converter changes.
Use case
make it easier to compile the dart code by avoiding the need for special compiler flags
Is your feature request related to a problem?
the parse_args_mod.f90 file should have the existing code changed from using double backslash to:
Describe your preferred solution
don't depend on compiler flags to parse
\\
(double backslash)Describe any alternatives you have considered
this is related to a long discussion in issue #219 which is closed now, and #555.
marlee is trying to clean up the code and bring it up to current standards.
this seems like a fix that fits into that goal.