[888] | 1 | MODULE sbcana |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE sbcana *** |
---|
| 4 | !! Ocean forcing: analytical momentum, heat and freshwater forcings |
---|
| 5 | !!===================================================================== |
---|
[1559] | 6 | !! History : 3.0 ! 2006-06 (G. Madec) Original code |
---|
| 7 | !! 3.2 ! 2009-07 (G. Madec) Style only |
---|
[888] | 8 | !!---------------------------------------------------------------------- |
---|
| 9 | |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! sbc_ana : set an analytical ocean forcing |
---|
| 12 | !! sbc_gyre : set the GYRE configuration analytical forcing |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
| 14 | USE oce ! ocean dynamics and tracers |
---|
| 15 | USE dom_oce ! ocean space and time domain |
---|
| 16 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
| 17 | USE phycst ! physical constants |
---|
| 18 | USE in_out_manager ! I/O manager |
---|
| 19 | USE lib_mpp ! distribued memory computing library |
---|
| 20 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[2548] | 21 | USE lib_fortran |
---|
[888] | 22 | |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
| 25 | |
---|
| 26 | PUBLIC sbc_ana ! routine called in sbcmod module |
---|
| 27 | PUBLIC sbc_gyre ! routine called in sbcmod module |
---|
| 28 | |
---|
[2715] | 29 | ! !!* Namelist namsbc_ana * |
---|
| 30 | INTEGER :: nn_tau000 = 1 ! nb of time-step during which the surface stress |
---|
| 31 | ! ! increase from 0 to its nominal value |
---|
| 32 | REAL(wp) :: rn_utau0 = 0._wp ! constant wind stress value in i-direction |
---|
| 33 | REAL(wp) :: rn_vtau0 = 0._wp ! constant wind stress value in j-direction |
---|
| 34 | REAL(wp) :: rn_qns0 = 0._wp ! non solar heat flux |
---|
| 35 | REAL(wp) :: rn_qsr0 = 0._wp ! solar heat flux |
---|
| 36 | REAL(wp) :: rn_emp0 = 0._wp ! net freshwater flux |
---|
[1230] | 37 | |
---|
[888] | 38 | !! * Substitutions |
---|
| 39 | # include "domzgr_substitute.h90" |
---|
[1028] | 40 | # include "vectopt_loop_substitute.h90" |
---|
[888] | 41 | !!---------------------------------------------------------------------- |
---|
[2528] | 42 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[1156] | 43 | !! $Id$ |
---|
[2715] | 44 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[888] | 45 | !!---------------------------------------------------------------------- |
---|
| 46 | CONTAINS |
---|
| 47 | |
---|
| 48 | SUBROUTINE sbc_ana( kt ) |
---|
| 49 | !!--------------------------------------------------------------------- |
---|
| 50 | !! *** ROUTINE sbc_ana *** |
---|
| 51 | !! |
---|
| 52 | !! ** Purpose : provide at each time-step the ocean surface boundary |
---|
[1559] | 53 | !! condition, i.e. the momentum, heat and freshwater fluxes. |
---|
[888] | 54 | !! |
---|
| 55 | !! ** Method : Constant and uniform surface forcing specified from |
---|
[1559] | 56 | !! namsbc_ana namelist parameters. All the fluxes are time |
---|
| 57 | !! independant except the stresses which increase from zero |
---|
| 58 | !! during the first nn_tau000 time-step |
---|
| 59 | !! CAUTION : never mask the surface stress field ! |
---|
[888] | 60 | !! |
---|
| 61 | !! ** Action : - set the ocean surface boundary condition, i.e. |
---|
[1695] | 62 | !! utau, vtau, taum, wndm, qns, qsr, emp, emps |
---|
[888] | 63 | !!---------------------------------------------------------------------- |
---|
| 64 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
[2715] | 65 | ! |
---|
| 66 | REAL(wp) :: zfacto ! local scalar |
---|
| 67 | REAL(wp) :: zrhoa = 1.22_wp ! Air density kg/m3 |
---|
| 68 | REAL(wp) :: zcdrag = 1.5e-3_wp ! drag coefficient |
---|
| 69 | REAL(wp) :: ztx, zty, zmod, zcoef ! temporary variables |
---|
[1025] | 70 | !! |
---|
| 71 | NAMELIST/namsbc_ana/ nn_tau000, rn_utau0, rn_vtau0, rn_qns0, rn_qsr0, rn_emp0 |
---|
[888] | 72 | !!--------------------------------------------------------------------- |
---|
| 73 | ! |
---|
| 74 | IF( kt == nit000 ) THEN |
---|
| 75 | ! |
---|
[2715] | 76 | REWIND( numnam ) ! Read Namelist namsbc : surface fluxes |
---|
| 77 | READ ( numnam, namsbc_ana ) |
---|
[1025] | 78 | ! |
---|
[888] | 79 | IF(lwp) WRITE(numout,*)' ' |
---|
| 80 | IF(lwp) WRITE(numout,*)' sbc_ana : Constant surface fluxes read in namsbc_ana namelist' |
---|
| 81 | IF(lwp) WRITE(numout,*)' ~~~~~~~ ' |
---|
| 82 | IF(lwp) WRITE(numout,*)' spin up of the stress nn_tau000 = ', nn_tau000, ' time-steps' |
---|
| 83 | IF(lwp) WRITE(numout,*)' constant i-stress rn_utau0 = ', rn_utau0 , ' N/m2' |
---|
| 84 | IF(lwp) WRITE(numout,*)' constant j-stress rn_vtau0 = ', rn_vtau0 , ' N/m2' |
---|
| 85 | IF(lwp) WRITE(numout,*)' non solar heat flux rn_qns0 = ', rn_qns0 , ' W/m2' |
---|
| 86 | IF(lwp) WRITE(numout,*)' solar heat flux rn_qsr0 = ', rn_qsr0 , ' W/m2' |
---|
| 87 | IF(lwp) WRITE(numout,*)' net heat flux rn_emp0 = ', rn_emp0 , ' Kg/m2/s' |
---|
[1025] | 88 | ! |
---|
[2715] | 89 | nn_tau000 = MAX( nn_tau000, 1 ) ! must be >= 1 |
---|
[888] | 90 | ! |
---|
[3273] | 91 | qns (:,:) = rn_qns0 |
---|
| 92 | qsr (:,:) = rn_qsr0 |
---|
| 93 | emp (:,:) = rn_emp0 |
---|
| 94 | emps(:,:) = rn_emp0 |
---|
| 95 | ! |
---|
| 96 | utau(:,:) = rn_utau0 |
---|
| 97 | vtau(:,:) = rn_vtau0 |
---|
| 98 | taum(:,:) = SQRT ( rn_utau0 * rn_utau0 + rn_vtau0 * rn_vtau0 ) |
---|
| 99 | wndm(:,:) = SQRT ( taum(1,1) / ( zrhoa * zcdrag ) ) |
---|
| 100 | ! |
---|
[888] | 101 | ENDIF |
---|
[2147] | 102 | |
---|
[888] | 103 | |
---|
| 104 | ! Increase the surface stress to its nominal value during the first nn_tau000 time-steps |
---|
| 105 | IF( kt <= nn_tau000 ) THEN |
---|
| 106 | zfacto = 0.5 * ( 1. - COS( rpi * FLOAT( kt ) / FLOAT( nn_tau000 ) ) ) |
---|
[1695] | 107 | zcoef = 1. / ( zrhoa * zcdrag ) |
---|
| 108 | ztx = zfacto * rn_utau0 |
---|
| 109 | zty = zfacto * rn_vtau0 |
---|
| 110 | zmod = SQRT( ztx * ztx + zty * zty ) |
---|
| 111 | utau(:,:) = ztx |
---|
| 112 | vtau(:,:) = zty |
---|
| 113 | taum(:,:) = zmod |
---|
| 114 | zmod = SQRT( zmod * zcoef ) |
---|
| 115 | wndm(:,:) = zmod |
---|
[888] | 116 | ENDIF |
---|
[1025] | 117 | ! |
---|
[888] | 118 | END SUBROUTINE sbc_ana |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | SUBROUTINE sbc_gyre( kt ) |
---|
| 122 | !!--------------------------------------------------------------------- |
---|
| 123 | !! *** ROUTINE sbc_ana *** |
---|
| 124 | !! |
---|
[1559] | 125 | !! ** Purpose : provide at each time-step the GYRE surface boundary |
---|
| 126 | !! condition, i.e. the momentum, heat and freshwater fluxes. |
---|
[888] | 127 | !! |
---|
| 128 | !! ** Method : analytical seasonal cycle for GYRE configuration. |
---|
[1559] | 129 | !! CAUTION : never mask the surface stress field ! |
---|
[888] | 130 | !! |
---|
| 131 | !! ** Action : - set the ocean surface boundary condition, i.e. |
---|
[1695] | 132 | !! utau, vtau, taum, wndm, qns, qsr, emp, emps |
---|
[888] | 133 | !! |
---|
| 134 | !! Reference : Hazeleger, W., and S. Drijfhout, JPO, 30, 677-695, 2000. |
---|
| 135 | !!---------------------------------------------------------------------- |
---|
| 136 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
[1559] | 137 | !! |
---|
[888] | 138 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 139 | INTEGER :: zyear0 ! initial year |
---|
| 140 | INTEGER :: zmonth0 ! initial month |
---|
| 141 | INTEGER :: zday0 ! initial day |
---|
| 142 | INTEGER :: zday_year0 ! initial day since january 1st |
---|
| 143 | REAL(wp) :: ztau , ztau_sais ! wind intensity and of the seasonal cycle |
---|
| 144 | REAL(wp) :: ztime ! time in hour |
---|
| 145 | REAL(wp) :: ztimemax , ztimemin ! 21th June, and 21th decem. if date0 = 1st january |
---|
| 146 | REAL(wp) :: ztimemax1, ztimemin1 ! 21th June, and 21th decem. if date0 = 1st january |
---|
| 147 | REAL(wp) :: ztimemax2, ztimemin2 ! 21th June, and 21th decem. if date0 = 1st january |
---|
| 148 | REAL(wp) :: ztaun ! intensity |
---|
| 149 | REAL(wp) :: zemp_s, zemp_n, zemp_sais, ztstar |
---|
| 150 | REAL(wp) :: zcos_sais1, zcos_sais2, ztrp, zconv, t_star |
---|
| 151 | REAL(wp) :: zsumemp, zsurf |
---|
[1695] | 152 | REAL(wp) :: zrhoa = 1.22 ! Air density kg/m3 |
---|
| 153 | REAL(wp) :: zcdrag = 1.5e-3 ! drag coefficient |
---|
| 154 | REAL(wp) :: ztx, zty, zmod, zcoef ! temporary variables |
---|
[1732] | 155 | REAL(wp) :: zyydd ! number of days in one year |
---|
[888] | 156 | !!--------------------------------------------------------------------- |
---|
[1732] | 157 | zyydd = REAL(nyear_len(1),wp) |
---|
| 158 | |
---|
[888] | 159 | ! ---------------------------- ! |
---|
| 160 | ! heat and freshwater fluxes ! |
---|
| 161 | ! ---------------------------- ! |
---|
| 162 | !same temperature, E-P as in HAZELEGER 2000 |
---|
| 163 | |
---|
| 164 | zyear0 = ndate0 / 10000 ! initial year |
---|
| 165 | zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100 ! initial month |
---|
| 166 | zday0 = ndate0 - zyear0 * 10000 - zmonth0 * 100 ! initial day betwen 1 and 30 |
---|
| 167 | zday_year0 = ( zmonth0 - 1 ) * 30.+zday0 ! initial day betwen 1 and 360 |
---|
| 168 | |
---|
| 169 | ! current day (in hours) since january the 1st of the current year |
---|
| 170 | ztime = REAL( kt ) * rdt / (rmmss * rhhmm) & ! total incrementation (in hours) |
---|
[1732] | 171 | & - (nyear - 1) * rjjhh * zyydd ! minus years since beginning of experiment (in hours) |
---|
[888] | 172 | |
---|
| 173 | ztimemax1 = ((5.*30.)+21.)* 24. ! 21th june at 24h in hours |
---|
[1732] | 174 | ztimemin1 = ztimemax1 + rjjhh * zyydd / 2 ! 21th december in hours |
---|
[888] | 175 | ztimemax2 = ((6.*30.)+21.)* 24. ! 21th july at 24h in hours |
---|
[1732] | 176 | ztimemin2 = ztimemax2 - rjjhh * zyydd / 2 ! 21th january in hours |
---|
| 177 | ! ! NB: rjjhh * zyydd / 4 = one seasonal cycle in hours |
---|
[888] | 178 | |
---|
| 179 | ! amplitudes |
---|
| 180 | zemp_S = 0.7 ! intensity of COS in the South |
---|
| 181 | zemp_N = 0.8 ! intensity of COS in the North |
---|
| 182 | zemp_sais = 0.1 |
---|
| 183 | zTstar = 28.3 ! intemsity from 28.3 a -5 deg |
---|
| 184 | |
---|
| 185 | ! 1/2 period between 21th June and 21th December and between 21th July and 21th January |
---|
| 186 | zcos_sais1 = COS( (ztime - ztimemax1) / (ztimemin1 - ztimemax1) * rpi ) |
---|
| 187 | zcos_sais2 = COS( (ztime - ztimemax2) / (ztimemax2 - ztimemin2) * rpi ) |
---|
| 188 | |
---|
| 189 | ztrp= - 40.e0 ! retroaction term on heat fluxes (W/m2/K) |
---|
| 190 | zconv = 3.16e-5 ! convertion factor: 1 m/yr => 3.16e-5 mm/s |
---|
| 191 | DO jj = 1, jpj |
---|
| 192 | DO ji = 1, jpi |
---|
| 193 | ! domain from 15 deg to 50 deg between 27 and 28 degC at 15N, -3 |
---|
| 194 | ! and 13 degC at 50N 53.5 + or - 11 = 1/4 period : |
---|
| 195 | ! 64.5 in summer, 42.5 in winter |
---|
| 196 | t_star = zTstar * ( 1 + 1. / 50. * zcos_sais2 ) & |
---|
| 197 | & * COS( rpi * (gphit(ji,jj) - 5.) & |
---|
| 198 | & / ( 53.5 * ( 1 + 11 / 53.5 * zcos_sais2 ) * 2.) ) |
---|
| 199 | ! 23.5 deg : tropics |
---|
| 200 | qsr (ji,jj) = 230 * COS( 3.1415 * ( gphit(ji,jj) - 23.5 * zcos_sais1 ) / ( 0.9 * 180 ) ) |
---|
[2977] | 201 | qns (ji,jj) = ztrp * ( tsb(ji,jj,1,jp_tem) - t_star ) - qsr(ji,jj) |
---|
[888] | 202 | IF( gphit(ji,jj) >= 14.845 .AND. 37.2 >= gphit(ji,jj) ) THEN ! zero at 37.8 deg, max at 24.6 deg |
---|
| 203 | emp (ji,jj) = zemp_S * zconv & |
---|
| 204 | & * SIN( rpi / 2 * (gphit(ji,jj) - 37.2) / (24.6 - 37.2) ) & |
---|
| 205 | & * ( 1 - zemp_sais / zemp_S * zcos_sais1) |
---|
| 206 | ELSE |
---|
| 207 | emp (ji,jj) = - zemp_N * zconv & |
---|
| 208 | & * SIN( rpi / 2 * (gphit(ji,jj) - 37.2) / (46.8 - 37.2) ) & |
---|
| 209 | & * ( 1 - zemp_sais / zemp_N * zcos_sais1 ) |
---|
| 210 | ENDIF |
---|
| 211 | END DO |
---|
| 212 | END DO |
---|
| 213 | emps(:,:) = emp(:,:) |
---|
| 214 | |
---|
| 215 | ! Compute the emp flux such as its integration on the whole domain at each time is zero |
---|
[2528] | 216 | IF( nbench /= 1 ) THEN |
---|
[2548] | 217 | zsumemp = GLOB_SUM( emp(:,:) ) |
---|
| 218 | zsurf = GLOB_SUM( tmask(:,:,1) ) |
---|
[888] | 219 | ! Default GYRE configuration |
---|
| 220 | zsumemp = zsumemp / zsurf |
---|
| 221 | ELSE |
---|
| 222 | ! Benchmark GYRE configuration (to allow the bit to bit comparison between Mpp/Mono case) |
---|
| 223 | zsumemp = 0.e0 ; zsurf = 0.e0 |
---|
| 224 | ENDIF |
---|
| 225 | |
---|
| 226 | !salinity terms |
---|
| 227 | emp (:,:) = emp(:,:) - zsumemp * tmask(:,:,1) |
---|
| 228 | emps(:,:) = emp(:,:) |
---|
| 229 | |
---|
| 230 | |
---|
| 231 | ! ---------------------------- ! |
---|
| 232 | ! momentum fluxes ! |
---|
| 233 | ! ---------------------------- ! |
---|
| 234 | ! same wind as in Wico |
---|
| 235 | !test date0 : ndate0 = 010203 |
---|
| 236 | zyear0 = ndate0 / 10000 |
---|
| 237 | zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100 |
---|
| 238 | zday0 = ndate0 - zyear0 * 10000 - zmonth0 * 100 |
---|
| 239 | !Calculates nday_year, day since january 1st |
---|
| 240 | zday_year0 = (zmonth0-1)*30.+zday0 |
---|
| 241 | |
---|
| 242 | !accumulates days of previous months of this year |
---|
| 243 | ! day (in hours) since january the 1st |
---|
| 244 | ztime = FLOAT( kt ) * rdt / (rmmss * rhhmm) & ! incrementation in hour |
---|
[1732] | 245 | & - (nyear - 1) * rjjhh * zyydd ! - nber of hours the precedent years |
---|
[888] | 246 | ztimemax = ((5.*30.)+21.)* 24. ! 21th june in hours |
---|
[1732] | 247 | ztimemin = ztimemax + rjjhh * zyydd / 2 ! 21th december in hours |
---|
| 248 | ! ! NB: rjjhh * zyydd / 4 = 1 seasonal cycle in hours |
---|
[888] | 249 | |
---|
| 250 | ! mean intensity at 0.105 ; srqt(2) because projected with 45deg angle |
---|
| 251 | ztau = 0.105 / SQRT( 2. ) |
---|
| 252 | ! seasonal oscillation intensity |
---|
| 253 | ztau_sais = 0.015 |
---|
| 254 | ztaun = ztau - ztau_sais * COS( (ztime - ztimemax) / (ztimemin - ztimemax) * rpi ) |
---|
| 255 | DO jj = 1, jpj |
---|
| 256 | DO ji = 1, jpi |
---|
| 257 | ! domain from 15deg to 50deg and 1/2 period along 14deg |
---|
| 258 | ! so 5/4 of half period with seasonal cycle |
---|
| 259 | utau(ji,jj) = - ztaun * SIN( rpi * (gphiu(ji,jj) - 15.) / (29.-15.) ) |
---|
| 260 | vtau(ji,jj) = ztaun * SIN( rpi * (gphiv(ji,jj) - 15.) / (29.-15.) ) |
---|
| 261 | END DO |
---|
| 262 | END DO |
---|
| 263 | |
---|
[1695] | 264 | ! module of wind stress and wind speed at T-point |
---|
| 265 | zcoef = 1. / ( zrhoa * zcdrag ) |
---|
| 266 | !CDIR NOVERRCHK |
---|
| 267 | DO jj = 2, jpjm1 |
---|
| 268 | !CDIR NOVERRCHK |
---|
| 269 | DO ji = fs_2, fs_jpim1 ! vect. opt. |
---|
| 270 | ztx = utau(ji-1,jj ) + utau(ji,jj) |
---|
| 271 | zty = vtau(ji ,jj-1) + vtau(ji,jj) |
---|
| 272 | zmod = 0.5 * SQRT( ztx * ztx + zty * zty ) |
---|
| 273 | taum(ji,jj) = zmod |
---|
| 274 | wndm(ji,jj) = SQRT( zmod * zcoef ) |
---|
| 275 | END DO |
---|
| 276 | END DO |
---|
| 277 | CALL lbc_lnk( taum(:,:), 'T', 1. ) ; CALL lbc_lnk( wndm(:,:), 'T', 1. ) |
---|
[1000] | 278 | |
---|
[888] | 279 | ! ---------------------------------- ! |
---|
| 280 | ! control print at first time-step ! |
---|
| 281 | ! ---------------------------------- ! |
---|
| 282 | IF( kt == nit000 .AND. lwp ) THEN |
---|
| 283 | WRITE(numout,*) |
---|
| 284 | WRITE(numout,*)'sbc_gyre : analytical surface fluxes for GYRE configuration' |
---|
| 285 | WRITE(numout,*)'~~~~~~~~ ' |
---|
| 286 | WRITE(numout,*)' nyear = ', nyear |
---|
| 287 | WRITE(numout,*)' nmonth = ', nmonth |
---|
| 288 | WRITE(numout,*)' nday = ', nday |
---|
[1732] | 289 | WRITE(numout,*)' nday_year = ', nday_year |
---|
[888] | 290 | WRITE(numout,*)' ztime = ', ztime |
---|
[1732] | 291 | WRITE(numout,*)' ztimemax = ', ztimemax |
---|
| 292 | WRITE(numout,*)' ztimemin = ', ztimemin |
---|
[888] | 293 | WRITE(numout,*)' ztimemax1 = ', ztimemax1 |
---|
| 294 | WRITE(numout,*)' ztimemin1 = ', ztimemin1 |
---|
| 295 | WRITE(numout,*)' ztimemax2 = ', ztimemax2 |
---|
| 296 | WRITE(numout,*)' ztimemin2 = ', ztimemin2 |
---|
| 297 | WRITE(numout,*)' zyear0 = ', zyear0 |
---|
| 298 | WRITE(numout,*)' zmonth0 = ', zmonth0 |
---|
| 299 | WRITE(numout,*)' zday0 = ', zday0 |
---|
| 300 | WRITE(numout,*)' zday_year0 = ', zday_year0 |
---|
[1732] | 301 | WRITE(numout,*)' zyydd = ', zyydd |
---|
[888] | 302 | WRITE(numout,*)' zemp_S = ', zemp_S |
---|
| 303 | WRITE(numout,*)' zemp_N = ', zemp_N |
---|
| 304 | WRITE(numout,*)' zemp_sais = ', zemp_sais |
---|
| 305 | WRITE(numout,*)' zTstar = ', zTstar |
---|
| 306 | WRITE(numout,*)' zsumemp = ', zsumemp |
---|
| 307 | WRITE(numout,*)' zsurf = ', zsurf |
---|
| 308 | WRITE(numout,*)' ztrp = ', ztrp |
---|
| 309 | WRITE(numout,*)' zconv = ', zconv |
---|
[1732] | 310 | WRITE(numout,*)' ndastp = ', ndastp |
---|
| 311 | WRITE(numout,*)' adatrj = ', adatrj |
---|
[888] | 312 | ENDIF |
---|
[1559] | 313 | ! |
---|
[888] | 314 | END SUBROUTINE sbc_gyre |
---|
| 315 | |
---|
| 316 | !!====================================================================== |
---|
| 317 | END MODULE sbcana |
---|