New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
cyclone.F90 in branches/UKMO/r5936_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/UKMO/r5936_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90 @ 7106

Last change on this file since 7106 was 7106, checked in by jcastill, 7 years ago

Remove svn keywords

  • Property svn:keywords set to Id
File size: 14.3 KB
Line 
1MODULE cyclone
2   !!======================================================================
3   !!                       ***  MODULE  cyclone  ***
4   !! add the Tropical Cyclones along tracks to the surface wind forcing
5   !!                 
6   !!======================================================================
7   !! History : 3.3  ! 2010-05  (E Vincent, G Madec, S Masson)  Original code
8   !!----------------------------------------------------------------------
9
10#if defined key_cyclone
11   !!----------------------------------------------------------------------
12   !!  'key_cyclone' : key option add Tropical Cyclones in the wind forcing
13   !!----------------------------------------------------------------------
14   !!   wnd_cyc      : 1 module subroutine
15   !!----------------------------------------------------------------------
16   USE oce             ! ocean dynamics and active tracers
17   USE sbc_oce         ! surface boundary condition: ocean
18   USE dom_oce         ! ocean space domain variables
19   USE phycst          ! physical constant
20   USE fldread         ! read input fields
21   USE in_out_manager  ! I/O manager
22   USE geo2ocean       ! tools for projection on ORCA grid
23   USE wrk_nemo        ! work arrays
24   USE lib_mpp       
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   wnd_cyc   ! routine called in sbcblk_core.F90 module
30
31   INTEGER , PARAMETER ::   jp_is1  = 1   ! index of presence 1 or absence 0 of a TC record
32   INTEGER , PARAMETER ::   jp_lon  = 2   ! index of longitude for present TCs
33   INTEGER , PARAMETER ::   jp_lat  = 3   ! index of latitude  for present TCs
34   INTEGER , PARAMETER ::   jp_vmax = 4   ! index of max wind  for present TCs
35   INTEGER , PARAMETER ::   jp_pres = 5   ! index of eye-pres  for present TCs
36
37   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
38
39   !! * Substitutions
40#  include "vectopt_loop_substitute.h90"
41   !!----------------------------------------------------------------------
42   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)
43   !! $Id$
44   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
45   !!----------------------------------------------------------------------
46
47CONTAINS
48
49   SUBROUTINE wnd_cyc( kt, pwnd_i, pwnd_j )
50      !!----------------------------------------------------------------------
51      !!                    ***  ROUTINE wnd_cyc  ***
52      !!
53      !! ** Purpose :  Add cyclone winds on the ORCA grid
54      !!
55      !! ** Action  : - open TC data, find TCs for the current timestep
56      !!              - for each potential TC, add the winds on the grid
57      !!----------------------------------------------------------------------
58      INTEGER , INTENT(in)                      ::   kt       ! time step index
59      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   pwnd_i   ! wind speed i-components at T-point ORCA direction
60      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   pwnd_j   ! wind speed j-components at T-point ORCA direction
61      !
62      !!
63      INTEGER  ::   ji, jj , jtc        ! loop arguments
64      INTEGER  ::   ierror              ! loop arguments
65      INTEGER  ::   vortex=1            ! vortex shape to be used: 0=Holland 1=Willoughby
66      REAL(wp) ::   zrout1=1.5e6        ! distance from center where we begin to kill vortex (m)
67      REAL(wp) ::   zrout2=2.5e6        ! distance from center where we bring vortex to zero (m)
68      REAL(wp) ::   zb                  ! power in Holland vortex shape
69      REAL(wp) ::   zA                  ! shape parameter in Willoughby vortex : A transtion between first and second outter exp
70      REAL(wp) ::   zn                  ! shape parameter in Willoughby vortex : n power law in the eye
71      REAL(wp) ::   zXX1                ! shape parameter in Willoughby vortex : decay length second outter exponential
72      REAL(wp) ::   zXX2                ! shape parameter in Willoughby vortex : decay length first  outter exponential
73      REAL(wp) ::   zztmp               ! temporary
74      REAL(wp) ::   zzrglam, zzrgphi    ! temporary
75      REAL(wp) ::   ztheta              ! azimuthal angle
76      REAL(wp) ::   zdist               ! dist to the TC center
77      REAL(wp) ::   zhemi               ! 1 for NH ;  -1 for SH
78      REAL(wp) ::   zinfl               ! clim inflow angle in TCs
79      REAL(wp) ::   zrmw                ! mean radius of Max wind of a tropical cyclone (Willoughby 2004) [m]
80      REAL(wp) ::   zwnd_r, zwnd_t      ! radial and tangential components of the wind
81      REAL(wp) ::   zvmax               ! timestep interpolated vmax
82      REAL(wp) ::   zrlon, zrlat        ! temporary
83      REAL(wp), DIMENSION(:,:), POINTER ::   zwnd_x, zwnd_y   ! zonal and meridional components of the wind
84      REAL(wp), DIMENSION(14,5)    ::   ztct                ! tropical cyclone track data at kt
85      !
86      CHARACTER(len=100) ::  cn_dir            ! Root directory for location of files
87      TYPE(FLD_N), DIMENSION(1) ::   slf_i     ! array of namelist informations on the TC position
88      TYPE(FLD_N) ::   sn_tc                   ! informations about the fields to be read
89      !!--------------------------------------------------------------------
90
91      CALL wrk_alloc( jpi,jpj, zwnd_x, zwnd_y )
92
93      !                                         ! ====================== !
94      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
95         !                                      ! ====================== !
96         ! set file information (default values)
97         cn_dir = './'       ! directory in which the model is executed
98         !
99         ! (NB: frequency positive => hours, negative => months)
100         !          !    file     ! frequency !  variable ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   ! land/sea mask !
101         !          !    name     !  (hours)  !   name    !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      ! filename      !
102         sn_tc = FLD_N( 'tc_track',     6     ,  'tc'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         , ''            )
103         !
104         !  Namelist is read in namsbc_core
105         ! set sf structure
106         ALLOCATE( sf(1), STAT=ierror )
107         IF( ierror > 0 ) THEN
108            CALL ctl_stop( 'wnd_cyc: unable to allocate sf structure' )   ;   RETURN
109         ENDIF
110         ALLOCATE( sf(1)%fnow(14,5,1) )
111         ALLOCATE( sf(1)%fdta(14,5,1,2) )
112         slf_i(1) = sn_tc
113         !
114         ! fill sf with slf_i and control print
115         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_tc', 'tropical cyclone track', 'namsbc_tc' )
116         !
117      ENDIF
118
119
120      !       Interpolation of lon lat vmax... at the current timestep
121      !       ***************************************************************
122
123      CALL fld_read( kt, nn_fsbc, sf )                   ! input fields provided at the current time-step
124
125      ztct(:,:) = sf(1)%fnow(:,:,1)
126
127      !       Add TC wind on the grid
128      !       ***************************************************************
129
130      zwnd_x(:,:) = 0.e0 
131      zwnd_y(:,:) = 0.e0 
132     
133      DO jtc = 1, 14
134         !
135         IF( ztct(jtc,jp_is1) == 1 ) THEN                ! cyclone is defined in this slot ? yes--> begin
136
137            zvmax =       ztct(jtc,jp_vmax)
138            zrlon = rad * ztct(jtc,jp_lon )
139            zrlat = rad * ztct(jtc,jp_lat )
140            zhemi = SIGN( 1. , zrlat )
141            zinfl = 15.* rad                             ! clim inflow angle in Tropical Cyclones
142         IF ( vortex == 0 ) THEN
143
144            ! Vortex Holland reconstruct wind at each lon-lat position
145            ! ********************************************************
146            zrmw = 51.6 * EXP( -0.0223*zvmax + 0.0281* ABS( ztct(jtc,jp_lat) ) ) * 1000.
147            ! climatological ZRMW of cyclones as a function of wind and latitude (Willoughby 2004)             
148            ! zb = 1.0036 + 0.0173 * zvmax - 0.0313 * LOG(zrmw/1000.) + 0.0087 * ABS( ztct(jtc,jp_lat) )
149            ! fitted B parameter (Willoughby 2004)
150            zb = 2.
151
152            DO jj = 1, jpj
153               DO ji = 1, jpi
154
155                  ! calc distance between TC center and any point following great circle
156                  ! source : http://www.movable-type.co.uk/scripts/latlong.html
157                  zzrglam = rad * glamt(ji,jj) - zrlon
158                  zzrgphi = rad * gphit(ji,jj)
159                  zdist = ra * ACOS(  SIN( zrlat ) * SIN( zzrgphi )   &
160                     &              + COS( zrlat ) * COS( zzrgphi ) * COS( zzrglam ) )
161
162                 IF (zdist < zrout2) THEN ! calculation of wind only to a given max radius
163                  ! shape of the wind profile
164                  zztmp = ( zrmw / ( zdist + 1.e-12 ) )**zb
165                  zztmp =  zvmax * SQRT( zztmp * EXP(1. - zztmp) )   
166
167                  IF (zdist > zrout1) THEN ! bring to zero between r_out1 and r_out2
168                     zztmp = zztmp * ( (zrout2-zdist)*1.e-6 )
169                  ENDIF
170
171                  ! !!! KILL EQ WINDS
172                  ! IF (SIGN( 1. , zrlat ) /= zhemi) THEN
173                  !    zztmp = 0.                              ! winds in other hemisphere
174                  !    IF (ABS(gphit(ji,jj)) <= 5.) zztmp=0.   ! kill between 5N-5S
175                  ! ENDIF
176                  ! IF (ABS(gphit(ji,jj)) <= 10. .and. ABS(gphit(ji,jj)) > 5.) THEN
177                  !    zztmp = zztmp * ( 1./5. * (ABS(gphit(ji,jj)) - 5.) )
178                  !    !linear to zero between 10 and 5
179                  ! ENDIF
180                  ! !!! / KILL EQ
181
182                  IF (ABS(gphit(ji,jj)) >= 55.) zztmp = 0. ! kill weak spurious winds at high latitude
183
184                  zwnd_t =   COS( zinfl ) * zztmp   
185                  zwnd_r = - SIN( zinfl ) * zztmp
186
187                  ! Project radial-tangential components on zonal-meridional components
188                  ! -------------------------------------------------------------------
189                 
190                  ! ztheta = azimuthal angle of the great circle between two points
191                  zztmp = COS( zrlat ) * SIN( zzrgphi ) &
192                     &  - SIN( zrlat ) * COS( zzrgphi ) * COS( zzrglam )
193                  ztheta = ATAN2(        COS( zzrgphi ) * SIN( zzrglam ) , zztmp )
194
195                  zwnd_x(ji,jj) = zwnd_x(ji,jj) - zhemi * COS(ztheta)*zwnd_t + SIN(ztheta)*zwnd_r
196                  zwnd_y(ji,jj) = zwnd_y(ji,jj) + zhemi * SIN(ztheta)*zwnd_t + COS(ztheta)*zwnd_r
197                 ENDIF
198               END DO
199            END DO
200         
201         ELSE IF ( vortex == 1 ) THEN
202
203            ! Vortex Willoughby reconstruct wind at each lon-lat position
204            ! ***********************************************************
205            zrmw = 46.4 * EXP( -0.0155*zvmax + 0.0169* ABS( ztct(jtc,jp_lat) ) )*1000.
206            ! climatological ZRMW of cyclones as a function of wind and latitude (Willoughby 2006)
207            zXX2 = 25.*1000.                                              ! 25km fixed "near-eye" exponential decay
208            zXX1 = ( 287.6  - 1.942 *zvmax + 7.799 *LOG(zrmw/1000.) + 1.819 *ABS( ztct(jtc,jp_lat) ) )*1000.   
209            zn   =   2.1340 + 0.0077*zvmax - 0.4522*LOG(zrmw/1000.) - 0.0038*ABS( ztct(jtc,jp_lat) )           
210            zA   =   0.5913 + 0.0029*zvmax - 0.1361*LOG(zrmw/1000.) - 0.0042*ABS( ztct(jtc,jp_lat) ) 
211            IF (zA < 0) THEN
212               zA=0
213            ENDIF           
214       
215            DO jj = 1, jpj
216               DO ji = 1, jpi
217                                 
218                  zzrglam = rad * glamt(ji,jj) - zrlon
219                  zzrgphi = rad * gphit(ji,jj)
220                  zdist = ra * ACOS(  SIN( zrlat ) * SIN( zzrgphi )   &
221                     &              + COS( zrlat ) * COS( zzrgphi ) * COS( zzrglam ) )
222
223                 IF (zdist < zrout2) THEN ! calculation of wind only to a given max radius
224               
225                  ! shape of the wind profile                     
226                  IF (zdist <= zrmw) THEN     ! inside the Radius of Maximum Wind
227                     zztmp  = zvmax * (zdist/zrmw)**zn
228                  ELSE
229                     zztmp  = zvmax * ( (1-zA) * EXP(- (zdist-zrmw)/zXX1 ) + zA * EXP(- (zdist-zrmw)/zXX2 ) )
230                  ENDIF
231
232                  IF (zdist > zrout1) THEN ! bring to zero between r_out1 and r_out2
233                     zztmp = zztmp * ( (zrout2-zdist)*1.e-6 )
234                  ENDIF
235
236                  ! !!! KILL EQ WINDS
237                  ! IF (SIGN( 1. , zrlat ) /= zhemi) THEN
238                  !    zztmp = 0.                              ! winds in other hemisphere
239                  !    IF (ABS(gphit(ji,jj)) <= 5.) zztmp=0.   ! kill between 5N-5S
240                  ! ENDIF
241                  ! IF (ABS(gphit(ji,jj)) <= 10. .and. ABS(gphit(ji,jj)) > 5.) THEN
242                  !    zztmp = zztmp * ( 1./5. * (ABS(gphit(ji,jj)) - 5.) )
243                  !    !linear to zero between 10 and 5
244                  ! ENDIF
245                  ! !!! / KILL EQ
246
247                  IF (ABS(gphit(ji,jj)) >= 55.) zztmp = 0. ! kill weak spurious winds at high latitude
248
249                  zwnd_t =   COS( zinfl ) * zztmp   
250                  zwnd_r = - SIN( zinfl ) * zztmp
251
252                  ! Project radial-tangential components on zonal-meridional components
253                  ! -------------------------------------------------------------------
254                 
255                  ! ztheta = azimuthal angle of the great circle between two points
256                  zztmp = COS( zrlat ) * SIN( zzrgphi ) &
257                     &  - SIN( zrlat ) * COS( zzrgphi ) * COS( zzrglam )
258                  ztheta = ATAN2(        COS( zzrgphi ) * SIN( zzrglam ) , zztmp )
259
260                  zwnd_x(ji,jj) = zwnd_x(ji,jj) - zhemi * COS(ztheta)*zwnd_t + SIN(ztheta)*zwnd_r
261                  zwnd_y(ji,jj) = zwnd_y(ji,jj) + zhemi * SIN(ztheta)*zwnd_t + COS(ztheta)*zwnd_r
262                 
263                 ENDIF
264               END DO
265            END DO
266         ENDIF                                         ! / vortex Holland or Wiloughby
267         ENDIF                                           ! / cyclone is defined in this slot ? yes--> begin
268      END DO ! / end simultaneous cyclones loop
269
270      CALL rot_rep ( zwnd_x, zwnd_y, 'T', 'en->i', pwnd_i ) !rotation of components on ORCA grid
271      CALL rot_rep ( zwnd_x, zwnd_y, 'T', 'en->j', pwnd_j ) !rotation of components on ORCA grid
272
273      CALL wrk_dealloc( jpi,jpj, zwnd_x, zwnd_y )
274
275   END SUBROUTINE wnd_cyc
276
277#endif
278
279   !!======================================================================
280END MODULE cyclone
Note: See TracBrowser for help on using the repository browser.