Changeset 2111


Ignore:
Timestamp:
Mar 5, 2019, 2:04:30 PM (6 years ago)
Author:
emillour
Message:

Generic model:

  • some fixes for the slab ocean. Still need to make it work in parallel.

EM

Location:
trunk/LMDZ.GENERIC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r2107 r2111  
    14651465== 26/02/2019 == AB
    14661466- now convective adjustment can be used for layers beyond thermals
     1467
     1468== 05/03/2019 == EM
     1469- some fixes for the slab ocean. Still need to make it work in parallel.
  • trunk/LMDZ.GENERIC/libf/phystd/surf_heat_transp_mod.F90

    r1537 r2111  
    3232  PRIVATE :: gr_fi_dyn, gr_dyn_fi
    3333  ! Routines from dyn3d, valid on global dynamics grid only:
    34   PRIVATE :: grad,diverg,gr_u_scal,gr_v_scal
     34  PRIVATE :: grad,diverg,gr_v_scal,gr_scal_v,gr_scal_u
    3535 
    3636CONTAINS
     
    231231      ip1jmp1=(nbp_lon+1)*nbp_lat ! = iip1*jjp1
    232232
    233 ! Passage taux,y sur grilles 2d
     233! Convert taux,y to 2D  scalar grid
     234      ! north and south poles tx,ty no meaning
     235      tx_phy(1)=0.
     236      tx_phy(ngrid)=0.
     237      ty_phy(1)=0.
     238      ty_phy(ngrid)=0.
    234239      CALL gr_fi_dyn(1,ngrid,iip1,jjp1,tx_phy,txu)
    235240      CALL gr_fi_dyn(1,ngrid,iip1,jjp1,ty_phy,tyu)
    236 ! Passage grille u,v
    237 ! Multiplication par f ou eps.
    238       CALL gr_v_scal(1,txu,txv)
    239       CALL gr_v_scal(1,tyu,tyv)
     241         
     242! Divide taux,y by f or eps, and convert to 2D u,v grids
     243! (Arakawa C grid)
     244      CALL gr_scal_v(1,txu,txv) ! wind stress at v points
     245      CALL gr_scal_v(1,tyu,tyv)
    240246      fluxm=tyv*unsev-txv*unsfv
    241247!      fluxm=-txv*unsfv
    242       CALL gr_u_scal(1,txu,txu)
    243       CALL gr_u_scal(1,tyu,tyu)
     248! Zonal flux
     249      CALL gr_scal_u(1,txu,txu) ! wind stress at u points
     250      CALL gr_scal_u(1,tyu,tyu)
    244251      fluxz=tyu*unsfu+txu*unseu
    245252!      fluxz=tyu*unsfu
    246253           
    247 ! Calcul de T, Tdeep
     254! Convert temperature to 2D grid
    248255      CALL gr_fi_dyn(2,ngrid,iip1,jjp1,ts_phy,ts)
    249256       
     
    263270      fluxv=fluxv
    264271
    265 !Calcul flux de chaleur méridiens
     272! Meridional heat fluxes
    266273      DO ij=1,ip1jm
     274          ! centered scheme
    267275          fluxtm(ij,1)=fluxm(ij)*(ts(ij+iip1,1)+ts(ij,1))/2.
    268276          fluxtm(ij,2)=-fluxm(ij)*(ts(ij+iip1,2)+ts(ij,2))/2.
    269277      END DO
    270278
    271 !Calcul flux chaleur zonaux
     279! Zonal heat fluxes
     280! Schema upstream     
     281      fluxtz(1:iip1,:)=0 ! no zonal heat flux at north pole
    272282      DO ij=iip2,ip1jm
    273283      IF (fluxz(ij).GE.0.) THEN
     
    487497
    488498
    489   SUBROUTINE gr_u_scal(nx,x_u,x_scal)
    490   USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    491   IMPLICIT NONE
    492  
    493   INTEGER,INTENT(IN) :: nx
    494   REAL,INTENT(IN) :: x_u((nbp_lon+1)*nbp_lat,nx)
    495   REAL,INTENT(OUT) :: x_scal((nbp_lon+1)*nbp_lat,nx)
    496  
    497   INTEGER :: l,ij
    498   INTEGER :: iip1,jjp1,ip1jmp1
    499  
    500   iip1=nbp_lon+1
    501   jjp1=nbp_lat
    502   ip1jmp1=(nbp_lon+1)*nbp_lat ! = iip1*jjp1
    503  
    504   DO l=1,nx
    505     DO ij=ip1jmp1,2,-1
    506       x_scal(ij,l)= &
    507                    (aireu(ij)*x_u(ij,l)+aireu(ij-1)*x_u(ij-1,l)) &
    508                   /(aireu(ij)+aireu(ij-1))
    509     ENDDO
    510   ENDDO
    511  
    512   CALL SCOPY(nx*jjp1,x_scal(iip1,1),iip1,x_scal(1,1),iip1)
    513 
    514   END SUBROUTINE gr_u_scal
    515 
    516 
    517 
    518499  SUBROUTINE gr_v_scal(nx,x_v,x_scal)
    519500  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
     
    547528
    548529  END SUBROUTINE gr_v_scal
     530
     531  SUBROUTINE gr_scal_v(nx,x_scal,x_v)
     532  ! convert values from scalar points to v points on C-grid
     533  ! used to compute wind stress at V points
     534  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
     535  IMPLICIT NONE
     536
     537  INTEGER,INTENT(IN) :: nx ! number of levels or fields
     538  REAL,INTENT(OUT) :: x_v((nbp_lon+1)*(nbp_lat-1),nx)
     539  REAL,INTENT(IN) :: x_scal((nbp_lon+1)*nbp_lat,nx)
     540
     541  INTEGER :: l,ij
     542  INTEGER :: iip1,ip1jm
     543
     544  iip1=nbp_lon+1
     545  ip1jm=(nbp_lon+1)*(nbp_lat-1) ! = iip1*jjm
     546
     547      DO l=1,nx
     548        DO ij=1,ip1jm
     549          x_v(ij,l)= &
     550            (cu(ij)*cvusurcu(ij)*x_scal(ij,l)+ &
     551            cu(ij+iip1)*cvusurcu(ij+iip1)*x_scal(ij+iip1,l)) &
     552            /(cu(ij)*cvusurcu(ij)+cu(ij+iip1)*cvusurcu(ij+iip1))
     553        ENDDO
     554      ENDDO
     555
     556  END SUBROUTINE gr_scal_v
     557
     558  SUBROUTINE gr_scal_u(nx,x_scal,x_u)
     559  ! convert values from scalar points to U points on C-grid
     560  ! used to compute wind stress at U points
     561  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
     562  IMPLICIT NONE
     563
     564  INTEGER,INTENT(IN) :: nx
     565  REAL,INTENT(OUT) :: x_u((nbp_lon+1)*nbp_lat,nx)
     566  REAL,INTENT(IN) :: x_scal((nbp_lon+1)*nbp_lat,nx)
     567
     568  INTEGER :: l,ij
     569  INTEGER :: iip1,jjp1,ip1jmp1
     570
     571  iip1=nbp_lon+1
     572  jjp1=nbp_lat
     573  ip1jmp1=(nbp_lon+1)*nbp_lat ! = iip1*jjp1
     574
     575  DO l=1,nx
     576     DO ij=1,ip1jmp1-1
     577        x_u(ij,l)= &
     578         (aire(ij)*x_scal(ij,l)+aire(ij+1)*x_scal(ij+1,l)) &
     579         /(aire(ij)+aire(ij+1))
     580     ENDDO
     581  ENDDO
     582
     583  CALL SCOPY(nx*jjp1,x_u(1,1),iip1,x_u(iip1,1),iip1)
     584
     585  END SUBROUTINE gr_scal_u
    549586 
    550587END MODULE surf_heat_transp_mod
Note: See TracChangeset for help on using the changeset viewer.