MODULE trcsms_my_trc !!====================================================================== !! *** MODULE trcsms_my_trc *** !! TOP : Main module of the MY_TRC tracers !!====================================================================== !! History : ! 2007 (C. Ethe, G. Madec) Original code !! ! 2016 (C. Ethe, T. Lovato) Revised architecture !!---------------------------------------------------------------------- !! trc_sms_my_trc : MY_TRC model main routine !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms !!---------------------------------------------------------------------- USE par_trc ! TOP parameters USE oce_trc ! Ocean variables USE trc ! TOP variables USE trd_oce USE trdtrc USE trcbc, only : trc_bc IMPLICIT NONE PRIVATE PUBLIC trc_sms_my_trc ! called by trcsms.F90 module PUBLIC trc_sms_my_trc_alloc ! called by trcini_my_trc.F90 module ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc !!---------------------------------------------------------------------- !! NEMO/TOP 4.0 , NEMO Consortium (2018) !! $Id$ !! Software governed by the CeCILL license (see ./LICENSE) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE trc_sms_my_trc( kt ) !!---------------------------------------------------------------------- !! *** trc_sms_my_trc *** !! !! ** Purpose : main routine of MY_TRC model !! !! ** Method : - !!---------------------------------------------------------------------- ! INTEGER, INTENT(in) :: kt ! ocean time-step index INTEGER :: jn ! dummy loop index REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrmyt !!---------------------------------------------------------------------- ! IF( ln_timing ) CALL timing_start('trc_sms_my_trc') ! IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) ' trc_sms_my_trc: MY_TRC model' IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' IF( l_trdtrc ) ALLOCATE( ztrmyt(jpi,jpj,jpk) ) CALL trc_bc ( kt ) ! tracers: surface and lateral Boundary Conditions ! add here the call to BGC model ! Save the trends in the mixed layer IF( l_trdtrc ) THEN DO jn = jp_myt0, jp_myt1 ztrmyt(:,:,:) = tra(:,:,:,jn) CALL trd_trc( ztrmyt, jn, jptra_sms, kt ) ! save trends END DO DEALLOCATE( ztrmyt ) END IF ! IF( ln_timing ) CALL timing_stop('trc_sms_my_trc') ! END SUBROUTINE trc_sms_my_trc INTEGER FUNCTION trc_sms_my_trc_alloc() !!---------------------------------------------------------------------- !! *** ROUTINE trc_sms_my_trc_alloc *** !!---------------------------------------------------------------------- ! ! ALLOCATE here the arrays specific to MY_TRC ! ALLOCATE( tab(...) , STAT=trc_sms_my_trc_alloc ) trc_sms_my_trc_alloc = 0 ! set to zero if no array to be allocated ! IF( trc_sms_my_trc_alloc /= 0 ) CALL ctl_warn('trc_sms_my_trc_alloc : failed to allocate arrays') ! END FUNCTION trc_sms_my_trc_alloc !!====================================================================== END MODULE trcsms_my_trc