Difference between revisions of "Centralized chemistry time step"

From Geos-chem
Jump to: navigation, search
(Overview)
(Overview)
Line 4: Line 4:
  
 
== Overview ==
 
== Overview ==
 
The ideal configuration (i.e. the one that minimizes the operator splitting error) is to have the chemistry operation done in the middle of a symmetric number of transport operations.
 
  
 
By "transport operation" (noted as "T" in the diagrams below) we mean the following dynamical operations:
 
By "transport operation" (noted as "T" in the diagrams below) we mean the following dynamical operations:
Line 20: Line 18:
 
# Chemistry
 
# Chemistry
  
Prior to [[GEOS-Chem v9-01-02]], the chemistry was always computed at the top of the hour, regardless of model resolution.  Therefore, we had these configurations for 4° x 5° and 2° x 2.5° resolution simulations:
+
Prior to [[GEOS-Chem v9-01-02]], the chemistry was always computed at the beginning of the chemistry timestep (which for a 60-minute timestep corresponded to the top of each hour).  This is illustrated by the following image:
 +
 
 +
 
 +
regardless of model resolution.  Therefore, we had these configurations for 4° x 5° and 2° x 2.5° resolution simulations:
  
 
  4 x 5 resolution -- prior to v9-01-02
 
  4 x 5 resolution -- prior to v9-01-02

Revision as of 17:05, 20 October 2011

NOTE: Page under construction

On this page we provide information about the modification made to GEOS-Chem v9-01-02 which moves the time at which the chemistry, emissions, photolysis, and drydep operations are performed.

Overview

By "transport operation" (noted as "T" in the diagrams below) we mean the following dynamical operations:

  1. Advection
  2. PBL mixing
  3. Convection

By "chemistry operation" (noted as "C" in the diagrams below), we mean the solving of the chemical mechanism matrix, plus the related operations that are used to compute reaction rates, i.e.

  1. Emissions
  2. Dry deposition
  3. Photolysis
  4. Chemistry

Prior to GEOS-Chem v9-01-02, the chemistry was always computed at the beginning of the chemistry timestep (which for a 60-minute timestep corresponded to the top of each hour). This is illustrated by the following image:


regardless of model resolution.  Therefore, we had these configurations for 4° x 5° and 2° x 2.5° resolution simulations:
4 x 5 resolution -- prior to v9-01-02
Default transport timestep = 30 min
Default chemistry timestep = 60 min
---------------------------------------------------------
GMT time:        00:00  00:30  01:00  01:30  02:00 ...
Operations:      TC     T      TC     T      TC
Photolysis time:        *             *


2 x 2.5 resolution -- prior to v9-01-02
Default transport timestep = 15 min
Default chemistry timestep = 60 min
---------------------------------------------------------
GMT time:        00:00  00:15  00:30  00:45  01:00 ...
Operations:      TC     T      T      T      TC 
Photolysis time:               *            

NOTE: The photolysis was computed just before the chemistry was performed. However, the sun angles that feed into the computation of the photolysis were always offset to the center of the chemistry timestep.

As you can see, the "chemistry operation" is not placed after a symmetric number of chemistry calls.


More text to be added.

--Bob Y. 16:55, 7 October 2011 (EDT)

Prior to GEOS-Chem v9-01-02, the order of operations was done

Current set up:

2x2.5:
timestep 1 : transport (15min) + Chemistry (60min)
timestep 2: transport (15 min)
timestep 3 : transport (15min)
timestep 4: transport (15 min)--------------------------->output
timestep 5 : transport (15min) + Chemistry (60min)
timestep 6: transport (15 min)
timestep 7 : transport (15min)
timestep 8: transport (15 min)--------------------------->output 

Fix: (provided by Lin Zhang) In time_mod.f, change this line

FLAG = ( MOD( ELAPSED_MIN, TS_CHEM ) == 0 )

to

      ! changes for proper chemistry time (lzh, ccc, 03/20/2010)
      INTEGER :: M

      !=================================================================
      ! ITS_TIME_FOR_CHEM begins here!
      !=================================================================

      ! Get multiplier between transport and chemistry:
      M = TS_CHEM/TS_DYN

      ! Divide by 2 (get middle). KEEP INTEGERS!!!!
      M = MAX( M/2, 1 )

      ! Is it time for chemistry?
      !FLAG = ( MOD( ELAPSED_MIN, TS_CHEM ) == 0 )
      FLAG = ( MOD( ELAPSED_MIN, TS_CHEM ) == (M-1)*TS_DYN )

      ! Might be M+1 or M didn't think it through completely. And we may want
      ! to calculate M only once, so put it as a module variable
      ! (and change the name)

In this way, chemistry time step is put in the center of transport time steps.


Problem when calling planeflight diagnostics

This code caused the model to crash when you call planeflight diagnostics.

Because originally in main.f,
TS_DYN=15min
TS_CHEM=60min
TS_DIAG=60min

TCTTT(T is transport, C is chemistry)

ITS_TIME_FOR_DYN()-->FLAG = ( MOD( ELAPSED_MIN, TS_DYN ) == 0 )--> Do dynamics
ITS_TIME_FOR_CHEM()-->FLAG = ( MOD( ELAPSED_MIN, TS_CHEM ) == 0 )--> Do chemistry (call setup_planeflight based on ITS_A_NEW_DAY in chemdr.f)

CALL TIMESTAMP_DIAG
CALL SET_ELAPSED_MIN-->ELAPSED_MIN = ELAPSED_MIN + TS_DYN--> after this is done, it is not a new day any more.
CALL SET_CURRENT_TIME

ITS_TIME_FOR_DIAG() -->FLAG = ( MOD( ELAPSED_MIN, TS_DIAG ) == 0 )-->including call Planeflight.

Since we move chemistry time step to the middle of transport, TTCTT, chemdr.f won't call setup_planeflight anymore. So the model will crash when it calls planeflight during diag output (no initialization).

Fix provided by Bob Y.

replace these lines in chemdr.f

IF ( ND40 > 0 .and. ITS_A_NEW_DAY() ) THEN
CALL SETUP_PLANEFLIGHT
ENDIF

with:

        INTEGER                  :: DATE                         
        INTEGER, SAVE            :: DATE_PREV = -1   
................
      !=================================================================
      ! At the beginning of each new day, call SETUP_PLANEFLIGHT
      ! to see if there are any plane flight points to be processed
      !=================================================================

      ! Get todays' date
      DATE = GET_NYMD()
    
      ! If this is the first chem timestep of a new day, then we need to 
      ! call SETUP_PLANEFLIGHT.  If chemistry is turned on, then we need
      ! to place this call here, so as to make sure that the chemical
      ! mechanism files (read by READER and READCHEM) have been loaded.
      IF ( ND40 .and. DATE /= DATE_PREV ) THEN
         print*, '### Called SETUP_PLANEFLIGHT'
         CALL SETUP_PLANEFLIGHT
         DATE_PREV = DATE
      ENDIF

The idea is that you want to call SETUP_PLANEFLIGHT on the first chemical timestep of a new day. However, this is no longer just when NHMS == 000000. A better way to test that just to see when the date is not the same as the previous date.

--Jmao 14:17, 14 June 2011 (EDT)

Small fix for chemistry time step

Lin Zhang provided the following fix. In GeosCore/diag_pl_mod.f, change line 1021

IF ( MOD( HOUR + CHEM, 24d0 ) == 0 ) THEN

to

IF ( HOUR + CHEM .GE. 24d0 ) THEN

--Melissa Payer 14:36, 27 September 2011 (EDT)