Changeset 1395 for trunk/LMDZ.GENERIC
- Timestamp:
- Mar 12, 2015, 12:45:17 PM (10 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F
r1216 r1395 5 5 use control_mod, only: nday, day_step, iperiod, iphysiq, 6 6 & iconser, ecritphy, idissip 7 use comgeomphy, only: initcomgeomphy7 ! use comgeomphy, only: initcomgeomphy 8 8 IMPLICIT NONE 9 9 … … 159 159 c variables pour l'initialisation de la physique : 160 160 c ------------------------------------------------ 161 INTEGER ngridmx162 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm )163 REAL zcufi(ngridmx),zcvfi(ngridmx)164 REAL latfi(ngridmx),lonfi(ngridmx)165 REAL airefi(ngridmx)166 SAVE latfi, lonfi, airefi167 INTEGER i,j161 ! INTEGER ngridmx 162 ! PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 163 ! REAL zcufi(ngridmx),zcvfi(ngridmx) 164 ! REAL latfi(ngridmx),lonfi(ngridmx) 165 ! REAL airefi(ngridmx) 166 ! SAVE latfi, lonfi, airefi 167 ! INTEGER i,j 168 168 169 169 c----------------------------------------------------------------------- … … 183 183 !#ifdef CPP_PHYS 184 184 CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 185 call initcomgeomphy 185 ! call initcomgeomphy ! now done in iniphysiq 186 186 !#endif 187 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 231 231 232 232 ! IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 233 latfi(1)=rlatu(1)234 lonfi(1)=0.235 zcufi(1) = cu(1)236 zcvfi(1) = cv(1)237 DO j=2,jjm238 DO i=1,iim239 latfi((j-2)*iim+1+i)= rlatu(j)240 lonfi((j-2)*iim+1+i)= rlonv(i)241 zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i)242 zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i)243 ENDDO244 ENDDO245 latfi(ngridmx)= rlatu(jjp1)246 lonfi(ngridmx)= 0.247 zcufi(ngridmx) = cu(ip1jm+1)248 zcvfi(ngridmx) = cv(ip1jm-iim)249 250 ! build airefi(), mesh area on physics grid251 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)252 ! Poles are single points on physics grid253 airefi(1)=airefi(1)*iim254 airefi(ngridmx)=airefi(ngridmx)*iim233 ! latfi(1)=rlatu(1) 234 ! lonfi(1)=0. 235 ! zcufi(1) = cu(1) 236 ! zcvfi(1) = cv(1) 237 ! DO j=2,jjm 238 ! DO i=1,iim 239 ! latfi((j-2)*iim+1+i)= rlatu(j) 240 ! lonfi((j-2)*iim+1+i)= rlonv(i) 241 ! zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) 242 ! zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) 243 ! ENDDO 244 ! ENDDO 245 ! latfi(ngridmx)= rlatu(jjp1) 246 ! lonfi(ngridmx)= 0. 247 ! zcufi(ngridmx) = cu(ip1jm+1) 248 ! zcvfi(ngridmx) = cv(ip1jm-iim) 249 ! 250 ! ! build airefi(), mesh area on physics grid 251 ! CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 252 ! ! Poles are single points on physics grid 253 ! airefi(1)=airefi(1)*iim 254 ! airefi(ngridmx)=airefi(ngridmx)*iim 255 255 256 256 ! Initialisation de la physique: pose probleme quand on tourne … … 258 258 ! Il faut une cle CPP_PHYS 259 259 !#ifdef CPP_PHYS 260 ! CALL iniphysiq( ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,261 CALL iniphysiq( ngridmx,llm,daysec,day_ini,dtphys,262 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,260 ! CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, 261 CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys, 262 & rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, 263 263 & 1) 264 264 ! & iflag_phys) -
trunk/LMDZ.GENERIC/libf/phystd/iniphysiq.F90
r1315 r1395 1 subroutine iniphysiq( ngrid,nlayer, punjours, pdayref,ptimestep,&2 plat,plon,parea,pcu,pcv,&1 subroutine iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep, & 2 rlatu,rlonv,aire,cu,cv, & 3 3 prad,pg,pr,pcpp,iflag_phys) 4 4 … … 10 10 klon_omp_end, & ! end index of local omp subgrid 11 11 klon_mpi_begin ! start indes of columns (on local mpi grid) 12 use comgeomphy, only : airephy, & ! physics grid area (m2) 12 13 use comgeomphy, only : initcomgeomphy, & 14 airephy, & ! physics grid area (m2) 13 15 cuphy, & ! cu coeff. (u_covariant = cu * u) 14 16 cvphy, & ! cv coeff. (v_covariant = cv * v) … … 21 23 include "dimensions.h" 22 24 include "comvert.h" 25 include "iniprint.h" 23 26 24 27 real,intent(in) :: prad ! radius of the planet (m) … … 27 30 real,intent(in) :: pcpp ! specific heat Cp 28 31 real,intent(in) :: punjours ! length (in s) of a standard day 29 integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid)32 !integer,intent(in) :: ngrid ! number of horizontal grid points in the physics (full grid) 30 33 integer,intent(in) :: nlayer ! number of atmospheric layers 31 real,intent(in) :: plat(ngrid) ! latitudes of the physics grid 32 real,intent(in) :: plon(ngrid) ! longitudes of the physics grid 33 real,intent(in) :: parea(klon_glo) ! area (m2) 34 real,intent(in) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u) 35 real,intent(in) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v) 34 integer,intent(in) :: ii ! number of atmospheric coulumns along longitudes 35 integer,intent(in) :: jj ! number of atompsheric columns along latitudes 36 real,intent(in) :: rlatu(jj+1) ! latitudes of the dynamics U grid 37 real,intent(in) :: rlonv(ii+1) ! longitudes of the dynamics V grid 38 real,intent(in) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2) 39 real,intent(in) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u) 40 real,intent(in) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v) 36 41 integer,intent(in) :: pdayref ! reference day of for the simulation 37 42 real,intent(in) :: ptimestep !physics time step (s) … … 39 44 40 45 integer :: ibegin,iend,offset 46 integer :: i,j 41 47 character(len=20) :: modname='iniphysiq' 42 48 character(len=80) :: abort_message 49 real :: total_area_phy, total_area_dyn 50 51 52 ! global array, on full physics grid: 53 real,allocatable :: latfi(:) 54 real,allocatable :: lonfi(:) 55 real,allocatable :: cufi(:) 56 real,allocatable :: cvfi(:) 57 real,allocatable :: airefi(:) 43 58 44 59 IF (nlayer.NE.klev) THEN … … 51 66 ENDIF 52 67 53 IF (ngrid.NE.klon_glo) THEN 54 write(*,*) 'STOP in ',trim(modname) 55 write(*,*) 'Problem with dimensions :' 56 write(*,*) 'ngrid = ',ngrid 57 write(*,*) 'klon = ',klon_glo 58 abort_message = '' 59 CALL abort_gcm (modname,abort_message,1) 68 !IF (ngrid.NE.klon_glo) THEN 69 ! write(*,*) 'STOP in ',trim(modname) 70 ! write(*,*) 'Problem with dimensions :' 71 ! write(*,*) 'ngrid = ',ngrid 72 ! write(*,*) 'klon = ',klon_glo 73 ! abort_message = '' 74 ! CALL abort_gcm (modname,abort_message,1) 75 !ENDIF 76 77 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 78 79 ! Generate global arrays on full physics grid 80 allocate(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo)) 81 latfi(1)=rlatu(1) 82 lonfi(1)=0. 83 cufi(1) = cu(1) 84 cvfi(1) = cv(1) 85 DO j=2,jj 86 DO i=1,ii 87 latfi((j-2)*ii+1+i)= rlatu(j) 88 lonfi((j-2)*ii+1+i)= rlonv(i) 89 cufi((j-2)*ii+1+i) = cu((j-1)*ii+1+i) 90 cvfi((j-2)*ii+1+i) = cv((j-1)*ii+1+i) 91 ENDDO 92 ENDDO 93 latfi(klon_glo)= rlatu(jj+1) 94 lonfi(klon_glo)= 0. 95 cufi(klon_glo) = cu((ii+1)*jj+1) 96 cvfi(klon_glo) = cv((ii+1)*jj-ii) 97 98 ! build airefi(), mesh area on physics grid 99 allocate(airefi(klon_glo)) 100 CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi) 101 ! Poles are single points on physics grid 102 airefi(1)=sum(aire(1:ii,1)) 103 airefi(klon_glo)=sum(aire(1:ii,jj+1)) 104 105 ! Sanity check: do total planet area match between physics and dynamics? 106 total_area_dyn=sum(aire(1:ii,1:jj+1)) 107 total_area_phy=sum(airefi(1:klon_glo)) 108 IF (total_area_dyn/=total_area_phy) THEN 109 WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!' 110 WRITE (lunout, *) ' in the dynamics total_area_dyn=', total_area_dyn 111 WRITE (lunout, *) ' but in the physics total_area_phy=', total_area_phy 112 IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN 113 ! stop here if the relative difference is more than 0.001% 114 abort_message = 'planet total surface discrepancy' 115 CALL abort_gcm(modname, abort_message, 1) 116 ENDIF 60 117 ENDIF 61 118 62 !$OMP PARALLEL PRIVATE(ibegin,iend) & 63 !$OMP SHARED(parea,pcu,pcv,plon,plat) 64 119 120 !$OMP PARALLEL 121 ! Now generate local lon/lat/cu/cv/area arrays 122 call initcomgeomphy 123 124 !!!!$OMP PARALLEL PRIVATE(ibegin,iend) & 125 !!! !$OMP SHARED(airefi,cufi,cvfi,lonfi,latfi) 126 65 127 offset=klon_mpi_begin-1 66 airephy(1:klon_omp)= parea(offset+klon_omp_begin:offset+klon_omp_end)67 cuphy(1:klon_omp)= pcu(offset+klon_omp_begin:offset+klon_omp_end)68 cvphy(1:klon_omp)= pcv(offset+klon_omp_begin:offset+klon_omp_end)69 rlond(1:klon_omp)= plon(offset+klon_omp_begin:offset+klon_omp_end)70 rlatd(1:klon_omp)= plat(offset+klon_omp_begin:offset+klon_omp_end)128 airephy(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end) 129 cuphy(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end) 130 cvphy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end) 131 rlond(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end) 132 rlatd(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end) 71 133 72 134 ! copy over preff , ap() and bp() -
trunk/LMDZ.GENERIC/libf/phystd/newstart.F
r1370 r1395 466 466 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 467 467 ! Poles are single points on physics grid 468 airefi(1)= airefi(1)*iim469 airefi(ngridmx)= airefi(ngridmx)*iim468 airefi(1)=sum(aire(1:iim,1)) 469 airefi(ngridmx)=sum(aire(1:iim,jjm+1)) 470 470 471 471 ! also initialize various physics flags/settings which might be needed
Note: See TracChangeset
for help on using the changeset viewer.