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

source: trunk/NEMO/OPA_SRC/SBC/tau_forced_daily.h90 @ 389

Last change on this file since 389 was 389, checked in by opalod, 18 years ago

RB:nemo_v1_update_038: first integration of Agrif :

  • configuration parameters are just integer when agrif is used
  • add call to agrif routines with key_agrif
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1   !!----------------------------------------------------------------------
2   !!                   ***  tau_forced_daily.h90  ***
3   !!----------------------------------------------------------------------
4
5   !!----------------------------------------------------------------------
6   !!   tau     :   update the surface stress - daily fields in NetCDF file
7   !!----------------------------------------------------------------------
8   !! * local modules variables
9   INTEGER ::   &
10      numtau,         &  ! logical unit for the i-component of the wind data
11      numtav,         &  ! logical unit for the j-component of the wind data
12      ntau1, ntau2 ,  &  ! index of the first and second record used
13      ndaytau            ! new day for ers/ncep tau forcing
14
15   CHARACTER (len=34) ::   &      !!! * monthly climatology/interanual fields
16      cl_taux ,  & ! generic name of the i-component monthly NetCDF file
17      cl_tauy      ! generic name of the j-component monthly NetCDF file
18   !!----------------------------------------------------------------------
19   !!   OPA 9.0 , LOCEAN-IPSL (2005)
20   !! $Header$
21   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
22   !!----------------------------------------------------------------------
23
24CONTAINS
25
26   SUBROUTINE tau( kt )
27      !!---------------------------------------------------------------------
28      !!                    ***  ROUTINE tau  ***
29      !!     
30      !! ** Purpose :   provide to the ocean the stress at each time step
31      !!
32      !! ** Method  :   Read the daily surface stress components in NetCDF
33      !!      file. They are given in the (i,j) referential
34      !!        The i-component is given at U-point (INTERP package)
35      !!        The j-component is given at V-point (INTERP package)
36      !!
37      !!    CAUTION: never mask the surface stress field !
38      !!
39      !! ** Action  :   update at each time-step the two components of the
40      !!      surface stress in both (i,j) and geographical referencial
41      !!
42      !! History :
43      !!   4.0  !  91-03  (G. Madec)  Original code
44      !!   6.0  !  92-07  (M. Imbard)
45      !!   8.1  !  00-08  (D. Ludicone) adapted to ERS-NCEP
46      !!   8.5  !  02-11  (G. Madec)  F90: Free form and module
47      !!        !  03-07  (C. Ethe, G. Madec)  daily generic forcing
48      !!----------------------------------------------------------------------
49      !! * Modules used
50      USE ioipsl       ! NetCDF library
51
52      !! * Arguments
53      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
54
55      !! * Local declarations
56      INTEGER, PARAMETER ::   jpday = 365
57      INTEGER ::   &
58         itime,   &
59         iday, idy,   &
60         ipi, ipj, ipk
61      INTEGER  , DIMENSION(jpday)  ::   istep
62      REAL(wp) , DIMENSION(jpi,jpj)::  &
63         zlon  , &
64         zlat
65      REAL(wp) , DIMENSION(jpk)::  &
66         zlev
67      REAL(wp) ::   zsecond, zdate0
68      !!---------------------------------------------------------------------
69      cl_taux = 'taux.nc'
70      cl_tauy = 'tauy.nc'
71
72      ! -------------- !
73      ! Initialization !
74      ! -------------- !
75
76      itime = jpday
77      ipi   = jpiglo
78      ipj   = jpjglo
79      ipk   = jpk
80      idy   = 365
81      IF ( nleapy == 1 ) idy = 366
82
83
84      ! -------------------- !
85      ! First call kt=nit000 !
86      ! -------------------- !
87
88      IF( kt == nit000 ) THEN
89         IF(lwp) THEN
90            WRITE(numout,*) ' '
91            WRITE(numout,*) ' tau    : DAILY wind stress in NetCDF files'
92            WRITE(numout,*) ' ~~~~~~~'
93         ENDIF
94         ! title, dimensions and tests
95#if defined key_AGRIF
96      if ( .NOT. Agrif_Root() ) then
97         cl_taux = TRIM(Agrif_CFixed())//'_'//TRIM(cl_taux)
98      endif
99#endif
100         
101         CALL flinopen( cl_taux, mig(1), nlci, mjg(1), nlcj,   &   ! taux on U-grid
102                        .FALSE., ipi   , ipj, ipk   ,        &
103                        zlon , zlat  , zlev   , itime,       &
104                        istep, zdate0, zsecond, numtau )
105         
106         IF( itime /= jpday .AND. itime /= jpday+1 ) THEN
107            IF(lwp) WRITE(numout,cform_err)
108            IF(lwp) WRITE(numout,*) '   problem with time coordinates in file ', cl_taux
109            IF(lwp) WRITE(numout,*) '   itime = ', itime,' jpday = ',jpday
110            nstop = nstop + 1
111         ENDIF
112         IF( ipi /= jpidta .OR. ipj /= jpjdta  ) THEN
113            IF(lwp) WRITE(numout,cform_err)
114            IF(lwp) WRITE(numout,*) '   problem with size read in file ', cl_taux
115            IF(lwp) WRITE(numout,*) '   ipi = ',ipi,' jpidta = ',jpidta
116            IF(lwp) WRITE(numout,*) '   ipj = ',ipj,' jpjdta = ',jpjdta
117            nstop = nstop + 1
118         ENDIF
119#if defined key_AGRIF
120      if ( .NOT. Agrif_Root() ) then
121         cl_tauy = TRIM(Agrif_CFixed())//'_'//TRIM(cl_tauy)
122      endif
123#endif
124
125         CALL flinopen( cl_tauy, mig(1), nlci, mjg(1), nlcj,   &   ! tauy on V-grid
126                        .FALSE., ipi   , ipj, ipk   ,        &
127                        zlon , zlat  , zlev   , itime,       &
128                        istep, zdate0, zsecond, numtav )
129         
130         IF( itime /= jpday .AND. itime /= jpday+1 ) THEN
131            IF(lwp) WRITE(numout,cform_err)
132            IF(lwp) WRITE(numout,*) '   problem with time coordinates in file ', cl_tauy
133            IF(lwp) WRITE(numout,*) '   itime = ', itime,' jpday = ',jpday
134            nstop = nstop + 1
135         ENDIF
136         IF( ipi /= jpidta .OR. ipj /= jpjdta ) THEN
137            IF(lwp) WRITE(numout,cform_err)
138            IF(lwp) WRITE(numout,*) '   problem with size read in file ', cl_tauy
139            IF(lwp) WRITE(numout,*) '   ipi = ',ipi,' jpidta = ',jpidta
140            IF(lwp) WRITE(numout,*) '   ipj = ',ipj,' jpjdta = ',jpjdta
141            nstop = nstop + 1
142         ENDIF
143      ENDIF
144
145      ! ----------------- !
146      ! Read daily file   !
147      ! ----------------- !
148
149      IF ( ndaytau /= nday ) THEN
150           
151         ndaytau = nday
152         iday  = nday_year
153           
154         ! Read daily wind stress data
155         CALL flinget( numtau,'taux',                 &   ! taux: i-component at U-pt
156                       jpidta,jpjdta,1,jpday,iday,    &
157                       iday,mig(1),nlci,mjg(1),nlcj,taux(1:nlci,1:nlcj) )
158         CALL flinget( numtav,'tauy',                 &   ! tauy: j-component at V-pt
159                       jpidta,jpjdta,1,jpday,iday,    &
160                       iday,mig(1),nlci,mjg(1),nlcj,tauy(1:nlci,1:nlcj) )
161           
162         IF (lwp .AND. nitend-nit000 <= 100 ) THEN
163            WRITE(numout,*)
164            WRITE(numout,*) ' read daily wind stress ok'
165            WRITE(numout,*)
166            WRITE(numout,*) ' day: ', ndastp , '  taux: 1 multiply by ', 1.
167            CALL prihre( taux, jpi, jpj, 1, jpi, 20, 1, jpj, 10, 1., numout )
168            WRITE(numout,*)
169            WRITE(numout,*) ' day: ', ndastp , '  tauy: 1 multiply by ', 1.
170            CALL prihre( tauy, jpi, jpj, 1, jpi, 20, 1, jpj, 10, 1., numout )
171            WRITE(numout,*) ' '
172         ENDIF
173           
174         CALL FLUSH(numout)
175      ENDIF
176         
177      ! Save components in geographical ref on U grid
178      tauxg(:,:) = taux(:,:)
179      tauyg(:,:) = tauy(:,:)
180         
181      ! ------------------- !
182      ! Last call kt=nitend !
183      ! ------------------- !
184
185      ! Closing of the 2 files
186      IF( kt == nitend ) THEN
187          CALL flinclo( numtau )
188          CALL flinclo( numtav )
189      ENDIF
190         
191   END SUBROUTINE tau
Note: See TracBrowser for help on using the repository browser.