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/2017/dev_r7881_no_wrk_alloc/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/2017/dev_r7881_no_wrk_alloc/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90 @ 7910

Last change on this file since 7910 was 7910, checked in by timgraham, 7 years ago

All wrk_alloc removed

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