New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5989 for branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2015-12-03T09:10:32+01:00 (8 years ago)
Author:
deazer
Message:

Merging TMB and 25h diagnostics to head of trunk
added brief documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r5260 r5989  
    1818   USE c1d             ! 1D configuration 
    1919   USE domcfg          ! domain configuration               (dom_cfg routine) 
    20    USE domain          ! domain initialization             (dom_init routine) 
    21    USE istate          ! initial state setting          (istate_init routine) 
     20   USE domain          ! domain initialization from coordinate & bathymetry (dom_init routine) 
     21   USE domrea          ! domain initialization from mesh_mask            (dom_init routine) 
    2222   USE eosbn2          ! equation of state            (eos bn2 routine) 
    2323   !              ! ocean physics 
     
    2626   USE traqsr          ! solar radiation penetration    (tra_qsr_init routine) 
    2727   USE trabbl          ! bottom boundary layer          (tra_bbl_init routine) 
     28   USE traldf          ! lateral physics                (tra_ldf_init routine) 
    2829   USE zdfini          ! vertical physics: initialization 
    2930   USE sbcmod          ! surface boundary condition       (sbc_init     routine) 
     
    3435   USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
    3536   USE dtadyn          ! Lecture and interpolation of the dynamical fields 
    36    USE stpctl          ! time stepping control            (stp_ctl routine) 
    3737   !              ! I/O & MPP 
    3838   USE iom             ! I/O library 
     
    9595      istp = nit000 
    9696      !  
    97       CALL iom_init( "nemo" )            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
     97      CALL iom_init( cxios_context )            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    9898      !  
    9999      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping 
     
    108108      END DO 
    109109#if defined key_iomput 
    110       CALL iom_context_finalize( "nemo" ) ! needed for XIOS+AGRIF 
     110      CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF 
    111111#endif 
    112112 
     
    143143      INTEGER ::   ilocal_comm   ! local integer 
    144144      INTEGER ::   ios 
     145      LOGICAL ::   llexist 
    145146      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    146147      !! 
     
    152153      !!---------------------------------------------------------------------- 
    153154      cltxt = '' 
     155      cxios_context = 'nemo' 
    154156      ! 
    155157      !                             ! Open reference namelist and configuration namelist files 
     
    181183      !                             !--------------------------------------------! 
    182184#if defined key_iomput 
    183       CALL  xios_initialize( "nemo",return_comm=ilocal_comm ) 
    184       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
     185      CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 
     186      narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    185187#else 
    186188      ilocal_comm = 0 
    187       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
     189      narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
    188190#endif 
    189191 
     
    268270      IF( lk_c1d        )   CALL     c1d_init   ! 1D column configuration 
    269271                            CALL     dom_cfg    ! Domain configuration 
    270                             CALL     dom_init   ! Domain 
     272      ! 
     273      INQUIRE( FILE='coordinates.nc', EXIST = llexist )   ! Check if coordinate file exist 
     274      ! 
     275      IF( llexist )  THEN  ;  CALL  dom_init   !  compute the grid from coordinates and bathymetry 
     276      ELSE                 ;  CALL  dom_rea    !  read grid from the meskmask 
     277      ENDIF 
    271278                            CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
    272279 
     
    275282      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    276283 
    277       !                                     ! Ocean physics 
    278284                            CALL     sbc_init   ! Forcings : surface module 
    279 #if ! defined key_degrad 
     285 
    280286                            CALL ldf_tra_init   ! Lateral ocean tracer physics 
    281 #endif 
    282       IF( lk_ldfslp )       CALL ldf_slp_init   ! slope of lateral mixing 
    283  
    284       !                                     ! Active tracers 
     287                            CALL ldf_eiv_init   ! Eddy induced velocity param 
     288                            CALL tra_ldf_init   ! lateral mixing 
     289      IF( l_ldfslp )        CALL ldf_slp_init   ! slope of lateral mixing 
     290 
    285291                            CALL tra_qsr_init   ! penetrative solar radiation qsr 
    286292      IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme 
    287293 
    288                             CALL trc_nam_run  ! Needed to get restart parameters for passive tracers 
    289       IF( ln_rsttr ) THEN 
    290         neuler = 1   ! Set time-step indicator at nit000 (leap-frog) 
    291         CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
    292       ELSE 
    293         neuler = 0                  ! Set time-step indicator at nit000 (euler) 
    294         CALL day_init               ! set calendar 
    295       ENDIF 
    296       !                                     ! Dynamics 
     294                            CALL trc_nam_run    ! Needed to get restart parameters for passive tracers 
     295                            CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
    297296                            CALL dta_dyn_init   ! Initialization for the dynamics 
    298297 
    299       !                                     ! Passive tracers 
    300298                            CALL     trc_init   ! Passive tracers initialization 
    301       ! 
    302       ! Initialise diaptr as some variables are used in if statements later (in 
    303       ! various advection and diffusion routines. 
    304                             CALL dia_ptr_init 
    305       ! 
    306       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
     299                            CALL dia_ptr_init   ! Initialise diaptr as some variables are used  
     300      !                                         ! in various advection and diffusion routines 
     301      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
    307302      ! 
    308303      IF( nn_timing == 1 )  CALL timing_stop( 'nemo_init') 
     
    450445      USE dom_oce,      ONLY: dom_oce_alloc 
    451446      USE zdf_oce,      ONLY: zdf_oce_alloc 
    452       USE ldftra_oce,   ONLY: ldftra_oce_alloc 
    453447      USE trc_oce,      ONLY: trc_oce_alloc 
    454448      ! 
     
    459453      ierr = ierr + dia_wri_alloc   () 
    460454      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    461       ierr = ierr + ldftra_oce_alloc()          ! ocean lateral  physics : tracers 
    462455      ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics 
    463456      ! 
     
    659652   END SUBROUTINE nemo_northcomms 
    660653#endif 
     654 
     655   SUBROUTINE istate_init 
     656      !!---------------------------------------------------------------------- 
     657      !!                   ***  ROUTINE istate_init  *** 
     658      !! 
     659      !! ** Purpose :   Initialization to zero of the dynamics and tracers. 
     660      !!---------------------------------------------------------------------- 
     661      ! 
     662      !     now fields         !     after fields      ! 
     663      un   (:,:,:)   = 0._wp   ;   ua(:,:,:) = 0._wp   ! 
     664      vn   (:,:,:)   = 0._wp   ;   va(:,:,:) = 0._wp   ! 
     665      wn   (:,:,:)   = 0._wp   !                       ! 
     666      hdivn(:,:,:)   = 0._wp   !                       ! 
     667      tsn  (:,:,:,:) = 0._wp   !                       ! 
     668      ! 
     669      rhd  (:,:,:) = 0.e0 
     670      rhop (:,:,:) = 0.e0 
     671      rn2  (:,:,:) = 0.e0 
     672      ! 
     673   END SUBROUTINE istate_init 
     674 
     675   SUBROUTINE stp_ctl( kt, kindic ) 
     676      !!---------------------------------------------------------------------- 
     677      !!                    ***  ROUTINE stp_ctl  *** 
     678      !! 
     679      !! ** Purpose :   Control the run 
     680      !! 
     681      !! ** Method  : - Save the time step in numstp 
     682      !! 
     683      !! ** Actions :   'time.step' file containing the last ocean time-step 
     684      !!---------------------------------------------------------------------- 
     685      INTEGER, INTENT(in   ) ::   kt      ! ocean time-step index 
     686      INTEGER, INTENT(inout) ::   kindic  ! indicator of solver convergence 
     687      !!---------------------------------------------------------------------- 
     688      ! 
     689      IF( kt == nit000 .AND. lwp ) THEN 
     690         WRITE(numout,*) 
     691         WRITE(numout,*) 'stp_ctl : time-stepping control' 
     692         WRITE(numout,*) '~~~~~~~' 
     693         ! open time.step file 
     694         CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     695      ENDIF 
     696      ! 
     697      IF(lwp) WRITE ( numstp, '(1x, i8)' )   kt      !* save the current time step in numstp 
     698      IF(lwp) REWIND( numstp )                       ! -------------------------- 
     699      ! 
     700   END SUBROUTINE stp_ctl 
    661701   !!====================================================================== 
    662702END MODULE nemogcm 
Note: See TracChangeset for help on using the changeset viewer.