Ignore:
Timestamp:
Oct 10, 2023, 11:41:27 AM (15 months ago)
Author:
emillour
Message:

Common physics/dynamics:
Add, for lon-lat outputs, a cell_area_for_lonlat_outputs()
field where polar mesh areas are adapted to match those
of the dynamics grid (where polar mesh points are replicated
along longitudes).

Mars PCM:
Enable outputing cell area with XIOS and make sure the polar grid point
is correctly handled (i.e. on lon-lat grid outputs polar mesh area must
be adjusted to account for the replicated polar meshes).

EM

Location:
trunk/LMDZ.COMMON/libf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dynphy_lonlat/inigeomphy_mod.F90

    r2519 r3078  
    1212                                klon_omp_end, & ! end index of local omp subgrid
    1313                                klon_mpi_begin ! start indes of columns (on local mpi grid)
    14   USE geometry_mod, ONLY : init_geometry
     14  USE geometry_mod, ONLY : init_geometry, init_geometry_cell_area_for_outputs
    1515  USE physics_distribution_mod, ONLY : init_physics_distribution
    1616  USE regular_lonlat_mod, ONLY : init_regular_lonlat, &
     
    6161  REAL,ALLOCATABLE :: cvfi_glo(:)
    6262  REAL,ALLOCATABLE :: airefi_glo(:)
     63  REAL,ALLOCATABLE :: aire_glo(:)
    6364  REAL,ALLOCATABLE :: boundslonfi_glo(:,:)
    6465  REAL,ALLOCATABLE :: boundslatfi_glo(:,:)
     
    7071  REAL,ALLOCATABLE,SAVE :: cvfi(:)
    7172  REAL,ALLOCATABLE,SAVE :: airefi(:)
     73  REAL,ALLOCATABLE,SAVE :: airefi_for_outputs(:)
    7274  REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:)
    7375  REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:)
    7476  INTEGER,ALLOCATABLE,SAVE :: ind_cell_glo_fi(:)
    75 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi,ind_cell_glo_fi)
     77!$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,airefi_for_outputs)
     78!$OMP THREADPRIVATE (boundslonfi,boundslatfi,ind_cell_glo_fi)
    7679
    7780  ! Initialize Physics distibution and parameters and interface with dynamics
     
    114117  ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo))
    115118  ALLOCATE(airefi_glo(klon_glo))
     119  ALLOCATE(aire_glo(klon_glo))
    116120  ALLOCATE(boundslonfi_glo(klon_glo,4))
    117121  ALLOCATE(boundslatfi_glo(klon_glo,4))
     
    173177    airefi_glo(1)=sum(aire(1:iim,1))
    174178    airefi_glo(klon_glo)=sum(aire(1:iim,jjm+1))
     179    ! but we also want to store mesh area with poles as on dyn grid
     180    ! (for lon-lat outputs)
     181    CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,aire_glo)
    175182
    176183    ! Sanity check: do total planet area match between physics and dynamics?
     
    194201    cvfi_glo(1)=cv(1)
    195202    airefi_glo(1)=aire(1,1)
     203    aire_glo(1)=aire(1,1)
    196204    boundslonfi_glo(1,north_east)=rlonu(1)
    197205    boundslatfi_glo(1,north_east)=PI/2
     
    208216  ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp))
    209217  ALLOCATE(airefi(klon_omp))
     218  ALLOCATE(airefi_for_outputs(klon_omp))
    210219  ALLOCATE(boundslonfi(klon_omp,4))
    211220  ALLOCATE(boundslatfi(klon_omp,4))
     
    215224  offset = klon_mpi_begin - 1
    216225  airefi(1:klon_omp) = airefi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     226  airefi_for_outputs(1:klon_omp) = &
     227                         aire_glo(offset+klon_omp_begin:offset+klon_omp_end)
    217228  cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end)
    218229  cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end)
     
    227238                     airefi,ind_cell_glo_fi,cufi,cvfi)
    228239
     240  ! copy over lon-lat mesh area for outputs (with polar "correction")
     241  CALL init_geometry_cell_area_for_outputs(klon_omp,airefi_for_outputs)
     242
    229243  ! copy over preff , ap(), bp(), etc
    230244  CALL init_vertical_layers(nlayer,preff,scaleheight, &
  • trunk/LMDZ.COMMON/libf/phy_common/geometry_mod.F90

    r1682 r3078  
    2727!$OMP THREADPRIVATE(dy)
    2828
    29   REAL,SAVE,ALLOCATABLE :: cell_area(:)      ! area of the cell
     29  REAL,SAVE,ALLOCATABLE :: cell_area(:) ! area of the cell (m2)
    3030!$OMP THREADPRIVATE(cell_area)
     31
     32  REAL,SAVE,ALLOCATABLE :: cell_area_for_lonlat_outputs(:)
     33                           ! for lon-lat outputs only: area of the cell
     34                           ! but with polar values as in dyn grid
     35                           ! (with replicated polar grid point)
     36!$OMP THREADPRIVATE(cell_area_for_lonlat_outputs)
    3137
    3238  INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:)      ! global index of a local cell
     
    7682
    7783
     84  SUBROUTINE init_geometry_cell_area_for_outputs(klon, &
     85                                                 cell_area_for_lonlat_outputs_)
     86  IMPLICIT NONE
     87  INTEGER,INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
     88  REAL,INTENT(IN) :: cell_area_for_lonlat_outputs_(klon) ! tweaked lon-lat mesh
     89                     ! cell areas where polar values are as on dyn lon-lat grid
     90                     ! for outputs
     91 
     92  ALLOCATE(cell_area_for_lonlat_outputs(klon))
     93  cell_area_for_lonlat_outputs(1:klon)=cell_area_for_lonlat_outputs_(1:klon)
     94 
     95  END SUBROUTINE init_geometry_cell_area_for_outputs
     96
    7897END MODULE geometry_mod
    7998
Note: See TracChangeset for help on using the changeset viewer.