Changeset 1549 for trunk/LMDZ.COMMON/libf/dynphy_lonlat/calfis_p.F
- Timestamp:
- May 6, 2016, 12:30:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dynphy_lonlat/calfis_p.F
r1543 r1549 36 36 #endif 37 37 #ifdef CPP_PARA 38 USE parallel_lmdz, ONLY : omp_chunk, using_mpi, AllGather_Field 38 USE parallel_lmdz, ONLY: omp_chunk, using_mpi, AllGather_Field, 39 & jjb_u,jje_u,jjb_v,jje_v, 40 & jj_begin_dyn=>jj_begin,jj_end_dyn=>jj_end 39 41 USE Write_Field 40 42 Use Write_field_p … … 49 51 USE comconst_mod, ONLY: daysec,dtvr,dtphys,kappa,cpp,g,rad,pi 50 52 USE logic_mod, ONLY: moyzon_ch,moyzon_mu 53 #ifdef CPP_PHYS 54 USE callphysiq_mod, ONLY: call_physiq 55 #endif 51 56 52 57 IMPLICIT NONE … … 159 164 REAL,ALLOCATABLE,SAVE :: zphi(:,:),zphis(:) 160 165 166 ! REAL zrot(iip1,jjb_v:jje_v,llm) ! AdlC May 2014 167 REAL :: zrot(iip1,jjm,llm) 161 168 REAL,ALLOCATABLE,SAVE :: zufi(:,:), zvfi(:,:) 162 169 REAL,ALLOCATABLE,SAVE :: ztfi(:,:),zqfi(:,:,:) … … 170 177 ! REAL,ALLOCATABLE,SAVE :: pcvgt(:,:), pcvgq(:,:,:) 171 178 c 172 REAL,ALLOCATABLE,SAVE :: zdufi(:,:),zdvfi(:,:) 179 REAL,ALLOCATABLE,SAVE :: zdufi(:,:),zdvfi(:,:), zrfi(:,:) 173 180 REAL,ALLOCATABLE,SAVE :: zdtfi(:,:),zdqfi(:,:,:) 174 181 REAL,ALLOCATABLE,SAVE :: zdpsrf(:) … … 183 190 REAL,ALLOCATABLE,SAVE :: zufi_omp(:,:) 184 191 REAL,ALLOCATABLE,SAVE :: zvfi_omp(:,:) 192 REAL,ALLOCATABLE,SAVE :: zrfi_omp(:,:) 185 193 REAL,ALLOCATABLE,SAVE :: ztfi_omp(:,:) 186 194 REAL,ALLOCATABLE,SAVE :: zqfi_omp(:,:,:) … … 216 224 c$OMP THREADPRIVATE(zplev_omp,zplay_omp,zpk_omp,zphi_omp,zphis_omp, 217 225 c$OMP+ presnivs_omp,zufi_omp,zvfi_omp,ztfi_omp, 218 c$OMP+ z qfi_omp,zdufi_omp,zdvfi_omp,226 c$OMP+ zrfi_omp,zqfi_omp,zdufi_omp,zdvfi_omp, 219 227 c$OMP+ zdtfi_omp,zdqfi_omp,zdpsrf_omp,flxwfi_omp, 220 228 c$OMP+ zdufic_omp,zdvfic_omp,zdtfic_omp,zdqfic_omp) … … 244 252 integer :: k,kstart,kend 245 253 INTEGER :: offset 254 INTEGER :: jjb,jje 246 255 247 256 LOGICAL tracerdyn ! for generic/mars physics call ; possibly to get rid of … … 294 303 ! ALLOCATE(pcvgu(klon,llm), pcvgv(klon,llm)) 295 304 ! ALLOCATE(pcvgt(klon,llm), pcvgq(klon,llm,2)) 296 ALLOCATE(zdufi(klon,llm),zdvfi(klon,llm) )305 ALLOCATE(zdufi(klon,llm),zdvfi(klon,llm),zrfi(klon,llm)) 297 306 ALLOCATE(zdtfi(klon,llm),zdqfi(klon,llm,nqtot)) 298 307 ALLOCATE(zdpsrf(klon)) … … 610 619 c$OMP END DO NOWAIT 611 620 612 c 46.champ v: 621 c 622 C Alvaro de la Camara (May 2014) 623 C 46.1 Calcul de la vorticite et passage sur la grille physique 624 C -------------------------------------------------------------- 625 626 jjb=jj_begin_dyn-1 627 jje=jj_end_dyn+1 628 if (is_north_pole) jjb=1 629 if (is_south_pole) jje=jjm 630 631 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 632 633 DO l=1,llm 634 do i=1,iim 635 do j=jjb,jje 636 zrot(i,j,l) = (pvcov(i+1,j,l) - pvcov(i,j,l) 637 $ + pucov(i,j+1,l) - pucov(i,j,l)) 638 $ / (cu(i,j)+cu(i,j+1)) 639 $ / (cv(i+1,j)+cv(i,j)) *4 640 enddo 641 enddo 642 ENDDO 643 644 645 c 46.2champ v: 613 646 c ----------- 614 647 … … 623 656 $ + pvcov(i,j,l)/cv(i,j) ) 624 657 658 if (j==1 .OR. j==jjp1) then ! AdlC MAY 2014 659 zrfi(ig0,l) = 0 ! AdlC MAY 2014 660 else 661 if(i==1)then 662 zrfi(ig0,l)= 0.25 *(zrot(iim,j-1,l)+zrot(iim,j,l) 663 $ +zrot(1,j-1,l)+zrot(1,j,l)) ! AdlC MAY 2014 664 else 665 zrfi(ig0,l)= 0.25 *(zrot(i-1,j-1,l)+zrot(i-1,j,l) 666 $ +zrot(i,j-1,l)+zrot(i,j,l)) ! AdlC MAY 2014 667 endif 668 endif 669 670 625 671 ENDDO 626 672 ENDDO … … 648 694 zufi(1,l) = SSUM(iim,zcos,1)/pi 649 695 zvfi(1,l) = SSUM(iim,zsin,1)/pi 696 zrfi(1,l) = 0. 650 697 651 698 ENDDO … … 675 722 zufi(klon,l) = SSUM(iim,zcos,1)/pi 676 723 zvfi(klon,l) = SSUM(iim,zsin,1)/pi 724 zrfi(klon,l) = 0. 677 725 ENDDO 678 726 c$OMP END DO NOWAIT … … 706 754 allocate(zufi_omp(klon,llm)) 707 755 allocate(zvfi_omp(klon,llm)) 756 allocate(zrfi_omp(klon,llm)) ! LG Ari 2014 708 757 allocate(ztfi_omp(klon,llm)) 709 758 allocate(zqfi_omp(klon,llm,nqtot)) … … 775 824 do l=1,llm 776 825 do i=1,klon 826 zrfi_omp(i,l)=zrfi(offset+i,l) 827 enddo 828 enddo 829 830 831 do l=1,llm 832 do i=1,klon 777 833 ztfi_omp(i,l)=ztfi(offset+i,l) 778 834 enddo … … 880 936 lafin_split=lafin.and.isplit==nsplit_phys 881 937 882 883 if (planet_type=="earth") then 884 CALL physiq (klon, 885 . llm, 886 . debut_split, 887 . lafin_split, 888 . jD_cur, 889 . jH_cur_split, 890 . zdt_split, 891 . zplev_omp, 892 . zplay_omp, 893 . zphi_omp, 894 . zphis_omp, 895 . presnivs_omp, 896 . zufi_omp, 897 . zvfi_omp, 898 . ztfi_omp, 899 . zqfi_omp, 900 . flxwfi_omp, 901 . zdufi_omp, 902 . zdvfi_omp, 903 . zdtfi_omp, 904 . zdqfi_omp, 905 . zdpsrf_omp, 906 . pducov) 907 908 else if ( planet_type=="generic" ) then 909 910 CALL physiq (klon, !! ngrid 911 . llm, !! nlayer 912 . nqtot, !! nq 913 . tname, !! tracer names from dynamical core (given in infotrac) 914 . debut_split, !! firstcall 915 . lafin_split, !! lastcall 916 . jD_cur, !! pday. see leapfrog_p 917 . jH_cur_split, !! ptime "fraction of day" 918 . zdt_split, !! ptimestep 919 . zplev_omp, !! pplev 920 . zplay_omp, !! pplay 921 . zphi_omp, !! pphi 922 . zufi_omp, !! pu 923 . zvfi_omp, !! pv 924 . ztfi_omp, !! pt 925 . zqfi_omp, !! pq 926 . flxwfi_omp, !! pw !! or 0. anyway this is for diagnostic. not used in physiq. 927 . zdufi_omp, !! pdu 928 . zdvfi_omp, !! pdv 929 . zdtfi_omp, !! pdt 930 . zdqfi_omp, !! pdq 931 . zdpsrf_omp, !! pdpsrf 932 . tracerdyn) !! tracerdyn <-- utilite ??? 933 934 else if ( planet_type=="mars" ) then 935 936 CALL physiq (klon, ! ngrid 937 . llm, ! nlayer 938 . nqtot, ! nq 939 . debut_split, ! firstcall 940 . lafin_split, ! lastcall 941 . jD_cur, ! pday 942 . jH_cur_split, ! ptime 943 . zdt_split, ! ptimestep 944 . zplev_omp, ! pplev 945 . zplay_omp, ! pplay 946 . zphi_omp, ! pphi 947 . zufi_omp, ! pu 948 . zvfi_omp, ! pv 949 . ztfi_omp, ! pt 950 . zqfi_omp, ! pq 951 . flxwfi_omp, ! pw 952 . zdufi_omp, ! pdu 953 . zdvfi_omp, ! pdv 954 . zdtfi_omp, ! pdt 955 . zdqfi_omp, ! pdq 956 . zdpsrf_omp, ! pdpsrf 957 . tracerdyn) ! tracerdyn (somewhat obsolete) 958 959 else if ((planet_type=="titan").or.(planet_type=="venus")) then 960 961 CALL physiq (klon, 962 . llm, 963 . nqtot, 964 . debut_split, 965 . lafin_split, 966 . jD_cur, 967 . jH_cur_split, 968 . zdt_split, 969 . zplev_omp, 970 . zplay_omp, 971 . zpk_omp, 972 . zphi_omp, 973 . zphis_omp, 974 . presnivs_omp, 975 . zufi_omp, 976 . zvfi_omp, 977 . ztfi_omp, 978 . zqfi_omp, 979 . flxwfi_omp, 980 . zdufi_omp, 981 . zdvfi_omp, 982 . zdtfi_omp, 983 . zdqfi_omp, 984 . zdpsrf_omp) 985 986 else ! unknown "planet_type" 987 988 write(lunout,*) "calfis_p: error, unknown planet_type: ", 989 & trim(planet_type) 990 stop 991 992 endif ! planet_type 938 CALL call_physiq(klon,llm,nqtot,tname, 939 & debut_split,lafin_split, 940 & jD_cur,jH_cur_split,zdt_split, 941 & zplev_omp,zplay_omp, 942 & zpk_omp,zphi_omp,zphis_omp, 943 & presnivs_omp, 944 & zufi_omp,zvfi_omp,zrfi_omp,ztfi_omp,zqfi_omp, 945 & flxwfi_omp,pducov, 946 & zdufi_omp,zdvfi_omp,zdtfi_omp,zdqfi_omp, 947 & zdpsrf_omp,tracerdyn) 948 949 ! if (planet_type=="earth") then 950 ! CALL physiq (klon, 951 ! . llm, 952 ! . debut_split, 953 ! . lafin_split, 954 ! . jD_cur, 955 ! . jH_cur_split, 956 ! . zdt_split, 957 ! . zplev_omp, 958 ! . zplay_omp, 959 ! . zphi_omp, 960 ! . zphis_omp, 961 ! . presnivs_omp, 962 ! . zufi_omp, 963 ! . zvfi_omp, 964 ! . ztfi_omp, 965 ! . zqfi_omp, 966 ! . flxwfi_omp, 967 ! . zdufi_omp, 968 ! . zdvfi_omp, 969 ! . zdtfi_omp, 970 ! . zdqfi_omp, 971 ! . zdpsrf_omp, 972 ! . pducov) 973 ! 974 ! else if ( planet_type=="generic" ) then 975 ! 976 ! CALL physiq (klon, !! ngrid 977 ! . llm, !! nlayer 978 ! . nqtot, !! nq 979 ! . tname, !! tracer names from dynamical core (given in infotrac) 980 ! . debut_split, !! firstcall 981 ! . lafin_split, !! lastcall 982 ! . jD_cur, !! pday. see leapfrog_p 983 ! . jH_cur_split, !! ptime "fraction of day" 984 ! . zdt_split, !! ptimestep 985 ! . zplev_omp, !! pplev 986 ! . zplay_omp, !! pplay 987 ! . zphi_omp, !! pphi 988 ! . zufi_omp, !! pu 989 ! . zvfi_omp, !! pv 990 ! . ztfi_omp, !! pt 991 ! . zqfi_omp, !! pq 992 ! . flxwfi_omp, !! pw !! or 0. anyway this is for diagnostic. not used in physiq. 993 ! . zdufi_omp, !! pdu 994 ! . zdvfi_omp, !! pdv 995 ! . zdtfi_omp, !! pdt 996 ! . zdqfi_omp, !! pdq 997 ! . zdpsrf_omp, !! pdpsrf 998 ! . tracerdyn) !! tracerdyn <-- utilite ??? 999 ! 1000 ! else if ( planet_type=="mars" ) then 1001 ! 1002 ! CALL physiq (klon, ! ngrid 1003 ! . llm, ! nlayer 1004 ! . nqtot, ! nq 1005 ! . debut_split, ! firstcall 1006 ! . lafin_split, ! lastcall 1007 ! . jD_cur, ! pday 1008 ! . jH_cur_split, ! ptime 1009 ! . zdt_split, ! ptimestep 1010 ! . zplev_omp, ! pplev 1011 ! . zplay_omp, ! pplay 1012 ! . zphi_omp, ! pphi 1013 ! . zufi_omp, ! pu 1014 ! . zvfi_omp, ! pv 1015 ! . ztfi_omp, ! pt 1016 ! . zqfi_omp, ! pq 1017 ! . flxwfi_omp, ! pw 1018 ! . zdufi_omp, ! pdu 1019 ! . zdvfi_omp, ! pdv 1020 ! . zdtfi_omp, ! pdt 1021 ! . zdqfi_omp, ! pdq 1022 ! . zdpsrf_omp, ! pdpsrf 1023 ! . tracerdyn) ! tracerdyn (somewhat obsolete) 1024 ! 1025 ! else if ((planet_type=="titan").or.(planet_type=="venus")) then 1026 ! 1027 ! CALL physiq (klon, 1028 ! . llm, 1029 ! . nqtot, 1030 ! . debut_split, 1031 ! . lafin_split, 1032 ! . jD_cur, 1033 ! . jH_cur_split, 1034 ! . zdt_split, 1035 ! . zplev_omp, 1036 ! . zplay_omp, 1037 ! . zpk_omp, 1038 ! . zphi_omp, 1039 ! . zphis_omp, 1040 ! . presnivs_omp, 1041 ! . zufi_omp, 1042 ! . zvfi_omp, 1043 ! . ztfi_omp, 1044 ! . zqfi_omp, 1045 ! . flxwfi_omp, 1046 ! . zdufi_omp, 1047 ! . zdvfi_omp, 1048 ! . zdtfi_omp, 1049 ! . zdqfi_omp, 1050 ! . zdpsrf_omp) 1051 ! 1052 ! else ! unknown "planet_type" 1053 ! 1054 ! write(lunout,*) "calfis_p: error, unknown planet_type: ", 1055 ! & trim(planet_type) 1056 ! stop 1057 ! 1058 ! endif ! planet_type 993 1059 zufi_omp(:,:)=zufi_omp(:,:)+zdufi_omp(:,:)*zdt_split 994 1060 zvfi_omp(:,:)=zvfi_omp(:,:)+zdvfi_omp(:,:)*zdt_split
Note: See TracChangeset
for help on using the changeset viewer.