Derived type objects used by GEOS-Chem

From Geos-chem
Jump to: navigation, search

On this page we shall describe the new derived-type objects that were added to GEOS-Chem as part of our GEOS-Chem HP developement effort.

Overview

To facilitate connecting GEOS-Chem with the NASA GEOS-5 GCM (as well as creating a standalone HPC-enabled version of GEOS-Chem), we (the GEOS-Chem Support Team) have restructured how data flows between GEOS-Chem's modules and routines.

Previous programming practice in GEOS-Chem

In the past, we relied on USE statements to import variables declared in other modules into GEOS-Chem subroutines and functions. You will typically see several USE statements at the top of most GEOS-Chem subroutines and functions, such as:

      USE TRACER_MOD,  ONLY : STT
      USE DAO_MOD,     ONLY : UWND, VWND
      USE LOGICAL_MOD, ONLY : LCHEM

Although this is perfectly allowable Fortran-90 syntax, this is not a good example of top-down programming. In top-down programming, all variables and input data are passed in and out of each routine via the argument list. This allows you to see precisely which variables are entering and leaving each routine. In addition, you have the option of protecting each argument by assigning it an INTENT acoderibute. For example, you will see arguments to many GEOS-Chem subroutines declared like this:

     SUBROUTINE MYSUB( X, Y, Z )

     INTEGER, INTENT(IN)    :: X   ! Read-only  : X will not be modified within the subroutine 
     INTEGER, INTENT(INOUT) :: Y   ! Read-write : Y will enter with a value, and leave w/ a new value
     INTEGER, INTENT(OUT)   :: Z   ! Write-only : Z will leave with a new value (overwriting any previous value)

The INTENT statements will alert the compiler if you are trying to modify an argument that was not meant to be modified. For example, if you try to change the value of X within the subroutine MYSUB, then you will compile-time error stating that X cannot be modified, because it is declared with INTENT(IN).

We often need to pass many (i.e. tens or hundreds) of variables and arrays between GEOS-Chem's moduleRs and subroutines. In practice, it is cumbersome to work with subroutines and/or function having more than 20 individual arguments. In order to facilitate passing a large number of variables between subroutines, we have started to implement derived-type objects into GEOS-Chem.

Using derived-type objects to replace USE statements

You already know about Fortran's basic data types:

  1. CHARACTER
  2. LOGICAL
  3. INTEGER
  4. REAL*4 (aka REAL)
  5. REAL*8 (aka DOUBLE PRECISION)
  6. COMPLEX

With these types you can create variables to hold alphabetical data of different lengths and numerical data with different precision. Fortran-90 adds the ability to create your own derived data types. A derived type functions similarly to an IDL structure, in that you can bundle several different fields (arrays or scalars) together into a single package.

Just as you create variables from the basic Fortran types, you can create objects from Fortran derived types. Think of the derived type as being the blueprint that you want the object to follow. Objects based on derived types offer you a convenient method of passing several individual variables between subroutines and functions. You simply create the object at the highest level of your code (i.e. your "main" program) and fill it with data. Then you pass the object as an argument to each lower-level subroutine.

For example, this statement creates the Fortran derived type MyType:

     TYPE :: MyType
       INTEGER         :: var_1          ! This is a scalar 
       REAL*8          :: A              ! This is another scalar field
       REAL*8          :: B              ! Yet another scalar field
       REAL*8          :: C              ! Yet another scalar field
       INTEGER,        :: array_fixed(3) ! This is a fixed array field
       REAL*8, POINTER :: array_1d(:)    ! This is a dynamic 1-D array field
       REAL*8, POINTER :: array_2d(:,:)  ! This is a dynamic 2-D array field
     END TYPE My Type

And this statement creates an object based on derived type MyType:

     TYPE(MyType) :: MyObject

You can refer to fields of a derived type object with the % operator. For example:

     MyObject%array_1d = 0d0
     MyObject%A        = 25.47d0
     MyObject%B        = SQRT( MyObject%A )
     print*, MyObject%C 

Things to note:

  • The individual fields of a derived type object may be of any basic data type (i.e. CHARACTER, INTEGER, REAL*4, REAL*8, COMPLEX, etc.) or may be of another derived type.
  • Individual fields in a derived-type object may be either scalars or arrays.
  • The dimensions of array fields in derived type objects may be:
    • Fixed (i.e. set with a constant value), such as: MyObject%array_fixed, or
    • Dynamic (i.e. assigned at run time), such as: MyObject%array_1d, My_Object%array_2d
  • The Fortran-90 standard states dynamically-allocated array fields of a derived-type object have to be declared with the POINTER attribute instead of the ALLOCATABLE attribute.
  • You can allocate memory to dynamic array fields of a derived-type object in the same manner as you would for an ALLOCATABLE module array:
     IF ( .not. ASSOCIATED( MyObject%array_2d ) ) THEN
        ALLOCATE( MyObject%array_2d( 100, 500 ), STAT=AS )
     ENDIF
  • You can deallocate a dynamic array field of a derived-type object like this:
     IF ( ASSOCIATED( MyObject%array_2d ) ) DEALLOCATE( MyObject%array_2d )
  • Note that when inquiring about whether any memory has been given to an array with the POINTER attribute, you must use the ASSOCIATED() function instead of the ALLOCATED() function, as you would for allocatable arrays.

For better compatibility with the Earth System Model Framework (ESMF) interface used by the GEOS-5 GCM, we have started to replace many of the USE statements—our time-honored method of referring to global variables contained within GEOS-Chem's modules—with objects created from derived types. As you peruse the GEOS-Chem source code, you will see the derived types and objects listed below. In GEOS-Chem v9-02, we now pass these derived type objects to many GEOS-Chem subroutines. As testing continues, you may see some of these derived type objects segregated from the existing code with #if defined( DEVEL ) blocks. These objects will be added to the standard code once we have validated these source code modifications. We will eventually remove all USE statements referring to variables.

IMPORTANT NOTE: It is still permissible to utilize USE statements in order to reference the following program elements:

  1. Subroutines or functions belonging to other modules, e.g.:
    • USE CHEMISTRY_MOD, ONLY : DO_CHEMISTRY
  2. Derived type declarations belonnging to other modules, e.g.:
    • USE Input_Opt_Mod, ONLY : OptInput
  3. Defined PARAMETER constants belonging to other modules, e.g.:
    • USE PhysConstants, ONLY : PI

But we are seeking to replace importing variables (arrays & scalars) from other GEOS-Chem modules via USE statements with derived types.

New derived types used by GEOS-Chem

