Ignore:
Timestamp:
Apr 5, 2016, 10:51:51 AM (9 years ago)
Author:
emillour
Message:

Generic GCM: Towards a cleaner separation between physics and dynamics

  • Got rid of references to "dimensions.h" from physics packages: use nbp_lon (=iim), nbp_lat (=jjp1) and nbp_lev from module mod_grid_phy_lmdz (in phy_common) instead.
  • Removed module "comhdiff_mod.F90", as it is only used by module surf_heat_transp_mod.F90, moved module variables there.
  • Addedin "surf_heat_transp_mod" local versions of some arrays and routines (from dyn3d) required to compute gradient, divergence, etc. on the global dynamics grid. As before, the slab ocean only works in serial.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/iniphysiq_mod.F90

    r1525 r1529  
    44
    55subroutine iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep,           &
    6                      rlatu,rlatv,rlonu,rlonv,aire,cu,cv,                 &
     6               rlatudyn,rlatvdyn,rlonudyn,rlonvdyn,airedyn,cudyn,cvdyn,  &
    77                     prad,pg,pr,pcpp,iflag_phys)
    88
     
    2121                       rlond, & ! longitudes
    2222                       rlatd ! latitudes
     23use surf_heat_transp_mod, only: ini_surf_heat_transp
    2324use infotrac, only : nqtot ! number of advected tracers
    2425use planete_mod, only: ini_planete_mod
     
    2930                              north_east, north_west, &
    3031                              south_west, south_east
     32use ioipsl_getin_p_mod, only: getin_p
    3133
    3234implicit none
    3335include "dimensions.h"
     36include "paramet.h"
     37include "comgeom.h"
    3438include "iniprint.h"
    3539
     
    4347integer,intent(in) :: ii ! number of atmospheric coulumns along longitudes
    4448integer,intent(in) :: jj  ! number of atompsheric columns along latitudes
    45 real,intent(in) :: rlatu(jj+1) ! latitudes of the physics grid
    46 real,intent(in) :: rlatv(jj) ! latitude boundaries of the physics grid
    47 real,intent(in) :: rlonv(ii+1) ! longitudes of the physics grid
    48 real,intent(in) :: rlonu(ii+1) ! longitude boundaries of the physics grid
    49 real,intent(in) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2)
    50 real,intent(in) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
    51 real,intent(in) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
     49real,intent(in) :: rlatudyn(jj+1) ! latitudes of the physics grid
     50real,intent(in) :: rlatvdyn(jj) ! latitude boundaries of the physics grid
     51real,intent(in) :: rlonvdyn(ii+1) ! longitudes of the physics grid
     52real,intent(in) :: rlonudyn(ii+1) ! longitude boundaries of the physics grid
     53real,intent(in) :: airedyn(ii+1,jj+1) ! area of the dynamics grid (m2)
     54real,intent(in) :: cudyn((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u)
     55real,intent(in) :: cvdyn((ii+1)*jj) ! cv coeff. (v_covariant = cv * v)
    5256integer,intent(in) :: pdayref ! reference day of for the simulation
    5357real,intent(in) :: ptimestep !physics time step (s)
     
    6064real :: total_area_phy, total_area_dyn
    6165real :: pi
     66logical :: ok_slab_ocean
    6267
    6368! boundaries, on global grid
     
    99104 
    100105DO i=1,ii
    101    boundslon_reg(i,east)=rlonu(i)
    102    boundslon_reg(i,west)=rlonu(i+1)
     106   boundslon_reg(i,east)=rlonudyn(i)
     107   boundslon_reg(i,west)=rlonudyn(i+1)
    103108ENDDO
    104109
    105110boundslat_reg(1,north)= PI/2
    106 boundslat_reg(1,south)= rlatv(1)
     111boundslat_reg(1,south)= rlatvdyn(1)
    107112DO j=2,jj
    108    boundslat_reg(j,north)=rlatv(j-1)
    109    boundslat_reg(j,south)=rlatv(j)
     113   boundslat_reg(j,north)=rlatvdyn(j-1)
     114   boundslat_reg(j,south)=rlatvdyn(j)
    110115ENDDO
    111 boundslat_reg(jj+1,north)= rlatv(jj)
     116boundslat_reg(jj+1,north)= rlatvdyn(jj)
    112117boundslat_reg(jj+1,south)= -PI/2
    113118
    114119! Write values in module regular_lonlat_mod
    115 CALL init_regular_lonlat(ii,jj+1, rlonv(1:ii), rlatu, &
     120CALL init_regular_lonlat(ii,jj+1, rlonvdyn(1:ii), rlatudyn, &
    116121                         boundslon_reg, boundslat_reg)
    117122
    118123! Generate global arrays on full physics grid
    119124allocate(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo))
    120 latfi(1)=rlatu(1)
     125latfi(1)=rlatudyn(1)
    121126lonfi(1)=0.
    122 cufi(1) = cu(1)
    123 cvfi(1) = cv(1)
     127cufi(1) = cudyn(1)
     128cvfi(1) = cvdyn(1)
    124129DO j=2,jj
    125130  DO i=1,ii
    126     latfi((j-2)*ii+1+i)= rlatu(j)
    127     lonfi((j-2)*ii+1+i)= rlonv(i)
    128     cufi((j-2)*ii+1+i) = cu((j-1)*(ii+1)+i)
    129     cvfi((j-2)*ii+1+i) = cv((j-1)*(ii+1)+i)
     131    latfi((j-2)*ii+1+i)= rlatudyn(j)
     132    lonfi((j-2)*ii+1+i)= rlonvdyn(i)
     133    cufi((j-2)*ii+1+i) = cudyn((j-1)*(ii+1)+i)
     134    cvfi((j-2)*ii+1+i) = cvdyn((j-1)*(ii+1)+i)
    130135  ENDDO
    131136ENDDO
    132 latfi(klon_glo)= rlatu(jj+1)
     137latfi(klon_glo)= rlatudyn(jj+1)
    133138lonfi(klon_glo)= 0.
    134 cufi(klon_glo) = cu((ii+1)*jj+1)
    135 cvfi(klon_glo) = cv((ii+1)*jj-ii)
     139cufi(klon_glo) = cudyn((ii+1)*jj+1)
     140cvfi(klon_glo) = cvdyn((ii+1)*jj-ii)
    136141
    137142! build airefi(), mesh area on physics grid
    138143allocate(airefi(klon_glo))
    139 CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi)
     144CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,airedyn,airefi)
    140145! Poles are single points on physics grid
    141 airefi(1)=sum(aire(1:ii,1))
    142 airefi(klon_glo)=sum(aire(1:ii,jj+1))
     146airefi(1)=sum(airedyn(1:ii,1))
     147airefi(klon_glo)=sum(airedyn(1:ii,jj+1))
    143148
    144149! Sanity check: do total planet area match between physics and dynamics?
    145 total_area_dyn=sum(aire(1:ii,1:jj+1))
     150total_area_dyn=sum(airedyn(1:ii,1:jj+1))
    146151total_area_phy=sum(airefi(1:klon_glo))
    147152IF (total_area_dyn/=total_area_phy) THEN
     
    174179call ini_planete_mod(nlayer,preff,ap,bp)
    175180
     181! for slab ocean, copy over some arrays
     182ok_slab_ocean=.false. ! default value
     183call getin_p("ok_slab_ocean",ok_slab_ocean)
     184if (ok_slab_ocean) then
     185  call ini_surf_heat_transp(ip1jm,ip1jmp1,unsairez,fext,unsaire, &
     186                            cu,cuvsurcv,cv,cvusurcu,aire,apoln,apols, &
     187                            aireu,airev)
     188endif
     189
    176190! copy some fundamental parameters to physics
    177191! and do some initializations
Note: See TracChangeset for help on using the changeset viewer.