Changeset 3627 for LMDZ6/branches/Ocean_skin/libf/phylmd/cpl_mod.F90
- Timestamp:
- Feb 3, 2020, 2:27:46 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin/libf/phylmd/cpl_mod.F90
r3605 r3627 48 48 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_snow, cpl_evap, cpl_tsol 49 49 !$OMP THREADPRIVATE(cpl_snow,cpl_evap,cpl_tsol) 50 51 REAL, ALLOCATABLE, SAVE:: cpl_t_int(:) 52 !$OMP THREADPRIVATE(cpl_t_int) 53 50 54 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: cpl_fder, cpl_albe, cpl_taux, cpl_tauy 51 55 !$OMP THREADPRIVATE(cpl_fder,cpl_albe,cpl_taux,cpl_tauy) … … 66 70 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: read_sit ! sea ice temperature 67 71 !$OMP THREADPRIVATE(read_sit) 72 73 REAL, ALLOCATABLE, SAVE:: read_sss(:, :) 74 ! bulk salinity of the surface layer of the ocean, in ppt 75 !$OMP THREADPRIVATE(read_sss) 76 68 77 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: read_sic ! sea ice fraction 69 78 !$OMP THREADPRIVATE(read_sic) … … 84 93 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cpl_snow2D, cpl_evap2D, cpl_tsol2D 85 94 !$OMP THREADPRIVATE(cpl_snow2D, cpl_evap2D, cpl_tsol2D) 95 96 REAL, ALLOCATABLE, SAVE:: cpl_t_int_2D(:,:) 97 !$OMP THREADPRIVATE(cpl_t_int_2D) 98 86 99 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cpl_fder2D, cpl_albe2D 87 100 !$OMP THREADPRIVATE(cpl_fder2D, cpl_albe2D) … … 122 135 USE geometry_mod, ONLY : longitude_deg, latitude_deg, ind_cell_glo, cell_area 123 136 USE ioipsl_getin_p_mod, ONLY: getin_p 137 use config_ocean_skin_m, only: activate_ocean_skin 124 138 125 139 ! Input arguments … … 217 231 ALLOCATE(read_sit(nbp_lon, jj_nb), stat = error) 218 232 sum_error = sum_error + error 233 234 if (activate_ocean_skin >= 1) then 235 ALLOCATE(read_sss(nbp_lon, jj_nb), stat = error) 236 sum_error = sum_error + error 237 238 if (activate_ocean_skin == 2) then 239 ALLOCATE(cpl_t_int(klon), stat = error) 240 sum_error = sum_error + error 241 end if 242 end if 243 219 244 ALLOCATE(read_alb_sic(nbp_lon, jj_nb), stat = error) 220 245 sum_error = sum_error + error … … 376 401 USE time_phylmdz_mod, ONLY: start_time, itau_phy 377 402 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 403 use config_ocean_skin_m, only: activate_ocean_skin 378 404 379 405 INCLUDE "YOMCST.h" … … 437 463 read_alb_sic(:,:) = tab_read_flds(:,:,idr_icealw) ! Albedo at sea ice 438 464 read_sit(:,:) = tab_read_flds(:,:,idr_icetem) ! Sea ice temperature 465 if (activate_ocean_skin >= 1) read_sss(:,:) = tab_read_flds(:,:,idr_sss) 439 466 !$OMP END MASTER 440 467 … … 494 521 ! 495 522 496 SUBROUTINE cpl_receive_ocean_fields(knon, knindex, tsurf_new, u0_new, v0_new) 523 SUBROUTINE cpl_receive_ocean_fields(knon, knindex, tsurf_new, u0_new, & 524 v0_new, sss) 497 525 ! 498 526 ! This routine returns the field for the ocean that has been read from the coupler … … 502 530 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day 503 531 USE indice_sol_mod 532 use config_ocean_skin_m, only: activate_ocean_skin 504 533 505 534 ! Input arguments … … 511 540 !************************************************************************************* 512 541 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new 542 543 REAL, INTENT(OUT):: sss(:) ! (klon) 544 ! bulk salinity of the surface layer of the ocean, in ppt 545 513 546 REAL, DIMENSION(klon), INTENT(OUT) :: u0_new 514 547 REAL, DIMENSION(klon), INTENT(OUT) :: v0_new … … 525 558 !************************************************************************************* 526 559 CALL cpl2gath(read_sst, tsurf_new, knon, knindex) 560 if (activate_ocean_skin >= 1) CALL cpl2gath(read_sss, sss, knon, knindex) 527 561 CALL cpl2gath(read_sic, sic_new, knon, knindex) 528 562 CALL cpl2gath(read_u0, u0_new, knon, knindex) … … 611 645 swdown, lwdown, fluxlat, fluxsens, & 612 646 precip_rain, precip_snow, evap, tsurf, fder, albsol, taux, tauy, windsp,& 613 sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol) 614 ! 615 ! This subroutine cumulates some fields for each time-step during a coupling 616 ! period. At last time-step in a coupling period the fields are transformed to the 617 ! grid accepted by the coupler. No sending to the coupler will be done from here 618 ! (it is done in cpl_send_seaice_fields). 619 ! 647 sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol, t_int) 648 649 ! This subroutine cumulates some fields for each time-step during 650 ! a coupling period. At last time-step in a coupling period the 651 ! fields are transformed to the grid accepted by the coupler. No 652 ! sending to the coupler will be done from here (it is done in 653 ! cpl_send_seaice_fields). Crucial hypothesis is that the surface 654 ! fractions do not change between coupling time-steps. 655 620 656 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 621 657 USE indice_sol_mod 622 658 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 659 use config_ocean_skin_m, only: activate_ocean_skin 623 660 624 661 ! Input arguments … … 634 671 REAL, DIMENSION(klon), INTENT(IN) :: sens_prec_liq, sens_prec_sol 635 672 REAL, DIMENSION(klon), INTENT(IN) :: lat_prec_liq, lat_prec_sol 673 real, intent(in):: t_int(:) ! (klon) ocean-air interface temperature, in K 636 674 637 675 ! Local variables … … 669 707 cpl_taumod(1:knon,cpl_index) = 0.0 670 708 IF (carbon_cycle_cpl) cpl_atm_co2(1:knon,cpl_index) = 0.0 709 if (activate_ocean_skin == 2) cpl_t_int(:knon) = 0. 671 710 ENDIF 672 711 … … 710 749 !!---OB: this is correct but why knindex ?? 711 750 ENDIF 751 752 if (activate_ocean_skin == 2) & 753 cpl_t_int(ig) = cpl_t_int(ig) + t_int(ig) / REAL(nexca) 712 754 ENDDO 713 755 … … 755 797 sum_error = sum_error + error 756 798 ENDIF 799 800 if (activate_ocean_skin == 2) then 801 ALLOCATE(cpl_t_int_2D(nbp_lon, jj_nb), stat = error) 802 sum_error = sum_error + error 803 end if 757 804 758 805 IF (sum_error /= 0) THEN … … 810 857 IF (carbon_cycle_cpl) & 811 858 CALL gath2cpl(cpl_atm_co2(:,cpl_index), cpl_atm_co22D(:,:), knon, knindex) 812 ENDIF 859 if (activate_ocean_skin == 2) & 860 CALL gath2cpl(cpl_t_int, cpl_t_int_2D, knon, knindex) 861 ENDIF 813 862 814 863 END SUBROUTINE cpl_send_ocean_fields … … 1145 1194 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 1146 1195 USE time_phylmdz_mod, ONLY: start_time, itau_phy 1196 use config_ocean_skin_m, only: activate_ocean_skin 1147 1197 ! Some includes 1148 1198 ! … … 1202 1252 tab_flds(:,:,ids_qraiic) = cpl_sens_rain2D(:,:,2) 1203 1253 tab_flds(:,:,ids_qsnoic) = cpl_sens_snow2D(:,:,2) 1254 if (activate_ocean_skin == 2) tab_flds(:, :, ids_t_int) = cpl_t_int_2D 1204 1255 1205 1256 IF (version_ocean=='nemo') THEN … … 1438 1489 ENDIF 1439 1490 1491 if (activate_ocean_skin == 2) deallocate(cpl_t_int_2d) 1492 1440 1493 IF (sum_error /= 0) THEN 1441 1494 abort_message='Pb in deallocation of cpl_xxxx2D coupling variables'
Note: See TracChangeset
for help on using the changeset viewer.