We are introducing three new derived type objects into GEOS-Chem v9-02 and higher versions. These are:

  1. The Input Options object (aka (Input_Opt)
  2. The Chemistry State object (aka State_Chm)
  3. The Meteorology State object (aka State_Met)

These are passed via the argument list to the various GEOS-Chem subroutines and functions. A typical GEOS-Chem subroutine header that has been modified for grid-independent functionality will now look like this:

!
! !INTERFACE:
!
      SUBROUTINE MY_GEOS_CHEM_SUB( am_I_Root, Input_Opt, State_Met, State_Chm, RC  )
!
! !USES:
! 
      USE ErrCode_Mod
      USE Input_Opt_Mod, ONLY : OptInput
      USE State_Chm_Mod, ONLY : ChmState
      USE State_Met_Mod, ONLY : MetState
!
! !INPUT PARAMETERS:
!
      LOGICAL,        INTENT(IN)    :: am_I_Root   ! Are we on the root CPU?
      TYPE(OptInput), INTENT(IN)    :: Input_Opt   ! Input Options object
      TYPE(MetState), INTENT(IN)    :: State_Met   ! Meteorology State object
!
! !INPUT/OUTPUT PARAMETERS:
!      
      TYPE(ChmState), INTENT(INOUT) :: State_Chm   ! Chemistry State object
!
! !OUTPUT PARAMETERS:
!
      INTEGER,        INTENT(OUT)   :: RC          ! Success or failure?

In addition to the Input Options, Meteorology State, and Chemistry State objects, we also pass two additional arguments:

Variable Description
am_I_Root Logical flag to denote if we are on the root CPU. In the ESMF environment, we need to restrict file I/O and screen output to the root CPU, so that we do not swamp the system. This flag does not apply when using the traditional GEOS-Chem without ESMF.
RC Error return code: This variable will return a value denoting success or failure (values for success or failure are contained in module Headers/errcode_mod.F90). A successful return will have a zero value; a non-successful return will have a non-zero value (like -1). When we connect GEOS-Chem to the ESMF environment, if the code dies with an error, we will need to return the error code all the way up to the top level of the code (the driver routine) and then handle the error there. We are working on implementing this feature in the code, but it will be some time before it is completely ready.

More information on the derived-type objects may be found in the following sections.

--Bob Yantosca (talk) 19:33, 17 March 2017 (UTC)

The Input Options object

The Input Options object (Input_Opt) holds settings such as logical flags, directory paths, and other input options that are read in from ASCII input files such as input.geos. This derived-type object has now made several previous GEOS-Chem modules obsolete:

  1. GeosCore/logical_mod.F
  2. GeosCore/diag_mod.F
  3. GeosCore/tracer_mod.F
  4. GeosUtil/directory_mod.F
  5. GeosUtil/unix_cmds_mod.F

Declaration

The Input Options object is passed as a read-only argument to GEOS-Chem subroutines and functions. It is declared as follows:

!
! !USES:
!
      USE Input_Opt_Mod, ONLY : OptInput   ! Derived type declaration
!
! !INPUT PARAMETERS:
! 
      TYPE(OptInput), INTENT(IN) :: Input_Opt   ! Input Options object (read-only)

NOTE: The module containing the OptInput derived type was renamed from gigc_input_opt_mod.F90 to input_opt_mod.F90 in GEOS-Chem v11-01.

Values read in from the master input file input.geos are copied to the Input Options object in module GeosCore/input_mod.F.

At present, the Input Options object only holds information from the input.geos file. We plan on extending it to hold information from other ASCII input files in the near future.

--Bob Yantosca (talk) 21:12, 17 March 2017 (UTC)

Derived type OptInput

The derived type OptInput is defined in Headers/input_opt_mod.F90. Right now, this derived type contains all of the fields that are read in from the input.geos file. We may add other fields to this derived type in the near future.

  • Fields in RED were removed from v11-02a and higher versions.
  • Fields in GREEN were added to v11-02a and higher versions.
  TYPE, PUBLIC :: OptInput

     !----------------------------------------
     ! General Runtime & Distributed Comp Info
     !----------------------------------------
     INTEGER                     :: NPES      ! Number of MPI procs
     INTEGER                     :: myCpu     ! Local MPI process handle
     INTEGER                     :: MPICOMM   ! MPI Communicator Handle
     LOGICAL                     :: HPC       ! Is this an HPC (ESMF or otherwise) sim?
     LOGICAL                     :: RootCPU   ! Is this the root cpu?

     !----------------------------------------
     ! SIZE PARAMETER fields
     !----------------------------------------
     INTEGER                     :: MAX_DIAG
     INTEGER                     :: MAX_TRCS
     INTEGER                     :: MAX_MEMB
     INTEGER                     :: MAX_FAMS
     INTEGER                     :: MAX_DEP
     INTEGER                     :: MAX_FAM
     INTEGER                     :: MAX_SPC

     !----------------------------------------
     ! SIMULATION MENU fields 
     !----------------------------------------
     INTEGER                     :: NYMDb              
     INTEGER                     :: NHMSb              
     INTEGER                     :: NYMDe              
     INTEGER                     :: NHMSe              
     CHARACTER(LEN=255)          :: RUN_DIR            
     CHARACTER(LEN=255)          :: IN_RST_FILE        
     CHARACTER(LEN=255)          :: DATA_DIR           
     CHARACTER(LEN=255)          :: CHEM_INPUTS_DIR
     CHARACTER(LEN=255)          :: RES_DIR
     CHARACTER(LEN=255)          :: GCAP_DIR           
     CHARACTER(LEN=255)          :: GEOS_4_DIR         
     CHARACTER(LEN=255)          :: GEOS_5_DIR         
     CHARACTER(LEN=255)          :: GEOS_FP_DIR        
     CHARACTER(LEN=255)          :: MERRA_DIR          
     CHARACTER(LEN=255)          :: MERRA2_DIR          
     CHARACTER(LEN=255)          :: DATA_DIR_1x1       
     CHARACTER(LEN=255)          :: TEMP_DIR           
     LOGICAL                     :: LUNZIP             
     LOGICAL                     :: LWAIT              
     LOGICAL                     :: LVARTROP           
     LOGICAL                     :: LCAPTROP
     REAL(fp)                    :: OZONOPAUSE
     INTEGER                     :: NESTED_I0          
     INTEGER                     :: NESTED_J0          
     CHARACTER(LEN=255)          :: HcoConfigFile

     !----------------------------------------
     ! ADVECTED SPECIES MENU fields
     !----------------------------------------
     INTEGER                     :: N_ADVECT
     CHARACTER(LEN=255), POINTER :: AdvectSpc_Name(:) 
     INTEGER                     :: SIM_TYPE
     CHARACTER(LEN=255)          :: SIM_NAME
     LOGICAL                     :: LSPLIT
     LOGICAL                     :: ITS_A_RnPbBe_SIM
     LOGICAL                     :: ITS_A_CH3I_SIM
     LOGICAL                     :: ITS_A_FULLCHEM_SIM
     LOGICAL                     :: ITS_A_HCN_SIM
     LOGICAL                     :: ITS_A_TAGO3_SIM
     LOGICAL                     :: ITS_A_TAGCO_SIM
     LOGICAL                     :: ITS_A_C2H6_SIM
     LOGICAL                     :: ITS_A_CH4_SIM
     LOGICAL                     :: ITS_AN_AEROSOL_SIM
     LOGICAL                     :: ITS_A_MERCURY_SIM
     LOGICAL                     :: ITS_A_CO2_SIM
     LOGICAL                     :: ITS_A_H2HD_SIM
     LOGICAL                     :: ITS_A_POPS_SIM
     LOGICAL                     :: ITS_A_SPECIALTY_SIM
     LOGICAL                     :: ITS_NOT_COPARAM_OR_CH4

     !----------------------------------------
     ! AEROSOL MENU fields
     !----------------------------------------
     LOGICAL                     :: LSULF              
     LOGICAL                     :: LCRYST             
     LOGICAL                     :: LCARB
     LOGICAL                     :: LBRC              
     LOGICAL                     :: LSOA
     LOGICAL                     :: LMPOA
     LOGICAL                     :: LSVPOA
     LOGICAL                     :: LDUST              
     LOGICAL                     :: LDEAD              
     LOGICAL                     :: LSSALT             
     LOGICAL                     :: LDSTUP
     LOGICAL                     :: LDICARB            
     REAL(fp),           POINTER :: SALA_REDGE_um(:)   
     REAL(fp),           POINTER :: SALC_REDGE_um(:)   
     LOGICAL                     :: LGRAVSTRAT
     LOGICAL                     :: LSOLIDPSC
     LOGICAL                     :: LHOMNUCNAT
     REAL(fp)                    :: T_NAT_SUPERCOOL
     REAL(fp)                    :: P_ICE_SUPERSAT
     LOGICAL                     :: LPSCCHEM
     LOGICAL                     :: LSTRATOD

     !----------------------------------------
     ! EMISSIONS MENU fields
     !----------------------------------------
     LOGICAL                     :: LEMIS
     INTEGER                     :: TS_EMIS
     INTEGER                     :: LBIOFUEL
     LOGICAL                     :: LOTDLOC
     LOGICAL                     :: LSOILNOX
     LOGICAL                     :: LWARWICK_VSLS
     LOGICAL                     :: LSSABr2
     LOGICAL                     :: LFIX_PBL_BRO
     LOGICAL                     :: LCH4EMIS
     LOGICAL                     :: LCH4SBC
     LOGICAL                     :: LOCSEMIS
     LOGICAL                     :: LCFCEMIS
     LOGICAL                     :: LCLEMIS
     LOGICAL                     :: LBREMIS
     LOGICAL                     :: LN2OEMIS
     LOGICAL                     :: LBASICEMIS
     LOGICAL                     :: LSETH2O
     LOGICAL                     :: LSETCH4
     LOGICAL                     :: LSETOCS
     LOGICAL                     :: LSETCFC
     LOGICAL                     :: LSETCL
     LOGICAL                     :: LBRGCCM
     LOGICAL                     :: LSETBR
     LOGICAL                     :: LSETBRSTRAT
     LOGICAL                     :: LSETNOYSTRAT
     LOGICAL                     :: LSETN2O
     LOGICAL                     :: LSETH2SO4
     INTEGER                     :: CFCYEAR
     LOGICAL                     :: LFUTURECFC

     !----------------------------------------
     ! CO2 MENU fields
     !----------------------------------------
     LOGICAL                     :: LFOSSIL
     LOGICAL                     :: LCHEMCO2
     LOGICAL                     :: LBIODIURNAL
     LOGICAL                     :: LBIONETCLIM
     LOGICAL                     :: LOCEAN
     LOGICAL                     :: LSHIP
     LOGICAL                     :: LPLANE
     LOGICAL                     :: LFFBKGRD
     LOGICAL                     :: LBIOSPHTAG
     LOGICAL                     :: LFOSSILTAG
     LOGICAL                     :: LSHIPTAG
     LOGICAL                     :: LPLANETAG

     !----------------------------------------
     ! FUTURE MENU fields
     !----------------------------------------
     LOGICAL                     :: LFUTURE
     INTEGER                     :: FUTURE_YEAR
     CHARACTER(LEN=255)          :: FUTURE_SCEN

     !----------------------------------------
     ! CHEMISTRY MENU fields
     !----------------------------------------
     LOGICAL                     :: LCHEM
     LOGICAL                     :: LSCHEM
     LOGICAL                     :: LLINOZ
     LOGICAL                     :: LSYNOZ
     INTEGER                     :: TS_CHEM
     REAL(fp)                    :: GAMMA_HO2
     LOGICAL                     :: LUCX
     LOGICAL                     :: LCH4CHEM
     LOGICAL                     :: LACTIVEH2O
     LOGICAL                     :: LO3FJX
     LOGICAL                     :: LINITSPEC
     INTEGER, POINTER            :: NTLOOPNCS(:)

     !----------------------------------------
     ! RADIATION MENU fields
     !----------------------------------------
     LOGICAL                     :: LRAD
     LOGICAL                     :: LLWRAD
     LOGICAL                     :: LSWRAD
     LOGICAL, POINTER            :: LSKYRAD(:)
     INTEGER                     :: TS_RAD

     !----------------------------------------
     ! TRANSPORT MENU fields
     !----------------------------------------
     LOGICAL                     :: LTRAN
     LOGICAL                     :: LFILL
     LOGICAL                     :: TPCORE_IORD
     LOGICAL                     :: TPCORE_JORD
     LOGICAL                     :: TPCORE_KORD
     INTEGER                     :: TS_DYN

     !----------------------------------------
     ! CONVECTION MENU fields
     !----------------------------------------
     LOGICAL                     :: LCONV
     LOGICAL                     :: LTURB
     LOGICAL                     :: LNLPBL
     INTEGER                     :: TS_CONV

     !----------------------------------------
     ! DEPOSITION MENU fields
     !----------------------------------------
     LOGICAL                     :: LDRYD
     LOGICAL                     :: LWETD
     REAL(fp)                    :: WETD_CONV_SCAL
     LOGICAL                     :: USE_OLSON_2001
     LOGICAL                     :: PBL_DRYDEP      

     !----------------------------------------
     ! GAMAP MENU fields
     !----------------------------------------
     CHARACTER(LEN=255)          :: GAMAP_DIAGINFO
     CHARACTER(LEN=255)          :: GAMAP_TRACERINFO

     !----------------------------------------
     ! OUTPUT MENU fields
     !----------------------------------------
     INTEGER,            POINTER :: NJDAY(:)

     !----------------------------------------
     ! DIAGNOSTIC MENU fields
     !----------------------------------------
     INTEGER                     :: ND01,             LD01
     INTEGER                     :: ND02,             LD02
     INTEGER                     :: ND03,             LD03
     INTEGER                     :: ND04,             LD04
     INTEGER                     :: ND05,             LD05
     INTEGER                     :: ND06,             LD06
     INTEGER                     :: ND07,             LD07
     INTEGER                     :: ND08,             LD08
     INTEGER                     :: ND09,             LD09
     INTEGER                     :: ND10,             LD10
     INTEGER                     :: ND11,             LD11
     INTEGER                     :: ND12,             LD12
     INTEGER                     :: ND13,             LD13
     INTEGER                     :: ND14,             LD14
     INTEGER                     :: ND15,             LD15
     INTEGER                     :: ND16,             LD16
     INTEGER                     :: ND17,             LD17
     INTEGER                     :: ND18,             LD18
     INTEGER                     :: ND19,             LD19
     INTEGER                     :: ND20,             LD20
     INTEGER                     :: ND21,             LD21
     INTEGER                     :: ND22,             LD22
     INTEGER                     :: ND23,             LD23
     INTEGER                     :: ND24,             LD24
     INTEGER                     :: ND25,             LD25
     INTEGER                     :: ND26,             LD26
     INTEGER                     :: ND27,             LD27
     INTEGER                     :: ND28,             LD28
     INTEGER                     :: ND29,             LD29
     INTEGER                     :: ND30,             LD30
     INTEGER                     :: ND31,             LD31
     INTEGER                     :: ND32,             LD32
     INTEGER                     :: ND33,             LD33
     INTEGER                     :: ND34,             LD34
     INTEGER                     :: ND35,             LD35
     INTEGER                     :: ND36,             LD36
     INTEGER                     :: ND37,             LD37
     INTEGER                     :: ND38,             LD38
     INTEGER                     :: ND39,             LD39
     INTEGER                     :: ND40,             LD40
     INTEGER                     :: ND41,             LD41
     INTEGER                     :: ND42,             LD42
     INTEGER                     :: ND43,             LD43
     INTEGER                     :: ND44,             LD44
     INTEGER                     :: ND45,             LD45
     INTEGER                     :: ND46,             LD46
     INTEGER                     :: ND47,             LD47
     INTEGER                     :: ND48,             LD48
     INTEGER                     :: ND49,             LD49
     INTEGER                     :: ND50,             LD50
     INTEGER                     :: ND51,             LD51
     INTEGER                     :: ND52,             LD52
     INTEGER                     :: ND53,             LD53
     INTEGER                     :: ND54,             LD54
     INTEGER                     :: ND55,             LD55
     INTEGER                     :: ND56,             LD56
     INTEGER                     :: ND57,             LD57
     INTEGER                     :: ND58,             LD58
     INTEGER                     :: ND59,             LD59
     INTEGER                     :: ND60,             LD60
     INTEGER                     :: ND61,             LD61
     INTEGER                     :: ND62,             LD62
     INTEGER                     :: ND63,             LD63
     INTEGER                     :: ND64,             LD64
     INTEGER                     :: ND66,             LD66
     INTEGER                     :: ND67,             LD67
     INTEGER                     :: ND68,             LD68
     INTEGER                     :: ND69,             LD69
     INTEGER                     :: ND70,             LD70
     INTEGER                     :: ND71,             LD71
     INTEGER                     :: ND72,             LD72

     INTEGER                     :: TS_DIAG
     LOGICAL                     :: LPRT
     INTEGER,            POINTER :: TINDEX(:,:)
     INTEGER,            POINTER :: TCOUNT(:) 				  
     INTEGER,            POINTER :: TMAX(:)
     LOGICAL                     :: DO_DIAG_WRITE

     ! Collection ids
     INTEGER                     :: DIAG_COLLECTION
     INTEGER                     :: GC_RST_COLLECTION ! Used only for NetCDF

#if defined( NC_DIAG )
     ! New diagnostic group output types (e.g. 'mean')
     CHARACTER(LEN=15)           :: TRANSPORT_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: WETSCAV_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: DRYDEP_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: SPECIES_CONC_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: SPECIES_EMIS_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: MET_OUTPUT_TYPE

     ! Placeholders pending grouping of diagnostics
     CHARACTER(LEN=15)           :: ND01_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND02_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND12_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND14_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND15_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND16_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND17_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND18_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND19_OUTPUT_TYPE
     CHARACTER(LEN=15)           :: ND30_OUTPUT_TYPE
#endif

     !----------------------------------------
     ! PLANEFLIGHT MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_PF
     CHARACTER(LEN=255)          :: PF_IFILE
     CHARACTER(LEN=255)          :: PF_OFILE

     !----------------------------------------
     ! ND48 MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND48
     CHARACTER(LEN=255)          :: ND48_FILE
     INTEGER                     :: ND48_FREQ
     INTEGER                     :: ND48_N_STA
     INTEGER,            POINTER :: ND48_IARR(:)
     INTEGER,            POINTER :: ND48_JARR(:)
     INTEGER,            POINTER :: ND48_LARR(:)
     INTEGER,            POINTER :: ND48_NARR(:)

     !----------------------------------------
     ! ND49 MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND49
     CHARACTER(LEN=255)          :: ND49_FILE
     INTEGER,            POINTER :: ND49_TRACERS(:)
     INTEGER                     :: ND49_FREQ
     INTEGER                     :: ND49_IMIN
     INTEGER                     :: ND49_IMAX
     INTEGER                     :: ND49_JMIN
     INTEGER                     :: ND49_JMAX
     INTEGER                     :: ND49_LMIN
     INTEGER                     :: ND49_LMAX

     !----------------------------------------
     ! ND50 MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND50
     CHARACTER(LEN=255)          :: ND50_FILE
     LOGICAL                     :: LND50_HDF
     INTEGER,            POINTER :: ND50_TRACERS(:)
     INTEGER                     :: ND50_IMIN
     INTEGER                     :: ND50_IMAX
     INTEGER                     :: ND50_JMIN
     INTEGER                     :: ND50_JMAX
     INTEGER                     :: ND50_LMIN
     INTEGER                     :: ND50_LMAX

     !----------------------------------------
     ! ND51 MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND51
     CHARACTER(LEN=255)          :: ND51_FILE
     LOGICAL                     :: LND51_HDF
     INTEGER,            POINTER :: ND51_TRACERS(:)
     REAL(fp)                    :: ND51_HR_WRITE
     REAL(fp)                    :: ND51_HR1
     REAL(fp)                    :: ND51_HR2
     INTEGER                     :: ND51_IMIN
     INTEGER                     :: ND51_IMAX
     INTEGER                     :: ND51_JMIN
     INTEGER                     :: ND51_JMAX
     INTEGER                     :: ND51_LMIN
     INTEGER                     :: ND51_LMAX

     !----------------------------------------
     ! ND51b MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND51b
     CHARACTER(LEN=255)          :: ND51b_FILE
     LOGICAL                     :: LND51b_HDF
     INTEGER,            POINTER :: ND51b_TRACERS(:)
     REAL(fp)                    :: ND51b_HR_WRITE
     REAL(fp)                    :: ND51b_HR1
     REAL(fp)                    :: ND51b_HR2
     INTEGER                     :: ND51b_IMIN
     INTEGER                     :: ND51b_IMAX
     INTEGER                     :: ND51b_JMIN
     INTEGER                     :: ND51b_JMAX
     INTEGER                     :: ND51b_LMIN
     INTEGER                     :: ND51b_LMAX

     !----------------------------------------
     ! ND63 MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_ND63
     CHARACTER(LEN=255)          :: ND63_FILE
     INTEGER,            POINTER :: ND63_TRACERS(:)
     INTEGER                     :: ND63_FREQ
     INTEGER                     :: ND63_IMIN
     INTEGER                     :: ND63_IMAX
     INTEGER                     :: ND63_JMIN
     INTEGER                     :: ND63_JMAX

     !----------------------------------------
     ! PROD LOSS MENU fields
     !----------------------------------------
     LOGICAL                     :: DO_SAVE_PL
     LOGICAL                     :: LFAMILY
     INTEGER                     :: ND65, LD65
     LOGICAL                     :: DO_SAVE_O3
     INTEGER                     :: NFAM
     REAL(fp),           POINTER :: FAM_COEF(:,:)
     CHARACTER(LEN=255), POINTER :: FAM_MEMB(:,:)
     CHARACTER(LEN=255), POINTER :: FAM_NAME(:  )
     INTEGER,            POINTER :: FAM_NMEM(:  )
     CHARACTER(LEN=255), POINTER :: FAM_TYPE(:  )

     !----------------------------------------
     ! UNIX CMDS fields
     !----------------------------------------
     CHARACTER(LEN=255)          :: BACKGROUND
     CHARACTER(LEN=255)          :: REDIRECT
     CHARACTER(LEN=255)          :: REMOVE_CMD
     CHARACTER(LEN=255)          :: SEPARATOR
     CHARACTER(LEN=255)          :: WILD_CARD
     CHARACTER(LEN=255)          :: UNZIP_CMD
     CHARACTER(LEN=255)          :: ZIP_SUFFIX
     CHARACTER(LEN=1)            :: SPACE

     !----------------------------------------
     ! NESTED GRID MENU fields
     !----------------------------------------
     LOGICAL                     :: ITS_A_NESTED_GRID
     LOGICAL                     :: LWINDO
     LOGICAL                     :: LWINDO2x25
     LOGICAL                     :: LWINDO_NA
     CHARACTER(LEN=255)          :: TPBC_DIR_NA
     LOGICAL                     :: LWINDO_EU
     CHARACTER(LEN=255)          :: TPBC_DIR_EU
     LOGICAL                     :: LWINDO_CH
     CHARACTER(LEN=255)          :: TPBC_DIR_CH
     LOGICAL                     :: LWINDO_AS
     CHARACTER(LEN=255)          :: TPBC_DIR_AS
     LOGICAL                     :: LWINDO_CU
     CHARACTER(LEN=255)          :: TPBC_DIR
     INTEGER                     :: NESTED_TS
     INTEGER                     :: NESTED_I1
     INTEGER                     :: NESTED_J1
     INTEGER                     :: NESTED_I2
     INTEGER                     :: NESTED_J2
     INTEGER                     :: NESTED_I0W
     INTEGER                     :: NESTED_J0W
     INTEGER                     :: NESTED_I0E
     INTEGER                     :: NESTED_J0E

     !----------------------------------------
     ! BENCHMARK MENU fields
     !----------------------------------------
     LOGICAL                     :: LSTDRUN
     CHARACTER(LEN=255)          :: STDRUN_INIT_FILE
     CHARACTER(LEN=255)          :: STDRUN_FINAL_FILE

     !----------------------------------------
     ! MERCURY MENU fields
     !----------------------------------------     
     INTEGER                     :: ANTHRO_Hg_YEAR
     CHARACTER(LEN=255)          :: HG_SCENARIO
     LOGICAL                     :: USE_CHECKS
     LOGICAL                     :: LDYNOCEAN
     LOGICAL                     :: LPREINDHG
     LOGICAL                     :: LGTMM
     CHARACTER(LEN=255)          :: GTMM_RST_FILE
     LOGICAL                     :: LARCTICRIV
     LOGICAL                     :: LKRedUV

     !----------------------------------------
     ! CH4 MENU fields
     !----------------------------------------  
     LOGICAL                     :: LCH4BUD
     LOGICAL                     :: LGAO
     LOGICAL                     :: LCOL
     LOGICAL                     :: LLIV
     LOGICAL                     :: LWAST
     LOGICAL                     :: LBFCH4
     LOGICAL                     :: LRICE
     LOGICAL                     :: LOTANT
     LOGICAL                     :: LBMCH4
     LOGICAL                     :: LWETL
     LOGICAL                     :: LSOABS
     LOGICAL                     :: LOTNAT

     !----------------------------------------
     ! POPS MENU fields
     !----------------------------------------
     CHARACTER(LEN=3)            :: POP_TYPE
     LOGICAL                     :: CHEM_PROCESS
     REAL(fp)                    :: POP_XMW
     REAL(fp)                    :: POP_KOA
     REAL(fp)                    :: POP_KBC
     REAL(fp)                    :: POP_K_POPG_OH
     REAL(fp)                    :: POP_K_POPP_O3A
     REAL(fp)                    :: POP_K_POPP_O3B
     REAL(fp)                    :: POP_HSTAR
     REAL(fp)                    :: POP_DEL_H
     REAL(fp)                    :: POP_DEL_Hw

     !----------------------------------------
     ! Fields for drydep and dust.  These get
     ! set in the init stage based on info 
     ! from file "input.geos". (mlong, 1/5/13)
     !----------------------------------------
     INTEGER                     :: N_DUST_BINS
     INTEGER,            POINTER :: NTRAIND(:)
     INTEGER,            POINTER :: IDDEP(:)
     INTEGER,            POINTER :: IDEP(:)
     REAL(fp),           POINTER :: DUSTREFF(:)
     REAL(fp),           POINTER :: DUSTDEN(:)
     CHARACTER(LEN=14),  POINTER :: DEPNAME(:)

     !----------------------------------------
     ! Fields for interface to GEOS-5 GCM
     !----------------------------------------
     LOGICAL                     :: haveImpRst

     !----------------------------------------
     ! Fields for LINOZ strat chem
     !----------------------------------------
     INTEGER                     :: LINOZ_NLEVELS
     INTEGER                     :: LINOZ_NLAT
     INTEGER                     :: LINOZ_NMONTHS
     INTEGER                     :: LINOZ_NFIELDS
     REAL(fp),           POINTER :: LINOZ_TPARM(:,:,:,:)

     !----------------------------------------
     ! Fields for overhead O3
     ! This gets set in main.F based on met
     ! field and year (mpayer, 12/13/13)
     !----------------------------------------
     LOGICAL                     :: USE_O3_FROM_MET

  END TYPE OptInput

--Bob Yantosca (talk) 18:38, 16 March 2017 (UTC)

Summary of fields removed from Input_Opt

The following fields were removed (or renamed) in v11-02a:

Old field New field Why changed?
MAX_TRCS MAX_SPC Since v11-01, everything in GEOS-Chem is now considered a species. We changed the TRCS to SPC to be consistent with that usage. What used to be "tracers" are now referred to as "advected species".
MAX_FAMS MAX_FAM Renamed to use 3 letters (like MAX_SPC). This also denotes that it is not tied to the old SMVGEAR prod/loss arrays, which have since been removed.
MAX_MEMB none This array dimension was used for the old SMVGEAR prod/loss species arrays, which have since been removed. Prod/Loss is now computed via FlexChem.
MAX_DEP none Dry deposition quantities are now provided via the GEOS-Chem species database. We have removed all of the arrays in Input_Opt that were dimensioned with this field, making it redundant.
LFAMILY none This logical field was used in a single IF statement. We rewrote the code with equivalent logic to remove the dependence on this field.
FAM_COEF none This array was used with the SMVGEAR prod/loss code, which has been rendered obsolete by FlexChem.
FAM_MEMB none " "
FAM_NMEM none " "
NTRAIND none This field maps drydep index to species index. It is now replaced by State_Chem%Map_Drydep.
IDDEP none This field held dry deposition indices, which now can be obtained directly from the GEOS-Chem species database.
IDEP none This has now been turned into a local variable in GeosCore/drydep_mod.F. It is initialized from the GEOS-Chem species database.
DUSTREFF none This is now replaced by the Radius field of the GEOS-Chem species database.
DUSTDEN none This is now replaced by the Density field of the GEOS-Chem species database.
DEPNAME none This has now been turned into a local variable in GeosCore/drydep_mod.F. It is initialized from the GEOS-Chem species database.

This update passed the following difference tests on 16 Mar 2017:

  1. geosfp_4x5_tropchem
  2. geosfp_4x5_standard
  3. geosfp_4x5_aciduptake

--Bob Yantosca (talk) 19:32, 17 March 2017 (UTC)

Using the Input Options object to replace existing variables

This discussion has been moved to our our Removal of obsolete modules from GEOS-Chem wiki page.

--Bob Yantosca (talk) 22:34, 1 December 2016 (UTC)

The Chemistry State object

The Chemistry State object (State_Chm) holds the GEOS-Chem species concentrations, plus related quantities (i.e. a list of tracer and species names, etc.) The GEOS-Chem species database is contained as a sub-object of State_Chm.

Declaration

The Chemistry State object is meant to be passed to the various GEOS-Chem subrotuines as a a read-write argument. We typically declare it statements such as:

!
! !USES:
!
    USE State_Chm_Mod, ONLY : ChmState      ! Derived type declaration
!
! !INPUT/OUTPUT PARAMETERS:
!
    TYPE(ChmState), INTENT(INOUT) :: State_Chm   ! Chemistry State object (read-write)

NOTE: The module containing the ChmState derived type was renamed from gigc_state_chm_mod.F90 to state_chm_mod.F90 in GEOS-Chem v11-01.

In the standard GEOS-Chem, the Chemistry State object is populated in driver routine main.F, and then passed down to the lower-level routines from there.

When connecting GEOS-Chem to the NASA GEOS-5 GCM via the ESMF environment, the Chemistry State object is populated in include file Includes_Before_Run.H, which is part of the Gridded Component module GEOSCHEMchem_GridCompMod.F90.

--Bob Yantosca (talk) 21:13, 17 March 2017 (UTC)

Derived type ChmState

The Chemistry State object is defined with the ChmState derived type, located in module file Headers/state_chm_mod.F90.

  TYPE, PUBLIC :: ChmState

     ! Count of each type of species
     INTEGER                    :: nSpecies             ! # of species
     INTEGER                    :: nAdvect              ! # of advected species
     INTEGER                    :: nDryDep              ! # of drydep species
     INTEGER                    :: nKppSpc              ! # of KPP chem species
     INTEGER                    :: nWetDep              ! # of wetdep species

     ! Mapping vectors to subset types of species
     INTEGER,           POINTER :: Map_Advect (:      ) ! Advected species ID's
     INTEGER,           POINTER :: Map_DryDep (:      ) ! Drydep species ID's
     INTEGER,           POINTER :: Map_KppSpc (:      ) ! KPP chem species ID's
     INTEGER,           POINTER :: Map_WetDep (:      ) ! Wetdep species IDs'

     ! Physical properties & indices for each species
     TYPE(SpcPtr),      POINTER :: SpcData    (:      ) ! GC Species database

     ! Chemical species
     INTEGER,           POINTER :: Spec_Id    (:      ) ! Species ID # 
     CHARACTER(LEN=14), POINTER :: Spec_Name  (:      ) ! Species names
     REAL(fp),          POINTER :: Species    (:,:,:,:) ! Species [molec/cm3]
     CHARACTER(LEN=20)          :: Spc_Units            ! Species units

     ! Aerosol quantities
     INTEGER                    :: nAero                ! # of Aerosol Types
     REAL(fp),          POINTER :: AeroArea   (:,:,:,:) ! Aerosol Area [cm2/cm3]
     REAL(fp),          POINTER :: AeroRadi   (:,:,:,:) ! Aerosol Radius [cm]
     REAL(fp),          POINTER :: WetAeroArea(:,:,:,:) ! Aerosol Area [cm2/cm3]
     REAL(fp),          POINTER :: WetAeroRadi(:,:,:,:) ! Aerosol Radius [cm]

     ! Fields for UCX mechanism
     REAL(f4),          POINTER :: STATE_PSC  (:,:,:  ) ! PSC type (see Kirner
                                                        !  et al. 2011, GMD)
     REAL(fp),          POINTER :: KHETI_SLA  (:,:,:,:) ! Strat. liquid aerosol
                                                        !  reaction cofactors
     ! For the tagged Hg simulation
     INTEGER                    :: N_HG_CATS            ! # of Hg categories
     INTEGER,           POINTER :: Hg0_Id_List(:      ) ! Hg0 cat <-> tracer #
     INTEGER,           POINTER :: Hg2_Id_List(:      ) ! Hg2 cat <-> tracer #
     INTEGER,           POINTER :: HgP_Id_List(:      ) ! HgP cat <-> tracer #
     CHARACTER(LEN=4),  POINTER :: Hg_Cat_Name(:      ) ! Category names

  END TYPE ChmState

--Bob Yantosca (talk) 21:15, 17 March 2017 (UTC)

The Meteorology State object

The Meteorology State object (aka State_Met) contains the meteorological fields and some other related inputs (i.e. for dry deposition) that need to be passed to lower-level GEOS-Chem subroutines. Most subroutines will accept the Meteorology State object as a read-only argument; however, a few routines will need to accept it as a read-write argument.

Declaration

We typically declare the Meteorology State object with statements like this:

!
! !USES:
!
    USE State_Met_Mod, ONLY : MetState    ! Derived type declaration
!
! !INPUT PARAMETERS:
!
    TYPE(MetState), INTENT(IN) :: State_Met    ! Meteorology State object (read-only)

NOTE: The module containing the MetState derived type was renamed from gigc_state_met_mod.F90 to state_met_mod.F90 in GEOS-Chem v11-01.

In the standard GEOS-Chem, the Meteorology State object is populated by the various modules that read in met field data. These are:

Met field product Modules
GEOS-4, GEOS-5, GCAP
  • GeosCore/a3_read_mod.F
  • GeosCore/a6_read_mod.F
  • GeosCore/i6_read_mod.F
  • GeosCoregcap_read_mod.F (for GCAP only)
MERRA
  • GeosCore/merra_cn_read_mod.F
  • GeosCore/merra_a1_read_mod.F
  • GeosCore/merra_a3_read_mod.F
  • GeosCore/merra_i6_read_mod.F
GEOS-FP
  • GeosCore/geosfp_read_mod.F90
MERRA-2
  • GeosCore/merra2_read_mod.F90

When connecting GEOS-Chem to the NASA GEOS-5 GCM via the ESMF environment, the Meteorology State object is populated in include file Includes_Before_Run.H, which is part of the Gridded Component module GEOSCHEMchem_GridCompMod.F90.

Derived type MetState

The Meteorology State object is defined with the MetState derived type, located in module file Headers/state_met_mod.F90.

NOTE: The MetState derived type contains arrays to hold the complete set of met fields used in GEOS-Chem, including fields for GCAP, GEOS-4, GEOS-5, GEOS-FP, MERRA, and MERRA-2 met data products.

  TYPE, PUBLIC :: MetState

     !----------------------------------------------------------------------
     ! Surface fields
     !----------------------------------------------------------------------
     REAL(fp), POINTER :: ALBD      (:,:  ) ! Visible surface albedo [1]
     REAL(fp), POINTER :: CLDFRC    (:,:  ) ! Column cloud fraction [1]
     INTEGER,  POINTER :: CLDTOPS   (:,:  ) ! Max cloud top height [levels]
     REAL(fp), POINTER :: EFLUX     (:,:  ) ! Latent heat flux [W/m2]
     REAL(fp), POINTER :: EVAP      (:,:  ) ! Surface evap [kg/m2/s]
     REAL(fp), POINTER :: FRCLND    (:,:  ) ! Olson land fraction [1]
     REAL(fp), POINTER :: FRLAKE    (:,:  ) ! Fraction of lake [1]
     REAL(fp), POINTER :: FRLAND    (:,:  ) ! Fraction of land [1]
     REAL(fp), POINTER :: FRLANDIC  (:,:  ) ! Fraction of land ice [1]
     REAL(fp), POINTER :: FROCEAN   (:,:  ) ! Fraction of ocean [1]
     REAL(fp), POINTER :: FRSEAICE  (:,:  ) ! Sfc sea ice fraction
     REAL(fp), POINTER :: FRSNO     (:,:  ) ! Sfc snow fraction
     REAL(fp), POINTER :: GRN       (:,:  ) ! Greenness fraction
     REAL(fp), POINTER :: GWETROOT  (:,:  ) ! Root soil wetness [1]
     REAL(fp), POINTER :: GWETTOP   (:,:  ) ! Top soil moisture [1]
     REAL(fp), POINTER :: HFLUX     (:,:  ) ! Sensible heat flux [W/m2]
     REAL(fp), POINTER :: LAI       (:,:  ) ! Leaf area index [m2/m2]
     REAL(fp), POINTER :: ITY       (:,:  ) ! Land surface type index
     REAL(fp), POINTER :: LWI       (:,:  ) ! Land/water indices [1]
     REAL(fp), POINTER :: LWI_GISS  (:,:  ) ! Land fraction [1]
     REAL(fp), POINTER :: MOLENGTH  (:,:  ) ! Monin-Obhukov length [m]
     REAL(fp), POINTER :: OICE      (:,:  ) ! Fraction of ocean ice [1]
     REAL(fp), POINTER :: PARDR     (:,:  ) ! Direct  photsyn active rad [W/m2]
     REAL(fp), POINTER :: PARDF     (:,:  ) ! Diffuse photsyn active rad [W/m2]
     REAL(fp), POINTER :: PBLH      (:,:  ) ! PBL height [m]
     INTEGER,  POINTER :: PBL_TOP_L (:,:  ) ! PBL top layer [1]
     REAL(fp), POINTER :: PHIS      (:,:  ) ! Sfc geopotential height [m2/s2]
     REAL(fp), POINTER :: PRECANV   (:,:  ) ! Anvil previp @ ground [kg/m2/s]
     REAL(fp), POINTER :: PRECCON   (:,:  ) ! Conv  precip @ ground [kg/m2/s]
     REAL(fp), POINTER :: PRECTOT   (:,:  ) ! Total precip @ ground [kg/m2/s]
     REAL(fp), POINTER :: PRECLSC   (:,:  ) ! LS precip @ ground [kg/m2/s]
     REAL(fp), POINTER :: PRECSNO   (:,:  ) ! Snow precip [kg/m2/s]
     REAL(fp), POINTER :: PS1_WET   (:,:  ) ! Wet sfc press at dt start[hPa]
     REAL(fp), POINTER :: PS2_WET   (:,:  ) ! Wet sfc press at dt end [hPa]
     REAL(fp), POINTER :: PSC2_WET  (:,:  ) ! Wet interpolated sfc press [hPa]
     REAL(fp), POINTER :: PS1_DRY   (:,:  ) ! Dry sfc press at dt start[hPa]
     REAL(fp), POINTER :: PS2_DRY   (:,:  ) ! Dry sfc press at dt end [hPa]
     REAL(fp), POINTER :: PSC2_DRY  (:,:  ) ! Dry interpolated sfc press [hPa]
     REAL(fp), POINTER :: RADLWG    (:,:  ) ! Net LW radiation @ ground [W/m2]
     REAL(fp), POINTER :: RADSWG    (:,:  ) ! Solar radiation @ ground [W/m2]
     REAL(fp), POINTER :: SEAICE00  (:,:  ) ! Sea ice coverage 00-10%
     REAL(fp), POINTER :: SEAICE10  (:,:  ) ! Sea ice coverage 10-20%
     REAL(fp), POINTER :: SEAICE20  (:,:  ) !  Sea ice coverage 20-30%
     REAL(fp), POINTER :: SEAICE30  (:,:  ) ! Sea ice coverage 30-40%
     REAL(fp), POINTER :: SEAICE40  (:,:  ) ! Sea ice coverage 40-50%
     REAL(fp), POINTER :: SEAICE50  (:,:  ) ! Sea ice coverage 50-60%
     REAL(fp), POINTER :: SEAICE60  (:,:  ) ! Sea ice coverage 60-70%
     REAL(fp), POINTER :: SEAICE70  (:,:  ) ! Sea ice coverage 70-80%
     REAL(fp), POINTER :: SEAICE80  (:,:  ) ! Sea ice coverage 80-90%
     REAL(fp), POINTER :: SEAICE90  (:,:  ) ! Sea ice coverage 90-100%
     REAL(fp), POINTER :: SLP       (:,:  ) ! Sea level pressure [hPa]
     REAL(fp), POINTER :: SNICE     (:,:  ) ! Fraction of snow/ice [1]
     REAL(fp), POINTER :: SNODP     (:,:  ) ! Snow depth [m]
     REAL(fp), POINTER :: SNOMAS    (:,:  ) ! Snow mass [kg/m2]
     REAL(fp), POINTER :: SNOW      (:,:  ) ! Snow depth (H2O equiv) [mm H2O]
     REAL(fp), POINTER :: SST       (:,:  ) ! Sea surface temperature [K]
     REAL(fp), POINTER :: SUNCOS    (:,:  ) ! COS(SZA), current time
     REAL(fp), POINTER :: SUNCOSmid (:,:  ) ! COS(SZA), midpt of chem timestep
!     REAL(fp), POINTER :: SUNCOSmid5(:,:  ) ! COS(SZA), midpt of chem timestep
!                                            !  5 hrs ago (for PARANOX)
     REAL(fp), POINTER :: SWGDN     (:,:  ) ! Incident radiation @ grnd [W/m2]
     REAL(fp), POINTER :: TO3       (:,:  ) ! Total overhead O3 column [DU]
     REAL(fp), POINTER :: TO31      (:,:  ) ! Total O3 at timestep start [DU]
     REAL(fp), POINTER :: TO32      (:,:  ) ! Total O3 at timestep end [DU]
     REAL(fp), POINTER :: TROPP     (:,:  ) ! Tropopause pressure [hPa]
     REAL(fp), POINTER :: TROPP1    (:,:  ) ! Trop P at timestep start [hPa]
     REAL(fp), POINTER :: TROPP2    (:,:  ) ! Trop P at timestep end [hPa]
     REAL(fp), POINTER :: TS        (:,:  ) ! Surface temperature [K]
     REAL(fp), POINTER :: TSKIN     (:,:  ) ! Surface skin temperature [K]
     REAL(fp), POINTER :: TTO3      (:,:  ) ! Tropospheric ozone column [DU]
     REAL(fp), POINTER :: U10M      (:,:  ) ! E/W wind speed @ 10m height [m/s]
     REAL(fp), POINTER :: USTAR     (:,:  ) ! Friction velocity [m/s]
     REAL(fp), POINTER :: UVALBEDO  (:,:  ) ! UV surface albedo [1]
     REAL(fp), POINTER :: V10M      (:,:  ) ! N/S wind speed @ 10m height [m/s]
     REAL(fp), POINTER :: Z0        (:,:  ) ! Surface roughness height [m]
     REAL(fp), POINTER :: CNV_FRC   (:,:  ) ! Convective fraction [1] 
            
     !----------------------------------------------------------------------
     ! 3-D Fields                  
     !----------------------------------------------------------------------
     REAL(fp), POINTER :: AREA_M2   (:,:,:) ! Grid box surface area [cm2]
     REAL(fp), POINTER :: CLDF      (:,:,:) ! 3-D cloud fraction [1]
     REAL(fp), POINTER :: CMFMC     (:,:,:) ! Cloud mass flux [kg/m2/s]
     REAL(fp), POINTER :: DETRAINE  (:,:,:) ! Detrainment (entrain plume)[Pa/s]
     REAL(fp), POINTER :: DETRAINN  (:,:,:) ! Detrainment (non-entr plume)[Pa/s]
     REAL(fp), POINTER :: DNDE      (:,:,:) ! Downdraft (entr plume) [Pa/s]
     REAL(fp), POINTER :: DNDN      (:,:,:) ! Downdraft (non-entr plume) [Pa/s]
     REAL(fp), POINTER :: DQRCU     (:,:,:) ! Conv precip prod rate [kg/kg/s]
                                            ! (assume per dry air)
     REAL(fp), POINTER :: DQRLSAN   (:,:,:) ! LS precip prod rate [kg/kg/s]
                                            ! (assume per dry air)
     REAL(fp), POINTER :: DQIDTMST  (:,:,:) ! Ice tendency, mst proc [kg/kg/s]
     REAL(fp), POINTER :: DQLDTMST  (:,:,:) ! H2O tendency, mst proc [kg/kg/s]
     REAL(fp), POINTER :: DQVDTMST  (:,:,:) ! Vapor tendency, mst proc [kg/kg/s]
     REAL(fp), POINTER :: DTRAIN    (:,:,:) ! Detrainment flux [kg/m2/s]
     REAL(fp), POINTER :: ENTRAIN   (:,:,:) ! GCAP entrainment [Pa/s]
     REAL(fp), POINTER :: HKBETA    (:,:,:) ! Hack overshoot parameter [1]
     REAL(fp), POINTER :: HKETA     (:,:,:) ! Hack conv mass flux [kg/m2/s]
     REAL(fp), POINTER :: MOISTQ    (:,:,:) ! Tendency in sp. humidity 
                                            ! [kg/kg tot air/s]
     REAL(fp), POINTER :: OPTD      (:,:,:) ! Visible optical depth [1]
     REAL(fp), POINTER :: PEDGE     (:,:,:) ! Wet air press @ level edges [hPa]
     REAL(fp), POINTER :: PFICU     (:,:,:) ! Dwn flux ice prec:conv [kg/m2/s]
     REAL(fp), POINTER :: PFILSAN   (:,:,:) ! Dwn flux ice prec:LS+anv [kg/m2/s]
     REAL(fp), POINTER :: PFLCU     (:,:,:) ! Dwn flux liq prec:conv [kg/m2/s]
     REAL(fp), POINTER :: PFLLSAN   (:,:,:) ! Dwn flux ice prec:LS+anv [kg/m2/s]
     REAL(fp), POINTER :: PV        (:,:,:) ! Potential vort [kg*m2/kg/s]
     REAL(fp), POINTER :: QI        (:,:,:) ! Ice mixing ratio [kg/kg dry air]
     REAL(fp), POINTER :: QL        (:,:,:) ! Water mixing ratio [kg/kg dry air]
     REAL(fp), POINTER :: REEVAPCN  (:,:,:) ! Evap of precip conv [kg/kg/s]
                                            ! (assume per dry air)
     REAL(fp), POINTER :: REEVAPLS  (:,:,:) ! Evap of precip LS+anvil [kg/kg/s]
                                            ! (assume per dry air)
     REAL(fp), POINTER :: RH        (:,:,:) ! Relative humidity [%]
     REAL(fp), POINTER :: RH1       (:,:,:) ! RH at timestep start [%]
     REAL(fp), POINTER :: RH2       (:,:,:) ! RH at timestep end [%]
     REAL(fp), POINTER :: SPHU      (:,:,:) ! Spcfc humidity [g H2O/kg tot air]
     REAL(fp), POINTER :: SPHU1     (:,:,:) ! Spec hum at timestep start [g/kg]
     REAL(fp), POINTER :: SPHU2     (:,:,:) ! Spec hum at timestep end [g/kg] 
     REAL(fp), POINTER :: T         (:,:,:) ! Temperature [K]
     REAL(fp), POINTER :: TAUCLI    (:,:,:) ! Opt depth of ice clouds [1]
     REAL(fp), POINTER :: TAUCLW    (:,:,:) ! Opt depth of H2O clouds [1]
     REAL(fp), POINTER :: TMPU1     (:,:,:) ! Temperature at timestep start [K]
     REAL(fp), POINTER :: TMPU2     (:,:,:) ! Temperature at timestep end [K]
     REAL(fp), POINTER :: U         (:,:,:) ! E/W component of wind [m s-1]
     REAL(fp), POINTER :: UPDE      (:,:,:) ! Updraft (entraining plume) [Pa/s]
     REAL(fp), POINTER :: UPDN      (:,:,:) ! Updraft (non-entr'n plume) [Pa/s]
     REAL(fp), POINTER :: UPDVVEL   (:,:,:) ! Updraft vertical velocity [hPa/s]
     REAL(fp), POINTER :: V         (:,:,:) ! N/S component of wind [m s-1]
     REAL(fp), POINTER :: ZMEU      (:,:,:) ! Z/M updraft entrainment [Pa/s]
     REAL(fp), POINTER :: ZMMD      (:,:,:) ! Z/M downdraft mass flux [Pa/s]
     REAL(fp), POINTER :: ZMMU      (:,:,:) ! Z/M updraft   mass flux [Pa/s]

     !----------------------------------------------------------------------
     ! Air quantities assigned in AIRQNT
     !----------------------------------------------------------------------
     ! Note on pressures: PMID is calculated from PEDGE, 
     ! and dry air pressures assume constant RH and T across grid box
     REAL(fp), POINTER :: PEDGE_DRY (:,:,:) ! Dry air partial pressure [hPa] 
                                            ! @ level edges [hPa]
     REAL(fp), POINTER :: PMID      (:,:,:) ! Average wet air pressure [hPa]
                                            ! defined as arithmetic
                                            ! average of edge pressures
     REAL(fp), POINTER :: PMID_DRY  (:,:,:) ! Dry air partial pressure [hPa]
                                            ! defined as arithmetic average
                                            ! of edge pressures 
     REAL(fp), POINTER :: TV        (:,:,:) ! Virtual temperature [K]
     REAL(fp), POINTER :: MAIRDEN   (:,:,:) ! Moist air density [kg/m3]
     REAL(fp), POINTER :: AIRDEN    (:,:,:) ! Dry air density [kg/m3]
     REAL(fp), POINTER :: AIRNUMDEN (:,:,:) ! Dry air density [molec/m3]
     REAL(fp), POINTER :: AVGW      (:,:,:) ! Water vapor volume mixing ratio
                                            ! [vol H2O / vol dry air]
     REAL(fp), POINTER :: BXHEIGHT  (:,:,:) ! Grid box height [m] (dry air)
     REAL(fp), POINTER :: DELP      (:,:,:) ! Delta-P (wet) across box [hPa]
     REAL(fp), POINTER :: DELP_DRY  (:,:,:) ! Delta-P (dry) across box [hPa]
     REAL(fp), POINTER :: AD        (:,:,:) ! Dry air mass [kg] in grid box
     REAL(fp), POINTER :: AIRVOL    (:,:,:) ! Grid box volume [m3] (dry air)
     REAL(fp), POINTER :: DELP_PREV (:,:,:) ! Previous State_Met%DELP
     REAL(fp), POINTER :: DP_DRY_PREV (:,:,:) ! Previous State_Met%DELP_DRY
     REAL(fp), POINTER :: SPHU_PREV (:,:,:) ! Previous State_Met%SPHU

     !----------------------------------------------------------------------
     ! Land type and leaf area index (LAI) fields for dry deposition
     !----------------------------------------------------------------------
     INTEGER,  POINTER :: IREG      (:,:  ) ! # of landtypes in grid box (I,J) 
     INTEGER,  POINTER :: ILAND     (:,:,:) ! Land type at (I,J); 1..IREG(I,J)
     INTEGER,  POINTER :: IUSE      (:,:,:) ! Fraction (per mil) of grid box
                                            !  (I,J) occupied by each land type
     REAL(fp), POINTER :: XLAI      (:,:,:) ! LAI per land type, this month
     REAL(fp), POINTER :: XLAI2     (:,:,:) ! LAI per land type, next month
     REAL(fp), POINTER :: XCHLR     (:,:,:) ! CHLR per land type, this month
     REAL(fp), POINTER :: XCHLR2    (:,:,:) ! CHLR per land type, next month

  END TYPE MetState

--Bob Yantosca (talk) 21:27, 17 March 2017 (UTC)

Removal of obsolete modules and files

This discussion has been moved to our Removal of obsolete modules from GEOS-Chem wiki page.

--Bob Yantosca (talk) 22:38, 1 December 2016 (UTC)

Information pertaining to older GEOS-Chem versions

The following information was relevant for GEOS-Chem versions prior to GEOS-Chem v11-01, in which the SMVGEAR solver was removed and the GEOS-Chem species database was introduced.

--Bob Yantosca (talk) 21:23, 17 March 2017 (UTC)

Clean up several modules that use the Meteorology State object

Obsolete.jpg

NOTE: The GEOS-Chem species database has rendered the code described below obsolete. We will rewrite this section in the near future.

Prior to the official release of GEOS-Chem v9-02, we cleaned up several modules that use the State_Met derived type object. For routines that use the same met fields several times, we now use a pointer at the top of the routine to point to the field in State_Met. For example, in COMPUTE_F (in module GeosCore/wetscav_mod.F), we had several blocks of code that resembled the following:

     ! Compute the rate constant K.  The retention factor for 
     ! liquid H2O2 is 0.05 for 248 K < T < 268 K and 1.0 for 
     ! T >= 268 K. (Eq. 1, Jacob et al, 2000)
     IF ( State_Met%T(I,J,L) >= 268d0 ) THEN
        K = KC * ( F_L + F_I )

     ELSE IF ( State_Met%T(I,J,L) > 248d0   .and.
    &          State_Met%T(I,J,L) < 268d0 ) THEN
        K = KC * ( ( 5d-2 * F_L ) + F_I ) 

     ELSE
        K = KC * F_I
                 
     ENDIF

     ! Distance between grid box centers [m]
     TMP = 0.5d0 * ( State_Met%BXHEIGHT(I,J,L-1) +
    &                State_Met%BXHEIGHT(I,J,L) ) 

In this update, we created pointers at the top of the routine to point to State_Met%T and State_Met%BXHEIGHT:

     ! Pointers
     REAL*8, POINTER :: BXHEIGHT(:,:,:)
     REAL*8, POINTER :: T(:,:,:)

     ! Initialize pointers
     BXHEIGHT => State_Met%BXHEIGHT
     T        => State_Met%T

so that the aforementioned sections of the code could be restored to:

     ! Compute the rate constant K.  The retention factor for 
     ! liquid H2O2 is 0.05 for 248 K < T < 268 K and 1.0 for 
     ! T >= 268 K. (Eq. 1, Jacob et al, 2000)
     IF ( T(I,J,L) >= 268d0 ) THEN
        K = KC * ( F_L + F_I )

     ELSE IF ( T(I,J,L) > 248d0  .and. T(I,J,L) < 268d0 ) THEN
        K = KC * ( ( 5d-2 * F_L ) + F_I ) 

     ELSE
        K = KC * F_I
                 
     ENDIF

     ! Distance between grid box centers [m]
     TMP = 0.5d0 * ( BXHEIGHT(I,J,L-1) + BXHEIGHT(I,J,L) )

This update has made the code more readable and will help to reduce the number of conflicts that arise when bringing in new features that are based on older versions of GEOS-Chem.

--Melissa Sulprizio 17:53, 27 February 2014 (EST)

Removal of STT and CSPEC_FULL arrays

Obsolete.jpg

NOTE: In v11-01 and higher versions, the STT, CSPEC_FULL, and TRACER fields were removed from State_Chm. The information below is now obsolete. We shall keep it here for reference.

In GEOS-Chem v9-02, we have removed all references to the following arrays:

  • STT: tracer array in GeosCore/tracer_mod.F
  • CSPEC_FULL: chemical species array in GeosCore/comode_mod.F

However, to avoid having to rewrite entire sections of legacy code, we have converted the STT and CSPEC_FULL arrays to local pointer arrays. Local copies of STT now point to State_Chm%TRACERS and local copies of CSPEC_FULL now point to State_Chm%SPECIES, as shown in the example below.

!
! !LOCAL VARIABLES:
!
     ! Pointers
     ! We need to define local arrays to hold corresponding values 
     ! from the Chemistry State (State_Chm) object. (mpayer, 12/6/12)
     REAL*8, POINTER :: STT(:,:,:,:)
     REAL*8, POINTER :: CSPEC_FULL(:,:,:,:)

     !==================
     ! TOP OF ROUTINE 
     !==================

     ! Initialize GEOS-Chem tracer array [kg] from Chemistry State object
     STT => State_Chm%Tracers
  
     ! Initialize GEOS-Chem species array
     CSPEC_FULL => State_Chm%Species
      
     !==================
     ! BODY OF ROUTINE 
     !==================

     ... USE EXISTING CODE THAT REFERS TO STT AND CSPEC_FULL ...
     ... TO AVOID HAVING TO REWRITE ENTIRE SECTIONS OF CODE  ...

     !===================
     ! END OF ROUTINE
     !===================

     ! Free pointer memory
     NULLIFY( STT, CSPEC_FULL )

--Bob Y. 14:16, 30 April 2013 (EDT)