!### macro's ##################################################### ! #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if ! #include "tm5.inc" ! !################################################################# module sources_sinks use GO, only : gol, goPr, goErr implicit none private public :: Sources_sinks_Init, Sources_sinks_Done ! Init and Done methods public :: Ss_monthly_update ! monthly initialization (photolysis,..) public :: ss_after_read_meteo_update ! Update SS after met fields are updated. Called from modelIntegration/Proces_update public :: sources_sinks_apply ! apply source : always called ! --- const -------------------------------------- character(len=*), parameter :: mname = 'sources_sinks' contains ! ================================================================ subroutine Sources_Sinks_Init( status ) ! --- in/out -------------------------------- integer, intent(out) :: status ! --- const ------------------------------ character(len=*), parameter :: rname = mname//'/Sources_Sinks_Init' ! --- begin -------------------------------- ! nothing to be init ! ok status = 0 end subroutine Sources_Sinks_Init ! *** subroutine Sources_Sinks_Done( status ) ! --- in/out -------------------------------- integer, intent(out) :: status ! --- const ------------------------------ character(len=*), parameter :: rname = mname//'/Sources_Sinks_Done' ! --- begin -------------------------------- ! nothing to be done ! ok status = 0 end subroutine Sources_Sinks_Done ! ================================================================ ! ! purpose ! ------- ! initialise data needed for chemistry, ! e.g. read emissions and boundary conditions ! provides a way to input tracer specific values. ! ! Called from tm5/TM5_Model_run, at run start and at beginning of each ! month. ! ! !--------------------------------------------------------------------- subroutine ss_monthly_update( status ) use datetime, only : calc_sm use dims, only : mlen, sec_month, sec_year, sec_day use dims, only : okdebug ! --- in/out -------------------------- integer, intent(out) :: status ! --- local -------------------------- character(len=*), parameter :: rname = mname//'/Ss_monthly_update' ! --- begin --------------------------- write (gol,'(a,": update time parameters for new month ...")') rname; call goPr call calc_sm( mlen, sec_day,sec_month,sec_year ) if ( okdebug ) then write (gol,*) 'seconds in a day, month and year',sec_day,sec_month,sec_year; call goPr end if ! ok status = 0 end subroutine ss_monthly_update !--------------------------------------------------------------------- ! ! subroutine that is called after reading new met fields ! (clouds, surface winds, etc.) ! In this routine, sources and sinks processes that depend on these data are updated. ! Routine is called from modelIntegration/Proces_Update ! !--------------------------------------------------------------------- subroutine ss_after_read_meteo_update( status ) ! --- in/out --------------------------------- integer, intent(out) :: status ! --- const --------------------------------- character(len=*), parameter :: rname = 'trace_after_read' ! --- begin --------------------------------- ! nothing to be done ! ok status = 0 end subroutine ss_after_read_meteo_update !--------------------------------------------------------------------- ! ! sources_sinks_apply ! ! ! purpose ! ------- ! this subroutine changes the tracer mass and its slopes ! by chemical sources ! ! interface ! --------- ! call source1 ! ! method ! ------ ! ! ! ! reference ! -------- ! see above ! !--------------------------------------------------------------------- subroutine Sources_sinks_apply( region, tr, status ) use GO , only : TDate ! --- in/out --------------------------------- integer, intent(in) :: region type(TDate), intent(in) :: tr(2) ! time range integer, intent(out) :: status ! --- const --------------------------------------- character(len=*), parameter :: rname = mname//'/Source1' ! --- begin ---------------------------------- ! ok status = 0 end subroutine Sources_sinks_apply end module sources_sinks