sbcblk_clio.F90 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. MODULE sbcblk_clio
  2. !!======================================================================
  3. !! *** MODULE sbcblk_clio ***
  4. !! Ocean forcing: bulk thermohaline forcing of the ocean (or ice)
  5. !!=====================================================================
  6. !! History : OPA ! 1997-06 (Louvain-La-Neuve) Original code
  7. !! ! 2001-04 (C. Ethe) add flx_blk_declin
  8. !! NEMO 2.0 ! 2002-08 (C. Ethe, G. Madec) F90: Free form and module
  9. !! 3.0 ! 2008-03 (C. Talandier, G. Madec) surface module + LIM3
  10. !! 3.2 ! 2009-04 (B. Lemaire) Introduce iom_put
  11. !!----------------------------------------------------------------------
  12. !!----------------------------------------------------------------------
  13. !! sbc_blk_clio : CLIO bulk formulation: read and update required input fields
  14. !! blk_clio_oce : ocean CLIO bulk formulea: compute momentum, heat and freswater fluxes for the ocean
  15. !! blk_ice_clio : ice CLIO bulk formulea: compute momentum, heat and freswater fluxes for the sea-ice
  16. !! blk_clio_qsr_oce : shortwave radiation for ocean computed from the cloud cover
  17. !! blk_clio_qsr_ice : shortwave radiation for ice computed from the cloud cover
  18. !! flx_blk_declin : solar declination
  19. !!----------------------------------------------------------------------
  20. USE oce ! ocean dynamics and tracers
  21. USE dom_oce ! ocean space and time domain
  22. USE phycst ! physical constants
  23. USE fldread ! read input fields
  24. USE sbc_oce ! Surface boundary condition: ocean fields
  25. USE iom ! I/O manager library
  26. USE in_out_manager ! I/O manager
  27. USE lib_mpp ! distribued memory computing library
  28. USE wrk_nemo ! work arrays
  29. USE timing ! Timing
  30. USE lbclnk ! ocean lateral boundary conditions (or mpp link)
  31. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  32. USE albedo
  33. USE prtctl ! Print control
  34. #if defined key_lim3
  35. USE ice
  36. USE sbc_ice ! Surface boundary condition: ice fields
  37. USE limthd_dh ! for CALL lim_thd_snwblow
  38. #elif defined key_lim2
  39. USE ice_2
  40. USE sbc_ice ! Surface boundary condition: ice fields
  41. USE par_ice_2 ! Surface boundary condition: ice fields
  42. #endif
  43. IMPLICIT NONE
  44. PRIVATE
  45. PUBLIC sbc_blk_clio ! routine called by sbcmod.F90
  46. #if defined key_lim2 || defined key_lim3
  47. PUBLIC blk_ice_clio_tau ! routine called by sbcice_lim.F90
  48. PUBLIC blk_ice_clio_flx ! routine called by sbcice_lim.F90
  49. #endif
  50. INTEGER , PARAMETER :: jpfld = 7 ! maximum number of files to read
  51. INTEGER , PARAMETER :: jp_utau = 1 ! index of wind stress (i-component) (N/m2) at U-point
  52. INTEGER , PARAMETER :: jp_vtau = 2 ! index of wind stress (j-component) (N/m2) at V-point
  53. INTEGER , PARAMETER :: jp_wndm = 3 ! index of 10m wind module (m/s) at T-point
  54. INTEGER , PARAMETER :: jp_humi = 4 ! index of specific humidity ( % )
  55. INTEGER , PARAMETER :: jp_ccov = 5 ! index of cloud cover ( % )
  56. INTEGER , PARAMETER :: jp_tair = 6 ! index of 10m air temperature (Kelvin)
  57. INTEGER , PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s)
  58. TYPE(FLD),ALLOCATABLE,DIMENSION(:) :: sf ! structure of input fields (file informations, fields read)
  59. INTEGER, PARAMETER :: jpintsr = 24 ! number of time step between sunrise and sunset
  60. ! ! uses for heat flux computation
  61. LOGICAL :: lbulk_init = .TRUE. ! flag, bulk initialization done or not)
  62. REAL(wp) :: cai = 1.40e-3 ! best estimate of atm drag in order to get correct FS export in ORCA2-LIM
  63. REAL(wp) :: cao = 1.00e-3 ! chosen by default ==> should depends on many things... !!gmto be updated
  64. REAL(wp) :: rdtbs2 !:
  65. REAL(wp), DIMENSION(19) :: budyko ! BUDYKO's coefficient (cloudiness effect on LW radiation)
  66. DATA budyko / 1.00, 0.98, 0.95, 0.92, 0.89, 0.86, 0.83, 0.80, 0.78, 0.75, &
  67. & 0.72, 0.69, 0.67, 0.64, 0.61, 0.58, 0.56, 0.53, 0.50 /
  68. REAL(wp), DIMENSION(20) :: tauco ! cloud optical depth coefficient
  69. DATA tauco / 6.6, 6.6, 7.0, 7.2, 7.1, 6.8, 6.5, 6.6, 7.1, 7.6, &
  70. & 6.6, 6.1, 5.6, 5.5, 5.8, 5.8, 5.6, 5.6, 5.6, 5.6 /
  71. !!
  72. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: sbudyko ! cloudiness effect on LW radiation
  73. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: stauc ! cloud optical depth
  74. REAL(wp) :: eps20 = 1.e-20 ! constant values
  75. !! * Substitutions
  76. # include "vectopt_loop_substitute.h90"
  77. !!----------------------------------------------------------------------
  78. !! NEMO/OPA 4.0 , NEMO Consortium (2011)
  79. !! $Id: sbcblk_clio.F90 4990 2014-12-15 16:42:49Z timgraham $
  80. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  81. !!----------------------------------------------------------------------
  82. CONTAINS
  83. SUBROUTINE sbc_blk_clio( kt )
  84. !!---------------------------------------------------------------------
  85. !! *** ROUTINE sbc_blk_clio ***
  86. !!
  87. !! ** Purpose : provide at each time step the surface ocean fluxes
  88. !! (momentum, heat, freshwater and runoff)
  89. !!
  90. !! ** Method : (1) READ each fluxes in NetCDF files:
  91. !! the i-component of the stress (N/m2)
  92. !! the j-component of the stress (N/m2)
  93. !! the 10m wind speed module (m/s)
  94. !! the 10m air temperature (Kelvin)
  95. !! the 10m specific humidity (%)
  96. !! the cloud cover (%)
  97. !! the total precipitation (rain+snow) (Kg/m2/s)
  98. !! (2) CALL blk_oce_clio
  99. !!
  100. !! C A U T I O N : never mask the surface stress fields
  101. !! the stress is assumed to be in the (i,j) mesh referential
  102. !!
  103. !! ** Action : defined at each time-step at the air-sea interface
  104. !! - utau, vtau i- and j-component of the wind stress
  105. !! - taum wind stress module at T-point
  106. !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice
  107. !! - qns non-solar heat flux including latent heat of solid
  108. !! precip. melting and emp heat content
  109. !! - qsr solar heat flux
  110. !! - emp upward mass flux (evap. - precip)
  111. !! - sfx salt flux; set to zero at nit000 but possibly non-zero
  112. !! if ice is present (computed in limsbc(_2).F90)
  113. !!----------------------------------------------------------------------
  114. INTEGER, INTENT( in ) :: kt ! ocean time step
  115. !!
  116. INTEGER :: ifpr, jfpr ! dummy indices
  117. INTEGER :: ierr0, ierr1, ierr2, ierr3 ! return error code
  118. INTEGER :: ios ! Local integer output status for namelist read
  119. !!
  120. CHARACTER(len=100) :: cn_dir ! Root directory for location of CLIO files
  121. TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read
  122. TYPE(FLD_N) :: sn_utau, sn_vtau, sn_wndm, sn_tair ! informations about the fields to be read
  123. TYPE(FLD_N) :: sn_humi, sn_ccov, sn_prec ! " "
  124. !!
  125. NAMELIST/namsbc_clio/ cn_dir, sn_utau, sn_vtau, sn_wndm, sn_humi, &
  126. & sn_ccov, sn_tair, sn_prec
  127. !!---------------------------------------------------------------------
  128. ! ! ====================== !
  129. IF( kt == nit000 ) THEN ! First call kt=nit000 !
  130. ! ! ====================== !
  131. REWIND( numnam_ref ) ! Namelist namsbc_clio in reference namelist : CLIO files
  132. READ ( numnam_ref, namsbc_clio, IOSTAT = ios, ERR = 901)
  133. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in reference namelist', lwp )
  134. REWIND( numnam_cfg ) ! Namelist namsbc_clio in configuration namelist : CLIO files
  135. READ ( numnam_cfg, namsbc_clio, IOSTAT = ios, ERR = 902 )
  136. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in configuration namelist', lwp )
  137. IF(lwm) WRITE ( numond, namsbc_clio )
  138. ! store namelist information in an array
  139. slf_i(jp_utau) = sn_utau ; slf_i(jp_vtau) = sn_vtau ; slf_i(jp_wndm) = sn_wndm
  140. slf_i(jp_tair) = sn_tair ; slf_i(jp_humi) = sn_humi
  141. slf_i(jp_ccov) = sn_ccov ; slf_i(jp_prec) = sn_prec
  142. ! set sf structure
  143. ALLOCATE( sf(jpfld), STAT=ierr0 )
  144. IF( ierr0 > 0 ) CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf structure' )
  145. DO ifpr= 1, jpfld
  146. ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) , STAT=ierr1)
  147. IF( slf_i(ifpr)%ln_tint ) ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) , STAT=ierr2 )
  148. IF( slf_i(ifpr)%nfreqh .GT. 0._wp .AND. MOD( 3600._wp * slf_i(ifpr)%nfreqh , REAL(nn_fsbc, wp) * rdt) .NE. 0._wp ) &
  149. & CALL ctl_warn( 'sbcmod time step rdt * nn_fsbc is NOT a submultiple of atmospheric forcing frequency' )
  150. END DO
  151. IF( ierr1+ierr2 > 0 ) CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate sf array structure' )
  152. ! fill sf with slf_i and control print
  153. CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_clio', 'flux formulation for ocean surface boundary condition', 'namsbc_clio' )
  154. ! allocate sbcblk clio arrays
  155. ALLOCATE( sbudyko(jpi,jpj) , stauc(jpi,jpj), STAT=ierr3 )
  156. IF( ierr3 > 0 ) CALL ctl_stop( 'STOP', 'sbc_blk_clio: unable to allocate arrays' )
  157. !
  158. sfx(:,:) = 0._wp ! salt flux; zero unless ice is present (computed in limsbc(_2).F90)
  159. !
  160. ENDIF
  161. ! ! ====================== !
  162. ! ! At each time-step !
  163. ! ! ====================== !
  164. !
  165. CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step
  166. !
  167. IF( MOD( kt - 1, nn_fsbc ) == 0 ) CALL blk_oce_clio( sf, sst_m )
  168. !
  169. END SUBROUTINE sbc_blk_clio
  170. SUBROUTINE blk_oce_clio( sf, pst )
  171. !!---------------------------------------------------------------------------
  172. !! *** ROUTINE blk_oce_clio ***
  173. !!
  174. !! ** Purpose : Compute momentum, heat and freshwater fluxes at ocean surface
  175. !! using CLIO bulk formulea
  176. !!
  177. !! ** Method : The flux of heat at the ocean surfaces are derived
  178. !! from semi-empirical ( or bulk ) formulae which relate the flux to
  179. !! the properties of the surface and of the lower atmosphere. Here, we
  180. !! follow the work of Oberhuber, 1988
  181. !! - momentum flux (stresses) directly read in files at U- and V-points
  182. !! - compute ocean/ice albedos (call albedo_oce/albedo_ice)
  183. !! - compute shortwave radiation for ocean (call blk_clio_qsr_oce)
  184. !! - compute long-wave radiation for the ocean
  185. !! - compute the turbulent heat fluxes over the ocean
  186. !! - deduce the evaporation over the ocean
  187. !! ** Action : Fluxes over the ocean:
  188. !! - utau, vtau i- and j-component of the wind stress
  189. !! - taum wind stress module at T-point
  190. !! - wndm 10m wind module at T-point over free ocean or leads in presence of sea-ice
  191. !! - qns non-solar heat flux including latent heat of solid
  192. !! precip. melting and emp heat content
  193. !! - qsr solar heat flux
  194. !! - emp suface mass flux (evap.-precip.)
  195. !! ** Nota : sf has to be a dummy argument for AGRIF on NEC
  196. !!----------------------------------------------------------------------
  197. TYPE(fld), INTENT(in), DIMENSION(:) :: sf ! input data
  198. REAL(wp) , INTENT(in), DIMENSION(jpi,jpj) :: pst ! surface temperature [Celcius]
  199. !!
  200. INTEGER :: ji, jj ! dummy loop indices
  201. !!
  202. REAL(wp) :: zrhova, zcsho, zcleo, zcldeff ! temporary scalars
  203. REAL(wp) :: zqsato, zdteta, zdeltaq, ztvmoy, zobouks ! - -
  204. REAL(wp) :: zpsims, zpsihs, zpsils, zobouku, zxins, zpsimu ! - -
  205. REAL(wp) :: zpsihu, zpsilu, zstab,zpsim, zpsih, zpsil ! - -
  206. REAL(wp) :: zvatmg, zcmn, zchn, zcln, zcmcmn, zdenum ! - -
  207. REAL(wp) :: zdtetar, ztvmoyr, zlxins, zchcm, zclcm ! - -
  208. REAL(wp) :: zmt1, zmt2, zmt3, ztatm3, ztamr, ztaevbk ! - -
  209. REAL(wp) :: zsst, ztatm, zcco1, zpatm, zcmax, zrmax ! - -
  210. REAL(wp) :: zrhoa, zev, zes, zeso, zqatm, zevsqr ! - -
  211. REAL(wp) :: ztx2, zty2, zcevap, zcprec ! - -
  212. REAL(wp), POINTER, DIMENSION(:,:) :: zqlw ! long-wave heat flux over ocean
  213. REAL(wp), POINTER, DIMENSION(:,:) :: zqla ! latent heat flux over ocean
  214. REAL(wp), POINTER, DIMENSION(:,:) :: zqsb ! sensible heat flux over ocean
  215. !!---------------------------------------------------------------------
  216. !
  217. IF( nn_timing == 1 ) CALL timing_start('blk_oce_clio')
  218. !
  219. CALL wrk_alloc( jpi,jpj, zqlw, zqla, zqsb )
  220. zpatm = 101000._wp ! atmospheric pressure (assumed constant here)
  221. !------------------------------------!
  222. ! momentum fluxes (utau, vtau ) !
  223. !------------------------------------!
  224. !CDIR COLLAPSE
  225. utau(:,:) = sf(jp_utau)%fnow(:,:,1)
  226. !CDIR COLLAPSE
  227. vtau(:,:) = sf(jp_vtau)%fnow(:,:,1)
  228. !------------------------------------!
  229. ! wind stress module (taum ) !
  230. !------------------------------------!
  231. !CDIR NOVERRCHK
  232. DO jj = 2, jpjm1
  233. !CDIR NOVERRCHK
  234. DO ji = fs_2, fs_jpim1 ! vector opt.
  235. ztx2 = utau(ji-1,jj ) + utau(ji,jj)
  236. zty2 = vtau(ji ,jj-1) + vtau(ji,jj)
  237. taum(ji,jj) = 0.5 * SQRT( ztx2 * ztx2 + zty2 * zty2 )
  238. END DO
  239. END DO
  240. utau(:,:) = utau(:,:) * umask(:,:,1)
  241. vtau(:,:) = vtau(:,:) * vmask(:,:,1)
  242. taum(:,:) = taum(:,:) * tmask(:,:,1)
  243. CALL lbc_lnk( taum, 'T', 1. )
  244. !------------------------------------!
  245. ! store the wind speed (wndm ) !
  246. !------------------------------------!
  247. !CDIR COLLAPSE
  248. wndm(:,:) = sf(jp_wndm)%fnow(:,:,1)
  249. wndm(:,:) = wndm(:,:) * tmask(:,:,1)
  250. !------------------------------------------------!
  251. ! Shortwave radiation for ocean and snow/ice !
  252. !------------------------------------------------!
  253. CALL blk_clio_qsr_oce( qsr )
  254. qsr(:,:) = qsr(:,:) * tmask(:,:,1) ! no shortwave radiation into the ocean beneath ice shelf
  255. !------------------------!
  256. ! Other ocean fluxes !
  257. !------------------------!
  258. !CDIR NOVERRCHK
  259. !CDIR COLLAPSE
  260. DO jj = 1, jpj
  261. !CDIR NOVERRCHK
  262. DO ji = 1, jpi
  263. !
  264. zsst = pst(ji,jj) + rt0 ! converte Celcius to Kelvin the SST
  265. ztatm = sf(jp_tair)%fnow(ji,jj,1) ! and set minimum value far above 0 K (=rt0 over land)
  266. zcco1 = 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ! fraction of clear sky ( 1 - cloud cover)
  267. zrhoa = zpatm / ( 287.04 * ztatm ) ! air density (equation of state for dry air)
  268. ztamr = ztatm - rtt ! Saturation water vapour
  269. zmt1 = SIGN( 17.269, ztamr ) ! ||
  270. zmt2 = SIGN( 21.875, ztamr ) ! \ /
  271. zmt3 = SIGN( 28.200, -ztamr ) ! \/
  272. zes = 611.0 * EXP( ABS( ztamr ) * MIN ( zmt1, zmt2 ) / ( ztatm - 35.86 + MAX( 0.e0, zmt3 ) ) )
  273. zev = sf(jp_humi)%fnow(ji,jj,1) * zes ! vapour pressure
  274. zevsqr = SQRT( zev * 0.01 ) ! square-root of vapour pressure
  275. zqatm = 0.622 * zev / ( zpatm - 0.378 * zev ) ! specific humidity
  276. !--------------------------------------!
  277. ! long-wave radiation over the ocean ! ( Berliand 1952 ; all latitudes )
  278. !--------------------------------------!
  279. ztatm3 = ztatm * ztatm * ztatm
  280. zcldeff = 1.0 - sbudyko(ji,jj) * sf(jp_ccov)%fnow(ji,jj,1) * sf(jp_ccov)%fnow(ji,jj,1)
  281. ztaevbk = ztatm * ztatm3 * zcldeff * ( 0.39 - 0.05 * zevsqr )
  282. !
  283. zqlw(ji,jj) = - emic * stefan * ( ztaevbk + 4. * ztatm3 * ( zsst - ztatm ) )
  284. !--------------------------------------------------
  285. ! Latent and sensible heat fluxes over the ocean
  286. !--------------------------------------------------
  287. ! ! vapour pressure at saturation of ocean
  288. zeso = 611.0 * EXP ( 17.2693884 * ( zsst - rtt ) * tmask(ji,jj,1) / ( zsst - 35.86 ) )
  289. zqsato = ( 0.622 * zeso ) / ( zpatm - 0.378 * zeso ) ! humidity close to the ocean surface (at saturation)
  290. ! Drag coefficients from Large and Pond (1981,1982)
  291. ! ! Stability parameters
  292. zdteta = zsst - ztatm
  293. zdeltaq = zqatm - zqsato
  294. ztvmoy = ztatm * ( 1. + 2.2e-3 * ztatm * zqatm )
  295. zdenum = MAX( sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) * ztvmoy, eps20 )
  296. zdtetar = zdteta / zdenum
  297. ztvmoyr = ztvmoy * ztvmoy * zdeltaq / zdenum
  298. ! ! case of stable atmospheric conditions
  299. zobouks = -70.0 * 10. * ( zdtetar + 3.2e-3 * ztvmoyr )
  300. zobouks = MAX( 0.e0, zobouks )
  301. zpsims = -7.0 * zobouks
  302. zpsihs = zpsims
  303. zpsils = zpsims
  304. ! ! case of unstable atmospheric conditions
  305. zobouku = MIN( 0.e0, -100.0 * 10.0 * ( zdtetar + 2.2e-3 * ztvmoyr ) )
  306. zxins = ( 1. - 16. * zobouku )**0.25
  307. zlxins = LOG( ( 1. + zxins * zxins ) / 2. )
  308. zpsimu = 2. * LOG( ( 1 + zxins ) * 0.5 ) + zlxins - 2. * ATAN( zxins ) + rpi * 0.5
  309. zpsihu = 2. * zlxins
  310. zpsilu = zpsihu
  311. ! ! intermediate values
  312. zstab = MAX( 0.e0, SIGN( 1.e0, zdteta ) )
  313. zpsim = zstab * zpsimu + ( 1.0 - zstab ) * zpsims
  314. zpsih = zstab * zpsihu + ( 1.0 - zstab ) * zpsihs
  315. zpsil = zpsih
  316. zvatmg = MAX( 0.032 * 1.5e-3 * sf(jp_wndm)%fnow(ji,jj,1) * sf(jp_wndm)%fnow(ji,jj,1) / grav, eps20 )
  317. zcmn = vkarmn / LOG ( 10. / zvatmg )
  318. zchn = 0.0327 * zcmn
  319. zcln = 0.0346 * zcmn
  320. zcmcmn = 1. / ( 1. - zcmn * zpsim / vkarmn )
  321. ! sometimes the ratio zchn * zpsih / ( vkarmn * zcmn ) is too close to 1 and zchcm becomes very very big
  322. zcmax = 0.1 ! choice for maximum value of the heat transfer coefficient, guided by my intuition
  323. zrmax = 1 - 3.e-4 / zcmax ! maximum value of the ratio
  324. zchcm = zcmcmn / ( 1. - MIN ( zchn * zpsih / ( vkarmn * zcmn ) , zrmax ) )
  325. zclcm = zchcm
  326. ! ! transfert coef. (Large and Pond 1981,1982)
  327. zcsho = zchn * zchcm
  328. zcleo = zcln * zclcm
  329. zrhova = zrhoa * sf(jp_wndm)%fnow(ji,jj,1)
  330. ! sensible heat flux
  331. zqsb(ji,jj) = zrhova * zcsho * 1004.0 * ( zsst - ztatm )
  332. ! latent heat flux (bounded by zero)
  333. zqla(ji,jj) = MAX( 0.e0, zrhova * zcleo * 2.5e+06 * ( zqsato - zqatm ) )
  334. !
  335. END DO
  336. END DO
  337. ! ----------------------------------------------------------------------------- !
  338. ! III Total FLUXES !
  339. ! ----------------------------------------------------------------------------- !
  340. zcevap = rcp / cevap ! convert zqla ==> evap (Kg/m2/s) ==> m/s ==> W/m2
  341. zcprec = rcp / rday ! convert prec ( mm/day ==> m/s) ==> W/m2
  342. !CDIR COLLAPSE
  343. emp(:,:) = zqla(:,:) / cevap & ! freshwater flux
  344. & - sf(jp_prec)%fnow(:,:,1) / rday * tmask(:,:,1)
  345. !
  346. !CDIR COLLAPSE
  347. qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:) & ! Downward Non Solar flux
  348. & - zqla(:,:) * pst(:,:) * zcevap & ! remove evap. heat content at SST in Celcius
  349. & + sf(jp_prec)%fnow(:,:,1) * sf(jp_tair)%fnow(:,:,1) * zcprec ! add precip. heat content at Tair in Celcius
  350. qns(:,:) = qns(:,:) * tmask(:,:,1)
  351. #if defined key_lim3
  352. qns_oce(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)
  353. qsr_oce(:,:) = qsr(:,:)
  354. #endif
  355. ! NB: if sea-ice model, the snow precip are computed and the associated heat is added to qns (see blk_ice_clio)
  356. IF ( nn_ice == 0 ) THEN
  357. CALL iom_put( "qlw_oce" , zqlw ) ! output downward longwave heat over the ocean
  358. CALL iom_put( "qsb_oce" , - zqsb ) ! output downward sensible heat over the ocean
  359. CALL iom_put( "qla_oce" , - zqla ) ! output downward latent heat over the ocean
  360. CALL iom_put( "qemp_oce", qns-zqlw+zqsb+zqla ) ! output downward heat content of E-P over the ocean
  361. CALL iom_put( "qns_oce" , qns ) ! output downward non solar heat over the ocean
  362. CALL iom_put( "qsr_oce" , qsr ) ! output downward solar heat over the ocean
  363. CALL iom_put( "qt_oce" , qns+qsr ) ! output total downward heat over the ocean
  364. ENDIF
  365. IF(ln_ctl) THEN
  366. CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce_clio: zqsb : ', tab2d_2=zqlw , clinfo2=' zqlw : ')
  367. CALL prt_ctl(tab2d_1=zqla , clinfo1=' blk_oce_clio: zqla : ', tab2d_2=qsr , clinfo2=' qsr : ')
  368. CALL prt_ctl(tab2d_1=pst , clinfo1=' blk_oce_clio: pst : ', tab2d_2=emp , clinfo2=' emp : ')
  369. CALL prt_ctl(tab2d_1=utau , clinfo1=' blk_oce_clio: utau : ', mask1=umask, &
  370. & tab2d_2=vtau , clinfo2=' vtau : ', mask2=vmask )
  371. ENDIF
  372. CALL wrk_dealloc( jpi,jpj, zqlw, zqla, zqsb )
  373. !
  374. IF( nn_timing == 1 ) CALL timing_stop('blk_oce_clio')
  375. !
  376. END SUBROUTINE blk_oce_clio
  377. # if defined key_lim2 || defined key_lim3
  378. SUBROUTINE blk_ice_clio_tau
  379. !!---------------------------------------------------------------------------
  380. !! *** ROUTINE blk_ice_clio_tau ***
  381. !!
  382. !! ** Purpose : Computation momentum flux at the ice-atm interface
  383. !!
  384. !! ** Method : Read utau from a forcing file. Rearrange if C-grid
  385. !!
  386. !!----------------------------------------------------------------------
  387. REAL(wp) :: zcoef
  388. INTEGER :: ji, jj ! dummy loop indices
  389. !!---------------------------------------------------------------------
  390. !
  391. IF( nn_timing == 1 ) CALL timing_start('blk_ice_clio_tau')
  392. SELECT CASE( cp_ice_msh )
  393. CASE( 'C' ) ! C-grid ice dynamics
  394. zcoef = cai / cao ! Change from air-sea stress to air-ice stress
  395. utau_ice(:,:) = zcoef * utau(:,:)
  396. vtau_ice(:,:) = zcoef * vtau(:,:)
  397. CASE( 'I' ) ! I-grid ice dynamics: I-point (i.e. F-point lower-left corner)
  398. zcoef = 0.5_wp * cai / cao ! Change from air-sea stress to air-ice stress
  399. DO jj = 2, jpj ! stress from ocean U- and V-points to ice U,V point
  400. DO ji = 2, jpi ! I-grid : no vector opt.
  401. utau_ice(ji,jj) = zcoef * ( utau(ji-1,jj ) + utau(ji-1,jj-1) )
  402. vtau_ice(ji,jj) = zcoef * ( vtau(ji ,jj-1) + vtau(ji-1,jj-1) )
  403. END DO
  404. END DO
  405. CALL lbc_lnk( utau_ice(:,:), 'I', -1. ) ; CALL lbc_lnk( vtau_ice(:,:), 'I', -1. ) ! I-point
  406. END SELECT
  407. IF(ln_ctl) THEN
  408. CALL prt_ctl(tab2d_1=utau_ice , clinfo1=' blk_ice_clio: utau_ice : ', tab2d_2=vtau_ice , clinfo2=' vtau_ice : ')
  409. ENDIF
  410. IF( nn_timing == 1 ) CALL timing_stop('blk_ice_clio_tau')
  411. END SUBROUTINE blk_ice_clio_tau
  412. #endif
  413. # if defined key_lim2 || defined key_lim3
  414. SUBROUTINE blk_ice_clio_flx( ptsu , palb_cs, palb_os, palb )
  415. !!---------------------------------------------------------------------------
  416. !! *** ROUTINE blk_ice_clio_flx ***
  417. !!
  418. !! ** Purpose : Computation of the heat fluxes at ocean and snow/ice
  419. !! surface the solar heat at ocean and snow/ice surfaces and the
  420. !! sensitivity of total heat fluxes to the SST variations
  421. !!
  422. !! ** Method : The flux of heat at the ice and ocean surfaces are derived
  423. !! from semi-empirical ( or bulk ) formulae which relate the flux to
  424. !! the properties of the surface and of the lower atmosphere. Here, we
  425. !! follow the work of Oberhuber, 1988
  426. !!
  427. !! ** Action : call albedo_oce/albedo_ice to compute ocean/ice albedo
  428. !! - snow precipitation
  429. !! - solar flux at the ocean and ice surfaces
  430. !! - the long-wave radiation for the ocean and sea/ice
  431. !! - turbulent heat fluxes over water and ice
  432. !! - evaporation over water
  433. !! - total heat fluxes sensitivity over ice (dQ/dT)
  434. !! - latent heat flux sensitivity over ice (dQla/dT)
  435. !! - qns : modified the non solar heat flux over the ocean
  436. !! to take into account solid precip latent heat flux
  437. !!----------------------------------------------------------------------
  438. REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: ptsu ! ice surface temperature [Kelvin]
  439. REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_cs ! ice albedo (clear sky) (alb_ice_cs) [-]
  440. REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: palb_os ! ice albedo (overcast sky) (alb_ice_os) [-]
  441. REAL(wp), INTENT( out), DIMENSION(:,:,:) :: palb ! ice albedo (actual value) [-]
  442. !!
  443. INTEGER :: ji, jj, jl ! dummy loop indices
  444. !!
  445. REAL(wp) :: zmt1, zmt2, zmt3, ztatm3 ! temporary scalars
  446. REAL(wp) :: ztaevbk, zind1, zind2, zind3, ztamr ! - -
  447. REAL(wp) :: zesi, zqsati, zdesidt ! - -
  448. REAL(wp) :: zdqla, zcldeff, zev, zes, zpatm, zrhova ! - -
  449. REAL(wp) :: zcshi, zclei, zrhovaclei, zrhovacshi ! - -
  450. REAL(wp) :: ztice3, zticemb, zticemb2, zdqlw, zdqsb ! - -
  451. REAL(wp) :: z1_lsub ! - -
  452. !!
  453. REAL(wp), DIMENSION(:,:) , POINTER :: ztatm ! Tair in Kelvin
  454. REAL(wp), DIMENSION(:,:) , POINTER :: zqatm ! specific humidity
  455. REAL(wp), DIMENSION(:,:) , POINTER :: zevsqr ! vapour pressure square-root
  456. REAL(wp), DIMENSION(:,:) , POINTER :: zrhoa ! air density
  457. REAL(wp), DIMENSION(:,:,:), POINTER :: z_qlw, z_qsb
  458. REAL(wp), DIMENSION(:,:) , POINTER :: zevap, zsnw
  459. !!---------------------------------------------------------------------
  460. !
  461. IF( nn_timing == 1 ) CALL timing_start('blk_ice_clio_flx')
  462. !
  463. CALL wrk_alloc( jpi,jpj, ztatm, zqatm, zevsqr, zrhoa )
  464. CALL wrk_alloc( jpi,jpj, jpl, z_qlw, z_qsb )
  465. zpatm = 101000. ! atmospheric pressure (assumed constant here)
  466. !--------------------------------------------------------------------------------
  467. ! Determine cloud optical depths as a function of latitude (Chou et al., 1981).
  468. ! and the correction factor for taking into account the effect of clouds
  469. !--------------------------------------------------------------------------------
  470. !CDIR NOVERRCHK
  471. !CDIR COLLAPSE
  472. DO jj = 1, jpj
  473. !CDIR NOVERRCHK
  474. DO ji = 1, jpi
  475. ztatm (ji,jj) = sf(jp_tair)%fnow(ji,jj,1) ! air temperature in Kelvins
  476. zrhoa(ji,jj) = zpatm / ( 287.04 * ztatm(ji,jj) ) ! air density (equation of state for dry air)
  477. ztamr = ztatm(ji,jj) - rtt ! Saturation water vapour
  478. zmt1 = SIGN( 17.269, ztamr )
  479. zmt2 = SIGN( 21.875, ztamr )
  480. zmt3 = SIGN( 28.200, -ztamr )
  481. zes = 611.0 * EXP( ABS( ztamr ) * MIN ( zmt1, zmt2 ) &
  482. & / ( ztatm(ji,jj) - 35.86 + MAX( 0.e0, zmt3 ) ) )
  483. zev = sf(jp_humi)%fnow(ji,jj,1) * zes ! vapour pressure
  484. zevsqr(ji,jj) = SQRT( zev * 0.01 ) ! square-root of vapour pressure
  485. zqatm(ji,jj) = 0.622 * zev / ( zpatm - 0.378 * zev ) ! specific humidity
  486. !----------------------------------------------------
  487. ! Computation of snow precipitation (Ledley, 1985) |
  488. !----------------------------------------------------
  489. zmt1 = 253.0 - ztatm(ji,jj) ; zind1 = MAX( 0.e0, SIGN( 1.e0, zmt1 ) )
  490. zmt2 = ( 272.0 - ztatm(ji,jj) ) / 38.0 ; zind2 = MAX( 0.e0, SIGN( 1.e0, zmt2 ) )
  491. zmt3 = ( 281.0 - ztatm(ji,jj) ) / 18.0 ; zind3 = MAX( 0.e0, SIGN( 1.e0, zmt3 ) )
  492. sprecip(ji,jj) = sf(jp_prec)%fnow(ji,jj,1) / rday & ! rday = converte mm/day to kg/m2/s
  493. & * ( zind1 & ! solid (snow) precipitation [kg/m2/s]
  494. & + ( 1.0 - zind1 ) * ( zind2 * ( 0.5 + zmt2 ) &
  495. & + ( 1.0 - zind2 ) * zind3 * zmt3 ) )
  496. !----------------------------------------------------!
  497. ! fraction of net penetrative shortwave radiation !
  498. !----------------------------------------------------!
  499. ! fraction of qsr_ice which is NOT absorbed in the thin surface layer
  500. ! and thus which penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
  501. fr1_i0(ji,jj) = 0.18 * ( 1.e0 - sf(jp_ccov)%fnow(ji,jj,1) ) + 0.35 * sf(jp_ccov)%fnow(ji,jj,1)
  502. fr2_i0(ji,jj) = 0.82 * ( 1.e0 - sf(jp_ccov)%fnow(ji,jj,1) ) + 0.65 * sf(jp_ccov)%fnow(ji,jj,1)
  503. END DO
  504. END DO
  505. CALL iom_put( 'snowpre', sprecip ) ! Snow precipitation
  506. !-----------------------------------------------------------!
  507. ! snow/ice Shortwave radiation (abedo already computed) !
  508. !-----------------------------------------------------------!
  509. CALL blk_clio_qsr_ice( palb_cs, palb_os, qsr_ice )
  510. DO jl = 1, jpl
  511. palb(:,:,jl) = ( palb_cs(:,:,jl) * ( 1.e0 - sf(jp_ccov)%fnow(:,:,1) ) &
  512. & + palb_os(:,:,jl) * sf(jp_ccov)%fnow(:,:,1) )
  513. END DO
  514. ! ! ========================== !
  515. DO jl = 1, jpl ! Loop over ice categories !
  516. ! ! ========================== !
  517. !CDIR NOVERRCHK
  518. !CDIR COLLAPSE
  519. DO jj = 1 , jpj
  520. !CDIR NOVERRCHK
  521. DO ji = 1, jpi
  522. !-------------------------------------------!
  523. ! long-wave radiation over ice categories ! ( Berliand 1952 ; all latitudes )
  524. !-------------------------------------------!
  525. ztatm3 = ztatm(ji,jj) * ztatm(ji,jj) * ztatm(ji,jj)
  526. zcldeff = 1.0 - sbudyko(ji,jj) * sf(jp_ccov)%fnow(ji,jj,1) * sf(jp_ccov)%fnow(ji,jj,1)
  527. ztaevbk = ztatm3 * ztatm(ji,jj) * zcldeff * ( 0.39 - 0.05 * zevsqr(ji,jj) )
  528. !
  529. z_qlw(ji,jj,jl) = - emic * stefan * ( ztaevbk + 4. * ztatm3 * ( ptsu(ji,jj,jl) - ztatm(ji,jj) ) )
  530. !----------------------------------------
  531. ! Turbulent heat fluxes over snow/ice ( Latent and sensible )
  532. !----------------------------------------
  533. ! vapour pressure at saturation of ice (tmask to avoid overflow in the exponential)
  534. zesi = 611.0 * EXP( 21.8745587 * tmask(ji,jj,1) * ( ptsu(ji,jj,jl) - rtt )/ ( ptsu(ji,jj,jl) - 7.66 ) )
  535. ! humidity close to the ice surface (at saturation)
  536. zqsati = ( 0.622 * zesi ) / ( zpatm - 0.378 * zesi )
  537. ! computation of intermediate values
  538. zticemb = ptsu(ji,jj,jl) - 7.66
  539. zticemb2 = zticemb * zticemb
  540. ztice3 = ptsu(ji,jj,jl) * ptsu(ji,jj,jl) * ptsu(ji,jj,jl)
  541. zdesidt = zesi * ( 9.5 * LOG( 10.0 ) * ( rtt - 7.66 ) / zticemb2 )
  542. ! Transfer cofficients assumed to be constant (Parkinson 1979 ; Maykut 1982)
  543. zcshi = 1.75e-03
  544. zclei = zcshi
  545. ! sensible and latent fluxes over ice
  546. zrhova = zrhoa(ji,jj) * sf(jp_wndm)%fnow(ji,jj,1) ! computation of intermediate values
  547. zrhovaclei = zrhova * zcshi * 2.834e+06
  548. zrhovacshi = zrhova * zclei * 1004.0
  549. ! sensible heat flux
  550. z_qsb(ji,jj,jl) = zrhovacshi * ( ptsu(ji,jj,jl) - ztatm(ji,jj) )
  551. ! latent heat flux
  552. qla_ice(ji,jj,jl) = MAX( 0.e0, zrhovaclei * ( zqsati - zqatm(ji,jj) ) )
  553. ! sensitivity of non solar fluxes (dQ/dT) (long-wave, sensible and latent fluxes)
  554. zdqlw = 4.0 * emic * stefan * ztice3
  555. zdqsb = zrhovacshi
  556. zdqla = zrhovaclei * ( zdesidt * ( zqsati * zqsati / ( zesi * zesi ) ) * ( zpatm / 0.622 ) )
  557. !
  558. dqla_ice(ji,jj,jl) = zdqla ! latent flux sensitivity
  559. dqns_ice(ji,jj,jl) = -( zdqlw + zdqsb + zdqla ) ! total non solar sensitivity
  560. END DO
  561. !
  562. END DO
  563. !
  564. END DO
  565. !
  566. ! ----------------------------------------------------------------------------- !
  567. ! Total FLUXES !
  568. ! ----------------------------------------------------------------------------- !
  569. !
  570. !CDIR COLLAPSE
  571. qns_ice(:,:,:) = z_qlw (:,:,:) - z_qsb (:,:,:) - qla_ice (:,:,:) ! Downward Non Solar flux
  572. !CDIR COLLAPSE
  573. tprecip(:,:) = sf(jp_prec)%fnow(:,:,1) / rday ! total precipitation [kg/m2/s]
  574. !
  575. ! ----------------------------------------------------------------------------- !
  576. ! Correct the OCEAN non solar flux with the existence of solid precipitation !
  577. ! ---------------=====--------------------------------------------------------- !
  578. !CDIR COLLAPSE
  579. qns(:,:) = qns(:,:) & ! update the non-solar heat flux with:
  580. & - sprecip(:,:) * lfus & ! remove melting solid precip
  581. & + sprecip(:,:) * MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow - rt0 ) * cpic & ! add solid P at least below melting
  582. & - sprecip(:,:) * sf(jp_tair)%fnow(:,:,1) * rcp ! remove solid precip. at Tair
  583. #if defined key_lim3
  584. ! ----------------------------------------------------------------------------- !
  585. ! Distribute evapo, precip & associated heat over ice and ocean
  586. ! ---------------=====--------------------------------------------------------- !
  587. CALL wrk_alloc( jpi,jpj, zevap, zsnw )
  588. ! --- evaporation --- !
  589. z1_lsub = 1._wp / Lsub
  590. evap_ice (:,:,:) = qla_ice (:,:,:) * z1_lsub ! sublimation
  591. devap_ice(:,:,:) = dqla_ice(:,:,:) * z1_lsub
  592. zevap (:,:) = emp(:,:) + tprecip(:,:) ! evaporation over ocean
  593. ! --- evaporation minus precipitation --- !
  594. zsnw(:,:) = 0._wp
  595. CALL lim_thd_snwblow( pfrld, zsnw ) ! snow redistribution by wind
  596. emp_oce(:,:) = pfrld(:,:) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * ( 1._wp - zsnw )
  597. emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw
  598. emp_tot(:,:) = emp_oce(:,:) + emp_ice(:,:)
  599. ! --- heat flux associated with emp --- !
  600. qemp_oce(:,:) = - pfrld(:,:) * zevap(:,:) * sst_m(:,:) * rcp & ! evap
  601. & + ( tprecip(:,:) - sprecip(:,:) ) * ( sf(jp_tair)%fnow(:,:,1) - rt0 ) * rcp & ! liquid precip
  602. & + sprecip(:,:) * ( 1._wp - zsnw ) * & ! solid precip
  603. & ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
  604. qemp_ice(:,:) = sprecip(:,:) * zsnw * & ! solid precip (only)
  605. & ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
  606. ! --- total solar and non solar fluxes --- !
  607. qns_tot(:,:) = pfrld(:,:) * qns_oce(:,:) + SUM( a_i_b(:,:,:) * qns_ice(:,:,:), dim=3 ) + qemp_ice(:,:) + qemp_oce(:,:)
  608. qsr_tot(:,:) = pfrld(:,:) * qsr_oce(:,:) + SUM( a_i_b(:,:,:) * qsr_ice(:,:,:), dim=3 )
  609. ! --- heat content of precip over ice in J/m3 (to be used in 1D-thermo) --- !
  610. qprec_ice(:,:) = rhosn * ( ( MIN( sf(jp_tair)%fnow(:,:,1), rt0_snow ) - rt0 ) * cpic * tmask(:,:,1) - lfus )
  611. ! --- heat content of evap over ice in W/m2 (to be used in 1D-thermo) --- !
  612. DO jl = 1, jpl
  613. qevap_ice(:,:,jl) = 0._wp ! should be -evap_ice(:,:,jl)*( ( Tice - rt0 ) * cpic * tmask(:,:,1) - lfus )
  614. ! but then qemp_ice should also include sublimation
  615. END DO
  616. CALL wrk_dealloc( jpi,jpj, zevap, zsnw )
  617. #endif
  618. !!gm : not necessary as all input data are lbc_lnk...
  619. CALL lbc_lnk( fr1_i0 (:,:) , 'T', 1. )
  620. CALL lbc_lnk( fr2_i0 (:,:) , 'T', 1. )
  621. DO jl = 1, jpl
  622. CALL lbc_lnk( qns_ice (:,:,jl) , 'T', 1. )
  623. CALL lbc_lnk( dqns_ice(:,:,jl) , 'T', 1. )
  624. CALL lbc_lnk( qla_ice (:,:,jl) , 'T', 1. )
  625. CALL lbc_lnk( dqla_ice(:,:,jl) , 'T', 1. )
  626. END DO
  627. !!gm : mask is not required on forcing
  628. DO jl = 1, jpl
  629. qns_ice (:,:,jl) = qns_ice (:,:,jl) * tmask(:,:,1)
  630. qla_ice (:,:,jl) = qla_ice (:,:,jl) * tmask(:,:,1)
  631. dqns_ice(:,:,jl) = dqns_ice(:,:,jl) * tmask(:,:,1)
  632. dqla_ice(:,:,jl) = dqla_ice(:,:,jl) * tmask(:,:,1)
  633. END DO
  634. CALL wrk_dealloc( jpi,jpj, ztatm, zqatm, zevsqr, zrhoa )
  635. CALL wrk_dealloc( jpi,jpj, jpl , z_qlw, z_qsb )
  636. IF(ln_ctl) THEN
  637. CALL prt_ctl(tab3d_1=z_qsb , clinfo1=' blk_ice_clio: z_qsb : ', tab3d_2=z_qlw , clinfo2=' z_qlw : ', kdim=jpl)
  638. CALL prt_ctl(tab3d_1=qla_ice , clinfo1=' blk_ice_clio: z_qla : ', tab3d_2=qsr_ice , clinfo2=' qsr_ice : ', kdim=jpl)
  639. CALL prt_ctl(tab3d_1=dqns_ice , clinfo1=' blk_ice_clio: dqns_ice : ', tab3d_2=qns_ice , clinfo2=' qns_ice : ', kdim=jpl)
  640. CALL prt_ctl(tab3d_1=dqla_ice , clinfo1=' blk_ice_clio: dqla_ice : ', tab3d_2=ptsu , clinfo2=' ptsu : ', kdim=jpl)
  641. CALL prt_ctl(tab2d_1=tprecip , clinfo1=' blk_ice_clio: tprecip : ', tab2d_2=sprecip , clinfo2=' sprecip : ')
  642. ENDIF
  643. IF( nn_timing == 1 ) CALL timing_stop('blk_ice_clio_flx')
  644. !
  645. END SUBROUTINE blk_ice_clio_flx
  646. #endif
  647. SUBROUTINE blk_clio_qsr_oce( pqsr_oce )
  648. !!---------------------------------------------------------------------------
  649. !! *** ROUTINE blk_clio_qsr_oce ***
  650. !!
  651. !! ** Purpose : Computation of the shortwave radiation at the ocean and the
  652. !! snow/ice surfaces.
  653. !!
  654. !! ** Method : - computed qsr from the cloud cover for both ice and ocean
  655. !! - also initialise sbudyko and stauc once for all
  656. !!----------------------------------------------------------------------
  657. REAL(wp), INTENT( out), DIMENSION(jpi,jpj) :: pqsr_oce ! shortwave radiation over the ocean
  658. !!
  659. INTEGER, PARAMETER :: jp24 = 24 ! sampling of the daylight period (sunrise to sunset) into 24 equal parts
  660. !!
  661. INTEGER :: ji, jj, jt ! dummy loop indices
  662. INTEGER :: indaet ! = -1, 0, 1 for odd, normal and leap years resp.
  663. INTEGER :: iday ! integer part of day
  664. INTEGER :: indxb, indxc ! index for cloud depth coefficient
  665. REAL(wp) :: zalat , zclat, zcmue, zcmue2 ! local scalars
  666. REAL(wp) :: zmt1, zmt2, zmt3 !
  667. REAL(wp) :: zdecl, zsdecl , zcdecl !
  668. REAL(wp) :: za_oce, ztamr !
  669. REAL(wp) :: zdl, zlha ! local scalars
  670. REAL(wp) :: zlmunoon, zcldcor, zdaycor !
  671. REAL(wp) :: zxday, zdist, zcoef, zcoef1 !
  672. REAL(wp) :: zes
  673. REAL(wp), DIMENSION(:,:), POINTER :: zev ! vapour pressure
  674. REAL(wp), DIMENSION(:,:), POINTER :: zdlha, zlsrise, zlsset ! 2D workspace
  675. REAL(wp), DIMENSION(:,:), POINTER :: zps, zpc ! sine (cosine) of latitude per sine (cosine) of solar declination
  676. !!---------------------------------------------------------------------
  677. !
  678. IF( nn_timing == 1 ) CALL timing_start('blk_clio_qsr_oce')
  679. !
  680. CALL wrk_alloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
  681. IF( lbulk_init ) THEN ! Initilization at first time step only
  682. rdtbs2 = nn_fsbc * rdt * 0.5
  683. ! cloud optical depths as a function of latitude (Chou et al., 1981).
  684. ! and the correction factor for taking into account the effect of clouds
  685. DO jj = 1, jpj
  686. DO ji = 1 , jpi
  687. zalat = ( 90.e0 - ABS( gphit(ji,jj) ) ) / 5.e0
  688. zclat = ( 95.e0 - gphit(ji,jj) ) / 10.e0
  689. indxb = 1 + INT( zalat )
  690. indxc = 1 + INT( zclat )
  691. zdl = zclat - INT( zclat )
  692. ! correction factor to account for the effect of clouds
  693. sbudyko(ji,jj) = budyko(indxb)
  694. stauc (ji,jj) = ( 1.e0 - zdl ) * tauco( indxc ) + zdl * tauco( indxc + 1 )
  695. END DO
  696. END DO
  697. lbulk_init = .FALSE.
  698. ENDIF
  699. ! Saturated water vapour and vapour pressure
  700. ! ------------------------------------------
  701. !CDIR NOVERRCHK
  702. !CDIR COLLAPSE
  703. DO jj = 1, jpj
  704. !CDIR NOVERRCHK
  705. DO ji = 1, jpi
  706. ztamr = sf(jp_tair)%fnow(ji,jj,1) - rtt
  707. zmt1 = SIGN( 17.269, ztamr )
  708. zmt2 = SIGN( 21.875, ztamr )
  709. zmt3 = SIGN( 28.200, -ztamr )
  710. zes = 611.0 * EXP( ABS( ztamr ) * MIN ( zmt1, zmt2 ) & ! Saturation water vapour
  711. & / ( sf(jp_tair)%fnow(ji,jj,1) - 35.86 + MAX( 0.e0, zmt3 ) ) )
  712. zev(ji,jj) = sf(jp_humi)%fnow(ji,jj,1) * zes * 1.0e-05 ! vapour pressure
  713. END DO
  714. END DO
  715. !-----------------------------------!
  716. ! Computation of solar irradiance !
  717. !-----------------------------------!
  718. !!gm : hard coded leap year ???
  719. indaet = 1 ! = -1, 0, 1 for odd, normal and leap years resp.
  720. zxday = nday_year + rdtbs2 / rday ! day of the year at which the fluxes are calculated
  721. iday = INT( zxday ) ! (centred at the middle of the ice time step)
  722. CALL flx_blk_declin( indaet, iday, zdecl ) ! solar declination of the current day
  723. zsdecl = SIN( zdecl * rad ) ! its sine
  724. zcdecl = COS( zdecl * rad ) ! its cosine
  725. ! correction factor added for computation of shortwave flux to take into account the variation of
  726. ! the distance between the sun and the earth during the year (Oberhuber 1988)
  727. zdist = zxday * 2. * rpi / REAL(nyear_len(1), wp)
  728. zdaycor = 1.0 + 0.0013 * SIN( zdist ) + 0.0342 * COS( zdist )
  729. !CDIR NOVERRCHK
  730. DO jj = 1, jpj
  731. !CDIR NOVERRCHK
  732. DO ji = 1, jpi
  733. ! product of sine (cosine) of latitude and sine (cosine) of solar declination
  734. zps(ji,jj) = SIN( gphit(ji,jj) * rad ) * zsdecl
  735. zpc(ji,jj) = COS( gphit(ji,jj) * rad ) * zcdecl
  736. ! computation of the both local time of sunrise and sunset
  737. zlsrise(ji,jj) = ACOS( - SIGN( 1.e0, zps(ji,jj) ) &
  738. & * MIN( 1.e0, SIGN( 1.e0, zps(ji,jj) ) * ( zps(ji,jj) / zpc(ji,jj) ) ) )
  739. zlsset (ji,jj) = - zlsrise(ji,jj)
  740. ! dividing the solar day into jp24 segments of length zdlha
  741. zdlha (ji,jj) = ( zlsrise(ji,jj) - zlsset(ji,jj) ) / REAL( jp24, wp )
  742. END DO
  743. END DO
  744. !---------------------------------------------!
  745. ! shortwave radiation absorbed by the ocean !
  746. !---------------------------------------------!
  747. pqsr_oce(:,:) = 0.e0 ! set ocean qsr to zero
  748. ! compute and sum ocean qsr over the daylight (i.e. between sunrise and sunset)
  749. !CDIR NOVERRCHK
  750. DO jt = 1, jp24
  751. zcoef = FLOAT( jt ) - 0.5
  752. !CDIR NOVERRCHK
  753. !CDIR COLLAPSE
  754. DO jj = 1, jpj
  755. !CDIR NOVERRCHK
  756. DO ji = 1, jpi
  757. zlha = COS( zlsrise(ji,jj) - zcoef * zdlha(ji,jj) ) ! local hour angle
  758. zcmue = MAX( 0.e0 , zps(ji,jj) + zpc(ji,jj) * zlha ) ! cos of local solar altitude
  759. zcmue2 = 1368.0 * zcmue * zcmue
  760. ! ocean albedo depending on the cloud cover (Payne, 1972)
  761. za_oce = ( 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ) * 0.05 / ( 1.1 * zcmue**1.4 + 0.15 ) & ! clear sky
  762. & + sf(jp_ccov)%fnow(ji,jj,1) * 0.06 ! overcast
  763. ! solar heat flux absorbed by the ocean (Zillman, 1972)
  764. pqsr_oce(ji,jj) = pqsr_oce(ji,jj) &
  765. & + ( 1.0 - za_oce ) * zdlha(ji,jj) * zcmue2 &
  766. & / ( ( zcmue + 2.7 ) * zev(ji,jj) + 1.085 * zcmue + 0.10 )
  767. END DO
  768. END DO
  769. END DO
  770. ! Taking into account the ellipsity of the earth orbit, the clouds AND masked if sea-ice cover > 0%
  771. zcoef1 = srgamma * zdaycor / ( 2. * rpi )
  772. !CDIR COLLAPSE
  773. DO jj = 1, jpj
  774. DO ji = 1, jpi
  775. zlmunoon = ASIN( zps(ji,jj) + zpc(ji,jj) ) / rad ! local noon solar altitude
  776. zcldcor = MIN( 1.e0, ( 1.e0 - 0.62 * sf(jp_ccov)%fnow(ji,jj,1) & ! cloud correction (Reed 1977)
  777. & + 0.0019 * zlmunoon ) )
  778. pqsr_oce(ji,jj) = zcoef1 * zcldcor * pqsr_oce(ji,jj) * tmask(ji,jj,1) ! and zcoef1: ellipsity
  779. END DO
  780. END DO
  781. CALL wrk_dealloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
  782. !
  783. IF( nn_timing == 1 ) CALL timing_stop('blk_clio_qsr_oce')
  784. !
  785. END SUBROUTINE blk_clio_qsr_oce
  786. SUBROUTINE blk_clio_qsr_ice( pa_ice_cs, pa_ice_os, pqsr_ice )
  787. !!---------------------------------------------------------------------------
  788. !! *** ROUTINE blk_clio_qsr_ice ***
  789. !!
  790. !! ** Purpose : Computation of the shortwave radiation at the ocean and the
  791. !! snow/ice surfaces.
  792. !!
  793. !! ** Method : - computed qsr from the cloud cover for both ice and ocean
  794. !! - also initialise sbudyko and stauc once for all
  795. !!----------------------------------------------------------------------
  796. REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: pa_ice_cs ! albedo of ice under clear sky
  797. REAL(wp), INTENT(in ), DIMENSION(:,:,:) :: pa_ice_os ! albedo of ice under overcast sky
  798. REAL(wp), INTENT( out), DIMENSION(:,:,:) :: pqsr_ice ! shortwave radiation over the ice/snow
  799. !!
  800. INTEGER, PARAMETER :: jp24 = 24 ! sampling of the daylight period (sunrise to sunset) into 24 equal parts
  801. !!
  802. INTEGER :: ji, jj, jl, jt ! dummy loop indices
  803. INTEGER :: ijpl ! number of ice categories (3rd dim of pqsr_ice)
  804. INTEGER :: indaet ! = -1, 0, 1 for odd, normal and leap years resp.
  805. INTEGER :: iday ! integer part of day
  806. !!
  807. REAL(wp) :: zcmue, zcmue2, ztamr ! temporary scalars
  808. REAL(wp) :: zmt1, zmt2, zmt3 ! - -
  809. REAL(wp) :: zdecl, zsdecl, zcdecl ! - -
  810. REAL(wp) :: zlha, zdaycor, zes ! - -
  811. REAL(wp) :: zxday, zdist, zcoef, zcoef1 ! - -
  812. REAL(wp) :: zqsr_ice_cs, zqsr_ice_os ! - -
  813. REAL(wp), DIMENSION(:,:), POINTER :: zev ! vapour pressure
  814. REAL(wp), DIMENSION(:,:), POINTER :: zdlha, zlsrise, zlsset ! 2D workspace
  815. REAL(wp), DIMENSION(:,:), POINTER :: zps, zpc ! sine (cosine) of latitude per sine (cosine) of solar declination
  816. !!---------------------------------------------------------------------
  817. !
  818. IF( nn_timing == 1 ) CALL timing_start('blk_clio_qsr_ice')
  819. !
  820. CALL wrk_alloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
  821. ijpl = SIZE(pqsr_ice, 3 ) ! number of ice categories
  822. ! Saturated water vapour and vapour pressure
  823. ! ------------------------------------------
  824. !CDIR NOVERRCHK
  825. !CDIR COLLAPSE
  826. DO jj = 1, jpj
  827. !CDIR NOVERRCHK
  828. DO ji = 1, jpi
  829. ztamr = sf(jp_tair)%fnow(ji,jj,1) - rtt
  830. zmt1 = SIGN( 17.269, ztamr )
  831. zmt2 = SIGN( 21.875, ztamr )
  832. zmt3 = SIGN( 28.200, -ztamr )
  833. zes = 611.0 * EXP( ABS( ztamr ) * MIN ( zmt1, zmt2 ) & ! Saturation water vapour
  834. & / ( sf(jp_tair)%fnow(ji,jj,1) - 35.86 + MAX( 0.e0, zmt3 ) ) )
  835. zev(ji,jj) = sf(jp_humi)%fnow(ji,jj,1) * zes * 1.0e-05 ! vapour pressure
  836. END DO
  837. END DO
  838. !-----------------------------------!
  839. ! Computation of solar irradiance !
  840. !-----------------------------------!
  841. !!gm : hard coded leap year ???
  842. indaet = 1 ! = -1, 0, 1 for odd, normal and leap years resp.
  843. zxday = nday_year + rdtbs2 / rday ! day of the year at which the fluxes are calculated
  844. iday = INT( zxday ) ! (centred at the middle of the ice time step)
  845. CALL flx_blk_declin( indaet, iday, zdecl ) ! solar declination of the current day
  846. zsdecl = SIN( zdecl * rad ) ! its sine
  847. zcdecl = COS( zdecl * rad ) ! its cosine
  848. ! correction factor added for computation of shortwave flux to take into account the variation of
  849. ! the distance between the sun and the earth during the year (Oberhuber 1988)
  850. zdist = zxday * 2. * rpi / REAL(nyear_len(1), wp)
  851. zdaycor = 1.0 + 0.0013 * SIN( zdist ) + 0.0342 * COS( zdist )
  852. !CDIR NOVERRCHK
  853. DO jj = 1, jpj
  854. !CDIR NOVERRCHK
  855. DO ji = 1, jpi
  856. ! product of sine (cosine) of latitude and sine (cosine) of solar declination
  857. zps(ji,jj) = SIN( gphit(ji,jj) * rad ) * zsdecl
  858. zpc(ji,jj) = COS( gphit(ji,jj) * rad ) * zcdecl
  859. ! computation of the both local time of sunrise and sunset
  860. zlsrise(ji,jj) = ACOS( - SIGN( 1.e0, zps(ji,jj) ) &
  861. & * MIN( 1.e0, SIGN( 1.e0, zps(ji,jj) ) * ( zps(ji,jj) / zpc(ji,jj) ) ) )
  862. zlsset (ji,jj) = - zlsrise(ji,jj)
  863. ! dividing the solar day into jp24 segments of length zdlha
  864. zdlha (ji,jj) = ( zlsrise(ji,jj) - zlsset(ji,jj) ) / REAL( jp24, wp )
  865. END DO
  866. END DO
  867. !---------------------------------------------!
  868. ! shortwave radiation absorbed by the ice !
  869. !---------------------------------------------!
  870. ! compute and sum ice qsr over the daylight for each ice categories
  871. pqsr_ice(:,:,:) = 0.e0
  872. zcoef1 = zdaycor / ( 2. * rpi ) ! Correction for the ellipsity of the earth orbit
  873. ! !----------------------------!
  874. DO jl = 1, ijpl ! loop over ice categories !
  875. ! !----------------------------!
  876. !CDIR NOVERRCHK
  877. DO jt = 1, jp24
  878. zcoef = FLOAT( jt ) - 0.5
  879. !CDIR NOVERRCHK
  880. !CDIR COLLAPSE
  881. DO jj = 1, jpj
  882. !CDIR NOVERRCHK
  883. DO ji = 1, jpi
  884. zlha = COS( zlsrise(ji,jj) - zcoef * zdlha(ji,jj) ) ! local hour angle
  885. zcmue = MAX( 0.e0 , zps(ji,jj) + zpc(ji,jj) * zlha ) ! cos of local solar altitude
  886. zcmue2 = 1368.0 * zcmue * zcmue
  887. ! solar heat flux absorbed by the ice/snow system (Shine and Crane 1984 adapted to high albedo)
  888. zqsr_ice_cs = ( 1.0 - pa_ice_cs(ji,jj,jl) ) * zdlha(ji,jj) * zcmue2 & ! clear sky
  889. & / ( ( 1.0 + zcmue ) * zev(ji,jj) + 1.2 * zcmue + 0.0455 )
  890. zqsr_ice_os = zdlha(ji,jj) * SQRT( zcmue ) & ! overcast sky
  891. & * ( 53.5 + 1274.5 * zcmue ) * ( 1.0 - 0.996 * pa_ice_os(ji,jj,jl) ) &
  892. & / ( 1.0 + 0.139 * stauc(ji,jj) * ( 1.0 - 0.9435 * pa_ice_os(ji,jj,jl) ) )
  893. pqsr_ice(ji,jj,jl) = pqsr_ice(ji,jj,jl) + ( ( 1.0 - sf(jp_ccov)%fnow(ji,jj,1) ) * zqsr_ice_cs &
  894. & + sf(jp_ccov)%fnow(ji,jj,1) * zqsr_ice_os )
  895. END DO
  896. END DO
  897. END DO
  898. !
  899. ! Correction : Taking into account the ellipsity of the earth orbit
  900. pqsr_ice(:,:,jl) = pqsr_ice(:,:,jl) * zcoef1 * tmask(:,:,1)
  901. !
  902. ! !--------------------------------!
  903. END DO ! end loop over ice categories !
  904. ! !--------------------------------!
  905. !!gm : this should be suppress as input data have been passed through lbc_lnk
  906. DO jl = 1, ijpl
  907. CALL lbc_lnk( pqsr_ice(:,:,jl) , 'T', 1. )
  908. END DO
  909. !
  910. CALL wrk_dealloc( jpi,jpj, zev, zdlha, zlsrise, zlsset, zps, zpc )
  911. !
  912. IF( nn_timing == 1 ) CALL timing_stop('blk_clio_qsr_ice')
  913. !
  914. END SUBROUTINE blk_clio_qsr_ice
  915. SUBROUTINE flx_blk_declin( ky, kday, pdecl )
  916. !!---------------------------------------------------------------------------
  917. !! *** ROUTINE flx_blk_declin ***
  918. !!
  919. !! ** Purpose : Computation of the solar declination for the day
  920. !!
  921. !! ** Method : ???
  922. !!---------------------------------------------------------------------
  923. INTEGER , INTENT(in ) :: ky ! = -1, 0, 1 for odd, normal and leap years resp.
  924. INTEGER , INTENT(in ) :: kday ! day of the year ( kday = 1 on january 1)
  925. REAL(wp), INTENT( out) :: pdecl ! solar declination
  926. !!
  927. REAL(wp) :: a0 = 0.39507671 ! coefficients for solar declinaison computation
  928. REAL(wp) :: a1 = 22.85684301 ! " "" "
  929. REAL(wp) :: a2 = -0.38637317 ! " "" "
  930. REAL(wp) :: a3 = 0.15096535 ! " "" "
  931. REAL(wp) :: a4 = -0.00961411 ! " "" "
  932. REAL(wp) :: b1 = -4.29692073 ! " "" "
  933. REAL(wp) :: b2 = 0.05702074 ! " "" "
  934. REAL(wp) :: b3 = -0.09028607 ! " "" "
  935. REAL(wp) :: b4 = 0.00592797
  936. !!
  937. REAL(wp) :: zday ! corresponding day of type year (cf. ky)
  938. REAL(wp) :: zp ! temporary scalars
  939. !!---------------------------------------------------------------------
  940. IF ( ky == 1 ) THEN ; zday = REAL( kday, wp ) - 0.5
  941. ELSEIF( ky == 3 ) THEN ; zday = REAL( kday, wp ) - 1.
  942. ELSE ; zday = REAL( kday, wp )
  943. ENDIF
  944. zp = rpi * ( 2.0 * zday - 367.0 ) / REAL(nyear_len(1), wp)
  945. pdecl = a0 &
  946. & + a1 * COS( zp ) + a2 * COS( 2. * zp ) + a3 * COS( 3. * zp ) + a4 * COS( 4. * zp ) &
  947. & + b1 * SIN( zp ) + b2 * SIN( 2. * zp ) + b3 * SIN( 3. * zp ) + b4 * SIN( 4. * zp )
  948. !
  949. END SUBROUTINE flx_blk_declin
  950. !!======================================================================
  951. END MODULE sbcblk_clio