Changeset 2109
- Timestamp:
- 2010-09-22T14:44:40+02:00 (14 years ago)
- Location:
- branches/DEV_r1837_MLF/NEMO/OPA_SRC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DEV_r1837_MLF/NEMO/OPA_SRC/DIA/diahsb.F90
r2108 r2109 27 27 28 28 !! * Module variables 29 INTEGER :: z_num ! 30 INTEGER , PARAMETER :: nitb0 = 0 ! 31 DOUBLEPRECISION :: z_surf_tot , z_vol_tot , z_sm0 ! 32 DOUBLEPRECISION :: z_frc_t , z_frc_s , z_frc_v ! global forcing trends 33 DOUBLEPRECISION :: zfact1 , zdeltat ! conversion factors 34 DOUBLEPRECISION :: zfact21 , zfact22 ! " " 35 DOUBLEPRECISION :: zfact31 , zfact32 ! " " 36 DOUBLEPRECISION, DIMENSION(jpi,jpj) :: z_surf , z_ssh_ini ! 37 DOUBLEPRECISION, DIMENSION(jpi,jpj,jpk) :: z_hc_loc_ini , z_sc_loc_ini, z_e3t_ini ! 29 INTEGER :: num ! 30 REAL(dp) :: surf_tot , vol_tot ! 31 REAL(dp) :: frc_t , frc_s , frc_v ! global forcing trends 32 REAL(dp) :: fact1 ! conversion factors 33 REAL(dp) :: fact21 , fact22 ! - - 34 REAL(dp) :: fact31 , fact32 ! - - 35 REAL(dp), DIMENSION(:,:) , ALLOCATABLE :: surf , ssh_ini ! 36 REAL(dp), DIMENSION(:,:,:), ALLOCATABLE :: hc_loc_ini, sc_loc_ini, e3t_ini ! 38 37 39 38 !! * Substitutions … … 54 53 !! 55 54 !! ** Purpose: Compute the ocean global heat content, salt content and volume 56 !! 55 !! non conservation 57 56 !! 58 57 !! ** Method : - Compute the deviation of heat content, salt content and volume 59 !! at the current time step from their values at nit000 + nitb058 !! at the current time step from their values at nit000 60 59 !! - Compute the contribution of forcing and remove it from these 61 60 !! deviations 62 !! ** Action : -Write the results in the 'heat_salt_volume_budgets.txt' ASCII file61 !! ** Action : Write the results in the 'heat_salt_volume_budgets.txt' ASCII file 63 62 !!--------------------------------------------------------------------------- 64 !! * Arguments ! 65 INTEGER , INTENT( in ) :: kt ! ocean time-step index 66 !! * Local declarations ! 67 CHARACTER (len=32) :: z_name ! 68 INTEGER :: jk ! dummy loop indice 69 DOUBLEPRECISION :: zdeltat ! 70 DOUBLEPRECISION :: zdiff_hc , zdiff_sc ! heat and salt content variations 71 DOUBLEPRECISION :: zdiff_v1 , zdiff_v2 ! volume variation 72 DOUBLEPRECISION :: z1_rau0 ! temporary scalars 73 DOUBLEPRECISION :: z_frc_trd_t , z_frc_trd_s ! " " 74 DOUBLEPRECISION :: z_frc_trd_v ! " " 75 !!---------------------------------------------------------------------------- 76 77 ! =================== 78 ! 1 - Initialisations 79 ! =================== 80 81 IF( kt == nit000 ) THEN 63 INTEGER, INTENT(in) :: kt ! ocean time-step index 64 !! 65 CHARACTER (len=32) :: s_name ! output file name 66 INTEGER :: jk ! dummy loop indice 67 INTEGER :: ierror ! local integer 68 REAL(dp) :: zdiff_hc , zdiff_sc ! heat and salt content variations 69 REAL(dp) :: zdiff_v1 , zdiff_v2 ! volume variation 70 REAL(dp) :: z1_rau0 ! local scalars 71 REAL(dp) :: zdeltat ! - - 72 REAL(dp) :: z_frc_trd_t , z_frc_trd_s ! - - 73 REAL(dp) :: z_frc_trd_v ! - - 74 !!--------------------------------------------------------------------------- 75 76 ! ! =================== ! 77 IF( kt == nit000 ) THEN ! 1 - Initialisations ! 78 ! ! =================== ! 79 80 ! 1.0 - Allocate memory 81 ! --------------------- 82 ALLOCATE( hc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 83 IF( ierror > 0 ) THEN 84 CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' ) ; RETURN 85 ENDIF 86 ALLOCATE( sc_loc_ini(jpi,jpj,jpk), STAT=ierror ) 87 IF( ierror > 0 ) THEN 88 CALL ctl_stop( 'dia_hsb: unable to allocate sc_loc_ini' ) ; RETURN 89 ENDIF 90 ALLOCATE( e3t_ini(jpi,jpj,jpk) , STAT=ierror ) 91 IF( ierror > 0 ) THEN 92 CALL ctl_stop( 'dia_hsb: unable to allocate e3t_ini' ) ; RETURN 93 ENDIF 94 ALLOCATE( surf(jpi,jpj) , STAT=ierror ) 95 IF( ierror > 0 ) THEN 96 CALL ctl_stop( 'dia_hsb: unable to allocate surf' ) ; RETURN 97 ENDIF 98 ALLOCATE( ssh_ini(jpi,jpj) , STAT=ierror ) 99 IF( ierror > 0 ) THEN 100 CALL ctl_stop( 'dia_hsb: unable to allocate ssh_ini' ) ; RETURN 101 ENDIF 82 102 83 103 ! 1.1 - Time independant variables and file opening … … 88 108 CALL ctl_warn( 'dia_hsb does not take open boundary fluxes into account' ) 89 109 ENDIF 90 z_name = 'heat_salt_volume_budgets.txt' ! name of output file 91 z_sm0 = 34.72654 ! Mean global salinity 92 z_surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:) ! masked surface grid cell area 93 z_surf_tot = SUM( z_surf(:,:) ) ! total ocean surface area 94 z_vol_tot = 0.d0 ! total ocean volume 110 s_name = 'heat_salt_volume_budgets.txt' ! name of output file 111 surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:) ! masked surface grid cell area 112 surf_tot = SUM( surf(:,:) ) ! total ocean surface area 113 vol_tot = 0.d0 ! total ocean volume 95 114 DO jk = 1, jpkm1 96 z_vol_tot = z_vol_tot + SUM( z_surf(:,:) * tmask(:,:,jk)&97 & * fse3t_n(:,:,jk))115 vol_tot = vol_tot + SUM( surf(:,:) * tmask(:,:,jk) & 116 & * fse3t_n(:,:,jk) ) 98 117 ENDDO 99 118 IF( lk_mpp ) THEN 100 CALL mpp_sum( z_vol_tot )101 CALL mpp_sum( z_surf_tot )102 ENDIF 103 104 CALL ctl_opn( z_num , z_name , 'UNKNOWN' , 'FORMATTED' , 'SEQUENTIAL' , 1 , numout , lwp , 1 )105 ! 106 WRITE( z_num, 9010 ) "kt | heat content budget | salt content budget ",&107 108 & "| volume budget (ssh) ",&109 110 111 WRITE( z_num, 9010 ) " | [C] [W/m2] | [psu] [mmm/s] [SV] ",&112 & "| [m3] [mmm/s] [SV] ",&113 119 CALL mpp_sum( vol_tot ) 120 CALL mpp_sum( surf_tot ) 121 ENDIF 122 123 CALL ctl_opn( num , s_name , 'UNKNOWN' , 'FORMATTED' , 'SEQUENTIAL' , 1 , numout , lwp , 1 ) 124 ! 12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80 125 WRITE( num, 9010 ) "kt | heat content budget | salt content budget ", & 126 ! 123456789012345678901234567890123456789012345 -> 45 127 & "| volume budget (ssh) ", & 128 ! 678901234567890123456789012345678901234567890 -> 45 129 & "| volume budget (e3t) " 130 WRITE( num, 9010 ) " | [C] [W/m2] | [psu] [mmm/s] [SV] ", & 131 & "| [m3] [mmm/s] [SV] ", & 132 & "| [m3] [mmm/s] [SV] " 114 133 115 134 ! 1.2 - Conversions (factors will be multiplied by duration afterwards) 116 135 ! ----------------- 117 136 ! heat content variation => equivalent heat flux: 118 zfact1 = rau0 * rcp / z_surf_tot! [C*m3] -> [W/m2]137 fact1 = rau0 * rcp / surf_tot ! [C*m3] -> [W/m2] 119 138 ! salt content variation => equivalent EMP and equivalent "flow": 120 zfact21 = 1.e3 / ( z_sm0 * z_surf_tot )! [psu*m3] -> [mm/s]121 zfact22 = 1.e-6 / z_sm0! [psu*m3] -> [Sv]139 fact21 = 1.e3 / ( soce * surf_tot ) ! [psu*m3] -> [mm/s] 140 fact22 = 1.e-6 / soce ! [psu*m3] -> [Sv] 122 141 ! volume variation => equivalent EMP and equivalent "flow": 123 zfact31 = 1.e3 / z_surf_tot ! [m3] -> [mm/s] 124 zfact32 = 1.e-6 ! [m3] -> [SV] 125 126 ENDIF 127 128 IF( kt == nit000 + nitb0 ) THEN 129 142 fact31 = 1.e3 / surf_tot ! [m3] -> [mm/s] 143 fact32 = 1.e-6 ! [m3] -> [SV] 144 130 145 ! 1.3 - initial conservation variables 131 146 ! ------------------------------------ 132 z_ssh_ini(:,:) = sshn(:,:) ! initial ssh147 ssh_ini(:,:) = sshn(:,:) ! initial ssh 133 148 DO jk = 1, jpk 134 z_e3t_ini (:,:,jk) = fse3t_n(:,:,jk) ! initial vertical scale factors135 z_hc_loc_ini(:,:,jk) = tn(:,:,jk) * fse3t_n(:,:,jk) ! initial heat content136 z_sc_loc_ini(:,:,jk) = sn(:,:,jk) * fse3t_n(:,:,jk) ! initial salt content149 e3t_ini (:,:,jk) = fse3t_n(:,:,jk) ! initial vertical scale factors 150 hc_loc_ini(:,:,jk) = tn(:,:,jk) * fse3t_n(:,:,jk) ! initial heat content 151 sc_loc_ini(:,:,jk) = sn(:,:,jk) * fse3t_n(:,:,jk) ! initial salt content 137 152 END DO 138 z_frc_v = 0.d0 ! volume trend due to forcing 139 z_frc_t = 0.d0 ! heat content " " " " 140 z_frc_s = 0.d0 ! salt content " " " " 141 142 ! ====================================================================== 143 ! 2 - Heat content, salt content and volume variations: curent - initial 144 ! ====================================================================== 145 146 ELSEIF ( kt >= nit000 + nitb0 + 1 ) THEN 153 frc_v = 0.d0 ! volume trend due to forcing 154 frc_t = 0.d0 ! heat content " " " " 155 frc_s = 0.d0 ! salt content " " " " 156 157 ! ! ====================================================================== ! 158 ELSE ! 2 - Heat content, salt content and volume variations: curent - initial ! 159 ! ! ====================================================================== ! 147 160 148 161 ! 2.1 - Trends due to forcing 149 162 ! --------------------------- 150 163 z1_rau0 = 1.e0 / rau0 151 z_frc_trd_v = z1_rau0 * SUM( - emp(:,:) * z_surf(:,:) ) ! volume fluxes152 z_frc_trd_t = SUM( sbc_hc_n(:,:) * z_surf(:,:) ) ! heat fluxes153 z_frc_trd_s = SUM( sbc_sc_n(:,:) * z_surf(:,:) ) ! salt fluxes164 z_frc_trd_v = z1_rau0 * SUM( - emp(:,:) * surf(:,:) ) ! volume fluxes 165 z_frc_trd_t = SUM( sbc_hc_n(:,:) * surf(:,:) ) ! heat fluxes 166 z_frc_trd_s = SUM( sbc_sc_n(:,:) * surf(:,:) ) ! salt fluxes 154 167 ! Add penetrative solar radiation 155 IF( ln_traqsr ) z_frc_trd_t = z_frc_trd_t + ro0cpr * SUM( qsr (:,:) * z_surf(:,:) )168 IF( ln_traqsr ) z_frc_trd_t = z_frc_trd_t + ro0cpr * SUM( qsr (:,:) * surf(:,:) ) 156 169 ! Add geothermal heat flux 157 IF( lk_trabbc ) z_frc_trd_t = z_frc_trd_t + ro0cpr * SUM( qgh_trd0(:,:) * z_surf(:,:) )170 IF( lk_trabbc ) z_frc_trd_t = z_frc_trd_t + ro0cpr * SUM( qgh_trd0(:,:) * surf(:,:) ) 158 171 IF( lk_mpp ) THEN 159 172 CALL mpp_sum( z_frc_trd_v ) 160 173 CALL mpp_sum( z_frc_trd_t ) 161 174 ENDIF 162 z_frc_v = z_frc_v + z_frc_trd_v * rdt163 z_frc_t = z_frc_t + z_frc_trd_t * rdt164 z_frc_s = z_frc_s + z_frc_trd_s * rdt175 frc_v = frc_v + z_frc_trd_v * rdt 176 frc_t = frc_t + z_frc_trd_t * rdt 177 frc_s = frc_s + z_frc_trd_s * rdt 165 178 166 179 ! 2.2 - Content variations … … 170 183 zdiff_sc = 0.d0 171 184 ! volume variation (calculated with ssh) 172 zdiff_v1 = SUM( z_surf(:,:) * tmask(:,:,1) * ( sshn(:,:) - z_ssh_ini(:,:) ) )185 zdiff_v1 = SUM( surf(:,:) * tmask(:,:,1) * ( sshn(:,:) - ssh_ini(:,:) ) ) 173 186 DO jk = 1, jpkm1 174 187 ! volume variation (calculated with scale factors) 175 zdiff_v2 = zdiff_v2 + SUM( z_surf(:,:) * tmask(:,:,jk)&176 & * ( fse3t_n(:,:,jk)&177 & - z_e3t_ini(:,:,jk) ) )188 zdiff_v2 = zdiff_v2 + SUM( surf(:,:) * tmask(:,:,jk) & 189 & * ( fse3t_n(:,:,jk) & 190 & - e3t_ini(:,:,jk) ) ) 178 191 ! heat content variation 179 zdiff_hc = zdiff_hc + SUM( z_surf(:,:) * tmask(:,:,jk)&180 &* ( fse3t_n(:,:,jk) * tn(:,:,jk) &181 & - z_hc_loc_ini(:,:,jk) ) )192 zdiff_hc = zdiff_hc + SUM( surf(:,:) * tmask(:,:,jk) & 193 & * ( fse3t_n(:,:,jk) * tn(:,:,jk) & 194 & - hc_loc_ini(:,:,jk) ) ) 182 195 ! salt content variation 183 zdiff_sc = zdiff_sc + SUM( z_surf(:,:) * tmask(:,:,jk)&184 &* ( fse3t_n(:,:,jk) * sn(:,:,jk) &185 & - z_sc_loc_ini(:,:,jk) ) )196 zdiff_sc = zdiff_sc + SUM( surf(:,:) * tmask(:,:,jk) & 197 & * ( fse3t_n(:,:,jk) * sn(:,:,jk) & 198 & - sc_loc_ini(:,:,jk) ) ) 186 199 ENDDO 187 200 … … 194 207 195 208 ! Substract sbc fluxes from heat content, salt content and volume variations 196 zdiff_v1 = zdiff_v1 - z_frc_v197 zdiff_v2 = zdiff_v2 - z_frc_v198 zdiff_hc = zdiff_hc - z_frc_t199 zdiff_sc = zdiff_sc - z_frc_s209 zdiff_v1 = zdiff_v1 - frc_v 210 zdiff_v2 = zdiff_v2 - frc_v 211 zdiff_hc = zdiff_hc - frc_t 212 zdiff_sc = zdiff_sc - frc_s 200 213 201 214 ! 2.3 - Diagnostics writing 202 215 ! ------------------------- 203 216 ! heat salt and volume budgets 204 zdeltat = 1.e0 / ( ( kt - nit b0) * rdt )205 WRITE( z_num , 9020) kt , zdiff_hc / z_vol_tot , zdiff_hc * zfact1 * zdeltat,&206 & zdiff_sc / z_vol_tot , zdiff_sc * zfact21 * zdeltat, zdiff_sc * zfact22 * zdeltat, &207 & zdiff_v1 , zdiff_v1 * zfact31 * zdeltat, zdiff_v1 * zfact32 * zdeltat, &208 & zdiff_v2 , zdiff_v2 * zfact31 * zdeltat, zdiff_v2 * zfact32 * zdeltat217 zdeltat = 1.e0 / ( ( kt - nit000 + 1 ) * rdt ) 218 WRITE(num , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1 * zdeltat, & 219 & zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat, & 220 & zdiff_v1 , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat, & 221 & zdiff_v2 , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat 209 222 ENDIF 210 223 211 IF ( kt == nitend ) CLOSE( z_num )224 IF ( kt == nitend ) CLOSE( num ) 212 225 213 226 9010 FORMAT(A80,A45,A45) -
branches/DEV_r1837_MLF/NEMO/OPA_SRC/DOM/dom_oce.F90
r2068 r2109 147 147 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3t_b !: before - - - - T points (m) 148 148 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3u_b , e3v_b !: - - - - - U--V points (m) 149 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: e3t_d !: "diffused" - - - - T points (m)150 149 #else 151 150 LOGICAL, PUBLIC, PARAMETER :: lk_vvl = .FALSE. !: fixed grid flag -
branches/DEV_r1837_MLF/NEMO/OPA_SRC/DOM/domzgr_substitute.h90
r2068 r2109 64 64 65 65 # define fse3t_m(i,j,k) (fse3t_0(i,j,k)*(1.+ssh_m(i,j)*mut(i,j,k))) 66 # define fse3t_d(i,j,k) e3t_d(i,j,k)67 66 68 67 # define fse3t_a(i,j,k) (fse3t_0(i,j,k)*(1.+ssha(i,j)*mut(i,j,k))) … … 101 100 102 101 # define fse3t_m(i,j,k) fse3t_0(i,j,k) 103 # define fse3t_d(i,j,k) fse3t_0(i,j,k)104 102 105 103 # define fse3t_a(i,j,k) fse3t_0(i,j,k) -
branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/dynnxt.F90
r2068 r2109 242 242 ! ------------------------------- 243 243 DO jk = 1, jpkm1 244 fse3t_b(:,:,jk) = fse3t_n(:,:,jk) + atfp * fse3t_d(:,:,jk) 244 fse3t_b(:,:,jk) = fse3t_n(:,:,jk) & 245 & + atfp * ( fse3t_b(:,:,jk) + fse3t_a(:,:,jk) & 246 & - 2.e0 * fse3t_n(:,:,jk) ) 245 247 ENDDO 246 248 ! Add volume filter correction only at the first level of t-point scale factors -
branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/sshwzv.F90
r2107 r2109 1 1 2 MODULE sshwzv 2 3 !!============================================================================== … … 181 182 CALL lbc_lnk( sshv_a, 'V', 1. ) 182 183 ENDIF 183 ! !----------------------------------------!184 ! ! vertical scale factor laplacian !185 ! !----------------------------------------!186 ! Needed for Robert-Asselin time filter and for Brown & Campana semi implicit hydrostatic presure gradient187 DO jk = 1, jpk188 fse3t_d(:,:,jk) = fse3t_b(:,:,jk) &189 & - 2.e0 * fse3t_n(:,:,jk) &190 & + fse3t_a(:,:,jk)191 ENDDO192 184 ! !------------------------------! 193 185 ! ! Now Vertical Velocity ! -
branches/DEV_r1837_MLF/NEMO/OPA_SRC/TRA/tranxt.F90
r2091 r2109 282 282 ze3t_n = fse3t_n(ji,jj,jk) 283 283 ze3t_a = fse3t_a(ji,jj,jk) 284 ze3t_d = fse3t_d(ji,jj,jk)284 ze3t_d = ze3t_b - 2.e0 * ze3t_n + ze3t_a 285 285 ! ! tracer content at Before, now and after 286 286 ztc_b = tb(ji,jj,jk) * ze3t_b ; zsc_b = sb(ji,jj,jk) * ze3t_b
Note: See TracChangeset
for help on using the changeset viewer.