Changeset 1725 for trunk/LMDZ.GENERIC/libf/phystd
- Timestamp:
- Jul 21, 2017, 5:30:44 PM (7 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/optci.F90
r1715 r1725 64 64 real*8 KCOEF(4) 65 65 integer NVAR(L_LEVELS) 66 67 ! temporary variables to reduce memory access time to gasi 68 real*8 tmpk(2,2) 69 real*8 tmpkvar(2,2,2) 66 70 67 71 ! temporary variables for multiple aerosol calculation … … 235 239 236 240 if(L_REFVAR.eq.1)then ! added by RW for special no variable case 237 KCOEF(1) = GASI(MT(K),MP(K),1,NW,NG) 238 KCOEF(2) = GASI(MT(K),MP(K)+1,1,NW,NG) 239 KCOEF(3) = GASI(MT(K)+1,MP(K)+1,1,NW,NG) 240 KCOEF(4) = GASI(MT(K)+1,MP(K),1,NW,NG) 241 242 ! JVO 2017 : added tmpk because the repeated calls to gasi/v increased dramatically 243 ! the execution time of optci/v -> ~ factor 2 on the whole radiative 244 ! transfer on the tested simulations ! 245 246 tmpk = GASI(MT(K):MT(K)+1,MP(K):MP(K)+1,1,NW,NG) 247 248 KCOEF(1) = tmpk(1,1) ! KCOEF(1) = GASI(MT(K),MP(K),1,NW,NG) 249 KCOEF(2) = tmpk(1,2) ! KCOEF(2) = GASI(MT(K),MP(K)+1,1,NW,NG) 250 KCOEF(3) = tmpk(2,2) ! KCOEF(3) = GASI(MT(K)+1,MP(K)+1,1,NW,NG) 251 KCOEF(4) = tmpk(2,1) ! KCOEF(4) = GASI(MT(K)+1,MP(K),1,NW,NG) 252 241 253 else 242 254 243 KCOEF(1) = GASI(MT(K),MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 244 (GASI(MT(K),MP(K),NVAR(K)+1,NW,NG) - & 245 GASI(MT(K),MP(K),NVAR(K),NW,NG)) 246 247 KCOEF(2) = GASI(MT(K),MP(K)+1,NVAR(K),NW,NG) + WRATIO(K)* & 248 (GASI(MT(K),MP(K)+1,NVAR(K)+1,NW,NG) - & 249 GASI(MT(K),MP(K)+1,NVAR(K),NW,NG)) 250 251 KCOEF(3) = GASI(MT(K)+1,MP(K)+1,NVAR(K),NW,NG) + WRATIO(K)* & 252 (GASI(MT(K)+1,MP(K)+1,NVAR(K)+1,NW,NG) - & 253 GASI(MT(K)+1,MP(K)+1,NVAR(K),NW,NG)) 254 255 KCOEF(4) = GASI(MT(K)+1,MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 256 (GASI(MT(K)+1,MP(K),NVAR(K)+1,NW,NG) - & 257 GASI(MT(K)+1,MP(K),NVAR(K),NW,NG)) 255 tmpkvar = GASI(MT(K):MT(K)+1,MP(K):MP(K)+1,NVAR(K):NVAR(K)+1,NW,NG) 256 257 KCOEF(1) = tmpkvar(1,1,1) + WRATIO(K) * & 258 ( tmpkvar(1,1,2)-tmpkvar(1,1,1) ) 259 260 KCOEF(2) = tmpkvar(1,2,1) + WRATIO(K) * & 261 ( tmpkvar(1,2,2)-tmpkvar(1,2,1) ) 262 263 KCOEF(3) = tmpkvar(2,2,1) + WRATIO(K) * & 264 ( tmpkvar(2,2,2)-tmpkvar(2,2,1) ) 265 266 KCOEF(4) = tmpkvar(2,1,1) + WRATIO(K) * & 267 ( tmpkvar(2,1,2)-tmpkvar(2,1,1) ) 258 268 259 269 endif -
trunk/LMDZ.GENERIC/libf/phystd/optcv.F90
r1722 r1725 73 73 real*8 KCOEF(4) 74 74 integer NVAR(L_LEVELS) 75 76 ! temporary variables to reduce memory access time to gasv 77 real*8 tmpk(2,2) 78 real*8 tmpkvar(2,2,2) 75 79 76 80 ! temporary variables for multiple aerosol calculation … … 226 230 227 231 if(L_REFVAR.eq.1)then ! added by RW for special no variable case 228 KCOEF(1) = GASV(MT(K),MP(K),1,NW,NG) 229 KCOEF(2) = GASV(MT(K),MP(K)+1,1,NW,NG) 230 KCOEF(3) = GASV(MT(K)+1,MP(K)+1,1,NW,NG) 231 KCOEF(4) = GASV(MT(K)+1,MP(K),1,NW,NG) 232 233 ! JVO 2017 : added tmpk because the repeated calls to gasi/v increased dramatically 234 ! the execution time of optci/v -> ~ factor 2 on the whole radiative 235 ! transfer on the tested simulations ! 236 237 tmpk = GASV(MT(K):MT(K)+1,MP(K):MP(K)+1,1,NW,NG) 238 239 KCOEF(1) = tmpk(1,1) ! KCOEF(1) = GASV(MT(K),MP(K),1,NW,NG) 240 KCOEF(2) = tmpk(1,2) ! KCOEF(2) = GASV(MT(K),MP(K)+1,1,NW,NG) 241 KCOEF(3) = tmpk(2,2) ! KCOEF(3) = GASV(MT(K)+1,MP(K)+1,1,NW,NG) 242 KCOEF(4) = tmpk(2,1) ! KCOEF(4) = GASV(MT(K)+1,MP(K),1,NW,NG) 243 232 244 else 233 245 234 KCOEF(1) = GASV(MT(K),MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 235 (GASV(MT(K),MP(K),NVAR(K)+1,NW,NG) - & 236 GASV(MT(K),MP(K),NVAR(K),NW,NG)) 237 238 KCOEF(2) = GASV(MT(K),MP(K)+1,NVAR(K),NW,NG) + WRATIO(K)* & 239 (GASV(MT(K),MP(K)+1,NVAR(K)+1,NW,NG) - & 240 GASV(MT(K),MP(K)+1,NVAR(K),NW,NG)) 241 242 KCOEF(3) = GASV(MT(K)+1,MP(K)+1,NVAR(K),NW,NG) + WRATIO(K)*& 243 (GASV(MT(K)+1,MP(K)+1,NVAR(K)+1,NW,NG) - & 244 GASV(MT(K)+1,MP(K)+1,NVAR(K),NW,NG)) 245 246 KCOEF(4) = GASV(MT(K)+1,MP(K),NVAR(K),NW,NG) + WRATIO(K)* & 247 (GASV(MT(K)+1,MP(K),NVAR(K)+1,NW,NG) - & 248 GASV(MT(K)+1,MP(K),NVAR(K),NW,NG)) 246 tmpkvar = GASV(MT(K):MT(K)+1,MP(K):MP(K)+1,NVAR(K):NVAR(K)+1,NW,NG) 247 248 KCOEF(1) = tmpkvar(1,1,1) + WRATIO(K) * & 249 ( tmpkvar(1,1,2)-tmpkvar(1,1,1) ) 250 251 KCOEF(2) = tmpkvar(1,2,1) + WRATIO(K) * & 252 ( tmpkvar(1,2,2)-tmpkvar(1,2,1) ) 253 254 KCOEF(3) = tmpkvar(2,2,1) + WRATIO(K) * & 255 ( tmpkvar(2,2,2)-tmpkvar(2,2,1) ) 256 257 KCOEF(4) = tmpkvar(2,1,1) + WRATIO(K) * & 258 ( tmpkvar(2,1,2)-tmpkvar(2,1,1) ) 259 249 260 250 261 endif
Note: See TracChangeset
for help on using the changeset viewer.