sbcblk_mfs.F90 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. MODULE sbcblk_mfs
  2. !!======================================================================
  3. !! *** MODULE sbcblk_mfs ***
  4. !! Ocean forcing: momentum, heat and freshwater flux formulation
  5. !!=====================================================================
  6. !! History : 3.3 ! 2010-05 (P. Oddo) Original Code
  7. !!----------------------------------------------------------------------
  8. !!----------------------------------------------------------------------
  9. !! sbc_blk_mfs : bulk formulation as ocean surface boundary condition
  10. !! (forced mode, mfs bulk formulae)
  11. !! blk_oce_mfs : ocean: computes momentum, heat and freshwater fluxes
  12. !!----------------------------------------------------------------------
  13. USE oce ! ocean dynamics and tracers
  14. USE dom_oce ! ocean space and time domain
  15. USE phycst ! physical constants
  16. USE fldread ! read input fields
  17. USE sbc_oce ! Surface boundary condition: ocean fields
  18. USE iom ! I/O manager library
  19. USE in_out_manager ! I/O manager
  20. USE lib_mpp ! distribued memory computing library
  21. USE wrk_nemo ! work arrays
  22. USE timing ! Timing
  23. USE lbclnk ! ocean lateral boundary conditions (or mpp link)
  24. USE prtctl ! Print control
  25. USE sbcwave,ONLY : cdn_wave !wave module
  26. IMPLICIT NONE
  27. PRIVATE
  28. PUBLIC sbc_blk_mfs ! routine called in sbcmod module
  29. INTEGER , PARAMETER :: jpfld = 7 ! maximum number of files to read
  30. INTEGER , PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point
  31. INTEGER , PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point
  32. INTEGER , PARAMETER :: jp_clc = 3 ! index of total cloud cover ( % )
  33. INTEGER , PARAMETER :: jp_msl = 4 ! index of mean sea level pressure (Pa)
  34. INTEGER , PARAMETER :: jp_tair = 5 ! index of 10m air temperature (Kelvin)
  35. INTEGER , PARAMETER :: jp_rhm = 6 ! index of dew point temperature (Kelvin)
  36. INTEGER , PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s)
  37. TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read)
  38. !! * Substitutions
  39. # include "domzgr_substitute.h90"
  40. # include "vectopt_loop_substitute.h90"
  41. !!----------------------------------------------------------------------
  42. !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)
  43. !! $Id: sbcblk_mfs.F90 4578 2017-09-25 09:34:12Z ufla $
  44. !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
  45. !!----------------------------------------------------------------------
  46. CONTAINS
  47. SUBROUTINE sbc_blk_mfs( kt )
  48. !!---------------------------------------------------------------------
  49. !! *** ROUTINE sbc_blk_mfs ***
  50. !!
  51. !! ** Purpose : provide at each time step the surface ocean fluxes
  52. !! (momentum, heat, freshwater, runoff is added later in the code)
  53. !!
  54. !! ** Method : (1) READ Atmospheric data from NetCDF files:
  55. !! the 10m wind velocity (i-component) (m/s) at T-point
  56. !! the 10m wind velocity (j-component) (m/s) at T-point
  57. !! the 2m Dew point Temperature (k)
  58. !! the Cloud COver (%)
  59. !! the 2m air temperature (Kelvin)
  60. !! the Mean Sea Level Preesure (hPa)
  61. !! the Climatological Precipitation (kg/m2/s)
  62. !! (2) CALL blk_oce_mfs
  63. !!
  64. !! Computes:
  65. !! Solar Radiation using Reed formula (1975, 1977)
  66. !! Net Long wave radiation using Bignami et al. (1995)
  67. !! Latent and Sensible heat using Kondo (1975)
  68. !! Drag coeff using Hllerman and Rosenstein (1983)
  69. !! C A U T I O N : never mask the surface stress fields
  70. !! the stress is assumed to be in the mesh referential
  71. !! i.e. the (i,j) referential
  72. !!
  73. !! ** Action : defined at each time-step at the air-sea interface
  74. !! - utau, vtau i- and j-component of the wind stress
  75. !! - taum wind stress module at T-point
  76. !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice
  77. !! - qns, qsr non-slor and solar heat flux
  78. !! - emp evaporation minus precipitation
  79. !!----------------------------------------------------------------------
  80. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sh_now ! specific humidity at T-point
  81. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: catm ! Cover
  82. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: alonl ! Lon
  83. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: alatl ! Lat
  84. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: gsst ! SST
  85. !!---------------------------------------------------------------------
  86. !! Local fluxes variables
  87. !!---------------------------------------------------------------------
  88. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: qbw ! Net Long wave
  89. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ha ! Sesnible
  90. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: elat ! Latent
  91. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: evap ! evaporation rate
  92. INTEGER, INTENT( in ) :: kt ! ocean time step
  93. !!
  94. INTEGER :: ierror ! return error code
  95. INTEGER :: ifpr ! dummy loop indice
  96. INTEGER :: jj,ji ! dummy loop arguments
  97. INTEGER :: ios ! Local integer output status for namelist read
  98. REAL(wp) :: act_hour
  99. !!--------------------------------------------------------------------
  100. !! Variables for specific humidity computation
  101. !!--------------------------------------------------------------------
  102. REAL(wp) :: onsea,par1,par2
  103. DATA onsea,par1,par2 / 0.98, 640380., -5107.4 /
  104. !! par1 [Kg/m3], par2 [K]
  105. CHARACTER(len=100) :: cn_dir ! Root directory for location of Atmospheric forcing files
  106. TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read
  107. TYPE(FLD_N) :: sn_wndi, sn_wndj, sn_clc, sn_msl ! informations about the fields to be read
  108. TYPE(FLD_N) :: sn_tair , sn_rhm, sn_prec ! " "
  109. !!---------------------------------------------------------------------
  110. NAMELIST/namsbc_mfs/ cn_dir , &
  111. & sn_wndi , sn_wndj, sn_clc , sn_msl , &
  112. & sn_tair , sn_rhm , sn_prec
  113. !!---------------------------------------------------------------------
  114. !
  115. IF( nn_timing == 1 ) CALL timing_start('sbc_blk_mfs')
  116. !
  117. ! ! ====================== !
  118. IF( kt == nit000 ) THEN ! First call kt=nit000 !
  119. ! ! ====================== !
  120. ALLOCATE( sh_now(jpi,jpj), catm(jpi,jpj), alonl(jpi,jpj), alatl(jpi,jpj), &
  121. & gsst(jpi,jpj), qbw(jpi,jpj), ha(jpi,jpj), elat(jpi,jpj), &
  122. & evap(jpi,jpj), STAT=ierror )
  123. IF( ierror /= 0 ) CALL ctl_warn('sbc_blk_mfs: failed to allocate arrays')
  124. REWIND( numnam_ref ) ! Namelist namsbc_msf in reference namelist : MFS files
  125. READ ( numnam_ref, namsbc_mfs, IOSTAT = ios, ERR = 901)
  126. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in reference namelist', lwp )
  127. REWIND( numnam_cfg ) ! Namelist namsbc_msf in configuration namelist : MFS files
  128. READ ( numnam_cfg, namsbc_mfs, IOSTAT = ios, ERR = 902 )
  129. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in configuration namelist', lwp )
  130. IF(lwm) WRITE ( numond, namsbc_mfs )
  131. !
  132. ! store namelist information in an array
  133. slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj
  134. slf_i(jp_clc ) = sn_clc ; slf_i(jp_msl ) = sn_msl
  135. slf_i(jp_tair) = sn_tair ; slf_i(jp_rhm) = sn_rhm
  136. slf_i(jp_prec) = sn_prec ;
  137. !
  138. ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure
  139. IF( ierror > 0 ) THEN
  140. CALL ctl_stop( 'sbc_blk_mfs: unable to allocate sf structure' ) ; RETURN
  141. ENDIF
  142. DO ifpr= 1, jpfld
  143. ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
  144. IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
  145. END DO
  146. ! fill sf with slf_i and control print
  147. CALL fld_fill( sf, slf_i, cn_dir,'sbc_blk_mfs','bulk formulation for ocean SBC', 'namsbc_mfs' )
  148. !
  149. ENDIF
  150. CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step
  151. catm(:,:) = 0.0 ! initializze cloud cover variable
  152. sh_now(:,:) = 0.0 ! initializze specifif humidity variable
  153. DO jj = 1, jpj
  154. DO ji = 1, jpi
  155. ! Calculate Specific Humidity
  156. !-------------------------------------------------
  157. sh_now(ji,jj) = (1/1.22) * onsea * par1 * EXP(par2/sf(jp_rhm)%fnow(ji,jj,1))
  158. ! Normalize Clouds
  159. !-------------------------------------------------
  160. catm(ji,jj) = max(0.0,min(1.0,sf(jp_clc)%fnow(ji,jj,1)*0.01))
  161. END DO
  162. END DO
  163. ! wind module at 10m
  164. !--------------------------------------------------
  165. wndm(:,:) = SQRT( sf(jp_wndi)%fnow(:,:,1) * sf(jp_wndi)%fnow(:,:,1) &
  166. & + sf(jp_wndj)%fnow(:,:,1) * sf(jp_wndj)%fnow(:,:,1) )
  167. ! Some conv for fluxes computation
  168. !-------------------------------------------------
  169. alonl(:,:) = glamt(:,:) * rad
  170. alatl(:,:) = gphit(:,:) * rad
  171. gsst(:,:) = tsn(:,:,1,jp_tem) * tmask(:,:,1)
  172. IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
  173. ! Force to zero the output of fluxes
  174. !-------------------------------------------------
  175. qsr(:,:) = 0.0 ; qbw(:,:) = 0.0 ;
  176. ha(:,:) = 0.0 ; elat(:,:) = 0.0 ;
  177. evap(:,:) = 0.0 ; utau(:,:) = 0.0 ;
  178. vtau(:,:) = 0.0
  179. CALL lbc_lnk( sf(jp_wndi)%fnow(:,:,1), 'T', -1. )
  180. CALL lbc_lnk( sf(jp_wndj)%fnow(:,:,1), 'T', -1. )
  181. act_hour = (( nsec_year / rday ) - INT (nsec_year / rday)) * rjjhh
  182. CALL fluxes_mfs(alatl,alonl,act_hour, & ! input static
  183. gsst(:,:),sf(jp_tair)%fnow(:,:,1),sh_now(:,:), & ! input dynamic
  184. sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1), & ! input dynamic
  185. sf(jp_msl)%fnow(:,:,1) , catm(:,:) , & ! input dynamic
  186. qsr,qbw,ha,elat,evap,utau,vtau) ! output
  187. ! Shortwave radiation
  188. !--------------------------------------------------
  189. qsr(:,:) = qsr(:,:) * tmask(:,:,1)
  190. ! total non solar heat flux over water
  191. !--------------------------------------------------
  192. qns(:,:) = -1. * ( qbw(:,:) + ha(:,:) + elat(:,:) )
  193. qns(:,:) = qns(:,:)*tmask(:,:,1)
  194. ! mask the wind module at 10m
  195. !--------------------------------------------------
  196. wndm(:,:) = wndm(:,:) * tmask(:,:,1)
  197. ! wind stress module (taum) into T-grid
  198. !--------------------------------------------------
  199. taum(:,:) = SQRT( utau(:,:) * utau(:,:) + vtau(:,:) * vtau(:,:) ) * tmask(:,:,1)
  200. CALL lbc_lnk( taum, 'T', 1. )
  201. ! Interpolate utau, vtau into the grid_V and grid_V
  202. !-------------------------------------------------
  203. ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines
  204. ! Note the use of MAX(tmask(i,j),tmask(i+1,j) is to mask tau over ice shelves
  205. DO jj = 1, jpjm1
  206. DO ji = 1, fs_jpim1
  207. utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( utau(ji,jj) * tmask(ji,jj,1) &
  208. & + utau(ji+1,jj) * tmask(ji+1,jj,1) ) &
  209. & * MAX(tmask(ji,jj,1),tmask(ji+1,jj ,1))
  210. vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( vtau(ji,jj) * tmask(ji,jj,1) &
  211. & + vtau(ji,jj+1) * tmask(ji,jj+1,1) ) &
  212. & * MAX(tmask(ji,jj,1),tmask(ji ,jj+1,1))
  213. END DO
  214. END DO
  215. CALL lbc_lnk( utau(:,:), 'U', -1. )
  216. CALL lbc_lnk( vtau(:,:), 'V', -1. )
  217. ! for basin budget and cooerence
  218. !--------------------------------------------------
  219. !CDIR COLLAPSE
  220. emp (:,:) = evap(:,:) - sf(jp_prec)%fnow(:,:,1) * tmask(:,:,1)
  221. !CDIR COLLAPSE
  222. CALL iom_put( "qlw_oce", qbw ) ! output downward longwave heat over the ocean
  223. CALL iom_put( "qsb_oce", - ha ) ! output downward sensible heat over the ocean
  224. CALL iom_put( "qla_oce", - elat ) ! output downward latent heat over the ocean
  225. CALL iom_put( "qns_oce", qns ) ! output downward non solar heat over the ocean
  226. ENDIF
  227. !
  228. IF( nn_timing == 1 ) CALL timing_stop('sbc_blk_mfs')
  229. !
  230. END SUBROUTINE sbc_blk_mfs
  231. SUBROUTINE fluxes_mfs(alat,alon,hour, &
  232. sst,tnow,shnow,unow,vnow,mslnow,cldnow,qsw,qbw,ha,elat, &
  233. evap,taux,tauy)
  234. !!----------------------------------------------------------------------
  235. !! *** ROUTINE fluxes_mfs ***
  236. !!
  237. !! --- it provides SURFACE HEAT and MOMENTUM FLUXES in MKS :
  238. !!
  239. !! 1) Water flux (WFLUX) [ watt/m*m ]
  240. !! 2) Short wave flux (QSW) [ watt/m*m ] Reed 1977
  241. !! 3) Long wave flux backward (QBW) [ watt/m*m ]
  242. !! 4) Latent heat of evaporation (ELAT) [ watt/m*m ]
  243. !! 5) Sensible heat flux (HA) [ watt/m*m ]
  244. !! 6) Wind stress x-component (TAUX) [ newton/m*m ]
  245. !! 7) Wind stress y-component (TAUY) [ newton/m*m ]
  246. !!
  247. !!----------------------------------------------------------------------
  248. USE sbcblk_core, ONLY: turb_core_2z ! For wave coupling and Tair/rh from 2 to 10m
  249. REAL(wp), INTENT(in ) :: hour
  250. REAL(wp), INTENT(in ), DIMENSION (:,:) :: sst, unow, alat , alon
  251. REAL(wp), INTENT(in ), DIMENSION (:,:) :: vnow, cldnow, mslnow
  252. REAL(wp), INTENT(out ), DIMENSION (:,:) :: qsw, qbw, ha, elat
  253. REAL(wp), INTENT(out ), DIMENSION (:,:) :: evap,taux,tauy
  254. REAL(wp), INTENT(inout), DIMENSION (:,:) :: tnow , shnow
  255. INTEGER :: ji,jj
  256. REAL(wp) :: wair, vtnow, ea, deltemp, s, stp , fh , fe
  257. REAL(wp) :: esre, cseep
  258. REAL(wp), DIMENSION (:,:), POINTER :: rspeed, sh10now, t10now, cdx, ce, shms
  259. REAL(wp), DIMENSION (:,:), POINTER :: rhom, sstk, ch, rel_windu, rel_windv
  260. !!----------------------------------------------------------------------
  261. !! coefficients ( in MKS ) :
  262. !!----------------------------------------------------------------------
  263. REAL(wp), PARAMETER :: ps = 1013. ! --- surface air pressure
  264. REAL(wp), PARAMETER :: expsi=0.622 ! --- expsi
  265. REAL(wp), PARAMETER :: rd=287. ! --- dry air gas constant
  266. REAL(wp), PARAMETER :: cp=1005. ! --- specific heat capacity
  267. REAL(wp), PARAMETER :: onsea=0.98 ! --- specific humidity factors
  268. REAL(wp), PARAMETER :: par1=640380. ! [Kg/m3]
  269. REAL(wp), PARAMETER :: par2=-5107.4 ! [K]
  270. !---------------------------------------------------------------------
  271. !--- define Kondo parameters
  272. !---------------------------------------------------------------------
  273. REAL(wp), DIMENSION(5) :: a_h = (/0.0,0.927,1.15,1.17,1.652/)
  274. REAL(wp), DIMENSION(5) :: a_e = (/0.0,0.969,1.18,1.196,1.68/)
  275. REAL(wp), DIMENSION(5) :: b_h = (/1.185,0.0546,0.01,0.0075,-0.017/)
  276. REAL(wp), DIMENSION(5) :: b_e = (/1.23,0.0521,0.01,0.008,-0.016/)
  277. REAL(wp), DIMENSION(5) :: c_h = (/0.0,0.0,0.0,-0.00045,0.0/)
  278. REAL(wp), DIMENSION(5) :: c_e = (/0.0,0.0,0.0,-0.0004,0.0/)
  279. REAL(wp), DIMENSION(5) :: p_h = (/-0.157,1.0,1.0,1.0,1.0/)
  280. REAL(wp), DIMENSION(5) :: p_e = (/-0.16,1.0,1.0,1.0,1.0/)
  281. INTEGER :: kku !index varing with wind speed
  282. !
  283. IF( nn_timing == 1 ) CALL timing_start('fluxes_mfs')
  284. !
  285. CALL wrk_alloc( jpi,jpj, rspeed, sh10now, t10now, cdx, ce, shms )
  286. CALL wrk_alloc( jpi,jpj, rhom, sstk, ch, rel_windu, rel_windv )
  287. !!----------------------------------------------------------------------
  288. !! ------------------ (i) short wave
  289. !!----------------------------------------------------------------------
  290. CALL qshort(hour,alat,alon,cldnow,qsw)
  291. rel_windu(:,:) = 0.0_wp
  292. rel_windv(:,:) = 0.0_wp
  293. DO jj = 2, jpj
  294. DO ji = fs_2, jpi
  295. rel_windu(ji,jj) = unow(ji,jj) - 0.5_wp * ( ssu_m(ji-1,jj) + ssu_m(ji,jj) )
  296. rel_windv(ji,jj) = vnow(ji,jj) - 0.5_wp * ( ssv_m(ji,jj-1) + ssv_m(ji,jj) )
  297. END DO
  298. END DO
  299. CALL lbc_lnk( rel_windu(:,:), 'U', -1. )
  300. CALL lbc_lnk( rel_windv(:,:), 'V', -1. )
  301. rspeed(:,:)= SQRT(rel_windu(:,:)*rel_windu(:,:) &
  302. & + rel_windv(:,:)*rel_windv(:,:))
  303. sstk(:,:) = sst(:,:) + rtt !- SST data in Kelvin degrees
  304. shms(:,:) = (1/1.22)*onsea*par1*EXP(par2/sstk(:,:)) !- Saturation Specific Humidity
  305. ! --- Transport temperature and humidity from 2m to 10m
  306. !----------------------------------------------------------------------
  307. t10now(:,:) = 0.0 ; sh10now(:,:)= 0.0
  308. ! Note that air temp is converted in potential temp
  309. CALL turb_core_2z(2.,10.,sstk,tnow+2*0.0098,shms,shnow,rspeed, &
  310. & Cdx,Ch,Ce,t10now,sh10now )
  311. tnow(:,:) = t10now(:,:) ; shnow(:,:) = sh10now(:,:)
  312. !!----------------------------------------------------------------------
  313. !! ------------------ (ii) net long wave
  314. !!----------------------------------------------------------------------
  315. DO jj = 1, jpj
  316. DO ji = 1, jpi
  317. wair = shnow(ji,jj) / (1 - shnow(ji,jj)) ! mixing ratio of the air (Wallace and Hobbs)
  318. vtnow = (tnow(ji,jj)*(expsi+wair))/(expsi*(1.+wair)) ! virtual temperature of air
  319. rhom(ji,jj) = 100.*(ps/rd)/vtnow ! density of the moist air
  320. ea = (wair / (wair + 0.622 )) * mslnow(ji,jj)
  321. qbw(ji,jj) = emic*stefan*( sstk(ji,jj)**4. ) &
  322. - ( stefan*( tnow(ji,jj)**4. ) * ( 0.653 + 0.00535*ea ) ) &
  323. * ( 1. + 0.1762*( cldnow(ji,jj)**2. ) )
  324. END DO
  325. END DO
  326. DO jj = 1, jpj
  327. DO ji = 1, jpi
  328. !!----------------------------------------------------------------------
  329. !! ------------------ (iii) sensible heat
  330. !!----------------------------------------------------------------------
  331. !! --- calculates the term : ( Ts - Ta )
  332. !!----------------------------------------------------------------------
  333. deltemp = sstk(ji,jj) - tnow (ji,jj)
  334. !!----------------------------------------------------------------------
  335. !! --- variable turbulent exchange coefficients ( from Kondo 1975 )
  336. !! --- calculate the Neutral Transfer Coefficent using an empiric formula
  337. !! --- by Kondo et al. Then it applies the diabatic approximation.
  338. !!----------------------------------------------------------------------
  339. s = deltemp/(wndm(ji,jj)**2.) !! --- calculate S
  340. stp = s*abs(s)/(abs(s)+0.01) !! --- calculate the Stability Parameter
  341. !!----------------------------------------------------------------------
  342. !! --- for stable condition (sst-t_air < 0):
  343. !!----------------------------------------------------------------------
  344. IF (s.lt.0. .and. ((stp.gt.-3.3).and.(stp.lt.0.))) THEN
  345. fh = 0.1_wp+0.03_wp*stp+0.9_wp*exp(4.8_wp*stp)
  346. fe = fh
  347. ELSE IF (s.lt.0. .and. stp.le.-3.3) THEN
  348. fh = 0._wp
  349. fe = fh
  350. ELSE ! --- for unstable condition
  351. fh = 1.0_wp+0.63_wp*sqrt(stp)
  352. fe = fh
  353. ENDIF
  354. !!----------------------------------------------------------------------
  355. !! --- calculate the coefficient CH,CE,CD
  356. !!----------------------------------------------------------------------
  357. IF (wndm(ji,jj) >= 0. .AND. wndm(ji,jj) <= 2.2) THEN
  358. kku=1
  359. ELSE IF (wndm(ji,jj) > 2.2 .AND. wndm(ji,jj) <= 5.0) THEN
  360. kku=2
  361. ELSE IF (wndm(ji,jj) > 5.0 .AND. wndm(ji,jj) <= 8.0) THEN
  362. kku=3
  363. ELSE IF (wndm(ji,jj) > 8.0 .AND. wndm(ji,jj) <= 25.0) THEN
  364. kku=4
  365. ELSE IF (wndm(ji,jj) > 25.0 ) THEN
  366. kku=5
  367. ENDIF
  368. ch(ji,jj) = ( a_h(kku) + b_h(kku) * wndm(ji,jj) ** p_h(kku) &
  369. + c_h(kku) * (wndm(ji,jj)-8 ) **2) * fh
  370. ce(ji,jj) = ( a_e(kku) + b_e(kku) * wndm(ji,jj) ** p_e(kku) &
  371. + c_e(kku) * (wndm(ji,jj)-8 ) **2) * fe
  372. ch(ji,jj) = ch(ji,jj) / 1000.0
  373. ce(ji,jj) = ce(ji,jj) / 1000.0
  374. IF (wndm(ji,jj)<0.3) THEN
  375. ch(ji,jj) = 1.3e-03 * fh
  376. ce(ji,jj) = 1.5e-03 * fe
  377. ELSE IF(wndm(ji,jj)>50.0) THEN
  378. ch(ji,jj) = 1.25e-03 * fh
  379. ce(ji,jj) = 1.30e-03 * fe
  380. ENDIF
  381. !!----------------------------------------------------------------------
  382. !! --- calculates the SENSIBLE HEAT FLUX in MKS ( watt/m*m )
  383. !!----------------------------------------------------------------------
  384. HA(ji,jj) = rhom(ji,jj)*cp*ch(ji,jj)*wndm(ji,jj)*deltemp
  385. !!----------------------------------------------------------------------
  386. !! ------------------ (iv) latent heat
  387. !! --- calculates the LATENT HEAT FLUX ( watt/m*m )
  388. !! --- ELAT = L*rho*Ce*|V|*[qs(Ts)-qa(t2d)]
  389. !!----------------------------------------------------------------------
  390. esre = shms(ji,jj) - shnow(ji,jj) ! --- calculates the term : qs(Ta)-qa(t2d)
  391. cseep = ce(ji,jj) * wndm(ji,jj) * esre ! --- calculates the term : Ce*|V|*[qs(Ts)-qa(t2d)]
  392. evap(ji,jj) = (cseep * rhom(ji,jj)) ! in [kg/m2/sec] !! --- calculates the EVAPORATION RATE [m/yr]
  393. elat(ji,jj) = rhom(ji,jj) * cseep * heatlat(sst(ji,jj))
  394. !!----------------------------------------------------------------------
  395. !! --- calculates the Drag Coefficient
  396. !!----------------------------------------------------------------------
  397. !!----------------------------------------------------------------------
  398. !! --- deltemp should be (Ts - Ta) in the formula estimating
  399. !! --- drag coefficient
  400. !!----------------------------------------------------------------------
  401. IF( .NOT. ln_cdgw ) THEN
  402. cdx(ji,jj) = cd_HR(wndm(ji,jj),deltemp)
  403. ENDIF
  404. END DO
  405. END DO
  406. !!----------------------------------------------------------------------
  407. !! --- calculates the wind stresses in MKS ( newton/m*m )
  408. !! --- taux= rho*Cd*|V|u tauy= rho*Cd*|V|v
  409. !!----------------------------------------------------------------------
  410. taux(:,:)= rhom(:,:) * cdx(:,:) * rspeed(:,:) * rel_windu(:,:)
  411. tauy(:,:)= rhom(:,:) * cdx(:,:) * rspeed(:,:) * rel_windv(:,:)
  412. CALL wrk_dealloc( jpi,jpj, rspeed, sh10now, t10now, cdx, ce, shms )
  413. CALL wrk_dealloc( jpi,jpj, rhom, sstk, ch, rel_windu, rel_windv )
  414. !
  415. IF( nn_timing == 1 ) CALL timing_stop('fluxes_mfs')
  416. !
  417. END SUBROUTINE fluxes_mfs
  418. REAL(wp) FUNCTION cd_HR(speed,delt)
  419. !!----------------------------------------------------------------------
  420. !! --- calculates the Drag Coefficient as a function of the abs. value
  421. !! --- of the wind velocity ( Hellermann and Rosenstein )
  422. !!----------------------------------------------------------------------
  423. REAL(wp), INTENT(in) :: speed,delt
  424. REAL(wp), PARAMETER :: a1=0.934e-3 , a2=0.788e-4, a3=0.868e-4
  425. REAL(wp), PARAMETER :: a4=-0.616e-6, a5=-.120e-5, a6=-.214e-5
  426. cd_HR = a1 + a2*speed + a3*delt + a4*speed*speed &
  427. + a5*delt*delt + a6*speed*delt
  428. END FUNCTION cd_HR
  429. REAL(wp) function HEATLAT(t)
  430. !!----------------------------------------------------------------------
  431. !! --- calculates the Latent Heat of Vaporization ( J/kg ) as function of
  432. !! --- the temperature ( Celsius degrees )
  433. !! --- ( from A. Gill pag. 607 )
  434. !!
  435. !! --- Constant Latent Heat of Vaporization ( Rosati,Miyakoda 1988 )
  436. !! L = 2.501e+6 (MKS)
  437. !!----------------------------------------------------------------------
  438. REAL(wp) , intent(in) :: t
  439. heatlat = 2.5008e+6 -2.3e+3*t
  440. END FUNCTION HEATLAT
  441. SUBROUTINE qshort(hour,alat,alon,cldnow,qsw)
  442. !!----------------------------------------------------------------------
  443. !! *** ROUTINE qshort ***
  444. !!
  445. !! ** Purpose : Compute Solar Radiation
  446. !!
  447. !! ** Method : Compute Solar Radiation according Astronomical
  448. !! formulae
  449. !!
  450. !! References : Reed RK (1975) and Reed RK (1977)
  451. !!
  452. !! Note: alat,alon - (lat, lon) in radians
  453. !!----------------------------------------------------------------------
  454. REAL(wp), INTENT (in) :: hour
  455. REAL(wp), INTENT(in ), DIMENSION(:,:) :: alat,alon
  456. REAL(wp), INTENT(in ), DIMENSION(:,:) :: cldnow
  457. REAL(wp), INTENT(out), DIMENSION(:,:) :: qsw
  458. REAL(wp), DIMENSION(12) :: alpham
  459. REAL(wp), PARAMETER :: eclips=23.439* (3.141592653589793_wp / 180._wp)
  460. REAL(wp), PARAMETER :: solar = 1350.
  461. REAL(wp), PARAMETER :: tau = 0.7
  462. REAL(wp), PARAMETER :: aozone = 0.09
  463. REAL(wp), PARAMETER :: yrdays = 360.
  464. REAL(wp) :: days, th0,th02,th03, sundec, thsun, coszen, qatten
  465. REAL(wp) :: qzer, qdir,qdiff,qtot,tjul,sunbet
  466. REAL(wp) :: albedo
  467. INTEGER :: jj, ji
  468. !!----------------------------------------------------------------------
  469. !! --- albedo monthly values from Payne (1972) as means of the values
  470. !! --- at 40N and 30N for the Atlantic Ocean ( hence the same latitudinal
  471. !! --- band of the Mediterranean Sea ) :
  472. !!----------------------------------------------------------------------
  473. data alpham /0.095,0.08,0.065,0.065,0.06,0.06,0.06,0.06, &
  474. 0.065,0.075,0.09,0.10/
  475. !!----------------------------------------------------------------------
  476. !! days is the number of days elapsed until the day=nday_year
  477. !!----------------------------------------------------------------------
  478. days = nday_year -1.
  479. th0 = 2.*rpi*days/yrdays
  480. th02 = 2.*th0
  481. th03 = 3.*th0
  482. !! --- sun declination :
  483. !!----------------------------------------------------------------------
  484. sundec = 0.006918 - 0.399912*cos(th0) + 0.070257*sin(th0) - &
  485. 0.006758*cos(th02) + 0.000907*sin(th02) - &
  486. 0.002697*cos(th03) + 0.001480*sin(th03)
  487. DO jj = 1, jpj
  488. DO ji = 1, jpi
  489. !! --- sun hour angle :
  490. !!----------------------------------------------------------------------
  491. thsun = (hour -12.)*15.*rad + alon(ji,jj)
  492. !! --- cosine of the solar zenith angle :
  493. !!----------------------------------------------------------------------
  494. coszen =sin(alat(ji,jj))*sin(sundec) &
  495. +cos(alat(ji,jj))*cos(sundec)*cos(thsun)
  496. IF(coszen .LE. 5.035D-04) THEN
  497. coszen = 0.0
  498. qatten = 0.0
  499. ELSE
  500. qatten = tau**(1./coszen)
  501. END IF
  502. qzer = coszen * solar * &
  503. (1.0+1.67E-2*cos(rpi*2.*(days-3.0)/365.0))**2
  504. qdir = qzer * qatten
  505. qdiff = ((1.-aozone)*qzer - qdir) * 0.5
  506. qtot = qdir + qdiff
  507. tjul = (days -81.)*rad
  508. !! --- sin of the solar noon altitude in radians :
  509. !!----------------------------------------------------------------------
  510. sunbet=sin(alat(ji,jj))*sin(eclips*sin(tjul)) + &
  511. cos(alat(ji,jj))*cos(eclips*sin(tjul))
  512. !! --- solar noon altitude in degrees :
  513. !!----------------------------------------------------------------------
  514. sunbet = asin(sunbet)/rad
  515. !!----------------------------------------------------------------------
  516. !! --- calculates the albedo according to Payne (1972)
  517. !!----------------------------------------------------------------------
  518. albedo = alpham(nmonth)
  519. !!----------------------------------------------------------------------
  520. !! --- ( radiation as from Reed(1977), Simpson and Paulson(1979) )
  521. !! --- calculates SHORT WAVE FLUX ( watt/m*m )
  522. !! --- ( Rosati,Miyakoda 1988 ; eq. 3.8 )
  523. !!----------------------------------------------------------------------
  524. IF(cldnow(ji,jj).LT.0.3) THEN
  525. qsw(ji,jj) = qtot * (1.-albedo)
  526. ELSE
  527. qsw(ji,jj) = qtot*(1.-0.62*cldnow(ji,jj) &
  528. + .0019*sunbet)*(1.-albedo)
  529. ENDIF
  530. END DO
  531. END DO
  532. END SUBROUTINE qshort
  533. !!======================================================================
  534. END MODULE sbcblk_mfs