Difference between revisions of "GEOS-Chem v9-01-03"

From Geos-chem
Jump to: navigation, search
(Outstanding issues not yet resolved in v9-01-03)
Line 967: Line 967:
  
 
Otherwise, LAT variable in HDF files will be wrong.
 
Otherwise, LAT variable in HDF files will be wrong.
 +
 +
=== Tagged CO simulation dies with compilation errors ===
 +
 +
We discovered some [[GEOS-Chem_v9-02#Bug_fixes_for_tagged_CO_simulation|minor errors in the tagged CO simulation]] after the release of v9-01-03.  These are now corrected in [[GEOS-Chem v9-02]].
 +
 +
--[[User:Bmy|Bob Y.]] 11:30, 23 October 2012 (EDT)
 +
http://wiki.seas.harvard.edu/geos-chem/index.php/GEOS-Chem_v9-02#Bug_fixes_for_tagged_CO_simulation

Revision as of 15:30, 23 October 2012

Overview

RELEASED 14 Sep 2012

What's new in this version

GEOS-Chem v9-01-03 contains the following major updates and improvements.

Feature Type Submitted by Benchmark(s) Status
Fix for GLCO3/GLPAN bug in standard chemistry mechanism Bug Fix Fabien Paulot (Harvard) v9-01-03a Approved 08 Dec 2011
Updated acetone chemistry (ocean source & sink) Science Emily Fischer (Harvard) v9-01-03b Approved 14 Dec 2011
Retirement of obsolete GEIA biogenic emissions Structural Emily Fischer (Harvard)
Dylan Millet (U. Minnesota)
" " " "
OVOC dry deposition updates Science Jingqiu Mao (NOAA/GFDL) v9-01-03c Approved 19 Dec 2011
Improved sea salt emission & deposition Science Lyatt Jaeglé (U. Washington) v9-01-03d Approved 12 Jan 2012
Update dry deposition to use local surface pressure Science Lyatt Jaeglé (U. Washington); GEOS-Chem Support Team " " " "
Dust submicron size distribution for optics Science David Ridley (Colo. State) " " " "
Improved snow scavenging and washout parameterization Science Qiaoqiao Wang (Harvard) v9-01-03e
+ Rn-Pb-Be benchmark
Approved 02 Feb 2012
Structural changes to clarify science behind washout Structural Helen Amos (Harvard) " " " "
PARANOX ship plume emissions Science Geert Vinken (Eindhoven) v9-01-03f Approved 17 Feb 2012
Bug fixes for David Streets emissions for years 2005 and earlier Bug fix Jenny Fisher (Harvard) " " " "
Bug fix in emep_mod.F for offline simulations Bug fix GEOS-Chem Support Team v9-01-03g Approved 27 Feb 2012
Bug fix in nei2005_anthro_mod.F for offline simulations Bug fix GEOS-Chem Support Team " " " "
Bug fix to prevent crash in wetdep when encountering anomalously low PRECTOT values Bug fix GEOS-Chem Support Team " " " "
Minor fix in Rn-Pb-Be simulation to prevent missing drydep diagnostics Bug fix GEOS-Chem Support Team " " " "
Correct out-of-bounds error in offline aerosol simulation Bug fix GEOS-Chem Support Team " " " "
Bug fixes in diag3.F Bug fix Mat Evans (Leeds)
GEOS-Chem Support Team
" " " "
Bug fixes for nested-grid simulation Bug fix Dylan Millet (U. Minnesota) " " " "
Bug fix for reading Hg emissions Bug fix Jenny Fisher (Harvard) " " " "
Add scaling of lightning NOx for 2x2.5 MERRA simulations Science Lee Murray (Harvard)
Matt Cooper (Dalhousie)
" " " "
Initial source code modifications for GEOS-5.7.2 Structural GEOS-Chem Support Team " " " "
Hg(II) gas-aerosol partitioning Science Helen Amos (Harvard) v9-01-03h Approved 09 Mar 2012
Nested-grid CO2 Science Yuxuan Wang (Tsinghua) " " " "
Historical emission inventories of SO2, NOx, BC, and POA Science Eric Leibensperger (MIT) " " " "
CH4 simulation updates Science Kevin Wecht (Harvard) " " " "
Remove support for GEOS-3 meteorology Structural GEOS-Chem Support Team " " " "
Bug fix in streets anthro mod.F for offline simulations Bug fix Fabien Paulot (Harvard) " " " "
Grid-independent GEOS-Chem updates #1: Fixes to facilitate implementation of grid-independent code Structural GEOS-Chem Support Team v9-01-03i Approved 26 Mar 2012
Replace RETRO C2H6 emissions with emissions from offline C2H6 simulation Bug fix GEOS-Chem Support Team " " " "
Implementation of updated LAI code Structural GEOS-Chem Support Team v9-01-03j Approved 17 Apr 2012
Grid-independent GEOS-Chem updates #2: Preliminary interface to link driving GCM Structural GEOS-Chem Support Team " " Note: We have merged code into v9-01-03j that will allow GEOS-Chem to be driven by the NASA/GEOS-5 GCM, for the Grid-independent GEOS-Chem project.
Replace existing regridding routines with the MAP_A2A regridding package Structural Matt Cooper (Dalhousie)
Prasad Kasibhatla (Duke)
v9-01-03k Approved 27 Apr 2012
Daily and 3-hourly GFED3 biomass emissions Science Prasad Kasibhatla (Duke) v9-01-03l Approved 18 May 2012
Tropospheric bromine chemistry Science Justin Parrella (Harvard) v9-01-03m Approved 06 Jun 2012
Bug fix in routine ARSL1K Bug fix GEOS-Chem Support Team " " " "
Satellite-based NOx emission trends Science Lok Lamsal (NASA GSFC) v9-01-03n Approved 08 Jun 2012
Bug fixes for the MAP_A2A regridding algorithm Bug fix Lee Murray (Harvard) " " " "
Bug fixes for dicarbonyl simulation Bug fix GEOS-Chem Support Team " " " "
Stratospheric P and k (monthly climatological) Science Lee Murray (Harvard) v9-01-03o Approved 11 Jul 2012
Standardization of structural changes to facilitate the GEOS-Chem/GEOS-5 GCM interface Structural Eric Nielsen (NASA GSFC)
GEOS-Chem Support Team
v9-01-03p Approved 21 Aug 2012
Fixed minor bug in stratospheric chemistry module Bug Fix GEOS-Chem Support Team " " " "
Additional modifications that are activated with the DEVEL=yes option Structural GEOS-Chem Support Team " " " "
Bug fixes for regional emission masks Bug fix Lee Murray v9-01-03q Approved 22 Aug 2012
Updates to enhance the performance of the MAP_A2A regridding scheme Performance GEOS-Chem Support Team v9-01-03r Approved 28 Aug 2012
Size-dependent depletion factors for sea salt aerosol debromination Science Justin Parrella (Harvard)
GEOS-Chem Support Team
Last-minute update 28 Aug 2012
Fixes for numerical stability in the nested-grid simulation Bug fix GEOS-Chem Support Team Last-minute update 07 Sep 2012
Fix for regridding error in offline CO2 simulation Bug fix GEOS-Chem Support Team Post-release patch 22 Sep 2012
Bug fix for improving speedup in calcrate.F Bug fix GEOS-Chem Support Team Post-release patch 04 Oct 2012
Fixed typos in vdiff_mod.F90 Bug fix GEOS-Chem Support Team Post-release patch 04 Oct 2012
Bug fix for Intel Fortran Compiler 12 Bug fix GEOS-Chem Support Team Post-release patch 05 Oct 2012

--Bob Y. 14:16, 5 October 2012 (EDT)

New data directories

The following new data directories have been added for GEOS-Chem v9-01-03. You will have to download the directories relevant to your simulation.

You can download these directories with anonymous FTP or the Wget utility. For instructions, please see Chapter 2.4, Downloading the GEOS-Chem shared data directories in the GEOS-Chem Online User's Guide.

GEOS_0.5x0.666_NA/CH4_201203                # For nested-grid NA CH4 simulation
GEOS_0.5x0.666_NA/mercury_201203            # For nested-grid NA mercury simulation

GEOS_1x1/anth_scale_factors_201111          # Contains updated NOx scale factors derived from OMI
GEOS_1x1/PARANOX_201202                     # For PARANOX ship plume model

GEOS_2x2.5/CH4_201203                       # Updated CH4 simulation files
GEOS_2x2.5/TOMS_201203                      # Update TOMS O3 columns (currently only used for GEOS-5.7.2)
GEOS_2x2.5/bromine_201205                   # Bromine emissions and stratospheric Bry concentrations
GEOS_2x2.5/historical_emissions_201203      # Historical emission inventories of BC and POA
GEOS_2x2.5/lightning_NOx_201101             # Contains new lightning redistribution file for MERRA 2x2.5
GEOS_2x2.5/strat_chem_201206                # Input files for applying linearized stratospheric chemistry

GEOS_4x5/CH4_201203                         # Updated CH4 simulation files
GEOS_4x5/TOMS_201203                        # Update TOMS O3 columns (currently only used for GEOS-5.7.2)
GEOS_4x5/bromine_201205                     # Bromine emissions and stratospheric Bry concentrations
GEOS_4x5/historical_emissions_201203        # Historical emission inventories of BC and POA
GEOS_4x5/strat_chem_201206                  # Input files for applying linearized stratospheric chemistry

GEOS_NATIVE/FastJ_201204                    # Contains netCDF version of old ASCII file jv_atms.dat
GEOS_NATIVE/Olson_Land_Map_201203           # Olson 1992 and 2001 land map files in netCDF format
GEOS_NATIVE/MODIS_LAI_201204                # MODIS LAI files in netCDF format
GEOS_NATIVE/MAP_A2A_Regrid_201203           # Contains files with lon and lat edge info used for regridding
GEOS_NATIVE/GFED3_201203                    # Monthly, daily, and 3-hourly GFED3 biomass burning emissions
GEOS_NATIVE/TOMS_201203                     # Update TOMS O3 columns (currently only used for GEOS-5.7.2)
GEOS_NATIVE/bromine_201205                  # Bromine emissions and stratospheric Bry concentrations
GEOS_NATIVE/historical_emissions_201203     # Historical emission inventories of SO2, NOx, BC, and POA
GEOS_NATIVE/strat_chem_201206               # Input files for applying linearized stratospheric chemistry

--Melissa Payer 14:12, 23 July 2012 (EDT)

Previous issues now resolved in v9-01-03

Bug fix for GLCO3 and GLPAN in standard mechanism

This update was tested in the 1-month benchmark simulation v9-01-03a and approved on 08 Dec 2011.

Prior to v9-01-02, some species in the globchem.dat and ratj.d files were left as inactive, but should have been declared as dead. For a full description of this issue, please see this wiki post on the Chemistry Issues page.

--Bob Y. 17:07, 14 December 2011 (EST)

Structural changes to clarify science behind washout

This update was tested in the 1-month benchmark simulation v9-01-03e and approved on 02 Feb 2012.

Helen Amos wrote:

Qiaoqiao's aerosol scavenging updates should *not* be applied to HNO3. HNO3 should still be scavenged according to Eq (14) from Jacob (2000). This issue came up a while back and as a result I wrote code to split washout into three cases: aerosols, HNO3, and soluble gases. I restructured the washout code specifically to handle Qiaoqiao's updates and make sure HNO3 didn't change, so if no one objects I suggest these structure changes go into the std code with Qiaoqiao's updates.

--Melissa Payer 16:01, 23 January 2012 (EST)

Correct out-of-bounds error in offline aerosol simulation

This update was tested in the 1-month benchmark simulation v9-01-03g and approved on 27 Feb 2012.

When using the offline aerosol simulation, an out-of-bounds error was found to occur in array WTAERA within subroutine RDAER (aerosol_mod.F). To fix the error, add the following lines to INIT_COMODE (comode_mod.F) below the offline aerosol simulation IF statement:

        ALLOCATE( WTAREA( ITLOOP, NDUST+NAER ), STAT=AS )
        IF ( AS /= 0 ) CALL ALLOC_ERR( 'WTAREA' )
        WTAREA = 0d0

        ALLOCATE( WERADIUS( ITLOOP, NDUST+NAER ), STAT=AS )
        IF ( AS /= 0 ) CALL ALLOC_ERR( 'WERADIUS' )
        WERADIUS = 0d0

--Melissa Payer 17:47, 11 January 2012 (EST)

Bug fixes in diag3.F

Bug fix for mass transport flux diagnostics

This update was tested in the 1-month benchmark simulation v9-01-03g and approved on 27 Feb 2012.

Mat Evans wrote:

In diag3.f line 1740
  ARRAY(:,:,1:LD24) = MASSFLEW(:,:,LD24:1:-1,N) / SCALEDYN
Should be
  ARRAY(:,:,1:LD24) = MASSFLEW(:,:,LLPAR:LLPAR-LD24+1:-1,N) / SCALEDYN
And the same for LD25 Line 1773
And for same for LD26 line 1806
Everything is fine if LD24 = LLPAR but it seems to go wrong if you try to output a subset of the model levels..

--Melissa Payer 17:28, 12 January 2012 (EST)

Bug fix in ND67 sea level pressure diagnostic

This update was tested in the 1-month benchmark simulation v9-01-03g and approved on 27 Feb 2012.

When plotting SLP in GAMAP for GEOS-5 at both 4°x5° and 2°x2.5° resolutions, the values appeared to be half of what they should be (SLP ~500 hPa globally).

In diag3.F, the lines:

              CASE ( 18 ) 
                 SCALEX = SCALE_ND67
                 UNIT   = 'hPa'

should be changed to:

              CASE ( 18 ) 
#if   defined( MERRA )
                 SCALEX = SCALE_A1     ! MERRA SLP is hourly
#else
                 SCALEX = SCALE_I6     ! Otherwise SLP is 6-h inst.
#endif
                 UNIT   = 'hPa'

As it is now, SCALE_ND67 = SCALE_A3 but SLP is an I6 field for GCAP, GEOS-3, GEOS-4, and GEOS-5.

--Melissa Payer 17:42, 12 January 2012 (EST)

Bug fixes for nested-grid simulation

This update was tested in the 1-month benchmark simulation v9-01-03g and approved on 27 Feb 2012.

Dylan Millet wrote:

My student Lu is running N. American nested grid with the v9-3-1b that Bob provided. We found a few minor glitches, mostly specific to the nested grid, that we thought we'd pass along. Perhaps they've already been fixed on your end.
  1. in land_mercury_mod.f, the variable "SOIL_EMS_FAC" is undefined for the 05x0666 case.
  2. the Makefiles in the GeosApm and GeosTomas directories each have an intermediate "else" that needs to be changed to an "elif"
  3. in tpcore_bc_mod.F, when reading in the boundary conditions if ITS_A_NEW_DAY, the call to ITS_A_NEW_DAY() needs to be ITS_A_NEW_DAY(.TRUE.) so that it will read in the boundary conditions actually at midnight. Otherwise it won't read them in at the start of the run.

--Melissa Payer 11:11, 18 January 2012 (EST)

Bug fix in streets_anthro_mod.F for offline simulations

This update was tested in the 1-month benchmark simulation v9-01-03h and approved on 09 Mar 2012.

Fabien Paulot wrote:

I just found a little bug in the streets emission routine
     !=================================================================
     ! Apply seasonal variation to NH3 based on seasonality from 
     ! Lex Bouwman.  Follow methodology in emep_mod.f (jaf, 3/2/11)
     !=================================================================

     ! Get TAU value for 1995, since the data is timestamped w/ this
     TAU1995 = GET_TAU0( GET_MONTH(), 1, 1995 )

     ! For NH3 only ...
     IF ( TRACERN == IDTNH3 ) THEN

        ! File name containing scaling factors
        FILENAME_S = TRIM( DATA_DIR_1x1 ) // 
    &        'Streets_200607/NH3-Streets-SeasonalScalar.generic.1x1'

        ! Tracer number for scale factor data
        RATIOID = 74

        ! Echo info
        WRITE( 6, 101 ) TRIM( FILENAME_S )
101      FORMAT( '     - READ_STREETS: Reading ', a )

        ! Read scaling factors
        CALL READ_BPCH2( FILENAME_S, 'RATIO-2D',  RATIOID,
    &                    TAU1995,     I1x1,       J1x1-1,
    &                    1,           SCALAR_1x1, QUIET=.TRUE. )

        ! Apply seasonal scalar to NH3 emissions
        ARRAY(:,:,1) = ARRAY(:,:,1) * SCALAR_1x1(:,:,1)

     ENDIF
The instruction TRACERN == IDTNH3 should be replaced by TRACER == 30 to avoid issues with the offline chemistry where idtnh3 is not equal to 30.
This routine is being called by
           CALL READ_STREETS( FILENAME, 'ANTHSRCE', 30, TAU2000, NH3 )
for NH3
So it seems to me, you are not going to scale NH3 if IDTNH3 is not equal to 30.

--Melissa Payer 11:51, 2 March 2012 (EST)

Bug fixes for dicarbonyls simulation

This update was tested in the 1-month benchmark simulation v9-01-03n and approved on 08 Jun 2012.

The following issues were discovered in the dicarbonyls simulation shortly after the release of GEOS-Chem v9-01-01. These will all been fixed in v9-01-03. Please follow the links below for more information:

  1. Out-of-bounds error in SOAG_LIGGIO_DIFF
  2. NL parameter needs to be increased

--Melissa Payer 12:34, 20 March 2012 (EDT)

Bug fixes for regional emission masks

This update was tested in the 1-month benchmark simulation v9-01-03q.

Lee Murray wrote:

I believe that there is a bug in the masks for the regional overwrites. I added the following code to the end of READ_EUROPE_MASK in emep_mod.F:
         ! Plot map
         DO J=JJPAR,1,-1
            WRITE(6,'(10F5.1)') EUROPE_MASK(30:39,J)
         ENDDO 
to output a map of EUROPE_MASK values, after it was re-gridded from 1x1 to the GEOS5 4x5 grid.
        - READ_EUROPE_MASK: Reading /Data/input/geos/GEOS_1x1/EMEP_200911/EMEP_mask.geos.1x1
     ... etc ...
     0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
     0.0  7.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5 12.5
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 12.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0 10.5 19.5 20.0 20.0 20.0 20.0 20.0 20.0 20.0
     0.0  0.0  2.0  3.5  9.5 15.5 20.0 20.0 20.0 20.0
     0.0  0.0  0.0  0.0  0.0  0.0  6.5 17.5 20.0 20.0
     0.0  0.0  0.0  0.0  0.0  0.0  0.0  1.0  9.5 12.5
     ... etc ...
You can see that many of the values exceed 1.0, so in many grid boxes, the emission rates for Europe would be multiplied by a factor of 20 when the mask is applied. I have also tested and get similar results for the Canada and US masks. I imagine the same holds for China and Mexico.
We can get masks in the correct range of 0 to 1 if we use
         CALL DO_REGRID_A2A( LLFILENAME, I1x1,    J1x1,
        &                    INGRID,     OUTGRID, PERAREA=0 )  
         EUROPE_MASK = OUTGRID 
instead of
         CALL DO_REGRID_A2A( LLFILENAME, I1x1,    J1x1,
        &                    INGRID,     OUTGRID, PERAREA=1 )  
         EUROPE_MASK = OUTGRID 
I think that this is because although the masks themselves are unitless, they are actually m2 region / m2 box, they are already in a "per unit area" and don't need to be converted in DO_REGRID_A2A.
Also, I suspect that once they are re-gridded, all values greater than 0 need to be set to 1 to be consistent with how the masks are applied to the regridded emissions. But someone who is more familiar with the emissions should verify that.

--Bob Y. 15:14, 17 August 2012 (EDT)

Fixes for numerical stability in the nested-grid simulation

Several minor fixes were added for the nested-grid simulation, mostly for numerical stability and more efficient memory usage.

(1) In GeosCore/strat_chem_mod.F90, routine GET_RATES_INTERP: we now avoid using array slices in the call to the TRANSFER_3D subroutine. This prevents the creation of large "temporary" arrays by the code. You will now see this code:
    !##############################################################################
    !###       call transfer_3D( array, array2 )
    !###
    !###       PROD(:,:,:,N) = ARRAY2
    !##############################################################################
           ptr_3D => PROD(:,:,:,N)
           call transfer_3D( array, ptr_3D )
           NULLIFY( ptr_3D )
(2) In GeosCore/tpcore_bc_mod.F:
  • Remove parallel loops from routine CLEAN_TPCORE_BC. Now just use F90 array assignment statements (i.e. BC = 0d0).
  • Use 0d0 instead of 0e0 to initialize arrays, in order to avoid loss of precision. The 0d0 constant will give a zero result out to 15 or 16 places of precision, rather than about 6 or 7.
(3) In GeosCore/transport_mod.F:
  • Add more calls to DEBUG_MSG after DO_WINDOW_TPCORE_BC and the array flipping.
We also made the structural changes described below. These do not affect any scientific results.
(4) In GeosCore/main.F:
  • Rename the argument to routine CHECK_STT_05x0666 from "after chemistry" to "end of chem section, before wetdep". An error may be flagged here on a timestep where chemistry isn't done.
(5) In Headers/define.h:
  • Removed C-preprocessor flags EXTERNAL_GRID, EXTERNAL_FORCING flags. These are now set by Makefile_Header.mk.
(6) In Makefile_header.mk:
  • Add the following new optional Makefile variables:
    • OPT: Lets you change the default optimization level (e.g. from -O2 (default) to -O1)
    • DEVEL=yes: Activates the DEVEL C-preprocessor switch for Grid-Independent model development.
    • EXTERNAL_GRID=yes: Activates the EXTERNAL_GRID C-preprocessor switch for Grid-Independent model development.
    • EXTERNAL_FORCING=yes: Activates the EXTERNAL_FORCING C-preprocessor switch for Grid-Independent model development.

--Bob Y. 16:20, 7 September 2012 (EDT)

Post-release patches

The following fixes were implemented after the official release of v9-01-03.

Fix for regridding error in offline CO2 simulation

We have corrected this issue as a post-release patch on 22 Sep 2012. This issue does not affect the full-chemistry simulations, only the CO2 simulation.

Ray Nassar wrote:

There is a bug in v9-01-03 for the CO2 simulation that causes a crash. It relates to the MAP_A2A regridding and the fact that the net terrestrial exchange file is named with geos.1x1 (360x181) although it is actually generic 1x1 (360x180) and it is trying to be read as geos.1x1.

Bob Yantosca wrote:

I fixed the issue in the CO2 code. To avoid further confusion, I made a symbolic link in the data directory:
   cd /as/data/geos/GEOS_1x1/CO_201003
   ln –s Net_terrestrial_exch_5.29Pg.geos.1x1 Net_terrestrial_exch_5.29Pg.generic.1x1
and then I made these changes in the code:
         ! Arrays and pointers
         REAL*4                 :: ARRAY    (IIPAR,JJPAR,1)
         REAL*4                 :: ARRAY_1x1(I1x1,J1x1-1,1)
         REAL*8,  TARGET        :: GEN_1x1  (I1x1,J1x1-1,1)
         REAL*8,  TARGET        :: GEOS_GRID(IIPAR,JJPAR,1)
         REAL*8,  POINTER       :: INGRID (:,:) => NULL()
         REAL*8,  POINTER       :: OUTGRID(:,:) => NULL()

         . . .
 
         !------------------------------------
         ! Read climatological Bionet data
         !------------------------------------       
         IF ( LBIONETCLIM ) THEN

            ! TAU value for start of "generic" year 2000
            TAU = GET_TAU0( 1, 1, 2000 )
   
   !-----------------------------------------------------------------------------
   !%%% v9-01-03 POST-RELEASE PATCH (bmy, 10/2/12)
   !%%% NOTE: Someone mislabeled the Net_terrestrial_exch file, it is labeled
   !%%% "geos.1x1" but is on the GENERIC 1x1 grid.  Therefore, we shall rename
   !%%% this file accordingly and use the generic grid indices (I1x1,J1x1-1)
   !%%% etc. below. (bmy, 10/2/12)
   !%%%         ! Filename
   !%%%         FILENAME = TRIM( DATA_DIR_1x1 )  //  
   !%%%     &              'CO2_201003/Net_terrestrial_exch_5.29Pg.geos.1x1'
   !%%% 
   !%%%         ! Echo info
   !%%%         WRITE( 6, 100 ) TRIM( FILENAME )
   !%%%
   !%%%         ! Read Net Terrestrial CO2 Exchange [molec/cm2/s]
   !%%%         CALL READ_BPCH2( FILENAME, 'CO2-SRCE', 6, 
   !%%%     &                    TAU,       I1x1,      J1x1      
   !%%%     &                    1,         ARRAY,     QUIET=.TRUE. )
   !%%%
   !%%%         ! Cast to REAL*8 before regridding
   !%%%         GEOS_1x1(:,:,1) = ARRAY(:,:,1)
   !%%%
   !%%%         ! File with lat/lon edges for regridding
   !%%%         LLFILENAME = TRIM( DATA_DIR_1x1) //
   !%%%     &                'MAP_A2A_Regrid_201203/MAP_A2A_latlon_geos1x1.nc'
   !%%%
   !%%%         ! Regrid from GEOS 1x1 --> current model resolution
   !%%%         INGRID  => GEOS_1x1 (:,:,1)
   !%%%         OUTGRID => GEOS_GRID(:,:,1)
   !%%%         CALL DO_REGRID_A2A( LLFILENAME, I1x1,    J1x1, 
   !%%%     &                       INGRID,     OUTGRID, PERAREA=0,
   !%%%     &                       netCDF=.TRUE.                   )
   !-----------------------------------------------------------------------------
                 
            ! Filename
            FILENAME = TRIM( DATA_DIR_1x1 )                      //  
        &              'CO2_201003/'                             //
        &              'Net_terrestrial_exch_5.29Pg.generic.1x1'
     
            ! Echo info
            WRITE( 6, 100 ) TRIM( FILENAME )

            ! Read Net Terrestrial CO2 Exchange [molec/cm2/s]
            CALL READ_BPCH2( FILENAME, 'CO2-SRCE', 6, 
        &                    TAU,       I1x1,      J1x1-1,
        &                    1,         ARRAY_1x1, QUIET=.TRUE. )

            ! Cast to REAL*8 before regridding
            GEN_1x1(:,:,1) = ARRAY_1x1(:,:,1)

            ! File with lat/lon edges for regridding
            LLFILENAME = TRIM( DATA_DIR_1x1)            //
        &                'MAP_A2A_Regrid_201203/'       //
        &                'MAP_A2A_latlon_generic1x1.nc'

            ! Regrid from GEOS 1x1 --> current model resolution
            INGRID  => GEN_1x1  (:,:,1)
            OUTGRID => GEOS_GRID(:,:,1)
            CALL DO_REGRID_A2A( LLFILENAME, I1x1,    J1x1-1, 
        &                       INGRID,     OUTGRID, PERAREA=0,
        &                       netCDF=.TRUE.                   )

        ! Free pointers
        NULLIFY( INGRID, OUTGRID )
        
        ... etc ...    

I pushed these to the GEOS_Chem repository (and also the GC_Bleeding_Edge repository). You can get it with:

    git pull git://git.as.harvard.edu/bmy/GEOS-Chem master

The commit was tagged with “Fix_for_CO2_sim” and is labeled:

   v9-01-03 post-release patch to fix bug in CO2 simulation
   

--Bob Y. 13:35, 2 October 2012 (EDT)

Bug fix for improving speedup in calcrate.F

We have just discovered a issue after the release of v9-01-03 that may be causing the full-chemistry simulation to take longer to execute than is necessary. When the Bromine chemistry updates were added, a this DO loop over all lons/lats/levels was placed within subroutine calcrate.F:

      REAL*8  :: QLIQ(IIPAR,JJPAR,LLPAR), QICE(IIPAR,JJPAR,LLPAR)
      darea  = 0d0
#if defined( GEOS_5 ) || defined( MERRA ) || defined( GEOS_57 )
      QICE      = QI
      QLIQ      = QL
#else
      ! GEOS-4 and GCAP do not have QI or QL variables. Make same assumption
      ! as we do in wetscav_mod.F.
      DO I=1,IIPAR
      DO J=1,JJPAR
      DO L=1,LLPAR
         IF ( T(I,J,L) .LE. 248d0 ) THEN
            QLIQ(I,J,L) = 0d0
         ELSE IF ( T(I,J,L) .GE. 268d0 ) THEN
            QLIQ(I,J,L) = 1d-6
         ELSE
            QLIQ(I,J,L) = 1d-6 * ( ( T(I,J,L) - 248d0 ) / 20d0 )
         ENDIF
      ENDDO
      ENDDO
      ENDDO
      QICE = 1d-6 - QLIQ
#endif

But calcrate.F itself is called from within a parallel loop from a higher level routine. This means that calcrate.F only works on a few grid boxes at a time, and not the whole globe. The extra DO loop over all lons/lats/levels from within calcrate.F is therefore unnecessary. The extra iterations DO NOT appear to impact the scientific results, but they do add extra CPU cycles to the simulation.

We have rewritten the QICE and QLIQ arrays so that they are dimensioned with KBLOOP instead of IIPAR,JJPAR,LLPAR. We have also disabled a debug print statement in the routine cldice_HbrHOBr_rxn.F.

We have pushed update this to the GEOS_Chem repository on 04 Oct 2012 (Git commit named "Remove potential parallelization bottleneck in calcrate.F").

--Bob Y. 12:27, 4 October 2012 (EDT)

Fixed typos in vdiff_mod.F90

When we call routine SETEMIS from within the non-local PBL mixing scheme (VDIFF</tt), then we have to change this line:

!-------------------------------------------------------------------------------
! Prior to 10/2/12:
! Need to also pass a value to the am_I_Root argument of setemis.F
! (mpayer, bmy, 10/2/12)
!          CALL SETEMIS( EMISRR, EMISRRN )
!-------------------------------------------------------------------------------
          CALL SETEMIS( EMISRR, EMISRRN, .TRUE. )

The third argument of SETEMIS is <tt>am_I_Root, which is a modification for the Grid-independent GEOS-Chem project.

--Bob Y. 12:40, 4 October 2012 (EDT)

Bug fix for Intel Fortran Compiler 12

Prasad Kasibhatla wrote:

I am experiencing the IFORT 12 compile failure of GEOS-Chem v9-01-03 with nested grid options turned on in define.h. The compile seems to be failing in strat_chem_mod.F90 (see end of this msg). And to add - the compile succeeds for v9-01-03l with IFORT 12. I noticed that strat_chem_mod.F90 appeared post-v9-01-03l.
   ifort -cpp -w -O2 -auto -noalign -convert big_endian -vec-report0 -mcmodel=medium -i-dynamic 
   -fp-model source -openmp -Dmultitask -I../Headers -module ../mod -I/opt/geos-netcdf-4/include 
   -c -free strat_chem_mod.F90
   : catastrophic error: **Internal compiler error: segmentation violation signal raised** 
   Please report this error along with the circumstances in which it occurred in a Software Problem Report.  
   Note: File and line given may not be explicit cause of this error.
   compilation aborted for strat_chem_mod.F90 (code 1)
   make[3]: *** [strat_chem_mod.o] Error 1
   make[3]: Leaving directory `/nfs/fire/psk9/Code.v9-01-03/GeosCore'
   make[2]: *** [lib] Error 2
   make[2]: Leaving directory `/nfs/fire/psk9/Code.v9-01-03/GeosCore'
   make[1]: *** [all] Error 2
   make[1]: Leaving directory `/nfs/fire/psk9/Code.v9-01-03/GeosCore'
   make: *** [all] Error 2 

Bob Yantosca wrote:

I have this version of IFORT installed locally:
   [67 bmy Code.v9-02]% ifort -V
   Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.3.293 Build 20120212
   Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
   FOR NON-COMMERCIAL USE ONLY
And I got the exact same error as you did. I looked on the internet and it seemed that the issue is related to how IFORT 12 deals w/ OpenMP DO loops (click HERE and HERE).
A little brute-force debugging revealed the offending parallel DO loop in strat_chem_mod.F90, in routine CALC_STE:
   ! Determine mean tropopause level for the period
   !$OMP PARALLEL DO                               &
   !$OMP DEFAULT( SHARED )                         &
   !$OMP PRIVATE( I,  J  )
   DO J = 1,JJPAR
   DO I = 1,IIPAR
      LTP(I,J) = NINT( TPauseL(I,J) / TPauseL_Cnt )
   ENDDO
   ENDDO
   !$OMP END PARALLEL DO
I also noticed that this DO loop is only executed for global simulations. Immediately preceding it there is an #if statement that exits out of the routine if you are doing an nested grid run:
   #if defined( NESTED_NA ) || defined( NESTED_CH ) || defined( NESTED_EU )
       ! This method only works for a global domain.
       ! It could be modified for nested domains if the total mass flux across the
       ! boundaries during the period is taken into account.
       RETURN
   #endif
So given that this code doesn’t get used for nested runs, I added an #else block so that the code isn’t compiled in when you compile for nested grids:
   #if defined( NESTED_NA ) || defined( NESTED_CH ) || defined( NESTED_EU )
       ! This method only works for a global domain.
       ! It could be modified for nested domains if the total mass flux across the
       ! boundaries during the period is taken into account.
       RETURN
   !------------------------------------------------------------------------------
   ! Prior to 10/5/12:
   ! Since the rest of this code isn't needed for the nested grid, wrap it
   ! in an #else statement.  This might help the code to compile for IFORT 12.
   !#endif
   !------------------------------------------------------------------------------
   #else

       ! Determine mean tropopause level for the period
       !$OMP PARALLEL DO                               &
       !$OMP DEFAULT( SHARED )                         &
       !$OMP PRIVATE( I,  J  )
       DO J = 1,JJPAR
       DO I = 1,IIPAR
          LTP(I,J) = NINT( TPauseL(I,J) / TPauseL_Cnt )
       ENDDO
       ENDDO
       !$OMP END PARALLEL DO

       ... etc ...

   #endif

     END SUBROUTINE Calc_STE
I’ve compiled this with the NA nested grid, the CH nested grid, and for 2 x 2.5 and 4 x 5 global GEOS-5 simulations, and the code does not get that compilation error. I’ve pushed this to the GEOS-Chem repository as a last-minute bug fix. I’m not sure why the error happens in the first place w/ the IFORT 12 compiler, but in any case, this fixes it.

--Bob Y. 13:52, 5 October 2012 (EDT)

Outstanding issues not yet resolved in v9-01-03

The following issues shall be corrected in a future version.

Negative ship emissions caused by PARANOX

Bob Yantosca wrote:

I found that in some grid boxes the INT_OPE quantity from PARANOX is going negative, which is probably causing my runs to die. Here are some outputs for 2005/08/01 at 1:30 GMT (the problem time):
   With TURBDAY PBL mixing (run dies):

   ### JLOOP   :        12447          11=IDEOX
   ### int_ope :  -0.1077172
   ### frac_nox:   0.7866639
   ### ship    :   0.425996044565739 
   ### EMIS_BL :  -6.823105207003066E+019
   ### VOLUME  :   1.043702600336568E+018
   ### REMIS :   -65.3740366729256

   With Non-local PBL mixing (run does not die):

   ### JLOOP   :        12447          11=IDEOX
   ### int_ope :  -3.7102826E-02
   ### frac_nox:   0.7883647
   ### ship    :   0.425996044565739
   ### EMIS_BL :  -2.331458316043083E+019
   ### VOLUME  :   1.043702600336568E+018
   ### REMIS :   -22.3383396313399
Note that in both cases, INT_OPE is negative. However, when TURBDAY PBL mixing is used, INT_OPE causes the REMIS emissions array to be 3X more negative. This probably causes SMVGEAR not to be able to converge. (Why it doesn’t choke when the Non-local PBL mixing (aka NLPBL) is turned on may just be a matter of how sensitive SMVGEAR is to negative inputs; maybe that run would eventually die at some later point, we don’t know.)
I have implemented a kludge in this section of calcrate.F in order to prevent negative emissions from going to the solver:
              !========================================================
              ! SHIP O3 emissions [molec/box/s]
              ! Distribute emissions thru the entire boundary layer
              !========================================================
              . . .  

              ! Loop over the boundary layer
              DO L = 1, TOP
                 . . .
                 
                 IF ( JLOOP /= 0 ) THEN
                    . . .
                   
                    ! Convert ship O3 emissions from [molec NO/box/s]
                    ! to [molec NO/cm3/s] and store in the REMIS array
                    REMIS(JLOOP,IDEOX) = REMIS(JLOOP,IDEOX) + 
    &                                    EMIS_BL / VOLUME(JLOOP)

                    !%%% DO NOT LET NEGATIVE SHIP EMISSIONS GET  
                    !%%% ARCHIVED INTO REMIS (bmy, mpayer, 6/20/12)
                    IF ( REMIS(JLOOP,IDEOX) < 0d0 ) THEN
                       REMIS(JLOOP,IDEOX) = 0d0
                    ENDIF
                 ENDIF
              ENDDO

Geert Vinken wrote:

Negative O3 emissions are physical, as O3 could be titrated by the NO in the plume. Especially during night and winter conditions I expect this to happen. I put them in as negative emissions, do you think this should be changed somehow?

Bob Yantosca wrote:

I am not 100% convinced that negative emissions are good for the chemical solver. We need to study that further. Even if we do not apply the above kludge when NLPBL=.TRUE. then we don't really know if that will cause the code to choke after several months. Until we get a chance to study this in more depth I would keep the kludge as-is, and make a note of it for now.
Also, the way we have implemented the kludge is that we do allow for negative production efficiencies to reduce the total emissions, but just that we don't reduce them below zero. I think that is a reasonable compromise for the time being.

--Bob Y. 12:07, 29 August 2012 (EDT)

IFORT 12 issues

Some users have reported compilation issues with version 12 of the Intel Fortran Compiler. If possible, we recommend staying with Intel Fortran Compiler version 11. We are investigating.

--Bob Y. 12:42, 4 October 2012 (EDT)

Bug fix in hdf_mod.F

Sajeev Philip wrote:

Bug fix in hdf_mod.F (line 155):

     DO J = 0, NJ-1
        LAT(J+1) = GET_YMID(J+JMIN,1,1)
     ENDDO

should be

     DO J = 0, NJ-1
        LAT(J+1) = GET_YMID(1,J+JMIN,1)
     ENDDO

Otherwise, LAT variable in HDF files will be wrong.

Tagged CO simulation dies with compilation errors

We discovered some minor errors in the tagged CO simulation after the release of v9-01-03. These are now corrected in GEOS-Chem v9-02.

--Bob Y. 11:30, 23 October 2012 (EDT) http://wiki.seas.harvard.edu/geos-chem/index.php/GEOS-Chem_v9-02#Bug_fixes_for_tagged_CO_simulation