Changeset 15154 for NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends
- Timestamp:
- 2021-07-28T10:31:26+02:00 (3 years ago)
- Location:
- NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/cfgs/SHARED/field_def_nemo-oce.xml
r13648 r15154 839 839 <!-- variables available with ln_dyn_trd --> 840 840 <field id="utrd_hpg" long_name="i-trend: hydrostatic pressure gradient" unit="m/s^2" /> 841 <field id="utrd_spg" long_name="i-trend: surface pressure gradient" unit="m/s^2" /> 841 <field id="utrd_hpg_corr" long_name="i-trend: HPG: correction" unit="m/s^2" grid_ref="grid_U_2D" /> 842 <field id="utrd_spg2d" long_name="i-trend: surface pressure gradient: true trend" unit="m/s^2" grid_ref="grid_U_2D" /> 842 843 <field id="utrd_spgexp" long_name="i-trend: surface pressure gradient (explicit)" unit="m/s^2" /> 843 <field id="utrd_spgflt" long_name="i-trend: surface pressure gradient (filtered)" unit="m/s^2" />844 844 <field id="utrd_keg" long_name="i-trend: KE gradient or hor. adv." unit="m/s^2" /> 845 845 <field id="utrd_rvo" long_name="i-trend: relative vorticity or metric term" unit="m/s^2" /> 846 <field id="utrd_pvo" long_name="i-trend: planetary vorticity" unit="m/s^2" /> 846 <field id="utrd_pvo" long_name="i-trend: planetary vorticity: 3D component" unit="m/s^2" /> 847 <field id="utrd_pvo2d" long_name="i-trend: planetary vorticity: 2D component" unit="m/s^2" grid_ref="grid_U_2D" /> 848 <field id="utrd_pvo_corr" long_name="i-trend: planetary vorticity: correction" unit="m/s^2" grid_ref="grid_U_2D" /> 847 849 <field id="utrd_zad" long_name="i-trend: vertical advection" unit="m/s^2" /> 848 850 <field id="utrd_udx" long_name="i-trend: U.dx[U]" unit="m/s^2" /> … … 852 854 <field id="utrd_bfr" long_name="i-trend: bottom friction (explicit)" unit="m/s^2" /> 853 855 <field id="utrd_bfri" long_name="i-trend: bottom friction (implicit)" unit="m/s^2" /> 856 <field id="utrd_bfr2d" long_name="i-trend: bottom friction: 2D component" unit="m/s^2" grid_ref="grid_U_2D" /> 854 857 <field id="utrd_tot" long_name="i-trend: total momentum trend before atf" unit="m/s^2" /> 855 858 <field id="utrd_atf" long_name="i-trend: asselin time filter trend" unit="m/s^2" /> 859 <!-- thickness weighted versions --> 860 <field id="utrd_hpg_e3u" unit="m2/s^2" > utrd_hpg * e3u </field> 861 <field id="utrd_spg_e3u" unit="m2/s^2" > utrd_spg * e3u </field> 862 <field id="utrd_spgexp_e3u" unit="m2/s^2" > utrd_spgexp * e3u </field> 863 <field id="utrd_keg_e3u" unit="m2/s^2" > utrd_keg * e3u </field> 864 <field id="utrd_rvo_e3u" unit="m2/s^2" > utrd_rvo * e3u </field> 865 <field id="utrd_pvo_e3u" unit="m2/s^2" > utrd_pvo * e3u </field> 866 <field id="utrd_zad_e3u" unit="m2/s^2" > utrd_zad * e3u </field> 867 <field id="utrd_ldf_e3u" unit="m2/s^2" > utrd_ldf * e3u </field> 868 <field id="utrd_zdf_e3u" unit="m2/s^2" > utrd_zdf * e3u </field> 869 <field id="utrd_tot_e3u" unit="m2/s^2" > utrd_tot * e3u </field> 870 <field id="utrd_atf_e3u" unit="m2/s^2" > utrd_atf * e3u </field> 871 <field id="utrd_bta_e3u" unit="m2/s^2" > utrd_bta * e3u </field> 872 <field id="utrd_bfr_e3u" unit="m2/s^2" > utrd_bfr * e3u </field> 873 <field id="utrd_bfri_e3u" unit="m2/s^2" > utrd_bfri * e3u </field> 856 874 </field_group> 857 875 … … 859 877 <!-- variables available with ln_dyn_trd --> 860 878 <field id="vtrd_hpg" long_name="j-trend: hydrostatic pressure gradient" unit="m/s^2" /> 879 <field id="vtrd_hpg_corr" long_name="j-trend: HPG: correction" unit="m/s^2" grid_ref="grid_V_2D" /> 861 880 <field id="vtrd_spg" long_name="j-trend: surface pressure gradient" unit="m/s^2" /> 881 <field id="vtrd_spgbt" long_name="j-trend: surface pressure gradient: barotropic part" unit="m/s^2" grid_ref="grid_V_2D" /> 882 <field id="vtrd_spg2d" long_name="j-trend: surface pressure gradient: true trend" unit="m/s^2" grid_ref="grid_V_2D" /> 862 883 <field id="vtrd_spgexp" long_name="j-trend: surface pressure gradient (explicit)" unit="m/s^2" /> 863 <field id="vtrd_spgflt" long_name="j-trend: surface pressure gradient (filtered)" unit="m/s^2" />864 884 <field id="vtrd_keg" long_name="j-trend: KE gradient or hor. adv." unit="m/s^2" /> 865 885 <field id="vtrd_rvo" long_name="j-trend: relative vorticity or metric term" unit="m/s^2" /> 866 <field id="vtrd_pvo" long_name="j-trend: planetary vorticity" unit="m/s^2" /> 886 <field id="vtrd_pvo" long_name="j-trend: planetary vorticity: 3D component" unit="m/s^2" /> 887 <field id="vtrd_pvo2d" long_name="j-trend: planetary vorticity: 2D component" unit="m/s^2" grid_ref="grid_V_2D" /> 888 <field id="vtrd_pvo_corr" long_name="j-trend: planetary vorticity: correction" unit="m/s^2" grid_ref="grid_V_2D" /> 867 889 <field id="vtrd_zad" long_name="j-trend: vertical advection" unit="m/s^2" /> 868 <field id="vtrd_vdy" long_name=" i-trend: V.dx[V]" unit="m/s^2" />890 <field id="vtrd_vdy" long_name="j-trend: V.dx[V]" unit="m/s^2" /> 869 891 <field id="vtrd_ldf" long_name="j-trend: lateral diffusion" unit="m/s^2" /> 870 892 <field id="vtrd_zdf" long_name="j-trend: vertical diffusion" unit="m/s^2" /> … … 872 894 <field id="vtrd_bfr" long_name="j-trend: bottom friction (explicit)" unit="m/s^2" /> 873 895 <field id="vtrd_bfri" long_name="j-trend: bottom friction (implicit)" unit="m/s^2" /> 896 <field id="vtrd_bfr2d" long_name="j-trend: bottom friction: 2D component" unit="m/s^2" grid_ref="grid_V_2D" /> 874 897 <field id="vtrd_tot" long_name="j-trend: total momentum trend before atf" unit="m/s^2" /> 875 898 <field id="vtrd_atf" long_name="j-trend: asselin time filter trend" unit="m/s^2" /> 899 <!-- thickness weighted versions --> 900 <field id="vtrd_hpg_e3v" unit="m2/s^2" > vtrd_hpg * e3v </field> 901 <field id="vtrd_spg_e3v" unit="m2/s^2" > vtrd_spg * e3v </field> 902 <field id="vtrd_spgexp_e3v" unit="m2/s^2" > vtrd_spgexp * e3v </field> 903 <field id="vtrd_keg_e3v" unit="m2/s^2" > vtrd_keg * e3v </field> 904 <field id="vtrd_rvo_e3v" unit="m2/s^2" > vtrd_rvo * e3v </field> 905 <field id="vtrd_pvo_e3v" unit="m2/s^2" > vtrd_pvo * e3v </field> 906 <field id="vtrd_zad_e3v" unit="m2/s^2" > vtrd_zad * e3v </field> 907 <field id="vtrd_ldf_e3v" unit="m2/s^2" > vtrd_ldf * e3v </field> 908 <field id="vtrd_zdf_e3v" unit="m2/s^2" > vtrd_zdf * e3v </field> 909 <field id="vtrd_tot_e3v" unit="m2/s^2" > vtrd_tot * e3v </field> 910 <field id="vtrd_atf_e3v" unit="m2/s^2" > vtrd_atf * e3v </field> 911 <field id="vtrd_bta_e3v" unit="m2/s^2" > vtrd_bta * e3v </field> 912 <field id="vtrd_bfr_e3v" unit="m2/s^2" > vtrd_bfr * e3v </field> 913 <field id="vtrd_bfri_e3v" unit="m2/s^2" > vtrd_bfri * e3v </field> 876 914 </field_group> 877 915 -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynhpg.F90
r14075 r15154 115 115 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 116 116 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 117 CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg , kt )117 CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg_save, kt ) 118 118 DEALLOCATE( ztrdu , ztrdv ) 119 119 ENDIF -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynspg.F90
r14075 r15154 81 81 IF( ln_timing ) CALL timing_start('dyn_spg') 82 82 ! 83 IF( l_trddyn ) THEN ! temporary save of ta and sa trends83 IF( l_trddyn .AND. nspg == np_EXP ) THEN ! temporary save of ta and sa trends 84 84 ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) ) 85 85 ztrdu(:,:,:) = ua(:,:,:) … … 165 165 END SELECT 166 166 ! 167 IF( l_trddyn ) THEN! save the surface pressure gradient trends for further diagnostics167 IF( l_trddyn .AND. nspg == np_EXP ) THEN ! save the surface pressure gradient trends for further diagnostics 168 168 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 169 169 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 170 170 CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 171 ! In this case we also need to finalise the write-out of the PVO 3D diagnostic with zero correction 172 ztrdu(:,:,1) = 0._wp 173 ztrdv(:,:,1) = 0._wp 174 CALL trd_dyn( ztrdu(:,:,1), ztrdv(:,:,1), jpdyn_pvo, kt ) 171 175 DEALLOCATE( ztrdu , ztrdv ) 172 176 ENDIF -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynspg_ts.F90
r14075 r15154 61 61 USE iom ! IOM library 62 62 USE restart ! only for lrst_oce 63 USE trd_oce ! trends: ocean variables 64 USE trddyn ! trend manager: dynamics 63 65 64 66 USE iom ! to remove … … 150 152 REAL(wp) :: r1_2dt_b, z1_hu, z1_hv ! local scalars 151 153 REAL(wp) :: za0, za1, za2, za3 ! - - 152 REAL(wp) :: z ztmp, zldg ! - -154 REAL(wp) :: zmdi, zztmp, zldg ! - - 153 155 REAL(wp) :: zhu_bck, zhv_bck, zhdiv ! - - 154 156 REAL(wp) :: zun_save, zvn_save ! - - … … 168 170 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ztwdmask, zuwdmask, zvwdmask ! ROMS wetting and drying masks at t,u,v points 169 171 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zuwdav2, zvwdav2 ! averages over the sub-steps of zuwdmask and zvwdmask 172 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zspgtrdu, zspgtrdv, zpvotrdu, zpvotrdv ! SPG and PVO trends (if l_trddyn) 173 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ztautrdu, ztautrdv, zbfrtrdu, zbfrtrdv ! TAU and BFR trends (if l_trddyn) 170 174 !!---------------------------------------------------------------------- 171 175 ! … … 173 177 ! !* Allocate temporary arrays 174 178 IF( ln_wd_dl ) ALLOCATE( ztwdmask(jpi,jpj), zuwdmask(jpi,jpj), zvwdmask(jpi,jpj), zuwdav2(jpi,jpj), zvwdav2(jpi,jpj)) 179 ! 180 IF( l_trddyn ) THEN 181 ALLOCATE( zspgtrdu(jpi,jpj), zspgtrdv(jpi,jpj), zpvotrdu(jpi,jpj), zpvotrdv(jpi,jpj), & 182 & ztautrdu(jpi,jpj), ztautrdv(jpi,jpj), zbfrtrdu(jpi,jpj), zbfrtrdv(jpi,jpj) ) 183 zspgtrdu(:,:) = 0._wp 184 zspgtrdv(:,:) = 0._wp 185 zpvotrdu(:,:) = 0._wp 186 zpvotrdv(:,:) = 0._wp 187 ztautrdu(:,:) = 0._wp 188 ztautrdv(:,:) = 0._wp 189 zbfrtrdu(:,:) = 0._wp 190 zbfrtrdv(:,:) = 0._wp 191 ENDIF 192 ! 193 zu_trd(:,:) = 0._wp 194 zv_trd(:,:) = 0._wp 195 zu_spg(:,:) = 0._wp 196 zv_spg(:,:) = 0._wp 197 ! 198 zmdi=1.e+20 ! missing data indicator for masking 175 199 ! 176 200 zwdramp = r_rn_wdmin1 ! simplest ramp … … 249 273 & zu_trd, zv_trd ) ! ==>> out 250 274 ! 275 IF( l_trddyn ) THEN 276 ! send correction to baroclinic planetary vorticity trend to trd_dyn 277 CALL trd_dyn( zu_trd, zv_trd, jpdyn_pvo_corr, kt ) 278 ENDIF 279 ! 251 280 IF( .NOT.ln_linssh ) THEN !* surface pressure gradient (variable volume only) 281 ! 282 IF( l_trddyn ) THEN 283 zspgtrdu(:,:) = zu_trd(:,:) 284 zspgtrdv(:,:) = zv_trd(:,:) 285 ENDIF 252 286 ! 253 287 IF( ln_wd_il ) THEN ! W/D : limiter applied to spgspg … … 270 304 ENDIF 271 305 ! 306 IF( l_trddyn ) THEN 307 zspgtrdu(:,:) = zu_trd(:,:) - zspgtrdu(:,:) 308 zspgtrdv(:,:) = zv_trd(:,:) - zspgtrdv(:,:) 309 ! send correction to HPG trend to trd_dyn 310 CALL trd_dyn( zspgtrdu, zspgtrdv, jpdyn_hpg_corr, kt ) 311 ! reset temporary arrays for use later 312 zspgtrdu(:,:) = 0._wp 313 zspgtrdv(:,:) = 0._wp 314 ENDIF 315 ! 272 316 ENDIF 273 317 ! … … 279 323 END DO 280 324 ! 325 IF( l_trddyn ) THEN 326 zbfrtrdu(:,:) = zu_frc(:,:) 327 zbfrtrdv(:,:) = zv_frc(:,:) 328 ENDIF 281 329 ! != Add bottom stress contribution from baroclinic velocities =! 282 330 ! ! ----------------------------------------------------------- ! 283 331 CALL dyn_drg_init( zu_frc, zv_frc, zCdU_u, zCdU_v ) ! also provide the barotropic drag coefficients 332 ! 333 IF( l_trddyn ) THEN 334 ! bottom friction trend diagnostic: bottom friction due to baroclinic currents 335 zbfrtrdu(:,:) = zu_frc(:,:) - zbfrtrdu(:,:) 336 zbfrtrdv(:,:) = zv_frc(:,:) - zbfrtrdv(:,:) 337 ENDIF 284 338 ! 285 339 ! != Add atmospheric pressure forcing =! … … 308 362 ! != Add atmospheric pressure forcing =! 309 363 ! ! ---------------------------------- ! 364 IF( l_trddyn ) THEN 365 ztautrdu(:,:) = zu_frc(:,:) 366 ztautrdv(:,:) = zv_frc(:,:) 367 ENDIF 368 ! 310 369 IF( ln_bt_fw ) THEN ! Add wind forcing 311 370 DO jj = 2, jpjm1 … … 325 384 ENDIF 326 385 ! 386 IF( l_trddyn ) THEN 387 ! wind stress trend diagnostic 388 ztautrdu(:,:) = zu_frc(:,:) - ztautrdu(:,:) 389 ztautrdv(:,:) = zv_frc(:,:) - ztautrdv(:,:) 390 ENDIF 327 391 ! !----------------! 328 392 ! !== sssh_frc ==! Right-Hand-Side of the barotropic ssh equation (over the FULL domain) … … 587 651 ENDIF 588 652 ! 653 IF( l_trddyn ) THEN 654 za2 = wgtbtp2(jn) 655 zspgtrdu(:,:) = zspgtrdu(:,:) + za2 * zu_spg(:,:) * ssumask(:,:) 656 zspgtrdv(:,:) = zspgtrdv(:,:) + za2 * zv_spg(:,:) * ssvmask(:,:) 657 ENDIF 658 ! 589 659 ! Add Coriolis trend: 590 660 ! zwz array below or triads normally depend on sea level with ln_linssh=F and should be updated … … 592 662 ! Recall that zhU and zhV hold fluxes at jn+0.5 (extrapolated not backward interpolated) 593 663 CALL dyn_cor_2d( zhup2_e, zhvp2_e, ua_e, va_e, zhU, zhV, zu_trd, zv_trd ) 664 ! 665 IF( l_trddyn ) THEN 666 za2 = wgtbtp2(jn) 667 zpvotrdu(:,:) = zpvotrdu(:,:) + za2 * zu_trd(:,:) * ssumask(:,:) 668 zpvotrdv(:,:) = zpvotrdv(:,:) + za2 * zv_trd(:,:) * ssvmask(:,:) 669 ENDIF 594 670 ! 595 671 ! Add tidal astronomical forcing if defined … … 612 688 END DO 613 689 END DO 690 IF( l_trddyn ) THEN 691 za2 = wgtbtp2(jn) 692 zbfrtrdu(:,:) = zbfrtrdu(:,:) + za2 * zCdU_u(:,:) * un_e(:,:) * hur_e(:,:) 693 zbfrtrdv(:,:) = zbfrtrdv(:,:) + za2 * zCdU_v(:,:) * vn_e(:,:) * hvr_e(:,:) 694 ENDIF 614 695 ENDIF 615 696 ! … … 834 915 IF( ln_wd_dl ) DEALLOCATE( ztwdmask, zuwdmask, zvwdmask, zuwdav2, zvwdav2 ) 835 916 ! 836 CALL iom_put( "baro_u" , un_b ) ! Barotropic U Velocity 837 CALL iom_put( "baro_v" , vn_b ) ! Barotropic V Velocity 917 IF( l_trddyn ) THEN 918 CALL trd_dyn( zspgtrdu, zspgtrdv, jpdyn_spg, kt ) 919 CALL trd_dyn( zpvotrdu, zpvotrdv, jpdyn_pvo, kt ) 920 CALL trd_dyn( ztautrdu, ztautrdv, jpdyn_tau, kt ) 921 CALL trd_dyn( zbfrtrdu, zbfrtrdv, jpdyn_bfr, kt ) 922 DEALLOCATE( zspgtrdu, zspgtrdv, zpvotrdu, zpvotrdv, ztautrdu, ztautrdv, zbfrtrdu, zbfrtrdv ) 923 ENDIF 924 ! 925 CALL iom_put( "baro_u" , un_b*ssumask(:,:)+zmdi*(1.-ssumask(:,:) ) ) ! Barotropic U Velocity 926 CALL iom_put( "baro_v" , vn_b*ssvmask(:,:)+zmdi*(1.-ssvmask(:,:) ) ) ! Barotropic V Velocity 838 927 ! 839 928 END SUBROUTINE dyn_spg_ts -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynvor.F90
r14075 r15154 133 133 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 134 134 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 135 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo , kt )135 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo_save, kt ) 136 136 ! 137 137 IF( n_dynadv /= np_LIN_dyn ) THEN !* relative vorticity or metric trend (only in non-linear case) -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/DYN/dynzdf.F90
r14075 r15154 25 25 ! 26 26 USE in_out_manager ! I/O manager 27 USE iom ! IOM library 27 28 USE lib_mpp ! MPP library 28 29 USE prtctl ! Print control … … 69 70 INTEGER :: ji, jj, jk ! dummy loop indices 70 71 INTEGER :: iku, ikv ! local integers 72 INTEGER :: ikbu, ikbv ! local integers 71 73 REAL(wp) :: zzwi, ze3ua, zdt ! local scalars 72 74 REAL(wp) :: zzws, ze3va ! - - … … 99 101 ! 100 102 ! 101 IF( l_trddyn ) THEN !* temporary save of ta and sa trends102 ALLOCATE( ztrdu(jpi,jpj,jpk), ztrdv(jpi,jpj,jpk) )103 ztrdu(:,:,:) = ua(:,:,:)104 ztrdv(:,:,:) = va(:,:,:)105 ENDIF106 !107 103 ! !== RHS: Leap-Frog time stepping on all trends but the vertical mixing ==! (put in ua,va) 108 104 ! … … 131 127 va(:,:,jk) = ( va(:,:,jk) - va_b(:,:) ) * vmask(:,:,jk) 132 128 END DO 129 IF( l_trddyn ) THEN !* temporary save of ta and sa trends 130 ALLOCATE( ztrdu(jpi,jpj,jpk), ztrdv(jpi,jpj,jpk) ) 131 ztrdu(:,:,:) = ua(:,:,:) 132 ztrdv(:,:,:) = va(:,:,:) 133 ENDIF 133 134 DO jj = 2, jpjm1 ! Add bottom/top stress due to barotropic component only 134 135 DO ji = fs_2, fs_jpim1 ! vector opt. … … 153 154 END DO 154 155 END IF 156 IF( l_trddyn ) THEN ! save explicit part of bottom friction trends 157 ztrdu(:,:,:) = ( ua(:,:,:) - ztrdu(:,:,:) ) / r2dt 158 ztrdv(:,:,:) = ( va(:,:,:) - ztrdv(:,:,:) ) / r2dt 159 CALL trd_dyn( ztrdu, ztrdv, jpdyn_bfr, kt ) 160 ENDIF 161 ENDIF 162 ! 163 IF( l_trddyn ) THEN !* temporary save of ta and sa trends 164 IF( .NOT. ALLOCATED(ztrdu) ) ALLOCATE( ztrdu(jpi,jpj,jpk), ztrdv(jpi,jpj,jpk) ) 165 ztrdu(:,:,:) = ua(:,:,:) 166 ztrdv(:,:,:) = va(:,:,:) 155 167 ENDIF 156 168 ! … … 486 498 ! 487 499 IF( l_trddyn ) THEN ! save the vertical diffusive trends for further diagnostics 488 ztrdu(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) / r2dt - ztrdu(:,:,:) 489 ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / r2dt - ztrdv(:,:,:) 500 501 ztrdu(:,:,:) = ( ua(:,:,:) - ztrdu(:,:,:) ) / r2dt 502 ztrdv(:,:,:) = ( va(:,:,:) - ztrdv(:,:,:) ) / r2dt 490 503 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt ) 504 ! 505 IF( ln_drgimp ) THEN 506 ztrdu(:,:,:) = 0._wp ; ztrdv(:,:,:) = 0._wp 507 DO jk = 1, jpkm1 508 DO jj = 2, jpjm1 509 DO ji = 2, jpim1 510 ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels 511 ikbv = mbkv(ji,jj) 512 ztrdu(ji,jj,jk) = 0.5 * ( rCdU_bot(ji+1,jj) + rCdU_bot(ji,jj) ) & 513 & * un(ji,jj,ikbu) / e3u_n(ji,jj,ikbu) 514 ztrdv(ji,jj,jk) = 0.5 * ( rCdU_bot(ji,jj+1) + rCdU_bot(ji,jj) ) & 515 & * vn(ji,jj,ikbv) / e3v_n(ji,jj,ikbv) 516 END DO 517 END DO 518 END DO 519 CALL trd_dyn( ztrdu, ztrdv, jpdyn_bfri, kt ) 520 ENDIF 521 ! 491 522 DEALLOCATE( ztrdu, ztrdv ) 492 523 ENDIF -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/TRD/trd_oce.F90
r14075 r15154 59 59 ! 60 60 ! !!!* Momentum trends indices 61 INTEGER, PUBLIC, PARAMETER :: jptot_dyn = 1 3!: Total trend nb: change it when adding/removing one indice below61 INTEGER, PUBLIC, PARAMETER :: jptot_dyn = 17 !: Total trend nb: change it when adding/removing one indice below 62 62 ! =============== ! 63 INTEGER, PUBLIC, PARAMETER :: jpdyn_hpg = 1 !: hydrostatic pressure gradient 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_bfr = 9 !: bottom stress 72 INTEGER, PUBLIC, PARAMETER :: jpdyn_atf = 10 !: Asselin time filter 73 INTEGER, PUBLIC, PARAMETER :: jpdyn_tau = 11 !: surface stress 74 INTEGER, PUBLIC, PARAMETER :: jpdyn_bfri = 12 !: implicit bottom friction (ln_drgimp=.TRUE.) 75 INTEGER, PUBLIC, PARAMETER :: jpdyn_ken = 13 !: use for calculation of KE 63 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_bfr = 13 !: bottom stress 76 INTEGER, PUBLIC, PARAMETER :: jpdyn_atf = 14 !: Asselin time filter 77 INTEGER, PUBLIC, PARAMETER :: jpdyn_tau = 15 !: surface stress 78 INTEGER, PUBLIC, PARAMETER :: jpdyn_bfri = 16 !: implicit bottom friction (ln_drgimp=.TRUE.) 79 INTEGER, PUBLIC, PARAMETER :: jpdyn_ken = 17 !: use for calculation of KE 76 80 ! 77 81 !!---------------------------------------------------------------------- -
NEMO/branches/UKMO/NEMO_4.0.4_momentum_trends/src/OCE/TRD/trddyn.F90
r14075 r15154 18 18 USE sbc_oce ! surface boundary condition: ocean 19 19 USE zdf_oce ! ocean vertical physics: variables 20 !!gm USE zdfdrg ! ocean vertical physics: bottom friction21 20 USE trd_oce ! trends: ocean variables 22 21 USE trdken ! trends: Kinetic ENergy … … 35 34 PUBLIC trd_dyn ! called by all dynXXX modules 36 35 36 INTERFACE trd_dyn 37 module procedure trd_dyn_3d, trd_dyn_2d 38 END INTERFACE 39 40 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_hpg, zvtrd_hpg 41 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_pvo, zvtrd_pvo 42 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_bfr, zvtrd_bfr 43 REAL(wp), ALLOCATABLE, DIMENSION(:,:) , SAVE :: zutrd_tau, zvtrd_tau 44 37 45 !! * Substitutions 38 46 # include "vectopt_loop_substitute.h90" … … 44 52 CONTAINS 45 53 46 SUBROUTINE trd_dyn ( putrd, pvtrd, ktrd, kt )54 SUBROUTINE trd_dyn_3d( putrd, pvtrd, ktrd, kt ) 47 55 !!--------------------------------------------------------------------- 48 !! *** ROUTINE trd_ mod ***56 !! *** ROUTINE trd_dyn_3d *** 49 57 !! 50 58 !! ** Purpose : Dispatch momentum trend computation, e.g. 3D output, … … 55 63 INTEGER , INTENT(in ) :: ktrd ! trend index 56 64 INTEGER , INTENT(in ) :: kt ! time step 65 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zue, zve ! temporary 2D arrays 66 INTEGER :: jk 57 67 !!---------------------------------------------------------------------- 58 68 ! … … 63 73 !!gm NB : here a lbc_lnk should probably be added 64 74 75 SELECT CASE( ktrd ) 76 CASE( jpdyn_hpg_save ) 77 ! 78 ! save 3D HPG trends to possibly have barotropic part corrected later before writing out 79 ALLOCATE( zutrd_hpg(jpi,jpj,jpk), zvtrd_hpg(jpi,jpj,jpk) ) 80 zutrd_hpg(:,:,:) = putrd(:,:,:) 81 zvtrd_hpg(:,:,:) = pvtrd(:,:,:) 82 83 CASE( jpdyn_pvo_save ) 84 ! 85 ! save 3D coriolis trends to possibly have barotropic part corrected later before writing out 86 ALLOCATE( zutrd_pvo(jpi,jpj,jpk), zvtrd_pvo(jpi,jpj,jpk) ) 87 zutrd_pvo(:,:,:) = putrd(:,:,:) 88 zvtrd_pvo(:,:,:) = pvtrd(:,:,:) 89 90 CASE( jpdyn_spg ) 91 ! For explicit scheme SPG trends come here as 3D fields 92 ! Add SPG trend to 3D HPG trend and also output as 2D diagnostic in own right. 93 CALL trd_dyn_iom_2d( putrd(:,:,1), pvtrd(:,:,1), jpdyn_spg, kt ) 94 putrd(:,:,:) = putrd(:,:,:) + zutrd_hpg(:,:,:) 95 pvtrd(:,:,:) = pvtrd(:,:,:) + zvtrd_hpg(:,:,:) 96 DEALLOCATE( zutrd_hpg, zvtrd_hpg ) 97 98 CASE( jpdyn_bfr ) 99 ! 100 ! Add 3D part of BFR trend minus its depth-mean part to depth-mean trend already saved. 101 ALLOCATE( zue(jpi,jpj), zve(jpi,jpj) ) 102 zue(:,:) = e3u_a(:,:,1) * putrd(:,:,1) * umask(:,:,1) 103 zve(:,:) = e3v_a(:,:,1) * pvtrd(:,:,1) * vmask(:,:,1) 104 DO jk = 2, jpkm1 105 zue(:,:) = zue(:,:) + e3u_a(:,:,jk) * putrd(:,:,jk) * umask(:,:,jk) 106 zve(:,:) = zve(:,:) + e3v_a(:,:,jk) * pvtrd(:,:,jk) * vmask(:,:,jk) 107 END DO 108 DO jk = 1, jpkm1 109 putrd(:,:,jk) = zutrd_bfr(:,:,jk) + putrd(:,:,jk) - zue(:,:) * r1_hu_a(:,:) 110 pvtrd(:,:,jk) = zvtrd_bfr(:,:,jk) + pvtrd(:,:,jk) - zve(:,:) * r1_hv_a(:,:) 111 END DO 112 ! Update locally saved BFR trends to add to ZDF trend. 113 zutrd_bfr(:,:,:) = putrd(:,:,:) 114 zvtrd_bfr(:,:,:) = pvtrd(:,:,:) 115 116 CASE( jpdyn_zdf ) 117 ! ZDF trend: Remove barotropic component and add wind stress and bottom friction 118 ! trends from dynspg_ts. Also adding on the bottom stress for the 119 ! baroclinic solution in the case of explicit bottom friction. 120 ALLOCATE( zue(jpi,jpj), zve(jpi,jpj) ) 121 zue(:,:) = e3u_a(:,:,1) * putrd(:,:,1) * umask(:,:,1) 122 zve(:,:) = e3v_a(:,:,1) * pvtrd(:,:,1) * vmask(:,:,1) 123 DO jk = 2, jpkm1 124 zue(:,:) = zue(:,:) + e3u_a(:,:,jk) * putrd(:,:,jk) * umask(:,:,jk) 125 zve(:,:) = zve(:,:) + e3v_a(:,:,jk) * pvtrd(:,:,jk) * vmask(:,:,jk) 126 END DO 127 DO jk = 1, jpkm1 128 putrd(:,:,jk) = zutrd_tau(:,:) + zutrd_bfr(:,:,jk) + putrd(:,:,jk) - zue(:,:) * r1_hu_a(:,:) 129 pvtrd(:,:,jk) = zvtrd_tau(:,:) + zvtrd_bfr(:,:,jk) + pvtrd(:,:,jk) - zve(:,:) * r1_hv_a(:,:) 130 END DO 131 DEALLOCATE( zue, zve, zutrd_tau, zvtrd_tau, zutrd_bfr, zvtrd_bfr ) 132 133 END SELECT 134 135 IF ( ktrd /= jpdyn_hpg_save .AND. ktrd /= jpdyn_pvo_save ) THEN 136 ! 137 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 138 ! 3D output of momentum and/or tracers trends using IOM interface 139 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 140 IF( ln_dyn_trd ) CALL trd_dyn_iom_3d( putrd, pvtrd, ktrd, kt ) 141 142 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 143 ! Integral Constraints Properties for momentum and/or tracers trends 144 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 145 IF( ln_glo_trd ) CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 146 147 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 148 ! Kinetic Energy trends 149 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 150 IF( ln_KE_trd ) CALL trd_ken( putrd, pvtrd, ktrd, kt ) 151 152 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 153 ! Vorticity trends 154 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 155 IF( ln_vor_trd ) CALL trd_vor( putrd, pvtrd, ktrd, kt ) 156 157 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 158 ! Mixed layer trends for active tracers 159 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 160 !!gm IF( ln_dyn_mxl ) CALL trd_mxl_dyn 161 ! 162 ENDIF 163 ! 164 END SUBROUTINE trd_dyn_3d 165 166 167 SUBROUTINE trd_dyn_2d( putrd, pvtrd, ktrd, kt ) 168 !!--------------------------------------------------------------------- 169 !! *** ROUTINE trd_mod *** 170 !! 171 !! ** Purpose : Dispatch momentum trend computation, e.g. 2D output, 172 !! integral constraints, barotropic vorticity, kinetic enrgy, 173 !! and/or mixed layer budget. 174 !!---------------------------------------------------------------------- 175 REAL(wp), DIMENSION(:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends 176 INTEGER , INTENT(in ) :: ktrd ! trend index 177 INTEGER , INTENT(in ) :: kt ! time step 178 INTEGER :: jk 179 !!---------------------------------------------------------------------- 180 ! 181 putrd(:,:) = putrd(:,:) * umask(:,:,1) ! mask the trends 182 pvtrd(:,:) = pvtrd(:,:) * vmask(:,:,1) 183 ! 184 185 !!gm NB : here a lbc_lnk should probably be added 186 187 SELECT CASE(ktrd) 188 189 CASE ( jpdyn_hpg_corr ) 190 ! 191 ! Remove "first-guess" SPG trend from 3D HPG trend. 192 DO jk = 1, jpkm1 193 zutrd_hpg(:,:,jk) = zutrd_hpg(:,:,jk) - putrd(:,:) 194 zvtrd_hpg(:,:,jk) = zvtrd_hpg(:,:,jk) - pvtrd(:,:) 195 ENDDO 196 197 CASE( jpdyn_pvo_corr ) 198 ! 199 ! Remove "first-guess" barotropic coriolis trend from 3D PVO trend. 200 DO jk = 1, jpkm1 201 zutrd_pvo(:,:,jk) = zutrd_pvo(:,:,jk) - putrd(:,:) 202 zvtrd_pvo(:,:,jk) = zvtrd_pvo(:,:,jk) - pvtrd(:,:) 203 ENDDO 204 205 CASE( jpdyn_spg ) 206 ! 207 ! For split-explicit scheme SPG trends come here as 2D fields 208 ! Add SPG trend to 3D HPG trend and also output as 2D diagnostic in own right. 209 DO jk = 1, jpkm1 210 zutrd_hpg(:,:,jk) = zutrd_hpg(:,:,jk) + putrd(:,:) 211 zvtrd_hpg(:,:,jk) = zvtrd_hpg(:,:,jk) + pvtrd(:,:) 212 ENDDO 213 CALL trd_dyn_3d( zutrd_hpg, zvtrd_hpg, jpdyn_hpg, kt ) 214 DEALLOCATE( zutrd_hpg, zvtrd_hpg ) 215 216 CASE( jpdyn_pvo ) 217 ! 218 ! Add 2D PVO trend to 3D PVO trend and also output as diagnostic in own right. 219 DO jk = 1, jpkm1 220 zutrd_pvo(:,:,jk) = zutrd_pvo(:,:,jk) + putrd(:,:) 221 zvtrd_pvo(:,:,jk) = zvtrd_pvo(:,:,jk) + pvtrd(:,:) 222 ENDDO 223 CALL trd_dyn_3d( zutrd_pvo, zvtrd_pvo, jpdyn_pvo, kt ) 224 DEALLOCATE( zutrd_pvo, zvtrd_pvo ) 225 226 CASE( jpdyn_tau ) 227 ! 228 ! Save 2D wind forcing trend locally (to be added to ZDF trend) 229 ! and output as a trend in its own right. 230 ALLOCATE( zutrd_tau(jpi,jpj), zvtrd_tau(jpi,jpj) ) 231 zutrd_tau(:,:) = putrd(:,:) 232 zvtrd_tau(:,:) = pvtrd(:,:) 233 234 CASE( jpdyn_bfr ) 235 ! 236 ! Create 3D BFR trend from 2D field and also output 2D field as diagnostic in own right. 237 ALLOCATE( zutrd_bfr(jpi,jpj,jpk), zvtrd_bfr(jpi,jpj,jpk) ) 238 zutrd_bfr(:,:,:) = 0.0 239 zvtrd_bfr(:,:,:) = 0.0 240 DO jk = 1, jpkm1 241 zutrd_bfr(:,:,jk) = putrd(:,:) * umask(:,:,jk) 242 zvtrd_bfr(:,:,jk) = pvtrd(:,:) * vmask(:,:,jk) 243 ENDDO 244 245 END SELECT 246 65 247 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 66 ! 3D output of momentum and/or tracers trends using IOM interface248 ! 2D output of momentum and/or tracers trends using IOM interface 67 249 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 68 IF( ln_dyn_trd ) CALL trd_dyn_iom ( putrd, pvtrd, ktrd, kt )250 IF( ln_dyn_trd ) CALL trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 69 251 70 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 71 ! Integral Constraints Properties for momentum and/or tracers trends 72 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 73 IF( ln_glo_trd ) CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 74 75 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 76 ! Kinetic Energy trends 77 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 78 IF( ln_KE_trd ) CALL trd_ken( putrd, pvtrd, ktrd, kt ) 79 80 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 81 ! Vorticity trends 82 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 83 IF( ln_vor_trd ) CALL trd_vor( putrd, pvtrd, ktrd, kt ) 252 253 !!$ CALLS TO THESE ROUTINES FOR 2D DIAGOSTICS NOT CODED YET 254 !!$ !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 255 !!$ ! Integral Constraints Properties for momentum and/or tracers trends 256 !!$ !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 257 !!$ IF( ln_glo_trd ) CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 258 !!$ 259 !!$ !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 260 !!$ ! Kinetic Energy trends 261 !!$ !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 262 !!$ IF( ln_KE_trd ) CALL trd_ken( putrd, pvtrd, ktrd, kt ) 263 !!$ 264 !!$ !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 265 !!$ ! Vorticity trends 266 !!$ !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 267 !!$ IF( ln_vor_trd ) CALL trd_vor( putrd, pvtrd, ktrd, kt ) 84 268 85 269 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 88 272 !!gm IF( ln_dyn_mxl ) CALL trd_mxl_dyn 89 273 ! 90 END SUBROUTINE trd_dyn 91 92 93 SUBROUTINE trd_dyn_iom ( putrd, pvtrd, ktrd, kt )274 END SUBROUTINE trd_dyn_2d 275 276 277 SUBROUTINE trd_dyn_iom_3d( putrd, pvtrd, ktrd, kt ) 94 278 !!--------------------------------------------------------------------- 95 279 !! *** ROUTINE trd_dyn_iom *** … … 110 294 CASE( jpdyn_hpg ) ; CALL iom_put( "utrd_hpg", putrd ) ! hydrostatic pressure gradient 111 295 CALL iom_put( "vtrd_hpg", pvtrd ) 112 CASE( jpdyn_spg ) ; CALL iom_put( "utrd_spg", putrd ) ! surface pressure gradient113 CALL iom_put( "vtrd_spg", pvtrd )114 296 CASE( jpdyn_pvo ) ; CALL iom_put( "utrd_pvo", putrd ) ! planetary vorticity 115 297 CALL iom_put( "vtrd_pvo", pvtrd ) … … 147 329 CALL iom_put( "vtrd_tau", z2dy ) 148 330 DEALLOCATE( z2dx , z2dy ) 149 !!gm to be changed : computation should be done in dynzdf.F90 150 !!gm + missing the top friction 151 ! ! ! bottom stress tends (implicit case) 152 ! IF( ln_drgimp ) THEN 153 ! ALLOCATE( z3dx(jpi,jpj,jpk) , z3dy(jpi,jpj,jpk) ) 154 ! z3dx(:,:,:) = 0._wp ; z3dy(:,:,:) = 0._wp ! after velocity known (now filed at this stage) 155 ! DO jk = 1, jpkm1 156 ! DO jj = 2, jpjm1 157 ! DO ji = 2, jpim1 158 ! ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels 159 ! ikbv = mbkv(ji,jj) 160 ! z3dx(ji,jj,jk) = 0.5 * ( rCdU_bot(ji+1,jj) + rCdU_bot(ji,jj) ) & 161 ! & * un(ji,jj,ikbu) / e3u_n(ji,jj,ikbu) 162 ! z3dy(ji,jj,jk) = 0.5 * ( rCdU_bot(ji,jj+1) + rCdU_bot(ji,jj) ) & 163 ! & * vn(ji,jj,ikbv) / e3v_n(ji,jj,ikbv) 164 ! END DO 165 ! END DO 166 ! END DO 167 ! CALL lbc_lnk_multi( 'trddyn', z3dx, 'U', -1., z3dy, 'V', -1. ) 168 ! CALL iom_put( "utrd_bfr", z3dx ) 169 ! CALL iom_put( "vtrd_bfr", z3dy ) 170 ! DEALLOCATE( z3dx , z3dy ) 171 ! ENDIF 172 !!gm end 173 CASE( jpdyn_bfr ) ! called if ln_drgimp=F 174 CALL iom_put( "utrd_bfr", putrd ) ! bottom friction (explicit case) 331 CASE( jpdyn_bfr ) ; CALL iom_put( "utrd_bfr", putrd ) ! bottom friction (explicit case) 175 332 CALL iom_put( "vtrd_bfr", pvtrd ) 333 CASE( jpdyn_bfri) ; CALL iom_put( "utrd_bfri", putrd ) ! bottom friction (implicit case) 334 CALL iom_put( "vtrd_bfri", pvtrd ) 176 335 CASE( jpdyn_atf ) ; CALL iom_put( "utrd_atf", putrd ) ! asselin filter trends 177 336 CALL iom_put( "vtrd_atf", pvtrd ) 178 337 END SELECT 179 338 ! 180 END SUBROUTINE trd_dyn_iom 339 END SUBROUTINE trd_dyn_iom_3d 340 341 342 SUBROUTINE trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 343 !!--------------------------------------------------------------------- 344 !! *** ROUTINE trd_dyn_iom *** 345 !! 346 !! ** Purpose : output 2D trends using IOM 347 !!---------------------------------------------------------------------- 348 REAL(wp), DIMENSION(:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends 349 INTEGER , INTENT(in ) :: ktrd ! trend index 350 INTEGER , INTENT(in ) :: kt ! time step 351 ! 352 INTEGER :: ji, jj, jk ! dummy loop indices 353 INTEGER :: ikbu, ikbv ! local integers 354 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z2dx, z2dy ! 2D workspace 355 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z3dx, z3dy ! 3D workspace 356 !!---------------------------------------------------------------------- 357 ! 358 SELECT CASE( ktrd ) 359 CASE( jpdyn_spg ) ; CALL iom_put( "utrd_spg2d", putrd ) ! surface pressure gradient 360 CALL iom_put( "vtrd_spg2d", pvtrd ) 361 CASE( jpdyn_pvo ) ; CALL iom_put( "utrd_pvo2d", putrd ) ! planetary vorticity (barotropic part) 362 CALL iom_put( "vtrd_pvo2d", pvtrd ) 363 CASE( jpdyn_hpg_corr ) ; CALL iom_put( "utrd_hpg_corr", putrd ) ! horizontal pressure gradient correction 364 CALL iom_put( "vtrd_hpg_corr", pvtrd ) 365 CASE( jpdyn_pvo_corr ) ; CALL iom_put( "utrd_pvo_corr", putrd ) ! planetary vorticity correction 366 CALL iom_put( "vtrd_pvo_corr", pvtrd ) 367 CASE( jpdyn_bfr ) ; CALL iom_put( "utrd_bfr2d", putrd ) ! bottom friction due to barotropic currents 368 CALL iom_put( "vtrd_bfr2d", pvtrd ) 369 END SELECT 370 ! 371 END SUBROUTINE trd_dyn_iom_2d 181 372 182 373 !!======================================================================
Note: See TracChangeset
for help on using the changeset viewer.