Changeset 9022
- Timestamp:
- 2017-12-13T17:38:29+01:00 (7 years ago)
- Location:
- branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/CONFIG/SHARED/field_def.xml
r8300 r9022 499 499 <field id="tke" long_name="Turbulent Kinetic Energy" unit="m2/s2" /> 500 500 <field id="tke_niw" long_name="Turbulent Kinetic Energy due to near-inertial wave breaking" unit="m2/s2" /> 501 <!-- variables available with dyn_vrt_dia - available with TODO FLAGS and TODO FLAGS --> 502 <field id="dia_vor_int-hpg" long_name="vertical integral vorticity tendencies for hpg" standard_name="vertically_integrated_vorticity_tendencies_hpg" unit="s-2" grid_ref="grid_W_2D" /> 503 <field id="dia_vor_mean-hpg" long_name="vertical mean vorticity tendencies for hpg" standard_name="vertical_mean_vorticity_tendencies_hpg" unit="s-2" grid_ref="grid_W_2D" /> 504 <field id="dia_vor_int-keg" long_name="vertical integral vorticity tendencies for keg" standard_name="vertically_integrated_vorticity_tendencies_keg" unit="s-2" grid_ref="grid_W_2D" /> 505 <field id="dia_vor_mean-keg" long_name="vertical mean vorticity tendencies for keg" standard_name="vertical_mean_vorticity_tendencies_keg" unit="s-2" grid_ref="grid_W_2D" /> 506 <field id="dia_vor_int-ldf" long_name="vertical integral vorticity tendencies for ldf" standard_name="vertically_integrated_vorticity_tendencies_ldf" unit="s-2" grid_ref="grid_W_2D" /> 507 <field id="dia_vor_mean-ldf" long_name="vertical mean vorticity tendencies for ldf" standard_name="vertical_mean_vorticity_tendencies_ldf" unit="s-2" grid_ref="grid_W_2D" /> 508 <field id="dia_vor_int-spg" long_name="vertical integral vorticity tendencies for spg" standard_name="vertically_integrated_vorticity_tendencies_spg" unit="s-2" grid_ref="grid_W_2D" /> 509 <field id="dia_vor_mean-spg" long_name="vertical mean vorticity tendencies for spg" standard_name="vertical_mean_vorticity_tendencies_spg" unit="s-2" grid_ref="grid_W_2D" /> 510 <field id="dia_vor_int-rvo" long_name="vertical integral vorticity tendencies for rvo" standard_name="vertically_integrated_vorticity_tendencies_rvo" unit="s-2" grid_ref="grid_W_2D" /> 511 <field id="dia_vor_mean-rvo" long_name="vertical mean vorticity tendencies for rvo" standard_name="vertical_mean_vorticity_tendencies_rvo" unit="s-2" grid_ref="grid_W_2D" /> 512 <field id="dia_vor_int-pvo" long_name="vertical integral vorticity tendencies for pvo" standard_name="vertically_integrated_vorticity_tendencies_pvo" unit="s-2" grid_ref="grid_W_2D" /> 513 <field id="dia_vor_mean-pvo" long_name="vertical mean vorticity tendencies for pvo" standard_name="vertical_mean_vorticity_tendencies_pvo" unit="s-2" grid_ref="grid_W_2D" /> 514 <field id="dia_vor_int-zad" long_name="vertical integral vorticity tendencies for zad" standard_name="vertically_integrated_vorticity_tendencies_zad" unit="s-2" grid_ref="grid_W_2D" /> 515 <field id="dia_vor_mean-zad" long_name="vertical mean vorticity tendencies for zad" standard_name="vertical_mean_vorticity_tendencies_zad" unit="s-2" grid_ref="grid_W_2D" /> 516 <field id="dia_vor_int-zdf" long_name="vertical integral vorticity tendencies for zdf" standard_name="vertically_integrated_vorticity_tendencies_zdf" unit="s-2" grid_ref="grid_W_2D" /> 517 <field id="dia_vor_mean-zdf" long_name="vertical mean vorticity tendencies for zdf" standard_name="vertical_mean_vorticity_tendencies_zdf" unit="s-2" grid_ref="grid_W_2D" /> 518 <field id="dia_vor_int-bfr" long_name="vertical integral vorticity tendencies for bfr" standard_name="vertically_integrated_vorticity_tendencies_bfr" unit="s-2" grid_ref="grid_W_2D" /> 519 <field id="dia_vor_mean-bfr" long_name="vertical mean vorticity tendencies for bfr" standard_name="vertical_mean_vorticity_tendencies_bfr" unit="s-2" grid_ref="grid_W_2D" /> 520 <field id="dia_vor_int-atf" long_name="vertical integral vorticity tendencies for atf" standard_name="vertically_integrated_vorticity_tendencies_atf" unit="s-2" grid_ref="grid_W_2D" /> 521 <field id="dia_vor_mean-atf" long_name="vertical mean vorticity tendencies for atf" standard_name="vertical_mean_vorticity_tendencies_atf" unit="s-2" grid_ref="grid_W_2D" /> 501 <!-- variables for trdvor output using ln_vor_trd --> 502 <!-- trdvor vertical average trends--> 503 <field id="sovortPh_avr" long_name="averaged vertical average tendencies for pressure gradient trend" standard_name="averaged_vor_grad_Ph" unit="s-2" grid_ref="grid_W_2D" /> 504 <field id="sovortEk_avr" long_name="averaged vertical average tendencies for kinetic energy trend" standard_name="averaged_vor_Energy" unit="s-2" grid_ref="grid_W_2D" /> 505 <field id="sovozeta_avr" long_name="averaged vertical average tendencies for relative vorticity trend" standard_name="averaged_vor_rel_vorticity" unit="s-2" grid_ref="grid_W_2D" /> 506 <field id="sovortif_avr" long_name="averaged vertical average tendencies for coriolis trend" standard_name="averaged_vor_coriolis" unit="s-2" grid_ref="grid_W_2D" /> 507 <field id="sovodifl_avr" long_name="averaged vertical average tendencies for horizontal diffusion" standard_name="averaged_vor_lat_diff" unit="s-2" grid_ref="grid_W_2D" /> 508 <field id="sovoadvv_avr" long_name="averaged vertical average tendencies for vertical advection" standard_name="averaged_vor_vert_adv" unit="s-2" grid_ref="grid_W_2D" /> 509 <field id="sovodifv_avr" long_name="averaged vertical average tendencies for vertical diffusion" standard_name="averaged_vor_vert_diff" unit="s-2" grid_ref="grid_W_2D" /> 510 <field id="sovortPs_avr" long_name="averaged vertical average tendencies for surface pressure gradient" standard_name="averaged_vor_grad_Ps" unit="s-2" grid_ref="grid_W_2D" /> 511 <field id="sovowind_avr" long_name="averaged vertical average tendencies for wind stress" standard_name="averaged_vor_wind_stress" unit="s-2" grid_ref="grid_W_2D" /> 512 <field id="sovobfri_avr" long_name="averaged vertical average tendencies for bottom friction" standard_name="averaged_vor_bottom_friction" unit="s-2" grid_ref="grid_W_2D" /> 513 <field id="1st_mbre_avr" long_name="averaged vertical average tendencies for 1st member of vrt eqn" standard_name="averaged_vor_1st_mbre" unit="s-2" grid_ref="grid_W_2D" /> 514 <field id="sovorgap_avr" long_name="averaged vertical average tendencies gap between 1st & 2nd member" standard_name="averaged_vor_gap" unit="s-2" grid_ref="grid_W_2D" /> 515 <!-- trdvor vertical integral trends--> 516 <field id="sovortPh_int" long_name="averaged vertical integral tendencies for pressure gradient trend" standard_name="integrated_vor_grad_Ph" unit="s-2" grid_ref="grid_W_2D" /> 517 <field id="sovortEk_int" long_name="averaged vertical integral tendencies for kinetic energy trend" standard_name="integrated_vor_Energy" unit="s-2" grid_ref="grid_W_2D" /> 518 <field id="sovozeta_int" long_name="averaged vertical integral tendencies for relative vorticity trend" standard_name="integrated_vor_rel_vorticity" unit="s-2" grid_ref="grid_W_2D" /> 519 <field id="sovortif_int" long_name="averaged vertical integral tendencies for coriolis trend" standard_name="integrated_vor_coriolis" unit="s-2" grid_ref="grid_W_2D" /> 520 <field id="sovodifl_int" long_name="averaged vertical integral tendencies for horizontal diffusion" standard_name="integrated_vor_lat_diff" unit="s-2" grid_ref="grid_W_2D" /> 521 <field id="sovoadvv_int" long_name="averaged vertical integral tendencies for vertical advection" standard_name="integrated_vor_vert_adv" unit="s-2" grid_ref="grid_W_2D" /> 522 <field id="sovodifv_int" long_name="averaged vertical integral tendencies for vertical diffusion" standard_name="integrated_vor_vert_diff" unit="s-2" grid_ref="grid_W_2D" /> 523 <field id="sovortPs_int" long_name="averaged vertical integral tendencies for surface pressure gradient" standard_name="integrated_vor_grad_Ps" unit="s-2" grid_ref="grid_W_2D" /> 524 <field id="sovowind_int" long_name="averaged vertical integral tendencies for wind stress" standard_name="integrated_vor_wind_stress" unit="s-2" grid_ref="grid_W_2D" /> 525 <field id="sovobfri_int" long_name="averaged vertical integral tendencies for bottom friction" standard_name="integrated_vor_bottom_friction" unit="s-2" grid_ref="grid_W_2D" /> 526 <field id="1st_mbre_int" long_name="averaged vertical integral tendencies for 1st member of vrt eqn" standard_name="integrated_vor_1st_mbre" unit="s-2" grid_ref="grid_W_2D" /> 527 <field id="sovorgap_int" long_name="averaged vertical integral tendencies gap between 1st & 2nd member" standard_name="integrated_vor_gap" unit="s-2" grid_ref="grid_W_2D" /> 522 528 </field_group> 523 529 -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90
r8300 r9022 35 35 USE wrk_nemo ! Memory Allocation 36 36 USE timing ! Timing 37 USE iom ! I/O Manager for dyn_vrt_dia_2d38 37 39 38 IMPLICIT NONE 40 39 PRIVATE 41 40 42 PUBLIC div_cur ! routine called by step.F90 and istate.F90 43 PUBLIC dyn_vrt_dia_3d ! routine called by various modules 44 PUBLIC dyn_vrt_dia_2d ! routine called by various modules 41 PUBLIC div_cur ! routine called by step.F90 and istate.F90 45 42 46 43 !! * Substitutions … … 341 338 342 339 #endif 343 344 345 SUBROUTINE dyn_vrt_dia_3d( utend, vtend, id_dia_vor)346 347 !!----------------------------------------------------------------------348 !!349 !! ** Purpose : compute the vertical integrals of utend and vtend, and350 !! then pass to dyn_vrt_dia_2d to calculate vorticity351 !! tendencies.352 !!353 !! ** Action : a) Calculate the vertical integrals of utend & of vtend354 !! (u_int & v_int)355 !! b) Call dyn_vrt_dia_2d with vertical integrals356 !!357 !!----------------------------------------------------------------------358 REAL :: utend(jpi,jpj,jpk) ! contribution to du/dt359 REAL :: vtend(jpi,jpj,jpk) ! contribution to dv/dt360 CHARACTER(len=3) :: id_dia_vor ! identifier for the diagnostic361 !362 !!----------------------------------------------------------------------363 !364 INTEGER :: ji, jj, jk ! dummy loop indices365 !366 REAL(wp), POINTER, DIMENSION(:,:) :: u_int ! u vertical integral367 REAL(wp), POINTER, DIMENSION(:,:) :: v_int ! v vertical integral368 369 CALL wrk_alloc(jpi, jpj, u_int)370 CALL wrk_alloc(jpi, jpj, v_int)371 372 u_int(:,:) = 0.0_wp373 v_int(:,:) = 0.0_wp374 375 !376 ! Calculate the vertical integrals of utend & of vtend377 !378 DO jk = 1, jpkm1379 DO jj = 2, jpjm1380 DO ji = fs_2, fs_jpim1381 u_int(ji,jj) = u_int(ji,jj) + ( utend(ji,jj,jk) * fse3u(ji,jj,jk) &382 & * e1u(ji,jj) * umask(ji,jj,jk) )383 v_int(ji,jj) = v_int(ji,jj) + ( vtend(ji,jj,jk) * fse3v(ji,jj,jk) &384 & * e2v(ji,jj) * vmask(ji,jj,jk) )385 END DO386 END DO387 END DO388 389 CALL dyn_vrt_dia_2d(u_int, v_int, id_dia_vor)390 391 CALL wrk_dealloc(jpi, jpj, u_int)392 CALL wrk_dealloc(jpi, jpj, v_int)393 394 END SUBROUTINE dyn_vrt_dia_3d395 396 397 SUBROUTINE dyn_vrt_dia_2d( u_int, v_int, id_dia_vor)398 399 !!----------------------------------------------------------------------400 !!401 !! ** Purpose : compute the integral and mean vorticity tendencies.402 !!403 !! ** Action : a) Calculate the vorticity tendencies for the vertical404 !! integrals.405 !! b) Calculate the vertical means, u_mn, v_mn from u_int406 !! and v_int by dividing by the depth407 !! c) Calculate the vorticity tendencies for the vertical408 !! means409 !! d) Call iom_put for the vertical integral vorticity410 !! tendencies (using cid_dia_vor_int)411 !! e) Call iom_put for the vertical mean vorticity412 !! tendencies (using cid_dia_vor_mn)413 !!414 !!----------------------------------------------------------------------415 REAL :: u_int(jpi,jpj) ! u vertical integral416 REAL :: v_int(jpi,jpj) ! v vertical integral417 CHARACTER(len=3) :: id_dia_vor ! identifier for the vorticity diagnostic418 !419 !!----------------------------------------------------------------------420 !421 INTEGER :: ji, jj ! dummy loop indices422 INTEGER :: ikbu, ikbv ! dummy loop indices423 !424 REAL(wp), POINTER, DIMENSION(:,:) :: u_mn ! u vertical means425 REAL(wp), POINTER, DIMENSION(:,:) :: v_mn ! u vertical means426 REAL(wp), POINTER, DIMENSION(:,:) :: vor_int ! vort trend of vert integrals427 REAL(wp), POINTER, DIMENSION(:,:) :: vor_mn ! vort trend of vert means428 CHARACTER(len=20) :: cid_dia_vor_int ! Identifier for iom_put429 CHARACTER(len=20) :: cid_dia_vor_mn ! Identifier for iom_put430 431 CALL wrk_alloc(jpi, jpj, u_mn)432 CALL wrk_alloc(jpi, jpj, v_mn)433 CALL wrk_alloc(jpi, jpj, vor_int)434 CALL wrk_alloc(jpi, jpj, vor_mn)435 436 CALL lbc_lnk( u_int, 'U', 1. )437 CALL lbc_lnk( v_int, 'V', 1. )438 439 WRITE ( cid_dia_vor_int, "(A16,A3)" ) "dia_vor_int-", id_dia_vor440 WRITE ( cid_dia_vor_mn, "(A17,A3)" ) "dia_vor_mean-", id_dia_vor441 442 !443 ! Calculate the vorticity tendencies for the vertical integrals.444 ! 1/e1e2 * ((d(vtend)/dx) - (d(utend)/dy))445 !446 447 DO jj = 2, jpjm1448 DO ji = fs_2, fs_jpim1449 vor_int(ji,jj) = ( ( v_int(ji+1,jj) - v_int(ji,jj) ) &450 & - ( u_int(ji,jj+1) - u_int(ji,jj) ) ) &451 & / ( e1f(ji,jj) * e2f(ji,jj) )452 END DO453 END DO454 455 ! Multiply by the surface mask456 vor_int(:,:) = vor_int(:,:) * fmask(:,:,1)457 458 !459 ! Calculate the vertical means, u_mn, v_mn from u_int & v_int by dividing460 ! by the depth461 ! mbku & mbkv - vertical index of the bottom last U- & W- ocean level462 !463 464 DO jj = 2, jpjm1465 DO ji = fs_2, fs_jpim1466 ikbu = mbku(ji,jj)467 ikbv = mbkv(ji,jj)468 469 IF (gdepw_n(ji,jj,ikbu+1) .ne. 0.0_wp) THEN ! Don't divide by 0!470 u_mn(ji,jj) = u_int(ji,jj) / gdepw_n(ji,jj,ikbu+1)471 ELSE472 u_mn(ji,jj) = 0.0_wp473 END IF474 475 IF (gdepw_n(ji,jj,ikbv+1) .ne. 0.0_wp) THEN ! Don't divide by 0!476 v_mn(ji,jj) = v_int(ji,jj) / gdepw_n(ji,jj,ikbv+1)477 ELSE478 v_mn(ji,jj) = 0.0_wp479 END IF480 END DO481 END DO482 483 !484 ! Calculate the vorticity tendencies for the vertical means485 ! 1/e1e2 * ((d(v_mn)/dx) - (d(u_mn)/dy))486 !487 488 DO jj = 2, jpjm1489 DO ji = fs_2, fs_jpim1490 vor_mn(ji,jj) = ( ( v_mn(ji+1,jj) - v_mn(ji,jj) ) &491 & - ( u_mn(ji,jj+1) - u_mn(ji,jj) ) ) &492 & / ( e1f(ji,jj) * e2f(ji,jj) )493 END DO494 END DO495 496 ! Multiply by the surface mask497 vor_mn(:,:) = vor_mn(:,:) * fmask(:,:,1)498 499 ! Call iom_put for the vertical integral vorticity tendencies500 CALL iom_put( cid_dia_vor_int, vor_int(:,:))501 502 ! Call iom_put for the vertical mean vorticity tendencies503 CALL iom_put( cid_dia_vor_mn, vor_mn(:,:))504 505 CALL wrk_dealloc(jpi, jpj, u_mn)506 CALL wrk_dealloc(jpi, jpj, v_mn)507 CALL wrk_dealloc(jpi, jpj, vor_int)508 CALL wrk_dealloc(jpi, jpj, vor_mn)509 510 END SUBROUTINE dyn_vrt_dia_2d511 512 513 340 !!====================================================================== 514 341 END MODULE divcur -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90
r8300 r9022 22 22 USE timing ! Timing 23 23 USE wrk_nemo ! Memory Allocation 24 USE divcur ! for dyn_vrt_dia25 24 26 25 IMPLICIT NONE … … 53 52 INTEGER :: ikbu, ikbv ! local integers 54 53 REAL(wp) :: zm1_2dt ! local scalar 55 CHARACTER(len=3) :: id_dyn_vrt_bfr = "bfr" ! TODO remove once flags set properly56 54 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 57 55 !!--------------------------------------------------------------------- … … 67 65 zm1_2dt = - 1._wp / ( 2._wp * rdt ) 68 66 69 IF( l_trddyn .OR. ( id_dyn_vrt_bfr == "bfr" )) THEN ! temporary save of ua and va trends67 IF( l_trddyn ) THEN ! temporary save of ua and va trends 70 68 CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv ) 71 69 ztrdu(:,:,:) = ua(:,:,:) … … 103 101 104 102 ! 105 IF( l_trddyn .OR. ( id_dyn_vrt_bfr == "bfr" )) THEN ! save the vertical diffusive trends for further diagnostics103 IF( l_trddyn ) THEN ! save the vertical diffusive trends for further diagnostics 106 104 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 107 105 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 108 IF( l_trddyn ) THEN 109 CALL trd_dyn( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_bfr, kt ) 110 ENDIF 111 IF( id_dyn_vrt_bfr == "bfr" ) THEN 112 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_dyn_vrt_bfr ) 113 ENDIF 106 CALL trd_dyn( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_bfr, kt ) 114 107 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 115 108 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r8300 r9022 36 36 USE trd_oce ! trends: ocean variables 37 37 USE trddyn ! trend manager: dynamics 38 USE divcur ! for dyn_vrt_dia_3d39 38 ! 40 39 USE in_out_manager ! I/O manager … … 83 82 !! - send trends to trd_dyn for futher diagnostics (l_trddyn=T) 84 83 !!---------------------------------------------------------------------- 85 INTEGER, INTENT(in) :: kt ! ocean time-step index 86 CHARACTER(len=3) :: id_vrt_dia_hpg = "hpg" ! TODO remove once flags set properly 84 INTEGER, INTENT(in) :: kt ! ocean time-step index 87 85 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 88 86 !!---------------------------------------------------------------------- … … 90 88 IF( nn_timing == 1 ) CALL timing_start('dyn_hpg') 91 89 ! 92 IF( l_trddyn .or. ( id_vrt_dia_hpg == "hpg" ) ) THEN! Temporary saving of ua and va trends (l_trddyn)90 IF( l_trddyn ) THEN ! Temporary saving of ua and va trends (l_trddyn) 93 91 CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv ) 94 92 ztrdu(:,:,:) = ua(:,:,:) … … 105 103 END SELECT 106 104 ! 107 IF( l_trddyn .or. ( id_vrt_dia_hpg == "hpg" )) THEN ! save the hydrostatic pressure gradient trends for momentum trend diagnostics105 IF( l_trddyn ) THEN ! save the hydrostatic pressure gradient trends for momentum trend diagnostics 108 106 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 109 107 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 110 ! 111 IF( id_vrt_dia_hpg == "hpg" ) THEN 112 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_hpg ) 113 END IF 114 IF( l_trddyn ) THEN 115 CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg, kt ) 116 END IF 108 CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg, kt ) 117 109 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 118 110 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90
r8300 r9022 17 17 USE trd_oce ! trends: ocean variables 18 18 USE trddyn ! trend manager: dynamics 19 USE divcur ! for dyn_vrt_dia_3d20 19 ! 21 20 USE in_out_manager ! I/O manager … … 75 74 INTEGER, INTENT( in ) :: kscheme ! =0/1 type of KEG scheme 76 75 ! 77 CHARACTER(len=3) :: id_vrt_dia_keg = "keg" ! TODO remove once flags set properly 78 INTEGER :: ji, jj, jk ! dummy loop indices 79 REAL(wp) :: zu, zv ! temporary scalars 76 INTEGER :: ji, jj, jk ! dummy loop indices 77 REAL(wp) :: zu, zv ! temporary scalars 80 78 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhke 81 79 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv … … 92 90 ENDIF 93 91 94 IF( l_trddyn .or. ( id_vrt_dia_keg == "keg" )) THEN ! Save ua and va trends92 IF( l_trddyn ) THEN ! Save ua and va trends 95 93 CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv ) 96 94 ztrdu(:,:,:) = ua(:,:,:) … … 145 143 END DO 146 144 ! 147 IF( l_trddyn .or. ( id_vrt_dia_keg == "keg" ) ) THEN! save the Kinetic Energy trends for diagnostic145 IF( l_trddyn ) THEN ! save the Kinetic Energy trends for diagnostic 148 146 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 149 147 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 150 ! 151 IF( id_vrt_dia_keg == "keg" ) THEN 152 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_keg ) 153 END IF 154 ! 155 IF( l_trddyn ) THEN 156 CALL trd_dyn( ztrdu, ztrdv, jpdyn_keg, kt ) 157 END IF 158 ! 148 CALL trd_dyn( ztrdu, ztrdv, jpdyn_keg, kt ) 159 149 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 160 150 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90
r8300 r9022 30 30 USE wrk_nemo ! Memory Allocation 31 31 USE timing ! Timing 32 USE divcur ! Used by dyn_vrt_dia33 32 34 33 IMPLICIT NONE … … 58 57 INTEGER, INTENT(in) :: kt ! ocean time-step index 59 58 ! 60 CHARACTER(len=3) :: id_vrt_dia_ldf = "ldf" ! TODO Replace once proper flags in place61 59 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 62 60 !!---------------------------------------------------------------------- … … 64 62 IF( nn_timing == 1 ) CALL timing_start('dyn_ldf') 65 63 ! 66 IF( l_trddyn .or. ( id_vrt_dia_ldf == "ldf" ) ) THEN! temporary save of ta and sa trends64 IF( l_trddyn ) THEN ! temporary save of ta and sa trends 67 65 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 68 66 ztrdu(:,:,:) = ua(:,:,:) … … 105 103 END SELECT 106 104 107 IF( l_trddyn .or. ( id_vrt_dia_ldf == "ldf" ) ) THEN! save the horizontal diffusive trends for further diagnostics105 IF( l_trddyn ) THEN ! save the horizontal diffusive trends for further diagnostics 108 106 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 109 107 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 110 IF( id_vrt_dia_ldf == "ldf" ) THEN 111 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_ldf ) 112 END IF 113 IF( l_trddyn ) THEN 114 CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt ) 115 END IF 108 CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt ) 116 109 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 117 110 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
r8300 r9022 46 46 USE prtctl ! Print control 47 47 USE timing ! Timing 48 USE divcur ! for dyn_vrt_dia49 48 #if defined key_agrif 50 49 USE agrif_opa_interp … … 107 106 REAL(wp) :: zue3a, zue3n, zue3b, zuf, zec ! local scalars 108 107 REAL(wp) :: zve3a, zve3n, zve3b, zvf, z1_2dt ! - - 109 CHARACTER(len=3) :: id_dyn_vrt_atf = "atf" ! TODO remove once flags done110 108 REAL(wp), POINTER, DIMENSION(:,:) :: zue, zve 111 109 REAL(wp), POINTER, DIMENSION(:,:,:) :: ze3u_f, ze3v_f, zua, zva … … 205 203 #endif 206 204 207 IF( l_trddyn .OR. ( id_dyn_vrt_atf == "atf" )) THEN ! prepare the atf trend computation + some diagnostics205 IF( l_trddyn ) THEN ! prepare the atf trend computation + some diagnostics 208 206 z1_2dt = 1._wp / (2. * rdt) ! Euler or leap-frog time step 209 IF( l_trddyn ) THEN 210 IF( neuler == 0 .AND. kt == nit000 ) z1_2dt = 1._wp / rdt 211 ! 212 ! ! Kinetic energy and Conversion 213 IF( ln_KE_trd ) CALL trd_dyn( ua, va, jpdyn_ken, kt ) 214 ! 215 IF( ln_dyn_trd ) THEN ! 3D output: total momentum trends 216 zua(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) * z1_2dt 217 zva(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) * z1_2dt 218 CALL iom_put( "utrd_tot", zua ) ! total momentum trends, except the asselin time filter 219 CALL iom_put( "vtrd_tot", zva ) 220 ENDIF 207 IF( neuler == 0 .AND. kt == nit000 ) z1_2dt = 1._wp / rdt 208 ! 209 ! ! Kinetic energy and Conversion 210 IF( ln_KE_trd ) CALL trd_dyn( ua, va, jpdyn_ken, kt ) 211 ! 212 IF( ln_dyn_trd ) THEN ! 3D output: total momentum trends 213 zua(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) * z1_2dt 214 zva(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) * z1_2dt 215 CALL iom_put( "utrd_tot", zua ) ! total momentum trends, except the asselin time filter 216 CALL iom_put( "vtrd_tot", zva ) 221 217 ENDIF 222 218 ! … … 396 392 ! 397 393 398 IF( l_trddyn .OR. ( id_dyn_vrt_atf == "atf" )) THEN ! 3D output: asselin filter trends on momentum394 IF( l_trddyn ) THEN ! 3D output: asselin filter trends on momentum 399 395 zua(:,:,:) = ( ub(:,:,:) - zua(:,:,:) ) * z1_2dt 400 396 zva(:,:,:) = ( vb(:,:,:) - zva(:,:,:) ) * z1_2dt 401 IF( id_dyn_vrt_atf == "atf" ) THEN ! 3D output: asselin filter trends on momentum 402 CALL dyn_vrt_dia_3d( zua, zva, id_dyn_vrt_atf ) 403 ENDIF 404 IF( l_trddyn ) THEN ! 3D output: asselin filter trends on momentum 405 CALL trd_dyn( zua, zva, jpdyn_atf, kt ) 406 ENDIF 397 CALL trd_dyn( zua, zva, jpdyn_atf, kt ) 407 398 ENDIF 408 399 ! -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
r8300 r9022 35 35 USE wrk_nemo ! Memory Allocation 36 36 USE timing ! Timing 37 USE divcur ! for dyn_vrt_dia_3d38 37 39 38 … … 90 89 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 91 90 REAL(wp), POINTER, DIMENSION(:,:) :: zpice 92 CHARACTER(len=3) :: id_vrt_dia_spg = "spg" ! TODO remove once flags set properly93 91 !!---------------------------------------------------------------------- 94 92 ! … … 101 99 102 100 103 IF( l_trddyn .or. ( id_vrt_dia_spg == "spg" ) ) THEN! temporary save of ta and sa trends104 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 101 IF( l_trddyn ) THEN ! temporary save of ta and sa trends 102 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 105 103 ztrdu(:,:,:) = ua(:,:,:) 106 104 ztrdv(:,:,:) = va(:,:,:) … … 190 188 END SELECT 191 189 ! 192 IF( l_trddyn .or. ( id_vrt_dia_spg == "spg" ) ) THEN! save the surface pressure gradient trends for further diagnostics190 IF( l_trddyn ) THEN ! save the surface pressure gradient trends for further diagnostics 193 191 SELECT CASE ( nspg ) 194 192 CASE ( 0, 1 ) … … 201 199 ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / z2dt - ztrdv(:,:,:) 202 200 END SELECT 203 ! 204 IF( id_vrt_dia_spg == "spg" ) THEN 205 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_spg ) 206 END IF 207 ! 208 IF( l_trddyn ) THEN 209 CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 210 END IF 201 CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 211 202 ! 212 203 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r8300 r9022 137 137 z2dtg = grav * z2dt 138 138 139 IF( l_trddyn ) CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) ! temporary save of spg trends 140 139 141 ! Evaluate the masked next velocity (effect of the additional force not included) 140 142 ! --------------------------------- … … 185 187 ! 186 188 IF( l_trddyn ) THEN ! temporary save of spg trends 187 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv )188 189 DO jk = 1, jpkm1 ! unweighted time stepping 189 190 DO jj = 2, jpjm1 -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
r7900 r9022 41 41 USE timing ! Timing 42 42 USE sbcapr ! surface boundary condition: atmospheric pressure 43 USE divcur ! for dyn_vrt_dia_2d44 43 USE dynadv, ONLY: ln_dynadv_vec 45 44 #if defined key_agrif … … 145 144 INTEGER :: ji, jj, jk, jn ! dummy loop indices 146 145 INTEGER :: ikbu, ikbv, noffset ! local integers 147 INTEGER :: id_dia_vrt_spg_int = 1 ! TODO remove once flags set properly148 INTEGER :: id_dia_vrt_spg_mean = 1 ! TODO remove once flags set properly149 146 REAL(wp) :: zraur, z1_2dt_b, z2dt_bf ! local scalars 150 147 REAL(wp) :: zx1, zy1, zx2, zy2 ! - - 151 148 REAL(wp) :: z1_12, z1_8, z1_4, z1_2 ! - - 149 REAL(wp) :: zu_spg, zv_spg ! - - 152 150 REAL(wp) :: zhura, zhvra ! - - 153 151 REAL(wp) :: za0, za1, za2, za3 ! - - … … 158 156 REAL(wp), POINTER, DIMENSION(:,:) :: zhup2_e, zhvp2_e, zhust_e, zhvst_e 159 157 REAL(wp), POINTER, DIMENSION(:,:) :: zsshu_a, zsshv_a 160 REAL(wp), POINTER, DIMENSION(:,:) :: zu_dia, zv_dia, zu_wfrc, zv_wfrc161 REAL(wp), POINTER, DIMENSION(:,:) :: zu_spg, zv_spg162 158 REAL(wp), POINTER, DIMENSION(:,:) :: zhf 163 159 !!---------------------------------------------------------------------- … … 171 167 CALL wrk_alloc( jpi, jpj, zhup2_e, zhvp2_e, zhust_e, zhvst_e) 172 168 CALL wrk_alloc( jpi, jpj, zsshu_a, zsshv_a ) 173 CALL wrk_alloc( jpi, jpj, zu_dia, zv_dia, zu_wfrc, zv_wfrc )174 CALL wrk_alloc( jpi, jpj, zu_spg, zv_spg )175 169 CALL wrk_alloc( jpi, jpj, zhf ) 176 170 ! … … 400 394 END DO 401 395 ! 402 ! ! Set zu_dia for use in dyn_vrt_dia403 zu_dia(:,:) = zu_frc(:,:)404 zv_dia(:,:) = zv_frc(:,:)405 !406 396 ! ! Add bottom stress contribution from baroclinic velocities: 407 397 IF (ln_bt_fw) THEN … … 430 420 ! 431 421 IF (ln_bt_fw) THEN ! Add wind forcing 432 zu_ wfrc(:,:) =zraur * utau(:,:) * hur(:,:)433 zv_ wfrc(:,:) =zraur * vtau(:,:) * hvr(:,:)422 zu_frc(:,:) = zu_frc(:,:) + zraur * utau(:,:) * hur(:,:) 423 zv_frc(:,:) = zv_frc(:,:) + zraur * vtau(:,:) * hvr(:,:) 434 424 ELSE 435 zu_ wfrc(:,:) =zraur * z1_2 * ( utau_b(:,:) + utau(:,:) ) * hur(:,:)436 zv_ wfrc(:,:) =zraur * z1_2 * ( vtau_b(:,:) + vtau(:,:) ) * hvr(:,:)425 zu_frc(:,:) = zu_frc(:,:) + zraur * z1_2 * ( utau_b(:,:) + utau(:,:) ) * hur(:,:) 426 zv_frc(:,:) = zv_frc(:,:) + zraur * z1_2 * ( vtau_b(:,:) + vtau(:,:) ) * hvr(:,:) 437 427 ENDIF 438 zu_frc(:,:) = zu_frc(:,:) + zu_wfrc(:,:)439 zv_frc(:,:) = zv_frc(:,:) + zv_wfrc(:,:)440 441 ! Calculate dia_vor_int & dia_vor_mn if required442 IF ( ( id_dia_vrt_spg_int == 1 ) .or. (id_dia_vrt_spg_mean == 1 ) ) THEN443 zu_dia(:,:) = zu_dia(:,:) + zu_wfrc(:,:)444 zv_dia(:,:) = zv_dia(:,:) + zv_wfrc(:,:)445 CALL dyn_vrt_dia_2d(zu_dia, zv_dia, id_dia_vrt_spg_int, id_dia_vrt_spg_mean)446 ! Reset zu_dia for use again later.447 zu_dia(:,:) = zu_dia(:,:) - zu_wfrc(:,:)448 zv_dia(:,:) = zv_dia(:,:) - zv_wfrc(:,:)449 END IF450 !451 428 ! 452 429 IF ( ln_apr_dyn ) THEN ! Add atm pressure forcing … … 454 431 DO jj = 2, jpjm1 455 432 DO ji = fs_2, fs_jpim1 ! vector opt. 456 zu_spg(ji,jj) = grav * ( ssh_ib (ji+1,jj ) - ssh_ib (ji,jj) ) /e1u(ji,jj) 457 zv_spg(ji,jj) = grav * ( ssh_ib (ji ,jj+1) - ssh_ib (ji,jj) ) /e2v(ji,jj) 433 zu_spg = grav * ( ssh_ib (ji+1,jj ) - ssh_ib (ji,jj) ) /e1u(ji,jj) 434 zv_spg = grav * ( ssh_ib (ji ,jj+1) - ssh_ib (ji,jj) ) /e2v(ji,jj) 435 zu_frc(ji,jj) = zu_frc(ji,jj) + zu_spg 436 zv_frc(ji,jj) = zv_frc(ji,jj) + zv_spg 458 437 END DO 459 438 END DO … … 461 440 DO jj = 2, jpjm1 462 441 DO ji = fs_2, fs_jpim1 ! vector opt. 463 zu_spg (ji,jj)= grav * z1_2 * ( ssh_ib (ji+1,jj ) - ssh_ib (ji,jj) &442 zu_spg = grav * z1_2 * ( ssh_ib (ji+1,jj ) - ssh_ib (ji,jj) & 464 443 & + ssh_ibb(ji+1,jj ) - ssh_ibb(ji,jj) ) /e1u(ji,jj) 465 zv_spg (ji,jj)= grav * z1_2 * ( ssh_ib (ji ,jj+1) - ssh_ib (ji,jj) &444 zv_spg = grav * z1_2 * ( ssh_ib (ji ,jj+1) - ssh_ib (ji,jj) & 466 445 & + ssh_ibb(ji ,jj+1) - ssh_ibb(ji,jj) ) /e2v(ji,jj) 446 zu_frc(ji,jj) = zu_frc(ji,jj) + zu_spg 447 zv_frc(ji,jj) = zv_frc(ji,jj) + zv_spg 467 448 END DO 468 449 END DO 469 450 ENDIF 470 zu_frc(:,:) = zu_frc(:,:) + zu_spg(:,:) 471 zv_frc(:,:) = zv_frc(:,:) + zv_spg(:,:) 472 ! Calculate dia_vor_int & dia_vor_mn if required 473 IF ( ( id_dia_vrt_spg_int == 1 ) .or. (id_dia_vrt_spg_mean == 1 ) ) THEN 474 zu_dia(:,:) = zu_dia(:,:) + zu_spg(:,:) 475 zv_dia(:,:) = zv_dia(:,:) + zv_spg(:,:) 476 CALL dyn_vrt_dia_2d(zu_dia, zv_dia, id_dia_vrt_spg_int, id_dia_vrt_spg_mean) 477 END IF 478 ENDIF 479 ! 451 ENDIF 480 452 ! !* Right-Hand-Side of the barotropic ssh equation 481 453 ! ! ----------------------------------------------- … … 952 924 CALL wrk_dealloc( jpi, jpj, zhup2_e, zhvp2_e, zhust_e, zhvst_e ) 953 925 CALL wrk_dealloc( jpi, jpj, zsshu_a, zsshv_a ) 954 CALL wrk_dealloc( jpi, jpj, zu_dia, zv_dia, zu_wfrc, zv_wfrc )955 CALL wrk_dealloc( jpi, jpj, zu_spg, zv_spg )956 926 CALL wrk_dealloc( jpi, jpj, zhf ) 957 927 ! -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
r8300 r9022 38 38 USE wrk_nemo ! Memory Allocation 39 39 USE timing ! Timing 40 USE divcur ! For dyn_vrt_dia_3d41 40 42 41 … … 81 80 INTEGER, INTENT( in ) :: kt ! ocean time-step index 82 81 ! 83 CHARACTER(len=3) :: id_vrt_dia_rvo = "rvo" ! TODO remove once flags set properly84 CHARACTER(len=3) :: id_vrt_dia_pvo = "pvo" ! TODO remove once flags set properly85 82 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 86 83 !!---------------------------------------------------------------------- … … 88 85 IF( nn_timing == 1 ) CALL timing_start('dyn_vor') 89 86 ! 90 IF( l_trddyn .or. ( id_vrt_dia_rvo == "rvo" )) CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )87 IF( l_trddyn ) CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv ) 91 88 ! 92 89 ! ! vorticity term … … 108 105 ! 109 106 CASE ( 0 ) ! energy conserving scheme 110 IF( l_trddyn .or. ( id_vrt_dia_rvo == "rvo" )) THEN107 IF( l_trddyn ) THEN 111 108 ztrdu(:,:,:) = ua(:,:,:) 112 109 ztrdv(:,:,:) = va(:,:,:) … … 114 111 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 115 112 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 116 IF( l_trddyn ) THEN 117 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 118 END IF 119 IF( id_vrt_dia_rvo == "rvo" ) THEN 120 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_rvo ) 121 END IF 113 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 122 114 ztrdu(:,:,:) = ua(:,:,:) 123 115 ztrdv(:,:,:) = va(:,:,:) … … 125 117 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 126 118 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 127 IF( l_trddyn ) THEN 128 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 129 END IF 130 IF( id_vrt_dia_pvo == "pvo" ) THEN 131 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_pvo ) 132 END IF 119 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 133 120 ELSE 134 121 CALL vor_ene( kt, ntot, ua, va ) ! total vorticity … … 136 123 ! 137 124 CASE ( 1 ) ! enstrophy conserving scheme 138 IF( l_trddyn .or. ( id_vrt_dia_rvo == "rvo" ) ) THEN125 IF( l_trddyn ) THEN 139 126 ztrdu(:,:,:) = ua(:,:,:) 140 127 ztrdv(:,:,:) = va(:,:,:) … … 142 129 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 143 130 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 144 IF( l_trddyn ) THEN 145 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 146 END IF 147 IF( id_vrt_dia_rvo == "rvo" ) THEN 148 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_rvo ) 149 END IF 131 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 150 132 ztrdu(:,:,:) = ua(:,:,:) 151 133 ztrdv(:,:,:) = va(:,:,:) … … 153 135 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 154 136 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 155 IF( l_trddyn ) THEN 156 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 157 END IF 158 IF( id_vrt_dia_pvo == "pvo" ) THEN 159 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_pvo ) 160 END IF 137 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 161 138 ELSE 162 139 CALL vor_ens( kt, ntot, ua, va ) ! total vorticity … … 164 141 ! 165 142 CASE ( 2 ) ! mixed ene-ens scheme 166 IF( l_trddyn .or. ( id_vrt_dia_rvo == "rvo" )) THEN143 IF( l_trddyn ) THEN 167 144 ztrdu(:,:,:) = ua(:,:,:) 168 145 ztrdv(:,:,:) = va(:,:,:) … … 170 147 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 171 148 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 172 IF( l_trddyn ) THEN 173 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 174 END IF 175 IF( id_vrt_dia_rvo == "rvo" ) THEN 176 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_rvo ) 177 END IF 149 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 178 150 ztrdu(:,:,:) = ua(:,:,:) 179 151 ztrdv(:,:,:) = va(:,:,:) … … 181 153 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 182 154 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 183 IF( l_trddyn ) THEN 184 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 185 END IF 186 IF( id_vrt_dia_pvo == "pvo" ) THEN 187 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_pvo ) 188 END IF 155 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 189 156 ELSE 190 157 CALL vor_mix( kt ) ! total vorticity (mix=ens-ene) … … 192 159 ! 193 160 CASE ( 3 ) ! energy and enstrophy conserving scheme 194 IF( l_trddyn .or. ( id_vrt_dia_rvo == "rvo" )) THEN161 IF( l_trddyn ) THEN 195 162 ztrdu(:,:,:) = ua(:,:,:) 196 163 ztrdv(:,:,:) = va(:,:,:) … … 198 165 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 199 166 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 200 IF( l_trddyn ) THEN 201 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 202 END IF 203 IF( id_vrt_dia_rvo == "rvo" ) THEN 204 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_rvo ) 205 END IF 167 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 206 168 ztrdu(:,:,:) = ua(:,:,:) 207 169 ztrdv(:,:,:) = va(:,:,:) … … 209 171 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 210 172 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 211 IF( l_trddyn ) THEN 212 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 213 END IF 214 IF( id_vrt_dia_pvo == "pvo" ) THEN 215 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_pvo ) 216 END IF 173 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 217 174 ELSE 218 175 CALL vor_een( kt, ntot, ua, va ) ! total vorticity … … 225 182 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) 226 183 ! 227 IF( l_trddyn .or. (id_vrt_dia_rvo == "rvo" )) CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )184 IF( l_trddyn ) CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 228 185 ! 229 186 IF( nn_timing == 1 ) CALL timing_stop('dyn_vor') -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90
r8300 r9022 18 18 USE trd_oce ! trends: ocean variables 19 19 USE trddyn ! trend manager: dynamics 20 USE divcur ! for dyn_vrt_dia_3d21 20 ! 22 21 USE in_out_manager ! I/O manager … … 60 59 INTEGER, INTENT(in) :: kt ! ocean time-step inedx 61 60 ! 62 CHARACTER(len=3) :: id_vrt_dia_zad = "zad" ! TODO remove once flags set properly 63 INTEGER :: ji, jj, jk ! dummy loop indices 64 INTEGER :: zua, zva ! temporary scalars 61 INTEGER :: ji, jj, jk ! dummy loop indices 62 REAL(wp) :: zua, zva ! temporary scalars 65 63 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwuw , zwvw 66 64 REAL(wp), POINTER, DIMENSION(:,: ) :: zww … … 78 76 ENDIF 79 77 80 IF( l_trddyn .OR. ( id_vrt_dia_zad == "zad" )) THEN ! Save ua and va trends78 IF( l_trddyn ) THEN ! Save ua and va trends 81 79 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 82 80 ztrdu(:,:,:) = ua(:,:,:) … … 132 130 END DO 133 131 134 IF( l_trddyn .OR. ( id_vrt_dia_zad == "zad" ) ) THEN! save the vertical advection trends for diagnostic132 IF( l_trddyn ) THEN ! save the vertical advection trends for diagnostic 135 133 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 136 134 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 137 ! 138 IF( id_vrt_dia_zad == "zad" ) THEN 139 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_zad ) 140 ENDIF 141 ! 142 IF( l_trddyn ) THEN 143 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zad, kt ) 144 ENDIF 145 ! 135 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zad, kt ) 146 136 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 147 137 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90
r8300 r9022 27 27 USE wrk_nemo ! Memory Allocation 28 28 USE timing ! Timing 29 USE divcur ! for dyn_vrt_dia30 29 31 30 IMPLICIT NONE … … 60 59 ! 61 60 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 62 CHARACTER(len=3) :: id_vrt_dia_zdf = "zdf" ! TODO remove once flags properly set63 61 !!--------------------------------------------------------------------- 64 62 ! … … 70 68 ENDIF 71 69 72 IF( l_trddyn .or. ( id_vrt_dia_zdf == "zdf" ) ) THEN! temporary save of ta and sa trends70 IF( l_trddyn ) THEN ! temporary save of ta and sa trends 73 71 CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 74 72 ztrdu(:,:,:) = ua(:,:,:) … … 90 88 END SELECT 91 89 92 IF( l_trddyn .or. ( id_vrt_dia_zdf == "zdf" ) ) THEN! save the vertical diffusive trends for further diagnostics90 IF( l_trddyn ) THEN ! save the vertical diffusive trends for further diagnostics 93 91 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 94 92 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 95 ! 96 IF( id_vrt_dia_zdf == "zdf" ) THEN 97 CALL dyn_vrt_dia_3d( ztrdu, ztrdv, id_vrt_dia_zdf ) 98 END IF 99 ! 100 IF( l_trddyn ) THEN 101 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt ) 102 END IF 103 ! 93 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt ) 104 94 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 105 95 ENDIF -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90
r6486 r9022 88 88 89 89 !!gm end 90 IF( ln_tra_mxl .OR. ln_vor_trd) CALL ctl_stop( 'ML tracer and Barotropic vorticity diags are still using old IOIPSL' )90 IF( ln_tra_mxl ) CALL ctl_stop( 'ML tracer and Barotropic vorticity diags are still using old IOIPSL' ) 91 91 !!gm end 92 92 ! 93 IF( lk_vvl .AND. ( l_trdtra .OR. l_trddyn )) CALL ctl_stop( 'trend diagnostics with variable volume not validated' )93 IF( lk_vvl .AND. l_trdtra ) CALL ctl_stop( 'trend diagnostics with variable volume not validated' ) 94 94 95 95 !!gm : Potential BUG : 3D output only for vector invariant form! add a ctl_stop or code the flux form case -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90
r6486 r9022 28 28 USE lib_mpp ! MPP library 29 29 USE wrk_nemo ! Memory allocation 30 USE iom ! I/O manager library 30 31 31 32 IMPLICIT NONE … … 40 41 PUBLIC trd_vor_alloc ! routine called by nemogcm.F90 41 42 42 INTEGER :: nh_t, nmoydpvor, nidvor, nhoridvor, ndimvor1, icount ! needs for IOIPSL output 43 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndexvor1 ! needed for IOIPSL output 43 INTEGER :: nmoydpvor ! needs for IOIPSL output 44 44 INTEGER :: ndebug ! (0/1) set it to 1 in case of problem to have more print 45 45 46 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avr ! average 47 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avrb ! before vorticity (kt-1) 48 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avrbb ! vorticity at begining of the nwrite-1 timestep averaging period 49 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avrbn ! after vorticity at time step after the 50 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: rotot ! begining of the NWRITE-1 timesteps 51 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avrtot ! 52 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: vor_avrres ! 53 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vortrd ! curl of trends 46 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor ! time average 47 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_b ! before vorticity (kt-1) 48 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_bb ! vorticity at begining of the nwrite-1 timestep averaging period 49 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_bn ! after vorticity at time step after 50 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: rotot ! begining of the NWRITE-1 timesteps 51 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: intvor_tot ! 52 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: avrvor_tot ! 53 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: intvor_res ! 54 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: avrvor_res ! 55 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: intvortrd ! vertically integrated curl of trends 56 REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avrvortrd ! vertically averaged curl of trends 54 57 55 58 CHARACTER(len=12) :: cvort … … 70 73 !! *** ROUTINE trd_vor_alloc *** 71 74 !!---------------------------------------------------------------------------- 72 ALLOCATE( vor_avr (jpi,jpj) , vor_avrb(jpi,jpj) , vor_avrbb (jpi,jpj) , & 73 & vor_avrbn (jpi,jpj) , rotot (jpi,jpj) , vor_avrtot(jpi,jpj) , & 74 & vor_avrres(jpi,jpj) , vortrd (jpi,jpj,jpltot_vor) , & 75 & ndexvor1 (jpi*jpj) , STAT= trd_vor_alloc ) 75 ALLOCATE( vor (jpi,jpj,jpvor_types) , vor_b (jpi,jpj,jpvor_types) , & 76 & vor_bb(jpi,jpj,jpvor_types) , vor_bn (jpi,jpj,jpvor_types) , & 77 & rotot (jpi,jpj,jpvor_types) , intvor_tot(jpi,jpj) , & 78 & avrvor_tot(jpi,jpj) , intvor_res(jpi,jpj) , & 79 & avrvor_res(jpi,jpj) , intvortrd(jpi,jpj,jpltot_vor), & 80 & avrvortrd(jpi,jpj,jpltot_vor), STAT= trd_vor_alloc ) 76 81 ! 77 82 IF( lk_mpp ) CALL mpp_sum ( trd_vor_alloc ) … … 122 127 CALL trd_vor_iom( kt ) 123 128 END SELECT 124 !125 129 CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 126 130 ! … … 138 142 !! 139 143 !! ** Action : trends : 140 !! vortrd (,, 1) = Pressure Gradient Trend 141 !! vortrd (,, 2) = KE Gradient Trend 142 !! vortrd (,, 3) = Relative Vorticity Trend 143 !! vortrd (,, 4) = Coriolis Term Trend 144 !! vortrd (,, 5) = Horizontal Diffusion Trend 145 !! vortrd (,, 6) = Vertical Advection Trend 146 !! vortrd (,, 7) = Vertical Diffusion Trend 147 !! vortrd (,, 8) = Surface Pressure Grad. Trend 148 !! vortrd (,, 9) = Beta V 149 !! vortrd (,,10) = forcing term 150 !! vortrd (,,11) = bottom friction term 151 !! rotot(,) : total cumulative trends over nwrite-1 time steps 152 !! vor_avrtot(,) : first membre of vrticity equation 153 !! vor_avrres(,) : residual = dh/dt entrainment 144 !! intvortrd (,, 1) = Vertical integral of Pressure Gradient Trend 145 !! intvortrd (,, 2) = Vertical integral of KE Gradient Trend 146 !! intvortrd (,, 3) = Vertical integral of Relative Vorticity Trend 147 !! intvortrd (,, 4) = Vertical integral of Coriolis Term Trend 148 !! intvortrd (,, 5) = Vertical integral of Horizontal Diffusion Trend 149 !! intvortrd (,, 6) = Vertical integral of Vertical Advection Trend 150 !! intvortrd (,, 7) = Vertical integral of Vertical Diffusion Trend 151 !! intvortrd (,, 8) = Vertical integral of Surface Pressure Grad. Trend 152 !! intvortrd (,,10) = Vertical integral of forcing term 153 !! intvortrd (,,11) = Vertical integral of bottom friction term 154 !! avrvortrd (,, 1) = Vertical average of Pressure Gradient Trend 155 !! avrvortrd (,, 2) = Vertical average of KE Gradient Trend 156 !! avrvortrd (,, 3) = Vertical average of Relative Vorticity Trend 157 !! avrvortrd (,, 4) = Vertical average of Coriolis Term Trend 158 !! avrvortrd (,, 5) = Vertical average of Horizontal Diffusion Trend 159 !! avrvortrd (,, 6) = Vertical average of Vertical Advection Trend 160 !! avrvortrd (,, 7) = Vertical average of Vertical Diffusion Trend 161 !! avrvortrd (,, 8) = Vertical average of Surface Pressure Grad. Trend 162 !! avrvortrd (,,10) = Vertical average of forcing term 163 !! avrvortrd (,,11) = Vertical average of bottom friction term 164 !! rotot (,,1) = total cumulative vertical integral trends over nwrite-1 time steps 165 !! rotot (,,2) = total cumulative vertical average trends over nwrite-1 time steps 166 !! intvor_tot(,,) = first membre of vrticity equation for vertical integral 167 !! avrvor_tot(,,) = first membre of vrticity equation for vertical average 168 !! intvor_res(,,) = residual = dh/dt entrainment for vertical integral 169 !! avrvor_res(,,) = residual = dh/dt entrainment for vertical average 154 170 !! 155 171 !! trends output in netCDF format using ioipsl … … 194 210 END SELECT 195 211 196 ! Average except for Beta.V 212 ! Curl of the vertical integral 213 DO ji = 1, jpim1 214 DO jj = 1, jpjm1 215 intvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & 216 & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 217 END DO 218 END DO 219 intvortrd(:,:,ktrd) = intvortrd(:,:,ktrd) * fmask(:,:,1) ! Surface mask 220 197 221 zudpvor(:,:) = zudpvor(:,:) * hur(:,:) 198 222 zvdpvor(:,:) = zvdpvor(:,:) * hvr(:,:) 199 223 200 ! Curl 224 ! Curl of the vertical average 201 225 DO ji = 1, jpim1 202 226 DO jj = 1, jpjm1 203 vortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) &227 avrvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & 204 228 & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 205 229 END DO 206 230 END DO 207 vortrd(:,:,ktrd) =vortrd(:,:,ktrd) * fmask(:,:,1) ! Surface mask231 avrvortrd(:,:,ktrd) = avrvortrd(:,:,ktrd) * fmask(:,:,1) ! Surface mask 208 232 209 233 IF( ndebug /= 0 ) THEN … … 227 251 !! 228 252 !! ** Action : trends : 229 !! vortrd (,,1) = Pressure Gradient Trend 230 !! vortrd (,,2) = KE Gradient Trend 231 !! vortrd (,,3) = Relative Vorticity Trend 232 !! vortrd (,,4) = Coriolis Term Trend 233 !! vortrd (,,5) = Horizontal Diffusion Trend 234 !! vortrd (,,6) = Vertical Advection Trend 235 !! vortrd (,,7) = Vertical Diffusion Trend 236 !! vortrd (,,8) = Surface Pressure Grad. Trend 237 !! vortrd (,,9) = Beta V 238 !! vortrd (,,10) = forcing term 239 !! vortrd (,,11) = bottom friction term 240 !! rotot(,) : total cumulative trends over nwrite-1 time steps 241 !! vor_avrtot(,) : first membre of vrticity equation 242 !! vor_avrres(,) : residual = dh/dt entrainment 243 !! 244 !! trends output in netCDF format using ioipsl 253 !! intvortrd (,, 1) = Vertical integral of Pressure Gradient Trend 254 !! intvortrd (,, 2) = Vertical integral of KE Gradient Trend 255 !! intvortrd (,, 3) = Vertical integral of Relative Vorticity Trend 256 !! intvortrd (,, 4) = Vertical integral of Coriolis Term Trend 257 !! intvortrd (,, 5) = Vertical integral of Horizontal Diffusion Trend 258 !! intvortrd (,, 6) = Vertical integral of Vertical Advection Trend 259 !! intvortrd (,, 7) = Vertical integral of Vertical Diffusion Trend 260 !! intvortrd (,, 8) = Vertical integral of Surface Pressure Grad. Trend 261 !! intvortrd (,,10) = Vertical integral of forcing term 262 !! intvortrd (,,11) = Vertical integral of bottom friction term 263 !! avrvortrd (,, 1) = Vertical average of Pressure Gradient Trend 264 !! avrvortrd (,, 2) = Vertical average of KE Gradient Trend 265 !! avrvortrd (,, 3) = Vertical average of Relative Vorticity Trend 266 !! avrvortrd (,, 4) = Vertical average of Coriolis Term Trend 267 !! avrvortrd (,, 5) = Vertical average of Horizontal Diffusion Trend 268 !! avrvortrd (,, 6) = Vertical average of Vertical Advection Trend 269 !! avrvortrd (,, 7) = Vertical average of Vertical Diffusion Trend 270 !! avrvortrd (,, 8) = Vertical average of Surface Pressure Grad. Trend 271 !! avrvortrd (,,10) = Vertical average of forcing term 272 !! avrvortrd (,,11) = Vertical average of bottom friction term 273 !! rotot (,,1) = total cumulative vertical integral trends over nwrite-1 time steps 274 !! rotot (,,2) = total cumulative vertical average trends over nwrite-1 time steps 275 !! intvor_tot(,,) = first membre of vrticity equation for vertical integral 276 !! avrvor_tot(,,) = first membre of vrticity equation for vertical average 277 !! intvor_res(,,) = residual = dh/dt entrainment for vertical integral 278 !! avrvor_res(,,) = residual = dh/dt entrainment for vertical average 279 !! 280 !! trends output in netCDF format using iom 245 281 !!---------------------------------------------------------------------- 246 282 ! … … 250 286 ! 251 287 INTEGER :: ji, jj, jk ! dummy loop indices 252 REAL(wp), POINTER, DIMENSION(:,:) :: zubet , zvbet ! Beta.V253 288 REAL(wp), POINTER, DIMENSION(:,:) :: zudpvor, zvdpvor ! total cmulative trends 254 289 !!---------------------------------------------------------------------- 255 290 256 CALL wrk_alloc( jpi,jpj, zu bet, zvbet, zudpvor, zvdpvor )291 CALL wrk_alloc( jpi,jpj, zudpvor, zvdpvor ) 257 292 258 293 ! Initialization 259 zubet (:,:) = 0._wp260 zvbet (:,:) = 0._wp261 294 zudpvor(:,:) = 0._wp 262 295 zvdpvor(:,:) = 0._wp … … 273 306 zvdpvor(:,:) = zvdpvor(:,:) + pvtrdvor(:,:,jk) * fse3v(:,:,jk) * e2v(:,:) * vmask(:,:,jk) 274 307 END DO 275 276 ! Planetary vorticity: 2nd computation (Beta.V term) store the vertical sum 277 ! as Beta.V term need intergration, not average 278 IF( ktrd == jpvor_pvo ) THEN 279 zubet(:,:) = zudpvor(:,:) 280 zvbet(:,:) = zvdpvor(:,:) 281 DO ji = 1, jpim1 282 DO jj = 1, jpjm1 283 vortrd(ji,jj,jpvor_bev) = ( zvbet(ji+1,jj) - zvbet(ji,jj) & 284 & - ( zubet(ji,jj+1) - zubet(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 285 END DO 286 END DO 287 ! Average of the Curl and Surface mask 288 vortrd(:,:,jpvor_bev) = vortrd(:,:,jpvor_bev) * hur(:,:) * fmask(:,:,1) 289 ENDIF 308 ! 309 ! Curl of the integral 310 DO ji=1,jpim1 311 DO jj=1,jpjm1 312 intvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & 313 & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 314 END DO 315 END DO 316 ! Surface mask 317 intvortrd(:,:,ktrd) = intvortrd(:,:,ktrd) * fmask(:,:,1) 290 318 ! 291 319 ! Average … … 293 321 zvdpvor(:,:) = zvdpvor(:,:) * hvr(:,:) 294 322 ! 295 ! Curl 323 ! Curl of the average 296 324 DO ji=1,jpim1 297 325 DO jj=1,jpjm1 298 vortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) &299 & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) )326 avrvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & 327 & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) 300 328 END DO 301 329 END DO 302 330 ! Surface mask 303 vortrd(:,:,ktrd) =vortrd(:,:,ktrd) * fmask(:,:,1)331 avrvortrd(:,:,ktrd) = avrvortrd(:,:,ktrd) * fmask(:,:,1) 304 332 305 333 IF( ndebug /= 0 ) THEN … … 308 336 ENDIF 309 337 ! 310 CALL wrk_dealloc( jpi,jpj, zu bet, zvbet, zudpvor, zvdpvor )338 CALL wrk_dealloc( jpi,jpj, zudpvor, zvdpvor ) 311 339 ! 312 340 END SUBROUTINE trd_vor_zint_3d … … 338 366 ! --------------------------------------------------- 339 367 340 IF( kt > nit000 ) vor_avrb(:,:) = vor_avr(:,:) 368 IF( kt > nit000 ) THEN 369 vor_b(:,:,:) = vor(:,:,:) 370 ENDIF 341 371 342 372 ! I.2 vertically integrated vorticity 343 373 ! ---------------------------------- 344 374 345 vor _avr (:,:) = 0._wp375 vor (:,:,:) = 0._wp 346 376 zun (:,:) = 0._wp 347 377 zvn (:,:) = 0._wp 348 vor_avrtot(:,:) = 0._wp 349 vor_avrres(:,:) = 0._wp 378 intvor_tot(:,:) = 0._wp 379 avrvor_tot(:,:) = 0._wp 380 intvor_res(:,:) = 0._wp 381 avrvor_res(:,:) = 0._wp 350 382 351 ! Vertically averaged velocity383 ! Vertically integrated velocity 352 384 DO jk = 1, jpk - 1 353 385 zun(:,:) = zun(:,:) + e1u(:,:) * un(:,:,jk) * fse3u(:,:,jk) … … 355 387 END DO 356 388 389 ! Curl of the vertical integral 390 DO ji = 1, jpim1 391 DO jj = 1, jpjm1 392 vor(ji,jj,jpvor_int) = ( ( zvn(ji+1,jj) - zvn(ji,jj) ) & 393 & - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) 394 END DO 395 END DO 396 397 ! Vertically averaged velocity 357 398 zun(:,:) = zun(:,:) * hur(:,:) 358 399 zvn(:,:) = zvn(:,:) * hvr(:,:) 359 400 360 ! Curl 401 ! Curl of the vertical average 361 402 DO ji = 1, jpim1 362 403 DO jj = 1, jpjm1 363 vor _avr(ji,jj) = ( ( zvn(ji+1,jj) - zvn(ji,jj) ) &404 vor(ji,jj,jpvor_avr) = ( ( zvn(ji+1,jj) - zvn(ji,jj) ) & 364 405 & - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) 365 406 END DO … … 373 414 ! ------------------------------------------------------ 374 415 IF( kt == nit000+1 ) THEN 375 vor_ avrbb(:,:) = vor_avrb(:,:)376 vor_ avrbn(:,:) = vor_avr (:,:)416 vor_bb(:,:,:) = vor_b(:,:,:) 417 vor_bn(:,:,:) = vor (:,:,:) 377 418 ENDIF 378 419 … … 384 425 nmoydpvor = nmoydpvor + 1 385 426 DO jl = 1, jpltot_vor 386 IF( jl /= 9 ) THEN 387 rotot(:,:) = rotot(:,:) + vortrd(:,:,jl) 388 ENDIF 427 rotot(:,:,jpvor_int) = rotot(:,:,jpvor_int) + intvortrd(:,:,jl) 428 rotot(:,:,jpvor_avr) = rotot(:,:,jpvor_avr) + avrvortrd(:,:,jl) 389 429 END DO 390 430 ENDIF … … 398 438 itmod = kt - nit000 + 1 399 439 400 IF( MOD( it, n n_trd) == 0 ) THEN440 IF( MOD( it, nwrite ) == 0 ) THEN 401 441 402 442 ! III.1 compute total trend 403 443 ! ------------------------ 404 444 zmean = 1._wp / ( REAL( nmoydpvor, wp ) * 2._wp * rdt ) 405 vor_avrtot(:,:) = ( vor_avr(:,:) - vor_avrbn(:,:) + vor_avrb(:,:) - vor_avrbb(:,:) ) * zmean 445 intvor_tot(:,:) = ( vor(:,:,jpvor_int) - vor_bn(:,:,jpvor_int) & 446 & + vor_b(:,:,jpvor_int) - vor_bb(:,:,jpvor_int) ) * zmean 447 avrvor_tot(:,:) = ( vor(:,:,jpvor_avr) - vor_bn(:,:,jpvor_avr) & 448 & + vor_b(:,:,jpvor_avr) - vor_bb(:,:,jpvor_avr) ) * zmean 406 449 407 450 … … 409 452 ! --------------------- 410 453 zmean = 1._wp / REAL( nmoydpvor, wp ) 411 vor_avrres(:,:) = vor_avrtot(:,:) - rotot(:,:) / zmean 454 intvor_res(:,:) = intvor_tot(:,:) - rotot(:,:,jpvor_int) * zmean 455 avrvor_res(:,:) = avrvor_tot(:,:) - rotot(:,:,jpvor_avr) * zmean 412 456 413 457 ! Boundary conditions 414 CALL lbc_lnk( vor_avrtot, 'F', 1. ) 415 CALL lbc_lnk( vor_avrres, 'F', 1. ) 458 CALL lbc_lnk( intvor_tot, 'F', 1. ) 459 CALL lbc_lnk( avrvor_tot, 'F', 1. ) 460 CALL lbc_lnk( intvor_res, 'F', 1. ) 461 CALL lbc_lnk( avrvor_res, 'F', 1. ) 416 462 417 463 418 464 ! III.3 time evolution array swap 419 465 ! ------------------------------ 420 vor_ avrbb(:,:) = vor_avrb(:,:)421 vor_ avrbn(:,:) = vor_avr (:,:)466 vor_bb(:,:,:) = vor_b(:,:,:) 467 vor_bn(:,:,:) = vor (:,:,:) 422 468 ! 423 469 nmoydpvor = 0 … … 430 476 IF( kt >= nit000+1 ) THEN 431 477 432 IF( lwp .AND. MOD( itmod, n n_trd) == 0 ) THEN478 IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN 433 479 WRITE(numout,*) '' 434 480 WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt 435 481 WRITE(numout,*) '~~~~~~~ ' 436 482 ENDIF 437 438 CALL histwrite( nidvor,"sovortPh",it,vortrd(:,:,jpvor_prg),ndimvor1,ndexvor1) ! grad Ph 439 CALL histwrite( nidvor,"sovortEk",it,vortrd(:,:,jpvor_keg),ndimvor1,ndexvor1) ! Energy 440 CALL histwrite( nidvor,"sovozeta",it,vortrd(:,:,jpvor_rvo),ndimvor1,ndexvor1) ! rel vorticity 441 CALL histwrite( nidvor,"sovortif",it,vortrd(:,:,jpvor_pvo),ndimvor1,ndexvor1) ! coriolis 442 CALL histwrite( nidvor,"sovodifl",it,vortrd(:,:,jpvor_ldf),ndimvor1,ndexvor1) ! lat diff 443 CALL histwrite( nidvor,"sovoadvv",it,vortrd(:,:,jpvor_zad),ndimvor1,ndexvor1) ! vert adv 444 CALL histwrite( nidvor,"sovodifv",it,vortrd(:,:,jpvor_zdf),ndimvor1,ndexvor1) ! vert diff 445 CALL histwrite( nidvor,"sovortPs",it,vortrd(:,:,jpvor_spg),ndimvor1,ndexvor1) ! grad Ps 446 CALL histwrite( nidvor,"sovortbv",it,vortrd(:,:,jpvor_bev),ndimvor1,ndexvor1) ! beta.V 447 CALL histwrite( nidvor,"sovowind",it,vortrd(:,:,jpvor_swf),ndimvor1,ndexvor1) ! wind stress 448 CALL histwrite( nidvor,"sovobfri",it,vortrd(:,:,jpvor_bfr),ndimvor1,ndexvor1) ! bottom friction 449 CALL histwrite( nidvor,"1st_mbre",it,vor_avrtot ,ndimvor1,ndexvor1) ! First membre 450 CALL histwrite( nidvor,"sovorgap",it,vor_avrres ,ndimvor1,ndexvor1) ! gap between 1st and 2 nd mbre 451 ! 483 484 ! Output the values for the vertical integral 485 CALL iom_put( "sovortPh_int", intvortrd (:,:,jpvor_prg) ) ! grad Ph 486 CALL iom_put( "sovortEk_int", intvortrd (:,:,jpvor_keg) ) ! Energy 487 CALL iom_put( "sovozeta_int", intvortrd (:,:,jpvor_rvo) ) ! rel vorticity 488 CALL iom_put( "sovortif_int", intvortrd (:,:,jpvor_pvo) ) ! coriolis 489 CALL iom_put( "sovodifl_int", intvortrd (:,:,jpvor_ldf) ) ! lat diff 490 CALL iom_put( "sovoadvv_int", intvortrd (:,:,jpvor_zad) ) ! vert adv 491 CALL iom_put( "sovodifv_int", intvortrd (:,:,jpvor_zdf) ) ! vert diff 492 CALL iom_put( "sovortPs_int", intvortrd (:,:,jpvor_spg) ) ! grad Ps 493 CALL iom_put( "sovowind_int", intvortrd (:,:,jpvor_swf) ) ! wind stress 494 CALL iom_put( "sovobfri_int", intvortrd (:,:,jpvor_bfr) ) ! bottom friction 495 CALL iom_put( "1st_mbre_int", intvor_tot(:,:) ) ! First membre 496 CALL iom_put( "sovorgap_int", intvor_res(:,:) ) ! gap between 1st and 2 nd mbre 497 498 ! Output the values for the vertical average 499 CALL iom_put( "sovortPh_avr", avrvortrd (:,:,jpvor_prg) ) ! grad Ph 500 CALL iom_put( "sovortEk_avr", avrvortrd (:,:,jpvor_keg) ) ! Energy 501 CALL iom_put( "sovozeta_avr", avrvortrd (:,:,jpvor_rvo) ) ! rel vorticity 502 CALL iom_put( "sovortif_avr", avrvortrd (:,:,jpvor_pvo) ) ! coriolis 503 CALL iom_put( "sovodifl_avr", avrvortrd (:,:,jpvor_ldf) ) ! lat diff 504 CALL iom_put( "sovoadvv_avr", avrvortrd (:,:,jpvor_zad) ) ! vert adv 505 CALL iom_put( "sovodifv_avr", avrvortrd (:,:,jpvor_zdf) ) ! vert diff 506 CALL iom_put( "sovortPs_avr", avrvortrd (:,:,jpvor_spg) ) ! grad Ps 507 CALL iom_put( "sovowind_avr", avrvortrd (:,:,jpvor_swf) ) ! wind stress 508 CALL iom_put( "sovobfri_avr", avrvortrd (:,:,jpvor_bfr) ) ! bottom friction 509 CALL iom_put( "1st_mbre_avr", avrvor_tot(:,:) ) ! First membre 510 CALL iom_put( "sovorgap_avr", avrvor_res(:,:) ) ! gap between 1st and 2 nd mbre 511 452 512 IF( ndebug /= 0 ) THEN 453 513 WRITE(numout,*) ' debuging trd_vor: III.4 done' … … 457 517 ENDIF 458 518 ! 459 IF( MOD( it, n n_trd ) == 0 ) rotot(:,:)=0460 !461 IF( kt == nitend ) CALL histclo( nidvor )519 IF( MOD( it, nwrite ) == 0 ) THEN 520 rotot(:,:,:)=0 521 ENDIF 462 522 ! 463 523 CALL wrk_dealloc( jpi, jpj, zun, zvn ) … … 473 533 !! from ocean surface down to control surface (NetCDF output) 474 534 !!---------------------------------------------------------------------- 475 REAL(wp) :: zjulian, zsto, zout476 CHARACTER (len=40) :: clhstnam477 CHARACTER (len=40) :: clop535 !REAL(wp) :: zjulian, zsto, zout 536 !CHARACTER (len=40) :: clhstnam 537 !CHARACTER (len=40) :: clop 478 538 !!---------------------------------------------------------------------- 479 539 … … 504 564 ! cumulated trends array init 505 565 nmoydpvor = 0 506 rotot(:,:)=0 507 vor_avrtot(:,:)=0 508 vor_avrres(:,:)=0 566 rotot(:,:,:)=0 567 intvor_tot(:,:)=0 568 avrvor_tot(:,:)=0 569 intvor_res(:,:)=0 570 avrvor_res(:,:)=0 509 571 510 572 IF( ndebug /= 0 ) THEN … … 512 574 CALL FLUSH(numout) 513 575 ENDIF 514 515 ! =================================516 ! II. netCDF output initialization517 ! =================================518 519 !-----------------------------------------520 ! II.1 Define frequency of output and means521 ! -----------------------------------------522 IF( ln_mskland ) THEN ; clop = "only(x)" ! put 1.e+20 on land (very expensive!!)523 ELSE ; clop = "x" ! no use of the mask value (require less cpu time)524 ENDIF525 #if defined key_diainstant526 zsto = nwrite*rdt527 clop = "inst("//TRIM(clop)//")"528 #else529 zsto = rdt530 clop = "ave("//TRIM(clop)//")"531 #endif532 zout = nn_trd*rdt533 534 IF(lwp) WRITE(numout,*) ' netCDF initialization'535 536 ! II.2 Compute julian date from starting date of the run537 ! ------------------------538 CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )539 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment540 IF(lwp) WRITE(numout,*)' '541 IF(lwp) WRITE(numout,*)' Date 0 used :',nit000, &542 & ' YEAR ', nyear,' MONTH ' , nmonth, &543 & ' DAY ' , nday, 'Julian day : ', zjulian544 545 ! II.3 Define the T grid trend file (nidvor)546 ! ---------------------------------547 CALL dia_nam( clhstnam, nn_trd, 'vort' ) ! filename548 IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam549 CALL histbeg( clhstnam, jpi, glamf, jpj, gphif,1, jpi, & ! Horizontal grid : glamt and gphit550 & 1, jpj, nit000-1, zjulian, rdt, nh_t, nidvor, domain_id=nidom, snc4chunks=snc4set )551 CALL wheneq( jpi*jpj, fmask, 1, 1., ndexvor1, ndimvor1 ) ! surface552 553 ! Declare output fields as netCDF variables554 CALL histdef( nidvor, "sovortPh", cvort//"grad Ph" , "s-2", & ! grad Ph555 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)556 CALL histdef( nidvor, "sovortEk", cvort//"Energy", "s-2", & ! Energy557 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)558 CALL histdef( nidvor, "sovozeta", cvort//"rel vorticity", "s-2", & ! rel vorticity559 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)560 CALL histdef( nidvor, "sovortif", cvort//"coriolis", "s-2", & ! coriolis561 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)562 CALL histdef( nidvor, "sovodifl", cvort//"lat diff ", "s-2", & ! lat diff563 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)564 CALL histdef( nidvor, "sovoadvv", cvort//"vert adv", "s-2", & ! vert adv565 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)566 CALL histdef( nidvor, "sovodifv", cvort//"vert diff" , "s-2", & ! vert diff567 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)568 CALL histdef( nidvor, "sovortPs", cvort//"grad Ps", "s-2", & ! grad Ps569 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)570 CALL histdef( nidvor, "sovortbv", cvort//"Beta V", "s-2", & ! beta.V571 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)572 CALL histdef( nidvor, "sovowind", cvort//"wind stress", "s-2", & ! wind stress573 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)574 CALL histdef( nidvor, "sovobfri", cvort//"bottom friction", "s-2", & ! bottom friction575 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)576 CALL histdef( nidvor, "1st_mbre", cvort//"1st mbre", "s-2", & ! First membre577 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)578 CALL histdef( nidvor, "sovorgap", cvort//"gap", "s-2", & ! gap between 1st and 2 nd mbre579 & jpi,jpj,nh_t,1,1,1,-99,32,clop,zsto,zout)580 CALL histend( nidvor, snc4set )581 582 IF( ndebug /= 0 ) THEN583 WRITE(numout,*) ' debuging trd_vor_init: II. done'584 CALL FLUSH(numout)585 ENDIF586 576 ! 587 577 END SUBROUTINE trd_vor_init -
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90
r6486 r9022 13 13 14 14 ! !!* vorticity trends index 15 INTEGER, PUBLIC, PARAMETER :: jpltot_vor = 1 1!: Number of vorticity trend terms15 INTEGER, PUBLIC, PARAMETER :: jpltot_vor = 10 !: Number of vorticity trend terms 16 16 ! 17 17 INTEGER, PUBLIC, PARAMETER :: jpvor_prg = 1 !: Pressure Gradient Trend … … 23 23 INTEGER, PUBLIC, PARAMETER :: jpvor_zdf = 7 !: Vertical Diffusion Trend 24 24 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 25 INTEGER, PUBLIC, PARAMETER :: jpvor_swf = 9 !: wind stress forcing term 26 INTEGER, PUBLIC, PARAMETER :: jpvor_bfr = 10 !: bottom friction term 27 ! 28 INTEGER, PUBLIC, PARAMETER :: jpvor_types = 2 !: bottom friction term 29 INTEGER, PUBLIC, PARAMETER :: jpvor_int = 1 !: bottom friction term 30 INTEGER, PUBLIC, PARAMETER :: jpvor_avr = 2 !: bottom friction term 28 31 29 32 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.