[2148] | 1 | MODULE diahsb |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE diahsb *** |
---|
[2334] | 4 | !! Ocean diagnostics: Heat, salt and volume budgets |
---|
[2148] | 5 | !!====================================================================== |
---|
[2334] | 6 | !! History : 3.3 ! 2010-09 (M. Leclair) Original code |
---|
[4045] | 7 | !! ! 2012-10 (C. Rousset) add iom_put |
---|
[2148] | 8 | !!---------------------------------------------------------------------- |
---|
[2334] | 9 | |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
[2148] | 11 | USE oce ! ocean dynamics and tracers |
---|
| 12 | USE dom_oce ! ocean space and time domain |
---|
| 13 | USE phycst ! physical constants |
---|
| 14 | USE sbc_oce ! surface thermohaline fluxes |
---|
| 15 | USE in_out_manager ! I/O manager |
---|
| 16 | USE domvvl ! vertical scale factors |
---|
| 17 | USE traqsr ! penetrative solar radiation |
---|
[2337] | 18 | USE trabbc ! bottom boundary condition |
---|
[2148] | 19 | USE lib_mpp ! distributed memory computing library |
---|
| 20 | USE trabbc ! bottom boundary condition |
---|
[3294] | 21 | USE obc_par ! (for lk_obc) |
---|
[2148] | 22 | USE bdy_par ! (for lk_bdy) |
---|
[3294] | 23 | USE timing ! preformance summary |
---|
[4045] | 24 | USE iom ! I/O manager |
---|
| 25 | USE lib_fortran ! glob_sum |
---|
| 26 | USE restart ! ocean restart |
---|
| 27 | USE wrk_nemo ! work arrays |
---|
[4220] | 28 | USE sbcrnf ! river runoffd |
---|
[2148] | 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | PRIVATE |
---|
| 32 | |
---|
[2334] | 33 | PUBLIC dia_hsb ! routine called by step.F90 |
---|
[4045] | 34 | PUBLIC dia_hsb_init ! routine called by nemogcm.F90 |
---|
| 35 | PUBLIC dia_hsb_rst ! routine called by step.F90 |
---|
[2148] | 36 | |
---|
[2334] | 37 | LOGICAL, PUBLIC :: ln_diahsb = .FALSE. !: check the heat and salt budgets |
---|
[2148] | 38 | |
---|
[4345] | 39 | REAL(dp) :: surf_tot ! |
---|
| 40 | REAL(dp) :: frc_t , frc_s , frc_v ! global forcing trends |
---|
| 41 | REAL(dp) :: frc_wn_t , frc_wn_s ! global forcing trends |
---|
| 42 | REAL(dp), DIMENSION(:,:) , ALLOCATABLE :: surf , ssh_ini ! |
---|
| 43 | REAL(dp), DIMENSION(:,:,:), ALLOCATABLE :: hc_loc_ini, sc_loc_ini, e3t_ini ! |
---|
| 44 | REAL(dp), DIMENSION(:,:) , ALLOCATABLE :: ssh_hc_loc_ini, ssh_sc_loc_ini |
---|
[2148] | 45 | |
---|
| 46 | !! * Substitutions |
---|
| 47 | # include "domzgr_substitute.h90" |
---|
| 48 | # include "vectopt_loop_substitute.h90" |
---|
| 49 | |
---|
| 50 | !!---------------------------------------------------------------------- |
---|
[2287] | 51 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[2281] | 52 | !! $Id$ |
---|
[2334] | 53 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[2148] | 54 | !!---------------------------------------------------------------------- |
---|
| 55 | |
---|
| 56 | CONTAINS |
---|
| 57 | |
---|
| 58 | SUBROUTINE dia_hsb( kt ) |
---|
| 59 | !!--------------------------------------------------------------------------- |
---|
| 60 | !! *** ROUTINE dia_hsb *** |
---|
| 61 | !! |
---|
[2334] | 62 | !! ** Purpose: Compute the ocean global heat content, salt content and volume conservation |
---|
[2148] | 63 | !! |
---|
| 64 | !! ** Method : - Compute the deviation of heat content, salt content and volume |
---|
[2334] | 65 | !! at the current time step from their values at nit000 |
---|
| 66 | !! - Compute the contribution of forcing and remove it from these deviations |
---|
| 67 | !! |
---|
[2148] | 68 | !!--------------------------------------------------------------------------- |
---|
| 69 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
| 70 | !! |
---|
| 71 | INTEGER :: jk ! dummy loop indice |
---|
[4345] | 72 | REAL(dp) :: zdiff_hc , zdiff_sc ! heat and salt content variations |
---|
| 73 | REAL(dp) :: zdiff_hc1 , zdiff_sc1 ! - - - - - - - - |
---|
| 74 | REAL(dp) :: zdiff_v1 , zdiff_v2 ! volume variation |
---|
| 75 | REAL(dp) :: zerr_hc1 , zerr_sc1 ! heat and salt content misfit |
---|
| 76 | REAL(dp) :: zvol_tot ! volume |
---|
| 77 | REAL(dp) :: z_frc_trd_t , z_frc_trd_s ! - - |
---|
| 78 | REAL(dp) :: z_frc_trd_v ! - - |
---|
| 79 | REAL(dp) :: z_wn_trd_t , z_wn_trd_s ! - - |
---|
| 80 | REAL(dp) :: z_ssh_hc , z_ssh_sc ! - - |
---|
[2148] | 81 | !!--------------------------------------------------------------------------- |
---|
[4045] | 82 | IF( nn_timing == 1 ) CALL timing_start('dia_hsb') |
---|
[2148] | 83 | |
---|
| 84 | ! ------------------------- ! |
---|
| 85 | ! 1 - Trends due to forcing ! |
---|
| 86 | ! ------------------------- ! |
---|
[4345] | 87 | z_frc_trd_v = r1_rau0 * glob_sum( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) ) ! volume fluxes |
---|
| 88 | z_frc_trd_t = glob_sum( sbc_tsc(:,:,jp_tem) * surf(:,:) ) ! heat fluxes |
---|
| 89 | z_frc_trd_s = glob_sum( sbc_tsc(:,:,jp_sal) * surf(:,:) ) ! salt fluxes |
---|
| 90 | ! Add runoff heat & salt input |
---|
| 91 | IF( ln_rnf ) z_frc_trd_t = z_frc_trd_t + glob_sum( rnf_tsc(:,:,jp_tem) * surf(:,:) ) |
---|
| 92 | IF( ln_rnf_sal) z_frc_trd_s = z_frc_trd_s + glob_sum( rnf_tsc(:,:,jp_sal) * surf(:,:) ) |
---|
[4220] | 93 | |
---|
[2148] | 94 | ! Add penetrative solar radiation |
---|
[4345] | 95 | IF( ln_traqsr ) z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( qsr (:,:) * surf(:,:) ) |
---|
[2148] | 96 | ! Add geothermal heat flux |
---|
[4345] | 97 | IF( ln_trabbc ) z_frc_trd_t = z_frc_trd_t + glob_sum( qgh_trd0(:,:) * surf(:,:) ) |
---|
[4045] | 98 | ! |
---|
[4345] | 99 | IF( .NOT. lk_vvl ) THEN |
---|
| 100 | z_wn_trd_t = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_tem) ) |
---|
| 101 | z_wn_trd_s = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_sal) ) |
---|
| 102 | ENDIF |
---|
| 103 | |
---|
[2148] | 104 | frc_v = frc_v + z_frc_trd_v * rdt |
---|
| 105 | frc_t = frc_t + z_frc_trd_t * rdt |
---|
| 106 | frc_s = frc_s + z_frc_trd_s * rdt |
---|
[4345] | 107 | ! ! Advection flux through fixed surface (z=0) |
---|
| 108 | IF( .NOT. lk_vvl ) THEN |
---|
| 109 | frc_wn_t = frc_wn_t + z_wn_trd_t * rdt |
---|
| 110 | frc_wn_s = frc_wn_s + z_wn_trd_s * rdt |
---|
| 111 | ENDIF |
---|
[2148] | 112 | |
---|
[4045] | 113 | ! ------------------------ ! |
---|
[4345] | 114 | ! 2 - Content variations ! |
---|
[4045] | 115 | ! ------------------------ ! |
---|
[4345] | 116 | zdiff_v2 = 0.d0 |
---|
| 117 | zdiff_hc = 0.d0 |
---|
| 118 | zdiff_sc = 0.d0 |
---|
| 119 | |
---|
[2148] | 120 | ! volume variation (calculated with ssh) |
---|
[4345] | 121 | zdiff_v1 = glob_sum( surf(:,:) * ( sshn(:,:) - ssh_ini(:,:) ) ) |
---|
| 122 | |
---|
| 123 | ! heat & salt content variation (associated with ssh) |
---|
| 124 | IF( .NOT. lk_vvl ) THEN |
---|
| 125 | z_ssh_hc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) ) ) |
---|
| 126 | z_ssh_sc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) ) ) |
---|
| 127 | ENDIF |
---|
| 128 | |
---|
[2148] | 129 | DO jk = 1, jpkm1 |
---|
| 130 | ! volume variation (calculated with scale factors) |
---|
[4345] | 131 | zdiff_v2 = zdiff_v2 + glob_sum( surf(:,:) * tmask(:,:,jk) & |
---|
| 132 | & * ( fse3t_n(:,:,jk) - e3t_ini(:,:,jk) ) ) |
---|
[2148] | 133 | ! heat content variation |
---|
[4345] | 134 | zdiff_hc = zdiff_hc + glob_sum( surf(:,:) * tmask(:,:,jk) & |
---|
| 135 | & * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_tem) - hc_loc_ini(:,:,jk) ) ) |
---|
[2148] | 136 | ! salt content variation |
---|
[4345] | 137 | zdiff_sc = zdiff_sc + glob_sum( surf(:,:) * tmask(:,:,jk) & |
---|
| 138 | & * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_sal) - sc_loc_ini(:,:,jk) ) ) |
---|
[2148] | 139 | ENDDO |
---|
| 140 | |
---|
| 141 | ! Substract forcing from heat content, salt content and volume variations |
---|
[4345] | 142 | zdiff_v1 = zdiff_v1 - frc_v |
---|
| 143 | IF( lk_vvl ) zdiff_v2 = zdiff_v2 - frc_v |
---|
| 144 | zdiff_hc = zdiff_hc - frc_t |
---|
| 145 | zdiff_sc = zdiff_sc - frc_s |
---|
[4220] | 146 | IF( .NOT. lk_vvl ) THEN |
---|
[4345] | 147 | zdiff_hc1 = zdiff_hc + z_ssh_hc |
---|
| 148 | zdiff_sc1 = zdiff_sc + z_ssh_sc |
---|
| 149 | zerr_hc1 = z_ssh_hc - frc_wn_t |
---|
| 150 | zerr_sc1 = z_ssh_sc - frc_wn_s |
---|
[4220] | 151 | ENDIF |
---|
[4345] | 152 | |
---|
[2148] | 153 | ! ----------------------- ! |
---|
[4345] | 154 | ! 3 - Diagnostics writing ! |
---|
[4045] | 155 | ! ----------------------- ! |
---|
[4345] | 156 | zvol_tot = 0.d0 ! total ocean volume |
---|
[4045] | 157 | DO jk = 1, jpkm1 |
---|
[4345] | 158 | zvol_tot = zvol_tot + glob_sum( surf(:,:) * tmask(:,:,jk) * fse3t_n(:,:,jk) ) |
---|
| 159 | END DO |
---|
| 160 | |
---|
| 161 | IF( lk_vvl ) THEN |
---|
| 162 | CALL iom_put( 'bgtemper' , zdiff_hc / zvol_tot ) ! Temperature variation (C) |
---|
| 163 | CALL iom_put( 'bgsaline' , zdiff_sc / zvol_tot ) ! Salinity variation (psu) |
---|
| 164 | CALL iom_put( 'bgheatco' , zdiff_hc * 1.e-20 * rau0 * rcp ) ! Heat content variation (1.e20 J) |
---|
| 165 | CALL iom_put( 'bgsaltco' , zdiff_sc * 1.e-9 ) ! Salt content variation (psu*km3) |
---|
| 166 | CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9 ) ! volume ssh variation (km3) |
---|
| 167 | CALL iom_put( 'bgvole3t' , zdiff_v2 * 1.e-9 ) ! volume e3t variation (km3) |
---|
| 168 | CALL iom_put( 'bgfrcvol' , frc_v * 1.e-9 ) ! vol - surface forcing (km3) |
---|
| 169 | CALL iom_put( 'bgfrctem' , frc_t / zvol_tot ) ! hc - surface forcing (C) |
---|
| 170 | CALL iom_put( 'bgfrcsal' , frc_s / zvol_tot ) ! sc - surface forcing (psu) |
---|
| 171 | ELSE |
---|
| 172 | CALL iom_put( 'bgtemper' , zdiff_hc1 / zvol_tot) ! Heat content variation (C) |
---|
| 173 | CALL iom_put( 'bgsaline' , zdiff_sc1 / zvol_tot) ! Salt content variation (psu) |
---|
| 174 | CALL iom_put( 'bgheatco' , zdiff_hc1 * 1.e-20 * rau0 * rcp ) ! Heat content variation (1.e20 J) |
---|
| 175 | CALL iom_put( 'bgsaltco' , zdiff_sc1 * 1.e-9 ) ! Salt content variation (psu*km3) |
---|
| 176 | CALL iom_put( 'bgvolssh' , zdiff_v1 * 1.e-9 ) ! volume ssh variation (km3) |
---|
| 177 | CALL iom_put( 'bgfrcvol' , frc_v * 1.e-9 ) ! vol - surface forcing (km3) |
---|
| 178 | CALL iom_put( 'bgfrctem' , frc_t / zvol_tot ) ! hc - surface forcing (C) |
---|
| 179 | CALL iom_put( 'bgfrcsal' , frc_s / zvol_tot ) ! sc - surface forcing (psu) |
---|
| 180 | CALL iom_put( 'bgmistem' , zerr_hc1 / zvol_tot ) ! hc - error due to free surface (C) |
---|
| 181 | CALL iom_put( 'bgmissal' , zerr_sc1 / zvol_tot ) ! sc - error due to free surface (psu) |
---|
[4220] | 182 | ENDIF |
---|
[4345] | 183 | ! |
---|
| 184 | IF( lrst_oce ) CALL dia_hsb_rst( kt, 'WRITE' ) |
---|
[4045] | 185 | |
---|
[3294] | 186 | IF( nn_timing == 1 ) CALL timing_stop('dia_hsb') |
---|
[4045] | 187 | ! |
---|
[2148] | 188 | END SUBROUTINE dia_hsb |
---|
| 189 | |
---|
[2334] | 190 | |
---|
[2148] | 191 | SUBROUTINE dia_hsb_init |
---|
| 192 | !!--------------------------------------------------------------------------- |
---|
| 193 | !! *** ROUTINE dia_hsb *** |
---|
| 194 | !! |
---|
| 195 | !! ** Purpose: Initialization for the heat salt volume budgets |
---|
| 196 | !! |
---|
| 197 | !! ** Method : Compute initial heat content, salt content and volume |
---|
| 198 | !! |
---|
| 199 | !! ** Action : - Compute initial heat content, salt content and volume |
---|
| 200 | !! - Initialize forcing trends |
---|
| 201 | !! - Compute coefficients for conversion |
---|
| 202 | !!--------------------------------------------------------------------------- |
---|
| 203 | INTEGER :: jk ! dummy loop indice |
---|
| 204 | INTEGER :: ierror ! local integer |
---|
[2334] | 205 | !! |
---|
[2148] | 206 | NAMELIST/namhsb/ ln_diahsb |
---|
| 207 | !!---------------------------------------------------------------------- |
---|
[2334] | 208 | ! |
---|
[2148] | 209 | REWIND ( numnam ) ! Read Namelist namhsb |
---|
| 210 | READ ( numnam, namhsb ) |
---|
[2334] | 211 | ! |
---|
[2148] | 212 | IF(lwp) THEN ! Control print |
---|
| 213 | WRITE(numout,*) |
---|
| 214 | WRITE(numout,*) 'dia_hsb_init : check the heat and salt budgets' |
---|
| 215 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
| 216 | WRITE(numout,*) ' Namelist namhsb : set hsb parameters' |
---|
| 217 | WRITE(numout,*) ' Switch for hsb diagnostic (T) or not (F) ln_diahsb = ', ln_diahsb |
---|
[4345] | 218 | WRITE(numout,*) |
---|
[2148] | 219 | ENDIF |
---|
| 220 | |
---|
| 221 | IF( .NOT. ln_diahsb ) RETURN |
---|
[4345] | 222 | ! IF( .NOT. lk_mpp_rep ) & |
---|
| 223 | ! CALL ctl_stop (' Your global mpp_sum if performed in single precision - 64 bits -', & |
---|
| 224 | ! & ' whereas the global sum to be precise must be done in double precision ',& |
---|
| 225 | ! & ' please add key_mpp_rep') |
---|
[2148] | 226 | |
---|
[4345] | 227 | ! ------------------- ! |
---|
| 228 | ! 1 - Allocate memory ! |
---|
| 229 | ! ------------------- ! |
---|
| 230 | ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), & |
---|
| 231 | & e3t_ini(jpi,jpj,jpk), surf(jpi,jpj), ssh_ini(jpi,jpj), STAT=ierror ) |
---|
| 232 | IF( ierror > 0 ) THEN |
---|
| 233 | CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' ) ; RETURN |
---|
| 234 | ENDIF |
---|
| 235 | |
---|
| 236 | IF(.NOT. lk_vvl ) ALLOCATE( ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj),STAT=ierror ) |
---|
| 237 | IF( ierror > 0 ) THEN |
---|
| 238 | CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' ) ; RETURN |
---|
| 239 | ENDIF |
---|
| 240 | |
---|
| 241 | ! ----------------------------------------------- ! |
---|
| 242 | ! 2 - Time independant variables and file opening ! |
---|
| 243 | ! ----------------------------------------------- ! |
---|
| 244 | IF(lwp) WRITE(numout,*) "dia_hsb: heat salt volume budgets activated" |
---|
| 245 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 246 | surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:) ! masked surface grid cell area |
---|
| 247 | surf_tot = glob_sum( surf(:,:) ) ! total ocean surface area |
---|
| 248 | |
---|
| 249 | IF( lk_bdy ) CALL ctl_warn( 'dia_hsb does not take open boundary fluxes into account' ) |
---|
[4045] | 250 | ! |
---|
[4345] | 251 | ! ---------------------------------- ! |
---|
| 252 | ! 4 - initial conservation variables ! |
---|
| 253 | ! ---------------------------------- ! |
---|
| 254 | CALL dia_hsb_rst( nit000, 'READ' ) !* read or initialize all required files |
---|
| 255 | ! |
---|
[4045] | 256 | END SUBROUTINE dia_hsb_init |
---|
[2148] | 257 | |
---|
[4045] | 258 | SUBROUTINE dia_hsb_rst( kt, cdrw ) |
---|
| 259 | !!--------------------------------------------------------------------- |
---|
| 260 | !! *** ROUTINE limdia_rst *** |
---|
| 261 | !! |
---|
| 262 | !! ** Purpose : Read or write DIA file in restart file |
---|
| 263 | !! |
---|
| 264 | !! ** Method : use of IOM library |
---|
| 265 | !!---------------------------------------------------------------------- |
---|
| 266 | INTEGER , INTENT(in) :: kt ! ocean time-step |
---|
| 267 | CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag |
---|
| 268 | ! |
---|
| 269 | INTEGER :: jk ! |
---|
| 270 | INTEGER :: id1 ! local integers |
---|
| 271 | !!---------------------------------------------------------------------- |
---|
| 272 | ! |
---|
| 273 | IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise |
---|
| 274 | IF( ln_rstart ) THEN !* Read the restart file |
---|
| 275 | !id1 = iom_varid( numror, 'frc_vol' , ldstop = .FALSE. ) |
---|
| 276 | ! |
---|
[4345] | 277 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 278 | IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp |
---|
| 279 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
[4045] | 280 | CALL iom_get( numror, 'frc_v', frc_v ) |
---|
| 281 | CALL iom_get( numror, 'frc_t', frc_t ) |
---|
| 282 | CALL iom_get( numror, 'frc_s', frc_s ) |
---|
[4345] | 283 | IF( .NOT. lk_vvl ) THEN |
---|
| 284 | CALL iom_get( numror, 'frc_wn_t', frc_wn_t ) |
---|
| 285 | CALL iom_get( numror, 'frc_wn_s', frc_wn_s ) |
---|
| 286 | ENDIF |
---|
[4045] | 287 | CALL iom_get( numror, jpdom_autoglo, 'ssh_ini', ssh_ini ) |
---|
| 288 | CALL iom_get( numror, jpdom_autoglo, 'e3t_ini', e3t_ini ) |
---|
| 289 | CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini ) |
---|
| 290 | CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini ) |
---|
[4345] | 291 | IF( .NOT. lk_vvl ) THEN |
---|
| 292 | CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini ) |
---|
| 293 | CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini ) |
---|
| 294 | ENDIF |
---|
[4045] | 295 | ELSE |
---|
[4345] | 296 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 297 | IF(lwp) WRITE(numout,*) ' dia_hsb at initial state ' |
---|
| 298 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
[4045] | 299 | ssh_ini(:,:) = sshn(:,:) ! initial ssh |
---|
| 300 | DO jk = 1, jpk |
---|
| 301 | e3t_ini (:,:,jk) = fse3t_n(:,:,jk) ! initial vertical scale factors |
---|
| 302 | hc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_tem) * fse3t_n(:,:,jk) ! initial heat content |
---|
| 303 | sc_loc_ini(:,:,jk) = tsn(:,:,jk,jp_sal) * fse3t_n(:,:,jk) ! initial salt content |
---|
| 304 | END DO |
---|
[4345] | 305 | frc_v = 0.d0 ! volume trend due to forcing |
---|
| 306 | frc_t = 0.d0 ! heat content - - - - |
---|
| 307 | frc_s = 0.d0 ! salt content - - - - |
---|
| 308 | IF( .NOT. lk_vvl ) THEN |
---|
| 309 | ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) ! initial heat content in ssh |
---|
| 310 | ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * sshn(:,:) ! initial salt content in ssh |
---|
| 311 | frc_wn_t = 0.d0 ! initial heat content misfit due to free surface |
---|
| 312 | frc_wn_s = 0.d0 ! initial salt content misfit due to free surface |
---|
| 313 | ENDIF |
---|
[4045] | 314 | ENDIF |
---|
[2148] | 315 | |
---|
[4045] | 316 | ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file |
---|
| 317 | ! ! ------------------- |
---|
[4345] | 318 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 319 | IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp |
---|
| 320 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 321 | |
---|
[4045] | 322 | CALL iom_rstput( kt, nitrst, numrow, 'frc_v' , frc_v ) |
---|
| 323 | CALL iom_rstput( kt, nitrst, numrow, 'frc_t' , frc_t ) |
---|
| 324 | CALL iom_rstput( kt, nitrst, numrow, 'frc_s' , frc_s ) |
---|
[4345] | 325 | IF( .NOT. lk_vvl ) THEN |
---|
| 326 | CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t ) |
---|
| 327 | CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s ) |
---|
| 328 | ENDIF |
---|
[4045] | 329 | CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini', ssh_ini ) |
---|
| 330 | CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini', e3t_ini ) |
---|
| 331 | CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini ) |
---|
| 332 | CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini ) |
---|
[4345] | 333 | IF( .NOT. lk_vvl ) THEN |
---|
| 334 | CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini ) |
---|
| 335 | CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini ) |
---|
| 336 | ENDIF |
---|
[4045] | 337 | ! |
---|
| 338 | ENDIF |
---|
| 339 | ! |
---|
| 340 | END SUBROUTINE dia_hsb_rst |
---|
[2148] | 341 | |
---|
| 342 | !!====================================================================== |
---|
| 343 | END MODULE diahsb |
---|