Ignore:
Timestamp:
Dec 14, 2015, 11:43:09 AM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2298:2396 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90

    r2298 r2408  
    2323  USE climb_wind_mod,      ONLY : climb_wind_down, climb_wind_up
    2424  USE coef_diff_turb_mod,  ONLY : coef_diff_turb
    25   USE control_mod
    2625
    2726
     
    4948
    5049    USE indice_sol_mod
     50    USE print_control_mod, ONLY: lunout
    5151
    5252    INCLUDE "dimsoil.h"
    53     INCLUDE "iniprint.h"
    5453 
    5554! Input variables
     
    7372!****************************************************************************************   
    7473    ALLOCATE(fder(klon), stat=ierr)
    75     IF (ierr /= 0) CALL abort_gcm('pbl_surface_init', 'pb in allocation',1)
     74    IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
    7675
    7776    ALLOCATE(snow(klon,nbsrf), stat=ierr)
    78     IF (ierr /= 0) CALL abort_gcm('pbl_surface_init', 'pb in allocation',1)
     77    IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
    7978
    8079    ALLOCATE(qsurf(klon,nbsrf), stat=ierr)
    81     IF (ierr /= 0) CALL abort_gcm('pbl_surface_init', 'pb in allocation',1)
     80    IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
    8281
    8382    ALLOCATE(ftsoil(klon,nsoilmx,nbsrf), stat=ierr)
    84     IF (ierr /= 0) CALL abort_gcm('pbl_surface_init', 'pb in allocation',1)
     83    IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
    8584
    8685
     
    10099      WRITE(lunout,*)"or on doit commencer par les surfaces continentales"
    101100      abort_message="voir ci-dessus"
    102       CALL abort_gcm(modname,abort_message,1)
     101      CALL abort_physic(modname,abort_message,1)
    103102    ENDIF
    104103
     
    109108      WRITE(lunout,*)' or is_oce = ',is_oce, '> is_sic = ',is_sic
    110109      abort_message='voir ci-dessus'
    111       CALL abort_gcm(modname,abort_message,1)
     110      CALL abort_physic(modname,abort_message,1)
    112111    ENDIF
    113112
     
    118117      WRITE(lunout,*)' or is_lic = ',is_lic, '> is_sic = ',is_sic
    119118      abort_message='voir ci-dessus'
    120       CALL abort_gcm(modname,abort_message,1)
     119      CALL abort_physic(modname,abort_message,1)
    121120    ENDIF
    122121
     
    130129       WRITE(lunout,*)'Option couplage pour l''ocean = ', type_ocean
    131130       abort_message='option pour l''ocean non valable'
    132        CALL abort_gcm(modname,abort_message,1)
     131       CALL abort_physic(modname,abort_message,1)
    133132    ENDIF
    134133
     
    261260    USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send
    262261    USE indice_sol_mod
     262    USE time_phylmdz_mod, ONLY: day_ini,annee_ref,itau_phy
     263    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     264    USE print_control_mod, ONLY: prt_level,lunout
    263265
    264266    IMPLICIT NONE
     
    266268    INCLUDE "dimsoil.h"
    267269    INCLUDE "YOMCST.h"
    268     INCLUDE "iniprint.h"
    269270    INCLUDE "YOETHF.h"
    270271    INCLUDE "FCTTRE.h"
    271272    INCLUDE "clesphys.h"
    272273    INCLUDE "compbl.h"
    273     INCLUDE "dimensions.h"
    274     INCLUDE "temps.h"
    275274    INCLUDE "flux_arp.h"
    276275!****************************************************************************************
     
    733732
    734733! For debugging with IOIPSL
    735     INTEGER, DIMENSION(iim*(jjm+1))    :: ndexbg
     734    INTEGER, DIMENSION(nbp_lon*nbp_lat)    :: ndexbg
    736735    REAL                               :: zjulian
    737736    REAL, DIMENSION(klon)              :: tabindx
    738     REAL, DIMENSION(iim,jjm+1)         :: zx_lon, zx_lat
    739     REAL, DIMENSION(iim,jjm+1)         :: debugtab
     737    REAL, DIMENSION(nbp_lon,nbp_lat)         :: zx_lon, zx_lat
     738    REAL, DIMENSION(nbp_lon,nbp_lat)         :: debugtab
    740739
    741740
     
    794793          idayref = day_ini
    795794          CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    796           CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon)
    797           DO i = 1, iim
     795          CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlon,zx_lon)
     796          DO i = 1, nbp_lon
    798797             zx_lon(i,1) = rlon(i+1)
    799              zx_lon(i,jjm+1) = rlon(i+1)
     798             zx_lon(i,nbp_lat) = rlon(i+1)
    800799          ENDDO
    801           CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat)
    802           CALL histbeg("sous_index", iim,zx_lon(:,1),jjm+1,zx_lat(1,:), &
    803                1,iim,1,jjm+1, &
     800          CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlat,zx_lat)
     801          CALL histbeg("sous_index",nbp_lon,zx_lon(:,1),nbp_lat,zx_lat(1,:), &
     802               1,nbp_lon,1,nbp_lat, &
    804803               itau_phy,zjulian,dtime,nhoridbg,nidbg)
    805804          ! no vertical axis
     
    809808          cl_surf(4)='sic'
    810809          DO nsrf=1,nbsrf
    811              CALL histdef(nidbg, cl_surf(nsrf),cl_surf(nsrf), "-",iim, &
    812                   jjm+1,nhoridbg, 1, 1, 1, -99, 32, "inst", dtime,dtime)
     810             CALL histdef(nidbg, cl_surf(nsrf),cl_surf(nsrf), "-",nbp_lon, &
     811                  nbp_lat,nhoridbg, 1, 1, 1, -99, 32, "inst", dtime,dtime)
    813812          END DO
    814813
     
    11441143          ndexbg(:) = 0
    11451144          CALL gath2cpl(tabindx,debugtab,knon,ni)
    1146           CALL histwrite(nidbg,cl_surf(nsrf),itap,debugtab,iim*(jjm+1), ndexbg)
     1145          CALL histwrite(nidbg,cl_surf(nsrf),itap,debugtab,nbp_lon*nbp_lat, ndexbg)
    11471146       ENDIF
    11481147       
     
    13181317!     *sqrt(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1)))
    13191318       ycdragm(i) = ust*ust/(1.+vent)/vent
    1320        print *,'ycdragm ust yu yv apres=',ycdragm(i),ust,yu(i,1),yv(i,1)
     1319!      print *,'ycdragm ust yu yv apres=',ycdragm(i),ust,yu(i,1),yv(i,1)
    13211320      ENDDO
    13221321     ENDIF
     
    13431342        IF (ok_prescr_ust) then
    13441343         DO i = 1, knon
    1345           print *,'ycdragm_x avant=',ycdragm_x(i)
     1344!         print *,'ycdragm_x avant=',ycdragm_x(i)
    13461345          vent= sqrt(yu_x(i,1)*yu_x(i,1)+yv_x(i,1)*yv_x(i,1))
    13471346          ycdragm_x(i) = ust*ust/(1.+vent)/vent
    1348           print *,'ycdragm_x ust yu yv apres=',ycdragm_x(i),ust,yu_x(i,1),yv_x(i,1)
     1347!         print *,'ycdragm_x ust yu yv apres=',ycdragm_x(i),ust,yu_x(i,1),yv_x(i,1)
    13491348         ENDDO
    13501349        ENDIF
     
    13671366            ycdragm_w, ycdragh_w, zri1_w, pref_w )
    13681367
    1369 ! --- special Dice. JYG+MPL 25112013
     1368! --- special Dice. JYG+MPL 25112013 puis BOMEX
    13701369        IF (ok_prescr_ust) then
    13711370         DO i = 1, knon
    1372           print *,'ycdragm_w avant=',ycdragm_w(i)
     1371!         print *,'ycdragm_w avant=',ycdragm_w(i)
    13731372          vent= sqrt(yu_w(i,1)*yu_w(i,1)+yv_w(i,1)*yv_w(i,1))
    13741373          ycdragm_w(i) = ust*ust/(1.+vent)/vent
    1375           print *,'ycdragm_w ust yu yv apres=',ycdragm_w(i),ust,yu_w(i,1),yv_w(i,1)
     1374!         print *,'ycdragm_w ust yu yv apres=',ycdragm_w(i),ust,yu_w(i,1),yv_w(i,1)
    13761375         ENDDO
    13771376        ENDIF
     
    17471746               y_flux_u1, y_flux_v1 )
    17481747               
    1749 ! Special DICE MPL 05082013
     1748! Special DICE MPL 05082013 puis BOMEX
    17501749       IF (ok_prescr_ust) THEN
     1750          do j=1,knon
    17511751!         ysnow(:)=0.
    17521752!         yqsol(:)=0.
     
    17611761!         y_dflux_t(:)=0.
    17621762!         y_dflux_q(:)=0.
    1763           y_flux_u1(:)=ycdragm(:)*(1.+sqrt(yu(:,1)*yu(:,1)+yv(:,1)*yv(:,1)))*yu(:,1)*ypplay(:,1)/RD/yt(:,1)
    1764           y_flux_v1(:)=ycdragm(:)*(1.+sqrt(yu(:,1)*yu(:,1)+yv(:,1)*yv(:,1)))*yv(:,1)*ypplay(:,1)/RD/yt(:,1)
     1763          y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
     1764          y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
     1765          enddo
    17651766      ENDIF
    17661767
     
    17971798          END DO
    17981799          ! Martin
     1800! Special DICE MPL 05082013 puis BOMEX MPL 20150410
     1801       IF (ok_prescr_ust) THEN
     1802          DO j=1,knon
     1803          y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
     1804          y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
     1805          ENDDO
     1806      ENDIF
    17991807         
    18001808       CASE(is_oce)
     
    18251833          print *,'arg de surf_ocean: ytsurf_new ',ytsurf_new
    18261834       ENDIF
     1835! Special DICE MPL 05082013 puis BOMEX MPL 20150410
     1836       IF (ok_prescr_ust) THEN
     1837          DO j=1,knon
     1838          y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
     1839          y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
     1840          ENDDO
     1841      ENDIF
    18271842         
    18281843       CASE(is_sic)
     
    18441859               y_flux_u1, y_flux_v1)
    18451860         
     1861! Special DICE MPL 05082013 puis BOMEX MPL 20150410
     1862       IF (ok_prescr_ust) THEN
     1863          DO j=1,knon
     1864          y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
     1865          y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
     1866          ENDDO
     1867      ENDIF
    18461868
    18471869       CASE DEFAULT
    18481870          WRITE(lunout,*) 'Surface index = ', nsrf
    18491871          abort_message = 'Surface index not valid'
    1850           CALL abort_gcm(modname,abort_message,1)
     1872          CALL abort_physic(modname,abort_message,1)
    18511873       END SELECT
    18521874
     
    18861908!
    18871909          IF (iflag_split .eq.0) THEN
    1888              Kech_h(:) = ycdragh(:) * (1.0+SQRT(yu(:,1)**2+yv(:,1)**2)) * &
    1889                   ypplay(:,1)/(RD*yt(:,1))
     1910             do j=1,knon
     1911             Kech_h(j) = ycdragh(j) * (1.0+SQRT(yu(j,1)**2+yv(j,1)**2)) * &
     1912                  ypplay(j,1)/(RD*yt(j,1))
     1913             enddo
    18901914          ENDIF ! (iflag_split .eq.0)
    18911915
     
    18951919          ENDDO
    18961920
    1897           y_d_ts(:) = ytsurf_new(:) - yts(:)
     1921          do j=1,knon
     1922          y_d_ts(j) = ytsurf_new(j) - yts(j)
     1923          enddo
    18981924
    18991925        ELSE ! (ok_flux_surf)
    1900           y_flux_t1(:) =  yfluxsens(:)
    1901           y_flux_q1(:) = -yevap(:)
     1926          do j=1,knon
     1927          y_flux_t1(j) =  yfluxsens(j)
     1928          y_flux_q1(j) = -yevap(j)
     1929          enddo
    19021930        ENDIF
    19031931
     
    30603088                ! Security abort. This option has never been tested. To test, comment the following line.
    30613089!                abort_message='The fraction of the continents have changed!'
    3062 !                CALL abort_gcm(modname,abort_message,1)
     3090!                CALL abort_physic(modname,abort_message,1)
    30633091                nfois(nsrf) = nfois(nsrf) + 1
    30643092             END IF
Note: See TracChangeset for help on using the changeset viewer.