Guillaume implemented a flexible reading of OH in his chemistry__4DVAR.F90, which defines one subroutine per OH format. These subroutines are called from chemistry_init. This is much cleaner than my existing code for CO+CO2. So I'm going to adapt his code for my CO+CO2 system. First, the budget for 2010 with my old code (to verify against once I modify code):
-------------------------------------------------------- Budget of tracers in region glb600x400 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 3.32167E+11 2.99212E+15 emitted : 1.82550E+12 1.55714E+13 chemistry : -1.84970E+12 2.90623E+12 update_p : 1.41927E+11 1.24270E+13 advection : 2.28638E-01 8.23000E+02 deposition : -1.25167E+11 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 3.24728E+11 3.02302E+15 Budget error : 1.05408E-01 1.06350E+03 -------------------------------------------------------- -------------------------------------------------------- Budget of tracers in region sea300x200 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 3.89294E+10 2.88745E+14 emitted : 1.05720E+11 3.98783E+12 chemistry : -8.77634E+10 1.37893E+11 update_p : 1.31167E+11 8.30128E+12 advection : -1.42449E+11 -9.63987E+12 deposition : -7.19594E+09 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 3.84076E+10 2.91532E+14 Budget error : -1.25877E-01 -5.00812E+02 -------------------------------------------------------- -------------------------------------------------------- Budget of tracers in region sea100x100 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 2.14392E+10 1.45622E+14 emitted : 2.94469E+11 8.08005E+12 chemistry : -1.40800E+11 2.21224E+11 update_p : 0.00000E+00 0.00000E+00 advection : -1.31412E+11 -6.98943E+12 deposition : -2.25017E+10 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 2.11938E+10 1.46933E+14 Budget error : -2.45556E+01 -1.59688E+02 --------------------------------------------------------
With modifications:
-------------------------------------------------------- Budget of tracers in region glb600x400 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 3.24478E+11 3.05396E+15 emitted : 1.82550E+12 1.55714E+13 chemistry : -1.84317E+12 2.89597E+12 update_p : 1.42489E+11 1.24262E+13 advection : 1.42944E-01 -1.93200E+03 deposition : -1.24970E+11 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 3.24328E+11 3.08485E+15 Budget error : 5.31006E-02 -1.50550E+03 -------------------------------------------------------- -------------------------------------------------------- Budget of tracers in region sea300x200 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 3.84345E+10 2.94882E+14 emitted : 1.05720E+11 3.98783E+12 chemistry : -8.75342E+10 1.37533E+11 update_p : 1.31491E+11 8.30080E+12 advection : -1.42540E+11 -9.76180E+12 deposition : -7.18709E+09 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 3.83835E+10 2.97546E+14 Budget error : -2.50504E-01 -8.91500E+02 -------------------------------------------------------- -------------------------------------------------------- Budget of tracers in region sea100x100 (Kg) Tracer : CO CO2 -------------------------------------------------------- Initial mass : 2.12289E+10 1.48737E+14 emitted : 2.94469E+11 8.08005E+12 chemistry : -1.40497E+11 2.20747E+11 update_p : 0.00000E+00 0.00000E+00 advection : -1.31536E+11 -7.06620E+12 deposition : -2.24815E+10 0.00000E+00 stratosphere : 0.00000E+00 0.00000E+00 Final mass : 2.11837E+10 1.49971E+14 Budget error : -2.43940E+01 1.50875E+02 --------------------------------------------------------
This is bizarre... why should the initial mass be different? I'm starting from the same restart file, after all!
Oh I see, I'm not starting from the same restart file... it was overwritten by another run in the meantime!