|
|
Line 1: |
Line 1: |
− | = Directories and input/output files =
| |
− |
| |
− | == Directory structure ==
| |
− |
| |
− | [sec:dir] The adjoint code package ''gcadj_std'' contains the following directories:
| |
− |
| |
− | l p8cml
| |
− |
| |
− | ''code/'' &Code directory, which contains all unmodified GEOS-Chem files, a Makefile and a few subdirectories relevant to the adjoint code, listed below. This is also where all the object files are placed.<br />
| |
− | ''code/modified/'' &Subdirectory that contains all (forward) GEOS-Chem files that have been modified for the adjoint.<br />
| |
− | ''code/adjoint/'' &Subdirectory that contains all adjoint specific files.<br />
| |
− | ''code/obs_operators/'' &Subdirectory contains all files relevant to observation operators.<br />
| |
− | ''code/new/'' & Subdirectory contains all new files (new to forward AND adjoint).<br />
| |
− | ''runs/'' & Run directory with subdirectories for each met field type.<br />
| |
− | ''runs/v8-02-1/geos*/'' & Run directories with subdirectories for output files.<br />
| |
− |
| |
− |
| |
− | ''runs/../geos*/adjtmp/'' & Adjoint temporary file directory (''gctm.chk.*; gctm.obs.*; gctm.adj.*'' ), the name can be changed in ''input.gcadj''.<br />
| |
− | ''runs/../geos*/tmp/'' & Forward model temporary file directory (unzipped met fields).<br />
| |
− | ''runs/../geos*/OptData/'' & Results from each iteration (''gctm.gdt.*; cfn.*; gctm.sf.*, fwd_dat.*.tar; gctm.arr''), the name can be changed in ''input.gcadj''.<br />
| |
− | ''runs/../geos*/diagadj/'' & Adjoint diagnostic files (''*.fd.*;*.fdglob.*; aero.ave.*; satave.*; jsave.*; gctm.iteration, emis.adj.*''), the name can be changed in ''input.gcadj''.<br />
| |
− |
| |
− |
| |
− | == Input files ==
| |
− |
| |
− | === ''input.gcadj'': the main adjoint input file ===
| |
− |
| |
− | ''input.gcadj'' file contains the following options:
| |
− |
| |
− | <pre>01: %%% ADJOINT SIMULATION MENU %%%
| |
− | 02: Do adjoint run LADJ : T
| |
− | 03: Selecet one simulation type :---
| |
− | 04: Invese problem L4DVAR : T
| |
− | 05: Kalman filter L3DVAR : F
| |
− | 06: Sensitivity LSENS : F
| |
− | 07: => spot finite diff FD_SPOT : F
| |
− | 08: => global finite diff FD_GLOB : F</pre>
| |
− | ''Description''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: ''LADJ'' & Global switch for adjoint option. If set to FALSE, it will overwrite all other options and make the run a forward mode only run.<br />
| |
− | 03: line& If LADJ = T, need to pick one of the following options. 3DVAR not yet supported.<br />
| |
− | 04: ''L4DVAR'' & Switch for 4d-var runs.<br />
| |
− | 05: ''L3DVAR'' & Switch for Kalman filter.<br />
| |
− | 06: ''LSENS'' & Switch for sensitivity runs. If performing a finite difference test, pick one option from below:<br />
| |
− | 07: ''FD_SPOT'' & Switch for spot finite difference test.<br />
| |
− | 08: ''FD_GLOB'' & Switc for global finite difference test).<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% FORWARD MODEL OPTIONS %%%
| |
− | 02: adjoint chemistry LADJ_CHEM : T
| |
− | 03: aerosol thermo LAERO_THEM : T</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: ''LADJ_CHEM'' & Switch for adjoint chemistry option. If set to FALSE, it will turn off adjoint chemistry. Make sure that LCHEM is set to the same value.<br />
| |
− | 03: ''LAERO_THEM'' & Switch for aerosol thermodynamics option (applies to forward and adjoint).<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% ADJOINT MODEL OPTIONS %%%
| |
− | 02: Include a priori term APSRC : F
| |
− | 03: compute bkgrnd error cov : F
| |
− | 04: Compute DFP inverse Hessian : F
| |
− | 05: Compute BFGS inverse Hessian : F
| |
− | 06: Include rxn rate sensitivities : F
| |
− | 07: Delete chk files LDEL_CHKPT : T
| |
− | 08: Scale up and FILL adj transport: F</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: ''APSRC'' & Switch for calculating the a priori term in the cost function. Valid option for 4d-var runs.<br />
| |
− | 03: ''COV'' & Switch for computing the full error covariance matrices (not yet implemented).<br />
| |
− | 04: ''LINVH'' & Switch for computing an approximate inverse Hessian matrix using the DFP method.<br />
| |
− | 04: ''LBFGS'' & Switch for computing an approximate inverse Hessian matrix using the L-BFGS method.<br />
| |
− | 06: Rxn sensitivities & Switch for storing sensitivities wrt reaction rates.<br />
| |
− | 07: LDEL_CHKPT & Delete checkpoint files after they are used in adj run. Set to F to reuse them for multiple adj runs.<br />
| |
− | 08: LFILL_ADJ & Scale up adjoints and then use the LFILL option in tpcore for advection.<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% DIRECTORIES %%%
| |
− | 02: Optimization output : OptData/
| |
− | 03: Temporary adjoint dir adjtmp : adjtmp/
| |
− | 04: Diagnostics ouptut : diagadj/</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: OptData. & Specify output directory where essential output will go, typically set to OptData.<br />
| |
− | 03: adjtmp. & Specify output directory where nonessential output will go, typically set to adjtmp.<br />
| |
− | 04: diagadj & Specify output directory where diagnostic output will go, typically set to diagadj.<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% CONTROL VARIABLE MENU %%%
| |
− | 02: Initial conditions LICS : F
| |
− | 03: ... OR emissions LADJ_EMS : T
| |
− | 04: => strat prod/loss LADJ_STRAT : T
| |
− | 05: >------------------------------<
| |
− | 06: FOR LICS :
| |
− | 07: NSOPT: number of tracers opt : 1
| |
− | 08: => opt these tracers------> : TRC# trc_name SF_DEFAULT REG_PARAM ERROR
| |
− | 09: Tracer #1 : 1 NOx 1 1 1
| |
− | 10: >------------------------------<
| |
− | 11: FOR LADJ_EMS :
| |
− | 12: NNEMS: ems groups implemented : 33
| |
− | 13: Emission entries ------------> : EMS# ems_name opt SF_DEFAULT REG_PARAM ERROR
| |
− | 14: Emission #1 : 1 IDADJ_ENH3_an T 1 1 1
| |
− | 15: Emission #2 : 2 IDADJ_ENH3_na T 1 1 1
| |
− | 16: Emission #3 : 3 IDADJ_ENH3_bb T 1 1 1
| |
− | 17: Emission #4 : 4 IDADJ_ENH3_bf T 1 1 1
| |
− | 18: Emission #5 : 5 IDADJ_ESO2_an1 T 1 1 1
| |
− | 19: Emission #6 : 6 IDADJ_ESO2_an2 T 1 1 1
| |
− | 20: Emission #7 : 7 IDADJ_ESO2_bf T 1 1 1
| |
− | 21: Emission #8 : 8 IDADJ_ESO2_bb T 1 1 1
| |
− | 22: Emission #9 : 9 IDADJ_ESO2_sh T 1 1 1
| |
− | 23: Emission #10 : 10 IDADJ_EBCPI_an T 1 1 1
| |
− | 24: Emission #11 : 11 IDADJ_EBCPO_an T 1 1 1
| |
− | 25: Emission #12 : 12 IDADJ_EOCPI_an T 1 1 1
| |
− | 26: Emission #13 : 13 IDADJ_EOCPO_an T 1 1 1
| |
− | 27: Emission #14 : 14 IDADJ_EBCPI_bf T 1 1 1
| |
− | 28: Emission #15 : 15 IDADJ_EBCPO_bf T 1 1 1
| |
− | 29: Emission #16 : 16 IDADJ_EOCPI_bf T 1 1 1
| |
− | 30: Emission #17 : 17 IDADJ_EOCPO_bf T 1 1 1
| |
− | 31: Emission #18 : 18 IDADJ_EBCPI_bb T 1 1 1
| |
− | 32: Emission #19 : 19 IDADJ_EBCPO_bb T 1 1 1
| |
− | 33: Emission #20 : 20 IDADJ_EOCPI_bb T 1 1 1
| |
− | 34: Emission #21 : 21 IDADJ_EOCPO_bb T 1 1 1
| |
− | 35: Emission #22 : 22 IDADJ_ENOX_so F 1 1 1
| |
− | 36: Emission #23 : 23 IDADJ_ENOX_li F 1 1 1
| |
− | 37: Emission #24 : 24 IDADJ_ENOX_ac F 1 1 1
| |
− | 38: Emission #25 : 25 IDADJ_ENOX_an F 1 1 1
| |
− | 39: Emission #26 : 26 IDADJ_ENOX_bf F 1 1 1
| |
− | 40: Emission #27 : 27 IDADJ_ENOX_bb F 1 1 1
| |
− | 41: Emission #28 : 28 IDADJ_ECO_an F 1 1 1
| |
− | 42: Emission #29 : 29 IDADJ_ECO_bf F 1 1 1
| |
− | 43: Emission #30 : 30 IDADJ_ECO_bb F 1 1 1
| |
− | 44: Emission #31 : 31 IDADJ_EISOP_an F 1 1 1
| |
− | 45: Emission #32 : 32 IDADJ_EISOP_bf F 1 1 1
| |
− | 46: Emission #33 : 33 IDADJ_EISOP_bb F 1 1 1
| |
− | 47: Number emis time group MMSCL : 1
| |
− | 48: >------------------------------<
| |
− | 49: FOR LADJ_STRAT :
| |
− | 50: NSTPL: strat prod & loss trcs : 24
| |
− | 51: Strat prod & loss trc entries : ID# trc_name opt SF_DEFALUT REG_PARAM ERROR
| |
− | 52: Tracer #1 : 1 NOx_p T 1 1 1
| |
− | 53: Tracer #2 : 2 Ox_p T 1 1 1
| |
− | 54: Tracer #3 : 3 PAN_p T 1 1 1
| |
− | 55: Tracer #4 : 4 CO_p T 1 1 1
| |
− | 56: Tracer #5 : 5 ALK4_p T 1 1 1
| |
− | 57: Tracer #6 : 6 ISOP_p T 1 1 1
| |
− | 58: Tracer #7 : 7 HNO3_p T 1 1 1
| |
− | 59: Tracer #8 : 8 H2O2_p T 1 1 1
| |
− | 60: Tracer #9 : 9 ACET_p T 1 1 1
| |
− | 61: Tracer #10 : 10 MEK_p T 1 1 1
| |
− | 62: Tracer #11 : 11 ALD2_p T 1 1 1
| |
− | 63: Tracer #12 : 12 RCHO_p T 1 1 1
| |
− | 64: Tracer #13 : 13 MVK_p T 1 1 1
| |
− | 65: Tracer #14 : 14 MACR_p T 1 1 1
| |
− | 66: Tracer #15 : 15 PMN_p T 1 1 1
| |
− | 67: Tracer #16 : 16 PPN_p T 1 1 1
| |
− | 68: Tracer #17 : 17 R4N2_p T 1 1 1
| |
− | 69: Tracer #18 : 18 PRPE_p T 1 1 1
| |
− | 70: Tracer #19 : 19 C3H8_p T 1 1 1
| |
− | 71: Tracer #20 : 20 CH2O_p T 1 1 1
| |
− | 72: Tracer #21 : 21 C2H6_p T 1 1 1
| |
− | 73: Tracer #22 : 22 N2O5_p T 1 1 1
| |
− | 74: Tracer #23 : 23 HNO4_p T 1 1 1
| |
− | 75: Tracer #24 : 24 MP_p T 1 1 1
| |
− | 76: Tracer #1 : 1 NOx_l T 1 1 1
| |
− | 77: Tracer #2 : 2 Ox_l T 1 1 1
| |
− | 78: Tracer #3 : 3 PAN_l T 1 1 1
| |
− | 79: Tracer #4 : 4 CO_l T 1 1 1
| |
− | 80: Tracer #5 : 5 ALK4_l T 1 1 1
| |
− | 81: Tracer #6 : 6 ISOP_l T 1 1 1
| |
− | 82: Tracer #7 : 7 HNO3_l T 1 1 1
| |
− | 83: Tracer #8 : 8 H2O2_l T 1 1 1
| |
− | 84: Tracer #9 : 9 ACET_l T 1 1 1
| |
− | 85: Tracer #10 : 10 MEK_l T 1 1 1
| |
− | 86: Tracer #11 : 11 ALD2_l T 1 1 1
| |
− | 87: Tracer #12 : 12 RCHO_l T 1 1 1
| |
− | 88: Tracer #13 : 13 MVK_l T 1 1 1
| |
− | 89: Tracer #14 : 14 MACR_l T 1 1 1
| |
− | 90: Tracer #15 : 15 PMN_l T 1 1 1
| |
− | 91: Tracer #16 : 16 PPN_l T 1 1 1
| |
− | 92: Tracer #17 : 17 R4N2_l T 1 1 1
| |
− | 93: Tracer #18 : 18 PRPE_l T 1 1 1
| |
− | 94: Tracer #19 : 19 C3H8_l T 1 1 1
| |
− | 95: Tracer #20 : 20 CH2O_l T 1 1 1
| |
− | 96: Tracer #21 : 21 C2H6_l T 1 1 1
| |
− | 97: Tracer #22 : 22 N2O5_l T 1 1 1
| |
− | 98: Tracer #23 : 23 HNO4_l T 1 1 1
| |
− | 99: Tracer #24 : 24 MP_l T 1 1 1</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & Need to pick one of the three possible sets of control parameters: initial conditions, emissions, or stratospheric production and loss rates. Emissions must be turned on to select stratospheric fluxes.<br />
| |
− | 02: LICS & Tracer initial conditions as control parameters.<br />
| |
− | 03: LADJ_EMS & Emissions as control parameters.<br />
| |
− | 04: LADJ_STRAT & Stratospheric production and loss rates as control parameters.<br />
| |
− | 05: spacer line & -<br />
| |
− | 06: FOR LICS & Specify which tracers to allow as control parameters. Note: the range of possible tracers is defined in input.geos. The adjoint will always include adjoints of all tracers. So here we just need to list which of these tracers will be optimized. All and only those tracers listed below will be optimized. This LICS section of the MENU will be ignored if LADJ_EMS = T.<br />
| |
− | 07: NSOPT & Total number of tracers to optimize listed in the submenu below.<br />
| |
− | 08: subheader & -<br />
| |
− | 09: Tracers #1 & List the corresponding tracer number (TRC#) and name (trc_name) from input.goes. Here you can also specify a global default scaling factor (SF_DEFAULT) for the first iteration, a regularization parameter (REG_PARAM) and an error (ERROR). The latter two only have an effect if LAPSRC = T.<br />
| |
− | …& add more lines like 08 if you want to make the initial conditions for more than one tracer active. …<br />
| |
− | 10: spacer line & -<br />
| |
− | 11: FOR LADJ_EMS & Specify all of the emissions adjoints that are currently implemented. This LADJ_EMS section of the menu will be ingnored if LICS = T.<br />
| |
− | 12: NNEMS & Total number of active emissions groups listed in the submenu below.<br />
| |
− | 13: subheader & -<br />
| |
− | 14: Emission #1 & List the emission number (EMS#) and name (ems_name). Names must begin with IDADJ_E…. Select wether this emissions group is to be optimized (opt). Here you can also specify a global default scaling factor (SF_DEFAULT) for the first iteration, a regularization parameter (REG_PARAM), and an error. The latter two only have an impact of APSRC = T.<br />
| |
− | 15…46 & additional emission group definitions and options.<br />
| |
− | 47: MMSCL & Number of emissions sub-scaling groups. MMSCL <math>></math> 1 not yet supported.<br />
| |
− | 48: spacer line & -<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 49: FOR LADJ_STRAT & Specify all of the stratospheric production and loss rate adjoints that are currently implemented. This LADJ_STRAT section of the menu will be only considered if both LADJ_EMS = T and LADJ_STRAT = T.<br />
| |
− | 50: NSTPL & Total number of active stratospheric tracers that have production and loss rates listed in the menu below. NOTE: each tracer has production and loss rates.<br />
| |
− | 51: subheader & -<br />
| |
− | 52: Tracer #1 & List the corresponding tracer number (ID#) and name (trc_name). Names must end with …_p (production) or…_l (loss). Select whether this stratospheric flux is to be optimized (opt), although optimization of the stratospheric fluxes has yet to be fully tested. Here you can also specify a global default scaling factor (SF_DEFAULT) for the first iteration, a regularization parameter (REG_PARAM), and an error. For now, only SF_DEFAULT is supported.<br />
| |
− | 53…99 & additional stratospheric flux definitions and options.<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% OBSERVATION MENU %%%
| |
− | 02: %%% for PSUEDO_OBS %%%
| |
− | 03: %%% or LSENSE %%%
| |
− | 04: Observation frequency OBS_FREQ : 60
| |
− | 05: Limit number of observations? : F
| |
− | 06: => max number of obs NSPAN : 1
| |
− | 07: COST FUNCTION options for LSENS:---
| |
− | 08: => tracer kg/box : T
| |
− | 09: => tracer ug/m3 : F
| |
− | 10: => tracer ppb : F
| |
− | 11: => tracer ppm free trop : F
| |
− | 12: => species ppb w/averaging : F
| |
− | 13: => tracer ug/m3 pop weight : F
| |
− | 14: >------------------------------<
| |
− | 15: NOBS: number of tracers to obs : 2
| |
− | 16: => obs these tracers------> : TRC# tracer_name
| |
− | 17: Tracer #1 : 34 BCPI
| |
− | 18: Tracer #2 : 35 OCPI
| |
− | 19: >------------------------------<
| |
− | 20: NOBS_CSPEC: # of species to obs: 0
| |
− | 21: => obs these species------> :species_name
| |
− | 22: Species #1 : O3</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & The options pretty much pertain only to sensitivity calculations or pseudo observation tests.<br />
| |
− | 02: header line & The only exception to that is if you have an observation operator specific to a chemical species.<br />
| |
− | 03: header line & which is not a tracer (e.g., O<math>_3</math>), in which case you need to specify it in the observed species submenu.<br />
| |
− | 04: ''OBS_FREQ'' & Frequency (in min) of checking and assimilating observations, both pseudo and real, typically 60.<br />
| |
− | 05 LMAX_OBS: & Set this if you wish to limit the number of observations. For example, if you want the cost function to be evaluated only during the final day of your simulation, and OBS_FREQ = 60, then set LMAX_OBS = T and NSPAN = 24. Setting FD_GLOB will trigger LMAX_OBS = T and NSPAN = 1.<br />
| |
− | 06: NSPAN & If LMAX_OBS = T, then use this to set the number of times the cost function is evaluated. Setting FD_GLOB will trigger LMAX_OBS = T and NSPAN = 1.<br />
| |
− | 07: subheader & Below are some options for evaluating the cost function during a sensitivity run. Note the distinction between tracers (STT) and species (CSPEC). Some of these options include the WEIGHT array, which allows for spatial masking. Check the respective code segments for details.<br />
| |
− | 08: LKGBOX & Evaluate the cost function for tracer concentrations in units of kg/box. Note: FD simulations will default to this option.<br />
| |
− | 09: LUGM3 & Evaluate the cost function for tracer concentrations in units of ug/m3.<br />
| |
− | 10: LSTT_PPB & Evaluate the cost function for tracer concentrations in units of ppb.<br />
| |
− | 11: LSTT_TROP_PPM & Evaluate the cost function for tracer concentrations only in the free troposphere in units of ppm.<br />
| |
− | 12: LCSPEC_PPB & Evaluate the cost function for species concentrations in units of ppb, averaged over the range NSPAN. There are also hardwired options within CALC_ADJ_FORCE_FOR_SENS that can be used to specify a sub-domain over which to average: LMIN, LMAX, JMIN, JMAX, IMIN, IMAX.<br />
| |
− | 13: LPOP_UGM3 & Domain-wide average population weighted aerosol concentrations<br />
| |
− | 14: spacer line & This next section is only important if you are using a cost function that involves tracers (STT).<br />
| |
− | 15: NOBS & The number of tracers involved in your cost function. It must match the number of tracers listed below, or if it is zero the section below will be ignored.<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 16: subheader & -<br />
| |
− | 17: Tracer #1 & List the ID number of the tracer from input.geos (TRC#) and its name (tracer_name). Make as many entries in this section as necessary.<br />
| |
− | 18- …: & …<br />
| |
− | 19: spacer & -<br />
| |
− | 20: NOBS_CSPEC & The number of species involved in your cost function. It must match the number of species listed below, or if it is zero the section below will be ignored.<br />
| |
− | 21: subheader & -<br />
| |
− | 22: Species #1 & Enter the names of the species to be observed (species_name) They don’t need to be ordered or numbered according to their definition in CSPEC, just make sure that the name is exactly as it is listed in globchem.dat so that the code can match the name and find the corresponding an ID index in CSPEC. Make as many entries in this section as necessary.<br />
| |
− | 23-…: & …<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% FINITE DIFFERENCE MENU %%%
| |
− | 02: fd perturbation FD_DIFF : 0.1
| |
− | 03: Numerator of derivative to test:---
| |
− | 04: => longitude degree LONFD : 32
| |
− | 05: => latitude degree LATFD : 21
| |
− | 06: => OR pick box by grid index? : T
| |
− | 07: => longidute index IFD : 21
| |
− | 08: => latitude index JFD : 31
| |
− | 09: => altidude index LFD : 1
| |
− | 10: => tracer (STT TRC#) NFD : 2
| |
− | 11: Denomenator of deriv. to test:
| |
− | 12: => w/LEMS: emis group MFD : 1
| |
− | 13: => w/LEMS: sector EMSFD : 9
| |
− | 14: => w/LICS: tracer ICSFD : 1
| |
− | 15: => w/LSTR: tracer STRFD : 1</pre>
| |
− | ''Description'' Selections in this menu will apply if we are performing a finite difference test, i.e. LSENS = T and either FD_GLOB or FD_SPOT = T in the ADJOINT SIMULATION MENU.
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: ''FD_DIFF'' & The size of the finite difference perturbation that is applied to the control parameters (LICS or LADJ_EMS), depending on which ones are selected for the finite difference test.<br />
| |
− | 03: spacer line & The numerator of the derivative to test is selected in the following submenu. Note: for debugging, it can be useful to point these indices to troublesome values and then turn on LPRINTFD in the DIAGNOSTICS MENU.<br />
| |
− | 04: ''LONFD'' & Longitude of the gridbox in the SPOT finite difference test and debugging (converted to index online).<br />
| |
− | 05: ''LATFD'' & Latitude of the gridbox in the SPOT finite difference test and debugging (converted to index online).<br />
| |
− | 06: specify box & This flag, if set to TRUE, will set the finite difference box as specified by the gridbox indecies, and not lat/lon indecies.<br />
| |
− | 07: ''IFD'' & Longitude index of the gridbox in the SPOT finite difference test and debugging.<br />
| |
− | 08: ''JFD'' & Latitude index of the gridbox in the SPOT finite difference test and debugging.<br />
| |
− | 09: ''LFD'' & Vertical level index of the gridbox in the SPOT and GLOB finite difference test and debugging.<br />
| |
− | 10: ''NFD'' & Tracer (STT TRC#) index of the SPOT and GLOB finite difference test and in debugging. This value will override whatever tracer is listed in the OBSERVATION MENU.<br />
| |
− | 11: spacer line & The denomenator of the derivative to test (for both SPOT and GLOB) is selected in the following submenu.<br />
| |
− | 12: ''MFD'' & Emission temporal group index of the finite difference test. Only matters for LADJ_EMS.<br />
| |
− | 13: ''EMSFD'' & Emission sector index (full chem only) of the finite difference test. Only matters for LADJ_EMS.<br />
| |
− | 14: ''ICSFD'' & Initial conditions type of the finite difference test. Only matters for LICS.<br />
| |
− | 15: ''STRFD'' & Stratospheric tracer index (full chem only) of the finite difference test. Only matters for LADJ_STRAT. NOTE: Finite difference test for the stratospheric fluxes is available for one of either production or loss rates. By default it is for loss rates. You can change it to production rate by modifying the code (inverse_mod.f).<br />
| |
− |
| |
− |
| |
− | <pre>01: %%% DIAGNOSTICS MENU %%%
| |
− | 02: General : T
| |
− | 03: => print debug LPRINTFD : T
| |
− | 04: => jsave, jsave2 : F
| |
− | 05: => adjoint traj LADJ_TRAJ : T
| |
− | 06: => w.r.t. scale factors? : T
| |
− | 07: => save iteration diags LITR : T
| |
− | 08: => sense w.r.t absolute emis : F
| |
− | 09: CO satellite diganostics : F
| |
− | 10: => H(model) : F
| |
− | 11: => h(obs) : F
| |
− | 12: => H(model)-h(obs) : F
| |
− | 13: => adjoint forcing : F
| |
− | 14: => model bias : F
| |
− | 15: => observation count : F
| |
− | 16: => DOFs : F
| |
− | 17: TES NH3 diagnostics :---
| |
− | 18: => BLVMR : F</pre>
| |
− | ''Description''<br />
| |
− |
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | 01: header line & –<br />
| |
− | 02: general switch & Global diagnostic switch. Needs to be set to TRUE for any of the diagnostics to be saved or printed.<br />
| |
− | 03: ''LPRINTFD'' & Print (to log file) debugging messages and tracer values in (IFD,JFD,LFD,NFD) gridbox.<br />
| |
− | 04: jsave, jsave2 & Switch to save jsave and jsave2 values (debugging/finite difference output).<br />
| |
− | 05: ''LADJ_TRAJ'' & Switch to store adjoint trajectory. Note: turning this on can generate a lot of output for fullchemistry simulations. You may want to edit the source code (routine MAKE_ADJ_FILE) so that only a subset of the adjoint species are written out, or a subset of vertical levels.<br />
| |
− | 06: ''LADJ_TRAJ'' & Switch to save adjoint trajectories as sensitivities w.r.t scaling factors.<br />
| |
− | 07: ''LITR'' & Save iteration diagnostic file ''gctm.iteration'' to the diagnostic directory. This file contains information related to convergence of the optimization routine.<br />
| |
− | 08: ''LEMS_ABS'' & Switch to save sensitivities w.r.t. absolute values of emissions (as opposed to scaling factors). These will be in the ems.adj.* files in the diagnostic directory. Currently only supported for SO<math>_2</math>, NH<math>_3</math>, BC and OC emissions.<br />
| |
− | 09: CO diags & Global switch for CO satellite diagnostics. To be used only when MOPITT, AIRS and/or SCIAMACHY observations are used. Corresponding code is very easy to adapt to other observational operators and saves information in the same space for model and observations, making model-data comparisons very easy.<br />
| |
− | 10: ''H(model)'' & Switch to save model convolved by satellite averaging kernels, currently as a column value.<br />
| |
− | 11: ''h(obs)'' & Switch to save satellite observations averaged on GEOS-Chem grid (1h resolution).<br />
| |
− | 12: ''H(model)-h(obs)'' & Switch to save model-satellite differences in satellite/model space.<br />
| |
− | 13: adj forcing & Switch to save adjoint forcing.<br />
| |
− | 14: model bias & Switch to save model bias (model-obs)/obs. This is very useful for computing Relative Residual Error (RRE) values for optimization studies.<br />
| |
− | 15: ''OBS_COUNT'' & Switch to save the number of observations per gridbox in a given simulation.<br />
| |
− | 16: ''DOF'' & Switch to save an average degrees of freedom (DOF) per gridbox.<br />
| |
− | 17: TES NH<math>_3</math> diags & switches for TES NH<math>_3</math> assimilation<br />
| |
− | 18: BLVMR & Switch to read in BLVMR values from TES and add GEOS-Chem BLVMR values to the TES data files.<br />
| |
− |
| |
− |
| |
− | === ''define_adj.h'': observation selection ===
| |
− |
| |
− | The following are observation options, all set in ''define_adj.h''. The corresponding files are in ''code/obs/''. Some are not yet fully implemented, as indicated by “'''Placeholder''' ”.
| |
− |
| |
− | Note: No observation operators are needed for basic sensitivity runs. Basic sensitivity runs are those where the cost function is calculated directly within subroutine ''CALC_ADJ_FORCE_FOR_SENS''.
| |
− |
| |
− | ''CO''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | <tt>MOPITT_V3_CO_OBS</tt> & Assimilate MOPITT CO (column) v3 observations to perform an optimization problem; data in hdf-eos4 file format.<br />
| |
− | <tt>MOPITT_V4_CO_OBS</tt> & Assimilate MOPITT CO (column) v3 observations to perform an optimization problem; data in hdf-eos4 file format.<br />
| |
− | <tt>AIRS_CO_OBS</tt> & Assimilate CO (column) observations from AIRS v5, data in hdf-eos4 file format.<br />
| |
− | <tt>SCIA_BRE_CO_OBS</tt> & Assimilate CO (column) observations from SCIAMACHY (Bremen retrieval only), data in ASCII format.<br />
| |
− |
| |
− |
| |
− | ''Aerosols''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | <tt>TES_NH3_OBS</tt> &<br />
| |
− | <tt>SCIA_DAL_SO2_OBS</tt> & '''Placeholder''' for SO<math>_2</math> from SCIA.<br />
| |
− | <tt>PM_ATTAINMENT</tt> & '''Placeholder''' for aerosol attainment sensitivities; no observations (pseudo or real) required.<br />
| |
− | <tt>IMPROVE_SO4_NIT_OBS</tt> & '''Placeholder''' for aerosol observations from IMPROVE data files.<br />
| |
− | <tt>CASTNET_NH4_OBS</tt> & '''Placeholder''' for aerosol observations from CASTNET data files.<br />
| |
− |
| |
− |
| |
− | ''Ozone''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | <tt>SOMO35_ATTAINMENT</tt> & '''Placeholder''' for ozone attainment sensitivities; no observations (pseudo or real) required.<br />
| |
− | <tt>TES_O3_OBS</tt> & TES O<math>_3</math> data in netcdf format from JPL.<br />
| |
− |
| |
− |
| |
− | ''NO2''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | <tt>SCIA_KNMI_NO2_OBS</tt> & '''Placeholder''' for SCIAMACHY or GOME NO<math>_2</math> data from KNMI hdf files.<br />
| |
− | <tt>SCIA_DAL_NO2_OBS</tt> & '''Placeholder''' for …<br />
| |
− |
| |
− |
| |
− | ''other options''
| |
− |
| |
− | l p12cm l
| |
− |
| |
− | <tt>PSEUDO_OBS</tt> & Use pseudo observations (generated by the model).<br />
| |
− | <tt>LOG_OPT</tt> & Use log-scaling factors.<br />
| |
− | <tt>LIDORT</tt> & Compile LIDORT code for radiative forcing caculations.<br />
| |
− | <tt>LBFGS</tt> & Calculate inverse Hessian matrix using L-BFGS method.<br />
| |
− |
| |
− |
| |
− | === Other input files ===
| |
− |
| |
− | All the files listed below, if needed, should be place in ''run/../geos*/'' directory.
| |
− |
| |
− | * ''run'' script, see Sec. [sec:run<sub>s</sub>cript].
| |
− | * Observational error file(s): for each dataset used. Currently the code expects it in the following format:<br />
| |
− | <tt>RRE_YYYYMMairsGlobal.bpch</tt><br />
| |
− | <tt>RRE_seasonMay1mopittGlobal.bpch</tt><br />
| |
− | <tt>RRE_seasonMay1sciabrGlobal.bpch</tt><br />
| |
− | So for example for AIRS data, in May 2004, the file name is RRE_200405airsGlobal.bpch. AIRS data uses monthly errors, while MOPITT and SCIAMACHY (due to scarcity of data), use seasonal errors. Currently there is 1 file per month for AIRS and 1 file each for MOPITTT and SCIA for the whole year. Current setting spans May 1, 2004 to May 1, 2005 NOTE: There is an option to specify a fixed error across all times and gridboxes and not use the files. This is useful for saving model and data to compute Relative Residual Error (RRE) quantities for later use in an inversion.
| |
− | * ''iter.txt'': This input file contains the iteration number of the next execution of the model. It starts with 1 and the code updates it. This way the same executable can be used for multiple runs (different dates and different iterations).
| |
− | * MOPITT files: ''mopitt_v3_apriori.dat'' (a priori profile)
| |
− | * SCIAMACHY files: ''ak_co_wfmdscia_V2.dat'' (averaging kernels, a priori profile), ''SCIA_pressure.dat'' (pressure levels for SCIA Bremen)
| |
− |
| |
− | == Output files ==
| |
− |
| |
− | See Sect. [sec:dir] for locations. All are binary bunch files unless otherwise noted. Note: files that don’t have an iteration token in their name will be overwritten or removed at each iteration. Exceptions are ''aero.ave*'' and ''satave*'' files, which are lumped into ''fwd_dat.*.tar'' files after each iteration, see the run script.
| |
− |
| |
− | === Essential output files ===
| |
− |
| |
− | lp8 cml
| |
− |
| |
− | ''adjtmp/gctm*.chk.*''& Checkpoint files. Generated during the forward run; deleted after they are used in the backward run (although the <tt>L_DEL_CHECKPT</tt> flag in ''CMN_ADJ'' allows you to not delete them if desired). See ''checkpt_mod.f'' for more details on content.<br />
| |
− | ''OptData/gctm.gdt.NN'' & Gradients of active parameters at each iteration NN (<tt>IJ-GDE-$</tt>). These gradients are semi-normalized. To include fully-normalized gradients (<tt>IJ-GDEN$'</tt> for diagnostic purposes), set <tt>L_WRITE_GDEN = .TRUE.</tt> at the top of the rountine <tt>MAKE_GDT_FILE</tt>.<br />
| |
− | ''OptData/cfn.NN'' & Cost function at each iteration NN. ASCII<br />
| |
− |
| |
− |
| |
− | === Nonessential output files ===
| |
− |
| |
− | lp8 cm l
| |
− |
| |
− | ''OptData/gctm.ics.NN'' & Scaling factors at each iteration NN. The scaled emissions themselves at each iteration are also included in this file for diagnostic purposes. Hence, the a priori estimates of emissions will be found in ''gctm.ics.01'', optimized emissions found in ''gctm.ics.10'', etc. The scaling factors are <tt>IJ-EMS-$</tt> and the emissions themselves are <tt>IJ-EM0-$</tt>.<br />
| |
− | ''OptData/gctm.obs.NN'' & Satellite observations in the CO version. Files contain 3 data structures/arrays. Tracer 1 corresponds to MOPITT obs, 2 to SCIA, 3 is AIRS. The arrays are (IIPAR, JJPAR, NDAYS), where NDAYS is number of simulation days.<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.model.NN'' & Model columns corresponding to the satellite data in time, space and retrieval processing to observations in gctm.obs.NN. These arrays correspond to the satellite ones and are updated at each iteration of the optimization.<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.costf.NN'' & These files contain 2 arrays; 1: Cumulative cost function (summed over all observation types) with dimensions (IIPAR,JJPAR,NDAYS), 2: observation count in each gridbox with dimensions (IIPAR,JJPAR).<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.modbias.NN'' & Contains <tt>(model-obs)/model</tt> at (IIPAR,JJPAR,NDAYS) resolution. Useful for computing Relative Residual Errors (RRE).<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.forcing.NN'' & Contains <tt>2*(model-obs)/err^2</tt>, also known as adjoint forcing; a diagnostic.<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.gdta.NN'' & Gradients of all parameters at each iteration NN. Only generated if <tt>CALL MAKE_GDT_ALL_FILE</tt> in ''inverse_driver.f''.<br />
| |
− |
| |
− |
| |
− | ''OptData/gctm.arr'' & Integrated reaction rate constant sensitivities.<br />
| |
− |
| |
− |
| |
− | lp8cm l
| |
− |
| |
− | ''diagadj/gctm.adj.YYYYMMDD.hhmmss'' & Adjoint state variables (<math>\lambda_c</math>). Purely diagnostic; only written if <tt>LADJ_TRAJ = T</tt> (in ''input.gcadj'') and <tt>ITS_TIME_FOR_OBS</tt>. The number of these files kept can be controlled using the <tt>REMOVE_ADJ_FILE</tt> routine (defunct, need to fix!) in ''geos_chem_adj_mod.f''and the <tt>N_ADJ_KEEP</tt> parameter in ''input.gcadj''. Can be saved as sensitivities with respect to concentrations or concentration scaling factors, see <tt>MAKE_ADJ_FILE</tt> in ''geos_chem_adj_mod.f''.<br />
| |
− |
| |
− |
| |
− | ''adjtmp/gctm.obs.YYYYMMDD.hhmmss'' & Pseudo observation file.<br />
| |
− |
| |
− |
| |
− | ''diagadj/gctm.fd.YYYYMMDD.hhmmss'' & Diagnostic file. Used for process specific finite difference tests.<br />
| |
− |
| |
− |
| |
− | ''diagadj/gctm.fdglob.YYYYMMDD.hhmmss'' & Diagnostic file. Used for process specific second order finite difference tests. Only generated if FD_GLOB is set to true.<br />
| |
− |
| |
− |
| |
− | ''diagadj/aero.ave.YYYYMMDD'' & Aerosol data and corresponding model predictions. Generated when running with <tt>IMPROVE_OBS</tt> or <tt>PM_ATTAINMENT</tt> options.<br />
| |
− |
| |
− |
| |
− | ''diagadj/jsave.YYYYMMDD'' & Contributions to cost function. Generated when running with <tt>IMPROVE_OBS</tt> or <tt>ATTAINMENT</tt> options.<br />
| |
− |
| |
− |
| |
− | ''diagadj/satave.bpch'' & Satellite data and corresponding model predictions for <tt>NO2_SAT_OBS</tt>.<br />
| |
− |
| |
− |
| |
− | ''diagadj/ems.adj.*'' & Emissions sensitivities on per-kg basis (as opposed to scaling factors). Currently only implemented for SO<math>_2</math>, NH<math>_3</math>, OC and BC emissions. Enabled with the ''LEMS_ABS'' switch.<br />
| |
− |
| |
− |
| |
− | ''diagadj/gctm.iteration'' & ASCII. Statistics from the optimization procedure. Enabled with the ''LITR'' switch.<br />
| |
− |
| |
− |
| |
− | ''runs/../geos*/FWD_met'' & Elements of the forward meteorology in the FD cell.<br />
| |
− |
| |
− |
| |
− | ''runs/../geos*/BACKWD_met'' & Elements of the backward meteorology in FD cell. Should agree exactly with contents of ''FWD_met''.<br />
| |
− |
| |
− |
| |
− | == The ''run'' script ==
| |
− |
| |
− | [sec:run<sub>s</sub>cript] Each run of the adjoint can be done with the same executable. Thus the simplest run script is sufficient for 1 iteration. The number in ITER updates ''N_CALC_STOP'' variable in ''inverse_driver.f'' and determines the number of iterations in the next execution of the code.
| |
− |
| |
− | '''NOTE:''' The ''run'' script uses bash like syntax, we expect it to work if you have bash on your system. If you experience problems please write to the development team in other to adress the problem.
| |
− |
| |
− | To use, you have to set several variables in the script, following the instructions therein.
| |
− |
| |
− | Change often (almost every run):
| |
− |
| |
− | <pre>X
| |
− | XSTOP
| |
− | RNAME
| |
− | TYPE
| |
− | Makefile</pre>
| |
− | Change rarely (only when migrating to a new filesystem):
| |
− |
| |
− | <pre>IFORT_OPT
| |
− | RECOMPILE
| |
− | SAVE
| |
− | DSAVE
| |
− | ARCHIVE
| |
− | DARCHIVE
| |
− | DRUNDIR
| |
− | DPACK</pre>
| |
− | Unlikely to need to be changed from the defaults:
| |
− |
| |
− | <pre>DCODE
| |
− | DRUN</pre>
| |
− | The frequently changed variables are <tt>X</tt>, <tt>XSTOP</tt>, <tt>RNAME</tt> and <tt>TYPE</tt>. Set <tt>RNAME</tt> to be a descriptive name of your current calculation (such as <tt>ADJv23_optimize_NH3_emissions</tt>). Set <tt>TYPE</tt> acording to the type of simulation operator, the model supports 4 types of simulation:
| |
− |
| |
− | <pre>DEFAULT : As it says is the default type that most of the people run.
| |
− | HDF : Set this type when satellite HDF data is going to be used.
| |
− | LIDORT : Set this type when running a LIDORT simulation.
| |
− | SAT_NETCDF : Set this type when satellite NetCDF data is goin to be used.</pre>
| |
− | Set the start (or current) iteration number, <tt>X</tt>. Set <tt>XSTOP</tt> to the final iteration number. For example, if you’ve already computed five iterations, then set <tt>X=6</tt> and <tt>XSTOP=9</tt> to compute three more. At each iteration, the current value of <tt>X</tt> is assigned to the variable <tt>N_CALC_STOP</tt> in ''inverse_driver.f'' and the code is executed. <tt>X = 0</tt> is used for generating pseudo observations. For example, if <tt>X=0</tt> and <tt>XSTOP =4</tt>:
| |
− |
| |
− | l | l | l | l | l
| |
− |
| |
− | <br />
| |
− | <tt>X=0</tt> & <tt>X=1</tt> & <tt>X=2</tt>& <tt>X=3</tt> & <tt>X=4</tt><br />
| |
− | <math>\sigma</math>=1&<math>\sigma</math>=1+<math>\delta \sigma</math> & read *.01 & read *.01 &read *.01<br />
| |
− | <tt>DO_GEOS_CHEM</tt>&<tt>DO_GEOS_CHEM</tt> & update <math>\sigma</math> & update <math>\sigma</math> & update <math>\sigma</math><br />
| |
− | make *obs* &<tt>DO_ADJOINT</tt> & <tt>DO_GEOS_CHEM</tt> & read *.02 & read *.02<br />
| |
− | &write *.01 & <tt>DO_ADJOINT</tt> & update <math>\sigma</math> & update <math>\sigma</math><br />
| |
− | & & write *.02 & <tt>DO_GEOS_CHEM</tt> & read *.03<br />
| |
− | & & & <tt>DO_ADJOINT</tt> & update <math>\sigma</math><br />
| |
− | & & & write *.03 & <tt>DO_GEOS_CHEM</tt><br />
| |
− | & & & & <tt>DO_ADJOINT</tt><br />
| |
− | & &&& write *.04<br />
| |
− |
| |
− |
| |
− | A reason to do only a single iteration per execution is because of code fragments like this:
| |
− |
| |
− | <tt>LOGICAL</tt>, <tt>SAVE :: FIRST = .TRUE.</tt>
| |
− |
| |
− | <pre>IF ( FIRST ) THEN
| |
− | CALL INIT_ARRAYS
| |
− | FIRST = .FALSE.
| |
− | ENDIF</pre>
| |
− | By exiting the code between each iteration, these logical control switches get automatically reset to <tt>FIRST = .TRUE.</tt>. Doesn’t this repeated reading / writing / optimizing take a lot of time? No, not with respect to the expense of the forward and backward model calculations.
| |
− |
| |
− | For sensitivity calculations, set <tt>X</tt> and <tt>XSTOP</tt> to 1
| |
− |
| |
− | For global finite difference calculations, set <tt>X=1</tt> and <tt>XSTOP=3</tt>.
| |
− |
| |
− | For spot finite difference calculations, set <tt>X=1</tt> and <tt>XSTOP=2</tt>.
| |
− |
| |
− | For generating pseudo observations using ''PSEUDO_OBS'', set <tt>X=0</tt> and <tt>XSTOP</tt> equal to the total number of iterations you wish to perform. Subsequent tests using the same set of pseudo observations can start from <tt>X=1</tt>.
| |
− |
| |
− | The run script will compile the ''geos'' executable,
| |
− |
| |
− | <pre> ##################################################################
| |
− | # Compile geos, move it to the run directory and execute
| |
− | ##################################################################
| |
− |
| |
− | cd $DRUN/$DPACK/$DCODE
| |
− | if [ -n $(grep 'Compute BFGS inverse Hessian: T' $DRUNDIR/input.gcadj) ]; then
| |
− | ./objects.sh $TYPE
| |
− | else
| |
− | ./objects.sh $TYPE LBFGS
| |
− | fi
| |
− |
| |
− | if [ $TYPE = 'DEFAULT' ]; then
| |
− | IFORT_OPT="$IFORT_OPT "
| |
− | elif [ $TYPE = 'HDF' ]; then
| |
− | IFORT_OPT="$IFORT_OPT HDF=yes"
| |
− | elif [ $TYPE = 'SAT_NETCDF' ]; then
| |
− | IFORT_OPT="$IFORT_OPT SAT_NETCDF=yes"
| |
− | elif [ $TYPE = 'LIDORT' ]; then
| |
− | IFORT_OPT="$IFORT_OPT LIDORT=yes"
| |
− | fi
| |
− |
| |
− | if [ -n $(grep 'Compute BFGS inverse Hessian: T' $DRUNDIR/input.gcadj) ]; then
| |
− | make $IFORT_OPT
| |
− | else
| |
− | make LBFGS='yes' $IFORT_OPT
| |
− | fi
| |
− |
| |
− | if [ $RECOMPILE = 'YES' ]; then
| |
− | mv -f geos ../$DRUNDIR/
| |
− | else
| |
− | cp -f geos ../$DRUNDIR/
| |
− | fi
| |
− |
| |
− | cd ../$DRUNDIR/
| |
− | time ./geos</pre>
| |
− | If you are running an interactive job and wish to save a log file that doesn’t get overwritten each iteration, than you may replace
| |
− |
| |
− | <pre> time ./geos</pre>
| |
− | with
| |
− |
| |
− | <pre> time ./geos > log.${X}</pre>
| |
− | The run script will optionally save a copy of the entire package and move it to <tt>DSAVE</tt>. This may be necessary if you are using <tt>DRUN</tt> on the local storage of a compute node to which you no longer have access after your log has completed. The enable or disable this feature, set the variable <tt>SAVE</tt>.
| |
− |
| |
− | Lastly, users running parallel jobs with OpenMP on multi-core compute nodes should be mindful to set the following to be appropriate for their system:<br />
| |
− |
| |
− |
| |
− | <pre># Set number of threads
| |
− | export OMP_NUM_THREADS=24</pre>
| |
| = Running the adjoint code = | | = Running the adjoint code = |
| | | |
There are two options for active variables (the ones with respect to which we compute sensitivities): initial conditions (LICS) and emissions (LADJ_EMS), which could include chemical production sources. The active variable tracers (LICS) need to be listed in input.gcadj and their order and numbering needs to correspond to the tracers listed in the input.geos file. For LADJ_EMS, the emissions also need to be listed in input.gcadj.
Not all (forward) GEOS-Chem options are accommodated in the adjoint model. Currently, the forward model settings that are supported are as follows:
This subroutine is used to specify the spatial domain over which observations are included in the cost function for the PSEUDO_OBS 4D-Var tests as well as for the following sensitivity run cost function options: LKGBOX, LUGM3, LSTT_PPB, and LSTT_TROP_PPM. If you’re computing a sensitivity of specific gridbox or region, you need to make sure that the WEIGHT array is initialized accordingly.
If you are using a cost function option that depends upon species concentrations (i.e., CSPEC), you can adjust the LMIN, LMAX, etc, parameters at the top of this routine to limit the spatial coverage of the cost function.
Set finite perturbation, FD_DIFF (e.g. to something like 0.1).
Select a numerator and denominator for the test in the FD MENU.
Decide whether to specify finite difference box with index (Specify box is TRUE) or lon/lat values.
Run from iteration 1 to iteration 3 for a global test . The first iteration performs the base case forward model run and the adjoint run. For iterations 2 and 3, the forward model will be run for positive and negative perturbations of the control variables being tested.
For a spot test, run from iteration 1 to 2. Both iterations include a forward model run and adjoint model run. The second run is evaluated with a positive perturbation. Finite difference sensitivities are compared to the average of the adjoints from the first and second run.
The sensitivity run local and global sensitivity calculation. LSENS controls this simulation type. The options here are sensitivity of a predefined gridbox concentration, average concentration etc. (in CALC_ADJ_FORCING in geos_chem_adj_mod.f).
Specify observations / cost function options.
Run for iteration 1 only. This iteration performs the base case forward model run and the adjoint run.
For inverse model tests using pseudo observations, we usually set the “initial guess” of scaling factors to be some value other than one (or zero for LOG_OPT) and then try to converge to values of one (zero). For real data assimilation problems or attainment studies, we begin with our best estimate, i.e. scaling factors equal to one (zero), and converge to values that lead to best agreement with observations.
Depending on whether we are using observations requiring additional libraries (e.g, hdf or netcdf), modify the run script to use the appropriate Makefile.
Set a desired number of iterations in the run script if using a multiple iteration script.
Select control parameters LADJ_EMS or LICS.
Set APSRC to TRUE if including a priori cost function term. If TRUE, make sure that REG_PARAM and ERROR are intentionally defined in the CONTROL VARIABLE MENU.
Set initial conditions for ICS_SF and EMS_SF. This can be done globally using SF_DEFAULT, or on a regionally specific basis by modifying code in inverse_mod.f.
Set observation frequency.
List optimized species and/or emissions.
If your observation operator depends upon a chemical species in CSPEC, such as O<math>_3</math> or NO<math>_2</math>, list this species as an observed species in the OBSERVATION MENU.
Specify for which gridbox or lat/lon you want debugging print statements in the finite difference menu.
Select diagnostic output (in the diagnostics menu) such as LITR.
3D-var run is a Kalman filter forward estimation. The code exists outside the v8 framework. Contact Kumaresh Singh if interested in details.
Currently, sensitivities with respect to the following reaction rate constants are included:
To have the model calculate sensitivity with respect to additional rate constants, the following needs to be updated:
For example, if we would like to calculate the sensitivity of the cost function with respect to the rate constant for the reaction ALD<math>_2</math> + NO<math>_3 </math><math>\rightarrow</math> HNO<math>_3</math> + MCO<math>_3</math>, we would find the following entry for this reaction in the KPP input file gckpp_adj.eqn:
The adjoint of GEOS-Chem is designed to be validated in several manners.
By turning off multidirectional transport related processes, the adjoint model sensitivities can be compared to finite difference sensitivities on a global scale, see Fig. 1 and 3 of .
For example, to check the adjoint of the chemistry only in a single vertical level, set the following:
Alternatively, we can compare adjoint gradients to finite difference gradients for control parameters one location at a time, but with all model processes turned on.