Changeset 1660
- Timestamp:
- 02/17/12 11:27:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/flincom.f90
r1378 r1660 9 9 !- 10 10 USE calendar, ONLY : ju2ymds, ymds2ju, ioconf_calendar 11 USE errioipsl, ONLY : histerr, ipslout 11 USE errioipsl, ONLY : histerr, ipslout,ipslerr,ipsldbg 12 12 USE stringop, ONLY : strlowercase 13 13 !- … … 175 175 CHARACTER(LEN=250):: name 176 176 !- 177 LOGICAL :: check = .FALSE. 178 !--------------------------------------------------------------------- 177 LOGICAL :: l_dbg 178 !--------------------------------------------------------------------- 179 CALL ipsldbg (old_status=l_dbg) 180 179 181 lll = LEN_TRIM(filename) 180 182 IF (filename(lll-2:lll) /= '.nc') THEN … … 193 195 ! Vertical axis 194 196 !- 195 IF ( check) WRITE(ipslout,*) 'flincre Vertical axis'197 IF (l_dbg) WRITE(ipslout,*) 'flincre Vertical axis' 196 198 !- 197 199 iret = NF90_DEF_VAR (fid, 'lev', NF90_FLOAT, zdimid1, levid) … … 202 204 ! Time axis 203 205 !- 204 IF ( check) WRITE(ipslout,*) 'flincre time axis'206 IF (l_dbg) WRITE(ipslout,*) 'flincre time axis' 205 207 !- 206 208 iret = NF90_DEF_VAR (fid, 'tstep', NF90_FLOAT, tdimid1, timeid) … … 211 213 ! The longitude 212 214 !- 213 IF ( check) WRITE(ipslout,*) 'flincre Longitude axis'215 IF (l_dbg) WRITE(ipslout,*) 'flincre Longitude axis' 214 216 !- 215 217 iret = NF90_DEF_VAR (fid, "nav_lon", NF90_FLOAT, & … … 226 228 ! The Latitude 227 229 !- 228 IF ( check) WRITE(ipslout,*) 'flincre Latitude axis'230 IF (l_dbg) WRITE(ipslout,*) 'flincre Latitude axis' 229 231 !- 230 232 iret = NF90_DEF_VAR (fid, "nav_lat", NF90_FLOAT, & … … 253 255 iret = NF90_ENDDEF (fid) 254 256 !- 255 IF ( check) WRITE(ipslout,*) 'flincre Variable'257 IF (l_dbg) WRITE(ipslout,*) 'flincre Variable' 256 258 !- 257 259 iret = NF90_PUT_VAR (fid, levid, lev1(1:llm1)) 258 260 !- 259 IF ( check) WRITE(ipslout,*) 'flincre Time Variable'261 IF (l_dbg) WRITE(ipslout,*) 'flincre Time Variable' 260 262 !- 261 263 iret = NF90_PUT_VAR (fid, timeid, REAL(itaus(1:ttm1))) 262 264 !- 263 IF ( check) WRITE(ipslout,*) 'flincre Longitude'265 IF (l_dbg) WRITE(ipslout,*) 'flincre Longitude' 264 266 !- 265 267 iret = NF90_PUT_VAR (fid, lonid, lon1(1:iim1,1:jjm1)) 266 268 !- 267 IF ( check) WRITE(ipslout,*) 'flincre Latitude'269 IF (l_dbg) WRITE(ipslout,*) 'flincre Latitude' 268 270 !- 269 271 iret = NF90_PUT_VAR (fid, latid, lat1(1:iim1,1:jjm1)) … … 311 313 INTEGER :: fid_out 312 314 !- 313 LOGICAL :: check = .FALSE. 314 !--------------------------------------------------------------------- 315 IF (check) WRITE (*,*) ' iideb, iilen, jjdeb, jjlen, iim, jjm ', & 315 LOGICAL :: l_dbg 316 !--------------------------------------------------------------------- 317 CALL ipsldbg (old_status=l_dbg) 318 319 IF (l_dbg) WRITE (*,*) ' iideb, iilen, jjdeb, jjlen, iim, jjm ', & 316 320 iideb, iilen, jjdeb, jjlen, iim, jjm 317 IF ( check) WRITE (*,*) ' lon ', lon(1,1), lon(iilen,jjlen)318 IF ( check) WRITE (*,*) ' lat ', lat(1,1), lat(iilen,jjlen)321 IF (l_dbg) WRITE (*,*) ' lon ', lon(1,1), lon(iilen,jjlen) 322 IF (l_dbg) WRITE (*,*) ' lat ', lat(1,1), lat(iilen,jjlen) 319 323 !- 320 324 CALL flinopen_work & … … 388 392 !- 389 393 LOGICAL :: open_file 390 LOGICAL :: check = .FALSE. 391 !--------------------------------------------------------------------- 394 LOGICAL :: l_dbg 395 !--------------------------------------------------------------------- 396 CALL ipsldbg (old_status=l_dbg) 397 392 398 iilast = iideb+iilen-1 393 399 jjlast = jjdeb+jjlen-1 394 IF ( check) WRITE (*,*) &400 IF (l_dbg) WRITE (*,*) & 395 401 ' flinopen_work zoom 2D information '// & 396 402 ' iideb, iilen, iilast, jjdeb, jjlen, jjlast ', & … … 422 428 ENDIF 423 429 !- 424 IF ( check) &430 IF (l_dbg) & 425 431 WRITE(ipslout,*) 'OUT OF flininfo :',tmp_iim,tmp_jjm,tmp_llm,tmp_ttm 426 432 !- … … 432 438 ! 2.2 We test the axis if we have to. 433 439 !- 434 IF ( check) &440 IF (l_dbg) & 435 441 WRITE(ipslout,*) 'flininfo 2.2 We test if we have to test : ',do_test 436 442 !- … … 453 459 !-- 2.3 Else the sizes of the axes are returned to the user 454 460 !--- 455 IF ( check) WRITE(ipslout,*) 'flinopen 2.3 Else sizes are returned'461 IF (l_dbg) WRITE(ipslout,*) 'flinopen 2.3 Else sizes are returned' 456 462 !--- 457 463 iim = tmp_iim … … 465 471 ! if not then we get the lon, lat and lev variables from the file 466 472 !- 467 IF ( check) WRITE(ipslout,*) 'flinopen 3.0 we are realy talking'473 IF (l_dbg) WRITE(ipslout,*) 'flinopen 3.0 we are realy talking' 468 474 !- 469 475 IF (do_test) THEN … … 473 479 iret = NF90_GET_VAR (fid, vid, x_last, start=(/ iilast, jjlast /)) 474 480 !--- 475 IF ( check) &481 IF (l_dbg) & 476 482 WRITE(ipslout,*) 'from file lon first and last, modulo 360. ', & 477 483 x_first, x_last, MODULO(x_first,360.), MODULO(x_last,360.) 478 IF ( check) &484 IF (l_dbg) & 479 485 WRITE(ipslout,*) 'from model lon first and last, modulo 360. ', & 480 486 lon(1,1),lon(iilen,jjlen), & … … 494 500 iret = NF90_GET_VAR (fid, vid, x_last, start=(/ iilast, jjlast /)) 495 501 !--- 496 IF ( check) WRITE(ipslout,*) &502 IF (l_dbg) WRITE(ipslout,*) & 497 503 'from file lat first and last ',x_first,x_last 498 IF ( check) WRITE(ipslout,*) &504 IF (l_dbg) WRITE(ipslout,*) & 499 505 'from model lat first and last ',lat(1,1),lat(iilen,jjlen) 500 506 !--- … … 512 518 iret = NF90_GET_VAR (fid, vid, x_last, start=(/ llm /)) 513 519 !----- 514 IF ( check) WRITE(ipslout,*) &520 IF (l_dbg) WRITE(ipslout,*) & 515 521 'from file lev first and last ',x_first ,x_last 516 IF ( check) WRITE(ipslout,*) &522 IF (l_dbg) WRITE(ipslout,*) & 517 523 'from model lev first and last ',lev(1),lev(llm) 518 524 !----- … … 530 536 !-- 4.0 extracting the coordinates if we do not check 531 537 !--- 532 IF ( check) WRITE(ipslout,*) 'flinopen 4.0 extracting the coordinates'538 IF (l_dbg) WRITE(ipslout,*) 'flinopen 4.0 extracting the coordinates' 533 539 !--- 534 540 CALL flinfindcood (fid_out, 'lon', vid, nbdim) … … 575 581 ! 5.0 Get all the details for the time if possible needed 576 582 !- 577 IF ( check) WRITE(ipslout,*) 'flinopen 5.0 Get time'583 IF (l_dbg) WRITE(ipslout,*) 'flinopen 5.0 Get time' 578 584 !- 579 585 IF (ttm > 0) THEN … … 609 615 DEALLOCATE(vec_tmp) 610 616 !--- 611 IF ( check) WRITE(ipslout,*) 'flinopen 5.1 Times ',itaus617 IF (l_dbg) WRITE(ipslout,*) 'flinopen 5.1 Times ',itaus 612 618 !--- 613 619 !-- Getting all the details for the time axis … … 629 635 sec0 = hours0*3600. + minutes0*60. + seci 630 636 CALL ymds2ju (year0, month0, day0, sec0, date0) 631 IF ( check) &637 IF (l_dbg) & 632 638 WRITE(ipslout,*) 'flinopen 5.1 gdtt_id year0 ... date0 ', & 633 639 year0, month0, day0, sec0, date0 … … 642 648 CALL ymds2ju (year0, month0, day0, sec0, date0) 643 649 !----- 644 IF ( check) &650 IF (l_dbg) & 645 651 WRITE(ipslout,*) 'flinopen 5.1 gdtmaf_id year0 ... date0 ', & 646 652 year0, month0, day0, sec0, date0 … … 660 666 ENDIF 661 667 !- 662 IF ( check) WRITE(ipslout,*) 'flinopen 6.0 File opened', date0, dt668 IF (l_dbg) WRITE(ipslout,*) 'flinopen 6.0 File opened', date0, dt 663 669 !--------------------------- 664 670 END SUBROUTINE flinopen_work … … 688 694 CHARACTER(LEN=30) :: axname 689 695 !- 690 LOGICAL :: check = .FALSE. 691 !--------------------------------------------------------------------- 696 LOGICAL :: l_dbg 697 !--------------------------------------------------------------------- 698 CALL ipsldbg (old_status=l_dbg) 699 692 700 lll = LEN_TRIM(filename) 693 701 IF (filename(lll-2:lll) /= '.nc') THEN … … 716 724 axname = ADJUSTL(axname) 717 725 !--- 718 IF ( check) WRITE(ipslout,*) &726 IF (l_dbg) WRITE(ipslout,*) & 719 727 'flininfo - getting axname',iv,axname,lll 720 728 !--- … … 778 786 !- 779 787 INTEGER :: fid, ncvarid, ndim, iret 780 LOGICAL :: check = .FALSE. 781 !--------------------------------------------------------------------- 782 IF (check) WRITE(ipslout,*) & 788 LOGICAL :: l_dbg 789 !--------------------------------------------------------------------- 790 CALL ipsldbg (old_status=l_dbg) 791 792 IF (l_dbg) WRITE(ipslout,*) & 783 793 "flinput_r1d : SIZE(var) = ",SIZE(var) 784 794 !- … … 805 815 !- 806 816 INTEGER :: fid, ncvarid, ndim, iret 807 LOGICAL :: check = .FALSE. 808 !--------------------------------------------------------------------- 809 IF (check) WRITE(ipslout,*) & 817 LOGICAL :: l_dbg 818 !--------------------------------------------------------------------- 819 CALL ipsldbg (old_status=l_dbg) 820 821 IF (l_dbg) WRITE(ipslout,*) & 810 822 "flinput_r2d : SIZE(var) = ",SIZE(var) 811 823 !- … … 832 844 !- 833 845 INTEGER :: fid, ncvarid, ndim, iret 834 LOGICAL :: check = .FALSE. 835 !--------------------------------------------------------------------- 836 IF (check) WRITE(ipslout,*) & 846 LOGICAL :: l_dbg 847 !--------------------------------------------------------------------- 848 CALL ipsldbg (old_status=l_dbg) 849 850 IF (l_dbg) WRITE(ipslout,*) & 837 851 "flinput_r3d : SIZE(var) = ",SIZE(var) 838 852 !- … … 859 873 !- 860 874 INTEGER :: fid, ncvarid, ndim, iret 861 LOGICAL :: check = .FALSE. 862 !--------------------------------------------------------------------- 863 IF (check) WRITE(ipslout,*) & 875 LOGICAL :: l_dbg 876 !--------------------------------------------------------------------- 877 CALL ipsldbg (old_status=l_dbg) 878 879 IF (l_dbg) WRITE(ipslout,*) & 864 880 "flinput_r4d : SIZE(var) = ",SIZE(var) 865 881 !- … … 958 974 INTEGER :: jl, ji 959 975 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 960 LOGICAL :: check = .FALSE. 961 !--------------------------------------------------------------------- 976 LOGICAL :: l_dbg 977 !--------------------------------------------------------------------- 978 CALL ipsldbg (old_status=l_dbg) 979 962 980 IF (.NOT.ALLOCATED(buff_tmp)) THEN 963 IF ( check) WRITE(ipslout,*) &981 IF (l_dbg) WRITE(ipslout,*) & 964 982 "flinget_r1d : allocate buff_tmp for buff_sz = ",SIZE(var) 965 983 ALLOCATE (buff_tmp(SIZE(var))) 966 984 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 967 IF ( check) WRITE(ipslout,*) &985 IF (l_dbg) WRITE(ipslout,*) & 968 986 "flinget_r1d : re-allocate buff_tmp for buff_sz = ",SIZE(var) 969 987 DEALLOCATE (buff_tmp) … … 996 1014 INTEGER :: jl, jj, ji 997 1015 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 998 LOGICAL :: check = .FALSE. 999 !--------------------------------------------------------------------- 1016 LOGICAL :: l_dbg 1017 !--------------------------------------------------------------------- 1018 CALL ipsldbg (old_status=l_dbg) 1019 1000 1020 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1001 IF ( check) WRITE(ipslout,*) &1021 IF (l_dbg) WRITE(ipslout,*) & 1002 1022 "flinget_r2d : allocate buff_tmp for buff_sz = ",SIZE(var) 1003 1023 ALLOCATE (buff_tmp(SIZE(var))) 1004 1024 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1005 IF ( check) WRITE(ipslout,*) &1025 IF (l_dbg) WRITE(ipslout,*) & 1006 1026 "flinget_r2d : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1007 1027 DEALLOCATE (buff_tmp) … … 1037 1057 INTEGER :: jl, jj, ji 1038 1058 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 1039 LOGICAL :: check = .FALSE. 1040 !--------------------------------------------------------------------- 1059 LOGICAL :: l_dbg 1060 !--------------------------------------------------------------------- 1061 CALL ipsldbg (old_status=l_dbg) 1062 1041 1063 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1042 IF ( check) WRITE(ipslout,*) &1064 IF (l_dbg) WRITE(ipslout,*) & 1043 1065 "flinget_r2d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var) 1044 1066 ALLOCATE (buff_tmp(SIZE(var))) 1045 1067 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1046 IF ( check) WRITE(ipslout,*) &1068 IF (l_dbg) WRITE(ipslout,*) & 1047 1069 "flinget_r2d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1048 1070 DEALLOCATE (buff_tmp) … … 1077 1099 INTEGER :: jl, jk, jj, ji 1078 1100 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 1079 LOGICAL :: check = .FALSE. 1080 !--------------------------------------------------------------------- 1101 LOGICAL :: l_dbg 1102 !--------------------------------------------------------------------- 1103 CALL ipsldbg (old_status=l_dbg) 1104 1081 1105 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1082 IF ( check) WRITE(ipslout,*) &1106 IF (l_dbg) WRITE(ipslout,*) & 1083 1107 "flinget_r3d : allocate buff_tmp for buff_sz = ",SIZE(var) 1084 1108 ALLOCATE (buff_tmp(SIZE(var))) 1085 1109 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1086 IF ( check) WRITE(ipslout,*) &1110 IF (l_dbg) WRITE(ipslout,*) & 1087 1111 "flinget_r3d : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1088 1112 DEALLOCATE (buff_tmp) … … 1120 1144 INTEGER :: jl, jk, jj, ji 1121 1145 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 1122 LOGICAL :: check = .FALSE. 1123 !--------------------------------------------------------------------- 1146 LOGICAL :: l_dbg 1147 !--------------------------------------------------------------------- 1148 CALL ipsldbg (old_status=l_dbg) 1149 1124 1150 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1125 IF ( check) WRITE(ipslout,*) &1151 IF (l_dbg) WRITE(ipslout,*) & 1126 1152 "flinget_r3d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var) 1127 1153 ALLOCATE (buff_tmp(SIZE(var))) 1128 1154 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1129 IF ( check) WRITE(ipslout,*) &1155 IF (l_dbg) WRITE(ipslout,*) & 1130 1156 "flinget_r3d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1131 1157 DEALLOCATE (buff_tmp) … … 1162 1188 INTEGER :: jl, jk, jj, ji, jm 1163 1189 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 1164 LOGICAL :: check = .FALSE. 1165 !--------------------------------------------------------------------- 1190 LOGICAL :: l_dbg 1191 !--------------------------------------------------------------------- 1192 CALL ipsldbg (old_status=l_dbg) 1193 1166 1194 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1167 IF ( check) WRITE(ipslout,*) &1195 IF (l_dbg) WRITE(ipslout,*) & 1168 1196 "flinget_r4d : allocate buff_tmp for buff_sz = ",SIZE(var) 1169 1197 ALLOCATE (buff_tmp(SIZE(var))) 1170 1198 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1171 IF ( check) WRITE(ipslout,*) &1199 IF (l_dbg) WRITE(ipslout,*) & 1172 1200 "flinget_r4d : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1173 1201 DEALLOCATE (buff_tmp) … … 1207 1235 INTEGER :: jl, jk, jj, ji, jm 1208 1236 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: buff_tmp 1209 LOGICAL :: check = .FALSE. 1210 !--------------------------------------------------------------------- 1237 LOGICAL :: l_dbg 1238 !--------------------------------------------------------------------- 1239 CALL ipsldbg (old_status=l_dbg) 1240 1211 1241 IF (.NOT.ALLOCATED(buff_tmp)) THEN 1212 IF ( check) WRITE(ipslout,*) &1242 IF (l_dbg) WRITE(ipslout,*) & 1213 1243 "flinget_r4d_zoom : allocate buff_tmp for buff_sz = ",SIZE(var) 1214 1244 ALLOCATE (buff_tmp(SIZE(var))) 1215 1245 ELSE IF (SIZE(var) > SIZE(buff_tmp)) THEN 1216 IF ( check) WRITE(ipslout,*) &1246 IF (l_dbg) WRITE(ipslout,*) & 1217 1247 "flinget_r4d_zoom : re-allocate buff_tmp for buff_sz = ",SIZE(var) 1218 1248 DEALLOCATE (buff_tmp) … … 1283 1313 ! ARGUMENTS 1284 1314 !- 1285 INTEGER :: fid_in1286 CHARACTER(LEN=*) :: varname1287 INTEGER :: iim, jjm, llm, ttm1288 INTEGER :: itau_dep, itau_fin, iideb, iilen, jjdeb, jjlen1289 REAL :: var(:)1315 INTEGER, INTENT(IN) :: fid_in 1316 CHARACTER(LEN=*), INTENT(IN) :: varname 1317 INTEGER, INTENT(IN) :: iim, jjm, llm, ttm 1318 INTEGER, INTENT(IN) :: itau_dep, itau_fin, iideb, iilen, jjdeb, jjlen 1319 REAL, INTENT(OUT) :: var(:) 1290 1320 !- 1291 1321 ! LOCAL … … 1303 1333 INTEGER :: i, nvars, i2d, cnd 1304 1334 REAL,DIMENSION(:),ALLOCATABLE,SAVE :: var_tmp 1335 INTEGER :: itau_len 1305 1336 LOGICAL :: uncompress = .FALSE. 1306 LOGICAL :: check = .FALSE. 1307 !--------------------------------------------------------------------- 1337 INTEGER :: il, ip, i2p, it 1338 !- 1339 LOGICAL :: l_dbg 1340 !--------------------------------------------------------------------- 1341 CALL ipsldbg (old_status=l_dbg) 1342 !- 1308 1343 fid = ncids(fid_in) 1309 1344 !- 1310 IF ( check) THEN1345 IF (l_dbg) THEN 1311 1346 WRITE(ipslout,*) & 1312 1347 'flinget_mat : fid_in, fid, varname :', fid_in, fid, TRIM(varname) … … 1335 1370 iret = NF90_INQUIRE_VARIABLE (fid, vid, & 1336 1371 ndims=ndims, dimids=dimids, nAtts=nb_atts) 1337 IF ( check) THEN1372 IF (l_dbg) THEN 1338 1373 WRITE(ipslout,*) & 1339 1374 'flinget_mat : fid, vid :', fid, vid … … 1347 1382 iret = NF90_INQUIRE_DIMENSION (fid, dimids(i), len=w_dim(i)) 1348 1383 ENDDO 1349 IF ( check) WRITE(ipslout,*) &1384 IF (l_dbg) WRITE(ipslout,*) & 1350 1385 'flinget_mat : w_dim :', w_dim(1:ndims) 1351 1386 !- … … 1353 1388 !- 1354 1389 IF (nb_atts > 0) THEN 1355 IF (check) THEN1390 IF (l_dbg) THEN 1356 1391 WRITE(ipslout,*) 'flinget_mat : attributes for variable :' 1357 1392 ENDIF … … 1364 1399 .OR.(x_typ == NF90_BYTE) ) THEN 1365 1400 iret = NF90_GET_ATT (fid, vid, att_n, tmp_i) 1366 IF (check) THEN1401 IF (l_dbg) THEN 1367 1402 WRITE(ipslout,*) ' ',TRIM(att_n),' : ',tmp_i 1368 1403 ENDIF 1369 1404 ELSE IF ( (x_typ == NF90_FLOAT).OR.(x_typ == NF90_DOUBLE) ) THEN 1370 1405 iret = NF90_GET_ATT (fid, vid, att_n, tmp_r) 1371 IF (check) THEN1406 IF (l_dbg) THEN 1372 1407 WRITE(ipslout,*) ' ',TRIM(att_n),' : ',tmp_r 1373 1408 ENDIF … … 1378 1413 tmp_n = '' 1379 1414 iret = NF90_GET_ATT (fid, vid, att_n, tmp_n) 1380 IF (check) THEN1415 IF (l_dbg) THEN 1381 1416 WRITE(ipslout,*) ' ',TRIM(att_n),' : ',TRIM(tmp_n) 1382 1417 ENDIF … … 1402 1437 iret = NF90_INQ_VARID (fid, tmp_n, cvid) 1403 1438 !--- 1404 IF ( check) WRITE(ipslout,*) &1439 IF (l_dbg) WRITE(ipslout,*) & 1405 1440 'Dimname, iret , NF90_NOERR : ',TRIM(tmp_n),iret,NF90_NOERR 1406 1441 !--- … … 1559 1594 ! 3.0 Reading the data 1560 1595 !- 1561 IF ( check) WRITE(ipslout,*) &1596 IF (l_dbg) WRITE(ipslout,*) & 1562 1597 'flinget_mat 3.0 : ', uncompress, w_sta, w_len 1563 1598 !--- 1599 var(:) = mis_v 1564 1600 IF (uncompress) THEN 1565 1601 !--- 1566 1602 IF (ALLOCATED(var_tmp)) THEN 1567 IF (SIZE(var_tmp) < clen) THEN1568 DEALLOCATE(var_tmp)1569 ALLOCATE(var_tmp(clen))1603 IF (SIZE(var_tmp) < PRODUCT(w_len(:),mask=(w_len>1))) THEN 1604 DEALLOCATE(var_tmp) 1605 ALLOCATE(var_tmp(PRODUCT(w_len(:),mask=(w_len>1)))) 1570 1606 ENDIF 1571 1607 ELSE 1572 ALLOCATE(var_tmp( clen))1608 ALLOCATE(var_tmp(PRODUCT(w_len(:),mask=(w_len>1)))) 1573 1609 ENDIF 1574 1610 !--- … … 1576 1612 start=w_sta(:), count=w_len(:)) 1577 1613 !--- 1614 itau_len=itau_fin-itau_dep+1 1615 IF (l_dbg) WRITE(ipslout,*) 'flinget_mat 3.0 : clen, itau_len ',clen,itau_len 1578 1616 var(:) = mis_v 1579 var(cindex(:)) = var_tmp(:) 1617 IF (itau_len > 0) THEN 1618 DO it=1,itau_len 1619 DO il=1,clen 1620 ip = il + (it-1)*clen 1621 i2p = cindex(il)+(it-1)*iim*jjm 1622 var(i2p) = var_tmp(ip) 1623 ENDDO 1624 ENDDO 1625 ELSE 1626 var(cindex(:)) = var_tmp(:) 1627 ENDIF 1580 1628 !--- 1581 1629 ELSE … … 1584 1632 ENDIF 1585 1633 !- 1586 IF ( check) WRITE(ipslout,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret)1634 IF (l_dbg) WRITE(ipslout,*) 'flinget_mat 3.1 : ',NF90_STRERROR (iret) 1587 1635 !-------------------------- 1588 1636 END SUBROUTINE flinget_mat … … 1632 1680 INTEGER :: iret, fid 1633 1681 !- 1634 LOGICAL :: check = .FALSE. 1635 !--------------------------------------------------------------------- 1636 IF (check) THEN 1682 LOGICAL :: l_dbg 1683 !--------------------------------------------------------------------- 1684 CALL ipsldbg (old_status=l_dbg) 1685 1686 IF (l_dbg) THEN 1637 1687 WRITE (*,*) 'flinget_scal in file with id ',fid_in 1638 1688 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.