FlexAOD: Difference between revisions

From Geos-chem
Jump to navigation Jump to search
No edit summary
No edit summary
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[http://pumpkin.aquila.infn.it/flexaod/ FlexAOD] (Flexible Aerosol Optical Depth) is a post-processing tool of GEOS-Chem, aimed at extending the model on-line capabilities concerning calculations of [[Aerosol optical properties]].
[http://pumpkin.aquila.infn.it/flexaod/ FlexAOD] (Flexible Aerosol Optical Depth) is a post-processing tool of GEOS-Chem, aimed at extending the model on-line capabilities concerning calculations of [[Aerosol optical properties]]. For a brief overview, check out the [https://geos-chem.seas.harvard.edu/files/icg5-day1-mond_aerclim_curci_gabriele_1_pc.pdf presentation] at the [https://geos-chem.seas.harvard.edu/geos-meetings-2011-igc5 5th International GEOS-Chem Meeting]! A quick comparison with online GEOS-Chem calculations is given in [http://pumpkin.aquila.infn.it/flexaod/download/FlexAODv1.4.pdf this pdf document].
 
 
== User's Guide ==
 
 
=== Download code ===
 
Source code & input data are available at this link:
http://pumpkin.aquila.infn.it/flexaod
 
From a Linux/Unix terminal, you may follow this procedure:
 
mkdir -p ~/geos-chem/flexaod
cd ~/geos-chem/flexaod
tar zxvf flexaod.tgz
 
This will create the subdirectory "<tt>flexaod_vX.Y</tt>", here is a quick look at the content:
 
{| border=1 cellspacing=0 cellpadding=5
|- bgcolor="#CCCCCC"
!Filename/Dirname
!Description             
|-
|<tt>flexaod.sh</tt>
|Launch script
|-
|<tt>[[FlexAOD#input.dat|input.dat]]</tt>
|Configuration file
|-
|<tt>[[FlexAOD#pointout.dat|pointout.dat]]</tt>
|Point output configuration file (the actual name is set with <tt>point_file</tt> variable)
|-
|<tt>random_pointout.sh</tt>
|Random <tt>[[FlexAOD#pointout.dat|pointout.dat]]</tt> generator
|-
|<tt>loop.sh</tt>
|Loop script for automatic launch at several wavelengths and/or date intervals
|-
|<tt>loop_wave_rtm.sh</tt>
|Loop script for automatic launch and post-processing of libRadtran output at several wavelengths
|-
|<tt>src/</tt>
|Fortran source code
|-
|<tt>src/Makefile.hdr.*</tt>
|Makefile headers for Fortran compiler configuration
|-
|<tt>data/</tt>
|Optical input data (i.e. all but GEOS-Chem timeseries)
|-
|<tt>data/gads/optdat</tt>
|GADS/OPAC input database (Hess et al., 1998)
|-
|<tt>data/lsmask</tt>
|Land/sea mask calculated from gridded national IDs (CIESIN and CIAT, 2005), only needed if point_watonly=T
|-
|<tt>data/refind</tt>
|Alternative refractive indices databases. From FlexAOD v1.4+ the dust refractive indices from Sinyuk et al. (2003) are used in the standard case.
|-
|<tt>data/size_dist</tt>
|Parameters of size distributions and hygroscopic growth factors
|-
|<tt>data/water</tt>
|Water spectral refractive index (Segelstein, 1981)
|-
|}
 
=== Set up GEOS-Chem timeseries & data dir ===
 
==== GEOS-Chem tracers ====
 
FlexAOD needs GEOS-Chem timeseries in input (instantaneous (ND49) or satellite (ND51)). There is a minimum set of tracers to be saved in output timeseries:
 
 
{| border=1 cellspacing=0 cellpadding=5
|- bgcolor="#CCCCCC"
!Aerosol concentrations
!Tracer #<br>(v9-01-01*)       
!Description
|-
|SO4
|27
|Sulfate
|-
|NH4
|31
|Ammonium
|-
|NIT
|32
|Nitrate
|-
|BCPI
|34
|Black carbon hydrophillic
|-
|OCPI
|35
|Primary organic carbon hydrophillic
|-
|BCPO
|36
|Black carbon hydrophobic
|-
|OCPO
|37
|Primary organic carbon hydrophobic
|-
|SOA1-5
|46-50
|[[Secondary organic aerosols]] classes 1-5
|-
|DST1-4
|51-54
|[[Mineral dust aerosols]] (size bins 1-4)
|-
|SSa
|55
|[[Sea salt aerosols]] accumulation mode
|-
|SSc
|56
|[[Sea salt aerosols]] coarse mode
|- bgcolor="#CCCCCC"
!Meteo fields
!Tracer #
!Description
|-
|AIRD
|80
|Air density (molecules/cm^3)
|-
|BOXH
|94
|Box Height (m)
|-
|RELH
|95
|Relative Humidity (%)
|-
|- bgcolor="#CCCCCC"
!Optional (for comparison with on-line AOD)
!Tracer #
!Description
|-
|OPSO4
|84
|Sulfate aerosols AOD
|-
|OPBC
|85
|Black carbon AOD
|-
|OPOC
|86
|Organic carbon AOD
|-
|OPSSa
|87
|SSa AOD
|-
|OPSSc
|88
|SSc AOD
|-
|OPD
|89
|Total dust AOD
|-
|}
<nowiki>*</nowiki>NOTE: tracer # valid for v9-01-01 <tt>SOA</tt> simulation, please check for other simulations and next versions!
 
===== Relative humidity timeseries issue =====
 
Relative humidity saved in GEOS-Chem timeseries output (ND49-51) differs from that used for on-line calculations of chemistry and aerosol optical depths. This causes ''small differences'' in FlexAOD output with respect to GEOS-Chem on-line calculations for very low AOD values. Have a look at [http://pumpkin.aquila.infn.it/flexaod/download/FlexAODv1.4.pdf this pdf document] to get an idea of the impact of the different RH on AOD calculations.
 
For a quick fix, do the following modifications to GEOS-Chem code (v9-01-01, under <tt>GeosCore</tt> directory):
 
In <tt>dao_mod.f</tt>:
 
.... around line 155
REAL*8,  ALLOCATABLE :: RH(:,:,:)
REAL*8,  ALLOCATABLE :: RH_CHEM(:,:,:)  <-- add this line
 
... around line 2090
! Relative humidity
ALLOCATE( RH( IIPAR, JJPAR, LLPAR ), STAT=AS )
IF ( AS /= 0 ) CALL ALLOC_ERR( 'RH' )
RH = 0d0
 
! Relative humidity used in chemistry (gcc rh, 7/10)    <-- add these lines
ALLOCATE( RH_CHEM( IIPAR, JJPAR, LLPAR ), STAT=AS )      <--
IF ( AS /= 0 ) CALL ALLOC_ERR( 'RH_CHEM' )              <--
RH_CHEM = 0d0                                            <--
... around line 2763
IF ( ALLOCATED( RH      ) ) DEALLOCATE( RH      )
IF ( ALLOCATED( RH_CHEM  ) ) DEALLOCATE( RH_CHEM  )    <-- add this line
 
In <tt>aerosol_mod.f</tt>:
 
... around line 544
USE DAO_MOD,      ONLY : BXHEIGHT
USE DAO_MOD,      ONLY : RH_CHEM    <-- add this line
... around line 923
! Store RH_CHEM
DO JLOOP = 1, NTLOOP
    ! Get 3-D grid box indices
    I = IXSAVE(JLOOP)
    J = IYSAVE(JLOOP)
    L = IZSAVE(JLOOP)
    ! Copy onto output array
    RH_CHEM(I, J, L) = ABSHUM(JLOOP) * 1d2
ENDDO
 
In <tt>diag49_mod.f</tt>
 
... around line 176
USE DAO_MOD,      ONLY : CLDTOPS, OPTD,  RH,      SLP
USE DAO_MOD,      ONLY : RH_CHEM    <-- add this line
... around line 948
!Q(X,Y,K) = RH(I,J,L)      <-- comment this line
Q(X,Y,K) = RH_CHEM(I,J,L)  <-- add this line
 
In <tt>diag51_mod.f</tt>:
 
... around line 358
USE DAO_MOD,        ONLY : UWND,    VWND,  SLP
USE DAO_MOD,        ONLY : RH_CHEM    <-- add this line
 
... around line 856
!Q(X,Y,K,W) = Q(X,Y,K,W) + ( RH(I,J,L) * GOOD(I) )      <-- comment this line
Q(X,Y,K,W) = Q(X,Y,K,W) + ( RH_CHEM(I,J,L) * GOOD(I) )  <-- add this line
 
==== GEOS-Chem rundir ====
 
By default, FlexAOD will look for GEOS-Chem output into a subdirectory defined at line 168 of <tt>flexaod.sh</tt>:
 
rundir=${HOME}/geos-chem/GEOS-Chem.${ver}.stdrun/runs/${met}.${res}/output/${lab}
 
where <tt>$ver</tt>, <tt>$met</tt>, <tt>$res</tt>, and <tt>$lab</tt> are all defined in <tt>[[FlexAOD#input.dat|input.dat]]</tt>. A GEOS-Chem user is familiar with the first three variables, the latter is introduced for further organization of the run directory, but its use is optional. Tailor the naming conventions of the run directory to your needs.
 
In addition to time series, FlexAOD expects to find under <tt>rundir</tt>:
 
tracerinfo.dat.${tlab}
diaginfo.dat.${tlab}
 
where <tt>$tlab</tt> is an additional "time label" also defined in <tt>[[FlexAOD#input.dat|input.dat]]</tt>. Please rename your <tt>*info.dat</tt> accordingly.
 
Sample GEOS-Chem timeseries output and info files are provided for testing under: http://pumpkin.aquila.infn.it/flexaod/download/testdata
 
From shell, go under your "rundir" and you may download all data with:
wget -r -nd -np -R*html* http://pumpkin.aquila.infn.it/flexaod/download/testdata
 
 
===== Optional GEOS-Chem launch script =====
 
A launch script for GEOS-Chem model is provided with FlexAOD in order to:
*launch the simulation within your <tt>rundir</tt>
*move/rename the output files after run in an output directory suitable for FlexAOD (see [[FlexAOD#GEOS-Chem rundir|GEOS-Chem rundir]])
You may download and launch the script with:
wget http://pumpkin.aquila.infn.it/flexaod/download/run_geos.sh
./run_geos.sh <lab> <tlab>
where <tt><lab></tt> and <tt><tlab></tt> are the simulation and time labels to subsequently set into <tt>[[FlexAOD#input.dat|input.dat]]</tt> for use with FlexAOD.
 
 
=== input.dat ===
 
Here is a description of the FlexAOD configuration file <tt>input.dat</tt>:
 
{| border=1 cellspacing=0 cellpadding=5
|- bgcolor="#CCCCCC"
!Parameter             
!Description
!Examples/Possible values
|-
|<tt>ver</tt>
|GEOS-Chem version
|<tt>v9-01-01</tt>
|-
|<tt>met</tt>
|GEOS-Chem met-fields version
|<tt>geos5</tt>
|-
|<tt>res</tt>
|GEOS-Chem horizontal resolution
|<tt>2x2.5</tt>
|-
|<tt>sim</tt>
|GEOS-Chem simulation
|<tt>SOA</tt>
|-
|<tt>compiler</tt>
|Fortran compiler option
|<tt>IFORT</tt> (used to link to corresponding <tt>src/Makefile.hdr.<compiler></tt>)
|-
|<tt>lab</tt>
|GEOS-Chem simulation label
|<tt>CTRL</tt> (optional, see [[FlexAOD#Set_up_GEOS-Chem_timeseries_.26_data_dir|Set up GEOS-Chem timeseries & data_dir]])
|-
|<tt>tlab</tt>
|GEOS-Chem time label
|<tt>200701</tt> (mandatory, see [[FlexAOD#Set_up_GEOS-Chem_timeseries_.26_data_dir|Set up GEOS-Chem timeseries & data_dir]])
|-
|<tt>typ</tt>
|GEOS-Chem timeseries type
|<tt>inst</tt> (ND49) or<br><tt>sat</tt> (ND51)
|-
|<tt>dini</tt>
|Initial date of FlexAOD run
|<tt>20070101</tt> (YYYYMMDD)
|-
|<tt>dend</tt>
|Final date of FlexAOD run
|<tt>20070131</tt> (YYYYMMDD)
|-
|<tt>wl</tt>
|Wavelegth (nm)
|<tt>443</tt> (range limited by optical input)
|-
|<tt>optsrc</tt>
|Optical properties option
|<tt>STD</tt> (OPAC/GADS, with modifications as online) or<br><tt>OPAC</tt> (OPAC/GADS)
|-
|<tt>distsrc</tt>
|Size distribution option
|<tt>STD</tt> (associates to <tt>data/size_dist/dist_<distsrc>.dat</tt>)
|-
|<tt>hgfsrc</tt>
|Hygroscopic growth option
|<tt>STD</tt> (from OPAC/GADS, with modifications as online) or<br><tt>OPAC</tt> (from OPAC/GADS) or<br><tt>CHIN</tt> (from Chin et al, 2002)
|-
|<tt>watsrc</tt>
|Water refractive index option
|<tt>STD</tt> (as online: fixed at <tt>1.33+i*0.0</tt>) or<br><tt>SEGEL</tt> (Segelstein (1981), spectrally varying index)
|-
|<tt>fullmie</tt>
|Mie calculations option
|<tt>F</tt> (create Mie look-up table) or<br><tt>T</tt> (Mie calculation for every grid-cell, NOT YET IMPLEMENTED, VERY CPU INTENSIVE!)
|-
|<tt>aodlab</tt>
|FlexAOD output label
|<tt>STD</tt>
|-
|<tt>gridout</tt>
|Switch for full 3-D output
|<tt>T</tt> or <tt>F</tt>
|-
|<tt>point_prof</tt>
|Switch for point profile output
|<tt>T</tt> or <tt>F</tt>
|-
|<tt>point_rtm</tt>
|Switch for point RTM output (libRadtran)
|<tt>T</tt> or <tt>F</tt>
|-
|<tt>point_file</tt>
|Point output list filename
|<tt>`pwd`/pointout.dat</tt>
|-
|<tt>point_watonly</tt>
|Point output only over water pixels
|<tt>T</tt> or <tt>F</tt>
|-
|}
 
=== pointout.dat ===
 
The <tt>pointout.dat</tt> contains the list of points (time and place) for FlexAOD point output. The actual name of the file may vary and is set with variable <tt>point_file</tt> in <tt>[[FlexAOD#input.dat|input.dat]]</tt>.
 
The format (free ASCII format) of the file is the following:
 
:column 1: point number
:column 2: time (YYYYMMDDHH)
:column 3: latitude (degrees north)
:column 4: longitude (degrees east)
 
Here is an example:
 
#  N    Date/hour    Lat      Lon
#      (YYYYMMDDHH)  (deg N)  (deg E)
1        2006010109    42.0      13.0
2        2006010110    42.0    -33.0
 
All the lines beginning with "<tt>#</tt>" will be removed by FlexAOD.
 
The utility <tt>random_pointout.sh</tt> generates a random list of points, between user defined dates and coordinates, that may be used for testing or random data model extraction.
 
 
=== Program Launch ===
 
Once you set up <tt>[[FlexAOD#input.dat|input.dat]]</tt> and, optionally, <tt>[[FlexAOD#pointout.dat|pointout.dat]]</tt>, launch FlexAOD from a shell:
 
./flexaod.sh
 
or, if you want a background job and log file (bash syntax):
 
./flexaod.sh &> log &
tail -f log
 
The utility <tt>loop.sh</tt> allows automatic FlexAOD launch for several user selected wavelengths and time periods. The <tt>loop_wave_rtm.sh</tt> is for specific use with <tt>point_rtm=T</tt> option: it will paste in a unique file the output of several wavelengths.
 
 
=== FlexAOD output ===
 
Similarly to [[Aerosol optical properties|GEOS-Chem on-line AOD calculations]], FlexAOD performs calculations for 6 "optical" species, assumed in external mixing state:
 
{| border=1 cellspacing=0 cellpadding=5
|- bgcolor="#CCCCCC"
!"Optical" species
![[FlexAOD#GEOS-Chem tracers|GEOS-Chem tracers]] included
|-
|SULF
|SO4, NH4, NIT
|-
|OC
|OCPI, OCPO, SOA1-5
|-
|BC
|BCPI, BCPO
|-
|SSa
|SSa
|-
|SSc
|SSc
|-
|DUST
|DST1-4
|-
|}
 
 
FlexAOD has the following types of user selected output:
 
{| border=1 cellspacing=0 cellpadding=5
|- bgcolor="#CCCCCC"
!Description
!<tt>[[FlexAOD#input.dat|input.dat]]</tt> option
!default output dir
!sample file name
!output variables
|-
|Full 3-D gridded output
|<tt>gridout=T</tt>
|<tt>[[FlexAOD#GEOS-Chem rundir|<rundir>]]/../GrADS</tt>
|<tt>ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>.ctl/dat</tt>
|AOD of "optical" species (same as GEOS-Chem on-line output), plus backscattering efficiency, single-scattering albedo and asymmetry factor
[[FlexAOD#Gridded (GrADS) output|[details]]]
|-
|Profile at selected points
|<tt>point_prof=T</tt><br><tt>point_file=<filename></tt>
|<tt>[[FlexAOD#GEOS-Chem rundir|<rundir>]]/../PROFILES</tt>
|<tt>ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_000012</tt>
|Profile of mass concentrations, number concentration; extinction, scattering and backscattering coefficients; single-scattering albedo; asymmetry factor; phase function coefficients
[[FlexAOD#Profile output|[details]]]
|-
|Profile at selected points for use with RTM (libRadtran)
|<tt>point_rtm=T</tt><br><tt>point_file=<filename></tt>
|<tt>[[FlexAOD#GEOS-Chem rundir|<rundir>]]/../libRadtran</tt>
|<tt>ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_000012_FILES</tt> (list of files with model level info)<br>
<tt>ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_CONC</tt> ("optical" species mass column, g/m^2)<br>
|extinction coefficient, single-scattering albedo, phase function coefficients
|-
|}
 
Any number of output types may be requested (at least one!).
 
 
==== Gridded (GrADS) output ====
 
The <tt>.ctl/.dat</tt> pairs generated for gridded GrADS binary output may be used for direct visualization and analysis in [http://www.iges.org/grads/ GrADS]. Activate this option only if you really need 3D output. If you need output only at selected points/times much better using [[FlexAOD#pointout.dat|point profile output]], which saves a lot of time performing calculations only at desired points.
 
If you don't like GrADS, you may read data with other computer languages, such as Fortran:
 
program read_grads
  ! Parameters
  integer,paramter :: iou = 10  ! I/O unit
  integer,paramter :: ni = 144  ! n. lons
  integer,paramter :: nj = 91    ! n. lats
  integer,paramter :: nl = 38    ! n. levs
  integer,paramter :: nspecs = 6 ! n. specs
  integer,paramter :: ntimes = 5 ! n. times
  ! Arrays
  real, dimension(ni,nj) :: aottot, ssatot, asymtot
  real, dimension(ni,nj,nl) :: kback, ssa, asym, boxh
  real, dimension(ni,nj,nl,nspecs) :: aot
  ! Open file in "binary" mode
  open(iou, file="<filename>", status="old", form="binary")
  ! Loop over times
  do it = 1, ntimes
    ! AOT [ni x nj]
    read(iou) aottot
    ! Column averaged Single-Scattering Albedo [ni x nj]
    read(iou) ssatot
    ! Column averaged Asymmetry Factor [ni x nj]
    read(iou) asymtot
    ! Optical Depths of single species [ni x nj x nl x nspecs]
    ! Species order: SULF, OC, BC, SSa, SSc, DUST
    do k=1,nspecs
      do l=1,nl
        read(iou) aot(:,:,l,k)
      enddo
    enddo
    ! 3D Back-scattering efficiency (1/(km srad)) [ni x nj x nl]
    do l=1,nl
      read(iou) kback(:,:,l)
    enddo
    ! 3D Single-Scatteting Albedo [ni x nj x nl]
    do l=1,nl
      read(iou) ssa(:,:,l)
    enddo
    ! 3D Asymmetry Factor [ni x nj x nl]
    do l=1,nl
      read(iou) asym(:,:,l)
    enddo
    ! Box Height (m) [ni x nj x nl]
    do l=1,nl
      read(iou) boxh(:,:,l)
    enddo
  enddo  ! times
  ! Close file
  close(iou)
end program read_grads
 
If your Fortran compiler does not understand the "binary" form, then just change it to "unformatted" at line 547 of <tt>src/flexaod.f90</tt>. In that case, however, you will NOT be able to use the output with GrADS.
 
==== Profile output ====
 
Profile output (<tt>point_prof=T</tt>) is much easier to handle, because it is in ASCII format. One file per point specified in <tt>[[FlexAOD#pointout.dat|pointout.dat]]</tt> list is generated. Each file thus contains the calculated profile for a given time/place.
 
Each output file has <tt>nl+1</tt> rows, where <tt>nl</tt> is the number of levels in GEOS-Chem timeseries. Here is the content of rows:
* '''1st row:''' column average/integrated values
* '''2nd to (<tt>nl+1</tt>)th row:''' values at model levels
 
Let <tt>nspecs = 6</tt> the number of "optical" species and <tt>noutpc</tt> is the number of output coefficients (default is 16, set at line <tt>1431</tt> of <tt>src/flexaod.f90</tt>).
 
Output variables for '''1st row''' are:
* '''column 1:''' 0.000
* '''column 2 to <tt>nspecs+1</tt>:''' column concentrations of "optical" species (g/m^2)
* '''column <tt>nspecs+2</tt>:''' column number concentration (#/cm^2)
* '''column <tt>nspecs+3</tt>:''' aerosol optical depth (unitless)
* '''column <tt>nspecs+4</tt>:''' scattering aerosol optical depth (unitless)
* '''column <tt>nspecs+5</tt>:''' back-scattering aerosol optical depth (unitless)
* '''column <tt>nspecs+6</tt>:''' column-weighted single-scattering albedo (unitless)
* '''column <tt>nspecs+7</tt>:''' column-weighted asymmetry factor (unitless)
* '''column <tt>nspecs+8</tt> to <tt>nspecs+8+noutpc-1</tt>:''' column-weighted phase function coefficients (unitless)
 
Output variables for '''other rows''' are:
* '''column 1:''' GEOS-Chem level height (km)
* '''column 2 to <tt>nspecs+1</tt>:''' mass concentrations of "optical" species (ug/m^3)
* '''column <tt>nspecs+2</tt>:''' number concentration (#/cm^3)
* '''column <tt>nspecs+3</tt>:''' extinction coefficient (1/km)
* '''column <tt>nspecs+4</tt>:''' scattering coefficient (1/km)
* '''column <tt>nspecs+5</tt>:''' back-scattering coefficient (1/(km srad))
* '''column <tt>nspecs+6</tt>:''' single-scattering albedo (unitless)
* '''column <tt>nspecs+7</tt>:''' asymmetry factor (unitless)
* '''column <tt>nspecs+8</tt> to <tt>nspecs+8+noutpc-1</tt>:''' phase function coefficients (unitless)
 
== Usage remarks ==
 
FlexAOD is still under devolopment, so it will hopefully expand its capabilities in the next months. Users are encouraged to return with bug reports, feedback, and suggestions.
 
At present stage, running FlexAOD with [[FlexAOD#Relative humidity timeseries issue|corrected GEOS-Chem RH timeseries]] and these options:
optsrc=STD
distsrc=STD
hgfsrc=STD
watsrc=STD
reproduces the on-line standard calculations, with negligible differences for very low AOD values (still not completely sure why).
 
In addition to on-line calculation, you can easily do:
#Extract selected profiles of additional variables, such as backscattering coefficients or single scattering albedo (see [[FlexAOD#Point output|Point output]])
#Calculate aerosol optical properties for several wavelengths avoiding repeated GEOS-Chem simulations
#Modify the size-distribution and hygroscopic properties of species (adding cases to <tt>data/size_dist</tt>)
 
Full flexibility of usage is reached with instantaneous timeseries (ND49, <tt>typ=inst</tt>) with hourly output, which allow perfect replication of on-line AOD calculation procedure. Hourly timeseries obviously require a lot of disk space. One may reduce disk usage by setting output frequency at e.g. 3 or 6 hours, but in that case FlexAOD output cannot be calculated for any hour of the day of course.
 
Satellite timeseries (ND51, <tt>typ=sat</tt>) is better used with 1 hour interval (e.g. 9-10 LT), in order again to replicate on-line AOD calculations. Using averaging interval larger than 1 hour will yield differences with respect to on-line AOD, because averaged values of aerosol concentrations and relative humidities will be used by FlexAOD.
 
Note on <tt>gridout</tt> option: activate this option only if you really need [[FlexAOD#Gridded (GrADS) output|3D output]]. If you need output only at selected points/times much better using [[FlexAOD#pointout.dat|point profile output]], which saves a lot of time performing calculations only at desired points.
 
 
--[[User:Gabriele.curci|gcc]] 12:05, 25 May 2011 (EDT)
 
== References ==
 
#Center for International Earth Science Information Network (CIESIN), Columbia University; and Centro Internacional de Agricultura Tropical (CIAT) (2005), Gridded Population of the World Version 3 (GPWv3): National Identifier Grid. Palisades, NY: Socioeconomic Data and Applications Center (SEDAC), Columbia University. http://sedac.ciesin.columbia.edu/gpw/
#Chin M, Ginoux P, Kinne S, Torres O, Holben BN, Duncan BN, Martin RV, Logan JA, Higurashi A, Nakajima T (2002), Tropospheric aerosol optical thickness from the GOCART model and comparisons with satellite and Sun photometer measurements, J. Atmos. Sci., 59(3), 461-483. (Table 3 of the paper)
#Hess, M., P. Koepke, and I. Schult (1998), Optical Properties of Aerosols and clouds: The software package OPAC, Bull. Am. Met. Soc., 79, 831-844. http://www.lrz.de/~uh234an/www/radaer/opac.html
#Mishchenko, M. I., J. M. Dlugach, E. G. Yanovitskij, and N. T. Zakharova, (1999), Bidirectional reflectance of flat, optically thick particulate laters:  an efficient radiative transfer solution and applications to snow and soil surfaces, J. Quant. Spectrosc. Radiat. Transfer, Vol. 63, 409-432.
#Mishchenko, M. I., L. D. Travis, and A. A. Lacis (2002), Scattering, Absorption, and Emission of Light by Small Particles, Cambridge University Press, Cambridge. http://www.giss.nasa.gov/staff/mmishchenko/brf/
#Segelstein, D. (1981), The Complex Refractive Index of Water, M.S. Thesis, University of Missouri, Kansas City. http://www.philiplaven.com/p20.html
#Sinyuk, A., O. Torres, and O. Dubovik (2003), Combined use of satellite and surface observations to infer the imaginary part of the refractive index of Saharan dust, Geophys. Res. Lett., 30(2), 1081.

Latest revision as of 20:58, 20 September 2022

FlexAOD (Flexible Aerosol Optical Depth) is a post-processing tool of GEOS-Chem, aimed at extending the model on-line capabilities concerning calculations of Aerosol optical properties. For a brief overview, check out the presentation at the 5th International GEOS-Chem Meeting! A quick comparison with online GEOS-Chem calculations is given in this pdf document.


User's Guide

Download code

Source code & input data are available at this link: http://pumpkin.aquila.infn.it/flexaod

From a Linux/Unix terminal, you may follow this procedure:

mkdir -p ~/geos-chem/flexaod
cd ~/geos-chem/flexaod
tar zxvf flexaod.tgz

This will create the subdirectory "flexaod_vX.Y", here is a quick look at the content:

Filename/Dirname Description
flexaod.sh Launch script
input.dat Configuration file
pointout.dat Point output configuration file (the actual name is set with point_file variable)
random_pointout.sh Random pointout.dat generator
loop.sh Loop script for automatic launch at several wavelengths and/or date intervals
loop_wave_rtm.sh Loop script for automatic launch and post-processing of libRadtran output at several wavelengths
src/ Fortran source code
src/Makefile.hdr.* Makefile headers for Fortran compiler configuration
data/ Optical input data (i.e. all but GEOS-Chem timeseries)
data/gads/optdat GADS/OPAC input database (Hess et al., 1998)
data/lsmask Land/sea mask calculated from gridded national IDs (CIESIN and CIAT, 2005), only needed if point_watonly=T
data/refind Alternative refractive indices databases. From FlexAOD v1.4+ the dust refractive indices from Sinyuk et al. (2003) are used in the standard case.
data/size_dist Parameters of size distributions and hygroscopic growth factors
data/water Water spectral refractive index (Segelstein, 1981)

Set up GEOS-Chem timeseries & data dir

GEOS-Chem tracers

FlexAOD needs GEOS-Chem timeseries in input (instantaneous (ND49) or satellite (ND51)). There is a minimum set of tracers to be saved in output timeseries:


Aerosol concentrations Tracer #
(v9-01-01*)
Description
SO4 27 Sulfate
NH4 31 Ammonium
NIT 32 Nitrate
BCPI 34 Black carbon hydrophillic
OCPI 35 Primary organic carbon hydrophillic
BCPO 36 Black carbon hydrophobic
OCPO 37 Primary organic carbon hydrophobic
SOA1-5 46-50 Secondary organic aerosols classes 1-5
DST1-4 51-54 Mineral dust aerosols (size bins 1-4)
SSa 55 Sea salt aerosols accumulation mode
SSc 56 Sea salt aerosols coarse mode
Meteo fields Tracer # Description
AIRD 80 Air density (molecules/cm^3)
BOXH 94 Box Height (m)
RELH 95 Relative Humidity (%)
Optional (for comparison with on-line AOD) Tracer # Description
OPSO4 84 Sulfate aerosols AOD
OPBC 85 Black carbon AOD
OPOC 86 Organic carbon AOD
OPSSa 87 SSa AOD
OPSSc 88 SSc AOD
OPD 89 Total dust AOD

*NOTE: tracer # valid for v9-01-01 SOA simulation, please check for other simulations and next versions!

Relative humidity timeseries issue

Relative humidity saved in GEOS-Chem timeseries output (ND49-51) differs from that used for on-line calculations of chemistry and aerosol optical depths. This causes small differences in FlexAOD output with respect to GEOS-Chem on-line calculations for very low AOD values. Have a look at this pdf document to get an idea of the impact of the different RH on AOD calculations.

For a quick fix, do the following modifications to GEOS-Chem code (v9-01-01, under GeosCore directory):

In dao_mod.f:

.... around line 155
REAL*8,  ALLOCATABLE :: RH(:,:,:)
REAL*8,  ALLOCATABLE :: RH_CHEM(:,:,:)  <-- add this line
 
... around line 2090
! Relative humidity
ALLOCATE( RH( IIPAR, JJPAR, LLPAR ), STAT=AS )
IF ( AS /= 0 ) CALL ALLOC_ERR( 'RH' )
RH = 0d0
 
! Relative humidity used in chemistry (gcc rh, 7/10)     <-- add these lines
ALLOCATE( RH_CHEM( IIPAR, JJPAR, LLPAR ), STAT=AS )      <--
IF ( AS /= 0 ) CALL ALLOC_ERR( 'RH_CHEM' )               <--
RH_CHEM = 0d0                                            <--

... around line 2763
IF ( ALLOCATED( RH       ) ) DEALLOCATE( RH       )
IF ( ALLOCATED( RH_CHEM  ) ) DEALLOCATE( RH_CHEM  )     <-- add this line

In aerosol_mod.f:

... around line 544
USE DAO_MOD,       ONLY : BXHEIGHT
USE DAO_MOD,       ONLY : RH_CHEM    <-- add this line

... around line 923
! Store RH_CHEM
DO JLOOP = 1, NTLOOP

   ! Get 3-D grid box indices
   I = IXSAVE(JLOOP)
   J = IYSAVE(JLOOP)
   L = IZSAVE(JLOOP)

   ! Copy onto output array
   RH_CHEM(I, J, L) = ABSHUM(JLOOP) * 1d2

ENDDO

In diag49_mod.f

... around line 176
USE DAO_MOD,      ONLY : CLDTOPS, OPTD,   RH,       SLP
USE DAO_MOD,      ONLY : RH_CHEM    <-- add this line

... around line 948
!Q(X,Y,K) = RH(I,J,L)      <-- comment this line
Q(X,Y,K) = RH_CHEM(I,J,L)  <-- add this line

In diag51_mod.f:

... around line 358
USE DAO_MOD,        ONLY : UWND,    VWND,   SLP
USE DAO_MOD,        ONLY : RH_CHEM    <-- add this line
 
... around line 856
!Q(X,Y,K,W) = Q(X,Y,K,W) + ( RH(I,J,L) * GOOD(I) )       <-- comment this line
Q(X,Y,K,W) = Q(X,Y,K,W) + ( RH_CHEM(I,J,L) * GOOD(I) )   <-- add this line

GEOS-Chem rundir

By default, FlexAOD will look for GEOS-Chem output into a subdirectory defined at line 168 of flexaod.sh:

rundir=${HOME}/geos-chem/GEOS-Chem.${ver}.stdrun/runs/${met}.${res}/output/${lab}

where $ver, $met, $res, and $lab are all defined in input.dat. A GEOS-Chem user is familiar with the first three variables, the latter is introduced for further organization of the run directory, but its use is optional. Tailor the naming conventions of the run directory to your needs.

In addition to time series, FlexAOD expects to find under rundir:

tracerinfo.dat.${tlab}
diaginfo.dat.${tlab}

where $tlab is an additional "time label" also defined in input.dat. Please rename your *info.dat accordingly.

Sample GEOS-Chem timeseries output and info files are provided for testing under: http://pumpkin.aquila.infn.it/flexaod/download/testdata

From shell, go under your "rundir" and you may download all data with:

wget -r -nd -np -R*html* http://pumpkin.aquila.infn.it/flexaod/download/testdata


Optional GEOS-Chem launch script

A launch script for GEOS-Chem model is provided with FlexAOD in order to:

  • launch the simulation within your rundir
  • move/rename the output files after run in an output directory suitable for FlexAOD (see GEOS-Chem rundir)

You may download and launch the script with:

wget http://pumpkin.aquila.infn.it/flexaod/download/run_geos.sh
./run_geos.sh <lab> <tlab>

where <lab> and <tlab> are the simulation and time labels to subsequently set into input.dat for use with FlexAOD.


input.dat

Here is a description of the FlexAOD configuration file input.dat:

Parameter Description Examples/Possible values
ver GEOS-Chem version v9-01-01
met GEOS-Chem met-fields version geos5
res GEOS-Chem horizontal resolution 2x2.5
sim GEOS-Chem simulation SOA
compiler Fortran compiler option IFORT (used to link to corresponding src/Makefile.hdr.<compiler>)
lab GEOS-Chem simulation label CTRL (optional, see Set up GEOS-Chem timeseries & data_dir)
tlab GEOS-Chem time label 200701 (mandatory, see Set up GEOS-Chem timeseries & data_dir)
typ GEOS-Chem timeseries type inst (ND49) or
sat (ND51)
dini Initial date of FlexAOD run 20070101 (YYYYMMDD)
dend Final date of FlexAOD run 20070131 (YYYYMMDD)
wl Wavelegth (nm) 443 (range limited by optical input)
optsrc Optical properties option STD (OPAC/GADS, with modifications as online) or
OPAC (OPAC/GADS)
distsrc Size distribution option STD (associates to data/size_dist/dist_<distsrc>.dat)
hgfsrc Hygroscopic growth option STD (from OPAC/GADS, with modifications as online) or
OPAC (from OPAC/GADS) or
CHIN (from Chin et al, 2002)
watsrc Water refractive index option STD (as online: fixed at 1.33+i*0.0) or
SEGEL (Segelstein (1981), spectrally varying index)
fullmie Mie calculations option F (create Mie look-up table) or
T (Mie calculation for every grid-cell, NOT YET IMPLEMENTED, VERY CPU INTENSIVE!)
aodlab FlexAOD output label STD
gridout Switch for full 3-D output T or F
point_prof Switch for point profile output T or F
point_rtm Switch for point RTM output (libRadtran) T or F
point_file Point output list filename `pwd`/pointout.dat
point_watonly Point output only over water pixels T or F

pointout.dat

The pointout.dat contains the list of points (time and place) for FlexAOD point output. The actual name of the file may vary and is set with variable point_file in input.dat.

The format (free ASCII format) of the file is the following:

column 1: point number
column 2: time (YYYYMMDDHH)
column 3: latitude (degrees north)
column 4: longitude (degrees east)

Here is an example:

#   N     Date/hour     Lat      Lon
#       (YYYYMMDDHH)  (deg N)  (deg E)
1        2006010109    42.0      13.0
2        2006010110    42.0     -33.0

All the lines beginning with "#" will be removed by FlexAOD.

The utility random_pointout.sh generates a random list of points, between user defined dates and coordinates, that may be used for testing or random data model extraction.


Program Launch

Once you set up input.dat and, optionally, pointout.dat, launch FlexAOD from a shell:

./flexaod.sh

or, if you want a background job and log file (bash syntax):

./flexaod.sh &> log &
tail -f log

The utility loop.sh allows automatic FlexAOD launch for several user selected wavelengths and time periods. The loop_wave_rtm.sh is for specific use with point_rtm=T option: it will paste in a unique file the output of several wavelengths.


FlexAOD output

Similarly to GEOS-Chem on-line AOD calculations, FlexAOD performs calculations for 6 "optical" species, assumed in external mixing state:

"Optical" species GEOS-Chem tracers included
SULF SO4, NH4, NIT
OC OCPI, OCPO, SOA1-5
BC BCPI, BCPO
SSa SSa
SSc SSc
DUST DST1-4


FlexAOD has the following types of user selected output:

Description input.dat option default output dir sample file name output variables
Full 3-D gridded output gridout=T <rundir>/../GrADS ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>.ctl/dat AOD of "optical" species (same as GEOS-Chem on-line output), plus backscattering efficiency, single-scattering albedo and asymmetry factor

[details]

Profile at selected points point_prof=T
point_file=<filename>
<rundir>/../PROFILES ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_000012 Profile of mass concentrations, number concentration; extinction, scattering and backscattering coefficients; single-scattering albedo; asymmetry factor; phase function coefficients

[details]

Profile at selected points for use with RTM (libRadtran) point_rtm=T
point_file=<filename>
<rundir>/../libRadtran ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_000012_FILES (list of files with model level info)

ts_satellite_<tlab>_<lab>_<dini>-<dend>_<wl>nm_<aodlab>_CONC ("optical" species mass column, g/m^2)

extinction coefficient, single-scattering albedo, phase function coefficients

Any number of output types may be requested (at least one!).


Gridded (GrADS) output

The .ctl/.dat pairs generated for gridded GrADS binary output may be used for direct visualization and analysis in GrADS. Activate this option only if you really need 3D output. If you need output only at selected points/times much better using point profile output, which saves a lot of time performing calculations only at desired points.

If you don't like GrADS, you may read data with other computer languages, such as Fortran:

program read_grads

 ! Parameters
 integer,paramter :: iou = 10   ! I/O unit
 integer,paramter :: ni = 144   ! n. lons
 integer,paramter :: nj = 91    ! n. lats
 integer,paramter :: nl = 38    ! n. levs
 integer,paramter :: nspecs = 6 ! n. specs
 integer,paramter :: ntimes = 5 ! n. times

 ! Arrays
 real, dimension(ni,nj) :: aottot, ssatot, asymtot
 real, dimension(ni,nj,nl) :: kback, ssa, asym, boxh
 real, dimension(ni,nj,nl,nspecs) :: aot


 ! Open file in "binary" mode
 open(iou, file="<filename>", status="old", form="binary")

 ! Loop over times
 do it = 1, ntimes

   ! AOT [ni x nj]
   read(iou) aottot

   ! Column averaged Single-Scattering Albedo [ni x nj]
   read(iou) ssatot

   ! Column averaged Asymmetry Factor [ni x nj]
   read(iou) asymtot

   ! Optical Depths of single species [ni x nj x nl x nspecs]
   ! Species order: SULF, OC, BC, SSa, SSc, DUST
   do k=1,nspecs
     do l=1,nl
       read(iou) aot(:,:,l,k)
     enddo
   enddo

   ! 3D Back-scattering efficiency (1/(km srad)) [ni x nj x nl]
   do l=1,nl
     read(iou) kback(:,:,l)
   enddo

   ! 3D Single-Scatteting Albedo [ni x nj x nl]
   do l=1,nl
     read(iou) ssa(:,:,l)
   enddo

   ! 3D Asymmetry Factor [ni x nj x nl]
   do l=1,nl
     read(iou) asym(:,:,l)
   enddo

   ! Box Height (m) [ni x nj x nl]
   do l=1,nl
     read(iou) boxh(:,:,l)
   enddo

 enddo   ! times

 ! Close file
 close(iou)

end program read_grads

If your Fortran compiler does not understand the "binary" form, then just change it to "unformatted" at line 547 of src/flexaod.f90. In that case, however, you will NOT be able to use the output with GrADS.

Profile output

Profile output (point_prof=T) is much easier to handle, because it is in ASCII format. One file per point specified in pointout.dat list is generated. Each file thus contains the calculated profile for a given time/place.

Each output file has nl+1 rows, where nl is the number of levels in GEOS-Chem timeseries. Here is the content of rows:

  • 1st row: column average/integrated values
  • 2nd to (nl+1)th row: values at model levels

Let nspecs = 6 the number of "optical" species and noutpc is the number of output coefficients (default is 16, set at line 1431 of src/flexaod.f90).

Output variables for 1st row are:

  • column 1: 0.000
  • column 2 to nspecs+1: column concentrations of "optical" species (g/m^2)
  • column nspecs+2: column number concentration (#/cm^2)
  • column nspecs+3: aerosol optical depth (unitless)
  • column nspecs+4: scattering aerosol optical depth (unitless)
  • column nspecs+5: back-scattering aerosol optical depth (unitless)
  • column nspecs+6: column-weighted single-scattering albedo (unitless)
  • column nspecs+7: column-weighted asymmetry factor (unitless)
  • column nspecs+8 to nspecs+8+noutpc-1: column-weighted phase function coefficients (unitless)

Output variables for other rows are:

  • column 1: GEOS-Chem level height (km)
  • column 2 to nspecs+1: mass concentrations of "optical" species (ug/m^3)
  • column nspecs+2: number concentration (#/cm^3)
  • column nspecs+3: extinction coefficient (1/km)
  • column nspecs+4: scattering coefficient (1/km)
  • column nspecs+5: back-scattering coefficient (1/(km srad))
  • column nspecs+6: single-scattering albedo (unitless)
  • column nspecs+7: asymmetry factor (unitless)
  • column nspecs+8 to nspecs+8+noutpc-1: phase function coefficients (unitless)

Usage remarks

FlexAOD is still under devolopment, so it will hopefully expand its capabilities in the next months. Users are encouraged to return with bug reports, feedback, and suggestions.

At present stage, running FlexAOD with corrected GEOS-Chem RH timeseries and these options:

optsrc=STD
distsrc=STD
hgfsrc=STD
watsrc=STD

reproduces the on-line standard calculations, with negligible differences for very low AOD values (still not completely sure why).

In addition to on-line calculation, you can easily do:

  1. Extract selected profiles of additional variables, such as backscattering coefficients or single scattering albedo (see Point output)
  2. Calculate aerosol optical properties for several wavelengths avoiding repeated GEOS-Chem simulations
  3. Modify the size-distribution and hygroscopic properties of species (adding cases to data/size_dist)

Full flexibility of usage is reached with instantaneous timeseries (ND49, typ=inst) with hourly output, which allow perfect replication of on-line AOD calculation procedure. Hourly timeseries obviously require a lot of disk space. One may reduce disk usage by setting output frequency at e.g. 3 or 6 hours, but in that case FlexAOD output cannot be calculated for any hour of the day of course.

Satellite timeseries (ND51, typ=sat) is better used with 1 hour interval (e.g. 9-10 LT), in order again to replicate on-line AOD calculations. Using averaging interval larger than 1 hour will yield differences with respect to on-line AOD, because averaged values of aerosol concentrations and relative humidities will be used by FlexAOD.

Note on gridout option: activate this option only if you really need 3D output. If you need output only at selected points/times much better using point profile output, which saves a lot of time performing calculations only at desired points.


--gcc 12:05, 25 May 2011 (EDT)

References

  1. Center for International Earth Science Information Network (CIESIN), Columbia University; and Centro Internacional de Agricultura Tropical (CIAT) (2005), Gridded Population of the World Version 3 (GPWv3): National Identifier Grid. Palisades, NY: Socioeconomic Data and Applications Center (SEDAC), Columbia University. http://sedac.ciesin.columbia.edu/gpw/
  2. Chin M, Ginoux P, Kinne S, Torres O, Holben BN, Duncan BN, Martin RV, Logan JA, Higurashi A, Nakajima T (2002), Tropospheric aerosol optical thickness from the GOCART model and comparisons with satellite and Sun photometer measurements, J. Atmos. Sci., 59(3), 461-483. (Table 3 of the paper)
  3. Hess, M., P. Koepke, and I. Schult (1998), Optical Properties of Aerosols and clouds: The software package OPAC, Bull. Am. Met. Soc., 79, 831-844. http://www.lrz.de/~uh234an/www/radaer/opac.html
  4. Mishchenko, M. I., J. M. Dlugach, E. G. Yanovitskij, and N. T. Zakharova, (1999), Bidirectional reflectance of flat, optically thick particulate laters: an efficient radiative transfer solution and applications to snow and soil surfaces, J. Quant. Spectrosc. Radiat. Transfer, Vol. 63, 409-432.
  5. Mishchenko, M. I., L. D. Travis, and A. A. Lacis (2002), Scattering, Absorption, and Emission of Light by Small Particles, Cambridge University Press, Cambridge. http://www.giss.nasa.gov/staff/mmishchenko/brf/
  6. Segelstein, D. (1981), The Complex Refractive Index of Water, M.S. Thesis, University of Missouri, Kansas City. http://www.philiplaven.com/p20.html
  7. Sinyuk, A., O. Torres, and O. Dubovik (2003), Combined use of satellite and surface observations to infer the imaginary part of the refractive index of Saharan dust, Geophys. Res. Lett., 30(2), 1081.