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 9019 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90 – NEMO

Ignore:
Timestamp:
2017-12-13T15:58:53+01:00 (6 years ago)
Author:
timgraham
Message:

Merge of dev_CNRS_2017 into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90

    r7646 r9019  
    1313   USE oce            ! ocean dynamics and tracers variables 
    1414   USE dom_oce        ! ocean space and time domain variables 
     15   USE phycst         ! physical constants 
    1516   USE sbc_oce        ! surface boundary condition: ocean 
    1617   USE zdf_oce        ! ocean vertical physics variables 
     18   USE zdfdrg         ! ocean vertical physics: bottom friction 
     19   USE ldftra         ! ocean active tracers lateral physics 
    1720   USE trd_oce        ! trends: ocean variables 
    18 !!gm   USE dynhpg          ! hydrostatic pressure gradient    
    19    USE zdfbfr         ! bottom friction 
    20    USE ldftra         ! ocean active tracers lateral physics 
    21    USE phycst         ! physical constants 
    2221   USE trdvor         ! ocean vorticity trends  
    2322   USE trdglo         ! trends:global domain averaged 
     
    2726   USE iom            ! I/O manager library 
    2827   USE lib_mpp        ! MPP library 
    29    USE wrk_nemo       ! Memory allocation 
    3028   USE ldfslp         ! Isopycnal slopes 
    3129 
     
    7472      !!          diagnose separately the KE trend associated with wind stress 
    7573      !!              - bottom friction case (jpdyn_bfr): 
    76       !!          explicit case (ln_bfrimp=F): bottom trend put in the 1st level  
     74      !!          explicit case (ln_drgimp=F): bottom trend put in the 1st level  
    7775      !!                                       of putrd, pvtrd 
    7876      ! 
     
    8684      INTEGER ::   ikbu  , ikbv     ! local integers 
    8785      INTEGER ::   ikbum1, ikbvm1   !   -       - 
    88       REAL(wp), POINTER, DIMENSION(:,:)   ::   z2dx, z2dy, zke2d   ! 2D workspace  
    89       REAL(wp), POINTER, DIMENSION(:,:,:) ::   zke                 ! 3D workspace  
    90       !!---------------------------------------------------------------------- 
    91       ! 
    92       CALL wrk_alloc( jpi, jpj, jpk, zke ) 
     86      REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   z2dx, z2dy, zke2d   ! 2D workspace  
     87      REAL(wp), DIMENSION(jpi,jpj,jpk)      ::   zke                 ! 3D workspace  
     88      !!---------------------------------------------------------------------- 
    9389      ! 
    9490      CALL lbc_lnk( putrd, 'U', -1. )   ;   CALL lbc_lnk( pvtrd, 'V', -1. )      ! lateral boundary conditions 
     
    125121         CASE( jpdyn_zdf )   ;   CALL iom_put( "ketrd_zdf"   , zke )    ! vertical diffusion  
    126122         !                   !                                          ! wind stress trends 
    127                                  CALL wrk_alloc( jpi, jpj, z2dx, z2dy, zke2d ) 
     123                                 ALLOCATE( z2dx(jpi,jpj) , z2dy(jpi,jpj) , zke2d(jpi,jpj) ) 
    128124                           z2dx(:,:) = un(:,:,1) * ( utau_b(:,:) + utau(:,:) ) * e1e2u(:,:) * umask(:,:,1) 
    129125                           z2dy(:,:) = vn(:,:,1) * ( vtau_b(:,:) + vtau(:,:) ) * e1e2v(:,:) * vmask(:,:,1) 
     
    136132                           END DO 
    137133                                 CALL iom_put( "ketrd_tau"   , zke2d )  !  
    138                                  CALL wrk_dealloc( jpi, jpj     , z2dx, z2dy, zke2d ) 
     134                                 DEALLOCATE( z2dx , z2dy , zke2d ) 
    139135         CASE( jpdyn_bfr )   ;   CALL iom_put( "ketrd_bfr"   , zke )    ! bottom friction (explicit case)  
    140136!!gm TO BE DONE properly 
    141 !!gm only valid if ln_bfrimp=F otherwise the bottom stress as to be recomputed at the end of the computation.... 
    142 !         IF(.NOT. ln_bfrimp) THEN 
     137!!gm only valid if ln_drgimp=F otherwise the bottom stress as to be recomputed at the end of the computation.... 
     138!         IF(.NOT. ln_drgimp) THEN 
    143139!            DO jj = 1, jpj    !    
    144140!               DO ji = 1, jpi 
     
    163159!! reflechir a une possible sauvegarde du "vrai" un,vn pour le calcul de atf.... 
    164160! 
    165 !         IF( ln_bfrimp ) THEN                                          ! bottom friction (implicit case) 
     161!         IF( ln_drgimp ) THEN                                          ! bottom friction (implicit case) 
    166162!            DO jj = 1, jpj                                                  ! after velocity known (now filed at this stage) 
    167163!               DO ji = 1, jpi 
     
    192188      END SELECT 
    193189      ! 
    194       CALL wrk_dealloc( jpi, jpj, jpk, zke ) 
    195       ! 
    196190   END SUBROUTINE trd_ken 
    197191 
     
    207201      !! ** Work only for full steps and partial steps (ln_hpg_zco or ln_hpg_zps) 
    208202      !!----------------------------------------------------------------------  
    209       INTEGER, INTENT(in) ::   kt    ! ocean time-step index 
    210       !! 
    211       REAL(wp), DIMENSION(jpi,jpj,jpk     ), INTENT(  out) ::   pconv 
    212       ! 
    213       INTEGER  ::   ji, jj, jk                       ! dummy loop indices 
    214       INTEGER  ::   iku, ikv                         ! temporary integers 
    215       REAL(wp) ::   zcoef                            ! temporary scalars 
    216       REAL(wp), POINTER, DIMENSION(:,:,:) ::  zconv  ! temporary conv on W-grid 
    217       !!---------------------------------------------------------------------- 
    218       ! 
    219       CALL wrk_alloc( jpi,jpj,jpk, zconv ) 
     203      INTEGER                   , INTENT(in   ) ::   kt      ! ocean time-step index 
     204      REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   pconv   !  
     205      ! 
     206      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     207      INTEGER  ::   iku, ikv     ! local integers 
     208      REAL(wp) ::   zcoef        ! local scalars 
     209      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zconv  ! 3D workspace 
     210      !!---------------------------------------------------------------------- 
    220211      ! 
    221212      ! Local constant initialization  
     
    240231      END DO 
    241232      ! 
    242       CALL wrk_dealloc( jpi,jpj,jpk, zconv )       
    243       ! 
    244233   END SUBROUTINE ken_p2k 
    245234 
Note: See TracChangeset for help on using the changeset viewer.