The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI...

11
The ATHAM Model: The ATHAM Model: Code Structure and Usage Code Structure and Usage Michael Herzog, Michael Herzog, GFDL GFDL Princeton, USA Princeton, USA Gunnar Luderer, Gunnar Luderer, MPI Mainz, MPI Mainz, Germany Germany Joerg Trentmann, Joerg Trentmann, U U niversity of Mainz, niversity of Mainz, Germany Germany Christiane Textor, Christiane Textor, LSCE Paris, LSCE Paris, France France

Transcript of The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI...

Page 1: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

The ATHAM Model: The ATHAM Model: Code Structure and UsageCode Structure and Usage

Michael Herzog,Michael Herzog, GFDL Princeton, USAGFDL Princeton, USA

Gunnar Luderer, Gunnar Luderer, MPI Mainz, GermanyMPI Mainz, Germany

Joerg Trentmann, Joerg Trentmann, UUniversity of Mainz, Germanyniversity of Mainz, Germany

Christiane Textor, Christiane Textor, LSCE Paris, FranceLSCE Paris, France

ATHAM Workshop, Cambridge, UK, June 19-22, 2006ATHAM Workshop, Cambridge, UK, June 19-22, 2006

Page 2: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Features of New ATHAM CodeFeatures of New ATHAM Code revised code structure

– namelist control to avoid recompile– directory structure to separate code from i/o– more user-friendly (makefiles, libraries,

defined interfaces for adding new modules or variables)

MPI support for parallel computing– larger problem size (3d, more processes)

(in cylindric coordinates serial only)

Page 3: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Getting Started Getting Started (unix-like system)(unix-like system)

expand archive file expand archive file atham_[dd.mm.yyyy]_tar.gz atham_[dd.mm.yyyy]_tar.gz – subdirectories subdirectories source/source/ and and input/input/

create directories create directories exec/, output/, save/exec/, output/, save/

specify compiler/flags in specify compiler/flags in source/Makefile.COMPILEsource/Makefile.COMPILE

compile code, create executable: compile code, create executable: make [atham, rebuild]make [atham, rebuild]

modify input files in modify input files in input/input/

run executable run executable exec/atham exec/atham (or with(or with make run make run))

visualize and analyze output files in visualize and analyze output files in output/output/

Page 4: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Input FilesInput Files vertical profiles:

– INPUT_profile: T(z), RH(z), u(z), v(z)

– INPUT_kinetic: viscosity, free path length of air

namelist files:

– INPUT_atham_setup: type, domain, timing

– INPUT_volcano: processes, tracer, forcing

– INPUT_procsconfig, INPUT_fireforcing, INPUT_twomicrophys, INPUT_zgrid, INPUT_coignimbrit, INPUT_dynamic_setup

Page 5: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

INPUT_atham_setupINPUT_atham_setup

type or configuration: e.g. if volcano_setup read INPUT_volcano

coordinate system: cylindric or cartesian

boundary condition: cyclic or no slip

output format: netcdf or binary

domain size, number of grid points

number of processors for MPI version

location of zoom, spatial resolution at zoomAdobe Acrobat

Document

Page 6: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

INPUT_volcanoINPUT_volcano

active process modules (bulk cloud microphysic)

number of tracer (ntrac, ntgas, ntpas)

tracer properties (cp, cv, density, radius)

tracer names for output files

Adobe Acrobat Document

Page 7: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Executing and OutputExecuting and Output executable exec/atham

– reads from input/ (except restart from output/)– writes to output/ (old output files

overwritten)

output from Parallel (MPI) version:– separate restart and output files

for each processor, e.g. ATDAT_<px>_<py>– output files can be recombined with exec/rebuild– no(!) rebuild for ATDAT– single output file if netcdf

output can be viewed with grads (qview) or ferret

Page 8: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Code StructureCode Structure

subdirectories in source/:

– Basic/: data module, phys constants

– Atham/: dynamical core

– ProcessModules/: processes, forcing=> add new process using process_data, .e.g. radiation

– Configurations/: problem description=> add new problem, e.g. coignimbrit eruption

Page 9: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Adding a ProcessAdding a ProcessExample: Radiation for volcano_setupExample: Radiation for volcano_setup add radiation.F90 in source/ProcessModules/

use data from module process_data.F90 (and atham_module.F90)

register radiation module in module processes.F90 and Makefile.COMPILE

add temperature forcing to tetflx

add radiation calls in source/Configurations/volcano.F90– radiation_init in routine volcano_init– radiation_preset in routine volcano_preset– radiation_flux in routine volcano_flux– diagnostics in volcano_diagnostic

and volcano_final_diagnostic

Page 10: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Treating a New ProblemTreating a New ProblemExample: Co-ignimbrite EruptionExample: Co-ignimbrite Eruption

add coignimbrit.F90 in source/Configurations/ containing:– coignimbrit_init (coignimbrit_pointer)– coginimbrit_preset– coignimbrit_flux (incl. coignimbrit_forcing)– coignimbrit_fallvel– coignimbrit_diagnostic, coignimbrit_final_diagnostic

register coignimbrit module in module configurations.F90 and Makefile.COMMON

use data from atham_module add flag coignimbrit_setup in source/Basic/atham_module.F90 add coignimbrit calls in source/Atham/atham_setup.F90,

atham_forcing.F90, atham_fallvelocity.F90, atham_output.F90

Page 11: The ATHAM Model: Code Structure and Usage Michael Herzog, GFDL Princeton, USA Gunnar Luderer, MPI Mainz, Germany Joerg Trentmann, University of Mainz,

Questions, Comments?Questions, Comments?