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 7954 for branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC – NEMO

Ignore:
Timestamp:
2017-04-24T09:19:00+02:00 (7 years ago)
Author:
gm
Message:

#1880 (HPC-09): OPA & TOP replace key_trabbl by ln_trabbl + in CONFIG, remove reference to key_zdfXXX and key_trabbl

Location:
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90

    r7753 r7954  
    55   !!                                  layer scheme 
    66   !!====================================================================== 
    7    !!============================================================================== 
    87   !! History :  OPA  !  1996-06  (L. Mortier)  Original code 
    98   !!            8.0  !  1997-11  (G. Madec)    Optimization 
     
    1312   !!             -   !  2010-04  (G. Madec)  Campin & Goosse advective bbl  
    1413   !!             -   !  2010-06  (C. Ethe, G. Madec)  merge TRA-TRC 
     14   !!            4.0  !  2017-04  (G. Madec)  ln_trabbl namelist variable instead of a CPP key 
    1515   !!---------------------------------------------------------------------- 
    16 #if  defined key_top &&  defined key_trabbl  
     16#if  defined key_top 
    1717   !!---------------------------------------------------------------------- 
    18    !!   'key_trabbl                      diffusive or/and adevective bottom boundary layer 
     18   !!   'key_top'                                                TOP models 
    1919   !!---------------------------------------------------------------------- 
    20    !!    trc_bbl       : update the tracer trends due to the bottom boundary layer (advective and/or diffusive) 
     20   !!    trc_bbl      : update the tracer trends due to the bottom boundary layer (advective and/or diffusive) 
    2121   !!---------------------------------------------------------------------- 
    22    USE oce_trc             ! ocean dynamics and active tracers variables 
    23    USE trc                 ! ocean passive tracers variables 
    24    USE trabbl              !  
    25    USE prtctl_trc          ! Print control for debbuging 
    26    USE trd_oce 
    27    USE trdtra 
     22   USE oce_trc        ! ocean dynamics and active tracers variables 
     23   USE trc            ! ocean passive tracers variables 
     24   USE trd_oce        ! trends: ocean variables 
     25   USE trdtra         ! tracer trends 
     26   USE trabbl         ! bottom boundary layer  
     27   USE prtctl_trc     ! Print control for debbuging 
    2828 
    29    PUBLIC   trc_bbl       !  routine called by step.F90 
     29   PUBLIC   trc_bbl   !  routine called by trctrp.F90 
    3030 
    3131   !!---------------------------------------------------------------------- 
    32    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     32   !! NEMO/TOP 4.0 , NEMO Consortium (2017) 
    3333   !! $Id$  
    3434   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    3535   !!---------------------------------------------------------------------- 
    36  
    3736CONTAINS 
    38  
    3937 
    4038   SUBROUTINE trc_bbl( kt ) 
     
    9896   END SUBROUTINE trc_bbl 
    9997 
    100 #else 
    101    !!---------------------------------------------------------------------- 
    102    !!   Dummy module :                      No bottom boundary layer scheme 
    103    !!---------------------------------------------------------------------- 
    104 CONTAINS 
    105    SUBROUTINE trc_bbl( kt )              ! Empty routine 
    106       WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt 
    107    END SUBROUTINE trc_bbl 
    10898#endif 
    10999 
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90

    r7646 r7954  
    1515   USE oce_trc         ! ocean dynamics and active tracers variables 
    1616   USE trc             ! ocean passive tracers variables  
    17    USE trabbl          ! bottom boundary layer               (trc_bbl routine) 
    1817   USE trcbbl          ! bottom boundary layer               (trc_bbl routine) 
    1918   USE trcdmp          ! internal damping                    (trc_dmp routine) 
     
    6362         ! 
    6463                                CALL trc_sbc    ( kt )      ! surface boundary condition 
    65          IF( lk_trabbl )        CALL trc_bbl    ( kt )      ! advective (and/or diffusive) bottom boundary layer scheme 
     64         IF( ln_trabbl )        CALL trc_bbl    ( kt )      ! advective (and/or diffusive) bottom boundary layer scheme 
    6665         IF( ln_trcdmp )        CALL trc_dmp    ( kt )      ! internal damping trends 
    6766         IF( ln_bdy )           CALL trc_bdy_dmp( kt )      ! BDY damping trends 
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90

    r7953 r7954  
    1717   PUBLIC   trc_alloc   ! called by nemogcm.F90 
    1818 
    19    !! parameters for the control of passive tracers 
    20    !! ---------------------------------------------    
    21    INTEGER, PUBLIC                                                 ::   numnat_ref = -1   !: logical unit for the reference passive tracer namelist_top_ref 
    22    INTEGER, PUBLIC                                                 ::   numnat_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg 
    23    INTEGER, PUBLIC                                                 ::   numont     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top 
    24    INTEGER, PUBLIC                                                 ::   numtrc_ref = -1   !: logical unit for the reference passive tracer namelist_top_ref 
    25    INTEGER, PUBLIC                                                 ::   numtrc_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg 
    26    INTEGER, PUBLIC                                                 ::   numonr     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top 
    27    INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics 
    28    INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read ) 
    29    INTEGER, PUBLIC                                                 ::   numrtw        !: logical unit for trc restart ( write ) 
     19   !                                     !!- logical units of passive tracers 
     20   INTEGER, PUBLIC ::   numnat_ref = -1   !: reference passive tracer namelist_top_ref 
     21   INTEGER, PUBLIC ::   numnat_cfg = -1   !: reference passive tracer namelist_top_cfg 
     22   INTEGER, PUBLIC ::   numont     = -1   !: reference passive tracer namelist output output.namelist.top 
     23   INTEGER, PUBLIC ::   numtrc_ref = -1   !: reference passive tracer namelist_top_ref 
     24   INTEGER, PUBLIC ::   numtrc_cfg = -1   !: reference passive tracer namelist_top_cfg 
     25   INTEGER, PUBLIC ::   numonr     = -1   !: reference passive tracer namelist output output.namelist.top 
     26   INTEGER, PUBLIC ::   numstr            !: tracer statistics 
     27   INTEGER, PUBLIC ::   numrtr            !: trc restart (read ) 
     28   INTEGER, PUBLIC ::   numrtw            !: trc restart ( write ) 
    3029 
    3130   !! passive tracers fields (before,now,after) 
    3231   !! -------------------------------------------------- 
    33    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)               ::  trai           !: initial total tracer 
    34    REAL(wp), PUBLIC                                                ::  areatot        !: total volume  
    35    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  cvol           !: volume correction -degrad option-  
    36    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trn            !: tracer concentration for now time step 
    37    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  tra            !: tracer concentration for next time step 
    38    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trb            !: tracer concentration for before time step 
    39    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  sbc_trc_b      !: Before sbc fluxes for tracers 
    40    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  sbc_trc        !: Now sbc fluxes for tracers 
     32   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  trai           !: initial total tracer 
     33   REAL(wp), PUBLIC                                        ::  areatot        !: total volume  
     34   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  cvol           !: volume correction -degrad option-  
     35   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trn            !: tracer concentration for now time step 
     36   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tra            !: tracer concentration for next time step 
     37   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trb            !: tracer concentration for before time step 
     38   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  sbc_trc_b      !: Before sbc fluxes for tracers 
     39   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  sbc_trc        !: Now sbc fluxes for tracers 
    4140 
    42    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_i          !: prescribed tracer concentration in sea ice for SBC 
    43    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_o          !: prescribed tracer concentration in ocean for SBC 
    44    INTEGER             , PUBLIC                                    ::  nn_ice_tr      !: handling of sea ice tracers 
     41   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  trc_i          !: prescribed tracer concentration in sea ice for SBC 
     42   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  trc_o          !: prescribed tracer concentration in ocean for SBC 
     43   INTEGER             , PUBLIC                            ::  nn_ice_tr      !: handling of sea ice tracers 
    4544 
    4645   !! interpolated gradient 
    4746   !!--------------------------------------------------   
    48    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtru           !: hor. gradient at u-points at bottom ocean level 
    49    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrv           !: hor. gradient at v-points at bottom ocean level 
    50    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrui          !: hor. gradient at u-points at top    ocean level 
    51    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrvi          !: hor. gradient at v-points at top    ocean level 
    52    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)             ::  qsr_mean        !: daily mean qsr 
     47   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtru           !: hor. gradient at u-points at bottom ocean level 
     48   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrv           !: hor. gradient at v-points at bottom ocean level 
     49   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrui          !: hor. gradient at u-points at top    ocean level 
     50   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrvi          !: hor. gradient at v-points at top    ocean level 
     51   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_mean        !: daily mean qsr 
    5352    
    5453   !! passive tracers  (input and output) 
    5554   !! ------------------------------------------   
    56    LOGICAL             , PUBLIC                                    ::  ln_rsttr       !: boolean term for restart i/o for passive tracers (namelist) 
    57    LOGICAL             , PUBLIC                                    ::  lrst_trc       !: logical to control the trc restart write 
    58    INTEGER             , PUBLIC                                    ::  nn_writetrc    !: time step frequency for concentration outputs (namelist) 
    59    INTEGER             , PUBLIC                                    ::  nutwrs         !: output FILE for passive tracers restart 
    60    INTEGER             , PUBLIC                                    ::  nutrst         !: logical unit for restart FILE for passive tracers 
    61    INTEGER             , PUBLIC                                    ::  nn_rsttr       !: control of the time step ( 0 or 1 ) for pass. tr. 
    62    CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_in   !: suffix of pass. tracer restart name (input) 
    63    CHARACTER(len = 256), PUBLIC                                    ::  cn_trcrst_indir  !: restart input directory 
    64    CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_out  !: suffix of pass. tracer restart name (output) 
    65    CHARACTER(len = 256), PUBLIC                                    ::  cn_trcrst_outdir  !: restart output directory 
    66    REAL(wp)            , PUBLIC                                    ::  rdttrc         !: passive tracer time step 
    67    REAL(wp)            , PUBLIC                                    ::  r2dttrc        !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0 
    68    LOGICAL             , PUBLIC                                    ::  ln_top_euler   !: boolean term for euler integration  
    69    LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files 
    70    LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag 
    71    LOGICAL             , PUBLIC                                    ::  ln_trcdmp_clo  !: internal damping flag on closed seas 
    72    INTEGER             , PUBLIC                                    ::  nittrc000      !: first time step of passive tracers model 
    73    LOGICAL             , PUBLIC                                    ::  l_trcdm2dc     !: Diurnal cycle for TOP 
     55   LOGICAL             , PUBLIC ::   ln_rsttr           !: boolean term for restart i/o for passive tracers (namelist) 
     56   LOGICAL             , PUBLIC ::   lrst_trc           !: logical to control the trc restart write 
     57   INTEGER             , PUBLIC ::   nn_writetrc        !: time step frequency for concentration outputs (namelist) 
     58   INTEGER             , PUBLIC ::   nutwrs             !: output FILE for passive tracers restart 
     59   INTEGER             , PUBLIC ::   nutrst             !: logical unit for restart FILE for passive tracers 
     60   INTEGER             , PUBLIC ::   nn_rsttr           !: control of the time step ( 0 or 1 ) for pass. tr. 
     61   CHARACTER(len = 80) , PUBLIC ::   cn_trcrst_in       !: suffix of pass. tracer restart name (input) 
     62   CHARACTER(len = 256), PUBLIC ::   cn_trcrst_indir    !: restart input directory 
     63   CHARACTER(len = 80) , PUBLIC ::   cn_trcrst_out      !: suffix of pass. tracer restart name (output) 
     64   CHARACTER(len = 256), PUBLIC ::   cn_trcrst_outdir   !: restart output directory 
     65   REAL(wp)            , PUBLIC ::   rdttrc             !: passive tracer time step 
     66   REAL(wp)            , PUBLIC ::   r2dttrc            !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0 
     67   LOGICAL             , PUBLIC ::   ln_top_euler       !: boolean term for euler integration  
     68   LOGICAL             , PUBLIC ::   ln_trcdta          !: Read inputs data from files 
     69   LOGICAL             , PUBLIC ::   ln_trcdmp          !: internal damping flag 
     70   LOGICAL             , PUBLIC ::   ln_trcdmp_clo      !: internal damping flag on closed seas 
     71   INTEGER             , PUBLIC ::   nittrc000          !: first time step of passive tracers model 
     72   LOGICAL             , PUBLIC ::   l_trcdm2dc         !: Diurnal cycle for TOP 
    7473 
    7574   !! Information for the ice module for tracers 
     
    8079         CHARACTER(len=2) :: ctrc_o     ! choice of ocean trc cc 
    8180   END TYPE 
    82  
    83    REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_ratio      ! ice-ocean tracer ratio 
    84    REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_prescr     ! prescribed ice trc cc 
    85    CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: cn_trc_o ! choice of ocean tracer cc 
     81   ! 
     82   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   trc_ice_ratio    !: ice-ocean tracer ratio 
     83   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   trc_ice_prescr   !: prescribed ice trc cc 
     84   CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   cn_trc_o         !: choice of ocean tracer cc 
    8685 
    8786 
    8887   !! information for outputs 
    8988   !! -------------------------------------------------- 
    90    TYPE, PUBLIC :: PTRACER                                                            !: Passive tracer type 
     89   TYPE, PUBLIC :: PTRACER                                                         !: Passive tracer type 
    9190       CHARACTER(len = 20)  :: clsname  !: short name 
    9291       CHARACTER(len = 80)  :: cllname  !: long name 
     
    9796       LOGICAL              :: llobc   !: read in a file or not 
    9897   END TYPE PTRACER 
    99  
    100    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm         !: tracer name  
    101    CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln         !: trccer field long name 
    102    CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun         !: tracer unit 
    103  
    104    TYPE, PUBLIC :: DIAG                                                               !: passive trcacer ddditional diagnostic type 
     98   ! 
     99   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm     !: tracer name  
     100   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln     !: trccer field long name 
     101   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun     !: tracer unit 
     102   ! 
     103   TYPE, PUBLIC :: DIAG                                                           !: passive trcacer ddditional diagnostic type 
    105104      CHARACTER(len = 20)  :: sname    !: short name 
    106105      CHARACTER(len = 80)  :: lname    !: long name 
    107106      CHARACTER(len = 20)  :: units    !: unit 
    108107   END TYPE DIAG 
    109  
     108   ! 
    110109   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc3d          !: 3D diagnostics for tracers 
    111110   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc2d          !: 2D diagnostics for tracers 
     
    113112   !! information for inputs 
    114113   !! -------------------------------------------------- 
    115    LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file 
    116    LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_obc     !: Use open boundary condition data 
    117    LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_sbc     !: Use surface boundary condition data 
    118    LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_cbc     !: Use coastal boundary condition data 
    119    LOGICAL , PUBLIC                                     ::  ln_rnf_ctl     !: remove runoff dilution on tracers 
    120    REAL(wp), PUBLIC                                     ::  rn_bc_time     !: Time scaling factor for SBC and CBC data (seconds in a day) 
     114   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_ini     !: Initialisation from data input file 
     115   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_obc     !: Use open boundary condition data 
     116   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_sbc     !: Use surface boundary condition data 
     117   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_cbc     !: Use coastal boundary condition data 
     118   LOGICAL , PUBLIC                                     ::   ln_rnf_ctl     !: remove runoff dilution on tracers 
     119   REAL(wp), PUBLIC                                     ::   rn_bc_time     !: Time scaling factor for SBC and CBC data (seconds in a day) 
    121120 
    122  
    123    !! variables to average over physics over passive tracer sub-steps. 
    124    !! ---------------------------------------------------------------- 
    125    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_tm       !: i-horizontal velocity average     [m/s] 
    126    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vn_tm       !: j-horizontal velocity average     [m/s] 
    127    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_tm      !: t/s average     [m/s] 
    128    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_tm      !: vertical diffusivity coeff. at  w-point   [m2/s] 
    129    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  rhop_tm     !:  
    130 #if defined key_trabbl 
    131    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm  !: u-, w-points 
    132    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahv_bbl_tm  !: j-direction slope at u-, w-points 
    133    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  utr_bbl_tm  !: j-direction slope at u-, w-points 
    134    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  vtr_bbl_tm  !: j-direction slope at u-, w-points 
    135 #endif 
    136    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_tm     !: average ssh for the now step [m] 
    137    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]   
    138  
    139    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  rnf_tm     !: river runoff 
    140    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  h_rnf_tm   !: depth in metres to the bottom of the relevant grid box 
    141    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_tm    !: mixed layer depth average [m] 
    142    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fr_i_tm    !: average ice fraction     [m/s] 
    143    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_tm     !: freshwater budget: volume flux [Kg/m2/s] 
    144    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fmmflx_tm  !: freshwater budget: freezing/melting [Kg/m2/s] 
    145    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_b_hold !: hold emp from the beginning of each sub-stepping[m]   
    146    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_tm     !: solar radiation average [m] 
    147    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  wndm_tm    !: 10m wind average [m] 
    148    ! 
    149  
    150    ! Temporary physical arrays for sub_stepping 
    151    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_temp 
    152    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_temp,vn_temp,wn_temp     !: hold current values of avt, un, vn, wn 
    153    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_temp, rhop_temp     !: hold current values of avt, un, vn, wn 
    154    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp 
    155    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp 
    156    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp 
    157    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_temp, qsr_temp, fr_i_temp,wndm_temp 
    158    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, fmmflx_temp, emp_b_temp 
    159    ! 
    160 #if defined key_trabbl 
    161    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values  
    162 #endif 
    163121   ! 
    164122   ! 
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcstp.F90

    r7812 r7954  
    88#if defined key_top 
    99   !!---------------------------------------------------------------------- 
    10    !!   trc_stp      : passive tracer system time-stepping 
    11    !!---------------------------------------------------------------------- 
    12    USE oce_trc          ! ocean dynamics and active tracers variables 
     10   !!   trc_stp       : passive tracer system time-stepping 
     11   !!---------------------------------------------------------------------- 
     12   USE oce_trc        ! ocean dynamics and active tracers variables 
    1313   USE sbc_oce 
    1414   USE trc 
    15    USE trctrp           ! passive tracers transport 
    16    USE trcsms           ! passive tracers sources and sinks 
     15   USE trctrp         ! passive tracers transport 
     16   USE trcsms         ! passive tracers sources and sinks 
    1717   USE trcwri 
    1818   USE trcrst 
     19   USE trcsub         ! 
    1920   USE trdtrc_oce 
    2021   USE trdmxl_trc 
    21    USE prtctl_trc       ! Print control for debbuging 
    22    USE iom 
    23    USE in_out_manager 
    24    USE trcsub 
     22   ! 
     23   USE prtctl_trc     ! Print control for debbuging 
     24   USE iom            ! 
     25   USE in_out_manager ! 
    2526 
    2627   IMPLICIT NONE 
     
    2930   PUBLIC   trc_stp    ! called by step 
    3031 
    31    REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   qsr_arr ! save qsr during TOP time-step 
    32    REAL(wp) :: rdt_sampl 
    33    INTEGER  :: nb_rec_per_day, ktdcy 
    34    REAL(wp) :: rsecfst, rseclast 
    35    LOGICAL  :: llnew 
     32   LOGICAL  ::   llnew                   ! ??? 
     33   REAL(wp) ::   rdt_sampl               ! ??? 
     34   INTEGER  ::   nb_rec_per_day, ktdcy   ! ??? 
     35   REAL(wp) ::   rsecfst, rseclast       ! ??? 
     36   REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   qsr_arr   ! save qsr during TOP time-step 
    3637 
    3738   !!---------------------------------------------------------------------- 
     
    4647      !!                     ***  ROUTINE trc_stp  *** 
    4748      !!                       
    48       !! ** Purpose : Time loop of opa for passive tracer 
     49      !! ** Purpose :   Time loop of opa for passive tracer 
    4950      !!  
    50       !! ** Method  :  
    51       !!              Compute the passive tracers trends  
    52       !!              Update the passive tracers 
     51      !! ** Method  :   Compute the passive tracers trends  
     52      !!                Update the passive tracers 
    5353      !!------------------------------------------------------------------- 
    54       INTEGER, INTENT( in ) ::  kt      ! ocean time-step index 
    55       INTEGER               ::  jk, jn  ! dummy loop indices 
    56       REAL(wp)              ::  ztrai 
    57       CHARACTER (len=25)    ::  charout  
    58  
     54      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     55      ! 
     56      INTEGER ::   jk, jn   ! dummy loop indices 
     57      REAL(wp)::   ztrai    ! local scalar 
     58      CHARACTER (len=25) ::   charout   ! 
    5959      !!------------------------------------------------------------------- 
    6060      ! 
     
    115115      ! 
    116116   END SUBROUTINE trc_stp 
     117 
    117118 
    118119   SUBROUTINE trc_mean_qsr( kt ) 
     
    128129      !!              In coupled mode, the sampling is done at every coupling frequency  
    129130      !!---------------------------------------------------------------------- 
    130       INTEGER, INTENT(in) ::   kt 
    131       INTEGER  :: jn 
    132       REAL(wp) :: zkt, zrec 
    133       CHARACTER(len=1)               ::   cl1                      ! 1 character 
    134       CHARACTER(len=2)               ::   cl2                      ! 2 characters 
    135  
     131      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     132      ! 
     133      INTEGER  ::   jn   ! dummy loop indices 
     134      REAL(wp) ::   zkt, zrec     ! local scalars 
     135      CHARACTER(len=1) ::   cl1   ! 1 character 
     136      CHARACTER(len=2) ::   cl2   ! 2 characters 
     137      !!---------------------------------------------------------------------- 
     138      ! 
    136139      IF( kt == nittrc000 ) THEN 
    137140         IF( ln_cpl )  THEN   
     
    143146         ENDIF 
    144147         ! 
    145          IF( lwp ) THEN 
     148         IF(lwp) THEN 
    146149            WRITE(numout,*)  
    147150            WRITE(numout,*) ' Sampling frequency dt = ', rdt_sampl, 's','   Number of sampling per day  nrec = ', nb_rec_per_day 
     
    171174                    CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl2, qsr_arr(:,:,jn) )   !  A mean of qsr 
    172175                  ENDIF 
    173               ENDDO 
     176              END DO 
    174177            ELSE 
    175178               DO jn = 1, nb_rec_per_day 
     
    184187            DO jn = 1, nb_rec_per_day 
    185188               qsr_arr(:,:,jn) = qsr_mean(:,:) 
    186             ENDDO 
     189            END DO 
    187190         ENDIF 
    188191         ! 
     
    220223               CALL iom_rstput( kt, nitrst, numrtw, 'qsr_arr_'//cl2, qsr_arr(:,:,jn) ) 
    221224             ENDIF 
    222          ENDDO 
     225         END DO 
    223226         CALL iom_rstput( kt, nitrst, numrtw, 'qsr_mean', qsr_mean(:,:) ) 
    224227      ENDIF 
  • branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90

    r7953 r7954  
    22   !!====================================================================== 
    33   !!                       ***  MODULE trcsubstp  *** 
    4    !!TOP :   Averages physics variables for TOP substepping.  
     4   !!   TOP :   Averages physics variables for TOP substepping.  
    55   !!====================================================================== 
    66   !! History :  1.0  !  2011-10  (K. Edwards)  Original 
     
    88#if defined key_top 
    99   !!---------------------------------------------------------------------- 
    10    !!   trc_sub    : passive tracer system sub-stepping  
     10   !!   trc_sub       : passive tracer system sub-stepping  
    1111   !!---------------------------------------------------------------------- 
    12    USE oce_trc          ! ocean dynamics and active tracers variables 
     12   USE oce_trc        ! ocean dynamics and active tracers variables 
    1313   USE trc 
    14    USE prtctl_trc       ! Print control for debbuging 
    15    USE iom 
    16    USE in_out_manager 
    17    USE lbclnk 
    18    USE trabbl 
     14   USE trabbl         ! bottom boundary layer 
    1915   USE zdf_oce 
    2016   USE domvvl 
    21    USE divhor          ! horizontal divergence            (div_hor routine) 
    22    USE sbcrnf    , ONLY: h_rnf, nk_rnf    ! River runoff 
    23    USE bdy_oce   , ONLY: ln_bdy, bdytmask ! BDY 
     17   USE divhor         ! horizontal divergence 
     18   USE sbcrnf   , ONLY: h_rnf, nk_rnf    ! River runoff 
     19   USE bdy_oce  , ONLY: ln_bdy, bdytmask ! BDY 
     20   ! 
     21   USE prtctl_trc     ! Print control for debbuging 
     22   USE in_out_manager !  
     23   USE iom 
     24   USE lbclnk 
    2425#if defined key_agrif 
    2526   USE agrif_opa_update 
     
    2930   IMPLICIT NONE 
    3031 
    31    PUBLIC   trc_sub_stp      ! called by trc_stp 
    32    PUBLIC   trc_sub_ini      ! called by trc_ini to initialize substepping arrays. 
    33    PUBLIC   trc_sub_reset    ! called by trc_stp to reset physics variables 
    34    PUBLIC   trc_sub_ssh      ! called by trc_stp to reset physics variables 
    35  
    36    REAL(wp)  :: r1_ndttrc     !    1 /  nn_dttrc  
    37    REAL(wp)  :: r1_ndttrcp1   !    1 / (nn_dttrc+1)  
    38  
    39    !                                                       !* iso-neutral slopes (if l_ldfslp=T) 
    40    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_temp, vslp_temp, wslpi_temp, wslpj_temp   !: hold current values  
    41    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_tm  , vslp_tm  , wslpi_tm  , wslpj_tm     !: time mean  
     32   PUBLIC   trc_sub_stp     ! called by trc_stp 
     33   PUBLIC   trc_sub_ini     ! called by trc_ini to initialize substepping arrays. 
     34   PUBLIC   trc_sub_reset   ! called by trc_stp to reset physics variables 
     35   PUBLIC   trc_sub_ssh     ! called by trc_stp to reset physics variables 
     36 
     37   REAL(wp) :: r1_ndttrc     ! = 1 /  nn_dttrc  
     38   REAL(wp) :: r1_ndttrcp1   ! = 1 / (nn_dttrc+1)  
     39 
     40 
     41   !! averaged and temporary saved variables  (needed when a larger passive tracer time-step is used) 
     42   !! ---------------------------------------------------------------- 
     43   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    un_tm ,   un_temp   !: i-horizontal velocity average     [m/s] 
     44   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    vn_tm ,   vn_temp   !: j-horizontal velocity average     [m/s] 
     45   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::              wn_temp   !: hold current values of avt, un, vn, wn 
     46   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tsn_tm ,  tsn_temp   !: t/s average     [m/s] 
     47   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   avs_tm ,  avs_temp   !: vertical diffusivity coeff. at  w-point   [m2/s] 
     48   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  rhop_tm , rhop_temp   !:  
     49   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_tm , sshn_temp   !: average ssh for the now step [m] 
     50 
     51   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    rnf_tm ,    rnf_temp   !: river runoff 
     52   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  h_rnf_tm ,  h_rnf_temp   !: depth in metres to the bottom of the relevant grid box 
     53   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   hmld_tm ,   hmld_temp   !: mixed layer depth average [m] 
     54   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   fr_i_tm ,   fr_i_temp   !: average ice fraction     [m/s] 
     55   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    emp_tm ,    emp_temp   !: freshwater budget: volume flux [Kg/m2/s] 
     56   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     :: fmmflx_tm , fmmflx_temp   !: freshwater budget: freezing/melting [Kg/m2/s] 
     57   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     :: emp_b_hold,  emp_b_temp   !: hold emp from the beginning of each sub-stepping[m]   
     58   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    qsr_tm ,    qsr_temp   !: solar radiation average [m] 
     59   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   wndm_tm ,   wndm_temp   !: 10m wind average [m] 
     60   ! 
     61   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]   
     62   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   sshb_temp, ssha_temp 
     63   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp 
     64   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp 
     65   ! 
     66   !                                                    !!- bottom boundary layer param (ln_trabbl=T) 
     67   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm, ahu_bbl_temp  ! BBL diffusive i-coef. 
     68   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahv_bbl_tm, ahv_bbl_temp  ! BBL diffusive j-coef. 
     69   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  utr_bbl_tm, utr_bbl_temp  ! BBL u-advection 
     70   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  vtr_bbl_tm, vtr_bbl_temp  ! BBL v-advection 
     71 
     72   !                                                      !!- iso-neutral slopes (if l_ldfslp=T) 
     73   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   uslp_temp, vslp_temp, wslpi_temp, wslpj_temp   !: hold current values  
     74   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   uslp_tm  , vslp_tm  , wslpi_tm  , wslpj_tm     !: time mean  
     75 
    4276 
    4377   !!---------------------------------------------------------------------- 
    44    !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     78   !! NEMO/TOP 4.0 , NEMO Consortium (2017) 
    4579   !! $Id$  
    4680   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    5791      !!              on TOP steps, calculate averages. 
    5892      !!------------------------------------------------------------------- 
    59       INTEGER, INTENT( in ) ::  kt        ! ocean time-step index 
    60       INTEGER               ::  ji,jj,jk  ! dummy loop indices 
    61       REAL(wp)              ::  z1_ne3t, z1_ne3u, z1_ne3v, z1_ne3w 
     93      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
     94      ! 
     95      INTEGER ::   ji, jj, jk   ! dummy loop indices 
     96      REAL(wp)::   z1_ne3t, z1_ne3u, z1_ne3v, z1_ne3w   ! local scalars 
    6297      !!------------------------------------------------------------------- 
    6398      ! 
     
    74109           r1_ndttrc        = 1._wp / REAL( nn_dttrc    , wp )  
    75110           r1_ndttrcp1      = 1._wp / REAL( nn_dttrc + 1, wp ) 
    76            ! 
    77111      ENDIF   
    78112 
    79        IF( MOD( kt , nn_dttrc ) /= 0 ) THEN 
    80           ! 
    81           un_tm   (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:)  
    82           vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:)  
    83           tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,:)   
    84           tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,:)   
    85           rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,:)   
    86           avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,:)   
     113      IF( MOD( kt , nn_dttrc ) /= 0 ) THEN 
     114         ! 
     115         un_tm   (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:)  
     116         vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:)  
     117         tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,:)   
     118         tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,:)   
     119         rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,:)   
     120         avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,:)   
    87121         IF( l_ldfslp ) THEN 
    88122            uslp_tm (:,:,:)      = uslp_tm (:,:,:)        + uslp (:,:,:) 
     
    91125            wslpj_tm(:,:,:)      = wslpj_tm(:,:,:)        + wslpj(:,:,:) 
    92126         ENDIF 
    93 # if defined key_trabbl 
    94           IF( nn_bbl_ldf == 1 ) THEN 
    95              ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:)  
    96              ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:)  
    97           ENDIF 
    98           IF( nn_bbl_adv == 1 ) THEN 
    99              utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:)  
    100              vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:)  
    101           ENDIF 
    102 # endif 
    103           ! 
    104           sshn_tm  (:,:)         = sshn_tm  (:,:)         + sshn  (:,:)  
    105           rnf_tm   (:,:)         = rnf_tm   (:,:)         + rnf   (:,:)  
    106           h_rnf_tm (:,:)         = h_rnf_tm (:,:)         + h_rnf (:,:)  
    107           hmld_tm  (:,:)         = hmld_tm  (:,:)         + hmld  (:,:) 
    108           fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:) 
    109           emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:)  
    110           fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:) 
    111           qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:) 
    112           wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:) 
    113  
     127         IF( ln_trabbl ) THEN 
     128            IF( nn_bbl_ldf == 1 ) THEN 
     129               ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:)  
     130               ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:)  
     131            ENDIF 
     132            IF( nn_bbl_adv == 1 ) THEN 
     133               utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:)  
     134               vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:)  
     135            ENDIF 
     136         ENDIF  
     137         ! 
     138         sshn_tm  (:,:)         = sshn_tm  (:,:)         + sshn  (:,:)  
     139         rnf_tm   (:,:)         = rnf_tm   (:,:)         + rnf   (:,:)  
     140         h_rnf_tm (:,:)         = h_rnf_tm (:,:)         + h_rnf (:,:)  
     141         hmld_tm  (:,:)         = hmld_tm  (:,:)         + hmld  (:,:) 
     142         fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:) 
     143         emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:)  
     144         fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:) 
     145         qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:) 
     146         wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:) 
     147         ! 
    114148      ELSE                           !  It is time to substep  
    115          !   1. set temporary arrays to hold physics variables 
     149         !   1. set temporary arrays to hold physics/dynamical variables 
    116150         un_temp    (:,:,:)      = un    (:,:,:) 
    117151         vn_temp    (:,:,:)      = vn    (:,:,:) 
     
    124158            vslp_temp  (:,:,:)   = vslp  (:,:,:)   ;   wslpj_temp (:,:,:)   = wslpj (:,:,:) 
    125159         ENDIF 
    126 # if defined key_trabbl 
    127           IF( nn_bbl_ldf == 1 ) THEN 
    128              ahu_bbl_temp(:,:)   = ahu_bbl(:,:)   
    129              ahv_bbl_temp(:,:)   = ahv_bbl(:,:)  
    130           ENDIF 
    131           IF( nn_bbl_adv == 1 ) THEN 
    132              utr_bbl_temp(:,:)   = utr_bbl(:,:)  
    133              vtr_bbl_temp(:,:)   = vtr_bbl(:,:)  
    134           ENDIF 
    135 # endif 
     160         IF( ln_trabbl ) THEN 
     161            IF( nn_bbl_ldf == 1 ) THEN 
     162               ahu_bbl_temp(:,:)   = ahu_bbl(:,:)   
     163               ahv_bbl_temp(:,:)   = ahv_bbl(:,:)  
     164            ENDIF 
     165            IF( nn_bbl_adv == 1 ) THEN 
     166               utr_bbl_temp(:,:)   = utr_bbl(:,:)  
     167               vtr_bbl_temp(:,:)   = vtr_bbl(:,:)  
     168            ENDIF 
     169         ENDIF  
    136170         sshn_temp  (:,:)        = sshn  (:,:) 
    137171         sshb_temp  (:,:)        = sshb  (:,:) 
     
    162196            wslpj_tm (:,:,:)     = wslpj_tm(:,:,:)        + wslpj(:,:,:)  
    163197         ENDIF 
    164 # if defined key_trabbl 
    165           IF( nn_bbl_ldf == 1 ) THEN 
    166              ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:)  
    167              ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:)  
    168           ENDIF 
    169           IF( nn_bbl_adv == 1 ) THEN 
    170              utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:)  
    171              vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:)  
    172           ENDIF 
    173 # endif 
     198         IF( ln_trabbl ) THEN 
     199            IF( nn_bbl_ldf == 1 ) THEN 
     200               ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:)  
     201               ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:)  
     202            ENDIF 
     203            IF( nn_bbl_adv == 1 ) THEN 
     204               utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:)  
     205               vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:)  
     206            ENDIF 
     207         ENDIF  
    174208         sshn_tm  (:,:)          = sshn_tm    (:,:)       + sshn  (:,:)  
    175209         rnf_tm   (:,:)          = rnf_tm     (:,:)       + rnf   (:,:)  
     
    195229            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrc  
    196230            fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrc 
    197 # if defined key_trabbl 
    198             IF( nn_bbl_ldf == 1 ) THEN 
    199                ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrc   
    200                ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrc  
    201             ENDIF 
    202             IF( nn_bbl_adv == 1 ) THEN 
    203                utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrc   
    204                vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrc  
    205             ENDIF 
    206 # endif 
     231            IF( ln_trabbl ) THEN 
     232               IF( nn_bbl_ldf == 1 ) THEN 
     233                  ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrc   
     234                  ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrc  
     235               ENDIF 
     236               IF( nn_bbl_adv == 1 ) THEN 
     237                  utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrc   
     238                  vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrc  
     239               ENDIF 
     240            ENDIF 
    207241         ELSE 
    208242            wndm  (:,:)          = wndm_tm    (:,:) * r1_ndttrcp1  
     
    211245            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrcp1  
    212246            fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrcp1  
    213 # if defined key_trabbl 
    214             IF( nn_bbl_ldf == 1 ) THEN 
    215                ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrcp1   
    216                ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrcp1  
    217             ENDIF 
    218             IF( nn_bbl_adv == 1 ) THEN 
    219                utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrcp1   
    220                vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrcp1  
    221             ENDIF 
    222 # endif 
     247            IF( ln_trabbl ) THEN 
     248               IF( nn_bbl_ldf == 1 ) THEN 
     249                  ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrcp1   
     250                  ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrcp1  
     251               ENDIF 
     252               IF( nn_bbl_adv == 1 ) THEN 
     253                  utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrcp1   
     254                  vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrcp1  
     255               ENDIF 
     256            ENDIF 
    223257         ENDIF 
    224258         ! 
     
    298332 
    299333      ! Physics variables that are set after initialization: 
    300       fr_i_tm(:,:) = 0._wp 
    301       emp_tm (:,:) = 0._wp 
     334      fr_i_tm  (:,:) = 0._wp 
     335      emp_tm   (:,:) = 0._wp 
    302336      fmmflx_tm(:,:)  = 0._wp 
    303       qsr_tm (:,:) = 0._wp 
    304       wndm_tm(:,:) = 0._wp 
    305 # if defined key_trabbl 
    306       IF( nn_bbl_ldf == 1 ) THEN 
    307          ahu_bbl_tm(:,:) = 0._wp 
    308          ahv_bbl_tm(:,:) = 0._wp 
    309       ENDIF 
    310       IF( nn_bbl_adv == 1 ) THEN 
    311          utr_bbl_tm(:,:) = 0._wp 
    312          vtr_bbl_tm(:,:) = 0._wp 
    313       ENDIF 
    314 # endif 
     337      qsr_tm   (:,:) = 0._wp 
     338      wndm_tm  (:,:) = 0._wp 
     339      IF( ln_trabbl ) THEN 
     340         IF( nn_bbl_ldf == 1 ) THEN 
     341            ahu_bbl_tm(:,:) = 0._wp 
     342            ahv_bbl_tm(:,:) = 0._wp 
     343         ENDIF 
     344         IF( nn_bbl_adv == 1 ) THEN 
     345            utr_bbl_tm(:,:) = 0._wp 
     346            vtr_bbl_tm(:,:) = 0._wp 
     347         ENDIF 
     348      ENDIF 
    315349      ! 
    316350      IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ini') 
     
    359393      qsr   (:,:)     =  qsr_temp   (:,:) 
    360394      wndm  (:,:)     =  wndm_temp  (:,:) 
    361 # if defined key_trabbl 
    362       IF( nn_bbl_ldf == 1 ) THEN 
    363          ahu_bbl(:,:) = ahu_bbl_temp(:,:)  
    364          ahv_bbl(:,:) = ahv_bbl_temp(:,:)  
    365       ENDIF 
    366       IF( nn_bbl_adv == 1 ) THEN 
    367          utr_bbl(:,:) = utr_bbl_temp(:,:)  
    368          vtr_bbl(:,:) = vtr_bbl_temp(:,:)  
    369       ENDIF 
    370 # endif 
     395      IF( ln_trabbl ) THEN 
     396         IF( nn_bbl_ldf == 1 ) THEN 
     397            ahu_bbl(:,:) = ahu_bbl_temp(:,:)  
     398            ahv_bbl(:,:) = ahv_bbl_temp(:,:)  
     399         ENDIF 
     400         IF( nn_bbl_adv == 1 ) THEN 
     401            utr_bbl(:,:) = utr_bbl_temp(:,:)  
     402            vtr_bbl(:,:) = vtr_bbl_temp(:,:)  
     403         ENDIF 
     404      ENDIF 
    371405      ! 
    372406      hdivn (:,:,:)   =  hdivn_temp (:,:,:) 
     
    397431      qsr_tm     (:,:) = qsr   (:,:) 
    398432      wndm_tm    (:,:) = wndm  (:,:) 
    399 # if defined key_trabbl 
    400       IF( nn_bbl_ldf == 1 ) THEN 
    401          ahu_bbl_tm(:,:) = ahu_bbl(:,:)  
    402          ahv_bbl_tm(:,:) = ahv_bbl(:,:)  
    403       ENDIF 
    404       IF( nn_bbl_adv == 1 ) THEN 
    405          utr_bbl_tm(:,:) = utr_bbl(:,:)  
    406          vtr_bbl_tm(:,:) = vtr_bbl(:,:)  
    407       ENDIF 
    408 # endif 
     433      IF( ln_trabbl ) THEN 
     434         IF( nn_bbl_ldf == 1 ) THEN 
     435            ahu_bbl_tm(:,:) = ahu_bbl(:,:)  
     436            ahv_bbl_tm(:,:) = ahv_bbl(:,:)  
     437         ENDIF 
     438         IF( nn_bbl_adv == 1 ) THEN 
     439            utr_bbl_tm(:,:) = utr_bbl(:,:)  
     440            vtr_bbl_tm(:,:) = vtr_bbl(:,:)  
     441         ENDIF 
     442      ENDIF 
    409443      ! 
    410444      ! 
     
    509543      !!------------------------------------------------------------------- 
    510544      USE lib_mpp, ONLY: ctl_warn 
    511       INTEGER ::  ierr 
    512       !!------------------------------------------------------------------- 
    513       ! 
    514       ALLOCATE( un_temp(jpi,jpj,jpk)        ,  vn_temp(jpi,jpj,jpk)  ,   & 
    515          &      wn_temp(jpi,jpj,jpk)        ,                            & 
    516          &      rhop_temp(jpi,jpj,jpk)      ,  rhop_tm(jpi,jpj,jpk) ,   & 
    517          &      sshn_temp(jpi,jpj)          ,  sshb_temp(jpi,jpj) ,      & 
    518          &      ssha_temp(jpi,jpj)          ,                           & 
    519 #if defined key_trabbl 
    520          &      ahu_bbl_temp(jpi,jpj)       ,  ahv_bbl_temp(jpi,jpj),    & 
    521          &      utr_bbl_temp(jpi,jpj)       ,  vtr_bbl_temp(jpi,jpj),    & 
    522 #endif 
    523          &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,     & 
    524          &      tsn_temp(jpi,jpj,jpk,2)     ,  emp_b_temp(jpi,jpj),      & 
    525          &      emp_temp(jpi,jpj)           ,  fmmflx_temp(jpi,jpj),     & 
    526          &      hmld_temp(jpi,jpj)          ,  qsr_temp(jpi,jpj) ,       & 
    527          &      fr_i_temp(jpi,jpj)          ,  fr_i_tm(jpi,jpj) ,        & 
    528          &      wndm_temp(jpi,jpj)          ,  wndm_tm(jpi,jpj) ,        & 
    529          &      avs_tm(jpi,jpj,jpk)         ,  avs_temp(jpi,jpj,jpk) ,   & 
    530          &      hdivn_temp(jpi,jpj,jpk)     ,  hdivb_temp(jpi,jpj,jpk),  & 
    531          &      un_tm(jpi,jpj,jpk)          ,  vn_tm(jpi,jpj,jpk)  ,     & 
    532          &      sshn_tm(jpi,jpj)            ,  sshb_hold(jpi,jpj) ,      & 
    533          &      tsn_tm(jpi,jpj,jpk,2)       ,                            & 
    534          &      emp_tm(jpi,jpj)             ,  fmmflx_tm(jpi,jpj)  ,     & 
    535          &      emp_b_hold(jpi,jpj)         ,                            & 
    536          &      hmld_tm(jpi,jpj)            ,  qsr_tm(jpi,jpj) ,         & 
    537 #if defined key_trabbl 
    538          &      ahu_bbl_tm(jpi,jpj)         ,  ahv_bbl_tm(jpi,jpj),      & 
    539          &      utr_bbl_tm(jpi,jpj)         ,  vtr_bbl_tm(jpi,jpj),      & 
    540 #endif 
    541          &      rnf_tm(jpi,jpj)             ,  h_rnf_tm(jpi,jpj) , STAT=trc_sub_alloc )   
     545      INTEGER ::  ierr(3) 
     546      !!------------------------------------------------------------------- 
     547      ! 
     548      ierr(:) = 0 
     549      ! 
     550      ALLOCATE( un_temp(jpi,jpj,jpk)      ,  vn_temp(jpi,jpj,jpk)   ,     & 
     551         &      wn_temp(jpi,jpj,jpk)      ,                               & 
     552         &      rhop_temp(jpi,jpj,jpk)    ,  rhop_tm(jpi,jpj,jpk)   ,     & 
     553         &      sshn_temp(jpi,jpj)        ,  sshb_temp(jpi,jpj)     ,     & 
     554         &      ssha_temp(jpi,jpj)        ,                               & 
     555         &      rnf_temp(jpi,jpj)         ,  h_rnf_temp(jpi,jpj)    ,     & 
     556         &      tsn_temp(jpi,jpj,jpk,2)   ,  emp_b_temp(jpi,jpj)    ,     & 
     557         &      emp_temp(jpi,jpj)         ,  fmmflx_temp(jpi,jpj)   ,     & 
     558         &      hmld_temp(jpi,jpj)        ,  qsr_temp(jpi,jpj)      ,     & 
     559         &      fr_i_temp(jpi,jpj)        ,  fr_i_tm(jpi,jpj)       ,     & 
     560         &      wndm_temp(jpi,jpj)        ,  wndm_tm(jpi,jpj)       ,     & 
     561         &      avs_tm(jpi,jpj,jpk)       ,  avs_temp(jpi,jpj,jpk)  ,     & 
     562         &      hdivn_temp(jpi,jpj,jpk)   ,  hdivb_temp(jpi,jpj,jpk),     & 
     563         &      un_tm(jpi,jpj,jpk)        ,  vn_tm(jpi,jpj,jpk)     ,     & 
     564         &      sshn_tm(jpi,jpj)          ,  sshb_hold(jpi,jpj)     ,     & 
     565         &      tsn_tm(jpi,jpj,jpk,2)     ,                               & 
     566         &      emp_tm(jpi,jpj)           ,  fmmflx_tm(jpi,jpj)     ,     & 
     567         &      emp_b_hold(jpi,jpj)       ,                               & 
     568         &      hmld_tm(jpi,jpj)          ,  qsr_tm(jpi,jpj)        ,     & 
     569         &      rnf_tm(jpi,jpj)           ,  h_rnf_tm(jpi,jpj)      , STAT=ierr(1) )   
     570      ! 
     571      IF( l_ldfslp ) THEN 
     572         ALLOCATE( uslp_temp(jpi,jpj,jpk) ,  wslpi_temp(jpi,jpj,jpk),     & 
     573            &      vslp_temp(jpi,jpj,jpk) ,  wslpj_temp(jpi,jpj,jpk),     & 
     574            &      uslp_tm  (jpi,jpj,jpk) ,  wslpi_tm  (jpi,jpj,jpk),     & 
     575            &      vslp_tm  (jpi,jpj,jpk) ,  wslpj_tm  (jpi,jpj,jpk), STAT=ierr(2) ) 
     576      ENDIF 
     577      IF( ln_trabbl ) THEN 
     578         ALLOCATE( ahu_bbl_temp(jpi,jpj)  , utr_bbl_temp(jpi,jpj)   ,     & 
     579            &      ahv_bbl_temp(jpi,jpj)  , vtr_bbl_temp(jpi,jpj)   ,     & 
     580            &      ahu_bbl_tm  (jpi,jpj)  , utr_bbl_tm  (jpi,jpj)   ,     & 
     581            &      ahv_bbl_tm  (jpi,jpj)  , vtr_bbl_tm  (jpi,jpj)   , STAT=ierr(3) )  
     582      ENDIF 
     583      ! 
     584      trc_sub_alloc = MAXVAL( ierr ) 
    542585      ! 
    543586      IF( trc_sub_alloc /= 0 )   CALL ctl_warn('trc_sub_alloc: failed to allocate arrays') 
    544       ! 
    545       IF( l_ldfslp ) THEN 
    546          ALLOCATE( uslp_temp(jpi,jpj,jpk)   ,  wslpi_temp(jpi,jpj,jpk),      & 
    547             &      vslp_temp(jpi,jpj,jpk)   ,  wslpj_temp(jpi,jpj,jpk),      & 
    548             &      uslp_tm  (jpi,jpj,jpk)   ,  wslpi_tm  (jpi,jpj,jpk),      & 
    549             &      vslp_tm  (jpi,jpj,jpk)   ,  wslpj_tm  (jpi,jpj,jpk),  STAT=trc_sub_alloc ) 
    550       ENDIF 
    551       ! 
    552       IF( trc_sub_alloc /= 0 )   CALL ctl_warn('trc_sub_alloc: failed to allocate ldf_slp arrays') 
    553587      ! 
    554588   END FUNCTION trc_sub_alloc 
Note: See TracChangeset for help on using the changeset viewer.