Changeset 5836 for trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
- Timestamp:
- 2015-10-26T15:49:40+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
r5566 r5836 17 17 !! ! 2005-11 (V. Garnier) Surface pressure gradient organization 18 18 !! 3.2 ! 2008-11 (B. Lemaire) creation from old diawri 19 !! 3.7 ! 2014-01 (G. Madec) remove eddy induced velocity from no-IOM output 20 !! ! change name of output variables in dia_wri_state 19 21 !!---------------------------------------------------------------------- 20 22 … … 27 29 USE dynadv, ONLY: ln_dynadv_vec 28 30 USE zdf_oce ! ocean vertical physics 29 USE ldftra_oce ! ocean active tracers: lateral physics 30 USE ldfdyn_oce ! ocean dynamics: lateral physics 31 USE traldf_iso_grif, ONLY : psix_eiv, psiy_eiv 31 USE ldftra ! lateral physics: eddy diffusivity coef. 32 32 USE sol_oce ! solver variables 33 33 USE sbc_oce ! Surface boundary condition: ocean fields … … 232 232 IF( iom_use('w_masstr') .OR. iom_use('w_masstr2') ) THEN ! vertical mass transport & its square value 233 233 ! Caution: in the VVL case, it only correponds to the baroclinic mass transport. 234 z2d(:,:) = rau0 * e1 2t(:,:)234 z2d(:,:) = rau0 * e1e2t(:,:) 235 235 DO jk = 1, jpk 236 236 z3d(:,:,jk) = wn(:,:,jk) * z2d(:,:) … … 247 247 DO jj = 2, jpjm1 ! sst gradient 248 248 DO ji = fs_2, fs_jpim1 ! vector opt. 249 zztmp 250 zztmpx = ( tsn(ji+1,jj ,1,jp_tem) - zztmp ) / e1u(ji,jj) + ( zztmp - tsn(ji-1,jj ,1,jp_tem) ) / e1u(ji-1,jj)251 zztmpy = ( tsn(ji ,jj+1,1,jp_tem) - zztmp ) / e2v(ji,jj) + ( zztmp - tsn(ji ,jj-1,1,jp_tem) ) / e2v(ji,jj-1)249 zztmp = tsn(ji,jj,1,jp_tem) 250 zztmpx = ( tsn(ji+1,jj,1,jp_tem) - zztmp ) * r1_e1u(ji,jj) + ( zztmp - tsn(ji-1,jj ,1,jp_tem) ) * r1_e1u(ji-1,jj) 251 zztmpy = ( tsn(ji,jj+1,1,jp_tem) - zztmp ) * r1_e2v(ji,jj) + ( zztmp - tsn(ji ,jj-1,1,jp_tem) ) * r1_e2v(ji,jj-1) 252 252 z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy ) & 253 253 & * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) … … 401 401 !! Each nwrite time step, output the instantaneous or mean fields 402 402 !!---------------------------------------------------------------------- 403 !! 404 INTEGER, INTENT( in ) :: kt ! ocean time-step index 405 !! 403 INTEGER, INTENT( in ) :: kt ! ocean time-step index 404 ! 406 405 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 407 406 CHARACTER (len=40) :: clhstnam, clop, clmx ! local names … … 412 411 INTEGER :: jn, ierror ! local integers 413 412 REAL(wp) :: zsto, zout, zmax, zjulian, zdt ! local scalars 414 ! !413 ! 415 414 REAL(wp), POINTER, DIMENSION(:,:) :: zw2d ! 2D workspace 416 415 REAL(wp), POINTER, DIMENSION(:,:,:) :: zw3d ! 3D workspace … … 419 418 IF( nn_timing == 1 ) CALL timing_start('dia_wri') 420 419 ! 421 CALL wrk_alloc( jpi ,jpj , zw2d )422 IF ( ln_traldf_gdia .OR. lk_vvl ) call wrk_alloc( jpi , jpj ,jpk , zw3d )420 CALL wrk_alloc( jpi,jpj , zw2d ) 421 IF( lk_vvl ) CALL wrk_alloc( jpi,jpj,jpk , zw3d ) 423 422 ! 424 423 ! Output the initial state and forcings … … 657 656 658 657 clmx ="l_max(only(x))" ! max index on a period 659 CALL histdef( nid_T, "sobowlin", "Bowl Index" , "W-point", & ! bowl INDEX660 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clmx, zsto, zout )658 ! CALL histdef( nid_T, "sobowlin", "Bowl Index" , "W-point", & ! bowl INDEX 659 ! & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clmx, zsto, zout ) 661 660 #if defined key_diahth 662 661 CALL histdef( nid_T, "sothedep", "Thermocline Depth" , "m" , & ! hth … … 682 681 CALL histdef( nid_U, "vozocrtx", "Zonal Current" , "m/s" , & ! un 683 682 & jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout ) 684 IF( ln_traldf_gdia ) THEN685 CALL histdef( nid_U, "vozoeivu", "Zonal EIV Current" , "m/s" , & ! u_eiv686 & jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout )687 ELSE688 #if defined key_diaeiv689 CALL histdef( nid_U, "vozoeivu", "Zonal EIV Current" , "m/s" , & ! u_eiv690 & jpi, jpj, nh_U, ipk, 1, ipk, nz_U, 32, clop, zsto, zout )691 #endif692 END IF693 683 ! !!! nid_U : 2D 694 684 CALL histdef( nid_U, "sozotaux", "Wind Stress along i-axis" , "N/m2" , & ! utau … … 700 690 CALL histdef( nid_V, "vomecrty", "Meridional Current" , "m/s" , & ! vn 701 691 & jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout ) 702 IF( ln_traldf_gdia ) THEN703 CALL histdef( nid_V, "vomeeivv", "Meridional EIV Current" , "m/s" , & ! v_eiv704 & jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout )705 ELSE706 #if defined key_diaeiv707 CALL histdef( nid_V, "vomeeivv", "Meridional EIV Current" , "m/s" , & ! v_eiv708 & jpi, jpj, nh_V, ipk, 1, ipk, nz_V, 32, clop, zsto, zout )709 #endif710 END IF711 692 ! !!! nid_V : 2D 712 693 CALL histdef( nid_V, "sometauy", "Wind Stress along j-axis" , "N/m2" , & ! vtau … … 718 699 CALL histdef( nid_W, "vovecrtz", "Vertical Velocity" , "m/s" , & ! wn 719 700 & jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout ) 720 IF( ln_traldf_gdia ) THEN721 CALL histdef( nid_W, "voveeivw", "Vertical EIV Velocity" , "m/s" , & ! w_eiv722 & jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout )723 ELSE724 #if defined key_diaeiv725 CALL histdef( nid_W, "voveeivw", "Vertical EIV Velocity" , "m/s" , & ! w_eiv726 & jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout )727 #endif728 END IF729 701 CALL histdef( nid_W, "votkeavt", "Vertical Eddy Diffusivity" , "m2/s" , & ! avt 730 702 & jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout ) … … 737 709 ENDIF 738 710 ! !!! nid_W : 2D 739 #if defined key_traldf_c2d740 CALL histdef( nid_W, "soleahtw", "lateral eddy diffusivity" , "m2/s" , & ! ahtw741 & jpi, jpj, nh_W, 1 , 1, 1 , - 99, 32, clop, zsto, zout )742 # if defined key_traldf_eiv743 CALL histdef( nid_W, "soleaeiw", "eddy induced vel. coeff. at w-point", "m2/s", & ! aeiw744 & jpi, jpj, nh_W, 1 , 1, 1 , - 99, 32, clop, zsto, zout )745 # endif746 #endif747 748 711 CALL histend( nid_W, snc4chunks=snc4set ) 749 712 … … 853 816 854 817 CALL histwrite( nid_U, "vozocrtx", it, un , ndim_U , ndex_U ) ! i-current 855 IF( ln_traldf_gdia ) THEN856 IF (.not. ALLOCATED(psix_eiv))THEN857 ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr )858 IF( lk_mpp ) CALL mpp_sum ( ierr )859 IF( ierr > 0 ) CALL ctl_stop('STOP', 'diawri: unable to allocate psi{x,y}_eiv')860 psix_eiv(:,:,:) = 0.0_wp861 psiy_eiv(:,:,:) = 0.0_wp862 ENDIF863 DO jk=1,jpkm1864 zw3d(:,:,jk) = (psix_eiv(:,:,jk+1) - psix_eiv(:,:,jk))/fse3u(:,:,jk) ! u_eiv = -dpsix/dz865 END DO866 zw3d(:,:,jpk) = 0._wp867 CALL histwrite( nid_U, "vozoeivu", it, zw3d, ndim_U , ndex_U ) ! i-eiv current868 ELSE869 #if defined key_diaeiv870 CALL histwrite( nid_U, "vozoeivu", it, u_eiv, ndim_U , ndex_U ) ! i-eiv current871 #endif872 ENDIF873 818 CALL histwrite( nid_U, "sozotaux", it, utau , ndim_hU, ndex_hU ) ! i-wind stress 874 819 875 820 CALL histwrite( nid_V, "vomecrty", it, vn , ndim_V , ndex_V ) ! j-current 876 IF( ln_traldf_gdia ) THEN877 DO jk=1,jpk-1878 zw3d(:,:,jk) = (psiy_eiv(:,:,jk+1) - psiy_eiv(:,:,jk))/fse3v(:,:,jk) ! v_eiv = -dpsiy/dz879 END DO880 zw3d(:,:,jpk) = 0._wp881 CALL histwrite( nid_V, "vomeeivv", it, zw3d, ndim_V , ndex_V ) ! j-eiv current882 ELSE883 #if defined key_diaeiv884 CALL histwrite( nid_V, "vomeeivv", it, v_eiv, ndim_V , ndex_V ) ! j-eiv current885 #endif886 ENDIF887 821 CALL histwrite( nid_V, "sometauy", it, vtau , ndim_hV, ndex_hV ) ! j-wind stress 888 822 889 823 CALL histwrite( nid_W, "vovecrtz", it, wn , ndim_T, ndex_T ) ! vert. current 890 IF( ln_traldf_gdia ) THEN891 DO jk=1,jpk-1892 DO jj = 2, jpjm1893 DO ji = fs_2, fs_jpim1 ! vector opt.894 zw3d(ji,jj,jk) = (psiy_eiv(ji,jj,jk) - psiy_eiv(ji,jj-1,jk))/e2v(ji,jj) + &895 & (psix_eiv(ji,jj,jk) - psix_eiv(ji-1,jj,jk))/e1u(ji,jj) ! w_eiv = dpsiy/dy + dpsiy/dx896 END DO897 END DO898 END DO899 zw3d(:,:,jpk) = 0._wp900 CALL histwrite( nid_W, "voveeivw", it, zw3d , ndim_T, ndex_T ) ! vert. eiv current901 ELSE902 # if defined key_diaeiv903 CALL histwrite( nid_W, "voveeivw", it, w_eiv , ndim_T, ndex_T ) ! vert. eiv current904 # endif905 ENDIF906 824 CALL histwrite( nid_W, "votkeavt", it, avt , ndim_T, ndex_T ) ! T vert. eddy diff. coef. 907 825 CALL histwrite( nid_W, "votkeavm", it, avmu , ndim_T, ndex_T ) ! T vert. eddy visc. coef. … … 909 827 CALL histwrite( nid_W, "voddmavs", it, fsavs(:,:,:), ndim_T, ndex_T ) ! S vert. eddy diff. coef. 910 828 ENDIF 911 #if defined key_traldf_c2d912 CALL histwrite( nid_W, "soleahtw", it, ahtw , ndim_hT, ndex_hT ) ! lateral eddy diff. coef.913 # if defined key_traldf_eiv914 CALL histwrite( nid_W, "soleaeiw", it, aeiw , ndim_hT, ndex_hT ) ! EIV coefficient at w-point915 # endif916 #endif917 829 918 830 ! 3. Close all files … … 925 837 ENDIF 926 838 ! 927 CALL wrk_dealloc( jpi , jpj, zw2d )928 IF ( ln_traldf_gdia .OR. lk_vvl ) callwrk_dealloc( jpi , jpj , jpk , zw3d )839 CALL wrk_dealloc( jpi , jpj , zw2d ) 840 IF( lk_vvl ) CALL wrk_dealloc( jpi , jpj , jpk , zw3d ) 929 841 ! 930 842 IF( nn_timing == 1 ) CALL timing_stop('dia_wri') … … 958 870 !!---------------------------------------------------------------------- 959 871 ! 960 ! IF( nn_timing == 1 ) CALL timing_start('dia_wri_state') ! not sure this works for routines not called in first timestep961 962 872 ! 0. Initialisation 963 873 ! ----------------- … … 1018 928 CALL histdef( id_i, "vovvldep", "T point depth" , "m" , & ! t-point depth 1019 929 & jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 1020 END 930 ENDIF 1021 931 1022 932 #if defined key_lim2 … … 1042 952 CALL histwrite( id_i, "vomecrty", kt, vn , jpi*jpj*jpk, idex ) ! now j-velocity 1043 953 CALL histwrite( id_i, "vovecrtz", kt, wn , jpi*jpj*jpk, idex ) ! now k-velocity 1044 CALL histwrite( id_i, "sowaflup", kt, (emp-rnf ), jpi*jpj , idex ) ! freshwater budget954 CALL histwrite( id_i, "sowaflup", kt, emp-rnf , jpi*jpj , idex ) ! freshwater budget 1045 955 CALL histwrite( id_i, "sohefldo", kt, qsr + qns , jpi*jpj , idex ) ! total heat flux 1046 956 CALL histwrite( id_i, "soshfldo", kt, qsr , jpi*jpj , idex ) ! solar heat flux … … 1060 970 ENDIF 1061 971 #endif 1062 1063 ! IF( nn_timing == 1 ) CALL timing_stop('dia_wri_state') ! not sure this works for routines not called in first timestep1064 972 ! 1065 1066 973 END SUBROUTINE dia_wri_state 1067 974 !!======================================================================
Note: See TracChangeset
for help on using the changeset viewer.