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 6060 for branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90 – NEMO

Ignore:
Timestamp:
2015-12-16T10:25:22+01:00 (8 years ago)
Author:
timgraham
Message:

Merged dev_r5836_noc2_VVL_BY_DEFAULT into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90

    r5386 r6060  
    1313 
    1414   !!---------------------------------------------------------------------- 
    15    !!   tra_npc : apply the non penetrative convection scheme 
    16    !!---------------------------------------------------------------------- 
    17    USE oce             ! ocean dynamics and active tracers 
    18    USE dom_oce         ! ocean space and time domain 
    19    USE phycst          ! physical constants 
    20    USE zdf_oce         ! ocean vertical physics 
    21    USE trd_oce         ! ocean active tracer trends 
    22    USE trdtra          ! ocean active tracer trends 
    23    USE eosbn2          ! equation of state (eos routine) 
     15   !!   tra_npc       : apply the non penetrative convection scheme 
     16   !!---------------------------------------------------------------------- 
     17   USE oce            ! ocean dynamics and active tracers 
     18   USE dom_oce        ! ocean space and time domain 
     19   USE phycst         ! physical constants 
     20   USE zdf_oce        ! ocean vertical physics 
     21   USE trd_oce        ! ocean active tracer trends 
     22   USE trdtra         ! ocean active tracer trends 
     23   USE eosbn2         ! equation of state (eos routine) 
    2424   ! 
    25    USE lbclnk          ! lateral boundary conditions (or mpp link) 
    26    USE in_out_manager  ! I/O manager 
    27    USE lib_mpp         ! MPP library 
    28    USE wrk_nemo        ! Memory Allocation 
    29    USE timing          ! Timing 
     25   USE lbclnk         ! lateral boundary conditions (or mpp link) 
     26   USE in_out_manager ! I/O manager 
     27   USE lib_mpp        ! MPP library 
     28   USE wrk_nemo       ! Memory Allocation 
     29   USE timing         ! Timing 
    3030 
    3131   IMPLICIT NONE 
     
    3535 
    3636   !! * Substitutions 
    37 #  include "domzgr_substitute.h90" 
    3837#  include "vectopt_loop_substitute.h90" 
    3938   !!---------------------------------------------------------------------- 
     
    5554      !!              (i.e. static stability computed locally) 
    5655      !! 
    57       !! ** Action  : - (ta,sa) after the application od the npc scheme 
     56      !! ** Action  : - tsa: after tracers with the application of the npc scheme 
    5857      !!              - send the associated trends for on-line diagnostics (l_trdtra=T) 
    5958      !! 
     
    115114                  zvts(:,jp_tem) = tsa(ji,jj,:,jp_tem)      ! temperature 
    116115                  zvts(:,jp_sal) = tsa(ji,jj,:,jp_sal)      ! salinity 
    117  
     116                  ! 
    118117                  zvab(:,jp_tem)  = zab(ji,jj,:,jp_tem)     ! Alpha  
    119118                  zvab(:,jp_sal)  = zab(ji,jj,:,jp_sal)     ! Beta   
    120119                  zvn2(:)         = zn2(ji,jj,:)            ! N^2  
    121                   
     120                  ! 
    122121                  IF( l_LB_debug ) THEN                  !LB debug: 
    123122                     lp_monitor_point = .FALSE. 
     
    126125                     lp_monitor_point = (narea == nncpu).AND.lp_monitor_point                       
    127126                  ENDIF                                  !LB debug  end 
    128  
     127                  ! 
    129128                  ikbot = mbkt(ji,jj)   ! ikbot: ocean bottom T-level 
    130129                  ikp = 1                  ! because N2 is irrelevant at the surface level (will start at ikp=2) 
     
    132131                  jiter  = 0 
    133132                  l_column_treated = .FALSE. 
    134                   
     133                  ! 
    135134                  DO WHILE ( .NOT. l_column_treated ) 
    136135                     ! 
    137136                     jiter = jiter + 1 
    138                      
     137                     !  
    139138                     IF( jiter >= 400 ) EXIT 
    140                      
     139                     ! 
    141140                     l_bottom_reached = .FALSE. 
    142  
     141                     ! 
    143142                     DO WHILE ( .NOT. l_bottom_reached ) 
    144  
     143                        ! 
    145144                        ikp = ikp + 1 
    146                         
     145                        ! 
    147146                        !! Testing level ikp for instability 
    148147                        !! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    149148                        IF( zvn2(ikp) <  -zn2_zero ) THEN ! Instability found! 
    150  
     149                           ! 
    151150                           ilayer = ilayer + 1    ! yet another instable portion of the water column found.... 
    152  
     151                           ! 
    153152                           IF( lp_monitor_point ) THEN  
    154153                              WRITE(numout,*) 
     
    165164                              WRITE(numout,*) 
    166165                           ENDIF 
    167                             
    168  
     166                           ! 
    169167                           IF( jiter == 1 )   inpcc = inpcc + 1  
    170  
     168                           ! 
    171169                           IF( lp_monitor_point )   WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer 
    172  
     170                           ! 
    173171                           !! ikup is the uppermost point where mixing will start: 
    174172                           ikup = ikp - 1 ! ikup is always "at most at ikp-1", less if neutral levels overlying 
    175                             
     173                           ! 
    176174                           !! If the points above ikp-1 have N2 == 0 they must also be mixed: 
    177175                           IF( ikp > 2 ) THEN 
     
    184182                              END DO 
    185183                           ENDIF 
    186                             
     184                           ! 
    187185                           IF( ikup < 1 )   CALL ctl_stop( 'tra_npc :  PROBLEM #1') 
    188  
     186                           ! 
    189187                           zsum_temp = 0._wp 
    190188                           zsum_sali = 0._wp 
     
    195193                           DO jk = ikup, ikbot      ! Inside the instable (and overlying neutral) portion of the column 
    196194                              ! 
    197                               zdz       = fse3t(ji,jj,jk) 
     195                              zdz       = e3t_n(ji,jj,jk) 
    198196                              zsum_temp = zsum_temp + zvts(jk,jp_tem)*zdz 
    199197                              zsum_sali = zsum_sali + zvts(jk,jp_sal)*zdz 
     
    244242 
    245243                              !! Interpolating alfa and beta at W point: 
    246                               zrw =  (fsdepw(ji,jj,jk  ) - fsdept(ji,jj,jk)) & 
    247                                  & / (fsdept(ji,jj,jk-1) - fsdept(ji,jj,jk)) 
     244                              zrw =  (gdepw_n(ji,jj,jk  ) - gdept_n(ji,jj,jk)) & 
     245                                 & / (gdept_n(ji,jj,jk-1) - gdept_n(ji,jj,jk)) 
    248246                              zaw = zvab(jk,jp_tem) * (1._wp - zrw) + zvab(jk-1,jp_tem) * zrw 
    249247                              zbw = zvab(jk,jp_sal) * (1._wp - zrw) + zvab(jk-1,jp_sal) * zrw 
     
    252250                              zvn2(jk) = grav*( zaw * ( zvts(jk-1,jp_tem) - zvts(jk,jp_tem) )     & 
    253251                                 &            - zbw * ( zvts(jk-1,jp_sal) - zvts(jk,jp_sal) )  )  & 
    254                                  &       / fse3w(ji,jj,jk) * tmask(ji,jj,jk) 
     252                                 &       / e3w_n(ji,jj,jk) * tmask(ji,jj,jk) 
    255253 
    256254                              !! OR, faster  => just considering the vertical gradient of density 
Note: See TracChangeset for help on using the changeset viewer.