Changeset 320 for LMDZ.3.3/branches/rel-LF
- Timestamp:
- Jan 25, 2002, 5:20:10 PM (23 years ago)
- Location:
- LMDZ.3.3/branches/rel-LF/libf/dyn3d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ.3.3/branches/rel-LF/libf/dyn3d/create_etat0_limit.F
r315 r320 13 13 c oldice = .T. si l'on veut garder les anciennes glaces , obtenues 14 14 c par grille_m ( grid_atob ) . 15 15 c 16 c on cree le masque dans etat0 que l'on passe ensuite dans limit pour 17 c garder les cohérences 16 18 17 19 LOGICAL interbar, extrap , oldice 18 20 PARAMETER ( interbar = .TRUE. , extrap = .FALSE. , oldice=.TRUE.) 21 #include "dimensions.h" 22 #include "paramet.h" 23 REAL :: masque(iip1,jjp1) 19 24 20 CALL etat0_netcdf ( interbar )25 CALL etat0_netcdf ( interbar, masque ) 21 26 c 22 27 WRITE(6,1) … … 26 31 WRITE(6,1) 27 32 c 28 CALL limit_netcdf ( interbar, extrap , oldice )33 CALL limit_netcdf ( interbar, extrap , oldice, masque ) 29 34 30 35 1 FORMAT(//) -
LMDZ.3.3/branches/rel-LF/libf/dyn3d/etat0_netcdf.F
r278 r320 1 SUBROUTINE etat0_netcdf 1 c 2 c $Header$ 3 c 4 SUBROUTINE etat0_netcdf (interbar, masque) 2 5 3 6 USE startvar … … 11 14 ! 12 15 ! 13 cINTEGER, PARAMETER :: KIDIA=1, KFDIA=iim*(jjm-1)+2,14 c.KLON=KFDIA-KIDIA+1,KLEV=llm16 ! INTEGER, PARAMETER :: KIDIA=1, KFDIA=iim*(jjm-1)+2, 17 ! .KLON=KFDIA-KIDIA+1,KLEV=llm 15 18 ! 16 19 #include "comgeom2.h" … … 21 24 #include "dimsoil.h" 22 25 ! 26 LOGICAL interbar 23 27 REAL :: latfi(klon), lonfi(klon) 24 28 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1), … … 56 60 CHARACTER*80 :: varname 57 61 ! 58 INTEGER :: i,j, ig, l, ji 62 INTEGER :: i,j, ig, l, ji,ii1,ii2 59 63 REAL :: xpi 60 64 ! … … 87 91 REAL ::phystep,co2_ppm,solaire 88 92 INTEGER :: radpas 93 real zrel(iip1*jjp1),chmin,chmax 89 94 90 95 CHARACTER*80 :: visu_file … … 156 161 ! This line needs to be replaced by a call to restget to get the values in the restart file 157 162 orog(:,:) = 0.0 158 CALL startget(varname, iip1, jjp1, rlonv, rlatu, orog, 0.0) 163 CALL startget(varname, iip1, jjp1, rlonv, rlatu, orog, 0.0 , 164 , jjm ,rlonu,rlatv , interbar ) 159 165 ! 160 166 WRITE(*,*) 'OUT OF GET VARIABLE : Relief' … … 164 170 ! This line needs to be replaced by a call to restget to get the values in the restart file 165 171 rugo(:,:) = 0.0 166 CALL startget(varname, iip1, jjp1, rlonv, rlatu, rugo, 0.0) 172 CALL startget(varname, iip1, jjp1, rlonv, rlatu, rugo, 0.0 , 173 , jjm, rlonu,rlatv , interbar ) 167 174 ! 168 175 WRITE(*,*) 'OUT OF GET VARIABLE : Rugosite' … … 172 179 ! This line needs to be replaced by a call to restget to get the values in the restart file 173 180 masque(:,:) = 0.0 174 CALL startget(varname, iip1, jjp1, rlonv, rlatu, masque, 0.0) 181 CALL startget(varname, iip1, jjp1, rlonv, rlatu, masque, 0.0, 182 , jjm ,rlonu,rlatv , interbar ) 175 183 ! 176 184 WRITE(*,*) 'MASQUE construit : Masque' … … 187 195 varname = 'zmasq' 188 196 zmasq(:) = 0. 189 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmasq,0.0) 197 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmasq,0.0, 198 , jjm ,rlonu,rlatv , interbar ) 190 199 WHERE (zmasq(1 : klon) .LT. EPSFRA) 191 200 zmasq(1 : klon) = 0. … … 201 210 varname = 'psol' 202 211 psol(:,:) = 0.0 203 CALL startget(varname, iip1, jjp1, rlonv, rlatu, psol, 0.0) 212 CALL startget(varname, iip1, jjp1, rlonv, rlatu, psol, 0.0 , 213 , jjm ,rlonu,rlatv , interbar ) 204 214 ! 205 215 ! Compute here the pressure on the intermediate levels. One would expect that this is available in the GCM … … 229 239 varname = 'surfgeo' 230 240 phis(:,:) = 0.0 231 CALL startget(varname, iip1, jjp1, rlonv, rlatu, phis, 0.0) 232 write(*,*) 'Phis = ' 233 write(*,*)phis 241 CALL startget(varname, iip1, jjp1, rlonv, rlatu, phis, 0.0 , 242 , jjm ,rlonu,rlatv, interbar ) 234 243 ! 235 244 varname = 'u' 236 245 uvent(:,:,:) = 0.0 237 246 CALL startget(varname, iip1, jjp1, rlonu, rlatu, llm, pls, 238 . workvar, uvent, 0.0 )247 . workvar, uvent, 0.0, jjm ,rlonv, rlatv, interbar ) 239 248 ! 240 249 varname = 'v' 241 250 vvent(:,:,:) = 0.0 242 251 CALL startget(varname, iip1, jjm, rlonv, rlatv, llm, pls, 243 . workvar, vvent, 0.0 )252 . workvar, vvent, 0.0, jjp1, rlonu, rlatu, interbar ) 244 253 ! 245 254 varname = 't' 246 255 t3d(:,:,:) = 0.0 247 256 CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls, 248 . workvar, t3d, 0.0 )257 . workvar, t3d, 0.0 , jjm, rlonu, rlatv , interbar ) 249 258 ! 250 259 WRITE(*,*) 'T3D min,max:',minval(t3d(:,:,:)), … … 253 262 tpot(:,:,:) = 0.0 254 263 CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls, 255 . pk, tpot, 0.0 )264 . pk, tpot, 0.0 , jjm, rlonu, rlatv , interbar ) 256 265 ! 257 266 WRITE(*,*) 'T3D min,max:',minval(t3d(:,:,:)), … … 273 282 ! 274 283 varname = 'q' 275 q3d(:,:,:,:) = 0.0276 284 qd(:,:,:) = 0.0 277 285 q3d(:,:,:,:) = 0.0 … … 279 287 . maxval(qsat(:,:,:)) 280 288 CALL startget(varname, iip1, jjp1, rlonv, rlatu, llm, pls, 281 . qsat, qd, 0.0 )289 . qsat, qd, 0.0, jjm, rlonu, rlatv , interbar ) 282 290 q3d(:,:,:,1) = qd(:,:,:) 283 291 ! … … 285 293 ! This line needs to be replaced by a call to restget to get the values in the restart file 286 294 tsol(:) = 0.0 287 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, tsol,0.0) 295 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, tsol, 0.0, 296 . jjm, rlonu, rlatv , interbar ) 288 297 ! 289 298 WRITE(*,*) 'TSOL construit :' … … 292 301 varname = 'qsol' 293 302 qsol(:) = 0.0 294 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, qsol,0.0) 303 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, qsol, 0.0, 304 . jjm, rlonu, rlatv , interbar ) 295 305 ! 296 306 varname = 'snow' 297 307 sn(:) = 0.0 298 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, sn,0.0) 308 CALL startget(varname, iip1, jjp1, rlonv, rlatu, klon, sn, 0.0, 309 . jjm, rlonu, rlatv , interbar ) 299 310 ! 300 311 varname = 'rads' 301 312 radsol(:) = 0.0 302 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0) 313 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,radsol,0.0, 314 . jjm, rlonu, rlatv , interbar ) 303 315 ! 304 316 varname = 'deltat' 305 317 deltat(:) = 0.0 306 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,deltat,0.0) 318 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,deltat,0.0, 319 . jjm, rlonu, rlatv , interbar ) 307 320 ! 308 321 varname = 'rugmer' 309 322 rugmer(:) = 0.0 310 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0) 323 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,rugmer,0.0, 324 . jjm, rlonu, rlatv , interbar ) 311 325 ! 312 326 varname = 'agsno' 313 327 agesno(:) = 0.0 314 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,agesno,0.0) 328 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,agesno,0.0, 329 . jjm, rlonu, rlatv , interbar ) 315 330 316 331 varname = 'zmea' 317 332 zmea(:) = 0.0 318 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0) 333 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zmea,0.0, 334 . jjm, rlonu, rlatv , interbar ) 335 319 336 varname = 'zstd' 320 337 zstd(:) = 0.0 321 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0) 338 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zstd,0.0, 339 . jjm, rlonu, rlatv , interbar ) 322 340 varname = 'zsig' 323 341 zsig(:) = 0.0 324 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0) 342 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zsig,0.0, 343 . jjm, rlonu, rlatv , interbar ) 325 344 varname = 'zgam' 326 345 zgam(:) = 0.0 327 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0) 346 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zgam,0.0, 347 . jjm, rlonu, rlatv , interbar ) 328 348 varname = 'zthe' 329 349 zthe(:) = 0.0 330 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0) 350 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zthe,0.0, 351 . jjm, rlonu, rlatv , interbar ) 331 352 varname = 'zpic' 332 353 zpic(:) = 0.0 333 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0) 354 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zpic,0.0, 355 . jjm, rlonu, rlatv , interbar ) 334 356 varname = 'zval' 335 357 zval(:) = 0.0 336 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zval,0.0) 358 CALL startget(varname,iip1,jjp1,rlonv,rlatu,klon,zval,0.0, 359 . jjm, rlonu, rlatv , interbar ) 360 c 337 361 rugsrel(:) = 0.0 338 362 IF(ok_orodr) THEN 363 DO i = 1, iip1* jjp1 364 rugsrel(i) = MAX( 1.e-05, zstd(i)* zsig(i) /2. ) 365 ENDDO 366 ENDIF 339 367 C 340 368 C En cas de simulation couplee, lecture du masque ocean issu du modele ocean -
LMDZ.3.3/branches/rel-LF/libf/dyn3d/limit_netcdf.F
r316 r320 2 2 C $Header$ 3 3 C 4 SUBROUTINE limit_netcdf ( interbar, extrap, oldice )4 SUBROUTINE limit_netcdf ( interbar, extrap, oldice, masque ) 5 5 c 6 6 IMPLICIT none … … 28 28 #include "comgeom2.h" 29 29 #include "comconst.h" 30 #include "dimphy.h" 30 31 c 31 32 c----------------------------------------------------------------------- … … 33 34 34 35 INTEGER KIDIA, KFDIA, KLON, KLEV 35 PARAMETER (KIDIA=1,KFDIA=iim*(jjm-1)+2,36 . KLON=KFDIA-KIDIA+1,KLEV=llm)37 36 c----------------------------------------------------------------------- 38 37 REAL phy_nat(klon,360), phy_nat0(klon) … … 195 194 CALL mask_c_o(imdep, jmdep, dlon_msk, dlat_msk,champ_msk, 196 195 . iim, jjp1, rlonv, rlatu, champint) 197 CALL gr_int_dyn(champint, masque, iim, jjp1)198 DO i = 1, iim199 masque(i,1) = FLOAT(NINT(masque(i,1)))200 masque(i,jjp1) = FLOAT(NINT(masque(i,jjp1)))201 ENDDO196 c CALL gr_int_dyn(champint, masque, iim, jjp1) 197 c DO i = 1, iim 198 c masque(i,1) = FLOAT(NINT(masque(i,1))) 199 c masque(i,jjp1) = FLOAT(NINT(masque(i,jjp1))) 200 c ENDDO 202 201 DO i = 1, iim 203 202 DO j = 1, jjp1 … … 205 204 ENDDO 206 205 ENDDO 207 CALL gr_dyn_fi(1, iip1, jjp1, klon, masque, phy_nat0)206 c CALL gr_dyn_fi(1, iip1, jjp1, klon, masque, phy_nat0) 208 207 ierr = NF_CLOSE(ncid) 209 208 c … … 591 590 . champan(1,1,k), phy_ice(1,k)) 592 591 DO i = 1, klon 593 phy_nat(i,k) = phy_nat0(i)592 phy_nat(i,k) = zmasq(i) 594 593 IF ( (phy_ice(i,k) - 0.5).GE.1.e-5 ) THEN 595 IF (NINT( phy_nat0(i)).EQ.0) THEN594 IF (NINT(zmasq(i)).EQ.0) THEN 596 595 phy_nat(i,k) = 3.0 597 596 ELSE -
LMDZ.3.3/branches/rel-LF/libf/dyn3d/startvar.F
r177 r320 1 ! $Header$ 1 C 2 C $Header$ 3 C 2 4 MODULE startvar 3 5 ! … … 11 13 ! 12 14 ! - A 2D variable on the dynamical grid : 13 ! CALL startget(varname, iml, jml, lon_in, lat_in, champ, val_ex) 14 ! 15 ! CALL startget(varname, iml, jml, lon_in, lat_in, champ, val_ex, jml2, lon_in2, lat_in2, interbar ) 15 16 ! 16 17 ! - A 1D variable on the physical grid : 17 ! CALL startget(varname, iml, jml, lon_in, lat_in, nbindex, champ, val_exp )18 ! CALL startget(varname, iml, jml, lon_in, lat_in, nbindex, champ, val_exp, jml2, lon_in2, lat_in2, interbar ) 18 19 ! 19 20 ! 20 21 ! - A 3D variable on the dynamical grid : 21 ! CALL startget(varname, iml, jml, lon_in, lat_in, lml, pls, workvar, champ, val_exp )22 ! CALL startget(varname, iml, jml, lon_in, lat_in, lml, pls, workvar, champ, val_exp, jml2, lon_in2, lat_in2, interbar ) 22 23 ! 23 24 ! … … 58 59 REAL, ALLOCATABLE, SAVE, DIMENSION (:,:) :: lat_phys, lat_rug, 59 60 . lat_alb, lat_rel, lat_dyn 60 REAL, ALLOCATABLE, SAVE, DIMENSION (:) :: lev _dyn61 REAL, ALLOCATABLE, SAVE, DIMENSION (:) :: levdyn_ini 61 62 REAL, ALLOCATABLE, SAVE, DIMENSION (:,:) :: relief, zstd, zsig, 62 63 . zgam, zthe, zpic, zval … … 71 72 ! 72 73 SUBROUTINE startget_phys2d(varname, iml, jml, lon_in, lat_in, 73 . champ, val_exp )74 . champ, val_exp, jml2, lon_in2, lat_in2 , interbar ) 74 75 ! 75 76 ! There is a big mess with the size in logitude, should it be iml or iml+1. … … 80 81 ! 81 82 CHARACTER*(*), INTENT(in) :: varname 82 INTEGER, INTENT(in) :: iml, jml 83 INTEGER, INTENT(in) :: iml, jml ,jml2 83 84 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 85 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 84 86 REAL, INTENT(inout) :: champ(iml,jml) 85 87 REAL, INTENT(in) :: val_exp 88 LOGICAL interbar 86 89 ! 87 90 ! This routine only works if the variable does not exist or is constant … … 98 101 IF ( .NOT.ALLOCATED(relief)) THEN 99 102 ! 100 CALL start_init_orog( iml, jml, lon_in, lat_in) 103 CALL start_init_orog( iml, jml, lon_in, lat_in, 104 . jml2,lon_in2,lat_in2, interbar ) 101 105 ! 102 106 ENDIF … … 118 122 IF ( .NOT.ALLOCATED(rugo)) THEN 119 123 ! 120 CALL start_init_orog( iml, jml, lon_in, lat_in) 124 CALL start_init_orog( iml, jml, lon_in, lat_in, 125 . jml2,lon_in2,lat_in2 , interbar ) 121 126 ! 122 127 ENDIF … … 138 143 IF ( .NOT.ALLOCATED(masque)) THEN 139 144 ! 140 CALL start_init_orog( iml, jml, lon_in, lat_in) 145 CALL start_init_orog( iml, jml, lon_in, lat_in, 146 . jml2,lon_in2,lat_in2 , interbar ) 141 147 ! 142 148 ENDIF … … 158 164 IF ( .NOT.ALLOCATED(phis)) THEN 159 165 ! 160 CALL start_init_orog( iml, jml, lon_in, lat_in) 166 CALL start_init_orog( iml, jml, lon_in, lat_in, 167 . jml2,lon_in2, lat_in2 , interbar ) 161 168 ! 162 169 ENDIF … … 178 185 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 179 186 ! 180 CALL start_init_dyn( iml, jml, lon_in, lat_in) 187 CALL start_init_dyn( iml, jml, lon_in, lat_in, 188 . jml2,lon_in2, lat_in2 , interbar ) 181 189 ! 182 190 ENDIF … … 232 240 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 233 241 ! 234 SUBROUTINE start_init_orog( iml, jml, lon_in, lat_in) 235 ! 236 INTEGER, INTENT(in) :: iml, jml 242 SUBROUTINE start_init_orog ( iml,jml,lon_in, lat_in,jml2,lon_in2 , 243 , lat_in2 , interbar ) 244 ! 245 INTEGER, INTENT(in) :: iml, jml, jml2 237 246 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 247 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 248 LOGICAL interbar 238 249 ! 239 250 ! LOCAL 240 251 ! 241 REAL :: lev(1), date, dt 252 LOGICAL interbar2 253 REAL :: lev(1), date, dt,chmin,chmax 242 254 INTEGER :: itau(1), fid 243 255 INTEGER :: llm_tmp, ttm_tmp 244 256 INTEGER :: i, j 245 257 INTEGER :: iret 258 CHARACTER*25 title 246 259 REAL, ALLOCATABLE :: relief_hi(:,:) 247 260 REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:) 261 REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:) 248 262 REAL, ALLOCATABLE :: tmp_var(:,:) 249 263 INTEGER, ALLOCATABLE :: tmp_int(:,:) … … 275 289 ! 276 290 ALLOCATE(lon_rad(iml_rel)) 291 ALLOCATE(lon_ini(iml_rel)) 292 277 293 IF ( MAXVAL(lon_rel(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 278 lon_rad(:) = lon_rel(:,1) * 2.0 * ASIN(1.0) / 180.0 279 ELSE 280 lon_rad(:) = lon_rel(:,1) 281 ENDIF 294 lon_ini(:) = lon_rel(:,1) * 2.0 * ASIN(1.0) / 180.0 295 ELSE 296 lon_ini(:) = lon_rel(:,1) 297 ENDIF 298 282 299 ALLOCATE(lat_rad(jml_rel)) 300 ALLOCATE(lat_ini(jml_rel)) 301 283 302 IF ( MAXVAL(lat_rel(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 284 lat_rad(:) = lat_rel(1,:) * 2.0 * ASIN(1.0) / 180.0 285 ELSE 286 lat_rad(:) = lat_rel(1,:) 287 ENDIF 288 ! 289 ! 303 lat_ini(:) = lat_rel(1,:) * 2.0 * ASIN(1.0) / 180.0 304 ELSE 305 lat_ini(:) = lat_rel(1,:) 306 ENDIF 307 ! 308 ! 309 310 title='RELIEF' 311 312 interbar2 = .FALSE. 313 CALL conf_dat2d(title,iml_rel, jml_rel, lon_ini, lat_ini, 314 . lon_rad, lat_rad, relief_hi , interbar2 ) 315 290 316 IF ( check ) WRITE(*,*) 'Computes all the parameters needed', 291 317 .' for the gravity wave drag code' … … 315 341 ! 316 342 CALL grid_noro(iml_rel, jml_rel, lon_rad, lat_rad, relief_hi, 317 $ iml-1, jml, lon_in, lat_in, 318 ! . phis, relief, zstd, zsig, zgam, zthe, zpic, zval, tmp_int) 319 ! PB masque avec % terre mai 2000 320 $ phis, relief, zstd, zsig, zgam, zthe, zpic, zval, masque) 343 . iml-1, jml, lon_in, lat_in, 344 . phis, relief, zstd, zsig, zgam, zthe, zpic, zval, tmp_int) 321 345 phis = phis * 9.81 322 ! write(*,*)'phis sortie grid_noro' 323 ! write(*,*)phis 324 ! 325 !PB supression ligne suivant pour masque avec % terre 326 ! masque(:,:) = FLOAT(tmp_int(:,:)) 346 ! 347 masque(:,:) = FLOAT(tmp_int(:,:)) 327 348 ! 328 349 ! Compute surface roughness … … 343 364 rugo(iml,j) = tmp_var(1,j) 344 365 ENDDO 366 c 367 cc *** rugo n'est pas utilise pour l'instant ****** 345 368 ! 346 369 ! Build land-sea mask … … 354 377 ! 355 378 SUBROUTINE startget_phys1d(varname, iml, jml, lon_in, 356 .lat_in, nbindex, champ, val_exp )379 .lat_in, nbindex, champ, val_exp ,jml2, lon_in2, lat_in2,interbar) 357 380 ! 358 381 CHARACTER*(*), INTENT(in) :: varname 359 INTEGER, INTENT(in) :: iml, jml, nbindex 382 INTEGER, INTENT(in) :: iml, jml, nbindex, jml2 360 383 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 384 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 361 385 REAL, INTENT(inout) :: champ(nbindex) 362 386 REAL, INTENT(in) :: val_exp 387 LOGICAL interbar 363 388 ! 364 389 ! … … 370 395 CASE ('tsol') 371 396 IF ( .NOT.ALLOCATED(tsol)) THEN 372 CALL start_init_phys( iml, jml, lon_in, lat_in) 397 CALL start_init_phys( iml, jml, lon_in, lat_in, 398 . jml2, lon_in2, lat_in2, interbar ) 373 399 ENDIF 374 400 IF ( SIZE(tsol) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 380 406 CASE ('qsol') 381 407 IF ( .NOT.ALLOCATED(qsol)) THEN 382 CALL start_init_phys( iml, jml, lon_in, lat_in) 408 CALL start_init_phys( iml, jml, lon_in, lat_in, 409 . jml2, lon_in2,lat_in2 , interbar ) 383 410 ENDIF 384 411 IF ( SIZE(qsol) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 390 417 CASE ('psol') 391 418 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 392 CALL start_init_dyn( iml, jml, lon_in, lat_in) 419 CALL start_init_dyn( iml, jml, lon_in, lat_in, 420 . jml2, lon_in2,lat_in2 , interbar ) 393 421 ENDIF 394 422 IF (SIZE(psol_dyn) .NE. SIZE(lon_in)*SIZE(lat_in)) THEN … … 401 429 CASE ('zmasq') 402 430 IF (.NOT. ALLOCATED(masque) ) THEN 403 CALL start_init_orog ( iml, jml,lon_in, lat_in) 431 CALL start_init_orog ( iml, jml,lon_in, lat_in, 432 . jml2, lon_in2,lat_in2 , interbar ) 404 433 ENDIF 405 434 IF ( SIZE(masque) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 411 440 CASE ('zmea') 412 441 IF ( .NOT.ALLOCATED(relief)) THEN 413 CALL start_init_orog( iml, jml, lon_in, lat_in) 442 CALL start_init_orog( iml, jml, lon_in, lat_in, 443 . jml2, lon_in2,lat_in2 , interbar ) 414 444 ENDIF 415 445 IF ( SIZE(relief) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 421 451 CASE ('zstd') 422 452 IF ( .NOT.ALLOCATED(zstd)) THEN 423 CALL start_init_orog( iml, jml, lon_in, lat_in) 453 CALL start_init_orog( iml, jml, lon_in, lat_in, 454 . jml2, lon_in2,lat_in2 , interbar ) 424 455 ENDIF 425 456 IF ( SIZE(zstd) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 431 462 CASE ('zsig') 432 463 IF ( .NOT.ALLOCATED(zsig)) THEN 433 CALL start_init_orog( iml, jml, lon_in, lat_in) 464 CALL start_init_orog( iml, jml, lon_in, lat_in, 465 . jml2, lon_in2,lat_in2 , interbar ) 434 466 ENDIF 435 467 IF ( SIZE(zsig) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 441 473 CASE ('zgam') 442 474 IF ( .NOT.ALLOCATED(zgam)) THEN 443 CALL start_init_orog( iml, jml, lon_in, lat_in) 475 CALL start_init_orog( iml, jml, lon_in, lat_in, 476 . jml2, lon_in2,lat_in2 , interbar ) 444 477 ENDIF 445 478 IF ( SIZE(zgam) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 451 484 CASE ('zthe') 452 485 IF ( .NOT.ALLOCATED(zthe)) THEN 453 CALL start_init_orog( iml, jml, lon_in, lat_in) 486 CALL start_init_orog( iml, jml, lon_in, lat_in, 487 . jml2, lon_in2,lat_in2 , interbar ) 454 488 ENDIF 455 489 IF ( SIZE(zthe) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 461 495 CASE ('zpic') 462 496 IF ( .NOT.ALLOCATED(zpic)) THEN 463 CALL start_init_orog( iml, jml, lon_in, lat_in) 497 CALL start_init_orog( iml, jml, lon_in, lat_in, 498 . jml2, lon_in2,lat_in2 , interbar ) 464 499 ENDIF 465 500 IF ( SIZE(zpic) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 471 506 CASE ('zval') 472 507 IF ( .NOT.ALLOCATED(zval)) THEN 473 CALL start_init_orog( iml, jml, lon_in, lat_in) 508 CALL start_init_orog( iml, jml, lon_in, lat_in, 509 . jml2, lon_in2,lat_in2 , interbar ) 474 510 ENDIF 475 511 IF ( SIZE(zval) .NE. SIZE(lon_in)*SIZE(lat_in) ) THEN … … 479 515 ENDIF 480 516 CALL gr_dyn_fi(1, iml, jml, nbindex,zval, champ) 481 517 CASE ('rads') 482 518 champ(:) = 0.0 483 519 CASE ('snow') … … 510 546 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 511 547 ! 512 SUBROUTINE start_init_phys( iml, jml, lon_in, lat_in) 513 ! 514 INTEGER, INTENT(in) :: iml, jml 548 SUBROUTINE start_init_phys( iml, jml, lon_in, lat_in, jml2, 549 . lon_in2, lat_in2 , interbar ) 550 ! 551 INTEGER, INTENT(in) :: iml, jml ,jml2 515 552 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 553 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 554 LOGICAL interbar 516 555 ! 517 556 ! LOCAL … … 522 561 INTEGER :: i, j 523 562 ! 563 CHARACTER*25 title 524 564 CHARACTER*120 :: physfname 525 565 LOGICAL :: check=.TRUE. 526 566 ! 527 567 REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:) 568 REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:) 528 569 REAL, ALLOCATABLE :: var_ana(:,:), tmp_var(:,:) 529 570 ! … … 549 590 ! In case we have a file which is in degrees we do the transformation 550 591 ! 592 DEALLOCATE (lon_rad) 551 593 ALLOCATE(lon_rad(iml_phys)) 594 DEALLOCATE (lon_ini) 595 ALLOCATE(lon_ini(iml_phys)) 596 552 597 IF ( MAXVAL(lon_phys(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 553 lon_rad(:) = lon_phys(:,1) * 2.0 * ASIN(1.0) / 180.0 554 ELSE 555 lon_rad(:) = lon_phys(:,1) 556 ENDIF 598 lon_ini(:) = lon_phys(:,1) * 2.0 * ASIN(1.0) / 180.0 599 ELSE 600 lon_ini(:) = lon_phys(:,1) 601 ENDIF 602 557 603 ALLOCATE(lat_rad(jml_phys)) 604 ALLOCATE(lat_ini(jml_phys)) 605 558 606 IF ( MAXVAL(lat_phys(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 559 lat_rad(:) = lat_phys(1,:) * 2.0 * ASIN(1.0) / 180.0 560 ELSE 561 lat_rad(:) = lat_phys(1,:) 562 ENDIF 607 lat_ini(:) = lat_phys(1,:) * 2.0 * ASIN(1.0) / 180.0 608 ELSE 609 lat_ini(:) = lat_phys(1,:) 610 ENDIF 611 612 563 613 ! 564 614 ! We get the two standard varibales … … 569 619 ! 570 620 ! 621 571 622 CALL flinget(fid_phys, 'ST', iml_phys, jml_phys, 572 623 .llm_tmp, ttm_tmp, 1, 1, var_ana) 573 CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad, 574 . var_ana, iml-1, jml, lon_in, lat_in, tmp_var) 624 625 title='ST' 626 CALL conf_dat2d(title,iml_phys, jml_phys, lon_ini, lat_ini, 627 . lon_rad, lat_rad, var_ana , interbar ) 628 629 IF ( interbar ) THEN 630 WRITE(6,*) '-------------------------------------------------', 631 ,'--------------' 632 WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ', 633 , ' pour ST $$$ ' 634 WRITE(6,*) '-------------------------------------------------', 635 ,'--------------' 636 CALL inter_barxy ( iml_phys,jml_phys -1,lon_rad,lat_rad , 637 , var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var ) 638 ELSE 639 CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad, 640 . var_ana, iml-1, jml, lon_in, lat_in, tmp_var ) 641 ENDIF 642 575 643 CALL gr_int_dyn(tmp_var, tsol, iml-1, jml) 576 644 ! … … 580 648 CALL flinget(fid_phys, 'CDSW', iml_phys, jml_phys, 581 649 . llm_tmp, ttm_tmp, 1, 1, var_ana) 582 CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad, 583 . var_ana, iml-1, jml, lon_in, lat_in, tmp_var) 584 CALL gr_int_dyn(tmp_var, qsol, iml-1, jml) 585 ! 586 CALL flinclo(fid_phys) 587 ! 650 651 title='CDSW' 652 CALL conf_dat2d(title,iml_phys, jml_phys, lon_ini, lat_ini, 653 . lon_rad, lat_rad, var_ana, interbar ) 654 655 IF ( interbar ) THEN 656 WRITE(6,*) '-------------------------------------------------', 657 ,'--------------' 658 WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ', 659 , ' pour CDSW $$$ ' 660 WRITE(6,*) '-------------------------------------------------', 661 ,'--------------' 662 CALL inter_barxy ( iml_phys,jml_phys -1,lon_rad,lat_rad , 663 , var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var ) 664 ELSE 665 CALL grille_m(iml_phys, jml_phys, lon_rad, lat_rad, 666 . var_ana, iml-1, jml, lon_in, lat_in, tmp_var ) 667 ENDIF 668 c 669 CALL gr_int_dyn(tmp_var, qsol, iml-1, jml) 670 ! 671 CALL flinclo(fid_phys) 672 ! 673 DEALLOCATE (lon_rad) 674 DEALLOCATE (lon_ini) 675 DEALLOCATE (lat_rad) 676 DEALLOCATE (lat_ini) 588 677 END SUBROUTINE start_init_phys 589 678 ! … … 593 682 ! 594 683 SUBROUTINE startget_dyn(varname, iml, jml, lon_in, lat_in, 595 . lml, pls, workvar, champ, val_exp) 684 . lml, pls, workvar, champ, val_exp,jml2, lon_in2, lat_in2 , 685 , interbar ) 596 686 ! 597 687 ! ARGUMENTS 598 688 ! 599 689 CHARACTER*(*), INTENT(in) :: varname 600 INTEGER, INTENT(in) :: iml, jml, lml 690 INTEGER, INTENT(in) :: iml, jml, lml, jml2 601 691 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 692 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 602 693 REAL, INTENT(in) :: pls(iml, jml, lml) 603 694 REAL, INTENT(in) :: workvar(iml, jml, lml) 604 695 REAL, INTENT(inout) :: champ(iml, jml, lml) 605 696 REAL, INTENT(in) :: val_exp 697 LOGICAL interbar 606 698 ! 607 699 ! LOCAL … … 609 701 INTEGER :: il, ij, ii 610 702 REAL :: xppn, xpps 611 !612 ! C'est vraiment une galere de devoir rajouter tant de commons just pour avoir les aires.613 ! Il faudrait mettre une structure plus flexible et moins dangereuse.614 703 ! 615 704 #include "dimensions.h" … … 626 715 CASE ('u') 627 716 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 628 CALL start_init_dyn( iml, jml, lon_in, lat_in) 717 CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 , 718 . lon_in2,lat_in2 , interbar ) 629 719 ENDIF 630 720 CALL start_inter_3d('U', iml, jml, lml, lon_in, 631 . lat_in, pls, champ)721 . lat_in, jml2, lon_in2, lat_in2, pls, champ,interbar ) 632 722 DO il=1,lml 633 723 DO ij=1,jml … … 640 730 CASE ('v') 641 731 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 642 CALL start_init_dyn( iml, jml, lon_in, lat_in) 732 CALL start_init_dyn( iml, jml, lon_in, lat_in , jml2, 733 . lon_in2, lat_in2 , interbar ) 643 734 ENDIF 644 CALL start_inter_3d('V', iml, jml, lml, lon_in, 645 . lat_in, pls, champ)735 CALL start_inter_3d('V', iml, jml, lml, lon_in, 736 . lat_in, jml2, lon_in2, lat_in2, pls, champ, interbar ) 646 737 DO il=1,lml 647 738 DO ij=1,jml … … 654 745 CASE ('t') 655 746 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 656 CALL start_init_dyn( iml, jml, lon_in, lat_in) 747 CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 , 748 . lon_in2, lat_in2 ,interbar ) 657 749 ENDIF 658 750 CALL start_inter_3d('TEMP', iml, jml, lml, lon_in, 659 . lat_in, pls, champ)751 . lat_in, jml2, lon_in2, lat_in2, pls, champ, interbar ) 660 752 661 753 CASE ('tpot') 662 754 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 663 CALL start_init_dyn( iml, jml, lon_in, lat_in) 755 CALL start_init_dyn( iml, jml, lon_in, lat_in , jml2 , 756 . lon_in2, lat_in2 , interbar ) 664 757 ENDIF 665 758 CALL start_inter_3d('TEMP', iml, jml, lml, lon_in, 666 . lat_in, pls, champ)759 . lat_in, jml2, lon_in2, lat_in2, pls, champ, interbar ) 667 760 IF ( MINVAL(workvar(:,:,:)) .NE. MAXVAL(workvar(:,:,:)) ) 668 761 . THEN … … 689 782 CASE ('q') 690 783 IF ( .NOT.ALLOCATED(psol_dyn)) THEN 691 CALL start_init_dyn( iml, jml, lon_in, lat_in) 784 CALL start_init_dyn( iml, jml, lon_in, lat_in, jml2 , 785 . lon_in2, lat_in2 , interbar ) 692 786 ENDIF 693 787 CALL start_inter_3d('R', iml, jml, lml, lon_in, lat_in, 694 . pls, champ)788 . jml2, lon_in2, lat_in2, pls, champ, interbar ) 695 789 IF ( MINVAL(workvar(:,:,:)) .NE. MAXVAL(workvar(:,:,:)) ) 696 790 . THEN … … 727 821 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 728 822 ! 729 SUBROUTINE start_init_dyn( iml, jml, lon_in, lat_in) 730 ! 731 INTEGER, INTENT(in) :: iml, jml 823 SUBROUTINE start_init_dyn( iml, jml, lon_in, lat_in,jml2,lon_in2 , 824 , lat_in2 , interbar ) 825 ! 826 INTEGER, INTENT(in) :: iml, jml, jml2 732 827 REAL, INTENT(in) :: lon_in(iml), lat_in(jml) 828 REAL, INTENT(in) :: lon_in2(iml), lat_in2(jml2) 829 LOGICAL interbar 733 830 ! 734 831 ! LOCAL … … 743 840 ! 744 841 REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:) 842 REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:) 745 843 REAL, ALLOCATABLE :: var_ana(:,:), tmp_var(:,:), z(:,:) 746 844 REAL, ALLOCATABLE :: xppn(:), xpps(:) 747 845 LOGICAL :: allo 748 846 ! 749 ! Ce n'est pas tres pratique d'avoir a charger 3 include pour avoir la grille du modele750 847 ! 751 848 #include "dimensions.h" 752 849 #include "paramet.h" 753 850 #include "comgeom2.h" 851 852 CHARACTER*25 title 853 754 854 ! 755 855 physfname = 'ECDYN.nc' … … 764 864 ALLOCATE (lat_dyn(iml_dyn,jml_dyn), stat=iret) 765 865 ALLOCATE (lon_dyn(iml_dyn,jml_dyn), stat=iret) 766 ALLOCATE (lev _dyn(llm_dyn), stat=iret)866 ALLOCATE (levdyn_ini(llm_dyn), stat=iret) 767 867 ! 768 868 CALL flinopen(physfname, .FALSE., iml_dyn, jml_dyn, llm_dyn, 769 . lon_dyn, lat_dyn, lev _dyn, ttm_dyn,869 . lon_dyn, lat_dyn, levdyn_ini, ttm_dyn, 770 870 . itau, date, dt, fid_dyn) 771 871 ! … … 781 881 DEALLOCATE(lon_rad, stat=iret) 782 882 endif 783 ALLOCATE(lon_rad(iml_dyn), stat=iret) 883 884 ALLOCATE(lon_rad(iml_dyn), stat=iret) 885 ALLOCATE(lon_ini(iml_dyn)) 784 886 785 887 IF ( MAXVAL(lon_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 786 lon_rad(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0 787 ELSE 788 lon_rad(:) = lon_dyn(:,1) 789 ENDIF 888 lon_ini(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0 889 ELSE 890 lon_ini(:) = lon_dyn(:,1) 891 ENDIF 892 790 893 ALLOCATE(lat_rad(jml_dyn)) 894 ALLOCATE(lat_ini(jml_dyn)) 895 791 896 IF ( MAXVAL(lat_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 792 lat_rad(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0 793 ELSE 794 lat_rad(:) = lat_dyn(1,:) 795 ENDIF 796 ! 897 lat_ini(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0 898 ELSE 899 lat_ini(:) = lat_dyn(1,:) 900 ENDIF 901 ! 902 903 797 904 ALLOCATE(z(iml, jml)) 798 905 ALLOCATE(tmp_var(iml-1,jml)) … … 800 907 CALL flinget(fid_dyn, 'Z', iml_dyn, jml_dyn, 0, ttm_dyn, 801 908 . 1, 1, var_ana) 802 CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana, 909 c 910 title='Z' 911 CALL conf_dat2d( title,iml_dyn, jml_dyn,lon_ini, lat_ini, 912 . lon_rad, lat_rad, var_ana, interbar ) 913 c 914 IF ( interbar ) THEN 915 WRITE(6,*) '-------------------------------------------------', 916 ,'--------------' 917 WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ', 918 , ' pour Z $$$ ' 919 WRITE(6,*) '-------------------------------------------------', 920 ,'--------------' 921 CALL inter_barxy ( iml_dyn,jml_dyn -1,lon_rad,lat_rad , 922 , var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var) 923 ELSE 924 CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana, 803 925 . iml-1, jml, lon_in, lat_in, tmp_var) 926 ENDIF 927 804 928 CALL gr_int_dyn(tmp_var, z, iml-1, jml) 805 929 ! … … 808 932 CALL flinget(fid_dyn, 'SP', iml_dyn, jml_dyn, 0, ttm_dyn, 809 933 . 1, 1, var_ana) 810 CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana, 811 . iml-1, jml, lon_in, lat_in, tmp_var) 934 935 title='SP' 936 CALL conf_dat2d( title,iml_dyn, jml_dyn,lon_ini, lat_ini, 937 . lon_rad, lat_rad, var_ana, interbar ) 938 939 IF ( interbar ) THEN 940 WRITE(6,*) '-------------------------------------------------', 941 ,'--------------' 942 WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ', 943 , ' pour SP $$$ ' 944 WRITE(6,*) '-------------------------------------------------', 945 ,'--------------' 946 CALL inter_barxy ( iml_dyn,jml_dyn -1,lon_rad,lat_rad , 947 , var_ana, iml-1, jml-1, lon_in2, lat_in2, jml, tmp_var) 948 ELSE 949 CALL grille_m(iml_dyn, jml_dyn , lon_rad, lat_rad, var_ana, 950 . iml-1, jml, lon_in, lat_in, tmp_var ) 951 ENDIF 952 812 953 CALL gr_int_dyn(tmp_var, psol_dyn, iml-1, jml) 813 954 ! … … 817 958 ! coming out of the restart file. In case we dor have it we will initialize it. 818 959 ! 819 CALL start_init_phys( iml, jml, lon_in, lat_in) 960 CALL start_init_phys( iml, jml, lon_in, lat_in,jml2,lon_in2, 961 . lat_in2 , interbar ) 820 962 ELSE 821 963 IF ( SIZE(tsol) .NE. SIZE(psol_dyn) ) THEN … … 831 973 ! coming out of the restart file. In case we dor have it we will initialize it. 832 974 ! 833 CALL start_init_orog( iml, jml, lon_in, lat_in) 975 CALL start_init_orog( iml, jml, lon_in, lat_in, jml2, lon_in2 , 976 . lat_in2 , interbar ) 834 977 ! 835 978 ELSE … … 877 1020 ! 878 1021 SUBROUTINE start_inter_3d(varname, iml, jml, lml, lon_in, 879 . lat_in, pls_in, var3d)1022 . lat_in, jml2, lon_in2, lat_in2, pls_in, var3d, interbar ) 880 1023 ! 881 1024 ! This subroutine gets a variables from a 3D file and does the interpolations needed … … 885 1028 ! 886 1029 CHARACTER*(*) :: varname 887 INTEGER :: iml, jml, lml 1030 INTEGER :: iml, jml, lml, jml2 888 1031 REAL :: lon_in(iml), lat_in(jml), pls_in(iml, jml, lml) 1032 REAL :: lon_in2(iml) , lat_in2(jml2) 889 1033 REAL :: var3d(iml, jml, lml) 1034 LOGICAL interbar 1035 real chmin,chmax 890 1036 ! 891 1037 ! LOCAL 892 1038 ! 893 INTEGER :: ii, ij, il 1039 CHARACTER*25 title 1040 INTEGER :: ii, ij, il, jsort,i,j,l 894 1041 REAL :: bx, by 895 1042 REAL, ALLOCATABLE :: lon_rad(:), lat_rad(:) 1043 REAL, ALLOCATABLE :: lon_ini(:), lat_ini(:) , lev_dyn(:) 896 1044 REAL, ALLOCATABLE :: var_tmp2d(:,:), var_tmp3d(:,:,:) 897 1045 REAL, ALLOCATABLE :: ax(:), ay(:), yder(:) 1046 REAL, ALLOCATABLE :: varrr(:,:,:) 898 1047 INTEGER, ALLOCATABLE :: lind(:) 899 1048 ! … … 903 1052 ALLOCATE(var_ana3d(iml_dyn, jml_dyn, llm_dyn)) 904 1053 ENDIF 1054 ALLOCATE(varrr(iml_dyn, jml_dyn, llm_dyn)) 905 1055 ! 906 1056 ! … … 917 1067 ! 918 1068 ALLOCATE(lon_rad(iml_dyn)) 1069 ALLOCATE(lon_ini(iml_dyn)) 1070 919 1071 IF ( MAXVAL(lon_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 920 lon_rad(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0 921 ELSE 922 lon_rad(:) = lon_dyn(:,1) 923 ENDIF 1072 lon_ini(:) = lon_dyn(:,1) * 2.0 * ASIN(1.0) / 180.0 1073 ELSE 1074 lon_ini(:) = lon_dyn(:,1) 1075 ENDIF 1076 924 1077 ALLOCATE(lat_rad(jml_dyn)) 1078 ALLOCATE(lat_ini(jml_dyn)) 1079 1080 ALLOCATE(lev_dyn(llm_dyn)) 1081 925 1082 IF ( MAXVAL(lat_dyn(:,:)) .GT. 2.0 * ASIN(1.0) ) THEN 926 lat_rad(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0 927 ELSE 928 lat_rad(:) = lat_dyn(1,:) 929 ENDIF 930 ! 1083 lat_ini(:) = lat_dyn(1,:) * 2.0 * ASIN(1.0) / 180.0 1084 ELSE 1085 lat_ini(:) = lat_dyn(1,:) 1086 ENDIF 1087 ! 1088 1089 CALL conf_dat3d ( varname,iml_dyn, jml_dyn, llm_dyn, lon_ini, 1090 . lat_ini, levdyn_ini, lon_rad, lat_rad, lev_dyn, var_ana3d , 1091 , interbar ) 1092 931 1093 ALLOCATE(var_tmp2d(iml-1, jml)) 932 1094 ALLOCATE(var_tmp3d(iml, jml, llm_dyn)) … … 936 1098 ALLOCATE(lind(llm_dyn)) 937 1099 ! 1100 938 1101 DO il=1,llm_dyn 939 1102 ! 940 CALL grille_m(iml_dyn, jml_dyn, lon_rad, lat_rad, 941 .var_ana3d(:,:,il), iml-1, jml, lon_in, lat_in, var_tmp2d) 1103 IF( interbar ) THEN 1104 IF( il.EQ.1 ) THEN 1105 WRITE(6,*) '-------------------------------------------------', 1106 ,'--------------' 1107 WRITE(6,*) '$$$ Utilisation de l interpolation barycentrique ', 1108 , ' pour ', varname 1109 WRITE(6,*) '-------------------------------------------------', 1110 ,'--------------' 1111 ENDIF 1112 CALL inter_barxy ( iml_dyn, jml_dyn -1,lon_rad, lat_rad, 1113 , var_ana3d(:,:,il),iml-1, jml2, lon_in2, lat_in2,jml,var_tmp2d ) 1114 ELSE 1115 CALL grille_m(iml_dyn, jml_dyn, lon_rad, lat_rad, 1116 . var_ana3d(:,:,il), iml-1, jml, lon_in, lat_in, var_tmp2d ) 1117 ENDIF 942 1118 ! 943 1119 CALL gr_int_dyn(var_tmp2d, var_tmp3d(:,:,il), iml-1, jml) … … 945 1121 ENDDO 946 1122 ! 947 ! IF needed we return the vertical axis. The spline interpolation948 ! Requires the coordinate to be in increasing order.949 !950 IF ( lev_dyn(1) .LT. lev_dyn(llm_dyn)) THEN951 DO il=1,llm_dyn952 lind(il) = il953 ENDDO954 ELSE955 1123 DO il=1,llm_dyn 956 1124 lind(il) = llm_dyn-il+1 957 1125 ENDDO 958 ENDIF 959 ! 1126 ! 1127 c 1128 c ... Pour l'interpolation verticale ,on interpole du haut de l'atmosphere 1129 c vers le sol ... 1130 c 960 1131 DO ij=1,jml 961 1132 DO ii=1,iml-1 962 1133 ! 963 ax(:) = lev_dyn(lind(:)) * 1001134 ax(:) = lev_dyn(lind(:)) 964 1135 ay(:) = var_tmp3d(ii, ij, lind(:)) 965 1136 ! 1137 966 1138 CALL SPLINE(ax, ay, llm_dyn, 1.e30, 1.e30, yder) 967 1139 ! … … 976 1148 ENDDO 977 1149 1150 do il=1,lml 1151 call minmax(iml*jml,var3d(1,1,il),chmin,chmax) 1152 SELECTCASE(varname) 1153 CASE('U') 1154 WRITE(*,*) ' U min max l ',il,chmin,chmax 1155 CASE('V') 1156 WRITE(*,*) ' V min max l ',il,chmin,chmax 1157 CASE('TEMP') 1158 WRITE(*,*) ' TEMP min max l ',il,chmin,chmax 1159 CASE('R') 1160 WRITE(*,*) ' R min max l ',il,chmin,chmax 1161 END SELECT 1162 enddo 1163 978 1164 DEALLOCATE(lon_rad) 979 1165 DEALLOCATE(lat_rad)
Note: See TracChangeset
for help on using the changeset viewer.