Ignore:
Timestamp:
May 13, 2019 11:04:01 AM (6 years ago)
Author:
suehring
Message:

Updates from chemistriy branched merged into trunk: code cleaning and formatting, code structure optimizations

File:
1 edited

Legend:

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

    r3930 r3968  
    2727! -----------------
    2828! $Id$
     29! - added "emiss_lod" which serves the same function as "mode_emis"
     30!   both will be synchronized with emiss_lod having pirority over
     31!   mode_emis (see informational messages)
     32! - modified existing error message and introduced new informational messages
     33!    - CM0436 - now also applies to invalid LOD settings
     34!    - CM0463 - emiss_lod take precedence in case of conflict with mod_emis
     35!    - CM0464 - emiss_lod valued assigned based on mode_emis if undefined
     36!
     37! 3930 2019-04-24 14:57:18Z forkel
    2938! Changed chem_non_transport_physics to chem_non_advective_processes
    3039!
     
    16821691!
    16831692!-- Emission mode info
    1684     IF ( mode_emis == "DEFAULT" )  THEN
    1685        WRITE( io, 5 )
    1686     ELSEIF ( mode_emis == "PARAMETERIZED" )  THEN
    1687        WRITE( io, 6 )
    1688     ELSEIF ( mode_emis == "PRE-PROCESSED" )  THEN
    1689        WRITE( io, 7 )
    1690     ENDIF
     1693!-- At the moment the evaluation is done with both emiss_lod and mode_emis
     1694!-- but once salsa has been migrated to emiss_lod the .OR. mode_emis
     1695!-- conditions can be removed (ecc 20190513)
     1696    IF     ( (emiss_lod == 1) .OR. (mode_emis == 'DEFAULT') )        THEN
     1697        WRITE ( io, 5 )
     1698    ELSEIF ( (emiss_lod == 0) .OR. (mode_emis == 'PARAMETERIZED') )  THEN
     1699        WRITE ( io, 6 )
     1700    ELSEIF ( (emiss_lod == 2) .OR. (mode_emis == 'PRE-PROCESSED') )  THEN
     1701        WRITE ( io, 7 )
     1702    ENDIF
    16911703!
    16921704!-- Photolysis scheme info
     
    22092221         decycle_method,                   &
    22102222         deposition_dry,                   &
    2211          emissions_anthropogenic,          & 
     2223         emissions_anthropogenic,          &
     2224         emiss_lod,                        &
    22122225         emiss_factor_main,                &
    22132226         emiss_factor_side,                &                     
     
    22712284!
    22722285!--    check for emission mode for chem species
    2273     IF ( (mode_emis /= 'PARAMETERIZED')  .AND. ( mode_emis /= 'DEFAULT' ) .AND. ( mode_emis /= 'PRE-PROCESSED'  ) )  THEN
    2274        message_string = 'Incorrect mode_emiss  option select. Please check spelling'
    2275        CALL message( 'chem_check_parameters', 'CM0436', 1, 2, 0, 6, 0 )
     2286
     2287    IF ( emiss_lod < 0 )  THEN   !- if LOD not defined in namelist
     2288       IF ( ( mode_emis /= 'PARAMETERIZED'  )    .AND.      &
     2289            ( mode_emis /= 'DEFAULT'        )    .AND.      &
     2290            ( mode_emis /= 'PRE-PROCESSED'  ) )  THEN
     2291          message_string = 'Incorrect mode_emiss  option select. Please check spelling'
     2292          CALL message( 'chem_check_parameters', 'CM0436', 1, 2, 0, 6, 0 )
     2293       ENDIF
     2294    ELSE
     2295       IF ( ( emiss_lod /= 0 )    .AND.         &
     2296            ( emiss_lod /= 1 )    .AND.         &
     2297            ( emiss_lod /= 2 ) )  THEN
     2298          message_string = 'Invalid value for emiss_lod (0, 1, or 2)'
     2299          CALL message( 'chem_check_parameters', 'CM0436', 1, 2, 0, 6, 0 )
     2300       ENDIF
     2301    ENDIF
     2302
     2303! for reference (ecc)
     2304!    IF ( (mode_emis /= 'PARAMETERIZED')  .AND. ( mode_emis /= 'DEFAULT' ) .AND. ( mode_emis /= 'PRE-PROCESSED'  ) )  THEN
     2305!       message_string = 'Incorrect mode_emiss  option select. Please check spelling'
     2306!       CALL message( 'chem_check_parameters', 'CM0436', 1, 2, 0, 6, 0 )
     2307!    ENDIF
     2308
     2309!
     2310!-- conflict resolution for emiss_lod and mode_emis
     2311!-- 1) if emiss_lod is defined, have mode_emis assume same setting as emiss_lod
     2312!-- 2) if emiss_lod it not defined, have emiss_lod assuem same setting as mode_emis
     2313!-- this check is in place to retain backward compatibility with salsa until the
     2314!-- code is migrated completed to emiss_lod
     2315    IF  ( emiss_lod >= 0 ) THEN
     2316       SELECT CASE  ( emiss_lod )
     2317          CASE (0)  !- parameterized mode
     2318             mode_emis = 'PARAMETERIZED'
     2319          CASE (1)  !- default mode
     2320             mode_emis = 'DEFAULT'
     2321          CASE (2)  !- preprocessed mode
     2322             mode_emis = 'PRE-PROCESSED'
     2323       END SELECT
     2324       
     2325       message_string = 'Synchronizing mode_emis to defined emiss_lod'               //  &
     2326                        CHAR(10)  //  '          '                                   //  &
     2327                        'NOTE - mode_emis will be depreciated in future releases'    //  &
     2328                        CHAR(10)  //  '          '                                   //  &
     2329                        'please use emiss_lod to define emission mode'
     2330
     2331       CALL message ( 'parin_chem', 'CM0463', 0, 0, 0, 6, 0 )
     2332    ELSE  ! if emiss_lod is not set
     2333       SELECT CASE ( mode_emis )
     2334          CASE ('PARAMETERIZED')
     2335             emiss_lod = 0
     2336          CASE ('DEFAULT')
     2337             emiss_lod = 1
     2338          CASE ('PRE-PROCESSED')
     2339             emiss_lod = 2
     2340       END SELECT
     2341
     2342       message_string = 'emiss_lod undefined.  Using existing mod_emiss setting'     //  &
     2343                        CHAR(10)  //  '          '                                   //  &
     2344                        'NOTE - mode_emis will be depreciated in future releases'    //  &
     2345                        CHAR(10)  //  '          '                                   //  &
     2346                        '       please use emiss_lod to define emission mode'
     2347
     2348       CALL message ( 'parin_chem', 'CM0464', 0, 0, 0, 6, 0 )
    22762349    ENDIF
    22772350
Note: See TracChangeset for help on using the changeset viewer.