Changeset 1279 for LMDZ4/trunk/libf/phylmd/cpl_mod.F90
- Timestamp:
- Dec 10, 2009, 10:02:56 AM (15 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
- Property svn:mergeinfo changed
/LMDZ4/branches/LMDZ4-dev merged: 1150-1162,1164-1193,1195-1231,1234-1235,1237-1240,1242-1274,1276
- Property svn:mergeinfo changed
-
LMDZ4/trunk/libf/phylmd/cpl_mod.F90
r1146 r1279 39 39 !************************************************************************************* 40 40 ! variable for coupling period 41 INTEGER, SAVE 41 INTEGER, SAVE :: nexca 42 42 !$OMP THREADPRIVATE(nexca) 43 43 … … 47 47 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_snow, cpl_evap, cpl_tsol 48 48 !$OMP THREADPRIVATE(cpl_snow,cpl_evap,cpl_tsol) 49 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_fder, cpl_albe, cpl_taux 50 !$OMP THREADPRIVATE(cpl_fder,cpl_albe,cpl_taux )49 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_fder, cpl_albe, cpl_taux, cpl_tauy 50 !$OMP THREADPRIVATE(cpl_fder,cpl_albe,cpl_taux,cpl_tauy) 51 51 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_windsp 52 52 !$OMP THREADPRIVATE(cpl_windsp) 53 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_tauy 54 !$OMP THREADPRIVATE(cpl_tauy) 53 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_taumod 54 !$OMP THREADPRIVATE(cpl_taumod) 55 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_atm_co2 56 !$OMP THREADPRIVATE(cpl_atm_co2) 55 57 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_rriv2D, cpl_rcoa2D, cpl_rlic2D 56 58 !$OMP THREADPRIVATE(cpl_rriv2D,cpl_rcoa2D,cpl_rlic2D) … … 67 69 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: read_u0, read_v0 ! ocean surface current 68 70 !$OMP THREADPRIVATE(read_u0,read_v0) 69 71 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: read_co2 ! ocean co2 flux 72 !$OMP THREADPRIVATE(read_co2) 70 73 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: unity 71 74 !$OMP THREADPRIVATE(unity) … … 82 85 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cpl_taux2D, cpl_tauy2D 83 86 !$OMP THREADPRIVATE(cpl_taux2D, cpl_tauy2D) 87 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cpl_taumod2D 88 !$OMP THREADPRIVATE(cpl_taumod2D) 84 89 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_windsp2D 85 90 !$OMP THREADPRIVATE(cpl_windsp2D) 86 87 ! variable for OPENMP parallelisation 88 89 INTEGER,ALLOCATABLE,DIMENSION(:),SAVE :: knon_omp 90 REAL,ALLOCATABLE,DIMENSION(:,:),SAVE :: buffer_omp 91 91 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_atm_co22D 92 !$OMP THREADPRIVATE(cpl_atm_co22D) 93 92 94 CONTAINS 93 95 ! … … 95 97 ! 96 98 SUBROUTINE cpl_init(dtime, rlon, rlat) 99 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day 97 100 98 101 INCLUDE "dimensions.h" … … 160 163 ALLOCATE(cpl_taux(klon,2), stat = error) 161 164 sum_error = sum_error + error 165 ALLOCATE(cpl_tauy(klon,2), stat = error) 166 sum_error = sum_error + error 162 167 ALLOCATE(cpl_windsp(klon,2), stat = error) 163 168 sum_error = sum_error + error 164 ALLOCATE(cpl_tau y(klon,2), stat = error)169 ALLOCATE(cpl_taumod(klon,2), stat = error) 165 170 sum_error = sum_error + error 166 171 ALLOCATE(cpl_rriv2D(iim,jj_nb), stat=error) … … 178 183 ALLOCATE(read_alb_sic(iim, jj_nb), stat = error) 179 184 sum_error = sum_error + error 180 181 185 ALLOCATE(read_u0(iim, jj_nb), stat = error) 182 186 sum_error = sum_error + error 183 187 ALLOCATE(read_v0(iim, jj_nb), stat = error) 184 188 sum_error = sum_error + error 189 190 IF (carbon_cycle_cpl) THEN 191 ALLOCATE(read_co2(iim, jj_nb), stat = error) 192 sum_error = sum_error + error 193 ALLOCATE(cpl_atm_co2(klon,2), stat = error) 194 sum_error = sum_error + error 195 196 ! Allocate variable in carbon_cycle_mod 197 ALLOCATE(fco2_ocn_day(klon), stat = error) 198 sum_error = sum_error + error 199 END IF 185 200 186 201 IF (sum_error /= 0) THEN … … 196 211 ENDDO 197 212 198 ! cpl_sols = 0. ; cpl_nsol = 0. ; cpl_rain = 0. ; cpl_snow = 0.199 ! cpl_evap = 0. ; cpl_tsol = 0. ; cpl_fder = 0. ; cpl_albe = 0.200 ! cpl_taux = 0. ; cpl_tauy = 0. ; cpl_rriv2D = 0. ; cpl_rcoa2D = 0.201 ! cpl_rlic2D = 0. ; cpl_windsp = 0.202 203 213 !************************************************************************************* 204 214 ! Initialize coupling … … 207 217 idtime = INT(dtime) 208 218 #ifdef CPP_COUPLE 209 !$OMP MASTER210 219 CALL inicma 211 !$OMP END MASTER212 220 #endif 213 221 … … 237 245 CALL histdef(nidct, 'tmp_lat','tmp_lat', & 238 246 "-",iim, jjm+1, nhoridct, 1, 1, 1, -99, 32, "inst", dtime,dtime) 239 DO jf=1,jpflda2o1 + jpflda2o2 240 CALL histdef(nidct, cl_writ(jf),cl_writ(jf), & 241 "-",iim, jjm+1, nhoridct, 1, 1, 1, -99, 32, "inst", dtime,dtime) 247 DO jf=1,maxsend 248 IF (infosend(i)%action) THEN 249 CALL histdef(nidct, infosend(i)%name ,infosend(i)%name , & 250 "-",iim, jjm+1, nhoridct, 1, 1, 1, -99, 32, "inst", dtime,dtime) 251 ENDIF 242 252 END DO 243 253 CALL histend(nidct) … … 248 258 0,zjulian,dtime,nhoridcs,nidcs) 249 259 ! no vertical axis 250 DO jf=1,jpfldo2a 251 CALL histdef(nidcs, cl_read(jf),cl_read(jf), & 252 "-",iim, jjm+1, nhoridcs, 1, 1, 1, -99, 32, "inst", dtime,dtime) 260 DO jf=1,maxrecv 261 IF (inforecv(i)%action) THEN 262 CALL histdef(nidcs,inforecv(i)%name ,inforecv(i)%name , & 263 "-",iim, jjm+1, nhoridcs, 1, 1, 1, -99, 32, "inst", dtime,dtime) 264 ENDIF 253 265 END DO 254 266 CALL histend(nidcs) … … 256 268 257 269 ENDIF ! is_sequential 258 259 ! OPENMP Initialization260 261 !$OMP MASTER262 ALLOCATE(knon_omp(0:omp_size-1))263 ALLOCATE(buffer_omp(klon_mpi,0:omp_size-1))264 !$OMP END MASTER265 !$OMP BARRIER266 270 267 271 END SUBROUTINE cpl_init … … 278 282 USE surface_data 279 283 USE phys_state_var_mod, ONLY : rlon, rlat 280 284 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 285 281 286 INCLUDE "indicesol.h" 282 287 INCLUDE "temps.h" … … 300 305 CHARACTER(len = 80) :: abort_message 301 306 REAL, DIMENSION(klon) :: read_sic1D 302 REAL, DIMENSION(iim,jj_nb, jpfldo2a):: tab_read_flds307 REAL, DIMENSION(iim,jj_nb,maxrecv) :: tab_read_flds 303 308 REAL, DIMENSION(klon,nbsrf) :: pctsrf_old 304 309 REAL, DIMENSION(klon_mpi) :: rlon_mpi, rlat_mpi … … 314 319 is_modified=.FALSE. 315 320 316 ! Check if right moment to rece vie from coupler321 ! Check if right moment to receive from coupler 317 322 IF (MOD(itime, nexca) == 1) THEN 318 323 is_modified=.TRUE. … … 329 334 ndexcs(:) = 0 330 335 itau_w = itau_phy + itime 331 DO i = 1, jpfldo2a 332 CALL histwrite(nidcs,cl_read(i),itau_w,tab_read_flds(:,:,i),iim*(jjm+1),ndexcs) 336 DO i = 1, maxrecv 337 IF (inforecv(i)%action) THEN 338 CALL histwrite(nidcs,inforecv(i)%name,itau_w,tab_read_flds(:,:,i),iim*(jjm+1),ndexcs) 339 ENDIF 333 340 END DO 334 341 ENDIF … … 337 344 ! Save each field in a 2D array. 338 345 !$OMP MASTER 339 read_sst(:,:) = tab_read_flds(:,:, 1) ! Sea surface temperature340 read_sic(:,:) = tab_read_flds(:,:, 2) ! Sea ice concentration341 read_alb_sic(:,:) = tab_read_flds(:,:, 3) ! Albedo at sea ice342 read_sit(:,:) = tab_read_flds(:,:, 4) ! Sea ice temperature346 read_sst(:,:) = tab_read_flds(:,:,idr_sisutw) ! Sea surface temperature 347 read_sic(:,:) = tab_read_flds(:,:,idr_icecov) ! Sea ice concentration 348 read_alb_sic(:,:) = tab_read_flds(:,:,idr_icealw) ! Albedo at sea ice 349 read_sit(:,:) = tab_read_flds(:,:,idr_icetem) ! Sea ice temperature 343 350 !$OMP END MASTER 344 351 … … 354 361 ! Transform the currents from cartesian to spheric coordinates 355 362 ! tmp_r0 should be zero 356 CALL geo2atm(iim, jj_nb, tab_read_flds(:,:,5), tab_read_flds(:,:,6), tab_read_flds(:,:,7), & 363 CALL geo2atm(iim, jj_nb, tab_read_flds(:,:,idr_curenx), & 364 tab_read_flds(:,:,idr_cureny), tab_read_flds(:,:,idr_curenz), & 357 365 tmp_lon, tmp_lat, & 358 366 read_u0(:,:), read_v0(:,:), tmp_r0(:,:)) 359 367 !$OMP END MASTER 360 368 361 369 ELSE 362 370 read_u0(:,:) = 0. 363 371 read_v0(:,:) = 0. 372 ENDIF 373 374 IF (carbon_cycle_cpl) THEN 375 !$OMP MASTER 376 read_co2(:,:) = tab_read_flds(:,:,idr_oceco2) ! CO2 flux 377 !$OMP END MASTER 364 378 ENDIF 365 379 … … 374 388 DO i = 1, klon 375 389 ! treatment only of points with ocean and/or seaice 390 ! old land-ocean mask can not be changed 376 391 IF (pctsrf_old(i,is_oce) + pctsrf_old(i,is_sic) > 0.) THEN 377 392 pctsrf(i,is_sic) = (pctsrf_old(i,is_oce) + pctsrf_old(i,is_sic)) & … … 396 411 ! The temperature is transformed into 1D array with valid points from index 1 to knon. 397 412 ! 413 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day 398 414 INCLUDE "indicesol.h" 399 415 … … 411 427 ! Local variables 412 428 !************************************************************************************* 413 INTEGER :: i 414 REAL, DIMENSION(klon) :: sic_new 429 INTEGER :: i 430 INTEGER, DIMENSION(klon) :: index 431 REAL, DIMENSION(klon) :: sic_new 415 432 416 433 !************************************************************************************* … … 422 439 CALL cpl2gath(read_u0, u0_new, knon, knindex) 423 440 CALL cpl2gath(read_v0, v0_new, knon, knindex) 441 442 !************************************************************************************* 443 ! Transform read_co2 into uncompressed 1D variable fco2_ocn_day added directly in 444 ! the module carbon_cycle_mod 445 ! 446 !************************************************************************************* 447 IF (carbon_cycle_cpl) THEN 448 DO i=1,klon 449 index(i)=i 450 END DO 451 CALL cpl2gath(read_co2, fco2_ocn_day, klon, index) 452 END IF 424 453 425 454 !************************************************************************************* … … 499 528 ! (it is done in cpl_send_seaice_fields). 500 529 ! 530 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 501 531 INCLUDE "indicesol.h" 502 532 INCLUDE "dimensions.h" … … 543 573 cpl_tauy(1:knon,cpl_index) = 0.0 544 574 cpl_windsp(1:knon,cpl_index) = 0.0 575 cpl_taumod(1:knon,cpl_index) = 0.0 576 IF (carbon_cycle_cpl) cpl_atm_co2(1:knon,cpl_index) = 0.0 545 577 ENDIF 546 578 … … 571 603 tauy(ig) / FLOAT(nexca) 572 604 cpl_windsp(ig,cpl_index) = cpl_windsp(ig,cpl_index) + & 573 windsp(ig) / FLOAT(nexca) 574 ENDDO 605 windsp(ig) / FLOAT(nexca) 606 cpl_taumod(ig,cpl_index) = cpl_taumod(ig,cpl_index) + & 607 SQRT ( taux(ig)*taux(ig)+tauy(ig)*tauy(ig) ) / FLOAT (nexca) 608 609 IF (carbon_cycle_cpl) THEN 610 cpl_atm_co2(ig,cpl_index) = cpl_atm_co2(ig,cpl_index) + & 611 co2_send(knindex(ig))/ FLOAT(nexca) 612 END IF 613 ENDDO 575 614 576 615 !************************************************************************************* … … 606 645 ALLOCATE(cpl_windsp2D(iim,jj_nb), stat=error) 607 646 sum_error = sum_error + error 647 ALLOCATE(cpl_taumod2D(iim,jj_nb,2), stat=error) 648 sum_error = sum_error + error 608 649 650 IF (carbon_cycle_cpl) THEN 651 ALLOCATE(cpl_atm_co22D(iim,jj_nb), stat=error) 652 sum_error = sum_error + error 653 END IF 654 609 655 IF (sum_error /= 0) THEN 610 656 abort_message='Pb allocation variables couplees pour l''ecriture' … … 650 696 knon, knindex) 651 697 652 ENDIF 698 CALL gath2cpl(cpl_taumod(:,cpl_index), cpl_taumod2D(:,:,cpl_index), & 699 knon, knindex) 700 701 IF (carbon_cycle_cpl) & 702 CALL gath2cpl(cpl_atm_co2(:,cpl_index), cpl_atm_co22D(:,:), knon, knindex) 703 ENDIF 653 704 654 705 END SUBROUTINE cpl_send_ocean_fields … … 668 719 ! the coupler. 669 720 ! 721 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 670 722 INCLUDE "indicesol.h" 671 723 INCLUDE "dimensions.h" … … 716 768 cpl_taux(1:knon,cpl_index) = 0.0 717 769 cpl_tauy(1:knon,cpl_index) = 0.0 770 cpl_taumod(1:knon,cpl_index) = 0.0 718 771 ENDIF 719 772 … … 742 795 taux(ig) / FLOAT(nexca) 743 796 cpl_tauy(ig,cpl_index) = cpl_tauy(ig,cpl_index) + & 744 tauy(ig) / FLOAT(nexca) 797 tauy(ig) / FLOAT(nexca) 798 cpl_taumod(ig,cpl_index) = cpl_taumod(ig,cpl_index) + & 799 SQRT ( taux(ig)*taux(ig)+tauy(ig)*tauy(ig) ) / FLOAT(nexca) 745 800 ENDDO 746 801 … … 775 830 ALLOCATE(cpl_windsp2D(iim,jj_nb), stat=error) 776 831 sum_error = sum_error + error 777 832 ALLOCATE(cpl_taumod2D(iim,jj_nb,2), stat=error) 833 sum_error = sum_error + error 834 835 IF (carbon_cycle_cpl) THEN 836 ALLOCATE(cpl_atm_co22D(iim,jj_nb), stat=error) 837 sum_error = sum_error + error 838 END IF 839 778 840 IF (sum_error /= 0) THEN 779 841 abort_message='Pb allocation variables couplees pour l''ecriture' … … 819 881 knon, knindex) 820 882 883 CALL gath2cpl(cpl_taumod(:,cpl_index), cpl_taumod2D(:,:,cpl_index), & 884 knon, knindex) 885 821 886 ! Send all fields 822 887 CALL cpl_send_all(itime, dtime, pctsrf, lafin, rlon, rlat) … … 894 959 ! will be done in cpl_send_seaice_fields. 895 960 ! 961 896 962 INCLUDE "dimensions.h" 897 963 … … 947 1013 ! 948 1014 USE surface_data 1015 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 949 1016 ! Some includes 950 1017 !************************************************************************************* … … 979 1046 REAL, DIMENSION(iim, jj_nb) :: tmp_calv 980 1047 ! Table with all fields to send to coupler 981 REAL, DIMENSION(iim, jj_nb, jpflda2o1+jpflda2o2):: tab_flds1048 REAL, DIMENSION(iim, jj_nb, maxsend) :: tab_flds 982 1049 REAL, DIMENSION(klon_mpi) :: rlon_mpi, rlat_mpi 983 1050 … … 998 1065 !************************************************************************************* 999 1066 !$OMP MASTER 1000 tab_flds(:,:, 7)= cpl_windsp2D(:,:)1001 tab_flds(:,:, 8)= cpl_sols2D(:,:,2)1002 tab_flds(:,:, 10) = cpl_nsol2D(:,:,2)1003 tab_flds(:,:, 12) = cpl_fder2D(:,:,2)1067 tab_flds(:,:,ids_windsp) = cpl_windsp2D(:,:) 1068 tab_flds(:,:,ids_shfice) = cpl_sols2D(:,:,2) 1069 tab_flds(:,:,ids_nsfice) = cpl_nsol2D(:,:,2) 1070 tab_flds(:,:,ids_dflxdt) = cpl_fder2D(:,:,2) 1004 1071 1005 1072 IF (version_ocean=='nemo') THEN 1006 tab_flds(:,:,18) = cpl_rriv2D(:,:) + cpl_rcoa2D(:,:) 1073 tab_flds(:,:,ids_liqrun) = cpl_rriv2D(:,:) + cpl_rcoa2D(:,:) 1074 IF (carbon_cycle_cpl) tab_flds(:,:,ids_atmco2)=cpl_atm_co22D(:,:) 1007 1075 ELSE IF (version_ocean=='opa8') THEN 1008 tab_flds(:,:, 9)= cpl_sols2D(:,:,1)1009 tab_flds(:,:, 11) = cpl_nsol2D(:,:,1)1010 tab_flds(:,:, 13) = cpl_evap2D(:,:,2)1011 tab_flds(:,:, 14) = cpl_evap2D(:,:,1)1012 tab_flds(:,:, 17) = cpl_rcoa2D(:,:)1013 tab_flds(:,:, 18) = cpl_rriv2D(:,:)1076 tab_flds(:,:,ids_shfoce) = cpl_sols2D(:,:,1) 1077 tab_flds(:,:,ids_nsfoce) = cpl_nsol2D(:,:,1) 1078 tab_flds(:,:,ids_icevap) = cpl_evap2D(:,:,2) 1079 tab_flds(:,:,ids_ocevap) = cpl_evap2D(:,:,1) 1080 tab_flds(:,:,ids_runcoa) = cpl_rcoa2D(:,:) 1081 tab_flds(:,:,ids_rivflu) = cpl_rriv2D(:,:) 1014 1082 END IF 1015 1083 … … 1063 1131 ENDIF 1064 1132 1065 IF (version_ocean=='nemo') THEN 1066 tab_flds(:,:,17) = tmp_calv(:,:) 1067 ELSE IF (version_ocean=='opa8') THEN 1068 tab_flds(:,:,19) = tmp_calv(:,:) 1069 END IF 1133 tab_flds(:,:,ids_calvin) = tmp_calv(:,:) 1070 1134 1071 1135 !************************************************************************************* … … 1078 1142 1079 1143 IF (version_ocean=='nemo') THEN 1080 tab_flds(:,:,9) = 0.0 1081 tab_flds(:,:,11) = 0.0 1082 tab_flds(:,:,13) = 0.0 1083 tab_flds(:,:,14) = 0.0 1084 tab_flds(:,:,15) = 0.0 1144 tab_flds(:,:,ids_shftot) = 0.0 1145 tab_flds(:,:,ids_nsftot) = 0.0 1146 tab_flds(:,:,ids_totrai) = 0.0 1147 tab_flds(:,:,ids_totsno) = 0.0 1148 tab_flds(:,:,ids_toteva) = 0.0 1149 tab_flds(:,:,ids_taumod) = 0.0 1085 1150 1086 1151 tmp_taux(:,:) = 0.0 … … 1092 1157 tmp_tauy = cpl_tauy2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1093 1158 cpl_tauy2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1159 1160 tab_flds(:,:,ids_shftot) = cpl_sols2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1161 cpl_sols2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1162 tab_flds(:,:,ids_nsftot) = cpl_nsol2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1163 cpl_nsol2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1164 tab_flds(:,:,ids_totrai) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1165 cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1166 tab_flds(:,:,ids_totsno) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1167 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1168 tab_flds(:,:,ids_toteva) = cpl_evap2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1169 cpl_evap2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1170 tab_flds(:,:,ids_taumod) = cpl_taumod2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1171 cpl_taumod2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1094 1172 1095 tab_flds(:,:,9) = cpl_sols2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1096 cpl_sols2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)1097 tab_flds(:,:,11) = cpl_nsol2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1098 cpl_nsol2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)1099 tab_flds(:,:,13) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1100 cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)1101 tab_flds(:,:,14) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1102 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)1103 tab_flds(:,:,15) = cpl_evap2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1104 cpl_evap2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:)1105 1173 ENDWHERE 1106 1174 1107 tab_flds(:,:, 16) = cpl_evap2D(:,:,2)1175 tab_flds(:,:,ids_icevap) = cpl_evap2D(:,:,2) 1108 1176 1109 1177 ELSE IF (version_ocean=='opa8') THEN 1110 1178 ! Store fields for rain and snow in tab_flds(:,:,15) and tab_flds(:,:,16) 1111 tab_flds(:,:, 15) = 0.01112 tab_flds(:,:, 16) = 0.01179 tab_flds(:,:,ids_totrai) = 0.0 1180 tab_flds(:,:,ids_totsno) = 0.0 1113 1181 tmp_taux(:,:) = 0.0 1114 1182 tmp_tauy(:,:) = 0.0 1115 1183 ! For all valid grid cells containing some fraction of ocean or sea-ice 1116 1184 WHERE ( deno(:,:) /= 0 ) 1117 tab_flds(:,:, 15) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1185 tab_flds(:,:,ids_totrai) = cpl_rain2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1118 1186 cpl_rain2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1119 tab_flds(:,:, 16) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + &1187 tab_flds(:,:,ids_totsno) = cpl_snow2D(:,:,1) * pctsrf2D(:,:,is_oce) / deno(:,:) + & 1120 1188 cpl_snow2D(:,:,2) * pctsrf2D(:,:,is_sic) / deno(:,:) 1121 1189 … … 1163 1231 !$OMP MASTER 1164 1232 CALL atm2geo (iim, jj_nb, tmp_taux, tmp_tauy, tmp_lon, tmp_lat, & 1165 tab_flds(:,:, 1), tab_flds(:,:,2), tab_flds(:,:,3) )1166 1167 tab_flds(:,:, 4) = tab_flds(:,:,1)1168 tab_flds(:,:, 5) = tab_flds(:,:,2)1169 tab_flds(:,:, 6) = tab_flds(:,:,3)1233 tab_flds(:,:,ids_tauxxu), tab_flds(:,:,ids_tauyyu), tab_flds(:,:,ids_tauzzu) ) 1234 1235 tab_flds(:,:,ids_tauxxv) = tab_flds(:,:,ids_tauxxu) 1236 tab_flds(:,:,ids_tauyyv) = tab_flds(:,:,ids_tauyyu) 1237 tab_flds(:,:,ids_tauzzv) = tab_flds(:,:,ids_tauzzu) 1170 1238 !$OMP END MASTER 1171 1239 … … 1175 1243 !************************************************************************************* 1176 1244 IF (is_sequential) THEN 1177 CALL histwrite(nidct,cl_writ(8), itau_w,tab_flds(:,:,8), iim*(jjm+1),ndexct) 1178 CALL histwrite(nidct,cl_writ(9), itau_w,tab_flds(:,:,9), iim*(jjm+1),ndexct) 1179 CALL histwrite(nidct,cl_writ(10),itau_w,tab_flds(:,:,10),iim*(jjm+1),ndexct) 1180 CALL histwrite(nidct,cl_writ(11),itau_w,tab_flds(:,:,11),iim*(jjm+1),ndexct) 1181 CALL histwrite(nidct,cl_writ(12),itau_w,tab_flds(:,:,12),iim*(jjm+1),ndexct) 1182 CALL histwrite(nidct,cl_writ(13),itau_w,tab_flds(:,:,13),iim*(jjm+1),ndexct) 1183 CALL histwrite(nidct,cl_writ(14),itau_w,tab_flds(:,:,14),iim*(jjm+1),ndexct) 1184 CALL histwrite(nidct,cl_writ(15),itau_w,tab_flds(:,:,15),iim*(jjm+1),ndexct) 1185 CALL histwrite(nidct,cl_writ(16),itau_w,tab_flds(:,:,16),iim*(jjm+1),ndexct) 1186 CALL histwrite(nidct,cl_writ(17),itau_w,tab_flds(:,:,17),iim*(jjm+1),ndexct) 1187 CALL histwrite(nidct,cl_writ(18),itau_w,tab_flds(:,:,18),iim*(jjm+1),ndexct) 1188 CALL histwrite(nidct,cl_writ(19),itau_w,tab_flds(:,:,19),iim*(jjm+1),ndexct) 1189 CALL histwrite(nidct,cl_writ(1), itau_w,tab_flds(:,:,1), iim*(jjm+1),ndexct) 1190 CALL histwrite(nidct,cl_writ(2), itau_w,tab_flds(:,:,2), iim*(jjm+1),ndexct) 1191 CALL histwrite(nidct,cl_writ(3), itau_w,tab_flds(:,:,3), iim*(jjm+1),ndexct) 1192 CALL histwrite(nidct,cl_writ(4), itau_w,tab_flds(:,:,4), iim*(jjm+1),ndexct) 1193 CALL histwrite(nidct,cl_writ(5), itau_w,tab_flds(:,:,5), iim*(jjm+1),ndexct) 1194 CALL histwrite(nidct,cl_writ(6), itau_w,tab_flds(:,:,6), iim*(jjm+1),ndexct) 1195 CALL histwrite(nidct,cl_writ(7), itau_w,tab_flds(:,:,7), iim*(jjm+1),ndexct) 1196 CALL histsync(nidct) 1245 DO j=1,maxsend 1246 IF (infosend(j)%action) CALL histwrite(nidct,infosend(j)%name, itau_w, & 1247 tab_flds(:,:,j),iim*(jjm+1),ndexct) 1248 ENDDO 1197 1249 ENDIF 1198 1199 1200 1250 !************************************************************************************* 1201 1251 ! Send the table of all fields … … 1218 1268 DEALLOCATE(cpl_evap2D, cpl_tsol2D, cpl_fder2D, cpl_albe2D, stat=error ) 1219 1269 sum_error = sum_error + error 1220 DEALLOCATE(cpl_taux2D, cpl_tauy2D, cpl_windsp2D, stat=error ) 1221 sum_error = sum_error + error 1270 DEALLOCATE(cpl_taux2D, cpl_tauy2D, cpl_windsp2D, cpl_taumod2D, stat=error ) 1271 sum_error = sum_error + error 1272 1273 IF (carbon_cycle_cpl) THEN 1274 DEALLOCATE(cpl_atm_co22D, stat=error ) 1275 sum_error = sum_error + error 1276 END IF 1277 1222 1278 IF (sum_error /= 0) THEN 1223 1279 abort_message='Pb in deallocation of cpl_xxxx2D coupling variables' … … 1231 1287 SUBROUTINE cpl2gath(champ_in, champ_out, knon, knindex) 1232 1288 USE mod_phys_lmdz_para 1233 ! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer1234 ! au coupleur.1289 ! Cette routine transforme un champs de la grille 2D recu du coupleur sur la grille 1290 ! 'gathered' (la grille physiq comprime). 1235 1291 ! 1236 1292 ! 1237 1293 ! input: 1238 ! champ_in champ sur la grille gathere1294 ! champ_in champ sur la grille 2D 1239 1295 ! knon nombre de points dans le domaine a traiter 1240 1296 ! knindex index des points de la surface a traiter 1241 1297 ! 1242 1298 ! output: 1243 ! champ_out champ sur la grille 2D1299 ! champ_out champ sur la grille 'gatherd' 1244 1300 ! 1245 1301 INCLUDE "dimensions.h"
Note: See TracChangeset
for help on using the changeset viewer.