Changeset 281
- Timestamp:
- Oct 19, 2001, 12:31:04 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90
r277 r281 60 60 & ocean, npas, nexca, zmasq, & 61 61 & evap, fluxsens, fluxlat, dflux_l, dflux_s, & 62 & tsol_rad, tsurf_new, alb_new, emis_new, z0_new, pctsrf_new, agesno) 62 & tsol_rad, tsurf_new, alb_new, alblw, emis_new, & 63 & z0_new, pctsrf_new, agesno) 63 64 64 65 … … 174 175 real, dimension(klon), intent(OUT):: fluxsens, fluxlat 175 176 real, dimension(klon), intent(OUT):: tsol_rad, tsurf_new, alb_new 177 real, dimension(klon), intent(OUT):: alblw 176 178 real, dimension(klon), intent(OUT):: emis_new, z0_new 177 179 real, dimension(klon), intent(OUT):: dflux_l, dflux_s … … 242 244 alb_new = 999999. ; z0_new = 999999. ; alb_neig = 999999. 243 245 tsurf_new = 999999. 246 alblw = 999999. 244 247 ! Aiguillage vers les differents schemas de surface 245 248 … … 316 319 call albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 317 320 where (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. 318 zfra = max(0.0,min(1.0,snow/(snow+10.0))) 319 alb_new(1 : knon) = alb_neig(1 : knon) *zfra + alb_new(1 : knon)*(1.0-zfra) 321 zfra(1:knon) = max(0.0,min(1.0,snow/(snow+10.0))) 322 alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + & 323 & alb_new(1 : knon)*(1.0-zfra(1:knon)) 320 324 z0_new = sqrt(z0_new**2+rugoro**2) 325 alblw(1 : knon) = alb_new(1 : knon) 321 326 322 327 else … … 333 338 & tsurf, p1lay/100., ps, radsol, & 334 339 & evap, fluxsens, fluxlat, & 335 & tsol_rad, tsurf_new, alb_new, emis_new, z0_new, dflux_l, dflux_s) 340 & tsol_rad, tsurf_new, alb_new, alblw, & 341 & emis_new, z0_new, dflux_l, dflux_s) 336 342 337 343 ! … … 429 435 430 436 z0_new = sqrt(rugos**2 + rugoro**2) 437 alblw(1:knon) = alb_new(1:knon) 438 431 439 ! 432 440 else if (nisurf == is_sic) then … … 498 506 CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 499 507 WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. 500 zfra = MAX(0.0,MIN(1.0,snow/(snow+10.0))) 501 alb_new(1 : knon) = alb_neig(1 : knon) *zfra + 0.6 * (1.0-zfra) 508 zfra(1:knon) = MAX(0.0,MIN(1.0,snow/(snow+10.0))) 509 alb_new(1 : knon) = alb_neig(1 : knon) *zfra(1:knon) + & 510 & 0.6 * (1.0-zfra(1:knon)) 502 511 !! alb_new(1 : knon) = 0.6 503 512 ENDIF … … 525 534 526 535 527 z0_new = 0.001 528 z0_new = SQRT(z0_new**2+rugoro**2) 536 z0_new = 0.001 537 z0_new = SQRT(z0_new**2+rugoro**2) 538 alblw(1:knon) = alb_new(1:knon) 529 539 530 540 else if (nisurf == is_lic) then … … 566 576 CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) 567 577 WHERE (snow(1 : knon) .LT. 0.0001) agesno(1 : knon) = 0. 568 zfra = MAX(0.0,MIN(1.0,snow/(snow+10.0))) 569 alb_new(1 : knon) = alb_neig(1 : knon)*zfra + 0.6 * (1.0-zfra) 578 zfra(1:knon) = MAX(0.0,MIN(1.0,snow/(snow+10.0))) 579 alb_new(1 : knon) = alb_neig(1 : knon)*zfra(1:knon) + & 580 & 0.6 * (1.0-zfra(1:knon)) 570 581 !! alb_new(1 : knon) = 0.6 571 582 ! … … 578 589 pctsrf_new(:,nisurf) = pctsrf(:,nisurf) 579 590 591 alblw(1:knon) = alb_new(1:knon) 580 592 else 581 593 write(*,*)'Index surface = ',nisurf … … 622 634 & tsurf, p1lay, ps, radsol, & 623 635 & evap, fluxsens, fluxlat, & 624 & tsol_rad, tsurf_new, alb_new, emis_new, z0_new, dflux_l, dflux_s) 636 & tsol_rad, tsurf_new, alb_new, alblw, & 637 & emis_new, z0_new, dflux_l, dflux_s) 625 638 626 639 USE intersurf … … 708 721 ! Parametres de sortie 709 722 real, dimension(klon), intent(OUT):: evap, fluxsens, fluxlat 710 real, dimension(klon), intent(OUT):: tsol_rad, tsurf_new, alb_new 723 real, dimension(klon), intent(OUT):: tsol_rad, tsurf_new, alb_new, alblw 711 724 real, dimension(klon), intent(OUT):: emis_new, z0_new 712 725 real, dimension(klon), intent(OUT):: dflux_s, dflux_l … … 714 727 ! Local 715 728 ! 716 integer :: ii, ij, jj, igrid, ireal, i, index 729 integer :: ii, ij, jj, igrid, ireal, i, index, iglob 717 730 integer :: error 718 731 character (len = 20) :: modname = 'interfsol' … … 751 764 real, dimension(klon) :: petA_orc, peqA_orc 752 765 real, dimension(klon) :: petB_orc, peqB_orc 766 ! Pb de correspondances de grilles 767 integer, dimension(:), save, allocatable :: ig, jg 768 integer :: indi, indj 769 integer, dimension(klon) :: ktindex 770 ! Essai cdrag 771 real, dimension(klon) :: cdrag 753 772 754 773 if (check) write(*,*)'Entree ', modname 755 774 if (check) write(*,*)'ok_veget = ',ok_veget 756 775 776 ktindex(:) = knindex(:) + iim - 1 777 757 778 ! initialisation 758 779 if (debut) then 759 780 781 ! Pb de correspondances de grilles 782 allocate(ig(klon)) 783 allocate(jg(klon)) 784 ig(1) = 1 785 jg(1) = 1 786 indi = 0 787 indj = 2 788 do igrid = 2, klon - 1 789 indi = indi + 1 790 if ( indi > iim) then 791 indi = 1 792 indj = indj + 1 793 endif 794 ig(igrid) = indi 795 jg(igrid) = indj 796 enddo 797 ig(klon) = 1 798 jg(klon) = jjm + 1 760 799 ! 761 800 ! Initialisation des offset … … 786 825 ! Attention aux poles 787 826 ! 827 !!$ do igrid = 1, knon 828 !!$ index = ktindex(igrid) 829 !!$ ij = index - int((index-1)/iim)*iim - 1 830 !!$ jj = 2 + int((index-1)/iim) 831 !!$ if (mod(index,iim) == 1 ) then 832 !!$ jj = 1 + int((index-1)/iim) 833 !!$ ij = iim 834 !!$ endif 835 !!$ correspond(ij,jj) = igrid 836 !!$ write(50,*)'igrid, i, j =',igrid,ij,jj 837 !!$ enddo 838 ! Pb de correspondances de grilles! 839 !!$ do igrid = 1, knon 840 !!$ index = ktindex(igrid) 841 !!$ ij = ig(index) 842 !!$ jj = jg(index) 843 !!$ correspond(ij,jj) = igrid 844 !!$ write(51,*)'igrid, i, j =',igrid,ij,jj 845 !!$ enddo 788 846 do igrid = 1, knon 789 index = knindex(igrid) 790 ij = index - int((index-1)/iim)*iim - 1 791 jj = 2 + int((index-1)/iim) 792 if (mod(index,iim) == 1 ) then 793 jj = 1 + int((index-1)/iim) 794 ij = iim 795 endif 847 index = ktindex(igrid) 848 jj = int((index - 1)/iim) + 1 849 ij = index - (jj - 1) * iim 796 850 correspond(ij,jj) = igrid 797 851 enddo 798 ! 852 853 !!$ index = 0 854 !!$ do jj = 1, jjm+1 855 !!$ do ij = 1, iim 856 !!$ index = index + 1 857 !!$ correspond(ij,jj) = index 858 !!$ enddo 859 !!$ enddo 860 799 861 ! Allouer et initialiser le tableau de coordonnees du sol 800 862 ! … … 832 894 ij = iim 833 895 endif 834 lon_scat(ij,jj) = rlon(index)835 lat_scat(ij,jj) = rlat(index)896 ! lon_scat(ij,jj) = rlon(index) 897 ! lat_scat(ij,jj) = rlat(index) 836 898 enddo 837 899 index = 1 … … 847 909 lon_scat(:,jjm+1) = lon_scat(:,2) 848 910 lat_scat(:,jjm+1) = rlat(klon) 911 ! Pb de correspondances de grilles! 912 ! do igrid = 1, knon 913 ! index = ktindex(igrid) 914 ! ij = ig(index) 915 ! jj = jg(index) 916 ! lon_scat(ij,jj) = rlon(index) 917 ! lat_scat(ij,jj) = rlat(index) 918 ! enddo 849 919 850 920 ! … … 870 940 ireal = knindex(igrid) 871 941 contfrac(igrid) = pctsrf(ireal,is_ter) 872 if (mod(ireal - 2, iim) == 0) then 942 enddo 943 944 do igrid = 1, knon 945 iglob = ktindex(igrid) 946 if (mod(iglob, iim) == 1) then 873 947 offset = off_ini(:,1) 874 else if(mod(i real - 1, iim) == 0) then948 else if(mod(iglob, iim) == 0) then 875 949 offset = off_ini(:,3) 876 950 else 877 951 offset = off_ini(:,2) 878 952 endif 879 if (ireal == 98) write (*,*) offset880 953 do i = 1, 8 881 index = ireal + offset(i) 882 if (index <= 1) index = 1 883 if (index >= klon) index = klon 884 if (pctsrf(index, is_ter) > EPSFRA) then 885 ij = index - int((index-1)/iim)*iim - 1 886 jj = 2 + int((index-1)/iim) 887 if (mod(index,iim) == 1 ) then 888 jj = 1 + int((index-1)/iim) 889 ij = iim 890 endif 891 ! write(*,*)'correspond',igrid, ireal,index,ij,jj 892 if ( ij >= 1 .and. ij <= iim .and. jj >= 1 .and. jj <= jjm) then 954 index = iglob + offset(i) 955 ireal = (min(max(1, index - iim + 1), klon)) 956 ! if (index <= 1) index = 1 957 ! if (index >= klon) index = klon 958 if (pctsrf(ireal, is_ter) > EPSFRA) then 959 jj = int((index - 1)/iim) + 1 960 ij = index - (jj - 1) * iim 961 !!$ ij = index - int((index-1)/iim)*iim - 1 962 !!$ jj = 2 + int((index-1)/iim) 963 !!$ if (mod(index,iim) == 1 ) then 964 !!$ jj = 1 + int((index-1)/iim) 965 !!$ ij = iim 966 !!$ endif 967 !!$! Pb de correspondances de grilles! 968 !!$ ij = ig(index) 969 !!$ jj = jg(index) 970 !!$! write(*,*)'correspond',igrid, ireal,index,ij,jj 971 ! if ( ij >= 1 .and. ij <= iim .and. jj >= 1 .and. jj <= jjm) then 893 972 ! write(*,*)'correspond',igrid, ireal,index,ij,jj 894 973 neighbours(igrid, i) = correspond(ij, jj) 895 endif974 ! endif 896 975 endif 897 976 enddo 898 977 enddo 978 979 write(*,*)'Neighbours = ' 980 981 write(*,*)neighbours(1,8), neighbours(1,1),neighbours(1,2) 982 write(*,*)neighbours(1,7), ktindex(1), neighbours(1,3) 983 write(*,*)neighbours(1,6), neighbours(1,5),neighbours(1,4) 984 985 write(*,*)neighbours(250,8), neighbours(250,1),neighbours(250,2) 986 write(*,*)neighbours(250,7), ktindex(250), neighbours(250,3) 987 write(*,*)neighbours(250,6), neighbours(250,5),neighbours(250,4) 988 989 OPEN (unit=12, file="neighbours.9671") 990 DO i=1,knon 991 WRITE(12,*) '-----------------------------' 992 WRITE(12,'(I7,f8.5, " ",3I6)') knon, contfrac(i), & 993 & neighbours(i,8), neighbours(i,1), neighbours(i,2) 994 WRITE(12,'(f10.5," ",3I6)') lalo(i,2), neighbours(i,7), & 995 & ktindex(i), neighbours(i,3) 996 WRITE(12,'(f10.5," ",3I6)') lalo(i,1), neighbours(i,6), & 997 & neighbours(i,5), neighbours(i,3) 998 ENDDO 999 CLOSE(12) 1000 899 1001 900 1002 ! … … 926 1028 peqB_orc = peqAcoef 927 1029 1030 cdrag = 0. 1031 cdrag(1:knon) = tq_cdrag(1:knon) 1032 1033 ! where(cdrag > 0.01) 1034 ! cdrag = 0.01 1035 ! endwhere 1036 ! write(*,*)'Cdrag = ',minval(cdrag),maxval(cdrag) 1037 928 1038 ! 929 1039 ! Init Orchidee 930 1040 ! 931 1041 if (debut) then 932 call intersurf_main (itime-1, iim, jjm+1, knon, k nindex, dtime, &1042 call intersurf_main (itime-1, iim, jjm+1, knon, ktindex, dtime, & 933 1043 & lrestart_read, lrestart_write, lalo, & 934 1044 & contfrac, neighbours, resolution, date0, & 935 1045 & zlev, u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, & 936 & tq_cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &1046 & cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, & 937 1047 & precip_rain, precip_snow, lwdown, swnet, swdown, p1lay, & 938 1048 & evap, fluxsens, fluxlat, coastalflow, riverflow, & … … 941 1051 endif 942 1052 943 call intersurf_main (itime, iim, jjm+1, knon, k nindex, dtime, &1053 call intersurf_main (itime, iim, jjm+1, knon, ktindex, dtime, & 944 1054 & lrestart_read, lrestart_write, lalo, & 945 1055 & contfrac, neighbours, resolution, date0, & 946 1056 & zlev, u1_lay, v1_lay, spechum, temp_air, epot_air, ccanopy, & 947 & tq_cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, &1057 & cdrag, petA_orc, peqA_orc, petB_orc, peqB_orc, & 948 1058 & precip_rain, precip_snow, lwdown, swnet, swdown, p1lay, & 949 1059 & evap, fluxsens, fluxlat, coastalflow, riverflow, & … … 951 1061 & lon_scat, lat_scat) 952 1062 953 alb_new(:) = albedo_out(:,1) 1063 ! alb_new(:) = (albedo_out(:,1) + albedo_out(:,2)) / 2. 1064 alb_new(1:knon) = albedo_out(1:knon,1) 1065 alblw(1:knon) = albedo_out(1:knon,2) 954 1066 955 1067 ! Convention orchidee: positif vers le haut 956 1068 fluxsens = -1. * fluxsens 957 1069 fluxlat = -1. * fluxlat 958 evap = -1. * evap1070 ! evap = -1. * evap 959 1071 960 1072 if (debut) lrestart_read = .false.
Note: See TracChangeset
for help on using the changeset viewer.