Changeset 996 for LMDZ4/trunk/libf/phylmd/ocean_cpl_mod.F90
- Timestamp:
- Sep 9, 2008, 3:22:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/ocean_cpl_mod.F90
r888 r996 16 16 PRIVATE 17 17 18 PUBLIC :: ocean_cpl_init, ocean_cpl_get_vars, ocean_cpl_noice, ocean_cpl_ice 19 20 REAL, ALLOCATABLE, DIMENSION(:), SAVE :: tmp_flux_o 21 !$OMP THREADPRIVATE(tmp_flux_o) 22 REAL, ALLOCATABLE, DIMENSION(:), SAVE :: tmp_flux_g 23 !$OMP THREADPRIVATE(tmp_flux_g) 18 PUBLIC :: ocean_cpl_init, ocean_cpl_noice, ocean_cpl_ice 24 19 25 20 !**************************************************************************************** … … 43 38 CHARACTER (len = 80) :: abort_message 44 39 CHARACTER (len = 20) :: modname = 'ocean_cpl_init' 45 46 47 ALLOCATE(tmp_flux_o(klon), stat = error)48 IF (error /= 0) THEN49 abort_message='Pb allocation tmp_flux_o'50 CALL abort_gcm(modname,abort_message,1)51 ENDIF52 53 ALLOCATE(tmp_flux_g(klon), stat = error)54 IF (error /= 0) THEN55 abort_message='Pb allocation tmp_flux_g'56 CALL abort_gcm(modname,abort_message,1)57 ENDIF58 40 59 41 ! Initialize module cpl_init … … 71 53 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & 72 54 petAcoef, peqAcoef, petBcoef, peqBcoef, & 73 ps, u1_lay, v1_lay, pctsrf_in,&55 ps, u1_lay, v1_lay, & 74 56 radsol, snow, agesno, & 75 57 qsurf, evap, fluxsens, fluxlat, & 76 tsurf_new, dflux_s, dflux_l , pctsrf_oce)58 tsurf_new, dflux_s, dflux_l) 77 59 ! 78 60 ! This subroutine treats the "open ocean", all grid points that are not entierly covered … … 101 83 REAL, DIMENSION(klon), INTENT(IN) :: ps 102 84 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 103 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf_in104 85 105 86 ! In/Output arguments … … 115 96 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 116 97 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 117 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_oce118 98 119 99 ! Local variables … … 122 102 INTEGER, DIMENSION(1) :: iloc 123 103 REAL, DIMENSION(klon) :: cal, beta, dif_grnd 124 REAL, DIMENSION(klon) :: zx_sl125 104 REAL, DIMENSION(klon) :: fder_new 126 105 REAL, DIMENSION(klon) :: tsurf_cpl … … 134 113 135 114 !**************************************************************************************** 136 ! Receive sea-surface temperature(tsurf_cpl) and new fraction of ocean surface(pctsrf_oce) 137 ! from coupler 138 ! 139 !**************************************************************************************** 140 CALL cpl_receive_ocean_fields(itime, dtime, knon, knindex, pctsrf_in, & 141 tsurf_cpl, pctsrf_oce) 115 ! Receive sea-surface temperature(tsurf_cpl) from coupler 116 ! 117 !**************************************************************************************** 118 CALL cpl_receive_ocean_fields(knon, knindex, tsurf_cpl) 142 119 143 120 !**************************************************************************************** … … 176 153 177 154 !**************************************************************************************** 178 ! Flux ocean-atmosphere useful for "slab" ocean but here calculated only for printing179 ! usage later in physiq180 !181 !****************************************************************************************182 tmp_flux_o(:) = 0.0183 DO i=1, knon184 zx_sl(i) = RLVTT185 IF (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT186 !IM flux_o(i) = fluxsens(i)-evap(i)*zx_sl(i)187 ! flux_o(i) = fluxsens(i) + fluxlat(i)188 IF (pctsrf_oce(knindex(i)) .GT. epsfra) THEN189 tmp_flux_o(knindex(i)) = fluxsens(i) + fluxlat(i)190 ENDIF191 ENDDO192 193 194 !****************************************************************************************195 155 ! Send and cumulate fields to the coupler 196 156 ! … … 213 173 p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, & 214 174 petAcoef, peqAcoef, petBcoef, peqBcoef, & 215 ps, u1_lay, v1_lay, pctsrf _in, &175 ps, u1_lay, v1_lay, pctsrf, & 216 176 radsol, snow, qsurf, & 217 177 alb1_new, alb2_new, evap, fluxsens, fluxlat, & 218 tsurf_new, dflux_s, dflux_l , pctsrf_sic)178 tsurf_new, dflux_s, dflux_l) 219 179 ! 220 180 ! This subroutine treats the ocean where there is ice. The subroutine first receives … … 244 204 REAL, DIMENSION(klon), INTENT(IN) :: ps 245 205 REAL, DIMENSION(klon), INTENT(IN) :: u1_lay, v1_lay 246 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf _in206 REAL, DIMENSION(klon,nbsrf), INTENT(IN) :: pctsrf 247 207 248 208 ! In/output arguments … … 258 218 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 259 219 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l 260 REAL, DIMENSION(klon), INTENT(OUT) :: pctsrf_sic261 220 262 221 ! Local variables … … 277 236 278 237 !**************************************************************************************** 279 ! Receive ocean temperature(tsurf_cpl), albedo(alb_cpl) and new fraction of 280 ! seaice(pctsrf_sic) from coupler 238 ! Receive ocean temperature(tsurf_cpl) and albedo(alb_new) from coupler 281 239 ! 282 240 !**************************************************************************************** 283 241 284 242 CALL cpl_receive_seaice_fields(knon, knindex, & 285 tsurf_cpl, alb_cpl , pctsrf_sic)243 tsurf_cpl, alb_cpl) 286 244 287 245 alb1_new(1:knon) = alb_cpl(1:knon) … … 308 266 CALL calcul_wind_flux(knon, dtime, taux, tauy) 309 267 310 !**************************************************************************************** 311 ! Flux ocean-atmosphere useful for "slab" ocean but here calculated only for printing 312 ! usage later in physiq 313 ! 314 ! IM: faire dependre le coefficient de conduction de la glace de mer 315 ! de l'epaisseur de la glace de mer, dans l'hypothese ou le coeff. 316 ! actuel correspond a 3m de glace de mer, cf. L.Li 317 ! 318 !**************************************************************************************** 319 tmp_flux_g(:) = 0.0 320 DO i = 1, knon 321 IF (cal(i) .GT. 1.0e-15 .AND. pctsrf_sic(knindex(i)) .GT. epsfra) & 322 tmp_flux_g(knindex(i)) = (tsurf_new(i)-t_grnd) * & 323 dif_grnd(i) * RCPD/cal(i) 324 ENDDO 325 268 326 269 !**************************************************************************************** 327 270 ! Calculate fder : flux derivative (sensible and latente) … … 344 287 345 288 CALL cpl_send_seaice_fields(itime, dtime, knon, knindex, & 346 pctsrf _in, lafin, rlon, rlat, &289 pctsrf, lafin, rlon, rlat, & 347 290 swnet, lwnet, fluxlat, fluxsens, & 348 291 precip_rain, precip_snow, evap, tsurf_new, fder_new, alb1, taux, tauy) … … 353 296 !**************************************************************************************** 354 297 ! 355 SUBROUTINE ocean_cpl_get_vars(flux_o, flux_g)356 357 ! This subroutine returns variables private in this module to an external358 ! routine (physiq).359 360 REAL, DIMENSION(klon), INTENT(OUT) :: flux_o361 REAL, DIMENSION(klon), INTENT(OUT) :: flux_g362 363 ! Set the output variables364 flux_o(:) = tmp_flux_o(:)365 flux_g(:) = tmp_flux_g(:)366 367 END SUBROUTINE ocean_cpl_get_vars368 !369 !****************************************************************************************370 !371 298 END MODULE ocean_cpl_mod
Note: See TracChangeset
for help on using the changeset viewer.