Changeset 5117 for LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat
- Timestamp:
- Jul 24, 2024, 4:23:34 PM (6 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.f90
r5116 r5117 299 299 ! convergence dynamique pour les traceurs "EAU" 300 300 ! Earth-specific treatment of first 2 tracers (water) 301 if(planet_type=="earth") THEN301 IF (planet_type=="earth") THEN 302 302 DO iq=1,2 303 303 DO l=1,llm … … 479 479 480 480 jH_cur_split=jH_cur+(isplit-1) * dtvr / (daysec *nsplit_phys) 481 debut_split=debut. and.isplit==1482 lafin_split=lafin. and.isplit==nsplit_phys481 debut_split=debut.AND.isplit==1 482 lafin_split=lafin.AND.isplit==nsplit_phys 483 483 484 484 ! if (planet_type=="earth") THEN … … 493 493 zdufi,zdvfi,zdtfi,zdqfi,zdpsrf) 494 494 495 ! else if( planet_type=="generic" ) THEN495 ! ELSE IF ( planet_type=="generic" ) THEN 496 496 ! CALL physiq (ngridmx, !! ngrid 497 497 ! . llm, !! nlayer … … 518 518 ! . tracerdyn) !! tracerdyn <-- utilite ??? 519 519 520 ! endif! of if (planet_type=="earth")520 ! ENDIF ! of if (planet_type=="earth") 521 521 522 522 zufi(:,:)=zufi(:,:)+zdufi(:,:)*zdt_split -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90
r5113 r5117 244 244 WHERE(cham2tmp<0.001) cham2tmp=0.001 245 245 CALL fine2coarse(xtmp,ytmp,xmod,ymod,out,REAL(LOG(cham2tmp))) 246 out=EXP( out)247 amin=MINVAL( out); amax=MAXVAL(out)246 out=EXP(OUT) 247 amin=MINVAL(OUT); amax=MAXVAL(OUT) 248 248 PRINT*, 'Ecart-type du modele:', amin, amax 249 249 out=out/amax*20.0 250 amin=MINVAL( out); amax=MAXVAL(out)250 amin=MINVAL(OUT); amax=MAXVAL(OUT) 251 251 PRINT*, 'Longueur de rugosite du modele:', amin, amax 252 rugs=REAL( out)252 rugs=REAL(OUT) 253 253 254 254 END SUBROUTINE rugsoro -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/inigeomphy_mod.F90
r5116 r5117 23 23 south_west, south_east 24 24 USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys 25 USE nrtype, ONLY: pi25 USE lmdz_physical_constants, ONLY: pi 26 26 USE comvert_mod, ONLY: preff, ap, bp, aps, bps, presnivs, & 27 27 scaleheight, pseudoalt, presinter … … 144 144 boundslonfi_glo(k,north_east)=rlonu(i) 145 145 boundslatfi_glo(k,north_east)=rlatv(j-1) 146 if(i==1) THEN146 IF (i==1) THEN 147 147 ! special case for the first longitude's west bound 148 148 boundslonfi_glo(k,north_west)=rlonu(iim)-2*PI -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90
r5116 r5117 40 40 USE parallel_lmdz,ONLY:omp_chunk,using_mpi,jjb_u,jje_u,jjb_v,jje_v & 41 41 ,jj_begin_dyn=>jj_begin,jj_end_dyn=>jj_end 42 USE Write_Field42 USE lmdz_write_field 43 43 Use Write_field_p 44 44 USE Times … … 188 188 ! J'ai été surpris au début que les tableaux zufi_omp, zdufi_omp n'co soitent 189 189 ! en SAVE. Je crois comprendre que c'est parce que tu voulais qu'il 190 ! soit allocatable(plutot par exemple que de passer une dimension190 ! soit ALLOCATABLE (plutot par exemple que de passer une dimension 191 191 ! dépendant du process en argument des routines) et que, du coup, 192 192 ! le SAVE évite d'avoir à refaire l'allocation à chaque appel. … … 222 222 !$OMP THREADPRIVATE(firstcal,debut) 223 223 224 REAL,SAVE, dimension(1:iim,1:llm):: du_send,du_recv,dv_send,dv_recv224 REAL,SAVE,DIMENSION(1:iim,1:llm):: du_send,du_recv,dv_send,dv_recv 225 225 INTEGER :: ierr 226 INTEGER, dimension(MPI_STATUS_SIZE,4) :: Status227 INTEGER, dimension(4) :: Req226 INTEGER,DIMENSION(MPI_STATUS_SIZE,4) :: Status 227 INTEGER, DIMENSION(4) :: Req 228 228 REAL,ALLOCATABLE,SAVE:: zdufi2(:,:),zdvfi2(:,:) 229 229 INTEGER :: k,kstart,kend … … 412 412 kend=klon 413 413 414 if(is_north_pole_dyn) kstart=2415 if(is_south_pole_dyn) kend=klon-1414 IF (is_north_pole_dyn) kstart=2 415 IF (is_south_pole_dyn) kend=klon-1 416 416 417 417 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 423 423 i=index_i(ig0) 424 424 j=index_j(ig0) 425 if(i==1) THEN425 IF (i==1) THEN 426 426 zufi(ig0,l)= 0.5 *( pucov(iim,j,l)/cu(iim,j) & 427 427 + pucov(1,j,l)/cu(1,j) ) … … 440 440 jjb=jj_begin_dyn-1 441 441 jje=jj_end_dyn+1 442 if(is_north_pole_dyn) jjb=1443 if(is_south_pole_dyn) jje=jjm442 IF (is_north_pole_dyn) jjb=1 443 IF (is_south_pole_dyn) jje=jjm 444 444 445 445 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 469 469 zvfi(ig0,l)= 0.5 *( pvcov(i,j-1,l)/cv(i,j-1) & 470 470 + pvcov(i,j,l)/cv(i,j) ) 471 if(j==1 .OR. j==jjp1) then ! AdlC MAY 2014471 IF (j==1 .OR. j==jjp1) then ! AdlC MAY 2014 472 472 zrfi(ig0,l) = 0 ! AdlC MAY 2014 473 473 else … … 491 491 ! V = 1 / pi * integrale [ v * sin(long) * d long ] 492 492 493 if(is_north_pole_dyn) THEN493 IF (is_north_pole_dyn) THEN 494 494 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 495 495 DO l=1,llm … … 511 511 ENDDO 512 512 !$OMP END DO NOWAIT 513 endif513 ENDIF 514 514 515 515 … … 519 519 ! V = 1 / pi * integrale [ v * sin(long) * d long ] 520 520 521 if(is_south_pole_dyn) THEN521 IF (is_south_pole_dyn) THEN 522 522 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 523 523 DO l=1,llm … … 538 538 ENDDO 539 539 !$OMP END DO NOWAIT 540 endif540 ENDIF 541 541 542 542 ! On change de grille, dynamique vers physiq, pour le flux de masse verticale … … 561 561 562 562 !$OMP BARRIER 563 if(first_omp) THEN563 IF (first_omp) THEN 564 564 klon=klon_omp 565 565 … … 586 586 allocate(flxwfi_omp(klon,llm)) 587 587 first_omp=.FALSE. 588 endif588 ENDIF 589 589 590 590 … … 708 708 709 709 jH_cur_split=jH_cur+(isplit-1) * dtvr / (daysec *nsplit_phys) 710 debut_split=debut. and.isplit==1711 lafin_split=lafin. and.isplit==nsplit_phys710 debut_split=debut.AND.isplit==1 711 lafin_split=lafin.AND.isplit==nsplit_phys 712 712 713 713 CALL call_physiq(klon,llm,nqtot,tracers(:)%name, & … … 837 837 IF (using_mpi) THEN 838 838 839 if(MPI_rank>0) THEN839 IF (MPI_rank>0) THEN 840 840 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 841 841 DO l=1,llm … … 858 858 !$OMP BARRIER 859 859 860 endif861 862 if(MPI_rank<MPI_Size-1) THEN860 ENDIF 861 862 IF (MPI_rank<MPI_Size-1) THEN 863 863 !$OMP BARRIER 864 864 … … 872 872 !$OMP END MASTER 873 873 874 endif874 ENDIF 875 875 876 876 !$OMP BARRIER … … 879 879 !$OMP MASTER 880 880 !$OMP CRITICAL (MPI) 881 if (MPI_rank>0 .and. MPI_rank< MPI_Size-1) THEN881 IF (MPI_rank>0 .AND. MPI_rank< MPI_Size-1) THEN 882 882 CALL MPI_WAITALL(4,Req(1),Status,ierr) 883 else if(MPI_rank>0) THEN883 ELSE IF (MPI_rank>0) THEN 884 884 CALL MPI_WAITALL(2,Req(1),Status,ierr) 885 else if(MPI_rank <MPI_Size-1) THEN885 ELSE IF (MPI_rank <MPI_Size-1) THEN 886 886 CALL MPI_WAITALL(2,Req(3),Status,ierr) 887 endif887 ENDIF 888 888 !$OMP END CRITICAL (MPI) 889 889 !$OMP END MASTER … … 908 908 pdvfi(:,jj_begin,l)=0 909 909 910 if (.not. is_south_pole_dyn) THEN910 IF (.NOT. is_south_pole_dyn) THEN 911 911 pdhfi(:,jj_end:jj_end+1,l)=0 912 912 pdqfi(:,jj_end:jj_end+1,l,:)=0 … … 921 921 pdpsfi(:,jj_begin)=0 922 922 923 if (.not. is_south_pole_dyn) THEN923 IF (.NOT. is_south_pole_dyn) THEN 924 924 pdpsfi(:,jj_end:jj_end+1)=0 925 925 endif … … 937 937 kend=klon 938 938 939 if(is_north_pole_dyn) kstart=2940 if(is_south_pole_dyn) kend=klon-1939 IF (is_north_pole_dyn) kstart=2 940 IF (is_south_pole_dyn) kend=klon-1 941 941 942 942 !CDIR ON_ADB(index_i) … … 947 947 j=index_j(ig0) 948 948 pdpsfi(i,j) = zdpsrf(ig0) 949 if(i==1) pdpsfi(iip1,j) = zdpsrf(ig0)949 IF (i==1) pdpsfi(iip1,j) = zdpsrf(ig0) 950 950 enddo 951 951 952 if(is_north_pole_dyn) THEN952 IF (is_north_pole_dyn) THEN 953 953 DO i=1,iip1 954 954 pdpsfi(i,1) = zdpsrf(1) … … 956 956 endif 957 957 958 if(is_south_pole_dyn) THEN958 IF (is_south_pole_dyn) THEN 959 959 DO i=1,iip1 960 960 pdpsfi(i,jjp1) = zdpsrf(klon) … … 970 970 kend=klon 971 971 972 if(is_north_pole_dyn) kstart=2973 if(is_south_pole_dyn) kend=klon-1972 IF (is_north_pole_dyn) kstart=2 973 IF (is_south_pole_dyn) kend=klon-1 974 974 975 975 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 983 983 j=index_j(ig0) 984 984 pdhfi(i,j,l) = cpp * zdtfi(ig0,l) / ppk(i,j,l) 985 if(i==1) pdhfi(iip1,j,l) = cpp * zdtfi(ig0,l) / ppk(i,j,l)985 IF (i==1) pdhfi(iip1,j,l) = cpp * zdtfi(ig0,l) / ppk(i,j,l) 986 986 enddo 987 987 988 if(is_north_pole_dyn) THEN988 IF (is_north_pole_dyn) THEN 989 989 DO i=1,iip1 990 990 pdhfi(i,1,l) = cpp * zdtfi(1,l) / ppk(i, 1 ,l) … … 992 992 endif 993 993 994 if(is_south_pole_dyn) THEN994 IF (is_south_pole_dyn) THEN 995 995 DO i=1,iip1 996 996 pdhfi(i,jjp1,l) = cpp * zdtfi(klon,l)/ ppk(i,jjp1,l) … … 1053 1053 j=index_j(ig0) 1054 1054 pdqfi(i,j,l,iq) = zdqfi(ig0,l,itr) 1055 if(i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,itr)1055 IF (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,itr) 1056 1056 ENDDO 1057 1057 … … 1083 1083 j=index_j(ig0) 1084 1084 1085 if(i/=iim) THEN1085 IF (i/=iim) THEN 1086 1086 pdufi(i,j,l)=0.5*(zdufi2(ig0,l)+zdufi2(ig0+1,l))*cu(i,j) 1087 1087 endif 1088 1088 1089 if(i==1) THEN1089 IF (i==1) THEN 1090 1090 pdufi(iim,j,l)=0.5*( zdufi2(ig0,l) & 1091 1091 + zdufi2(ig0+iim-1,l))*cu(iim,j) … … 1095 1095 enddo 1096 1096 1097 if(is_north_pole_dyn) THEN1097 IF (is_north_pole_dyn) THEN 1098 1098 DO i=1,iip1 1099 1099 pdufi(i,1,l) = 0. … … 1101 1101 endif 1102 1102 1103 if(is_south_pole_dyn) THEN1103 IF (is_south_pole_dyn) THEN 1104 1104 DO i=1,iip1 1105 1105 pdufi(i,jjp1,l) = 0. … … 1116 1116 kend=klon 1117 1117 1118 if(is_north_pole_dyn) kstart=21119 if(is_south_pole_dyn) kend=klon-1-iim1118 IF (is_north_pole_dyn) kstart=2 1119 IF (is_south_pole_dyn) kend=klon-1-iim 1120 1120 1121 1121 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 1128 1128 j=index_j(ig0) 1129 1129 pdvfi(i,j,l)=0.5*(zdvfi2(ig0,l)+zdvfi2(ig0+iim,l))*cv(i,j) 1130 if(i==1) pdvfi(iip1,j,l) = 0.5*(zdvfi2(ig0,l)+ &1130 IF (i==1) pdvfi(iip1,j,l) = 0.5*(zdvfi2(ig0,l)+ & 1131 1131 zdvfi2(ig0+iim,l)) & 1132 1132 *cv(i,j) … … 1141 1141 ! v = U * cos(long) + V * SIN(long) 1142 1142 1143 if(is_north_pole_dyn) THEN1143 IF (is_north_pole_dyn) THEN 1144 1144 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1145 1145 DO l=1,llm … … 1158 1158 !$OMP END DO NOWAIT 1159 1159 1160 endif1161 1162 if(is_south_pole_dyn) THEN1160 ENDIF 1161 1162 IF (is_south_pole_dyn) THEN 1163 1163 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1164 1164 DO l=1,llm … … 1177 1177 !$OMP END DO NOWAIT 1178 1178 1179 endif1179 ENDIF 1180 1180 !----------------------------------------------------------------------- 1181 1181 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_gr_fi_dyn_p.F90
r5066 r5117 27 27 j=index_j(ig) 28 28 pdyn(i,j,ifield)=pfi(ig,ifield) 29 if(i==1) pdyn(im,j,ifield)=pdyn(i,j,ifield)29 IF (i==1) pdyn(im,j,ifield)=pdyn(i,j,ifield) 30 30 ENDDO 31 31 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/mod_interface_dyn_phys.F90
r5110 r5117 3 3 4 4 MODULE mod_interface_dyn_phys 5 INTEGER,SAVE, dimension(:),allocatable:: index_i6 INTEGER,SAVE, dimension(:),allocatable:: index_j5 INTEGER,SAVE,DIMENSION(:),ALLOCATABLE :: index_i 6 INTEGER,SAVE,DIMENSION(:),ALLOCATABLE :: index_j 7 7 8 8 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90
r5113 r5117 18 18 USE inifis_mod, ONLY: inifis 19 19 USE phyaqua_mod, ONLY: iniaqua 20 USE nrtype, ONLY: pi20 USE lmdz_physical_constants, ONLY: pi 21 21 IMPLICIT NONE 22 22 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90
r5116 r5117 69 69 70 70 !$OMP MASTER 71 if(ok_dyn_xios) THEN71 IF (ok_dyn_xios) THEN 72 72 CALL xios_get_current_context(dyn3d_ctx_handle) 73 endif73 ENDIF 74 74 !$OMP END MASTER 75 75 … … 99 99 ! switching back to LMDZDYN context 100 100 !$OMP MASTER 101 if(ok_dyn_xios) THEN101 IF (ok_dyn_xios) THEN 102 102 CALL xios_set_current_context(dyn3d_ctx_handle) 103 endif103 ENDIF 104 104 !$OMP END MASTER 105 105 -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/ce0l.F90
r5116 r5117 73 73 74 74 #ifdef CPP_PARA 75 integerierr75 INTEGER ierr 76 76 #else 77 77 ! for iniphysiq in serial mode -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
r5116 r5117 39 39 USE comvert_mod, ONLY: ap, bp, preff, pressure_exner 40 40 USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itau_phy, start_time 41 USE strings_mod, ONLY: strLower41 USE lmdz_strings, ONLY: strLower 42 42 43 43 IMPLICIT NONE … … 78 78 USE lmdz_filtreg 79 79 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 80 USE lmdz_q_sat, ONLY: q_sat 80 81 IMPLICIT NONE 81 82 !------------------------------------------------------------------------------- -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
r5116 r5117 539 539 do j=2,jmp1-1 540 540 PRINT*,'avant if ',cos(rlatu(j)),coslat0 541 if(cos(rlatu(j))<coslat0) THEN541 IF (cos(rlatu(j))<coslat0) THEN 542 542 ! nb de pts affectes par le filtrage de part et d'autre du pt 543 543 ifiltre=(coslat0/cos(rlatu(j))-1.)/2. … … 548 548 wwf(ifiltre+1)=(coslat0/cos(rlatu(j))-1.)/2.-ifiltre 549 549 do i=1,imp1-1 550 if(masque(i,j)>0.9) THEN550 IF (masque(i,j)>0.9) THEN 551 551 ssz=phis(i,j) 552 552 do ifi=1,ifiltre+1 553 553 ii=i+ifi 554 if(ii>imp1-1) ii=ii-imp1+1554 IF (ii>imp1-1) ii=ii-imp1+1 555 555 ssz=ssz+wwf(ifi)*phis(ii,j) 556 556 ii=i-ifi 557 if(ii<1) ii=ii+imp1-1557 IF (ii<1) ii=ii+imp1-1 558 558 ssz=ssz+wwf(ifi)*phis(ii,j) 559 559 enddo -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.f90
r5116 r5117 378 378 REAL :: chmin, chmax, timeday, al 379 379 INTEGER ierr, idx 380 integern_extrap ! number of extrapolated points381 logicalskip380 INTEGER n_extrap ! number of extrapolated points 381 LOGICAL skip 382 382 383 383 !------------------------------------------------------------------------------ … … 599 599 CALL pchfe_95(timeyear, champtime(i, j, :), yder, skip, & 600 600 arth(0.5, real(ndays_in) / ndays, ndays), champan(i, j, :), ierr) 601 if(ierr < 0) CALL abort_physic("get_2Dfield", "", 1)601 IF (ierr < 0) CALL abort_physic("get_2Dfield", "", 1) 602 602 n_extrap = n_extrap + ierr 603 603 END DO -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90
r5116 r5117 13 13 ! the surface pressure, which sample possible values on Earth. 14 14 15 useexner_hyb_m, ONLY: exner_hyb16 uselmdz_vertical_layers, ONLY: ap,bp,preff17 usecomconst_mod, ONLY: kappa, cpp15 USE exner_hyb_m, ONLY: exner_hyb 16 USE lmdz_vertical_layers, ONLY: ap,bp,preff 17 USE comconst_mod, ONLY: kappa, cpp 18 18 USE lmdz_abort_physic, ONLY: abort_physic 19 19 … … 22 22 23 23 ! Local: 24 integerl, i25 integer, parameter:: ngrid = 726 realp(ngrid, llm + 1) ! pressure at half-level, in Pa27 real pks(ngrid) ! exner function at the surface, in J K-1 kg-128 real pk(ngrid, llm) ! exner function at full level, in J K-1 kg-129 realps(ngrid) ! surface pressure, in Pa30 realp_lay(ngrid, llm) ! pressure at full level, in Pa31 realdelta_ps ! in Pa24 INTEGER l, i 25 INTEGER, parameter:: ngrid = 7 26 REAL p(ngrid, llm + 1) ! pressure at half-level, in Pa 27 REAL pks(ngrid) ! exner function at the surface, in J K-1 kg-1 28 REAL pk(ngrid, llm) ! exner function at full level, in J K-1 kg-1 29 REAL ps(ngrid) ! surface pressure, in Pa 30 REAL p_lay(ngrid, llm) ! pressure at full level, in Pa 31 REAL delta_ps ! in Pa 32 32 33 33 !--------------------- … … 42 42 43 43 ! Are pressure values in the right order? 44 if (any(p(:, :llm) <= p_lay .or. p_lay <= p(:, 2:))) THEN44 IF (any(p(:, :llm) <= p_lay .OR. p_lay <= p(:, 2:))) THEN 45 45 ! List details and stop: 46 46 do l = 1, llm 47 47 do i = 1, ngrid 48 if(p(i, l) <= p_lay(i, l)) THEN48 IF (p(i, l) <= p_lay(i, l)) THEN 49 49 print 1000, "ps = ", ps(i) / 100., "hPa, p(level ", l, & 50 50 ") = ", p(i, l) / 100., " hPa <= p(layer ", l, ") = ", & 51 51 p_lay(i, l) / 100., " hPa" 52 52 end if 53 if(p_lay(i, l) <= p(i, l + 1)) THEN53 IF (p_lay(i, l) <= p(i, l + 1)) THEN 54 54 print 1000, "ps = ", ps(i) / 100., "hPa, p(layer ", l, ") = ", & 55 55 p_lay(i, l) / 100., " hPa <= p(level ", l + 1, ") = ", &
Note: See TracChangeset
for help on using the changeset viewer.