1 | !!---------------------------------------------------------------------- |
---|
2 | !! *** flx_bulk_daily *** |
---|
3 | !!---------------------------------------------------------------------- |
---|
4 | |
---|
5 | !!---------------------------------------------------------------------- |
---|
6 | !! bulk : reading |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! * Modules used C A U T I O N already defined in flxmod.F90 |
---|
9 | |
---|
10 | !! * Module variables |
---|
11 | |
---|
12 | INTEGER :: & |
---|
13 | ji, jj, & ! loop indices |
---|
14 | numfl1, numfl2, & ! logical units for surface fluxes data |
---|
15 | numfl3, numfl4, & ! |
---|
16 | nflx1 , nflx2 , & ! first and second record used |
---|
17 | ndayflx |
---|
18 | |
---|
19 | REAL(wp), DIMENSION(jpi,jpj,2,3) :: & |
---|
20 | flxdta ! 2 consecutive set of CLIO/CMAP monthly fluxes |
---|
21 | !!---------------------------------------------------------------------- |
---|
22 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
23 | !! $Header$ |
---|
24 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
25 | !!---------------------------------------------------------------------- |
---|
26 | |
---|
27 | CONTAINS |
---|
28 | |
---|
29 | SUBROUTINE flx( kt ) |
---|
30 | !!--------------------------------------------------------------------- |
---|
31 | !! *** ROUTINE flx *** |
---|
32 | !! |
---|
33 | !! ** Purpose : provide the thermohaline fluxes (heat and freshwater) |
---|
34 | !! to the ocean at each time step. |
---|
35 | !! |
---|
36 | !! ** Method : |
---|
37 | !! ORCA FORCED VERSION WITH : |
---|
38 | !! Daily climatological NCEP temperature |
---|
39 | !! Daily climatological ERS-NCEP winds |
---|
40 | !! monthly climatological humidity and clouds |
---|
41 | !! monthly climatological CMAP precipitation |
---|
42 | !! Read several AGCM daily and monthly fluxes file |
---|
43 | !! temperature at 2m tatm (K) |
---|
44 | !! relative humidite hatm (%) |
---|
45 | !! wind speed vatm (m/s) |
---|
46 | !! monthly precip watm (kg/m2/day) from Xie/Arkin |
---|
47 | !! clouds catm (%) |
---|
48 | !! |
---|
49 | !! caution : now, in the opa global model, the net upward water flux is |
---|
50 | !! ------- with mm/day unit. |
---|
51 | !! |
---|
52 | !! History : |
---|
53 | !! ! 91-03 (O. Marti and Ph Dandin) Original code |
---|
54 | !! ! 92-07 (M. Imbard) |
---|
55 | !! ! 96-11 (E. Guilyardi) Daily AGCM input files |
---|
56 | !! ! 99-11 (M. Imbard) NetCDF FORMAT with io-ipsl |
---|
57 | !! ! 00-05 (K. Rodgers) Daily Netcdf |
---|
58 | !! 8.5 ! 02-09 (C. Ethe and G. Madec) F90: Free form and MODULE |
---|
59 | !!---------------------------------------------------------------------- |
---|
60 | !! * modules used |
---|
61 | USE iom ! I/O library |
---|
62 | USE blk_oce ! bulk variable |
---|
63 | USE bulk ! bulk module |
---|
64 | |
---|
65 | !! * arguments |
---|
66 | INTEGER, INTENT( in ) :: kt ! ocean time step |
---|
67 | |
---|
68 | !! * Local declarations |
---|
69 | INTEGER :: iman,imois,i15 |
---|
70 | REAL(wp) :: zxy |
---|
71 | !!--------------------------------------------------------------------- |
---|
72 | |
---|
73 | |
---|
74 | ! Initialization |
---|
75 | ! -------------- |
---|
76 | |
---|
77 | i15 = INT(2*FLOAT(nday)/(FLOAT(nobis(nmonth))+0.5)) |
---|
78 | iman = INT( raamo ) |
---|
79 | imois = nmonth + i15 - 1 |
---|
80 | IF (imois == 0) imois = iman |
---|
81 | |
---|
82 | |
---|
83 | ! 1. first call kt = nit000 |
---|
84 | ! ----------------------- |
---|
85 | |
---|
86 | IF( kt == nit000 ) THEN |
---|
87 | ! initializations |
---|
88 | nflx1 = 0 |
---|
89 | ndayflx = 0 |
---|
90 | IF(lwp) THEN |
---|
91 | WRITE(numout,*) ' ' |
---|
92 | WRITE(numout,*) ' **** Routine flx_bulk_daily.h90' |
---|
93 | WRITE(numout,*) ' ' |
---|
94 | ENDIF |
---|
95 | ! open files |
---|
96 | IF(lwp) WRITE(numout,*) ' **** global NCEP flx daily fields ' |
---|
97 | CALL iom_open ( 'tair_1d.nc', numfl1 ) |
---|
98 | IF(lwp) WRITE(numout,*) ' **** global CLIO flx monthly fields ' |
---|
99 | CALL iom_open ( 'hum_cloud_1m.nc', numfl2 ) |
---|
100 | IF(lwp) WRITE(numout,*) ' **** global XIE flx monthly fields ' |
---|
101 | CALL iom_open ( 'rain_1m.nc', numfl3 ) |
---|
102 | IF(lwp) WRITE(numout,*) ' **** global ERS-NCEP wind daily fields ' |
---|
103 | CALL iom_open ( 'wspd_1d.nc', numfl4 ) |
---|
104 | ENDIF |
---|
105 | |
---|
106 | |
---|
107 | ! 2. Read daily DATA Temperature from NCEP |
---|
108 | ! --------------------------------------- |
---|
109 | |
---|
110 | IF( ndayflx /= nday ) THEN |
---|
111 | |
---|
112 | ndayflx = nday |
---|
113 | |
---|
114 | ! read T 2m (Caution in K) |
---|
115 | CALL iom_get ( numfl1, jpdom_data, 'air', tatm, nday_year ) |
---|
116 | |
---|
117 | IF(lwp) WRITE (numout,*)' Lecture daily flx record OK :',nday_year |
---|
118 | IF(lwp) WRITE (numout,*)' ' |
---|
119 | |
---|
120 | ! conversion of temperature Kelvin --> Celsius [rt0=273.15] |
---|
121 | tatm(:,:) = ( tatm(:,:) - rt0 ) |
---|
122 | |
---|
123 | ! read wind speed |
---|
124 | CALL iom_get ( numfl4, jpdom_data, 'wspd', vatm, nday_year ) |
---|
125 | |
---|
126 | IF(lwp) WRITE (numout,*)' Lecture daily wind speed flx :',nday_year |
---|
127 | IF(lwp) WRITE (numout,*)' ' |
---|
128 | |
---|
129 | ENDIF |
---|
130 | |
---|
131 | |
---|
132 | ! 3. Read monthly data from CLIO and From Xie |
---|
133 | ! ------------------------------------------- |
---|
134 | |
---|
135 | IF( kt == nit000 .OR. imois /= nflx1 ) THEN |
---|
136 | |
---|
137 | ! calendar computation |
---|
138 | |
---|
139 | ! nflx1 number of the first file record used in the simulation |
---|
140 | ! flx2 number of the last file record |
---|
141 | |
---|
142 | nflx1 = imois |
---|
143 | nflx2 = nflx1+1 |
---|
144 | nflx1 = MOD(nflx1,iman) |
---|
145 | IF ( nflx1 == 0 ) nflx1 = iman |
---|
146 | nflx2 = MOD(nflx2,iman) |
---|
147 | IF ( nflx2 == 0 ) nflx2 = iman |
---|
148 | IF(lwp)WRITE(numout,*) 'first record file used nflx1 ',nflx1 |
---|
149 | IF(lwp)WRITE(numout,*) 'last record file used nflx2 ',nflx2 |
---|
150 | |
---|
151 | ! Read monthly fluxes data Esbensen Kushnir |
---|
152 | |
---|
153 | ! humidity |
---|
154 | CALL iom_get ( numfl2, jpdom_data, 'socliohu', flxdta(:,:,1,1), nflx1 ) |
---|
155 | CALL iom_get ( numfl2, jpdom_data, 'socliohu', flxdta(:,:,2,1), nflx2 ) |
---|
156 | |
---|
157 | ! clouds |
---|
158 | CALL iom_get ( numfl2, jpdom_data, 'socliocl', flxdta(:,:,1,2), nflx1 ) |
---|
159 | CALL iom_get ( numfl2, jpdom_data, 'socliocl', flxdta(:,:,2,2), nflx2 ) |
---|
160 | |
---|
161 | ! Read monthly precipitations ds flxdta(:,:,1 ou 2,4) |
---|
162 | |
---|
163 | CALL iom_get ( numfl3, jpdom_data, 'rain', flxdta(:,:,1,3), nflx1 ) |
---|
164 | CALL iom_get ( numfl3, jpdom_data, 'rain', flxdta(:,:,2,3), nflx2 ) |
---|
165 | |
---|
166 | ENDIF |
---|
167 | |
---|
168 | |
---|
169 | ! 3. at every time step linear interpolation of precipitation fluxes |
---|
170 | ! ----------------------------------------------------------- |
---|
171 | |
---|
172 | zxy = FLOAT(nday) / FLOAT(nobis(nflx1)) + 0.5 - i15 |
---|
173 | |
---|
174 | hatm(:,:) = ( (1.-zxy) * flxdta(:,:,1,1) + zxy * flxdta(:,:,2,1) ) |
---|
175 | catm(:,:) = ( (1.-zxy )* flxdta(:,:,1,2) + zxy * flxdta(:,:,2,2) ) |
---|
176 | watm(:,:) = ( (1.-zxy) * flxdta(:,:,1,3) + zxy * flxdta(:,:,2,3) ) |
---|
177 | |
---|
178 | ! 4. Closing all files |
---|
179 | ! -------------------- |
---|
180 | |
---|
181 | IF( kt == nitend ) THEN |
---|
182 | CALL iom_close (numfl1) |
---|
183 | CALL iom_close (numfl2) |
---|
184 | CALL iom_close (numfl3) |
---|
185 | CALL iom_close (numfl4) |
---|
186 | ENDIF |
---|
187 | |
---|
188 | CALL blk(kt) |
---|
189 | |
---|
190 | CALL FLUSH(numout) |
---|
191 | |
---|
192 | END SUBROUTINE flx |
---|
193 | |
---|