Child pages
  • AppsWRFchemEmissions
Skip to end of metadata
Go to start of metadata

Compiling the Global Emissions Programs

You can copy the latest global emissions data files and programs from ftp://aftp.fsl.noaa.gov/divisions/taq/global_emissions/.

Compiling the utility library on AIX

The utility library is required to compile prep_chem_input. Follow the README and be sure to use gmake.

Set these variables:

% export OBJECT_MODE=64
% export NCARG_ROOT=/usr/local/pkg/ncarg/version64

Here are the diffs for include.mk. Be sure to remove the default Linux definitions (ifort etc) lower down!

% diff include.mk include.mk.DIST
39,40d35
< LOADER=ncargf90
< LIBNCARG=$(NCARG_ROOT)/lib/libncarg.a
43,44c38,39
< # NCARG_DIR=$(NCARG_ROOT)
< # LIBNCARG=$(NCARG_ROOT)/libncarg-$(UTILS_VERSION).a
---
> NCARG_DIR=$(NCARG_ROOT)
> LIBNCARG=$(NCARG_ROOT)/libncarg-$(UTILS_VERSION).a

< MPI_PATH=/usr/lpp/ppe.poe
< PAR_INCS=-I$(MPI_PATH)/include
< PAR_LIBS=-L$(MPI_PATH)/lib -lmpi 
< PAR_DEFS=-DRAMS_MPI
---
> #MPI_PATH=/usr/local/mpich
> #PAR_INCS=-I$(MPI_PATH)/include
> #PAR_LIBS=-L$(MPI_PATH)/lib/rs6000/ch_p4 -lmpi 
> #PAR_DEFS=-DRAMS_MPI

Compiling the emissions preparation programs

Many of the fortran source files have misaligned string initializers, for example:

% diff prep_chem_sources_utils.f90 prep_chem_sources_utils.f90.DIST
1914,1916c1914,1916
< ,'OC  '   &!
< ,'BC  '   &
< ,'DMS '  &
---
> ,'OC'   &!
> ,'BC'   &
> ,'DMS'  &

As shown above, it was necessary to align all the string initializers (make them the same length) to get these files to compile:

  • AeM_emission_factors.f90
  • chem1_list.f90
  • edgar_emissions.f90
  • gocart_background.f90
  • prep_chem_sources_utils.f90

Also lines 1804 and 1822 of prep_chem_sources_utils.f90 ended the statement read(iunit,)* with a comma, regarded as a syntax error by the xlf compiler.

gocart_emissions.f90 had CALL FLUSH(6) rather than just FLUSH(6) on line 192.

To compile, set these variables:

% export OBJECT_MODE=64
% export NCARG_ROOT=/usr/local/pkg/ncarg/version64

Here are the diffs for the .mk files:

% diff include_prep_chem_src.mk include_prep_chem_src.mk.DIST
11c11
< PREP_SOURCES_CHEM=.
---
> PREP_SOURCES_CHEM=../
24d23
< NETCDF=/usr/local/pkg/netcdf/version64
42,50c41,49
< CMACH=IBM
< F_COMP=xlf_r
< F_OPTS=-O -NA18000 -NQ30000 -qcharlen=10000 $(NCDF_LIBS) 
< C_COMP=cc_r
< C_OPTS=-O2 -D$CMACH
< C_PP_OPTS=-P
< LOADER=ncargf77
< LOADER_OPTS=
< LIBS=
---
> #CMACH=IBM
> #F_COMP=f77
> #F_OPTS=-O -NA18000 -NQ30000 -qcharlen=10000
> #C_COMP=cc
> #C_OPTS=-O -D$CMACH
> #C_PP_OPTS=-P
> #LOADER=ncargf77
> #LOADER_OPTS=
> #LIBS=
155,165c154,164
< # CMACH=PC_LINUX1
< # F_COMP=ifort
< # C_COMP=icc
< # LOADER=ifort
< # C_LOADER=icc
< # LIBS=
< # # Compiler options
< # #F_OPTS=-FR -O2 $(NCDF_LIBS) -g -check all
< # F_OPTS=-FR -O2 -convert big_endian $(NCDF_LIBS) 
< # C_OPTS=-O2 
< # LOADER_OPTS= 
---
> CMACH=PC_LINUX1
> F_COMP=ifort
> C_COMP=icc
> LOADER=ifort
> C_LOADER=icc
> LIBS=
> # Compiler options
> #F_OPTS=-FR -O2 $(NCDF_LIBS) -g -check all
> F_OPTS=-FR -O2 -convert big_endian $(NCDF_LIBS) 
> C_OPTS=-O2 
> LOADER_OPTS= 
% gmake
  • No labels