Ignore:
Timestamp:
Mar 15, 2019 11:15:38 AM (3 years ago)
Author:
forkel
Message:

Modifications for OpenMP version by Klaus Ketelsen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/fortran_file.C

    r3789 r3797  
    1818//-----------------
    1919//$Id:
     20// OpenMP version    (15.03.2019, ketelsen)
    2021//
    21 // removal of unnecessary variables (Ntotal, TSTART)                        (08.03.2019 forkel)
     22// removal of unnecessary variables (Ntotal, TSTART)   (08.03.2019 forkel)
    2223//
    2324// Added vector switch and creation of dimension statement (rev. 3260, 18.09.2018, ketelsen)
     
    333334      lo_line.insert(0,"!DELETE ");
    334335    }
     336//  Delete KPP-generated EQUIVALENCE line (var is POINTER now)
     337    if(ip->get_token(0) == "EQUIVALENCE"  && ip->get_token_size() >= 1) {
     338      lo_line.insert(0,"!DELETE ");
     339    }
    335340
    336341//  Remove  REAL(kind=dp):: sun
     
    429434    }
    430435
    431 
    432 
    433436//  Make ind_ variables public
     437
    434438    if(ip->get_token(3).substr(0,4) == "ind_") {
    435439      global_substitute (lo_line,"PARAMETER","PARAMETER, PUBLIC");
     
    670674    ip->global_substitute(", - ",", -");
    671675
     676//  Replace Roundoff = WLAMCH('E') since WLAMCH does not work everywhere
     677       ip->global_substitute("Roundoff = WLAMCH('E')","roundoff = epsilon(one)");
     678
    672679// Now do some cosmetics to adapt the KPP generated output a bit o the looks of PALM,
    673680// i.e. add some blanks, convert all to lowercase except Fortran language elements, etc.
    674 //  Replace Roundoff = WLAMCH('E') by Roundoff = epsilon(one)
    675        ip->global_substitute("Roundoff = WLAMCH('E')","roundoff = epsilon(one)");
    676681       lo_line = ip->get_line();
    677682       if(lo_line.find("'",0) == string::npos)  {     // No substitution in line with strings
     
    706711         global_substitute(lo_line,"E+ ","E+");
    707712         global_substitute(lo_line,"E- ","E-");
     713//   Set all characters to lowercase
    708714         ip->global_subtolower(lo_line);
     715//   Restore OMP directives: The next 2 lines are not only cosmetics!
     716         global_substitute(lo_line,"!$omp","!$OMP");
     717         global_substitute(lo_line,"threadprivate","THREADPRIVATE");
     718
    709719         global_substitute(lo_line,"allocated","ALLOCATED");
    710720         global_substitute(lo_line,"allocatable","ALLOCATABLE");
     
    714724         global_substitute(lo_line,"character","CHARACTER");
    715725         global_substitute(lo_line,"contains","CONTAINS");
     726         global_substitute(lo_line,"contiguous","CONTIGUOUS");
    716727         global_substitute(lo_line,"deallocate","DEALLOCATE");
    717728         global_substitute(lo_line,"allocate","ALLOCATE");
     
    728739         global_substitute(lo_line,"tEND","tend");
    729740         global_substitute(lo_line,"#ENDIF","#endif");
    730          global_substitute(lo_line,"equivalence","EQUIVALENCE");
    731741         global_substitute(lo_line,"function","FUNCTION");
    732742         global_substitute(lo_line,"if(","IF (");
     
    743753         global_substitute(lo_line,"optional","OPTIONAL");
    744754         global_substitute(lo_line,"parameter","PARAMETER");
     755         global_substitute(lo_line,"pointer","POINTER");
    745756         global_substitute(lo_line,"present","PRESENT");
    746757         global_substitute(lo_line,"private","PRIVATE");
     
    752763         global_substitute(lo_line,"save","SAVE");
    753764         global_substitute(lo_line,"subroutine","SUBROUTINE");
     765         global_substitute(lo_line,"target","TARGET");
    754766         global_substitute(lo_line,"then","THEN");
    755767         global_substitute(lo_line,"where","WHERE");
     
    761773         global_substitute(lo_line,"(inout)","(INOUT)");
    762774         global_substitute(lo_line,"\t","      ");
     775
     776         // Skalar Version
     777         global_substitute(lo_line,"  REAL(kind=dp):: var(nvar)","! REAL(kind=dp):: var(nvar)  var is now POINTER");
     778         global_substitute(lo_line,"REAL(kind=dp):: c(nspec)","REAL(kind=dp), TARGET    :: c(nspec)");
     779         // Vektor Version
     780         global_substitute(lo_line,"  REAL(kind=dp):: var (vl_dim, nvar)","! REAL(kind=dp):: var (vl_dim, nvar)  var is now POINTER");
     781         global_substitute(lo_line,"REAL(kind=dp):: c (vl_dim, nspec)","REAL(kind=dp), TARGET    :: c (vl_dim, nspec)");
     782
    763783//       cout << "HIER1 " << lo_line <<endl;
    764784       }
Note: See TracChangeset for help on using the changeset viewer.