ldfdyn_c2d.h90 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. !!----------------------------------------------------------------------
  2. !! *** ldfdyn_c2d.h90 ***
  3. !!----------------------------------------------------------------------
  4. !! ldf_dyn_c2d : set the lateral viscosity coefficients
  5. !! ldf_dyn_c2d_orca : specific case for orca r2 and r4
  6. !!----------------------------------------------------------------------
  7. !!----------------------------------------------------------------------
  8. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  9. !! $Id: ldfdyn_c2d.h90 4325 2013-11-29 15:27:48Z cbricaud $
  10. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  11. !!----------------------------------------------------------------------
  12. SUBROUTINE ldf_dyn_c2d( ld_print )
  13. !!----------------------------------------------------------------------
  14. !! *** ROUTINE ldf_dyn_c2d ***
  15. !!
  16. !! ** Purpose : initializations of the horizontal ocean physics
  17. !!
  18. !! ** Method :
  19. !! 2D eddy viscosity coefficients ( longitude, latitude )
  20. !!
  21. !! harmonic operator : ahm1 is defined at t-point
  22. !! ahm2 is defined at f-point
  23. !! + isopycnal : ahm3 is defined at u-point
  24. !! or geopotential ahm4 is defined at v-point
  25. !! iso-model level : ahm3, ahm4 not used
  26. !!
  27. !! biharmonic operator : ahm3 is defined at u-point
  28. !! ahm4 is defined at v-point
  29. !! : ahm1, ahm2 not used
  30. !!
  31. !!----------------------------------------------------------------------
  32. LOGICAL, INTENT (in) :: ld_print ! If true, output arrays on numout
  33. !
  34. INTEGER :: ji, jj
  35. REAL(wp) :: za00, zd_max, zetmax, zeumax, zefmax, zevmax
  36. !!----------------------------------------------------------------------
  37. IF(lwp) WRITE(numout,*)
  38. IF(lwp) WRITE(numout,*) 'ldf_dyn_c2d : 2d lateral eddy viscosity coefficient'
  39. IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
  40. ! harmonic operator (ahm1, ahm2) : ( T- and F- points) (used for laplacian operators
  41. ! =============================== whatever its orientation is)
  42. IF( ln_dynldf_lap ) THEN
  43. ! define ahm1 and ahm2 at the right grid point position
  44. ! (USER: modify ahm1 and ahm2 following your desiderata)
  45. zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) )
  46. IF( lk_mpp ) CALL mpp_max( zd_max ) ! max over the global domain
  47. IF(lwp) WRITE(numout,*) ' laplacian operator: ahm proportional to e1'
  48. IF(lwp) WRITE(numout,*) ' maximum grid-spacing = ', zd_max, ' maximum value for ahm = ', ahm0
  49. za00 = ahm0 / zd_max
  50. DO jj = 1, jpj
  51. DO ji = 1, jpi
  52. zetmax = MAX( e1t(ji,jj), e2t(ji,jj) )
  53. zefmax = MAX( e1f(ji,jj), e2f(ji,jj) )
  54. ahm1(ji,jj) = za00 * zetmax
  55. ahm2(ji,jj) = za00 * zefmax
  56. END DO
  57. END DO
  58. IF( ln_dynldf_iso ) THEN
  59. IF(lwp) WRITE(numout,*) ' Caution, as implemented now, the isopycnal part of momentum'
  60. IF(lwp) WRITE(numout,*) ' mixing use aht0 as eddy viscosity coefficient. Thus, it is'
  61. IF(lwp) WRITE(numout,*) ' uniform and you must be sure that your ahm is greater than'
  62. IF(lwp) WRITE(numout,*) ' aht0 everywhere in the model domain.'
  63. ENDIF
  64. ! Special case for ORCA R1, R2 and R4 configurations (overwrite the value of ahm1 ahm2)
  65. ! ==============================================
  66. IF( cp_cfg == "orca" .AND. ( jp_cfg == 2 .OR. jp_cfg == 4 ) ) CALL ldf_dyn_c2d_orca( ld_print )
  67. IF( cp_cfg == "orca" .AND. jp_cfg == 1) CALL ldf_dyn_c2d_orca_R1( ld_print )
  68. ! Control print
  69. IF( lwp .AND. ld_print ) THEN
  70. WRITE(numout,*)
  71. WRITE(numout,*) 'inildf: 2D ahm1 array'
  72. CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  73. WRITE(numout,*)
  74. WRITE(numout,*) 'inildf: 2D ahm2 array'
  75. CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  76. ENDIF
  77. ENDIF
  78. ! biharmonic operator (ahm3, ahm4) : at U- and V-points (used for bilaplacian operator
  79. ! ================================= whatever its orientation is)
  80. IF( ln_dynldf_bilap ) THEN
  81. ! (USER: modify ahm3 and ahm4 following your desiderata)
  82. ! Here: ahm is proportional to the cube of the maximum of the gridspacing
  83. ! in the to horizontal direction
  84. zd_max = MAX( MAXVAL( e1u(:,:) ), MAXVAL( e2u(:,:) ) )
  85. IF( lk_mpp ) CALL mpp_max( zd_max ) ! max over the global domain
  86. IF(lwp) WRITE(numout,*) ' bi-laplacian operator: ahm proportional to e1**3 '
  87. IF(lwp) WRITE(numout,*) ' maximum grid-spacing = ', zd_max, ' maximum value for ahm = ', ahm0
  88. za00 = ahm0_blp / ( zd_max * zd_max * zd_max )
  89. DO jj = 1, jpj
  90. DO ji = 1, jpi
  91. zeumax = MAX( e1u(ji,jj), e2u(ji,jj) )
  92. zevmax = MAX( e1v(ji,jj), e2v(ji,jj) )
  93. ahm3(ji,jj) = za00 * zeumax * zeumax * zeumax
  94. ahm4(ji,jj) = za00 * zevmax * zevmax * zevmax
  95. END DO
  96. END DO
  97. ! Control print
  98. IF( lwp .AND. ld_print ) THEN
  99. WRITE(numout,*)
  100. WRITE(numout,*) 'inildf: ahm3 array'
  101. CALL prihre(ahm3,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  102. WRITE(numout,*)
  103. WRITE(numout,*) 'inildf: ahm4 array'
  104. CALL prihre(ahm4,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  105. ENDIF
  106. ENDIF
  107. !
  108. END SUBROUTINE ldf_dyn_c2d
  109. SUBROUTINE ldf_dyn_c2d_orca( ld_print )
  110. !!----------------------------------------------------------------------
  111. !! *** ROUTINE ldf_dyn_c2d ***
  112. !!
  113. !! **** W A R N I N G ****
  114. !!
  115. !! ORCA R2 and R4 configurations
  116. !!
  117. !! **** W A R N I N G ****
  118. !!
  119. !! ** Purpose : initializations of the lateral viscosity for orca R2
  120. !!
  121. !! ** Method : blah blah blah...
  122. !!
  123. !!----------------------------------------------------------------------
  124. USE ldftra_oce, ONLY: aht0
  125. USE iom
  126. !
  127. LOGICAL, INTENT (in) :: ld_print ! If true, output arrays on numout
  128. !
  129. INTEGER :: ji, jj, jn ! dummy loop indices
  130. INTEGER :: inum, iim, ijm ! local integers
  131. INTEGER :: ifreq, il1, il2, ij, ii
  132. INTEGER :: ijpt0,ijpt1, ierror
  133. REAL(wp) :: zahmeq, zcoft, zcoff, zmsk
  134. CHARACTER (len=15) :: clexp
  135. INTEGER, POINTER, DIMENSION(:,:) :: icof
  136. REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d ! temporary array to read ahmcoef file
  137. !!----------------------------------------------------------------------
  138. !
  139. CALL wrk_alloc( jpi , jpj , icof )
  140. !
  141. IF(lwp) WRITE(numout,*)
  142. IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
  143. IF(lwp) WRITE(numout,*) '~~~~~~ --'
  144. IF(lwp) WRITE(numout,*) ' orca ocean configuration'
  145. IF( cp_cfg == "orca" .AND. cp_cfz == "antarctic" ) THEN
  146. !
  147. ! 1.2 Modify ahm
  148. ! --------------
  149. IF(lwp)WRITE(numout,*) ' inildf: Antarctic ocean'
  150. IF(lwp)WRITE(numout,*) ' no tropics, no reduction of ahm'
  151. IF(lwp)WRITE(numout,*) ' north boundary increase'
  152. ahm1(:,:) = ahm0
  153. ahm2(:,:) = ahm0
  154. ijpt0=max(1,min(49 -njmpp+1,jpj))
  155. ijpt1=max(0,min(49-njmpp+1,jpj-1))
  156. DO jj=ijpt0,ijpt1
  157. ahm2(:,jj)=ahm0*2.
  158. ahm1(:,jj)=ahm0*2.
  159. END DO
  160. ijpt0=max(1,min(48 -njmpp+1,jpj))
  161. ijpt1=max(0,min(48-njmpp+1,jpj-1))
  162. DO jj=ijpt0,ijpt1
  163. ahm2(:,jj)=ahm0*1.9
  164. ahm1(:,jj)=ahm0*1.75
  165. END DO
  166. ijpt0=max(1,min(47 -njmpp+1,jpj))
  167. ijpt1=max(0,min(47-njmpp+1,jpj-1))
  168. DO jj=ijpt0,ijpt1
  169. ahm2(:,jj)=ahm0*1.5
  170. ahm1(:,jj)=ahm0*1.25
  171. END DO
  172. ijpt0=max(1,min(46 -njmpp+1,jpj))
  173. ijpt1=max(0,min(46-njmpp+1,jpj-1))
  174. DO jj=ijpt0,ijpt1
  175. ahm2(:,jj)=ahm0*1.1
  176. END DO
  177. ELSE IF( cp_cfg == "orca" .AND. cp_cfz == "arctic" ) THEN
  178. ! 1.2 Modify ahm
  179. ! --------------
  180. IF(lwp)WRITE(numout,*) ' inildf: Arctic ocean'
  181. IF(lwp)WRITE(numout,*) ' no tropics, no reduction of ahm'
  182. IF(lwp)WRITE(numout,*) ' south and west boundary increase'
  183. ahm1(:,:) = ahm0
  184. ahm2(:,:) = ahm0
  185. ijpt0=max(1,min(98-jpjzoom+1-njmpp+1,jpj))
  186. ijpt1=max(0,min(98-jpjzoom+1-njmpp+1,jpj-1))
  187. DO jj=ijpt0,ijpt1
  188. ahm2(:,jj)=ahm0*2.
  189. ahm1(:,jj)=ahm0*2.
  190. END DO
  191. ijpt0=max(1,min(99-jpjzoom+1-njmpp+1,jpj))
  192. ijpt1=max(0,min(99-jpjzoom+1-njmpp+1,jpj-1))
  193. DO jj=ijpt0,ijpt1
  194. ahm2(:,jj)=ahm0*1.9
  195. ahm1(:,jj)=ahm0*1.75
  196. END DO
  197. ijpt0=max(1,min(100-jpjzoom+1-njmpp+1,jpj))
  198. ijpt1=max(0,min(100-jpjzoom+1-njmpp+1,jpj-1))
  199. DO jj=ijpt0,ijpt1
  200. ahm2(:,jj)=ahm0*1.5
  201. ahm1(:,jj)=ahm0*1.25
  202. END DO
  203. ijpt0=max(1,min(101-jpjzoom+1-njmpp+1,jpj))
  204. ijpt1=max(0,min(101-jpjzoom+1-njmpp+1,jpj-1))
  205. DO jj=ijpt0,ijpt1
  206. ahm2(:,jj)=ahm0*1.1
  207. END DO
  208. ELSE
  209. ! Read 2d integer array to specify western boundary increase in the
  210. ! ===================== equatorial strip (20N-20S) defined at t-points
  211. !
  212. ALLOCATE( ztemp2d(jpi,jpj) )
  213. ztemp2d(:,:) = 0.
  214. CALL iom_open ( 'ahmcoef.nc', inum )
  215. CALL iom_get ( inum, jpdom_data, 'icof', ztemp2d)
  216. icof(:,:) = NINT(ztemp2d(:,:))
  217. CALL iom_close( inum )
  218. DEALLOCATE(ztemp2d)
  219. ! Set ahm1 and ahm2 ( T- and F- points) (used for laplacian operator)
  220. ! =================
  221. ! define ahm1 and ahm2 at the right grid point position
  222. ! (USER: modify ahm1 and ahm2 following your desiderata)
  223. ! Decrease ahm to zahmeq m2/s in the tropics
  224. ! (from 90 to 20 degre: ahm = constant
  225. ! from 20 to 2.5 degre: ahm = decrease in (1-cos)/2
  226. ! from 2.5 to 0 degre: ahm = constant
  227. ! symmetric in the south hemisphere)
  228. zahmeq = aht0
  229. DO jj = 1, jpj
  230. DO ji = 1, jpi
  231. IF( ABS( gphif(ji,jj) ) >= 20. ) THEN
  232. ahm2(ji,jj) = ahm0
  233. ELSEIF( ABS( gphif(ji,jj) ) <= 2.5 ) THEN
  234. ahm2(ji,jj) = zahmeq
  235. ELSE
  236. ahm2(ji,jj) = zahmeq + (ahm0-zahmeq)/2. &
  237. * ( 1. - COS( rad * ( ABS(gphif(ji,jj))-2.5 ) * 180. / 17.5 ) )
  238. ENDIF
  239. IF( ABS( gphit(ji,jj) ) >= 20. ) THEN
  240. ahm1(ji,jj) = ahm0
  241. ELSEIF( ABS( gphit(ji,jj) ) <= 2.5 ) THEN
  242. ahm1(ji,jj) = zahmeq
  243. ELSE
  244. ahm1(ji,jj) = zahmeq + (ahm0-zahmeq)/2. &
  245. * ( 1. - COS( rad * ( ABS(gphit(ji,jj))-2.5 ) * 180. / 17.5 ) )
  246. ENDIF
  247. END DO
  248. END DO
  249. ! increase along western boundaries of equatorial strip
  250. ! t-point
  251. DO jj = 1, jpjm1
  252. DO ji = 1, jpim1
  253. zcoft = FLOAT( icof(ji,jj) ) / 100.
  254. ahm1(ji,jj) = zcoft * ahm0 + (1.-zcoft) * ahm1(ji,jj)
  255. END DO
  256. END DO
  257. ! f-point
  258. icof(:,:) = icof(:,:) * tmask(:,:,1)
  259. DO jj = 1, jpjm1
  260. DO ji = 1, jpim1 ! NO vector opt.
  261. zmsk = tmask(ji,jj+1,1) + tmask(ji+1,jj+1,1) + tmask(ji,jj,1) + tmask(ji,jj+1,1)
  262. IF( zmsk == 0. ) THEN
  263. zcoff = 1.
  264. ELSE
  265. zcoff = FLOAT( icof(ji,jj+1) + icof(ji+1,jj+1) + icof(ji,jj) + icof(ji,jj+1) ) &
  266. / (zmsk * 100.)
  267. ENDIF
  268. ahm2(ji,jj) = zcoff * ahm0 + (1.-zcoff) * ahm2(ji,jj)
  269. END DO
  270. END DO
  271. ENDIF
  272. ! Lateral boundary conditions on ( ahm1, ahm2 )
  273. ! ==============
  274. CALL lbc_lnk( ahm1, 'T', 1. ) ! T-point, unchanged sign
  275. CALL lbc_lnk( ahm2, 'F', 1. ) ! F-point, unchanged sign
  276. ! Control print
  277. IF( lwp .AND. ld_print ) THEN
  278. WRITE(numout,*)
  279. WRITE(numout,*) 'inildf: 2D ahm1 array'
  280. CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  281. WRITE(numout,*)
  282. WRITE(numout,*) 'inildf: 2D ahm2 array'
  283. CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  284. ENDIF
  285. !
  286. CALL wrk_dealloc( jpi , jpj , icof )
  287. !
  288. END SUBROUTINE ldf_dyn_c2d_orca
  289. SUBROUTINE ldf_dyn_c2d_orca_R1( ld_print )
  290. !!----------------------------------------------------------------------
  291. !! *** ROUTINE ldf_dyn_c2d ***
  292. !!
  293. !! **** W A R N I N G ****
  294. !!
  295. !! ORCA R1 configuration
  296. !!
  297. !! **** W A R N I N G ****
  298. !!
  299. !! ** Purpose : initializations of the lateral viscosity for orca R1
  300. !!
  301. !! ** Method : blah blah blah...
  302. !!
  303. !!----------------------------------------------------------------------
  304. USE ldftra_oce, ONLY: aht0
  305. USE iom
  306. !
  307. LOGICAL, INTENT (in) :: ld_print ! If true, output arrays on numout
  308. !
  309. INTEGER :: ji, jj, jn ! dummy loop indices
  310. INTEGER :: inum ! temporary logical unit
  311. INTEGER :: iim, ijm
  312. INTEGER :: ifreq, il1, il2, ij, ii
  313. INTEGER :: ijpt0,ijpt1, ierror
  314. REAL(wp) :: zahmeq, zcoft, zcoff, zmsk, zam20s
  315. CHARACTER (len=15) :: clexp
  316. INTEGER, POINTER, DIMENSION(:,:) :: icof
  317. REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d ! temporary array to read ahmcoef file
  318. !!----------------------------------------------------------------------
  319. !
  320. CALL wrk_alloc( jpi , jpj , icof )
  321. !
  322. IF(lwp) WRITE(numout,*)
  323. IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
  324. IF(lwp) WRITE(numout,*) '~~~~~~ --'
  325. IF(lwp) WRITE(numout,*) ' orca_r1 configuration'
  326. IF( cp_cfg == "orca" .AND. cp_cfz == "antarctic" ) THEN
  327. !
  328. ! 1.2 Modify ahm
  329. ! --------------
  330. IF(lwp)WRITE(numout,*) ' inildf: Antarctic ocean'
  331. IF(lwp)WRITE(numout,*) ' no tropics, no reduction of ahm'
  332. IF(lwp)WRITE(numout,*) ' north boundary increase'
  333. ahm1(:,:) = ahm0
  334. ahm2(:,:) = ahm0
  335. ijpt0=max(1,min(49 -njmpp+1,jpj))
  336. ijpt1=max(0,min(49-njmpp+1,jpj-1))
  337. DO jj=ijpt0,ijpt1
  338. ahm2(:,jj)=ahm0*2.
  339. ahm1(:,jj)=ahm0*2.
  340. END DO
  341. ijpt0=max(1,min(48 -njmpp+1,jpj))
  342. ijpt1=max(0,min(48-njmpp+1,jpj-1))
  343. DO jj=ijpt0,ijpt1
  344. ahm2(:,jj)=ahm0*1.9
  345. ahm1(:,jj)=ahm0*1.75
  346. END DO
  347. ijpt0=max(1,min(47 -njmpp+1,jpj))
  348. ijpt1=max(0,min(47-njmpp+1,jpj-1))
  349. DO jj=ijpt0,ijpt1
  350. ahm2(:,jj)=ahm0*1.5
  351. ahm1(:,jj)=ahm0*1.25
  352. END DO
  353. ijpt0=max(1,min(46 -njmpp+1,jpj))
  354. ijpt1=max(0,min(46-njmpp+1,jpj-1))
  355. DO jj=ijpt0,ijpt1
  356. ahm2(:,jj)=ahm0*1.1
  357. END DO
  358. ELSE IF( cp_cfg == "orca" .AND. cp_cfz == "arctic" ) THEN
  359. ! 1.2 Modify ahm
  360. ! --------------
  361. IF(lwp)WRITE(numout,*) ' inildf: Arctic ocean'
  362. IF(lwp)WRITE(numout,*) ' no tropics, no reduction of ahm'
  363. IF(lwp)WRITE(numout,*) ' south and west boundary increase'
  364. ahm1(:,:) = ahm0
  365. ahm2(:,:) = ahm0
  366. ijpt0=max(1,min(98-jpjzoom+1-njmpp+1,jpj))
  367. ijpt1=max(0,min(98-jpjzoom+1-njmpp+1,jpj-1))
  368. DO jj=ijpt0,ijpt1
  369. ahm2(:,jj)=ahm0*2.
  370. ahm1(:,jj)=ahm0*2.
  371. END DO
  372. ijpt0=max(1,min(99-jpjzoom+1-njmpp+1,jpj))
  373. ijpt1=max(0,min(99-jpjzoom+1-njmpp+1,jpj-1))
  374. DO jj=ijpt0,ijpt1
  375. ahm2(:,jj)=ahm0*1.9
  376. ahm1(:,jj)=ahm0*1.75
  377. END DO
  378. ijpt0=max(1,min(100-jpjzoom+1-njmpp+1,jpj))
  379. ijpt1=max(0,min(100-jpjzoom+1-njmpp+1,jpj-1))
  380. DO jj=ijpt0,ijpt1
  381. ahm2(:,jj)=ahm0*1.5
  382. ahm1(:,jj)=ahm0*1.25
  383. END DO
  384. ijpt0=max(1,min(101-jpjzoom+1-njmpp+1,jpj))
  385. ijpt1=max(0,min(101-jpjzoom+1-njmpp+1,jpj-1))
  386. DO jj=ijpt0,ijpt1
  387. ahm2(:,jj)=ahm0*1.1
  388. END DO
  389. ELSE
  390. ! Read 2d integer array to specify western boundary increase in the
  391. ! ===================== equatorial strip (20N-20S) defined at t-points
  392. ALLOCATE( ztemp2d(jpi,jpj) )
  393. ztemp2d(:,:) = 0.
  394. CALL iom_open ( 'ahmcoef.nc', inum )
  395. CALL iom_get ( inum, jpdom_data, 'icof', ztemp2d)
  396. icof(:,:) = NINT(ztemp2d(:,:))
  397. CALL iom_close( inum )
  398. DEALLOCATE(ztemp2d)
  399. ! Set ahm1 and ahm2 ( T- and F- points) (used for laplacian operator)
  400. ! =================
  401. ! define ahm1 and ahm2 at the right grid point position
  402. ! (USER: modify ahm1 and ahm2 following your desiderata)
  403. ! Decrease ahm to zahmeq m2/s in the tropics
  404. ! (from 90 to 20 degrees: ahm = scaled by local metrics
  405. ! from 20 to 2.5 degrees: ahm = decrease in (1-cos)/2
  406. ! from 2.5 to 0 degrees: ahm = constant
  407. ! symmetric in the south hemisphere)
  408. zahmeq = aht0
  409. zam20s = ahm0*COS( rad * 20. )
  410. DO jj = 1, jpj
  411. DO ji = 1, jpi
  412. IF( ABS( gphif(ji,jj) ) >= 20. ) THEN
  413. ! leave as set in ldf_dyn_c2d
  414. ELSEIF( ABS( gphif(ji,jj) ) <= 2.5 ) THEN
  415. ahm2(ji,jj) = zahmeq
  416. ELSE
  417. ahm2(ji,jj) = zahmeq + (zam20s-zahmeq)/2. &
  418. * ( 1. - COS( rad * ( ABS(gphif(ji,jj))-2.5 ) * 180. / 17.5 ) )
  419. ENDIF
  420. IF( ABS( gphit(ji,jj) ) >= 20. ) THEN
  421. ! leave as set in ldf_dyn_c2d
  422. ELSEIF( ABS( gphit(ji,jj) ) <= 2.5 ) THEN
  423. ahm1(ji,jj) = zahmeq
  424. ELSE
  425. ahm1(ji,jj) = zahmeq + (zam20s-zahmeq)/2. &
  426. * ( 1. - COS( rad * ( ABS(gphit(ji,jj))-2.5 ) * 180. / 17.5 ) )
  427. ENDIF
  428. END DO
  429. END DO
  430. ! increase along western boundaries of equatorial strip
  431. ! t-point
  432. DO jj = 1, jpjm1
  433. DO ji = 1, jpim1
  434. IF( ABS( gphit(ji,jj) ) < 20. ) THEN
  435. zcoft = FLOAT( icof(ji,jj) ) / 100.
  436. ahm1(ji,jj) = zcoft * ahm0 + (1.-zcoft) * ahm1(ji,jj)
  437. ENDIF
  438. END DO
  439. END DO
  440. ! f-point
  441. icof(:,:) = icof(:,:) * tmask(:,:,1)
  442. DO jj = 1, jpjm1
  443. DO ji = 1, jpim1
  444. IF( ABS( gphif(ji,jj) ) < 20. ) THEN
  445. zmsk = tmask(ji,jj+1,1) + tmask(ji+1,jj+1,1) + tmask(ji,jj,1) + tmask(ji,jj+1,1)
  446. IF( zmsk == 0. ) THEN
  447. zcoff = 1.
  448. ELSE
  449. zcoff = FLOAT( icof(ji,jj+1) + icof(ji+1,jj+1) + icof(ji,jj) + icof(ji,jj+1) ) &
  450. / (zmsk * 100.)
  451. ENDIF
  452. ahm2(ji,jj) = zcoff * ahm0 + (1.-zcoff) * ahm2(ji,jj)
  453. ENDIF
  454. END DO
  455. END DO
  456. ENDIF
  457. ! Lateral boundary conditions on ( ahm1, ahm2 )
  458. ! ==============
  459. CALL lbc_lnk( ahm1, 'T', 1. ) ! T-point, unchanged sign
  460. CALL lbc_lnk( ahm2, 'F', 1. ) ! F-point, unchanged sign
  461. ! Control print
  462. IF( lwp .AND. ld_print ) THEN
  463. WRITE(numout,*)
  464. WRITE(numout,*) 'inildf: 2D ahm1 array'
  465. CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  466. WRITE(numout,*)
  467. WRITE(numout,*) 'inildf: 2D ahm2 array'
  468. CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
  469. ENDIF
  470. !
  471. CALL wrk_dealloc( jpi , jpj , icof )
  472. !
  473. END SUBROUTINE ldf_dyn_c2d_orca_R1