Difference between revisions of "FlexAOD"

From Geos-chem
Jump to: navigation, search
(Profile output)
(Download code)
 
Line 14: Line 14:
 
  mkdir -p ~/geos-chem/flexaod
 
  mkdir -p ~/geos-chem/flexaod
 
  cd ~/geos-chem/flexaod
 
  cd ~/geos-chem/flexaod
wget http://pumpkin.aquila.infn.it/flexaod/download/flexaod.tgz
 
 
  tar zxvf flexaod.tgz
 
  tar zxvf flexaod.tgz
  

Latest revision as of 21:06, 11 May 2013

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.