Changes between Version 3 and Version 4 of 2019WP/KERNEL-02_Storkey_Coward_IMMERSE_first_steps


Ignore:
Timestamp:
2019-02-08T16:04:02+01:00 (17 months ago)
Author:
acc
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • 2019WP/KERNEL-02_Storkey_Coward_IMMERSE_first_steps

    v3 v4  
    112112 for n in `seq 0 1 $(( ${#INVARS[*]} - 1 ))` 
    113113 do 
    114   perl -0777 -pi -e 's:([\s+-\/\*\%])'${INVARS[$n]}'\s*\(([^)]*)\):\1'${OUTVARS[$n]}'\(\2,'${TLEVS[$n]}'\):g'  $f 
     114  perl -0777 -pi -e 's:([+.(,\s\-\/\*\%])'${INVARS[$n]}'\s*\(([^)]*)\):\1'${OUTVARS[$n]}'\(\2,'${TLEVS[$n]}'\):g'  $f 
    115115 done 
    116116 diff -u TEST_FILES_ORG/`basename $f` $f >> patch.list 
     
    119119}}} 
    120120 
    121 '''The results (patch.list):''' 
     121''' Some contrived tests:''' 
     122 
     123{{{ 
     124cat TEST_FILES_ORG/contrived_tests.F90 
     125   un(:,:,:)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
     126  pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged 
     127  sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged 
     128   un ( ji   , jj,   : )        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
     129   a+ub(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     130   a-vb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     131   a*vn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     132   a/wb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     133   a%wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     134 .OR.wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     135    (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised 
     136   un ( ji+1 ,     &            ! Check entries over multiple lines ae handled 
     137  &     jj, jk - 1 )            ! Check entries over multiple lines ae handled 
     138   un( mi0(ii) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 
     139}}} 
     140 
     141'''Result of the script on the contrived tests:''' 
     142 
     143{{{ 
     144cat TEST_FILES/contrived_tests.F90 
     145   uu(:,:,:,jtn)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
     146  pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged 
     147  sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged 
     148   uu( ji   , jj,   : ,jtn)        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
     149   a+uu(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     150   a-vv(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     151   a*vv(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     152   a/ww(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     153   a%ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     154 .OR.ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     155    (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised 
     156   uu( ji+1 ,     &            ! Check entries over multiple lines ae handled 
     157  &     jj, jk - 1 ,jtn)            ! Check entries over multiple lines ae handled 
     158   uu( mi0(ii,jtn) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 
     159}}} 
     160 
     161{{{#!diff 
     162Index: TEST_FILES/contrived_tests.F90 
     163============================== 
     164--- TEST_FILES_ORG/contrived_tests.F90  2019-02-08 14:21:07.000000000 +0000 
     165+++ TEST_FILES/contrived_tests.F90      2019-02-08 14:39:25.000000000 +0000 
     166@@ -1,14 +1,14 @@ 
     167-   un(:,:,:)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
     168+   uu(:,:,:,jtn)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
     169   pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged 
     170   sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged 
     171-   un ( ji   , jj,   : )        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
     172-   a+ub(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     173-   a-vb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     174-   a*vn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     175-   a/wb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     176-   a%wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     177- .OR.wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
     178-    (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised 
     179-   un ( ji+1 ,     &            ! Check entries over multiple lines ae handled 
     180-  &     jj, jk - 1 )            ! Check entries over multiple lines ae handled 
     181-   un( mi0(ii) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 
     182+   uu( ji   , jj,   : ,jtn)        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
     183+   a+uu(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     184+   a-vv(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     185+   a*vv(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     186+   a/ww(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     187+   a%ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     188+ .OR.ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     189+    (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised 
     190+   uu( ji+1 ,     &            ! Check entries over multiple lines ae handled 
     191+  &     jj, jk - 1 ,jtn)            ! Check entries over multiple lines ae handled 
     192+   uu( mi0(ii,jtn) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 
     193}}} 
     194 
     195So all changes were made correctly (apart from the last which was expected). Also those entries which were potential pitfalls (pun and abc_fwb) were correctly ignored. Time to try a real set: 
     196 
     197'''The results on the sample set of files (patch.list):''' 
    122198 
    123199{{{#!diff 
     
    277353-      !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((un(j+1)+un(j-1))/2)^2  ) 
    278354-      !!                    + mj-1(  2 * vn^2 + ((vn(i+1)+vn(i-1))/2)^2  ) ] 
    279 +      !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((un(j+1)+uu(j-1,jtn))/2)^2  ) 
    280 +      !!                    + mj-1(  2 * vn^2 + ((vn(i+1)+vv(i-1,jtn))/2)^2  ) ] 
     355+      !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((uu(j+1,jtn)+uu(j-1,jtn))/2)^2  ) 
     356+      !!                    + mj-1(  2 * vn^2 + ((vv(I+1,jtn)+vv(i-1,jtn))/2)^2  ) ] 
    281357       !! 
    282358       !!      Take its horizontal gradient and add it to the general momentum 
     
    373449}}} 
    374450 
     451''' Ok This was wrong. jtb is not what should go into the ALLOCATE statement''' 
     452 
    375453{{{#!diff 
    376454Index: TEST_FILES/floats.F90 
     
    403481}}} 
    404482 
     483So far so good.... 
    405484 
    406485