Changeset 1682
- Timestamp:
- Mar 31, 2017, 11:31:38 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DOC/chantiers/commit_importants.log
r1650 r1682 1960 1960 * misc 1961 1961 - wxios.F90 : follow up on changes in LMDZ5 1962 1963 ********************** 1964 **** commit_v1682 **** 1965 ********************** 1966 Ehouarn: set things up to enable pluging physics with dynamico 1967 1968 * dyn3d 1969 - gcm.F90 : move I/O initialization (dates) to be done before physics 1970 initialization 1971 1972 * dyn3dpar 1973 - gcm.F : move I/O initialization (dates) to be done before physics 1974 initialization 1975 1976 * dynphy_lonlat: 1977 - inigeomphy_mod.F90 : add ind_cell_glo computation and transfer 1978 to init_geometry 1979 1980 * phy_common: 1981 - geometry_mod.F90 : add ind_cell_glo module variable to store global 1982 column index 1983 - print_control_mod.F90 : make initialization occur via init_print_control_mod 1984 to avoid circular module dependencies 1985 - init_print_control_mod.F90 : added to initialize print_control_mod module 1986 variables 1987 - mod_phys_lmdz_mpi_data.F90 : use print_control_mod (rather than iniprint.h) 1988 - mod_phys_lmdz_para.F90 : use print_control_mod (rather than iniprint.h) 1989 - mod_phys_lmdz_omp_data.F90 : add is_omp_master (alias of is_omp_root) module 1990 variable and use print_control_mod (rather than 1991 iniprint.h) 1992 - physics_distribution_mod.F90 : add call to init_dimphy in 1993 init_physics_distribution 1994 - xios_writefield.F90 : generic routine to output field with XIOS (for debug) 1995 1996 * misc: 1997 - handle_err_m.F90 : call abort_physic, rather than abort_gcm 1998 - wxios.F90 : updates to enable unstructured grids 1999 set module variable g_ctx_name to "LMDZ" 2000 wxios_init(): remove call to wxios_context_init 2001 wxios_context_init(): call xios_context_initialize with COMM_LMDZ_PHY 2002 add routine wxios_set_context() to get handle and set context to XIOS 2003 wxios_domain_param(): change arguments and generate the domain in-place 2004 add wxios_domain_param_unstructured(): generate domain for unstructured case 2005 NB: access is via "domain group" (whereas it is via "domain" in 2006 wxios_domain_param) 2007 * dynphy_lonlat/phy[std|mars|venus|titan]: 2008 - iniphysiq_mod.F90 : Remove call to init_dimphy (which is now done in 2009 phy_common/physics_distribution_mod.F90) 2010 2011 * phystd: 2012 - ocean_slab_mod.F90 : call abort_physic, rather than abort_gcm 2013 - inifis_mod.F90 : initialize print_control variables 2014 - physiq_mod.F90 : add XIOS context initialization and finalization 2015 - xios_output_mod.F90 : update initialize_xios_output initialization 2016 of the horizontal domain 2017 -
trunk/LMDZ.COMMON/libf/dyn3d/gcm.F90
r1672 r1682 417 417 418 418 !----------------------------------------------------------------------- 419 ! Initialisation de la physique :420 ! -------------------------------421 422 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN423 ! Physics:424 #ifdef CPP_PHYS425 CALL iniphysiq(iim,jjm,llm, &426 (jjm-1)*iim+2,comm_lmdz, &427 daysec,day_ini,dtphys/nsplit_phys, &428 rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, &429 iflag_phys)430 #endif431 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100))432 433 !-----------------------------------------------------------------------434 419 ! Initialisation des I/O : 435 420 ! ------------------------ … … 465 450 #endif 466 451 452 453 !----------------------------------------------------------------------- 454 ! Initialisation de la physique : 455 ! ------------------------------- 456 457 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN 458 ! Physics: 459 #ifdef CPP_PHYS 460 CALL iniphysiq(iim,jjm,llm, & 461 (jjm-1)*iim+2,comm_lmdz, & 462 daysec,day_ini,dtphys/nsplit_phys, & 463 rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, & 464 iflag_phys) 465 #endif 466 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) 467 468 467 469 if (planet_type=="mars") then 468 470 ! For Mars we transmit day_ini -
trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F
r1672 r1682 441 441 442 442 c----------------------------------------------------------------------- 443 c Initialisation de la physique :444 c -------------------------------445 446 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN447 ! latfi(1)=rlatu(1)448 ! lonfi(1)=0.449 ! zcufi(1) = cu(1)450 ! zcvfi(1) = cv(1)451 ! DO j=2,jjm452 ! DO i=1,iim453 ! latfi((j-2)*iim+1+i)= rlatu(j)454 ! lonfi((j-2)*iim+1+i)= rlonv(i)455 ! zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)456 ! zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)457 ! ENDDO458 ! ENDDO459 ! latfi(ngridmx)= rlatu(jjp1)460 ! lonfi(ngridmx)= 0.461 ! zcufi(ngridmx) = cu(ip1jm+1)462 ! zcvfi(ngridmx) = cv(ip1jm-iim)463 464 ! build airefi(), mesh area on physics grid465 ! CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)466 ! Poles are single points on physics grid467 ! airefi(1)=airefi(1)*iim468 ! airefi(ngridmx)=airefi(ngridmx)*iim469 470 ! Physics471 #ifdef CPP_PHYS472 ! CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,473 ! & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,474 ! & iflag_phys)475 CALL iniphysiq(iim,jjm,llm,476 & distrib_phys(mpi_rank),comm_lmdz,477 & daysec,day_ini,dtphys/nsplit_phys,478 & rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,479 & iflag_phys)480 #endif481 ! call_iniphys=.false.482 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100))483 484 485 c-----------------------------------------------------------------------486 443 c Initialisation des I/O : 487 444 c ------------------------ … … 519 476 #endif 520 477 478 479 c----------------------------------------------------------------------- 480 c Initialisation de la physique : 481 c ------------------------------- 482 483 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN 484 ! Physics 485 #ifdef CPP_PHYS 486 CALL iniphysiq(iim,jjm,llm, 487 & distrib_phys(mpi_rank),comm_lmdz, 488 & daysec,day_ini,dtphys/nsplit_phys, 489 & rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp, 490 & iflag_phys) 491 #endif 492 ! call_iniphys=.false. 493 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) 494 495 521 496 if (planet_type=="mars") then 522 497 ! For Mars we transmit day_ini -
trunk/LMDZ.COMMON/libf/dynphy_lonlat/inigeomphy_mod.F90
r1621 r1682 73 73 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 74 74 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 75 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi) 75 INTEGER,ALLOCATABLE,SAVE :: ind_cell_glo_fi(:) 76 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi,ind_cell_glo_fi) 76 77 77 78 ! Initialize Physics distibution and parameters and interface with dynamics … … 201 202 ALLOCATE(boundslonfi(klon_omp,4)) 202 203 ALLOCATE(boundslatfi(klon_omp,4)) 203 ! CALL initcomgeomphy 204 ALLOCATE(ind_cell_glo_fi(klon_omp)) 205 204 206 205 207 offset = klon_mpi_begin - 1 … … 211 213 boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 212 214 boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 215 ind_cell_glo_fi(1:klon_omp)=(/ (i,i=offset+klon_omp_begin,offset+klon_omp_end) /) 213 216 214 217 ! copy over local grid longitudes and latitudes 215 218 CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, & 216 airefi, cufi,cvfi)219 airefi,ind_cell_glo_fi,cufi,cvfi) 217 220 218 221 ! copy over preff , ap(), bp(), etc -
trunk/LMDZ.COMMON/libf/dynphy_lonlat/phyvenus/iniphysiq_mod.F90
r1621 r1682 72 72 !$OMP PARALLEL 73 73 74 ! Initialize dimphy module 75 call init_dimphy(klon_omp,nlayer)74 ! Initialize dimphy module => Now done in physics_distribution_mod 75 !call init_dimphy(klon_omp,nlayer) 76 76 77 77 ! Initialize some physical constants -
trunk/LMDZ.COMMON/libf/misc/handle_err_m.F90
r1391 r1682 39 39 end if 40 40 end if 41 call abort_ gcm("NetCDF95 handle_err", "", 1)41 call abort_physic("NetCDF95 handle_err", "", 1) 42 42 end if 43 43 -
trunk/LMDZ.COMMON/libf/misc/wxios.F90
r1650 r1682 15 15 16 16 INTEGER, SAVE :: g_comm 17 CHARACTER(len=100), SAVE :: g_ctx_name 17 CHARACTER(len=100), SAVE :: g_ctx_name ="LMDZ" 18 18 TYPE(xios_context), SAVE :: g_ctx 19 19 !$OMP THREADPRIVATE(g_comm,g_cts_name,g_ctx) … … 136 136 g_ctx_name = xios_ctx_name 137 137 138 ! Si couple alors init fait dans cpl_init139 IF (.not. PRESENT(type_ocean)) THEN140 CALL wxios_context_init()141 ENDIF138 ! ! Si couple alors init fait dans cpl_init 139 ! IF (.not. PRESENT(type_ocean)) THEN 140 ! CALL wxios_context_init() 141 ! ENDIF 142 142 143 143 END SUBROUTINE wxios_init … … 145 145 SUBROUTINE wxios_context_init() 146 146 USE print_control_mod, ONLY : prt_level, lunout 147 !USE mod_phys_lmdz_mpi_data, ONLY : COMM_LMDZ_PHY147 USE mod_phys_lmdz_mpi_data, ONLY : COMM_LMDZ_PHY 148 148 IMPLICIT NONE 149 149 … … 152 152 !$OMP MASTER 153 153 !Initialisation du contexte: 154 CALL xios_context_initialize(g_ctx_name, g_comm)154 CALL xios_context_initialize(g_ctx_name, COMM_LMDZ_PHY) 155 155 CALL xios_get_handle(g_ctx_name, xios_ctx) !Récupération 156 156 CALL xios_set_current_context(xios_ctx) !Activation … … 165 165 !$OMP END MASTER 166 166 END SUBROUTINE wxios_context_init 167 168 169 SUBROUTINE wxios_set_context() 170 IMPLICIT NONE 171 TYPE(xios_context) :: xios_ctx 172 173 !$OMP MASTER 174 CALL xios_get_handle(g_ctx_name, xios_ctx) !Récupération 175 CALL xios_set_current_context(xios_ctx) !Activation 176 !$OMP END MASTER 177 178 END SUBROUTINE wxios_set_context 167 179 168 180 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 203 215 CASE DEFAULT 204 216 abort_message = 'wxios_set_cal: Mauvais choix de calendrier' 205 CALL abort_ gcm('Gcm:Xios',abort_message,1)217 CALL abort_physic('Gcm:Xios',abort_message,1) 206 218 END SELECT 207 219 … … 210 222 211 223 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date 224 212 225 CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0)) 213 226 … … 237 250 ! Pour initialiser un domaine !!!!!!!!!!!!!!!!!!!! 238 251 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 239 SUBROUTINE wxios_domain_param(dom_id, is_sequential, ni, nj, ni_glo, nj_glo, & 240 ibegin, iend, ii_begin, ii_end, jbegin, jend, & 241 data_ni, data_ibegin, data_iend, & 242 io_lat, io_lon,is_south_pole,mpi_rank) 243 244 245 USE print_control_mod, ONLY : prt_level, lunout 246 IMPLICIT NONE 247 252 SUBROUTINE wxios_domain_param(dom_id,flip_coordinates) 253 USE dimphy, only: klon 254 USE mod_phys_lmdz_transfert_para, ONLY: gather, bcast 255 USE mod_phys_lmdz_para, only: jj_nb, jj_begin, jj_end, ii_begin, ii_end, & 256 mpi_size, mpi_rank, klon_mpi, & 257 is_sequential, is_south_pole_dyn 258 USE mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, klon_glo 259 USE print_control_mod, ONLY : prt_level, lunout 260 USE geometry_mod 261 262 IMPLICIT NONE 248 263 CHARACTER(len=*),INTENT(IN) :: dom_id ! domain identifier 249 LOGICAL,INTENT(IN) :: is_sequential ! flag 250 INTEGER,INTENT(IN) :: ni ! local MPI domain number of longitudes 251 INTEGER,INTENT(IN) :: nj ! local MPI domain number of latitudes 252 INTEGER,INTENT(IN) :: ni_glo ! global grid number of longitudes 253 INTEGER,INTENT(IN) :: nj_glo ! global grid number of latitudes 254 INTEGER,INTENT(IN) :: ibegin ! start index, on global grid, of local MPI domain 255 INTEGER,INTENT(IN) :: iend ! end index, on global grid, of local MPI domain 256 INTEGER,INTENT(IN) :: ii_begin ! i index at which local data starts (first row) 257 INTEGER,INTENT(IN) :: ii_end ! i index at which local data ends (last row) 258 INTEGER,INTENT(IN) :: jbegin ! start index, on global grid, of local MPI domain 259 INTEGER,INTENT(IN) :: jend ! end index, on global grid, of local MPI domain 260 INTEGER,INTENT(IN) :: data_ni 261 INTEGER,INTENT(IN) :: data_ibegin 262 INTEGER,INTENT(IN) :: data_iend 263 REAL,INTENT(IN) :: io_lat(:) ! latitudes (of global grid) 264 REAL,INTENT(IN) :: io_lon(:) ! longitudes (of global grid) 265 logical,intent(in) :: is_south_pole ! does this process include the south pole? 266 integer,intent(in) :: mpi_rank ! rank of process 267 264 LOGICAL,OPTIONAL,INTENT(IN) :: flip_coordinates ! .true. to change signs 265 ! of coordinates 266 LOGICAL :: flip_axes=.false. ! default; do not swap axes 267 REAL :: rlat_glo(klon_glo) 268 REAL :: rlon_glo(klon_glo) 269 REAL :: io_lat(nbp_lat) 270 REAL :: io_lon(nbp_lon) 271 LOGICAL :: mask(nbp_lon,jj_nb) !Masque pour les problèmes de recouvrement MPI 268 272 TYPE(xios_domain) :: dom 273 INTEGER :: i 269 274 LOGICAL :: boool 270 275 271 !Masque pour les problèmes de recouvrement MPI: 272 LOGICAL :: mask(ni,nj) 276 277 IF (flip_axes) THEN 278 ! change signs of axes 279 CALL gather(-latitude_deg,rlat_glo) 280 CALL bcast(rlat_glo) 281 CALL gather(-longitude_deg,rlon_glo) 282 CALL bcast(rlon_glo) 283 ELSE 284 CALL gather(latitude_deg,rlat_glo) 285 CALL bcast(rlat_glo) 286 CALL gather(longitude_deg,rlon_glo) 287 CALL bcast(rlon_glo) 288 ENDIF 289 290 !$OMP MASTER 291 io_lat(1)=rlat_glo(1) 292 io_lat(nbp_lat)=rlat_glo(klon_glo) 293 IF ((nbp_lon*nbp_lat) > 1) then 294 DO i=2,nbp_lat-1 295 io_lat(i)=rlat_glo(2+(i-2)*nbp_lon) 296 ENDDO 297 ENDIF 298 299 IF (klon_glo == 1) THEN 300 io_lon(1)=rlon_glo(1) 301 ELSE 302 io_lon(1:nbp_lon)=rlon_glo(2:nbp_lon+1) 303 ENDIF 304 273 305 274 306 !On récupère le handle: 275 307 CALL xios_get_domain_handle(dom_id, dom) 276 308 277 IF (prt_level >= 10) THEN278 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ni:",ni," ni_glo:", ni_glo, " nj:", nj, " nj_glo:", nj_glo279 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ibegin:",ibegin," iend:", iend, " jbegin:", jbegin, " jend:", jend280 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ii_begin:",ii_begin," ii_end:", ii_end281 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," Size io_lon:", SIZE(io_lon(ibegin:iend)), " io_lat:", SIZE(io_lat(jbegin:jend))282 ENDIF283 284 309 !On parametrise le domaine: 285 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni, type="rectilinear") 286 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2) 287 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend)) 310 CALL xios_set_domain_attr_hdl(dom, ni_glo=nbp_lon, ibegin=0, ni=nbp_lon, type="rectilinear") 311 CALL xios_set_domain_attr_hdl(dom, nj_glo=nbp_lat, jbegin=jj_begin-1, nj=jj_nb, data_dim=2) 312 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(1:nbp_lon), latvalue_1d=io_lat(jj_begin:jj_end)) 313 288 314 IF (.NOT.is_sequential) THEN 289 315 mask(:,:)=.TRUE. 290 316 if (ii_begin>1) mask(1:ii_begin-1,1) = .FALSE. 291 if (ii_end<n i) mask(ii_end+1:ni,nj) = .FALSE.317 if (ii_end<nbp_lon) mask(ii_end+1:nbp_lon,jj_nb) = .FALSE. 292 318 ! special case for south pole 293 if ((ii_end .eq.1).and.(is_south_pole)) mask(1:ni,nj)=.true.319 if ((ii_end==1).and.(is_south_pole_dyn)) mask(1:nbp_lon,jj_nb)=.true. 294 320 IF (prt_level >= 10) THEN 295 321 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,1)=",mask(:,1) 296 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:, nj)=",mask(:,nj)322 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,jj_nb)=",mask(:,jj_nb) 297 323 ENDIF 298 324 CALL xios_set_domain_attr_hdl(dom, mask_2d=mask) … … 306 332 IF (prt_level >= 10) WRITE(lunout,*) "wxios_domain_param: Invalid domain: ", trim(dom_id) 307 333 END IF 334 !$OMP END MASTER 335 308 336 END SUBROUTINE wxios_domain_param 309 337 338 339 SUBROUTINE wxios_domain_param_unstructured(dom_id,flip_coordinates) 340 USE geometry_mod, ONLY : longitude, latitude, boundslon, boundslat,ind_cell_glo 341 USE mod_grid_phy_lmdz, ONLY : nvertex, klon_glo 342 USE mod_phys_lmdz_para 343 USE nrtype, ONLY : PI 344 IMPLICIT NONE 345 CHARACTER(len=*),INTENT(IN) :: dom_id ! domain identifier 346 LOGICAL,OPTIONAL,INTENT(IN) :: flip_coordinates ! .true. to change signs 347 ! of coordinates 348 LOGICAL :: flip_axes=.false. ! default; do not swap axes 349 REAL :: lon_mpi(klon_mpi) 350 REAL :: lat_mpi(klon_mpi) 351 REAL :: boundslon_mpi(klon_mpi,nvertex) 352 REAL :: boundslat_mpi(klon_mpi,nvertex) 353 INTEGER :: ind_cell_glo_mpi(klon_mpi) 354 TYPE(xios_domaingroup) :: dom 355 356 IF (PRESENT(flip_coordinates)) flip_axes=flip_coordinates 357 358 IF (flip_axes) THEN 359 ! change signs of axes and boundaries 360 CALL gather_omp(-longitude*180/PI,lon_mpi) 361 CALL gather_omp(-latitude*180/PI,lat_mpi) 362 CALL gather_omp(-boundslon*180/PI,boundslon_mpi) 363 CALL gather_omp(-boundslat*180/PI,boundslat_mpi) 364 ELSE 365 CALL gather_omp(longitude*180/PI,lon_mpi) 366 CALL gather_omp(latitude*180/PI,lat_mpi) 367 CALL gather_omp(boundslon*180/PI,boundslon_mpi) 368 CALL gather_omp(boundslat*180/PI,boundslat_mpi) 369 ENDIF 370 CALL gather_omp(ind_cell_glo,ind_cell_glo_mpi) 371 372 373 !$OMP MASTER 374 CALL xios_get_domaingroup_handle(dom_id, dom) 375 376 !On parametrise le domaine: 377 CALL xios_set_attr(dom, ni_glo=klon_glo, ibegin=ij_begin-1, ni=ij_nb, type="unstructured") 378 CALL xios_set_attr(dom, nvertex=nvertex, lonvalue_1d=lon_mpi, latvalue_1d=lat_mpi, & 379 bounds_lon_1d=TRANSPOSE(boundslon_mpi), bounds_lat_1d=TRANSPOSE(boundslat_mpi) ) 380 CALL xios_set_attr(dom, i_index=ind_cell_glo_mpi(:)-1) 381 !$OMP END MASTER 382 383 END SUBROUTINE wxios_domain_param_unstructured 384 385 386 387 310 388 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 311 389 ! Pour déclarer un axe vertical !!!!!!!!!!!!!!! -
trunk/LMDZ.COMMON/libf/phy_common/geometry_mod.F90
r1543 r1682 30 30 !$OMP THREADPRIVATE(cell_area) 31 31 32 INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global index of a local cell 33 !$OMP THREADPRIVATE(ind_cell_glo) 32 34 33 35 CONTAINS … … 35 37 SUBROUTINE init_geometry(klon,longitude_,latitude_, & 36 38 boundslon_,boundslat_, & 37 cell_area_, dx_,dy_)39 cell_area_,ind_cell_glo_,dx_,dy_) 38 40 USE mod_grid_phy_lmdz, ONLY: nvertex 39 41 USE nrtype, ONLY : PI … … 45 47 REAL,INTENT(IN) :: boundslat_(klon,nvertex) 46 48 REAL,INTENT(IN) :: cell_area_(klon) 49 INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon) 47 50 REAL,OPTIONAL,INTENT(IN) :: dx_(klon) 48 51 REAL,OPTIONAL,INTENT(IN) :: dy_(klon) … … 55 58 ALLOCATE(boundslat(klon,nvertex)) 56 59 ALLOCATE(cell_area(klon)) 60 IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) 57 61 IF (PRESENT(dx_)) ALLOCATE(dx(klon)) 58 62 IF (PRESENT(dy_))ALLOCATE(dy(klon)) … … 65 69 boundslat(:,:) = boundslat_(:,:) 66 70 cell_area(:) = cell_area_(:) 71 IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) 67 72 IF (PRESENT(dx_)) dx(:) = dx_(:) 68 73 IF (PRESENT(dy_)) dy(:) = dy_(:) -
trunk/LMDZ.COMMON/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r1572 r1682 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_data 5 ! USE mod_const_mpi6 5 7 6 INTEGER,SAVE :: ii_begin … … 36 35 INTEGER,SAVE :: mpi_size 37 36 INTEGER,SAVE :: mpi_master 38 ! INTEGER,SAVE :: mpi_root39 37 LOGICAL,SAVE :: is_mpi_root 40 38 LOGICAL,SAVE :: is_using_mpi … … 48 46 CONTAINS 49 47 50 ! SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)51 48 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator) 52 ! USE mod_const_mpi, ONLY : COMM_LMDZ53 49 IMPLICIT NONE 54 50 #ifdef CPP_MPI 55 51 INCLUDE 'mpif.h' 56 52 #endif 57 INTEGER,INTENT( in) :: nbp58 INTEGER,INTENT( in) :: nbp_lon59 INTEGER,INTENT( in) :: nbp_lat60 INTEGER,INTENT( in) :: communicator53 INTEGER,INTENT(IN) :: nbp 54 INTEGER,INTENT(IN) :: nbp_lon 55 INTEGER,INTENT(IN) :: nbp_lat 56 INTEGER,INTENT(IN) :: communicator 61 57 62 58 INTEGER,ALLOCATABLE :: distrib(:) … … 187 183 188 184 SUBROUTINE print_module_data 189 !USE print_control_mod, ONLY: lunout185 USE print_control_mod, ONLY: lunout 190 186 IMPLICIT NONE 191 INCLUDE "iniprint.h"192 187 193 188 WRITE(lunout,*) 'ii_begin =', ii_begin -
trunk/LMDZ.COMMON/libf/phy_common/mod_phys_lmdz_omp_data.F90
r1572 r1682 7 7 INTEGER,SAVE :: omp_rank 8 8 LOGICAL,SAVE :: is_omp_root 9 LOGICAL,SAVE :: is_omp_master ! alias of is_omp_root 9 10 LOGICAL,SAVE :: is_using_omp 10 11 LOGICAL,SAVE :: is_north_pole_phy, is_south_pole_phy … … 17 18 INTEGER,SAVE :: klon_omp_begin 18 19 INTEGER,SAVE :: klon_omp_end 19 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root, klon_omp_begin,klon_omp_end)20 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,is_omp_master,klon_omp_begin,klon_omp_end) 20 21 !$OMP THREADPRIVATE(is_north_pole_phy, is_south_pole_phy) 21 22 … … 60 61 ELSE 61 62 abort_message = 'ANORMAL : OMP_MASTER /= 0' 62 CALL abort_ gcm(modname,abort_message,1)63 CALL abort_physic (modname,abort_message,1) 63 64 ENDIF 64 65 !$OMP END MASTER 65 66 is_omp_master=is_omp_root 66 67 67 68 !$OMP MASTER … … 106 107 107 108 SUBROUTINE Print_module_data 109 USE print_control_mod, ONLY: lunout 108 110 IMPLICIT NONE 109 INCLUDE "iniprint.h"110 111 111 112 !$OMP CRITICAL -
trunk/LMDZ.COMMON/libf/phy_common/mod_phys_lmdz_para.F90
r1572 r1682 19 19 SUBROUTINE Init_phys_lmdz_para(nbp,nbp_lon,nbp_lat,communicator) 20 20 IMPLICIT NONE 21 INTEGER,INTENT( in) :: nbp22 INTEGER,INTENT( in) :: nbp_lon23 INTEGER,INTENT( in) :: nbp_lat24 INTEGER,INTENT( in) :: communicator21 INTEGER,INTENT(IN) :: nbp 22 INTEGER,INTENT(IN) :: nbp_lon 23 INTEGER,INTENT(IN) :: nbp_lat 24 INTEGER,INTENT(IN) :: communicator 25 25 26 26 CALL Init_phys_lmdz_mpi_data(nbp,nbp_lon,nbp_lat,communicator) … … 49 49 SUBROUTINE Test_transfert 50 50 USE mod_grid_phy_lmdz 51 USE print_control_mod, ONLY: lunout 51 52 IMPLICIT NONE 52 INCLUDE "iniprint.h"53 53 54 54 REAL :: Test_Field1d_glo(klon_glo,nbp_lev) -
trunk/LMDZ.COMMON/libf/phy_common/physics_distribution_mod.F90
r1543 r1682 10 10 nbp, nbp_lon, nbp_lat, nbp_lev, & 11 11 communicator) 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para, klon_omp 13 13 USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz 14 USE dimphy, ONLY : Init_dimphy 15 14 16 IMPLICIT NONE 15 17 INTEGER,INTENT(IN) :: grid_type … … 24 26 CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev) 25 27 CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator) 28 !$OMP PARALLEL 29 CALL init_dimphy(klon_omp,nbp_lev) 30 !$OMP END PARALLEL 26 31 27 32 END SUBROUTINE init_physics_distribution -
trunk/LMDZ.COMMON/libf/phy_common/print_control_mod.F90
r1521 r1682 7 7 !$OMP THREADPRIVATE(lunout,prt_level,debug) 8 8 9 ! NB: Module variable Initializations done by set_print_control 10 ! routine from init_print_control_mod to avoid circular 11 ! module dependencies 12 9 13 CONTAINS 10 14 11 SUBROUTINE init_print_control 12 USE ioipsl_getin_p_mod, ONLY : getin_p 13 USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master 15 SUBROUTINE set_print_control(lunout_,prt_level_,debug_) 14 16 IMPLICIT NONE 15 16 LOGICAL :: opened 17 INTEGER :: number 17 INTEGER :: lunout_ 18 INTEGER :: prt_level_ 19 LOGICAL :: debug_ 20 21 lunout = lunout_ 22 prt_level = prt_level_ 23 debug = debug_ 18 24 19 !Config Key = prt_level 20 !Config Desc = niveau d'impressions de débogage 21 !Config Def = 0 22 !Config Help = Niveau d'impression pour le débogage 23 !Config (0 = minimum d'impression) 24 prt_level = 0 25 CALL getin_p('prt_level',prt_level) 26 27 !Config Key = lunout 28 !Config Desc = unite de fichier pour les impressions 29 !Config Def = 6 30 !Config Help = unite de fichier pour les impressions 31 !Config (defaut sortie standard = 6) 32 lunout=6 33 CALL getin_p('lunout', lunout) 34 35 IF (is_omp_root) THEN 36 IF (lunout /= 5 .and. lunout /= 6) THEN 37 INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number) 38 IF (opened) THEN 39 lunout=number 40 ELSE 41 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', & 42 STATUS='unknown',FORM='formatted') 43 ENDIF 44 ENDIF 45 ENDIF 46 47 !Config Key = debug 48 !Config Desc = mode debogage 49 !Config Def = false 50 !Config Help = positionne le mode debogage 51 52 debug = .FALSE. 53 CALL getin_p('debug',debug) 54 55 IF (is_master) THEN 56 WRITE(lunout,*)"init_print_control: prt_level=",prt_level 57 WRITE(lunout,*)"init_print_control: lunout=",lunout 58 WRITE(lunout,*)"init_print_control: debug=",debug 59 ENDIF 60 61 END SUBROUTINE init_print_control 25 END SUBROUTINE set_print_control 62 26 63 27 END MODULE print_control_mod -
trunk/LMDZ.GENERIC/README
r1673 r1682 1295 1295 >> Followup on updates in LMDZ.COMMON, add print_control_mod.F90 1296 1296 and abort_physic.F90 inphy_common 1297 1298 == 30/03/2017 == EM 1299 >> Keep up with updates in LMDZ.COMMON: 1300 In phystd: 1301 - ocean_slab_mod.F90 : call abort_physic, rather than abort_gcm 1302 - inifis_mod.F90 : initialize print_control variables 1303 - physiq_mod.F90 : add XIOS context initialization and finalization 1304 - xios_output_mod.F90 : update initialize_xios_output initialization 1305 of the horizontal domain 1306 In dynphy_lonlat : 1307 - inigeomphy_mod.F90 : add ind_cell_glo computation and transfer 1308 to init_geometry 1309 - mod_interface_dyn_phys.F90 : use is_north_pole_dyn and is_south_pole_dyn 1310 (instead of is_north_pole, is_south_pole) 1311 1312 In phy_common: 1313 - geometry_mod.F90 : add ind_cell_glo module variable to store global 1314 column index 1315 - init_print_control_mod.F90 : added to initialize print_control_mod module 1316 variables 1317 - print_control_mod.F90 : make initialization occur via init_print_control_mod 1318 to avoid circular module dependencies 1319 - mod_phys_lmdz_mpi_data.F90 : use print_control_mod (rather than iniprint.h) 1320 and define is_north_pole_dyn, is_south_pole_dyn 1321 (instead of is_north_pole, is_south_pole) 1322 - mod_phys_lmdz_mpi_transfert.F90 : use is_north_pole_dyn, is_south_pole_dyn 1323 (instead of is_north_pole, is_south_pole) 1324 - mod_phys_lmdz_omp_data.F90 : add is_omp_master (alias of is_omp_root) module 1325 variable and use print_control_mod (rather than 1326 iniprint.h), and introduce is_north_pole_phy 1327 and is_south_pole_phy 1328 - mod_phys_lmdz_para.F90 : use print_control_mod (rather than iniprint.h) 1329 - physics_distribution_mod.F90 : add call to init_dimphy in 1330 init_physics_distribution -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/inigeomphy_mod.F90
r1621 r1682 73 73 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 74 74 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 75 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi) 75 INTEGER,ALLOCATABLE,SAVE :: ind_cell_glo_fi(:) 76 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi,ind_cell_glo_fi) 76 77 77 78 ! Initialize Physics distibution and parameters and interface with dynamics … … 201 202 ALLOCATE(boundslonfi(klon_omp,4)) 202 203 ALLOCATE(boundslatfi(klon_omp,4)) 203 ! CALL initcomgeomphy 204 ALLOCATE(ind_cell_glo_fi(klon_omp)) 205 204 206 205 207 offset = klon_mpi_begin - 1 … … 211 213 boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 212 214 boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 215 ind_cell_glo_fi(1:klon_omp)=(/ (i,i=offset+klon_omp_begin,offset+klon_omp_end) /) 213 216 214 217 ! copy over local grid longitudes and latitudes 215 218 CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, & 216 airefi, cufi,cvfi)219 airefi,ind_cell_glo_fi,cufi,cvfi) 217 220 218 221 ! copy over preff , ap(), bp(), etc -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/mod_interface_dyn_phys.F90
r1543 r1682 22 22 23 23 k=1 24 IF (is_north_pole ) THEN24 IF (is_north_pole_dyn) THEN 25 25 index_i(k)=1 26 26 index_j(k)=1 … … 42 42 ENDDO 43 43 44 IF (is_south_pole ) THEN44 IF (is_south_pole_dyn) THEN 45 45 index_i(k)=1 46 46 index_j(k)=jj_end -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/iniphysiq_mod.F90
r1573 r1682 73 73 ! and do some initializations 74 74 75 ! Initialize dimphy module 76 call init_dimphy(klon_omp,nlayer)75 ! Initialize dimphy module => Now done in physics_distribution_mod 76 ! call init_dimphy(klon_omp,nlayer) 77 77 78 78 ! copy over preff , ap() and bp() -
trunk/LMDZ.GENERIC/libf/phy_common/geometry_mod.F90
r1543 r1682 30 30 !$OMP THREADPRIVATE(cell_area) 31 31 32 INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global index of a local cell 33 !$OMP THREADPRIVATE(ind_cell_glo) 32 34 33 35 CONTAINS … … 35 37 SUBROUTINE init_geometry(klon,longitude_,latitude_, & 36 38 boundslon_,boundslat_, & 37 cell_area_, dx_,dy_)39 cell_area_,ind_cell_glo_,dx_,dy_) 38 40 USE mod_grid_phy_lmdz, ONLY: nvertex 39 41 USE nrtype, ONLY : PI … … 45 47 REAL,INTENT(IN) :: boundslat_(klon,nvertex) 46 48 REAL,INTENT(IN) :: cell_area_(klon) 49 INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon) 47 50 REAL,OPTIONAL,INTENT(IN) :: dx_(klon) 48 51 REAL,OPTIONAL,INTENT(IN) :: dy_(klon) … … 55 58 ALLOCATE(boundslat(klon,nvertex)) 56 59 ALLOCATE(cell_area(klon)) 60 IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) 57 61 IF (PRESENT(dx_)) ALLOCATE(dx(klon)) 58 62 IF (PRESENT(dy_))ALLOCATE(dy(klon)) … … 65 69 boundslat(:,:) = boundslat_(:,:) 66 70 cell_area(:) = cell_area_(:) 71 IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) 67 72 IF (PRESENT(dx_)) dx(:) = dx_(:) 68 73 IF (PRESENT(dy_)) dy(:) = dy_(:) -
trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r1543 r1682 1 1 ! 2 !$ Header$2 !$Id$ 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_data 5 ! USE mod_const_mpi6 5 7 6 INTEGER,SAVE :: ii_begin … … 36 35 INTEGER,SAVE :: mpi_size 37 36 INTEGER,SAVE :: mpi_master 38 ! INTEGER,SAVE :: mpi_root39 37 LOGICAL,SAVE :: is_mpi_root 40 38 LOGICAL,SAVE :: is_using_mpi 41 39 42 40 43 LOGICAL,SAVE :: is_north_pole 44 LOGICAL,SAVE :: is_south_pole 41 LOGICAL,SAVE :: is_north_pole_dyn 42 LOGICAL,SAVE :: is_south_pole_dyn 45 43 INTEGER,SAVE :: COMM_LMDZ_PHY 46 44 INTEGER,SAVE :: MPI_REAL_LMDZ ! MPI_REAL8 … … 48 46 CONTAINS 49 47 50 ! SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)51 48 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator) 52 ! USE mod_const_mpi, ONLY : COMM_LMDZ53 49 IMPLICIT NONE 54 50 #ifdef CPP_MPI 55 51 INCLUDE 'mpif.h' 56 52 #endif 57 INTEGER,INTENT( in) :: nbp58 INTEGER,INTENT( in) :: nbp_lon59 INTEGER,INTENT( in) :: nbp_lat60 INTEGER,INTENT( in) :: communicator53 INTEGER,INTENT(IN) :: nbp 54 INTEGER,INTENT(IN) :: nbp_lon 55 INTEGER,INTENT(IN) :: nbp_lat 56 INTEGER,INTENT(IN) :: communicator 61 57 62 58 INTEGER,ALLOCATABLE :: distrib(:) … … 109 105 110 106 IF (mpi_rank == 0) THEN 111 is_north_pole = .TRUE.112 ELSE 113 is_north_pole = .FALSE.107 is_north_pole_dyn = .TRUE. 108 ELSE 109 is_north_pole_dyn = .FALSE. 114 110 ENDIF 115 111 116 112 IF (mpi_rank == mpi_size-1) THEN 117 is_south_pole = .TRUE.118 ELSE 119 is_south_pole = .FALSE.113 is_south_pole_dyn = .TRUE. 114 ELSE 115 is_south_pole_dyn = .FALSE. 120 116 ENDIF 121 117 … … 187 183 188 184 SUBROUTINE print_module_data 189 !USE print_control_mod, ONLY: lunout185 USE print_control_mod, ONLY: lunout 190 186 IMPLICIT NONE 191 INCLUDE "iniprint.h"192 187 193 188 WRITE(lunout,*) 'ii_begin =', ii_begin … … 217 212 WRITE(lunout,*) 'mpi_master =', mpi_master 218 213 WRITE(lunout,*) 'is_mpi_root =', is_mpi_root 219 WRITE(lunout,*) 'is_north_pole =', is_north_pole220 WRITE(lunout,*) 'is_south_pole =', is_south_pole214 WRITE(lunout,*) 'is_north_pole_dyn =', is_north_pole_dyn 215 WRITE(lunout,*) 'is_south_pole_dyn =', is_south_pole_dyn 221 216 WRITE(lunout,*) 'COMM_LMDZ_PHY =', COMM_LMDZ_PHY 222 217 -
trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
r1543 r1682 1 1 ! 2 !$ Header$2 !$Id$ 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_transfert … … 1693 1693 1694 1694 offset=ii_begin 1695 IF (is_north_pole ) Offset=nbp_lon1695 IF (is_north_pole_dyn) Offset=nbp_lon 1696 1696 1697 1697 … … 1703 1703 1704 1704 1705 IF (is_north_pole ) THEN1705 IF (is_north_pole_dyn) THEN 1706 1706 DO i=1,dimsize 1707 1707 DO ij=1,nbp_lon … … 1711 1711 ENDIF 1712 1712 1713 IF (is_south_pole ) THEN1713 IF (is_south_pole_dyn) THEN 1714 1714 DO i=1,dimsize 1715 1715 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1737 1737 1738 1738 offset=ii_begin 1739 IF (is_north_pole ) Offset=nbp_lon1739 IF (is_north_pole_dyn) Offset=nbp_lon 1740 1740 1741 1741 … … 1747 1747 1748 1748 1749 IF (is_north_pole ) THEN1749 IF (is_north_pole_dyn) THEN 1750 1750 DO i=1,dimsize 1751 1751 DO ij=1,nbp_lon … … 1755 1755 ENDIF 1756 1756 1757 IF (is_south_pole ) THEN1757 IF (is_south_pole_dyn) THEN 1758 1758 DO i=1,dimsize 1759 1759 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1782 1782 1783 1783 offset=ii_begin 1784 IF (is_north_pole ) Offset=nbp_lon1784 IF (is_north_pole_dyn) Offset=nbp_lon 1785 1785 1786 1786 … … 1792 1792 1793 1793 1794 IF (is_north_pole ) THEN1794 IF (is_north_pole_dyn) THEN 1795 1795 DO i=1,dimsize 1796 1796 DO ij=1,nbp_lon … … 1800 1800 ENDIF 1801 1801 1802 IF (is_south_pole ) THEN1802 IF (is_south_pole_dyn) THEN 1803 1803 DO i=1,dimsize 1804 1804 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1824 1824 1825 1825 offset=ii_begin 1826 IF (is_north_pole ) offset=nbp_lon1826 IF (is_north_pole_dyn) offset=nbp_lon 1827 1827 1828 1828 DO i=1,dimsize … … 1832 1832 ENDDO 1833 1833 1834 IF (is_north_pole ) THEN1834 IF (is_north_pole_dyn) THEN 1835 1835 DO i=1,dimsize 1836 1836 VarOut(1,i)=VarIn(1,i) … … 1854 1854 1855 1855 offset=ii_begin 1856 IF (is_north_pole ) offset=nbp_lon1856 IF (is_north_pole_dyn) offset=nbp_lon 1857 1857 1858 1858 DO i=1,dimsize … … 1862 1862 ENDDO 1863 1863 1864 IF (is_north_pole ) THEN1864 IF (is_north_pole_dyn) THEN 1865 1865 DO i=1,dimsize 1866 1866 VarOut(1,i)=VarIn(1,i) … … 1883 1883 1884 1884 offset=ii_begin 1885 IF (is_north_pole ) offset=nbp_lon1885 IF (is_north_pole_dyn) offset=nbp_lon 1886 1886 1887 1887 DO i=1,dimsize … … 1891 1891 ENDDO 1892 1892 1893 IF (is_north_pole ) THEN1893 IF (is_north_pole_dyn) THEN 1894 1894 DO i=1,dimsize 1895 1895 VarOut(1,i)=VarIn(1,i) -
trunk/LMDZ.GENERIC/libf/phy_common/mod_phys_lmdz_omp_data.F90
r1543 r1682 1 1 ! 2 !$Id: mod_phys_lmdz_omp_data.F90 2 326 2015-07-10 12:24:29Z emillour$2 !$Id: mod_phys_lmdz_omp_data.F90 2429 2016-01-27 12:43:09Z fairhead $ 3 3 ! 4 4 MODULE mod_phys_lmdz_omp_data … … 7 7 INTEGER,SAVE :: omp_rank 8 8 LOGICAL,SAVE :: is_omp_root 9 LOGICAL,SAVE :: is_omp_master ! alias of is_omp_root 9 10 LOGICAL,SAVE :: is_using_omp 11 LOGICAL,SAVE :: is_north_pole_phy, is_south_pole_phy 10 12 11 13 INTEGER,SAVE,DIMENSION(:),ALLOCATABLE :: klon_omp_para_nb … … 16 18 INTEGER,SAVE :: klon_omp_begin 17 19 INTEGER,SAVE :: klon_omp_end 18 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,klon_omp_begin,klon_omp_end) 20 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,is_omp_master,klon_omp_begin,klon_omp_end) 21 !$OMP THREADPRIVATE(is_north_pole_phy, is_south_pole_phy) 19 22 20 23 CONTAINS 21 24 22 25 SUBROUTINE Init_phys_lmdz_omp_data(klon_mpi) 23 USE dimphy 26 USE dimphy 27 USE mod_phys_lmdz_mpi_data, ONLY : is_north_pole_dyn, is_south_pole_dyn 24 28 IMPLICIT NONE 25 29 INTEGER, INTENT(in) :: klon_mpi … … 43 47 omp_size=OMP_GET_NUM_THREADS() 44 48 !$OMP END MASTER 49 !$OMP BARRIER 45 50 omp_rank=OMP_GET_THREAD_NUM() 46 51 #else … … 56 61 ELSE 57 62 abort_message = 'ANORMAL : OMP_MASTER /= 0' 58 CALL abort_ gcm(modname,abort_message,1)63 CALL abort_physic (modname,abort_message,1) 59 64 ENDIF 60 65 !$OMP END MASTER 61 66 is_omp_master=is_omp_root 62 67 63 68 !$OMP MASTER 69 64 70 ALLOCATE(klon_omp_para_nb(0:omp_size-1)) 65 71 ALLOCATE(klon_omp_para_begin(0:omp_size-1)) … … 80 86 !$OMP END MASTER 81 87 !$OMP BARRIER 88 89 if ((is_north_pole_dyn) .AND. (omp_rank == 0 )) then 90 is_north_pole_phy = .TRUE. 91 else 92 is_north_pole_phy = .FALSE. 93 endif 94 if ((is_south_pole_dyn) .AND. (omp_rank == omp_size-1)) then 95 is_south_pole_phy = .TRUE. 96 else 97 is_south_pole_phy = .FALSE. 98 endif 82 99 83 100 klon_omp=klon_omp_para_nb(omp_rank) … … 90 107 91 108 SUBROUTINE Print_module_data 109 USE print_control_mod, ONLY: lunout 92 110 IMPLICIT NONE 93 INCLUDE "iniprint.h"94 111 95 112 !$OMP CRITICAL -
trunk/LMDZ.GENERIC/libf/phy_common/physics_distribution_mod.F90
r1543 r1682 10 10 nbp, nbp_lon, nbp_lat, nbp_lev, & 11 11 communicator) 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para, klon_omp 13 13 USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz 14 USE dimphy, ONLY : Init_dimphy 15 14 16 IMPLICIT NONE 15 17 INTEGER,INTENT(IN) :: grid_type … … 24 26 CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev) 25 27 CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator) 28 !$OMP PARALLEL 29 CALL init_dimphy(klon_omp,nbp_lev) 30 !$OMP END PARALLEL 26 31 27 32 END SUBROUTINE init_physics_distribution -
trunk/LMDZ.GENERIC/libf/phy_common/print_control_mod.F90
r1673 r1682 7 7 !$OMP THREADPRIVATE(lunout,prt_level,debug) 8 8 9 ! NB: Module variable Initializations done by set_print_control 10 ! routine from init_print_control_mod to avoid circular 11 ! module dependencies 12 9 13 CONTAINS 10 14 11 SUBROUTINE init_print_control 12 USE ioipsl_getin_p_mod, ONLY : getin_p 13 USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master 15 SUBROUTINE set_print_control(lunout_,prt_level_,debug_) 14 16 IMPLICIT NONE 15 16 LOGICAL :: opened 17 INTEGER :: number 17 INTEGER :: lunout_ 18 INTEGER :: prt_level_ 19 LOGICAL :: debug_ 20 21 lunout = lunout_ 22 prt_level = prt_level_ 23 debug = debug_ 18 24 19 !Config Key = prt_level 20 !Config Desc = niveau d'impressions de débogage 21 !Config Def = 0 22 !Config Help = Niveau d'impression pour le débogage 23 !Config (0 = minimum d'impression) 24 prt_level = 0 25 CALL getin_p('prt_level',prt_level) 26 27 !Config Key = lunout 28 !Config Desc = unite de fichier pour les impressions 29 !Config Def = 6 30 !Config Help = unite de fichier pour les impressions 31 !Config (defaut sortie standard = 6) 32 lunout=6 33 CALL getin_p('lunout', lunout) 34 35 IF (is_omp_root) THEN 36 IF (lunout /= 5 .and. lunout /= 6) THEN 37 INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number) 38 IF (opened) THEN 39 lunout=number 40 ELSE 41 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', & 42 STATUS='unknown',FORM='formatted') 43 ENDIF 44 ENDIF 45 ENDIF 46 47 !Config Key = debug 48 !Config Desc = mode debogage 49 !Config Def = false 50 !Config Help = positionne le mode debogage 51 52 debug = .FALSE. 53 CALL getin_p('debug',debug) 54 55 IF (is_master) THEN 56 WRITE(lunout,*)"init_print_control: prt_level=",prt_level 57 WRITE(lunout,*)"init_print_control: lunout=",lunout 58 WRITE(lunout,*)"init_print_control: debug=",debug 59 ENDIF 60 61 END SUBROUTINE init_print_control 25 END SUBROUTINE set_print_control 62 26 63 27 END MODULE print_control_mod -
trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
r1677 r1682 9 9 prad,pg,pr,pcpp) 10 10 11 use init_print_control_mod, only: init_print_control 11 12 use radinc_h, only: ini_radinc_h, naerkind 12 13 use radcommon_h, only: ini_radcommon_h … … 76 77 REAL SSUM 77 78 79 ! Initialize flags lunout, prt_level, debug (in print_control_mod) 80 CALL init_print_control 81 78 82 ! initialize constants in comcstfi_mod 79 83 rad=prad -
trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90
r1397 r1682 94 94 IF (error /= 0) THEN 95 95 abort_message='Pb allocation tmp_tslab' 96 CALL abort_ gcm(modname,abort_message,1)96 CALL abort_physic(modname,abort_message,1) 97 97 ENDIF 98 98 tmp_tslab(:,:) = tslab_rst(:,:) … … 100 100 IF (error /= 0) THEN 101 101 abort_message='Pb allocation tmp_tslab_loc' 102 CALL abort_ gcm(modname,abort_message,1)102 CALL abort_physic(modname,abort_message,1) 103 103 ENDIF 104 104 tmp_tslab_loc(:,:) = tslab_rst(:,:) … … 107 107 IF (error /= 0) THEN 108 108 abort_message='Pb allocation tmp_seaice' 109 CALL abort_ gcm(modname,abort_message,1)109 CALL abort_physic(modname,abort_message,1) 110 110 ENDIF 111 111 tmp_seaice(:) = seaice_rst(:) … … 114 114 IF (error /= 0) THEN 115 115 abort_message='Pb allocation tmp_pctsrf_slab' 116 CALL abort_ gcm(modname,abort_message,1)116 CALL abort_physic(modname,abort_message,1) 117 117 ENDIF 118 118 tmp_pctsrf_slab(:) = pctsrf_rst(:) … … 122 122 IF (error /= 0) THEN 123 123 abort_message='Pb allocation tmp_radsol' 124 CALL abort_ gcm(modname,abort_message,1)124 CALL abort_physic(modname,abort_message,1) 125 125 ENDIF 126 126 … … 128 128 IF (error /= 0) THEN 129 129 abort_message='Pb allocation tmp_flux_o' 130 CALL abort_ gcm(modname,abort_message,1)130 CALL abort_physic(modname,abort_message,1) 131 131 ENDIF 132 132 … … 134 134 IF (error /= 0) THEN 135 135 abort_message='Pb allocation tmp_flux_g' 136 CALL abort_ gcm(modname,abort_message,1)136 CALL abort_physic(modname,abort_message,1) 137 137 ENDIF 138 138 … … 141 141 IF (error /= 0) THEN 142 142 abort_message='Pb allocation slab_bils' 143 CALL abort_ gcm(modname,abort_message,1)143 CALL abort_physic(modname,abort_message,1) 144 144 ENDIF 145 145 slab_bils(:) = 0.0 … … 148 148 IF (error /= 0) THEN 149 149 abort_message='Pb allocation dt_hdiff' 150 CALL abort_ gcm(modname,abort_message,1)150 CALL abort_physic(modname,abort_message,1) 151 151 ENDIF 152 152 dt_hdiff = 0.0 … … 155 155 IF (error /= 0) THEN 156 156 abort_message='Pb allocation dt_hdiff' 157 CALL abort_ gcm(modname,abort_message,1)157 CALL abort_physic(modname,abort_message,1) 158 158 ENDIF 159 159 dt_ekman = 0.0 … … 163 163 IF (error /= 0) THEN 164 164 abort_message='Pb allocation lmt_bils' 165 CALL abort_ gcm(modname,abort_message,1)165 CALL abort_physic(modname,abort_message,1) 166 166 ENDIF 167 167 lmt_bils(:) = 0.0 … … 170 170 IF (error /= 0) THEN 171 171 abort_message='Pb allocation slabh' 172 CALL abort_ gcm(modname,abort_message,1)172 CALL abort_physic(modname,abort_message,1) 173 173 ENDIF 174 174 slabh(1)=50. -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r1669 r1682 48 48 use callkeys_mod 49 49 use vertical_layers_mod, only: presnivs, pseudoalt 50 use mod_phys_lmdz_omp_data, ONLY: is_omp_master 50 51 #ifdef CPP_XIOS 51 52 use xios_output_mod, only: initialize_xios_output, & 52 53 update_xios_timestep, & 53 54 send_xios_field 55 use wxios, only: wxios_context_init, xios_context_finalize 54 56 #endif 55 57 implicit none … … 529 531 endif 530 532 533 #ifdef CPP_XIOS 534 ! Initialize XIOS context 535 write(*,*) "physiq: call wxios_context_init" 536 CALL wxios_context_init 537 #endif 531 538 532 539 ! Read 'startfi.nc' file. … … 735 742 presnivs,pseudoalt) 736 743 #endif 744 write(*,*) "physiq: end of firstcall" 737 745 endif ! end of 'firstcall' 738 746 … … 1893 1901 end if 1894 1902 1895 1896 endif ! end of 'lastcall' 1903 endif ! end of 'lastcall' 1897 1904 1898 1905 … … 2181 2188 CALL send_xios_field("u",zu) 2182 2189 CALL send_xios_field("v",zv) 2183 2190 2191 if (lastcall.and.is_omp_master) then 2192 write(*,*) "physiq: call xios_context_finalize" 2193 call xios_context_finalize 2194 endif 2184 2195 #endif 2185 2196 -
trunk/LMDZ.GENERIC/libf/phystd/xios_output_mod.F90
r1626 r1682 26 26 mpi_size, mpi_rank, klon_mpi, & 27 27 is_sequential, is_south_pole_dyn 28 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo 28 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid_type, unstructured 29 29 USE print_control_mod, ONLY: lunout, prt_level 30 30 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 31 31 USE regular_lonlat_mod, ONLY: lon_reg, lat_reg 32 32 USE nrtype, ONLY: pi 33 USE wxios 33 #ifdef CPP_XIOS 34 USE xios 35 #endif 36 USE wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_closedef 34 37 IMPLICIT NONE 35 38 … … 60 63 ! 2. Declare horizontal domain 61 64 ! Set values for the mask: 62 IF (mpi_rank == 0) THEN 63 data_ibegin = 0 64 ELSE 65 data_ibegin = ii_begin - 1 66 END IF 67 68 IF (mpi_rank == mpi_size-1) THEN 69 data_iend = nbp_lon 70 ELSE 71 data_iend = ii_end + 1 72 END IF 73 74 if (prt_level>=10) then 75 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end 76 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat 77 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 78 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 79 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn 80 endif 81 65 ! IF (mpi_rank == 0) THEN 66 ! data_ibegin = 0 67 ! ELSE 68 ! data_ibegin = ii_begin - 1 69 ! END IF 70 71 ! IF (mpi_rank == mpi_size-1) THEN 72 ! data_iend = nbp_lon 73 ! ELSE 74 ! data_iend = ii_end + 1 75 ! END IF 76 77 ! if (prt_level>=10) then 78 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end 79 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat 80 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 81 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 82 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn 83 ! endif 84 85 !$OMP END MASTER 86 !$OMP BARRIER 82 87 ! Initialize the XIOS domain coreesponding to this process: 83 88 if (prt_level>=10) write(lunout,*) "initialize_xios_output: call wxios_domain_param" 84 CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, & 85 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, & 86 klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, & 87 lat_reg*(180./pi), lon_reg*(180./pi), & 88 is_south_pole_dyn,mpi_rank) 89 89 ! CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, & 90 ! 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, & 91 ! klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, & 92 ! lat_reg*(180./pi), lon_reg*(180./pi), & 93 ! is_south_pole_dyn,mpi_rank) 94 95 IF (grid_type==unstructured) THEN 96 CALL wxios_domain_param_unstructured("dom_glo") 97 ELSE 98 CALL wxios_domain_param("dom_glo") 99 ENDIF 100 101 !$OMP MASTER 90 102 ! 3. Declare calendar and time step 91 103 if (prt_level>=10) write(lunout,*) "initialize_xios_output: build calendar" -
trunk/LMDZ.MARS/README
r1660 r1682 2392 2392 Cp and thermal conductivity in aeronomars/concentrations.F 2393 2393 2394 2394 == 30/03/2017 == EM 2395 Keep up with updates in LMDZ.COMMON: 2396 In dynphy_lonlat : 2397 - inigeomphy_mod.F90 : add ind_cell_glo computation and transfer 2398 to init_geometry 2399 - mod_interface_dyn_phys.F90 : use is_north_pole_dyn and is_south_pole_dyn 2400 (instead of is_north_pole, is_south_pole) 2401 In phy_common: 2402 - abort_physic.F90 : to properly abort from physics (to be used instead 2403 of abort_gcm which is for within the dynamics) 2404 - geometry_mod.F90 : add ind_cell_glo module variable to store global 2405 column index 2406 - mod_phys_lmdz_mpi_data.F90 : use print_control_mod (rather than iniprint.h) 2407 and define is_north_pole_dyn, is_south_pole_dyn 2408 (instead of is_north_pole, is_south_pole) 2409 - mod_phys_lmdz_mpi_transfert.F90 : use is_north_pole_dyn, is_south_pole_dyn 2410 (instead of is_north_pole, is_south_pole) 2411 - mod_phys_lmdz_omp_data.F90 : add is_omp_master (alias of is_omp_root) module 2412 variable and use print_control_mod (rather than 2413 iniprint.h), and introduce is_north_pole_phy 2414 and is_south_pole_phy 2415 - mod_phys_lmdz_para.F90 : use print_control_mod (rather than iniprint.h) 2416 - physics_distribution_mod.F90 : add call to init_dimphy in 2417 init_physics_distribution 2418 - init_print_control_mod.F90 : added to initialize print_control_mod module 2419 variables 2420 - print_control_mod.F90 : make initialization occur via init_print_control_mod 2421 to avoid circular module dependencies -
trunk/LMDZ.MARS/libf/dynphy_lonlat/inigeomphy_mod.F90
r1621 r1682 73 73 REAL,ALLOCATABLE,SAVE :: boundslonfi(:,:) 74 74 REAL,ALLOCATABLE,SAVE :: boundslatfi(:,:) 75 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi) 75 INTEGER,ALLOCATABLE,SAVE :: ind_cell_glo_fi(:) 76 !$OMP THREADPRIVATE (latfi,lonfi,cufi,cvfi,airefi,boundslonfi,boundslatfi,ind_cell_glo_fi) 76 77 77 78 ! Initialize Physics distibution and parameters and interface with dynamics … … 201 202 ALLOCATE(boundslonfi(klon_omp,4)) 202 203 ALLOCATE(boundslatfi(klon_omp,4)) 203 ! CALL initcomgeomphy 204 ALLOCATE(ind_cell_glo_fi(klon_omp)) 205 204 206 205 207 offset = klon_mpi_begin - 1 … … 211 213 boundslonfi(1:klon_omp,:) = boundslonfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 212 214 boundslatfi(1:klon_omp,:) = boundslatfi_glo(offset+klon_omp_begin:offset+klon_omp_end,:) 215 ind_cell_glo_fi(1:klon_omp)=(/ (i,i=offset+klon_omp_begin,offset+klon_omp_end) /) 213 216 214 217 ! copy over local grid longitudes and latitudes 215 218 CALL init_geometry(klon_omp,lonfi,latfi,boundslonfi,boundslatfi, & 216 airefi, cufi,cvfi)219 airefi,ind_cell_glo_fi,cufi,cvfi) 217 220 218 221 ! copy over preff , ap(), bp(), etc -
trunk/LMDZ.MARS/libf/dynphy_lonlat/mod_interface_dyn_phys.F90
r1543 r1682 22 22 23 23 k=1 24 IF (is_north_pole ) THEN24 IF (is_north_pole_dyn) THEN 25 25 index_i(k)=1 26 26 index_j(k)=1 … … 42 42 ENDDO 43 43 44 IF (is_south_pole ) THEN44 IF (is_south_pole_dyn) THEN 45 45 index_i(k)=1 46 46 index_j(k)=jj_end -
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/iniphysiq_mod.F90
r1621 r1682 66 66 ! and do some initializations 67 67 68 ! Initialize dimphy module 69 call init_dimphy(klon_omp,nlayer)68 ! Initialize dimphy module => Now done in physics_distribution_mod 69 !call init_dimphy(klon_omp,nlayer) 70 70 71 71 call phys_state_var_init(klon_omp,nlayer,nqtot,tname, & -
trunk/LMDZ.MARS/libf/phy_common/geometry_mod.F90
r1543 r1682 30 30 !$OMP THREADPRIVATE(cell_area) 31 31 32 INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global index of a local cell 33 !$OMP THREADPRIVATE(ind_cell_glo) 32 34 33 35 CONTAINS … … 35 37 SUBROUTINE init_geometry(klon,longitude_,latitude_, & 36 38 boundslon_,boundslat_, & 37 cell_area_, dx_,dy_)39 cell_area_,ind_cell_glo_,dx_,dy_) 38 40 USE mod_grid_phy_lmdz, ONLY: nvertex 39 41 USE nrtype, ONLY : PI … … 45 47 REAL,INTENT(IN) :: boundslat_(klon,nvertex) 46 48 REAL,INTENT(IN) :: cell_area_(klon) 49 INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon) 47 50 REAL,OPTIONAL,INTENT(IN) :: dx_(klon) 48 51 REAL,OPTIONAL,INTENT(IN) :: dy_(klon) … … 55 58 ALLOCATE(boundslat(klon,nvertex)) 56 59 ALLOCATE(cell_area(klon)) 60 IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) 57 61 IF (PRESENT(dx_)) ALLOCATE(dx(klon)) 58 62 IF (PRESENT(dy_))ALLOCATE(dy(klon)) … … 65 69 boundslat(:,:) = boundslat_(:,:) 66 70 cell_area(:) = cell_area_(:) 71 IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) 67 72 IF (PRESENT(dx_)) dx(:) = dx_(:) 68 73 IF (PRESENT(dy_)) dy(:) = dy_(:) -
trunk/LMDZ.MARS/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r1543 r1682 1 1 ! 2 !$ Header$2 !$Id$ 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_data 5 ! USE mod_const_mpi6 5 7 6 INTEGER,SAVE :: ii_begin … … 36 35 INTEGER,SAVE :: mpi_size 37 36 INTEGER,SAVE :: mpi_master 38 ! INTEGER,SAVE :: mpi_root39 37 LOGICAL,SAVE :: is_mpi_root 40 38 LOGICAL,SAVE :: is_using_mpi 41 39 42 40 43 LOGICAL,SAVE :: is_north_pole 44 LOGICAL,SAVE :: is_south_pole 41 LOGICAL,SAVE :: is_north_pole_dyn 42 LOGICAL,SAVE :: is_south_pole_dyn 45 43 INTEGER,SAVE :: COMM_LMDZ_PHY 46 44 INTEGER,SAVE :: MPI_REAL_LMDZ ! MPI_REAL8 … … 48 46 CONTAINS 49 47 50 ! SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)51 48 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator) 52 ! USE mod_const_mpi, ONLY : COMM_LMDZ53 49 IMPLICIT NONE 54 50 #ifdef CPP_MPI 55 51 INCLUDE 'mpif.h' 56 52 #endif 57 INTEGER,INTENT( in) :: nbp58 INTEGER,INTENT( in) :: nbp_lon59 INTEGER,INTENT( in) :: nbp_lat60 INTEGER,INTENT( in) :: communicator53 INTEGER,INTENT(IN) :: nbp 54 INTEGER,INTENT(IN) :: nbp_lon 55 INTEGER,INTENT(IN) :: nbp_lat 56 INTEGER,INTENT(IN) :: communicator 61 57 62 58 INTEGER,ALLOCATABLE :: distrib(:) … … 109 105 110 106 IF (mpi_rank == 0) THEN 111 is_north_pole = .TRUE.112 ELSE 113 is_north_pole = .FALSE.107 is_north_pole_dyn = .TRUE. 108 ELSE 109 is_north_pole_dyn = .FALSE. 114 110 ENDIF 115 111 116 112 IF (mpi_rank == mpi_size-1) THEN 117 is_south_pole = .TRUE.118 ELSE 119 is_south_pole = .FALSE.113 is_south_pole_dyn = .TRUE. 114 ELSE 115 is_south_pole_dyn = .FALSE. 120 116 ENDIF 121 117 … … 187 183 188 184 SUBROUTINE print_module_data 189 !USE print_control_mod, ONLY: lunout185 USE print_control_mod, ONLY: lunout 190 186 IMPLICIT NONE 191 INCLUDE "iniprint.h"192 187 193 188 WRITE(lunout,*) 'ii_begin =', ii_begin … … 217 212 WRITE(lunout,*) 'mpi_master =', mpi_master 218 213 WRITE(lunout,*) 'is_mpi_root =', is_mpi_root 219 WRITE(lunout,*) 'is_north_pole =', is_north_pole220 WRITE(lunout,*) 'is_south_pole =', is_south_pole214 WRITE(lunout,*) 'is_north_pole_dyn =', is_north_pole_dyn 215 WRITE(lunout,*) 'is_south_pole_dyn =', is_south_pole_dyn 221 216 WRITE(lunout,*) 'COMM_LMDZ_PHY =', COMM_LMDZ_PHY 222 217 -
trunk/LMDZ.MARS/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
r1543 r1682 1 1 ! 2 !$ Header$2 !$Id$ 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_transfert … … 1693 1693 1694 1694 offset=ii_begin 1695 IF (is_north_pole ) Offset=nbp_lon1695 IF (is_north_pole_dyn) Offset=nbp_lon 1696 1696 1697 1697 … … 1703 1703 1704 1704 1705 IF (is_north_pole ) THEN1705 IF (is_north_pole_dyn) THEN 1706 1706 DO i=1,dimsize 1707 1707 DO ij=1,nbp_lon … … 1711 1711 ENDIF 1712 1712 1713 IF (is_south_pole ) THEN1713 IF (is_south_pole_dyn) THEN 1714 1714 DO i=1,dimsize 1715 1715 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1737 1737 1738 1738 offset=ii_begin 1739 IF (is_north_pole ) Offset=nbp_lon1739 IF (is_north_pole_dyn) Offset=nbp_lon 1740 1740 1741 1741 … … 1747 1747 1748 1748 1749 IF (is_north_pole ) THEN1749 IF (is_north_pole_dyn) THEN 1750 1750 DO i=1,dimsize 1751 1751 DO ij=1,nbp_lon … … 1755 1755 ENDIF 1756 1756 1757 IF (is_south_pole ) THEN1757 IF (is_south_pole_dyn) THEN 1758 1758 DO i=1,dimsize 1759 1759 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1782 1782 1783 1783 offset=ii_begin 1784 IF (is_north_pole ) Offset=nbp_lon1784 IF (is_north_pole_dyn) Offset=nbp_lon 1785 1785 1786 1786 … … 1792 1792 1793 1793 1794 IF (is_north_pole ) THEN1794 IF (is_north_pole_dyn) THEN 1795 1795 DO i=1,dimsize 1796 1796 DO ij=1,nbp_lon … … 1800 1800 ENDIF 1801 1801 1802 IF (is_south_pole ) THEN1802 IF (is_south_pole_dyn) THEN 1803 1803 DO i=1,dimsize 1804 1804 DO ij=nbp_lon*(jj_nb-1)+1,nbp_lon*jj_nb … … 1824 1824 1825 1825 offset=ii_begin 1826 IF (is_north_pole ) offset=nbp_lon1826 IF (is_north_pole_dyn) offset=nbp_lon 1827 1827 1828 1828 DO i=1,dimsize … … 1832 1832 ENDDO 1833 1833 1834 IF (is_north_pole ) THEN1834 IF (is_north_pole_dyn) THEN 1835 1835 DO i=1,dimsize 1836 1836 VarOut(1,i)=VarIn(1,i) … … 1854 1854 1855 1855 offset=ii_begin 1856 IF (is_north_pole ) offset=nbp_lon1856 IF (is_north_pole_dyn) offset=nbp_lon 1857 1857 1858 1858 DO i=1,dimsize … … 1862 1862 ENDDO 1863 1863 1864 IF (is_north_pole ) THEN1864 IF (is_north_pole_dyn) THEN 1865 1865 DO i=1,dimsize 1866 1866 VarOut(1,i)=VarIn(1,i) … … 1883 1883 1884 1884 offset=ii_begin 1885 IF (is_north_pole ) offset=nbp_lon1885 IF (is_north_pole_dyn) offset=nbp_lon 1886 1886 1887 1887 DO i=1,dimsize … … 1891 1891 ENDDO 1892 1892 1893 IF (is_north_pole ) THEN1893 IF (is_north_pole_dyn) THEN 1894 1894 DO i=1,dimsize 1895 1895 VarOut(1,i)=VarIn(1,i) -
trunk/LMDZ.MARS/libf/phy_common/mod_phys_lmdz_omp_data.F90
r1657 r1682 1 1 ! 2 !$Id: mod_phys_lmdz_omp_data.F90 2 326 2015-07-10 12:24:29Z emillour$2 !$Id: mod_phys_lmdz_omp_data.F90 2429 2016-01-27 12:43:09Z fairhead $ 3 3 ! 4 4 MODULE mod_phys_lmdz_omp_data … … 7 7 INTEGER,SAVE :: omp_rank 8 8 LOGICAL,SAVE :: is_omp_root 9 LOGICAL,SAVE :: is_omp_master ! alias of is_omp_root 9 10 LOGICAL,SAVE :: is_using_omp 11 LOGICAL,SAVE :: is_north_pole_phy, is_south_pole_phy 10 12 11 13 INTEGER,SAVE,DIMENSION(:),ALLOCATABLE :: klon_omp_para_nb … … 16 18 INTEGER,SAVE :: klon_omp_begin 17 19 INTEGER,SAVE :: klon_omp_end 18 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,klon_omp_begin,klon_omp_end) 20 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,is_omp_master,klon_omp_begin,klon_omp_end) 21 !$OMP THREADPRIVATE(is_north_pole_phy, is_south_pole_phy) 19 22 20 23 CONTAINS 21 24 22 25 SUBROUTINE Init_phys_lmdz_omp_data(klon_mpi) 23 USE dimphy 26 USE dimphy 27 USE mod_phys_lmdz_mpi_data, ONLY : is_north_pole_dyn, is_south_pole_dyn 24 28 IMPLICIT NONE 25 29 INTEGER, INTENT(in) :: klon_mpi … … 43 47 omp_size=OMP_GET_NUM_THREADS() 44 48 !$OMP END MASTER 49 !$OMP BARRIER 45 50 omp_rank=OMP_GET_THREAD_NUM() 46 51 #else … … 56 61 ELSE 57 62 abort_message = 'ANORMAL : OMP_MASTER /= 0' 58 !-- abort_gcm only in the dynamics 59 !CALL abort_gcm (modname,abort_message,1) 60 print *,modname,abort_message 61 STOP 63 CALL abort_physic (modname,abort_message,1) 62 64 ENDIF 63 65 !$OMP END MASTER 64 66 is_omp_master=is_omp_root 65 67 66 68 !$OMP MASTER 69 67 70 ALLOCATE(klon_omp_para_nb(0:omp_size-1)) 68 71 ALLOCATE(klon_omp_para_begin(0:omp_size-1)) … … 83 86 !$OMP END MASTER 84 87 !$OMP BARRIER 88 89 if ((is_north_pole_dyn) .AND. (omp_rank == 0 )) then 90 is_north_pole_phy = .TRUE. 91 else 92 is_north_pole_phy = .FALSE. 93 endif 94 if ((is_south_pole_dyn) .AND. (omp_rank == omp_size-1)) then 95 is_south_pole_phy = .TRUE. 96 else 97 is_south_pole_phy = .FALSE. 98 endif 85 99 86 100 klon_omp=klon_omp_para_nb(omp_rank) … … 93 107 94 108 SUBROUTINE Print_module_data 109 USE print_control_mod, ONLY: lunout 95 110 IMPLICIT NONE 96 INCLUDE "iniprint.h"97 111 98 112 !$OMP CRITICAL -
trunk/LMDZ.MARS/libf/phy_common/mod_phys_lmdz_para.F90
r1543 r1682 1 1 ! 2 ! $Header$2 ! $Id: mod_phys_lmdz_para.F90 2429 2016-01-27 12:43:09Z fairhead $ 3 3 ! 4 4 MODULE mod_phys_lmdz_para … … 11 11 LOGICAL,SAVE :: is_parallel 12 12 LOGICAL,SAVE :: is_master 13 13 14 14 15 !$OMP THREADPRIVATE(klon_loc,is_master) … … 18 19 SUBROUTINE Init_phys_lmdz_para(nbp,nbp_lon,nbp_lat,communicator) 19 20 IMPLICIT NONE 20 INTEGER,INTENT( in) :: nbp21 INTEGER,INTENT( in) :: nbp_lon22 INTEGER,INTENT( in) :: nbp_lat23 INTEGER,INTENT( in) :: communicator21 INTEGER,INTENT(IN) :: nbp 22 INTEGER,INTENT(IN) :: nbp_lon 23 INTEGER,INTENT(IN) :: nbp_lat 24 INTEGER,INTENT(IN) :: communicator 24 25 25 26 CALL Init_phys_lmdz_mpi_data(nbp,nbp_lon,nbp_lat,communicator) … … 41 42 is_parallel=.FALSE. 42 43 ENDIF 44 45 43 46 44 47 END SUBROUTINE Init_phys_lmdz_para … … 46 49 SUBROUTINE Test_transfert 47 50 USE mod_grid_phy_lmdz 51 USE print_control_mod, ONLY: lunout 48 52 IMPLICIT NONE 49 INCLUDE "iniprint.h"50 53 51 54 REAL :: Test_Field1d_glo(klon_glo,nbp_lev) -
trunk/LMDZ.MARS/libf/phy_common/physics_distribution_mod.F90
r1543 r1682 10 10 nbp, nbp_lon, nbp_lat, nbp_lev, & 11 11 communicator) 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para, klon_omp 13 13 USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz 14 USE dimphy, ONLY : Init_dimphy 15 14 16 IMPLICIT NONE 15 17 INTEGER,INTENT(IN) :: grid_type … … 24 26 CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev) 25 27 CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator) 28 !$OMP PARALLEL 29 CALL init_dimphy(klon_omp,nbp_lev) 30 !$OMP END PARALLEL 26 31 27 32 END SUBROUTINE init_physics_distribution -
trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/iniphysiq_mod.F90
r1647 r1682 70 70 ! and do some initializations 71 71 72 ! Initialize dimphy module 73 call init_dimphy(klon_omp,nlayer)72 ! Initialize dimphy module => Now done in physics_distribution_mod 73 !call init_dimphy(klon_omp,nlayer) 74 74 75 75 ! copy over preff , ap() and bp() -
trunk/LMDZ.VENUS/libf/phyvenus/conf_phys.F90
r1661 r1682 8 8 & if_ebil) 9 9 10 use init_print_control_mod, only: init_print_control 11 use print_control_mod, only: lunout 10 12 use IOIPSL 11 13 implicit none … … 25 27 26 28 ! Local 27 integer :: numout = 6 29 ! integer :: numout = 6 30 31 32 ! Initialize flags lunout, prt_level, debug (in print_control_mod) 33 CALL init_print_control 28 34 29 35 ! … … 472 478 ! 473 479 474 write( numout,*)' ##############################################'475 write( numout,*)' Configuration des parametres de la physique: '476 write( numout,*)' cycle_diurne = ', cycle_diurne477 write( numout,*)' soil_model = ', soil_model478 write( numout,*)' ok_orodr = ', ok_orodr479 write( numout,*)' ok_orolf = ', ok_orolf480 write( numout,*)' ok_gw_nonoro = ', ok_gw_nonoro481 write( numout,*)' nbapp_rad = ', nbapp_rad482 write( numout,*)' nbapp_chim = ', nbapp_chim483 write( numout,*)' iflag_con = ', iflag_con484 write( numout,*)' Sortie journaliere = ', ok_journe485 write( numout,*)' Sortie mensuelle = ', ok_mensuel486 write( numout,*)' Sortie instantanee = ', ok_instan487 write( numout,*)' frequence sorties = ', ecriphy488 write( numout,*)' Sortie bilan d''energie, if_ebil =', if_ebil489 write( numout,*)' Excentricite = ',R_ecc490 write( numout,*)' Equinoxe = ',R_peri491 write( numout,*)' Inclinaison =',R_incl492 write( numout,*)' tr_scheme = ', tr_scheme493 write( numout,*)' iflag_pbl = ', iflag_pbl494 write( numout,*)' z0 = ',z0495 write( numout,*)' lmixmin = ',lmixmin496 write( numout,*)' ksta = ',ksta497 write( numout,*)' ok_kzmin = ',ok_kzmin498 write( numout,*)' inertie = ', inertie499 write( numout,*)' iflag_ajs = ', iflag_ajs500 write( numout,*)' lev_histins = ',lev_histins501 write( numout,*)' lev_histday = ',lev_histday502 write( numout,*)' lev_histmth = ',lev_histmth503 write( numout,*)' reinit_trac = ',reinit_trac504 write( numout,*)' ok_cloud = ',ok_cloud505 write( numout,*)' ok_chem = ',ok_chem506 write( numout,*)' ok_sedim = ',ok_sedim507 write( numout,*)' nb_mode = ',nb_mode508 write( numout,*)' callnlte = ',callnlte509 write( numout,*)' nltemodel = ',nltemodel510 write( numout,*)' callnirco2 = ',callnirco2511 write( numout,*)' nircorr = ',nircorr512 write( numout,*)' callthermos = ',callthermos513 write( numout,*)' solvarmod = ',solvarmod514 write( numout,*)' solarcondate = ',solarcondate515 write( numout,*)' euveff = ',euveff480 write(lunout,*)' ##############################################' 481 write(lunout,*)' Configuration des parametres de la physique: ' 482 write(lunout,*)' cycle_diurne = ', cycle_diurne 483 write(lunout,*)' soil_model = ', soil_model 484 write(lunout,*)' ok_orodr = ', ok_orodr 485 write(lunout,*)' ok_orolf = ', ok_orolf 486 write(lunout,*)' ok_gw_nonoro = ', ok_gw_nonoro 487 write(lunout,*)' nbapp_rad = ', nbapp_rad 488 write(lunout,*)' nbapp_chim = ', nbapp_chim 489 write(lunout,*)' iflag_con = ', iflag_con 490 write(lunout,*)' Sortie journaliere = ', ok_journe 491 write(lunout,*)' Sortie mensuelle = ', ok_mensuel 492 write(lunout,*)' Sortie instantanee = ', ok_instan 493 write(lunout,*)' frequence sorties = ', ecriphy 494 write(lunout,*)' Sortie bilan d''energie, if_ebil =', if_ebil 495 write(lunout,*)' Excentricite = ',R_ecc 496 write(lunout,*)' Equinoxe = ',R_peri 497 write(lunout,*)' Inclinaison =',R_incl 498 write(lunout,*)' tr_scheme = ', tr_scheme 499 write(lunout,*)' iflag_pbl = ', iflag_pbl 500 write(lunout,*)' z0 = ',z0 501 write(lunout,*)' lmixmin = ',lmixmin 502 write(lunout,*)' ksta = ',ksta 503 write(lunout,*)' ok_kzmin = ',ok_kzmin 504 write(lunout,*)' inertie = ', inertie 505 write(lunout,*)' iflag_ajs = ', iflag_ajs 506 write(lunout,*)' lev_histins = ',lev_histins 507 write(lunout,*)' lev_histday = ',lev_histday 508 write(lunout,*)' lev_histmth = ',lev_histmth 509 write(lunout,*)' reinit_trac = ',reinit_trac 510 write(lunout,*)' ok_cloud = ',ok_cloud 511 write(lunout,*)' ok_chem = ',ok_chem 512 write(lunout,*)' ok_sedim = ',ok_sedim 513 write(lunout,*)' nb_mode = ',nb_mode 514 write(lunout,*)' callnlte = ',callnlte 515 write(lunout,*)' nltemodel = ',nltemodel 516 write(lunout,*)' callnirco2 = ',callnirco2 517 write(lunout,*)' nircorr = ',nircorr 518 write(lunout,*)' callthermos = ',callthermos 519 write(lunout,*)' solvarmod = ',solvarmod 520 write(lunout,*)' solarcondate = ',solarcondate 521 write(lunout,*)' euveff = ',euveff 516 522 517 523 return -
trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F
r1665 r1682 80 80 use infotrac_phy, only: iflag_trac, tname, ttext 81 81 use vertical_layers_mod, only: pseudoalt 82 use mod_phys_lmdz_omp_data, ONLY: is_omp_master 82 83 #ifdef CPP_XIOS 83 84 use xios_output_mod, only: initialize_xios_output, 84 85 & update_xios_timestep, 85 86 & send_xios_field 87 use wxios, only: wxios_context_init, xios_context_finalize 86 88 #endif 87 89 IMPLICIT none … … 429 431 allocate(source(klon,nqmax)) 430 432 433 #ifdef CPP_XIOS 434 ! Initialize XIOS context 435 write(*,*) "physiq: call wxios_context_init" 436 CALL wxios_context_init 437 #endif 438 431 439 CALL suphec ! initialiser constantes et parametres phys. 432 440 … … 1874 1882 CALL send_xios_field("d_qmoldifN2",d_q_moldif(:,:,i_n2)) 1875 1883 ENDIF 1876 1884 1885 if (lafin.and.is_omp_master) then 1886 write(*,*) "physiq: call xios_context_finalize" 1887 call xios_context_finalize 1888 endif 1889 1877 1890 #endif 1878 1891 -
trunk/LMDZ.VENUS/libf/phyvenus/xios_output_mod.F90
r1642 r1682 26 26 mpi_size, mpi_rank, klon_mpi, & 27 27 is_sequential, is_south_pole_dyn 28 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo 28 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid_type, unstructured 29 29 USE print_control_mod, ONLY: lunout, prt_level 30 30 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 31 31 USE regular_lonlat_mod, ONLY: lon_reg, lat_reg 32 32 USE nrtype, ONLY: pi 33 USE wxios 33 #ifdef CPP_XIOS 34 USE xios 35 #endif 36 USE wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_closedef 34 37 IMPLICIT NONE 35 38 … … 60 63 ! 2. Declare horizontal domain 61 64 ! Set values for the mask: 62 IF (mpi_rank == 0) THEN 63 data_ibegin = 0 64 ELSE 65 data_ibegin = ii_begin - 1 66 END IF 67 68 IF (mpi_rank == mpi_size-1) THEN 69 data_iend = nbp_lon 70 ELSE 71 data_iend = ii_end + 1 72 END IF 73 74 if (prt_level>=10) then 75 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end 76 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat 77 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 78 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 79 write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn 80 endif 81 65 ! IF (mpi_rank == 0) THEN 66 ! data_ibegin = 0 67 ! ELSE 68 ! data_ibegin = ii_begin - 1 69 ! END IF 70 71 ! IF (mpi_rank == mpi_size-1) THEN 72 ! data_iend = nbp_lon 73 ! ELSE 74 ! data_iend = ii_end + 1 75 ! END IF 76 77 ! if (prt_level>=10) then 78 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end 79 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat 80 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 81 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 82 ! write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn 83 ! endif 84 85 !$OMP END MASTER 86 !$OMP BARRIER 82 87 ! Initialize the XIOS domain corresponding to this process: 83 88 if (prt_level>=10) write(lunout,*) "initialize_xios_output: call wxios_domain_param" 84 CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, &85 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, &86 klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, &89 ! CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, & 90 ! 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, & 91 ! klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, & 87 92 ! VENUS IS SEEN UPSIDE DOWN, SO CENTRAL SYMMETRY TO PUT NORTH UP AGAIN 88 -1.*lat_reg*(180./pi), -1.*lon_reg*(180./pi), & 89 is_south_pole_dyn,mpi_rank) 90 93 ! -1.*lat_reg*(180./pi), -1.*lon_reg*(180./pi), & 94 ! is_south_pole_dyn,mpi_rank) 95 96 IF (grid_type==unstructured) THEN 97 CALL wxios_domain_param_unstructured("dom_glo",.true.) 98 ELSE 99 CALL wxios_domain_param("dom_glo",.true.) 100 ENDIF 101 102 !$OMP MASTER 91 103 ! 3. Declare calendar and time step 92 104 if (prt_level>=10) write(lunout,*) "initialize_xios_output: build calendar"
Note: See TracChangeset
for help on using the changeset viewer.