Ignore:
Timestamp:
Jun 25, 2015, 5:25:50 PM (9 years ago)
Author:
Ehouarn Millour
Message:

More on physics/dynamics separation: make a vertical_layers_mod module to contain information on the vertical discretization. This module should be used from within the physics (instead of including comvert.h from dynamics).
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90

    r2311 r2315  
    33
    44
    5 SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep,         &
     5SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
    66                     rlatu,rlonv,aire,cu,cv,                             &
    77                     prad,pg,pr,pcpp,iflag_phys)
     
    1313                                klon_omp_end, & ! end index of local omp subgrid
    1414                                klon_mpi_begin ! start indes of columns (on local mpi grid)
     15  USE vertical_layers_mod, ONLY : init_vertical_layers
    1516  USE comgeomphy, ONLY: initcomgeomphy, &
    1617                        airephy, & ! physics grid area (m2)
     
    2829  ! =======================================================================
    2930
     31  include "dimensions.h"
     32  include "comvert.h"
    3033  include "iniprint.h"
    3134
     
    3639  REAL, INTENT (IN) :: punjours ! length (in s) of a standard day
    3740  INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers
    38   INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes
    39   INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes
    40   REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid
    41   REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid
    42   REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2)
    43   REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u)
    44   REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v)
     41  INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes
     42  INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes
     43  REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid
     44  REAL, INTENT (IN) :: rlonv(ii+1) ! longitudes of the physics grid
     45  REAL, INTENT (IN) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
     46  REAL, INTENT (IN) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
     47  REAL, INTENT (IN) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
    4548  INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation
    4649  REAL, INTENT (IN) :: ptimestep !physics time step (s)
     
    7073  END IF
    7174
    72   !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/))
     75  !call init_phys_lmdz(ii,jj+1,llm,1,(/(jj-1)*ii+2/))
    7376 
    7477  ! Generate global arrays on full physics grid
     
    8285    cufi(1) = cu(1)
    8386    cvfi(1) = cv(1)
    84     DO j=2,jjm
    85       DO i=1,iim
    86         latfi((j-2)*iim+1+i)= rlatu(j)
    87         lonfi((j-2)*iim+1+i)= rlonv(i)
    88         cufi((j-2)*iim+1+i) = cu((j-1)*(iim+1)+i)
    89         cvfi((j-2)*iim+1+i) = cv((j-1)*(iim+1)+i)
     87    DO j=2,jj
     88      DO i=1,ii
     89        latfi((j-2)*ii+1+i)= rlatu(j)
     90        lonfi((j-2)*ii+1+i)= rlonv(i)
     91        cufi((j-2)*ii+1+i) = cu((j-1)*(ii+1)+i)
     92        cvfi((j-2)*ii+1+i) = cv((j-1)*(ii+1)+i)
    9093      ENDDO
    9194    ENDDO
    9295    ! South pole
    93     latfi(klon_glo)= rlatu(jjm+1)
     96    latfi(klon_glo)= rlatu(jj+1)
    9497    lonfi(klon_glo)= 0.
    95     cufi(klon_glo) = cu((iim+1)*jjm+1)
    96     cvfi(klon_glo) = cv((iim+1)*jjm-iim)
     98    cufi(klon_glo) = cu((ii+1)*jj+1)
     99    cvfi(klon_glo) = cv((ii+1)*jj-ii)
    97100
    98101    ! build airefi(), mesh area on physics grid
    99     CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi)
     102    CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
    100103    ! Poles are single points on physics grid
    101     airefi(1)=sum(aire(1:iim,1))
    102     airefi(klon_glo)=sum(aire(1:iim,jjm+1))
     104    airefi(1)=sum(aire(1:ii,1))
     105    airefi(klon_glo)=sum(aire(1:ii,jj+1))
    103106
    104107    ! Sanity check: do total planet area match between physics and dynamics?
    105     total_area_dyn=sum(aire(1:iim,1:jjm+1))
     108    total_area_dyn=sum(aire(1:ii,1:jj+1))
    106109    total_area_phy=sum(airefi(1:klon_glo))
    107110    IF (total_area_dyn/=total_area_phy) THEN
     
    128131  CALL inifis(punjours,prad,pg,pr,pcpp)
    129132 
     133  ! copy over preff , ap(), bp(), etc
     134  CALL init_vertical_layers(nlayer,preff,scaleheight, &
     135                            ap,bp,presnivs,pseudoalt)
     136
    130137  ! Now generate local lon/lat/cu/cv/area arrays
    131138  CALL initcomgeomphy
Note: See TracChangeset for help on using the changeset viewer.