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 10810 – NEMO

Changeset 10810


Ignore:
Timestamp:
2019-03-29T09:43:38+01:00 (5 years ago)
Author:
davestorkey
Message:

UKMO/dev_r10037_vorticity_trends branch: commit code changes.

Location:
NEMO/branches/UKMO/dev_r10037_vorticity_trends
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/cfgs/SHARED/domain_def_nemo.xml

    r9930 r10810  
    168168     <domain id="EqU" domain_ref="grid_U" > <zoom_domain id="EqU"/> </domain> 
    169169 
    170        
    171170     <!--   V grid   --> 
    172171     <domain id="grid_V" long_name="grid V"/> 
    173172     <!--   Eq section : no V point on the Equator...   --> 
    174173 
    175       
     174     <!--   F grid   --> 
     175     <domain id="grid_F" long_name="grid F"/> 
     176 
    176177     <!--   W grid   --> 
    177178     <domain id="grid_W" long_name="grid W"/> 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/cfgs/SHARED/field_def_nemo-oce.xml

    r10011 r10810  
    792792     <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />    
    793793     <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />    
     794 
     795   </field_group> 
     796 
     797   <field_group id="trdvor" grid_ref="grid_F_2D"> 
     798     <!-- variables available with ln_dyn_vor --> 
     799     <field id="vort_prg_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     800     <field id="vort_keg_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     801     <field id="vort_rvo_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     802     <field id="vort_pvo_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     803     <field id="vort_ldf_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     804     <field id="vort_zad_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     805     <field id="vort_zdf_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     806     <field id="vort_spg_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     807     <field id="vort_swf_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     808     <field id="vort_bfr_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     809     <field id="vort_prg_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     810     <field id="vort_keg_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     811     <field id="vort_rvo_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     812     <field id="vort_pvo_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     813     <field id="vort_ldf_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     814     <field id="vort_zad_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     815     <field id="vort_zdf_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     816     <field id="vort_spg_int"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     817<!--     <field id="vort_swf_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> 
     818         <field id="vort_bfr_avg"       long_name="curl(vertical avg) vort trend: internal pressure gradient"          unit="m/s^2" /> --> 
    794819   </field_group> 
    795820 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/cfgs/SHARED/grid_def_nemo.xml

    r9930 r10810  
    3535       </grid> 
    3636        <!--  --> 
     37       <grid id="grid_F_2D" > 
     38         <domain id="grid_F" /> 
     39       </grid> 
     40        <!--  --> 
    3741       <grid id="grid_W_2D" > 
    3842         <domain id="grid_W" /> 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/src/OCE/IOM/iom.F90

    r10032 r10810  
    153153         CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) 
    154154         CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. ) 
     155         CALL set_grid( "F", glamf, gphif, .FALSE., .FALSE. ) 
    155156         CALL set_grid( "W", glamt, gphit, .FALSE., .FALSE. ) 
    156157         CALL set_grid_znl( gphit ) 
     
    160161            CALL iom_set_domain_attr("grid_U", area = e1e2u(nldi:nlei, nldj:nlej)) 
    161162            CALL iom_set_domain_attr("grid_V", area = e1e2v(nldi:nlei, nldj:nlej)) 
     163            CALL iom_set_domain_attr("grid_F", area = e1e2f(nldi:nlei, nldj:nlej)) 
    162164            CALL iom_set_domain_attr("grid_W", area = e1e2t(nldi:nlei, nldj:nlej)) 
    163165            CALL set_grid_bounds( "T", glamf, gphif, glamt, gphit ) 
    164166            CALL set_grid_bounds( "U", glamv, gphiv, glamu, gphiu ) 
    165167            CALL set_grid_bounds( "V", glamu, gphiu, glamv, gphiv ) 
     168            CALL set_grid_bounds( "F", glamt, gphit, glamf, gphif ) 
    166169            CALL set_grid_bounds( "W", glamf, gphif, glamt, gphit ) 
    167170         ENDIF 
     
    174177         CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. )  
    175178         CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. )  
     179         CALL set_grid( "F", glamf_crs, gphif_crs, .FALSE., .FALSE. )  
    176180         CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. )  
    177181         CALL set_grid_znl( gphit_crs ) 
     
    183187            CALL iom_set_domain_attr("grid_U", area = e1u_crs(nldi:nlei, nldj:nlej) * e2u_crs(nldi:nlei, nldj:nlej)) 
    184188            CALL iom_set_domain_attr("grid_V", area = e1v_crs(nldi:nlei, nldj:nlej) * e2v_crs(nldi:nlei, nldj:nlej)) 
     189            CALL iom_set_domain_attr("grid_F", area = e1f_crs(nldi:nlei, nldj:nlej) * e2f_crs(nldi:nlei, nldj:nlej)) 
    185190            CALL iom_set_domain_attr("grid_W", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 
    186191            CALL set_grid_bounds( "T", glamf_crs, gphif_crs, glamt_crs, gphit_crs ) 
    187192            CALL set_grid_bounds( "U", glamv_crs, gphiv_crs, glamu_crs, gphiu_crs ) 
    188193            CALL set_grid_bounds( "V", glamu_crs, gphiu_crs, glamv_crs, gphiv_crs ) 
     194            CALL set_grid_bounds( "F", glamt_crs, gphit_crs, glamf_crs, gphif_crs ) 
    189195            CALL set_grid_bounds( "W", glamf_crs, gphif_crs, glamt_crs, gphit_crs ) 
    190196         ENDIF 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/src/OCE/TRD/trdini.F90

    r9950 r10810  
    8787 
    8888!!gm end 
    89       IF( ln_tra_mxl .OR. ln_vor_trd )   CALL ctl_stop( 'ML tracer and Barotropic vorticity diags are still using old IOIPSL' ) 
     89!!$      IF( ln_tra_mxl .OR. ln_vor_trd )   CALL ctl_stop( 'ML tracer and Barotropic vorticity diags are still using old IOIPSL' ) 
    9090!!gm end 
    9191      ! 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/src/OCE/TRD/trdvor.F90

    r9950 r10810  
    2525   ! 
    2626   USE in_out_manager  ! I/O manager 
    27    USE ioipsl          ! NetCDF library 
     27   USE iom             ! I/O 
    2828   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2929   USE lib_mpp         ! MPP library 
     
    5151   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrtot   ! 
    5252   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrres   ! 
    53    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   vortrd       ! curl of trends 
     53   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:,:) ::   vortrd       ! curl of trends 
    5454          
    5555   CHARACTER(len=12) ::   cvort 
     
    7070      ALLOCATE( vor_avr   (jpi,jpj) , vor_avrb(jpi,jpj) , vor_avrbb (jpi,jpj) ,   & 
    7171         &      vor_avrbn (jpi,jpj) , rotot   (jpi,jpj) , vor_avrtot(jpi,jpj) ,   & 
    72          &      vor_avrres(jpi,jpj) , vortrd  (jpi,jpj,jpltot_vor) ,              & 
     72         &      vor_avrres(jpi,jpj) , vortrd  (jpi,jpj,jpltot_vor,jpltype_vor) ,   & 
    7373         &      ndexvor1  (jpi*jpj)                                ,   STAT= trd_vor_alloc ) 
    7474         ! 
     
    193193      DO ji = 1, jpim1 
    194194         DO jj = 1, jpjm1 
    195             vortrd(ji,jj,ktrd) = (    zvdpvor(ji+1,jj) - zvdpvor(ji,jj)       & 
    196                  &                - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) )   ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
     195            vortrd(ji,jj,ktrd,jptype_vor_avg) = (    zvdpvor(ji+1,jj) - zvdpvor(ji,jj)       & 
     196                 &                               - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) )   ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
    197197         END DO 
    198198      END DO 
    199       vortrd(:,:,ktrd) = vortrd(:,:,ktrd) * fmask(:,:,1)      ! Surface mask 
     199      vortrd(:,:,ktrd,jptype_vor_avg) = vortrd(:,:,ktrd,jptype_vor_avg) * fmask(:,:,1)      ! Surface mask 
    200200 
    201201      IF( ndebug /= 0 ) THEN 
     
    217217      !! 
    218218      !! ** Action :     trends : 
    219       !!                  vortrd (,,1) = Pressure Gradient Trend 
    220       !!                  vortrd (,,2) = KE Gradient Trend 
    221       !!                  vortrd (,,3) = Relative Vorticity Trend 
    222       !!                  vortrd (,,4) = Coriolis Term Trend 
    223       !!                  vortrd (,,5) = Horizontal Diffusion Trend 
    224       !!                  vortrd (,,6) = Vertical Advection Trend 
    225       !!                  vortrd (,,7) = Vertical Diffusion Trend 
    226       !!                  vortrd (,,8) = Surface Pressure Grad. Trend 
    227       !!                  vortrd (,,9) = Beta V 
    228       !!                  vortrd (,,10) = forcing term 
    229       !!      vortrd (,,11) = bottom friction term 
     219      !!                  vortrd (,,1,) = Pressure Gradient Trend 
     220      !!                  vortrd (,,2,) = KE Gradient Trend 
     221      !!                  vortrd (,,3,) = Relative Vorticity Trend 
     222      !!                  vortrd (,,4,) = Coriolis Term Trend 
     223      !!                  vortrd (,,5,) = Horizontal Diffusion Trend 
     224      !!                  vortrd (,,6,) = Vertical Advection Trend 
     225      !!                  vortrd (,,7,) = Vertical Diffusion Trend 
     226      !!                  vortrd (,,8,) = Surface Pressure Grad. Trend 
     227      !!                  vortrd (,,9,) = forcing term 
     228      !!      vortrd (,,10,) = bottom friction term 
    230229      !!                  rotot(,) : total cumulative trends over nwrite-1 time steps 
    231230      !!                  vor_avrtot(,) : first membre of vrticity equation 
     
    240239      ! 
    241240      INTEGER ::   ji, jj, jk   ! dummy loop indices 
    242       REAL(wp), DIMENSION(jpi,jpj) :: zubet  , zvbet    ! Beta.V    
    243241      REAL(wp), DIMENSION(jpi,jpj) :: zudpvor, zvdpvor  ! total cmulative trends 
    244242      !!---------------------------------------------------------------------- 
    245243      
    246244      ! Initialization 
    247       zubet  (:,:) = 0._wp 
    248       zvbet  (:,:) = 0._wp 
    249245      zudpvor(:,:) = 0._wp 
    250246      zvdpvor(:,:) = 0._wp 
     
    261257      END DO 
    262258 
    263       ! Planetary vorticity: 2nd computation (Beta.V term) store the vertical sum 
    264       ! as Beta.V term need intergration, not average 
    265       IF( ktrd == jpvor_pvo ) THEN  
    266          zubet(:,:) = zudpvor(:,:) 
    267          zvbet(:,:) = zvdpvor(:,:) 
    268          DO ji = 1, jpim1 
    269             DO jj = 1, jpjm1 
    270                vortrd(ji,jj,jpvor_bev) = (    zvbet(ji+1,jj) - zvbet(ji,jj)     & 
    271                   &                       - ( zubet(ji,jj+1) - zubet(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
    272             END DO 
     259      ! Curl(vertical integral)/H diagnostics: 
     260      ! Curl: 
     261      DO ji = 1, jpim1 
     262         DO jj = 1, jpjm1 
     263            vortrd(ji,jj,ktrd,jptype_vor_int) = (    zvdpvor(ji+1,jj) - zvdpvor(ji,jj)     & 
     264               &                                 - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
    273265         END DO 
    274          ! Average of the Curl and Surface mask 
    275          vortrd(:,:,jpvor_bev) = vortrd(:,:,jpvor_bev) * r1_hu_n(:,:) * fmask(:,:,1) 
    276       ENDIF 
    277       ! 
    278       ! Average  
     266      END DO 
     267      ! Average of the Curl and Surface mask: 
     268      vortrd(:,:,ktrd,jptype_vor_int) = vortrd(:,:,ktrd,jptype_vor_int) * r1_hu_n(:,:) * fmask(:,:,1) 
     269      ! 
     270      ! Curl(vertical mean) diagnostics: 
     271      ! Average: 
    279272      zudpvor(:,:) = zudpvor(:,:) * r1_hu_n(:,:) 
    280273      zvdpvor(:,:) = zvdpvor(:,:) * r1_hv_n(:,:) 
    281274      ! 
    282       ! Curl 
     275      ! Curl: 
    283276      DO ji=1,jpim1 
    284277         DO jj=1,jpjm1 
    285             vortrd(ji,jj,ktrd) = (    zvdpvor(ji+1,jj) - zvdpvor(ji,jj)     & 
    286                &                  - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
     278            vortrd(ji,jj,ktrd,jptype_vor_avg) = (    zvdpvor(ji+1,jj) - zvdpvor(ji,jj)     & 
     279               &                                 - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 
    287280         END DO 
    288281      END DO 
    289       ! Surface mask 
    290       vortrd(:,:,ktrd) = vortrd(:,:,ktrd) * fmask(:,:,1) 
     282      ! Surface mask: 
     283      vortrd(:,:,ktrd,jptype_vor_avg) = vortrd(:,:,ktrd,jptype_vor_avg) * fmask(:,:,1) 
    291284    
    292285      IF( ndebug /= 0 ) THEN 
     
    318311      
    319312      
    320       ! I.1 set before values of vertically average u and v 
    321       ! --------------------------------------------------- 
    322  
    323       IF( kt > nit000 )   vor_avrb(:,:) = vor_avr(:,:) 
    324  
    325       ! I.2 vertically integrated vorticity 
    326       !  ---------------------------------- 
    327  
    328       vor_avr   (:,:) = 0._wp 
    329       zun       (:,:) = 0._wp 
    330       zvn       (:,:) = 0._wp 
    331       vor_avrtot(:,:) = 0._wp 
    332       vor_avrres(:,:) = 0._wp 
    333        
    334       ! Vertically averaged velocity 
    335       DO jk = 1, jpk - 1 
    336          zun(:,:) = zun(:,:) + e1u(:,:) * un(:,:,jk) * e3u_n(:,:,jk) 
    337          zvn(:,:) = zvn(:,:) + e2v(:,:) * vn(:,:,jk) * e3v_n(:,:,jk) 
    338       END DO 
    339   
    340       zun(:,:) = zun(:,:) * r1_hu_n(:,:) 
    341       zvn(:,:) = zvn(:,:) * r1_hv_n(:,:) 
    342  
    343       ! Curl 
    344       DO ji = 1, jpim1 
    345          DO jj = 1, jpjm1 
    346             vor_avr(ji,jj) = (  ( zvn(ji+1,jj) - zvn(ji,jj) )    & 
    347                &              - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) 
    348          END DO 
    349       END DO 
    350        
    351       !  ================================= 
    352       !   II. Cumulated trends 
    353       !  ================================= 
    354  
    355       ! II.1 set `before' mixed layer values for kt = nit000+1 
    356       ! ------------------------------------------------------ 
    357       IF( kt == nit000+1 ) THEN 
    358          vor_avrbb(:,:) = vor_avrb(:,:) 
    359          vor_avrbn(:,:) = vor_avr (:,:) 
    360       ENDIF 
    361  
    362       ! II.2 cumulated trends over analysis period (kt=2 to nwrite) 
    363       ! ---------------------- 
    364       ! trends cumulated over nwrite-2 time steps 
    365  
    366       IF( kt >= nit000+2 ) THEN 
    367          nmoydpvor = nmoydpvor + 1 
    368          DO jl = 1, jpltot_vor 
    369             IF( jl /= 9 ) THEN 
    370                rotot(:,:) = rotot(:,:) + vortrd(:,:,jl) 
    371             ENDIF 
    372          END DO 
    373       ENDIF 
    374  
    375       !  ============================================= 
    376       !   III. Output in netCDF + residual computation 
    377       !  ============================================= 
    378  
    379       ! define time axis 
    380       it    = kt 
    381       itmod = kt - nit000 + 1 
    382  
    383       IF( MOD( it, nn_trd ) == 0 ) THEN 
    384  
    385          ! III.1 compute total trend 
    386          ! ------------------------ 
    387          zmean = 1._wp / (  REAL( nmoydpvor, wp ) * 2._wp * rdt  ) 
    388          vor_avrtot(:,:) = (  vor_avr(:,:) - vor_avrbn(:,:) + vor_avrb(:,:) - vor_avrbb(:,:) ) * zmean 
    389  
    390  
    391          ! III.2 compute residual 
    392          ! --------------------- 
    393          zmean = 1._wp / REAL( nmoydpvor, wp ) 
    394          vor_avrres(:,:) = vor_avrtot(:,:) - rotot(:,:) / zmean 
    395  
    396          ! Boundary conditions 
    397          CALL lbc_lnk_multi( vor_avrtot, 'F', 1. , vor_avrres, 'F', 1. ) 
    398  
    399  
    400          ! III.3 time evolution array swap 
    401          ! ------------------------------ 
    402          vor_avrbb(:,:) = vor_avrb(:,:) 
    403          vor_avrbn(:,:) = vor_avr (:,:) 
    404          ! 
    405          nmoydpvor = 0 
    406          ! 
    407       ENDIF 
     313!!$      ! I.1 set before values of vertically average u and v 
     314!!$      ! --------------------------------------------------- 
     315!!$ 
     316!!$      IF( kt > nit000 )   vor_avrb(:,:) = vor_avr(:,:) 
     317!!$ 
     318!!$      ! I.2 vertically integrated vorticity 
     319!!$      !  ---------------------------------- 
     320!!$ 
     321!!$      vor_avr   (:,:) = 0._wp 
     322!!$      zun       (:,:) = 0._wp 
     323!!$      zvn       (:,:) = 0._wp 
     324!!$      vor_avrtot(:,:) = 0._wp 
     325!!$      vor_avrres(:,:) = 0._wp 
     326!!$       
     327!!$      ! Vertically averaged velocity 
     328!!$      DO jk = 1, jpk - 1 
     329!!$         zun(:,:) = zun(:,:) + e1u(:,:) * un(:,:,jk) * e3u_n(:,:,jk) 
     330!!$         zvn(:,:) = zvn(:,:) + e2v(:,:) * vn(:,:,jk) * e3v_n(:,:,jk) 
     331!!$      END DO 
     332!!$  
     333!!$      zun(:,:) = zun(:,:) * r1_hu_n(:,:) 
     334!!$      zvn(:,:) = zvn(:,:) * r1_hv_n(:,:) 
     335!!$ 
     336!!$      ! Curl 
     337!!$      DO ji = 1, jpim1 
     338!!$         DO jj = 1, jpjm1 
     339!!$            vor_avr(ji,jj) = (  ( zvn(ji+1,jj) - zvn(ji,jj) )    & 
     340!!$               &              - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) 
     341!!$         END DO 
     342!!$      END DO 
     343!!$       
     344!!$      !  ================================= 
     345!!$      !   II. Cumulated trends 
     346!!$      !  ================================= 
     347!!$ 
     348!!$      ! II.1 set `before' mixed layer values for kt = nit000+1 
     349!!$      ! ------------------------------------------------------ 
     350!!$      IF( kt == nit000+1 ) THEN 
     351!!$         vor_avrbb(:,:) = vor_avrb(:,:) 
     352!!$         vor_avrbn(:,:) = vor_avr (:,:) 
     353!!$      ENDIF 
     354!!$ 
     355!!$      ! II.2 cumulated trends over analysis period (kt=2 to nwrite) 
     356!!$      ! ---------------------- 
     357!!$      ! trends cumulated over nwrite-2 time steps 
     358!!$ 
     359!!$      IF( kt >= nit000+2 ) THEN 
     360!!$         nmoydpvor = nmoydpvor + 1 
     361!!$         DO jl = 1, jpltot_vor 
     362!!$            IF( jl /= 9 ) THEN 
     363!!$               rotot(:,:) = rotot(:,:) + vortrd(:,:,jl) 
     364!!$            ENDIF 
     365!!$         END DO 
     366!!$      ENDIF 
     367!!$ 
     368!!$      !  ============================================= 
     369!!$      !   III. Output in netCDF + residual computation 
     370!!$      !  ============================================= 
     371!!$ 
     372!!$      ! define time axis 
     373!!$      it    = kt 
     374!!$      itmod = kt - nit000 + 1 
     375!!$ 
     376!!$      IF( MOD( it, nn_trd ) == 0 ) THEN 
     377!!$ 
     378!!$         ! III.1 compute total trend 
     379!!$         ! ------------------------ 
     380!!$         zmean = 1._wp / (  REAL( nmoydpvor, wp ) * 2._wp * rdt  ) 
     381!!$         vor_avrtot(:,:) = (  vor_avr(:,:) - vor_avrbn(:,:) + vor_avrb(:,:) - vor_avrbb(:,:) ) * zmean 
     382!!$ 
     383!!$ 
     384!!$         ! III.2 compute residual 
     385!!$         ! --------------------- 
     386!!$         zmean = 1._wp / REAL( nmoydpvor, wp ) 
     387!!$         vor_avrres(:,:) = vor_avrtot(:,:) - rotot(:,:) / zmean 
     388!!$ 
     389!!$         ! Boundary conditions 
     390!!$         CALL lbc_lnk_multi( vor_avrtot, 'F', 1. , vor_avrres, 'F', 1. ) 
     391!!$ 
     392!!$ 
     393!!$         ! III.3 time evolution array swap 
     394!!$         ! ------------------------------ 
     395!!$         vor_avrbb(:,:) = vor_avrb(:,:) 
     396!!$         vor_avrbn(:,:) = vor_avr (:,:) 
     397!!$         ! 
     398!!$         nmoydpvor = 0 
     399!!$         ! 
     400!!$      ENDIF 
    408401 
    409402      ! III.4 write trends to output 
     
    412405      IF( kt >=  nit000+1 ) THEN 
    413406 
    414          IF( lwp .AND. MOD( itmod, nn_trd ) == 0 ) THEN 
    415             WRITE(numout,*) '' 
    416             WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt 
    417             WRITE(numout,*) '~~~~~~~  ' 
    418          ENDIF 
    419   
    420          CALL histwrite( nidvor,"sovortPh",it,vortrd(:,:,jpvor_prg),ndimvor1,ndexvor1)  ! grad Ph 
    421          CALL histwrite( nidvor,"sovortEk",it,vortrd(:,:,jpvor_keg),ndimvor1,ndexvor1)  ! Energy 
    422          CALL histwrite( nidvor,"sovozeta",it,vortrd(:,:,jpvor_rvo),ndimvor1,ndexvor1)  ! rel vorticity 
    423          CALL histwrite( nidvor,"sovortif",it,vortrd(:,:,jpvor_pvo),ndimvor1,ndexvor1)  ! coriolis 
    424          CALL histwrite( nidvor,"sovodifl",it,vortrd(:,:,jpvor_ldf),ndimvor1,ndexvor1)  ! lat diff 
    425          CALL histwrite( nidvor,"sovoadvv",it,vortrd(:,:,jpvor_zad),ndimvor1,ndexvor1)  ! vert adv 
    426          CALL histwrite( nidvor,"sovodifv",it,vortrd(:,:,jpvor_zdf),ndimvor1,ndexvor1)  ! vert diff 
    427          CALL histwrite( nidvor,"sovortPs",it,vortrd(:,:,jpvor_spg),ndimvor1,ndexvor1)  ! grad Ps 
    428          CALL histwrite( nidvor,"sovortbv",it,vortrd(:,:,jpvor_bev),ndimvor1,ndexvor1)  ! beta.V 
    429          CALL histwrite( nidvor,"sovowind",it,vortrd(:,:,jpvor_swf),ndimvor1,ndexvor1) ! wind stress 
    430          CALL histwrite( nidvor,"sovobfri",it,vortrd(:,:,jpvor_bfr),ndimvor1,ndexvor1) ! bottom friction 
    431          CALL histwrite( nidvor,"1st_mbre",it,vor_avrtot    ,ndimvor1,ndexvor1) ! First membre 
    432          CALL histwrite( nidvor,"sovorgap",it,vor_avrres    ,ndimvor1,ndexvor1) ! gap between 1st and 2 nd mbre 
    433          ! 
    434          IF( ndebug /= 0 ) THEN 
    435             WRITE(numout,*) ' debuging trd_vor: III.4 done' 
    436             CALL FLUSH(numout) 
    437          ENDIF 
     407         IF( iom_use("vort_prg_avg") ) CALL iom_put("vort_prg_avg",vortrd(:,:,jpvor_prg,jptype_vor_avg)) 
     408         IF( iom_use("vort_keg_avg") ) CALL iom_put("vort_keg_avg",vortrd(:,:,jpvor_keg,jptype_vor_avg)) 
     409         IF( iom_use("vort_rvo_avg") ) CALL iom_put("vort_rvo_avg",vortrd(:,:,jpvor_rvo,jptype_vor_avg)) 
     410         IF( iom_use("vort_pvo_avg") ) CALL iom_put("vort_pvo_avg",vortrd(:,:,jpvor_pvo,jptype_vor_avg)) 
     411         IF( iom_use("vort_ldf_avg") ) CALL iom_put("vort_ldf_avg",vortrd(:,:,jpvor_ldf,jptype_vor_avg)) 
     412         IF( iom_use("vort_zad_avg") ) CALL iom_put("vort_zad_avg",vortrd(:,:,jpvor_zad,jptype_vor_avg)) 
     413         IF( iom_use("vort_zdf_avg") ) CALL iom_put("vort_zdf_avg",vortrd(:,:,jpvor_zdf,jptype_vor_avg)) 
     414         IF( iom_use("vort_spg_avg") ) CALL iom_put("vort_spg_avg",vortrd(:,:,jpvor_spg,jptype_vor_avg)) 
     415         IF( iom_use("vort_swf_avg") ) CALL iom_put("vort_swf_avg",vortrd(:,:,jpvor_swf,jptype_vor_avg)) 
     416         IF( iom_use("vort_bfr_avg") ) CALL iom_put("vort_bfr_avg",vortrd(:,:,jpvor_bfr,jptype_vor_avg)) 
     417 
     418         IF( iom_use("vort_prg_int") ) CALL iom_put("vort_prg_int",vortrd(:,:,jpvor_prg,jptype_vor_int)) 
     419         IF( iom_use("vort_keg_int") ) CALL iom_put("vort_keg_int",vortrd(:,:,jpvor_keg,jptype_vor_int)) 
     420         IF( iom_use("vort_rvo_int") ) CALL iom_put("vort_rvo_int",vortrd(:,:,jpvor_rvo,jptype_vor_int)) 
     421         IF( iom_use("vort_pvo_int") ) CALL iom_put("vort_pvo_int",vortrd(:,:,jpvor_pvo,jptype_vor_int)) 
     422         IF( iom_use("vort_ldf_int") ) CALL iom_put("vort_ldf_int",vortrd(:,:,jpvor_ldf,jptype_vor_int)) 
     423         IF( iom_use("vort_zad_int") ) CALL iom_put("vort_zad_int",vortrd(:,:,jpvor_zad,jptype_vor_int)) 
     424         IF( iom_use("vort_zdf_int") ) CALL iom_put("vort_zdf_int",vortrd(:,:,jpvor_zdf,jptype_vor_int)) 
     425         IF( iom_use("vort_spg_int") ) CALL iom_put("vort_spg_int",vortrd(:,:,jpvor_spg,jptype_vor_int)) 
     426!!$         IF( iom_use("vort_swf_int") ) CALL iom_put("vort_swf_int",vortrd(:,:,jpvor_prg,jptype_vor_int)) 
     427!!$         IF( iom_use("vort_bfr_int") ) CALL iom_put("vort_bfr_int",vortrd(:,:,jpvor_prg,jptype_vor_int)) 
    438428         ! 
    439429      ENDIF 
    440430      ! 
    441       IF( MOD( it, nn_trd ) == 0 ) rotot(:,:)=0 
    442       ! 
    443       IF( kt == nitend )   CALL histclo( nidvor ) 
     431!!$      IF( MOD( it, nn_trd ) == 0 ) rotot(:,:)=0 
    444432      ! 
    445433   END SUBROUTINE trd_vor_iom 
     
    452440      !! ** Purpose :   computation of vertically integrated T and S budgets 
    453441      !!      from ocean surface down to control surface (NetCDF output) 
    454       !!---------------------------------------------------------------------- 
    455       REAL(wp) ::   zjulian, zsto, zout 
    456       CHARACTER (len=40) ::   clhstnam 
    457       CHARACTER (len=40) ::   clop 
    458442      !!---------------------------------------------------------------------- 
    459443 
     
    481465      IF( trd_vor_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'trd_vor_init : unable to allocate trdvor arrays' ) 
    482466 
     467      vortrd(:,:,:,:) = 0.0 
    483468 
    484469      ! cumulated trends array init 
     
    493478      ENDIF 
    494479 
    495       !  ================================= 
    496       !   II. netCDF output initialization 
    497       !  ================================= 
    498  
    499       !----------------------------------------- 
    500       ! II.1 Define frequency of output and means 
    501       ! ----------------------------------------- 
    502       IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!) 
    503       ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time) 
    504       ENDIF 
    505 #if defined key_diainstant 
    506       zsto = nwrite*rdt 
    507       clop = "inst("//TRIM(clop)//")" 
    508 #else 
    509       zsto = rdt 
    510       clop = "ave("//TRIM(clop)//")" 
    511 #endif 
    512       zout = nn_trd*rdt 
    513  
    514       IF(lwp) WRITE(numout,*) '               netCDF initialization' 
    515  
    516       ! II.2 Compute julian date from starting date of the run 
    517       ! ------------------------ 
    518       CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) 
    519       zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    520       IF(lwp) WRITE(numout,*)' '   
    521       IF(lwp) WRITE(numout,*)'               Date 0 used :',nit000,    & 
    522          &                   ' YEAR ', nyear,' MONTH '      , nmonth,   & 
    523          &                   ' DAY ' , nday, 'Julian day : ', zjulian 
    524  
    525       ! II.3 Define the T grid trend file (nidvor) 
    526       ! --------------------------------- 
    527       CALL dia_nam( clhstnam, nn_trd, 'vort' )                  ! filename 
    528       IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam 
    529       CALL histbeg( clhstnam, jpi, glamf, jpj, gphif,1, jpi,   &  ! Horizontal grid : glamt and gphit 
    530          &          1, jpj, nit000-1, zjulian, rdt, nh_t, nidvor, domain_id=nidom, snc4chunks=snc4set ) 
    531       CALL wheneq( jpi*jpj, fmask, 1, 1., ndexvor1, ndimvor1 )    ! surface 
    532  
    533       ! Declare output fields as netCDF variables 
    534       CALL histdef( nidvor, "sovortPh", cvort//"grad Ph" , "s-2",        & ! grad Ph 
    535          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    536       CALL histdef( nidvor, "sovortEk", cvort//"Energy", "s-2",          & ! Energy 
    537          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    538       CALL histdef( nidvor, "sovozeta", cvort//"rel vorticity", "s-2",   & ! rel vorticity 
    539          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    540       CALL histdef( nidvor, "sovortif", cvort//"coriolis", "s-2",        & ! coriolis 
    541          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    542       CALL histdef( nidvor, "sovodifl", cvort//"lat diff ", "s-2",       & ! lat diff 
    543          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    544       CALL histdef( nidvor, "sovoadvv", cvort//"vert adv", "s-2",        & ! vert adv 
    545          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    546       CALL histdef( nidvor, "sovodifv", cvort//"vert diff" , "s-2",      & ! vert diff 
    547          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    548       CALL histdef( nidvor, "sovortPs", cvort//"grad Ps", "s-2",         & ! grad Ps 
    549          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    550       CALL histdef( nidvor, "sovortbv", cvort//"Beta V", "s-2",          & ! beta.V 
    551          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    552       CALL histdef( nidvor, "sovowind", cvort//"wind stress", "s-2",     & ! wind stress 
    553          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    554       CALL histdef( nidvor, "sovobfri", cvort//"bottom friction", "s-2", & ! bottom friction 
    555          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    556       CALL histdef( nidvor, "1st_mbre", cvort//"1st mbre", "s-2",        & ! First membre 
    557          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    558       CALL histdef( nidvor, "sovorgap", cvort//"gap", "s-2",             & ! gap between 1st and 2 nd mbre 
    559          &          jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout) 
    560       CALL histend( nidvor, snc4set ) 
    561  
    562       IF( ndebug /= 0 ) THEN 
    563          WRITE(numout,*) ' debuging trd_vor_init: II. done' 
    564          CALL FLUSH(numout) 
    565       ENDIF 
    566480      ! 
    567481   END SUBROUTINE trd_vor_init 
  • NEMO/branches/UKMO/dev_r10037_vorticity_trends/src/OCE/TRD/trdvor_oce.F90

    r9950 r10810  
    1313 
    1414   !                                               !!* vorticity trends index 
    15    INTEGER, PUBLIC, PARAMETER ::   jpltot_vor = 11  !: Number of vorticity trend terms 
     15   INTEGER, PUBLIC, PARAMETER ::   jpltot_vor = 10  !: Number of vorticity trend terms 
     16   INTEGER, PUBLIC, PARAMETER ::   jpltype_vor = 2  !: Number of of types of vorticity trend 
     17   ! 
     18   INTEGER, PUBLIC, PARAMETER ::   jptype_vor_avg =  1   !: curl(vertical average) 
     19   INTEGER, PUBLIC, PARAMETER ::   jptype_vor_int =  2   !: curl(vertical integral)/H 
    1620   ! 
    1721   INTEGER, PUBLIC, PARAMETER ::   jpvor_prg =  1   !: Pressure Gradient Trend 
     
    2327   INTEGER, PUBLIC, PARAMETER ::   jpvor_zdf =  7   !: Vertical Diffusion Trend 
    2428   INTEGER, PUBLIC, PARAMETER ::   jpvor_spg =  8   !: Surface Pressure Grad. Trend 
    25    INTEGER, PUBLIC, PARAMETER ::   jpvor_bev =  9   !: Beta V 
    26    INTEGER, PUBLIC, PARAMETER ::   jpvor_swf = 10   !: wind stress forcing term 
    27    INTEGER, PUBLIC, PARAMETER ::   jpvor_bfr = 11   !: bottom friction term 
    28  
     29   INTEGER, PUBLIC, PARAMETER ::   jpvor_swf =  9   !: wind stress forcing term 
     30   INTEGER, PUBLIC, PARAMETER ::   jpvor_bfr = 10   !: bottom friction term 
     31   ! 
    2932   !!---------------------------------------------------------------------- 
    3033   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
Note: See TracChangeset for help on using the changeset viewer.