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.
taumod.F90 in trunk/NEMO/OPA_SRC/SBC – NEMO

source: trunk/NEMO/OPA_SRC/SBC/taumod.F90 @ 699

Last change on this file since 699 was 699, checked in by smasson, 17 years ago

insert revision Id

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.3 KB
Line 
1MODULE taumod
2   !!======================================================================
3   !!                       ***  MODULE  taumod  ***
4   !! Ocean forcing : stress at the the ocean surface
5   !!=====================================================================
6
7   !!----------------------------------------------------------------------
8   !!   tau          : define the surface stress for the ocean
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE dom_oce         ! ocean space and time domain
12   USE phycst          ! physical constants
13   USE in_out_manager  ! I/O manager
14   USE daymod          ! calendar
15   USE lbclnk          !
16
17#if defined key_oasis3 || defined key_oasis4
18   USE geo2ocean, only : repcmo
19   USE ice, only       : frld       ! : leads fraction = 1-a/totalarea
20#if defined key_oasis3
21   USE cpl_oasis3      ! OASIS3 coupling (to ECHAM5)
22#elif defined key_oasis4
23   USE cpl_oasis4      ! OASIS4 coupling (to ECHAM5)
24#endif
25#endif
26   IMPLICIT NONE
27   PRIVATE
28
29   !! * Routine accessibility
30   PUBLIC tau                ! routine called by step.F90
31
32   !! * Share modules variables
33   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &
34      taux, tauy             !: surface stress components in (i,j) referential
35   !!----------------------------------------------------------------------
36   !!   OPA 9.0 , LOCEAN-IPSL (2005)
37   !! $Id$
38   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
39   !!----------------------------------------------------------------------
40
41#if defined key_tau_monthly
42   ! Monthly climatology in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
43   !!----------------------------------------------------------------------
44   !!   'key_tau_monthly'                        MONTHLY climatology stress
45   !!   default case                                   NetCDF files
46   !!----------------------------------------------------------------------
47#   include "tau_forced_monthly.h90"
48
49# elif defined key_tau_daily
50   !!----------------------------------------------------------------------
51   !!   'key_tau_daily'                                 DAILY stress
52   !!                                                   NetCDF files
53   !!----------------------------------------------------------------------
54   ! Daily climatology/interannual in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
55#   include "tau_forced_daily.h90"
56
57#elif defined key_oasis3  ||  defined key_oasis4
58   ! Coupled case : stress at the coupling frequency
59   !!----------------------------------------------------------------------
60   !!   'key_oasis3' or 'key_oasis4' and           Coupled Ocean/Atmosphere
61   !!   'key_ice_lim'                                   LIM sea-ice
62   !!----------------------------------------------------------------------
63   ! New way: 3D referential link to the earth (avoid north pole pb)
64   ! (3 component stress defined at U- and V-points)
65#  include "tau_oasis_ice.h90"
66#else
67   !!----------------------------------------------------------------------
68   !!   Default option                                     constant forcing
69   !!----------------------------------------------------------------------
70   !! * local modules variables
71   INTEGER  ::       & !!! * Namelist numtau *
72      ntau000 = 1       ! nb of time-step during which the surface stress
73      !                 ! increase from 0 to its nominal value (taudta) (>0)
74   REAL(wp) ::       & !!! * Namelist numtau *
75      tau0x = 0.e0 , &  ! constant wind stress value in i-direction
76      tau0y = 0.e0      ! constant wind stress value in j-direction
77   !!----------------------------------------------------------------------
78
79CONTAINS
80
81   SUBROUTINE tau( kt )
82      !!---------------------------------------------------------------------
83      !!                    ***  ROUTINE tau  ***
84      !!
85      !! ** Purpose :   provide the ocean surface stress at each time step
86      !!
87      !! ** Method  :   Constant surface stress increasing from 0 to taudta
88      !!      value during the first ntau000 time-step (namelist)
89      !!        CAUTION: never mask the surface stress field !
90      !!
91      !! ** Action  : - update taux , tauy the stress in (i,j) ref.
92      !!
93      !! History :
94      !!   4.0  !  91-03  (G. Madec)  Original code
95      !!   8.5  !  02-11  (G. Madec)  F90: Free form and module
96      !!----------------------------------------------------------------------
97      !! * Arguments
98      INTEGER, INTENT( in  ) ::   kt    ! ocean time step
99      REAL(wp) ::   ztau, ztau_sais, &  ! wind intensity and of the seasonal cycle
100         ztime,                      &  ! time in hour
101         ztimemax, ztimemin,         &  ! 21th June, and 21th decem. if date0 = 1st january
102         ztaun                          ! intensity
103      INTEGER  ::   ji, jj              ! dummy loop indices
104
105      INTEGER  ::           &
106         zyear0,            &           ! initial year
107         zmonth0,           &           ! initial month
108         zday0,             &           ! initial day
109         zday_year0                    ! initial day since january 1st
110       
111
112      !! * Local declarations
113      REAL(wp) ::   zfacto              !
114
115      NAMELIST/namtau/ ntau000, tau0x, tau0y
116      !!---------------------------------------------------------------------
117
118      IF( cp_cfg == 'gyre' ) THEN
119
120         zyear0  = ndate0 / 10000                             ! initial year
121         zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100          ! initial month
122         zday0   = ndate0 - zyear0 * 10000 - zmonth0 * 100    ! initial day betwen 1 and 30
123
124         zday_year0 = (zmonth0-1)*30.+zday0                   ! initial day betwen 1 and 360
125
126         ! current day (in hours) since january the 1st of the current year
127          ztime = FLOAT( kt ) * rdt / (rmmss * rhhmm)  &    !  total incrementation (in hours)
128             &     - (nyear  - 1) * rjjhh * raajj           !  minus years since beginning of experiment (in hours)
129
130
131        ! 21th june at 24h in hours
132         ztimemax = ((5.*30.)+21.)* 24.
133         ! 21th december day in hours
134         ! rjjhh * raajj / 4 = 1 seasonal cycle in hours
135         ztimemin = ztimemax + rjjhh * raajj / 2 
136
137         ! mean intensity at 0.105/srqt(2) because projected with 45deg angle
138         ztau = 0.105 / SQRT(2.)           
139         ! seasonal oscillation intensity
140         ztau_sais = 0.015                 
141         ztaun = ztau - ztau_sais * COS( (ztime - ztimemax) / (ztimemin - ztimemax) * rpi )
142         DO jj = 1, jpj
143            DO ji = 1, jpi
144              ! domain from 15deg to 50deg and 1/2 period along 14deg
145              ! so 5/4 of half period with seasonal cycle
146              taux (ji,jj) = - ztaun * SIN( rpi * (gphiu(ji,jj) - 15.) / (29.-15.) )
147              tauy (ji,jj) =   ztaun * SIN( rpi * (gphiv(ji,jj) - 15.) / (29.-15.) )
148            END DO
149         END DO
150   
151         IF( kt == nit000 .AND. lwp ) THEN
152            WRITE(numout,*)' tau    : analytical formulation for gyre'
153            WRITE(numout,*)' ~~~~~~~ '
154            WRITE(numout,*)'          nyear      = ', nyear
155            WRITE(numout,*)'          nmonth     = ', nmonth
156            WRITE(numout,*)'          nday       = ', nday
157            WRITE(numout,*)'          nday_year  = ',nday_year
158            WRITE(numout,*)'          ndastp     = ',ndastp
159            WRITE(numout,*)'          adatrj     = ',adatrj
160            WRITE(numout,*)'          ztime      = ',ztime
161            WRITE(numout,*)'          ztimemax   = ',ztimemax
162            WRITE(numout,*)'          ztimemin   = ',ztimemin
163            WRITE(numout,*)'          zyear0     = ', zyear0
164            WRITE(numout,*)'          zmonth0    = ', zmonth0
165            WRITE(numout,*)'          zday0      = ', zday0
166            WRITE(numout,*)'          zday_year0 = ',zday_year0
167            WRITE(numout,*)'          raajj      = ', raajj
168            WRITE(numout,*)'          ztau       = ', ztau
169            WRITE(numout,*)'          ztau_sais  = ', ztau_sais
170            WRITE(numout,*)'          ztaun      = ', ztaun
171         ENDIF
172   
173      ELSE
174
175         IF( kt == nit000 ) THEN
176   
177            ! Read Namelist namtau : surface wind stress
178            ! --------------------
179            REWIND ( numnam )
180            READ   ( numnam, namtau )
181   
182            IF(lwp) WRITE(numout,*)' '
183            IF(lwp) WRITE(numout,*)' tau     : Constant surface wind stress read in namelist'
184            IF(lwp) WRITE(numout,*)' ~~~~~~~ '
185            IF(lwp) WRITE(numout,*)'           Namelist namtau: set the constant stress values'
186            IF(lwp) WRITE(numout,*)'              spin up of the stress  ntau000 = ', ntau000, ' time-steps'
187            IF(lwp) WRITE(numout,*)'              constant i-stress      tau0x   = ', tau0x  , ' N/m2'
188            IF(lwp) WRITE(numout,*)'              constant j-stress      tau0y   = ', tau0y  , ' N/m2'
189   
190            ntau000 = MAX( ntau000, 1 )   ! must be >= 1
191   
192         ENDIF
193   
194         ! Increase the surface stress to its nominal value in ntau000 time-step
195         
196         IF( kt <= ntau000 ) THEN
197            zfacto = 0.5 * (  1. - COS( rpi * FLOAT( kt ) / FLOAT( ntau000 ) )  )
198            taux (:,:) = zfacto * tau0x
199            tauy (:,:) = zfacto * tau0y
200         ENDIF
201
202      ENDIF
203     
204   END SUBROUTINE tau
205#endif
206   !!======================================================================
207END MODULE taumod
Note: See TracBrowser for help on using the repository browser.