-
Notifications
You must be signed in to change notification settings - Fork 19
Add MEGAN2 BVOC emission process #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 20 commits
220487c
fab3b42
ed9c494
344afb7
90160eb
05dc57e
c08aebf
052211a
caea32e
afcbfc4
b31acf1
b7a7376
1bda156
521ee44
f9e7037
f6b4258
435dc0b
82e7f4f
e440c0c
6b52ab6
9a05046
8fb6042
173f5f6
73c3b12
6836cfd
9bfa143
75e2bff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,15 @@ SUBROUTINE Read_Input_File( Config , GridState, EmisState, ChemState, RC, Config | |
| RETURN | ||
| ENDIF | ||
|
|
||
| call Config_Process_Bvoc(ConfigInput, Config, RC) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = 'Error in "Config_Process_Bvoc"!' | ||
| CALL CC_Error( errMsg, RC, thisLoc ) | ||
| CALL QFYAML_CleanUp( ConfigInput ) | ||
lwcugb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CALL QFYAML_CleanUp( ConfigAnchored ) | ||
| RETURN | ||
| ENDIF | ||
|
|
||
| call Config_Process_Plumerise(ConfigInput, Config, RC) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = 'Error in "Config_Process_Plumerise"!' | ||
|
|
@@ -1373,4 +1382,97 @@ SUBROUTINE Config_Process_DryDep( ConfigInput, Config, RC ) | |
| END SUBROUTINE Config_Process_DryDep | ||
|
|
||
|
|
||
| !> \brief Process BVOC configuration | ||
| !! | ||
| !! This function processes the biogenic VOC configuration and performs the necessary actions based on the configuration. | ||
| !! | ||
| !! \param[in] ConfigInput The YAML configuration object | ||
| !! \param[inout] Config The configuration object | ||
| !! \param[out] RC The return code | ||
| !! | ||
| !! \ingroup core_modules | ||
| !!!> | ||
| SUBROUTINE Config_Process_Bvoc( ConfigInput, Config, RC ) | ||
| USE CharPak_Mod, ONLY : StrSplit | ||
| USE Error_Mod | ||
| USE Config_Opt_Mod, ONLY : ConfigType | ||
|
|
||
| TYPE(QFYAML_t), INTENT(INOUT) ::ConfigInput ! YAML Config object | ||
| TYPE(ConfigType), INTENT(INOUT) :: Config ! Input options | ||
|
|
||
| ! | ||
| ! !OUTPUT PARAMETERS: | ||
| ! | ||
| INTEGER, INTENT(OUT) :: RC ! Success or failure | ||
| ! !LOCAL VARIABLES: | ||
| ! | ||
| ! Scalars | ||
| LOGICAL :: v_bool | ||
| INTEGER :: v_int | ||
| ! Reals | ||
| REAL(fp) :: v_real | ||
| ! Strings | ||
| CHARACTER(LEN=255) :: thisLoc | ||
| CHARACTER(LEN=512) :: errMsg | ||
| CHARACTER(LEN=QFYAML_StrLen) :: key | ||
|
|
||
| !======================================================================== | ||
| ! Config_Process_Bvoc begins here! | ||
| !======================================================================== | ||
|
|
||
| ! Initialize | ||
| RC = CC_SUCCESS | ||
| thisLoc = ' -> at Config_Process_Bvoc (in CATChem/src/core/config_mod.F90)' | ||
| errMsg = '' | ||
| ! TODO #105 Fix reading of config file | ||
| key = "process%bvoc%activate" | ||
| v_bool = MISSING_BOOL | ||
| CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_bool, "", RC ) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = 'Error parsing ' // TRIM( key ) // '!' | ||
| CALL CC_Error( errMsg, RC, thisLoc ) | ||
| RETURN | ||
| ENDIF | ||
| Config%bvoc_activate = v_bool | ||
|
|
||
| key = "process%bvoc%scheme_opt" | ||
| v_int = MISSING_INT | ||
| CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_int, "", RC ) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = TRIM( key ) // 'Not Found, Setting Default to 1' | ||
bbakernoaa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CALL CC_Error( errMsg, RC, thisLoc ) | ||
| v_int = 1 ! default is one | ||
|
||
| ENDIF | ||
| Config%bvoc_scheme = v_int | ||
|
|
||
| key = "process%bvoc%co2_inhib" | ||
| v_bool = MISSING_BOOL | ||
| CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_bool, "", RC ) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = TRIM( key ) // 'Not Found, Setting Default to TRUE' | ||
| CALL CC_Error( errMsg, RC, thisLoc ) | ||
| v_bool = .TRUE. ! default is true | ||
| ENDIF | ||
| Config%megan_co2_inhib = v_bool | ||
|
|
||
| key = 'process%bvoc%co2_conc_ppm' | ||
| v_real = MISSING_REAL | ||
| CALL QFYAML_Add_Get( ConfigInput, TRIM( key ), v_real, "", RC ) | ||
| IF ( RC /= CC_SUCCESS ) THEN | ||
| errMsg = TRIM( key ) // 'Not Found, Setting Default to 390.0' | ||
bbakernoaa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| CALL CC_Error( errMsg, RC, thisLoc ) | ||
| v_real = 390.0_fp ! default is 390 ppm | ||
| ENDIF | ||
| Config%megan_co2_conc_ppm = v_real | ||
|
|
||
| write(*,*) "BVOC Configuration" | ||
| write(*,*) '------------------------------------' | ||
| write(*,*) 'Config%bvoc_activate = ', Config%bvoc_activate | ||
| write(*,*) 'Config%bvoc_scheme = ', Config%bvoc_scheme | ||
| write(*,*) 'Config%megan_co2_inhib = ', Config%megan_co2_inhib | ||
| write(*,*) 'Config%megan_co2_conc_ppm = ', Config%megan_co2_conc_ppm | ||
| write(*,*) '------------------------------------' | ||
|
|
||
| END SUBROUTINE Config_Process_Bvoc | ||
|
|
||
| END MODULE config_mod | ||
Uh oh!
There was an error while loading. Please reload this page.