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 3604 for trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2012-11-19T15:21:34+01:00 (11 years ago)
Author:
rblod
Message:

Adding routines and modules for TAM - Ticket #1005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r3558 r3604  
    66   !! History :  OPA  ! 1990-10  (C. Levy, G. Madec)  Original code 
    77   !!            7.0  ! 1991-11  (M. Imbard, C. Levy, G. Madec) 
    8    !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar,  
    9    !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1  
     8   !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
     9   !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 
    1010   !!             -   ! 1992-06  (L.Terray)  coupling implementation 
    11    !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice  
    12    !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar,  
     11   !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice 
     12   !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    1313   !!                             P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 
    1414   !!            8.1  ! 1997-06  (M. Imbard, G. Madec) 
    15    !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model  
    16    !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP  
     15   !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model 
     16   !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP 
    1717   !!                 ! 2000-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
    1818   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and modules 
     
    2525   !!             -   ! 2007-07  (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 
    2626   !!            3.2  ! 2009-08  (S. Masson)  open/write in the listing file in mpp 
    27    !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface  
     27   !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 
    2828   !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    2929   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
     
    3434   !!   nemo_gcm       : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
    3535   !!   nemo_init      : initialization of the NEMO system 
    36    !!   nemo_ctl       : initialisation of the contol print  
     36   !!   nemo_ctl       : initialisation of the contol print 
    3737   !!   nemo_closefile : close remaining open files 
    3838   !!   nemo_alloc     : dynamical allocation 
     
    5656   USE phycst          ! physical constant                  (par_cst routine) 
    5757   USE trdmod          ! momentum/tracers trends       (trd_mod_init routine) 
    58    USE asmtrj          ! writing out state trajectory 
     58   USE asmbkg          ! writing out state trajectory 
    5959   USE diaptr          ! poleward transports           (dia_ptr_init routine) 
    6060   USE diadct          ! sections transports           (dia_dct_init routine) 
     
    7676   USE mod_ioclient 
    7777#endif 
     78   USE tamtrj          ! Output trajectory, needed for TAM 
    7879 
    7980   IMPLICIT NONE 
     
    8283   PUBLIC   nemo_gcm    ! called by model.F90 
    8384   PUBLIC   nemo_init   ! needed by AGRIF 
     85   PUBLIC   nemo_alloc  ! needed by TAM 
    8486 
    8587   CHARACTER(lc) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
     
    9698      !!                     ***  ROUTINE nemo_gcm  *** 
    9799      !! 
    98       !! ** Purpose :   NEMO solves the primitive equations on an orthogonal  
     100      !! ** Purpose :   NEMO solves the primitive equations on an orthogonal 
    99101      !!              curvilinear mesh on the sphere. 
    100102      !! 
     
    140142          IF( lk_asminc ) THEN 
    141143             IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields 
    142              IF( ln_trjwri ) CALL asm_trj_wri( nit000 - 1 )    ! Output trajectory fields 
    143144             IF( ln_asmdin ) THEN                        ! Direct initialization 
    144145                IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers 
    145                 IF( ln_dyninc ) THEN  
    146                    CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
    147                    IF ( ln_asmdin ) CALL ssh_wzv ( nit000 - 1 )      ! update vertical velocity  
    148                 ENDIF 
     146                IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
    149147                IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH 
    150148             ENDIF 
    151149          ENDIF 
    152          
     150 
    153151         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    154152#if defined key_agrif 
     
    163161 
    164162      IF( lk_diaobs ) CALL dia_obs_wri 
    165         
     163 
    166164      !                            !------------------------! 
    167165      !                            !==  finalize the run  ==! 
     
    171169      IF( nstop /= 0 .AND. lwp ) THEN   ! error print 
    172170         WRITE(numout,cform_err) 
    173          WRITE(numout,*) nstop, ' error have been found'  
     171         WRITE(numout,*) nstop, ' error have been found' 
    174172      ENDIF 
    175173      ! 
     
    240238      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
    241239 
    242       ! If dimensions of processor grid weren't specified in the namelist file  
     240      ! If dimensions of processor grid weren't specified in the namelist file 
    243241      ! then we calculate them here now that we have our communicator size 
    244242      IF( (jpni < 1) .OR. (jpnj < 1) )THEN 
     
    258256         jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    259257#if defined key_nemocice_decomp 
    260          jpj = ( jpjglo+1-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     258         jpj = ( jpjglo+1-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 
    261259#else 
    262260         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
     
    280278         WRITE(numout,*) 
    281279         WRITE(numout,*) 
    282          DO ji = 1, SIZE(cltxt)  
     280         DO ji = 1, SIZE(cltxt) 
    283281            IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
    284282         END DO 
     
    287285      ENDIF 
    288286 
    289       ! Now we know the dimensions of the grid and numout has been set we can  
     287      ! Now we know the dimensions of the grid and numout has been set we can 
    290288      ! allocate arrays 
    291289      CALL nemo_alloc() 
     
    314312      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    315313 
    316       IF( lk_obc        )   CALL     obc_init   ! Open boundaries  
     314      IF( lk_obc        )   CALL     obc_init   ! Open boundaries 
    317315      IF( lk_bdy        )   CALL     bdy_init       ! Open boundaries initialisation 
    318316      IF( lk_bdy        )   CALL     bdy_dta_init   ! Open boundaries initialisation of external data arrays 
     
    326324 
    327325      !                                     ! Ocean physics 
    328                             CALL     sbc_init   ! Forcings : surface module  
     326                            CALL     sbc_init   ! Forcings : surface module 
    329327      !                                         ! Vertical physics 
    330328                            CALL     zdf_init      ! namelist read 
     
    335333      IF( lk_zdfkpp     )   CALL zdf_kpp_init      ! KPP closure scheme 
    336334      IF( lk_zdftmx     )   CALL zdf_tmx_init      ! tidal vertical mixing 
    337       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &  
     335      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    338336         &                  CALL zdf_ddm_init      ! double diffusive mixing 
    339337      !                                         ! Lateral physics 
     
    358356                            CALL dyn_zdf_init   ! vertical diffusion 
    359357                            CALL dyn_spg_init   ! surface pressure gradient 
    360                              
     358 
    361359      !                                     ! Misc. options 
    362360      IF( nn_cla == 1   )   CALL cla_init       ! Cross Land Advection 
    363        
     361 
    364362#if defined key_top 
    365363      !                                     ! Passive tracers 
     
    377375                            CALL dia_obs_init            ! Initialize observational data 
    378376                            CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    379       ENDIF       
     377      ENDIF 
    380378      !                                     ! Assimilation increments 
    381379      IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
    382380      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
     381                            CALL tam_trj_init ! Trajectory handling 
    383382      ! 
    384383   END SUBROUTINE nemo_init 
     
    389388      !!                     ***  ROUTINE nemo_ctl  *** 
    390389      !! 
    391       !! ** Purpose :   control print setting  
     390      !! ** Purpose :   control print setting 
    392391      !! 
    393392      !! ** Method  : - print namctl information and check some consistencies 
     
    436435         !                              ! indices used for the SUM control 
    437436         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    438             lsp_area = .FALSE.                         
     437            lsp_area = .FALSE. 
    439438         ELSE                                             ! print control done over a specific  area 
    440439            lsp_area = .TRUE. 
     
    458457      ENDIF 
    459458      ! 
    460       IF( nbench == 1 ) THEN              ! Benchmark  
     459      IF( nbench == 1 ) THEN              ! Benchmark 
    461460         SELECT CASE ( cp_cfg ) 
    462461         CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
     
    521520      !!---------------------------------------------------------------------- 
    522521      ! 
    523       ierr =        oce_alloc       ()          ! ocean  
     522      ierr =        oce_alloc       ()          ! ocean 
    524523      ierr = ierr + dia_wri_alloc   () 
    525524      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
     
    541540      !!                 ***  ROUTINE nemo_partition  *** 
    542541      !! 
    543       !! ** Purpose :    
     542      !! ** Purpose : 
    544543      !! 
    545544      !! ** Method  : 
     
    589588      !! 
    590589      !! ** Purpose :   return the prime factors of n. 
    591       !!                knfax factors are returned in array kfax which is of  
     590      !!                knfax factors are returned in array kfax which is of 
    592591      !!                maximum dimension kmaxfax. 
    593592      !! ** Method  : 
     
    657656      !!===================================================================== 
    658657      !!---------------------------------------------------------------------- 
    659       !!  
     658      !! 
    660659      !! ** Purpose :   Initialization of the northern neighbours lists. 
    661660      !!---------------------------------------------------------------------- 
    662       !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  
     661      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    663662      !!---------------------------------------------------------------------- 
    664663 
     
    742741      jtyp = 5 
    743742      lrankset = .FALSE. 
    744       znnbrs = narea  
     743      znnbrs = narea 
    745744      CALL lbc_lnk( znnbrs, 'J', 1. ) ! first ice U-V point 
    746745 
     
    755754      ENDIF 
    756755 
    757       znnbrs = narea  
     756      znnbrs = narea 
    758757      CALL lbc_lnk( znnbrs, 'K', 1. ) ! second ice U-V point 
    759758 
     
    778777         END DO 
    779778         ! 
    780          ! For northern row areas, set l_north_nogather so that all subsequent exchanges  
     779         ! For northern row areas, set l_north_nogather so that all subsequent exchanges 
    781780         ! can use peer to peer communications at the north fold 
    782781         ! 
Note: See TracChangeset for help on using the changeset viewer.