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 15179 for NEMO – NEMO

Changeset 15179 for NEMO


Ignore:
Timestamp:
2021-08-11T13:07:00+02:00 (3 years ago)
Author:
davestorkey
Message:

UKMO/NEMO_4.0.4_momentum_trends:

  1. Bug fix for previous commit (correct wind stress and top friction trends for depth-mean flow).
  2. Surface trends: Remove ice-ocean stress from wind stress trend and add to top friction trend.
  3. Some tidying of trd_oce.F90 and trddyn.F90.
Location:
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/cfgs/SHARED/field_def_nemo-oce.xml

    r15176 r15179  
    840840     <field id="hu"             long_name="total time-varying depth at U-points"            unit="m" grid_ref="grid_U_2D" /> 
    841841     <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
    842      <field id="utrd_hpg_corr"  long_name="i-trend: HPG: correction"       unit="m/s^2"    grid_ref="grid_U_2D" /> 
    843842     <field id="utrd_spg2d"     long_name="i-trend: surface pressure gradient: true trend"       unit="m/s^2"    grid_ref="grid_U_2D" /> 
    844      <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
    845843     <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
    846844     <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
    847845     <field id="utrd_pvo"       long_name="i-trend: planetary vorticity: 3D component"      unit="m/s^2"                        /> 
    848846     <field id="utrd_pvo2d"     long_name="i-trend: planetary vorticity: 2D component"      unit="m/s^2"    grid_ref="grid_U_2D" /> 
    849      <field id="utrd_pvo_corr"     long_name="i-trend: planetary vorticity: correction"      unit="m/s^2"    grid_ref="grid_U_2D" /> 
    850847     <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        /> 
    851848     <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        /> 
     
    865862     <field id="utrd_hpg_e3u"       unit="m2/s^2" > utrd_hpg * e3u </field> 
    866863     <field id="utrd_spg_e3u"       unit="m2/s^2" > utrd_spg * e3u </field> 
    867      <field id="utrd_spgexp_e3u"    unit="m2/s^2" > utrd_spgexp * e3u </field> 
    868864     <field id="utrd_keg_e3u"       unit="m2/s^2" > utrd_keg * e3u </field> 
    869865     <field id="utrd_rvo_e3u"       unit="m2/s^2" > utrd_rvo * e3u </field> 
     
    890886     <field id="hv"             long_name="total time-varying depth at V-points"            unit="m" grid_ref="grid_V_2D" /> 
    891887     <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        /> 
    892      <field id="vtrd_hpg_corr"  long_name="j-trend: HPG: correction"       unit="m/s^2"    grid_ref="grid_V_2D" /> 
    893888     <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        /> 
    894889     <field id="vtrd_spg2d"     long_name="j-trend: surface pressure gradient: true trend"       unit="m/s^2"    grid_ref="grid_V_2D" /> 
    895      <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        /> 
    896890     <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        /> 
    897891     <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        /> 
    898892     <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity: 3D component"      unit="m/s^2"                        /> 
    899893     <field id="vtrd_pvo2d"     long_name="j-trend: planetary vorticity: 2D component"      unit="m/s^2"    grid_ref="grid_V_2D" /> 
    900      <field id="vtrd_pvo_corr"     long_name="j-trend: planetary vorticity: correction"      unit="m/s^2"    grid_ref="grid_V_2D" /> 
    901894     <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        /> 
    902895     <field id="vtrd_vdy"       long_name="j-trend: V.dx[V]"                                unit="m/s^2"                        /> 
     
    916909     <field id="vtrd_hpg_e3v"       unit="m2/s^2" > vtrd_hpg * e3v </field> 
    917910     <field id="vtrd_spg_e3v"       unit="m2/s^2" > vtrd_spg * e3v </field> 
    918      <field id="vtrd_spgexp_e3v"    unit="m2/s^2" > vtrd_spgexp * e3v </field> 
    919911     <field id="vtrd_keg_e3v"       unit="m2/s^2" > vtrd_keg * e3v </field> 
    920912     <field id="vtrd_rvo_e3v"       unit="m2/s^2" > vtrd_rvo * e3v </field> 
  • NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynspg_ts.F90

    r15176 r15179  
    392392               END DO 
    393393            ENDIF 
    394             CALL trd_dyn( ztautrdu, ztautrdv, jpdyn_tau2d_ice, kt ) 
     394            CALL trd_dyn( ztautrdu, ztautrdv, jpdyn_iceoc2d, kt ) 
    395395         ENDIF 
    396396         ! initialise fields for wind stress trends 
     
    924924            ztottrdv(:,:) = r1_hv_n(:,:) * ( va_b(:,:) - vb_b(:,:) * hv_b(:,:) ) * r1_2dt_b 
    925925            CALL trd_dyn( ztottrdu, ztottrdv, jpdyn_tot, kt ) 
    926 !!$            ! output total thickness for external thickness weighting 
    927 !!$            CALL iom_put( 'hu', hu_n )  
    928 !!$            CALL iom_put( 'hv', hv_n )  
    929926         ENDIF 
    930927      ENDIF 
  • NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynzdf.F90

    r15176 r15179  
    516516         CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt ) 
    517517         ! 
     518         !                             ! trends due to ice-ocean drag in surface layer 
     519         ztrdu_fr(:,:,:) = 0._wp    ;   ztrdv_fr(:,:,:) = 0._wp 
     520         ztrdu_fr(:,:,1) = ( uiceoc_b(:,:) + uiceoc(:,:) ) / ( e3u_n(:,:,1) * rau0 ) 
     521         ztrdv_fr(:,:,1) = ( viceoc_b(:,:) + viceoc(:,:) ) / ( e3v_n(:,:,1) * rau0 ) 
     522         CALL trd_dyn( ztrdu_fr(:,:,1), ztrdv_fr(:,:,1), jpdyn_iceoc, kt ) 
     523         ! 
     524         !                             ! wind stress trends in surface layer 
     525         ztrdu_fr(:,:,:) = 0._wp    ;   ztrdv_fr(:,:,:) = 0._wp 
     526         ztrdu_fr(:,:,1) = ( utau_b(:,:) + utau(:,:) ) / ( e3u_n(:,:,1) * rau0 ) 
     527         ztrdv_fr(:,:,1) = ( vtau_b(:,:) + vtau(:,:) ) / ( e3v_n(:,:,1) * rau0 ) 
     528         CALL trd_dyn( ztrdu_fr(:,:,1), ztrdv_fr(:,:,1), jpdyn_tau, kt ) 
     529         ! 
    518530         IF( ln_drgimp ) THEN 
     531            !                          ! trends due to implicit bottom friction 
    519532            ztrdu_fr(:,:,:) = 0._wp    ;   ztrdv_fr(:,:,:) = 0._wp 
    520533            DO jj = 2, jpjm1 
     
    529542            END DO 
    530543            CALL trd_dyn( ztrdu_fr, ztrdv_fr, jpdyn_bfri, kt ) 
     544            !                          ! trends due to implicit top friction 
    531545            IF( ln_isfcav.OR.ln_drgice_imp ) THEN    ! Ocean cavities (ISF) or implicit ice-ocean drag 
    532546               ztrdu_fr(:,:,:) = 0._wp    ;   ztrdv_fr(:,:,:) = 0._wp 
  • NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/TRD/trd_oce.F90

    r15176 r15179  
    5959   ! 
    6060   !                                                  !!!* Momentum trends indices 
    61    INTEGER, PUBLIC, PARAMETER ::   jptot_dyn  = 27     !: Total trend nb: change it when adding/removing one indice below 
     61   INTEGER, PUBLIC, PARAMETER ::   jptot_dyn  = 16     !: Total number of trends (excluding flags for internal processing)  
    6262   !                               ===============     !   
    6363   INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg   =  1     !: hydrostatic pressure gradient  
    64    INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg_save =  2  !: hydrostatic pressure gradient (saved value) 
    65    INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg_corr =  3  !: hydrostatic pressure gradient (initial correction) 
    66    INTEGER, PUBLIC, PARAMETER ::   jpdyn_spg   =  4     !: surface     pressure gradient 
    67    INTEGER, PUBLIC, PARAMETER ::   jpdyn_keg   =  5     !: kinetic energy gradient  or horizontal advection 
    68    INTEGER, PUBLIC, PARAMETER ::   jpdyn_rvo   =  6     !: relative  vorticity      or metric term 
    69    INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo   =  7     !: planetary vorticity 
    70    INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo_save =  8  !: planetary vorticity (saved value) 
    71    INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo_corr =  9  !: planetary vorticity (initial correction) 
    72    INTEGER, PUBLIC, PARAMETER ::   jpdyn_zad   = 10     !: vertical advection 
    73    INTEGER, PUBLIC, PARAMETER ::   jpdyn_ldf   = 11     !: horizontal diffusion    
    74    INTEGER, PUBLIC, PARAMETER ::   jpdyn_zdf   = 12     !: vertical   diffusion 
    75    INTEGER, PUBLIC, PARAMETER ::   jpdyn_frc2d = 13     !: constant forcing terms in depth-mean calculation 
    76    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau   = 14     !: wind stress excluding ice-ocean drag: surface trend 
    77    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau2d = 15     !: wind stress excluding ice-ocean drag: barotropic trend 
    78    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau2d_ice = 16 !: (partial) ice-ocean drag: barotropic trend 
    79    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfr   = 17     !: top friction (cavities and ice-ocean drag if ln_drgice_imp=T)  
    80    INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfr   = 18     !: bottom friction  
    81    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfre  = 19     !: explicit top friction for baroclinic trend (ln_drgimp=.FALSE.) 
    82    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfre_bt  = 20  !: top friction due to barotropic currents for baroclinic trend (ln_dynspg_ts=.TRUE.) 
    83    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfri  = 21     !: implicit top friction for baroclinic trend  
    84    INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfre  = 22     !: explicit bottom friction for baroclinic trend (ln_drgimp=.FALSE.) 
    85    INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfre_bt  = 23  !: bottom friction due to barotropic currents for baroclinic trend (ln_dynspg_ts=.TRUE.) 
    86    INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfri  = 24     !: implicit bottom friction for baroclinic trend (ln_drgimp=.TRUE.) 
    87    INTEGER, PUBLIC, PARAMETER ::   jpdyn_tot   = 25     !: Total trend excluding Asselin time filter 
    88    INTEGER, PUBLIC, PARAMETER ::   jpdyn_atf   = 26     !: Asselin time filter 
    89    INTEGER, PUBLIC, PARAMETER ::   jpdyn_ken   = 27     !: use for calculation of KE 
     64   INTEGER, PUBLIC, PARAMETER ::   jpdyn_spg   =  2     !: surface     pressure gradient 
     65   INTEGER, PUBLIC, PARAMETER ::   jpdyn_keg   =  3     !: kinetic energy gradient  or horizontal advection 
     66   INTEGER, PUBLIC, PARAMETER ::   jpdyn_rvo   =  4     !: relative  vorticity      or metric term 
     67   INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo   =  5     !: planetary vorticity 
     68   INTEGER, PUBLIC, PARAMETER ::   jpdyn_zad   =  6     !: vertical advection 
     69   INTEGER, PUBLIC, PARAMETER ::   jpdyn_ldf   =  7     !: horizontal diffusion    
     70   INTEGER, PUBLIC, PARAMETER ::   jpdyn_zdf   =  8     !: vertical   diffusion 
     71   INTEGER, PUBLIC, PARAMETER ::   jpdyn_frc2d =  9     !: constant forcing terms in depth-mean calculation 
     72   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau   = 10     !: wind stress excluding ice-ocean drag: surface trend 
     73   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tau2d = 11     !: wind stress excluding ice-ocean drag: barotropic trend 
     74   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfr   = 12     !: top friction (cavities and ice-ocean drag if ln_drgice_imp=T)  
     75   INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfr   = 13     !: bottom friction  
     76   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tot   = 14     !: Total trend excluding Asselin time filter 
     77   INTEGER, PUBLIC, PARAMETER ::   jpdyn_atf   = 15     !: Asselin time filter 
     78   INTEGER, PUBLIC, PARAMETER ::   jpdyn_ken   = 16     !: use for calculation of KE 
     79   !                               ================     !: FLAGS BELOW FOR INTERNAL PROCESSING ONLY 
     80   INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg_save = 17  !: hydrostatic pressure gradient (saved value) 
     81   INTEGER, PUBLIC, PARAMETER ::   jpdyn_hpg_corr = 18  !: hydrostatic pressure gradient (initial correction) 
     82   INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo_save = 19  !: planetary vorticity (saved value) 
     83   INTEGER, PUBLIC, PARAMETER ::   jpdyn_pvo_corr = 20  !: planetary vorticity (initial correction) 
     84   INTEGER, PUBLIC, PARAMETER ::   jpdyn_iceoc    = 21  !: (partial) ice-ocean drag: surface trend 
     85   INTEGER, PUBLIC, PARAMETER ::   jpdyn_iceoc2d  = 22  !: (partial) ice-ocean drag: barotropic trend 
     86   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfre     = 21  !: explicit top friction for baroclinic trend (ln_drgimp=.FALSE.) 
     87   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfre_bt  = 22  !: top friction due to barotropic currents for baroclinic trend (ln_dynspg_ts=.TRUE.) 
     88   INTEGER, PUBLIC, PARAMETER ::   jpdyn_tfri     = 23  !: implicit top friction for baroclinic trend  
     89   INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfre     = 24  !: explicit bottom friction for baroclinic trend (ln_drgimp=.FALSE.) 
     90   INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfre_bt  = 25  !: bottom friction due to barotropic currents for baroclinic trend (ln_dynspg_ts=.TRUE.) 
     91   INTEGER, PUBLIC, PARAMETER ::   jpdyn_bfri     = 26  !: implicit bottom friction for baroclinic trend (ln_drgimp=.TRUE.) 
    9092   ! 
    9193   !!---------------------------------------------------------------------- 
  • NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/TRD/trddyn.F90

    r15176 r15179  
    4444   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_tfr, zvtrd_tfr 
    4545   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_bfr, zvtrd_bfr 
     46   REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_iceoc, zvtrd_iceoc 
    4647   REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_tau2d, zvtrd_tau2d 
    47    REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_tau2d_ice, zvtrd_tau2d_ice 
     48   REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_iceoc2d, zvtrd_iceoc2d 
    4849   REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_tfr2d, zvtrd_tfr2d 
    4950   REAL(wp), ALLOCATABLE, DIMENSION(:,:)  , SAVE :: zutrd_bfr2d, zvtrd_bfr2d 
     
    162163 
    163164      CASE( jpdyn_zdf )  
    164          ! ZDF trend: Add explicit bottom friction if necessary. If ln_dynspg_ts, remove barotropic component  
     165         ! ZDF trend: Add explicit top/bottom friction if necessary. If ln_dynspg_ts, remove barotropic component  
    165166         !            and add wind stress, and top and bottom friction trends from dynspg_ts. 
    166167         ! 
    167168         ! If TFRE or BFRE arrays allocated at this stage then they will contain trends due 
    168169         ! to explicit top or bottom drag components which need to be added to the ZDF trend.  
    169          IF( ALLOCATED( zutrd_tfre ) )THEN 
     170         IF( ALLOCATED( zutrd_tfre ) ) THEN 
    170171            DO jk = 1, jpkm1 
    171172               putrd(:,:,jk) = ( putrd(:,:,jk) + zutrd_tfre(:,:,jk) ) * umask(:,:,jk) 
     
    174175            DEALLOCATE( zutrd_tfre, zvtrd_tfre ) 
    175176         ENDIF 
    176          IF( ALLOCATED( zutrd_bfre ) )THEN 
     177         IF( ALLOCATED( zutrd_bfre ) ) THEN 
    177178            DO jk = 1, jpkm1 
    178179               putrd(:,:,jk) = ( putrd(:,:,jk) + zutrd_bfre(:,:,jk) ) * umask(:,:,jk) 
     
    209210         ! removing any depth-mean component. 
    210211         IF( ALLOCATED( zutrd_tfr ) ) THEN 
     212            IF( ALLOCATED( zutrd_iceoc ) ) THEN 
     213               ! Add trend due to ice-ocean stress at the surface 
     214               zutrd_tfr(:,:,1) = zutrd_tfr(:,:,1) + zutrd_iceoc(:,:) 
     215               zvtrd_tfr(:,:,1) = zvtrd_tfr(:,:,1) + zvtrd_iceoc(:,:) 
     216               DEALLOCATE( zutrd_iceoc, zvtrd_iceoc ) 
     217            ENDIF 
    211218            ALLOCATE( zue(jpi,jpj), zve(jpi,jpj) ) 
    212219            zue(:,:) = e3u_a(:,:,1) * zutrd_tfr(:,:,1) * umask(:,:,1) 
     
    241248      END SELECT 
    242249 
    243       IF ( ktrd /= jpdyn_hpg_save .AND. ktrd /= jpdyn_pvo_save .AND. & 
    244      &     ktrd /= jpdyn_tfre     .AND. ktrd /= jpdyn_tfre_bt  .AND. & 
    245      &     ktrd /= jpdyn_tfri     .AND. ktrd /= jpdyn_bfre     .AND. & 
    246      &     ktrd /= jpdyn_bfre_bt  .AND. ktrd /= jpdyn_bfri ) THEN 
     250      IF ( ktrd <= jptot_dyn ) THEN  ! output of 3D trends and use for other diagnostics 
    247251         ! 
    248252         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     
    335339          DEALLOCATE( zutrd_pvo, zvtrd_pvo ) 
    336340 
    337       CASE( jpdyn_tau2d_ice ) 
    338           ! 
    339           ! Save 2D ice-ocean stress trend locally to be subtracted from 
    340           ! 2D wind stress trend and added to 2D top friction trend.  
    341           IF( .NOT. ALLOCATED(zutrd_tau2d_ice) ) ALLOCATE( zutrd_tau2d_ice(jpi,jpj), zvtrd_tau2d_ice(jpi,jpj) ) 
    342           zutrd_tau2d_ice(:,:) = putrd(:,:) 
    343           zvtrd_tau2d_ice(:,:) = pvtrd(:,:) 
     341      CASE( jpdyn_iceoc ) 
     342          ! 
     343          ! Save surface ice-ocean stress trend locally to be subtracted from 
     344          ! surface wind stress trend and added to 3D top friction trend.  
     345          IF( .NOT. ALLOCATED(zutrd_iceoc) ) ALLOCATE( zutrd_iceoc(jpi,jpj), zvtrd_iceoc(jpi,jpj) ) 
     346          zutrd_iceoc(:,:) = putrd(:,:) 
     347          zvtrd_iceoc(:,:) = pvtrd(:,:) 
     348 
     349      CASE( jpdyn_tau ) 
     350          ! 
     351          ! Subtract ice-ocean stress from surface wind forcing 
     352          IF( ALLOCATED(zutrd_iceoc) ) THEN 
     353             putrd(:,:) = putrd(:,:) - zutrd_iceoc(:,:)  
     354             pvtrd(:,:) = pvtrd(:,:) - zvtrd_iceoc(:,:)  
     355          ENDIF 
     356 
     357      CASE( jpdyn_iceoc2d ) 
     358          ! 
     359          ! Save 2D ice-ocean stress trend locally as the first installment of top friction. 
     360          ! Subtracted from 2D wind stress trend later.  
     361          IF( .NOT. ALLOCATED(zutrd_tfr2d) ) ALLOCATE( zutrd_tfr2d(jpi,jpj), zvtrd_tfr2d(jpi,jpj) ) 
     362          zutrd_tfr2d(:,:) = putrd(:,:) 
     363          zvtrd_tfr2d(:,:) = pvtrd(:,:) 
    344364 
    345365      CASE( jpdyn_tau2d ) 
    346366          ! 
    347           ! Save 2D wind forcing trend locally (to be added to ZDF trend) 
    348           ! and output as a trend in its own right. 
     367          ! Subtract ice-ocean stress from depth-mean trend due to wind forcing 
     368          ! and save to be added to ZDF trend later. Output as a trend in its own right (below). 
     369          ! Note at this stage, zutrd_tfr2d should only contain the contribution to top friction 
     370          ! from (partial) ice-ocean stress. 
    349371          ALLOCATE( zutrd_tau2d(jpi,jpj), zvtrd_tau2d(jpi,jpj) ) 
     372          IF( ALLOCATED(zutrd_tfr2d) ) THEN 
     373             putrd(:,:) = putrd(:,:) - zutrd_tfr2d(:,:)  
     374             pvtrd(:,:) = pvtrd(:,:) - zvtrd_tfr2d(:,:)  
     375          ENDIF 
    350376          zutrd_tau2d(:,:) = putrd(:,:) 
    351377          zvtrd_tau2d(:,:) = pvtrd(:,:) 
    352           IF( ALLOCATED(zutrd_tau2d_ice) ) THEN 
    353              zutrd_tau2d(:,:) = zutrd_tau2d(:,:) - zutrd_tau2d_ice(:,:)  
    354              zvtrd_tau2d(:,:) = zvtrd_tau2d(:,:) - zvtrd_tau2d_ice(:,:)  
     378 
     379      CASE( jpdyn_tfr ) 
     380          ! 
     381          ! Add ice-ocean stress from depth-mean trend due to top friction 
     382          ! and save to be added to ZDF trend later. Output as a trend in its own right (below). 
     383          IF( .NOT. ALLOCATED(zutrd_tfr2d) ) THEN 
     384             ALLOCATE( zutrd_tfr2d(jpi,jpj), zvtrd_tfr2d(jpi,jpj) ) 
     385             zutrd_tfr2d(:,:) = 0._wp ; zvtrd_tfr2d(:,:) = 0._wp  
    355386          ENDIF 
    356  
    357       CASE( jpdyn_tfr ) 
    358           ! 
    359           ! Save 2D field to add to ZDF trend (and also output 2D field as diagnostic in own right below). 
    360           ALLOCATE( zutrd_tfr2d(jpi,jpj), zvtrd_tfr2d(jpi,jpj) ) 
    361           zutrd_tfr2d(:,:) = putrd(:,:) 
    362           zvtrd_tfr2d(:,:) = pvtrd(:,:) 
    363           IF( ALLOCATED(zutrd_tau2d_ice) ) THEN 
    364              zutrd_tfr2d(:,:) = zutrd_tfr2d(:,:) + zutrd_tau2d_ice(:,:)  
    365              zvtrd_tfr2d(:,:) = zvtrd_tfr2d(:,:) + zvtrd_tau2d_ice(:,:)  
    366           ENDIF 
     387          zutrd_tfr2d(:,:) = zutrd_tfr2d(:,:) + putrd(:,:) 
     388          zvtrd_tfr2d(:,:) = zvtrd_tfr2d(:,:) + pvtrd(:,:) 
     389          ! update (putrd,pvtrd) so that total tfr2d trend is output by call to trd_dyn_iom_2d 
     390          putrd(:,:) = zutrd_tfr2d(:,:) 
     391          pvtrd(:,:) = zvtrd_tfr2d(:,:) 
    367392 
    368393      CASE( jpdyn_bfr ) 
    369394          ! 
    370           ! Create 3D BFR trend from 2D field and also output 2D field as diagnostic in own right. 
     395          !  Save 2D field to add to ZDF trend  and also output 2D field as diagnostic in own right (below). 
    371396          ALLOCATE( zutrd_bfr2d(jpi,jpj), zvtrd_bfr2d(jpi,jpj) ) 
    372397          zutrd_bfr2d(:,:) = putrd(:,:) 
     
    375400      END SELECT 
    376401 
    377       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    378       !   2D output of momentum and/or tracers trends using IOM interface 
    379       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    380       IF( ln_dyn_trd )   CALL trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 
     402      IF( ktrd <= jptot_dyn ) THEN ! output of 2D trends and use for other diagnostics 
     403 
     404         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     405         !   2D output of momentum and/or tracers trends using IOM interface 
     406         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     407         IF( ln_dyn_trd )   CALL trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 
    381408          
    382  
    383409!!$   CALLS TO THESE ROUTINES FOR 2D DIAGOSTICS NOT CODED YET 
    384 !!$      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    385 !!$      !  Integral Constraints Properties for momentum and/or tracers trends 
    386 !!$      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    387 !!$      IF( ln_glo_trd )   CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 
     410!!$         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     411!!$         !  Integral Constraints Properties for momentum and/or tracers trends 
     412!!$         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     413!!$         IF( ln_glo_trd )   CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 
    388414!!$ 
    389 !!$      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    390 !!$      !  Kinetic Energy trends 
    391 !!$      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    392 !!$      IF( ln_KE_trd  )   CALL trd_ken( putrd, pvtrd, ktrd, kt ) 
     415!!$         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     416!!$         !  Kinetic Energy trends 
     417!!$         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     418!!$         IF( ln_KE_trd  )   CALL trd_ken( putrd, pvtrd, ktrd, kt ) 
    393419!!$ 
    394 !!$      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    395 !!$      !  Vorticity trends 
    396 !!$      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    397 !!$      IF( ln_vor_trd )   CALL trd_vor( putrd, pvtrd, ktrd, kt ) 
    398  
    399       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    400       !  Mixed layer trends for active tracers 
    401       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    402 !!gm      IF( ln_dyn_mxl )   CALL trd_mxl_dyn    
     420!!$         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     421!!$         !  Vorticity trends 
     422!!$         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     423!!$         IF( ln_vor_trd )   CALL trd_vor( putrd, pvtrd, ktrd, kt ) 
     424!!$ 
     425!!$         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     426!!$         !  Mixed layer trends for active tracers 
     427!!$         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     428!!$         IF( ln_dyn_mxl )   CALL trd_mxl_dyn    
     429 
     430      ENDIF 
    403431      ! 
    404432   END SUBROUTINE trd_dyn_2d 
     
    451479      CASE( jpdyn_zdf )   ;   CALL iom_put( "utrd_zdf", putrd )    ! vertical diffusion  
    452480                              CALL iom_put( "vtrd_zdf", pvtrd ) 
    453                               ! 
    454                               !                                    ! wind stress trends in surface layer 
    455                               ALLOCATE( z2dx(jpi,jpj) , z2dy(jpi,jpj) ) 
    456                               z2dx(:,:) = ( utau_b(:,:) + utau(:,:) ) / ( e3u_n(:,:,1) * rau0 ) 
    457                               z2dy(:,:) = ( vtau_b(:,:) + vtau(:,:) ) / ( e3v_n(:,:,1) * rau0 ) 
    458                               CALL iom_put( "utrd_tau", z2dx ) 
    459                               CALL iom_put( "vtrd_tau", z2dy ) 
    460                               DEALLOCATE( z2dx , z2dy ) 
    461481      CASE( jpdyn_bfr )   ;   CALL iom_put( "utrd_bfr", putrd )    ! bottom friction for bottom layer 
    462482                              CALL iom_put( "vtrd_bfr", pvtrd ) 
     
    493513      CASE( jpdyn_pvo )      ;   CALL iom_put( "utrd_pvo2d", putrd )      ! planetary vorticity (barotropic part) 
    494514                                 CALL iom_put( "vtrd_pvo2d", pvtrd ) 
    495       CASE( jpdyn_hpg_corr ) ;   CALL iom_put( "utrd_hpg_corr", putrd )   ! horizontal pressure gradient correction 
    496                                  CALL iom_put( "vtrd_hpg_corr", pvtrd ) 
    497       CASE( jpdyn_pvo_corr ) ;   CALL iom_put( "utrd_pvo_corr", putrd )   ! planetary vorticity correction 
    498                                  CALL iom_put( "vtrd_pvo_corr", pvtrd ) 
    499515      CASE( jpdyn_frc2d )    ;   CALL iom_put( "utrd_frc2d", putrd )      ! constant forcing term from barotropic calcn. 
    500516                                 CALL iom_put( "vtrd_frc2d", pvtrd )  
     517      CASE( jpdyn_tau )      ;   CALL iom_put( "utrd_tau", putrd )        ! surface wind stress trend 
     518                                 CALL iom_put( "vtrd_tau", pvtrd ) 
    501519      CASE( jpdyn_tau2d )    ;   CALL iom_put( "utrd_tau2d", putrd )      ! wind stress depth-mean trend 
    502520                                 CALL iom_put( "vtrd_tau2d", pvtrd ) 
Note: See TracChangeset for help on using the changeset viewer.