Changeset 11917
- Timestamp:
- 2019-11-15T16:56:18+01:00 (5 years ago)
- Location:
- NEMO/branches/UKMO/NEMO_4.0_momentum_trends/src/OCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0_momentum_trends/src/OCE/DYN/dynspg_ts.F90
r11613 r11917 175 175 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zuwdav2, zvwdav2 ! averages over the sub-steps of zuwdmask and zvwdmask 176 176 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zspgtrdu, zspgtrdv, zpvotrdu, zpvotrdv ! SPG and PVO trends (if l_trddyn) 177 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z bfrtrdu, zbfrtrdv !BFR trends (if l_trddyn)177 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ztautrdu, ztautrdv, zbfrtrdu, zbfrtrdv ! TAU and BFR trends (if l_trddyn) 178 178 !!---------------------------------------------------------------------- 179 179 ! … … 183 183 ! 184 184 IF( l_trddyn ) THEN 185 ALLOCATE( zspgtrdu(jpi,jpj), zspgtrdv(jpi,jpj), zpvotrdu(jpi,jpj), zpvotrdv(jpi,jpj), zbfrtrdu(jpi,jpj), zbfrtrdv(jpi,jpj) ) 185 ALLOCATE( zspgtrdu(jpi,jpj), zspgtrdv(jpi,jpj), zpvotrdu(jpi,jpj), zpvotrdv(jpi,jpj), & 186 & ztautrdu(jpi,jpj), ztautrdv(jpi,jpj), zbfrtrdu(jpi,jpj), zbfrtrdv(jpi,jpj) ) 186 187 zspgtrdu(:,:) = 0._wp 187 188 zspgtrdv(:,:) = 0._wp 188 189 zpvotrdu(:,:) = 0._wp 189 190 zpvotrdv(:,:) = 0._wp 191 ztautrdu(:,:) = 0._wp 192 ztautrdv(:,:) = 0._wp 190 193 zbfrtrdu(:,:) = 0._wp 191 194 zbfrtrdv(:,:) = 0._wp … … 573 576 ! 574 577 ! Note that the "unclipped" bottom friction parameter is used even with explicit drag 578 IF( l_trddyn ) THEN 579 zbfrtrdu(:,:) = zu_frc(:,:) 580 zbfrtrdv(:,:) = zv_frc(:,:) 581 ENDIF 582 ! 575 583 IF( ln_wd_il ) THEN 576 584 zztmp = -1._wp / rdtbt … … 592 600 END IF 593 601 ! 602 IF( l_trddyn ) THEN 603 ! bottom friction trend diagnostic: bottom friction due to baroclinic currents 604 zbfrtrdu(:,:) = zu_frc(:,:) - zbfrtrdu(:,:) 605 zbfrtrdv(:,:) = zv_frc(:,:) - zbfrtrdv(:,:) 606 ENDIF 607 ! 594 608 IF( ln_isfcav ) THEN ! Add TOP stress contribution from baroclinic velocities: 595 609 IF( ln_bt_fw ) THEN … … 622 636 ENDIF 623 637 ! 638 IF( l_trddyn ) THEN 639 ztautrdu(:,:) = zu_frc(:,:) 640 ztautrdv(:,:) = zv_frc(:,:) 641 ENDIF 642 ! 624 643 IF( ln_bt_fw ) THEN ! Add wind forcing 625 644 DO jj = 2, jpjm1 … … 638 657 END DO 639 658 ENDIF 659 ! 660 IF( l_trddyn ) THEN 661 ! wind stress trend diagnostic 662 ztautrdu(:,:) = zu_frc(:,:) - ztautrdu(:,:) 663 ztautrdv(:,:) = zv_frc(:,:) - ztautrdv(:,:) 664 ENDIF 640 665 ! 641 666 IF( ln_apr_dyn ) THEN ! Add atm pressure forcing … … 1357 1382 CALL trd_dyn( zspgtrdu, zspgtrdv, jpdyn_spg, kt ) 1358 1383 CALL trd_dyn( zpvotrdu, zpvotrdv, jpdyn_pvo, kt ) 1384 CALL trd_dyn( ztautrdu, ztautrdv, jpdyn_tau, kt ) 1359 1385 CALL trd_dyn( zbfrtrdu, zbfrtrdv, jpdyn_bfr, kt ) 1360 DEALLOCATE( zspgtrdu, zspgtrdv, zpvotrdu, zpvotrdv, z bfrtrdu, zbfrtrdv )1386 DEALLOCATE( zspgtrdu, zspgtrdv, zpvotrdu, zpvotrdv, ztautrdu, ztautrdv, zbfrtrdu, zbfrtrdv ) 1361 1387 ENDIF 1362 1388 ! -
NEMO/branches/UKMO/NEMO_4.0_momentum_trends/src/OCE/TRD/trddyn.F90
r11903 r11917 41 41 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_pvo, zvtrd_pvo 42 42 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: zutrd_bfr, zvtrd_bfr 43 REAL(wp), ALLOCATABLE, DIMENSION(:,:) , SAVE :: zutrd_tau, zvtrd_tau 43 44 44 45 !! * Substitutions … … 87 88 zvtrd_pvo(:,:,:) = pvtrd(:,:,:) 88 89 89 CASE DEFAULT 90 91 IF( ktrd == jpdyn_spg ) THEN 92 ! For explicit scheme SPG trends come here as 3D fields 93 ! Add SPG trend to 3D HPG trend and also output as 2D diagnostic in own right. 94 CALL trd_dyn_iom_2d( putrd(:,:,1), pvtrd(:,:,1), jpdyn_spg, kt ) 95 putrd(:,:,:) = putrd(:,:,:) + zutrd_hpg(:,:,:) 96 pvtrd(:,:,:) = pvtrd(:,:,:) + zvtrd_hpg(:,:,:) 97 DEALLOCATE( zutrd_hpg, zvtrd_hpg ) 98 ENDIF 99 100 IF( ktrd == jpdyn_bfr ) THEN 101 ! 102 ! Add 3D part of BFR trend minus its depth-mean part to depth-mean trend already saved. 103 ALLOCATE( zue(jpi,jpj), zve(jpi,jpj) ) 104 zue(:,:) = e3u_a(:,:,1) * putrd(:,:,1) * umask(:,:,1) 105 zve(:,:) = e3v_a(:,:,1) * pvtrd(:,:,1) * vmask(:,:,1) 106 DO jk = 2, jpkm1 107 zue(:,:) = zue(:,:) + e3u_a(:,:,jk) * putrd(:,:,jk) * umask(:,:,jk) 108 zve(:,:) = zve(:,:) + e3v_a(:,:,jk) * pvtrd(:,:,jk) * vmask(:,:,jk) 109 END DO 110 DO jk = 1, jpkm1 111 putrd(:,:,jk) = zutrd_bfr(:,:,jk) + putrd(:,:,jk) - zue(:,:) * r1_hu_a(:,:) 112 pvtrd(:,:,jk) = zvtrd_bfr(:,:,jk) + pvtrd(:,:,jk) - zve(:,:) * r1_hv_a(:,:) 113 END DO 114 DEALLOCATE( zue, zve, zutrd_bfr, zvtrd_bfr ) 115 ENDIF 116 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) = zutrd_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 ! 117 137 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 118 138 ! 3D output of momentum and/or tracers trends using IOM interface … … 140 160 !!gm IF( ln_dyn_mxl ) CALL trd_mxl_dyn 141 161 ! 142 END SELECT162 ENDIF 143 163 ! 144 164 END SUBROUTINE trd_dyn_3d … … 174 194 zvtrd_hpg(:,:,jk) = zvtrd_hpg(:,:,jk) - pvtrd(:,:) 175 195 ENDDO 176 CALL trd_dyn_iom_2d( putrd, pvtrd, jpdyn_hpg_corr, kt )177 196 178 197 CASE( jpdyn_pvo_corr ) … … 183 202 zvtrd_pvo(:,:,jk) = zvtrd_pvo(:,:,jk) - pvtrd(:,:) 184 203 ENDDO 185 CALL trd_dyn_iom_2d( putrd, pvtrd, jpdyn_pvo_corr, kt )186 204 187 205 CASE( jpdyn_spg ) … … 193 211 zvtrd_hpg(:,:,jk) = zvtrd_hpg(:,:,jk) + pvtrd(:,:) 194 212 ENDDO 195 CALL trd_dyn_iom_2d( putrd(:,:), pvtrd(:,:), jpdyn_spg, kt )196 213 CALL trd_dyn_3d( zutrd_hpg, zvtrd_hpg, jpdyn_hpg, kt ) 197 214 DEALLOCATE( zutrd_hpg, zvtrd_hpg ) … … 204 221 zvtrd_pvo(:,:,jk) = zvtrd_pvo(:,:,jk) + pvtrd(:,:) 205 222 ENDDO 206 CALL trd_dyn_iom_2d( putrd, pvtrd, jpdyn_pvo, kt )207 223 CALL trd_dyn_3d( zutrd_pvo, zvtrd_pvo, jpdyn_pvo, kt ) 208 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(:,:) 209 233 210 234 CASE( jpdyn_bfr ) … … 215 239 zvtrd_bfr(:,:,:) = 0.0 216 240 DO jk = 1, jpkm1 217 zutrd_bfr(:,:,jk) = putrd(:,:) 218 zvtrd_bfr(:,:,jk) = pvtrd(:,:) 241 zutrd_bfr(:,:,jk) = putrd(:,:) * umask(:,:,jk) 242 zvtrd_bfr(:,:,jk) = pvtrd(:,:) * vmask(:,:,jk) 219 243 ENDDO 220 CALL trd_dyn_iom_2d( putrd, pvtrd, jpdyn_bfr, kt ) 221 222 CASE DEFAULT 223 224 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 225 ! 2D output of momentum and/or tracers trends using IOM interface 226 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 227 IF( ln_dyn_trd ) CALL trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 244 245 END SELECT 246 247 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 248 ! 2D output of momentum and/or tracers trends using IOM interface 249 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 250 IF( ln_dyn_trd ) CALL trd_dyn_iom_2d( putrd, pvtrd, ktrd, kt ) 228 251 229 END SELECT230 252 231 253 !!$ CALLS TO THESE ROUTINES FOR 2D DIAGOSTICS NOT CODED YET
Note: See TracChangeset
for help on using the changeset viewer.