Changeset 766 for LMDZ4/trunk/libf/phylmd/phyredem.F
- Timestamp:
- Jun 4, 2007, 4:34:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/phyredem.F
r644 r766 4 4 c 5 5 SUBROUTINE phyredem (fichnom,dtime,radpas, 6 . rlat ,rlon, pctsrf,tsol,tsoil,6 . rlat_p,rlon_p, pctsrf_p,tsol_p,tsoil_p, 7 7 cIM "slab" ocean 8 8 . tslab,seaice, 9 . qsurf ,qsol,snow,10 . albedo, alblw, evap, rain_fall, snow_fall,11 . solsw, sollw,fder,12 . radsol,frugs,agesno,13 . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugsrel,14 . t_ancien, q_ancien, rnebcon, ratqs, clwcon,15 . run_off_lic_0)9 . qsurf_p,qsol_p,snow_p,albedo_p, alblw_p, evap_p, 10 . rain_fall_p, snow_fall_p,solsw_p, sollw_p,fder_p, 11 . radsol_p,frugs_p,agesno_p,zmea_p,zstd_p,zsig_p, 12 . zgam_p,zthe_p,zpic_p,zval_p,rugsrel_p, 13 . t_ancien_p, q_ancien_p, rnebcon_p, ratqs_p, clwcon_p, 14 . run_off_lic_0_p) 15 USE dimphy 16 16 IMPLICIT none 17 17 c====================================================================== … … 19 19 c Objet: Ecriture de l'etat de redemarrage pour la physique 20 20 c====================================================================== 21 #include "dimensions.h"22 #include "dimphy.h"21 cym#include "dimensions.h" 22 cym#include "dimphy.h" 23 23 #include "netcdf.inc" 24 24 #include "indicesol.h" … … 31 31 REAL dtime 32 32 INTEGER radpas 33 REAL rlat (klon), rlon(klon)34 REAL tsol (klon,nbsrf)35 REAL tsoil (klon,nsoilmx,nbsrf)33 REAL rlat_p(klon), rlon_p(klon) 34 REAL tsol_p(klon,nbsrf) 35 REAL tsoil_p(klon,nsoilmx,nbsrf) 36 36 cIM "slab" ocean 37 REAL tslab (klon), seaice(klon)38 REAL qsurf (klon,nbsrf)39 REAL qsol (klon)40 REAL snow (klon,nbsrf)41 REAL albedo (klon,nbsrf)37 REAL tslab_p(klon), seaice_p(klon) 38 REAL qsurf_p(klon,nbsrf) 39 REAL qsol_p(klon) 40 REAL snow_p(klon,nbsrf) 41 REAL albedo_p(klon,nbsrf) 42 42 cIM BEG 43 REAL alblw (klon,nbsrf)43 REAL alblw_p(klon,nbsrf) 44 44 cIM END 45 REAL evap(klon,nbsrf) 46 REAL rain_fall(klon) 47 REAL snow_fall(klon) 48 real solsw(klon) 49 real sollw(klon) 50 real fder(klon) 51 REAL radsol(klon) 52 REAL frugs(klon,nbsrf) 53 REAL agesno(klon,nbsrf) 54 REAL zmea(klon) 55 REAL zstd(klon) 56 REAL zsig(klon) 57 REAL zgam(klon) 58 REAL zthe(klon) 59 REAL zpic(klon) 60 REAL zval(klon) 61 REAL rugsrel(klon) 62 REAL pctsrf(klon, nbsrf) 63 REAL t_ancien(klon,klev), q_ancien(klon,klev) 64 real clwcon(klon,klev),rnebcon(klon,klev),ratqs(klon,klev) 65 REAL run_off_lic_0(klon) 45 REAL evap_p(klon,nbsrf) 46 REAL rain_fall_p(klon) 47 REAL snow_fall_p(klon) 48 real solsw_p(klon) 49 real sollw_p(klon) 50 real fder_p(klon) 51 REAL radsol_p(klon) 52 REAL frugs_p(klon,nbsrf) 53 REAL agesno_p(klon,nbsrf) 54 REAL zmea_p(klon) 55 REAL zstd_p(klon) 56 REAL zsig_p(klon) 57 REAL zgam_p(klon) 58 REAL zthe_p(klon) 59 REAL zpic_p(klon) 60 REAL zval_p(klon) 61 REAL rugsrel_p(klon) 62 REAL pctsrf_p(klon, nbsrf) 63 REAL t_ancien_p(klon,klev), q_ancien_p(klon,klev) 64 real clwcon_p(klon,klev),rnebcon_p(klon,klev),ratqs_p(klon,klev) 65 REAL run_off_lic_0_p(klon) 66 67 REAL rlat(klon2), rlon(klon2) 68 REAL tsol(klon2,nbsrf) 69 REAL tsoil(klon2,nsoilmx,nbsrf) 70 REAL tslab(klon2), seaice(klon2) 71 REAL qsurf(klon2,nbsrf) 72 REAL qsol(klon2) 73 REAL snow(klon2,nbsrf) 74 REAL albedo(klon2,nbsrf) 75 REAL alblw(klon2,nbsrf) 76 REAL evap(klon2,nbsrf) 77 REAL rain_fall(klon2) 78 REAL snow_fall(klon2) 79 real solsw(klon2) 80 real sollw(klon2) 81 real fder(klon2) 82 REAL radsol(klon2) 83 REAL frugs(klon2,nbsrf) 84 REAL agesno(klon2,nbsrf) 85 REAL zmea(klon2) 86 REAL zstd(klon2) 87 REAL zsig(klon2) 88 REAL zgam(klon2) 89 REAL zthe(klon2) 90 REAL zpic(klon2) 91 REAL zval(klon2) 92 REAL rugsrel(klon2) 93 REAL pctsrf(klon2, nbsrf) 94 REAL t_ancien(klon2,klev), q_ancien(klon2,klev) 95 real clwcon(klon2,klev),rnebcon(klon2,klev),ratqs(klon2,klev) 96 REAL run_off_lic_0(klon2) 97 REAL masq(klon2) 66 98 c 67 99 INTEGER nid, nvarid, idim1, idim2, idim3 … … 75 107 CHARACTER*2 str2 76 108 c 109 REAL,SAVE,ALLOCATABLE :: rlat_mpi(:), rlon_mpi(:) 110 REAL,SAVE,ALLOCATABLE :: tsol_mpi(:,:) 111 REAL,SAVE,ALLOCATABLE :: tsoil_mpi(:,:,:) 112 REAL,SAVE,ALLOCATABLE :: tslab_mpi(:) 113 REAL,SAVE,ALLOCATABLE :: seaice_mpi(:) 114 REAL,SAVE,ALLOCATABLE :: qsurf_mpi(:,:) 115 REAL,SAVE,ALLOCATABLE :: qsol_mpi(:) 116 REAL,SAVE,ALLOCATABLE :: snow_mpi(:,:) 117 REAL,SAVE,ALLOCATABLE :: albedo_mpi(:,:) 118 REAL,SAVE,ALLOCATABLE :: alblw_mpi(:,:) 119 REAL,SAVE,ALLOCATABLE :: evap_mpi(:,:) 120 REAL,SAVE,ALLOCATABLE :: rain_fall_mpi(:) 121 REAL,SAVE,ALLOCATABLE :: snow_fall_mpi(:) 122 REAL,SAVE,ALLOCATABLE :: solsw_mpi(:) 123 REAL,SAVE,ALLOCATABLE :: sollw_mpi(:) 124 REAL,SAVE,ALLOCATABLE :: fder_mpi(:) 125 REAL,SAVE,ALLOCATABLE :: radsol_mpi(:) 126 REAL,SAVE,ALLOCATABLE :: frugs_mpi(:,:) 127 REAL,SAVE,ALLOCATABLE :: agesno_mpi(:,:) 128 REAL,SAVE,ALLOCATABLE :: zmea_mpi(:) 129 REAL,SAVE,ALLOCATABLE :: zstd_mpi(:) 130 REAL,SAVE,ALLOCATABLE :: zsig_mpi(:) 131 REAL,SAVE,ALLOCATABLE :: zgam_mpi(:) 132 REAL,SAVE,ALLOCATABLE :: zthe_mpi(:) 133 REAL,SAVE,ALLOCATABLE :: zpic_mpi(:) 134 REAL,SAVE,ALLOCATABLE :: zval_mpi(:) 135 REAL,SAVE,ALLOCATABLE :: rugsrel_mpi(:) 136 REAL,SAVE,ALLOCATABLE :: pctsrf_mpi(:, :) 137 REAL,SAVE,ALLOCATABLE :: t_ancien_mpi(:,:), q_ancien_mpi(:,:) 138 REAL,SAVE,ALLOCATABLE :: clwcon_mpi(:,:),rnebcon_mpi(:,:) 139 REAL,SAVE,ALLOCATABLE :: ratqs_mpi(:,:) 140 REAL,SAVE,ALLOCATABLE :: run_off_lic_0_mpi(:) 141 REAL,SAVE,ALLOCATABLE :: masq_mpi(:) 142 143 c$OMP MASTER 144 ALLOCATE( rlat_mpi(klon_mpi), rlon_mpi(klon_mpi)) 145 ALLOCATE( tsol_mpi(klon_mpi,nbsrf)) 146 ALLOCATE( tsoil_mpi(klon_mpi,nsoilmx,nbsrf)) 147 ALLOCATE( tslab_mpi(klon_mpi)) 148 ALLOCATE( seaice_mpi(klon_mpi)) 149 ALLOCATE( qsurf_mpi(klon_mpi,nbsrf)) 150 ALLOCATE( qsol_mpi(klon_mpi)) 151 ALLOCATE( snow_mpi(klon_mpi,nbsrf)) 152 ALLOCATE( albedo_mpi(klon_mpi,nbsrf)) 153 ALLOCATE( alblw_mpi(klon_mpi,nbsrf)) 154 ALLOCATE( evap_mpi(klon_mpi,nbsrf)) 155 ALLOCATE( rain_fall_mpi(klon_mpi)) 156 ALLOCATE( snow_fall_mpi(klon_mpi)) 157 ALLOCATE( solsw_mpi(klon_mpi)) 158 ALLOCATE( sollw_mpi(klon_mpi)) 159 ALLOCATE( fder_mpi(klon_mpi)) 160 ALLOCATE( radsol_mpi(klon_mpi)) 161 ALLOCATE( frugs_mpi(klon_mpi,nbsrf)) 162 ALLOCATE( agesno_mpi(klon_mpi,nbsrf)) 163 ALLOCATE( zmea_mpi(klon_mpi)) 164 ALLOCATE( zstd_mpi(klon_mpi)) 165 ALLOCATE( zsig_mpi(klon_mpi)) 166 ALLOCATE( zgam_mpi(klon_mpi)) 167 ALLOCATE( zthe_mpi(klon_mpi)) 168 ALLOCATE( zpic_mpi(klon_mpi)) 169 ALLOCATE( zval_mpi(klon_mpi)) 170 ALLOCATE( rugsrel_mpi(klon_mpi)) 171 ALLOCATE( pctsrf_mpi(klon_mpi, nbsrf)) 172 ALLOCATE( t_ancien_mpi(klon_mpi,klev)) 173 ALLOCATE( q_ancien_mpi(klon_mpi,klev)) 174 ALLOCATE( clwcon_mpi(klon_mpi,klev),rnebcon_mpi(klon_mpi,klev)) 175 ALLOCATE( ratqs_mpi(klon_mpi,klev)) 176 ALLOCATE( run_off_lic_0_mpi(klon_mpi)) 177 ALLOCATE( masq_mpi(klon_mpi)) 178 c$OMP END MASTER 179 c$OMP BARRIER 180 181 call GatherField_omp( rlat_p,rlat_mpi,1) 182 call GatherField_omp( rlon_p,rlon_mpi,1) 183 call GatherField_omp( tsol_p,tsol_mpi,nbsrf) 184 call GatherField_omp( tsoil_p,tsoil_mpi,nsoilmx*nbsrf) 185 call GatherField_omp( tslab_p,tslab_mpi,1) 186 call GatherField_omp( seaice_p,seaice_mpi,1) 187 call GatherField_omp( qsurf_p,qsurf_mpi,nbsrf) 188 call GatherField_omp( qsol_p,qsol_mpi,1) 189 call GatherField_omp( snow_p,snow_mpi,nbsrf) 190 call GatherField_omp( albedo_p,albedo_mpi,nbsrf) 191 call GatherField_omp( alblw_p,alblw_mpi,nbsrf) 192 call GatherField_omp( evap_p,evap_mpi,nbsrf) 193 call GatherField_omp( radsol_p,radsol_mpi,1) 194 call GatherField_omp( rain_fall_p,rain_fall_mpi,1) 195 call GatherField_omp( snow_fall_p,snow_fall_mpi,1) 196 call GatherField_omp( sollw_p,sollw_mpi,1) 197 call GatherField_omp( solsw_p,solsw_mpi,1) 198 call GatherField_omp( fder_p,fder_mpi,1) 199 call GatherField_omp( frugs_p,frugs_mpi,nbsrf) 200 call GatherField_omp( agesno_p,agesno_mpi,nbsrf) 201 call GatherField_omp( zmea_p,zmea_mpi,1) 202 call GatherField_omp( zstd_p,zstd_mpi,1) 203 call GatherField_omp( zsig_p,zsig_mpi,1) 204 call GatherField_omp( zgam_p,zgam_mpi,1) 205 call GatherField_omp( zthe_p,zthe_mpi,1) 206 call GatherField_omp( zpic_p,zpic_mpi,1) 207 call GatherField_omp( zval_p,zval_mpi,1) 208 call GatherField_omp( rugsrel_p,rugsrel_mpi,1) 209 call GatherField_omp( pctsrf_p,pctsrf_mpi, nbsrf) 210 call GatherField_omp( run_off_lic_0_p,run_off_lic_0_mpi,1) 211 call GatherField_omp( t_ancien_p,t_ancien_mpi,klev) 212 call GatherField_omp( q_ancien_p,q_ancien_mpi,klev) 213 call GatherField_omp( rnebcon_p,rnebcon_mpi,klev) 214 call GatherField_omp( clwcon_p,clwcon_mpi,klev) 215 call GatherField_omp( ratqs_p,ratqs_mpi,klev) 216 call GatherField_omp( zmasq,masq_mpi,1) 217 218 c$OMP MASTER 219 call GatherField( rlat_mpi,rlat,1) 220 call GatherField( rlon_mpi,rlon,1) 221 call GatherField( tsol_mpi,tsol,nbsrf) 222 call GatherField( tsoil_mpi,tsoil,nsoilmx*nbsrf) 223 call GatherField( tslab_mpi,tslab,1) 224 call GatherField( seaice_mpi,seaice,1) 225 call GatherField( qsurf_mpi,qsurf,nbsrf) 226 call GatherField( qsol_mpi,qsol,1) 227 call GatherField( snow_mpi,snow,nbsrf) 228 call GatherField( albedo_mpi,albedo,nbsrf) 229 call GatherField( alblw_mpi,alblw,nbsrf) 230 call GatherField( evap_mpi,evap,nbsrf) 231 call GatherField( radsol_mpi,radsol,1) 232 call GatherField( rain_fall_mpi,rain_fall,1) 233 call GatherField( snow_fall_mpi,snow_fall,1) 234 call GatherField( sollw_mpi,sollw,1) 235 call GatherField( solsw_mpi,solsw,1) 236 call GatherField( fder_mpi,fder,1) 237 call GatherField( frugs_mpi,frugs,nbsrf) 238 call GatherField( agesno_mpi,agesno,nbsrf) 239 call GatherField( zmea_mpi,zmea,1) 240 call GatherField( zstd_mpi,zstd,1) 241 call GatherField( zsig_mpi,zsig,1) 242 call GatherField( zgam_mpi,zgam,1) 243 call GatherField( zthe_mpi,zthe,1) 244 call GatherField( zpic_mpi,zpic,1) 245 call GatherField( zval_mpi,zval,1) 246 call GatherField( rugsrel_mpi,rugsrel,1) 247 call GatherField( pctsrf_mpi,pctsrf, nbsrf) 248 call GatherField( run_off_lic_0_mpi,run_off_lic_0,1) 249 call GatherField( t_ancien_mpi,t_ancien,klev) 250 call GatherField( q_ancien_mpi,q_ancien,klev) 251 call GatherField( rnebcon_mpi,rnebcon,klev) 252 call GatherField( clwcon_mpi,clwcon,klev) 253 call GatherField( ratqs_mpi,ratqs,klev) 254 call GatherField( masq_mpi,masq,1) 255 256 DEALLOCATE( rlat_mpi, rlon_mpi) 257 DEALLOCATE( tsol_mpi) 258 DEALLOCATE( tsoil_mpi) 259 DEALLOCATE( tslab_mpi) 260 DEALLOCATE( seaice_mpi) 261 DEALLOCATE( qsurf_mpi) 262 DEALLOCATE( qsol_mpi) 263 DEALLOCATE( snow_mpi) 264 DEALLOCATE( albedo_mpi) 265 DEALLOCATE( alblw_mpi) 266 DEALLOCATE( evap_mpi) 267 DEALLOCATE( rain_fall_mpi) 268 DEALLOCATE( snow_fall_mpi) 269 DEALLOCATE( solsw_mpi) 270 DEALLOCATE( sollw_mpi) 271 DEALLOCATE( fder_mpi) 272 DEALLOCATE( radsol_mpi) 273 DEALLOCATE( frugs_mpi) 274 DEALLOCATE( agesno_mpi) 275 DEALLOCATE( zmea_mpi) 276 DEALLOCATE( zstd_mpi) 277 DEALLOCATE( zsig_mpi) 278 DEALLOCATE( zgam_mpi) 279 DEALLOCATE( zthe_mpi) 280 DEALLOCATE( zpic_mpi) 281 DEALLOCATE( zval_mpi) 282 DEALLOCATE( rugsrel_mpi) 283 DEALLOCATE( pctsrf_mpi) 284 DEALLOCATE( t_ancien_mpi) 285 DEALLOCATE( q_ancien_mpi) 286 DEALLOCATE( clwcon_mpi,rnebcon_mpi) 287 DEALLOCATE( ratqs_mpi) 288 DEALLOCATE( run_off_lic_0_mpi) 289 DEALLOCATE( masq_mpi) 290 291 if (phy_rank==0) then 292 77 293 ierr = NF_CREATE(fichnom, NF_CLOBBER, nid) 78 294 IF (ierr.NE.NF_NOERR) THEN … … 86 302 c 87 303 ierr = NF_DEF_DIM (nid, "index", length, idim1) 88 ierr = NF_DEF_DIM (nid, "points_physiques", klon , idim2)89 ierr = NF_DEF_DIM (nid, "horizon_vertical", klon *klev, idim3)304 ierr = NF_DEF_DIM (nid, "points_physiques", klon2, idim2) 305 ierr = NF_DEF_DIM (nid, "horizon_vertical", klon2*klev, idim3) 90 306 c 91 307 ierr = NF_ENDDEF(nid) … … 168 384 ierr = NF_ENDDEF(nid) 169 385 #ifdef NC_DOUBLE 170 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid, zmasq)171 #else 172 ierr = NF_PUT_VAR_REAL (nid,nvarid, zmasq)386 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masq) 387 #else 388 ierr = NF_PUT_VAR_REAL (nid,nvarid,masq) 173 389 #endif 174 390 c BP ajout des fraction de chaque sous-surface … … 186 402 ierr = NF_ENDDEF(nid) 187 403 #ifdef NC_DOUBLE 188 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon , is_ter))189 #else 190 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon , is_ter))404 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_ter)) 405 #else 406 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_ter)) 191 407 #endif 192 408 C … … 203 419 ierr = NF_ENDDEF(nid) 204 420 #ifdef NC_DOUBLE 205 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon ,is_lic))206 #else 207 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon , is_lic))421 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2,is_lic)) 422 #else 423 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_lic)) 208 424 #endif 209 425 C … … 220 436 ierr = NF_ENDDEF(nid) 221 437 #ifdef NC_DOUBLE 222 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon , is_oce))223 #else 224 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon , is_oce))438 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_oce)) 439 #else 440 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_oce)) 225 441 #endif 226 442 C … … 237 453 ierr = NF_ENDDEF(nid) 238 454 #ifdef NC_DOUBLE 239 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon , is_sic))240 #else 241 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon , is_sic))455 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon2, is_sic)) 456 #else 457 ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon2, is_sic)) 242 458 #endif 243 459 C … … 547 763 #endif 548 764 c 765 endif 766 c$OMP END MASTER 767 cc ----> necessaire pour eviter bug openMP sur SX6 768 c$OMP MASTER 769 if (phy_rank==0) then 549 770 DO nsrf = 1, nbsrf 550 771 IF (nsrf.LE.99) THEN … … 799 1020 ierr = NF_CLOSE(nid) 800 1021 c 1022 endif ! phy_rank==0 1023 c$OMP END MASTER 801 1024 RETURN 802 1025 END
Note: See TracChangeset
for help on using the changeset viewer.