Changeset 3078
- Timestamp:
- Oct 10, 2023, 11:41:27 AM (15 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dynphy_lonlat/inigeomphy_mod.F90
r2519 r3078 12 12 klon_omp_end, & ! end index of local omp subgrid 13 13 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 15 15 USE physics_distribution_mod, ONLY : init_physics_distribution 16 16 USE regular_lonlat_mod, ONLY : init_regular_lonlat, & … … 61 61 REAL,ALLOCATABLE :: cvfi_glo(:) 62 62 REAL,ALLOCATABLE :: airefi_glo(:) 63 REAL,ALLOCATABLE :: aire_glo(:) 63 64 REAL,ALLOCATABLE :: boundslonfi_glo(:,:) 64 65 REAL,ALLOCATABLE :: boundslatfi_glo(:,:) … … 70 71 REAL,ALLOCATABLE,SAVE :: cvfi(:) 71 72 REAL,ALLOCATABLE,SAVE :: airefi(:) 73 REAL,ALLOCATABLE,SAVE :: airefi_for_outputs(:) 72 74 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 73 75 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 74 76 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) 76 79 77 80 ! Initialize Physics distibution and parameters and interface with dynamics … … 114 117 ALLOCATE(cufi_glo(klon_glo),cvfi_glo(klon_glo)) 115 118 ALLOCATE(airefi_glo(klon_glo)) 119 ALLOCATE(aire_glo(klon_glo)) 116 120 ALLOCATE(boundslonfi_glo(klon_glo,4)) 117 121 ALLOCATE(boundslatfi_glo(klon_glo,4)) … … 173 177 airefi_glo(1)=sum(aire(1:iim,1)) 174 178 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) 175 182 176 183 ! Sanity check: do total planet area match between physics and dynamics? … … 194 201 cvfi_glo(1)=cv(1) 195 202 airefi_glo(1)=aire(1,1) 203 aire_glo(1)=aire(1,1) 196 204 boundslonfi_glo(1,north_east)=rlonu(1) 197 205 boundslatfi_glo(1,north_east)=PI/2 … … 208 216 ALLOCATE(latfi(klon_omp),lonfi(klon_omp),cufi(klon_omp),cvfi(klon_omp)) 209 217 ALLOCATE(airefi(klon_omp)) 218 ALLOCATE(airefi_for_outputs(klon_omp)) 210 219 ALLOCATE(boundslonfi(klon_omp,4)) 211 220 ALLOCATE(boundslatfi(klon_omp,4)) … … 215 224 offset = klon_mpi_begin - 1 216 225 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) 217 228 cufi(1:klon_omp) = cufi_glo(offset+klon_omp_begin:offset+klon_omp_end) 218 229 cvfi(1:klon_omp) = cvfi_glo(offset+klon_omp_begin:offset+klon_omp_end) … … 227 238 airefi,ind_cell_glo_fi,cufi,cvfi) 228 239 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 229 243 ! copy over preff , ap(), bp(), etc 230 244 CALL init_vertical_layers(nlayer,preff,scaleheight, & -
trunk/LMDZ.COMMON/libf/phy_common/geometry_mod.F90
r1682 r3078 27 27 !$OMP THREADPRIVATE(dy) 28 28 29 REAL,SAVE,ALLOCATABLE :: cell_area(:) ! area of the cell29 REAL,SAVE,ALLOCATABLE :: cell_area(:) ! area of the cell (m2) 30 30 !$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) 31 37 32 38 INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global index of a local cell … … 76 82 77 83 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 78 97 END MODULE geometry_mod 79 98 -
trunk/LMDZ.MARS/changelog.txt
r3077 r3078 4252 4252 Improve conctatnc's handling of XIOS output files (handle change in some 4253 4253 variable names, e.g. "area" or "phisfi"). 4254 4255 == 10/10/2023 == EM 4256 Enable outputing cell area with XIOS and make sure the polar grid point 4257 is correctly handled (i.e. on lon-lat grid outputs polar mesh area must 4258 be adjusted to account for the replicated polar meshes). 4259 -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3042 r3078 50 50 & mlayer,layer ! soil mid layer depths 51 51 use geometry_mod, only: longitude, latitude, cell_area, 52 & longitude_deg52 & cell_area_for_lonlat_outputs,longitude_deg 53 53 use comgeomfi_h, only: sinlon, coslon, sinlat, coslat 54 54 use surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, … … 110 110 use wxios, only: wxios_context_init, xios_context_finalize 111 111 #endif 112 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured 112 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured, 113 & regular_lonlat 113 114 use ioipsl_getin_p_mod, only: getin_p 114 115 use comslope_mod, ONLY: nslope,def_slope,def_slope_mean, … … 3172 3173 call write_output("phisfi","Surface geopotential", 3173 3174 & "m2s-2",phisfi(:)) 3175 if (grid_type == regular_lonlat) then 3176 call write_output("area","Mesh area","m2", 3177 & cell_area_for_lonlat_outputs) 3178 else ! unstructured grid (e.g. dynamico) 3179 call write_output("area","Mesh area","m2",cell_area) 3180 endif 3174 3181 call write_output("tsurf","Surface temperature","K", 3175 3182 & tsurf(:,iflat))
Note: See TracChangeset
for help on using the changeset viewer.