how to add a tracer in echam6?. mo_transport.f90 module mo_transport use mo_kind, only: dp use...
TRANSCRIPT
How to add a tracer in ECHAM6?
mo_transport.f90
MODULE mo_transport
USE mo_kind, ONLY: dp
USE mo_time_conversion ONLY: time_days
IMPLICIT NONE
PRIVATE
PUBLIC :: init_transport, bcond_transport
CHARACTER (LEN=9), PARAMETER :: c_mod_name=’transport’
INTEGER :: dt_start_emission(6)=(/1991,6,15,0,0,0/)
REAL(dp) :: emission_flux=1.0_dp ! emission msaa fluz in kg/s
REAL(dp) :: emission_lon=12._dp, emission_lat=40._dp, emission_plec=500._dp
INTEGER :: idx_lev_emission
TYPE(time_days), SAVE :: start_emission
REAL(dp), pointer :: emission_mask(:,:)
INTEGER :: idx_xtrans ! tracer index
CHARACTER(LEN=24) :: trname ! tracer base name
CHARACTER(LEN=256) :: trmodule !< module name
SUBROUTINE init_transport
SUBROUTINE init_transport
USE mo_exception, ONLY: finish, message
USE mo_mpi, ONLY: p_parallel_io, p_parallel, p_io, p_bcast
USE mo_namelist, ONLY: position_nml, open_nml, &
POSITIONED, MISSING, &
LENGTH_ERROR, READ_ERROR
USE mo_tracer, ONLY: new_tracer, get_tracer
USE mo_tracdef, ONLY: ON, OFF, GAS, RESTART, CONSTANT
USE mo_time_conversion, ONLY: TC_set, TC_convert, time_native
USE mo_memory_base, ONLY: new_stream, add_stream_element, t_stream
USE mo_gaussgrid, ONLY: philon, philat, gridarea
USE mo_transpose, ONLY: scatter_gp
USE mo_decomposition, ONLY: dc => local_decomposition,global_decomposition
USE mo_control, ONLY: nlev, nvclev, vct ! for hyai, hybi coefficients
USE mo_util_string, ONLY: int2string
……
SUBROUTINE init_transport……
! define new tracer xtrans if it does not exist already
trname = 'xtrans'
CALL get_tracer (trname, idx = idx_xtrans, modulename=trmodule, ierr = ierr) !, pxt = co2, pxtm1 = co2m1)
IF (ierr==1) THEN
CALL new_tracer( &
trname, &! tracer name
'transport', &! module name
idx=idx_xtrans, &! tracer index (out)
units = 'kg kg-1', &
ninit = RESTART+CONSTANT, &
vini = 0.0_dp, &
ierr = ierr)
ELSE
CALL finish ('mo_transport ( init_transport )','Tracer '''//trname//''' already exists '//&
'defined by module '//TRIM(trmodule))
END IF
……
ninit
• Initialization of tracer mixing ratios in one integer
• constant: set tracer mixing ratio to a globally constant value at start of run• restart: at restart, read mmr from restart file• Initial: set tracer mmr to same distribution read from file(at beginning of
experiment)
• Hierarchy in ECHAM: restart→ initial(values from file)→ constant
20 21 22 23 …231
0/1 0/1 0/1 0/1 0/1
constant restart initial
Submodel mo_tracer.f90SUBROUTINE new_tracer (name, modulename, spid, subname,longname, & ! names... units, trtype, nphase, mode, & ninit, nrerun, vini, & ! initialisation nwrite, nint, code, table, bits, & ! output burdenid, nbudget, & ! diagnostics ntran, nfixtyp, nvdiff, nconv, & ! processes ndrydep, nwetdep, nsedi, nemis, nsoluble, & moleweight, tdecay, & ! species properties !!mgs!! moleweight, henry, dryreac, tdecay, & ! species properties idx, myflag, ierr) ! return info
Submodel mo_tracer.f90
• CHARACTER(len=*) ,INTENT(in) :: name ! name of tracer• CHARACTER(len=*) ,INTENT(in) :: modulename! name of routine/module• INTEGER ,INTENT(in) ,OPTIONAL :: spid ! species index• CHARACTER(len=*) ,INTENT(in) ,OPTIONAL :: subname ! optional for 'colored'• CHARACTER(len=*) ,INTENT(in) ,OPTIONAL :: longname ! long name• CHARACTER(len=*) ,INTENT(in) ,OPTIONAL :: units ! units• INTEGER ,INTENT(in) ,OPTIONAL :: trtype ! tracer type• INTEGER ,INTENT(in) ,OPTIONAL :: nphase ! phase indicator• INTEGER ,INTENT(in) ,OPTIONAL :: mode ! mode indicator or bin
number• INTEGER ,INTENT(in) ,OPTIONAL :: ninit ! initialisation flag• INTEGER ,INTENT(in) ,OPTIONAL :: nrerun ! restart flag• REAL(dp) ,INTENT(in) ,OPTIONAL :: vini ! initialisation value• INTEGER ,INTENT(in) ,OPTIONAL :: nwrite ! flag to print tracer• INTEGER ,INTENT(in) ,OPTIONAL :: nint ! integration flag
• INTEGER ,INTENT(in) ,OPTIONAL :: code ! grib code• INTEGER ,INTENT(in) ,OPTIONAL :: table ! grib table• INTEGER ,INTENT(in) ,OPTIONAL :: bits ! grib encoding bits• INTEGER ,INTENT(in) ,OPTIONAL :: burdenid ! burden diagnostics
number• INTEGER ,INTENT(in) ,OPTIONAL :: nbudget ! budget diagnostics• INTEGER ,INTENT(in) ,OPTIONAL :: ntran ! transport switch• INTEGER ,INTENT(in) ,OPTIONAL :: nfixtyp ! type of mass fixer• INTEGER ,INTENT(in) ,OPTIONAL :: nvdiff ! vertical diffusion fl.• INTEGER ,INTENT(in) ,OPTIONAL :: nconv ! convection flag• INTEGER ,INTENT(in) ,OPTIONAL :: ndrydep ! dry deposition flag• INTEGER ,INTENT(in) ,OPTIONAL :: nwetdep ! wet deposition flag• INTEGER ,INTENT(in) ,OPTIONAL :: nsedi ! sedimentation flag• INTEGER ,INTENT(in) ,OPTIONAL :: nemis ! surface emission flag• INTEGER ,INTENT(in) ,OPTIONAL :: nsoluble ! soluble flag