- Timestamp:
- Oct 21, 2010, 4:25:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/LMDZ5V1.0-dev/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
r1279 r1444 138 138 INTEGER :: ij, jj, igrid, ireal, index 139 139 INTEGER :: error 140 INTEGER, SAVE :: nb_fields_cpl ! number of fields for the climate-carbon coupling (between ATM and ORCHIDEE). 141 REAL, SAVE, ALLOCATABLE, DIMENSION(:,:) :: fields_cpl ! Fluxes for the climate-carbon coupling 140 142 REAL, DIMENSION(klon) :: swdown_vrai 141 REAL, DIMENSION(klon) :: fco2_land_comp ! sur grille compresse142 REAL, DIMENSION(klon) :: fco2_lu_comp ! sur grille compresse143 143 CHARACTER (len = 20) :: modname = 'surf_land_orchidee' 144 144 CHARACTER (len = 80) :: abort_message … … 210 210 211 211 IF (debut) THEN 212 ! Test de coherence 213 #ifndef ORCH_NEW 214 ! Compilation avec orchidee nouvelle version necessaire avec carbon_cycle_cpl=y 215 IF (carbon_cycle_cpl) THEN 216 abort_message='You must define preprossing key ORCH_NEW when running carbon_cycle_cpl=y' 217 CALL abort_gcm(modname,abort_message,1) 218 END IF 219 #endif 212 220 ALLOCATE(ktindex(knon)) 213 221 IF ( .NOT. ALLOCATED(albedo_keep)) THEN … … 342 350 ! 343 351 ! Allocate variables needed for carbon_cycle_mod 344 ! 352 IF ( carbon_cycle_cpl ) THEN 353 nb_fields_cpl=2 354 ELSE 355 nb_fields_cpl=1 356 END IF 357 358 345 359 IF (carbon_cycle_cpl) THEN 346 IF (.NOT. ALLOCATED(fco2_land_inst)) THEN 347 ALLOCATE(fco2_land_inst(klon),stat=error) 348 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation fco2_land_inst',1) 349 350 ALLOCATE(fco2_lu_inst(klon),stat=error) 351 IF(error /=0) CALL abort_gcm(modname,'Pb in allocation fco2_lu_inst',1) 352 END IF 360 ALLOCATE(fco2_land_inst(klon),stat=error) 361 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation fco2_land_inst',1) 362 363 ALLOCATE(fco2_lu_inst(klon),stat=error) 364 IF(error /=0) CALL abort_gcm(modname,'Pb in allocation fco2_lu_inst',1) 353 365 END IF 366 367 ALLOCATE(fields_cpl(klon,nb_fields_cpl), stat = error) 368 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation fields_cpl',1) 354 369 355 370 ENDIF ! (fin debut) … … 406 421 evap, fluxsens, fluxlat, coastalflow, riverflow, & 407 422 tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, & 408 lon_scat, lat_scat, q2m, t2m) 423 lon_scat, lat_scat, q2m, t2m & 424 #ifdef ORCH_NEW 425 , nb_fields_cpl, fields_cpl) 426 #else 427 ) 428 #endif 409 429 410 430 #else 411 ! Interface for ORCHIDEE version 1.9 or later(1.9.2, 1.9.3, 1.9.4 ) compiled in parallel mode(with preprocessing flag CPP_MPI)431 ! 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) 412 432 CALL intersurf_main (itime+itau_phy-1, iim, jjm+1, offset, knon, ktindex, & 413 433 orch_comm, dtime, lrestart_read, lrestart_write, lalo, & … … 418 438 evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), & 419 439 tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), & 420 lon_scat, lat_scat, q2m, t2m) 440 lon_scat, lat_scat, q2m, t2m & 441 #ifdef ORCH_NEW 442 , nb_fields_cpl, fields_cpl(1:knon,:)) 443 #else 444 ) 445 #endif 421 446 #endif 422 447 … … 431 456 432 457 IF (knon /=0) THEN 433 434 458 #ifndef CPP_MPI 435 459 ! Interface for ORCHIDEE compiled in sequential mode(without preprocessing flag CPP_MPI) … … 442 466 evap, fluxsens, fluxlat, coastalflow, riverflow, & 443 467 tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0_new, & 444 lon_scat, lat_scat, q2m, t2m) 445 468 lon_scat, lat_scat, q2m, t2m & 469 #ifdef ORCH_NEW 470 , nb_fields_cpl, fields_cpl) 471 #else 472 ) 473 #endif 446 474 #else 447 475 ! Interface for ORCHIDEE version 1.9 or later compiled in parallel mode(with preprocessing flag CPP_MPI) … … 454 482 evap(1:knon), fluxsens(1:knon), fluxlat(1:knon), coastalflow(1:knon), riverflow(1:knon), & 455 483 tsol_rad(1:knon), tsurf_new(1:knon), qsurf(1:knon), albedo_out(1:knon,:), emis_new(1:knon), z0_new(1:knon), & 456 lon_scat, lat_scat, q2m, t2m) 457 #endif 458 484 lon_scat, lat_scat, q2m, t2m & 485 #ifdef ORCH_NEW 486 , nb_fields_cpl, fields_cpl(1:knon,:)) 487 #else 488 ) 489 #endif 490 #endif 459 491 ENDIF 460 492 … … 478 510 479 511 IF (debut) lrestart_read = .FALSE. 480 481 482 ! JG : TEMPORAIRE!!!! Les variables fco2_land_comp et fco2_lu_comp seront plus tard en sortie d'ORCHIDEE483 ! ici mis a valeur quelquonque pour test. Ces variables sont sur la grille compresse avec uniquement des points de terres484 485 fco2_land_comp(:) = 1.486 fco2_lu_comp(:) = 10.487 512 488 513 ! Decompress variables for the module carbon_cycle_mod … … 493 518 DO igrid = 1, knon 494 519 ireal = knindex(igrid) 495 fco2_land_inst(ireal) = f co2_land_comp(igrid)496 fco2_lu_inst(ireal) = f co2_lu_comp(igrid)520 fco2_land_inst(ireal) = fields_cpl(igrid,1) 521 fco2_lu_inst(ireal) = fields_cpl(igrid,2) 497 522 END DO 498 523 END IF
Note: See TracChangeset
for help on using the changeset viewer.