Changeset 3632 for palm/trunk/SOURCE


Ignore:
Timestamp:
Dec 17, 2018 2:52:50 PM (5 years ago)
Author:
kanani
Message:

Fix for masked output, change default chemistry mechanism

Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/chem_gasphase_mod.f90

    r3298 r3632  
    11MODULE chem_gasphase_mod
    22 
    3 !   Mechanism: passive
     3!   Mechanism: phstatp
    44!
    55!------------------------------------------------------------------------------!
     
    4444!--------------------------------------------------------------------------------!
    4545!
    46 ! Current revisions:
    47 ! ------------------
    48 !
    49 !
    50 ! Former revisions:
    51 ! -----------------
    52 ! $Id: chem_gasphase_mod.f90 3287 2018-09-28 10:19:58Z forkel $
    53 ! forkel June 2018: qvap,fakt added
    54 ! forkel June 2018: reset case in  Initialize,Integrate,Update_rconst
    55 !
    56 !
    57 ! 3287 2018-09-28 10:19:58Z forkel
    58 !
    59 ! forkel Sept. 2017: Variables for photolyis added
    60 !
    61 !
    62 ! Nov. 2016: Intial version (Klaus Ketelsen)
    63 !
    64 !------------------------------------------------------------------------------!
    65 !
    66 
     46!
     47! MODULE HEADER TEMPLATE
     48!
     49!  Initial version (Nov. 2016,ketelsen),for later modifications of module_header
     50!  see comments in kpp4palm/src/create_kpp_module.C
    6751
    6852! Set kpp Double Precision to PALM Default Precision
     
    129113!
    130114! File                 : chem_gasphase_mod_Parameters.f90
    131 ! Time                 : Tue Sep 25 18:34:57 2018
    132 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     115! Time                 : Fri Nov 30 13:52:19 2018
     116! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    133117! Equation file        : chem_gasphase_mod.kpp
    134118! Output root filename : chem_gasphase_mod
     
    142126
    143127! NSPEC - Number of chemical species
    144   INTEGER, PARAMETER :: nspec = 2
     128  INTEGER, PARAMETER :: nspec = 4
    145129! NVAR - Number of Variable species
    146   INTEGER, PARAMETER :: nvar = 2
     130  INTEGER, PARAMETER :: nvar = 4
    147131! NVARACT - Number of Active species
    148   INTEGER, PARAMETER :: nvaract = 2
     132  INTEGER, PARAMETER :: nvaract = 4
    149133! NFIX - Number of Fixed species
    150134  INTEGER, PARAMETER :: nfix = 1
    151135! NREACT - Number of reactions
    152   INTEGER, PARAMETER :: nreact = 2
     136  INTEGER, PARAMETER :: nreact = 3
    153137! NVARST - Starting of variables in conc. vect.
    154138  INTEGER, PARAMETER :: nvarst = 1
    155139! NFIXST - Starting of fixed in conc. vect.
    156   INTEGER, PARAMETER :: nfixst = 3
     140  INTEGER, PARAMETER :: nfixst = 5
    157141! NONZERO - Number of nonzero entries in Jacobian
    158   INTEGER, PARAMETER :: nonzero = 2
     142  INTEGER, PARAMETER :: nonzero = 10
    159143! LU_NONZERO - Number of nonzero entries in LU factoriz. of Jacobian
    160   INTEGER, PARAMETER :: lu_nonzero = 2
     144  INTEGER, PARAMETER :: lu_nonzero = 10
    161145! CNVAR - (NVAR+1) Number of elements in compressed row format
    162   INTEGER, PARAMETER :: cnvar = 3
     146  INTEGER, PARAMETER :: cnvar = 5
    163147! CNEQN - (NREACT+1) Number stoicm elements in compressed col format
    164   INTEGER, PARAMETER :: cneqn = 3
     148  INTEGER, PARAMETER :: cneqn = 4
    165149! NHESS - Length of Sparse Hessian
    166   INTEGER, PARAMETER :: nhess = 1
     150  INTEGER, PARAMETER :: nhess = 3
    167151! NMASS - Number of atoms to check mass balance
    168152  INTEGER, PARAMETER :: nmass = 1
     
    172156
    173157  INTEGER, PARAMETER, PUBLIC :: ind_pm10 = 1
    174   INTEGER, PARAMETER, PUBLIC :: ind_pm25 = 2
     158  INTEGER, PARAMETER, PUBLIC :: ind_no = 2
     159  INTEGER, PARAMETER, PUBLIC :: ind_no2 = 3
     160  INTEGER, PARAMETER, PUBLIC :: ind_o3 = 4
    175161
    176162! Index declaration for fixed species in C
     
    183169
    184170! NJVRP - Length of sparse Jacobian JVRP
    185   INTEGER, PARAMETER :: njvrp = 2
     171  INTEGER, PARAMETER :: njvrp = 4
    186172
    187173! NSTOICM - Length of Sparse Stoichiometric Matrix
    188   INTEGER, PARAMETER :: nstoicm = 1
     174  INTEGER, PARAMETER :: nstoicm = 6
    189175
    190176
     
    204190!
    205191! File                 : chem_gasphase_mod_Global.f90
    206 ! Time                 : Tue Sep 25 18:34:57 2018
    207 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     192! Time                 : Fri Nov 30 13:52:19 2018
     193! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    208194! Equation file        : chem_gasphase_mod.kpp
    209195! Output root filename : chem_gasphase_mod
     
    270256!
    271257! File                 : chem_gasphase_mod_JacobianSP.f90
    272 ! Time                 : Tue Sep 25 18:34:57 2018
    273 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     258! Time                 : Fri Nov 30 13:52:19 2018
     259! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    274260! Equation file        : chem_gasphase_mod.kpp
    275261! Output root filename : chem_gasphase_mod
     
    285271
    286272
    287   INTEGER, PARAMETER, DIMENSION(2):: lu_irow =  (/ &
    288        1, 2 /)
    289 
    290   INTEGER, PARAMETER, DIMENSION(2):: lu_icol =  (/ &
    291        1, 2 /)
    292 
    293   INTEGER, PARAMETER, DIMENSION(3):: lu_crow =  (/ &
    294        1, 2, 3 /)
    295 
    296   INTEGER, PARAMETER, DIMENSION(3):: lu_diag =  (/ &
    297        1, 2, 3 /)
     273  INTEGER, PARAMETER, DIMENSION(10):: lu_irow =  (/ &
     274       1, 2, 2, 2, 3, 3, 3, 4, 4, 4 /)
     275
     276  INTEGER, PARAMETER, DIMENSION(10):: lu_icol =  (/ &
     277       1, 2, 3, 4, 2, 3, 4, 2, 3, 4 /)
     278
     279  INTEGER, PARAMETER, DIMENSION(5):: lu_crow =  (/ &
     280       1, 2, 5, 8, 11 /)
     281
     282  INTEGER, PARAMETER, DIMENSION(5):: lu_diag =  (/ &
     283       1, 2, 6, 10, 11 /)
    298284
    299285
     
    314300!
    315301! File                 : chem_gasphase_mod_Monitor.f90
    316 ! Time                 : Tue Sep 25 18:34:57 2018
    317 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     302! Time                 : Fri Nov 30 13:52:19 2018
     303! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    318304! Equation file        : chem_gasphase_mod.kpp
    319305! Output root filename : chem_gasphase_mod
     
    325311
    326312
    327   CHARACTER(len=15), PARAMETER, DIMENSION(2):: spc_names =  (/ &
    328      'PM10           ','PM25           ' /)
    329 
    330   CHARACTER(len=100), PARAMETER, DIMENSION(2):: eqn_names =  (/ &
    331      'PM10 --> PM10                                                                                       ',&
    332      'PM25 --> PM25                                                                                       ' /)
     313  CHARACTER(len=15), PARAMETER, DIMENSION(4):: spc_names =  (/ &
     314     'PM10           ','NO             ','NO2            ',&
     315     'O3             ' /)
     316
     317  CHARACTER(len=100), PARAMETER, DIMENSION(3):: eqn_names =  (/ &
     318     '    NO2 --> NO + O3                                                                                 ',&
     319     'NO + O3 --> NO2                                                                                     ',&
     320     '   PM10 --> PM10                                                                                    ' /)
    333321
    334322! INLINED global variables
     
    337325  !   REAL(kind=dp):: phot(nphot)must eventually be moved to global later for
    338326  INTEGER, PARAMETER :: nphot = 1
    339   !   phot photolysis frequencies
     327  !   phot photolysis frequencies 
    340328  REAL(kind=dp):: phot(nphot)
    341329
     
    374362!
    375363! File                 : chem_gasphase_mod_Initialize.f90
    376 ! Time                 : Tue Sep 25 18:34:57 2018
    377 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     364! Time                 : Fri Nov 30 13:52:19 2018
     365! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    378366! Equation file        : chem_gasphase_mod.kpp
    379367! Output root filename : chem_gasphase_mod
     
    400388!
    401389! File                 : chem_gasphase_mod_Integrator.f90
    402 ! Time                 : Tue Sep 25 18:34:57 2018
    403 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     390! Time                 : Fri Nov 30 13:52:19 2018
     391! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    404392! Equation file        : chem_gasphase_mod.kpp
    405393! Output root filename : chem_gasphase_mod
     
    458446!
    459447! File                 : chem_gasphase_mod_LinearAlgebra.f90
    460 ! Time                 : Tue Sep 25 18:34:57 2018
    461 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     448! Time                 : Fri Nov 30 13:52:19 2018
     449! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    462450! Equation file        : chem_gasphase_mod.kpp
    463451! Output root filename : chem_gasphase_mod
     
    485473!
    486474! File                 : chem_gasphase_mod_Jacobian.f90
    487 ! Time                 : Tue Sep 25 18:34:57 2018
    488 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     475! Time                 : Fri Nov 30 13:52:19 2018
     476! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    489477! Equation file        : chem_gasphase_mod.kpp
    490478! Output root filename : chem_gasphase_mod
     
    512500!
    513501! File                 : chem_gasphase_mod_Function.f90
    514 ! Time                 : Tue Sep 25 18:34:57 2018
    515 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     502! Time                 : Fri Nov 30 13:52:19 2018
     503! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    516504! Equation file        : chem_gasphase_mod.kpp
    517505! Output root filename : chem_gasphase_mod
     
    541529!
    542530! File                 : chem_gasphase_mod_Rates.f90
    543 ! Time                 : Tue Sep 25 18:34:57 2018
    544 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     531! Time                 : Fri Nov 30 13:52:19 2018
     532! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    545533! Equation file        : chem_gasphase_mod.kpp
    546534! Output root filename : chem_gasphase_mod
     
    567555!
    568556! File                 : chem_gasphase_mod_Util.f90
    569 ! Time                 : Tue Sep 25 18:34:57 2018
    570 ! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
     557! Time                 : Fri Nov 30 13:52:19 2018
     558! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
    571559! Equation file        : chem_gasphase_mod.kpp
    572560! Output root filename : chem_gasphase_mod
     
    777765
    778766! Computation of equation rates
     767  a(1) = rct(1) * v(3)
     768  a(2) = rct(2) * v(2) * v(4)
    779769
    780770! Aggregate function
    781771  vdot(1) = 0
    782   vdot(2) = 0
     772  vdot(2) = a(1) - a(2)
     773  vdot(3) = - a(1) + a(2)
     774  vdot(4) = a(1) - a(2)
    783775     
    784776END SUBROUTINE fun
     
    791783  REAL(kind=dp):: x(nvar)
    792784
    793   x(2) = x(2) / jvs(2)
     785  x(3) = x(3) - jvs(5) * x(2)
     786  x(4) = x(4) - jvs(8) * x(2) - jvs(9) * x(3)
     787  x(4) = x(4) / jvs(10)
     788  x(3) = (x(3) - jvs(7) * x(4)) /(jvs(6))
     789  x(2) = (x(2) - jvs(3) * x(3) - jvs(4) * x(4)) /(jvs(2))
    794790  x(1) = x(1) / jvs(1)
    795791     
     
    810806! Local variables
    811807! B - Temporary array
    812   REAL(kind=dp):: b(2)
    813 
    814 ! B(1) = dA(1)/dV(1)
     808  REAL(kind=dp):: b(4)
     809
     810! B(1) = dA(1)/dV(3)
    815811  b(1) = rct(1)
    816812! B(2) = dA(2)/dV(2)
    817   b(2) = rct(2)
     813  b(2) = rct(2) * v(4)
     814! B(3) = dA(2)/dV(4)
     815  b(3) = rct(2) * v(2)
     816! B(4) = dA(3)/dV(1)
     817  b(4) = rct(3)
    818818
    819819! Construct the Jacobian terms from B's
     
    821821  jvs(1) = 0
    822822! JVS(2) = Jac_FULL(2,2)
    823   jvs(2) = 0
     823  jvs(2) = - b(2)
     824! JVS(3) = Jac_FULL(2,3)
     825  jvs(3) = b(1)
     826! JVS(4) = Jac_FULL(2,4)
     827  jvs(4) = - b(3)
     828! JVS(5) = Jac_FULL(3,2)
     829  jvs(5) = b(2)
     830! JVS(6) = Jac_FULL(3,3)
     831  jvs(6) = - b(1)
     832! JVS(7) = Jac_FULL(3,4)
     833  jvs(7) = b(3)
     834! JVS(8) = Jac_FULL(4,2)
     835  jvs(8) = - b(2)
     836! JVS(9) = Jac_FULL(4,3)
     837  jvs(9) = b(1)
     838! JVS(10) = Jac_FULL(4,4)
     839  jvs(10) = - b(3)
    824840     
    825841END SUBROUTINE jac_sp
     
    848864! End INLINED RCONST
    849865
    850   rconst(1) = (1.0_dp)
    851   rconst(2) = (1.0_dp)
     866  rconst(1) = (phot(j_no2))
     867  rconst(2) = (arr2(1.8e-12_dp , 1370.0_dp , temp))
     868  rconst(3) = (1.0_dp)
    852869     
    853870END SUBROUTINE update_rconst
     
    22342251!   i = 1
    22352252!   i = 2
     2253!   i = 3
     2254    jvs(5) = (jvs(5)) / jvs(2)
     2255    jvs(6) = jvs(6) - jvs(3) * jvs(5)
     2256    jvs(7) = jvs(7) - jvs(4) * jvs(5)
     2257!   i = 4
     2258    jvs(8) = (jvs(8)) / jvs(2)
     2259    a = 0.0; a = a  - jvs(3) * jvs(8)
     2260    jvs(9) = (jvs(9) + a) / jvs(6)
     2261    jvs(10) = jvs(10) - jvs(4) * jvs(8) - jvs(7) * jvs(9)
    22362262    RETURN                                                           
    22372263                                                                     
  • palm/trunk/SOURCE/data_output_mask.f90

    r3589 r3632  
    2525! -----------------
    2626! $Id$
     27! Fix output time levels (use time_since_reference_point)
     28!
     29! 3589 2018-11-30 15:09:51Z suehring
    2730! Move the control parameter "salsa" from salsa_mod.f90 to control_parameters
    2831!
     
    168171               mask_j, mask_k, mask_size, mask_size_l, mask_start_l,           &
    169172               mask_surface,                                                   &
    170                max_masks, message_string, mid, nz_do3d, salsa, simulated_time
     173               max_masks, message_string, mid, nz_do3d, salsa,                 &
     174               time_since_reference_point
     175
    171176    USE cpulog,                                                                &
    172177        ONLY:  cpu_log, log_point
     
    265270    IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
    266271       nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_time_mask(mid,av), &
    267                                (/ simulated_time /),                          &
     272                               (/ time_since_reference_point /),              &
    268273                               start = (/ domask_time_count(mid,av) /),       &
    269274                               count = (/ 1 /) )
     
    370375          CASE ( 'pr' )  ! mean particle radius (effective radius)
    371376             IF ( av == 0 )  THEN
    372                 IF ( simulated_time >= particle_advection_start )  THEN
     377                IF ( time_since_reference_point >= particle_advection_start )  THEN
    373378                   DO  i = nxl, nxr
    374379                      DO  j = nys, nyn
     
    514519          CASE ( 'ql_vp' )
    515520             IF ( av == 0 )  THEN
    516                 IF ( simulated_time >= particle_advection_start )  THEN
     521                IF ( time_since_reference_point >= particle_advection_start )  THEN
    517522                   DO  i = nxl, nxr
    518523                      DO  j = nys, nyn
Note: See TracChangeset for help on using the changeset viewer.