- Timestamp:
- Dec 14, 2015, 11:43:09 AM (9 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2293-2295,2297,2299-2302,2305-2313,2315,2317-2380,2382-2396
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
r1999 r2408 21 21 USE cpl_mod, ONLY : cpl_send_land_fields 22 22 USE surface_data, ONLY : type_ocean 23 USE comgeomphy, ONLY : cuphy, cvphy23 USE geometry_mod, ONLY : dx, dy 24 24 USE mod_grid_phy_lmdz 25 25 USE mod_phys_lmdz_para … … 98 98 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_land_inst, fco2_lu_inst 99 99 USE indice_sol_mod 100 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 101 USE print_control_mod, ONLY: lunout 102 #ifdef CPP_VEGET 103 USE time_phylmdz_mod, ONLY: itau_phy 104 #endif 100 105 IMPLICIT NONE 101 106 102 INCLUDE "temps.h"103 107 INCLUDE "YOMCST.h" 104 INCLUDE "iniprint.h"105 INCLUDE "dimensions.h"106 108 107 109 ! … … 215 217 IF (carbon_cycle_cpl) THEN 216 218 abort_message='You must define preprossing key ORCH_NEW when running carbon_cycle_cpl=y' 217 CALL abort_ gcm(modname,abort_message,1)219 CALL abort_physic(modname,abort_message,1) 218 220 END IF 219 221 #endif … … 232 234 DO igrid = 2, klon - 1 233 235 indi = indi + 1 234 IF ( indi > iim) THEN236 IF ( indi > nbp_lon) THEN 235 237 indi = 1 236 238 indj = indj + 1 … … 240 242 ENDDO 241 243 ig(klon) = 1 242 jg(klon) = jjm + 1244 jg(klon) = nbp_lat 243 245 244 246 IF ((.NOT. ALLOCATED(lalo))) THEN … … 246 248 IF (error /= 0) THEN 247 249 abort_message='Pb allocation lalo' 248 CALL abort_ gcm(modname,abort_message,1)250 CALL abort_physic(modname,abort_message,1) 249 251 ENDIF 250 252 ENDIF 251 253 IF ((.NOT. ALLOCATED(lon_scat))) THEN 252 ALLOCATE(lon_scat( iim,jjm+1), stat = error)254 ALLOCATE(lon_scat(nbp_lon,nbp_lat), stat = error) 253 255 IF (error /= 0) THEN 254 256 abort_message='Pb allocation lon_scat' 255 CALL abort_ gcm(modname,abort_message,1)257 CALL abort_physic(modname,abort_message,1) 256 258 ENDIF 257 259 ENDIF 258 260 IF ((.NOT. ALLOCATED(lat_scat))) THEN 259 ALLOCATE(lat_scat( iim,jjm+1), stat = error)261 ALLOCATE(lat_scat(nbp_lon,nbp_lat), stat = error) 260 262 IF (error /= 0) THEN 261 263 abort_message='Pb allocation lat_scat' 262 CALL abort_ gcm(modname,abort_message,1)264 CALL abort_physic(modname,abort_message,1) 263 265 ENDIF 264 266 ENDIF … … 278 280 IF (is_mpi_root) THEN 279 281 index = 1 280 DO jj = 2, jjm281 DO ij = 1, iim282 DO jj = 2, nbp_lat-1 283 DO ij = 1, nbp_lon 282 284 index = index + 1 283 285 lon_scat(ij,jj) = rlon_g(index) … … 287 289 lon_scat(:,1) = lon_scat(:,2) 288 290 lat_scat(:,1) = rlat_g(1) 289 lon_scat(:, jjm+1) = lon_scat(:,2)290 lat_scat(:, jjm+1) = rlat_g(klon_glo)291 lon_scat(:,nbp_lat) = lon_scat(:,2) 292 lat_scat(:,nbp_lat) = rlat_g(klon_glo) 291 293 ENDIF 292 294 … … 301 303 IF (error /= 0) THEN 302 304 abort_message='Pb allocation neighbours' 303 CALL abort_ gcm(modname,abort_message,1)305 CALL abort_physic(modname,abort_message,1) 304 306 ENDIF 305 307 ENDIF … … 309 311 IF (error /= 0) THEN 310 312 abort_message='Pb allocation contfrac' 311 CALL abort_ gcm(modname,abort_message,1)313 CALL abort_physic(modname,abort_message,1) 312 314 ENDIF 313 315 ENDIF … … 327 329 IF (error /= 0) THEN 328 330 abort_message='Pb allocation resolution' 329 CALL abort_ gcm(modname,abort_message,1)331 CALL abort_physic(modname,abort_message,1) 330 332 ENDIF 331 333 ENDIF 332 334 DO igrid = 1, knon 333 335 ij = knindex(igrid) 334 resolution(igrid,1) = cuphy(ij)335 resolution(igrid,2) = cvphy(ij)336 resolution(igrid,1) = dx(ij) 337 resolution(igrid,2) = dy(ij) 336 338 ENDDO 337 339 … … 339 341 IF (error /= 0) THEN 340 342 abort_message='Pb allocation coastalflow' 341 CALL abort_ gcm(modname,abort_message,1)343 CALL abort_physic(modname,abort_message,1) 342 344 ENDIF 343 345 … … 345 347 IF (error /= 0) THEN 346 348 abort_message='Pb allocation riverflow' 347 CALL abort_ gcm(modname,abort_message,1)349 CALL abort_physic(modname,abort_message,1) 348 350 ENDIF 349 351 … … 359 361 IF (carbon_cycle_cpl) THEN 360 362 ALLOCATE(fco2_land_inst(klon),stat=error) 361 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation fco2_land_inst',1)363 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation fco2_land_inst',1) 362 364 363 365 ALLOCATE(fco2_lu_inst(klon),stat=error) 364 IF(error /=0) CALL abort_ gcm(modname,'Pb in allocation fco2_lu_inst',1)366 IF(error /=0) CALL abort_physic(modname,'Pb in allocation fco2_lu_inst',1) 365 367 END IF 366 368 367 369 ALLOCATE(fields_cpl(klon,nb_fields_cpl), stat = error) 368 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation fields_cpl',1)370 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation fields_cpl',1) 369 371 370 372 ENDIF ! (fin debut) … … 399 401 ! if (pole_nord) then 400 402 ! offset=0 401 ! ktindex(:)=ktindex(:)+ iim-1403 ! ktindex(:)=ktindex(:)+nbp_lon-1 402 404 ! else 403 ! offset = klon_mpi_begin-1+ iim-1404 ! ktindex(:)=ktindex(:)+MOD(offset, iim)405 ! offset=offset-MOD(offset, iim)405 ! offset = klon_mpi_begin-1+nbp_lon-1 406 ! ktindex(:)=ktindex(:)+MOD(offset,nbp_lon) 407 ! offset=offset-MOD(offset,nbp_lon) 406 408 ! endif 407 409 … … 413 415 #ifndef CPP_MPI 414 416 ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI) 415 CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, knon, ktindex, dtime, &417 CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, knon, ktindex, dtime, & 416 418 lrestart_read, lrestart_write, lalo, & 417 419 contfrac, neighbours, resolution, date0, & … … 430 432 #else 431 433 ! Interface for ORCHIDEE version 1.9 or later(1.9.2, 1.9.3, 1.9.4, 1.9.5) compiled in parallel mode(with preprocessing flag CPP_MPI) 432 CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, offset, knon, ktindex, &434 CALL intersurf_main (itime+itau_phy-1, nbp_lon, nbp_lat, offset, knon, ktindex, & 433 435 orch_comm, dtime, lrestart_read, lrestart_write, lalo, & 434 436 contfrac, neighbours, resolution, date0, & … … 458 460 #ifndef CPP_MPI 459 461 ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI) 460 CALL intersurf_main (itime+itau_phy, iim, jjm+1, knon, ktindex, dtime, &462 CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat, knon, ktindex, dtime, & 461 463 lrestart_read, lrestart_write, lalo, & 462 464 contfrac, neighbours, resolution, date0, & … … 474 476 #else 475 477 ! Interface for ORCHIDEE version 1.9 or later compiled in parallel mode(with preprocessing flag CPP_MPI) 476 CALL intersurf_main (itime+itau_phy, iim, jjm+1,offset, knon, ktindex, &478 CALL intersurf_main (itime+itau_phy, nbp_lon, nbp_lat,offset, knon, ktindex, & 477 479 orch_comm,dtime, lrestart_read, lrestart_write, lalo, & 478 480 contfrac, neighbours, resolution, date0, & … … 530 532 SUBROUTINE Init_orchidee_index(knon,orch_comm,knindex,offset,ktindex) 531 533 532 INCLUDE "dimensions.h"534 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 533 535 534 536 #ifdef CPP_MPI … … 563 565 !**************************************************************************************** 564 566 565 MyLastPoint=klon_mpi_begin-1+knindex(knon)+ iim-1567 MyLastPoint=klon_mpi_begin-1+knindex(knon)+nbp_lon-1 566 568 567 569 IF (is_parallel) THEN … … 592 594 offset=0 593 595 ELSE 594 offset=LastPoint-MOD(LastPoint, iim)595 ENDIF 596 597 ktindex(1:knon)=knindex(1:knon)+(klon_mpi_begin+ iim-1)-offset-1596 offset=LastPoint-MOD(LastPoint,nbp_lon) 597 ENDIF 598 599 ktindex(1:knon)=knindex(1:knon)+(klon_mpi_begin+nbp_lon-1)-offset-1 598 600 599 601 … … 635 637 636 638 USE indice_sol_mod 637 638 INCLUDE "dimensions.h" 639 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 640 639 641 #ifdef CPP_MPI 640 642 INCLUDE 'mpif.h' … … 662 664 INTEGER, DIMENSION(8) :: offset 663 665 INTEGER, DIMENSION(knon) :: ktindex_p 664 INTEGER, DIMENSION( iim,jjm+1) :: correspond666 INTEGER, DIMENSION(nbp_lon,nbp_lat) :: correspond 665 667 INTEGER, ALLOCATABLE, DIMENSION(:) :: ktindex_g 666 668 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: neighbours_g … … 695 697 ENDIF 696 698 697 ktindex_p(1:knon)=ktindex(1:knon)+klon_mpi_begin-1+ iim-1699 ktindex_p(1:knon)=ktindex(1:knon)+klon_mpi_begin-1+nbp_lon-1 698 700 699 701 IF (is_sequential) THEN … … 714 716 ! 715 717 ! offset bord ouest 716 off_ini(1,1) = - iim ; off_ini(2,1) = - iim+ 1; off_ini(3,1) = 1717 off_ini(4,1) = iim + 1; off_ini(5,1) = iim ; off_ini(6,1) = 2 * iim- 1718 off_ini(7,1) = iim-1 ; off_ini(8,1) = - 1718 off_ini(1,1) = - nbp_lon ; off_ini(2,1) = - nbp_lon + 1; off_ini(3,1) = 1 719 off_ini(4,1) = nbp_lon + 1; off_ini(5,1) = nbp_lon ; off_ini(6,1) = 2 * nbp_lon - 1 720 off_ini(7,1) = nbp_lon -1 ; off_ini(8,1) = - 1 719 721 ! offset point normal 720 off_ini(1,2) = - iim ; off_ini(2,2) = - iim+ 1; off_ini(3,2) = 1721 off_ini(4,2) = iim + 1; off_ini(5,2) = iim ; off_ini(6,2) = iim- 1722 off_ini(7,2) = -1 ; off_ini(8,2) = - iim- 1722 off_ini(1,2) = - nbp_lon ; off_ini(2,2) = - nbp_lon + 1; off_ini(3,2) = 1 723 off_ini(4,2) = nbp_lon + 1; off_ini(5,2) = nbp_lon ; off_ini(6,2) = nbp_lon - 1 724 off_ini(7,2) = -1 ; off_ini(8,2) = - nbp_lon - 1 723 725 ! offset bord est 724 off_ini(1,3) = - iim; off_ini(2,3) = - 2 * iim + 1; off_ini(3,3) = - iim+ 1725 off_ini(4,3) = 1 ; off_ini(5,3) = iim ; off_ini(6,3) = iim- 1726 off_ini(7,3) = -1 ; off_ini(8,3) = - iim- 1726 off_ini(1,3) = - nbp_lon; off_ini(2,3) = - 2 * nbp_lon + 1; off_ini(3,3) = - nbp_lon + 1 727 off_ini(4,3) = 1 ; off_ini(5,3) = nbp_lon ; off_ini(6,3) = nbp_lon - 1 728 off_ini(7,3) = -1 ; off_ini(8,3) = - nbp_lon - 1 727 729 ! 728 730 ! … … 731 733 DO igrid = 1, knon_g 732 734 index = ktindex_g(igrid) 733 jj = INT((index - 1)/ iim) + 1734 ij = index - (jj - 1) * iim735 jj = INT((index - 1)/nbp_lon) + 1 736 ij = index - (jj - 1) * nbp_lon 735 737 correspond(ij,jj) = igrid 736 738 ENDDO … … 738 740 DO igrid = 1, knon_g 739 741 iglob = ktindex_g(igrid) 740 IF (MOD(iglob, iim) == 1) THEN742 IF (MOD(iglob, nbp_lon) == 1) THEN 741 743 offset = off_ini(:,1) 742 ELSE IF(MOD(iglob, iim) == 0) THEN744 ELSE IF(MOD(iglob, nbp_lon) == 0) THEN 743 745 offset = off_ini(:,3) 744 746 ELSE … … 747 749 DO i = 1, 8 748 750 index = iglob + offset(i) 749 ireal = (MIN(MAX(1, index - iim+ 1), klon_glo))751 ireal = (MIN(MAX(1, index - nbp_lon + 1), klon_glo)) 750 752 IF (pctsrf_g(ireal) > EPSFRA) THEN 751 jj = INT((index - 1)/ iim) + 1752 ij = index - (jj - 1) * iim753 jj = INT((index - 1)/nbp_lon) + 1 754 ij = index - (jj - 1) * nbp_lon 753 755 neighbours_g(igrid, i) = correspond(ij, jj) 754 756 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.