150 likes | 276 Views
How to implement a submodel (transport submodel ) in ECHAM6. New submodel “ transport ” in ECHAM. register submodel => new switch “ ltransport ” in “ submodelctl.inc ” ID-number=> id_transport set initial value of ltransport broadcast ltransport , call new_submodel
E N D
New submodel “transport” in ECHAM • register submodel=> new switch “ltransport” in “submodelctl.inc” ID-number=>id_transport set initial value of ltransport broadcast ltransport, call new_submodel (2) Namelist “transportctl.inc” (3) “mo_transport.f90” (4)call “init_transport” (5) In Namelist=> set variables
(1.1) Switch=>ltransport宣告(/echam-6.0.09/include/submodelctl.inc) NAMELIST /submodelctl/ & lxt, & ! switch generic test tracer submodule on/off lmethox, & ! switch for upper atmospheric H2O production from methane ltransdiag, & ! switch to turn on atmospheric energy transport diagnostics lco2, & ! switch for CO2 submodel (JSBACH related) lham, & ! switch HAM aerosol module on/off lsalsa, & ! switch SALSA module on/off lmoz, & ! switch MOZART on/off lhammoz, & ! switch HAM and MOZ on/off together with the coupling between the two ! note: lhammoz overrides lham and lmoz lhammonia, & ! switch HAMMONIA on/off llght, & ! switch lightning emissions on/off laircraft, & ! switch aircraft emissions on/off lmegan, & ! switch biogenic emissions model (MEGAN) on/off losat, & ! satellite simulator on/off loisccp, & ! isccp diagnostics on/off lhmzphoto, & ! hammoz photolysis frequency coupling on/off lhmzoxi, & ! hammoz coupling of oxidant fields on/off lhmzhet, & ! hammoz heterogeneous chemistry coupling on/off linterchem, & ! chemistry interacts with radiation on/off lchemheat, & ! chemical heating on/off linteram, & ! hammonia air mass from chemistry on/off lintercp, & ! hammonia specific heat from chemistry on/off lemissions, & ! switch emissions on/off lchemistry, & ! switch chemistry calculations on/off ldrydep, & ! switch dry deposition on/off lwetdep, & ! switch wet deposition on/off lsedimentation, & ! switch sedimantation on/off lmicrophysics, & ! switch microphysical processes on/off lburden, & ! activate burden (column integral) diagnostics for mass mixing ratio tracers ltransport 加入new submodel的switch
(1.2) ltransport宣告(/echam-6.0.09/src/mo_submodel.f90) MODULE mo_submodel USE mo_tracdef, ONLY: ln ! length of caracter string (module name) IMPLICIT NONE PRIVATE ! central switches for submodels PUBLIC :: lmethox ! switch for upper atmospheric H2O production from methane PUBLIC :: lco2 ! switch on/off CO2 transport submodel PUBLIC :: ltransdiag ! switch for turning on atmospheric energy transport diagnostic PUBLIC :: lhammoz ! submodel switches PUBLIC :: lham ! PUBLIC :: lmoz ! PUBLIC :: llght ! PUBLIC :: laircraft ! PUBLIC :: lmegan ! PUBLIC :: lxt ! PUBLIC :: lhammonia ! PUBLIC :: losat ! satellite simulator switches PUBLIC :: loisccp ! ISCCP simulator switches PUBLIC :: lsalsa ! salsa aerosol model switches PUBLIC :: ltransport 加入ltransport的宣告
(1.3) ID-number=>id_transport宣告(/echam-6.0.09/src/mo_submodel.f90) (MODULE mo_submodel) PUBLIC :: id_xt PUBLIC :: id_ham PUBLIC :: id_megan PUBLIC :: id_salsa PUBLIC :: id_transport PUBLIC :: id_moz PUBLIC :: id_aircraft PUBLIC :: id_lightning PUBLIC :: id_hammonia PUBLIC :: id_isccp PUBLIC :: id_sat Id_transport 宣告
(1.4) ltransport初始值設定(/echam-6.0.09/src/mo_submodel.f90) (MODULE mo_submodel) ! submodel switches (default: all submodels turned off) LOGICAL :: lxt = .FALSE. ! .true. to activate simple generic tracer submodel LOGICAL :: lmethox = .FALSE. ! .true. for upper atmospheric H2O production from methane LOGICAL :: lco2 = .FALSE. ! .true. for interactive transport CO2 subm. LOGICAL :: ltransdiag = .FALSE. ! .true. for atmospheric energy transport diagnostic LOGICAL :: lhammoz = .FALSE. ! .true. to turn on HAM and MOZ and activate coupling LOGICAL :: lham = .FALSE. ! .true. for aerosol module HAM LOGICAL :: lmoz = .FALSE. ! .true. for gas-phase chemistry module MOZ LOGICAL :: llght = .FALSE. ! .true. for enabling lightning emissions LOGICAL :: laircraft = .FALSE. ! .true. for enabling aircraft emissions LOGICAL :: lmegan = .FALSE. ! .true. for enabling Biogenic emissions (MEGAN) module LOGICAL :: lsalsa = .FALSE. ! .true. for aerosol module salsa LOGICAL :: ltransport = .FALSE. ! .true. to enable transport submodule ! Diagnostics submodel switches ! Satellite and ISCCP cloud diagnostic processors LOGICAL :: losat = .FALSE. ! .true. for satellite simulator LOGICAL :: loisccp = .FALSE. ! .true. for ISCCP diagnostics processor … END Ltransport 初始值設定
(1.5) 廣播ltransport(/echam-6.0.09/src/mo_submodel.f90) (MODULE mo_submodel) SUBROUTINE setsubmodel … IF (p_parallel) THEN ! submodel switches CALL p_bcast (lmethox, p_io) CALL p_bcast (lco2, p_io) CALL p_bcast (ltransdiag, p_io) CALL p_bcast (lxt, p_io) CALL p_bcast (lham, p_io) CALL p_bcast (lmoz, p_io) CALL p_bcast (lhammoz, p_io) CALL p_bcast (lhammonia, p_io) CALL p_bcast (llght, p_io) CALL p_bcast (laircraft, p_io) CALL p_bcast (lmegan, p_io) CALL p_bcast (losat, p_io) CALL p_bcast (loisccp, p_io) CALL p_bcast (lsalsa, p_io) CALL p_bcast (ltransport, p_io) … END IF 將ltransport的設定廣播出去
(1.6) register new submodel(/echam-6.0.09/src/mo_submodel.f90) (MODULE mo_submodel) SUBROUTINE setsubmodel … ! Register submodels IF (lmethox) CALL new_submodel('METHOX', id_methox ) IF (lco2) CALL new_submodel('CO2', id_co2 ) IF (ltransdiag) CALL new_submodel('TRANSDIAG', id_transdiag) IF (lxt) CALL new_submodel('XT', id_xt ) IF (lham) CALL new_submodel('HAM', id_ham ) IF (lmoz) CALL new_submodel('MOZ', id_moz ) IF (lhammonia) CALL new_submodel('HAMMONIA', id_hammonia ) IF (llght) CALL new_submodel('LIGHTNING', id_lightning) IF (laircraft) CALL new_submodel('AIRCRAFT', id_aircraft ) IF (lmegan) CALL new_submodel('MEGAN', id_megan ) IF (losat) CALL new_submodel('SAT', id_sat ) IF (loisccp) CALL new_submodel('ISCCP', id_isccp ) IF (lsalsa) CALL new_submodel('SALSA', id_salsa ) IF (ltransport) CALL new_submodel('TRANSPORT', id_transport) 註冊新的submodel “TRANSPORT”
(1.7) register new submodel(/echam-6.0.09/src/mo_submodel.f90) (MODULE mo_submodel) SUBROUTINE setsubmodel ! report submodel status CALL message('', separator) WRITE (message_text,*) nsubm, ' submodels registered.' CALL message('', message_text, level=em_param) CALL message('', 'Submodel switches processed.', level=em_param) CALL print_status('METHOX module', lmethox) CALL print_status('TRANSDIAG module', ltransdiag) CALL print_status('HAM aerosol module', lham) CALL print_status('SALSA aerosol module', lsalsa) CALL print_status('TRASPORT module', ltransport) CALL print_status('MOZ chemistry module', lmoz) … … END SUBROUTINE setsubmodel 在make 過後Output ltransport的狀態
(2) Namelist “transportctl.inc”(/echam-6.0.09/include/transportctl.inc) • ! transportctl.inc • ! • !------------------------------------------------------------------------- • NAMELIST /transportctl/ & • dt_start_emission, &! start date of emission • emission_flux, &! mass flux of emission in kg/s • emission_plev, &! pressure height of emissions (hPa) • emission_lon, &! longitude of emission • emission_lat ! latitude of emission • !-------------------------------------------------------------------------
(3.1) “mo_transport.f90”(/echam-6.0.09/src/mo_transport.f90) MODULE mo_transport … PUBLIC :: init_transport CONTAINS SUBROUTINE init_transport include 'transportctl.inc' … IF (p_parallel_io) THEN inml = open_nml ('namelist.echam') iunit = position_nml ('TRANSPORTCTL', inml, status=ierr) SELECT CASE (ierr) CASE (POSITIONED) READ(iunit, transportctl) CASE (MISSING) CALL finish ('init_transport','namelisttransport.ctl not found in namelist.echam') CASE (LENGTH_ERROR) CALL finish ('init_transport','namelisttransport.ctl has wrong length') CASE (READ_ERROR) CALL finish ('init_transport','cannot read namelisttransport.ctl') END SELECT END IF
(3.2) “mo_transport.f90”(/echam-6.0.09/src/mo_transport.f90) (MODULE mo_transport) (SUBROUTINE init_transport) … ! send dt_start_emission, emission_flux, emission_plev to all processors IF (p_parallel) THEN CALL p_bcast(dt_start_emission, p_io) CALL p_bcast(emission_flux, p_io) CALL p_bcast(emission_plev, p_io) END IF END SUBROUTINE init_transport END MODULE mo_transport
(4)call “init_transport”(/echam-6.0.09/src/mo_submodel_interface.f90) SUBROUTINE init_subm USE mo_exception, ONLY: message, em_warn, em_info USE mo_species, ONLY: init_splist, printspec USE mo_submodel, ONLY: starttracdef, & endtracdef, & lmethox, & ltransdiag, & lmegan, & lxt, & lham, & lmoz, & lhammoz, & lhmzoxi, & ltransport, & id_ham, & id_moz USE mo_transport, ONLY: init_transport … IF (ltransport) CALL init_transport … END SUBROUTINE init_subm
(5) In Namelist(echam6_T31L39.sh) cat > namelist.echam << EOF &parctl nproca = ${NPROCA} nprocb = ${NPROCB} / &runctl out_datapath = "${EXPDIR}/" out_expname = "${EXP}" out_filetype = 2 ! 1 - GRIB1, 2 - netCDF rerun_filetype = 2 lresume = $RERUN lamip = .true. dt_start = 1991,01,01,0,0,0 dt_stop = 1993,01,01,0,0,0 putdata = 6, 'hours', 'first', 0 putrerun = 1,'months','last',0 nsub = 0 no_cycles = 5 trigfiles = 1,'months','first',0 nproma = ${NPROMA} … / &submodelctl lco2 = .true. ltransport = .true. / &transportctl dt_start_emission=1991,01,01,00,00,00 emission_flux=1. emission_plev=500. emission_lon=10. emission_lat=53.5 / EOF ! transportctl.inc ! !------------------------------------------------------------------------- NAMELIST /transportctl/ & dt_start_emission, &! start date of emission emission_flux, &! mass flux of emission in kg/s emission_plev, &! pressure height of emissions (hPa) emission_lon, &! longitude of emission emission_lat ! latitude of emission !-------------------------------------------------------------------------
Makefile (/echam-6.0.09/src/Makefile.f90): • util/createMakefile.pl => 加入新的mo_....f90到Makefile • 將新增的檔案加入Makefile: PROG = ../bin/echam6 SRCS = …mo_transport.f90 mo_tropopause.f90 \ mo_truncation.f90 …… mo_submodel_interface.o: …mo_exception.o \ mo_transport.o … mo_transport.o: …mo_tracer.o \ mo_transport.omo_transpose.o…\ $(INCLUDE)/transportctl.inc