Ignore:
Timestamp:
Jun 15, 2021, 1:18:14 PM (3 years ago)
Author:
crisi
Message:

replace files by symbloic liks from phylmdiso towards phylmd.
Many files at once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/surf_landice_mod.F90

    r3927 r3940  
    1919       tsoil, z0m, z0h, SFRWL, alb_dir, alb_dif, evap, fluxsens, fluxlat, &
    2020       tsurf_new, dflux_s, dflux_l, &
    21        slope, cloudf, &
     21       alt, slope, cloudf, &
    2222       snowhgt, qsnow, to_ice, sissnow, &
    2323       alb3, runoff, &
     
    3030
    3131    USE dimphy
    32     USE surface_data,     ONLY : type_ocean, calice, calsno, ok_snow
    33     USE fonte_neige_mod,  ONLY : fonte_neige, run_off_lic
     32    USE surface_data,     ONLY : type_ocean, calice, calsno, landice_opt, iflag_albcalc
     33    USE fonte_neige_mod,  ONLY : fonte_neige,run_off_lic,fqcalving_global,ffonte_global,fqfonte_global,runofflic_global
    3434    USE cpl_mod,          ONLY : cpl_send_landice_fields
    3535    USE calcul_fluxs_mod
     
    4747    USE ioipsl_getin_p_mod, ONLY : getin_p
    4848
    49 #ifdef CPP_SISVAT
    50     USE surf_sisvat_mod,  ONLY : surf_sisvat
    51 #endif
     49
     50#ifdef CPP_INLANDSIS
     51    USE surf_inlandsis_mod,  ONLY : surf_inlandsis
     52#endif
     53
    5254    USE indice_sol_mod
    5355
     
    8890    REAL, DIMENSION(klon), INTENT(IN)             :: albedo  !mean albedo
    8991    REAL, DIMENSION(klon), INTENT(IN)             :: pphi1   
     92    REAL, DIMENSION(klon), INTENT(IN)             :: alt   !mean altitude of the grid box 
    9093    REAL, DIMENSION(klon), INTENT(IN)             :: slope   !mean slope in grid box 
    9194    REAL, DIMENSION(klon), INTENT(IN)             :: cloudf  !total cloud fraction
     
    108111!    REAL, DIMENSION(klon), INTENT(OUT)            :: alb1  ! new albedo in visible SW interval
    109112!    REAL, DIMENSION(klon), INTENT(OUT)            :: alb2  ! new albedo in near IR interval
    110     REAL, DIMENSION(6), INTENT(IN)              ::SFRWL
    111     REAL, DIMENSION(klon,nsw), INTENT(OUT)        ::alb_dir,alb_dif
     113    REAL, DIMENSION(6), INTENT(IN)                :: SFRWL
     114    REAL, DIMENSION(klon,nsw), INTENT(OUT)        :: alb_dir,alb_dif
    112115!albedo SB <<<
    113116    REAL, DIMENSION(klon), INTENT(OUT)            :: evap, fluxsens, fluxlat
     
    135138    REAL, DIMENSION(klon)    :: zfra, alb_neig
    136139    REAL, DIMENSION(klon)    :: radsol
    137     REAL, DIMENSION(klon)    :: u0, v0, u1_lay, v1_lay
    138     INTEGER                  :: i,j
     140    REAL, DIMENSION(klon)    :: u0, v0, u1_lay, v1_lay, ustar
     141    INTEGER                  :: i,j,nt
     142    REAL, DIMENSION(klon)    :: fqfonte,ffonte
    139143#ifdef ISO       
    140144      real, parameter :: t_coup = 273.15
     
    155159    REAL, DIMENSION(klon)    :: emis_new                  !Emissivity
    156160    REAL, DIMENSION(klon)    :: swdown,lwdown
    157     REAL, DIMENSION(klon)    :: precip_snow_adv, snow_adv !Snow Drift precip./advection
    158     REAL, DIMENSION(klon)    :: bl_height, wind_velo      !height boundary layer, wind spd
     161    REAL, DIMENSION(klon)    :: precip_snow_adv, snow_adv !Snow Drift precip./advection (not used in inlandsis)
     162    REAL, DIMENSION(klon)    :: erod                      !erosion of surface snow (flux, kg/m2/s like evap)
     163    REAL, DIMENSION(klon)    :: zsl_height, wind_velo     !surface layer height, wind spd
    159164    REAL, DIMENSION(klon)    :: dens_air,  snow_cont_air  !air density; snow content air
    160165    REAL, DIMENSION(klon)    :: alb_soil                  !albedo of underlying ice
    161166    REAL, DIMENSION(klon)    :: pexner                    !Exner potential
    162167    REAL                     :: pref
    163     REAL, DIMENSION(klon,nsoilmx) :: tsoil0 !modfi
     168    REAL, DIMENSION(klon,nsoilmx) :: tsoil0               !modif
     169    REAL                          :: dtis                ! subtimestep
     170    LOGICAL                       :: debut_is, lafin_is  ! debut and lafin for inlandsis
    164171
    165172    CHARACTER (len = 20)                      :: modname = 'surf_landice'
     
    167174
    168175
    169 !albedo SB >>>
    170     real,dimension(klon) :: alb1,alb2
    171 !albedo SB <<<
    172 
     176    REAL,DIMENSION(klon) :: alb1,alb2
     177    REAL, DIMENSION (klon,6) :: alb6
    173178! End definition
    174179!****************************************************************************************
     
    181186  LOGICAL, SAVE :: firstcall = .TRUE.
    182187  !$OMP THREADPRIVATE(firstcall)
    183 !FC
    184 
    185 
     188
     189
     190!FC firtscall initializations
     191!******************************************************************************************
    186192#ifdef ISO
    187193#ifdef ISOVERIF
     
    203209  CALL getin_p('alb_nir_sno_lic',alb_nir_sno_lic)
    204210           PRINT*, 'alb_nir_sno_lic',alb_nir_sno_lic
     211 
     212!  z0m=1.e-3
     213!  z0h = z0m
    205214  firstcall=.false.
    206215  ENDIF
     216!******************************************************************************************
    207217!
    208218! Initialize output variables
     
    220230
    221231!****************************************************************************************
    222 !   ok_snow = TRUE  : prepare and call SISVAT snow model
    223 !   ok_snow = FALSE : soil_model, calcul_flux, fonte_neige, ...
    224 !
    225 !****************************************************************************************
    226     IF (ok_snow) THEN
    227 #ifdef CPP_SISVAT
    228        ! Prepare for calling SISVAT
     232!  landice_opt = 0 : soil_model, calcul_flux, fonte_neige, ... 
     233!  landice_opt = 1  : prepare and call INterace Lmdz SISvat (INLANDSIS)
     234!****************************************************************************************
     235
     236
     237    IF (landice_opt .EQ. 1) THEN
     238
     239!****************************************************************************************   
     240! CALL to INLANDSIS interface
     241!****************************************************************************************
     242#ifdef CPP_INLANDSIS
     243
     244#ifdef ISO
     245        CALL abort_gcm('surf_landice 235','isotopes pas dans INLANDSIS',1)
     246#endif
     247
     248        debut_is=debut
     249        lafin_is=.false.
     250        ! Suppose zero surface speed
     251        u0(:)            = 0.0
     252        v0(:)            = 0.0
     253
     254
     255        CALL calcul_flux_wind(knon, dtime, &
     256         u0, v0, u1, v1, gustiness, cdragm, &
     257         AcoefU, AcoefV, BcoefU, BcoefV, &
     258         p1lay, temp_air, &
     259         flux_u1, flux_v1)
     260
    229261       
    230        ! Calculate incoming flux for SW and LW interval: swdown, lwdown
     262       ! Set constants and compute some input for SISVAT
     263       ! = 1000 hPa
     264       ! and calculate incoming flux for SW and LW interval: swdown, lwdown
    231265       swdown(:)        = 0.0
    232266       lwdown(:)        = 0.0
     267       snow_cont_air(:) = 0.  ! the snow content in air is not a prognostic variable of the model     
     268       alb_soil(:)      = 0.4 ! before albedo(:) but here it is the ice albedo that we have to set
     269       ustar(:)         = 0.
     270       pref             = 100000.       
    233271       DO i = 1, knon
    234272          swdown(i)        = swnet(i)/(1-albedo(i))
    235273          lwdown(i)        = lwdownm(i)
    236        END DO
    237        
    238        ! Set constants and compute some input for SISVAT
    239        snow_adv(:)      = 0.                          ! no snow blown in for now
    240        snow_cont_air(:) = 0.       
    241        alb_soil(:)      = albedo(:)
    242        pref             = 100000.                     ! = 1000 hPa
    243        DO i = 1, knon
    244274          wind_velo(i)     = u1(i)**2 + v1(i)**2
    245275          wind_velo(i)     = wind_velo(i)**0.5
    246276          pexner(i)        = (p1lay(i)/pref)**(RD/RCPD)
    247277          dens_air(i)      = p1lay(i)/RD/temp_air(i)  ! dry air density
    248           bl_height(i)     = pphi1(i)/RG             
     278          zsl_height(i)    = pphi1(i)/RG     
     279          tsoil0(i,:)      = tsoil(i,:) 
     280          ustar(i)= (cdragm(i)*(wind_velo(i)**2))**0.5   
    249281       END DO
    250 
    251 !****************************************************************************************
    252 ! CALL to SISVAT interface
    253 !
    254 !****************************************************************************************
    255        ! config: compute everything with SV but temperatures afterwards with soil/calculfluxs
    256        DO i = 1, knon
    257           tsoil0(i,:)=tsoil(i,:)
    258        END DO
    259            ! Martin
    260            PRINT*, 'on appelle surf_sisvat'
    261            ! Martin
    262        CALL surf_sisvat(knon, rlon, rlat, knindex, itime, dtime, debut, lafin, &
    263             rmu0, swdown, lwdown, pexner, ps, p1lay, &
    264             precip_rain, precip_snow, precip_snow_adv, snow_adv, &
    265             bl_height, wind_velo, temp_air, dens_air, spechum, tsurf, &
    266             rugoro, snow_cont_air, alb_soil, slope, cloudf, &
    267             radsol, qsol, tsoil0, snow, snowhgt, qsnow, to_ice,sissnow, agesno, &
    268             AcoefH, AcoefQ, BcoefH, BcoefQ, cdragh, &
    269             run_off_lic, evap, fluxsens, fluxlat, dflux_s, dflux_l, &       
    270             tsurf_new, alb1, alb2, alb3, &
    271             emis_new, z0m, qsurf)
    272        z0h(1:knon)=z0m(1:knon) ! en attendant mieux
    273282       
    274        ! Suppose zero surface speed
    275        u0(:)            = 0.0
    276        v0(:)            = 0.0
    277        ! The calculation of heat/water fluxes, otherwise done by "CALL calcul_fluxs" is
    278        ! integrated in SISVAT, using the same method. It can be found in "sisvat.f", in the
    279        ! subroutine "SISVAT_TS2".
    280        ! u0, v0=0., dif_grnd=0. and beta=1 are assumed there!
    281        
    282        CALL calcul_flux_wind(knon, dtime, &
    283             u0, v0, u1, v1, gustiness, cdragm, &
    284             AcoefU, AcoefV, BcoefU, BcoefV, &
    285             p1lay, temp_air, &
    286             flux_u1, flux_v1)
     283
     284
     285        dtis=dtime
     286
     287          IF (lafin) THEN
     288            lafin_is=.true.
     289          END IF
     290
     291          CALL surf_inlandsis(knon, rlon, rlat, knindex, itime, dtis, debut_is, lafin_is,&
     292            rmu0, swdown, lwdown, albedo, pexner, ps, p1lay, precip_rain, precip_snow,   &
     293            zsl_height, wind_velo, ustar, temp_air, dens_air, spechum, tsurf,&
     294            rugoro, snow_cont_air, alb_soil, alt, slope, cloudf, &
     295            radsol, qsol, tsoil0, snow, zfra, snowhgt, qsnow, to_ice, sissnow,agesno,   &
     296            AcoefH, AcoefQ, BcoefH, BcoefQ, cdragm, cdragh, &
     297            run_off_lic, fqfonte, ffonte, evap, erod, fluxsens, fluxlat,dflux_s, dflux_l, &
     298            tsurf_new, alb1, alb2, alb3, alb6, &
     299            emis_new, z0m, z0h, qsurf)
     300
     301          debut_is=.false.
     302
     303
     304        ! Treatment of snow melting and calving
     305
     306        ! for consistency with standard LMDZ, add calving to run_off_lic
     307        run_off_lic(:)=run_off_lic(:) + to_ice(:)
     308
     309        DO i = 1, knon
     310           ffonte_global(knindex(i),is_lic)    = ffonte(i)
     311           fqfonte_global(knindex(i),is_lic)   = fqfonte(i)! net melting= melting - refreezing
     312           fqcalving_global(knindex(i),is_lic) = to_ice(i) ! flux
     313           runofflic_global(knindex(i)) = run_off_lic(i)
     314        ENDDO
     315        ! Here, we assume that the calving term is equal to the to_ice term
     316        ! (no ice accumulation)
     317
     318
    287319#else
    288        abort_message='Pb de coherence: ok_snow = .true. mais CPP_SISVAT = .false.'
     320       abort_message='Pb de coherence: landice_opt = 1  mais CPP_INLANDSIS = .false.'
    289321       CALL abort_physic(modname,abort_message,1)
    290322#endif
    291 #ifdef ISO
    292        abort_message='surf_landice 267: isotopes pas prevus ici'
    293        CALL abort_physic(modname,abort_message,1)
    294 #endif
    295     ELSE ! ok_snow=FALSE
     323
     324
     325
     326    ELSE
    296327
    297328!****************************************************************************************
     
    299330!
    300331!****************************************************************************************
     332
     333    ! EV: use calbeta
     334    CALL calbeta(dtime, is_lic, knon, snow, qsol, beta, cal, dif_grnd)
     335
     336
     337    ! use soil model and recalculate properly cal
    301338    IF (soil_model) THEN
    302339       CALL soil(dtime, is_lic, knon, snow, tsurf, tsoil, soilcap, soilflux)
     
    313350!
    314351!****************************************************************************************
    315     beta(:) = 1.0
    316     dif_grnd(:) = 0.0
     352!    beta(:) = 1.0
     353!    dif_grnd(:) = 0.0
    317354
    318355! Suppose zero surface speed
     
    367404!   
    368405!****************************************************************************************
    369     CALL fonte_neige( knon, is_lic, knindex, dtime, &
     406    CALL fonte_neige(knon, is_lic, knindex, dtime, &
    370407         tsurf, precip_rain, precip_snow, &
    371408         snow, qsol, tsurf_new, evap &
     
    408445!****************************************************************************************
    409446    CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 
     447
    410448    WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0.
    411449    zfra(1:knon) = MAX(0.0,MIN(1.0,snow(1:knon)/(snow(1:knon)+10.0)))
     
    420458!IM: KstaTER0.77 & LMD_ARMIP6   
    421459
    422 ! Attantion: alb1 and alb2 are the same!
     460! Attantion: alb1 and alb2 are not the same!
    423461    alb1(1:knon)  = alb_vis_sno_lic
    424462    alb2(1:knon)  = alb_nir_sno_lic
     
    433471    z0m = SQRT(z0m**2+rugoro**2)
    434472
    435     END IF ! ok_snow
     473
     474
     475    END IF ! landice_opt
    436476
    437477
    438478!****************************************************************************************
    439479! Send run-off on land-ice to coupler if coupled ocean.
    440 ! run_off_lic has been calculated in fonte_neige or surf_sisvat
     480! run_off_lic has been calculated in fonte_neige or surf_inlandsis
    441481!
    442482!****************************************************************************************
     
    450490 
    451491!****************************************************************************************
    452        snow_o=0.
    453        zfra_o = 0.
    454        DO j = 1, knon
    455            i = knindex(j)
    456            snow_o(i) = snow(j)
    457            zfra_o(i) = zfra(j)
    458        ENDDO
    459 
     492! Etienne: comment these lines because of duplication just below
     493!       snow_o=0.
     494!       zfra_o = 0.
     495!       DO j = 1, knon
     496!           i = knindex(j)
     497!           snow_o(i) = snow(j)
     498!           zfra_o(i) = zfra(j)
     499!       ENDDO
     500!
    460501!****************************************************************************************
    461502       snow_o=0.
     
    485526       alb_dir(1:knon,5)=alb2(1:knon)
    486527       alb_dir(1:knon,6)=alb2(1:knon)
     528
     529       IF ((landice_opt .EQ. 1) .AND. (iflag_albcalc .EQ. 2)) THEN
     530       alb_dir(1:knon,1)=alb6(1:knon,1)
     531       alb_dir(1:knon,2)=alb6(1:knon,2)
     532       alb_dir(1:knon,3)=alb6(1:knon,3)
     533       alb_dir(1:knon,4)=alb6(1:knon,4)
     534       alb_dir(1:knon,5)=alb6(1:knon,5)
     535       alb_dir(1:knon,6)=alb6(1:knon,6)
     536       ENDIF
     537
    487538     end select
    488539alb_dif=alb_dir
    489540!albedo SB <<<
    490541
    491 
    492 
     542 
     543 
    493544
    494545  END SUBROUTINE surf_landice
Note: See TracChangeset for help on using the changeset viewer.