Ignore:
Timestamp:
Mar 5, 2019 11:19:45 AM (5 years ago)
Author:
forkel
Message:

removed read from unit 10 in chemistry_model_mod.f90, added get_mechanismname

Location:
palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/bin/kpp4palm.ksh

    r3458 r3780  
    4040# -----------------
    4141# $Id$
     42# forkel   05. March 2019: cs_mech and set_cm
    4243# forkel   30. Oktober 2018: Integrating contents of kp4_compress into chem_gasphase_mod.f90
    4344# forkel   25. September 2018: Added cat for $MECH to pass mechanism name to kpp4palm
     
    276277  REAL(kind=dp) :: FAKT
    277278
     279! CS_MECH for check of mechanism name with namelist
     280  CHARACTER(LEN=30) :: CS_MECH
    278281#ENDINLINE
    279282EOF
     
    285288EOF
    286289
     290# Store mechanism name for cs_mech
     291cat  >> set_cm  <<  EOF
     292
     293! Set cs_mech for check with mechanism name from namelist
     294    cs_mech = '$MECH'
     295EOF
     296
    287297# Run kpp
    288298
  • palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/create_kpp_module.C

    r3458 r3780  
    1717//-----------------
    1818//$Id: create_kpp_module.C 3453 2018-10-30 13:21:51Z forkel $
     19// Added create_set_cs and cs_mech and get_mechanismname in module_header (05.03.2019, forkel)
     20//
    1921// exclude kco_compress from handling by global_variables2vector (30.10.2018, forkel)
    2022//
     
    191193
    192194   generate_module_header();
     195
     196// create_set_cs
     197   create_set_cs();
    193198
    194199// Create kpp_integrate subroutine (chem_gasphase_integrate) for skalar and vector mode
     
    458463}
    459464
     465void create_kpp_module::create_set_cs() {
     466   fortran_file          kppi;         
     467   vector<Vvar>::iterator               iv;
     468   string                               xline;
     469     
     470   string                          buf;
     471   ifstream                        in;
     472   program_line                    line;
     473
     474   kppi.set_name("get_mechanismname");
     475   kppi.add_line("SUBROUTINE get_mechanismname                                        ");
     476   kppi.add_line("                                                                    ");
     477   kppi.add_line("  IMPLICIT NONE                                                     ");
     478// Read mechanism from set_cm
     479// Tis got an own own subroutine to aviod being called at each timestep
     480
     481   in.open("set_cm");
     482   if( !in ) {
     483      cout << "cannot open " << endl; my_abort("set_cm");
     484   }
     485
     486   while ( 1 ) {
     487     getline (in, buf);
     488     if( in.eof() ) break;
     489     if( in.bad() ) my_abort("ERROR_READ_4");
     490     line.set_line(buf);
     491     kppi.add_line(line);
     492   }
     493   in.close();
     494
     495   kppi.add_line("                                                                    ");
     496   kppi.add_line("  return                                                            ");
     497   kppi.add_line("END SUBROUTINE get_mechanismname                                    ");
     498   kppi.add_line("                                                                    ");
     499   kpp_subroutines.push_back(kppi);
     500
     501   return;
     502}
     503
     504
    460505void create_kpp_module::create_kpp_integrate() {
    461506   fortran_file          kppi;
    462507   vector<Vvar>::iterator               iv;
    463    string                               line;
     508   string                               xline;
     509
    464510
    465511   kppi.set_name("chem_gasphase_integrate");
     
    598644   kppi.add_line("                                                                    ");
    599645   kppi.add_line("  return                                                            ");
    600    kppi.add_line("END SUBROUTINE chem_gasphase_integrate                                        ");
     646   kppi.add_line("END SUBROUTINE chem_gasphase_integrate                              ");
    601647
    602648//   e5_subroutines.push_back(kppi);
  • palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/src/create_kpp_module.h

    r3458 r3780  
    1919// -----------------------
    2020// $Id$
     21// forkel   22.02.2019: Added create_set_cs
    2122// ketelsen 18.09.2018: Removed create_fill_routine
    2223//
     
    6061
    6162  void create_kpp_integrate();
     63  void create_set_cs();
    6264
    6365public:
  • palm/trunk/UTIL/chemistry/gasphase_preproc/kpp4palm/templates/module_header

    r3681 r3780  
    6161!         , REQ_MCFCT, IP_MAX, jname
    6262
     63  PUBLIC :: cs_mech
    6364  PUBLIC :: eqn_names,  phot_names, spc_names
    6465  PUBLIC :: nmaxfixsteps
     
    7778  PUBLIC :: chem_gasphase_integrate
    7879  PUBLIC :: initialize_kpp_ctrl
     80  PUBLIC :: get_mechanismname
    7981
    8082! END OF MODULE HEADER TEMPLATE
Note: See TracChangeset for help on using the changeset viewer.