Changeset 1023 for IOIPSL/trunk
- Timestamp:
- 05/18/10 12:27:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/histcom.f90
r1011 r1023 104 104 LOGICAL :: hist_calc_rng=.FALSE.,hist_wrt_rng=.FALSE. 105 105 !-Book keeping of the axes 106 INTEGER :: tdimid,tax_last 106 INTEGER :: tdimid,tbndid=-1,tax_last 107 LOGICAL :: l_bnd 107 108 CHARACTER(LEN=40) :: tax_name 108 109 !- … … 127 128 !-Counter of elements (variables, time-horizontal-vertical axis 128 129 INTEGER :: n_var=0,n_tax=0,n_hax=0,n_zax=0 129 !-NETCDF dimension IDs for time- longitude-latitude130 INTEGER :: tid, xid,yid130 !-NETCDF dimension IDs for time-[time_bounds]-longitude-latitude 131 INTEGER :: tid,bid,xid,yid 131 132 !-General definitions in the NETCDF file 132 133 INTEGER,DIMENSION(2) :: full_size=0,slab_ori,slab_siz … … 1321 1322 IF (pos < 0) THEN 1322 1323 W_F(idf)%n_tax = W_F(idf)%n_tax+1 1324 W_F(idf)%W_V(iv)%l_bnd = & 1325 & (TRIM(W_F(idf)%W_V(iv)%topp) /= 'inst') 1323 1326 W_F(idf)%W_V(W_F(idf)%n_tax)%tax_name = str40 1324 1327 W_F(idf)%W_V(W_F(idf)%n_tax)%tax_last = 0 … … 1367 1370 REAL :: rtime0 1368 1371 CHARACTER(LEN=30) :: str30 1372 CHARACTER(LEN=35) :: str35 1369 1373 CHARACTER(LEN=120) :: assoc 1370 1374 CHARACTER(LEN=70) :: str70 … … 1373 1377 & 'JUL','AUG','SEP','OCT','NOV','DEC' /) 1374 1378 CHARACTER(LEN=7) :: tmp_opp 1379 LOGICAL :: l_b 1375 1380 LOGICAL :: l_dbg 1376 1381 !--------------------------------------------------------------------- … … 1382 1387 !- 1383 1388 IF (l_dbg) WRITE(*,*) "histend : 1.0" 1384 !--- 1389 !- 1390 ! 1.1 Define the time dimensions needed for this file 1391 !- 1385 1392 iret = NF90_DEF_DIM (nfid,'time_counter', & 1386 1393 & NF90_UNLIMITED,W_F(idf)%tid) 1387 !- 1388 ! 1.1 Define all the time axes needed for this file 1394 DO iv=1,W_F(idf)%n_var 1395 IF (W_F(idf)%W_V(iv)%l_bnd) THEN 1396 iret = NF90_DEF_DIM (nfid,'tbnds',2,W_F(idf)%bid) 1397 EXIT 1398 ENDIF 1399 ENDDO 1400 !- 1401 ! 1.2 Define all the time axes needed for this file 1389 1402 !- 1390 1403 DO itx=1,W_F(idf)%n_tax 1391 1404 dims(1) = W_F(idf)%tid 1405 l_b = (INDEX(W_F(idf)%W_V(itx)%tax_name,"t_op_") == 1) 1392 1406 IF (W_F(idf)%n_tax > 1) THEN 1393 1407 str30 = W_F(idf)%W_V(itx)%tax_name 1394 1408 ELSE 1395 1409 str30 = "time_counter" 1410 ENDIF 1411 IF (l_b) THEN 1412 str35 = TRIM(str30)//'_bnds' 1396 1413 ENDIF 1397 1414 iret = NF90_DEF_VAR (nfid,TRIM(str30),NF90_REAL8, & … … 1445 1462 iret = NF90_PUT_ATT (nfid,W_F(idf)%W_V(itx)%tdimid, & 1446 1463 & 'time_origin',TRIM(str70)) 1464 !--- 1465 IF (l_b) THEN 1466 iret = NF90_PUT_ATT (nfid,W_F(idf)%W_V(itx)%tdimid, & 1467 & 'bounds',TRIM(str35)) 1468 dims(1:2) = (/ W_F(idf)%bid,W_F(idf)%tid /) 1469 iret = NF90_DEF_VAR (nfid,TRIM(str35),NF90_REAL8, & 1470 & dims(1:2),W_F(idf)%W_V(itx)%tbndid) 1471 ENDIF 1447 1472 ENDDO 1448 1473 !- … … 1544 1569 IF (itax > 0) THEN 1545 1570 IF (W_F(idf)%n_tax > 1) THEN 1546 str30 = "t_"//W_F(idf)%W_V(itax)%tax_name1571 str30 = W_F(idf)%W_V(itax)%tax_name 1547 1572 ELSE 1548 1573 str30 = "time_counter" … … 1839 1864 !- 1840 1865 REAL :: rtime 1866 REAL,DIMENSION(2) :: t_bnd 1841 1867 CHARACTER(LEN=7) :: tmp_opp 1842 1868 REAL,ALLOCATABLE,DIMENSION(:),SAVE :: tbf_2 … … 2020 2046 IF ( (TRIM(tmp_opp) /= "inst") & 2021 2047 & .AND.(TRIM(tmp_opp) /= "once") ) THEN 2022 rtime = (rtime+W_F(idf)%W_V(iv)%last_wrt*W_F(idf)%deltat)/2.0 2048 t_bnd(1:2) = (/ W_F(idf)%W_V(iv)%last_wrt*W_F(idf)%deltat,rtime /) 2049 rtime = (t_bnd(1)+t_bnd(2))/2.0 2023 2050 ENDIF 2024 2051 !- … … 2037 2064 iret = NF90_PUT_VAR (nfid,W_F(idf)%W_V(itax)%tdimid, & 2038 2065 & (/ rtime /),start=(/ itime /),count=(/ 1 /)) 2066 IF (W_F(idf)%W_V(itax)%tbndid > 0) THEN 2067 iret = NF90_PUT_VAR (nfid,W_F(idf)%W_V(itax)%tbndid, & 2068 & t_bnd,start=(/ 1,itime /),count=(/ 2,1 /)) 2069 ENDIF 2039 2070 W_F(idf)%W_V(itax)%tax_last = itime 2040 2071 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.