From 5d99b13969d644869bfe8d39c18bc2f54515e979 Mon Sep 17 00:00:00 2001 From: Melissa Sulprizio Date: Wed, 27 Sep 2023 13:43:32 -0400 Subject: [PATCH 1/3] Add option to perturb OH in CH4 simulations A new option `OH_perturbation_factor` has been added to geoschem_config.rc for CH4, tag CH4, and carbon simulations. This option is added to facilitate optimizing for OH in the Integrated Methane Inversion (IMI). The scaling of OH is currently done in global_ch4_mod.F90, but it would be more straightforward to do this in HEMCO_Config.rc. Also in this commit, other CH4 options have been slightly renamed for clarity: - Input_Opt%AnalyticalInv -> Input_Opt%DoAnalyticalInv - Input_Opt%PerturbEmis -> Input_Opt%EmisPerturbFactor - Input_Opt%PerturbCH4BoundaryConditions -> DoPerturbCH4BoundaryConditions The options for using emissions and OH scale factors from a previous inversion have been moved to the end of the CH4 options list so that the options for the Jacobian runs within the IMI framework are grouped together. Signed-off-by: Melissa Sulprizio --- CHANGELOG.md | 1 + GeosCore/global_ch4_mod.F90 | 41 ++++++---- GeosCore/hco_interface_gc_mod.F90 | 2 +- GeosCore/hco_utilities_gc_mod.F90 | 2 +- GeosCore/input_mod.F90 | 82 +++++++++++-------- GeosCore/set_boundary_conditions_mod.F90 | 2 +- Headers/input_opt_mod.F90 | 22 ++--- .../geoschem_config.yml.CH4 | 64 ++------------- .../geoschem_config.yml.carbon | 27 +++++- .../geoschem_config.yml.tagCH4 | 14 ++-- .../geoschem_config.yml.carbon | 60 ++------------ 11 files changed, 132 insertions(+), 185 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e438ece7c..601a23bb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Added warning in GCHP HISTORY.rc about outputting area-dependent variables on custom grids - Added option to use a single advected species in the carbon simulation - Added option to perturb CH4 boundary conditions in CH4 simulation +- Added option to perturb OH in CH4 simulation ### Changed - Update `DiagnFreq` in GCClassic integration tests to ensure HEMCO diagnostic output diff --git a/GeosCore/global_ch4_mod.F90 b/GeosCore/global_ch4_mod.F90 index 3d3739da7..d011e21a7 100644 --- a/GeosCore/global_ch4_mod.F90 +++ b/GeosCore/global_ch4_mod.F90 @@ -149,7 +149,7 @@ SUBROUTINE EMISSCH4( Input_Opt, State_Chm, State_Grid, State_Met, RC ) ! ================================================================= ! Get fields for CH4 analytical inversions if needed ! ================================================================= - IF ( Input_Opt%AnalyticalInv ) THEN + IF ( Input_Opt%DoAnalyticalInv ) THEN ! Evaluate the state vector field from HEMCO CALL HCO_GC_EvalFld( Input_Opt, State_Grid, 'CH4_STATE_VECTOR', & @@ -506,7 +506,7 @@ SUBROUTINE EMISSCH4( Input_Opt, State_Chm, State_Grid, State_Met, RC ) ! ================================================================= ! Do scaling for analytical inversion ! ================================================================= - IF ( Input_Opt%AnalyticalInv .or. & + IF ( Input_Opt%DoAnalyticalInv .or. & Input_Opt%UseEmisSF .or. & Input_Opt%UseOHSF ) THEN @@ -514,7 +514,6 @@ SUBROUTINE EMISSCH4( Input_Opt, State_Chm, State_Grid, State_Met, RC ) ! emissions array State_Chm%CH4_EMIS(:,:,1) = State_Chm%CH4_EMIS(:,:,1) + State_Chm%CH4_EMIS(:,:,15) - ! Rescale emissions !$OMP PARALLEL DO & !$OMP DEFAULT( SHARED ) & !$OMP PRIVATE( I, J) @@ -522,7 +521,7 @@ SUBROUTINE EMISSCH4( Input_Opt, State_Chm, State_Grid, State_Met, RC ) DO I = 1, State_Grid%NX !------------------------------------------------------------ - ! For applying scale factors from analytical inversion + ! Apply emission scale factors from a previous inversion !------------------------------------------------------------ IF ( Input_Opt%UseEmisSF ) THEN ! Scale total emissions @@ -532,16 +531,20 @@ SUBROUTINE EMISSCH4( Input_Opt, State_Chm, State_Grid, State_Met, RC ) !------------------------------------------------------------ ! Perturb emissions for analytical inversion !------------------------------------------------------------ - IF ( Input_Opt%AnalyticalInv ) THEN + IF ( Input_Opt%DoAnalyticalInv ) THEN ! Only apply emission perturbation to current state vector ! element number IF ( Input_Opt%StateVectorElement .GT. 0 ) THEN IF ( STATE_VECTOR(I,J) == Input_Opt%StateVectorElement ) THEN - State_Chm%CH4_EMIS(I,J,1) = State_Chm%CH4_EMIS(I,J,1) * Input_Opt%PerturbEmis - !Print*, 'Analytical Inversion: Scaled state vector element ', & - ! Input_Opt%StateVectorElement, ' by ', & - ! Input_Opt%PerturbEmis + State_Chm%CH4_EMIS(I,J,1) = State_Chm%CH4_EMIS(I,J,1) * & + Input_Opt%EmisPerturbFactor + IF ( Input_Opt%Verbose ) THEN + Print*, 'Analytical Inversion: ', & + 'Scaled state vector element ', & + Input_Opt%StateVectorElement, ' by ', & + Input_Opt%EmisPerturbFactor + ENDIF ENDIF ENDIF ENDIF @@ -930,10 +933,18 @@ SUBROUTINE CH4_DECAY( Input_Opt, State_Chm, State_Diag, & ! BOH from HEMCO in units of kg/m3, convert to molec/cm3 C_OH = State_Chm%BOH(I,J,L) * XNUMOL_OH / CM3PERM3 - ! Apply scale factors from analytical inversion + ! Apply OH perturbation factor for inversions + IF ( Input_Opt%OHPerturbFactor /= 1.0 ) THEN + C_OH = C_OH * Input_Opt%OHPerturbFactor + ENDIF + + ! Apply OH scale factors from a previous inversion IF ( Input_Opt%UseOHSF ) THEN C_OH = C_OH * OH_SF(I,J) - !Print*, 'Applying scale factor to OH: ', OH_SF(I,J) + IF ( Input_Opt%Verbose ) THEN + !This will print over every grid box; comment out for now + !Print*, 'Applying scale factor to OH: ', OH_SF(I,J) + ENDIF ENDIF ! Cl in [molec/cm3] @@ -973,9 +984,11 @@ SUBROUTINE CH4_DECAY( Input_Opt, State_Chm, State_Diag, & ENDDO !$OMP END PARALLEL DO - !print*,'% --- CHEMCH4: CH4_DECAY: TROP DECAY (Tg): ',TROPOCH4/1e9 - !print*,'Trop decay should be over 1Tg per day globally' - !print*,' ~ 500Tg/365d ~ 1.37/d' + IF ( Input_Opt%Verbose ) THEN + print*,'% --- CHEMCH4: CH4_DECAY: TROP DECAY (Tg): ',TROPOCH4/1e9 + print*,'Trop decay should be over 1Tg per day globally' + print*,' ~ 500Tg/365d ~ 1.37/d' + ENDIF ! Free pointers Spc => NULL() diff --git a/GeosCore/hco_interface_gc_mod.F90 b/GeosCore/hco_interface_gc_mod.F90 index 0d1748d2a..830cbf61e 100644 --- a/GeosCore/hco_interface_gc_mod.F90 +++ b/GeosCore/hco_interface_gc_mod.F90 @@ -4171,7 +4171,7 @@ SUBROUTINE CheckSettings( HcoConfig, Input_Opt, State_Met, State_Chm, RC ) !----------------------------------------------------------------------- IF ( Input_Opt%ITS_A_CH4_SIM .or. Input_Opt%ITS_A_TAGCH4_SIM) THEN - IF ( Input_Opt%AnalyticalInv ) THEN + IF ( Input_Opt%DoAnalyticalInv ) THEN CALL GetExtOpt( HcoConfig, -999, 'AnalyticalInv', & OptValBool=LTMP, FOUND=FOUND, RC=HMRC ) diff --git a/GeosCore/hco_utilities_gc_mod.F90 b/GeosCore/hco_utilities_gc_mod.F90 index 202f00ab7..9247ca551 100644 --- a/GeosCore/hco_utilities_gc_mod.F90 +++ b/GeosCore/hco_utilities_gc_mod.F90 @@ -2576,7 +2576,7 @@ SUBROUTINE Get_Boundary_Conditions( Input_Opt, State_Chm, State_Grid, & ! Each time the boundary conditions are read, they have no longer been perturbed ! This value is sometimes set to True in set_boundary_conditions_mod.F90 IF ( ( Input_Opt%ITS_A_CH4_SIM .OR. Input_Opt%ITS_A_CARBON_SIM ) .AND. & - Input_Opt%PerturbCH4BoundaryConditions ) THEN + Input_Opt%DoPerturbCH4BoundaryConditions ) THEN State_Chm%IsCH4BCPerturbed = .FALSE. ENDIF diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 469bb2978..8623486eb 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -4899,20 +4899,7 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) CALL GC_Error( errMsg, RC, thisLoc ) RETURN ENDIF - Input_Opt%AnalyticalInv = v_bool - - !------------------------------------------------------------------------ - ! Emission perturbation - !------------------------------------------------------------------------ - key = "CH4_simulation_options%analytical_inversion%emission_perturbation" - v_str = MISSING_STR - CALL QFYAML_Add_Get( Config, TRIM( key ), v_str, "", RC ) - IF ( RC /= GC_SUCCESS ) THEN - errMsg = 'Error parsing ' // TRIM( key ) // '!' - CALL GC_Error( errMsg, RC, thisLoc ) - RETURN - ENDIF - Input_Opt%PerturbEmis = Cast_and_RoundOff( v_str, places=4 ) + Input_Opt%DoAnalyticalInv = v_bool !------------------------------------------------------------------------ ! Current state vector element number @@ -4929,31 +4916,30 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) Input_Opt%StateVectorElement = v_int !------------------------------------------------------------------------ - ! Use emission scale factor? + ! Emission perturbation factor !------------------------------------------------------------------------ - key = & - "CH4_simulation_options%analytical_inversion%use_emission_scale_factor" - v_bool = MISSING_BOOL - CALL QFYAML_Add_Get( Config, TRIM( key ), v_bool, "", RC ) + key = "CH4_simulation_options%analytical_inversion%emission_perturbation_factor" + v_str = MISSING_STR + CALL QFYAML_Add_Get( Config, TRIM( key ), v_str, "", RC ) IF ( RC /= GC_SUCCESS ) THEN errMsg = 'Error parsing ' // TRIM( key ) // '!' CALL GC_Error( errMsg, RC, thisLoc ) RETURN ENDIF - Input_Opt%UseEmisSF = v_bool + Input_Opt%EmisPerturbFactor = Cast_and_RoundOff( v_str, places=4 ) !------------------------------------------------------------------------ - ! Use OH scale factors? + ! OH perturbation factor !------------------------------------------------------------------------ - key = "CH4_simulation_options%analytical_inversion%use_OH_scale_factors" - v_bool = MISSING_BOOL - CALL QFYAML_Add_Get( Config, TRIM( key ), v_bool, "", RC ) + key = "CH4_simulation_options%analytical_inversion%OH_perturbation_factor" + v_str = MISSING_STR + CALL QFYAML_Add_Get( Config, TRIM( key ), v_str, "", RC ) IF ( RC /= GC_SUCCESS ) THEN errMsg = 'Error parsing ' // TRIM( key ) // '!' CALL GC_Error( errMsg, RC, thisLoc ) RETURN ENDIF - Input_Opt%UseOHSF = v_bool + Input_Opt%OHPerturbFactor = Cast_and_RoundOff( v_str, places=4 ) !------------------------------------------------------------------------ ! Perturb CH4 boundary conditions? @@ -4966,7 +4952,7 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) CALL GC_Error( errMsg, RC, thisLoc ) RETURN ENDIF - Input_Opt%PerturbCH4BoundaryConditions = v_bool + Input_Opt%DoPerturbCH4BoundaryConditions = v_bool !------------------------------------------------------------------------ ! How much to perturb CH4 boundary conditions by? @@ -4984,25 +4970,53 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) Input_Opt%CH4BoundaryConditionIncreaseEast = Cast_and_RoundOff( a_str(3), places=4 ) Input_Opt%CH4BoundaryConditionIncreaseWest = Cast_and_RoundOff( a_str(4), places=4 ) + !------------------------------------------------------------------------ + ! Use emission scale factors from a previous inversion? + !------------------------------------------------------------------------ + key = & + "CH4_simulation_options%analytical_inversion%use_emission_scale_factor" + v_bool = MISSING_BOOL + CALL QFYAML_Add_Get( Config, TRIM( key ), v_bool, "", RC ) + IF ( RC /= GC_SUCCESS ) THEN + errMsg = 'Error parsing ' // TRIM( key ) // '!' + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + Input_Opt%UseEmisSF = v_bool + + !------------------------------------------------------------------------ + ! Use OH scale factors from a previous inversion? + !------------------------------------------------------------------------ + key = "CH4_simulation_options%analytical_inversion%use_OH_scale_factors" + v_bool = MISSING_BOOL + CALL QFYAML_Add_Get( Config, TRIM( key ), v_bool, "", RC ) + IF ( RC /= GC_SUCCESS ) THEN + errMsg = 'Error parsing ' // TRIM( key ) // '!' + CALL GC_Error( errMsg, RC, thisLoc ) + RETURN + ENDIF + Input_Opt%UseOHSF = v_bool + !======================================================================== ! Print to screen !======================================================================== IF ( Input_Opt%amIRoot ) THEN WRITE(6,90 ) 'CH4 SIMULATION SETTINGS' WRITE(6,95 ) '-----------------------' - WRITE(6,100) 'Use AIRS obs operator : ', Input_Opt%AIRS_CH4_OBS - WRITE(6,100) 'Use GOSAT obs operator : ', Input_Opt%GOSAT_CH4_OBS - WRITE(6,100) 'Use TCCON obs operator : ', Input_Opt%TCCON_CH4_OBS - WRITE(6,100) 'Do analytical inversion : ', Input_Opt%AnalyticalInv - WRITE(6,110) 'Emission perturbation : ', Input_Opt%PerturbEmis + WRITE(6,100) 'Use AIRS obs operator? : ', Input_Opt%AIRS_CH4_OBS + WRITE(6,100) 'Use GOSAT obs operator? : ', Input_Opt%GOSAT_CH4_OBS + WRITE(6,100) 'Use TCCON obs operator? : ', Input_Opt%TCCON_CH4_OBS + WRITE(6,100) 'Do analytical inversion? : ', Input_Opt%DoAnalyticalInv WRITE(6,120) 'Current state vector elem: ', Input_Opt%StateVectorElement - WRITE(6,100) 'Use emis scale factors : ', Input_Opt%UseEmisSF - WRITE(6,100) 'Use OH scale factors : ', Input_Opt%UseOHSF - WRITE(6,100) 'Perturb CH4 BCs : ', Input_Opt%PerturbCH4BoundaryConditions + WRITE(6,110) 'Emiss perturbation factor: ', Input_Opt%EmisPerturbFactor + WRITE(6,110) 'OH perturbation factor: ', Input_Opt%OHPerturbFactor + WRITE(6,100) 'Perturb CH4 BCs? : ', Input_Opt%DoPerturbCH4BoundaryConditions WRITE(6,130) 'CH4 BC ppb increase NSEW : ', Input_Opt%CH4BoundaryConditionIncreaseNorth,& Input_Opt%CH4BoundaryConditionIncreaseSouth,& Input_Opt%CH4BoundaryConditionIncreaseEast,& Input_Opt%CH4BoundaryConditionIncreaseWest + WRITE(6,100) 'Use emis scale factors? : ', Input_Opt%UseEmisSF + WRITE(6,100) 'Use OH scale factors? : ', Input_Opt%UseOHSF ENDIF ! FORMAT statements diff --git a/GeosCore/set_boundary_conditions_mod.F90 b/GeosCore/set_boundary_conditions_mod.F90 index 92a271889..cb633279b 100644 --- a/GeosCore/set_boundary_conditions_mod.F90 +++ b/GeosCore/set_boundary_conditions_mod.F90 @@ -141,7 +141,7 @@ SUBROUTINE Set_Boundary_Conditions( Input_Opt, State_Chm, State_Grid, RC ) ! Convert to [kg/kg dry] (nbalasus, 8/31/2023) Perturb_CH4_BC = ( State_Chm%SpcData(N)%Info%Name == "CH4" .AND. & ( Input_Opt%ITS_A_CH4_SIM .OR. Input_Opt%ITS_A_CARBON_SIM ) .AND. & - Input_Opt%PerturbCH4BoundaryConditions .AND. & + Input_Opt%DoPerturbCH4BoundaryConditions .AND. & ( .NOT. State_Chm%IsCH4BCPerturbed ) ) MW_g_CH4 = State_Chm%SpcData(N)%Info%MW_g diff --git a/Headers/input_opt_mod.F90 b/Headers/input_opt_mod.F90 index 318636490..64d9816ef 100644 --- a/Headers/input_opt_mod.F90 +++ b/Headers/input_opt_mod.F90 @@ -365,16 +365,17 @@ MODULE Input_Opt_Mod LOGICAL :: GOSAT_CH4_OBS LOGICAL :: AIRS_CH4_OBS LOGICAL :: TCCON_CH4_OBS - LOGICAL :: AnalyticalInv - REAL(fp) :: PerturbEmis + LOGICAL :: DoAnalyticalInv INTEGER :: StateVectorElement - LOGICAL :: UseEmisSF - LOGICAL :: UseOHSF - LOGICAL :: PerturbCH4BoundaryConditions + REAL(fp) :: EmisPerturbFactor + REAL(fp) :: OHPerturbFactor + LOGICAL :: DoPerturbCH4BoundaryConditions REAL(fp) :: CH4BoundaryConditionIncreaseNorth REAL(fp) :: CH4BoundaryConditionIncreaseSouth REAL(fp) :: CH4BoundaryConditionIncreaseEast REAL(fp) :: CH4BoundaryConditionIncreaseWest + LOGICAL :: UseEmisSF + LOGICAL :: UseOHSF !---------------------------------------- ! POPS MENU fields @@ -906,16 +907,17 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%GOSAT_CH4_OBS = .FALSE. Input_Opt%AIRS_CH4_OBS = .FALSE. Input_Opt%TCCON_CH4_OBS = .FALSE. - Input_Opt%AnalyticalInv = .FALSE. - Input_Opt%PerturbEmis = 1.0 + Input_Opt%DoAnalyticalInv = .FALSE. Input_Opt%StateVectorElement = 0 - Input_Opt%UseEmisSF = .FALSE. - Input_Opt%UseOHSF = .FALSE. - Input_Opt%PerturbCH4BoundaryConditions = .FALSE. + Input_Opt%EmisPerturbFactor = 1.0 + Input_Opt%OHPerturbFactor = 1.0 + Input_Opt%DoPerturbCH4BoundaryConditions = .FALSE. Input_Opt%CH4BoundaryConditionIncreaseNorth = 0.0_fp Input_Opt%CH4BoundaryConditionIncreaseSouth = 0.0_fp Input_Opt%CH4BoundaryConditionIncreaseEast = 0.0_fp Input_Opt%CH4BoundaryConditionIncreaseWest = 0.0_fp + Input_Opt%UseEmisSF = .FALSE. + Input_Opt%UseOHSF = .FALSE. !---------------------------------------- ! POPS MENU fields diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 index eeb72f238..1284940df 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 @@ -1,9 +1,6 @@ --- ### geoschem_config.yml: GEOS-Chem Runtime configuration options. ### Customized for simulations using the CH4 mechanism. -### -### NOTE: Add quotes around nitrogen oxide ('NO'), because YAML -### parsers will confuse this with a negative "no" value. #============================================================================ # Simulation settings @@ -79,13 +76,14 @@ CH4_simulation_options: analytical_inversion: activate: false - emission_perturbation: 1.0 state_vector_element_number: 0 - use_emission_scale_factor: false - use_OH_scale_factors: false + emission_perturbation_factor: 1.0 + OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] - + use_emission_scale_factor: false + use_OH_scale_factors: false + #============================================================================ # Settings for diagnostics (other than HISTORY and HEMCO) #============================================================================ @@ -102,54 +100,4 @@ extra_diagnostics: planeflight: activate: false flight_track_file: Planeflight.dat.YYYYMMDD - output_file: plane.log.YYYYMMDD - - legacy_bpch: # 1 2 3 - output_menu: # 1234567890123456789012345678901 - schedule_output_for_JAN: 3000000000000000000000000000000 - schedule_output_for_FEB: 30000000000000000000000000000 - schedule_output_for_MAR: 3000000000000000000000000000000 - schedule_output_for_APR: 300000000000000000000000000000 - schedule_output_for_MAY: 3000000000000000000000000000000 - schedule_output_for_JUN: 300000000000000000000000000000 - schedule_output_for_JUL: 3000000000000000000000000000000 - schedule_output_for_AUG: 3000000000000000000000000000000 - schedule_output_for_SEP: 300000000000000000000000000000 - schedule_output_for_OCT: 3000000000000000000000000000000 - schedule_output_for_NOV: 300000000000000000000000000000 - schedule_output_for_DEC: 3000000000000000000000000000000 - - gamap: - diaginfo_dat_file: ./diaginfo.dat - tracerinfo_dat_file: ./tracerinfo.dat - - bpch_diagnostics: - TOMAS_aerosol_emissions: "0 all" - TOMAS_rate: "0 all" - TOMAS_3D_rate: "0 all" - - ND51_satellite: - activate: false - output_file: ts_satellite.YYYYMMDD.bpch - tracers: - - 1 - - 2 - - 501 - UTC_hour_for_write: 0 - averaging_period_in_LT: [9, 11] - IMIN_and_IMAX_of_region: [1, 72] - JMIN_and_JMAX_of_region: [1, 46] - LMIN_and_LMAX_of_region: [1, 1] - - ND51b_satellite: - activate: false - output_file: ts_13_15_NA..YYYYMMDD.bpch - tracers: - - 1 - - 2 - - 501 - UTC_hour_for_write: 1 - averaging_period_in_LT: [13, 15] - IMIN_and_IMAX_of_region: [1, 72] - JMIN_and_JMAX_of_region: [1, 46] - LMIN_and_LMAX_of_region: [1, 1] + output_file: plane.log.YYYYMMDD \ No newline at end of file diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon index beeb1b210..1e86fe98a 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon @@ -79,12 +79,13 @@ CH4_simulation_options: analytical_inversion: activate: false - emission_perturbation: 1.0 state_vector_element_number: 0 - use_emission_scale_factor: false - use_OH_scale_factors: false + emission_perturbation_factor: 1.0 + OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] + use_emission_scale_factor: false + use_OH_scale_factors: false #============================================================================ # Options for CO @@ -115,3 +116,23 @@ CO2_simulation_options: tag_land_fossil_fuel_CO2: tag_global_ship_CO2: false tag_global_aircraft_CO2: false + +#============================================================================ +# Settings for diagnostics (other than HISTORY and HEMCO) +#============================================================================ +extra_diagnostics: + + obspack: + activate: false + quiet_logfile_output: false + input_file: ./obspack_co2_1_OCO2MIP_2018-11-28.YYYYMMDD.nc + output_file: ./OutputDir/GEOSChem.ObsPack.YYYYMMDD_hhmmz.nc4 + output_species: + - CH4 + - CO + - CO2 + + planeflight: + activate: false + flight_track_file: Planeflight.dat.YYYYMMDD + output_file: plane.log.YYYYMMDD \ No newline at end of file diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 index 91753a733..d0c306cea 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 @@ -1,9 +1,6 @@ --- ### geoschem_config.yml: GEOS-Chem Runtime configuration options. ### Customized for simulations using the tagged CH4 mechanism. -### -### NOTE: Add quotes around nitrogen oxide ('NO'), because YAML -### parsers will confuse this with a negative "no" value. #============================================================================ # Simulation settings @@ -83,7 +80,7 @@ operations: - CH4_RES #============================================================================ -# Settings specific to the CH4 simulation / Integrated Methane Inversion +# Options for CH4 #============================================================================ CH4_simulation_options: @@ -94,13 +91,14 @@ CH4_simulation_options: analytical_inversion: activate: false - emission_perturbation: 1.0 state_vector_element_number: 0 - use_emission_scale_factor: false - use_OH_scale_factors: false + emission_perturbation_factor: 1.0 + OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] - + use_emission_scale_factor: false + use_OH_scale_factors: false + #============================================================================ # Settings for diagnostics (other than HISTORY and HEMCO) #============================================================================ diff --git a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon index 19e1aa9b3..f19df07c6 100644 --- a/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon +++ b/run/GCHP/geoschem_config.yml.templates/geoschem_config.yml.carbon @@ -48,8 +48,11 @@ CH4_simulation_options: analytical_inversion: activate: false - emission_perturbation: 1.0 state_vector_element_number: 0 + emission_perturbation_factor: 1.0 + OH_perturbation_factor: 1.0 + perturb_CH4_boundary_conditions: false + CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] use_emission_scale_factor: false use_OH_scale_factors: false @@ -101,57 +104,4 @@ extra_diagnostics: planeflight: activate: false flight_track_file: Planeflight.dat.YYYYMMDD - output_file: plane.log.YYYYMMDD - - legacy_bpch: # 1 2 3 - output_menu: # 1234567890123456789012345678901 - schedule_output_for_JAN: 3000000000000000000000000000000 - schedule_output_for_FEB: 30000000000000000000000000000 - schedule_output_for_MAR: 3000000000000000000000000000000 - schedule_output_for_APR: 300000000000000000000000000000 - schedule_output_for_MAY: 3000000000000000000000000000000 - schedule_output_for_JUN: 300000000000000000000000000000 - schedule_output_for_JUL: 3000000000000000000000000000000 - schedule_output_for_AUG: 3000000000000000000000000000000 - schedule_output_for_SEP: 300000000000000000000000000000 - schedule_output_for_OCT: 3000000000000000000000000000000 - schedule_output_for_NOV: 300000000000000000000000000000 - schedule_output_for_DEC: 3000000000000000000000000000000 - - gamap: - diaginfo_dat_file: ./diaginfo.dat - tracerinfo_dat_file: ./tracerinfo.dat - - bpch_diagnostics: - TOMAS_aerosol_emissions: "0 all" - TOMAS_rate: "0 all" - TOMAS_3D_rate: "0 all" - ND65_prodloss: - activate: true - number_of_levels: 72 - - ND51_satellite: - activate: false - output_file: ts_satellite.YYYYMMDD.bpch - tracers: - - 1 - - 2 - - 501 - UTC_hour_for_write: 0 - averaging_period_in_LT: [9, 11] - IMIN_and_IMAX_of_region: [1, 72] - JMIN_and_JMAX_of_region: [1, 46] - LMIN_and_LMAX_of_region: [1, 1] - - ND51b_satellite: - activate: false - output_file: ts_13_15_NA..YYYYMMDD.bpch - tracers: - - 1 - - 2 - - 501 - UTC_hour_for_write: 1 - averaging_period_in_LT: [13, 15] - IMIN_and_IMAX_of_region: [1, 72] - JMIN_and_JMAX_of_region: [1, 46] - LMIN_and_LMAX_of_region: [1, 1] + output_file: plane.log.YYYYMMDD \ No newline at end of file From 371dcda9859a8b081dee795577634d4bc077b16c Mon Sep 17 00:00:00 2001 From: Melissa Sulprizio Date: Wed, 4 Oct 2023 14:16:38 -0400 Subject: [PATCH 2/3] Now specify and apply OH perturbation via HEMCO_Config.rc Previously, we specified OH perturbation scale factor in geoschem_config.rc and applied the perturbation in global_ch4_mod.F90. This is now more easily done in HEMCO_Config.rc. The default is to use 1.0 (i.e. no scaling) for `OH_pert_factor`, which is applied to the GLOBAL_OH field read into HEMCO. Signed-off-by: Melissa Sulprizio --- CHANGELOG.md | 2 +- GeosCore/global_ch4_mod.F90 | 5 ----- GeosCore/input_mod.F90 | 14 -------------- Headers/input_opt_mod.F90 | 2 -- .../HEMCO_Config.rc.templates/HEMCO_Config.rc.CH4 | 10 +++++++++- .../HEMCO_Config.rc.carbon | 10 +++++++++- .../HEMCO_Config.rc.tagCH4 | 10 +++++++++- .../geoschem_config.yml.CH4 | 1 - .../geoschem_config.yml.carbon | 1 - .../geoschem_config.yml.tagCH4 | 1 - 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 601a23bb1..ebb69260b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Added warning in GCHP HISTORY.rc about outputting area-dependent variables on custom grids - Added option to use a single advected species in the carbon simulation - Added option to perturb CH4 boundary conditions in CH4 simulation -- Added option to perturb OH in CH4 simulation +- Added option to perturb OH in CH4 simulation using scale factor in HEMCO_Config.rc ### Changed - Update `DiagnFreq` in GCClassic integration tests to ensure HEMCO diagnostic output diff --git a/GeosCore/global_ch4_mod.F90 b/GeosCore/global_ch4_mod.F90 index d011e21a7..cca63ea6d 100644 --- a/GeosCore/global_ch4_mod.F90 +++ b/GeosCore/global_ch4_mod.F90 @@ -933,11 +933,6 @@ SUBROUTINE CH4_DECAY( Input_Opt, State_Chm, State_Diag, & ! BOH from HEMCO in units of kg/m3, convert to molec/cm3 C_OH = State_Chm%BOH(I,J,L) * XNUMOL_OH / CM3PERM3 - ! Apply OH perturbation factor for inversions - IF ( Input_Opt%OHPerturbFactor /= 1.0 ) THEN - C_OH = C_OH * Input_Opt%OHPerturbFactor - ENDIF - ! Apply OH scale factors from a previous inversion IF ( Input_Opt%UseOHSF ) THEN C_OH = C_OH * OH_SF(I,J) diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 8623486eb..0df147e4f 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -4928,19 +4928,6 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) ENDIF Input_Opt%EmisPerturbFactor = Cast_and_RoundOff( v_str, places=4 ) - !------------------------------------------------------------------------ - ! OH perturbation factor - !------------------------------------------------------------------------ - key = "CH4_simulation_options%analytical_inversion%OH_perturbation_factor" - v_str = MISSING_STR - CALL QFYAML_Add_Get( Config, TRIM( key ), v_str, "", RC ) - IF ( RC /= GC_SUCCESS ) THEN - errMsg = 'Error parsing ' // TRIM( key ) // '!' - CALL GC_Error( errMsg, RC, thisLoc ) - RETURN - ENDIF - Input_Opt%OHPerturbFactor = Cast_and_RoundOff( v_str, places=4 ) - !------------------------------------------------------------------------ ! Perturb CH4 boundary conditions? !------------------------------------------------------------------------ @@ -5009,7 +4996,6 @@ SUBROUTINE Config_CH4( Config, Input_Opt, RC ) WRITE(6,100) 'Do analytical inversion? : ', Input_Opt%DoAnalyticalInv WRITE(6,120) 'Current state vector elem: ', Input_Opt%StateVectorElement WRITE(6,110) 'Emiss perturbation factor: ', Input_Opt%EmisPerturbFactor - WRITE(6,110) 'OH perturbation factor: ', Input_Opt%OHPerturbFactor WRITE(6,100) 'Perturb CH4 BCs? : ', Input_Opt%DoPerturbCH4BoundaryConditions WRITE(6,130) 'CH4 BC ppb increase NSEW : ', Input_Opt%CH4BoundaryConditionIncreaseNorth,& Input_Opt%CH4BoundaryConditionIncreaseSouth,& diff --git a/Headers/input_opt_mod.F90 b/Headers/input_opt_mod.F90 index 64d9816ef..ac8c9e1c9 100644 --- a/Headers/input_opt_mod.F90 +++ b/Headers/input_opt_mod.F90 @@ -368,7 +368,6 @@ MODULE Input_Opt_Mod LOGICAL :: DoAnalyticalInv INTEGER :: StateVectorElement REAL(fp) :: EmisPerturbFactor - REAL(fp) :: OHPerturbFactor LOGICAL :: DoPerturbCH4BoundaryConditions REAL(fp) :: CH4BoundaryConditionIncreaseNorth REAL(fp) :: CH4BoundaryConditionIncreaseSouth @@ -910,7 +909,6 @@ SUBROUTINE Set_Input_Opt( am_I_Root, Input_Opt, RC ) Input_Opt%DoAnalyticalInv = .FALSE. Input_Opt%StateVectorElement = 0 Input_Opt%EmisPerturbFactor = 1.0 - Input_Opt%OHPerturbFactor = 1.0 Input_Opt%DoPerturbCH4BoundaryConditions = .FALSE. Input_Opt%CH4BoundaryConditionIncreaseNorth = 0.0_fp Input_Opt%CH4BoundaryConditionIncreaseSouth = 0.0_fp diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.CH4 b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.CH4 index 887358993..a76769f18 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.CH4 +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.CH4 @@ -656,7 +656,7 @@ ${RUNDIR_CH4_LOSS} # --- Global OH from GEOS-Chem v5-07 [kg/m3] --- (((GLOBAL_OH -* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 +* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 2 1 1 )))GLOBAL_OH # --- Global Cl [mol/mol dry air] --- @@ -884,6 +884,14 @@ ${RUNDIR_GLOBAL_Cl} #============================================================================== 1 NEGATIVE -1.0 - - - xy 1 1 +#============================================================================== +# --- Perturbation factors --- +# +# Add factors to perturb OH, emissions, and other fields here for +# analytical inversions. +#============================================================================== +2 OH_pert_factor 1.0 - - - xy 1 1 + #============================================================================== # --- Seasonal scaling factors ---- #============================================================================== diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index 75842702d..7645a6d66 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -1296,7 +1296,7 @@ Mask fractions: false #------------------------------------------------------------------------------ # --- OH from GEOS-Chem v5-07 [kg/m3], needed for CH4/IMI --- (((GLOBAL_OH_GCv5 -* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 +* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 3 1 1 )))GLOBAL_OH_GCv5 # --- OH from the last 10-yr benchmark [mol/mol dry air] --- @@ -1376,6 +1376,14 @@ ${RUNDIR_CO2_COPROD} #============================================================================== 1 NEGATIVE -1.0 - - - xy 1 1 +#============================================================================== +# --- Perturbation factors --- +# +# Add factors to perturb OH, emissions, and other fields here for +# analytical inversions. +#============================================================================== +2 OH_pert_factor 1.0 - - - xy 1 1 + #============================================================================== # --- Seasonal scaling factors ---- #============================================================================== diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 index bbab3dc1a..0a85ade96 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 @@ -718,7 +718,7 @@ ${RUNDIR_CH4_LOSS} # --- Global OH from GEOS-Chem v5-07 [kg/m3] --- (((GLOBAL_OH -* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 +* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 3 1 1 )))GLOBAL_OH # --- Global Cl [mol/mol dry air] --- @@ -946,6 +946,14 @@ ${RUNDIR_GLOBAL_Cl} #============================================================================== 1 NEGATIVE -1.0 - - - xy 1 1 +#============================================================================== +# --- Perturbation factors --- +# +# Add factors to perturb OH, emissions, and other fields here for +# analytical inversions. +#============================================================================== +2 OH_pert_factor 1.0 - - - xy 1 1 + #============================================================================== # --- Seasonal scaling factors ---- #============================================================================== diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 index 1284940df..1c04432fa 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CH4 @@ -78,7 +78,6 @@ CH4_simulation_options: activate: false state_vector_element_number: 0 emission_perturbation_factor: 1.0 - OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] use_emission_scale_factor: false diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon index 1e86fe98a..36f5499cd 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon @@ -81,7 +81,6 @@ CH4_simulation_options: activate: false state_vector_element_number: 0 emission_perturbation_factor: 1.0 - OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] use_emission_scale_factor: false diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 index d0c306cea..68a3623eb 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCH4 @@ -93,7 +93,6 @@ CH4_simulation_options: activate: false state_vector_element_number: 0 emission_perturbation_factor: 1.0 - OH_perturbation_factor: 1.0 perturb_CH4_boundary_conditions: false CH4_boundary_condition_ppb_increase_NSEW: [0.0, 0.0, 0.0, 0.0] use_emission_scale_factor: false From 3af9d3bbd42c681e2d607f42240e65df1b42c7a1 Mon Sep 17 00:00:00 2001 From: Melissa Sulprizio Date: Fri, 6 Oct 2023 07:59:18 -0400 Subject: [PATCH 3/3] Fix typos in HEMCO_Config.rc for carbon and tagCH4 simulations The scale factor for perturbing GLOBAL_OH should be 2, not 3, since this corresponds to the OH_perf_factor scale factor ID. The GCHP HEMCO_Config.rc.carbon file has also been updated here for consistency with the GCClassic version. Signed-off-by: Melissa Sulprizio --- .../HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon | 2 +- .../HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 | 2 +- .../HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index 7645a6d66..62c8bb45f 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -1296,7 +1296,7 @@ Mask fractions: false #------------------------------------------------------------------------------ # --- OH from GEOS-Chem v5-07 [kg/m3], needed for CH4/IMI --- (((GLOBAL_OH_GCv5 -* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 3 1 1 +* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 2 1 1 )))GLOBAL_OH_GCv5 # --- OH from the last 10-yr benchmark [mol/mol dry air] --- diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 index 0a85ade96..8611fa776 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.tagCH4 @@ -718,7 +718,7 @@ ${RUNDIR_CH4_LOSS} # --- Global OH from GEOS-Chem v5-07 [kg/m3] --- (((GLOBAL_OH -* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 3 1 1 +* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 2 1 1 )))GLOBAL_OH # --- Global Cl [mol/mol dry air] --- diff --git a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index 5f343eec9..7d6491f6d 100644 --- a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -1296,7 +1296,7 @@ Mask fractions: false #------------------------------------------------------------------------------ # --- OH from GEOS-Chem v5-07 [kg/m3], needed for CH4/IMI --- (((GLOBAL_OH_GCv5 -* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 +* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * 2 1 1 )))GLOBAL_OH_GCv5 # --- OH from the last 10-yr benchmark [mol/mol dry air] --- @@ -1321,7 +1321,6 @@ ${RUNDIR_GLOBAL_Cl} #------------------------------------------------------------------------------ # --- Quantities needed for CO chemistry --- #------------------------------------------------------------------------------ -(((USE_CO_DATA # -- P(CO) from CH4 and NMVOC from the last 10-yr benchmark [molec/cm3/s] --- (((PROD_CO_CH4 @@ -1377,6 +1376,14 @@ ${RUNDIR_CO2_COPROD} #============================================================================== 1 NEGATIVE -1.0 - - - xy 1 1 +#============================================================================== +# --- Perturbation factors --- +# +# Add factors to perturb OH, emissions, and other fields here for +# analytical inversions. +#============================================================================== +2 OH_pert_factor 1.0 - - - xy 1 1 + #============================================================================== # --- Seasonal scaling factors ---- #==============================================================================