Ignore:
Timestamp:
Sep 9, 2008, 3:22:23 PM (16 years ago)
Author:
lsce
Message:
  • Modifications liées au calcul des nouveau sous-fractions
  • Nettoyage de ocean slab : il reste uniquement la version avec glace de mer forcé
  • Nouveaux variables pour distiguer la version et type d'ocean : type_ocean=force/slab/couple, version_ocean=opa8/nemo pour couplé ou version_ocean=sicOBS pour slab

JG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/trunk/libf/phylmd/ocean_cpl_mod.F90

    r888 r996  
    1616  PRIVATE
    1717
    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
    2419
    2520!****************************************************************************************
     
    4338    CHARACTER (len = 80) :: abort_message
    4439    CHARACTER (len = 20) :: modname = 'ocean_cpl_init'
    45 
    46 
    47     ALLOCATE(tmp_flux_o(klon), stat = error)
    48     IF (error /= 0) THEN
    49        abort_message='Pb allocation tmp_flux_o'
    50        CALL abort_gcm(modname,abort_message,1)
    51     ENDIF
    52 
    53     ALLOCATE(tmp_flux_g(klon), stat = error)
    54     IF (error /= 0) THEN
    55        abort_message='Pb allocation tmp_flux_g'
    56        CALL abort_gcm(modname,abort_message,1)
    57     ENDIF
    5840
    5941! Initialize module cpl_init
     
    7153       p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, &
    7254       petAcoef, peqAcoef, petBcoef, peqBcoef, &
    73        ps, u1_lay, v1_lay, pctsrf_in, &
     55       ps, u1_lay, v1_lay, &
    7456       radsol, snow, agesno, &
    7557       qsurf, evap, fluxsens, fluxlat, &
    76        tsurf_new, dflux_s, dflux_l, pctsrf_oce)
     58       tsurf_new, dflux_s, dflux_l)
    7759!
    7860! This subroutine treats the "open ocean", all grid points that are not entierly covered
     
    10183    REAL, DIMENSION(klon), INTENT(IN)        :: ps
    10284    REAL, DIMENSION(klon), INTENT(IN)        :: u1_lay, v1_lay
    103     REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf_in
    10485
    10586! In/Output arguments
     
    11596    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
    11697    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
    117     REAL, DIMENSION(klon), INTENT(OUT)       :: pctsrf_oce
    11898
    11999! Local variables
     
    122102    INTEGER, DIMENSION(1) :: iloc
    123103    REAL, DIMENSION(klon) :: cal, beta, dif_grnd
    124     REAL, DIMENSION(klon) :: zx_sl
    125104    REAL, DIMENSION(klon) :: fder_new
    126105    REAL, DIMENSION(klon) :: tsurf_cpl
     
    134113
    135114!****************************************************************************************
    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)
    142119
    143120!****************************************************************************************
     
    176153
    177154!****************************************************************************************
    178 ! Flux ocean-atmosphere useful for "slab" ocean but here calculated only for printing
    179 ! usage later in physiq 
    180 !
    181 !****************************************************************************************
    182     tmp_flux_o(:) = 0.0
    183     DO i=1, knon
    184        zx_sl(i) = RLVTT
    185        IF (tsurf_new(i) .LT. RTT) zx_sl(i) = RLSTT
    186        !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) THEN
    189           tmp_flux_o(knindex(i)) = fluxsens(i) + fluxlat(i)
    190        ENDIF
    191     ENDDO
    192 
    193 
    194 !****************************************************************************************
    195155! Send and cumulate fields to the coupler
    196156!
     
    213173       p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, spechum, &
    214174       petAcoef, peqAcoef, petBcoef, peqBcoef, &
    215        ps, u1_lay, v1_lay, pctsrf_in, &
     175       ps, u1_lay, v1_lay, pctsrf, &
    216176       radsol, snow, qsurf, &
    217177       alb1_new, alb2_new, evap, fluxsens, fluxlat, &
    218        tsurf_new, dflux_s, dflux_l, pctsrf_sic)
     178       tsurf_new, dflux_s, dflux_l)
    219179!
    220180! This subroutine treats the ocean where there is ice. The subroutine first receives
     
    244204    REAL, DIMENSION(klon), INTENT(IN)        :: ps
    245205    REAL, DIMENSION(klon), INTENT(IN)        :: u1_lay, v1_lay
    246     REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf_in
     206    REAL, DIMENSION(klon,nbsrf), INTENT(IN)  :: pctsrf
    247207
    248208! In/output arguments
     
    258218    REAL, DIMENSION(klon), INTENT(OUT)       :: tsurf_new
    259219    REAL, DIMENSION(klon), INTENT(OUT)       :: dflux_s, dflux_l     
    260     REAL, DIMENSION(klon), INTENT(OUT)       :: pctsrf_sic
    261220
    262221! Local variables
     
    277236
    278237!****************************************************************************************
    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
    281239!
    282240!****************************************************************************************
    283241
    284242    CALL cpl_receive_seaice_fields(knon, knindex, &
    285          tsurf_cpl, alb_cpl, pctsrf_sic)
     243         tsurf_cpl, alb_cpl)
    286244
    287245    alb1_new(1:knon) = alb_cpl(1:knon)
     
    308266    CALL calcul_wind_flux(knon, dtime, taux, tauy)
    309267   
    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   
    326269!****************************************************************************************
    327270! Calculate fder : flux derivative (sensible and latente)
     
    344287
    345288    CALL cpl_send_seaice_fields(itime, dtime, knon, knindex, &
    346        pctsrf_in, lafin, rlon, rlat, &
     289       pctsrf, lafin, rlon, rlat, &
    347290       swnet, lwnet, fluxlat, fluxsens, &
    348291       precip_rain, precip_snow, evap, tsurf_new, fder_new, alb1, taux, tauy)
     
    353296!****************************************************************************************
    354297!
    355   SUBROUTINE ocean_cpl_get_vars(flux_o, flux_g)
    356 
    357 ! This subroutine returns variables private in this module to an external
    358 ! routine (physiq).
    359 
    360     REAL, DIMENSION(klon), INTENT(OUT) :: flux_o
    361     REAL, DIMENSION(klon), INTENT(OUT) :: flux_g
    362 
    363 ! Set the output variables
    364     flux_o(:) = tmp_flux_o(:)
    365     flux_g(:) = tmp_flux_g(:)
    366 
    367   END SUBROUTINE ocean_cpl_get_vars
    368 !
    369 !****************************************************************************************
    370 !
    371298END MODULE ocean_cpl_mod
Note: See TracChangeset for help on using the changeset viewer.